X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Flegacy%2FLegacyLinkDB.php;fp=application%2Fbookmark%2FLinkDB.php;h=7ccf5e54a9c4cb9dfb70974a99197a545ef2c92a;hb=336a28fa4a09b968ce4705900bf57693e672f0bf;hp=f01c7ee6cadaea8422baf7e650ee85e639e84172;hpb=796c4c57d085ae4589b53dfe8369ae9ba30ffdaf;p=github%2Fshaarli%2FShaarli.git diff --git a/application/bookmark/LinkDB.php b/application/legacy/LegacyLinkDB.php similarity index 89% rename from application/bookmark/LinkDB.php rename to application/legacy/LegacyLinkDB.php index f01c7ee6..7ccf5e54 100644 --- a/application/bookmark/LinkDB.php +++ b/application/legacy/LegacyLinkDB.php @@ -1,17 +1,17 @@ offset. */ protected $ids; @@ -82,10 +84,10 @@ class LinkDB implements Iterator, Countable, ArrayAccess // Position in the $this->keys array (for the Iterator interface) private $position; - // Is the user logged in? (used to filter private links) + // Is the user logged in? (used to filter private bookmarks) private $loggedIn; - // Hide public links + // Hide public bookmarks private $hidePublicLinks; /** @@ -95,7 +97,7 @@ class LinkDB implements Iterator, Countable, ArrayAccess * * @param string $datastore datastore file path. * @param boolean $isLoggedIn is the user logged in? - * @param boolean $hidePublicLinks if true all links are private. + * @param boolean $hidePublicLinks if true all bookmarks are private. */ public function __construct( $datastore, @@ -280,7 +282,7 @@ You use the community supported version of the original Shaarli project, by Seba */ private function read() { - // Public links are hidden and user not logged in => nothing to show + // Public bookmarks are hidden and user not logged in => nothing to show if ($this->hidePublicLinks && !$this->loggedIn) { $this->links = array(); return; @@ -310,7 +312,7 @@ You use the community supported version of the original Shaarli project, by Seba $link['sticky'] = isset($link['sticky']) ? $link['sticky'] : false; - // To be able to load links before running the update, and prepare the update + // To be able to load bookmarks before running the update, and prepare the update if (!isset($link['created'])) { $link['id'] = $link['linkdate']; $link['created'] = DateTime::createFromFormat(self::LINK_DATE_FORMAT, $link['linkdate']); @@ -375,13 +377,13 @@ You use the community supported version of the original Shaarli project, by Seba * * @return array $filtered array containing permalink data. * - * @throws LinkNotFoundException if the smallhash is malformed or doesn't match any link. + * @throws BookmarkNotFoundException if the smallhash is malformed or doesn't match any link. */ public function filterHash($request) { $request = substr($request, 0, 6); - $linkFilter = new LinkFilter($this->links); - return $linkFilter->filter(LinkFilter::$FILTER_HASH, $request); + $linkFilter = new LegacyLinkFilter($this->links); + return $linkFilter->filter(LegacyLinkFilter::$FILTER_HASH, $request); } /** @@ -393,21 +395,21 @@ You use the community supported version of the original Shaarli project, by Seba */ public function filterDay($request) { - $linkFilter = new LinkFilter($this->links); - return $linkFilter->filter(LinkFilter::$FILTER_DAY, $request); + $linkFilter = new LegacyLinkFilter($this->links); + return $linkFilter->filter(LegacyLinkFilter::$FILTER_DAY, $request); } /** - * Filter links according to search parameters. + * Filter bookmarks according to search parameters. * * @param array $filterRequest Search request content. Supported keys: * - searchtags: list of tags * - searchterm: term search * @param bool $casesensitive Optional: Perform case sensitive filter - * @param string $visibility return only all/private/public links - * @param bool $untaggedonly return only untagged links + * @param string $visibility return only all/private/public bookmarks + * @param bool $untaggedonly return only untagged bookmarks * - * @return array filtered links, all links if no suitable filter was provided. + * @return array filtered bookmarks, all bookmarks if no suitable filter was provided. */ public function filterSearch( $filterRequest = array(), @@ -420,19 +422,19 @@ You use the community supported version of the original Shaarli project, by Seba $searchtags = isset($filterRequest['searchtags']) ? escape($filterRequest['searchtags']) : ''; $searchterm = isset($filterRequest['searchterm']) ? escape($filterRequest['searchterm']) : ''; - // Search tags + fullsearch - blank string parameter will return all links. - $type = LinkFilter::$FILTER_TAG | LinkFilter::$FILTER_TEXT; // == "vuotext" + // Search tags + fullsearch - blank string parameter will return all bookmarks. + $type = LegacyLinkFilter::$FILTER_TAG | LegacyLinkFilter::$FILTER_TEXT; // == "vuotext" $request = [$searchtags, $searchterm]; - $linkFilter = new LinkFilter($this); + $linkFilter = new LegacyLinkFilter($this); return $linkFilter->filter($type, $request, $casesensitive, $visibility, $untaggedonly); } /** - * Returns the list tags appearing in the links with the given tags + * Returns the list tags appearing in the bookmarks with the given tags * - * @param array $filteringTags tags selecting the links to consider - * @param string $visibility process only all/private/public links + * @param array $filteringTags tags selecting the bookmarks to consider + * @param string $visibility process only all/private/public bookmarks * * @return array tag => linksCount */ @@ -471,12 +473,12 @@ You use the community supported version of the original Shaarli project, by Seba } /** - * Rename or delete a tag across all links. + * Rename or delete a tag across all bookmarks. * * @param string $from Tag to rename * @param string $to New tag. If none is provided, the from tag will be deleted * - * @return array|bool List of altered links or false on error + * @return array|bool List of altered bookmarks or false on error */ public function renameTag($from, $to) { @@ -519,7 +521,7 @@ You use the community supported version of the original Shaarli project, by Seba } /** - * Reorder links by creation date (newest first). + * Reorder bookmarks by creation date (newest first). * * Also update the urls and ids mapping arrays. * @@ -562,7 +564,7 @@ You use the community supported version of the original Shaarli project, by Seba } /** - * Returns a link offset in links array from its unique ID. + * Returns a link offset in bookmarks array from its unique ID. * * @param int $id Persistent ID of a link. *