From 72ccf0723c419618b2b6a822721628a9188bcbf0 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Thu, 20 Oct 2016 21:19:51 +0200 Subject: LinkDB: update datastore method names Relates to https://github.com/shaarli/Shaarli/issues/95 Signed-off-by: VirtualTam --- application/LinkDB.php | 16 ++++++++-------- application/NetscapeBookmarkUtils.php | 2 +- application/Updater.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'application') diff --git a/application/LinkDB.php b/application/LinkDB.php index 2d42c514..f5f209f6 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php @@ -100,8 +100,8 @@ class LinkDB implements Iterator, Countable, ArrayAccess $this->hidePublicLinks = $hidePublicLinks; $this->redirector = $redirector; $this->redirectorEncode = $redirectorEncode === true; - $this->checkDB(); - $this->readDB(); + $this->check(); + $this->read(); } /** @@ -210,7 +210,7 @@ class LinkDB implements Iterator, Countable, ArrayAccess * * If no DB file is found, creates a dummy DB. */ - private function checkDB() + private function check() { if (file_exists($this->datastore)) { return; @@ -243,13 +243,13 @@ You use the community supported version of the original Shaarli project, by Seba $this->links[$link['linkdate']] = $link; // Write database to disk - $this->writeDB(); + $this->write(); } /** * Reads database from disk to memory */ - private function readDB() + private function read() { // Public links are hidden and user not logged in => nothing to show @@ -315,7 +315,7 @@ You use the community supported version of the original Shaarli project, by Seba * * @throws IOException the datastore is not writable */ - private function writeDB() + private function write() { if (is_file($this->datastore) && !is_writeable($this->datastore)) { // The datastore exists but is not writeable @@ -337,14 +337,14 @@ You use the community supported version of the original Shaarli project, by Seba * * @param string $pageCacheDir page cache directory */ - public function savedb($pageCacheDir) + public function save($pageCacheDir) { if (!$this->loggedIn) { // TODO: raise an Exception instead die('You are not authorized to change the database.'); } - $this->writeDB(); + $this->write(); invalidateCaches($pageCacheDir); } diff --git a/application/NetscapeBookmarkUtils.php b/application/NetscapeBookmarkUtils.php index d6840d37..dd21f05b 100644 --- a/application/NetscapeBookmarkUtils.php +++ b/application/NetscapeBookmarkUtils.php @@ -183,7 +183,7 @@ class NetscapeBookmarkUtils $importCount++; } - $linkDb->savedb($pagecache); + $linkDb->save($pagecache); return self::importStatus( $filename, $filesize, diff --git a/application/Updater.php b/application/Updater.php index 90913235..36eddd4f 100644 --- a/application/Updater.php +++ b/application/Updater.php @@ -143,7 +143,7 @@ class Updater $link['tags'] = implode(' ', array_unique(LinkFilter::tagsStrToArray($link['tags'], true))); $this->linkDB[$link['linkdate']] = $link; } - $this->linkDB->savedb($this->conf->get('resource.page_cache')); + $this->linkDB->save($this->conf->get('resource.page_cache')); return true; } -- cgit v1.2.3