Take a queue from Frameworks. Look into CakePHP if you're not sure how they work. It requires a single PHP file within the document root (index.php) and everything else can be stored in a separate location.
How do you plan to maintain the subdomains? At this time, DH does not allow automated creation of subdomains.
yerba# rm -rf /etc