Beispiel #1
0
 /**
  * Display system step
  */
 public function display()
 {
     if (!isset($this->tests['required'])) {
         $this->tests['required'] = $this->model_system->checkRequiredTests();
     }
     if (!isset($this->tests['optional'])) {
         $this->tests['optional'] = $this->model_system->checkOptionalTests();
     }
     if (!is_callable('getenv') || !($user = @getenv('APACHE_RUN_USER'))) {
         $user = '******';
     }
     // Generate display array
     $this->tests_render = array('required' => array(array('title' => $this->l('Required PHP parameters'), 'success' => 1, 'checks' => array('phpversion' => $this->l('PHP 5.1.2 or later is not enabled'), 'upload' => $this->l('Cannot upload files'), 'system' => $this->l('Cannot create new files and folders'), 'gd' => $this->l('GD library is not installed'), 'mysql_support' => $this->l('MySQL support is not activated'))), array('title' => $this->l('Files'), 'success' => 1, 'checks' => array('files' => $this->l('Not all files were successfully uploaded on your server'))), array('title' => $this->l('Permissions on files and folders'), 'success' => 1, 'checks' => array('config_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/config/'), 'cache_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/cache/'), 'log_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/log/'), 'img_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/img/'), 'mails_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/mails/'), 'module_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/modules/'), 'theme_lang_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/themes/default-bootstrap/lang/'), 'theme_pdf_lang_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/themes/default-bootstrap/pdf/lang/'), 'theme_cache_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/themes/default-bootstrap/cache/'), 'translations_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/translations/'), 'customizable_products_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/upload/'), 'virtual_products_dir' => $this->l('Recursive write permissions for %1$s user on %2$s', $user, '~/download/')))), 'optional' => array(array('title' => $this->l('Recommended PHP parameters'), 'success' => $this->tests['optional']['success'], 'checks' => array('new_phpversion' => sprintf($this->l('You are using PHP %s version. Soon, the latest PHP version supported by PrestaShop will be PHP 5.4. To make sure you’re ready for the future, we recommend you to upgrade to PHP 5.4 now!'), phpversion()), 'fopen' => $this->l('Cannot open external URLs'), 'register_globals' => $this->l('PHP register_globals option is enabled'), 'gz' => $this->l('GZIP compression is not activated'), 'mcrypt' => $this->l('Mcrypt extension is not enabled'), 'mbstring' => $this->l('Mbstring extension is not enabled'), 'magicquotes' => $this->l('PHP magic quotes option is enabled'), 'dom' => $this->l('Dom extension is not loaded'), 'pdo_mysql' => $this->l('PDO MySQL extension is not loaded')))));
     foreach ($this->tests_render['required'] as &$category) {
         foreach ($category['checks'] as $id => $check) {
             if ($this->tests['required']['checks'][$id] != 'ok') {
                 $category['success'] = 0;
             }
         }
     }
     // If required tests failed, disable next button
     if (!$this->tests['required']['success']) {
         $this->next_button = false;
     }
     $this->displayTemplate('system');
 }
Beispiel #2
0
 /**
  * Display system step
  */
 public function display()
 {
     if (!isset($this->tests['required'])) {
         $this->tests['required'] = $this->model_system->checkRequiredTests();
     }
     if (!isset($this->tests['optional'])) {
         $this->tests['optional'] = $this->model_system->checkOptionalTests();
     }
     // Generate display array
     $this->tests_render = array('required' => array(array('title' => $this->l('PHP parameters:'), 'checks' => array('phpversion' => $this->l('Is PHP 5.1.2 or later installed ?'), 'upload' => $this->l('Can upload files ?'), 'system' => $this->l('Can create new files and folders ?'), 'gd' => $this->l('Is GD Library installed ?'), 'mysql_support' => $this->l('Is MySQL support is on ?'))), array('title' => $this->l('Recursive write permissions on files and folders:'), 'checks' => array('config_dir' => '~/config/', 'cache_dir' => '~/cache/', 'log_dir' => '~/log/', 'img_dir' => '~/img/', 'mails_dir' => '~/mails/', 'module_dir' => '~/modules/', 'theme_lang_dir' => '~/themes/default/lang/', 'theme_pdf_lang_dir' => '~/themes/default/pdf/lang/', 'theme_cache_dir' => '~/themes/default/cache/', 'translations_dir' => '~/translations/', 'customizable_products_dir' => '~/upload/', 'virtual_products_dir' => '~/download/', 'sitemap' => '~/sitemap.xml'))), 'optional' => array(array('title' => $this->l('PHP parameters:'), 'checks' => array('fopen' => $this->l('Can open external URLs ?'), 'register_globals' => $this->l('Is PHP register global option off (recommended) ?'), 'gz' => $this->l('Is GZIP compression activated (recommended) ?'), 'mcrypt' => $this->l('Is Mcrypt extension available (recommended) ?'), 'magicquotes' => $this->l('Is PHP magic quotes option deactivated (recommended) ?'), 'dom' => $this->l('Is Dom extension loaded ?'), 'pdo_mysql' => $this->l('Is PDO MySQL extension loaded ?')))));
     // If required tests failed, disable next button
     if (!$this->tests['required']['success']) {
         $this->next_button = false;
     }
     $this->displayTemplate('system');
 }
Beispiel #3
0
 /**
  * Display system step
  */
 public function display()
 {
     if (!isset($this->tests['required'])) {
         $this->tests['required'] = $this->model_system->checkRequiredTests();
     }
     if (!isset($this->tests['optional'])) {
         $this->tests['optional'] = $this->model_system->checkOptionalTests();
     }
     $testsRequiredsf2 = $this->model_system->checkSf2Requirements();
     $testsOptionalsf2 = $this->model_system->checkSf2Recommendations();
     if (!is_callable('getenv') || !($user = @getenv('APACHE_RUN_USER'))) {
         $user = '******';
     }
     // Generate display array
     $this->tests_render = array('required' => array(array('title' => $this->translator->trans('Required PHP parameters', array(), 'Install'), 'success' => 1, 'checks' => array('phpversion' => $this->translator->trans('PHP 5.4 or later is not enabled', array(), 'Install'), 'upload' => $this->translator->trans('Cannot upload files', array(), 'Install'), 'system' => $this->translator->trans('Cannot create new files and folders', array(), 'Install'), 'gd' => $this->translator->trans('GD library is not installed', array(), 'Install'), 'pdo_mysql' => $this->translator->trans('PDO MySQL extension is not loaded', array(), 'Install'), 'zip' => $this->translator->trans('ZIP extension is not enabled', array(), 'Install'))), array('title' => $this->translator->trans('Required Apache configuration', array(), 'Install'), 'success' => 1, 'checks' => array('apache_mod_rewrite' => $this->translator->trans('Enable the Apache mod_rewrite module', array(), 'Install'))), array('title' => $this->translator->trans('Files', array(), 'Install'), 'success' => 1, 'checks' => array('files' => $this->translator->trans('Not all files were successfully uploaded on your server', array(), 'Install'))), array('title' => $this->translator->trans('Permissions on files and folders', array(), 'Install'), 'success' => 1, 'checks' => array('config_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/config/'), 'Install'), 'cache_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/app/cache/'), 'Install'), 'log_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/app/logs/'), 'Install'), 'img_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/img/'), 'Install'), 'mails_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/mails/'), 'Install'), 'module_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/modules/'), 'Install'), 'theme_lang_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/themes/' . _THEME_NAME_ . '/lang/'), 'Install'), 'theme_pdf_lang_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/themes/' . _THEME_NAME_ . '/pdf/lang/'), 'Install'), 'theme_cache_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/themes/' . _THEME_NAME_ . '/cache/'), 'Install'), 'translations_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/translations/'), 'Install'), 'customizable_products_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/upload/'), 'Install'), 'virtual_products_dir' => $this->translator->trans('Recursive write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/download/'), 'Install'), 'config_sf2_dir' => $this->translator->trans('Write permissions for %user% user on %folder%', array('%user%' => $user, '%folder%' => '~/app/config/'), 'Install')))), 'optional' => array(array('title' => $this->translator->trans('Recommended PHP parameters', array(), 'Install'), 'success' => $this->tests['optional']['success'], 'checks' => array('new_phpversion' => sprintf($this->translator->trans('You are using PHP %s version. Soon, the latest PHP version supported by PrestaShop will be PHP 5.4. To make sure you’re ready for the future, we recommend you to upgrade to PHP 5.4 now!'), phpversion()), 'fopen' => $this->translator->trans('Cannot open external URLs', array(), 'Install'), 'gz' => $this->translator->trans('GZIP compression is not activated', array(), 'Install'), 'mcrypt' => $this->translator->trans('Mcrypt extension is not enabled', array(), 'Install'), 'mbstring' => $this->translator->trans('Mbstring extension is not enabled', array(), 'Install'), 'dom' => $this->translator->trans('Dom extension is not loaded', array(), 'Install')))));
     //Inject Sf2 errors to test render required
     foreach ($testsRequiredsf2 as $error) {
         $this->tests_render['required'][2]['checks'][] = $this->translator->trans($error->getHelpHtml(), array(), 'Install');
     }
     //Inject Sf2 optionnal config to test render optional
     foreach ($testsOptionalsf2 as $error) {
         $this->tests_render['optional'][0]['checks'][] = $this->translator->trans($error->getHelpHtml(), array(), 'Install');
     }
     foreach ($this->tests_render['required'] as &$category) {
         foreach ($category['checks'] as $id => $check) {
             if (!isset($this->tests['required']['checks'][$id]) || $this->tests['required']['checks'][$id] != 'ok') {
                 $category['success'] = 0;
             }
         }
     }
     //if sf2 requirement error found, force the required success to false
     if (count($testsRequiredsf2) > 0) {
         $this->tests['required']['success'] = false;
     }
     // If required tests failed, disable next button
     if (!$this->tests['required']['success']) {
         $this->next_button = false;
     }
     $this->displayTemplate('system');
 }
Beispiel #4
0
 /**
  * Display system step
  */
 public function display()
 {
     if (!isset($this->tests['required'])) {
         $this->tests['required'] = $this->model_system->checkRequiredTests();
     }
     if (!isset($this->tests['optional'])) {
         $this->tests['optional'] = $this->model_system->checkOptionalTests();
     }
     // Generate display array
     $this->tests_render = array('required' => array(array('title' => $this->l('PHP parameters:'), 'success' => 1, 'checks' => array('phpversion' => $this->l('PHP 5.1.2 or later is not enabled'), 'upload' => $this->l('Cannot upload files'), 'system' => $this->l('Cannot create new files and folders'), 'gd' => $this->l('GD Library is not installed'), 'mysql_support' => $this->l('MySQL support is not activated'))), array('title' => $this->l('Files'), 'success' => 1, 'checks' => array('files' => $this->l('All files are not successfuly uploaded on your server'))), array('title' => $this->l('Recursive write permissions on files and folders:'), 'success' => 1, 'checks' => array('config_dir' => '~/config/', 'cache_dir' => '~/cache/', 'log_dir' => '~/log/', 'img_dir' => '~/img/', 'mails_dir' => '~/mails/', 'module_dir' => '~/modules/', 'theme_lang_dir' => '~/themes/default/lang/', 'theme_pdf_lang_dir' => '~/themes/default/pdf/lang/', 'theme_cache_dir' => '~/themes/default/cache/', 'translations_dir' => '~/translations/', 'customizable_products_dir' => '~/upload/', 'virtual_products_dir' => '~/download/'))), 'optional' => array(array('title' => $this->l('PHP parameters:'), 'success' => $this->tests['optional']['success'], 'checks' => array('fopen' => $this->l('Cannot open external URLs'), 'register_globals' => $this->l('PHP register global option is on'), 'gz' => $this->l('GZIP compression is not activated'), 'mcrypt' => $this->l('Mcrypt extension is not enabled'), 'mbstring' => $this->l('Mbstring extension is not enabled'), 'magicquotes' => $this->l('PHP magic quotes option is enabled'), 'dom' => $this->l('Dom extension is not loaded'), 'pdo_mysql' => $this->l('PDO MySQL extension is not loaded')))));
     foreach ($this->tests_render['required'] as &$category) {
         foreach ($category['checks'] as $id => $check) {
             if ($this->tests['required']['checks'][$id] != 'ok') {
                 $category['success'] = 0;
             }
         }
     }
     // If required tests failed, disable next button
     if (!$this->tests['required']['success']) {
         $this->next_button = false;
     }
     $this->displayTemplate('system');
 }