How requests are processed
-
A request comes in on the website's domain name
-
If the file exists in the filesystem and is readable, Apache will return it (.htaccess does this)
-
Otherwise, the request is passed to index.php in the root of the website
-
index.php will then include wtSiteConfig.php (also in the root) which defines the site's ID, database, database username and password
-
index.php will then include wtIndex.php from the /wtv2/code directory
-
wtIndex.php will check if the request is for a built in WebTemplate resource (eg file icons, javascript to process forms, etc) and if it is, will return it
-
wtIndex will then include all of the WebTemplate core code (by including wt.php)
-
wtIndex.php will then check if the request is for a WebTemplate command (eg login, add to cart, form submission)
-
wtIndex.php will then parse the uri of the request and pass it onto WebTemplate::outputURIContent (defined in wt.php)
-
WebTemplate::outputURIContent
-
explodes the URI into it's parts
-
if a custom function has been registered to the first part of the URI (with WebTemplate::registerURIHandler), control will be passed to the function
-
if a custom URI processor has been registered, control will be passed to the processor. The processor can modify the URI and then pass control back to WebTemplate
-
will then look for a Page node which corresponds to the URI, if a Page node is found, a Page object for the node is created and it's render method is called
-
If no Page node is found, the 404 page is outputted