示例#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'));
 }