public static function asset($pathname, $relativeTo = null, $options = []) { if (is_null($relativeTo)) { $relativeTo = Uri::getInstance(); } return $relativeTo->withPathname(trim($pathname, '/'))->withBasePath('')->__toString(); }
public static function getInstance($cli = false) { if (!isset(static::$instance)) { $method = $cli ? 'GET' : $_SERVER['REQUEST_METHOD']; $request = new Request($method, Uri::getInstance($cli)); $request->headers = Headers::getInstance(); static::$instance = $request; } return static::$instance; }