@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param array $parameters |
| 41 | 41 | * @param $matchedSitemapItem |
| 42 | 42 | */ |
| 43 | - public function __construct($template='', Request $request, $parameters=array(), $matchedSitemapItem) |
|
| 43 | + public function __construct($template = '', Request $request, $parameters = array(), $matchedSitemapItem) |
|
| 44 | 44 | { |
| 45 | 45 | $this->template = $template; |
| 46 | 46 | $this->request = $request; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * |
| 66 | 66 | * @throws \Exception |
| 67 | 67 | */ |
| 68 | - public function render($application=null) |
|
| 68 | + public function render($application = null) |
|
| 69 | 69 | { |
| 70 | 70 | $this->renderedContent = $this->renderTemplate($this->template, true, $application); |
| 71 | 71 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @return string |
| 92 | 92 | * @throws \Exception |
| 93 | 93 | */ |
| 94 | - public function renderTemplate($template='', $obClean = true, $application=null) |
|
| 94 | + public function renderTemplate($template = '', $obClean = true, $application = null) |
|
| 95 | 95 | { |
| 96 | 96 | $templatePath = $this->getTemplatePath($template, $application); |
| 97 | 97 | if (realpath($templatePath) !== false) { |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | return ob_get_contents(); |
| 111 | 111 | } else { |
| 112 | 112 | if ($template !== null) { // If template is null, its a application component, which doesnt have a template |
| 113 | - throw new \Exception('Couldnt find template ' . $templatePath); |
|
| 113 | + throw new \Exception('Couldnt find template '.$templatePath); |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @return string |
| 126 | 126 | * @throws \Exception |
| 127 | 127 | */ |
| 128 | - public function includeTemplate($template='', $parameters = array()) |
|
| 128 | + public function includeTemplate($template = '', $parameters = array()) |
|
| 129 | 129 | { |
| 130 | 130 | if (is_array($parameters)) { |
| 131 | 131 | foreach ($parameters as $name => $value) { |
@@ -145,10 +145,10 @@ discard block |
||
| 145 | 145 | * @param null $application |
| 146 | 146 | * @return string |
| 147 | 147 | */ |
| 148 | - protected function getTemplatePath($template, $application=null) |
|
| 148 | + protected function getTemplatePath($template, $application = null) |
|
| 149 | 149 | { |
| 150 | 150 | $templatePath = $application->getTemplatePath(); |
| 151 | - $templatePath = $templatePath . DIRECTORY_SEPARATOR . $template . '.php'; |
|
| 151 | + $templatePath = $templatePath.DIRECTORY_SEPARATOR.$template.'.php'; |
|
| 152 | 152 | return $templatePath; |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | if (isset($this->parameters['document'])) { |
| 86 | 86 | $this->runByDocumentParameter(); |
| 87 | 87 | } else { |
| 88 | - throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: ' . $this->matchedSitemapItem->title); |
|
| 88 | + throw new \Exception('When not using a regex, you need to set the parameter `document` with the path to the document in this sitemap item: '.$this->matchedSitemapItem->title); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -102,9 +102,9 @@ discard block |
||
| 102 | 102 | $relativeDocumentUri = current($this->matchedSitemapItem->matches[1]); |
| 103 | 103 | if (isset($this->parameters['folder'])) { |
| 104 | 104 | if (substr($this->parameters['folder'], -1) !== '/') { |
| 105 | - $this->parameters['folder'] = $this->parameters['folder'] . '/'; |
|
| 105 | + $this->parameters['folder'] = $this->parameters['folder'].'/'; |
|
| 106 | 106 | } |
| 107 | - $relativeDocumentUri = $this->parameters['folder'] . $relativeDocumentUri; |
|
| 107 | + $relativeDocumentUri = $this->parameters['folder'].$relativeDocumentUri; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $document = $this->storage->getDocuments()->getDocumentBySlug($relativeDocumentUri); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $whitelistIps = explode(',', $this->parameters[self::PARAMETER_WHITELIST_IPS]); |
| 171 | 171 | $whitelistIps = array_map("trim", $whitelistIps); |
| 172 | 172 | if (!in_array($remoteAddress, $whitelistIps)) { |
| 173 | - throw new \Exception('Ip address ' . $remoteAddress . ' is not on whitelist'); |
|
| 173 | + throw new \Exception('Ip address '.$remoteAddress.' is not on whitelist'); |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $blacklistIps = explode(',', $this->parameters[self::PARAMETER_BLACKLIST_IPS]); |
| 187 | 187 | $blacklistIps = array_map("trim", $blacklistIps); |
| 188 | 188 | if (in_array($remoteAddress, $blacklistIps)) { |
| 189 | - throw new \Exception('Ip address ' . $remoteAddress . ' is on blacklist'); |
|
| 189 | + throw new \Exception('Ip address '.$remoteAddress.' is on blacklist'); |
|
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | if ($relativeCmsUri == '/log-off') { |
| 231 | 231 | $_SESSION[self::SESSION_PARAMETER_CLOUD_CONTROL] = null; |
| 232 | 232 | unset($_SESSION[self::SESSION_PARAMETER_CLOUD_CONTROL]); |
| 233 | - header('Location: ' . $request::$subfolders . $this->parameters[self::PARAMETER_CMS_PREFIX]); |
|
| 233 | + header('Location: '.$request::$subfolders.$this->parameters[self::PARAMETER_CMS_PREFIX]); |
|
| 234 | 234 | exit; |
| 235 | 235 | } |
| 236 | 236 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | |
| 372 | 372 | protected function getTemplatePath($template, $application = null) |
| 373 | 373 | { |
| 374 | - return __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . $template . '.php'; |
|
| 374 | + return __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'templates'.DIRECTORY_SEPARATOR.$template.'.php'; |
|
| 375 | 375 | } |
| 376 | 376 | } |
| 377 | 377 | } |
| 378 | 378 | \ No newline at end of file |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | if (isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) { |
| 163 | 163 | $this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID]; |
| 164 | 164 | } else { |
| 165 | - $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] = (string)microtime(true); |
|
| 165 | + $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] = (string) microtime(true); |
|
| 166 | 166 | $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName]['submitted'] = false; |
| 167 | 167 | $this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID]; |
| 168 | 168 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $postValues = $request::$post; |
| 191 | 191 | $postValues[self::PARAMETER_DOCUMENT_TYPE] = $this->documentType; |
| 192 | 192 | $postValues[self::GET_PARAMETER_PATH] = $this->responseFolder; |
| 193 | - $postValues['title'] = date('r') . ' - From: ' . $request::$requestUri; |
|
| 193 | + $postValues['title'] = date('r').' - From: '.$request::$requestUri; |
|
| 194 | 194 | |
| 195 | 195 | return $postValues; |
| 196 | 196 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | private function setFormParameter($form) |
| 326 | 326 | { |
| 327 | 327 | if ($this->isFormSubmitted($this->request) || $this->isSubmitAllowed() === false) { |
| 328 | - $this->parameters[$this->formParameterName] = '<a name="' . $this->formId . '"></a>' . $this->thankYouMessage; |
|
| 328 | + $this->parameters[$this->formParameterName] = '<a name="'.$this->formId.'"></a>'.$this->thankYouMessage; |
|
| 329 | 329 | } else { |
| 330 | 330 | $this->parameters[$this->formParameterName] = $form; |
| 331 | 331 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $i = 0; |
| 53 | 53 | foreach ($termsForDocumentField as $term) { |
| 54 | 54 | $frequency = intval($term->count) / $documentField->totalTermCount; |
| 55 | - $values[] = $quotedDocumentPath . ',' . $quotedField . ', ' . $db->quote($term->term) . ', ' . $db->quote($frequency); |
|
| 55 | + $values[] = $quotedDocumentPath.','.$quotedField.', '.$db->quote($term->term).', '.$db->quote($frequency); |
|
| 56 | 56 | $i += 1; |
| 57 | 57 | if ($i >= Indexer::SQLITE_MAX_COMPOUND_SELECT) { |
| 58 | 58 | $this->executeStore($sql, $values, $db); |
@@ -101,11 +101,11 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | private function executeStore($sql, $values, $db) |
| 103 | 103 | { |
| 104 | - $sql .= '(' . implode('),' . PHP_EOL . '(', $values) . ');'; |
|
| 104 | + $sql .= '('.implode('),'.PHP_EOL.'(', $values).');'; |
|
| 105 | 105 | if (!$db->query($sql)) { |
| 106 | 106 | $errorInfo = $db->errorInfo(); |
| 107 | 107 | $errorMsg = $errorInfo[2]; |
| 108 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
| 108 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | protected function applyFilters($tokens) |
| 47 | 47 | { |
| 48 | 48 | foreach ($this->filters as $filterName) { |
| 49 | - $filterClassName = '\CloudControl\Cms\search\filters\\' . $filterName; |
|
| 49 | + $filterClassName = '\CloudControl\Cms\search\filters\\'.$filterName; |
|
| 50 | 50 | $filter = new $filterClassName($tokens); |
| 51 | 51 | $tokens = $filter->getFilterResults(); |
| 52 | 52 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | foreach ($documentTermCount as $field => $countArray) { |
| 67 | 67 | $quotedField = $db->quote($field); |
| 68 | 68 | foreach ($countArray as $term => $count) { |
| 69 | - $values[] = $quotedDocumentPath . ', ' . $db->quote($term) . ', ' . $db->quote($count) . ', ' . $quotedField; |
|
| 69 | + $values[] = $quotedDocumentPath.', '.$db->quote($term).', '.$db->quote($count).', '.$quotedField; |
|
| 70 | 70 | $i += 1; |
| 71 | 71 | if ($i >= Indexer::SQLITE_MAX_COMPOUND_SELECT) { |
| 72 | 72 | $this->executeStoreDocumentTermCount($values, $sql, $db); |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | protected function executeStoreDocumentTermCount($values, $sql, $db) |
| 92 | 92 | { |
| 93 | - $sql .= '(' . implode('),' . PHP_EOL . '(', $values) . ');'; |
|
| 93 | + $sql .= '('.implode('),'.PHP_EOL.'(', $values).');'; |
|
| 94 | 94 | $stmt = $db->prepare($sql); |
| 95 | 95 | if ($stmt === false || !$stmt->execute()) { |
| 96 | 96 | $errorInfo = $db->errorInfo(); |
| 97 | 97 | $errorMsg = $errorInfo[2]; |
| 98 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
| 98 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
@@ -45,18 +45,18 @@ discard block |
||
| 45 | 45 | if ($stmt === false) { |
| 46 | 46 | $errorInfo = $db->errorInfo(); |
| 47 | 47 | $errorMsg = $errorInfo[2]; |
| 48 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
| 48 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
| 49 | 49 | } |
| 50 | 50 | if (($stmt->execute()) === false) { |
| 51 | 51 | $errorInfo = $db->errorInfo(); |
| 52 | 52 | $errorMsg = $errorInfo[2]; |
| 53 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
| 53 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
| 54 | 54 | } |
| 55 | 55 | $uniqueFieldsPerDocument = $stmt->fetchAll(\PDO::FETCH_OBJ); |
| 56 | 56 | $values = array(); |
| 57 | 57 | $i = 0; |
| 58 | 58 | foreach ($uniqueFieldsPerDocument as $fieldRow) { |
| 59 | - $values[] = 'UPDATE term_frequency SET termNorm = 1/sqrt(' . intval($fieldRow->termCount) . ') WHERE documentPath = ' . $db->quote($fieldRow->documentPath) . ' AND field = ' . $db->quote($fieldRow->field) . ';'; |
|
| 59 | + $values[] = 'UPDATE term_frequency SET termNorm = 1/sqrt('.intval($fieldRow->termCount).') WHERE documentPath = '.$db->quote($fieldRow->documentPath).' AND field = '.$db->quote($fieldRow->field).';'; |
|
| 60 | 60 | $i += 1; |
| 61 | 61 | if ($i >= Indexer::SQLITE_MAX_COMPOUND_SELECT) { |
| 62 | 62 | $this->executeUpdateTermNorm($values, $db); |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | private function executeUpdateTermNorm($values, $db) |
| 78 | 78 | { |
| 79 | - $sql = 'BEGIN TRANSACTION;' . PHP_EOL; |
|
| 80 | - $sql .= implode(PHP_EOL, $values) . PHP_EOL; |
|
| 79 | + $sql = 'BEGIN TRANSACTION;'.PHP_EOL; |
|
| 80 | + $sql .= implode(PHP_EOL, $values).PHP_EOL; |
|
| 81 | 81 | $sql .= 'COMMIT;'; |
| 82 | 82 | if (($db->exec($sql)) === false) { |
| 83 | 83 | $errorInfo = $db->errorInfo(); |
| 84 | 84 | $errorMsg = $errorInfo[2]; |
| 85 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
| 85 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | \ No newline at end of file |
@@ -47,14 +47,14 @@ |
||
| 47 | 47 | if (!$stmt = $db->prepare($sql)) { |
| 48 | 48 | $errorInfo = $db->errorInfo(); |
| 49 | 49 | $errorMsg = $errorInfo[2]; |
| 50 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
| 50 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
| 51 | 51 | } |
| 52 | 52 | $stmt->bindValue(':documentCount', $this->documentCount); |
| 53 | 53 | $result = $stmt->execute(); |
| 54 | 54 | if ($result === false) { |
| 55 | 55 | $errorInfo = $db->errorInfo(); |
| 56 | 56 | $errorMsg = $errorInfo[2]; |
| 57 | - throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); |
|
| 57 | + throw new \Exception('SQLite Exception: '.$errorMsg.' in SQL: <br /><pre>'.$sql.'</pre>'); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | \ No newline at end of file |
@@ -10,5 +10,5 @@ |
||
| 10 | 10 | |
| 11 | 11 | class DutchStopWords extends StopWordsFilter |
| 12 | 12 | { |
| 13 | - protected $stopWords = array('aan','af','al','alles','als','altijd','andere','ben','bij','daar','dan','dat','de','der','deze','die','dit','doch','doen','door','doorgaans','dus','een','eens','en','er','ge','geen','geweest','haar','had','heb','hebben','heeft','hem','het','hier','hij','hoe','hun','iemand','iets','ik','in','is','ja','je','kan','kon','kunnen','maar','me','meer','men','met','mij','mijn','moet','na','naar','niet','niets','nog','nu','of','om','omdat','ons','ook','op','over','reeds','te','tegen','toch','toen','tot','u','uit','uw','van','veel','voor','want','waren','was','wat','we','wel','werd','wezen','wie','wij','wil','worden','zal','ze','zei','zelf','zich','zij','zijn','zo','zodat','zonder','zou'); |
|
| 13 | + protected $stopWords = array('aan', 'af', 'al', 'alles', 'als', 'altijd', 'andere', 'ben', 'bij', 'daar', 'dan', 'dat', 'de', 'der', 'deze', 'die', 'dit', 'doch', 'doen', 'door', 'doorgaans', 'dus', 'een', 'eens', 'en', 'er', 'ge', 'geen', 'geweest', 'haar', 'had', 'heb', 'hebben', 'heeft', 'hem', 'het', 'hier', 'hij', 'hoe', 'hun', 'iemand', 'iets', 'ik', 'in', 'is', 'ja', 'je', 'kan', 'kon', 'kunnen', 'maar', 'me', 'meer', 'men', 'met', 'mij', 'mijn', 'moet', 'na', 'naar', 'niet', 'niets', 'nog', 'nu', 'of', 'om', 'omdat', 'ons', 'ook', 'op', 'over', 'reeds', 'te', 'tegen', 'toch', 'toen', 'tot', 'u', 'uit', 'uw', 'van', 'veel', 'voor', 'want', 'waren', 'was', 'wat', 'we', 'wel', 'werd', 'wezen', 'wie', 'wij', 'wil', 'worden', 'zal', 'ze', 'zei', 'zelf', 'zich', 'zij', 'zijn', 'zo', 'zodat', 'zonder', 'zou'); |
|
| 14 | 14 | } |
| 15 | 15 | \ No newline at end of file |