Open supriyo-biswas opened 5 years ago
Also:
There are more scattered everywhere, too lazy to search.
I too think they should be removed/replaced with something "namespacy" to avoid global name clashes when integrating with legacy / 3rd party systems you can't control.
A first step was that all Arr
and Str
helpers have been removed.
I'd like to use illuminate/database in a non-Laravel project, which has a dependency on illuminate/support. It declares some global functions that are in conflict with my project's functions such as
env()
,with()
,e()
andarray_*()
.My project's functions are also dissimilar to what is there in illuminate/support, so the
if (function_exists('foo'))
boilerplate does not help since they would prevent illuminate/* from working correctly.I'd like to request for a way to opt-out of these support helpers. Doing so would probably involve:
Have a file that declares these support helpers in a namespaced manner, e.g.
Support::with()
. I'm aware that namespaced versions already exist for some things such asenv()
.Move over illuminate/{container,contracts,database,support} to use these namespaced functions.
Have these helpers such as
env()
defined inside of the Laravel framework, or at the very least have a constant to opt-out of including the helper, such as:and the following in the
helpers.php
file: