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

Move the helper functions into the Valet namespace #602

Merged
merged 1 commit into from
Aug 15, 2018

Conversation

colindecarlo
Copy link
Contributor

Valet doesn't play well with others.

In its helpers.php file it registers a number of global functions without considering the landscape of the current environment. This leads to fatal errors being raised when Valet redeclares methods that already exist.

To remedy this issue, I've placed the helpers used by Valet in the Valet namespace.

@mattstauffer
Copy link
Collaborator

@colindecarlo Hey, could you show how to reproduce the non-merged helpers in a way that causes problems?

@adamwathan
Copy link
Contributor

Problem is all globally installed composer packages share an autoloader, so its very easy to end up with some unrelated package defining the same global function as Valet and breaking Valet for no reason. Have had lots of issues opened around it and until now have recommended using cgr instead of composer but intention has always been to namespace these functions to stop those issues 👍🏻

@mattstauffer
Copy link
Collaborator

Ahhhh other globally required things. Great--thanks both! I'll pull it down to test (but looks great) and then merge.

@mattstauffer mattstauffer merged commit 9b4b1e1 into laravel:master Aug 15, 2018
cretueusebiu added a commit to cretueusebiu/valet-windows that referenced this pull request Sep 24, 2018
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

Successfully merging this pull request may close these issues.

3 participants