-
Notifications
You must be signed in to change notification settings - Fork 0
Plugins: Life Cycle
Plugins are able to hook into some of the core application life cycle features
using the config/configure.cfc
component.
The hooks are executed in the order of the application's plugins
setting.
When a request is made to reinitialize the application the plugins are consulted with the available information to determine if the given request has the right to reinitialize the application.
If any of the plugins returns false
the application will not be reinitialized.
Occurs when the CFML engine naturally shuts down and just before the application is reinitialized.
Occurs when the CFML engine starts serving requests for the application and when the application is reinitialized.
Occurs at the end of a request.
Occurs at the start of a request.
Occurs at the end of a session.
Occurs at the start of a session.
When the application is being initialized or reinitialized it reads in the
settings and information for each of the plugins. The update
function is used
to update the state of the environment to match what the plugin is expecting to
run.
For example, when using a database any database commands that would setup or alter the environment should be run here as needed.
As another example, creating a directory to contain non-webroot based files or images used in the plugin.