]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
remove superfluous returns after die messages
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 20 Nov 2009 07:32:51 +0000 (07:32 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 20 Nov 2009 07:32:51 +0000 (07:32 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@562 b3834d28-1941-0410-a4f8-b48e95affb8f

src/SemanticScuttle/Service/Bookmark.php
src/SemanticScuttle/Service/Vote.php

index 58423909f3cd2ffc7b658b45cd1056b6287e186c..1975b22a539a1c1f25ed5a4f2e7f5706a6e7b02d 100644 (file)
@@ -66,7 +66,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
 
         if (!($dbresult = & $this->db->sql_query_limit($query, 1, 0))) {
             message_die(GENERAL_ERROR, 'Could not get bookmark', '', __LINE__, __FILE__, $query, $this->db);
-            return false;
         }
 
         if ($row =& $this->db->sql_fetchrow($dbresult)) {
@@ -353,7 +352,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
                 'Could not insert bookmark',
                 '', __LINE__, __FILE__, $sql, $this->db
             );
-            return false;
         }
 
         // Get the resultant row ID for the bookmark.
@@ -365,7 +363,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
                 'Could not insert bookmark',
                 '', __LINE__, __FILE__, $sql, $this->db
             );
-            return false;
         }
 
         $uriparts  = explode('.', $address);
@@ -383,7 +380,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
                 'Could not insert bookmark',
                 '', __LINE__, __FILE__, $sql, $this->db
             );
-            return false;
         }
         $this->db->sql_transaction('commit');
 
@@ -456,7 +452,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
         if (!($dbresult = & $this->db->sql_query($sql))) {
             $this->db->sql_transaction('rollback');
             message_die(GENERAL_ERROR, 'Could not update bookmark', '', __LINE__, __FILE__, $sql, $this->db);
-            return false;
         }
 
         $uriparts = explode('.', $address);
@@ -467,7 +462,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
         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);
-            return false;
         }
 
         $this->db->sql_transaction('commit');
@@ -700,7 +694,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
 
         if (!($dbresult = & $this->db->sql_query_limit($query, intval($perpage), intval($start)))) {
             message_die(GENERAL_ERROR, 'Could not get bookmarks', '', __LINE__, __FILE__, $query, $this->db);
-            return false;
         }
 
         if (SQL_LAYER == 'mysql4') {
@@ -715,7 +708,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
 
         if (!($totalresult = & $this->db->sql_query($totalquery)) || (!($row = & $this->db->sql_fetchrow($totalresult)))) {
             message_die(GENERAL_ERROR, 'Could not get total bookmarks', '', __LINE__, __FILE__, $totalquery, $this->db);
-            return false;
         }
 
         $total = $row['total'];
@@ -755,7 +747,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
                 GENERAL_ERROR, 'Could not delete bookmark',
                 '', __LINE__, __FILE__, $query, $this->db
             );
-            return false;
         }
 
         $query = 'DELETE FROM ' . $GLOBALS['tableprefix'] . 'bookmarks2tags'
@@ -767,7 +758,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
                 GENERAL_ERROR, 'Could not delete tags for bookmark',
                 '', __LINE__, __FILE__, $query, $this->db
             );
-            return false;
         }
 
         $query = 'DELETE FROM '. $GLOBALS['tableprefix'] .'votes'
@@ -779,7 +769,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
                 GENERAL_ERROR, 'Could not delete votes for bookmark',
                 '', __LINE__, __FILE__, $query, $this->db
             );
-            return false;
         }
 
         $this->db->sql_transaction('commit');
@@ -795,7 +784,6 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
 
         if (!($dbresult = & $this->db->sql_query($query))) {
             message_die(GENERAL_ERROR, 'Could not delete bookmarks', '', __LINE__, __FILE__, $query, $this->db);
-            return false;
         }
 
         return true;
@@ -837,9 +825,18 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
 
 
 
-    function normalize($address)
+    /**
+     * Normalizes a given address.
+     * Prepends http:// if there is no protocol specified,
+     * and removes the trailing slash
+     *
+     * @param string $address URL to check
+     *
+     * @return string Fixed URL
+     */
+    public function normalize($address)
     {
-        // If bookmark address doesn't contain ":", add "http://" to the start as a default protocol
+        //you know, there is "callto:" and "mailto:"
         if (strpos($address, ':') === false) {
             $address = 'http://'. $address;
         }
index 53bebdc03411c00d62013f78776562523e1fa437..85380e736c4e2e8346f3a9e237a08cbcc8f577c9 100644 (file)
@@ -89,7 +89,6 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
                 '', __LINE__, __FILE__, $query, $this->db
             );
             //FIXME: throw exception
-            return false;
         }
 
         $row = $this->db->sql_fetchrow($dbres);
@@ -126,7 +125,6 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
                 '', __LINE__, __FILE__, $query, $this->db
             );
             //FIXME: throw exception
-            return false;
         }
 
         $row = $this->db->sql_fetchrow($dbres);
@@ -160,7 +158,6 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
                 '', __LINE__, __FILE__, $query, $this->db
             );
             //FIXME: throw exception
-            return null;
         }
 
         $row = $this->db->sql_fetchrow($dbres);
@@ -193,7 +190,6 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
                 '', __LINE__, __FILE__, $query, $this->db
             );
             //FIXME: throw exception
-            return false;
         }
 
         $row = $this->db->sql_fetchrow($dbres);