public/wordpress/wp-content/plugins/backupbuddy/classes/backup.php
/*	shutdown_function()
	 *	
	 *	Used for catching fatal PHP errors during backup to write to log for debugging.
	 *	
	 *	@return		null
	 */


Used for catching fatal PHP errors during backup to write to log for debugging.

@return         null
Used for catching fatal PHP errors during backup to write to log for debugging . @return null
public function shutdown_function() {
		$e = error_get_last();
		if ( $e === NULL ) { 
			return;
		} else { 
			if ( !is_array( $e ) || ( $e['type'] != E_ERROR ) && ( $e['type'] != E_USER_ERROR ) ) { 
				return;
			}
		}
		$log_directory = backupbuddy_core::getLogDirectory();
		$main_file = $log_directory . 'log-' . pb_backupbuddy::$options['log_serial'] . '.txt';
		if ( pb_backupbuddy::$_status_serial != '' ) {
			$serial = pb_backupbuddy::$_status_serial;
			$serial_file = $log_directory . 'status-' . $serial . '_' . pb_backupbuddy::$options['log_serial'] . '.txt';
			$write_serial = true;
		} else {
			$write_serial = false;
		}
		$e_string = 'PHP_ERROR ' . __( 'Error #32893. Fatal PHP error encountered:', 'it-l10n-backupbuddy' );
		foreach( (array)$e as $e_line_title => $e_line ) {
			$e_string .= $e_line_title . ' => ' . $e_line . "; ";
		}
		$e_string .= ".\n";
		@file_put_contents( $main_file, $e_string, FILE_APPEND );
		if ( $write_serial === true ) {
			@file_put_contents( $serial_file, $e_string, FILE_APPEND );
		}
	}
public function shutdown_function ( ) { $ e = error_get_last ( ) ; if ( $ e === NULL ) { return ; } else { if ( ! is_array ( $ e ) || ( $ e [ 'type' ] != E_ERROR ) && ( $ e [ 'type' ] != E_USER_ERROR ) ) { return ; } } $ log_directory = backupbuddy_core :: getLogDirectory ( ) ; $ main_file = $ log_directory . 'log-' . pb_backupbuddy :: $ options [ 'log_serial' ] . '.txt' ; if ( pb_backupbuddy :: $ _status_serial != '' ) { $ serial = pb_backupbuddy :: $ _status_serial ; $ serial_file = $ log_directory . 'status-' . $ serial . '_' . pb_backupbuddy :: $ options [ 'log_serial' ] . '.txt' ; $ write_serial = true ; } else { $ write_serial = false ; } $ e_string = 'PHP_ERROR ' . __ ( 'Error #32893. Fatal PHP error encountered:' , 'it-l10n-backupbuddy' ) ; foreach ( ( array ) $ e as $ e_line_title => $ e_line ) { $ e_string .= $ e_line_title . ' => ' . $ e_line . " ;  " ; } $ e_string .= " . \n " ; @ file_put_contents ( $ main_file , $ e_string , FILE_APPEND ) ; if ( $ write_serial === true ) { @ file_put_contents ( $ serial_file , $ e_string , FILE_APPEND ) ; } }
shutdown_function()
shutdown_function ()
// Get error message. // Error types: http://php.net/manual/en/errorfunc.constants.php // No error of any kind. // Some type of error. // Return if not a fatal error. // Calculate log directory. // Determine if writing to a serial log. // Format error message. // Write to log.