Пример #1
0
function log_file($log, $var = null, $file = 'logs/main.log', $overwrite = false)
{
    $date = date('Y-m-d H:i:s');
    $log = '----Logged on ' . $date . ' ----' . PHP_EOL . PHP_EOL . '$' . $var . ': ' . (is_array($log) ? print_r($log, true) : $log) . PHP_EOL . PHP_EOL;
    file_save_($file, $log, $overwrite);
    return true;
}
Пример #2
0
function file_save($file, $string, $overwrite = false)
{
    if (is_array($string)) {
        $string = serialize($string);
    }
    return file_save_($file, $string, $overwrite);
}
Пример #3
0
function log_file($log, $var = null, $file = null, $overwrite = false)
{
    $file = log_file_location($file);
    $log = '----Logged on ' . date('r') . ' ----' . PHP_EOL . PHP_EOL . '$' . $var . ': ' . ((is_array($log) or is_object($log)) ? print_r($log, true) : $log) . PHP_EOL . PHP_EOL;
    file_save_($file, $log, $overwrite);
    return true;
}