@@ -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); |
@@ -172,11 +172,11 @@ |
||
| 172 | 172 | /** |
| 173 | 173 | * Convert class name to underscore and set latte file extension |
| 174 | 174 | */ |
| 175 | - $this->underscore_name = lcfirst(preg_replace_callback('/(?<=.)([A-Z])/', function ($m) { |
|
| 176 | - return '_' . strtolower($m[1]); |
|
| 175 | + $this->underscore_name = lcfirst(preg_replace_callback('/(?<=.)([A-Z])/', function($m) { |
|
| 176 | + return '_'.strtolower($m[1]); |
|
| 177 | 177 | }, $class_name)); |
| 178 | 178 | |
| 179 | - $template_name = $this->underscore_name . '.latte'; |
|
| 179 | + $template_name = $this->underscore_name.'.latte'; |
|
| 180 | 180 | $this->log_type = $this->underscore_name; |
| 181 | 181 | |
| 182 | 182 | if ($this->template_file) { |