Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function catch_db_error( $errno, $errstr, $errfile, $errline )
- {
- global $db;
- static $failures;
- if ( strstr( $errstr, "Lost connection" ) && $failures < 5 ) {
- $failures++;
- return null;
- }
- if ( is_object( $db ) ) {
- $db->halt( '' . $errstr . "
- " . "
- " . $errfile . " on line " . $errline );
- return null;
- }
- vb_error_handler( $errno, $errstr, $errfile, $errline );
- return null;
- }
- function vb_error_handler( $errno, $errstr, $errfile, $errline )
- {
- global $vbulletin;
- switch ( $errno ) {
- case E_WARNING:
- case E_USER_WARNING: {
- if ( !error_reporting() || !ini_get( "display_errors" ) ) {
- return null;
- }
- $errfile = str_replace( DIR, "[path]", $errfile );
- $errstr = str_replace( DIR, "[path]", $errstr );
- echo '' . "<br /><strong>Warning</strong>: " . $errstr . " in <strong>" . $errfile . "</strong> on line <strong>" . $errline . "</strong><br />";
- break;
- }
- .........................................................
- ............................
- ..........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement