Valet: Valet seems to conflict with phing

Created on 26 Oct 2016  路  7Comments  路  Source: laravel/valet

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 馃槂.

Most helpful comment

Yeah we need to do some namespacing of some things.

All 7 comments

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:

https://github.com/consolidation/cgr

Ah cool, thanks for that @adamwathan

That is the key @adamwathan. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EHLOVader picture EHLOVader  路  4Comments

idmahbub picture idmahbub  路  3Comments

sadhakbj picture sadhakbj  路  3Comments

Alshie picture Alshie  路  4Comments

webartistse picture webartistse  路  4Comments