]> git.mxchange.org Git - friendica.git/blobdiff - src/Factory/SessionFactory.php
Create constants for Mastodon notification types
[friendica.git] / src / Factory / SessionFactory.php
index d4ad1e7ca11bb7e734bd72e6403bc471ccfde252..491573033bd4b22994ddda1ce06381d47be5f199 100644 (file)
@@ -1,4 +1,23 @@
 <?php
+/**
+ * @copyright Copyright (C) 2010-2021, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
 
 namespace Friendica\Factory;
 
@@ -39,7 +58,7 @@ class SessionFactory
         */
        public function createSession(App\Mode $mode, App\BaseURL $baseURL, IConfig $config, Database $dba, ICache $cache, LoggerInterface $logger, Profiler $profiler, array $server = [])
        {
-               $stamp1  = microtime(true);
+               $profiler->startRecording('session');
                $session = null;
 
                try {
@@ -58,7 +77,7 @@ class SessionFactory
                                                if ($config->get('system', 'cache_driver') === Type::DATABASE) {
                                                        $handler = new Session\Handler\Database($dba, $logger, $server);
                                                } else {
-                                                       $handler = new Session\Handler\Cache($cache, $logger, $server);
+                                                       $handler = new Session\Handler\Cache($cache);
                                                }
                                                break;
                                }
@@ -66,7 +85,7 @@ class SessionFactory
                                $session = new Session\Native($baseURL, $handler);
                        }
                } finally {
-                       $profiler->saveTimestamp($stamp1, 'parser', System::callstack());
+                       $profiler->stopRecording();
                        return $session;
                }
        }