I cannot use class Nette\HttpUrlScript "smoothly", as standalone (its needed for me for extending of Nette\Http\Request class).
For example:
$url = new \Nette\Http\UrlScript("http://nette.org/admin/script.php/pathinfo/?name=param#fragment");
echo $url->basePath; // expected '/admin/', but output is '/'
My suggestions:
You can specify in the constructor the minimum default functionality, suitable for most cases. My simple example:
class UrlScript extends Url
{
...
public function __construct($url = NULL)
{
parent::__construct($url);
$this->scriptPath = $this->path;
}
...
}
With this patch any descendant class of UrlScript (if its instance was created standalone, not from RequestFactory), will have same behavioral as the class Url (in method getBasePath, getRelativeUrl and other).
I cannot use class Nette\HttpUrlScript "smoothly", as standalone (its needed for me for extending of Nette\Http\Request class).
For example:
My suggestions:
You can specify in the constructor the minimum default functionality, suitable for most cases. My simple example:
With this patch any descendant class of UrlScript (if its instance was created standalone, not from RequestFactory), will have same behavioral as the class Url (in method getBasePath, getRelativeUrl and other).