How a request is handled
- Apache receives the request from the User Agent (a Web browser like Firefox or Internet Explorer)
- Apache's mod_rewrite calls AWF's index.php, because of the RewriteRule defined in the .htaccess file located in the main directory
- AWF's inc/sessions.inc cares about starting a PHP session (global $_SESSION array) and imports URL parameters into the $_GET array
- If no user is logged in, inc/caching.inc looks for a valid cache file in cache/awf/ (full-page caching)
- If it finds one, the page will be served and the request ends at this point
- If not, the class library in inc/classes.inc is included (just the most important classes are defined there; the rest is included on demand using PHP's autoloading feature)
- inc/config.inc creates an instance of the AWF class ($awf) and calls it's init method $awf->init()
- AWF loads the config from the file inc/config.ini, starts the database connection and creates an instance of all required classes:
- AWF_Sites (determines the current site - sets constants according to the site configuration)
- AWF_Designs (cares about loading the right design files and templates)
- AWF_Languages (looks up, which languages/charsets are available and will be used for this page; loads language files located in inc/lang/)
- AWF_ContentManager (creates an instance of all AWF_ContentContainer classes located in inc/classes/containers/)
- AWF then calls AWF_ContentManager::handle_request() which asks the Content Containers if they can handle the current request
- If not, the Error 404 page located in templates/errors/ is displayed
- If yes, inc/output.inc calls $awf->cms->output_page()
- The content manager then retrieves the requested content by calling AWF_ContentContainer::get_requested_content() (Smarty/Raw) or AWF_ContentContainer::get_requested_content_as_array() (XML)
- Depending on the request type, the content manager outputs the content using a Smarty Template (XHTML/HTML/WML), as XML or directly as raw data (used for images, for example)
- inc/shutdown.inc appends a line to the log file in sites/[site short name]/logs/YYYY_MM.log and creates a cache file, if caching is enabled
- The PHP session is closed
Created: 09.01.2006 04:10 CET, Last Change: 09.01.2006 15:11 CET by admin





