@@ -302,17 +302,17 @@ |
||
| 302 | 302 | $startTime = microtime(true); |
| 303 | 303 | $record = new $params['clearTaggedClass'](); |
| 304 | 304 | $records = $record->loadAll(); |
| 305 | - self::$logger->info('Loaded all of the active records (elapsed time ['.round(microtime(true) - $startTime, 5).'] seconds)'); |
|
| 305 | + self::$logger->info('Loaded all of the active records (elapsed time ['.round(microtime(true)-$startTime, 5).'] seconds)'); |
|
| 306 | 306 | ActiveRecord::begin(); |
| 307 | 307 | $tag = new Tag(); |
| 308 | 308 | $tag->deleteAllByAttribute('taggedClass', $params['clearTaggedClass']); |
| 309 | - self::$logger->info('Deleted all of the old tags (elapsed time ['.round(microtime(true) - $startTime, 5).'] seconds)'); |
|
| 309 | + self::$logger->info('Deleted all of the old tags (elapsed time ['.round(microtime(true)-$startTime, 5).'] seconds)'); |
|
| 310 | 310 | $this->regenerateTagsOnRecords($records); |
| 311 | - self::$logger->info('Saved all of the new tags (elapsed time ['.round(microtime(true) - $startTime, 5).'] seconds)'); |
|
| 311 | + self::$logger->info('Saved all of the new tags (elapsed time ['.round(microtime(true)-$startTime, 5).'] seconds)'); |
|
| 312 | 312 | self::$logger->action('Tags recreated on the ['.$params['clearTaggedClass'].'] class'); |
| 313 | 313 | ActiveRecord::commit(); |
| 314 | 314 | $this->setStatusMessage(View::displayUpdateMessage('Tags recreated on the '.$record->getFriendlyClassName().' class.')); |
| 315 | - self::$logger->info('Tags recreated on the ['.$params['clearTaggedClass'].'] class (time taken ['.round(microtime(true) - $startTime, 5).'] seconds).'); |
|
| 315 | + self::$logger->info('Tags recreated on the ['.$params['clearTaggedClass'].'] class (time taken ['.round(microtime(true)-$startTime, 5).'] seconds).'); |
|
| 316 | 316 | } catch (AlphaException $e) { |
| 317 | 317 | self::$logger->error($e->getMessage()); |
| 318 | 318 | ActiveRecord::rollback(); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $config = ConfigProvider::getInstance(); |
| 200 | 200 | |
| 201 | 201 | // used to track when our pagination range ends |
| 202 | - $end = ($this->startPoint + $config->get('app.list.page.amount')); |
|
| 202 | + $end = ($this->startPoint+$config->get('app.list.page.amount')); |
|
| 203 | 203 | |
| 204 | 204 | $body = ''; |
| 205 | 205 | |
@@ -289,14 +289,14 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | $body = ''; |
| 291 | 291 | |
| 292 | - $end = ($this->startPoint + $config->get('app.list.page.amount')); |
|
| 292 | + $end = ($this->startPoint+$config->get('app.list.page.amount')); |
|
| 293 | 293 | |
| 294 | 294 | if ($end > $this->resultCount) { |
| 295 | 295 | $end = $this->resultCount; |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | if ($this->resultCount > 0) { |
| 299 | - $body .= '<p align="center">Displaying '.($this->startPoint + 1).' to '.$end.' of <strong>'.$this->resultCount.'</strong>. '; |
|
| 299 | + $body .= '<p align="center">Displaying '.($this->startPoint+1).' to '.$end.' of <strong>'.$this->resultCount.'</strong>. '; |
|
| 300 | 300 | } else { |
| 301 | 301 | if (!empty($this->query)) { |
| 302 | 302 | $body .= View::displayUpdateMessage('There were no search results for your query.'); |
@@ -308,9 +308,9 @@ discard block |
||
| 308 | 308 | if ($this->startPoint > 0) { |
| 309 | 309 | // handle secure URLs |
| 310 | 310 | if (isset($params['tk'])) { |
| 311 | - $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint - $config->get('app.list.page.amount'))).'">«</a></li>'; |
|
| 311 | + $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint-$config->get('app.list.page.amount'))).'">«</a></li>'; |
|
| 312 | 312 | } else { |
| 313 | - $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/start/'.($this->startPoint - $config->get('app.list.page.amount')).'">«</a></li>'; |
|
| 313 | + $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/start/'.($this->startPoint-$config->get('app.list.page.amount')).'">«</a></li>'; |
|
| 314 | 314 | } |
| 315 | 315 | } elseif ($this->resultCount > $config->get('app.list.page.amount')) { |
| 316 | 316 | $body .= '<li class="disabled"><a href="#">«</a></li>'; |
@@ -336,9 +336,9 @@ discard block |
||
| 336 | 336 | if ($this->resultCount > $end) { |
| 337 | 337 | // handle secure URLs |
| 338 | 338 | if (isset($params['tk'])) { |
| 339 | - $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint + $config->get('app.list.page.amount'))).'">Next->></a></li>'; |
|
| 339 | + $body .= '<li><a href="'.FrontController::generateSecureURL('act=Search&q='.$this->query.'&start='.($this->startPoint+$config->get('app.list.page.amount'))).'">Next->></a></li>'; |
|
| 340 | 340 | } else { |
| 341 | - $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/start/'.($this->startPoint + $config->get('app.list.page.amount')).'">»</a></li>'; |
|
| 341 | + $body .= '<li><a href="'.$config->get('app.url').'/search/'.$this->query.'/start/'.($this->startPoint+$config->get('app.list.page.amount')).'">»</a></li>'; |
|
| 342 | 342 | } |
| 343 | 343 | } elseif ($this->resultCount > $config->get('app.list.page.amount')) { |
| 344 | 344 | $body .= '<li class="disabled"><a href="#">»</a></li>'; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | if (isset($matches[$key])) { |
| 123 | 123 | // increment the weight if the same BO is tagged more than once |
| 124 | - $weight = intval($matches[$key]) + 1; |
|
| 124 | + $weight = intval($matches[$key])+1; |
|
| 125 | 125 | $matches[$key] = $weight; |
| 126 | 126 | } else { |
| 127 | 127 | $matches[$key] = 1; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $this->numberFound = count($matches); |
| 142 | 142 | |
| 143 | 143 | // now paginate |
| 144 | - $matches = array_slice($matches, $start, $limit + 5); // the +5 is just some padding in case of orphans |
|
| 144 | + $matches = array_slice($matches, $start, $limit+5); // the +5 is just some padding in case of orphans |
|
| 145 | 145 | |
| 146 | 146 | // now load each object |
| 147 | 147 | foreach ($matches as $key => $weight) { |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | if (isset($matches[$key])) { |
| 229 | 229 | // increment the weight if the same BO is tagged more than once |
| 230 | - $weight = intval($matches[$key]) + 1; |
|
| 230 | + $weight = intval($matches[$key])+1; |
|
| 231 | 231 | $matches[$key] = $weight; |
| 232 | 232 | } else { |
| 233 | 233 | $matches[$key] = 1; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | $this->endTime = microtime(true); |
| 169 | 169 | |
| 170 | - $this->duration = $this->endTime - $this->startTime; |
|
| 170 | + $this->duration = $this->endTime-$this->startTime; |
|
| 171 | 171 | |
| 172 | 172 | $logfile = new LogProviderFile(); |
| 173 | 173 | $logfile->setPath($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv'); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $this->endTime = microtime(true); |
| 191 | 191 | |
| 192 | - $this->duration = $this->endTime - $this->startTime; |
|
| 192 | + $this->duration = $this->endTime-$this->startTime; |
|
| 193 | 193 | |
| 194 | 194 | $logfile = new LogProviderFile(); |
| 195 | 195 | $logfile->setPath($config->get('app.file.store.dir').'logs/kpi-'.$this->name->getValue().'.csv'); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | if ($this->level == 'DEBUG' || in_array($this->classname, $this->debugClasses)) { |
| 130 | 130 | $dateTime = date('Y-m-d H:i:s'); |
| 131 | 131 | $this->logProvider->writeLine(array($dateTime, 'DEBUG', $this->classname, $message, |
| 132 | - $this->request->getUserAgent(), $this->request->getIP(), gethostname(), )); |
|
| 132 | + $this->request->getUserAgent(), $this->request->getIP(), gethostname(),)); |
|
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if ($this->level == 'DEBUG' || $this->level == 'INFO' || in_array($this->classname, $this->debugClasses)) { |
| 146 | 146 | $dateTime = date('Y-m-d H:i:s'); |
| 147 | 147 | $this->logProvider->writeLine(array($dateTime, 'INFO', $this->classname, $message, |
| 148 | - $this->request->getUserAgent(), $this->request->getIP(), gethostname(), )); |
|
| 148 | + $this->request->getUserAgent(), $this->request->getIP(), gethostname(),)); |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | if ($this->level == 'DEBUG' || $this->level == 'INFO' || $this->level == 'WARN' || in_array($this->classname, $this->debugClasses)) { |
| 162 | 162 | $dateTime = date('Y-m-d H:i:s'); |
| 163 | 163 | $this->logProvider->writeLine(array($dateTime, 'WARN', $this->classname, $message, |
| 164 | - $this->request->getUserAgent(), $this->request->getIP(), gethostname(), )); |
|
| 164 | + $this->request->getUserAgent(), $this->request->getIP(), gethostname(),)); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | { |
| 141 | 141 | $size = filesize($this->path); |
| 142 | 142 | |
| 143 | - return ($size / 1024) / 1024; |
|
| 143 | + return ($size/1024)/1024; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | * |
| 114 | 114 | * @since 1.0 |
| 115 | 115 | */ |
| 116 | - protected $tagMap = array('item' => 'item','feeddesc' => 'description','itemdesc' => 'description'); |
|
| 116 | + protected $tagMap = array('item' => 'item', 'feeddesc' => 'description', 'itemdesc' => 'description'); |
|
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | 119 | * The BO which we will serve up in this feed. |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | if (isset($codeTypeTag[0])) { |
| 75 | 75 | $start = mb_strpos($codeTypeTag[0], '['); |
| 76 | 76 | $end = mb_strpos($codeTypeTag[0], ']'); |
| 77 | - $language = mb_substr($codeTypeTag[0], $start + 1, $end - ($start + 1)); |
|
| 77 | + $language = mb_substr($codeTypeTag[0], $start+1, $end-($start+1)); |
|
| 78 | 78 | } else { |
| 79 | 79 | // will use php as a defualt language type when none is provided |
| 80 | 80 | $language = 'php'; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if (isset($title)) { |
| 127 | 127 | $title = str_replace('"', '"', $title); |
| 128 | 128 | $title = $this->encodeAmpsAndAngles($title); |
| 129 | - $result .= " title=\"$title\""; |
|
| 129 | + $result .= " title=\"$title\""; |
|
| 130 | 130 | } |
| 131 | 131 | if ($external) { |
| 132 | 132 | $result .= " target=\"$url\""; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | foreach ($attachments[0] as $attachmentURL) { |
| 157 | 157 | $start = mb_strpos($attachmentURL, '/'); |
| 158 | 158 | $end = mb_strrpos($attachmentURL, '"'); |
| 159 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
| 159 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
| 160 | 160 | |
| 161 | 161 | if (method_exists($this->BO, 'getAttachmentSecureURL')) { |
| 162 | 162 | $this->content = str_replace($attachmentURL, 'href='.$this->BO->getAttachmentSecureURL($fileName), $this->content); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | foreach ($attachments[0] as $attachmentURL) { |
| 171 | 171 | $start = mb_strpos($attachmentURL, '/'); |
| 172 | 172 | $end = mb_strrpos($attachmentURL, '" alt'); |
| 173 | - $fileName = mb_substr($attachmentURL, $start + 1, $end - ($start + 1)); |
|
| 173 | + $fileName = mb_substr($attachmentURL, $start+1, $end-($start+1)); |
|
| 174 | 174 | |
| 175 | 175 | if ($config->get('cms.images.widget')) { |
| 176 | 176 | // get the details of the source image |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $type = 'png'; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean) $config->get('cms.images.widget.secure')); |
|
| 188 | + $img = new Image($path, $image_details[0], $image_details[1], $type, 0.95, false, (boolean)$config->get('cms.images.widget.secure')); |
|
| 189 | 189 | $this->content = str_replace($attachmentURL, $img->renderHTMLLink(), $this->content); |
| 190 | 190 | } else { |
| 191 | 191 | // render a normal image link to the ViewAttachment controller |