From: Roland Haeder Date: Mon, 19 May 2014 20:36:43 +0000 (+0200) Subject: Introduced isUrlStackEmpty() which overwrites the method in BaseSource because X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e114e388919e50f3ca5edcab4ef10fdd84297842;p=hub.git Introduced isUrlStackEmpty() which overwrites the method in BaseSource because isStackInitialized() does currently not work with file-based stacks. Used latest 'core'. Signed-off-by: Roland Haeder --- diff --git a/application/hub/main/source/class_BaseUrlSource.php b/application/hub/main/source/class_BaseUrlSource.php index cf8e9b9bd..9e3de5c37 100644 --- a/application/hub/main/source/class_BaseUrlSource.php +++ b/application/hub/main/source/class_BaseUrlSource.php @@ -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] diff --git a/application/hub/main/source/urls/class_Crawler b/application/hub/main/source/urls/class_Crawler index b77d4e33e..5ef38a60a 100644 --- a/application/hub/main/source/urls/class_Crawler +++ b/application/hub/main/source/urls/class_Crawler @@ -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.'); } } diff --git a/application/hub/main/source/urls/class_CrawlerFoundRssUrlSource.php b/application/hub/main/source/urls/class_CrawlerFoundRssUrlSource.php index 7300b36dc..d77847c2c 100644 --- a/application/hub/main/source/urls/class_CrawlerFoundRssUrlSource.php +++ b/application/hub/main/source/urls/class_CrawlerFoundRssUrlSource.php @@ -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.'); } } diff --git a/application/hub/main/source/urls/class_CrawlerLocalStartUrlSource.php b/application/hub/main/source/urls/class_CrawlerLocalStartUrlSource.php index f84bdc147..a2679ebdb 100644 --- a/application/hub/main/source/urls/class_CrawlerLocalStartUrlSource.php +++ b/application/hub/main/source/urls/class_CrawlerLocalStartUrlSource.php @@ -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.'); } } diff --git a/application/hub/main/source/urls/class_CrawlerRssStartUrlSource.php b/application/hub/main/source/urls/class_CrawlerRssStartUrlSource.php index e53ef143e..e955d027f 100644 --- a/application/hub/main/source/urls/class_CrawlerRssStartUrlSource.php +++ b/application/hub/main/source/urls/class_CrawlerRssStartUrlSource.php @@ -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.'); } } diff --git a/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php b/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php index 90415e019..0c7dd6055 100644 --- a/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php +++ b/application/hub/main/source/urls/class_CrawlerUploadedListUrlSource.php @@ -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 e947d4d08..5d0255415 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit e947d4d080c0780f1573344736abd2699e2e462a +Subproject commit 5d02554156f746355bf6863924b38b784569be24