@@ -19,7 +19,7 @@ |
||
19 | 19 | (object) array( |
20 | 20 | 'match' => '/get/portfolioImage.json', |
21 | 21 | 'controller' => 'GetPortfolioImageController'), |
22 | - ); |
|
22 | + ); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | } |
@@ -46,16 +46,16 @@ |
||
46 | 46 | 'value' => Request::getPost()); |
47 | 47 | } |
48 | 48 | |
49 | - global $container; |
|
50 | - $sent = $container['mail'] |
|
51 | - ->addTo($container['config']->admin_email) |
|
52 | - ->setSubject('Site Contact') |
|
53 | - ->setPlainMessage( |
|
54 | - 'Name: ' . Request::getPost('name') . "\n" . |
|
55 | - 'Email: ' . Request::getPost('email') . "\n" . |
|
56 | - 'Message: ' . Request::getPost('message') |
|
57 | - ) |
|
58 | - ->send(); |
|
49 | + global $container; |
|
50 | + $sent = $container['mail'] |
|
51 | + ->addTo($container['config']->admin_email) |
|
52 | + ->setSubject('Site Contact') |
|
53 | + ->setPlainMessage( |
|
54 | + 'Name: ' . Request::getPost('name') . "\n" . |
|
55 | + 'Email: ' . Request::getPost('email') . "\n" . |
|
56 | + 'Message: ' . Request::getPost('message') |
|
57 | + ) |
|
58 | + ->send(); |
|
59 | 59 | |
60 | 60 | return array( |
61 | 61 | 'success_message' => "Thank you for your message, " . Request::getPost('name') . "! I'll get back to you as soon as possible."); |
@@ -44,16 +44,16 @@ |
||
44 | 44 | 'value' => Request::getPost()); |
45 | 45 | } |
46 | 46 | |
47 | - global $container; |
|
48 | - $sent = $container['mail'] |
|
49 | - ->addTo($container['config']->admin_email) |
|
50 | - ->setSubject('Portfolio Contact') |
|
51 | - ->setPlainMessage( |
|
52 | - 'Name: ' . Request::getPost('name') . "\n" . |
|
53 | - 'Email: ' . Request::getPost('email') . "\n" . |
|
54 | - 'Message: ' . Request::getPost('message') |
|
55 | - ) |
|
56 | - ->send(); |
|
47 | + global $container; |
|
48 | + $sent = $container['mail'] |
|
49 | + ->addTo($container['config']->admin_email) |
|
50 | + ->setSubject('Portfolio Contact') |
|
51 | + ->setPlainMessage( |
|
52 | + 'Name: ' . Request::getPost('name') . "\n" . |
|
53 | + 'Email: ' . Request::getPost('email') . "\n" . |
|
54 | + 'Message: ' . Request::getPost('message') |
|
55 | + ) |
|
56 | + ->send(); |
|
57 | 57 | |
58 | 58 | return array( |
59 | 59 | 'success_message' => "Thank you for your message, ".Request::getPost('name')."! I'll get back to you as soon as possible."); |
@@ -58,16 +58,16 @@ |
||
58 | 58 | 'values' => $values); |
59 | 59 | } |
60 | 60 | |
61 | - global $container; |
|
62 | - $sent = $container['mail'] |
|
63 | - ->addTo($container['config']->admin_email) |
|
64 | - ->setSubject('Waterfall Site Contact') |
|
65 | - ->setPlainMessage( |
|
66 | - "Name: {$values->name}\n" . |
|
67 | - "Email: {$values->email}\n" . |
|
68 | - "Message: {$values->message}" |
|
69 | - ) |
|
70 | - ->send(); |
|
61 | + global $container; |
|
62 | + $sent = $container['mail'] |
|
63 | + ->addTo($container['config']->admin_email) |
|
64 | + ->setSubject('Waterfall Site Contact') |
|
65 | + ->setPlainMessage( |
|
66 | + "Name: {$values->name}\n" . |
|
67 | + "Email: {$values->email}\n" . |
|
68 | + "Message: {$values->message}" |
|
69 | + ) |
|
70 | + ->send(); |
|
71 | 71 | |
72 | 72 | return (object) array('display' => 'success'); |
73 | 73 | } |
@@ -60,16 +60,16 @@ |
||
60 | 60 | 'values' => $values); |
61 | 61 | } |
62 | 62 | |
63 | - global $container; |
|
64 | - $sent = $container['mail'] |
|
65 | - ->addTo($container['config']->admin_email) |
|
66 | - ->setSubject('Home Page Contact') |
|
67 | - ->setPlainMessage( |
|
68 | - "Name: {$values->name}\n" . |
|
69 | - "Email: {$values->email}\n" . |
|
70 | - "Message: {$values->message}" |
|
71 | - ) |
|
72 | - ->send(); |
|
63 | + global $container; |
|
64 | + $sent = $container['mail'] |
|
65 | + ->addTo($container['config']->admin_email) |
|
66 | + ->setSubject('Home Page Contact') |
|
67 | + ->setPlainMessage( |
|
68 | + "Name: {$values->name}\n" . |
|
69 | + "Email: {$values->email}\n" . |
|
70 | + "Message: {$values->message}" |
|
71 | + ) |
|
72 | + ->send(); |
|
73 | 73 | |
74 | 74 | return (object) array('display' => 'success'); |
75 | 75 | } |
@@ -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 | }; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | // configure the db connections holder |
25 | 25 | $db_connections = new Aura\Sql\ConnectionLocator(); |
26 | -$db_connections->setDefault(function () use ($config) { |
|
26 | +$db_connections->setDefault(function() use ($config) { |
|
27 | 27 | $connection = $config->database->slave; |
28 | 28 | return new Aura\Sql\ExtendedPdo( |
29 | 29 | "mysql:host={$connection->host}", |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $connection->password |
32 | 32 | ); |
33 | 33 | }); |
34 | -$db_connections->setWrite('master', function () use ($config) { |
|
34 | +$db_connections->setWrite('master', function() use ($config) { |
|
35 | 35 | $connection = $config->database->master; |
36 | 36 | return new Aura\Sql\ExtendedPdo( |
37 | 37 | "mysql:host={$connection->host}", |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $connection->password |
40 | 40 | ); |
41 | 41 | }); |
42 | -$db_connections->setRead('slave', function () use ($config) { |
|
42 | +$db_connections->setRead('slave', function() use ($config) { |
|
43 | 43 | $connection = $config->database->slave; |
44 | 44 | $pdo = new Aura\Sql\ExtendedPdo( |
45 | 45 | "mysql:host={$connection->host}", |
@@ -66,6 +66,6 @@ discard block |
||
66 | 66 | $container['console'] = $console; |
67 | 67 | $container['profiler'] = $profiler; |
68 | 68 | $container['default_timezone'] = new DateTimeZone('America/Phoenix'); |
69 | -$container['mail'] = function ($c) { |
|
69 | +$container['mail'] = function($c) { |
|
70 | 70 | return new Jacobemerick\Archangel\Archangel(); |
71 | 71 | }; |