Ejemplo n.º 1
0
 /**
  * Initialize the class members values.
  * @return 	void
  */
 public static function init()
 {
     static::$ssl = Request::isSecure();
     static::$protocol = static::$ssl === true ? 'https' : 'http';
     static::$request_uri = $req = $_SERVER['REQUEST_URI'];
     static::$request_method = $_SERVER['REQUEST_METHOD'];
     if (strpos($req, '?') !== false) {
         list(static::$request_uri, static::$query_string) = explode('?', $req);
     }
 }
Ejemplo n.º 2
0
 public static function setAppProtocol($protocol)
 {
     static::$protocol = (string) $protocol;
 }
Ejemplo n.º 3
0
 public static function register($protocol = 'shm')
 {
     static::$protocol = $protocol;
     return stream_wrapper_register($protocol, get_called_class());
 }
 /**
  * Unregisters the stream wrapper
  */
 public static function unregister()
 {
     if (!static::$protocol) {
         return;
     }
     if (!stream_wrapper_unregister(static::$protocol)) {
         throw new \RuntimeException(sprintf('The protocol "%s" cannot be unregistered
             from the runtime', static::$protocol));
     }
     static::$protocol = null;
     static::$pathFactory = null;
     static::$bufferFactory = null;
 }