for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of CacheTool.
*
* (c) Samuel Gordalina <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CacheTool\Adapter;
use CacheTool\Code;
use Symfony\Component\Process\Process;
class Cli extends AbstractAdapter
{
/**
* {@inheritdoc}
protected function doRun(Code $code)
$file = $this->createTemporaryFile();
$code->writeTo($file);
$process = new Process([PHP_BINARY ?: "php", $file]);
$process->run();
if (!@unlink($file)) {
$this->logger->debug(sprintf('CLI: Could not delete file: %s', $file));
}
return $process->getOutput();