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')); } }
/** * Returns the request scheme * * @return string */ public static function scheme() { return url::scheme(); }
/** * 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']; } }