@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | protected function set_head_data() |
20 | 20 | { |
21 | - $this->set_head('rss_link', [ |
|
22 | - 'title' => 'Jacob Emerick Blog Feed', |
|
23 | - 'url' => '/rss.xml' |
|
24 | - ]); |
|
25 | - $this->set_head('rss_comment_link', [ |
|
26 | - 'title' => 'Jacob Emerick Blog Comment Feed', |
|
27 | - 'url' => '/rss-comments.xml' |
|
28 | - ]); |
|
21 | + $this->set_head('rss_link', [ |
|
22 | + 'title' => 'Jacob Emerick Blog Feed', |
|
23 | + 'url' => '/rss.xml' |
|
24 | + ]); |
|
25 | + $this->set_head('rss_comment_link', [ |
|
26 | + 'title' => 'Jacob Emerick Blog Comment Feed', |
|
27 | + 'url' => '/rss-comments.xml' |
|
28 | + ]); |
|
29 | 29 | |
30 | 30 | $this->add_css('normalize'); |
31 | 31 | $this->add_css('blog'); |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | |
88 | 88 | final private function get_tags_for_post($post) |
89 | 89 | { |
90 | - global $container; |
|
91 | - $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']); |
|
92 | - $tag_result = $repository->getTagsForPost($post['id']); |
|
90 | + global $container; |
|
91 | + $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']); |
|
92 | + $tag_result = $repository->getTagsForPost($post['id']); |
|
93 | 93 | |
94 | - $tag_array = array(); |
|
94 | + $tag_array = array(); |
|
95 | 95 | foreach($tag_result as $tag) |
96 | 96 | { |
97 | 97 | $tag_object = new stdclass(); |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | |
126 | 126 | final private function get_tag_cloud() |
127 | 127 | { |
128 | - global $container; |
|
129 | - $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']); |
|
130 | - $tag_result = $repository->getTagCloud(); |
|
128 | + global $container; |
|
129 | + $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']); |
|
130 | + $tag_result = $repository->getTagCloud(); |
|
131 | 131 | |
132 | 132 | $maximum_tag_count = $this->get_maximum_tag_count($tag_result); |
133 | 133 | |
@@ -176,49 +176,49 @@ discard block |
||
176 | 176 | $array[] = $comment_obj; |
177 | 177 | } |
178 | 178 | |
179 | - $comment_service_array = $this->get_comments_from_service(); |
|
180 | - if ($comment_service_array !== $array) { |
|
181 | - global $container; |
|
182 | - $container['console']->log('Mismatch between comment service and legacy db'); |
|
183 | - $container['console']->log($comment_service_array[0]); |
|
184 | - $container['console']->log($array[0]); |
|
185 | - } |
|
179 | + $comment_service_array = $this->get_comments_from_service(); |
|
180 | + if ($comment_service_array !== $array) { |
|
181 | + global $container; |
|
182 | + $container['console']->log('Mismatch between comment service and legacy db'); |
|
183 | + $container['console']->log($comment_service_array[0]); |
|
184 | + $container['console']->log($array[0]); |
|
185 | + } |
|
186 | 186 | return $array; |
187 | 187 | } |
188 | 188 | |
189 | - final private function get_comments_from_service() |
|
190 | - { |
|
191 | - global $config; |
|
192 | - $configuration = new Jacobemerick\CommentService\Configuration(); |
|
193 | - $configuration->setUsername($config->comments->user); |
|
194 | - $configuration->setPassword($config->comments->password); |
|
195 | - $configuration->addDefaultHeader('Content-Type', 'application/json'); |
|
196 | - $configuration->setHost($config->comments->host); |
|
197 | - $configuration->setCurlTimeout($config->comments->timeout); |
|
198 | - |
|
199 | - $client = new Jacobemerick\CommentService\ApiClient($configuration); |
|
200 | - $api = new Jacobemerick\CommentService\Api\DefaultApi($client); |
|
201 | - |
|
202 | - $start = microtime(true); |
|
203 | - $comment_response = $api->getComments(1, self::$RECENT_COMMENT_COUNT, '-date', 'blog.jacobemerick.com'); |
|
204 | - $elapsed = microtime(true) - $start; |
|
205 | - global $container; |
|
206 | - $container['logger']->info("CommentService | Sidebar | {$elapsed}"); |
|
207 | - |
|
208 | - $array = array(); |
|
209 | - foreach($comment_response as $comment) |
|
210 | - { |
|
211 | - $body = $comment->getBody(); |
|
212 | - $body = Content::instance('CleanComment', $body)->activate(); |
|
213 | - $body = strip_tags($body); |
|
214 | - |
|
215 | - $comment_obj = new stdclass(); |
|
216 | - $comment_obj->description = Content::instance('SmartTrim', $body)->activate(30); |
|
217 | - $comment_obj->commenter = $comment->getCommenter()->getName(); |
|
218 | - $comment_obj->link = "{$comment->getUrl()}/#comment-{$comment->getId()}"; |
|
219 | - $array[] = $comment_obj; |
|
220 | - } |
|
221 | - return $array; |
|
222 | - } |
|
189 | + final private function get_comments_from_service() |
|
190 | + { |
|
191 | + global $config; |
|
192 | + $configuration = new Jacobemerick\CommentService\Configuration(); |
|
193 | + $configuration->setUsername($config->comments->user); |
|
194 | + $configuration->setPassword($config->comments->password); |
|
195 | + $configuration->addDefaultHeader('Content-Type', 'application/json'); |
|
196 | + $configuration->setHost($config->comments->host); |
|
197 | + $configuration->setCurlTimeout($config->comments->timeout); |
|
198 | + |
|
199 | + $client = new Jacobemerick\CommentService\ApiClient($configuration); |
|
200 | + $api = new Jacobemerick\CommentService\Api\DefaultApi($client); |
|
201 | + |
|
202 | + $start = microtime(true); |
|
203 | + $comment_response = $api->getComments(1, self::$RECENT_COMMENT_COUNT, '-date', 'blog.jacobemerick.com'); |
|
204 | + $elapsed = microtime(true) - $start; |
|
205 | + global $container; |
|
206 | + $container['logger']->info("CommentService | Sidebar | {$elapsed}"); |
|
207 | + |
|
208 | + $array = array(); |
|
209 | + foreach($comment_response as $comment) |
|
210 | + { |
|
211 | + $body = $comment->getBody(); |
|
212 | + $body = Content::instance('CleanComment', $body)->activate(); |
|
213 | + $body = strip_tags($body); |
|
214 | + |
|
215 | + $comment_obj = new stdclass(); |
|
216 | + $comment_obj->description = Content::instance('SmartTrim', $body)->activate(30); |
|
217 | + $comment_obj->commenter = $comment->getCommenter()->getName(); |
|
218 | + $comment_obj->link = "{$comment->getUrl()}/#comment-{$comment->getId()}"; |
|
219 | + $array[] = $comment_obj; |
|
220 | + } |
|
221 | + return $array; |
|
222 | + } |
|
223 | 223 | |
224 | 224 | } |