Esempio n. 1
0
 protected static function setPath($path = null)
 {
     if (!Site::$pathStack) {
         $requestURI = parse_url($_SERVER['REQUEST_URI']);
         Site::$pathStack = Site::$requestPath = explode('/', ltrim($requestURI['path'], '/'));
     }
     static::$_path = isset($path) ? $path : Site::$pathStack;
 }
Esempio n. 2
0
 /**
  * Sets important variables, e.g. the cache directory
  * @param $path (with trailing slash)
  * @return void
  */
 public static function init($path)
 {
     $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
     //remove every slash and then add one, so there is one ALWAYS
     $abs = realpath(dirname(__FILE__));
     //get absolute path, so the class can be used from anywhere
     static::$_path = $abs . DIRECTORY_SEPARATOR . $path;
     //save the new path to the static
 }
Esempio n. 3
0
 public function __construct()
 {
     $this->_active = defined('BLODE_EVENTS') && BLODE_EVENTS === true;
     $this->_url = 'http://' . BLODE_SERVER . ':' . BLODE_HTTP_PORT;
     static::$_ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null;
     static::$_path = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : null;
     static::$_host = gethostname();
     if (BLODE_USE_UDP) {
         $this->_init_socket();
     } else {
         $this->_init_curl();
     }
 }
Esempio n. 4
0
 public static final function setup($path = '.')
 {
     static::$_path = $path;
     if (!static::$_instance) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
 protected static function setPath(array $path = null)
 {
     static::$_path = isset($path) ? $path : \Site::$pathStack;
 }