aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/database.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/database.php')
-rw-r--r--engine/lib/database.php41
1 files changed, 16 insertions, 25 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index c44fdf1fd..cc2b99f6a 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -189,22 +189,6 @@ function db_delayedexecution_shutdown_hook() {
}
/**
- * Registers shutdown functions for database profiling and delayed queries.
- *
- * @note Database connections are established upon first call to database.
- *
- * @return true
- * @elgg_event_handler boot system
- * @access private
- */
-function init_db() {
- register_shutdown_function('db_delayedexecution_shutdown_hook');
- register_shutdown_function('db_profiling_shutdown_hook');
-
- return true;
-}
-
-/**
* Returns (if required, also creates) a database link resource.
*
* Database link resources are stored in the {@link $dblink} global. These
@@ -728,9 +712,9 @@ function sanitize_string($string) {
/**
* Sanitises an integer for database use.
*
- * @param int $int Integer
- * @param bool[optional] $signed Whether negative values should be allowed (true)
- * @return int Sanitised integer
+ * @param int $int Value to be sanitized
+ * @param bool $signed Whether negative values should be allowed (true)
+ * @return int
*/
function sanitise_int($int, $signed = true) {
$int = (int) $int;
@@ -745,18 +729,25 @@ function sanitise_int($int, $signed = true) {
}
/**
- * Sanitises an integer for database use.
+ * Sanitizes an integer for database use.
* Wrapper function for alternate English spelling (@see sanitise_int)
*
- * @param int $int Integer
- * @param bool[optional] $signed Whether negative values should be allowed (true)
- * @return int Sanitised integer
+ * @param int $int Value to be sanitized
+ * @param bool $signed Whether negative values should be allowed (true)
+ * @return int
*/
function sanitize_int($int, $signed = true) {
return sanitise_int($int, $signed);
}
/**
- * @elgg_register_event boot system init_db
+ * Registers shutdown functions for database profiling and delayed queries.
+ *
+ * @access private
*/
-elgg_register_event_handler('boot', 'system', 'init_db', 0);
+function init_db() {
+ register_shutdown_function('db_delayedexecution_shutdown_hook');
+ register_shutdown_function('db_profiling_shutdown_hook');
+}
+
+elgg_register_event_handler('init', 'system', 'init_db');