| @@ 48-74 (lines=27) @@ | ||
| 45 | parent::__construct(); |
|
| 46 | } |
|
| 47 | ||
| 48 | protected function configure() : void |
|
| 49 | { |
|
| 50 | $this |
|
| 51 | ->setName('browscap:fetch') |
|
| 52 | ->setDescription('Fetches an updated INI file for Browscap.') |
|
| 53 | ->addArgument( |
|
| 54 | 'file', |
|
| 55 | InputArgument::OPTIONAL, |
|
| 56 | 'browscap.ini file', |
|
| 57 | $this->defaultIniFile |
|
| 58 | ) |
|
| 59 | ->addOption( |
|
| 60 | 'remote-file', |
|
| 61 | 'r', |
|
| 62 | InputOption::VALUE_OPTIONAL, |
|
| 63 | 'browscap.ini file to download from remote location (possible values are: ' . IniLoaderInterface::PHP_INI_LITE |
|
| 64 | . ', ' . IniLoaderInterface::PHP_INI . ', ' . IniLoaderInterface::PHP_INI_FULL . ')', |
|
| 65 | IniLoaderInterface::PHP_INI |
|
| 66 | ) |
|
| 67 | ->addOption( |
|
| 68 | 'cache', |
|
| 69 | 'c', |
|
| 70 | InputOption::VALUE_OPTIONAL, |
|
| 71 | 'Where the cache files are located', |
|
| 72 | $this->defaultCacheFolder |
|
| 73 | ); |
|
| 74 | } |
|
| 75 | ||
| 76 | protected function execute(InputInterface $input, OutputInterface $output) : void |
|
| 77 | { |
|
| @@ 42-68 (lines=27) @@ | ||
| 39 | parent::__construct(); |
|
| 40 | } |
|
| 41 | ||
| 42 | protected function configure() : void |
|
| 43 | { |
|
| 44 | $this |
|
| 45 | ->setName('browscap:update') |
|
| 46 | ->setDescription('Fetches an updated INI file for Browscap and overwrites the current PHP file.') |
|
| 47 | ->addOption( |
|
| 48 | 'remote-file', |
|
| 49 | 'r', |
|
| 50 | InputOption::VALUE_OPTIONAL, |
|
| 51 | 'browscap.ini file to download from remote location (possible values are: ' . IniLoaderInterface::PHP_INI_LITE |
|
| 52 | . ', ' . IniLoaderInterface::PHP_INI . ', ' . IniLoaderInterface::PHP_INI_FULL . ')', |
|
| 53 | IniLoaderInterface::PHP_INI |
|
| 54 | ) |
|
| 55 | ->addOption( |
|
| 56 | 'no-backup', |
|
| 57 | null, |
|
| 58 | InputOption::VALUE_NONE, |
|
| 59 | 'Do not backup the previously existing file' |
|
| 60 | ) |
|
| 61 | ->addOption( |
|
| 62 | 'cache', |
|
| 63 | 'c', |
|
| 64 | InputOption::VALUE_OPTIONAL, |
|
| 65 | 'Where the cache files are located', |
|
| 66 | $this->defaultCacheFolder |
|
| 67 | ); |
|
| 68 | } |
|
| 69 | ||
| 70 | protected function execute(InputInterface $input, OutputInterface $output) : void |
|
| 71 | { |
|