This repository has been archived by the owner on Mar 14, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bootstrap.php returns DI container and index.php runs the application
- Loading branch information
Showing
2 changed files
with
7 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
<?php | ||
|
||
// uncomment this line if you must temporarily take down your site for maintenance | ||
// Uncomment this line if you must temporarily take down your site for maintenance. | ||
// require '.maintenance.php'; | ||
|
||
// load bootstrap file | ||
require __DIR__ . '/../app/bootstrap.php'; | ||
// Let bootstrap create Dependency Injection container. | ||
$container = require __DIR__ . '/../app/bootstrap.php'; | ||
|
||
// Run application. | ||
$container->application->run(); |
a62ff78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Great to see this! I wanted to propose this change for some time but have never find a moment to write down my reasoning.
a62ff78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what is your reason? ;)
a62ff78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bootstrapping (preparing) the whole application but not executing it's default entry point. That's useful for
The approach is similar to Misko's main() method - which is
index.php
in our casea62ff78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I have the same reasons.
a62ff78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just great! 👍