aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/LinkDB.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2015-07-09 22:14:39 +0200
committerVirtualTam <virtualtam@flibidi.net>2015-08-13 23:48:06 +0200
commit01e48f269df59e02798dad4a698c125d76b0ed70 (patch)
tree9341487badd4ed14e0104ae338cf48c4ee0dc994 /application/LinkDB.php
parent5ac5349ac053b1e560b136c62f8c764fd3230039 (diff)
downloadShaarli-01e48f269df59e02798dad4a698c125d76b0ed70.tar.gz
Shaarli-01e48f269df59e02798dad4a698c125d76b0ed70.tar.zst
Shaarli-01e48f269df59e02798dad4a698c125d76b0ed70.zip
CachedPage: move to a proper file, add tests
Modifications - rename `pageCache` to `CachedPage` - move utilities to `Cache` - do not access globals - apply coding rules - update LinkDB and test code - add test coverage Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'application/LinkDB.php')
-rw-r--r--application/LinkDB.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php
index 1e16fef1..463aa47e 100644
--- a/application/LinkDB.php
+++ b/application/LinkDB.php
@@ -269,8 +269,10 @@ You use the community supported version of the original Shaarli project, by Seba
269 269
270 /** 270 /**
271 * Saves the database from memory to disk 271 * Saves the database from memory to disk
272 *
273 * @param string $pageCacheDir page cache directory
272 */ 274 */
273 public function savedb() 275 public function savedb($pageCacheDir)
274 { 276 {
275 if (!$this->_loggedIn) { 277 if (!$this->_loggedIn) {
276 // TODO: raise an Exception instead 278 // TODO: raise an Exception instead
@@ -280,7 +282,7 @@ You use the community supported version of the original Shaarli project, by Seba
280 $this->_datastore, 282 $this->_datastore,
281 self::$phpPrefix.base64_encode(gzdeflate(serialize($this->_links))).self::$phpSuffix 283 self::$phpPrefix.base64_encode(gzdeflate(serialize($this->_links))).self::$phpSuffix
282 ); 284 );
283 invalidateCaches(); 285 invalidateCaches($pageCacheDir);
284 } 286 }
285 287
286 /** 288 /**
@@ -439,4 +441,3 @@ You use the community supported version of the original Shaarli project, by Seba
439 return $linkDays; 441 return $linkDays;
440 } 442 }
441} 443}
442?>