@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->_path = $path; |
| 39 | 39 | |
| 40 | - /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
|
| 41 | - if ( |
|
| 40 | + /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
|
| 41 | + if ( |
|
| 42 | 42 | !file_exists($this->_path) |
| 43 | 43 | && |
| 44 | 44 | !@mkdir($this->_path, 0777, true) |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | return false; |
| 108 | 108 | } |
| 109 | 109 | return fclose($fp); |
| 110 | - } |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | 112 | /* The file already exists, we try a longer fileName */ |
| 113 | 113 | $fileName .= $this->getRandomString(1); |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | public function queueMessage(Swift_Mime_Message $message) |
| 98 | 98 | { |
| 99 | 99 | $ser = serialize($message); |
| 100 | - $fileName = $this->_path . '/' . $this->getRandomString(); |
|
| 100 | + $fileName = $this->_path.'/'.$this->getRandomString(); |
|
| 101 | 101 | for ($i = 0; $i < $this->_retryLimit; ++$i) { |
| 102 | 102 | /* We try an exclusive creation of the file. This is an atomic operation, it avoid locking mechanism */ |
| 103 | 103 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 104 | - $fp = @fopen($fileName . '.message', 'xb'); |
|
| 104 | + $fp = @fopen($fileName.'.message', 'xb'); |
|
| 105 | 105 | if (false !== $fp) { |
| 106 | 106 | if (false === fwrite($fp, $ser)) { |
| 107 | 107 | return false; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - $failedRecipients = (array)$failedRecipients; |
|
| 160 | + $failedRecipients = (array) $failedRecipients; |
|
| 161 | 161 | $count = 0; |
| 162 | 162 | $time = time(); |
| 163 | 163 | foreach ($directoryIterator as $file) { |
@@ -168,13 +168,13 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /* We try a rename, it's an atomic operation, and avoid locking the file */ |
| 171 | - if (rename($file, $file . '.sending')) { |
|
| 171 | + if (rename($file, $file.'.sending')) { |
|
| 172 | 172 | // TODO: -> SECURITY | Perhaps it's possible to exploit the unserialize via: file_get_contents(...) |
| 173 | - $message = unserialize(file_get_contents($file . '.sending')); |
|
| 173 | + $message = unserialize(file_get_contents($file.'.sending')); |
|
| 174 | 174 | |
| 175 | 175 | $count += $transport->send($message, $failedRecipients); |
| 176 | 176 | |
| 177 | - unlink($file . '.sending'); |
|
| 177 | + unlink($file.'.sending'); |
|
| 178 | 178 | } else { |
| 179 | 179 | /* This message has just been catched by another process */ |
| 180 | 180 | continue; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $ret = ''; |
| 212 | 212 | $strlen = strlen($base) - 1; |
| 213 | 213 | for ($i = 0; $i < $count; ++$i) { |
| 214 | - $ret .= $base[(int)mt_rand(0, $strlen)]; |
|
| 214 | + $ret .= $base[(int) mt_rand(0, $strlen)]; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | return $ret; |
@@ -101,8 +101,8 @@ |
||
| 101 | 101 | return $staticStrtolowerCache[$string]; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $staticStrtolowerCache[$string] = strtolower($string); |
|
| 104 | + $staticStrtolowerCache[$string] = strtolower($string); |
|
| 105 | 105 | |
| 106 | - return $staticStrtolowerCache[$string]; |
|
| 106 | + return $staticStrtolowerCache[$string]; |
|
| 107 | 107 | } |
| 108 | 108 | } |