protected function execute(InputInterface $input, OutputInterface $output) { $this->ensureExtensionLoaded('apc'); $file = $input->getOption('file'); $dump = $this->getCacheTool()->apc_bin_dump(null, null); if ($file) { $result = @file_put_contents($file, $dump); if ($result === false) { throw new \RuntimeException(sprintf("Could not write to file: %s", $file)); } } else { echo $dump; } }