Пример #1
0
 /**
  * write the log down to disk
  *
  * @return void
  */
 public static function write()
 {
     if (empty(static::$_data)) {
         return;
     }
     $buffer = date("H:i:s") . " - " . CCServer::method() . ' ' . CCServer::server('REQUEST_URI') . "\n";
     $buffer .= implode("\n", static::$_data);
     CCFile::append(CCStorage::path('logs/' . date('Y-m') . '/' . date('d') . '.log'), $buffer . "\n");
     // clear
     static::clear();
 }
Пример #2
0
 /**
  * Send the mail
  *
  * @param CCMail 		$mail	The mail object.
  * @return void
  *
  * @throws Mail\Exception
  */
 public function send(CCMail $mail)
 {
     $data = $mail->export_data();
     $filename = 'mails/' . date('Y-m') . '/' . date('d') . '/' . date("H-i-s") . '-' . \CCStr::clean_url($data['subject']) . '.log';
     \CCFile::append(\CCStorage::path($filename), \CCJson::encode($data, true));
 }