Elgg
Version 1.11
|
Go to the source code of this file.
Namespaces | |
Elgg\Core | |
Activate a plugin or plugins. | |
Functions | |
execute_delayed_write_query ($query, $handler="") | |
Queue a query for running during shutdown that writes to the database. More... | |
execute_delayed_read_query ($query, $handler="") | |
Queue a query for running during shutdown that reads from the database. More... | |
get_data ($query, $callback="") | |
Retrieve rows from the database. More... | |
get_data_row ($query, $callback="") | |
Retrieve a single row from the database. More... | |
insert_data ($query) | |
Insert a row into the database. More... | |
update_data ($query) | |
Update a row in the database. More... | |
delete_data ($query) | |
Remove a row from the database. More... | |
run_sql_script ($scriptlocation) | |
Runs a full database script from disk. More... | |
sanitize_string ($string) | |
Sanitize a string for database use. More... | |
sanitise_string ($string) | |
Wrapper function for alternate English spelling (. More... | |
sanitize_int ($int, $signed=true) | |
Sanitizes an integer for database use. More... | |
sanitise_int ($int, $signed=true) | |
Sanitizes an integer for database use. More... | |
_elgg_db_log_profiling_data () | |
Log db profiling information at NOTICE debug level upon shutdown. More... | |
_elgg_db_get_query_counter () | |
Get a new query counter that will begin counting from 0. More... | |
_elgg_db_run_delayed_queries () | |
Execute any delayed queries upon shutdown. More... | |
_elgg_db_init () | |
Registers shutdown functions for database profiling and delayed queries. More... | |
Variables | |
return | function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
_elgg_db_get_query_counter | ( | ) |
Get a new query counter that will begin counting from 0.
For profiling isolated sections of code.
$counter = _elgg_db_get_query_counter();
... code to profile
$counter->setDeltaHeader();
Definition at line 205 of file database.php.
_elgg_db_init | ( | ) |
Registers shutdown functions for database profiling and delayed queries.
private
Definition at line 224 of file database.php.
_elgg_db_log_profiling_data | ( | ) |
Log db profiling information at NOTICE debug level upon shutdown.
Definition at line 183 of file database.php.
_elgg_db_run_delayed_queries | ( | ) |
Execute any delayed queries upon shutdown.
Definition at line 215 of file database.php.
delete_data | ( | $query | ) |
Remove a row from the database.
string | $query | The SQL query to run |
Definition at line 106 of file database.php.
execute_delayed_read_query | ( | $query, | |
$handler = "" |
|||
) |
Queue a query for running during shutdown that reads from the database.
string | $query | The query to execute |
string | $handler | The optional handler for processing the result |
Definition at line 31 of file database.php.
execute_delayed_write_query | ( | $query, | |
$handler = "" |
|||
) |
Queue a query for running during shutdown that writes to the database.
string | $query | The query to execute |
string | $handler | The optional handler for processing the result |
Definition at line 19 of file database.php.
get_data | ( | $query, | |
$callback = "" |
|||
) |
Retrieve rows from the database.
Queries are executed with execute_query() and results are retrieved with mysql_fetch_object(). If a callback function $callback is defined, each row will be passed as the single argument to $callback. If no callback function is defined, the entire result set is returned as an array.
mixed | $query | The query being passed. |
string | $callback | Optionally, the name of a function to call back to on each row |
Definition at line 50 of file database.php.
get_data_row | ( | $query, | |
$callback = "" |
|||
) |
Retrieve a single row from the database.
Similar to get_data() but returns only the first row matched. If a callback function $callback is specified, the row will be passed as the only argument to $callback.
mixed | $query | The query to execute. |
string | $callback | A callback function |
Definition at line 66 of file database.php.
insert_data | ( | $query | ) |
Insert a row into the database.
mixed | $query | The query to execute. |
Definition at line 80 of file database.php.
run_sql_script | ( | $scriptlocation | ) |
Runs a full database script from disk.
The file specified should be a standard SQL file as created by mysqldump or similar. Statements must be terminated with ; and a newline character (
or
) with only one statement per line.
The special string 'prefix_' is replaced with the database prefix as defined in ->dbprefix.
string | $scriptlocation | The full path to the script |
DatabaseException |
Definition at line 130 of file database.php.
sanitise_int | ( | $int, | |
$signed = true |
|||
) |
Sanitizes an integer for database use.
Wrapper function for alternate English spelling (
int | $int | Value to be sanitized |
bool | $signed | Whether negative values should be allowed (true) |
Definition at line 173 of file database.php.
sanitise_string | ( | $string | ) |
Wrapper function for alternate English spelling (.
string | $string | The string to sanitize |
Definition at line 150 of file database.php.
sanitize_int | ( | $int, | |
$signed = true |
|||
) |
Sanitizes an integer for database use.
int | $int | Value to be sanitized |
bool | $signed | Whether negative values should be allowed (true) |
Definition at line 161 of file database.php.
sanitize_string | ( | $string | ) |
Sanitize a string for database use.
string | $string | The string to sanitize |
Definition at line 140 of file database.php.
update_data | ( | $query | ) |
Update a row in the database.
string | $query | The query to run. |
Definition at line 93 of file database.php.
return function(\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks) |
Definition at line 229 of file database.php.