33 lines
801 B
PHP
33 lines
801 B
PHP
<?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();
|