eZ component: Url, Requirements ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Author: Alexandru Stanoi :Revision: $Revision: $ :Date: $Date: $ Introduction ============ Description ----------- This component will provide support for handling urls. The applications that use the url component can create urls, can modify query arguments, can extract the basedir. The query arguments are urlencoded to protect against attacks with sql injection. Current implementation ---------------------- The current implementation of the Url component has functionality similar to the eZ publish 3.x url handling. ezcUrl is the only class in the package. Requirements ============ Provide these functionalities: - Create a url from scratch or from a string url. - System urls (eg. http://www.example.com/index.php/content/edit/13/3/) and virtual urls (eg. http://www.example.com/company/about/) are supported. - Query arguments can be extracted from and inserted into the url (eg. '?search=foo&lang=en' or '/content/view/article/42/mode/print'). - Query arguments are urlencoded/urldecoded. - Support relative urls. - List of prefixes (eg. 'images' => '/media/pictures') to be prepended to filenames so the full path is not specified everytime. - List of basedirs (eg. 'ex' => 'www.example.com/mydir') to be prepended to filenames so the basedir is not specified everytime. - Extract the basedir from the current location. - Remove the basedir from the current location (eg. from 'http://www.example.com/shop/products/10' return 'products/10'). Design goals ============ The url passed to the constructor is parsed (broken down into parts) with the php function parse_url(), and it is reconstructed with the __toString() method. A static array holds prefixes (eg. 'images' => '/media/pictures'). Another static array holds the basedirs (eg. 'ex' => 'http://www.example.com/mydir'). .. Local Variables: mode: rst fill-column: 79 End: vim: et syn=rst tw=79