Config, setup and bootstrap
This commit is contained in:
32
app/bootstrap/app.php
Normal file
32
app/bootstrap/app.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
function buildApp(): Symfony\Component\Console\Application
|
||||
{
|
||||
$builder = new DI\ContainerBuilder();
|
||||
|
||||
$baseFolder = dirname(__DIR__);
|
||||
$folders = [
|
||||
'configs',
|
||||
'setups'
|
||||
];
|
||||
foreach ($folders as $folderName) {
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [$baseFolder, $folderName]);
|
||||
if (!isset($folder)) {
|
||||
continue;
|
||||
}
|
||||
$files = new FilesystemIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir()) {
|
||||
continue;
|
||||
}
|
||||
$builder->addDefinitions($file->getRealPath());
|
||||
}
|
||||
}
|
||||
|
||||
$app = (new ProVM\Extend\Application())
|
||||
->setContainer($builder->build());
|
||||
return require_once 'commands.php';
|
||||
}
|
||||
|
||||
require_once 'composer.php';
|
||||
|
||||
return buildApp();
|
Reference in New Issue
Block a user