Quote Originally Posted by Selkirk
The current WACT template implementation does not require a deployment phase because the templates are compiled automatically on demand. Could a code generation technique applied to front controllers & intercepting filters also avoid requiring a Deployment Phase?
Think it can be done automatically (fully automatic on Apache by using the 404 trick).

For a page controller which hasn't actually been deployed yet, this might happen;

1. User requests http://www.example.com/example_page.php

2. Apache finds page doesn't exist, calls 404 hander deployer.php

3. deployer.php copies /home/username/deploy/example_page.php to /home/username/www/example_page.php (adding necessary mods for front controller)

4. Page is served

5. User requests http://www.example.com/example_page.php again.

6. example_page.php (or some included code) checks the modification time on /home/username/deploy/example_page.php and compares with itself - updates if needed.

8. Latest version is executed

9. Page is served

Something like that. For users unable to modify their server's 404 handler, the initial deployment would need to be manually invoked but after that, no problem.

Whether this is a good idea though, not sure. Some things that might be problematic;

Confusing to develop with - you place your script in a different directory to the one it will actually be executed from - might make includes etc. mind boggling.

Easy to break(?). A script which "updates itself" may not be a pretty thing.