mirror of
https://github.com/friendica/friendica
synced 2025-04-26 01:10:15 +00:00
Modifed "update" and "insert" function / many changed queries
This commit is contained in:
parent
a5e7f7bf70
commit
fce72cbbc8
11 changed files with 66 additions and 123 deletions
|
@ -183,20 +183,18 @@ function unregister_hook($hook,$file,$function) {
|
|||
}}
|
||||
|
||||
|
||||
if (! function_exists('load_hooks')) {
|
||||
function load_hooks() {
|
||||
$a = get_app();
|
||||
$a->hooks = array();
|
||||
$r = q("SELECT * FROM `hook` WHERE 1 ORDER BY `priority` DESC, `file`");
|
||||
$r = dba::select('hook', array('hook', 'file', 'function'), array(), array('order' => array('priority' => 'desc', 'file')));
|
||||
|
||||
if (dbm::is_result($r)) {
|
||||
foreach ($r as $rr) {
|
||||
if (! array_key_exists($rr['hook'],$a->hooks))
|
||||
$a->hooks[$rr['hook']] = array();
|
||||
$a->hooks[$rr['hook']][] = array($rr['file'],$rr['function']);
|
||||
while ($rr = dba::fetch($r)) {
|
||||
if (! array_key_exists($rr['hook'],$a->hooks)) {
|
||||
$a->hooks[$rr['hook']] = array();
|
||||
}
|
||||
$a->hooks[$rr['hook']][] = array($rr['file'],$rr['function']);
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Calls a hook.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue