1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 16:50:09 +01:00
Files
laravel-valet/includes/compatibility.php
Taylor Otwell d933bd65c0 detect phpunit
2016-05-08 23:33:32 -05:00

25 lines
547 B
PHP

<?php
/**
* Check the system's compatibility with Valet.
*/
$inTestingEnvironment = strpos($_SERVER['SCRIPT_NAME'], 'phpunit') !== false;
if (PHP_OS != 'Darwin' && ! $inTestingEnvironment) {
echo 'Valet only supports the Mac operating system.'.PHP_EOL;
exit(1);
}
if (version_compare(PHP_VERSION, '5.5.9', '<')) {
echo "Valet requires PHP 5.5.9 or later.";
exit(1);
}
if (exec('which brew') != '/usr/local/bin/brew' && ! $inTestingEnvironment) {
echo 'Valet requires Brew to be installed on your Mac.';
exit(1);
}