load_function()) function is used to retrieve the name of an overloadable SPIP function. Whenever an internal function with a
_dist() suffix is overloaded (by recreating it without that suffix), or whenever all of a file that contains such a function is overloaded, then the correct function to be run must be retrievable at the time that that function is to be executed.
This is what the
charger_fonction() does. It returns the correct name of the function to be executed.
- $ma_fonction = charger_fonction('my_function','directory');
The searching principle
The function operates as follows:
- if the
directory_my_functionfunction has already been declared, then that function is returned,
- else try to load a file called
directory/my_functionif it exists,
- else return