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


Ignore:
Timestamp:
Feb 18, 2014 8:18:46 AM (10 years ago)
Author:
anonymous
Message:

Removed 'Session not authenticated' logging

File:
1 edited

Legend:

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

    r419 r465  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    3737    // Database handle.
    3838    var $dbh;
    39    
     39
    4040    // Count how many queries run during the whole instance.
    4141    var $_query_count = 0;
     
    5858        // Display db errors. FALSE recommended for production sites.
    5959        'db_debug' => false,
    60        
     60
    6161        // Script stops on db error. TRUE recommended for production sites.
    6262        'db_die_on_failure' => true,
     
    101101    {
    102102        $app =& App::getInstance();
    103    
     103
    104104        if (isset($params) && is_array($params)) {
    105105            // Merge new parameters with old overriding only those passed.
     
    120120    {
    121121        $app =& App::getInstance();
    122    
     122
    123123        if (isset($this->_params[$param])) {
    124124            return $this->_params[$param];
     
    139139    {
    140140        $app =& App::getInstance();
    141    
     141
    142142        if (!$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass')) {
    143143            $app->logMsg('Database credentials missing.', LOG_EMERG, __FILE__, __LINE__);
     
    193193        return mysql_close($this->dbh);
    194194    }
    195    
     195
    196196    /*
    197     * 
     197    *
    198198    *
    199199    * @access   public
    200     * @param   
    201     * @return   
     200    * @param
     201    * @return
    202202    * @author   Quinn Comendant <quinn@strangecode.com>
    203203    * @version  1.0
     
    209209        $this->connect();
    210210    }
    211    
     211
    212212    /*
    213213    * Die only if db_die_on_failure is true. This will be set to false for some cases
     
    260260        return (true === $this->_connected);
    261261    }
    262    
     262
    263263    /**
    264264     * Returns a properly escaped string using mysql_real_escape_string() with the current connection's charset.
     
    288288     */
    289289    function query($query, $debug=false)
    290     {   
     290    {
    291291        $app =& App::getInstance();
    292292
     
    301301            echo "<!-- ----------------- Query $this->_query_count ---------------------\n$debugqry\n-->\n";
    302302        }
    303        
    304         // Ensure we have an active connection. 
     303
     304        // Ensure we have an active connection.
    305305        // If we continue on a dead connection we might experience a "MySQL server has gone away" error.
    306306        // http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
     
    318318            if ($this->getParam('db_debug')) {
    319319                echo '<pre style="padding:2em; background:#ddd; font:9px monaco;">' . wordwrap(mysql_error($this->dbh)) . '<hr>' . htmlspecialchars($debugqry) . '</pre>';
    320             }           
     320            }
    321321            // Die if db_die_on_failure = true, or just continue without connection
    322322            return $this->_fail();
     
    339339    {
    340340        $app =& App::getInstance();
    341    
     341
    342342        if (!$this->_connected) {
    343343            return false;
     
    406406        }
    407407    }
    408    
     408
    409409    /*
    410410    * Return the total number of queries executed thus far.
Note: See TracChangeset for help on using the changeset viewer.