Created
July 22, 2020 12:04
-
-
Save raftaar1191/75fff8d3d887eef173eafbf318cc380e to your computer and use it in GitHub Desktop.
Debug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if ( isset( $_GET['debug123'] ) ) { | |
function bb_track_log( $end = false ) { | |
static $starttime; | |
if ( ! $end ) { | |
$starttime = time(); | |
register_shutdown_function( | |
function() { | |
bb_track_log( true ); | |
} | |
); | |
} else { | |
$data = array(); | |
$data[] = array( | |
$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . ' ', // URL | |
( time() - $starttime ), // Time Consume | |
json_encode( $_POST ), // Post Data | |
json_encode( array() ), // Extra Data | |
); | |
$file_name = dirname( __FILE__ ) . '/' . basename( __FILE__ ) . '-kjha45.csv'; | |
$fp = fopen( $file_name, 'a' ); | |
foreach ( $data as $val ) { | |
fputcsv( $fp, $val ); | |
} | |
fclose( $fp ); | |
} | |
} | |
// bb_track_log(); | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment