Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Proposals (Political/Workflow) #570

Open
sandeepone opened this issue Nov 7, 2013 · 1 comment
Open

Proposals (Political/Workflow) #570

sandeepone opened this issue Nov 7, 2013 · 1 comment
Assignees

Comments

@sandeepone
Copy link
Member

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.

http://dev.kohanaframework.org/issues/4777

@sergeyklay
Copy link
Contributor

👍 I've thought about it. Yes, it's a good idea

@ghost ghost assigned sandeepone Nov 9, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants