I don't really know why, but I had phing/phing installed as a global composer package, and as soon as I add laravel/valet, I get this.
PHP Fatal error: Cannot declare class FileSystem, because the name is already in use in /Users/ngocpham/.composer/vendor/phing/phing/classes/phing/system/io/FileSystem.php on line 38
PHP Stack trace:
PHP 1. {main}() /Users/ngocpham/.composer/vendor/phing/phing/bin/phing:0
PHP 2. require_once() /Users/ngocpham/.composer/vendor/phing/phing/bin/phing:14
PHP 3. require_once() /Users/ngocpham/.composer/vendor/phing/phing/bin/phing.php:27
PHP 4. require_once() /Users/ngocpham/.composer/vendor/phing/phing/classes/phing/Phing.php:20
PHP 5. include_once() /Users/ngocpham/.composer/vendor/phing/phing/classes/phing/Diagnostics.php:22
PHP 6. include_once() /Users/ngocpham/.composer/vendor/phing/phing/classes/phing/Project.php:20
PHP 7. include_once() /Users/ngocpham/.composer/vendor/phing/phing/classes/phing/system/io/PhingFile.php:20
I'm not sure what happens at this point, so I will just create this issue here. I will try to go back to it to see if I can find a possible fix or not 馃槂.
Yeah we need to do some namespacing of some things.
I found that the Filesystem facade is not used anywhere else except for the valet server-log command. To my test, doing
$fileSystem = new \Valet\Filesystem();
$files = $fileSystem->scandir(VALET_HOME_PATH.'/Log');
instead of
$files = Filesystem::scandir(VALET_HOME_PATH.'/Log');
with class Filesystem extends Facade {} being removed from includes/facades.php helps solve this issue.
However, I'm a noob with all those namespace, facade things, so I'm not sure if that would be the right thing to do here or not. Please advise.
I think we should revisit this a bit. So the classes are namespaced now, and it is the facades that cause the issue. Should all the facades be prefixed with Valet. for example ValetFileSystem?
Would be great if we could get an update on this, still having the same issue
Lots of global composer stuff conflicts, best solution is to use this instead:
Ah cool, thanks for that @adamwathan
That is the key @adamwathan. Thanks!
Most helpful comment
Yeah we need to do some namespacing of some things.