示例#1
0
文件: Scanner.php 项目: phmlabs/smoke
 public function __construct(array $rules, HttpAdapterInterface $client, Dispatcher $eventDispatcher, Retriever $responseRetriever)
 {
     $eventDispatcher->simpleNotify('Scanner.Init', array('rules' => $rules, 'httpClient' => $client, 'dispatcher' => $eventDispatcher));
     $this->rules = $rules;
     $this->eventDispatcher = $eventDispatcher;
     $this->responseRetriever = $responseRetriever;
     $this->eventDispatcher->simpleNotify('Scanner.Init.ResponseRetriever', array('responseRetriever' => $this->responseRetriever));
 }
示例#2
0
 public function init(Configuration $_configuration, Dispatcher $_eventDispatcher)
 {
     if ($_configuration->hasSection('stop')) {
         $strategies = $_configuration->getSection('stop');
         foreach ($strategies as $name => $strategy) {
             $this->stopStrategies[$name] = Init::initialize($strategy);
             $_eventDispatcher->connectListener($this->stopStrategies[$name]);
         }
     }
 }