<?php
/* Service creation: only useful services are created */
-$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
-$tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
-$cdservice =SemanticScuttle_Service_Factory::getServiceInstance('CommonDescription');
+$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
+$tagservice =SemanticScuttle_Service_Factory::get('Tag');
+$cdservice =SemanticScuttle_Service_Factory::get('CommonDescription');
$pageName = isset($pageName)?$pageName:"";
***************************************************************************/
/* Service creation: only useful services are created */
-$b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag');
+$b2tservice = SemanticScuttle_Service_Factory :: get('Bookmark2Tag');
$logged_on_userid = $userservice->getCurrentUserId();
<?php
-$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag');
$commonTags =& $b2tservice->getRelatedTagsByHash($hash);
$commonTags =& $b2tservice->tagCloud($commonTags, 5, 90, 225, 'alphabet_asc');
<?php
/* Service creation: only useful services are created */
-$tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
+$tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag');
require_once('sidebar.linkedtags.inc.php');
<?php
/* Service creation: only useful services are created */
-$tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
+$tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag');
require_once('sidebar.linkedtags.inc.php');
<?php
/* Service creation: only useful services are created */
-$tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
+$tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag');
require_once('sidebar.linkedtags.inc.php');
<?php
/* Service creation: only useful services are created */
-$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag');
if(!isset($user)) {
<?php
/* Service creation: only useful services are created */
-$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag');
/* Manage input */
$userid = isset($userid)?$userid:NULL;
<?php
/* Service creation: only useful services are created */
-$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag');
if(!isset($user)) $user="";
<?php
/* Service creation: only useful services are created */
-$searchhistoryservice =SemanticScuttle_Service_Factory::getServiceInstance('SearchHistory');
+$searchhistoryservice =SemanticScuttle_Service_Factory::get('SearchHistory');
$logged_on_userid = $userservice->getCurrentUserId();
if ($logged_on_userid === false) {
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) {
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 {
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;
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
// 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();
}
$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);
$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);
// 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()) {
return false;
}
- $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User');
+ $userservice = SemanticScuttle_Service_Factory :: get('User');
$sId = $userservice->getCurrentUserId();
if ($userservice->isLoggedOn()) {
}
}
- $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
+ $tagservice =SemanticScuttle_Service_Factory::get('Tag');
$tags = $tagservice->normalize($tags);
}
}
- $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) {
}
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();
}
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';
// 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()) {
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
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)
}
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;
*
* @return SemanticScuttle_Service Service object
*/
- public static function getServiceInstance($name)
+ public static function get($name)
{
self::loadDb();
self::loadService($name);
}
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);
// 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
}
// 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 {
$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";
}
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() .'`';
}
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);
}
$query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';
$this->db->sql_query($query);
- $tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
+ $tsts =SemanticScuttle_Service_Factory::get('TagStat');
$tsts->deleteAll();
}
}
function getChildren($tag1, $uId) {
- $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
+ $tagservice =SemanticScuttle_Service_Factory::get('Tag');
$tag1 = $tagservice->normalize($tag1);
if($tag1 == '') return false;
}
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);
}
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);
}
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() ."`";
}
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() ."`";
}
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;
* $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);
}
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 ."'";
return false;
}
- $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
+ $tts =SemanticScuttle_Service_Factory::get('Tag2Tag');
$linkedTags = $tts->getLinkedTags($tag1, $relationType, $uId);
$nbDescendants = 0;
$maxDepth = 0;
}
function updateAllStat() {
- $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
+ $tts =SemanticScuttle_Service_Factory::get('Tag2Tag');
$query = "SELECT tag1, uId FROM `". $tts->getTableName() ."`";
$query.= " WHERE relationType = '>'";
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'];
}
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'];
}
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'];
}
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'];
}
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'];
}
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);
}
}
}
// 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;
$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();
}
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();
}
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();
}
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();
}
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();
}
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();
}
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');
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', '');
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, '>');
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');
?>
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');
?>
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', '');
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);
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');
?>
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', '');
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');
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']) != ''))
}
/* Service creation: only useful services are created */
-$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$bookmarkservice =SemanticScuttle_Service_Factory::get('Bookmark');
/*
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']) != ''))
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');
?>
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"\n?>"; ?>
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']) != ''))
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.
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.
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
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.
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.
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.
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.
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.
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']) != ''))
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', '');
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', '');
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', '');
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);
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)) {
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 */
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();
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', '');
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;
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');
// 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();
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', '');
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', '');
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 */
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', '');
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 */
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', '');
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', '');
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);
// 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');
?>
<h1>Upgrade</h1>
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();
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);