mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 00:40:06 +01:00
Maintain compatibility with the old name of the PHP version
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
|
||||
class Brew
|
||||
{
|
||||
const SUPPORTED_PHP_VERSIONS = ['php', 'php@7.2', 'php@7.1', 'php@7.0', 'php@5.6'];
|
||||
const SUPPORTED_PHP_VERSIONS = ['php', 'php@7.2', 'php@7.1', 'php@7.0', 'php@5.6', 'php72', 'php71', 'php70', 'php56'];
|
||||
const LATEST_PHP_VERSION = 'php@7.2';
|
||||
|
||||
var $cli, $files;
|
||||
|
||||
|
||||
@@ -111,10 +111,11 @@ function fpmConfigPath()
|
||||
$confLookup = [];
|
||||
|
||||
foreach (Brew::SUPPORTED_PHP_VERSIONS as $version) {
|
||||
$versionNormalized = preg_replace('/([^\d\.])/', '', $version);
|
||||
$versionNormalized = $versionNormalized === ''
|
||||
? '7.2'
|
||||
: $versionNormalized;
|
||||
$versionNormalized = preg_replace(
|
||||
'/php@?(\d)\.?(\d)/',
|
||||
'$1.$2',
|
||||
$version === 'php' ? Brew::LATEST_PHP_VERSION : $version
|
||||
);
|
||||
|
||||
$confLookup[$version] = $versionNormalized === '5.6'
|
||||
? '/usr/local/etc/php/5.6/php-fpm.conf'
|
||||
|
||||
@@ -67,6 +67,10 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
{
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php72')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php71')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php70')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php56')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@7.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.0')->andReturn(false);
|
||||
@@ -75,6 +79,10 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php72')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php71')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php70')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php56')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.1')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@7.0')->andReturn(false);
|
||||
@@ -83,6 +91,10 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php72')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php71')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php70')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php56')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.0')->andReturn(true);
|
||||
@@ -91,6 +103,10 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php72')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php71')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php70')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php56')->andReturn(true);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.0')->andReturn(false);
|
||||
@@ -99,6 +115,10 @@ public function test_has_installed_php_indicates_if_php_is_installed_via_brew()
|
||||
|
||||
$brew = Mockery::mock(Brew::class.'[installed]', [new CommandLine, new Filesystem]);
|
||||
$brew->shouldReceive('installed')->with('php')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php72')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php71')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php70')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php56')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.2')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.1')->andReturn(false);
|
||||
$brew->shouldReceive('installed')->with('php@7.0')->andReturn(false);
|
||||
|
||||
Reference in New Issue
Block a user