Welcome Guest, Not a member yet? Register   Sign In
Which came first? The Config Chicken or pre_system hooks?
#1

[eluser]TheresonAntaltego[/eluser]
If you look at CodeIgniter.php, you see the bootstrap order:
# Set CI system version
# Load common, compatibility functions
# Load constants
# Load benchmarking
# Load hooks
# Call Pre-system hook
# Load Base Classes (Config, URI, Router, Output)
# ... (continued)

Ergo, hooks would seem to precede application configuration. Yet, instantiation of hooks loads the config itself, just to determine ONE thing: whether 'enable_hooks' is set). To enable configuration based on a pre_system hook, one of the following solutions is needed:

A) enable/disable hooks in the entry point (index.php) along with the only other two things configurable there (application and system folder locations)
B) Have hook instantiation temporarily load/parse ONLY the config file (instead of instantiating Config class) with the sole purpose of retrieving that value
C) Consider Hooks ALWAYS on, and to process them if they exist. How often would you have hooks without using them? Perhaps in development only
D) add an "enabled" parameter to each hook configuration.




Theme © iAndrew 2016 - Forum software by © MyBB