Example #1
0
 public function index()
 {
     if (isset($this->index)) {
         return $this->index;
     }
     if (r::cli()) {
         return $this->index = '/';
     } else {
         return $this->index = url::scheme() . '://' . server::get('HTTP_HOST') . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
     }
 }
Example #2
0
 /**
  * Returns the request scheme
  *
  * @return string
  */
 public static function scheme()
 {
     return url::scheme();
 }
Example #3
0
 /**
  * Returns the proper base url for the installation
  *
  * @return string
  */
 protected static function url()
 {
     // auto-detect the url
     if (empty(c::$data['url'])) {
         if (r::cli()) {
             return c::$data['url'] = '/';
         } else {
             return c::$data['url'] = url::scheme() . '://' . server::get('HTTP_HOST') . preg_replace('!\\/index\\.php$!i', '', server::get('SCRIPT_NAME'));
         }
     } else {
         return c::$data['url'];
     }
 }