]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/statusnet.php
mail paths for docfile
[quix0rs-gnu-social.git] / lib / statusnet.php
index 39f90a5069dffb7a3cd67ff2bba3cd9e5c4ab28d..648369ec4482ebf9f1f347aa382d12b13c9d2eee 100644 (file)
@@ -31,6 +31,7 @@ class StatusNet
 {
     protected static $have_config;
     protected static $is_api;
+    protected static $is_ajax;
     protected static $plugins = array();
 
     /**
@@ -169,7 +170,6 @@ class StatusNet
         return $sites;
     }
 
-
     /**
      * Fire initialization events for all instantiated plugins.
      */
@@ -225,12 +225,22 @@ class StatusNet
     {
         return self::$is_api;
     }
-    
+
     public function setApi($mode)
     {
         self::$is_api = $mode;
     }
 
+    public function isAjax()
+    {
+        return self::$is_ajax;
+    }
+
+    public function setAjax($mode)
+    {
+        self::$is_ajax = $mode;
+    }
+
     /**
      * Build default configuration array
      * @return array
@@ -246,7 +256,7 @@ class StatusNet
      * Establish default configuration based on given or default server and path
      * Sets global $_server, $_path, and $config
      */
-    protected static function initDefaults($server, $path)
+    public static function initDefaults($server, $path)
     {
         global $_server, $_path, $config;
 
@@ -387,6 +397,22 @@ class StatusNet
             }
         }
     }
+
+    /**
+     * Are we running from the web with HTTPS?
+     *
+     * @return boolean true if we're running with HTTPS; else false
+     */
+
+    static function isHTTPS()
+    {
+        // There are some exceptions to this; add them here!
+        if(empty($_SERVER['HTTPS'])) {
+            return false;
+        } else {
+            return $_SERVER['HTTPS'] !== 'off';
+        }
+    }
 }
 
 class NoConfigException extends Exception