diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..090a1f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +.DS_Store diff --git a/FrameWordpressValetDriver.php b/FrameWordpressValetDriver.php index 4fecb2f..bdbf633 100644 --- a/FrameWordpressValetDriver.php +++ b/FrameWordpressValetDriver.php @@ -1,6 +1,10 @@ debug ){ @@ -176,7 +180,7 @@ private function forceTrailingSlash($uri) } - public function isStaticFile($sitePath, $siteName, $uri) + public function isStaticFile(string $sitePath, string $siteName, string $uri)/*: string|false */ { $sitePath = $sitePath . $this->public_dir; // If the URI contains one of the main WordPress directories and it doesn't end with a slash, diff --git a/README.md b/README.md index 176d7d6..1eea01d 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,38 @@ A custom upgraded Valet driver that handles the unique structure of Frame's proj This driver allows you to run `valet link` in the project root folder, rather than having to link from the `site` or `dist` folder - this makes valet work better overall, and commands such as `valet isolate`, `valet php` and `valet composer` will work with less complications whe the Valet site root is set as the root folder of the project. -To enable, copy or symlink into the `~/.config/valet/Drivers/` folder. \ No newline at end of file +## Installation ## + +Clone this repo to your local machine - this will allow for easy updates to be published in the future; + +```shell +git clone https://github.com/framecreative/frame-valet-drivers.git +``` + +Run the installation script on the cli, this will remove any old version of this specific driver, and create a symlink from valet's config to the driver in this repo. + +```shell +php install.php +``` + +## Updates ## + +By utilising the symlink method above, updating is as simple as pulling changes from github. + +```shell +git pull origin master +``` + +## Changelog ## + +### Version 1.0.0 ### +- Initial release +- Move to github vs sharing the file in team slack +- Compatible with Valet 2.x, works with Valet 3.x with minor issues + +### Version 2.0.0 ### +- Updates to support valet 4.x releases +- Added installation script for easier setup +- Requires PHP 7+ (standard) +- Supports 3.x and 4.x versions of Valet - Valet 1.x and 2.x support is deprecated + diff --git a/install.php b/install.php new file mode 100644 index 0000000..36ec576 --- /dev/null +++ b/install.php @@ -0,0 +1,27 @@ +#!/usr/local/bin/php + ' . $valetDriverFullPath . PHP_EOL; + +echo PHP_EOL . 'Install completed. To update the driver just run "git pull origin master" in this repo';