I want to extend/change the CHttpRequest class in order to change the "getScriptUrl()"-Function. Is this possible without touching any framework files?
or
Is their a way to put the entry-script into such a directoy structure without having problems?
So what I want is to not have the entry-script (index.php) in the www-root-directory. Currently I get "/yii" when doing -> die(Yii::app()->urlmanager->baseUrl);
I know this is minor, but I like to have this structure. Thanks for any help.
You may want to extend CHttpRequest as usual, then configure the ‘request’ application component as array(‘class’=>‘path.to.components.ExtendedRequest’).
You don’t have to do anything in order to have that specific directory structure. Rename ‘protected’ to ‘application’, and you’re done.
Oh, I didn’t knew I can extend the request component that easy
No the problem is that I have the index.php one directory under the .htaccess file. It came to (controller/action) errors that way because the request-class included the “yii” folder in the scriptUrl (getScriptUrl()-function). I’ve now fixed it like this:
<?php
class HttpRequest extends CHttpRequest
{
private $_scriptUrl;
public function getScriptUrl()
{
$this->_scriptUrl = '/';
return $this->_scriptUrl;
}
}
?>