@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | public function log($type, Nette\Mail\Message $mail) |
| 37 | 37 | { |
| 38 | 38 | $timestamp = date('Y-m-d H:i:s'); |
| 39 | - $type .= '.' . time(); |
|
| 39 | + $type .= '.'.time(); |
|
| 40 | 40 | $file = $this->getLogFile($type, $timestamp); |
| 41 | 41 | |
| 42 | 42 | if (file_exists($file) && filesize($file)) { |
| 43 | - $file = str_replace(static::LOG_EXTENSION, '.' . uniqid() . static::LOG_EXTENSION, $file); |
|
| 43 | + $file = str_replace(static::LOG_EXTENSION, '.'.uniqid().static::LOG_EXTENSION, $file); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | file_put_contents($file, $mail->generateMessage()); |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | preg_match('/^((([0-9]{4})-[0-9]{2})-[0-9]{2}).*/', $timestamp, $fragments); |
| 59 | 59 | |
| 60 | - $year_dir = $this->log_directory . '/' . $fragments[3]; |
|
| 61 | - $month_dir = $year_dir . '/' . $fragments[2]; |
|
| 62 | - $day_dir = $month_dir . '/' . $fragments[1]; |
|
| 63 | - $file = $day_dir . '/' . $type . static::LOG_EXTENSION; |
|
| 60 | + $year_dir = $this->log_directory.'/'.$fragments[3]; |
|
| 61 | + $month_dir = $year_dir.'/'.$fragments[2]; |
|
| 62 | + $day_dir = $month_dir.'/'.$fragments[1]; |
|
| 63 | + $file = $day_dir.'/'.$type.static::LOG_EXTENSION; |
|
| 64 | 64 | |
| 65 | 65 | if (!file_exists($day_dir)) { |
| 66 | 66 | mkdir($day_dir, 0777, TRUE); |
@@ -173,11 +173,11 @@ discard block |
||
| 173 | 173 | /** |
| 174 | 174 | * Convert class name to underscore and set latte file extension |
| 175 | 175 | */ |
| 176 | - $this->underscore_name = lcfirst(preg_replace_callback('/(?<=.)([A-Z])/', function ($m) { |
|
| 177 | - return '_' . strtolower($m[1]); |
|
| 176 | + $this->underscore_name = lcfirst(preg_replace_callback('/(?<=.)([A-Z])/', function($m) { |
|
| 177 | + return '_'.strtolower($m[1]); |
|
| 178 | 178 | }, $class_name)); |
| 179 | 179 | |
| 180 | - $template_name = $this->underscore_name . '.latte'; |
|
| 180 | + $template_name = $this->underscore_name.'.latte'; |
|
| 181 | 181 | $this->log_type = $this->underscore_name; |
| 182 | 182 | |
| 183 | 183 | if ($this->template_file) { |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * In case mail logging is turned on, log failed email message |
| 242 | 242 | */ |
| 243 | 243 | if ($this->config === self::CONFIG_BOTH) { |
| 244 | - $this->logger->log($this->log_type . '_failed', $this->message); |
|
| 244 | + $this->logger->log($this->log_type.'_failed', $this->message); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | throw $e; |