Skip to content

Commit

Permalink
docs(events): prefered use of the shutdown event vs shutdown function
Browse files Browse the repository at this point in the history
fixes #7619
  • Loading branch information
jeabakker committed Sep 23, 2016
1 parent fbf52cb commit c62b307
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/guides/events-list.rst
Expand Up @@ -32,6 +32,9 @@ System events
might not be shown until after the process is completed. This means that any long-running might not be shown until after the process is completed. This means that any long-running
processes will still delay the page load. processes will still delay the page load.


.. note:: This event is prefered above using ``register_shutdown_function`` as you may not have access
to all the Elgg services (eg. database) in the shutdown function but you will in the event.

**regenerate_site_secret:before, system** **regenerate_site_secret:before, system**
Return false to cancel regenerating the site secret. You should also provide a message Return false to cancel regenerating the site secret. You should also provide a message
to the user. to the user.
Expand Down
3 changes: 2 additions & 1 deletion docs/guides/guidelines.rst
Expand Up @@ -120,4 +120,5 @@ These points are good ideas, but are not yet in the official guidelines. Followi
- Do not use the ``bundled`` category with your plugins. That is for plugins distributed with Elgg - Do not use the ``bundled`` category with your plugins. That is for plugins distributed with Elgg
- Update functions deprecated in 1.8. - Update functions deprecated in 1.8.
- Many registration functions simply added an ``elgg_`` prefix for consistency - Many registration functions simply added an ``elgg_`` prefix for consistency
- See ``/engine/lib/deprecated-1.8.php`` for the full list. You can also set the debug level to warning to get visual reminders of deprecated functions - See ``/engine/lib/deprecated-1.8.php`` for the full list. You can also set the debug level to warning to get visual reminders of deprecated functions
- Don't use ``register_shutdown_function`` as you may not have access to certain Elgg parts anymore (eg database). Instead use the ``shutdown`` ``system`` event

0 comments on commit c62b307

Please sign in to comment.