Пример #1
0
 /**
  * Execute the command.
  *
  * @return void
  */
 public function fire()
 {
     $this->config->set('enabled', false);
     $fetcher = new Fetcher();
     $converter = new Converter(base_path() . '/vendor/pragmarx/ua-parser/php/resources/');
     $converter->convertString($fetcher->fetch(), false);
 }
Пример #2
0
 public function testFetchError()
 {
     $url = "https://raw.githubusercontent.com/ua-parser/uap-core/master/regexes.yaml";
     $fetcher = new Fetcher(stream_context_create(array('ssl' => array('verify_peer' => true, Fetcher::getPeerNameKey() => 'invalid.com'))));
     $this->setExpectedException('UAParser\\Exception\\FetcherException', 'Could not fetch HTTP resource "' . $url . '": file_get_contents(' . $url . '): failed to open stream: operation failed');
     $fetcher->fetch();
 }
Пример #3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $fs = new Filesystem();
     $fetcher = new Fetcher();
     $fs->dumpFile($input->getArgument('file'), $fetcher->fetch());
 }
Пример #4
0
 public function testFetchError()
 {
     $fetcher = new Fetcher(stream_context_create(array('ssl' => array('verify_peer' => true, 'CN_match' => 'invalid.com'))));
     $this->setExpectedException('UAParser\\Exception\\FetcherException', 'Could not fetch HTTP resource "https://raw.github.com/tobie/ua-parser/master/regexes.yaml": file_get_contents(https://raw.github.com/tobie/ua-parser/master/regexes.yaml): failed to open stream: operation failed');
     $fetcher->fetch();
 }
Пример #5
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $fetcher = new Fetcher();
     $converter = new Converter($this->resourceDirectory);
     $converter->convertString($fetcher->fetch(), !$input->getOption('no-backup'));
 }