Changeset 465
- Timestamp:
- Feb 18, 2014 8:18:46 AM (10 years ago)
- Location:
- trunk/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Auth_SQL.inc.php
r453 r465 654 654 } 655 655 $app->logMsg(sprintf('User_id %s (%s) session expired: %s', $this->get('user_id'), $this->get('username'), join(', ', $expire_reasons)), LOG_INFO, __FILE__, __LINE__); 656 } else {657 $app->logMsg(sprintf('Session not authenticated: %s', getDump($_SESSION['_auth_sql'][$this->_ns])), LOG_DEBUG, __FILE__, __LINE__);658 656 } 659 657 -
trunk/lib/DB.inc.php
r419 r465 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 37 37 // Database handle. 38 38 var $dbh; 39 39 40 40 // Count how many queries run during the whole instance. 41 41 var $_query_count = 0; … … 58 58 // Display db errors. FALSE recommended for production sites. 59 59 'db_debug' => false, 60 60 61 61 // Script stops on db error. TRUE recommended for production sites. 62 62 'db_die_on_failure' => true, … … 101 101 { 102 102 $app =& App::getInstance(); 103 103 104 104 if (isset($params) && is_array($params)) { 105 105 // Merge new parameters with old overriding only those passed. … … 120 120 { 121 121 $app =& App::getInstance(); 122 122 123 123 if (isset($this->_params[$param])) { 124 124 return $this->_params[$param]; … … 139 139 { 140 140 $app =& App::getInstance(); 141 141 142 142 if (!$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass')) { 143 143 $app->logMsg('Database credentials missing.', LOG_EMERG, __FILE__, __LINE__); … … 193 193 return mysql_close($this->dbh); 194 194 } 195 195 196 196 /* 197 * 197 * 198 198 * 199 199 * @access public 200 * @param 201 * @return 200 * @param 201 * @return 202 202 * @author Quinn Comendant <quinn@strangecode.com> 203 203 * @version 1.0 … … 209 209 $this->connect(); 210 210 } 211 211 212 212 /* 213 213 * Die only if db_die_on_failure is true. This will be set to false for some cases … … 260 260 return (true === $this->_connected); 261 261 } 262 262 263 263 /** 264 264 * Returns a properly escaped string using mysql_real_escape_string() with the current connection's charset. … … 288 288 */ 289 289 function query($query, $debug=false) 290 { 290 { 291 291 $app =& App::getInstance(); 292 292 … … 301 301 echo "<!-- ----------------- Query $this->_query_count ---------------------\n$debugqry\n-->\n"; 302 302 } 303 304 // Ensure we have an active connection. 303 304 // Ensure we have an active connection. 305 305 // If we continue on a dead connection we might experience a "MySQL server has gone away" error. 306 306 // http://dev.mysql.com/doc/refman/5.0/en/gone-away.html … … 318 318 if ($this->getParam('db_debug')) { 319 319 echo '<pre style="padding:2em; background:#ddd; font:9px monaco;">' . wordwrap(mysql_error($this->dbh)) . '<hr>' . htmlspecialchars($debugqry) . '</pre>'; 320 } 320 } 321 321 // Die if db_die_on_failure = true, or just continue without connection 322 322 return $this->_fail(); … … 339 339 { 340 340 $app =& App::getInstance(); 341 341 342 342 if (!$this->_connected) { 343 343 return false; … … 406 406 } 407 407 } 408 408 409 409 /* 410 410 * Return the total number of queries executed thus far. -
trunk/lib/Utilities.inc.php
r464 r465 33 33 * @param bool $var_dump Use var_dump instead of print_r. 34 34 */ 35 function dump($var, $display=false, $var_dump=false, $file , $line)35 function dump($var, $display=false, $var_dump=false, $file='', $line='') 36 36 { 37 37 if (defined('_CLI')) { 38 echo "\n ";39 } else { 40 echo $display ? "\n<br />< pre>\n" : "\n\n\n<!--\n";38 echo "\n$file $line\n"; 39 } else { 40 echo $display ? "\n<br /><strong>$file $line</strong>\n<br /><pre>\n" : "\n\n\n<!--\n$file $line\n"; 41 41 } 42 42 if ($var_dump) { … … 1121 1121 } 1122 1122 1123 1124 1123 ?>
Note: See TracChangeset
for help on using the changeset viewer.