VWCV site dev guide
Background
Section titled “Background”The site is not a content management system, it is not even a fully dynamic site. Any content updates require technical changes. This section of Doclab provides the context for that.
The VWCV site was inherited from a previous agency in early 2009. The way the site is architected poses a number of challenges when applying updates or changes. Chief amongst these is that the main business operation of the site – ongoing content updates and changes – is not addressed by the solution delivered.
The entire site needs to be rebuilt to make it suitable for purpose. However, in the meantime we must operate the existing platform. This guide provides technical information to help in that. It is designed for technical developers wworking on the site and that have a background in:
- PHP
- SQL
- HTML / CSS
Site Architecture
Section titled “Site Architecture”Application architecture
Section titled “Application architecture”Introduction
Section titled “Introduction”The application is PHP based and uses the fusebox framework. It is hosted across several environments for staging and production. These sit on Windows and Redhat, with RDBMS across SQL Server and MySQL.
Fusebox
Section titled “Fusebox”Fusebox is a PHP framework based on the Front Controller pattern. Fusebox was originally developed for Coldfusion and PHP and is so-called as it emulates the way electrical systems work in buildings. I.e., a fusebox distributing power via various circuits. Fusebox has the concepts of circuits and actions. Fusebox has since been ported over to several other technologies including ASP.
Front Controller design pattern
Section titled “Front Controller design pattern”This pattern can be thought of in terms of an office building. An order request arrives to a reception area and is rooted to one of several rooms. The order is packed then sent out via reception to the address it was sent from.
Fusebox concepts
Section titled “Fusebox concepts”Circuits
Section titled “Circuits”A circuit is a set of related functionalities. A circuit usually maps to a subdirectory and contains fuses.
Actions
Section titled “Actions”Also known as a fuseaction, an action is a method or function within a circuit.
A fuse is a small file responsible for performing a simple action
[diagram pending]
URL format
Section titled “URL format”Incoming URLs contain two main variables: these are circuit and action. For example: ../a/b will be rewritten as …action=b.a This is then accessible within the system as:
$Fusebox['circuit'] and $Fusebox['action']
URL processing
Section titled “URL processing”An inbound URL is processed in the following way:
- Convert URL to required format
- Look up the required circuit using fbx_circuits.php
- Navigate to the subfolder for that circuit
- Resolve actions to the correct parts of the circuit using fbx_switch.php
- fbx_switch.php will determine what actions to take and the resources required
Structural redirect example
Section titled “Structural redirect example”Rules for external callbacks
Section titled “Rules for external callbacks”RewriteRule ^external/send-brochure/([a-zA-Z0-9_]+)/title/(.*)/name/(.*)/surname/(.*)/emailstatus/([a-zAZ0-9_]+)/email/(.*)?$ index.php?action=external.sendbrochure&brochure=$1&title=$2&name=$3&surname=$4&emailstatus=$5&email=$6 [L]
Hosting environment
Section titled “Hosting environment”The hosting environment is standard for low-mid level traffic. It consists of production, staging, integration test, and development. Production, staging, and integration tests are mirrored in VWCV and iris infrastructures.