]> git.mxchange.org Git - hub.git/commitdiff
Introduced isUrlStackEmpty() which overwrites the method in BaseSource because
authorRoland Haeder <roland@mxchange.org>
Mon, 19 May 2014 20:36:43 +0000 (22:36 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 19 May 2014 20:37:34 +0000 (22:37 +0200)
isStackInitialized() does currently not work with file-based stacks.

Used latest 'core'.

Signed-off-by: Roland Haeder <roland@mxchange.org>
application/hub/main/source/class_BaseUrlSource.php
application/hub/main/source/urls/class_Crawler
application/hub/main/source/urls/class_CrawlerFoundRssUrlSource.php
application/hub/main/source/urls/class_CrawlerLocalStartUrlSource.php
application/hub/main/source/urls/class_CrawlerRssStartUrlSource.php
application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php
core

index cf8e9b9bdb6621a652b9b9afc362e2abf3a7134f..9e3de5c37d365dccf7fcb55984708c2448aa51ea 100644 (file)
@@ -47,6 +47,19 @@ class BaseUrlSource extends BaseSource {
                // Set the stack here
                $this->setStackerInstance($stackInstance);
        }
+
+       /**
+        * Determines whether the stack 'urls' is empty.
+        *
+        * @return      $isEmpty        Whether the stack 'urls' is empty.
+        */
+       protected function isUrlStackEmpty () {
+               // Determine it
+               $isEmpty = $this->getStackerInstance()->isStackEmpty('urls');
+
+               // Return result
+               return $isEmpty;
+       }
 }
 
 // [EOF]
index b77d4e33e20900882c7429f92817d6b26e50e529..5ef38a60a908bc5e2327abd1f62db7e60ee719bf 100644 (file)
@@ -52,9 +52,15 @@ class Crawler???UrlSource extends BaseUrlSource implements UrlSource, Registerab
         * Processes entries in the stack.
         *
         * @return      void
-        * @todo        0% done
+        * @todo        ~ 10% done
         */
        public function processStack () {
+               // Does the stack have some entries left?
+               if ($this->isUrlStackEmpty()) {
+                       // Nothing to handle here
+                       return;
+               } // END - if
+
                $this->partialStub('Please implement this method.');
        }
 }
index 7300b36dc1edee190af184155b0371c2a3702932..d77847c2cd758311ba2e1f95573d7065138721c6 100644 (file)
@@ -52,9 +52,15 @@ class CrawlerFoundRssUrlSource extends BaseUrlSource implements UrlSource, Regis
         * Processes entries in the stack.
         *
         * @return      void
-        * @todo        0% done
+        * @todo        ~10% done
         */
        public function processStack () {
+               // Does the stack have some entries left?
+               if ($this->isUrlStackEmpty()) {
+                       // Nothing to handle here
+                       return;
+               } // END - if
+
                $this->partialStub('Please implement this method.');
        }
 }
index f84bdc147cf8af486c58d8f45b108cad667bca33..a2679ebdb2799bedeebb2b7572c976ac97f1b9cd 100644 (file)
@@ -52,9 +52,15 @@ class CrawlerLocalStartUrlSource extends BaseUrlSource implements UrlSource, Reg
         * Processes entries in the stack.
         *
         * @return      void
-        * @todo        0% done
+        * @todo        ~10% done
         */
        public function processStack () {
+               // Does the stack have some entries left?
+               if ($this->isUrlStackEmpty()) {
+                       // Nothing to handle here
+                       return;
+               } // END - if
+
                $this->partialStub('Please implement this method.');
        }
 }
index e53ef143e9d320c36ac57c42f61d183a2ad0ab9a..e955d027f2f93209024ea05c060556278b8ad09a 100644 (file)
@@ -52,9 +52,15 @@ class CrawlerRssStartUrlSource extends BaseUrlSource implements UrlSource, Regis
         * Processes entries in the stack.
         *
         * @return      void
-        * @todo        0% done
+        * @todo        ~10% done
         */
        public function processStack () {
+               // Does the stack have some entries left?
+               if ($this->isUrlStackEmpty()) {
+                       // Nothing to handle here
+                       return;
+               } // END - if
+
                $this->partialStub('Please implement this method.');
        }
 }
index 90415e019ebaecffbb0b5c5244a753cda6b8637b..0c7dd60550401062a291a1a7deaf42f0dc0db0c8 100644 (file)
@@ -52,9 +52,15 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
         * Processes entries in the stack.
         *
         * @return      void
-        * @todo        0% done
+        * @todo        ~10% done
         */
        public function processStack () {
+               // Does the stack have some entries left?
+               if ($this->isUrlStackEmpty()) {
+                       // Nothing to handle here
+                       return;
+               } // END - if
+
                $this->partialStub('Please implement this method.');
        }
 }
diff --git a/core b/core
index e947d4d080c0780f1573344736abd2699e2e462a..5d02554156f746355bf6863924b38b784569be24 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit e947d4d080c0780f1573344736abd2699e2e462a
+Subproject commit 5d02554156f746355bf6863924b38b784569be24