@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $this->resetIndex(); |
59 | 59 | $this->addLog('Retrieving documents to be indexed.'); |
60 | 60 | $documents = $this->storage->getDocuments()->getDocuments(); |
61 | - $this->addLog('Start Document Term Count for ' . count($documents) . ' documents'); |
|
61 | + $this->addLog('Start Document Term Count for '.count($documents).' documents'); |
|
62 | 62 | $this->createDocumentTermCount($documents); |
63 | 63 | $this->addLog('Start Document Term Frequency.'); |
64 | 64 | $this->createDocumentTermFrequency(); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | private function addLog($string) |
160 | 160 | { |
161 | 161 | $currentTime = round(microtime(true) * 1000); |
162 | - $this->log .= date('d-m-Y H:i:s - ') . str_pad($string, 50, " ", STR_PAD_RIGHT) . "\t" . ($currentTime - $this->lastLog) . 'ms since last log. ' . "\t" . ($currentTime - $this->loggingStart) . 'ms since start.' . PHP_EOL; |
|
162 | + $this->log .= date('d-m-Y H:i:s - ').str_pad($string, 50, " ", STR_PAD_RIGHT)."\t".($currentTime - $this->lastLog).'ms since last log. '."\t".($currentTime - $this->loggingStart).'ms since start.'.PHP_EOL; |
|
163 | 163 | $this->lastLog = round(microtime(true) * 1000); |
164 | 164 | } |
165 | 165 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | protected function getSearchDbHandle() |
172 | 172 | { |
173 | 173 | if ($this->searchDbHandle === null) { |
174 | - $path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $this->storageDir . DIRECTORY_SEPARATOR; |
|
175 | - $this->searchDbHandle = new \PDO('sqlite:' . $path . self::SEARCH_TEMP_DB); |
|
174 | + $path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$this->storageDir.DIRECTORY_SEPARATOR; |
|
175 | + $this->searchDbHandle = new \PDO('sqlite:'.$path.self::SEARCH_TEMP_DB); |
|
176 | 176 | } |
177 | 177 | return $this->searchDbHandle; |
178 | 178 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | public function replaceOldIndex() |
184 | 184 | { |
185 | 185 | $this->searchDbHandle = null; |
186 | - $path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . $this->storageDir . DIRECTORY_SEPARATOR; |
|
187 | - rename($path . self::SEARCH_TEMP_DB, $path . 'search.db'); |
|
186 | + $path = __DIR__.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.$this->storageDir.DIRECTORY_SEPARATOR; |
|
187 | + rename($path.self::SEARCH_TEMP_DB, $path.'search.db'); |
|
188 | 188 | } |
189 | 189 | } |
190 | 190 | \ No newline at end of file |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if (isset($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE])) { |
80 | 80 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], $request::$get[CmsComponent::GET_PARAMETER_PATH])) { |
81 | 81 | $cmsComponent->storage->getDocuments()->addDocument($request::$post); |
82 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
82 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
83 | 83 | exit; |
84 | 84 | } |
85 | 85 | $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPE, $cmsComponent->storage->getDocumentTypeBySlug($request::$get[CmsComponent::PARAMETER_DOCUMENT_TYPE], true)); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } else { |
88 | 88 | $documentTypes = $cmsComponent->storage->getDocumentTypes(); |
89 | 89 | if (count($documentTypes) < 1) { |
90 | - throw new \Exception('No Document Types defined yet. <a href="' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/configuration/document-types/new">Please do so first.</a>'); |
|
90 | + throw new \Exception('No Document Types defined yet. <a href="'.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/configuration/document-types/new">Please do so first.</a>'); |
|
91 | 91 | } |
92 | 92 | $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT_TYPES, $documentTypes); |
93 | 93 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $cmsComponent->setParameter(CmsComponent::PARAMETER_SMALLEST_IMAGE, $cmsComponent->storage->getImageSet()->getSmallestImageSet()->slug); |
105 | 105 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$get[CmsComponent::GET_PARAMETER_SLUG])) { |
106 | 106 | $cmsComponent->storage->getDocuments()->saveDocument($request::$post); |
107 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
107 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
108 | 108 | exit; |
109 | 109 | } |
110 | 110 | $cmsComponent->setParameter(CmsComponent::PARAMETER_DOCUMENT, $cmsComponent->storage->getDocuments()->getDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG])); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | private function deleteDocumentRoute($request, $cmsComponent) |
142 | 142 | { |
143 | 143 | $cmsComponent->storage->getDocuments()->deleteDocumentBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
144 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
144 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
145 | 145 | exit; |
146 | 146 | } |
147 | 147 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $cmsComponent->setParameter(CmsComponent::PARAMETER_MAIN_NAV_CLASS, CmsComponent::PARAMETER_DOCUMENTS); |
156 | 156 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post[CmsComponent::GET_PARAMETER_PATH])) { |
157 | 157 | $cmsComponent->storage->addDocumentFolder($request::$post); |
158 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
158 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
159 | 159 | exit; |
160 | 160 | } |
161 | 161 | } |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | array_pop($path); |
175 | 175 | $path = implode('/', $path); |
176 | 176 | |
177 | - $request::$get[CmsComponent::GET_PARAMETER_PATH] = '/' . $path; |
|
177 | + $request::$get[CmsComponent::GET_PARAMETER_PATH] = '/'.$path; |
|
178 | 178 | |
179 | 179 | if (isset($request::$post[CmsComponent::POST_PARAMETER_TITLE], $request::$post['content'])) { |
180 | 180 | $cmsComponent->storage->saveDocumentFolder($request::$post); |
181 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
181 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
182 | 182 | exit; |
183 | 183 | } |
184 | 184 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | private function deleteFolderRoute($request, $cmsComponent) |
194 | 194 | { |
195 | 195 | $cmsComponent->storage->deleteDocumentFolderBySlug($request::$get[CmsComponent::GET_PARAMETER_SLUG]); |
196 | - header('Location: ' . $request::$subfolders . $cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX) . '/documents'); |
|
196 | + header('Location: '.$request::$subfolders.$cmsComponent->getParameter(CmsComponent::PARAMETER_CMS_PREFIX).'/documents'); |
|
197 | 197 | exit; |
198 | 198 | } |
199 | 199 | } |
200 | 200 | \ No newline at end of file |
@@ -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); |