示例#1
0
 private function getConfig()
 {
     $dispatcher = new \phmLabs\Components\Annovent\Dispatcher();
     \PhmLabs\Components\Init\Init::registerGlobalParameter('_eventDispatcher', $dispatcher);
     \PhmLabs\Components\Init\Init::registerGlobalParameter('_output', null);
     return new \whm\Smoke\Config\Configuration(new \whm\Html\Uri('http://www.example.com'), $dispatcher, \Symfony\Component\Yaml\Yaml::parse(file_get_contents(__DIR__ . '/fixtures/filter.yml')));
 }
示例#2
0
 protected function init(InputInterface $input, OutputInterface $output, $url = null)
 {
     if ($input->hasOption('bootstrap') && !is_null($input->getOption('bootstrap'))) {
         include $input->getOption('bootstrap');
     }
     $this->output = $output;
     $this->eventDispatcher = new Dispatcher();
     Init::registerGlobalParameter('_eventDispatcher', $this->eventDispatcher);
     Init::registerGlobalParameter('_output', $output);
     $this->writeSmokeCredentials($url);
 }
示例#3
0
 public function __construct(Uri $uri, Dispatcher $eventDispatcher, array $configArray, array $defaultSettings = null)
 {
     $this->eventDispatcher = $eventDispatcher;
     Init::registerGlobalParameter('_configuration', $this);
     $this->initConfigArray($configArray, $defaultSettings);
     if (array_key_exists('extensions', $this->configArray)) {
         $this->addListener($this->configArray['extensions']);
     }
     if (!array_key_exists('rules', $this->configArray)) {
         $this->configArray['rules'] = [];
     }
     $this->startUri = $uri;
     $this->initRules($this->configArray['rules']);
 }