-
-
Save kenng/dcda660cf201e59f87aa8d200d868b4c to your computer and use it in GitHub Desktop.
php 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
| public static function WriteErrorFile(String $msg) { | |
| $fpath = base_path() . '/errors.log'; | |
| $fpath = "/Applications/AMPPS/www/lwnew.thelivingwellco.com.sg/wp-content/plugins/itwonders-woocommerce-deposit/errors.log"; | |
| error_log(print_r($msg, TRUE), 3, $fpath); | |
| } | |
| public static function backtrace($skip=0, $limit=12) { | |
| $dump = []; | |
| $mydump = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $limit); | |
| foreach ($mydump as $key => $item) { | |
| if ($key >= $skip) { | |
| $myfile = isset($item['file'])?:'undefined'; | |
| $dump[] = $myfile . "::" . $item['function']; | |
| } | |
| } | |
| self::WriteErrorFile(implode("\n", $dump) . "\n"); | |
| return $dump; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment