1
0
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:
Taylor Otwell
2016-05-07 12:19:51 -05:00
parent c9d5735589
commit 9f4896399e
3 changed files with 23 additions and 25 deletions

22
compatibility.php Normal file
View 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);
}

View File

@@ -15,6 +15,7 @@
],
"autoload": {
"files": [
"compatibility.php",
"helpers.php"
],
"psr-4": {

View File

@@ -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".
*