]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
some more doc strings
[friendica.git] / boot.php
index 497a97b0eca04a7c0062ef75e07c1cc934cce0ab..2242ba476d85f06e811eb872b4f435f5c2625ec0 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -36,7 +36,7 @@ define ( 'FRIENDICA_PLATFORM',     'Friendica');
 define ( 'FRIENDICA_CODENAME',     'Asparagus');
 define ( 'FRIENDICA_VERSION',      '3.5-dev' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
-define ( 'DB_UPDATE_VERSION',      1191      );
+define ( 'DB_UPDATE_VERSION',      1193      );
 
 /**
  * @brief Constant with a HTML line break.
@@ -467,6 +467,7 @@ class App {
        public  $is_tablet;
        public  $is_friendica_app;
        public  $performance = array();
+       public  $callstack = array();
 
        public $nav_sel;
 
@@ -554,6 +555,12 @@ class App {
                $this->performance["marktime"] = 0;
                $this->performance["markstart"] = microtime(true);
 
+               $this->callstack["database"] = array();
+               $this->callstack["network"] = array();
+               $this->callstack["file"] = array();
+               $this->callstack["rendering"] = array();
+               $this->callstack["parser"] = array();
+
                $this->config = array();
                $this->page = array();
                $this->pager= array();
@@ -903,6 +910,10 @@ class App {
        }
 
        function get_cached_avatar_image($avatar_image){
+               return $avatar_image;
+
+               // The following code is deactivated. It doesn't seem to make any sense and it slows down the system.
+               /*
                if($this->cached_profile_image[$avatar_image])
                        return $this->cached_profile_image[$avatar_image];
 
@@ -922,6 +933,7 @@ class App {
                        }
                }
                return $this->cached_profile_image[$avatar_image];
+               */
        }
 
 
@@ -1016,6 +1028,20 @@ class App {
 
                $this->performance[$value] += (float)$duration;
                $this->performance["marktime"] += (float)$duration;
+
+               // Trace the different functions with their timestamps
+               $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
+
+               array_shift($trace);
+
+               $function = array();
+               foreach ($trace AS $func)
+                       $function[] = $func["function"];
+
+               $function = implode(", ", $function);
+
+               $this->callstack[$value][$function] += (float)$duration;
+
        }
 
        function mark_timestamp($mark) {