You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
The current index.php does several things as the common entry point to the application:
Defines application, module and system paths
Sets error reporting
Defines profiling constants
Includes the application bootstrap
Executes a Minion task if used from the CLI
Otherwise executes a web request
The result is that neither index.php nor application/bootstrap.php can bootstrap the application on their own, and it is impossible to include the Kohana environment in any non-Minion CLI tool (PHPUnit, Behat, Doctrine, etc) without duplicating the index.php definitions.
Though less significant, this also makes it more tricky than necessary to move the index.php down to an explicit web document root for security - all the path definitions in index.php have to be updated and you also cannot use the stock unittest bootstrap which forces a standard (index.php at root) layout.
I propose that for 3.4 we tidy up this structure so that:
All definitions and bootstrapping code moves from index.php to application/bootstrap.php
index.php becomes a very tiny file that includes application/bootstrap.php and then executes a web request
The minion task runner binary similarly includes application/bootstrap.php and then executes the minion task
The unittest bootstraps can be tidied up to remove the index.php definitions code that they currently duplicate
This would make the structure neater with more clearly defined responsibilities, and make it much simpler to use the Kohana environment in other contexts. It would also mean that if moving the index.php within an otherwise standard Kohana folder structure the only required change would be to update the require 'application/bootstrap.php' that would now be the first line in index.php.
The current index.php does several things as the common entry point to the application:
The result is that neither index.php nor application/bootstrap.php can bootstrap the application on their own, and it is impossible to include the Kohana environment in any non-Minion CLI tool (PHPUnit, Behat, Doctrine, etc) without duplicating the index.php definitions.
Though less significant, this also makes it more tricky than necessary to move the index.php down to an explicit web document root for security - all the path definitions in index.php have to be updated and you also cannot use the stock unittest bootstrap which forces a standard (index.php at root) layout.
I propose that for 3.4 we tidy up this structure so that:
This would make the structure neater with more clearly defined responsibilities, and make it much simpler to use the Kohana environment in other contexts. It would also mean that if moving the index.php within an otherwise standard Kohana folder structure the only required change would be to update the
require 'application/bootstrap.php'
that would now be the first line in index.php.http://dev.kohanaframework.org/issues/4777
The text was updated successfully, but these errors were encountered: