@@ -169,26 +169,26 @@ |
||
169 | 169 | } |
170 | 170 | } |
171 | 171 | |
172 | - $site = URLDecode::getSite(); |
|
172 | + $site = URLDecode::getSite(); |
|
173 | 173 | |
174 | - if ($site == 'blog') { |
|
175 | - $subject = "New Comment on Jacob Emerick's Blog"; |
|
176 | - $message = "Hello!\nThere has been a new comment on the post '{$this->page_title}' at Jacob Emerick's Blog. You have chosen to be notified of it - please reply to [email protected] if you would like to be removed from these notifications.\n\nOn " . date('F j, Y g:i a') . ", " . Request::getPost('name') . " commented...\n" . Request::getPost('comment') . "\n\nVisit {$this->full_path}#comments to see and reply to all the comments on this post.\nThank you!"; |
|
177 | - } else if ($site == 'waterfalls') { |
|
178 | - $subject = "New Comment on Waterfalls of the Keweenaw"; |
|
179 | - $message = "Hello!\nThere has been a new comment on the page '{$this->page_title}' at Waterfalls of the Keweenaw. You have chosen to be notified of it - please reply to [email protected] if you would like to be removed from these notifications.\n\nOn " . date('F j, Y g:i a') . ", " . Request::getPost('name') . " commented...\n" . Request::getPost('comment') . "\n\nVisit {$this->full_path}#comments to see and reply to all the comments on this post.\nThank you!"; |
|
180 | - } |
|
174 | + if ($site == 'blog') { |
|
175 | + $subject = "New Comment on Jacob Emerick's Blog"; |
|
176 | + $message = "Hello!\nThere has been a new comment on the post '{$this->page_title}' at Jacob Emerick's Blog. You have chosen to be notified of it - please reply to [email protected] if you would like to be removed from these notifications.\n\nOn " . date('F j, Y g:i a') . ", " . Request::getPost('name') . " commented...\n" . Request::getPost('comment') . "\n\nVisit {$this->full_path}#comments to see and reply to all the comments on this post.\nThank you!"; |
|
177 | + } else if ($site == 'waterfalls') { |
|
178 | + $subject = "New Comment on Waterfalls of the Keweenaw"; |
|
179 | + $message = "Hello!\nThere has been a new comment on the page '{$this->page_title}' at Waterfalls of the Keweenaw. You have chosen to be notified of it - please reply to [email protected] if you would like to be removed from these notifications.\n\nOn " . date('F j, Y g:i a') . ", " . Request::getPost('name') . " commented...\n" . Request::getPost('comment') . "\n\nVisit {$this->full_path}#comments to see and reply to all the comments on this post.\nThank you!"; |
|
180 | + } |
|
181 | 181 | |
182 | - global $container; |
|
182 | + global $container; |
|
183 | 183 | |
184 | 184 | foreach($email_recipient_array as $email_recipient) |
185 | 185 | { |
186 | - $sent = $container['mail'] |
|
187 | - ->addTo($email_recipient['email'], $email_recipient['name']) |
|
188 | - ->addBCC($container['config']->admin_email) |
|
189 | - ->setSubject($subject) |
|
190 | - ->setMessage($message); |
|
191 | - ->send(); |
|
186 | + $sent = $container['mail'] |
|
187 | + ->addTo($email_recipient['email'], $email_recipient['name']) |
|
188 | + ->addBCC($container['config']->admin_email) |
|
189 | + ->setSubject($subject) |
|
190 | + ->setMessage($message); |
|
191 | + ->send(); |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | $handle = @fopen($config_path, 'r'); |
9 | 9 | if ($handle === false) { |
10 | - throw new RuntimeException("Could not load config"); |
|
10 | + throw new RuntimeException("Could not load config"); |
|
11 | 11 | } |
12 | 12 | $config = fread($handle, filesize($config_path)); |
13 | 13 | fclose($handle); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $config = json_decode($config); |
16 | 16 | $last_json_error = json_last_error(); |
17 | 17 | if ($last_json_error !== JSON_ERROR_NONE) { |
18 | - throw new RuntimeException("Could not parse config - JSON error detected"); |
|
18 | + throw new RuntimeException("Could not parse config - JSON error detected"); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | // timezones are fun |
@@ -24,34 +24,34 @@ discard block |
||
24 | 24 | // configure the db connections holder |
25 | 25 | $db_connections = new Aura\Sql\ConnectionLocator(); |
26 | 26 | $db_connections->setDefault(function () use ($config) { |
27 | - $connection = $config->database->slave; |
|
28 | - return new Aura\Sql\ExtendedPdo( |
|
29 | - "mysql:host={$connection->host}", |
|
30 | - $connection->user, |
|
31 | - $connection->password |
|
32 | - ); |
|
27 | + $connection = $config->database->slave; |
|
28 | + return new Aura\Sql\ExtendedPdo( |
|
29 | + "mysql:host={$connection->host}", |
|
30 | + $connection->user, |
|
31 | + $connection->password |
|
32 | + ); |
|
33 | 33 | }); |
34 | 34 | $db_connections->setWrite('master', function () use ($config) { |
35 | - $connection = $config->database->master; |
|
36 | - return new Aura\Sql\ExtendedPdo( |
|
37 | - "mysql:host={$connection->host}", |
|
38 | - $connection->user, |
|
39 | - $connection->password |
|
40 | - ); |
|
35 | + $connection = $config->database->master; |
|
36 | + return new Aura\Sql\ExtendedPdo( |
|
37 | + "mysql:host={$connection->host}", |
|
38 | + $connection->user, |
|
39 | + $connection->password |
|
40 | + ); |
|
41 | 41 | }); |
42 | 42 | $db_connections->setRead('slave', function () use ($config) { |
43 | - $connection = $config->database->slave; |
|
44 | - $pdo = new Aura\Sql\ExtendedPdo( |
|
45 | - "mysql:host={$connection->host}", |
|
46 | - $connection->user, |
|
47 | - $connection->password |
|
48 | - ); |
|
43 | + $connection = $config->database->slave; |
|
44 | + $pdo = new Aura\Sql\ExtendedPdo( |
|
45 | + "mysql:host={$connection->host}", |
|
46 | + $connection->user, |
|
47 | + $connection->password |
|
48 | + ); |
|
49 | 49 | |
50 | - $profiler = new Aura\Sql\Profiler(); |
|
51 | - $profiler->setActive(true); |
|
52 | - $pdo->setProfiler($profiler); |
|
50 | + $profiler = new Aura\Sql\Profiler(); |
|
51 | + $profiler->setActive(true); |
|
52 | + $pdo->setProfiler($profiler); |
|
53 | 53 | |
54 | - return $pdo; |
|
54 | + return $pdo; |
|
55 | 55 | }); |
56 | 56 | |
57 | 57 | // setup the profiler |
@@ -67,5 +67,5 @@ discard block |
||
67 | 67 | $container['profiler'] = $profiler; |
68 | 68 | $container['default_timezone'] = new DateTimeZone('America/Phoenix'); |
69 | 69 | $container['mail'] = function ($c) { |
70 | - return new Jacobemerick\Archangel\Archangel(); |
|
70 | + return new Jacobemerick\Archangel\Archangel(); |
|
71 | 71 | }; |