Skip to content
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

Valet seems to conflict with phing #199

Closed
ngocphamm opened this issue Oct 26, 2016 · 7 comments
Closed

Valet seems to conflict with phing #199

ngocphamm opened this issue Oct 26, 2016 · 7 comments

Comments

@ngocphamm
Copy link

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 😃.

@adamwathan
Copy link
Contributor

Yeah we need to do some namespacing of some things.

@ngocphamm
Copy link
Author

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.

@ngocphamm
Copy link
Author

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?

@mrailton
Copy link

Would be great if we could get an update on this, still having the same issue

@adamwathan
Copy link
Contributor

Lots of global composer stuff conflicts, best solution is to use this instead:

https://github.com/consolidation/cgr

@mrailton
Copy link

Ah cool, thanks for that @adamwathan

@ngocphamm
Copy link
Author

That is the key @adamwathan. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants