Exemple #1
0
 public function __destruct()
 {
     $this->values['end'] = date('H:i:s');
     $logdb = new log_database();
     try {
         $logdb->logSMSStatus($this->values);
         //throw new dbException('PACKET OVERFLOW',1153);
     } catch (dbException $e) {
         if ($e->getCode() == 1153) {
             //max_allowed_packet
             $logf = new log_file('/packet_overflow/');
             if ($logf->packet_overflow($this->values)) {
                 $this->values['log_message'] = "LOG TEXT OVER MySQL max_packet_size, WRITTEN TO " . $logf->path;
                 $logdb->logSMSStatus($this->values);
             } else {
                 $this->values['log_message'] = "TRIED TO CREATE LOG FILE AND FAILED " . $logf->path;
             }
             $this->status(CRITICAL);
             $logdb->logSMSStatus($this->values);
         } else {
             debug::output($e->getMessage());
             $this->status(WARNING);
         }
     }
 }
Exemple #2
0
 private function log()
 {
     if ($this->live == true) {
         $logf = new log_file('/api/textanywhere/');
         $logf->request($this->method, $this->vars, $this->count);
         $logf->response($this->method, $this->response, $this->count);
     }
 }
Exemple #3
0
if ($lock != 'nolock') {
    $lock->release();
}
debug::output("\n\nEnding script ... {$_SERVER['SCRIPT_NAME']} : " . config::get('process_name') . " : " . date('d/m/Y H:i:s') . "\n\n");
$contents = ob_get_contents();
ob_end_clean();
if (config::get('email_reports')) {
    // 		$to_email = join(',', config::get('email_reports'));
    // 		$operator = config::get('operator');
    // 		mail($to_email, "$operator Flat File Processed", $contents);
}
//if (config::get('process_name'))	{}
$status->data('log_message', $contents);
if (config::get('log_to_file') == true) {
    $logf = new log_file('/output/');
    $logf->output_buffer($contents);
}
if (config::get('output_to_screen') == true) {
    echo $contents;
}
if (config::get('process_name')) {
    // 	$type = config::get('flat_file_type');
    // 	if (empty($type) || strpos($type, 'run_process')  !== false)
    // 	{
    // 		$type = config::get('product_type');
    // 	}
    // 	$status->data('type', $type);
    $status->save();
    unset($status);
}