]> git.mxchange.org Git - hub.git/commitdiff
Added classes for crawler sources + rewrote 'Source' interface + added more interface...
authorRoland Haeder <roland@mxchange.org>
Sun, 11 May 2014 12:57:39 +0000 (14:57 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 11 May 2014 12:57:39 +0000 (14:57 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
30 files changed:
application/hub/interfaces/handler/task/class_HandleableTask.php
application/hub/interfaces/source/class_Source.php [new file with mode: 0644]
application/hub/interfaces/source/class_Sourceable.php [deleted file]
application/hub/interfaces/source/units/.htaccess [new file with mode: 0644]
application/hub/interfaces/source/units/class_UnitSource.php [new file with mode: 0644]
application/hub/interfaces/source/urls/.htaccess [new file with mode: 0644]
application/hub/interfaces/source/urls/class_UrlSource.php [new file with mode: 0644]
application/hub/main/factories/source/units/class_UnitSourceFactory.php
application/hub/main/factories/source/url/.htaccess [new file with mode: 0644]
application/hub/main/factories/source/url/class_UrlSourceObjectFactory.php [new file with mode: 0644]
application/hub/main/handler/tasks/class_TaskHandler.php
application/hub/main/source/class_
application/hub/main/source/units/class_TestUnitSource.php
application/hub/main/source/urls/.htaccess [new file with mode: 0644]
application/hub/main/source/urls/class_CrawlerUrlSource [new file with mode: 0644]
application/hub/main/source/urls/class_CrawlerUrlSourceFoundRss.php [new file with mode: 0644]
application/hub/main/source/urls/class_CrawlerUrlSourceLocalStart.php [new file with mode: 0644]
application/hub/main/source/urls/class_CrawlerUrlSourceRssStart.php [new file with mode: 0644]
application/hub/main/source/urls/class_CrawlerUrlSourceUploadedList.php [new file with mode: 0644]
application/hub/main/tasks/crawler/url_source/class_CrawlerUrlSource
application/hub/main/tasks/crawler/url_source/class_CrawlerUrlSourceFoundRssTask.php
application/hub/main/tasks/crawler/url_source/class_CrawlerUrlSourceLocalStartTask.php
application/hub/main/tasks/crawler/url_source/class_CrawlerUrlSourceRssStartTask.php
application/hub/main/tasks/crawler/url_source/class_CrawlerUrlSourceUploadedListTask.php
data/.htaccess [new file with mode: 0644]
data/stacks/.htaccess [new file with mode: 0644]
data/url_lists/.htaccess [new file with mode: 0644]
data/url_lists/demo.lst [new file with mode: 0644]
url_lists/.htaccess [deleted file]
url_lists/demo.lst [deleted file]

index ae9c194c62452b30bcaae6668d190ec5733a44c3..2020c566f84a6dd39e1e5e2ef4078f85ff276781 100644 (file)
  */
 interface HandleableTask extends Handleable {
        /**
-        * Registers a task with a task handler. This method throws a
-        * TaskAlreadyRegisteredException if the task has already been registered
+        * Searches a task by given instance
+        *
+        * @param       $taskInstanc    An instanceof a Taskable class
+        * @return      $taskName               Name of the task as used while registration
+        */
+       function searchTask (Taskable $taskInstance);
+
+       /**
+        * Registers a task with a task handler.
         *
         * @param       $taskName               A task name to register the task on
         * @param       $taskInstance   The instance we should register as a task
@@ -33,7 +40,7 @@ interface HandleableTask extends Handleable {
        function registerTask ($taskName, Visitable $taskInstance);
 
        /**
-        * Checks whether tasks are left including idle task.
+        * Checks whether tasks are left including idle task
         *
         * @return      $tasksLeft      Whether there are tasks left to handle
         */
@@ -48,6 +55,14 @@ interface HandleableTask extends Handleable {
         * @return      void
         */
        function handleTasks ();
+
+       /**
+        * Shuts down all tasks and the task handler itself. This method should be
+        * called from a corresponding filter class.
+        * 
+        * @return      void
+        */
+       function doShutdown ();
 }
 
 // [EOF]
diff --git a/application/hub/interfaces/source/class_Source.php b/application/hub/interfaces/source/class_Source.php
new file mode 100644 (file)
index 0000000..d66de7a
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for sources
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Source extends FrameworkInterface {
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/source/class_Sourceable.php b/application/hub/interfaces/source/class_Sourceable.php
deleted file mode 100644 (file)
index 94a23b9..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
- * An interface for sources
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-interface Sourceable extends FrameworkInterface {
-       /**
-        * "Getter" or generator for a message
-        *
-        * @return      $message        A message from our source
-        */
-       function generateMessageFromSource ();
-}
-
-// [EOF]
-?>
diff --git a/application/hub/interfaces/source/units/.htaccess b/application/hub/interfaces/source/units/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/source/units/class_UnitSource.php b/application/hub/interfaces/source/units/class_UnitSource.php
new file mode 100644 (file)
index 0000000..2c25a21
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+/**
+ * An interface for unit sources
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface UnitSource extends Source {
+       /**
+        * "Getter" or generator for a message
+        *
+        * @return      $message        A message from our source
+        */
+       function generateMessageFromSource ();
+}
+
+// [EOF]
+?>
diff --git a/application/hub/interfaces/source/urls/.htaccess b/application/hub/interfaces/source/urls/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/source/urls/class_UrlSource.php b/application/hub/interfaces/source/urls/class_UrlSource.php
new file mode 100644 (file)
index 0000000..03d51ca
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for URL sources
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface UrlSource extends Source {
+}
+
+// [EOF]
+?>
index f95687776ae733f36f81ecd270a348a2004f9047..06ae52ce39eff3aef4699aa991d64c93b258f3a3 100644 (file)
@@ -36,7 +36,7 @@ class UnitSourceFactory extends ObjectFactory {
         * Creates an instance of a configurable and singleton unit source
         *
         * @param       $unitType                       Type of the unit source
-        * @return      $sourceInstance         A Sourceable class instance
+        * @return      $sourceInstance         A UnitSource class instance
         */
        public static final function createUnitSourceInstance ($unitType) {
                // Do we have cache?
diff --git a/application/hub/main/factories/source/url/.htaccess b/application/hub/main/factories/source/url/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/factories/source/url/class_UrlSourceObjectFactory.php b/application/hub/main/factories/source/url/class_UrlSourceObjectFactory.php
new file mode 100644 (file)
index 0000000..76ac831
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * A factory class for URL sources
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class UrlSourceObjectFactory extends ObjectFactory {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Returns a singleton (registry-based) UrlSource instance
+        *
+        * @param       $taskInstance           An instance of a class with an Taskable interface
+        * @return      $sourceInstance         An instance of a UrlSource class
+        */
+       public static final function createUrlSourceInstance (Taskable $taskInstance) {
+               // Get new factory instance
+               $factoryInstance = new UrlSourceObjectFactory();
+
+               // Get task handler instance
+               $handlerInstance = Registry::getRegistry()->getInstance('task_handler');
+
+               // The default node-mode is from our configuration
+               $sourceType = $handlerInstance->searchTask($taskInstance);
+
+               // Only let registered tasks pass
+               assert(!empty($sourceType));
+
+               // If there is no handler?
+               if (Registry::getRegistry()->instanceExists('node_' . $sourceType)) {
+                       // Get handler from registry
+                       $sourceInstance = Registry::getRegistry()->getInstance('node_' . $sourceType);
+               } else {
+                       // Now convert the source type into a class name
+                       $className = $factoryInstance->convertToClassName($sourceType);
+
+                       // Get the node instance
+                       $sourceInstance = ObjectFactory::createObjectByName($className);
+
+                       // Add it to the registry
+                       Registry::getRegistry()->addInstance('node_' . $sourceType, $sourceInstance);
+               }
+
+               // Return the instance
+               return $sourceInstance;
+       }
+}
+
+// [EOF]
+?>
index b8d1f30c0e1999e03ff8ac3d5db4a8b900e7bd2c..f849e4d86e794dbaf2b80409b6ef83866d50eab8 100644 (file)
@@ -174,6 +174,35 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                self::createDebugInstance(__CLASS__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Removing task ' . $taskData['id'] . ' from queue - FINISHED');
         }
 
+       /**
+        * Searches a task by given instance
+        *
+        * @param       $taskInstanc    An instanceof a Taskable class
+        * @return      $taskName               Name of the task as used while registration
+        */
+       public function searchTask (Taskable $taskInstance) {
+               // Default is an empty (not found) task name
+               $taskName = '';
+
+               // Get whole list
+               $taskList = $this->getListInstance()->getArrayFromList('tasks');
+
+               // Search all instances
+               foreach ($taskList as $currentTask) {
+                       // Does it match given task instance?
+                       if ($currentTask['task_instance']->equals($taskInstance)) {
+                               // Found it
+                               $taskName = $currentTask['id'];
+
+                               // Abort here
+                               break;
+                       } // END - if
+               } // END - foreach
+
+               // Return found name
+               return $taskName;
+       }
+
        /**
         * Registers a task with a task handler.
         *
index 46d6533de6df8b24c8860e357163f0c84cf567ba..2441753bd8115bbf873de44e56aed5df0f0bcff7 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class ???Source extends BaseSource implements Sourceable {
+class ???Source extends BaseSource implements Source!!! {
        /**
         * Protected constructor
         *
@@ -35,7 +35,7 @@ class ???Source extends BaseSource implements Sourceable {
        /**
         * Creates an instance of this class
         *
-        * @return      $sourceInstance         An instance of a Sourceable class
+        * @return      $sourceInstance         An instance of a Source class
         */
        public final static function create???Source () {
                // Get new instance
@@ -44,16 +44,6 @@ class ???Source extends BaseSource implements Sourceable {
                // Return the prepared instance
                return $sourceInstance;
        }
-
-       /**
-        * "Getter" or generator for a message
-        *
-        * @return      $message        A message from our source
-        * @todo        0% done
-        */
-       public function generateMessageFromSource () {
-               $this->partialStub('Please implement this method.');
-       }
 }
 
 // [EOF]
index a854fd224520ad0f21073bd2ab54c5e3428ee272..118beed4eaa8f9d57a291efa10410c83821c6ce4 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class TestUnitSource extends BaseSource implements Sourceable, Registerable {
+class TestUnitSource extends BaseSource implements UnitSource, Registerable {
        /**
         * Protected constructor
         *
@@ -35,7 +35,7 @@ class TestUnitSource extends BaseSource implements Sourceable, Registerable {
        /**
         * Creates an instance of this class
         *
-        * @return      $sourceInstance         An instance of a Sourceable class
+        * @return      $sourceInstance         An instance of a Source class
         */
        public final static function createTestUnitSource () {
                // Get new instance
diff --git a/application/hub/main/source/urls/.htaccess b/application/hub/main/source/urls/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/source/urls/class_CrawlerUrlSource b/application/hub/main/source/urls/class_CrawlerUrlSource
new file mode 100644 (file)
index 0000000..eb94110
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A ??? URL source class for crawlers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 Crawler Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CrawlerUrlSource??? extends BaseSource implements UrlSource, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $sourceInstance         An instance of a Source class
+        */
+       public final static function createCrawlerUrlSource??? () {
+               // Get new instance
+               $sourceInstance = new CrawlerUrlSource???();
+
+               // Return the prepared instance
+               return $sourceInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/source/urls/class_CrawlerUrlSourceFoundRss.php b/application/hub/main/source/urls/class_CrawlerUrlSourceFoundRss.php
new file mode 100644 (file)
index 0000000..6abf586
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A FoundRss URL source class for crawlers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 Crawler Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CrawlerUrlSourceFoundRss extends BaseSource implements UrlSource, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $sourceInstance         An instance of a Source class
+        */
+       public final static function createCrawlerUrlSourceFoundRss () {
+               // Get new instance
+               $sourceInstance = new CrawlerUrlSourceFoundRss();
+
+               // Return the prepared instance
+               return $sourceInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/source/urls/class_CrawlerUrlSourceLocalStart.php b/application/hub/main/source/urls/class_CrawlerUrlSourceLocalStart.php
new file mode 100644 (file)
index 0000000..f2b5e15
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A ??? URL source class for crawlers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 Crawler Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CrawlerUrlSourceLocalStart extends BaseSource implements UrlSource, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $sourceInstance         An instance of a Source class
+        */
+       public final static function createCrawlerUrlSourceLocalStart () {
+               // Get new instance
+               $sourceInstance = new CrawlerUrlSourceLocalStart();
+
+               // Return the prepared instance
+               return $sourceInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/source/urls/class_CrawlerUrlSourceRssStart.php b/application/hub/main/source/urls/class_CrawlerUrlSourceRssStart.php
new file mode 100644 (file)
index 0000000..c0f880e
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A RssStart URL source class for crawlers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 Crawler Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CrawlerUrlSourceRssStart extends BaseSource implements UrlSource, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $sourceInstance         An instance of a Source class
+        */
+       public final static function createCrawlerUrlSourceRssStart () {
+               // Get new instance
+               $sourceInstance = new CrawlerUrlSourceRssStart();
+
+               // Return the prepared instance
+               return $sourceInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/source/urls/class_CrawlerUrlSourceUploadedList.php b/application/hub/main/source/urls/class_CrawlerUrlSourceUploadedList.php
new file mode 100644 (file)
index 0000000..ecbbe59
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A UploadedList URL source class for crawlers
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2014 Crawler Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class CrawlerUrlSourceUploadedList extends BaseSource implements UrlSource, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $sourceInstance         An instance of a Source class
+        */
+       public final static function createCrawlerUrlSourceUploadedList () {
+               // Get new instance
+               $sourceInstance = new CrawlerUrlSourceUploadedList();
+
+               // Return the prepared instance
+               return $sourceInstance;
+       }
+}
+
+// [EOF]
+?>
index fc9fa9f0effe94c7004ff8fd1040148a4aaa80ef..b62a9df06507024861b7d1c39659581c4fc7a656 100644 (file)
@@ -61,10 +61,10 @@ class CrawlerUrlSource???Task extends BaseTask implements Taskable, Visitable {
         * Executes the task
         *
         * @return      void
-        * @todo        0%
         */
        public function executeTask () {
-               $this->partialStub('Unimplemented task.');
+               // Get the URL source instance and announce us
+               UrlSourceObjectFactory::createUrlSourceInstance($this)->processStack();
        }
 }
 
index 1988739defe0d800ec5103768e55938633316cab..14236c6ffa6ed537675ecefb1549d905ce3f02eb 100644 (file)
@@ -61,10 +61,10 @@ class CrawlerUrlSourceFoundRssTask extends BaseTask implements Taskable, Visitab
         * Executes the task
         *
         * @return      void
-        * @todo        0%
         */
        public function executeTask () {
-               $this->partialStub('Unimplemented task.');
+               // Get the URL source instance and announce us
+               UrlSourceObjectFactory::createUrlSourceInstance($this)->processStack();
        }
 }
 
index 0972f062a06b58e0a6fe0c9212d1f39b442175ef..9fdb71d1dd90054bb62a6ec6cd2631ca51626fca 100644 (file)
@@ -61,10 +61,10 @@ class CrawlerUrlSourceLocalStartTask extends BaseTask implements Taskable, Visit
         * Executes the task
         *
         * @return      void
-        * @todo        0%
         */
        public function executeTask () {
-               $this->partialStub('Unimplemented task.');
+               // Get the URL source instance and announce us
+               UrlSourceObjectFactory::createUrlSourceInstance($this)->processStack();
        }
 }
 
index fd1a77d45e891e232777a744c85b930bf9819018..413c7ad5d83503f293bca55d5af61b07770b55f1 100644 (file)
@@ -61,10 +61,10 @@ class CrawlerUrlSourceRssStartTask extends BaseTask implements Taskable, Visitab
         * Executes the task
         *
         * @return      void
-        * @todo        0%
         */
        public function executeTask () {
-               $this->partialStub('Unimplemented task.');
+               // Get the URL source instance and announce us
+               UrlSourceObjectFactory::createUrlSourceInstance($this)->processStack();
        }
 }
 
index c8b4b70856367b7ad480ce650c2b6e04425cabc3..7330dda2d886d6b10b421a0e88fc2b54282d5846 100644 (file)
@@ -61,10 +61,10 @@ class CrawlerUrlSourceUploadedListTask extends BaseTask implements Taskable, Vis
         * Executes the task
         *
         * @return      void
-        * @todo        0%
         */
        public function executeTask () {
-               $this->partialStub('Unimplemented task.');
+               // Get the URL source instance and announce us
+               UrlSourceObjectFactory::createUrlSourceInstance($this)->processStack();
        }
 }
 
diff --git a/data/.htaccess b/data/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/data/stacks/.htaccess b/data/stacks/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/data/url_lists/.htaccess b/data/url_lists/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/data/url_lists/demo.lst b/data/url_lists/demo.lst
new file mode 100644 (file)
index 0000000..84b5b40
--- /dev/null
@@ -0,0 +1 @@
+http://mxchange.org
diff --git a/url_lists/.htaccess b/url_lists/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/url_lists/demo.lst b/url_lists/demo.lst
deleted file mode 100644 (file)
index 84b5b40..0000000
+++ /dev/null
@@ -1 +0,0 @@
-http://mxchange.org