-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
917f8f5
commit 8b8b995
Showing
1 changed file
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
use Phoundation\Bootstrap\Bootstrap; | ||
use Phoundation\Config\Loader\StaticConfigLoader; | ||
use Phoundation\Di\Container\Factory\ZendServiceManagerFactory; | ||
use Phoundation\ErrorHandling\Handler\LogHandler; | ||
use Phoundation\ErrorHandling\RunnerInterface; | ||
use Phoundation\ErrorHandling\WhoopsRunner; | ||
use Psr\Container\ContainerInterface; | ||
use Psr\Log\NullLogger; | ||
use Whoops\Run; | ||
|
||
$config = [ | ||
'db' => [ | ||
'dsn' => 'mysql:dbname=test;host=127.0.0.1', | ||
'user' => 'root', | ||
'password' => 'secret', | ||
], | ||
'di' => [ | ||
'factories' => [ | ||
//automatically registered during bootstrap | ||
RunnerInterface::class => function () { | ||
$runner = new WhoopsRunner(new Run()); | ||
$runner->pushHandler(new LogHandler(new NullLogger())); | ||
|
||
return $runner; | ||
}, | ||
] | ||
], | ||
]; | ||
|
||
$bootstrap = new Bootstrap( | ||
new StaticConfigLoader($config), | ||
new ZendServiceManagerFactory() | ||
); | ||
/* @var $diContainer ContainerInterface */ | ||
$diContainer = $bootstrap(); | ||
|
||
assert($diContainer->has(RunnerInterface::class)); |