Update Addon functions and calls

Update function names and calls for Addon class.
This commit is contained in:
Adam Magness 2018-01-17 13:42:40 -05:00
parent 213f6ae1a1
commit 11cf36105c
73 changed files with 544 additions and 464 deletions

View file

@ -4,6 +4,7 @@
*/
namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -138,7 +139,7 @@ Class Cron {
$sql_extra = (($manual_id) ? " AND `id` = $manual_id " : "");
reload_plugins();
Addon::reload();
$d = datetime_convert();

View file

@ -5,6 +5,7 @@
namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\Worker;
@ -18,7 +19,7 @@ Class CronHooks {
foreach ($a->hooks["cron"] as $single_hook) {
if ($single_hook[1] == $hook) {
logger("Calling cron hook '" . $hook . "'", LOGGER_DEBUG);
call_single_hook($a, $hook, $single_hook);
Addon::callSingleHook($a, $hook, $single_hook);
}
}
return;

View file

@ -6,6 +6,7 @@
namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -27,7 +28,7 @@ class Directory {
$arr = ['url' => $url];
call_hooks('globaldir_update', $arr);
Addon::callHooks('globaldir_update', $arr);
logger('Updating directory: ' . $arr['url'], LOGGER_DEBUG);
if (strlen($arr['url'])) {

View file

@ -6,6 +6,7 @@
namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -20,7 +21,7 @@ class Expire {
require_once 'include/datetime.php';
require_once 'include/items.php';
load_hooks();
Addon::loadHooks();
if ($param == 'delete') {
logger('Delete expired items', LOGGER_DEBUG);
@ -50,7 +51,7 @@ class Expire {
foreach ($a->hooks["expire"] as $hook) {
if ($hook[1] == $hook_name) {
logger("Calling expire hook '" . $hook[1] . "'", LOGGER_DEBUG);
call_single_hook($a, $hook_name, $hook, $data);
Addon::callSingleHook($a, $hook_name, $hook, $data);
}
}
return;

View file

@ -4,6 +4,7 @@
*/
namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
@ -553,10 +554,10 @@ class Notifier {
logger('notifier: calling hooks', LOGGER_DEBUG);
if ($normal_mode) {
call_hooks('notifier_normal',$target_item);
Addon::callHooks('notifier_normal',$target_item);
}
call_hooks('notifier_end',$target_item);
Addon::callHooks('notifier_end',$target_item);
return;
}

View file

@ -4,6 +4,7 @@
*/
namespace Friendica\Worker;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\Worker;
@ -55,7 +56,7 @@ class Queue
*/
$r = q("SELECT `id` FROM `queue` WHERE ((`created` > UTC_TIMESTAMP() - INTERVAL 12 HOUR AND `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE) OR (`last` < UTC_TIMESTAMP() - INTERVAL 1 HOUR)) ORDER BY `cid`, `created`");
call_hooks('queue_predeliver', $r);
Addon::callHooks('queue_predeliver', $r);
if (DBM::is_result($r)) {
foreach ($r as $q_item) {
@ -159,7 +160,7 @@ class Queue
default:
$params = ['owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false];
call_hooks('queue_deliver', $params);
Addon::callHooks('queue_deliver', $params);
if ($params['result']) {
QueueModel::removeItem($q_item['id']);