| Total Complexity | 4 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class OpcacheConfigurationCommand extends AbstractCommand |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * {@inheritdoc} |
||
| 22 | */ |
||
| 23 | 24 | protected function configure() |
|
| 24 | { |
||
| 25 | $this |
||
| 26 | 24 | ->setName('opcache:configuration') |
|
| 27 | 24 | ->setDescription('Get configuration information about the cache') |
|
| 28 | 24 | ->setHelp(''); |
|
| 29 | 24 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | 1 | protected function execute(InputInterface $input, OutputInterface $output): int |
|
| 35 | { |
||
| 36 | 1 | $this->ensureExtensionLoaded('Zend OPcache'); |
|
| 37 | |||
| 38 | 1 | $info = $this->getCacheTool()->opcache_get_configuration(); |
|
| 39 | |||
| 40 | 1 | $output->writeln("<info>{$info['version']['opcache_product_name']}</info> <comment>{$info['version']['version']}</comment>"); |
|
| 41 | |||
| 42 | 1 | $table = new Table($output); |
|
| 43 | $table |
||
| 44 | 1 | ->setHeaders(['Directive', 'Value']) |
|
| 45 | 1 | ->setRows($this->processDirectives($info['directives'])) |
|
| 46 | ; |
||
| 47 | |||
| 48 | 1 | $table->render(); |
|
| 49 | |||
| 50 | 1 | return 0; |
|
| 51 | } |
||
| 52 | |||
| 53 | 1 | protected function processDirectives(array $directives) |
|
| 62 | } |
||
| 63 | } |
||
| 64 |