]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Hook.php
Merge pull request #8055 from nupplaphil/task/remove_get_server
[friendica.git] / src / Core / Hook.php
index 5caa54319429df3ff4a81668a7517ca59c02549b..b8ad0fb8bd3b7d33399d671c0e111dfaaaf0af77 100644 (file)
@@ -5,14 +5,14 @@
 namespace Friendica\Core;
 
 use Friendica\App;
-use Friendica\BaseObject;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Util\Strings;
 
 /**
  * Some functions to handle hooks
  */
-class Hook extends BaseObject
+class Hook
 {
        /**
         * Array of registered hooks
@@ -75,7 +75,7 @@ class Hook extends BaseObject
         */
        public static function register($hook, $file, $function, $priority = 0)
        {
-               $file = str_replace(self::getApp()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
+               $file = str_replace(DI::app()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
 
                $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
                if (DBA::exists('hook', $condition)) {
@@ -98,7 +98,7 @@ class Hook extends BaseObject
         */
        public static function unregister($hook, $file, $function)
        {
-               $relative_file = str_replace(self::getApp()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
+               $relative_file = str_replace(DI::app()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
 
                // This here is only needed for fixing a problem that existed on the develop branch
                $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
@@ -148,7 +148,7 @@ class Hook extends BaseObject
                                                if ($hook[0] != $fork_hook[0]) {
                                                        continue;
                                                }
-                                               self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata);
+                                               self::callSingle(DI::app(), 'hook_fork', $fork_hook, $hookdata);
                                        }
 
                                        if (!$hookdata['execute']) {
@@ -175,7 +175,7 @@ class Hook extends BaseObject
        {
                if (array_key_exists($name, self::$hooks)) {
                        foreach (self::$hooks[$name] as $hook) {
-                               self::callSingle(self::getApp(), $name, $hook, $data);
+                               self::callSingle(DI::app(), $name, $hook, $data);
                        }
                }
        }