@@ -47,21 +47,21 @@ |
||
47 | 47 | { |
48 | 48 | global $rootPath; |
49 | 49 | |
50 | - self::$subfolders = '/' . str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath)); |
|
50 | + self::$subfolders = '/'.str_replace('//', '/', str_replace(str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']), "", $rootPath)); |
|
51 | 51 | self::$subfolders = str_replace('//', '/', self::$subfolders); |
52 | 52 | if (PHP_SAPI === 'cli') { |
53 | 53 | global $argv; |
54 | 54 | array_shift($argv); |
55 | 55 | self::$queryString = ''; |
56 | - self::$requestUri = self::$subfolders . implode('/', $argv); |
|
56 | + self::$requestUri = self::$subfolders.implode('/', $argv); |
|
57 | 57 | } else { |
58 | 58 | self::$requestUri = $_SERVER['REQUEST_URI']; |
59 | 59 | self::$queryString = $_SERVER['QUERY_STRING']; |
60 | 60 | } |
61 | 61 | if (self::$subfolders === '/') { |
62 | - self::$relativeUri = str_replace('?' . self::$queryString, '', substr(self::$requestUri,1)); |
|
62 | + self::$relativeUri = str_replace('?'.self::$queryString, '', substr(self::$requestUri, 1)); |
|
63 | 63 | } else { |
64 | - self::$relativeUri = str_replace('?' . self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri)); |
|
64 | + self::$relativeUri = str_replace('?'.self::$queryString, '', str_replace(self::$subfolders, '', self::$requestUri)); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | self::$requestParameters = explode('/', self::$relativeUri); |
@@ -99,9 +99,9 @@ |
||
99 | 99 | $this->sessionValues = $_SESSION['LanguageComponent']; |
100 | 100 | |
101 | 101 | if ($this->forceRedirect === true) { |
102 | - if (substr($request::$relativeUri, 0, 2) !== $lang ) { |
|
102 | + if (substr($request::$relativeUri, 0, 2) !== $lang) { |
|
103 | 103 | if ($lang !== $this->defaultLanguage) { |
104 | - header('Location: ' . $request::$subfolders . $lang . '/' . $request::$relativeUri); |
|
104 | + header('Location: '.$request::$subfolders.$lang.'/'.$request::$relativeUri); |
|
105 | 105 | exit; |
106 | 106 | } |
107 | 107 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?=isset($formId) ? '#' . $formId : '' ?>"> |
|
1 | +<form method="<?= isset($documentType) ? 'post' : 'get' ?>" onsubmit="return processRtes();" action="<?=isset($formId) ? '#'.$formId : '' ?>"> |
|
2 | 2 | <? if (!isset($hideTitleAndState)) : ?> |
3 | 3 | <input type="hidden" name="path" value="<?=$request::$get['path']?>" /> |
4 | 4 | <? else : ?> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <input<?=isset($document) && $document->state == 'published' ? ' checked="checked"' : '' ?> type="checkbox" id="state" name="state" placeholder="State" /> |
21 | 21 | </div> |
22 | 22 | <? endif ?> |
23 | - <?$fieldPrefix='fields';?> |
|
23 | + <?$fieldPrefix = 'fields'; ?> |
|
24 | 24 | <? foreach ($documentType->fields as $field) : ?> |
25 | 25 | <div class="form-element"> |
26 | 26 | <label for="<?=$field->slug?>"><?=$field->title?></label> |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
45 | 45 | <div class="form-element"> |
46 | 46 | <? endif ?> |
47 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
47 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
48 | 48 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
49 | 49 | |
50 | 50 | </div> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <li class="grid-container"> |
67 | 67 | <div class="grid-box-10"> |
68 | 68 | <div class="grid-inner form-element"> |
69 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
69 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
70 | 70 | </div> |
71 | 71 | </div> |
72 | 72 | <div class="grid-box-2"> |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | </div> |
77 | 77 | </div> |
78 | 78 | </li> |
79 | - <?$value='';?> |
|
79 | + <?$value = ''; ?> |
|
80 | 80 | <? endforeach ?> |
81 | 81 | <? endif ?> |
82 | 82 | </ul> |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | <a class="btn error js-deletemultiple"><i class="fa fa-times"></i></a> |
94 | 94 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
95 | 95 | <div class="form-element"> |
96 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
96 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
97 | 97 | </div> |
98 | 98 | </li> |
99 | - <?$value='';?> |
|
99 | + <?$value = ''; ?> |
|
100 | 100 | <? endforeach ?> |
101 | 101 | <? endif ?> |
102 | 102 | </div> |
@@ -105,17 +105,17 @@ discard block |
||
105 | 105 | <a class="btn js-addrtemultiple">+</a> |
106 | 106 | <? endif ?> |
107 | 107 | </div> |
108 | - <?$value='';?> |
|
108 | + <?$value = ''; ?> |
|
109 | 109 | <? endforeach ?> |
110 | 110 | <hr /> |
111 | - <? $static_brick_nr = 0;?> |
|
111 | + <? $static_brick_nr = 0; ?> |
|
112 | 112 | <? foreach ($documentType->bricks as $brick) : ?> |
113 | 113 | <div class="brick"> |
114 | 114 | <label><?=$brick->title?></label> |
115 | 115 | <? if ($brick->multiple == 'true') : ?> |
116 | 116 | <input type="hidden" value="<?=$brick->brickSlug?>"/> |
117 | 117 | <input type="hidden" value="<?=$brick->slug?>"/> |
118 | - <?$myBrickSlug=$brick->slug;?> |
|
118 | + <?$myBrickSlug = $brick->slug; ?> |
|
119 | 119 | <ul id="newBrickDropzone_<?=$static_brick_nr?>" class="dynamicBricks sortable"> |
120 | 120 | <? if (isset($document)) : ?> |
121 | 121 | <? foreach ($document->bricks as $currentBrickSlug => $brickArray) : ?> |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | <li class="brick form-element"> |
130 | 130 | <label><?=$brick->title?></label> |
131 | 131 | <?$static = true; ?> |
132 | - <?include(__DIR__ . '/brick.php')?> |
|
132 | + <?include(__DIR__.'/brick.php')?> |
|
133 | 133 | </li> |
134 | 134 | <? endif ?> |
135 | 135 | <? endforeach ?> |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | <a class="btn" onclick="addDynamicBrick(this, 'true', 'newBrickDropzone_<?=$static_brick_nr?>');">+</a> |
140 | 140 | <?$static_brick_nr += 1?> |
141 | 141 | <? else : ?> |
142 | - <?$fieldPrefix='bricks[' . $brick->slug . '][fields]';?> |
|
142 | + <?$fieldPrefix = 'bricks['.$brick->slug.'][fields]'; ?> |
|
143 | 143 | <input type="hidden" name="bricks[<?=$brick->slug?>][type]" value="<?=$brick->brickSlug?>" /> |
144 | 144 | <? foreach ($brick->structure->fields as $field) : ?> |
145 | 145 | <div class="form-element"> |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
166 | 166 | <div class="form-element"> |
167 | 167 | <? endif ?> |
168 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
168 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
169 | 169 | <? if ($field->multiple == true && $field->type != 'Rich Text') : ?> |
170 | 170 | |
171 | 171 | </div> |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | <li class="grid-container"> |
189 | 189 | <div class="grid-box-10"> |
190 | 190 | <div class="grid-inner form-element"> |
191 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
191 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
192 | 192 | </div> |
193 | 193 | </div> |
194 | 194 | <div class="grid-box-2"> |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | </div> |
199 | 199 | </div> |
200 | 200 | </li> |
201 | - <?$value='';?> |
|
201 | + <?$value = ''; ?> |
|
202 | 202 | <? endforeach ?> |
203 | 203 | <? endif ?> |
204 | 204 | </ul> |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | <a class="btn error js-deletemultiple"><i class="fa fa-times"></i></a> |
217 | 217 | <a class="btn move ui-sortable-handle"><i class="fa fa-arrows-v"></i></a> |
218 | 218 | <div class="form-element"> |
219 | - <? include(__DIR__ . '/fieldTypes/' . str_replace(' ', '-', $field->type) . '.php') ?> |
|
219 | + <? include(__DIR__.'/fieldTypes/'.str_replace(' ', '-', $field->type).'.php') ?> |
|
220 | 220 | </div> |
221 | 221 | </li> |
222 | - <?$value='';?> |
|
222 | + <?$value = ''; ?> |
|
223 | 223 | <? endforeach ?> |
224 | 224 | <? endif ?> |
225 | 225 | </div> |
@@ -228,12 +228,12 @@ discard block |
||
228 | 228 | <a class="btn js-addrtemultiple">+</a> |
229 | 229 | <? endif ?> |
230 | 230 | </div> |
231 | - <?$value='';?> |
|
231 | + <?$value = ''; ?> |
|
232 | 232 | <? endforeach ?> |
233 | 233 | <? endif ?> |
234 | 234 | </div> |
235 | 235 | <hr /> |
236 | - <? endforeach;?> |
|
236 | + <? endforeach; ?> |
|
237 | 237 | |
238 | 238 | |
239 | 239 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | <li class="brick form-element"> |
257 | 257 | <label><?=$brick->title?></label> |
258 | 258 | <?$static = false; ?> |
259 | - <?include(__DIR__ . '/brick.php')?> |
|
259 | + <?include(__DIR__.'/brick.php')?> |
|
260 | 260 | </li> |
261 | 261 | <? endforeach ?> |
262 | 262 | <? endif ?> |
@@ -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 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $whitelistIps = explode(',', $this->parameters[self::PARAMETER_WHITELIST_IPS]); |
160 | 160 | $whitelistIps = array_map("trim", $whitelistIps); |
161 | 161 | if (!in_array($remoteAddress, $whitelistIps)) { |
162 | - throw new \Exception('Ip address ' . $remoteAddress . ' is not on whitelist'); |
|
162 | + throw new \Exception('Ip address '.$remoteAddress.' is not on whitelist'); |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $blacklistIps = explode(',', $this->parameters[self::PARAMETER_BLACKLIST_IPS]); |
176 | 176 | $blacklistIps = array_map("trim", $blacklistIps); |
177 | 177 | if (in_array($remoteAddress, $blacklistIps)) { |
178 | - throw new \Exception('Ip address ' . $remoteAddress . ' is on blacklist'); |
|
178 | + throw new \Exception('Ip address '.$remoteAddress.' is on blacklist'); |
|
179 | 179 | } |
180 | 180 | } |
181 | 181 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | if ($relativeCmsUri == '/log-off') { |
220 | 220 | $_SESSION[self::SESSION_PARAMETER_CLOUD_CONTROL] = null; |
221 | 221 | unset($_SESSION[self::SESSION_PARAMETER_CLOUD_CONTROL]); |
222 | - header('Location: ' . $request::$subfolders . $this->parameters[self::PARAMETER_CMS_PREFIX]); |
|
222 | + header('Location: '.$request::$subfolders.$this->parameters[self::PARAMETER_CMS_PREFIX]); |
|
223 | 223 | exit; |
224 | 224 | } |
225 | 225 | } |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | return '0 seconds'; |
39 | 39 | } |
40 | 40 | |
41 | - $a = array( 365 * 24 * 60 * 60 => 'year', |
|
41 | + $a = array(365 * 24 * 60 * 60 => 'year', |
|
42 | 42 | 30 * 24 * 60 * 60 => 'month', |
43 | 43 | 24 * 60 * 60 => 'day', |
44 | 44 | 60 * 60 => 'hour', |
45 | 45 | 60 => 'minute', |
46 | 46 | 1 => 'second' |
47 | 47 | ); |
48 | - $a_plural = array( 'year' => 'years', |
|
48 | + $a_plural = array('year' => 'years', |
|
49 | 49 | 'month' => 'months', |
50 | 50 | 'day' => 'days', |
51 | 51 | 'hour' => 'hours', |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if ($d >= 1) |
60 | 60 | { |
61 | 61 | $r = round($d); |
62 | - return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . ' ago'; |
|
62 | + return $r.' '.($r > 1 ? $a_plural[$str] : $str).' ago'; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | return 0; |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | * @param string $unit |
74 | 74 | * @return string |
75 | 75 | */ |
76 | -function humanFileSize($size,$unit="") { |
|
77 | - if( (!$unit && $size >= 1<<30) || $unit == "GB") |
|
78 | - return number_format($size/(1<<30),2)."GB"; |
|
79 | - if( (!$unit && $size >= 1<<20) || $unit == "MB") |
|
80 | - return number_format($size/(1<<20),2)."MB"; |
|
81 | - if( (!$unit && $size >= 1<<10) || $unit == "KB") |
|
82 | - return number_format($size/(1<<10),2)."KB"; |
|
76 | +function humanFileSize($size, $unit = "") { |
|
77 | + if ((!$unit && $size >= 1 << 30) || $unit == "GB") |
|
78 | + return number_format($size / (1 << 30), 2)."GB"; |
|
79 | + if ((!$unit && $size >= 1 << 20) || $unit == "MB") |
|
80 | + return number_format($size / (1 << 20), 2)."MB"; |
|
81 | + if ((!$unit && $size >= 1 << 10) || $unit == "KB") |
|
82 | + return number_format($size / (1 << 10), 2)."KB"; |
|
83 | 83 | return number_format($size)." bytes"; |
84 | 84 | } |
85 | 85 | |
@@ -133,9 +133,9 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return mixed|string |
135 | 135 | */ |
136 | -function slugify($str, $replace=array(), $delimiter='-') { |
|
137 | - if( !empty($replace) ) { |
|
138 | - $str = str_replace((array)$replace, ' ', $str); |
|
136 | +function slugify($str, $replace = array(), $delimiter = '-') { |
|
137 | + if (!empty($replace)) { |
|
138 | + $str = str_replace((array) $replace, ' ', $str); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | { |
159 | 159 | $debug_backtrace = current(debug_backtrace()); |
160 | 160 | if (PHP_SAPI == 'cli') { |
161 | - echo 'Dump: ' . $debug_backtrace['file'] . ':' . $debug_backtrace['line'] . "\n"; |
|
161 | + echo 'Dump: '.$debug_backtrace['file'].':'.$debug_backtrace['line']."\n"; |
|
162 | 162 | foreach (func_get_args() as $data) { |
163 | 163 | var_dump($data); |
164 | 164 | } |
165 | 165 | } else { |
166 | 166 | ob_clean(); |
167 | - echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>"; |
|
167 | + echo '<div>Dump: '.$debug_backtrace['file'].':<b>'.$debug_backtrace['line']."</b></div>"; |
|
168 | 168 | echo '<pre>'; |
169 | 169 | foreach (func_get_args() as $data) { |
170 | 170 | echo "<code>"; |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | */ |
213 | 213 | function utf8Convert($array) |
214 | 214 | { |
215 | - array_walk_recursive($array, function(&$item){ |
|
216 | - if(!mb_detect_encoding($item, 'utf-8', true)){ |
|
215 | + array_walk_recursive($array, function(&$item) { |
|
216 | + if (!mb_detect_encoding($item, 'utf-8', true)) { |
|
217 | 217 | $item = utf8_encode($item); |
218 | 218 | } |
219 | 219 | }); |
@@ -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 |
@@ -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 |