X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Fmain%2Ffactories%2Fstates%2Fcrawler%2Fclass_CrawlerStateFactory.php;h=4b0eb52fb13d769baff26dd844c21974904df471;hb=73aff29b9bc78031853b0b8c0fe0a8e04f66ac29;hp=29021d3cb82ee162cf5271f7d892efce1c87ac74;hpb=72871c3489dd8048f273f0cef908e6f28997ae2b;p=hub.git diff --git a/application/hub/main/factories/states/crawler/class_CrawlerStateFactory.php b/application/hub/main/factories/states/crawler/class_CrawlerStateFactory.php index 29021d3cb..4b0eb52fb 100644 --- a/application/hub/main/factories/states/crawler/class_CrawlerStateFactory.php +++ b/application/hub/main/factories/states/crawler/class_CrawlerStateFactory.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @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() . '.');