fuel/core — Issue #698: Override Global Function Aliases used in the Core?
Author: lukearmstrong
Created: 2011-11-29 11:20:51+00:00
State: open

Fuel defines several functions in the global namespace to serve as aliases to methods in Core Classes.

For example ```__()``` returns ```\Lang::get()```

But I wanted to define my own ```__()``` function, though I can't do that safely unless I grep the core and replace all usages of the ```__()``` alias with ```\Lang::get()```. For obvious reasons I don't want to modify any files in the core, so I won't be doing that.

To me, an alias is something that should be defined for developers to use, not for the core to use - as that will avoid the problem I am having now. So either I pick another function name to use, or I figure out a way of getting the ```Lang``` class to use ```gettext()```.

Also, ```/fuel/core/base.php``` checks if the function exists. Is it possible to define my function before this is run?