mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 16:50:09 +01:00
Improvements to "valet use" command
- properly detects if the requested version is already installed, and skips re-installing/re-starting/re-configuring - allows --force to re-configure anyway - smarter treatment of 'php' when it's aliased to another specific installed version
This commit is contained in:
@@ -172,6 +172,26 @@ function ends_with($haystack, $needles) {
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('starts_with')) {
|
||||
/**
|
||||
* Determine if a given string starts with a given substring.
|
||||
*
|
||||
* @param string $haystack
|
||||
* @param string|string[] $needles
|
||||
* @return bool
|
||||
*/
|
||||
function starts_with($haystack, $needles)
|
||||
{
|
||||
foreach ((array) $needles as $needle) {
|
||||
if ((string) $needle !== '' && strncmp($haystack, $needle, strlen($needle)) === 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user