X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=rendertime%2Frendertime.php;h=acc6521a5468c20c1fd9a5c08d1369e40a6f3f22;hb=14c09c1bbba1324bd03f58d6af123ba53b29070c;hp=a54fc489d3442cad2d92c08537bd7953a759d51d;hpb=1f0e3ee60481d6bb8e7245d121905dc600e9765b;p=friendica-addons.git diff --git a/rendertime/rendertime.php b/rendertime/rendertime.php index a54fc489..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() && (($_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 . '