function init() { if ( !isset( $this->PersistenceList['run_finetune'] ) ) $this->PersistenceList['run_finetune'] = false; if ( $this->PersistenceList['run_finetune'] ) { $criticalTests = eZSetupCriticalTests(); $optionalTests = eZSetupOptionalTests(); $testTable = eZSetupTestTable(); $runResult = eZSetupRunTests( $criticalTests, 'eZSetup:init:system_check', $this->PersistenceList ); $optionalRunResult = eZSetupRunTests( $optionalTests, 'eZSetup:init:system_check', $this->PersistenceList ); $this->Results = $runResult['results']; $this->Result = $runResult['result']; $this->OptionalResults = $optionalRunResult['results']; $this->OptionalResult = $optionalRunResult['result']; $persistenceData = $runResult['persistence_list']; $testsRun = array(); foreach ( $this->Results as $testResultItem ) { $testsRun[$testResultItem[1]] = $testResultItem[0]; } eZSetupMergePersistenceList( $this->PersistenceList, $persistenceData ); $this->PersistenceList['tests_run'] = $testsRun; $this->PersistenceList['optional_tests_run'] = $testsRun; return ( $this->OptionalResult == EZ_SETUP_TEST_SUCCESS ); } return true; }
/** * Executes checks for system requirements taken from setup wizard * @see eZStepSystemCheck::init */ static function checkSetupRequirements() { $criticalTests = eZSetupCriticalTests(); $optionalTests = eZSetupOptionalTests(); //$testTable = eZSetupTestTable(); // run all tests $list = null; $runResult = eZSetupRunTests($criticalTests, 'eZSetup:init:system_check', $list); $optionalRunResult = eZSetupRunTests($optionalTests, 'eZSetup:init:system_check', $list); // extract failed ones $warnings = array(); foreach (array($runResult['results'], $optionalRunResult['results']) as $tests) { foreach ($tests as $test) { if ($test[0] != 1) { $warnings[$test[1]] = $test[2]; } } } // remove failures we don't care about foreach ($warnings as $testName => $error) { switch ($testName) { // this test is useless: if we get here, at least 1 db connection is working (nb: is it really true? to be checked for anon uer...) case 'database_all_extensions': // this test should (imho) just be removed from the setup wizard // this test should (imho) just be removed from the setup wizard case 'accept_path_info': unset($warnings[$testName]); break; default: break; } } return $warnings; }
function init() { $optionalTests = eZSetupOptionalTests(); $testTable = eZSetupTestTable(); $optionalRunResult = eZSetupRunTests($optionalTests, 'eZSetup:init:system_check', $this->PersistenceList); $this->OptionalResults = $optionalRunResult['results']; $this->OptionalResult = $optionalRunResult['result']; $testsRun = array(); if (isset($this->Results) && is_array($this->Results)) { foreach ($this->Results as $testResultItem) { $testsRun[$testResultItem[1]] = $testResultItem[0]; } } $this->PersistenceList['tests_run'] = $testsRun; $this->PersistenceList['optional_tests_run'] = $testsRun; return false; // Always show welcome message }
function eZSetupCheckTestFunctions($type) { $testList = eZSetupConfigVariableArray($type, 'TestList'); $requireType = eZSetupConfigVariable($type, 'Require'); $dummy = null; $runResult = eZSetupRunTests($testList, 'eZSetupCheckTestFunctions', $dummy); $testResults = $runResult['results']; $testResult = $runResult['result']; $successCount = $runResult['success_count']; $persistenceData = $runResult['persistence_list']; $result = true; if ($requireType == 'one') { if ($successCount == 0) { $result = false; } } else { if ($successCount < count($extensionList)) { $result = false; } } return array('result' => $result, 'persistence_list' => $persistenceData, 'test_results' => $testResults); }
/** * @param \eZTemplate $mailTpl * @param array $userData * * @return array|null|string */ function generateRegistration( eZTemplate $mailTpl, array $userData ) { $databaseMap = eZSetupDatabaseMap(); $databaseInfo = $this->PersistenceList['database_info']; $databaseInfo['info'] = $databaseMap[$databaseInfo['type']]; $regionalInfo = $this->PersistenceList['regional_info']; if ( !isset( $regionalInfo['languages'] ) ) $regionalInfo['languages'] = array(); $emailInfo = $this->PersistenceList['email_info']; $siteType = $this->chosenSiteType(); $url = $siteType['url']; if ( !preg_match( "#^[a-zA-Z0-9]+://(.*)$#", $url ) ) { $url = 'http://' . $url; } $currentURL = $url; $adminURL = $url; if ( $siteType['access_type'] == 'url' ) { $url .= '/' . $siteType['access_type_value']; $adminURL .= '/' . $siteType['admin_access_type_value']; } else if ( $siteType['access_type'] == 'hostname' ) { $url = eZHTTPTool::createRedirectURL( 'http://' . $siteType['access_type_value'] ); $adminURL = eZHTTPTool::createRedirectURL( 'http://' . $siteType['admin_access_type_value'] ); } else if ( $siteType['access_type'] == 'port' ) { $url = eZHTTPTool::createRedirectURL( $currentURL, array( 'override_port' => $siteType['access_type_value'] ) ); $adminURL = eZHTTPTool::createRedirectURL( $currentURL, array( 'override_port' => $siteType['admin_access_type_value'] ) ); } $siteType['url'] = $url; $siteType['admin_url'] = $adminURL; $testsRun = $this->PersistenceList['tests_run']; $imageMagickProgram = $this->PersistenceList['imagemagick_program']; $imageGDExtension = $this->PersistenceList['imagegd_extension']; $phpVersion = $this->PersistenceList['phpversion']; $phpVersion['sapi'] = PHP_SAPI; $webserverInfo = false; if ( function_exists( 'apache_get_version' ) ) { $webserverInfo = array( 'version' => apache_get_version() ); } else if ( !empty( $_SERVER['SERVER_SOFTWARE'] ) ) { $webserverInfo = array( 'version' => $_SERVER['SERVER_SOFTWARE'] ); } $systemInfo = new eZSysInfo(); $systemInfo->scan(); $optionalTests = eZSetupOptionalTests(); $runResult = eZSetupRunTests( $optionalTests, 'eZSetup:init:send_registration', $this->PersistenceList ); $testResults = $runResult['results']; // Generate email body e-mail $mailTpl->setVariable( 'user_data', $userData ); $mailTpl->setVariable( 'database_info', $databaseInfo ); $mailTpl->setVariable( 'regional_info', $regionalInfo ); $mailTpl->setVariable( 'email_info', $emailInfo ); $mailTpl->setVariable( 'site_type', $siteType ); $mailTpl->setVariable( 'tests_run', $testsRun ); $mailTpl->setVariable( 'imagemagick_program', $imageMagickProgram ); $mailTpl->setVariable( 'imagegd_extension', $imageGDExtension ); $mailTpl->setVariable( 'phpversion', $phpVersion ); $mailTpl->setVariable( 'webserver', $webserverInfo ); $mailTpl->setVariable( 'system', $systemInfo ); $mailTpl->setVariable( 'os', array( 'name' => php_uname() ) ); $mailTpl->setVariable( 'optional_tests', $testResults ); $mailTpl->setVariable( "version", array( "text" => eZPublishSDK::version(), "major" => eZPublishSDK::majorVersion(), "minor" => eZPublishSDK::minorVersion(), "release" => eZPublishSDK::release() ) ); return $mailTpl->fetch( 'design:setup/registration_email.tpl' ); }
function generateRegistration($mailTpl, $comments) { $databaseMap = eZSetupDatabaseMap(); $databaseInfo = $this->PersistenceList['database_info']; $databaseInfo['info'] = $databaseMap[$databaseInfo['type']]; $regionalInfo = $this->PersistenceList['regional_info']; if (!isset($regionalInfo['languages'])) { $regionalInfo['languages'] = array(); } // $demoData = $this->PersistenceList['demo_data']; $emailInfo = $this->PersistenceList['email_info']; $siteTemplates = array(); $siteType = $this->chosenSiteType(); /* $typeFunctionality = eZSetupFunctionality( $siteType['identifier'] ); $additionalPackages = array(); if ( isset( $this->PersistenceList['additional_packages'] ) ) $additionalPackages = $this->PersistenceList['additional_packages']; $extraFunctionality = array_merge( $additionalPackages, $typeFunctionality['required'] ); $extraFunctionality = array_unique( $extraFunctionality );*/ $url = $siteType['url']; if (!preg_match("#^[a-zA-Z0-9]+://(.*)\$#", $url)) { $url = 'http://' . $url; } $currentURL = $url; $adminURL = $url; if ($siteType['access_type'] == 'url') { $url .= '/' . $siteType['access_type_value']; $adminURL .= '/' . $siteType['admin_access_type_value']; } else { if ($siteType['access_type'] == 'hostname') { $url = eZHTTPTool::createRedirectURL('http://' . $siteType['access_type_value']); $adminURL = eZHTTPTool::createRedirectURL('http://' . $siteType['admin_access_type_value']); } else { if ($siteType['access_type'] == 'port') { $url = eZHTTPTool::createRedirectURL($currentURL, array('override_port' => $siteType['access_type_value'])); $adminURL = eZHTTPTool::createRedirectURL($currentURL, array('override_port' => $siteType['admin_access_type_value'])); } } } $siteType['url'] = $url; $siteType['admin_url'] = $adminURL; //$siteType['extra_functionality'] = $extraFunctionality; $testsRun = $this->PersistenceList['tests_run']; $imageMagickProgram = $this->PersistenceList['imagemagick_program']; $imageGDExtension = $this->PersistenceList['imagegd_extension']; $phpVersion = $this->PersistenceList['phpversion']; $webserverInfo = false; if (function_exists('apache_get_version')) { $webserverInfo = array('version' => apache_get_version()); } $systemInfo = new eZSysInfo(); $systemInfo->scan(); $optionalTests = eZSetupOptionalTests(); $testTable = eZSetupTestTable(); $runResult = eZSetupRunTests($optionalTests, 'eZSetup:init:send_registration', $this->PersistenceList); $testResults = $runResult['results']; $testResult = $runResult['result']; $successCount = $runResult['success_count']; $persistenceData = $runResult['persistence_list']; // Send e-mail $mailTpl->setVariable('comments', $comments); $mailTpl->setVariable('database_info', $databaseInfo); $mailTpl->setVariable('regional_info', $regionalInfo); // $mailTpl->setVariable( 'demo_data', $demoData ); $mailTpl->setVariable('email_info', $emailInfo); $mailTpl->setVariable('site_type', $siteType); $mailTpl->setVariable('tests_run', $testsRun); $mailTpl->setVariable('imagemagick_program', $imageMagickProgram); $mailTpl->setVariable('imagegd_extension', $imageGDExtension); $mailTpl->setVariable('phpversion', $phpVersion); $mailTpl->setVariable('webserver', $webserverInfo); $mailTpl->setVariable('system', $systemInfo); $mailTpl->setVariable('os', array('name' => php_uname())); $mailTpl->setVariable('optional_tests', $testResults); $mailTpl->setVariable("version", array("text" => eZPublishSDK::version(), "major" => eZPublishSDK::majorVersion(), "minor" => eZPublishSDK::minorVersion(), "release" => eZPublishSDK::release())); return $mailTpl->fetch('design:setup/registration_email.tpl'); }