X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=rendertime%2Frendertime.php;h=acc6521a5468c20c1fd9a5c08d1369e40a6f3f22;hb=14c09c1bbba1324bd03f58d6af123ba53b29070c;hp=5af6f5129e86a27e08fe1220d511c7cdfc3b80ca;hpb=b303aedd668010f80457cc5b0080a39c8919a09c;p=friendica-addons.git diff --git a/rendertime/rendertime.php b/rendertime/rendertime.php index 5af6f512..acc6521a 100644 --- a/rendertime/rendertime.php +++ b/rendertime/rendertime.php @@ -8,18 +8,12 @@ */ use Friendica\Core\Hook; -use Friendica\Core\L10n; +use Friendica\DI; function rendertime_install() { Hook::register('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end'); } - -function rendertime_uninstall() { - Hook::unregister('init_1', 'addon/rendertime/rendertime.php', 'rendertime_init_1'); - Hook::unregister('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end'); -} - function rendertime_init_1(&$a) { } @@ -30,16 +24,16 @@ function rendertime_init_1(&$a) { function rendertime_page_end(Friendica\App $a, &$o) { - $profiler = $a->getProfiler(); + $profiler = DI::profiler(); $duration = microtime(true) - $profiler->get('start'); $ignored_modules = ["fbrowser"]; - $ignored = in_array($a->module, $ignored_modules); + $ignored = in_array(DI::module()->getName(), $ignored_modules); - if (is_site_admin() && (defaults($_GET, "mode", '') != "minimal") && !$a->is_mobile && !$a->is_tablet && !$ignored) { + if (is_site_admin() && (($_GET['mode'] ?? '') != 'minimal') && !DI::mode()->isMobile() && !DI::mode()->isMobile() && !$ignored) { - $o = $o . '