Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 42 lines (38 sloc) 786 Bytes
<?php
/**
* Magic Fields's debug Class
*
* @author David Valdez <me@gnuget.org>
* @package Magic Fields
* @subpackage tools
*/
class Debug
{
/**
* Writes log info to a file
* @param $msg string the message to write out
* @param $path string the location to write the messages
* @return null
*/
function log($msg,$path = "") {
if(empty($path)){
$path = dirname(__FILE__)."/../tmp/debug/";
$path = MF_FILES_PATH;
}
if(!is_string($msg)){
$msg = print_r($msg,true);
}
$fp = fopen($path.'magic_fields.log', 'a+');
$date = gmdate( 'Y-m-d H:i:s' );
fwrite($fp, "$date - $msg\n");
fclose($fp);
}
}
//wrapper for print_r with tag pre
if (!function_exists('pr')) {
function pr($data){
echo "<pre>";
print_r($data);
echo "</pre>";
}
}
You can’t perform that action at this time.