Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Installer
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @since 3 Apr 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -31,10 +31,11 @@ class _Install
|
||||
public static function systemRequirements()
|
||||
{
|
||||
$return = array();
|
||||
|
||||
|
||||
/* PHP Version */
|
||||
$phpVersion = PHP_VERSION;
|
||||
if ( version_compare( $phpVersion, '5.3.0' ) >= 0 )
|
||||
$requirements = json_decode( file_get_contents( \IPS\ROOT_PATH . '/applications/core/data/requirements.json' ), TRUE );
|
||||
if ( version_compare( $phpVersion, $requirements['php']['required'] ) >= 0 )
|
||||
{
|
||||
$return['requirements']['PHP']['version'] = array(
|
||||
'success' => TRUE,
|
||||
@@ -45,13 +46,13 @@ class _Install
|
||||
{
|
||||
$return['requirements']['PHP']['version'] = array(
|
||||
'success' => FALSE,
|
||||
'message' => \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail', FALSE, array( 'sprintf' => array( $phpVersion ) ) ),
|
||||
'message' => ( $requirements['php']['required'] == $requirements['php']['recommended'] ) ? \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail_no_recommended', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'] ) ) ) : \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_fail', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['required'], $requirements['php']['recommended'] ) ) ),
|
||||
);
|
||||
}
|
||||
if ( version_compare( $phpVersion, '5.4.0' ) == -1 )
|
||||
if ( $return['requirements']['PHP']['version']['success'] and version_compare( $phpVersion, $requirements['php']['recommended'] ) == -1 )
|
||||
{
|
||||
$return['requirements']['PHP']['version']['message'] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_success_53x', FALSE, array( 'sprintf' => array( $phpVersion ) ) );
|
||||
$return['advice']['php'] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_advice', FALSE, array( 'sprintf' => array( $phpVersion ) ) );
|
||||
$return['requirements']['PHP']['version']['message'] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_success', FALSE, array( 'sprintf' => array( $phpVersion ) ) );
|
||||
$return['advice']['php'] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_php_version_advice', FALSE, array( 'sprintf' => array( $phpVersion, $requirements['php']['recommended'] ) ) );
|
||||
}
|
||||
|
||||
/* cURL or allow_url_fopen */
|
||||
@@ -96,6 +97,14 @@ class _Install
|
||||
'message' => \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mb_regex' ),
|
||||
);
|
||||
}
|
||||
|
||||
if( ini_get('mbstring.func_overload') AND ini_get('mbstring.func_overload') > 0 )
|
||||
{
|
||||
$return['requirements']['PHP'][] = array(
|
||||
'success' => FALSE,
|
||||
'message' => \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mb_overload' ),
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -109,7 +118,7 @@ class _Install
|
||||
/* Extensions */
|
||||
foreach ( array(
|
||||
'required' => array( 'dom', 'gd', 'mysqli', 'openssl', 'session', 'simplexml', 'xml', 'xmlreader', 'xmlwriter' ),
|
||||
'advised' => array( 'phar', 'zip' ),
|
||||
'advised' => array( 'phar', 'zip', 'exif' ),
|
||||
) as $type => $extensions )
|
||||
{
|
||||
foreach ( $extensions as $extension )
|
||||
@@ -130,7 +139,14 @@ class _Install
|
||||
}
|
||||
elseif ( $type === 'advised' )
|
||||
{
|
||||
$return['advice'][] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_extension_advice', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( "requirements_extension_{$extension}" ) ) ) );
|
||||
if( \IPS\Member::loggedIn()->language()->checkKeyExists( 'requirements_extension_advice_' . $extension ) )
|
||||
{
|
||||
$return['advice'][] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_extension_advice_' . $extension );
|
||||
}
|
||||
else
|
||||
{
|
||||
$return['advice'][] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_extension_advice', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( "requirements_extension_{$extension}" ) ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,12 +201,18 @@ class _Install
|
||||
'suhosin.request.max_varname_length' => 350,
|
||||
) as $setting => $minimum )
|
||||
{
|
||||
$value = ini_get( 'suhosin.post.max_vars' );
|
||||
$value = ini_get( $setting );
|
||||
if ( $value and $value < $minimum )
|
||||
{
|
||||
$return['advisory'][] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_suhosin_limit', FALSE, array( 'sprintf' => array( $setting, $value, $minimum ) ) );
|
||||
$return['advice'][] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_suhosin_limit', FALSE, array( 'sprintf' => array( $setting, $value, $minimum ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
$value = ini_get('suhosin.cookie.encrypt');
|
||||
if ( $value and $value == 1 )
|
||||
{
|
||||
$return['advice'][] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_suhosin_cookie_encrypt' );
|
||||
}
|
||||
}
|
||||
|
||||
/* Writeables */
|
||||
@@ -204,15 +226,17 @@ class _Install
|
||||
'message' => $success ? \IPS\Member::loggedIn()->language()->addToStack( 'requirements_file_writable', FALSE, array( 'sprintf' => array( \IPS\ROOT_PATH . '/' . $dir ) ) ) : \IPS\Member::loggedIn()->language()->addToStack( 'err_not_writable', FALSE, array( 'sprintf' => array( \IPS\ROOT_PATH . '/' . $dir ) ) )
|
||||
);
|
||||
}
|
||||
$logMethods = \IPS\Log::getUsedMethods();
|
||||
if( isset( $logMethods['disk'] ) and !empty( $logMethods['disk'] ) )
|
||||
if( !\IPS\NO_WRITES )
|
||||
{
|
||||
$dir = \IPS\Log::i( 'Disk' )->logDir;
|
||||
$success = is_writable( $dir );
|
||||
$return['requirements'][ $writeablesKey ][ $dir ] = array(
|
||||
'success' => $success,
|
||||
'message' => $success ? \IPS\Member::loggedIn()->language()->addToStack( 'requirements_file_writable', FALSE, array( 'sprintf' => array( $dir ) ) ) : \IPS\Member::loggedIn()->language()->addToStack( 'err_not_writable', FALSE, array( 'sprintf' => array( $dir ) ) )
|
||||
);
|
||||
$dir = \IPS\Log::fallbackDir();
|
||||
if ( $dir !== NULL )
|
||||
{
|
||||
$success = is_writable( $dir );
|
||||
$return['requirements'][ $writeablesKey ][ $dir ] = array(
|
||||
'success' => $success,
|
||||
'message' => $success ? \IPS\Member::loggedIn()->language()->addToStack( 'requirements_file_writable', FALSE, array( 'sprintf' => array( $dir ) ) ) : \IPS\Member::loggedIn()->language()->addToStack( 'err_not_writable', FALSE, array( 'sprintf' => array( $dir ) ) )
|
||||
);
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
@@ -225,6 +249,8 @@ class _Install
|
||||
{
|
||||
throw new \Exception;
|
||||
}
|
||||
|
||||
@unlink( $tempFile );
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
@@ -255,19 +281,20 @@ class _Install
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $apps Application keys of apps to install
|
||||
* @param string $defaultApp The default applicaion
|
||||
* @param string $baseUrl Base URL
|
||||
* @param array $path Base Path
|
||||
* @param array $db Database connection detials [see \IPS\Db::i()]
|
||||
* @param string $adminName Admin Username
|
||||
* @param string $adminPass Admin Password
|
||||
* @param string $adminEmail Admin Email
|
||||
* @param array $apps Application keys of apps to install
|
||||
* @param string $defaultApp The default applicaion
|
||||
* @param string $baseUrl Base URL
|
||||
* @param array $path Base Path
|
||||
* @param array $db Database connection detials [see \IPS\Db::i()]
|
||||
* @param string $adminName Admin Username
|
||||
* @param string $adminPass Admin Password
|
||||
* @param string $adminEmail Admin Email
|
||||
* @param bool $diagnostics Enable diagnostics reporting?
|
||||
* @return void
|
||||
* @throws \InvalidArgumentException
|
||||
* @see \IPS\Db::i()
|
||||
*/
|
||||
public function __construct( $apps, $defaultApp, $baseUrl, $path, $db, $adminName, $adminPass, $adminEmail )
|
||||
public function __construct( $apps, $defaultApp, $baseUrl, $path, $db, $adminName, $adminPass, $adminEmail, $diagnostics=TRUE )
|
||||
{
|
||||
/* Have core app? */
|
||||
if ( !in_array( 'core', $apps ) )
|
||||
@@ -305,6 +332,7 @@ class _Install
|
||||
$this->adminName = $adminName;
|
||||
$this->adminPass = $adminPass;
|
||||
$this->adminEmail = $adminEmail;
|
||||
$this->diagnostics = $diagnostics;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,7 +344,7 @@ class _Install
|
||||
public function process( $data )
|
||||
{
|
||||
/* Start */
|
||||
if ( $data === 0 )
|
||||
if ( ! $data )
|
||||
{
|
||||
return array( array( 1 ), \IPS\Member::loggedIn()->language()->addToStack('installing') );
|
||||
}
|
||||
@@ -597,7 +625,7 @@ class _Install
|
||||
}
|
||||
|
||||
/* Set up File Storage methods */
|
||||
\IPS\Application::load( $app )->installExtensions();
|
||||
\IPS\Application::load( $app )->installExtensions( TRUE );
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -614,6 +642,7 @@ class _Install
|
||||
$member->name = $this->adminName;
|
||||
$member->email = $this->adminEmail;
|
||||
$member->ip_address = \IPS\Request::i()->ipAddress();
|
||||
$member->timezone = 'UTC';
|
||||
$member->member_group_id = 4;
|
||||
$member->allow_admin_mails = 0;
|
||||
$member->joined = time();
|
||||
@@ -625,6 +654,7 @@ class _Install
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $this->adminEmail ), "conf_key = 'email_out'" );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $this->adminEmail ), "conf_key = 'email_in'" );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $this->adminEmail ), "conf_key = 'upgrade_email'" );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => $this->diagnostics ), "conf_key = 'diagnostics_reporting'" );
|
||||
|
||||
unset( \IPS\Data\Store::i()->settings );
|
||||
|
||||
@@ -643,10 +673,6 @@ class _Install
|
||||
{
|
||||
\IPS\Application::load( $app )->installTasks();
|
||||
|
||||
if( $app == 'core' )
|
||||
{
|
||||
\IPS\core\BulkMail\Bulkmailer::updateTask( 0 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -678,6 +704,17 @@ class _Install
|
||||
'lang_id' => 1,
|
||||
'lang_short' => $locale,
|
||||
'lang_title' => "English (USA)",
|
||||
'lang_default' => 0,
|
||||
'lang_isrtl' => 0,
|
||||
'lang_protected' => 1,
|
||||
'lang_order' => 2
|
||||
)
|
||||
);
|
||||
|
||||
\IPS\Db::i()->insert( 'core_sys_lang', array(
|
||||
'lang_id' => 2,
|
||||
'lang_short' => 'ru_RU',
|
||||
'lang_title' => "Русский (RU)",
|
||||
'lang_default' => 1,
|
||||
'lang_isrtl' => 0,
|
||||
'lang_protected' => 1,
|
||||
@@ -779,9 +816,24 @@ class _Install
|
||||
*/
|
||||
protected function step10( $data )
|
||||
{
|
||||
return $this->appLoop( $data, function( $app )
|
||||
return $this->appLoop( $data, function( $app ) use( $data )
|
||||
{
|
||||
\IPS\Application::load( $app )->installJavascript();
|
||||
if ( !isset( $data[2] ) )
|
||||
{
|
||||
$data[2] = 0;
|
||||
}
|
||||
|
||||
$inserted = \IPS\Application::load( $app )->installJavascript( $data[2], 250 );
|
||||
|
||||
if ( $inserted )
|
||||
{
|
||||
$data[2] += $inserted;
|
||||
return $data;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@@ -828,11 +880,7 @@ class _Install
|
||||
}
|
||||
catch( \Exception $e )
|
||||
{
|
||||
try
|
||||
{
|
||||
\IPS\Log::i( LOG_ERR )->write( $e, 'install_error' );
|
||||
}
|
||||
catch( \RuntimeException $e ){}
|
||||
\IPS\Log::log( $e, 'install_error' );
|
||||
}
|
||||
|
||||
/* Insert default emoticons */
|
||||
|
||||
Reference in new issue
Block a user