Last active
August 29, 2015 14:08
-
-
Save shauvik/6c0c7e69edc3e579b791 to your computer and use it in GitHub Desktop.
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
| ; Automatically add files before PHP document. | |
| ; http://php.net/auto-prepend-file | |
| auto_prepend_file = /Users/shauvik/Library/Containers/com.bitnami.mampstack/Data/app-5_4_9/apache2/htdocs/php_trace/prepend.php | |
| ; Automatically add files after PHP document. | |
| ; http://php.net/auto-append-file | |
| auto_append_file = /Users/shauvik/Library/Containers/com.bitnami.mampstack/Data/app-5_4_9/apache2/htdocs/php_trace/append.php | |
| ;... | |
| ;[XDebug] | |
| ;; Only Zend OR (!) XDebug | |
| zend_extension="/Applications/MampStack.app/Contents/Resources/app/php/lib/php/extensions/xdebug.so" | |
| ;xdebug.remote_enable=true | |
| ;xdebug.remote_host=127.0.0.1 | |
| ;xdebug.remote_port=9000 | |
| ;xdebug.remote_handler=dbgp | |
| xdebug.profiler_enable=1 | |
| xdebug.profiler_output_dir=/tmp | |
| ;Shauvik | |
| xdebug.collect_assignments=1 | |
| xdebug.collect_params=4 | |
| xdebug.collect_return=1 | |
| xdebug.trace_format=1 | |
| xdebug.var_display_max_children=-1 | |
| xdebug.var_display_max_data=-1 | |
| xdebug.var_display_max_depth=-1 |
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
| <?php | |
| //var_dump(xdebug_get_code_coverage()); | |
| //xdebug_stop_code_coverage(); | |
| $headers = getallheaders(); | |
| if(array_key_exists('Trace-Request-Id', $headers)) { | |
| xdebug_stop_trace(); | |
| } |
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
| <?php | |
| //xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE); | |
| $base = "/Users/shauvik/Library/Containers/com.bitnami.mampstack/Data/app-5_4_9/apache2/htdocs/xtlogs/"; | |
| $patharr = explode("/",$_SERVER['REQUEST_URI']); | |
| $foldername = count($patharr)>1 ? $patharr[1] : ''; | |
| if($foldername){ | |
| if (!file_exists($base.$foldername)) { | |
| mkdir($base.$foldername); | |
| } | |
| $base = $base.$foldername.'/'; | |
| } | |
| $headers = getallheaders(); | |
| //echo $headers['RequestId']; | |
| //var_dump($headers); | |
| if(array_key_exists('Trace-Request-Id', $headers)) { | |
| xdebug_start_trace($base.'trace.'.$headers['Trace-Request-Id']); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment