@@ -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() |