Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/install.php
Show First 20 Lines • Show All 264 Lines • ▼ Show 20 Line(s) | |||||
// $this->SetFirstStep(); | // $this->SetFirstStep(); | ||||
} | } | ||||
} | } | ||||
switch ($this->currentStep) { | switch ($this->currentStep) { | ||||
case 'sys_requirements': | case 'sys_requirements': | ||||
$required_checks = Array ( | $required_checks = Array ( | ||||
'php_version', 'composer', 'curl', 'simplexml', 'freetype', 'gd_version', | 'php_version', 'composer', 'curl', 'simplexml', 'freetype', 'gd_version', | ||||
'jpeg', 'mysql', 'json', 'date.timezone', 'output_buffering', | 'jpeg', 'mysql', 'json', 'openssl', 'date.timezone', 'output_buffering', | ||||
); | ); | ||||
$check_results = $this->toolkit->CallPrerequisitesMethod('core/', 'CheckSystemRequirements'); | $check_results = $this->toolkit->CallPrerequisitesMethod('core/', 'CheckSystemRequirements'); | ||||
$required_checks = array_diff($required_checks, array_keys( array_filter($check_results) )); | $required_checks = array_diff($required_checks, array_keys( array_filter($check_results) )); | ||||
if ( $required_checks ) { | if ( $required_checks ) { | ||||
// php-based checks failed - show error | // php-based checks failed - show error | ||||
$this->errorMessage = '<br/>Installation can not continue until all required environment parameters are set correctly'; | $this->errorMessage = '<br/>Installation can not continue until all required environment parameters are set correctly'; | ||||
▲ Show 20 Lines • Show All 554 Lines • ▼ Show 20 Line(s) | |||||
$config_data = $this->GetVar('system_config'); | $config_data = $this->GetVar('system_config'); | ||||
foreach ($config_data as $section => $section_vars) { | foreach ($config_data as $section => $section_vars) { | ||||
foreach ($section_vars as $var_name => $var_value) { | foreach ($section_vars as $var_name => $var_value) { | ||||
$this->toolkit->systemConfig->set($var_name, $section, $var_value); | $this->toolkit->systemConfig->set($var_name, $section, $var_value); | ||||
} | } | ||||
} | } | ||||
if ( !$this->toolkit->systemConfig->get('SecurityHmacKey', 'Misc') | |||||
|| !$this->toolkit->systemConfig->get('SecurityEncryptionKey', 'Misc') | |||||
) { | |||||
$this->toolkit->systemConfig->set( | |||||
'SecurityHmacKey', | |||||
'Misc', | |||||
base64_encode(SecurityGenerator::generateString( | |||||
SecurityEncrypter::HASHING_KEY_LENGTH, | |||||
SecurityGenerator::CHAR_ALNUM | SecurityGenerator::CHAR_SYMBOLS | |||||
)) | |||||
); | |||||
$this->toolkit->systemConfig->set( | |||||
'SecurityEncryptionKey', | |||||
'Misc', | |||||
SecurityGenerator::generateBytes(SecurityEncrypter::ENCRYPTION_KEY_LENGTH) | |||||
); | |||||
} | |||||
$this->toolkit->systemConfig->save(); | $this->toolkit->systemConfig->save(); | ||||
break; | break; | ||||
case 'root_password': | case 'root_password': | ||||
// update root password in database | // update root password in database | ||||
/** @var kPasswordFormatter $password_formatter */ | /** @var kPasswordFormatter $password_formatter */ | ||||
$password_formatter = $this->Application->recallObject('kPasswordFormatter'); | $password_formatter = $this->Application->recallObject('kPasswordFormatter'); | ||||
▲ Show 20 Lines • Show All 919 Lines • Show Last 20 Lines |