]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Works now
[friendica.git] / src / App.php
index f6b568ae8ac2c59b5c3e532ef81f8eacce318740..ec03829933d8478ea81b6c53ecfe6b1d7ccfadf7 100644 (file)
@@ -100,6 +100,7 @@ class App {
         */
        public $template_engine_instance = array();
        public $process_id;
+       public $queue;
        private $ldelim = array(
                'internal' => '',
                'smarty3' => '{{'
@@ -326,7 +327,27 @@ class App {
                        $basepath = $_SERVER['PWD'];
                }
 
-               return $basepath;
+               return self::realpath($basepath);
+       }
+
+       /**
+        * @brief Returns a normalized file path
+        *
+        * This is a wrapper for the "realpath" function.
+        * That function cannot detect the real path when some folders aren't readable.
+        * Since this could happen with some hosters we need to handle this.
+        *
+        * @param string $path The path that is about to be normalized
+        * @return string normalized path - when possible
+        */
+       public static function realpath($path) {
+               $normalized = realpath($path);
+
+               if (!is_bool($normalized)) {
+                       return $normalized;
+               } else {
+                       return $path;
+               }
        }
 
        function get_scheme() {