/**
  * get all tests
  *
  * @return array of test results
  */
 public function getTestResult()
 {
     $tests_errors = array('phpversion' => $this->l('Update your PHP version.'), 'upload' => $this->l('Configure your server to allow file uploads.'), 'system' => $this->l('Configure your server to allow the creation of directories and files with write permissions.'), 'gd' => $this->l('Enable the GD library on your server.'), 'mysql_support' => $this->l('Enable the MySQL support on your server.'), 'config_dir' => $this->l('Set write permissions for the "config" folder.'), 'cache_dir' => $this->l('Set write permissions for the "cache" folder.'), 'sitemap' => $this->l('Set write permissions for the "sitemap.xml" file.'), 'img_dir' => $this->l('Set write permissions for the "img" folder and subfolders.'), 'log_dir' => $this->l('Set write permissions for the "log" folder and subfolders.'), 'mails_dir' => $this->l('Set write permissions for the "mails" folder and subfolders.'), 'module_dir' => $this->l('Set write permissions for the "modules" folder and subfolders.'), 'theme_lang_dir' => sprintf($this->l('Set the write permissions for the "themes%s/lang/" folder and subfolders, recursively.'), _THEME_NAME_), 'translations_dir' => $this->l('Set write permissions for the "translations" folder and subfolders.'), 'customizable_products_dir' => $this->l('Set write permissions for the "upload" folder and subfolders.'), 'virtual_products_dir' => $this->l('Set write permissions for the "download" folder and subfolders.'), 'fopen' => $this->l('Allow the PHP fopen() function on your server.'), 'register_globals' => $this->l('Set PHP "register_globals" option to "Off".'), 'gz' => $this->l('Enable GZIP compression on your server.'), 'files' => $this->l('All files from PrestaShop are not present on your server.'));
     // Functions list to test with 'test_system'
     // Test to execute (function/args): lets uses the default test
     $params_required_results = ConfigurationTest::check(ConfigurationTest::getDefaultTests());
     if (!defined('_PS_HOST_MODE_')) {
         $params_optional_results = ConfigurationTest::check(ConfigurationTest::getDefaultTestsOp());
     }
     $failRequired = in_array('fail', $params_required_results);
     if ($failRequired && $params_required_results['files'] != 'ok') {
         $tmp = ConfigurationTest::test_files_(false);
         if (is_array($tmp) && count($tmp)) {
             $tests_errors['files'] = $tests_errors['files'] . '<br/>(' . implode(', ', $tmp) . ')';
         }
     }
     $results = array('failRequired' => $failRequired, 'testsErrors' => $tests_errors, 'testsRequired' => $params_required_results);
     if (!defined('_PS_HOST_MODE_')) {
         $results = array_merge($results, array('failOptional' => in_array('fail', $params_optional_results), 'testsOptional' => $params_optional_results));
     }
     return $results;
 }
示例#2
0
 public static function test_files()
 {
     $return = ConfigurationTest::test_files_();
     return empty($return);
 }