Sometimes I find myself wondering how to un-park a folder, and it takes me awhile to find `forget` in the list.
Adding `unpark` as an alias may be helpful.
Updated the `proxies` method to return the URL + .tld
as the rendered output wasn't exactly what one would
expect. While not critical, it was not consistent.
Refactored some of the Site class to aid in testing using
a fake instead of relying on a ton of mocking.
The Site fake has support for both using `tests/output`
as well as named fixtures (`tests/fixtures/Proxies`).
Testing for certificate I/O is pretty whack, but this is
the best I could come up with that would still ensure
the certificate stuff was getting called without
actually requiring `sudo` to run phpunit.
Replaced instances referring directly to `VALET_HOME_PATH`
with calls to the new `valetHomePath()`. This method
is taken over in the fake Site implementation so
that everything runs the same using the fake
Site without having to change other
assumptions.
Updated several "path" methods (and many of their usages)
to take the "thing" you are looking for so you can
either get the path to the type of "thing" you
are looking for or the direct path to the
specific "thing" you are looking for.
Examples:
```
// ~/.config/valet/Nginx
$site->nginxPath();
// ~/.config/valet/Nginx/some-site.com.test
$site->nginxPath('some-site.com.test');
```
Made some other tests related to the existence of `Sites`
directory that resulted in updating the mocks for
many of the other tests.
All in all, it should make other aspects of the Site class
handle things more gracefully if `Sites` doesn't exist.
PHP's default is 128M, but it's becoming common practice to set the value to 512M in dev and production
Plus, currently homestead sets it to 512M as well.
Fixes#756
Previously if `php` was installed as just `php` (the default Homebrew alias), Valet would not detect *which* PHP version was actually installed, and therefore `valet use` might do incorrect or unnecessary installations/links/etc.
NOTE: This does NOT "convert" existing `php` alias to a numbered version. It merely accepts it as-is, but notes its version in an attempt to avoid extra installations.
*NOTE: Specifally tested with PHP 7.4 and 7.3. No promises about old 5.6, etc aliases.*
PHP configs no longer support `#` for comments. Must use semicolons `;`.
Otherwise PHP may not start, and may show a confusing error in logs: `value is NULL for a ZEND_INI_PARSER_ENTRY`
While `valet trust` enables (creates) sudoers entries, there was no cleanup/removal option for this, apart from complete forced uninstall of Valet.
This adds `valet trust --off` so that the sudoers entries can be removed from Valet CLI.
After running `valet directory-listing on` if a URI points to a directory that exists, but the requested file cannot be found in that directory, a directory listing will be displayed.
A 404 will still happen if the project directory cannot be found.
Running `valet directory-listing off` makes a 404 display (without a listing) if the requested file cannot be found.
Supercedes and closes#349 and closes#587
This leverages the existing `.valet-env.php` file capability, but just adds the Valet Home directory as a first-lookup location.
So, now Valet will check for `.valet-env.php` in:
- `~/.config/valet/`
- then the current project folder
As discussed at https://github.com/laravel/valet/issues/789#issuecomment-565112046Fixes#789