]> git.mxchange.org Git - friendica.git/commitdiff
Rename DI::apphelper() to DI::appHeler()
authorArt4 <art4@wlabs.de>
Sun, 17 Nov 2024 20:00:34 +0000 (20:00 +0000)
committerArt4 <art4@wlabs.de>
Sun, 17 Nov 2024 20:00:34 +0000 (20:00 +0000)
31 files changed:
mod/item.php
src/App.php
src/Console/PostUpdate.php
src/Content/OEmbed.php
src/Content/Text/BBCode.php
src/Core/Hook.php
src/Core/Renderer.php
src/Core/Theme.php
src/Core/Worker.php
src/DI.php
src/Model/Item.php
src/Module/Admin/Summary.php
src/Module/Api/Friendica/Events/Create.php
src/Module/Home.php
src/Module/OAuth/Acknowledge.php
src/Module/OAuth/Authorize.php
src/Module/RandomProfile.php
src/Module/Settings/Account.php
src/Module/Update/Profile.php
src/Object/Thread.php
src/Protocol/ActivityPub/Queue.php
src/Protocol/Feed.php
src/Security/OpenWebAuth.php
src/Util/Temporal.php
src/Worker/Cron.php
src/Worker/DBUpdate.php
src/Worker/Expire.php
src/Worker/FetchMissingActivity.php
src/Worker/Notifier.php
src/Worker/ProfileUpdate.php
view/theme/frio/php/scheme.php

index f184186e16252d81b9d5da60235db9e73f7f4315..decb957bcc5eb8f07623d204eef69759f0268c4b 100644 (file)
@@ -284,7 +284,7 @@ function item_process(array $post, array $request, bool $preview, string $return
        unset($post['api_source']);
 
        if (!empty($request['scheduled_at'])) {
-               $scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::apphelper()->getTimeZone());
+               $scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::appHelper()->getTimeZone());
                if ($scheduled_at > DateTimeFormat::utcNow()) {
                        unset($post['created']);
                        unset($post['edited']);
index c5a79909949a0a0d9234d88f4081278d31e5031b..46639f8939497cf9616be667565e9e9b636b7edd 100644 (file)
@@ -129,7 +129,7 @@ class App implements AppHelper
                $this->l10n      = $l10n;
                $this->args      = $args;
                $this->session   = $session;
-               $this->appHelper = DI::apphelper();
+               $this->appHelper = DI::appHelper();
 
                $this->load($dbaDefinition, $viewDefinition);
        }
index 2d0357a460f7a6848308cf4809ae402097c8fb84..318712cdc57dbf34b5c90d3761a3e63b31526161 100644 (file)
@@ -58,7 +58,7 @@ HELP;
                $this->appMode  = $appMode;
                $this->keyValue = $keyValue;
                $this->l10n     = $l10n;
-               $this->basePath = DI::apphelper()->getBasePath();
+               $this->basePath = DI::appHelper()->getBasePath();
        }
 
        protected function doExecute(): int
index 55f5e0ad0f237aa026e2e20e37cb5f96cca6e630..4d3c58904194a7bcc4b4b35b6e831589e6833776 100644 (file)
@@ -48,7 +48,7 @@ class OEmbed
        {
                $embedurl = trim($embedurl, '\'"');
 
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                $cache_key = 'oembed:' . $appHelper->getThemeInfoValue('videowidth') . ':' . $embedurl;
 
index 238bac1205b7ce28dad5d36eda1b6231e8027e51..bcac088e7e71173b1909c09a014addd2465f78de 100644 (file)
@@ -1926,7 +1926,7 @@ class BBCode
 
        private static function convertVideoPlatformsToHtml(string $text, bool $try_oembed): string
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                $text = self::normalizeVideoLinks($text);
 
index bbf634401a0755c978c869038b14b06eb7f9b5d6..44dfad70bcbd83d20e8b8fa0b525cf2e021f7e54 100644 (file)
@@ -80,7 +80,7 @@ class Hook
         */
        public static function register(string $hook, string $file, string $function, int $priority = 0)
        {
-               $file = str_replace(DI::apphelper()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
+               $file = str_replace(DI::appHelper()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
 
                $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
                if (DBA::exists('hook', $condition)) {
@@ -101,7 +101,7 @@ class Hook
         */
        public static function unregister(string $hook, string $file, string $function): bool
        {
-               $relative_file = str_replace(DI::apphelper()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
+               $relative_file = str_replace(DI::appHelper()->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];
@@ -197,7 +197,7 @@ class Hook
        public static function callSingle(string $name, array $hook, &$data = null)
        {
                // Don't run a theme's hook if the user isn't using the theme
-               if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . DI::apphelper()->getCurrentTheme()) === false) {
+               if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . DI::appHelper()->getCurrentTheme()) === false) {
                        return;
                }
 
index 6ddd8d4ad106a4f233a7aaaeed5f86aaedfcf7fc..6fb6e02eada9df4e49da08f3578907fd701c5b3d 100644 (file)
@@ -155,7 +155,7 @@ class Renderer
                        if (isset(self::$template_engine_instance[$template_engine])) {
                                return self::$template_engine_instance[$template_engine];
                        } else {
-                               $appHelper = DI::apphelper();
+                               $appHelper = DI::appHelper();
                                $class = self::$template_engines[$template_engine];
                                $obj = new $class($appHelper->getCurrentTheme(), $appHelper->getThemeInfo());
                                self::$template_engine_instance[$template_engine] = $obj;
index 81d1016831fd24d1960ec3bbeb9200b5a8958427..eedc64e0667f0a9ef06fd35bb0614e942165dffd 100644 (file)
@@ -208,7 +208,7 @@ class Theme
         */
        public static function getPathForFile(string $file): string
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                $theme = $appHelper->getCurrentTheme();
 
@@ -245,7 +245,7 @@ class Theme
                        return 'view/theme/' . $theme . '/style.css';
                }
 
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                $query_params = [];
 
@@ -267,7 +267,7 @@ class Theme
        {
                $theme = Strings::sanitizeFilePathItem($theme);
 
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
                $base_theme = $appHelper->getThemeInfoValue('extends') ?? '';
 
                if (file_exists("view/theme/$theme/config.php")) {
index 6aa8d4331d0c57089dddb52cd0d3e9d0d20b7aa4..5d33dc57fef3966bd6d917e01c1427aaae919103 100644 (file)
@@ -533,7 +533,7 @@ class Worker
         */
        private static function execFunction(array $queue, string $funcname, array $argv, bool $method_call)
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                self::coolDown();
 
@@ -1371,7 +1371,7 @@ class Worker
         */
        public static function getRetrial(): int
        {
-               $queue = DI::apphelper()->getQueue();
+               $queue = DI::appHelper()->getQueue();
                return $queue['retrial'] ?? 0;
        }
 
@@ -1384,7 +1384,7 @@ class Worker
         */
        public static function defer(int $worker_defer_limit = 0): bool
        {
-               $queue = DI::apphelper()->getQueue();
+               $queue = DI::appHelper()->getQueue();
 
                if (empty($queue)) {
                        return false;
index 8f5c9859e5b09c02606350bd07afa8b12a7f9b85..5604fe9df24c6e3e95b224ae780994ea5b5067cf 100644 (file)
@@ -71,7 +71,7 @@ abstract class DI
        //
 
        /**
-        * @deprecated 2024.12 use DI::apphelper() instead
+        * @deprecated 2024.12 use DI::appHelper() instead
         *
         * @return App
         */
@@ -80,7 +80,7 @@ abstract class DI
                return self::$dice->create(App::class);
        }
 
-       public static function apphelper(): AppHelper
+       public static function appHelper(): AppHelper
        {
                return self::$dice->create(AppHelper::class);
        }
index b0b4d80d19164a5c9553044119b510e1d9800a7a..ffdb9c67f0bc6186a1e40df0f7995b42d11f405c 100644 (file)
@@ -3348,7 +3348,7 @@ class Item
         */
        public static function prepareBody(array &$item, bool $attach = false, bool $is_preview = false, bool $only_cache = false): string
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
                $uid = DI::userSession()->getLocalUserId();
                Hook::callAll('prepare_body_init', $item);
 
index a586b117da614c827590fa6b4ba4288f8e1b31d1..736c8b3e2e1b122e7c010e0c7ea9ec632e8f15e0 100644 (file)
@@ -29,7 +29,7 @@ class Summary extends BaseAdmin
        {
                parent::content();
 
-               $basePath = DI::apphelper()->getBasePath();
+               $basePath = DI::appHelper()->getBasePath();
 
                // are there MyISAM tables in the DB? If so, trigger a warning message
                $warningtext = [];
index fdde2e9c18409926c2dad5adba81582936865363..3766fa1fbe56fabc2f0d8956f7ed5d693e7617c6 100644 (file)
@@ -59,11 +59,11 @@ class Create extends BaseApi
                        $finish   = DBA::NULL_DATETIME;
                        $nofinish = true;
                } else {
-                       $finish   = DateTimeFormat::convert($request['end_time'], 'UTC', DI::apphelper()->getTimeZone());
+                       $finish   = DateTimeFormat::convert($request['end_time'], 'UTC', DI::appHelper()->getTimeZone());
                        $nofinish = false;
                }
 
-               $start = DateTimeFormat::convert($request['start_time'], 'UTC', DI::apphelper()->getTimeZone());
+               $start = DateTimeFormat::convert($request['start_time'], 'UTC', DI::appHelper()->getTimeZone());
 
                // create event
                $event = [];
index 94cb08773ec52976314bfdac85664923f8eefb9b..9c72398f7a685ff26482628685b2f137a94e2d06 100644 (file)
@@ -32,7 +32,7 @@ class Home extends BaseModule
 
        protected function content(array $request = []): string
        {
-               $basePath = DI::apphelper()->getBasePath();
+               $basePath = DI::appHelper()->getBasePath();
                $config = DI::config();
 
                // currently no returned data is used
index 82ad166bc9201e32d02ab4ddfb49d7d9a2e576a2..78e4083e42cf2f0d99c0e2806c69e0dcea90e79a 100644 (file)
@@ -26,7 +26,7 @@ class Acknowledge extends BaseApi
        protected function post(array $request = [])
        {
                DI::session()->set('oauth_acknowledge', true);
-               DI::apphelper()->redirect(DI::session()->get('return_path'));
+               DI::appHelper()->redirect(DI::session()->get('return_path'));
        }
 
        protected function content(array $request = []): string
index 8d77573e72bf31b06a404b6bdd188ff7c416feb1..8179bfa886e9743e912182a835ca4ad130bc1dcc 100644 (file)
@@ -60,14 +60,14 @@ class Authorize extends BaseApi
                $uid = DI::userSession()->getLocalUserId();
                if (empty($uid)) {
                        Logger::info('Redirect to login');
-                       DI::apphelper()->redirect('login?' . http_build_query(['return_authorize' => $redirect]));
+                       DI::appHelper()->redirect('login?' . http_build_query(['return_authorize' => $redirect]));
                } else {
                        Logger::info('Already logged in user', ['uid' => $uid]);
                }
 
                if (!OAuth::existsTokenForUser($application, $uid) && !DI::session()->get('oauth_acknowledge')) {
                        Logger::info('Redirect to acknowledge');
-                       DI::apphelper()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']]));
+                       DI::appHelper()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']]));
                }
 
                DI::session()->remove('oauth_acknowledge');
@@ -78,7 +78,7 @@ class Authorize extends BaseApi
                }
 
                if ($application['redirect_uri'] != 'urn:ietf:wg:oauth:2.0:oob') {
-                       DI::apphelper()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']]));
+                       DI::appHelper()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']]));
                }
 
                self::$oauth_code = $token['code'];
index d590af634f7e68413f58f6e2a117b6b6fbaa6080..bc43d48511d8bcf59f9e719b87a5220dd3803edb 100644 (file)
@@ -18,7 +18,7 @@ class RandomProfile extends BaseModule
 {
        protected function content(array $request = []): string
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                $contact = Contact::getRandomContact();
 
index 6c8a4734703f6bc7e101cb2afd52d5eaeb8694d2..3046e28775ffe3f7c739ff7f9746e304f5ab5baa 100644 (file)
@@ -109,7 +109,7 @@ class Account extends BaseSettings
                        }
 
                        if (strlen($timezone) && $timezone != $user['timezone']) {
-                               DI::apphelper()->setTimeZone($timezone);
+                               DI::appHelper()->setTimeZone($timezone);
                        }
 
                        $fields = [
@@ -400,7 +400,7 @@ class Account extends BaseSettings
                $expire_network_only = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'expire', 'network_only', false);
 
                if (!strlen($user['timezone'])) {
-                       $timezone = DI::apphelper()->getTimeZone();
+                       $timezone = DI::appHelper()->getTimeZone();
                }
 
                // Set the account type to "Community" when the page is a community page but the account type doesn't fit
index bcfce3fa3863428ab119bee7bb2cdd85922cafbb..b9360d736016da75b908b6ae825461fac3dac0a0 100644 (file)
@@ -23,7 +23,7 @@ class Profile extends BaseModule
 {
        protected function rawContent(array $request = [])
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                // Ensure we've got a profile owner if updating.
                $appHelper->setProfileOwner((int)($request['p'] ?? 0));
index e0585e322255a2a6272c3e8d09b9d1fa750d375a..2363ab197deb3d736dbfa1bd63715851420c9cd1 100644 (file)
@@ -57,7 +57,7 @@ class Thread
                        return;
                }
 
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                switch ($mode) {
                        case Conversation::MODE_NETWORK:
index 678decb1cac24713fe3dfcba2df930844dded0f6..059ba1a3884bcd0189f2d607668be4af69c694e1 100644 (file)
@@ -192,7 +192,7 @@ class Queue
                }
 
                if (!empty($entry['wid'])) {
-                       $worker = DI::apphelper()->getQueue();
+                       $worker = DI::appHelper()->getQueue();
                        $wid = $worker['id'] ?? 0;
                        if ($entry['wid'] != $wid) {
                                $workerqueue = DBA::selectFirst('workerqueue', ['pid'], ['id' => $entry['wid'], 'done' => false]);
index 9800fd24338645475512759e4b63e6c8277ac127..62d58a0ec8564483bbc59777d557c8608c3ed05b 100644 (file)
@@ -1014,7 +1014,7 @@ class Feed
 
                // Display events in the user's timezone
                if (strlen($owner['timezone'])) {
-                       DI::apphelper()->setTimeZone($owner['timezone']);
+                       DI::appHelper()->setTimeZone($owner['timezone']);
                }
 
                $previous_created = $last_update;
index 79117c4ecc9d3814d7fba26d38a8b6cb326a47e7..4090fa7378b74a6a6e27749f9ddca7e5db5f3df0 100644 (file)
@@ -114,7 +114,7 @@ class OpenWebAuth
         */
        public static function init(string $token)
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                // Clean old OpenWebAuthToken entries.
                OpenWebAuthToken::purge('owt', '3 MINUTE');
@@ -160,7 +160,7 @@ class OpenWebAuth
         */
        public static function addVisitorCookieForHandle(string $handle): array
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                // Try to find the public contact entry of the visitor.
                $cid = Contact::getIdForURL($handle);
index 64ab47b98c248d16f9cea6ee284b86472bc23004..098b60d5e803d32917f9c492c5768d2bf7c72413 100644 (file)
@@ -264,7 +264,7 @@ class Temporal
                                $input_text,
                                DI::l10n()->t(
                                        'Time zone: <strong>%s</strong> <a href="%s">Change in Settings</a>',
-                                       str_replace('_', ' ', DI::apphelper()->getTimeZone()) . ' (GMT ' . DateTimeFormat::localNow('P') . ')',
+                                       str_replace('_', ' ', DI::appHelper()->getTimeZone()) . ' (GMT ' . DateTimeFormat::localNow('P') . ')',
                                        DI::baseUrl() . '/settings'
                                ),
                                $required ? '*' : '',
index e6d11db3704cc5dbd92b4f9491789ba7b3d5db08..c10a548559a6cf7f52f65aaedea4768000aa501d 100644 (file)
@@ -21,7 +21,7 @@ class Cron
 {
        public static function execute()
        {
-               $basepath = DI::apphelper()->getBasePath();
+               $basepath = DI::appHelper()->getBasePath();
 
                $last = DI::keyValue()->get('last_cron');
 
index 87a3fae27fea4299bd8666aa8c3b1fcaf23b7198..4e01e628985533d2e0477acfad2e87e358e5e070 100644 (file)
@@ -19,7 +19,7 @@ class DBUpdate
        {
                // Just in case the last update wasn't failed
                if (DI::config()->get('system', 'update', Update::SUCCESS) != Update::FAILED) {
-                       Update::run(DI::apphelper()->getBasePath());
+                       Update::run(DI::appHelper()->getBasePath());
                }
        }
 }
index 2193791229a34339a9d5c003f3883962e7726008..baaef454ffe070d0d3f7faec0a9dd9950b050d44 100644 (file)
@@ -21,7 +21,7 @@ class Expire
 {
        public static function execute($param = '', $hook_function = '')
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                Hook::loadHooks();
 
index 7224f85cdb9f3bade1d907f7d2c7ebc79aeb9e51..5b6e8ffd03f5cb62795df64a1a2c775ad03b69c7 100644 (file)
@@ -40,7 +40,7 @@ class FetchMissingActivity
                        Logger::info('Defer limit reached, activity could not be fetched', ['url' => $url]);
 
                        // recursively delete all entries that belong to this worker task
-                       $queue = DI::apphelper()->getQueue();
+                       $queue = DI::appHelper()->getQueue();
                        if (!empty($queue['id'])) {
                                Queue::deleteByWorkerId($queue['id']);
                        }
index 90e47273dee2e8d221dc4ad8aeb235869e988098..42868e4e0edd0a3cc8d68e213f746b5b0d98dc1e 100644 (file)
@@ -42,7 +42,7 @@ class Notifier
 {
        public static function execute(string $cmd, int $post_uriid, int $sender_uid = 0)
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                Logger::info('Invoked', ['cmd' => $cmd, 'target' => $post_uriid, 'sender_uid' => $sender_uid]);
 
@@ -414,7 +414,7 @@ class Notifier
         */
        private static function delivery(string $cmd, int $post_uriid, int $sender_uid, array $target_item, array $parent, array $thr_parent, array $owner, bool $batch_delivery, bool $in_batch, array $contacts, array $ap_contacts, array $conversants = []): int
        {
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
                $delivery_queue_count = 0;
 
                if (!empty($target_item['verb']) && ($target_item['verb'] == Activity::ANNOUNCE)) {
index fb8ecfd8572a9b60b1dd496cb90385a999867a09..685229b3b5582e44c8782e0f71421d887d6d4092 100644 (file)
@@ -30,7 +30,7 @@ class ProfileUpdate {
                        return;
                }
 
-               $appHelper = DI::apphelper();
+               $appHelper = DI::appHelper();
 
                $inboxes = ActivityPub\Transmitter::fetchTargetInboxesforUser($uid);
 
index b8547fee3dd6df72417a8b8057aaa7cf9b5f7756..5c11c8a5d1656116b295c06c270cacb10930e1a1 100644 (file)
@@ -29,7 +29,7 @@ require_once 'view/theme/frio/theme.php';
 
 function get_scheme_info($scheme)
 {
-       $theme = DI::apphelper()->getCurrentTheme();
+       $theme = DI::appHelper()->getCurrentTheme();
        $themepath = 'view/theme/' . $theme . '/';
        $scheme = Strings::sanitizeFilePathItem($scheme) ?: FRIO_DEFAULT_SCHEME;