CacheTool\Command\ApcBinDumpCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    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;
        }
    }
ApcBinDumpCommand