Changeset 630 for trunk/lib/DB.inc.php


Ignore:
Timestamp:
Jun 8, 2018 3:41:16 AM (6 years ago)
Author:
anonymous
Message:

Disable App::sslOn(). Better logging on Email::send() unreplaced variables. Fix the elusive 'Database table session_tbl has invalid columns' error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/DB.inc.php

    r627 r630  
    7878
    7979    // Caches.
    80     protected $existing_tables;
    81     protected $table_columns;
     80    protected static $existing_tables = null;
     81    protected static $table_columns = null;
    8282
    8383    /**
     
    377377        }
    378378
    379         if (!isset($this->existing_tables) || !$use_cached_results) {
    380             $this->existing_tables = array();
     379        if (is_null(self::$existing_tables) || !$use_cached_results) {
     380            self::$existing_tables = array();
    381381            $qid = $this->query("SHOW TABLES");
    382382            while (list($row) = mysql_fetch_row($qid)) {
    383                 $this->existing_tables[] = $row;
     383                self::$existing_tables[] = $row;
    384384            }
    385385        }
    386         if (in_array($table, $this->existing_tables)) {
     386
     387        if (in_array($table, self::$existing_tables)) {
    387388            return true;
    388389        } else {
     
    421422        }
    422423
    423         if (!isset($this->table_columns[$table]) || !$use_cached_results) {
     424        if (!isset(self::$table_columns[$table]) || !$use_cached_results) {
    424425            // Populate and cache array of current columns for this table.
    425             $this->table_columns[$table] = array();
     426            self::$table_columns[$table] = array();
    426427            $qid = $this->query("DESCRIBE $table");
    427428            while ($row = mysql_fetch_row($qid)) {
    428                 $this->table_columns[$table][] = $row[0];
     429                self::$table_columns[$table][] = $row[0];
    429430            }
    430431        }
     
    433434            // Do an exact comparison of table schemas.
    434435            sort($columns);
    435             sort($this->table_columns[$table]);
    436             return $this->table_columns[$table] == $columns;
     436            sort(self::$table_columns[$table]);
     437            return self::$table_columns[$table] == $columns;
    437438        } else {
    438439            // Only check that the specified columns are available in the table.
    439             $match_columns = array_intersect($this->table_columns[$table], $columns);
     440            $match_columns = array_intersect(self::$table_columns[$table], $columns);
    440441            sort($columns);
    441442            sort($match_columns);
     
    467468    public function resetCache()
    468469    {
    469         $this->existing_tables = null;
    470         $this->table_columns = null;
     470        self::$existing_tables = null;
     471        self::$table_columns = null;
    471472    }
    472473
Note: See TracChangeset for help on using the changeset viewer.