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.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.1
instead 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
pathFilter
function to replace the directory name with it's Windows shortname equivalent. e.g. fromJohn Doe
toJOHNDO~1
. For use with thevaletBinPath
function 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_PATH
to 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->run
tocli->powershell
to ensure that the copy commandclip
is 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
-c
option 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
pathFilter
function 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
diagnose
commands array into the__construct
function so that we can use the globalvaletBinPath
function and allow the paths to also be changed to the short username if needed. -
Changed various
diagnose
array commands to use thevaletBinPath
function and the command that has theCOMPOSER_GLOBAL_PATH
to use thefilterPath
function.
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
diagnose
command 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 havingdiagnose
command 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 list
command, 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
parity
command 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_reporting
setting wasn't ignoring deprecation notices, and all reports are enabled, ie.E_ALL
. This notice would then be displayed in the terminal on everyvalet
command. Though it doesn't impact valet's functionality, it could potentially be broken in future PHP versions.Fixed by:
-
Adding a default
null
value to the$debug
parameter for the optional--debug
option of theshare
command. -
Removing the default
null
value from the$key
parameter of the optionalkey
argument of thelog
command. 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
install
confirmation 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 use
command, 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
links
command output (Patch 1 PR by @damsfx in iamroi#1). -
Added PHP version to the
parked
command output, improvements to the Patch 1 above and a new commandphp:which
(Patch 2 by @yCodeTech in #1)-
Adds
default
orisolated
to the PHP version output, with the latter being coloured green for emphasis in bothparked
andlinks
commands. This acts as a 2 in 1, showing the PHP version, and determines whether the site is isolated. -
Adds
Alias
andAlias URL
to theparked
command 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:which
command 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
setVertical
method (only works when Valet is installed on PHP 8.1).
-
-
Added new
isolate
andunisolate
commands. 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_alias
to theaddPhp
function in theConfiguration.php
file, 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
krsort
function to theaddPhp
function in theConfiguration.php
file, so that the PHP array in the user's Valetconfig.json
is written in a natural decending order that adheres to decimals.Natural decending order example:
8.1.18 8.1.8 7.4.33
This 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
use
command 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
isolated
command to list all the isolated sites. -
Added
Version Alias
to the table output ofphp:list
. -
Added
--isolate
option to thelink
command 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
secured
command 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
sites
command to list all sites in parked, links and proxies. -
Added
set-ngrok-token
to set ngrok authtoken and added a command alias for it:auth
. -
Added
--debug
option to theshare
command 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
--options
option to theshare
command to pass any ngrok options/flags for the ngrokhttp
command, which Valet will pass through to ngrok. Also added a shortcut-o
. See the docs for information on how this works. -
Added
sudo
command and gsudo files. The new command is topassthru
Valet commands to the commandline that need elevated privileges by using gsudo. gsudo is asudo
equivalent 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 sudo
is ran, because you can't sudo the sudo command. -
Added
valetBinPath
helper 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
services
function, andinstall
,uninstall
,restart
,stop
commands to improve the UX. -
Added
error
output to thegetPhpByVersion
function to cut down on duplicateerror
code that relates to the function. -
Added a sleep for 0.3s (300000 microseconds) in between the
uninstall
warning and the question to allow the warning be output before the question is outputted. And simplified the if statements. -
Added a command alias of
unpark
to theforget
command. -
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
--secure
option toproxy
command. - Updated the proxy stub to be the unsecure proxy stub as default.
- Changed the
proxyCreate
inSite
class to accommodate for the new--secure
option. - Added new
secure.proxy.valet.conf
stub for the secure proxy. - Changed
resecureForNewTld
to check for the newsecure.proxy
stub to ensure it keeps it secured when reinstalling Valet. - Added support for proxying multiple sites at once by separating them with commas, in both
proxy
andunproxy
commands.
- Added
-
Changed package namespace to
yCodeTech
. -
Changed capitalisation from
valet
toValet
in 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
usePhp
function toisolate
inSite.php
file 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
SSL
columns toSecure
for easier understanding. -
Changed
error
helper function to throw an exception when specified to do so, and add more meaning to the error output by constructing the error message from theException
class. 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
box
which outputs solid borders instead of using dashes. -
Changed the name of the
starts_with
andends_with
helper functions tostr_starts_with
andstr_ends_with
respectively to reflect the PHP 8+ functions. -
Updated various output texts.
-
Changed the way the
secure
command was getting the current working directory to use thegetSiteURL
function instead. -
Changed various
warning
s toerror
s. -
Changed
domain
text and variables tosite
to 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
--xdebug
option to the commandsphp:add
andinstall
to optionally install Xdebug while installing the PHP or installing Valet respectively. - Added an optional
phpVersion
argument to the commandsxdebug:install
andxdebug:uninstall
to 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
PhpCgiXdebug
andPhpCgi
files. - 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
WinSwFactory
to allowWinSW
functions get the and use the full ID in order to fully check if it's installed. Used inPhpCgiXdebug
,PhpCgi
, andNginx
files. - Changed Xdebug service name.
- Changed the powershell cli command of the
installed
function ofWinSW
file 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
getPhpCgiName
function fromPhpCgiXdebug
class 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
isInstalledService
function in favour of using theinstalled
function ofWinSW
, as it does exactly the same, thus removing duplicate code.
- Added an
-
Changed the path argument of
php:add
to required rather than optional (removed the square brackets). -
Changed the
services
function in theValet.php
file to outputnot installed
instead ofmissing
for the Xdebug services, because it's not essential for Valet to run, so it shouldn't be labelled as missing. -
Replaced the
DIRECTORY_SEPARATORs
and\\
for/
in all paths and usingstr_replace
to replace\\
into/
, so there isn't any weird paths likeC:\\sites/mysite
. -
Overhauled the
diagnose
command.-
Changed
Diagnose
class to use theprogressbar
helper function instead of initiating Symfony'sProgressBar
class separately. -
Removed commands not applicable for Windows.
-
Added various other commands that will be necessary to debug.
-
Added a
COMPOSER_GLOBAL_PATH
constant to the helpers and agetComposerGlobalPath
function to theValet
class 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 outdated
to 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
runCommand
function, and used thepowershell
function of theCommandLine
class instead. Powershell is used because it has native support for thecat
function, which is the alias ofGet-Content
for 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
log
command to usecat
alias of the Powershell'sGet-Content
command instead of thetail
command which only works in Git Bash.-
Also changed the options to that of Powershell's variants
-Tail
for how many lines and-Wait
for following real time output. -
Swapped around the Valet command's options, and changed various descriptions.
-
Changed the
runCommand
CommandLine
function to allow real time output. ThesetTimeout
is 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
--site
option from theuse
command that was added in cretueusebiu#195, in favour of using theisolate
command. - Removed the deprecated
getLinks
function in theSite.php
file. - Removed the deprecated and unnecessary
publishParkedNginxConf
,runOrDie
,should_be_sudo
,quietly
,quietlyAsUser
functions. - Removed the unsupported
trust
command. - Removed the hardcoded ngrok options from the
share
command in favour of the new--options
option. - Removed the
echo
from thetrustCa
function 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.ini
s. - Removed and deleted the unused and outdated tests,
.dockerignore
,phpunit.xml
config 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
domain
alias fortld
command.
-
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
lint
function to properly check the confs for errors. -
Fixed filesystem
copy
function to use the@
operator to suppress pr-error messages that occur in PHP internally. And added an inlineerror
function ifcopy
fails. 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
.env
file such as theWP_HOME
for 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 thedev
TLD and gets a request tohttp://mySite.dev
, the site will auto redirect tohttp://mySite.test
. 404 Not Found error appears. The response fromhttp://mySite.test
is cached by browsers. Valet is changed to usetest
TLD, and gets a request forhttp://mySite.test
. The previously cached error response is served.This partial fix adds
no cache
headers to Nginx configuration files to try and prevent the browsers caching sites at all. -
Fixed
services
command to correctly loop through and check all PHP services. -
Fixed
fetch-share-url
command by:- Replacing the outdated
nategood/httpful
composer dependency withguzzlehttp/guzzle
for REST API requests to get the current ngrok tunnel public URL, and copy it to the clipboard. - Changing the
findHttpTunnelUrl
function to use array bracket notation. - Changing the
domain
argument tosite
to properly reference the site without getting confused with the ngrok--domain
. - Added a command alias:
url
.
- Replacing the outdated
-
Fixed
on-latest-version
command to use Guzzle and added a new composer dependencycomposer/ca-bundle
to 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
ngrok
command to accept options/flags, using the new--options
option. See the docs for information on how this works. -
Fixed
php:remove
command to enable it to remove PHP by specifying it's version; by adding aphpVersion
argument and changing thepath
argument to an option (--path
), makingphpVersion
the main way to remove instead. -
Fixed
start
command by removing the whole functionality and utilise Silly'srunCommand
to run therestart
command 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
passthru
function by adding a 3rd party binary, Ansicon, along with a new class withinstall
/uninstall
functions and added the function calls to the Valetinstall
/uninstall
commands respectively.For whatever reason, the
passthru
function 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:80
in 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_replace
in thereplacePhpVersionInSiteConf
function of theSite
class. (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
reisolateForNewTld
function to unisolate the old TLD site and reisolate the new TLD site. Also works for sites that are both isolated and secured. -
Fixed
unlink
command to properly get the site from the current working directory if noname
was supplied, by using the previouslyprivate
, nowpublic
getLinkNameByCurrentDir()
function. Also changed the error message in the latter function to include the multiple linked names. -
Fixed
stop
function of thePhpCgi
class to onlystop
the PHP CGI or PHP CGI Xdebug if it's installed.This prevents errors occurring when
uninstall
ing Valet. It would try tostop
Xdebug services for all PHP versions available to Valet, even though all Xdebug services may not be installed. -
Fixed
unsecure --all
toexit
the script if there are no sites to unsecure, otherwise nginx would still run afterwards, which is not needed. -
Fixed
uninstall
command to only unsecure sites if they are any secured sites. Also prevented theunsecureAll
function from exiting the script if the call came fromuninstall
. Also added an option shortcut-p
for--purge-config
. -
Fixed
install
command 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 changedservices
function (which this fix uses) to disable the progressbar when it's called frominstall
. -
Fixed the Xdebug
failed to restart
error in therestart
function of thePhpCgi
class (of whichPhpCgiXdebug
class 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
restart
function 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
default
PHP 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 php
CMD 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
null
and sets the default asnull
. Then further installation scripts would stop because of theCannot find PHP [null] in the list
error.Valet will now convert the drive letter to a lowercase via the native
lcfirst
PHP function in bothaddDefaultPhp
function ofConfiguration
class and in thephp:add
command. 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
read
function of theConfiguration
class (fix PR by @hemant-kr-meena in #4).