Skip to content

Commit 9be2a56

Browse files
committed
docs: added some TODO code comments and added new section to explain the valet config files and directories.
Also added some `~` to the beginning of the .config paths and removed a duplicated `install` description.
1 parent 08d3951 commit 9be2a56

File tree

3 files changed

+61
-8
lines changed

3 files changed

+61
-8
lines changed

README.md

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ composer global require ycodetech/valet-windows
2222
2323
<br>
2424

25-
[Introduction](#introduction) | [Installation](#installation) | [Commands](#commands) | [Command Parity Checker](#command-parity-checker) | [Deprecations and Removals](#deprecations-and-removals) | [Emergency Stop and Uninstall Services](#emergency-stop-and-uninstall-services) | [Known Issues](#known-issues) | [Xdebug Installation](#xdebug-installation) | [Contributions](#contributions)
25+
[Introduction](#introduction) | [Installation](#installation) | [Commands](#commands) | [Command Parity Checker](#command-parity-checker) | [Deprecations and Removals](#deprecations-and-removals) | [Emergency Stop and Uninstall Services](#emergency-stop-and-uninstall-services) | [Valet Directories](#valet-directories) | [Known Issues](#known-issues) | [Xdebug Installation](#xdebug-installation) | [Contributions](#contributions)
2626

2727
---
2828

@@ -193,8 +193,7 @@ For commands that are referenced as "the same as the Mac version", please refer
193193
##### install
194194

195195
```
196-
install Install Valet's services and configs
197-
Install Valet's services and configs, and auto start Valet.
196+
install Install Valet's services and configs, and auto start Valet.
198197
[--xdebug] Optionally, install Xdebug for PHP.
199198
```
200199

@@ -212,7 +211,7 @@ This installs all Valet services:
212211
- Acrylic DNS
213212
- Ansicon
214213

215-
And it's configs in `C:\Users\Username\.config\valet`.
214+
And it's configs in `C:/Users/Username/.config/valet`.
216215

217216
Once complete, Valet will automatically start the services.
218217

@@ -790,7 +789,7 @@ link Register the current working directory as a symbolic link
790789
[--isolate=] Optionally isolate the site to a specified PHP version
791790
```
792791

793-
`link` is another way to serve directories as sites, except it serves one singular site in a directory rather than the whole directory. It does this by creating a symbolic link inside the `/.config/valet/Sites` directory, of which is a _`parked`_ directory on Valet installation.
792+
`link` is another way to serve directories as sites, except it serves one singular site in a directory rather than the whole directory. It does this by creating a symbolic link inside the `~/.config/valet/Sites` directory, of which is a _`parked`_ directory on Valet installation.
794793

795794
Serving the current working directory as a site:
796795

@@ -858,7 +857,7 @@ unlink Unlink the current working directory linked site
858857
[name] Optionally specify the linked site name
859858
```
860859

861-
`unlink` removes the current working directory's (cwd) symbolic linked site. Valet will find the linked site name using the cwd name and delete the symbolic link from the `/.config/valet/Sites/` directory.
860+
`unlink` removes the current working directory's (cwd) symbolic linked site. Valet will find the linked site name using the cwd name and delete the symbolic link from the `~/.config/valet/Sites/` directory.
862861

863862
```console
864863
$ cd /d/sites/my site
@@ -1170,7 +1169,7 @@ This site is served by [BasicValetDriver].
11701169
paths List all of the paths registered with Valet
11711170
```
11721171

1173-
`paths` allows you to view all registered paths. The default path is `.config/valet/Sites`, any others are added via the [`park`](#park) command.
1172+
`paths` allows you to view all registered paths. The default path is `~/.config/valet/Sites`, any others are added via the [`park`](#park) command.
11741173

11751174
```console
11761175
$ valet paths
@@ -1484,6 +1483,56 @@ To run, open a CMD terminal with Admin privileges and run this:
14841483

14851484
All services will have been stopped and you can then be able to run `composer global update`.
14861485

1486+
## Valet Directories
1487+
1488+
Upon installation, Valet creates the following directories and config files:
1489+
1490+
- `~/.config/valet`
1491+
Contains all of Valet's config files. This resides in the home directory (`C:/Users/Username/`) indicated by `~`.
1492+
1493+
- `~/.config/valet/CA`
1494+
Contains Valet's generated self-signed Root CA certificate, of which all site TLS certificates are signed with.
1495+
1496+
- `~/.config/valet/Certificates`
1497+
Contains all the TLS certificates for the secured sites. These files are rebuilt when running the `install` and `secure` commands.
1498+
1499+
- `~/.config/valet/Drivers`
1500+
Contains any user-defined custom Valet drivers. Drivers determine how a particular framework / CMS is served. See the [Valet Docs](https://laravel.com/docs/12.x/valet#custom-valet-drivers) for information on how to create a custom driver.
1501+
1502+
- `~/.config/valet/Drivers/SampleValetDriver.php`
1503+
A sample custom driver.
1504+
1505+
- `~/.config/valet/Extensions`
1506+
Contains custom Valet extensions/commands. You can extend Valet and add your own commands or change existing ones. See [this comment](https://github.com/laravel/valet/issues/804#issuecomment-569731561) for more info and links to examples.
1507+
1508+
- `~/.config/valet/Log`
1509+
Contains all error logs.
1510+
1511+
- `~/.config/valet/Nginx`
1512+
Contains site-specific Nginx configs for any site that is isolated or secured. These files are rebuilt when running the `install`, `tld`, and `secure` commands.
1513+
1514+
- `~/.config/valet/Services`
1515+
Contains the Nginx and PHP config and executable files to be able to run them as Windows services. These files are rebuilt when running the `install` command.
1516+
- `~/.config/valet/Sites`
1517+
Contains all of the symbolic links for any `link`ed sites.
1518+
1519+
- `~/.config/valet/Xdebug`
1520+
Contains the output files of Xdebug profiling.
1521+
1522+
- `~/.config/valet/config.json`
1523+
This is the main Valet config file.
1524+
1525+
- `~/.config/valet/emergency_uninstall_services.bat`
1526+
This is an batch file to do an emergency stop and uninstall of all services. See the [Emergency Stop and Uninstall Services section](#emergency-stop-and-uninstall-services).
1527+
1528+
> [!WARNING]
1529+
>
1530+
> It's not recommended to change the config files except the custom `Drivers` and `Extensions`. Changing any other config file manually will put Valet out of sync and cause errors. Use the CLI instead and let Valet do it for you.
1531+
1532+
> [!CAUTION]
1533+
>
1534+
> You must not remove any config file (except the custom ones) without first uninstalling Valet.
1535+
14871536
## Known Issues
14881537

14891538
- WSL2 distros fail because of Acrylic DNS Proxy ([microsoft/wsl#4929](https://github.com/microsoft/WSL/issues/4929)). Use `valet stop`, start WSL2 then `valet start`.

cli/drivers/ValetDriver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
// TODO: Update all Drivers to make sure they're on par with macOS.
4+
35
abstract class ValetDriver {
46
/**
57
* Determine if the driver serves the request.
@@ -204,4 +206,4 @@ public function loadServerEnvironmentVariables($sitePath, $siteName) {
204206
putenv($key . '=' . $value);
205207
}
206208
}
207-
}
209+
}

cli/valet.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
Site::pruneLinks();
4242
}
4343

44+
// TODO: Abstract all Xdebug related code into a separate opt-in custom extension, this could be an alternative to just deprecating Xdebug functionality altogether.
45+
4446
/**
4547
* Install Valet's services and configs,
4648
* and auto start Valet.

0 commit comments

Comments
 (0)