X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fsymfony%2Ffinder%2FShell%2FShell.php;fp=vendor%2Fsymfony%2Ffinder%2FShell%2FShell.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=65ede47c5fae3158d0d3935c5cbde340c253c464;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/symfony/finder/Shell/Shell.php b/vendor/symfony/finder/Shell/Shell.php deleted file mode 100644 index 65ede47c5..000000000 --- a/vendor/symfony/finder/Shell/Shell.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Shell; - -@trigger_error('The '.__NAMESPACE__.'\Shell class is deprecated since Symfony 2.8 and will be removed in 3.0.', E_USER_DEPRECATED); - -/** - * @author Jean-François Simon - * - * @deprecated since 2.8, to be removed in 3.0. - */ -class Shell -{ - const TYPE_UNIX = 1; - const TYPE_DARWIN = 2; - const TYPE_CYGWIN = 3; - const TYPE_WINDOWS = 4; - const TYPE_BSD = 5; - - /** - * @var string|null - */ - private $type; - - /** - * Returns guessed OS type. - * - * @return int - */ - public function getType() - { - if (null === $this->type) { - $this->type = $this->guessType(); - } - - return $this->type; - } - - /** - * Tests if a command is available. - * - * @param string $command - * - * @return bool - */ - public function testCommand($command) - { - if (!function_exists('exec')) { - return false; - } - - // todo: find a better way (command could not be available) - $testCommand = 'which '; - if (self::TYPE_WINDOWS === $this->type) { - $testCommand = 'where '; - } - - $command = escapeshellcmd($command); - - exec($testCommand.$command, $output, $code); - - return 0 === $code && count($output) > 0; - } - - /** - * Guesses OS type. - * - * @return int - */ - private function guessType() - { - $os = strtolower(PHP_OS); - - if (false !== strpos($os, 'cygwin')) { - return self::TYPE_CYGWIN; - } - - if (false !== strpos($os, 'darwin')) { - return self::TYPE_DARWIN; - } - - if (false !== strpos($os, 'bsd')) { - return self::TYPE_BSD; - } - - if (0 === strpos($os, 'win')) { - return self::TYPE_WINDOWS; - } - - return self::TYPE_UNIX; - } -}