eZ publish Enterprise Component: Http, Design ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Introduction ============ Purpose of the Http package --------------------------- A set of classes providing misc HTTP-related functionality, such as parsing URLs and handling file downloads. Requirements ============ The component should provide the follwing functionality: 1. Extracting URL parts. 2. Adding previously specified prefix to an URI. 3. Handling of file download by passing the file trough PHP (passthru). Design ====== The required functionality is split across several independant classes described below. ezcHttpUrl ---------- URL handling class. Serves two needs: - URL parsing. - Prepending specified URIs with previously set prefix. URL parsing ``````````` Functionality for fetching host, port, uri, script path, script name, script parameters, anchor from the given URL. Prepending URI prefix ````````````````````` It's often needed to have internal links on your pages without depending on a specific directory structure. For example, you would like to display a link to internal URI '/company/contacts'. If your site is located under '/mysite', the link would be '/mysite/company/contants'. To not hardcode site directory prefix in all the links, you can set the prefix with ezcHttpUrl::addPrefix() and the easily prepend it to any link with ezcHttpUrl::prepend(). ezcHttpPassthrough ------------------ Passes specified file through to client browser, genereating the appropriate HTTP response headers.