PHP Classes

File: lib/logs.php

Recommend this page to a friend!
  Classes of Ganesh Kandu   Palette PHP CMS System   lib/logs.php   Download  
File: lib/logs.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Palette PHP CMS System
Manage content site edited visually in the browser
Author: By
Last change:
Date: 2 years ago
Size: 770 bytes
 

Contents

Class file image Download
<?php

/*
///////////////////////////////////////////////////
Palatte is a PHP Based Site Builder
Developed By : Ganesh Kandu
Contact Mail : kanduganesh@gmail.com
///////////////////////////////////////////////////
*/

if(!file_exists("logs/error.log")){
   
$myfile = fopen("logs/error.log", "w");
}

$error = error_get_last();

if(!empty(
$error)){
    if(!
is_writable("logs/error.log")){
       
$n = new notify();
       
$msg = array(
           
'type' => "warning",
           
'caption' => "",
           
'content' => "error.log is Not Writable"
       
);
       
$n->setnotification($msg);
    }
   
$log = "[".date("d-m-Y h:i:sa")."] Error Type ".$error['type']." ".$error['message']." in ".$error['file']." on ".$error['line']."\n";
   
$logfile = fopen("logs/error.log", 'a');
   
fwrite($logfile, $log);
   
fclose($logfile);
}