@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | $PDO = new PDO("sqlite:" . $this->SqliteDir . '/' . self::INDEXING_FILE); |
153 | 153 | $PDO->setAttribute(PDO::ATTR_ERRMODE, |
154 | - PDO::ERRMODE_EXCEPTION); |
|
154 | + PDO::ERRMODE_EXCEPTION); |
|
155 | 155 | |
156 | 156 | if ($createTable == true) { |
157 | 157 | $this->initIndexing($PDO); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | // look for keyword |
187 | 187 | $stm = $this->indexing->prepare("SELECT * FROM `balancing` WHERE `keyword`=:keyword LIMIT 1"); |
188 | 188 | $stm->execute([ |
189 | - ':keyword' => $keyword, |
|
189 | + ':keyword' => $keyword, |
|
190 | 190 | ]); |
191 | 191 | $row = $stm->fetch(PDO::FETCH_ASSOC); |
192 | 192 | if (isset($row[ 'db' ]) && $row[ 'db' ] != '') { |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | $db = $this->currentDB; |
199 | 199 | $stm = $this->indexing->prepare("INSERT INTO `balancing` (`keyword`,`db`) VALUES(:keyword, :db)"); |
200 | 200 | $stm->execute([ |
201 | - ':keyword' => $keyword, |
|
202 | - ':db' => $db, |
|
201 | + ':keyword' => $keyword, |
|
202 | + ':db' => $db, |
|
203 | 203 | ]); |
204 | 204 | } |
205 | 205 | |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | if ($toWrite == true) { |
271 | 271 | try { |
272 | 272 | $stm = $this->getDb($item->getKey()) |
273 | - ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)"); |
|
273 | + ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)"); |
|
274 | 274 | $stm->execute([ |
275 | - ':keyword' => $item->getKey(), |
|
276 | - ':object' => $this->encode($this->driverPreWrap($item)), |
|
277 | - ':exp' => time() + $item->getTtl(), |
|
275 | + ':keyword' => $item->getKey(), |
|
276 | + ':object' => $this->encode($this->driverPreWrap($item)), |
|
277 | + ':exp' => time() + $item->getTtl(), |
|
278 | 278 | ]); |
279 | 279 | |
280 | 280 | return true; |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | |
283 | 283 | try { |
284 | 284 | $stm = $this->getDb($item->getKey(), true) |
285 | - ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)"); |
|
285 | + ->prepare("INSERT OR REPLACE INTO `caching` (`keyword`,`object`,`exp`) values(:keyword,:object,:exp)"); |
|
286 | 286 | $stm->execute([ |
287 | - ':keyword' => $item->getKey(), |
|
288 | - ':object' => $this->encode($this->driverPreWrap($item)), |
|
289 | - ':exp' => time() + $item->getTtl(), |
|
287 | + ':keyword' => $item->getKey(), |
|
288 | + ':object' => $this->encode($this->driverPreWrap($item)), |
|
289 | + ':exp' => time() + $item->getTtl(), |
|
290 | 290 | ]); |
291 | 291 | } catch (PDOException $e) { |
292 | 292 | return false; |
@@ -308,18 +308,18 @@ discard block |
||
308 | 308 | { |
309 | 309 | try { |
310 | 310 | $stm = $this->getDb($item->getKey()) |
311 | - ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1"); |
|
311 | + ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1"); |
|
312 | 312 | $stm->execute([ |
313 | - ':keyword' => $item->getKey(), |
|
313 | + ':keyword' => $item->getKey(), |
|
314 | 314 | ]); |
315 | 315 | $row = $stm->fetch(PDO::FETCH_ASSOC); |
316 | 316 | |
317 | 317 | } catch (PDOException $e) { |
318 | 318 | try { |
319 | 319 | $stm = $this->getDb($item->getKey(), true) |
320 | - ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1"); |
|
320 | + ->prepare("SELECT * FROM `caching` WHERE `keyword`=:keyword LIMIT 1"); |
|
321 | 321 | $stm->execute([ |
322 | - ':keyword' => $item->getKey(), |
|
322 | + ':keyword' => $item->getKey(), |
|
323 | 323 | ]); |
324 | 324 | $row = $stm->fetch(PDO::FETCH_ASSOC); |
325 | 325 | } catch (PDOException $e) { |
@@ -347,11 +347,11 @@ discard block |
||
347 | 347 | if ($item instanceof Item) { |
348 | 348 | try { |
349 | 349 | $stm = $this->getDb($item->getKey()) |
350 | - ->prepare("DELETE FROM `caching` WHERE (`exp` <= :U) OR (`keyword`=:keyword) "); |
|
350 | + ->prepare("DELETE FROM `caching` WHERE (`exp` <= :U) OR (`keyword`=:keyword) "); |
|
351 | 351 | |
352 | 352 | return $stm->execute([ |
353 | - ':keyword' => $item->getKey(), |
|
354 | - ':U' => time(), |
|
353 | + ':keyword' => $item->getKey(), |
|
354 | + ':U' => time(), |
|
355 | 355 | ]); |
356 | 356 | } catch (PDOException $e) { |
357 | 357 | return false; |
@@ -414,9 +414,9 @@ discard block |
||
414 | 414 | } |
415 | 415 | |
416 | 416 | $stat->setData(implode(', ', array_keys($this->itemInstances))) |
417 | - ->setRawData([]) |
|
418 | - ->setSize(Directory::dirSize($path)) |
|
419 | - ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
417 | + ->setRawData([]) |
|
418 | + ->setSize(Directory::dirSize($path)) |
|
419 | + ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
420 | 420 | |
421 | 421 | return $stat; |
422 | 422 | } |