]> git.mxchange.org Git - friendica.git/blobdiff - src/App/Page.php
update FR translations THX kalon33
[friendica.git] / src / App / Page.php
index 305b2962b9c70e856ba31c67ab28394e82d1c457..475681054a1254d1ea664df2102ddeb814a67260 100644 (file)
@@ -98,10 +98,16 @@ class Page implements ArrayAccess
                $this->method  = $method;
        }
 
-       public function logRuntime()
+       public function logRuntime(IManageConfigValues $config, string $origin = '')
        {
+               if (in_array($this->command, $config->get('system', 'runtime_ignore'))) {
+                       return;
+               }
+
                $runtime = number_format(microtime(true) - $this->timestamp, 3);
-               Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime]);
+               if ($runtime > $config->get('system', 'runtime_loglimit')) {
+                       Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime, 'origin' => $origin]);
+               }
        }
 
        /**
@@ -189,7 +195,7 @@ class Page implements ArrayAccess
         * @param string $media
         * @see Page::initHead()
         */
-       public function registerStylesheet($path, string $media = 'screen')
+       public function registerStylesheet(string $path, string $media = 'screen')
        {
                $path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]);
 
@@ -282,7 +288,7 @@ class Page implements ArrayAccess
         *
         * Taken from http://webcheatsheet.com/php/get_current_page_url.php
         */
-       private function curPageURL()
+       private function curPageURL(): string
        {
                $pageURL = 'http';
                if (!empty($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on")) {