]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/factories/states/crawler/class_CrawlerStateFactory.php
Updated 'core'.
[hub.git] / application / hub / main / factories / states / crawler / class_CrawlerStateFactory.php
index 29021d3cb82ee162cf5271f7d892efce1c87ac74..4b0eb52fb13d769baff26dd844c21974904df471 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2014 Core Developer Team
+ * @copyright  Copyright (c) 2014, 2015 Hub Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -37,15 +37,17 @@ class CrawlerStateFactory extends ObjectFactory {
         * given crawler instance.
         *
         * @param       $stateName                      Name of the state
-        * @param       $crawlerInstance        A Crawler class instance
         * @return      $stateInstance          A Stateable class instance
         */
-       public static final function createCrawlerStateInstanceByName ($stateName, Crawler $crawlerInstance) {
+       public static final function createCrawlerStateInstanceByName ($stateName) {
                // Then construct the class' configuraton entry
                $className = 'crawler_' . $stateName . '_state_class';
 
                // Get a class from that configuration entry
-               $stateInstance = self::createObjectByConfiguredName($className, array($crawlerInstance));
+               $stateInstance = self::createObjectByConfiguredName($className);
+
+               // Get crawler instance
+               $crawlerInstance = Registry::getRegistry()->getInstance('crawler');
 
                // Debug message
                self::createDebugInstance(__CLASS__)->debugOutput('CRAWLER-STATE-FACTORY[' . __METHOD__ . ':' . __LINE__ . ']: Crawler state has changed from ' . $crawlerInstance->getPrintableState() . ' to ' . $stateInstance->getStateName() . '.');