Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -64,7 +64,7 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
\IPS\Dispatcher::i()->checkAcpPermission( 'upgrade_manage', 'core', 'overview' );
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('ips_suite_upgrade');
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::external( "https://ipbmafia.ru/files/file/2342-invision-community-nulled/" ) );
|
||||
\IPS\Output::i()->redirect( \IPS\Http\Url::external( "https://nullcave.club/resources/invision-community.979/" ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,36 +160,39 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
if ( $values )
|
||||
{
|
||||
/* Check requirements */
|
||||
try
|
||||
if( !\IPS\CIC )
|
||||
{
|
||||
$requirements = \IPS\Http\Url::ips('requirements')->setQueryString( 'version', $values['version'] )->request()->get()->decodeJson();
|
||||
$phpVersion = PHP_VERSION;
|
||||
$mysqlVersion = \IPS\Db::i()->server_info;
|
||||
if ( !( version_compare( $phpVersion, $requirements['php']['required'] ) >= 0 ) )
|
||||
try
|
||||
{
|
||||
if ( $requirements['php']['required'] == $requirements['php']['recommended'] )
|
||||
$requirements = \IPS\Http\Url::ips('requirements')->setQueryString( 'version', $values['version'] )->request()->get()->decodeJson();
|
||||
$phpVersion = PHP_VERSION;
|
||||
$mysqlVersion = \IPS\Db::i()->server_info;
|
||||
if ( !( version_compare( $phpVersion, $requirements['php']['required'] ) >= 0 ) )
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail_no_recommended', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'] ) ) );
|
||||
if ( $requirements['php']['required'] == $requirements['php']['recommended'] )
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail_no_recommended', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'] ) ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'], $requirements['php']['recommended'] ) ) );
|
||||
}
|
||||
\IPS\Output::i()->error( $message, '1C287/2' );
|
||||
}
|
||||
else
|
||||
if ( !( version_compare( $mysqlVersion, $requirements['mysql']['required'] ) >= 0 ) )
|
||||
{
|
||||
$message = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'], $requirements['php']['recommended'] ) ) );
|
||||
\IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_version_fail', FALSE, array( 'sprintf' => array( $mysqlVersion, $requirements['mysql']['required'], $requirements['mysql']['recommended'] ) ) ), '1C287/3', 403, '' );
|
||||
}
|
||||
\IPS\Output::i()->error( $message, '1C287/2' );
|
||||
}
|
||||
if ( !( version_compare( $mysqlVersion, $requirements['mysql']['required'] ) >= 0 ) )
|
||||
{
|
||||
\IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_version_fail', FALSE, array( 'sprintf' => array( $mysqlVersion, $requirements['mysql']['required'], $requirements['mysql']['recommended'] ) ) ), '1C287/3', 403, '' );
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
}
|
||||
catch ( \Exception $e ) {}
|
||||
|
||||
/* Do a database check */
|
||||
if( !\IPS\IPS_ALPHA_BUILD )
|
||||
{
|
||||
$md5CheckVersion = NULL;
|
||||
/* If the files on disk are already newer, set version for MD5 check (i.e. if the files were already applied, but the upgrade hasn't happened) */
|
||||
if( (int) \IPS\Application::getAvailableVersion('core') > \IPS\Application::load('core')->long_version )
|
||||
if( (int) \IPS\Application::getAvailableVersion('core') > \IPS\Application::load('core')->long_version AND \IPS\Application::load('core')->version != \IPS\Application::getAvailableVersion( 'core', TRUE ) )
|
||||
{
|
||||
$md5CheckVersion = (int) \IPS\Application::getAvailableVersion('core');
|
||||
}
|
||||
@@ -226,7 +229,99 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Check Resources for new versions */
|
||||
if ( !isset( \IPS\Request::i()->skip_resource_check ) )
|
||||
{
|
||||
/* Check apps and plugins */
|
||||
$row = \IPS\Db::i()->union(
|
||||
array(
|
||||
\IPS\Db::i()->select( "'applications' AS `table`, app_directory AS `id`, app_version AS `current`, app_long_version AS `long`, app_marketplace_id as `marketplace_id`", 'core_applications', [ \IPS\Db::i()->in( 'app_directory', \IPS\IPS::$ipsApps, TRUE ) ] ),
|
||||
\IPS\Db::i()->select( "'plugins' AS `table`, plugin_id AS id, plugin_version_human AS `current`, plugin_version_long AS `long`, plugin_marketplace_id as `marketplace_id`", 'core_plugins' ),
|
||||
\IPS\Db::i()->select( "'themes' AS `table`, set_id AS `id`, set_version AS `current`, set_long_version AS `long`, set_marketplace_id as `marketplace_id`", 'core_themes', [ 'set_customized=?', 1 ] ),
|
||||
\IPS\Db::i()->select( "'languages' AS `table`, lang_id AS `id`, `lang_version` AS `current`, `lang_version_long` AS `long`, `lang_marketplace_id` as `marketplace_id`", "core_sys_lang" )
|
||||
),
|
||||
NULL,
|
||||
200
|
||||
);
|
||||
|
||||
$marketplaceCheck = [];
|
||||
$output = [ 'updates' => [], 'noupdate' => [], 'compatible' => [], 'custom' => [] ];
|
||||
foreach ( $row as $r )
|
||||
{
|
||||
/* Load title */
|
||||
try
|
||||
{
|
||||
switch( $r['table'] )
|
||||
{
|
||||
case 'applications':
|
||||
$r['title'] = \IPS\Application::load( $r['id'] )->_title;
|
||||
break;
|
||||
case 'plugins':
|
||||
$r['title'] = \IPS\Plugin::load( $r['id'] )->_title;
|
||||
break;
|
||||
case 'themes':
|
||||
$r['title'] = \IPS\Theme::load( $r['id'] )->_title;
|
||||
break;
|
||||
case 'languages':
|
||||
\IPS\Db::i()->select( 'word_id', 'core_sys_lang_words', array( 'lang_id=? AND word_export=1 AND word_custom IS NOT NULL', $r['id'], 1 ) )->first();
|
||||
$r['title'] = \IPS\Lang::load( $r['id'] )->_title;
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch( \RuntimeException | \OutOfRangeException $e )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$output[ ( $r['marketplace_id'] ? 'updates' : 'custom' )][ $r['table'] . $r['id'] ] = $r;
|
||||
if ( $r['marketplace_id'] )
|
||||
{
|
||||
$marketplaceCheck[] = $r;
|
||||
}
|
||||
}
|
||||
|
||||
/* Actually Check */
|
||||
if( \count( $marketplaceCheck ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
$marketplaceController = new \IPS\core\modules\admin\marketplace\marketplace;
|
||||
$response = $marketplaceController->_updateCheck( array_column( $marketplaceCheck, 'long', 'marketplace_id' ), (int) $values['version'] );
|
||||
|
||||
foreach ( $marketplaceCheck as $mp )
|
||||
{
|
||||
if( !empty( $response[ $mp['marketplace_id'] ] ) )
|
||||
{
|
||||
$mp['update'] = $response[ $mp['marketplace_id'] ];
|
||||
|
||||
if( $response[ $mp['marketplace_id'] ]['longversion'] == $mp['long'] )
|
||||
{
|
||||
$output['compatible'][ $mp['table'] . $mp['id'] ] = $mp;
|
||||
unset( $output['updates'][ $mp['table'] . $mp['id'] ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
$output['updates'][ $mp['table'] . $mp['id'] ] = $mp;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
unset( $output['updates'][ $mp['table'] . $mp['id'] ] );
|
||||
$output['noupdate'][ $mp['table'] . $mp['id'] ] = $mp;
|
||||
}
|
||||
}
|
||||
catch( \RuntimeException | \UnexpectedValueException $e )
|
||||
{
|
||||
$output['nocheck'] = $marketplaceCheck;
|
||||
$output['updates'] = [];
|
||||
}
|
||||
}
|
||||
|
||||
return \IPS\Theme::i()->getTemplate('system')->upgradeDeltaResourceIssues( $values['version'], $output );
|
||||
}
|
||||
|
||||
/* Get details */
|
||||
$data = array( 'version' => $values['version'], 'oldVersion' => \IPS\Application::load('core')->long_version, 'changes' => array() );
|
||||
$data['info'] = $this->_changeDetails( $data['oldVersion'], $values['version'] );
|
||||
@@ -409,6 +504,9 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/* Deliberately no try/catch because if it does fail, the site will never know and it will always be an issue cloud-side. */
|
||||
\IPS\IPS::applyLatestFilesIPSCloud();
|
||||
|
||||
/* Log who started the upgrade */
|
||||
\IPS\Session::i()->log( 'acplog__upgrade_started' );
|
||||
|
||||
if ( isset( \IPS\Request::i()->check ) )
|
||||
{
|
||||
@@ -994,6 +1092,8 @@ class _upgrade extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
unset( \IPS\Data\Store::i()->applications, \IPS\Data\Store::i()->updatecount_applications );
|
||||
|
||||
\IPS\core\extensions\core\CommunityEnhancements\Zapier::rebuildRESTApiPermissions();
|
||||
|
||||
\IPS\core\AdminNotification::remove( 'core', 'NewVersion' );
|
||||
|
||||
return array( \IPS\Theme::i()->getTemplate('system')->upgradeFinished( $databaseErrors ) );
|
||||
|
||||
Reference in new issue
Block a user