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=08e0cc5549ffda65f0c18592ca796cb4329aaf3e;hpb=c1880f1bd7437bc1c330352a54b90f068fad527b;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 08e0cc554..4b0eb52fb 100644 --- a/application/hub/main/factories/states/crawler/class_CrawlerStateFactory.php +++ b/application/hub/main/factories/states/crawler/class_CrawlerStateFactory.php @@ -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() . '.');