All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
3.1.7 - 2025-03-22
-
Fixed
Ngrok::hasAuthTokenmethod to explicitly check for anauthtokenproperty within the ngrok config file, when the config file already exists.Previously, the method only checks if the config file exists, if it doesn't then the authtoken isn't set. But what if the user added the config manually or edited the file? The method would then always
return trueeven though the token might not exist.Fixed by adding an explicit check of the contents if the file does exist. The contents of the yml config file is read and converted to an associative array.
From this we can then check if the config version is 2 or 3 (v3 has a new config format), and then we can check if the
authtokenkey exists. In v3 theauthtokenis defined in a separateagentkey, so the checks need to be adjusted. -
Fixed
Ngrok::runmethod to check if the command proxying to ngrok executable is theupdateorconfig upgradecommand, if it is then append the ngrok config flag to it. This is just so ngrok doesn't complain it can't find the config, and so we can upgrade the config to v3 without the user specifying the config location.
-
Added
symfony/yamldependency to convert contents of a.ymlfile to an associative array. (Required for the fixedNgrok::hasAuthTokenmethod.) -
Added various output messages to the terminal for
Ngrok::start, so it's more descriptive as to what's happening. -
Added new
CommandLine::shellExecmethod to execute the command in the terminal, and also be able to return the output as a string to the calling method. This is just a wrapper around the native PHPshell_execfunction.
-
Dependency version bump for
mnapoli/sillyto 1.9 -
Refactored
Ngrok::getNgrokConfigmethod to optionally return only the path of the config file (without the leading--configcli flag). (Required for the fixedNgrok::hasAuthTokenmethod.) -
Changed
Ngrok::startmethod to output a message if ngrok errors that the executable is "too old" for the account:ERROR: authentication failed: Your ngrok-agent version "3.3.1" is too old. The minimum supported agent version for your account is "3.6.0". Please update to a newer version with ngrok update...
Because we can't test ngrok commands for errors or errors in the executable (which was tested in commit f8be62b, but reverted in a449582), we need to return the output of any errors and check the output for a specific error code relating to the "too old" error (
ERR_NGROK_121). Then output a message (along with the original error output) to the user to inform them that they can update ngrok executable and also upgrade the config file themselves by performing the valet commands:valet ngrok updateandvalet ngrok config upgraderespectively.All errors other errors will still output to the terminal.
-
Removed the functionality of starting a new CMD window in
Ngrok::startof thesharecommand, since a new window will surpress any errors. We need to be able to output the errors as and when they happen. -
Removed the
--debugflag from thesharecommand since this is now defunct with the removal of the new CMD window. (Debug only prevented the CMD window opening, forcing errors to be logged directly to the terminal.) (Not a breaking change.)
3.1.6.1 - 2025-03-11
- Fixed version number because in v3.1.6 release, Valet didn't have it's version bumped, so it was displaying as v3.1.5. Fixed by bumping version to v3.1.6.1
3.1.6 - 2025-03-06
- Added emergency batch script to stop and uninstall services if errors occur when running
composer global updatewithout uninstalling valet first. This happens because the services are still installed and therefore the files cannot be removed and updated since they're in-use. The batch script is to emergency stop and uninstall the services, so a subsequent composer update is able to work.
- Fixed
php:whichcommand to obtain the linked sites and merge with the parked sites array. Previously, it was only getting the parked sites, so not all sites were obtained and queried.
3.1.5 - 2025-03-03
-
Fixed a deprecation notice in PHP 8.4:
Valet\CommandLine::run(): Implicitly marking parameter $onError as nullable is deprecated, the explicit nullable type must be used instead.
When an optional function argument is typed eg.
callable $onError = null, it is implicitly casted tonullvia it's default value, this is now deprecated in 8.4. Usually we can just use a union typecallable|null, this is explicitly tells PHP it is eithercallableornull. However, union types were only introduced in 8.0. To keep backward compatibility for PHP 7, we can use the nullable type operator (?) instead.Using the nullable type operator fixes the deprecation notice in 8.4 and is backwards compatible for PHP 7 and 8.
3.1.4 - 2024-08/06
- Fixed a bug with AcrylicDNS when Valet is installed on Linux on Windows via WSL2, WSL2 wouldn't launch on system reboot (Fix PR by @jerrens in #15).
- Changed the binding address to
127.0.0.1instead of0.0.0.0. Fixes #14
- Changed the binding address to
3.1.3 - 2024-05-23
-
Fixed Valet install failure, particularly with Ansicon due to spaces in the user directory name (Fix PR by @shahriarrahat in #12).
- Adds a
pathFilterfunction to replace the directory name with it's Windows shortname equivalent. e.g. fromJohn DoetoJOHNDO~1. For use with thevaletBinPathfunction that is used in the Ansicon installation.
- Adds a
-
Fixed multiple cmd or powershell commands for spaces by wrapping them in double quotes.
-
Fixed errors where composer diagnostics and the valet diagnostics output file couldn't be written because it was trying to write to the terminal's current working directory, which could be a protected directory like
Program Files. AddedVALET_HOME_PATHto the commands, so that they get saved to~/.config/valet. -
Fixed the copying of the diagnostics output to clipboard that just stopped working for unknown reasons. Fixed by changing
cli->runtocli->powershellto ensure that the copy commandclipis available. -
Fixed the nginx config check command in
diagnose, where it errors out because it couldn't find the file due to:-
the path after the
-coption couldn't be the shortened username via thevaletBinPath(). Changed it back to use__DIR__. And added an escaped double quotes (\") around it. -
the replacing of all backslashes in the command. This meant that with the new escaped double quotes it changed the backslash to forward slash. So instead of
-c \"C:/Users/...it was changed to-c /"C:/Users/...and the system interpreted it as"C:/C:/Users/...Fixed by changing the replace function to use a regex that only replaces single backslashes and disregards the escaped quotes.
-
-
Changed
pathFilterfunction from #12 to replace forward slashes with backslashes to prevent errors within the function where paths aren't exploded because the/s. But replaced the backslashes back to forwardslashes once the function was complete and fix further errors that occurred. -
Moved the
diagnosecommands array into the__constructfunction so that we can use the globalvaletBinPathfunction and allow the paths to also be changed to the short username if needed. -
Changed various
diagnosearray commands to use thevaletBinPathfunction and the command that has theCOMPOSER_GLOBAL_PATHto use thefilterPathfunction.
3.1.2 - 2024-05-17
-
Fixed #11 bug that couldn't find the PHP executable when trying to add the default when installing valet. It would fail to get the PHP when there is a space in the path like
c:/Program Files/php/. Wrapping the path in quotes in the underlying cmd command fixes this. -
Fixed an issue with the
diagnosecommand which was brought up in #11. The command wasn't available if valet wasn't installed, and could never be installed because of the PHP bug above. Fixed this by always havingdiagnosecommand available whether valet is installed or not.
3.1.1 - 2024-03-25
- Aesthetic only - Added the logo as an ASCII art to the namespace command
valet; and thevalet listcommand, via extending Silly's Application class.
- Updated dependencies for Laravel installer to add support for Laravel 11, (PR by @ onecentlin in #10).
3.1.0 - 2024-02-28
- Added new
paritycommand to get a calculation of the percentage of parity completion against Laravel Valet for macOS.
- Updated dependencies for Laravel installer to add support for Laravel 10, (PR by @hemant-kr-meena in #8).
-
Fixed #6 PHP 8+ deprecation notice for required parameters declared after optional parameters.
The notice would only show when the PHP ini
error_reportingsetting wasn't ignoring deprecation notices, and all reports are enabled, ie.E_ALL. This notice would then be displayed in the terminal on everyvaletcommand. Though it doesn't impact valet's functionality, it could potentially be broken in future PHP versions.Fixed by:
-
Adding a default
nullvalue to the$debugparameter for the optional--debugoption of thesharecommand. -
Removing the default
nullvalue from the$keyparameter of the optionalkeyargument of thelogcommand. Because the key is used to specify the name of a specific log and omitting the argument will make valet list all the log file names, it doesn't need to have a default value.
-
- The
installconfirmation question of outdated cretueusebiu package. Doesn't affect valet functionality.
3.0.0 - 2023-09-21
-
Added support for multiple PHP services, (Feature PR by @iamroi in cretueusebiu#195).
- Enables the use of the previously disabled
valet usecommand, to switch the default PHP version used by Valet. - Adds new commands
php:add,php:remove,php:install,php:uninstall,php:list,xdebug:install,xdebug:uninstall.
- Enables the use of the previously disabled
-
Added PHP version to the
linkscommand output (Patch 1 PR by @damsfx in iamroi#1). -
Added PHP version to the
parkedcommand output, improvements to the Patch 1 above and a new commandphp:which(Patch 2 by @yCodeTech in #1)-
Adds
defaultorisolatedto the PHP version output, with the latter being coloured green for emphasis in bothparkedandlinkscommands. This acts as a 2 in 1, showing the PHP version, and determines whether the site is isolated. -
Adds
AliasandAlias URLto theparkedcommand output. If the parked site also has a symbolic link, it's linked name (aka alias) and alias URL will be outputted in the table. -
Adds new
php:whichcommand to determine which PHP version the current working directory or a specified site is using. -
Changes the output table to vertical for easier reading, using Symfony's
setVerticalmethod (only works when Valet is installed on PHP 8.1).
-
-
Added new
isolateandunisolatecommands. Isolates the current working directory or a specified site (also specify multiple sites) to a specific PHP version, and removes an isolated site (also unisolate all sites), respectively. -
Added
version_aliasto theaddPhpfunction in theConfiguration.phpfile, creating an alias name for the full PHP version, which is then written to the user's Valetconfig.json. A full PHP version of 8.1.8 will have the alias of 8.1, the alias can then be used in commands. -
Added PHP's
krsortfunction to theaddPhpfunction in theConfiguration.phpfile, so that the PHP array in the user's Valetconfig.jsonis written in a natural decending order that adheres to decimals.Natural decending order example:
8.1.18 8.1.8 7.4.33This means that when two different patch versions of the same SemVer MAJOR.MINOR version of PHP is added like 8.1.8 and 8.1.18; and then the
usecommand is ran with the alias version like 8.1, then the default will be set to the most recent version of that alias. In this example, it would be 8.1.18. -
Added
isolatedcommand to list all the isolated sites. -
Added
Version Aliasto the table output ofphp:list. -
Added
--isolateoption to thelinkcommand to optionally isolate the site whilst making it a symbolic link. -
Added the ability to unsecure a site when a secured linked site is unlinked before removing the site's conf to ensure it's removed from Windows internal certificate store.
-
Added the ability to unisolate a site when an isolated linked site is unlinked, to ensure it removes it properly.
-
Added
securedcommand to list all the secured sites. -
Added Valet Root CA generation and sign TLS certificates with the CA (PR by @shawkuro in cretueusebiu#179).
-
Added row separators for horizontal tables.
-
Added
sitescommand to list all sites in parked, links and proxies. -
Added
set-ngrok-tokento set ngrok authtoken and added a command alias for it:auth. -
Added
--debugoption to thesharecommand to prevent the opening of a new CMD window, and allow error messages to be displayed from ngrok for easier debugging. This is needed because ngrok may fail silently by opening a new CMD window and quickly closes it if it encounters an error, so no errors are outputted. -
Added an
--optionsoption to thesharecommand to pass any ngrok options/flags for the ngrokhttpcommand, which Valet will pass through to ngrok. Also added a shortcut-o. See the docs for information on how this works. -
Added
sudocommand and gsudo files. The new command is topassthruValet commands to the commandline that need elevated privileges by using gsudo. gsudo is asudoequivalent for Windows, it requires only 1 UAC popup to enable the elevation and then all commands will be executed as the system instead of having multiple UACs opening.Also added an error message for if
valet sudo sudois ran, because you can't sudo the sudo command. -
Added
valetBinPathhelper function to find the Valet bin path, and updated all the code to use it. -
Added a check to see if a site is isolated before unisolating it.
-
Added command example usages to display in the console when using
--help. -
Added a progressbar UI to
servicesfunction, andinstall,uninstall,restart,stopcommands to improve the UX. -
Added
erroroutput to thegetPhpByVersionfunction to cut down on duplicateerrorcode that relates to the function. -
Added a sleep for 0.3s (300000 microseconds) in between the
uninstallwarning and the question to allow the warning be output before the question is outputted. And simplified the if statements. -
Added a command alias of
unparkto theforgetcommand. -
Added a composer conflict for the old unmaintained cretueusebiu/valet-windows version, just so composer can't install this 3.0 version alongside it.
-
Added parity related additions for proxying.
- Added
--secureoption toproxycommand. - Updated the proxy stub to be the unsecure proxy stub as default.
- Changed the
proxyCreateinSiteclass to accommodate for the new--secureoption. - Added new
secure.proxy.valet.confstub for the secure proxy. - Changed
resecureForNewTldto check for the newsecure.proxystub to ensure it keeps it secured when reinstalling Valet. - Added support for proxying multiple sites at once by separating them with commas, in both
proxyandunproxycommands.
- Added
-
Changed package namespace to
yCodeTech. -
Changed capitalisation from
valettoValetin various outputs and code comments where the don't refer to the commands. -
Changed the output table to vertical for easier reading on those longer columns, with an optional argument to draw the table horizonally.
-
Renamed the
usePhpfunction toisolateinSite.phpfile to reflect it's command name. -
Updated ngrok to the latest version of 3.3.1
-
Moved Valet's version variable out and into it's own separate file for ease.
-
Changed various function return types.
-
Changed output tables
SSLcolumns toSecurefor easier understanding. -
Changed
errorhelper function to throw an exception when specified to do so, and add more meaning to the error output by constructing the error message from theExceptionclass. This is because sometimes the exception doesn't output the exact error or file names needed in order to debug. So reconstructing the error from the class methods should fix it. -
Changed the table style to
boxwhich outputs solid borders instead of using dashes. -
Changed the name of the
starts_withandends_withhelper functions tostr_starts_withandstr_ends_withrespectively to reflect the PHP 8+ functions. -
Updated various output texts.
-
Changed the way the
securecommand was getting the current working directory to use thegetSiteURLfunction instead. -
Changed various
warnings toerrors. -
Changed
domaintext and variables tositeto properly reference thesite. -
Changed text to use the proper capitalisation of
Xdebug. -
Changed the 404 template to be more visually appealing by adding the Valet 3 logo - the logo also acts as a clarification that if the 404 happens we know it's something to do with Valet and nothing else.
-
Changed Xdebug's installation behaviour to no longer install automatically, without specific flag being present. This is because Xdebug is only a PHP debugging service, so if it's not used, then it's wasting a bit of resources.
- Added an
--xdebugoption to the commandsphp:addandinstallto optionally install Xdebug while installing the PHP or installing Valet respectively. - Added an optional
phpVersionargument to the commandsxdebug:installandxdebug:uninstallto install or uninstall Xdebug for a specfic PHP version. If installing and the version is already installed, ask the user if they want to reinstall it. - Added function to check if a supplied PHP version is the alias or not, and a function to get the full PHP version by the alias. Used in
PhpCgiXdebugandPhpCgifiles. - Added a function to check if Xdebug of a specfic PHP version is installed, or if a version isn't supplied then check if any version is installed for the PHP installed in Valet. Used for many of the commands to uninstall if it is installed.
- Added the service ID to
WinSwFactoryto allowWinSWfunctions get the and use the full ID in order to fully check if it's installed. Used inPhpCgiXdebug,PhpCgi, andNginxfiles. - Changed Xdebug service name.
- Changed the powershell cli command of the
installedfunction ofWinSWfile to use the newly added service ID instead of the name. And removed the now unnecessary extra code. - Changed various warning outputs to errors.
- Removed the
getPhpCgiNamefunction fromPhpCgiXdebugclass because the function exists in the parent class and should be used instead, thus removing duplicate code. - Fixed
xdebug:install, previously, when no PHP version is passed, the command will reinstall Xdebug even if it's already installed without asking the user. Fixed so that it asks just as it does when a PHP version was passed. Changed the output text accordingly. - Removed the redundant
isInstalledServicefunction in favour of using theinstalledfunction ofWinSW, as it does exactly the same, thus removing duplicate code.
- Added an
-
Changed the path argument of
php:addto required rather than optional (removed the square brackets). -
Changed the
servicesfunction in theValet.phpfile to outputnot installedinstead ofmissingfor the Xdebug services, because it's not essential for Valet to run, so it shouldn't be labelled as missing. -
Replaced the
DIRECTORY_SEPARATORsand\\for/in all paths and usingstr_replaceto replace\\into/, so there isn't any weird paths likeC:\\sites/mysite. -
Overhauled the
diagnosecommand.-
Changed
Diagnoseclass to use theprogressbarhelper function instead of initiating Symfony'sProgressBarclass separately. -
Removed commands not applicable for Windows.
-
Added various other commands that will be necessary to debug.
-
Added a
COMPOSER_GLOBAL_PATHconstant to the helpers and agetComposerGlobalPathfunction to theValetclass to be able to get and use the global path of composer in the commands. -
Fixed the output for
composer global diagnose, where it would only output 1 line of an info and no diagnostics. Fixed by outputting it to a file first and then reading the file before removing it. -
Fixed the output for
composer global outdatedto format as a HTML table in the output for copy. Additionally, made the terminal output more human readable depending on the command option used. -
Removed the unnecessary
runCommandfunction, and used thepowershellfunction of theCommandLineclass instead. Powershell is used because it has native support for thecatfunction, which is the alias ofGet-Contentfor getting file contents. -
Fixed the ability to copy to clipboard.
-
Various changes to output for human readability or because the raw output wasn't good enough or had quirks.
-
-
Changed
logcommand to usecatalias of the Powershell'sGet-Contentcommand instead of thetailcommand which only works in Git Bash.-
Also changed the options to that of Powershell's variants
-Tailfor how many lines and-Waitfor following real time output. -
Swapped around the Valet command's options, and changed various descriptions.
-
Changed the
runCommandCommandLinefunction to allow real time output. ThesetTimeoutis set to 0 to allow it to run for what should be "forever". Though this can't be tested for obvious reasons. -
Added a boolean param to all the other commandline functions that utilise the aforementioned function, so they can pass along and use the real time output if/when needed.
-
- Removed the deprecated PHP PowerShell files.
- Removed unnecessary/redundant/duplicate code.
- Removed the
--siteoption from theusecommand that was added in cretueusebiu#195, in favour of using theisolatecommand. - Removed the deprecated
getLinksfunction in theSite.phpfile. - Removed the deprecated and unnecessary
publishParkedNginxConf,runOrDie,should_be_sudo,quietly,quietlyAsUserfunctions. - Removed the unsupported
trustcommand. - Removed the hardcoded ngrok options from the
sharecommand in favour of the new--optionsoption. - Removed the
echofrom thetrustCafunction that was in the PR code from cretueusebiu#179 - Removed various outputs to fully streamline the progressbar UI and prevent multiple progressbars in the output because of multiple infos interrupting it.
- Removed the ability to download PHP via an internal PowerShell script (
php.ps1), because keeping it updated with the current versions of PHP and deprecating it's ancestor versions is impractical. Deleted the file and all related PHP.inis. - Removed and deleted the unused and outdated tests,
.dockerignore,phpunit.xmlconfig files, and the related composer dependencies and scripts. - Removed the deprecated and unused legacy home path code, inline with the Mac version.
- Removed the obsolete
domainalias fortldcommand.
-
Fixed securing sites with an SSL/TLS certificate, both normally and when proxies are added by adding the localhost IP address to the Nginx conf listen directives. (PR by @RohanSakhale in cretueusebiu#208).
-
Fixed a bug where sometimes the link won't be unlinked under certain conditions. In accordance with official PHP guidelines of the
unlink()function, the functionrmdir()fixes this issue to remove symlink directories.If the file is a symlink, the symlink will be deleted. On Windows, to delete a symlink to a directory, rmdir() has to be used instead.
-
Fixed Nginx
lintfunction to properly check the confs for errors. -
Fixed filesystem
copyfunction to use the@operator to suppress pr-error messages that occur in PHP internally. And added an inlineerrorfunction ifcopyfails. We do this, so that we can construct proper meaningful error output for debugging. -
Partial fix for a possible bug where if a site is using a framework that sets a site URL environment variable in a
.envfile such as theWP_HOMEfor Laravel Bedrock, then when trying to request the site and the TLD is different from the one set in Valet, then the site automatically redirects to use the URL from the environment variable. This ends in Valet returning a 404 error, because as far as Valet is concerned it's not valid site. This then results in the response being cached by the browser and keeps requesting the cached version of the site even if the TLD has been changed to match.Example:
WP_HOME='http://mySite.test', Valet is set to use thedevTLD and gets a request tohttp://mySite.dev, the site will auto redirect tohttp://mySite.test. 404 Not Found error appears. The response fromhttp://mySite.testis cached by browsers. Valet is changed to usetestTLD, and gets a request forhttp://mySite.test. The previously cached error response is served.This partial fix adds
no cacheheaders to Nginx configuration files to try and prevent the browsers caching sites at all. -
Fixed
servicescommand to correctly loop through and check all PHP services. -
Fixed
fetch-share-urlcommand by:- Replacing the outdated
nategood/httpfulcomposer dependency withguzzlehttp/guzzlefor REST API requests to get the current ngrok tunnel public URL, and copy it to the clipboard. - Changing the
findHttpTunnelUrlfunction to use array bracket notation. - Changing the
domainargument tositeto properly reference the site without getting confused with the ngrok--domain. - Added a command alias:
url.
- Replacing the outdated
-
Fixed
on-latest-versioncommand to use Guzzle and added a new composer dependencycomposer/ca-bundleto find and use the TLS CA bundle in order to verify the TLS/SSL certificate of the requesting website/API. Otherwise, Guzzle spits out a cURL error. (Thanks to this StackOverflow Answer.)Also added a command alias:
latest. -
Fixed
ngrokcommand to accept options/flags, using the new--optionsoption. See the docs for information on how this works. -
Fixed
php:removecommand to enable it to remove PHP by specifying it's version; by adding aphpVersionargument and changing thepathargument to an option (--path), makingphpVersionthe main way to remove instead. -
Fixed
startcommand by removing the whole functionality and utilise Silly'srunCommandto run therestartcommand instead, so they're effectively sharing the same function. This is because it was unnecessary duplicated code. -
Fixed lack of output colouring when using PHP
passthrufunction by adding a 3rd party binary, Ansicon, along with a new class withinstall/uninstallfunctions and added the function calls to the Valetinstall/uninstallcommands respectively.For whatever reason, the
passthrufunction loses the output colourings, therefore the visual meaning is lost. What Ansicon does is injects code into the active and new terminals to ensure ANSI escape sequences (that are interpreted from the HTML-like tags<fg=red></>) are correctly rendered. -
Fixed a bug where a non-secured isolated site's server port was being replaced with the PHP port and was being served with the default server instead of the isolated server.
So instead of the usual port 80:
127.0.0.1:80in the site's isolated config file, nginx was actually listening for the site on port 9002:127.0.0.1:9002, which is the port where PHP 7.4 was configured to be hosted. This confused nginx because it couldn't find port 80 in the site's config file, so it used the default server instead, in which the default PHP version was set as 8.1 on the port 9001, and thus serving the site under the wrong PHP version.Fixed by removing the
preg_replacein thereplacePhpVersionInSiteConffunction of theSiteclass. (This doesn't affect the PHP isolation and still works as intended.) -
Fixed an oversight while changing the TLD by allowing isolated sites TLD to be changed. Previously, if there is an isolated site, changing the TLD wouldn't change the isolated site's conf file, thus leaving it as the old TLD. This fix adds a
reisolateForNewTldfunction to unisolate the old TLD site and reisolate the new TLD site. Also works for sites that are both isolated and secured. -
Fixed
unlinkcommand to properly get the site from the current working directory if nonamewas supplied, by using the previouslyprivate, nowpublicgetLinkNameByCurrentDir()function. Also changed the error message in the latter function to include the multiple linked names. -
Fixed
stopfunction of thePhpCgiclass to onlystopthe PHP CGI or PHP CGI Xdebug if it's installed.This prevents errors occurring when
uninstalling Valet. It would try tostopXdebug services for all PHP versions available to Valet, even though all Xdebug services may not be installed. -
Fixed
unsecure --alltoexitthe script if there are no sites to unsecure, otherwise nginx would still run afterwards, which is not needed. -
Fixed
uninstallcommand to only unsecure sites if they are any secured sites. Also prevented theunsecureAllfunction from exiting the script if the call came fromuninstall. Also added an option shortcut-pfor--purge-config. -
Fixed
installcommand to detect if Valet is already installed. Checks the services to see if they are running, if they are, Valet will ask a question whether to reinstall Valet or not. Also changedservicesfunction (which this fix uses) to disable the progressbar when it's called frominstall. -
Fixed the Xdebug
failed to restarterror in therestartfunction of thePhpCgiclass (of whichPhpCgiXdebugclass shares) by adding a check to see if the Xdebug service is installed, it will only restart the service if it's installed.This is because previously, if there is a version of Xdebug installed and other versions of PHP didn't have their corresponding Xdebug installed, and the
restartfunction is ran, Valet would then spit out an error in complaint of the Xdebug PHP version failing to restart, because it's not installed. -
Fixed the
defaultPHP configuration oninstall, by allowing Valet to only set the default PHP if they key doesn't exist or if it'snull.This is because previously, upon installing Valet, if the config file already exists with a default PHP set, Valet will always reset the default no matter what, even if Valet is set to use a version other than the version it finds from the
where phpCMD command, which gets it from Windows PATH (eg. default in config: 7.4.33, Valet finds: 8.1.8; Valet resets the default back to 8.1.8).- Also fixed a bug in relation to this flaw... When adding the default PHP, Valet would sometimes fail to get the PHP path because of the inconsistent capitalisation of the drive letter in the PHP path. If the path's drive letter is a lowercase, it would fail because of the strict comparison between the former and Valet's retrieval of the uppercase letter from
where php(eg. config: c:/php/8.1; Valet retrieves: C:/php/8.1).
Therefore, the comparison returns
nulland sets the default asnull. Then further installation scripts would stop because of theCannot find PHP [null] in the listerror.Valet will now convert the drive letter to a lowercase via the native
lcfirstPHP function in bothaddDefaultPhpfunction ofConfigurationclass and in thephp:addcommand. So now the default PHP should never benull. - Also fixed a bug in relation to this flaw... When adding the default PHP, Valet would sometimes fail to get the PHP path because of the inconsistent capitalisation of the drive letter in the PHP path. If the path's drive letter is a lowercase, it would fail because of the strict comparison between the former and Valet's retrieval of the uppercase letter from
-
Fixed #3 where upon a fresh installation of Valet with no config.json, it would try to read the config even if it's not yet created and spits out an "Failed to open stream: No such file" error. Fixed by adding a check to see if the file exists in the
readfunction of theConfigurationclass (fix PR by @hemant-kr-meena in #4).