-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specific Valet Drivers not found when adding LocalValetDriver #1405
Comments
Huh. I tested this functionality when I was writing it... but now I'm seeing the same error. Thanks for the issue! Let me see what I can do. |
Nevermind lol.. I was on an old version of Valet I was testing. I can no longer reproduce this. Can you paste the contents of your |
Sure thing, here is my LocalValetDriver.php that I've been using to display images from a different URL if they don't exists on my local.
|
@mattstauffer has the LocalValetDriver.php been any help at replicating the issue? |
@amuscalu this may have some side-effects with other sites you serve, but even reporting on those will be helpful in coming up with a complete fix...
public static function assign(string $sitePath, string $siteName, string $uri): ?ValetDriver
{
$drivers = [];
+ // Must scan these so they're extendable by customSiteDrivers loaded next
+ $specificDrivers = static::specificDrivers();
+
// Queue custom driver based on path
if ($customSiteDriver = static::customSiteDriver($sitePath)) {
$drivers[] = $customSiteDriver;
}
// Queue custom drivers for this environment
$drivers = array_merge($drivers, static::customDrivers());
// Queue Valet-shipped drivers
$drivers[] = 'LaravelValetDriver';
- $drivers = array_merge($drivers, static::SpecificDrivers());
+ $drivers = array_merge($drivers, $specificDrivers);
$drivers[] = 'BasicWithPublicValetDriver';
$drivers[] = 'BasicValetDriver'; |
above solution is working |
I'd accept a PR for the above from anyone who has time, or I'll get to it as soon as I can get a free moment; likely next week |
@mattstauffer I'm not certain whether there are any side-effects due to order-of-loading. At this stage I think you grok the inner workings of this part way better than I do yet ;) |
Could the documentation be updated to mention the Valet\Drivers\Specific namespace? I just updated Valet for the first time in a while and my WordPress custom drivers died because of the namespace change. |
Something like this? : https://github.com/laravel/valet/blob/master/UPGRADE.md |
Something like that! I swear I was using 4 before, because I had to change from just extending Thinking more, my suggestion is that |
Description
Getting Fatal error when adding LocalValetDriver.php file to the root of my wordpress site.
Fatal error: Uncaught Error: Class "Valet\Drivers\Specific\WordPressValetDriver" not found in /Users/amuscalu/Sites/icd/LocalValetDriver.php:11 Stack trace: #0 /Users/amuscalu/.composer/vendor/laravel/valet/cli/Valet/Drivers/ValetDriver.php(75): require_once() #1 /Users/amuscalu/.composer/vendor/laravel/valet/cli/Valet/Drivers/ValetDriver.php(37): Valet\Drivers\ValetDriver::customSiteDriver('/Users/amuscalu...') #2 /Users/amuscalu/.composer/vendor/laravel/valet/server.php(54): Valet\Drivers\ValetDriver::assign('/Users/amuscalu...', 'icd', '/') #3 {main} thrown in /Users/amuscalu/Sites/icd/LocalValetDriver.php on line 11
Related to valet version 4.0.1 & PR #1388
Steps To Reproduce
Diagnosis
sw_vers
valet --version
cat ~/.config/valet/config.json
cat ~/.composer/composer.json
composer global diagnose
composer global outdated
ls -al /etc/sudoers.d/
brew config
brew services list
brew list --formula --versions | grep -E "(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s"
brew outdated
brew tap
php -v
which -a php
php --ini
nginx -v
curl --version
php --ri curl
/opt/homebrew/bin/ngrok version
ls -al ~/.ngrok2
brew info nginx
brew info php
brew info openssl
openssl version -a
openssl ciphers
sudo nginx -t
which -a php-fpm
/opt/homebrew/opt/php/sbin/php-fpm -v
sudo /opt/homebrew/opt/php/sbin/php-fpm -y /opt/homebrew/etc/php/8.2/php-fpm.conf --test
ls -al ~/Library/LaunchAgents | grep homebrew
ls -al /Library/LaunchAgents | grep homebrew
ls -al /Library/LaunchDaemons | grep homebrew
ls -al /Library/LaunchDaemons | grep "com.laravel.valet."
ls -aln /etc/resolv.conf
cat /etc/resolv.conf
ifconfig lo0
sh -c 'echo "------\n/opt/homebrew/etc/nginx/valet/valet.conf\n---\n"; cat /opt/homebrew/etc/nginx/valet/valet.conf | grep -n "# valet loopback"; echo "\n------\n"'
sh -c 'for file in ~/.config/valet/dnsmasq.d/*; do echo "------\n~/.config/valet/dnsmasq.d/$(basename $file)\n---\n"; cat $file; echo "\n------\n"; done'
sh -c 'for file in ~/.config/valet/nginx/*; do echo "------\n~/.config/valet/nginx/$(basename $file)\n---\n"; cat $file | grep -n "# valet loopback"; echo "\n------\n"; done'
The text was updated successfully, but these errors were encountered: