[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/classes/ -> sniffer.php (source)

   1  <?php
   2  /**

   3   * Sniffer Class.

   4   *

   5   * @package classes

   6   * @copyright Copyright 2003-2006 Zen Cart Development Team

   7   * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0

   8   * @version $Id: sniffer.php 3260 2006-03-26 00:18:01Z drbyte $

   9   */
  10  if (!defined('IS_ADMIN_FLAG')) {
  11    die('Illegal Access');
  12  }
  13  /**

  14   * Sniffer Class.

  15   * This class is used to collect information on the system that Zen Cart is running on

  16   * and to return error reports

  17   *

  18   * @package classes

  19   */
  20  class sniffer extends base {
  21  
  22    function sniffer() {
  23      $this->browser = Array();
  24      $this->php = Array();
  25      $this->server = Array();
  26      $this->database = Array();
  27      $this->phpBB = Array();
  28    }
  29  
  30    function table_exists($table_name) {
  31      global $db;
  32      $found_table = false;
  33      // Check to see if the requested Zen Cart table exists

  34      $sql = "SHOW TABLES like '".$table_name."'";
  35      $tables = $db->Execute($sql);
  36      //echo 'tables_found = '. $tables->RecordCount() .'<br>';

  37      if ($tables->RecordCount() > 0) {
  38        $found_table = true;
  39      }
  40      return $found_table;
  41    }
  42  
  43    function field_exists($table_name, $field_name) {
  44      global $db;
  45      $sql = "show fields from " . $table_name;
  46      $result = $db->Execute($sql);
  47      while (!$result->EOF) {
  48        // echo 'fields found='.$result->fields['Field'].'<br />';

  49        if  ($result->fields['Field'] == $field_name) {
  50          return true; // exists, so return with no error

  51        }
  52        $result->MoveNext();
  53      }
  54      return false;
  55    }
  56  }
  57  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics