From 68c01cda10ef49b05fffb6e323fa2d34ba5dd2f4 Mon Sep 17 00:00:00 2001 From: cweiske Date: Fri, 23 Oct 2009 17:13:16 +0000 Subject: rename ServiceFactory::getServiceInstance() to get() - much easier to write git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@396 b3834d28-1941-0410-a4f8-b48e95affb8f --- data/templates/bookmarks.tpl.php | 6 +++--- data/templates/dynamictags.inc.php | 2 +- data/templates/sidebar.block.common.php | 2 +- data/templates/sidebar.block.linked.php | 2 +- data/templates/sidebar.block.menu.php | 2 +- data/templates/sidebar.block.menu2.php | 2 +- data/templates/sidebar.block.popular.php | 2 +- data/templates/sidebar.block.recent.php | 2 +- data/templates/sidebar.block.related.php | 2 +- data/templates/sidebar.block.search.php | 2 +- data/templates/sidebar.linkedtags.inc.php | 4 ++-- src/SemanticScuttle/Service/Bookmark.php | 20 ++++++++++---------- src/SemanticScuttle/Service/Bookmark2Tag.php | 20 ++++++++++---------- src/SemanticScuttle/Service/Factory.php | 2 +- src/SemanticScuttle/Service/Tag2Tag.php | 16 ++++++++-------- src/SemanticScuttle/Service/TagCache.php | 14 +++++++------- src/SemanticScuttle/Service/TagStat.php | 6 +++--- src/SemanticScuttle/Service/User.php | 14 +++++++------- src/SemanticScuttle/header.php | 4 ++-- tests/BookmarksTest.php | 10 +++++----- tests/CommonDescriptionTest.php | 12 ++++++------ tests/SearchTest.php | 12 ++++++------ tests/Tag2TagTest.php | 10 +++++----- tests/TagsCacheTest.php | 12 ++++++------ tests/TagsTest.php | 12 ++++++------ www/admin.php | 14 +++++++------- www/ajax/getadminlinkedtags.php | 8 ++++---- www/ajax/getadmintags.php | 4 ++-- www/ajax/getcontacttags.php | 4 ++-- www/ajax/getlinkedtags.php | 8 ++++---- www/ajax/gettags.php | 4 ++-- www/ajaxDelete.php | 2 +- www/alltags.php | 4 ++-- www/api/export_csv.php | 2 +- www/api/export_gcs.php | 2 +- www/api/export_html.php | 2 +- www/api/export_sioc.php | 4 ++-- www/api/posts_add.php | 2 +- www/api/posts_all.php | 2 +- www/api/posts_dates.php | 2 +- www/api/posts_delete.php | 2 +- www/api/posts_get.php | 2 +- www/api/posts_public.php | 2 +- www/api/posts_recent.php | 2 +- www/api/posts_update.php | 2 +- www/api/tags_get.php | 2 +- www/api/tags_rename.php | 2 +- www/bookmarkcommondescriptionedit.php | 4 ++-- www/bookmarks.php | 4 ++-- www/edit.php | 2 +- www/history.php | 4 ++-- www/import.php | 2 +- www/importNetscape.php | 2 +- www/importStructure.php | 2 +- www/index.php | 4 ++-- www/populartags.php | 4 ++-- www/rss.php | 4 ++-- www/search.php | 4 ++-- www/tag2tagadd.php | 2 +- www/tag2tagdelete.php | 2 +- www/tag2tagedit.php | 2 +- www/tagcommondescriptionedit.php | 4 ++-- www/tagdelete.php | 2 +- www/tagedit.php | 2 +- www/tagrename.php | 6 +++--- www/tags.php | 4 ++-- www/upgrade.php | 2 +- www/users.php | 4 ++-- www/watchlist.php | 4 ++-- 69 files changed, 170 insertions(+), 170 deletions(-) diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php index 1768928..2314b75 100644 --- a/data/templates/bookmarks.tpl.php +++ b/data/templates/bookmarks.tpl.php @@ -1,9 +1,9 @@ getCurrentUserId(); diff --git a/data/templates/sidebar.block.common.php b/data/templates/sidebar.block.common.php index 7fbc782..951ed80 100644 --- a/data/templates/sidebar.block.common.php +++ b/data/templates/sidebar.block.common.php @@ -1,5 +1,5 @@ getRelatedTagsByHash($hash); $commonTags =& $b2tservice->tagCloud($commonTags, 5, 90, 225, 'alphabet_asc'); diff --git a/data/templates/sidebar.block.linked.php b/data/templates/sidebar.block.linked.php index 6802051..9e91f93 100644 --- a/data/templates/sidebar.block.linked.php +++ b/data/templates/sidebar.block.linked.php @@ -1,6 +1,6 @@ getCurrentUserId(); if ($logged_on_userid === false) { diff --git a/data/templates/sidebar.linkedtags.inc.php b/data/templates/sidebar.linkedtags.inc.php index f978339..020d0f0 100644 --- a/data/templates/sidebar.linkedtags.inc.php +++ b/data/templates/sidebar.linkedtags.inc.php @@ -9,8 +9,8 @@ function displayLinkedTags($tag, $linkType, $uId, $cat_url, $user, $editingMode return array('output' => '', 'stoplist' => $stopList); } - $tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); - $tagstatservice =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); + $tagstatservice =SemanticScuttle_Service_Factory::get('TagStat'); // link '>' if($level>1) { diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php index 6075a0d..c920d65 100644 --- a/src/SemanticScuttle/Service/Bookmark.php +++ b/src/SemanticScuttle/Service/Bookmark.php @@ -27,7 +27,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service function _getbookmark($fieldname, $value, $all = false) { if (!$all) { - $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User'); + $userservice = SemanticScuttle_Service_Factory :: get('User'); $sId = $userservice->getCurrentUserId(); $range = ' AND uId = '. $sId; } else { @@ -61,7 +61,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service if ($row = & $this->db->sql_fetchrow($dbresult)) { if ($include_tags) { - $b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag'); + $b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag'); $row['tags'] = $b2tservice->getTagsForBookmark($bid); } $output = $row; @@ -128,7 +128,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service return false; } - $userservice = SemanticScuttle_Service_Factory::getServiceInstance('User'); + $userservice = SemanticScuttle_Service_Factory::get('User'); $user = $userservice->getCurrentUser(); //user has to be either admin, or owner @@ -170,7 +170,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service // Note that date is expected to be a string that's interpretable by strtotime(). function addBookmark($address, $title, $description, $privateNote, $status, $categories, $date = NULL, $fromApi = false, $fromImport = false, $sId = -1) { if($sId == -1) { - $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User'); + $userservice = SemanticScuttle_Service_Factory :: get('User'); $sId = $userservice->getCurrentUserId(); } @@ -214,7 +214,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service $extension = end($uriparts); unset($uriparts); - $b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag'); + $b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag'); if (!$b2tservice->attachTags($bId, $categories, $fromApi, $extension, false, $fromImport)) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not insert bookmark', '', __LINE__, __FILE__, $sql, $this->db); @@ -270,7 +270,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service $extension = end($uriparts); unset($uriparts); - $b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag'); + $b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag'); if (!$b2tservice->attachTags($bId, $categories, $fromApi, $extension)) { $this->db->sql_transaction('rollback'); message_die(GENERAL_ERROR, 'Could not update bookmark', '', __LINE__, __FILE__, $sql, $this->db); @@ -292,9 +292,9 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service // bookmarks; otherwise, just get the public bookmarks. // - if the $user is set and IS the logged-in user, then get all bookmarks. - $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); - $b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); - $tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $userservice =SemanticScuttle_Service_Factory::get('User'); + $b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); + $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); $sId = $userservice->getCurrentUserId(); if ($userservice->isLoggedOn()) { @@ -506,7 +506,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service return false; } - $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User'); + $userservice = SemanticScuttle_Service_Factory :: get('User'); $sId = $userservice->getCurrentUserId(); if ($userservice->isLoggedOn()) { diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php index bd3f3af..07d75b9 100644 --- a/src/SemanticScuttle/Service/Bookmark2Tag.php +++ b/src/SemanticScuttle/Service/Bookmark2Tag.php @@ -53,7 +53,7 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service } } - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tags = $tagservice->normalize($tags); @@ -104,8 +104,8 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service } } - $bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); - $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $bs =SemanticScuttle_Service_Factory::get('Bookmark'); + $tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); // Create links between tags foreach($tags as $key => $tag) { @@ -161,7 +161,7 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service } function deleteTag($uId, $tag) { - $bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $bs =SemanticScuttle_Service_Factory::get('Bookmark'); $query = 'DELETE FROM '. $this->getTableName(); $query.= ' USING '. $this->getTableName() .', '. $bs->getTableName(); @@ -235,7 +235,7 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service } function &getTags($userid = NULL) { - $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); + $userservice =SemanticScuttle_Service_Factory::get('User'); $logged_on_user = $userservice->getCurrentUserId(); $query = 'SELECT T.tag, COUNT(B.bId) AS bCount FROM '. $GLOBALS['tableprefix'] .'bookmarks AS B INNER JOIN '. $userservice->getTableName() .' AS U ON B.uId = U.'. $userservice->getFieldName('primary') .' INNER JOIN '. $GLOBALS['tableprefix'] .'bookmarks2tags AS T ON B.bId = T.bId'; @@ -310,7 +310,7 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service // Returns the most popular tags used for a particular bookmark hash function &getRelatedTagsByHash($hash, $limit = 20) { - $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User'); + $userservice = SemanticScuttle_Service_Factory :: get('User'); $sId = $userservice->getCurrentUserId(); // Logged in if ($userservice->isLoggedOn()) { @@ -340,7 +340,7 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service function &getAdminTags($limit = 30, $logged_on_user = NULL, $days = NULL) { // look for admin ids - $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User'); + $userservice = SemanticScuttle_Service_Factory :: get('User'); $adminIds = $userservice->getAdminIds(); // ask for their tags @@ -349,7 +349,7 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service function &getContactTags($user, $limit = 30, $logged_on_user = NULL, $days = NULL) { // look for contact ids - $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User'); + $userservice = SemanticScuttle_Service_Factory :: get('User'); $contacts = $userservice->getWatchlist($user); // add the user (to show him/her also his/her tags) @@ -417,8 +417,8 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service } function renameTag($userid, $old, $new, $fromApi = false) { - $bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); if (is_null($userid) || is_null($old) || is_null($new)) return false; diff --git a/src/SemanticScuttle/Service/Factory.php b/src/SemanticScuttle/Service/Factory.php index 92747d7..0ea9009 100644 --- a/src/SemanticScuttle/Service/Factory.php +++ b/src/SemanticScuttle/Service/Factory.php @@ -62,7 +62,7 @@ class SemanticScuttle_Service_Factory * * @return SemanticScuttle_Service Service object */ - public static function getServiceInstance($name) + public static function get($name) { self::loadDb(); self::loadService($name); diff --git a/src/SemanticScuttle/Service/Tag2Tag.php b/src/SemanticScuttle/Service/Tag2Tag.php index b209d60..d283b57 100644 --- a/src/SemanticScuttle/Service/Tag2Tag.php +++ b/src/SemanticScuttle/Service/Tag2Tag.php @@ -27,7 +27,7 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service } function addLinkedTags($tag1, $tag2, $relationType, $uId) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tag1 = $tagservice->normalize($tag1); $tag2 = $tagservice->normalize($tag2); @@ -57,7 +57,7 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service // Return linked tags just for admin users function getAdminLinkedTags($tag, $relationType, $inverseRelation = false, $stopList = array()) { // look for admin ids - $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User'); + $userservice = SemanticScuttle_Service_Factory :: get('User'); $adminIds = $userservice->getAdminIds(); //ask for their linked tags @@ -130,7 +130,7 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service } // try to find data in cache - $tcs = SemanticScuttle_Service_Factory::getServiceInstance('TagCache'); + $tcs = SemanticScuttle_Service_Factory::get('TagCache'); if(count($stopList) == 0) { $activatedCache = true; } else { @@ -188,7 +188,7 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service $query = "SELECT DISTINCT tts.tag1 as tag"; $query.= " FROM `". $this->getTableName() ."` tts"; if($orderBy != null) { - $tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $tsts =SemanticScuttle_Service_Factory::get('TagStat'); $query.= ", ".$tsts->getTableName() ." tsts"; } $query.= " WHERE tts.tag1 <> ALL"; @@ -339,7 +339,7 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service } function renameTag($uId, $oldName, $newName) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $newName = $tagservice->normalize($newName); $query = 'UPDATE `'. $this->getTableName() .'`'; @@ -366,10 +366,10 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service } function update($tag1, $tag2, $relationType, $uId) { - $tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $tsts =SemanticScuttle_Service_Factory::get('TagStat'); $tsts->updateStat($tag1, $relationType, $uId); - $tcs = SemanticScuttle_Service_Factory::getServiceInstance('TagCache'); + $tcs = SemanticScuttle_Service_Factory::get('TagCache'); $tcs->deleteByUser($uId); } @@ -377,7 +377,7 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`'; $this->db->sql_query($query); - $tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $tsts =SemanticScuttle_Service_Factory::get('TagStat'); $tsts->deleteAll(); } diff --git a/src/SemanticScuttle/Service/TagCache.php b/src/SemanticScuttle/Service/TagCache.php index 30f9ebd..95f3ea8 100644 --- a/src/SemanticScuttle/Service/TagCache.php +++ b/src/SemanticScuttle/Service/TagCache.php @@ -37,7 +37,7 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service } function getChildren($tag1, $uId) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tag1 = $tagservice->normalize($tag1); if($tag1 == '') return false; @@ -66,7 +66,7 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service } function addChild($tag1, $tag2, $uId) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tag1 = $tagservice->normalize($tag1); $tag2 = $tagservice->normalize($tag2); @@ -110,7 +110,7 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service } function existsChild($tag1, $tag2, $uId) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tag1 = $tagservice->normalize($tag1); $tag2 = $tagservice->normalize($tag2); @@ -214,7 +214,7 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service } function _isSynonymKey($tag1, $uId) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tag1 = $tagservice->normalize($tag1); $query = "SELECT tag1 FROM `". $this->getTableName() ."`"; @@ -226,7 +226,7 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service } function _isSynonymValue($tag2, $uId) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tag2 = $tagservice->normalize($tag2); $query = "SELECT tag2 FROM `". $this->getTableName() ."`"; @@ -250,7 +250,7 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service } function _getSynonymKey($tag2, $uId) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tag2 = $tagservice->normalize($tag2); if($this->_isSynonymKey($tag2)) return $tag2; @@ -279,7 +279,7 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service * $tagExcepted allows to hide a value. */ function _getSynonymValues($tag1, $uId, $tagExcepted = NULL) { - $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $tagservice =SemanticScuttle_Service_Factory::get('Tag'); $tag1 = $tagservice->normalize($tag1); $tagExcepted = $tagservice->normalize($tagExcepted); diff --git a/src/SemanticScuttle/Service/TagStat.php b/src/SemanticScuttle/Service/TagStat.php index c54dcb7..1bb7b05 100644 --- a/src/SemanticScuttle/Service/TagStat.php +++ b/src/SemanticScuttle/Service/TagStat.php @@ -27,7 +27,7 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_Service } function getNbChildren($tag1, $relationType, $uId) { - $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $query = "SELECT tag1, relationType, uId FROM `". $tts->getTableName() ."`"; $query.= " WHERE tag1 = '" .$tag1 ."'"; $query.= " AND relationType = '". $relationType ."'"; @@ -102,7 +102,7 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_Service return false; } - $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $linkedTags = $tts->getLinkedTags($tag1, $relationType, $uId); $nbDescendants = 0; $maxDepth = 0; @@ -123,7 +123,7 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_Service } function updateAllStat() { - $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $query = "SELECT tag1, uId FROM `". $tts->getTableName() ."`"; $query.= " WHERE relationType = '>'"; diff --git a/src/SemanticScuttle/Service/User.php b/src/SemanticScuttle/Service/User.php index 22076fe..49951d1 100644 --- a/src/SemanticScuttle/Service/User.php +++ b/src/SemanticScuttle/Service/User.php @@ -612,7 +612,7 @@ class User { function getName() { // Look for value only if not already set if(!isset($this->name)) { - $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); + $userservice =SemanticScuttle_Service_Factory::get('User'); $user = $userservice->getUser($this->id); $this->name = $user['name']; } @@ -622,7 +622,7 @@ class User { function getEmail() { // Look for value only if not already set if(!isset($this->email)) { - $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); + $userservice =SemanticScuttle_Service_Factory::get('User'); $user = $userservice->getUser($this->id); $this->email = $user['email']; } @@ -632,7 +632,7 @@ class User { function getHomepage() { // Look for value only if not already set if(!isset($this->homepage)) { - $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); + $userservice =SemanticScuttle_Service_Factory::get('User'); $user = $userservice->getUser($this->id); $this->homepage = $user['homepage']; } @@ -642,7 +642,7 @@ class User { function getContent() { // Look for value only if not already set if(!isset($this->content)) { - $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); + $userservice =SemanticScuttle_Service_Factory::get('User'); $user = $userservice->getUser($this->id); $this->content = $user['uContent']; } @@ -652,7 +652,7 @@ class User { function getDatetime() { // Look for value only if not already set if(!isset($this->content)) { - $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); + $userservice =SemanticScuttle_Service_Factory::get('User'); $user = $userservice->getUser($this->id); $this->datetime = $user['uDatetime']; } @@ -662,14 +662,14 @@ class User { function isAdmin() { // Look for value only if not already set if(!isset($this->isAdmin)) { - $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); + $userservice =SemanticScuttle_Service_Factory::get('User'); $this->isAdmin = $userservice->isAdmin($this->id); } return $this->isAdmin; } function getNbBookmarks($range = 'public') { - $bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); return $bookmarkservice->countBookmarks($this->getId(), $range); } } diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php index 53dcad6..0e8974a 100644 --- a/src/SemanticScuttle/header.php +++ b/src/SemanticScuttle/header.php @@ -50,10 +50,10 @@ if (!defined('UNIT_TEST_MODE')) { } // 5 // Create mandatory services and objects -$userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); +$userservice =SemanticScuttle_Service_Factory::get('User'); $currentUser = $userservice->getCurrentObjectUser(); -$templateservice =SemanticScuttle_Service_Factory::getServiceInstance('Template'); +$templateservice =SemanticScuttle_Service_Factory::get('Template'); $tplVars = array(); $tplVars['currentUser'] = $currentUser; $tplVars['userservice'] = $userservice; diff --git a/tests/BookmarksTest.php b/tests/BookmarksTest.php index fd9ed76..7520058 100644 --- a/tests/BookmarksTest.php +++ b/tests/BookmarksTest.php @@ -20,14 +20,14 @@ class BookmarksTest extends PHPUnit_Framework_TestCase $tableprefix, $TEMPLATES_DIR, $filetypes, $debugMode; require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php'; - $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User'); - $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $this->us =SemanticScuttle_Service_Factory::get('User'); + $this->bs =SemanticScuttle_Service_Factory::get('Bookmark'); $this->bs->deleteAll(); - $this->b2ts=SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); + $this->b2ts=SemanticScuttle_Service_Factory::get('Bookmark2Tag'); $this->b2ts->deleteAll(); - $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $this->tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $this->tts->deleteAll(); - $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $this->tsts =SemanticScuttle_Service_Factory::get('TagStat'); $this->tsts->deleteAll(); } diff --git a/tests/CommonDescriptionTest.php b/tests/CommonDescriptionTest.php index 87d09d1..3f6917e 100644 --- a/tests/CommonDescriptionTest.php +++ b/tests/CommonDescriptionTest.php @@ -21,16 +21,16 @@ class CommonDescriptionTest extends PHPUnit_Framework_TestCase global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix; require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php'; - $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User'); - $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $this->us =SemanticScuttle_Service_Factory::get('User'); + $this->bs =SemanticScuttle_Service_Factory::get('Bookmark'); $this->bs->deleteAll(); - $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); + $this->b2ts =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); $this->b2ts->deleteAll(); - $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $this->tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $this->tts->deleteAll(); - $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $this->tsts =SemanticScuttle_Service_Factory::get('TagStat'); $this->tsts->deleteAll(); - $this->cds =SemanticScuttle_Service_Factory::getServiceInstance('CommonDescription'); + $this->cds =SemanticScuttle_Service_Factory::get('CommonDescription'); $this->cds->deleteAll(); } diff --git a/tests/SearchTest.php b/tests/SearchTest.php index e03b4d9..3aa49de 100644 --- a/tests/SearchTest.php +++ b/tests/SearchTest.php @@ -20,16 +20,16 @@ class SearchTest extends PHPUnit_Framework_TestCase global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix; require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php'; - $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User'); - $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $this->us =SemanticScuttle_Service_Factory::get('User'); + $this->bs =SemanticScuttle_Service_Factory::get('Bookmark'); $this->bs->deleteAll(); - $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); + $this->b2ts =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); $this->b2ts->deleteAll(); - $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $this->tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $this->tts->deleteAll(); - $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $this->tsts =SemanticScuttle_Service_Factory::get('TagStat'); $this->tsts->deleteAll(); - $this->shs =SemanticScuttle_Service_Factory::getServiceInstance('SearchHistory'); + $this->shs =SemanticScuttle_Service_Factory::get('SearchHistory'); $this->shs->deleteAll(); } diff --git a/tests/Tag2TagTest.php b/tests/Tag2TagTest.php index 24c0ae1..5445a67 100644 --- a/tests/Tag2TagTest.php +++ b/tests/Tag2TagTest.php @@ -19,14 +19,14 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix; require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php'; - $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User'); - $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $this->us =SemanticScuttle_Service_Factory::get('User'); + $this->bs =SemanticScuttle_Service_Factory::get('Bookmark'); $this->bs->deleteAll(); - $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); + $this->b2ts =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); $this->b2ts->deleteAll(); - $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $this->tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $this->tts->deleteAll(); - $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $this->tsts =SemanticScuttle_Service_Factory::get('TagStat'); $this->tsts->deleteAll(); } diff --git a/tests/TagsCacheTest.php b/tests/TagsCacheTest.php index f401ab6..8e15f2d 100644 --- a/tests/TagsCacheTest.php +++ b/tests/TagsCacheTest.php @@ -19,16 +19,16 @@ class TagsCacheTest extends PHPUnit_Framework_TestCase global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix, $TEMPLATES_DIR, $debugMode; require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php'; - $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User'); - $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $this->us =SemanticScuttle_Service_Factory::get('User'); + $this->bs =SemanticScuttle_Service_Factory::get('Bookmark'); $this->bs->deleteAll(); - $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); + $this->b2ts =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); $this->b2ts->deleteAll(); - $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $this->tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $this->tts->deleteAll(); - $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $this->tsts =SemanticScuttle_Service_Factory::get('TagStat'); $this->tsts->deleteAll(); - $this->tcs =SemanticScuttle_Service_Factory::getServiceInstance('TagCache'); + $this->tcs =SemanticScuttle_Service_Factory::get('TagCache'); $this->tcs->deleteAll(); } diff --git a/tests/TagsTest.php b/tests/TagsTest.php index bb904e1..f07e04f 100644 --- a/tests/TagsTest.php +++ b/tests/TagsTest.php @@ -16,16 +16,16 @@ class TagsTest extends PHPUnit_Framework_TestCase global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix; require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php'; - $this->ts =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); + $this->ts =SemanticScuttle_Service_Factory::get('Tag'); $this->ts->deleteAll(); - $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User'); - $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $this->us =SemanticScuttle_Service_Factory::get('User'); + $this->bs =SemanticScuttle_Service_Factory::get('Bookmark'); $this->bs->deleteAll(); - $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); + $this->b2ts =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); $this->b2ts->deleteAll(); - $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $this->tts =SemanticScuttle_Service_Factory::get('Tag2Tag'); $this->tts->deleteAll(); - $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); + $this->tsts =SemanticScuttle_Service_Factory::get('TagStat'); $this->tsts->deleteAll(); } diff --git a/www/admin.php b/www/admin.php index 37ebe4b..42fa0c8 100644 --- a/www/admin.php +++ b/www/admin.php @@ -20,13 +20,13 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmark2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tagservice'); -$bookmarkservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark'); -$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag'); -$tagcacheservice = SemanticScuttle_Service_Factory :: getServiceInstance('TagCache'); -$commondescriptionservice = SemanticScuttle_Service_Factory :: getServiceInstance('CommonDescription'); -$searchhistoryservice = SemanticScuttle_Service_Factory :: getServiceInstance('SearchHistory'); -$tagstatservice = SemanticScuttle_Service_Factory :: getServiceInstance('TagStat'); +$bookmark2tagservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tagservice'); +$bookmarkservice = SemanticScuttle_Service_Factory :: get('Bookmark'); +$tag2tagservice = SemanticScuttle_Service_Factory :: get('Tag2Tag'); +$tagcacheservice = SemanticScuttle_Service_Factory :: get('TagCache'); +$commondescriptionservice = SemanticScuttle_Service_Factory :: get('CommonDescription'); +$searchhistoryservice = SemanticScuttle_Service_Factory :: get('SearchHistory'); +$tagstatservice = SemanticScuttle_Service_Factory :: get('TagStat'); // Header variables $tplVars['subtitle'] = T_('Manage users'); diff --git a/www/ajax/getadminlinkedtags.php b/www/ajax/getadminlinkedtags.php index 89dd1e6..0a5d813 100644 --- a/www/ajax/getadminlinkedtags.php +++ b/www/ajax/getadminlinkedtags.php @@ -24,9 +24,9 @@ require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); -$tagstatservice =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Tag'); +$tagstatservice =SemanticScuttle_Service_Factory::get('TagStat'); /* Managing all possible inputs */ isset($_GET['tag']) ? define('GET_TAG', $_GET['tag']): define('GET_TAG', ''); @@ -36,7 +36,7 @@ isset($_GET['uId']) ? define('GET_UID', $_GET['uId']): define('GET_UID', ''); function displayTag($tag, $uId) { $uId = ($uId==0)?NULL:$uId; // if user is nobody, NULL allows to look for every public tags - $tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); $output = '{ id:'.rand().', name:\''.$tag.'\''; $linkedTags = $tag2tagservice->getAdminLinkedTags($tag, '>'); diff --git a/www/ajax/getadmintags.php b/www/ajax/getadmintags.php index 8345516..00e8906 100644 --- a/www/ajax/getadmintags.php +++ b/www/ajax/getadmintags.php @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Tag'); ?> diff --git a/www/ajax/getcontacttags.php b/www/ajax/getcontacttags.php index e508655..4ddc493 100644 --- a/www/ajax/getcontacttags.php +++ b/www/ajax/getcontacttags.php @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Tag'); ?> diff --git a/www/ajax/getlinkedtags.php b/www/ajax/getlinkedtags.php index 2a93a3d..9415f87 100644 --- a/www/ajax/getlinkedtags.php +++ b/www/ajax/getlinkedtags.php @@ -24,9 +24,9 @@ require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); -$tagstatservice =SemanticScuttle_Service_Factory::getServiceInstance('TagStat'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Tag'); +$tagstatservice =SemanticScuttle_Service_Factory::get('TagStat'); /* Managing all possible inputs */ isset($_GET['tag']) ? define('GET_TAG', $_GET['tag']): define('GET_TAG', ''); @@ -36,7 +36,7 @@ isset($_GET['uId']) ? define('GET_UID', $_GET['uId']): define('GET_UID', ''); function displayTag($tag, $uId) { $uId = ($uId==0)?NULL:$uId; // if user is nobody, NULL allows to look for every public tags - $tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); + $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); $output = '{ id:'.rand().', name:\''.$tag.'\''; $linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId); diff --git a/www/ajax/gettags.php b/www/ajax/gettags.php index b6b12c7..3a4a393 100644 --- a/www/ajax/gettags.php +++ b/www/ajax/gettags.php @@ -24,8 +24,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Tag'); ?> diff --git a/www/ajaxDelete.php b/www/ajaxDelete.php index f605b3a..be9ed51 100644 --- a/www/ajaxDelete.php +++ b/www/ajaxDelete.php @@ -25,7 +25,7 @@ header('Cache-Control: no-cache, must-revalidate'); require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark'); +$bookmarkservice = SemanticScuttle_Service_Factory :: get('Bookmark'); /* Managing all possible inputs */ isset($_GET['id']) ? define('GET_ID', $_GET['id']): define('GET_ID', ''); diff --git a/www/alltags.php b/www/alltags.php index 0a88288..52a42b0 100644 --- a/www/alltags.php +++ b/www/alltags.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); diff --git a/www/api/export_csv.php b/www/api/export_csv.php index c696001..04000ef 100644 --- a/www/api/export_csv.php +++ b/www/api/export_csv.php @@ -6,7 +6,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Check to see if a tag was specified. if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != '')) diff --git a/www/api/export_gcs.php b/www/api/export_gcs.php index 1eed961..fab7fe2 100644 --- a/www/api/export_gcs.php +++ b/www/api/export_gcs.php @@ -13,7 +13,7 @@ if($GLOBALS['enableGoogleCustomSearch'] == false) { } /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); /* diff --git a/www/api/export_html.php b/www/api/export_html.php index 922901a..0f36c07 100644 --- a/www/api/export_html.php +++ b/www/api/export_html.php @@ -9,7 +9,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Check to see if a tag was specified. if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != '')) diff --git a/www/api/export_sioc.php b/www/api/export_sioc.php index 90713e7..4b0898e 100644 --- a/www/api/export_sioc.php +++ b/www/api/export_sioc.php @@ -5,8 +5,8 @@ require_once '../../src/SemanticScuttle/header.php'; header('Content-Type: text/xml; charset=utf-8'); //we change headers html defined in headers.inc.php /* Service creation: only useful services are created */ -$userservice =SemanticScuttle_Service_Factory::getServiceInstance('User'); -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$userservice =SemanticScuttle_Service_Factory::get('User'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); ?> "; ?> diff --git a/www/api/posts_add.php b/www/api/posts_add.php index f396b5e..aff8771 100644 --- a/www/api/posts_add.php +++ b/www/api/posts_add.php @@ -14,7 +14,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Get all the bookmark's passed-in information if (isset($_REQUEST['url']) && (trim($_REQUEST['url']) != '')) diff --git a/www/api/posts_all.php b/www/api/posts_all.php index 4c280c7..286d3b3 100644 --- a/www/api/posts_all.php +++ b/www/api/posts_all.php @@ -9,7 +9,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Check to see if a tag was specified. diff --git a/www/api/posts_dates.php b/www/api/posts_dates.php index 5f002d1..5c53a35 100644 --- a/www/api/posts_dates.php +++ b/www/api/posts_dates.php @@ -7,7 +7,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Check to see if a tag was specified. diff --git a/www/api/posts_delete.php b/www/api/posts_delete.php index 7ad332f..9e2781a 100644 --- a/www/api/posts_delete.php +++ b/www/api/posts_delete.php @@ -11,7 +11,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Note that del.icio.us only errors out if no URL was passed in; there's no error on attempting diff --git a/www/api/posts_get.php b/www/api/posts_get.php index a6a6102..2e43a99 100644 --- a/www/api/posts_get.php +++ b/www/api/posts_get.php @@ -14,7 +14,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Check to see if a tag was specified. diff --git a/www/api/posts_public.php b/www/api/posts_public.php index 2ade45e..ca63f44 100644 --- a/www/api/posts_public.php +++ b/www/api/posts_public.php @@ -9,7 +9,7 @@ require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Check to see if a tag was specified. diff --git a/www/api/posts_recent.php b/www/api/posts_recent.php index e8bc644..7d2e8dc 100644 --- a/www/api/posts_recent.php +++ b/www/api/posts_recent.php @@ -11,7 +11,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Check to see if a tag was specified. diff --git a/www/api/posts_update.php b/www/api/posts_update.php index 18e5676..9eb5dbd 100644 --- a/www/api/posts_update.php +++ b/www/api/posts_update.php @@ -9,7 +9,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); // Get the posts relevant to the passed-in variables. diff --git a/www/api/tags_get.php b/www/api/tags_get.php index 043b629..23dfd2a 100644 --- a/www/api/tags_get.php +++ b/www/api/tags_get.php @@ -9,7 +9,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); // Get the tags relevant to the passed-in variables. diff --git a/www/api/tags_rename.php b/www/api/tags_rename.php index bf78b39..a8e281c 100644 --- a/www/api/tags_rename.php +++ b/www/api/tags_rename.php @@ -9,7 +9,7 @@ require_once('httpauth.inc.php'); require_once '../../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); // Get the tag info. if (isset($_REQUEST['old']) && (trim($_REQUEST['old']) != '')) diff --git a/www/bookmarkcommondescriptionedit.php b/www/bookmarkcommondescriptionedit.php index 8a46313..0cd46d9 100644 --- a/www/bookmarkcommondescriptionedit.php +++ b/www/bookmarkcommondescriptionedit.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark'); -$cdservice = SemanticScuttle_Service_Factory :: getServiceInstance('CommonDescription'); +$bookmarkservice = SemanticScuttle_Service_Factory :: get('Bookmark'); +$cdservice = SemanticScuttle_Service_Factory :: get('CommonDescription'); /* Managing all possible inputs */ isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', ''); diff --git a/www/bookmarks.php b/www/bookmarks.php index 32bdba0..4a36a39 100644 --- a/www/bookmarks.php +++ b/www/bookmarks.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); /* Managing all possible inputs */ isset($_GET['action']) ? define('GET_ACTION', $_GET['action']): define('GET_ACTION', ''); diff --git a/www/edit.php b/www/edit.php index 6f30d3c..ba4ae89 100644 --- a/www/edit.php +++ b/www/edit.php @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark'); +$bookmarkservice = SemanticScuttle_Service_Factory :: get('Bookmark'); /* Managing all possible inputs */ isset($_POST['submitted']) ? define('POST_SUBMITTED', $_POST['submitted']): define('POST_SUBMITTED', ''); diff --git a/www/history.php b/www/history.php index a7c2024..fa1c535 100644 --- a/www/history.php +++ b/www/history.php @@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); /* Managing all possible inputs */ isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0); diff --git a/www/import.php b/www/import.php index 8f6e386..87f0a9a 100644 --- a/www/import.php +++ b/www/import.php @@ -67,7 +67,7 @@ if ($userservice->isLoggedOn() && sizeof($_FILES) > 0 && $_FILES['userfile']['si function startElement($parser, $name, $attrs) { global $depth, $status, $tplVars, $userservice; - $bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); + $bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); if ($name == 'POST') { while(list($attrTitle, $attrVal) = each($attrs)) { diff --git a/www/importNetscape.php b/www/importNetscape.php index ad5b414..a941145 100644 --- a/www/importNetscape.php +++ b/www/importNetscape.php @@ -22,7 +22,7 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); /* Managing all possible inputs */ diff --git a/www/importStructure.php b/www/importStructure.php index c5f5fa0..0611fee 100644 --- a/www/importStructure.php +++ b/www/importStructure.php @@ -22,7 +22,7 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag'); +$tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag'); /* Managing current logged user */ $currentUser = $userservice->getCurrentObjectUser(); diff --git a/www/index.php b/www/index.php index 28bf678..bc1b354 100644 --- a/www/index.php +++ b/www/index.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); /* Managing all possible inputs */ isset($_GET['action']) ? define('GET_ACTION', $_GET['action']): define('GET_ACTION', ''); diff --git a/www/populartags.php b/www/populartags.php index 2f501da..06813e9 100644 --- a/www/populartags.php +++ b/www/populartags.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); @list($url, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL; diff --git a/www/rss.php b/www/rss.php index 672f4cd..8c08015 100644 --- a/www/rss.php +++ b/www/rss.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); header('Content-Type: application/xml'); diff --git a/www/search.php b/www/search.php index 4a15053..2b65b2f 100644 --- a/www/search.php +++ b/www/search.php @@ -36,8 +36,8 @@ if (POST_TERMS != '') { // GET } else { /* Service creation: only useful services are created */ - $bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); - $searchhistoryservice =SemanticScuttle_Service_Factory::getServiceInstance('SearchHistory'); + $bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); + $searchhistoryservice =SemanticScuttle_Service_Factory::get('SearchHistory'); /* Managing current logged user */ $currentUserId = $userservice->getCurrentUserId(); diff --git a/www/tag2tagadd.php b/www/tag2tagadd.php index cc1ecb4..166a0d3 100644 --- a/www/tag2tagadd.php +++ b/www/tag2tagadd.php @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag'); +$tag2tagservice = SemanticScuttle_Service_Factory :: get('Tag2Tag'); /* Managing all possible inputs */ isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', ''); diff --git a/www/tag2tagdelete.php b/www/tag2tagdelete.php index dd71a87..af639b3 100644 --- a/www/tag2tagdelete.php +++ b/www/tag2tagdelete.php @@ -22,7 +22,7 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag'); +$tag2tagservice = SemanticScuttle_Service_Factory :: get('Tag2Tag'); /* Managing all possible inputs */ isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', ''); diff --git a/www/tag2tagedit.php b/www/tag2tagedit.php index 750e550..9ee7b96 100644 --- a/www/tag2tagedit.php +++ b/www/tag2tagedit.php @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag'); +$tag2tagservice = SemanticScuttle_Service_Factory :: get('Tag2Tag'); /* Managing all possible inputs */ diff --git a/www/tagcommondescriptionedit.php b/www/tagcommondescriptionedit.php index 84ca5e3..0d9e978 100644 --- a/www/tagcommondescriptionedit.php +++ b/www/tagcommondescriptionedit.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag'); -$cdservice = SemanticScuttle_Service_Factory :: getServiceInstance('CommonDescription'); +$b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag'); +$cdservice = SemanticScuttle_Service_Factory :: get('CommonDescription'); /* Managing all possible inputs */ isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', ''); diff --git a/www/tagdelete.php b/www/tagdelete.php index 9ba18fd..1d2ce5e 100644 --- a/www/tagdelete.php +++ b/www/tagdelete.php @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag'); +$b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag'); /* Managing all possible inputs */ diff --git a/www/tagedit.php b/www/tagedit.php index 5a3fbb4..8b27b7d 100644 --- a/www/tagedit.php +++ b/www/tagedit.php @@ -22,7 +22,7 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag'); +$tagservice = SemanticScuttle_Service_Factory :: get('Tag'); /* Managing all possible inputs */ isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', ''); diff --git a/www/tagrename.php b/www/tagrename.php index 735e2e8..7222acf 100644 --- a/www/tagrename.php +++ b/www/tagrename.php @@ -22,9 +22,9 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag'); -$tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag'); -$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag'); +$b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag'); +$tagservice = SemanticScuttle_Service_Factory :: get('Tag'); +$tag2tagservice = SemanticScuttle_Service_Factory :: get('Tag2Tag'); /* Managing all possible inputs */ isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', ''); diff --git a/www/tags.php b/www/tags.php index 52bf289..e3fd6d2 100644 --- a/www/tags.php +++ b/www/tags.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); /* Managing all possible inputs */ isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0); diff --git a/www/upgrade.php b/www/upgrade.php index 39b82db..10a63ff 100644 --- a/www/upgrade.php +++ b/www/upgrade.php @@ -35,7 +35,7 @@ exit(); // This part below will be executed once you comment the two lines above ///////////////// require_once '../src/SemanticScuttle/header.php'; -$tagstatservice = SemanticScuttle_Service_Factory :: getServiceInstance('TagStat'); +$tagstatservice = SemanticScuttle_Service_Factory :: get('TagStat'); ?>

Upgrade

diff --git a/www/users.php b/www/users.php index 111e512..72f5a3d 100644 --- a/www/users.php +++ b/www/users.php @@ -22,8 +22,8 @@ require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); /* Managing current logged user */ $currentUser = $userservice->getCurrentObjectUser(); diff --git a/www/watchlist.php b/www/watchlist.php index 289a478..6198781 100644 --- a/www/watchlist.php +++ b/www/watchlist.php @@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require_once '../src/SemanticScuttle/header.php'; /* Service creation: only useful services are created */ -$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark'); -$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache'); +$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark'); +$cacheservice =SemanticScuttle_Service_Factory::get('Cache'); /* Managing all possible inputs */ isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0); -- cgit v1.2.3