mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 08:10:07 +01:00
Small changes to allow Valet to be used in non-CLI contexts
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
<?php
|
||||
|
||||
if (php_sapi_name() !== "cli") {
|
||||
// Allow bypassing these checks if using Valet in a non-CLI app
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the system's compatibility with Valet.
|
||||
*/
|
||||
|
||||
@@ -4,21 +4,22 @@
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Container\Container;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
use Symfony\Component\Console\Helper\Table;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
|
||||
/**
|
||||
* Define the ~/.config/valet path as a constant.
|
||||
* Define constants
|
||||
*/
|
||||
define('VALET_LOOPBACK', '127.0.0.1');
|
||||
define('VALET_HOME_PATH', $_SERVER['HOME'].'/.config/valet');
|
||||
define('VALET_SERVER_PATH', realpath(__DIR__ . '/../../server.php'));
|
||||
define('VALET_STATIC_PREFIX', '41c270e4-5535-4daa-b23e-c269744c2f45');
|
||||
if (! defined('VALET_LOOPBACK')) {
|
||||
define('VALET_LOOPBACK', '127.0.0.1');
|
||||
define('VALET_HOME_PATH', $_SERVER['HOME'] . '/.config/valet');
|
||||
define('VALET_SERVER_PATH', realpath(__DIR__ . '/../../server.php'));
|
||||
define('VALET_STATIC_PREFIX', '41c270e4-5535-4daa-b23e-c269744c2f45');
|
||||
|
||||
define('VALET_LEGACY_HOME_PATH', $_SERVER['HOME'].'/.valet');
|
||||
define('VALET_LEGACY_HOME_PATH', $_SERVER['HOME'] . '/.valet');
|
||||
|
||||
define('BREW_PREFIX', (new CommandLine())->runAsUser('printf $(brew --prefix)'));
|
||||
define('BREW_PREFIX', (new CommandLine())->runAsUser('printf $(brew --prefix)'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Output the given text to the console.
|
||||
@@ -28,7 +29,7 @@
|
||||
*/
|
||||
function info($output)
|
||||
{
|
||||
output('<info>'.$output.'</info>');
|
||||
output('<info>' . $output . '</info>');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,7 +40,7 @@ function info($output)
|
||||
*/
|
||||
function warning($output)
|
||||
{
|
||||
output('<fg=red>'.$output.'</>');
|
||||
output('<fg=red>' . $output . '</>');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +71,7 @@ function output($output)
|
||||
return;
|
||||
}
|
||||
|
||||
(new ConsoleOutput)->writeln($output);
|
||||
(new ConsoleOutput())->writeln($output);
|
||||
}
|
||||
|
||||
if (! function_exists('resolve')) {
|
||||
|
||||
Reference in New Issue
Block a user