/**
 * log events
 * @param: $message
 * @return: none
 */
function log_message($log_file, $message)
{
    $log = file_get_contents($log_file);
    $log .= $message . "\n";
    try {
        if (file_put_contents($log_file, $log) === FALSE) {
            throw $err = new customException("logging error");
        }
        return FALSE;
    } catch (customException $e) {
        $err->debug_notifier($e->errorMessage());
    }
}
Beispiel #2
0
 /**
  * @desc: test catch reference
  */
 function test_catch()
 {
     try {
         //throw error
         if (1 != 2) {
             throw $err = new customException("the error details");
         }
     } catch (customException $e) {
         $err->debug_notifier($e->errorMessage());
     }
 }