[ Index ]
 

Code source de phpMyVisites 2.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/core/install/ -> InstallCreateTables.class.php (source)

   1  <?php
   2  /* 
   3   * phpMyVisites : website statistics and audience measurements
   4   * Copyright (C) 2002 - 2006
   5   * http://www.phpmyvisites.net/ 
   6   * phpMyVisites is free software (license GNU/GPL)
   7   * Authors : phpMyVisites team
   8  */
   9  
  10  // $Id: InstallCreateTables.class.php 29 2006-08-18 07:35:21Z matthieu_ $
  11  
  12  
  13  require_once  INCLUDE_PATH."/core/include/InstallModule.class.php";
  14  
  15  class InstallCreateTables extends InstallModule
  16  {
  17      var $viewTemplate = "install/create_tables.tpl";
  18      
  19      var $stepNumber = 4;
  20      
  21  	function InstallCreateTables()
  22      {
  23          parent::InstallModule();
  24      }
  25  
  26  	function process()
  27      {
  28          
  29          $next_step = false;
  30          
  31          $db =& Db::getInstance();
  32          $tablesInstalled = $db->getAllInstalledTables();
  33          
  34          // some tables are already in the database
  35          // offer clean install
  36          if(sizeof($tablesInstalled) > 0)
  37          {
  38  //            print("tables déjà présentes");
  39              
  40              if($this->request->getTablesClean() == 1)
  41              {
  42                  // asked for clean all tables!
  43                  $db->eraseExistingTables();
  44                  $thereIsNoTable = true;
  45              }
  46              else
  47              {
  48                  // ask for clean all table or reuse
  49                  $this->tpl->assign("offer_clean_install", true);
  50              }
  51          }
  52          else
  53          {
  54              $thereIsNoTable = true;
  55          }
  56          
  57          if(isset($thereIsNoTable))
  58          {
  59              $db->createAllTables();
  60              $db->setVersion( PHPMV_VERSION );
  61              $next_step =true;
  62              $this->tpl->assign("tables_success", true);
  63          }
  64          
  65          $this->tpl->assign("show_next_step", $next_step);
  66      }
  67  }
  68  ?>


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