]> git.mxchange.org Git - friendica.git/commitdiff
rewrote to static approach and if() condition can be simplified.
authorRoland Haeder <roland@mxchange.org>
Sat, 25 Mar 2017 11:59:37 +0000 (12:59 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 25 Mar 2017 12:00:10 +0000 (13:00 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
boot.php

index 0efd4a2069ce6972cbdcbbf8ad1d613a94b32e34..2a6e9b4ca52900e29f241edd03f483c4a11c7dbd 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1255,8 +1255,7 @@ class App {
         * @return bool Is it a known backend?
         */
        function is_backend() {
-               /// @Should be made static to speedup things
-               $backend = array();
+               static $backend = array();
                $backend[] = "_well_known";
                $backend[] = "api";
                $backend[] = "dfrn_notify";
@@ -1277,12 +1276,8 @@ class App {
                $backend[] = "statistics_json";
                $backend[] = "xrd";
 
-               /// @TODO Maybe rewrite this part: return (in_array() || $this->backend); ?
-               if (in_array($this->module, $backend)) {
-                       return(true);
-               } else {
-                       return($this->backend);
-               }
+               // Check if current module is in backend or backend flag is set
+               return (in_array($this->module, self::$backend) || $this->backend);
        }
 
        /**