mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 16:10:08 +01:00
extract helper into autoloaded file
This commit is contained in:
22
compatibility.php
Normal file
22
compatibility.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Check the system's compatibility with Valet.
|
||||
*/
|
||||
if (PHP_OS != 'Darwin') {
|
||||
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') {
|
||||
echo 'Valet requires Brew to be installed on your Mac.';
|
||||
|
||||
exit(1);
|
||||
}
|
||||
@@ -15,6 +15,7 @@
|
||||
],
|
||||
"autoload": {
|
||||
"files": [
|
||||
"compatibility.php",
|
||||
"helpers.php"
|
||||
],
|
||||
"psr-4": {
|
||||
|
||||
25
helpers.php
25
helpers.php
@@ -77,31 +77,6 @@ function run_as_root($command, callable $onError = null)
|
||||
return $processOutput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the system's compatibility with Valet.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
call_user_func(function () {
|
||||
if (PHP_OS != 'Darwin') {
|
||||
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') {
|
||||
echo 'Valet requires Brew to be installed on your Mac.';
|
||||
|
||||
exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Verify that the script is currently running as "sudo".
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user