1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00
Files
laravel-valet/cli/includes/compatibility.php
2022-12-22 00:27:09 -05:00

30 lines
641 B
PHP

<?php
// Allow bypassing these checks if using Valet in a non-CLI app
if (php_sapi_name() !== 'cli') {
return;
}
/**
* 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, '8.0', '<')) {
echo 'Valet requires PHP 8.0 or later.';
exit(1);
}
if (exec('which brew') == '' && ! $inTestingEnvironment) {
echo 'Valet requires Homebrew to be installed on your Mac.';
exit(1);
}