Changeset 15 for trunk/lib/DB.inc.php
- Timestamp:
- Nov 13, 2005 4:51:22 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/DB.inc.php
r14 r15 7 7 * 8 8 * @author Quinn Comendant <quinn@strangecode.com> 9 * @version 1.0 9 * @version 1.0.1 10 10 */ 11 11 … … 144 144 } 145 145 146 // Connection errors.146 // Test for connection errors. 147 147 if (!$this->dbh || mysql_error($this->dbh)) { 148 148 $mysql_error_msg = $this->dbh ? 'Codebase MySQL error: (' . mysql_errno($this->dbh) . ') ' . mysql_error($this->dbh) : 'Codebase MySQL error: Could not connect to server.'; 149 App::logMsg($mysql_error_msg, LOG_EMERG, __FILE__, __LINE__); 150 151 // Print helpful or pretty error? 149 152 if ($this->getParam('db_debug')) { 150 153 echo $mysql_error_msg . "\n"; … … 152 155 echo _("This page is temporarily unavailable. It should be back up in a few minutes."); 153 156 } 154 App::logMsg($mysql_error_msg, LOG_EMERG, __FILE__, __LINE__); 155 echo "\n\n<!-- Script execution stopped out of embarrassment. -->"; 156 die; 157 158 // Die or continue without connection? 159 if ($this->getParam('db_die_on_failure')) { 160 echo "\n\n<!-- Script execution stopped out of embarrassment. -->"; 161 die; 162 } else { 163 return false; 164 } 157 165 } 158 166
Note: See TracChangeset
for help on using the changeset viewer.