[ 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/ -> dbinstall.php (source)

   1  <?php
   2  # ***** BEGIN LICENSE BLOCK *****
   3  # This file is part of Plume CMS, a website management application.
   4  # Copyright (C) 2001-2005 Loic d'Anterroches and contributors.
   5  #
   6  # Plume CMS is free software; you can redistribute it and/or modify
   7  # it under the terms of the GNU General Public License as published by
   8  # the Free Software Foundation; either version 2 of the License, or
   9  # (at your option) any later version.
  10  #
  11  # Plume CMS is distributed in the hope that it will be useful,
  12  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  # GNU General Public License for more details.
  15  #
  16  # You should have received a copy of the GNU General Public License
  17  # along with this program; if not, write to the Free Software
  18  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  19  #
  20  # ***** END LICENSE BLOCK *****
  21  require_once dirname(__FILE__).'/prepend.php';
  22  $_px_p = 40; //percentage of wizard done.
  23  
  24  if (empty($_SESSION['step4'])) {
  25      header('Location: dbinfo.php');
  26      exit;
  27  }
  28  
  29  //load the language file
  30  $_PX_config['encoding'] = $_SESSION['manager_encoding'];
  31  $l = new l10n($_SESSION['lang'], 'install');
  32  
  33  
  34  $_PX_config['db']['db_login']     = $_SESSION['dblogin'];
  35  $_PX_config['db']['db_password']  = $_SESSION['dbpass'];
  36  $_PX_config['db']['db_server']    = $_SESSION['dbserver'];
  37  $_PX_config['db']['db_database']  = $_SESSION['dbname'];
  38  $_PX_config['db']['table_prefix'] = $_SESSION['dbprefix'];
  39  $_PX_config['debug'] = true;
  40  $_PX_config['db_version'] = $_SESSION['db_version'];
  41  $con =& pxDBConnect();
  42  
  43  $extra = '';
  44  $charset = '';
  45  $rsV = $con->select('SELECT VERSION() AS version');
  46  $mysql_version = preg_replace('/-log$/','',$rsV->f(0));
  47  if (version_compare($mysql_version, '3.23', '>=')) {
  48      $extra = ' TYPE=MyISAM';
  49  }
  50  
  51  if (version_compare($mysql_version, '4.1', '>=')) {
  52      $charset = 'DEFAULT CHARSET=utf8';
  53  }
  54  
  55  $checklist = new checklist();
  56  $xml = implode("\n", file('./db-create.xml'));
  57  $sql = new xmlsql($con, $xml);
  58  
  59  $sql->replace('{{TYPE}}', $extra);
  60  $sql->replace('{{PREFIX}}',$_PX_config['db']['table_prefix']);
  61  $sql->replace('{{CHARSET}}',$charset);
  62  $sql->execute($checklist);
  63  
  64  $check = $checklist->checkAll();
  65  
  66  if($check) {
  67      $_SESSION['step5'] = true;
  68  }
  69  
  70  include dirname(__FILE__).'/_top.php';
  71  
  72  echo '<h2>'.__('Database installation').'</h2>'."\n\n";
  73  
  74  if(!$check) {
  75      echo '<p class="important">'.__('Errors during database initialization procedure.').'</p>'."\n\n";
  76  }
  77  
  78  echo $checklist->getHtml('../themes/default/images');
  79  
  80  
  81  if($check) {
  82      echo '<p>'.sprintf(__('In the next step the first user will be registered to use the system. <a href="%s">Next</a>.'), 'firstuser.php').'</p>'."\n\n";
  83  }
  84  include dirname(__FILE__).'/_bottom.php';
  85  ?>


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