/** * Generates the configuration tree builder. * * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder */ public function getConfigTreeBuilder() { $builder = new TreeBuilder(); $finder = new ExecutableFinder(); $builder->root('assetic')->children()->booleanNode('debug')->defaultValue($this->debug)->end()->booleanNode('use_controller')->defaultValue($this->debug)->end()->scalarNode('read_from')->defaultValue('%kernel.root_dir%/../web')->end()->scalarNode('write_to')->defaultValue('%assetic.read_from%')->end()->scalarNode('java')->defaultValue($finder->find('java', '/usr/bin/java'))->end()->scalarNode('node')->defaultValue($finder->find('node', '/usr/bin/node'))->end()->scalarNode('sass')->defaultValue($finder->find('sass', '/usr/bin/sass'))->end()->end()->fixXmlConfig('bundle')->children()->arrayNode('bundles')->defaultValue($this->bundles)->requiresAtLeastOneElement()->prototype('scalar')->validate()->ifNotInArray($this->bundles)->thenInvalid('%s is not a valid bundle.')->end()->end()->end()->end()->fixXmlConfig('asset')->children()->arrayNode('assets')->addDefaultsIfNotSet()->requiresAtLeastOneElement()->useAttributeAsKey('name')->prototype('array')->beforeNormalization()->ifTrue(function ($v) { return !is_array($v); })->then(function ($v) { return array('inputs' => array($v)); })->end()->beforeNormalization()->always()->then(function ($v) { // cast scalars as array foreach (array('input', 'inputs', 'filter', 'filters') as $key) { if (isset($v[$key]) && !is_array($v[$key])) { $v[$key] = array($v[$key]); } } // organize arbitrary options foreach ($v as $key => $value) { if (!in_array($key, array('input', 'inputs', 'filter', 'filters', 'option', 'options'))) { $v['options'][$key] = $value; unset($v[$key]); } } return $v; })->end()->fixXmlConfig('input')->fixXmlConfig('filter')->children()->arrayNode('inputs')->prototype('scalar')->end()->end()->arrayNode('filters')->prototype('scalar')->end()->end()->arrayNode('options')->useAttributeAsKey('name')->prototype('variable')->end()->end()->end()->end()->end()->end()->fixXmlConfig('filter')->children()->arrayNode('filters')->addDefaultsIfNotSet()->requiresAtLeastOneElement()->useAttributeAsKey('name')->prototype('variable')->treatNullLike(array())->validate()->ifTrue(function ($v) { return !is_array($v); })->thenInvalid('The assetic.filters config %s must be either null or an array.')->end()->end()->end()->end()->children()->arrayNode('twig')->addDefaultsIfNotSet()->defaultValue(array())->fixXmlConfig('function')->children()->arrayNode('functions')->addDefaultsIfNotSet()->defaultValue(array())->useAttributeAsKey('name')->prototype('variable')->treatNullLike(array())->validate()->ifTrue(function ($v) { return !is_array($v); })->thenInvalid('The assetic.twig.functions config %s must be either null or an array.')->end()->end()->end()->end()->end()->end(); return $builder; }
/** * Creates a new runner. * * @param string|null $binDir The path to Composer's "bin-dir". */ public function __construct($binDir = null) { $phpFinder = new PhpExecutableFinder(); if (!($php = $phpFinder->find())) { throw new RuntimeException('The "php" command could not be found.'); } $puliFinder = new ExecutableFinder(); // Search: // 1. in the current working directory // 2. in Composer's "bin-dir" // 3. in the system path $searchPath = array_merge(array(getcwd()), (array) $binDir); // Search "puli.phar" in the PATH and the current directory if (!($puli = $puliFinder->find('puli.phar', null, $searchPath))) { // Search "puli" in the PATH and Composer's "bin-dir" if (!($puli = $puliFinder->find('puli', null, $searchPath))) { throw new RuntimeException('The "puli"/"puli.phar" command could not be found.'); } } if (Path::hasExtension($puli, '.bat', true)) { $this->puli = $puli; } else { $this->puli = $php . ' ' . $puli; } }
/** * @return string */ public function find() { if (null === ($executable = $this->executableFinder->find('docker-compose'))) { throw new \RuntimeException('Unable to find docker-compose binary. ' . 'You should run `docker:install` to set up your Docker environment'); } return $executable; }
public static function find() { $composer = new ExecutableFinder(); $composerPath = $composer->find('composer'); if ($composerPath !== null) { return $composerPath; } $composerPath = $composer->find('composer.phar', null, [$this->baseDir, $this->baseDir . '/bin/']); if ($composerPath !== null) { return $composerPath; } throw new \RuntimeException('Cannot find a local installation of composer. Please ensure that composer is in your $PATH, or there is a composer.phar at the root of the symfony installation.'); }
protected static function buildFixtures() { $finder = Finder::create(); Filesystem::create()->copyDir(__DIR__ . '/fixtures', static::$tmpDir, $finder); chdir(static::$tmpDir); $exFinder = new ExecutableFinder(); if (!is_executable($executable = $exFinder->find('composer.phar'))) { $executable = $exFinder->find('composer'); } $process = new Process($executable . ' dumpautoload'); $process->run(); //static::$composerOutput = $process->getOutput(); }
/** * {@inheritdoc} */ public function handle() { if (!$this->processLauncher->isSupported()) { throw new RuntimeException('The ProcessLauncher must be supported for the man help to run.'); } if (!$this->manBinary) { $this->manBinary = $this->executableFinder->find('man'); } if (!$this->manBinary) { throw new RuntimeException('The "man" binary was not found.'); } return $this->processLauncher->launchProcess(escapeshellcmd($this->manBinary) . ' -l %path%', array('path' => $this->path), false); }
/** * {@inheritdoc} */ public function handle(Args $args, IO $io) { if ($this->processLauncher->isSupported()) { if (!$this->lessBinary) { $this->lessBinary = $this->executableFinder->find('less'); } if ($this->lessBinary) { return $this->processLauncher->launchProcess(escapeshellcmd($this->lessBinary) . ' %path%', array('path' => $this->path), false); } } $io->write(file_get_contents($this->path)); return 0; }
/** * @param string $command * @param boolean $forceUnix This parameter makes it possible to force unix style commands * on a windows environment. * This can be useful in git hooks. * * @return string * * @throws RuntimeException if the command can not be found */ public function locate($command, $forceUnix = false) { // Search executable: $executable = $this->executableFinder->find($command, null, array($this->binDir)); if (!$executable) { throw new RuntimeException(sprintf('The executable for "%s" could not be found.', $command)); } // Make sure to add unix-style directory separators if unix-mode is enforced if ($forceUnix) { $parts = pathinfo($executable); $executable = $parts['dirname'] . '/' . $parts['filename']; } return $executable; }
private $workbenchSettings; private $command; private $phpBinary; private $gitBinary; //private $pharSamiBinary; /** * WorkbenchApiGeneration constructor. * @param \Padosoft\Workbench\WorkbenchSettings $workbenchSettings * @param Command $command */ public function __construct(WorkbenchSettings $workbenchSettings, Command $command) { $this->workbenchSettings = $workbenchSettings; $this->command = $command; $finder = new ExecutableFinder(); $this->gitBinary = '"' . str_replace("\\", "/", $finder->find('git', null, [Config::get('workbench.git_path')])) . '"';
public function execute(InputInterface $input, OutputInterface $output) { $this->output = $output; $outputDir = $input->getOption('outdir'); $guiBin = null; if ($input->getOption('gui')) { $finder = new ExecutableFinder(); $guiBin = $finder->find($input->getOption('gui-bin')); if (null === $guiBin) { throw new \InvalidArgumentException(sprintf('Could not locate GUI bin "%s"', $input->getOption('gui-bin'))); } } if (!$this->filesystem->exists($outputDir)) { $output->writeln(sprintf('<comment>// creating non-existing directory %s</comment>', $outputDir)); $this->filesystem->mkdir($outputDir); } $generatedFiles = array(); $this->runnerHandler->runFromInput($input, $output, array('executor' => array('executor' => 'xdebug', 'output_dir' => $outputDir, 'callback' => function ($iteration) use($outputDir, $guiBin, &$generatedFiles) { $generatedFiles[] = $generatedFile = $outputDir . DIRECTORY_SEPARATOR . XDebugUtil::filenameFromIteration($iteration); if ($guiBin) { $process = new Process(sprintf($guiBin . ' ' . $generatedFile)); $process->run(); } }), 'iterations' => 1)); $output->write(PHP_EOL); $output->writeln(sprintf('<info>%s profile(s) generated:</info>', count($generatedFiles))); $output->write(PHP_EOL); foreach ($generatedFiles as $generatedFile) { if (!file_exists($generatedFile)) { throw new \InvalidArgumentException(sprintf('Profile "%s" was not generated. Maybe you do not have XDebug installed?', $generatedFile)); } $this->output->writeln(sprintf(' %s', $generatedFile)); } }
public function findExecutable($name, $default = null, array $extraDirs = array()) { $finder = new ExecutableFinder(); $extraDirs = array_merge($this->getDefaultDirs(), $extraDirs); $executable = $finder->find($name, $default, $extraDirs); return is_executable($executable) ? $executable : false; }
function render($context = null, $vars = array()) { $options = $this->options; $compress = @$options["compress"] ?: false; $outputFile = tempnam(sys_get_temp_dir(), 'metatemplate_template_less_output'); $finder = new ExecutableFinder(); $bin = @$this->options["less_bin"] ?: self::DEFAULT_LESSC; $cmd = $finder->find($bin); if ($cmd === null) { throw new \UnexpectedValueException("'{$bin}' executable was not found. Make sure it's installed."); } if ($compress) { $cmd .= ' -x'; } if (array_key_exists('include_path', $this->options)) { $cmd .= sprintf('--include-path %s', escapeshellarg(join(PATH_SEPARATOR, (array) $this->options['include_path']))); } $cmd .= " --no-color - {$outputFile}"; $process = new Process($cmd); $process->setStdin($this->getData()); if ($this->isFile()) { $process->setWorkingDirectory(dirname($this->source)); } $process->setEnv(array('PATH' => getenv("PATH"))); $process->run(); $content = @file_get_contents($outputFile); @unlink($outputFile); if (!$process->isSuccessful()) { throw new \RuntimeException("{$cmd} returned an error: " . $process->getErrorOutput()); } return $content; }
/** * @param \Symfony\Component\Process\ExecutableFinder $finder */ function it_should_handle_notifysend_notifications_only($finder) { $notification = new NotifySendNotification('message', []); $otherNotification = new EmailNotification(['recipient'], []); $finder->find(NotifySend::NOTIFY_SEND_COMMAND)->willReturn(true); if (!$this->getWrappedObject()->shouldHandle($notification)) { throw new \Exception('fails'); } if ($this->getWrappedObject()->shouldHandle($otherNotification)) { throw new \Exception('fails'); } $finder->find(NotifySend::NOTIFY_SEND_COMMAND)->willReturn(null); if ($this->getWrappedObject()->shouldHandle($notification)) { throw new \Exception('fails'); } }
public function testConfiguredUsage() { $executableFinder = new ExecutableFinder(); $php = $executableFinder->find('php'); if (null === $php) { $this->markTestSkipped('Unable to find mandatory PHP executable'); } $app = new Application(); $app->register(new MediaAlchemystServiceProvider(), array('media-alchemyst.configuration' => array('ffmpeg.threads' => 42, 'ffmpeg.ffmpeg.timeout' => 42, 'ffmpeg.ffprobe.timeout' => 42, 'ffmpeg.ffmpeg.binaries' => $php, 'ffmpeg.ffprobe.binaries' => $php, 'imagine.driver' => 'gd', 'gs.timeout' => 42, 'gs.binaries' => $php, 'mp4box.timeout' => 42, 'mp4box.binaries' => $php, 'swftools.timeout' => 42, 'swftools.pdf2swf.binaries' => $php, 'swftools.swfrender.binaries' => $php, 'swftools.swfextract.binaries' => $php, 'unoconv.binaries' => $php, 'unoconv.timeout' => 42))); $drivers = $app['media-alchemyst']->getDrivers(); $this->assertEquals($php, $drivers['ffmpeg.ffmpeg']->getFFMpegDriver()->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $drivers['ffmpeg.ffprobe']->getFFProbeDriver()->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $drivers['ghostscript.transcoder']->getProcessBuilderFactory()->getBinary()); $this->assertInstanceOf('Imagine\\Gd\\Imagine', $drivers['imagine']); $this->assertEquals($php, $drivers['swftools.driver-container']['pdf2swf']->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $drivers['swftools.driver-container']['swfextract']->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $drivers['swftools.driver-container']['swfrender']->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $drivers['unoconv']->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $drivers['mp4box']->getProcessBuilderFactory()->getBinary()); $this->assertEquals(42, $drivers['ffmpeg.ffmpeg']->getFFMpegDriver()->getConfiguration()->get('ffmpeg.threads')); $this->assertEquals(42, $drivers['ffmpeg.ffmpeg']->getFFMpegDriver()->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $drivers['ffmpeg.ffprobe']->getFFProbeDriver()->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $drivers['ghostscript.transcoder']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $drivers['swftools.driver-container']['pdf2swf']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $drivers['swftools.driver-container']['swfextract']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $drivers['swftools.driver-container']['swfrender']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $drivers['unoconv']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $drivers['mp4box']->getProcessBuilderFactory()->getTimeout()); }
public function testCustomizedDrivers() { $object = new DriversContainer(); $executableFinder = new ExecutableFinder(); $php = $executableFinder->find('php'); if (null === $php) { $this->markTestSkipped('Unable to find mandatory PHP executable'); } $object['configuration'] = array('ffmpeg.threads' => 42, 'ffmpeg.ffmpeg.timeout' => 42, 'ffmpeg.ffprobe.timeout' => 42, 'ffmpeg.ffmpeg.binaries' => $php, 'ffmpeg.ffprobe.binaries' => $php, 'imagine.driver' => 'gd', 'gs.timeout' => 42, 'gs.binaries' => $php, 'mp4box.timeout' => 42, 'mp4box.binaries' => $php, 'swftools.timeout' => 42, 'swftools.pdf2swf.binaries' => $php, 'swftools.swfrender.binaries' => $php, 'swftools.swfextract.binaries' => $php, 'unoconv.binaries' => $php, 'unoconv.timeout' => 42); $this->assertEquals($php, $object['ffmpeg.ffmpeg']->getFFMpegDriver()->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $object['ffmpeg.ffprobe']->getFFProbeDriver()->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $object['ghostscript.transcoder']->getProcessBuilderFactory()->getBinary()); $this->assertInstanceOf('Imagine\\Gd\\Imagine', $object['imagine']); $this->assertEquals($php, $object['swftools.driver-container']['pdf2swf']->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $object['swftools.driver-container']['swfextract']->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $object['swftools.driver-container']['swfrender']->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $object['unoconv']->getProcessBuilderFactory()->getBinary()); $this->assertEquals($php, $object['mp4box']->getProcessBuilderFactory()->getBinary()); $this->assertEquals(42, $object['ffmpeg.ffmpeg']->getFFMpegDriver()->getConfiguration()->get('ffmpeg.threads')); $this->assertEquals(42, $object['ffmpeg.ffmpeg']->getFFMpegDriver()->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $object['ffmpeg.ffprobe']->getFFProbeDriver()->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $object['ghostscript.transcoder']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $object['swftools.driver-container']['pdf2swf']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $object['swftools.driver-container']['swfextract']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $object['swftools.driver-container']['swfrender']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $object['unoconv']->getProcessBuilderFactory()->getTimeout()); $this->assertEquals(42, $object['mp4box']->getProcessBuilderFactory()->getTimeout()); }
public function testLoadDefaultBin() { $this->extension->load(array(), $this->container); $finder = new ExecutableFinder(); $bowerLocation = $finder->find('bower', '/usr/bin/bower'); $this->assertParameter($bowerLocation, 'sp_bower.bower.bin'); }
function render($context = null, $vars = array()) { $finder = new ExecutableFinder(); $bin = @$this->options["tsc_bin"] ?: self::DEFAULT_TSC; $cmd = $finder->find($bin); if ($cmd === null) { throw new \UnexpectedValueException("'{$bin}' executable was not found. Make sure it's installed."); } $inputFile = sys_get_temp_dir() . '/pipe_typescript_input_' . uniqid() . '.ts'; file_put_contents($inputFile, $this->getData()); $outputFile = tempnam(sys_get_temp_dir(), 'pipe_typescript_output_') . '.js'; $cmd .= " --out " . escapeshellarg($outputFile) . ' ' . escapeshellarg($inputFile); $process = new Process($cmd); $process->setEnv(array('PATH' => @$_SERVER['PATH'] ?: join(PATH_SEPARATOR, array("/bin", "/sbin", "/usr/bin", "/usr/local/bin", "/usr/local/share/npm/bin")))); if ($this->isFile()) { $process->setWorkingDirectory(dirname($this->source)); } $process->run(); unlink($inputFile); if ($process->getErrorOutput()) { throw new \RuntimeException("tsc({$this->source}) returned an error:\n {$process->getErrorOutput()}"); } $data = file_get_contents($outputFile); unlink($outputFile); return $data; }
public function execute(InputInterface $input, OutputInterface $output) { $outputDir = $this->outputDirHandler->handleOutputDir($input, $output); $guiBin = null; if ($input->getOption('gui')) { $finder = new ExecutableFinder(); $guiBin = $finder->find($input->getOption('gui-bin')); if (null === $guiBin) { throw new \InvalidArgumentException(sprintf('Could not locate GUI bin "%s"', $input->getOption('gui-bin'))); } } $generatedFiles = []; $this->runnerHandler->runFromInput($input, $output, ['executor' => ['executor' => 'xdebug_profile', 'output_dir' => $outputDir, 'callback' => function ($iteration) use($outputDir, $guiBin, &$generatedFiles) { $generatedFiles[] = $generatedFile = $outputDir . DIRECTORY_SEPARATOR . XDebugUtil::filenameFromIteration($iteration, '.cachegrind'); if ($guiBin) { $process = new Process(sprintf($guiBin . ' ' . $generatedFile)); $process->run(); } }], 'iterations' => [1]]); $output->write(PHP_EOL); $output->writeln(sprintf('<info>%s profile(s) generated:</info>', count($generatedFiles))); $output->write(PHP_EOL); foreach ($generatedFiles as $generatedFile) { if (!file_exists($generatedFile)) { throw new \InvalidArgumentException(sprintf('Profile "%s" was not generated. Maybe you do not have XDebug installed?', $generatedFile)); } $output->writeln(sprintf(' %s', $generatedFile)); } }
public static function setUpBeforeClass() { $oldCwd = getcwd(); self::$gitRepo = sys_get_temp_dir() . '/composer-git-' . rand() . '/'; $locator = new ExecutableFinder(); if (!$locator->find('git')) { self::$skipped = 'This test needs a git binary in the PATH to be able to run'; return; } if (!mkdir(self::$gitRepo) || !chdir(self::$gitRepo)) { self::$skipped = 'Could not create and move into the temp git repo ' . self::$gitRepo; return; } // init $process = new ProcessExecutor(); $process->execute('git init', $null); touch('foo'); $process->execute('git add foo', $null); $process->execute('git commit -m init', $null); // non-composed tag & branch $process->execute('git tag 0.5.0', $null); $process->execute('git branch oldbranch', $null); // add composed tag & master branch $composer = array('name' => 'a/b'); file_put_contents('composer.json', json_encode($composer)); $process->execute('git add composer.json', $null); $process->execute('git commit -m addcomposer', $null); $process->execute('git tag 0.6.0', $null); // add feature-a branch $process->execute('git checkout -b feature-a', $null); file_put_contents('foo', 'bar feature'); $process->execute('git add foo', $null); $process->execute('git commit -m change-a', $null); // add version to composer.json $process->execute('git checkout master', $null); $composer['version'] = '1.0.0'; file_put_contents('composer.json', json_encode($composer)); $process->execute('git add composer.json', $null); $process->execute('git commit -m addversion', $null); // create tag with wrong version in it $process->execute('git tag 0.9.0', $null); // create tag with correct version in it $process->execute('git tag 1.0.0', $null); // add feature-b branch $process->execute('git checkout -b feature-b', $null); file_put_contents('foo', 'baz feature'); $process->execute('git add foo', $null); $process->execute('git commit -m change-b', $null); // add 1.0 branch $process->execute('git checkout master', $null); $process->execute('git branch 1.0', $null); // add 1.0.x branch $process->execute('git branch 1.1.x', $null); // update master to 2.0 $composer['version'] = '2.0.0'; file_put_contents('composer.json', json_encode($composer)); $process->execute('git add composer.json', $null); $process->execute('git commit -m bump-version', $null); chdir($oldCwd); }
public function setUp() { $finder = new ExecutableFinder(); $unoconv = $finder->find('unoconv'); if (null === $unoconv) { $this->markTestSkipped('Unable to detect unoconv, mandatory for this test'); } }
public static function setUpBeforeClass() { $finder = new ExecutableFinder(); self::$jsEngine = $finder->find("phantomjs"); fwrite(STDOUT, "Starting up of functional tests"); self::$startTime = time(); if (self::$jsEngine != null) { fwrite(STDOUT, " with PhantomJS (webkit engine)"); } else { self::$jsEngine = $finder->find("slimerjs"); if (self::$jsEngine != null) { fwrite(STDOUT, " with SlimerJS (gecko engine)"); } } self::$jsEngine = null; fwrite(STDOUT, PHP_EOL); }
public function __construct($path = null) { if (!$path) { $finder = new ExecutableFinder(); $path = $finder->find('git', '/usr/bin/git'); } $this->setPath($path); }
protected function findExecutable($name, $serverKey = null) { if ($serverKey && isset($_SERVER[$serverKey])) { return $_SERVER[$serverKey]; } $finder = new ExecutableFinder(); return $finder->find($name); }
protected function findExecutable($name, $server = null) { if (!is_null($server) and getenv($server) !== false) { return $_SERVER[$server]; } $finder = new ExecutableFinder(); return $finder->find($name); }
protected function findExecutable($name, $server = null) { if (!is_null($server) and isset($_SERVER[$server])) { return $_SERVER[$server]; } $finder = new ExecutableFinder(); return $finder->find($name); }
protected function getPhpBinary() { $finder = new ExecutableFinder(); $php = $finder->find('php'); if (null === $php) { $this->markTestSkipped('Unable to find a php binary'); } return $php; }
public function __construct($pathToVagrant = null) { if ($pathToVagrant) { $this->command = $pathToVagrant; } else { $finder = new ExecutableFinder(); $this->command = $finder->find('vagrant'); } }
/** * {@inheritDoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $finder = new ExecutableFinder(); $treeBuilder->root('html_compressor')->children()->booleanNode('enabled')->defaultTrue()->end()->scalarNode('java')->defaultValue(function () use($finder) { return $finder->find('java', '/usr/bin/java'); })->end()->scalarNode('jar')->isRequired()->cannotBeEmpty()->end()->arrayNode('options')->normalizeKeys(false)->prototype('scalar')->end()->end(); return $treeBuilder; }
/** * @inheritdoc */ public function find($names, $default = null, array $extraDirs = array()) { foreach ((array) $names as $name) { $executable = parent::find($name, $default, $extraDirs); if ($executable != $default) { return $executable; } } return $default; }
public function isScriptingSupported() { $executableFinder = new ExecutableFinder(); foreach (['composer', 'composer.phar'] as $candidateName) { if ($composerPath = $executableFinder->find($candidateName, null, array(getcwd()))) { return true; } } return false; }