[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/install/ -> check.php (source)

   1  <?php
   2  /* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
   3  /*
   4  # ***** BEGIN LICENSE BLOCK *****
   5  # This file is part of Plume CMS, a website management application.
   6  # Copyright (C) 2001-2005 Loic d'Anterroches and contributors.
   7  #
   8  # Plume CMS is free software; you can redistribute it and/or modify
   9  # it under the terms of the GNU General Public License as published by
  10  # the Free Software Foundation; either version 2 of the License, or
  11  # (at your option) any later version.
  12  #
  13  # Plume CMS is distributed in the hope that it will be useful,
  14  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  # GNU General Public License for more details.
  17  #
  18  # You should have received a copy of the GNU General Public License
  19  # along with this program; if not, write to the Free Software
  20  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  21  #
  22  # ***** END LICENSE BLOCK ***** */
  23  require_once dirname(__FILE__).'/prepend.php';
  24  
  25  $_px_p = 10; //percentage of wizard done.
  26  
  27  
  28  
  29  if (empty($_SESSION['step1'])) {
  30      header('Location: index.php');
  31      exit;
  32  }
  33  
  34  /**
  35   * load the language file
  36   */
  37  $_PX_config['encoding'] = $_SESSION['encoding'];
  38  $l = new l10n($_SESSION['lang'], 'install');
  39  
  40  /* Check of the php installation */
  41  
  42  //Check the php version
  43  $checklist = new checklist('php', version_compare(phpversion(),'4.1','>='),
  44                             sprintf(__('The installed PHP version is: %s.'), phpversion()),
  45      sprintf(__('The installed PHP version is: %s. PHP 4.1 or higher is required.'), phpversion()));
  46  //Check the support of MySQL
  47  $checklist->addTest('mysql', function_exists('mysql_connect'),
  48      __('The MySQL module is available.'),
  49      __('The MySQL module is not available.'));
  50  //Check the support of the output buffer functions
  51  $checklist->addTest('ob', function_exists('ob_start'),
  52      __('The output buffering functions are available.'),
  53      __('The output buffering functions are not available.'));
  54  //Check the support of gd for thumbnails
  55  //Note: the library version is not tested as the output buffering functions are needed.
  56  //I may get the results of the test 'ob' and then if ok, check the version.
  57  $checklist->addTest('gd', (function_exists('imagecreatefromjpeg')) ? 1 : 2,
  58      __('The GD library is available.'),
  59      '', /* no error in test only warning */
  60      __('The GD library is not available. Thumbnails will not be created automatically.'));
  61  //Need the XML module for the SQL xml class
  62  $checklist->addTest('xmlparser', function_exists('xml_parser_create'),
  63      __('The XML module is available.'),
  64      __('The XML module is not available.'));
  65  
  66  
  67  /* Check of the read/write of the files */
  68  // Files/folders to check:
  69  // xmedia and xmedia/thumb
  70  // conf folder and files in
  71  // cache folder
  72  // templates
  73  // tools (warning only for the update manager)
  74  $rp = $_PX_config['manager_path'];
  75  //Configuration folder
  76  $checklist->addTest('conf-folder', is_writable($rp.'/conf/'),
  77      sprintf(__('The system can write in the configuration folder: %s'), files::real_path($rp.'/conf/')),
  78      sprintf(__('The system cannot write in the configuration folder: %s. Check the permissions.'), files::real_path($rp.'/conf/')));
  79  //Cache folder
  80  $checklist->addTest('cache-folder', is_writable($rp.'/cache/'),
  81      sprintf(__('The system can write in the cache folder: %s'), files::real_path($rp.'/cache/')),
  82      sprintf(__('The system cannot write in the cache folder: %s. Check the permissions.'), files::real_path($rp.'/cache/')));
  83  //Template folder
  84  $checklist->addTest('templates-folder', is_writable($rp.'/templates/'),
  85      sprintf(__('The system can write in the template folder: %s'), files::real_path($rp.'/templates/')),
  86      sprintf(__('The system cannot write in the template folder: %s. Check the permissions.'), files::real_path($rp.'/templates/')));
  87  //document root
  88  $checklist->addTest('root-folder', is_writable($rp.'/../'),
  89      sprintf(__('The system can write in the document folder: %s'), files::real_path($rp.'/../')),
  90      sprintf(__('The system cannot write in the document folder: %s. Check the permissions.'), files::real_path($rp.'/../')));
  91  //xmedia path and thumbnail path
  92  $checklist->addTest('xmedia-folder', is_writable($rp.'/../xmedia/'),
  93      sprintf(__('The system can write in the document folder: %s'), files::real_path($rp.'/../xmedia/')),
  94      sprintf(__('The system cannot write in the document folder: %s. Check the permissions.'), files::real_path($rp.'/../xmedia/')));
  95  $checklist->addTest('theme-folder', is_writable($rp.'/../xmedia/theme/'),
  96      sprintf(__('The system can write in the theme folder: %s'), files::real_path($rp.'/../xmedia/theme/')),
  97      sprintf(__('The system cannot write in the theme folder: %s. Check the permissions.'), files::real_path($rp.'/../xmedia/theme/')));
  98  $checklist->addTest('thumb-folder', (is_writable($rp.'/../xmedia/thumb/')) ? 1 : 2,
  99      sprintf(__('The system can write in the thumbnail folder: %s'), files::real_path($rp.'/../xmedia/thumb/')),
 100      '', /*no error but warning */
 101      sprintf(__('The system cannot write in the thumbnail folder: %s. Check the permissions or you will not be able to have automatic creation of the thumbnails.'), files::real_path($rp.'/../xmedia/thumb/')));
 102  
 103  $check = $checklist->checkAll();
 104  if ($check) {
 105      $_SESSION['step2'] = true;
 106  }
 107  include dirname(__FILE__).'/_top.php';
 108  
 109  echo '<h2>'.__('Check of the PLUME CMS support by the system').'</h2>'."\n\n";
 110  
 111  echo $checklist->getHtml('../themes/default/images');
 112  
 113  if ($check) {
 114      echo '<p>'.__('Congratulations, your system supports PLUME CMS. Warnings will not prevent your use of PLUME CMS.').'</p>'."\n";
 115      echo '<p>'.__('No irreversible action is taken during the installation process. You can revert your choices from the manager at a later time.').'</p>'."\n";
 116  
 117  
 118      echo '<p>'.sprintf(__('<a href="%s">Continue with the choice of languages</a>.'), 'encoding.php').'</p>'."\n";
 119  
 120  } else {
 121      echo '<p>'.__('Some errors prevent the installation of PLUME CMS on your system. You can fix them and restart the wizard afterwards.').'</p>'."\n\n";
 122  }
 123  include dirname(__FILE__).'/_bottom.php';
 124  
 125  ?>


Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics