@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | foreach ($this->config['chats'] as $idUser) { |
| 43 | 43 | $url = 'https://api.telegram.org/'. $this->config['token'] .'/sendMessage?disable_web_page_preview=true&chat_id='. $idUser |
| 44 | - . '&parse_mode=HTML&text='; |
|
| 44 | + . '&parse_mode=HTML&text='; |
|
| 45 | 45 | |
| 46 | 46 | @file_get_contents($url . $text); |
| 47 | 47 | } |
@@ -35,12 +35,12 @@ |
||
| 35 | 35 | $biggestNumberLength = strlen(max(array_keys($data['file_lines']))); |
| 36 | 36 | foreach ($data['file_lines'] as $num => $line) { |
| 37 | 37 | $num = str_pad($num, $biggestNumberLength, ' ', STR_PAD_LEFT); |
| 38 | - $num = '<code>'. $num .'</code>'; |
|
| 39 | - $text .= urlencode($num .'|<code>'. htmlentities($line) .'</code>'); |
|
| 38 | + $num = '<code>' . $num . '</code>'; |
|
| 39 | + $text .= urlencode($num . '|<code>' . htmlentities($line) . '</code>'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | foreach ($this->config['chats'] as $idUser) { |
| 43 | - $url = 'https://api.telegram.org/'. $this->config['token'] .'/sendMessage?disable_web_page_preview=true&chat_id='. $idUser |
|
| 43 | + $url = 'https://api.telegram.org/' . $this->config['token'] . '/sendMessage?disable_web_page_preview=true&chat_id=' . $idUser |
|
| 44 | 44 | . '&parse_mode=HTML&text='; |
| 45 | 45 | |
| 46 | 46 | @file_get_contents($url . $text); |
@@ -48,11 +48,11 @@ |
||
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | $url = 'https://slack.com/api/chat.postMessage?' |
| 51 | - . 'token='. $this->config['token'] |
|
| 52 | - . '&channel='. urlencode($this->config['channel']) |
|
| 53 | - . '&text='. urlencode($text) |
|
| 54 | - . '&username='. urlencode($this->config['username']) |
|
| 55 | - . '&as_user=false&icon_url=http%3A%2F%2Fcherry-pie.co%2Fimg%2Flog-envelope.png&mrkdwn=1&pretty=1&attachments='. urlencode(json_encode([$attachments])); |
|
| 51 | + . 'token='. $this->config['token'] |
|
| 52 | + . '&channel='. urlencode($this->config['channel']) |
|
| 53 | + . '&text='. urlencode($text) |
|
| 54 | + . '&username='. urlencode($this->config['username']) |
|
| 55 | + . '&as_user=false&icon_url=http%3A%2F%2Fcherry-pie.co%2Fimg%2Flog-envelope.png&mrkdwn=1&pretty=1&attachments='. urlencode(json_encode([$attachments])); |
|
| 56 | 56 | |
| 57 | 57 | @file_get_contents($url); |
| 58 | 58 | } // end send |
@@ -43,16 +43,16 @@ |
||
| 43 | 43 | $line = preg_replace('~[\r\n]~', '', $line); |
| 44 | 44 | // double spaces, so in slack it'll be more readable |
| 45 | 45 | $line = preg_replace('~(\s+)~', "$1$1", $line); |
| 46 | - $attachments['text'] .= $num .'| '. $line ."\n"; |
|
| 46 | + $attachments['text'] .= $num . '| ' . $line . "\n"; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | $url = 'https://slack.com/api/chat.postMessage?' |
| 51 | - . 'token='. $this->config['token'] |
|
| 52 | - . '&channel='. urlencode($this->config['channel']) |
|
| 53 | - . '&text='. urlencode($text) |
|
| 54 | - . '&username='. urlencode($this->config['username']) |
|
| 55 | - . '&as_user=false&icon_url=http%3A%2F%2Fcherry-pie.co%2Fimg%2Flog-envelope.png&mrkdwn=1&pretty=1&attachments='. urlencode(json_encode([$attachments])); |
|
| 51 | + . 'token=' . $this->config['token'] |
|
| 52 | + . '&channel=' . urlencode($this->config['channel']) |
|
| 53 | + . '&text=' . urlencode($text) |
|
| 54 | + . '&username=' . urlencode($this->config['username']) |
|
| 55 | + . '&as_user=false&icon_url=http%3A%2F%2Fcherry-pie.co%2Fimg%2Flog-envelope.png&mrkdwn=1&pretty=1&attachments=' . urlencode(json_encode([$attachments])); |
|
| 56 | 56 | |
| 57 | 57 | @file_get_contents($url); |
| 58 | 58 | } // end send |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | protected function prepare() |
| 11 | 11 | { |
| 12 | 12 | $this->config['from_name'] = $this->config['from_name'] ?: 'Log Envelope'; |
| 13 | - $this->config['from_email'] = $this->config['from_email'] ?: 'logenvelope@'. $this->data['host']; |
|
| 13 | + $this->config['from_email'] = $this->config['from_email'] ?: 'logenvelope@' . $this->data['host']; |
|
| 14 | 14 | } // end prepare |
| 15 | 15 | |
| 16 | 16 | protected function check() |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | MailFacade::queue('log-envelope::main', $data, function($message) use ($data, $config) { |
| 37 | 37 | $subject = sprintf('[%s] @ %s: %s', $data['class'], $data['host'], $data['exception']); |
| 38 | 38 | |
| 39 | - // to protect from gmail's anchors automatic generation |
|
| 39 | + // to protect from gmail's anchors automatic generation |
|
| 40 | 40 | $message->setBody( |
| 41 | 41 | preg_replace( |
| 42 | 42 | ['~\.~', '~http~'], |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | ) |
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | - $message->to($config['to']) |
|
| 49 | - ->from($config['from_email'], $config['from_name']) |
|
| 50 | - ->subject($subject); |
|
| 48 | + $message->to($config['to']) |
|
| 49 | + ->from($config['from_email'], $config['from_name']) |
|
| 50 | + ->subject($subject); |
|
| 51 | 51 | }); |
| 52 | 52 | } // end send |
| 53 | 53 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $subject = sprintf('[%s] @ %s: %s', $this->data['class'], $this->data['host'], $this->data['exception']); |
| 30 | 30 | |
| 31 | 31 | // to protect from gmail's anchors automatic generating |
| 32 | - $this->withSwiftMessage(function ($message) { |
|
| 32 | + $this->withSwiftMessage(function($message) { |
|
| 33 | 33 | $message->setBody( |
| 34 | 34 | preg_replace( |
| 35 | 35 | ['~\.~', '~http~'], |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | |
| 20 | 20 | $data = $this->data; |
| 21 | 21 | |
| 22 | - $data['exegutor'] = implode('<br>', array_map($data['exegutor'], function ($item) { |
|
| 22 | + $data['exegutor'] = implode('<br>', array_map($data['exegutor'], function($item) { |
|
| 23 | 23 | return $item['wrap_left'] . $item['line'] . $item['wrap_right']; |
| 24 | 24 | })); |
| 25 | 25 | $data['lines'] = implode("\n", $data['lines']); |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | } |
| 154 | 154 | $file->seek($index); |
| 155 | 155 | |
| 156 | - if($file->eof()) { |
|
| 156 | + if ($file->eof()) { |
|
| 157 | 157 | return [false, false]; |
| 158 | 158 | } |
| 159 | 159 | |