kohana/kohana — pull request #46 by acoulton (2014-08-13 09:55:57+00:00)
Title: [WIP Proposal] Extract bootstrapping from index.php, handle all in bootstrap.php

There is currently no clear separation between index.php and bootstrap.php - both files have to be run to bootstrap a complete environment, but loading index.php then always attempts to run either a web request or a
minion task.

This means the bit of bootstrapping that happens in index.php has to be partially duplicated in the unittest module and also in any end-user projects that want to make the kohana environment available to other CLI or web tools (eg PHPUnit, Behat, Doctrine, etc). This causes maintenance issues if the default path structure changes, or if you want to use a non-standard directory layout. It additionally makes it more tricky than it should be to move the index.php down to an explicit web document root for security. I explained the issue more in http://dev.kohanaframework.org/issues/4777 last year.

I'd appreciate feedback/agreement on this proposal before I finish off making the required changes to unittest and minion to support it.