Auth, Login, Home, Venta->Listados->Precios
This commit is contained in:
45
app/setup/app.php
Normal file
45
app/setup/app.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
use DI\ContainerBuilder;
|
||||
use DI\Bridge\Slim\Bridge;
|
||||
|
||||
require_once 'composer.php';
|
||||
|
||||
function buildApp() {
|
||||
$builder = new ContainerBuilder();
|
||||
$folders = [
|
||||
'settings',
|
||||
'setups'
|
||||
];
|
||||
foreach ($folders as $folder_name) {
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
__DIR__,
|
||||
$folder_name
|
||||
]);
|
||||
if (!file_exists($folder)) {
|
||||
continue;
|
||||
}
|
||||
$files = new FilesystemIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir()) {
|
||||
continue;
|
||||
}
|
||||
$builder->addDefinitions($file->getRealPath());
|
||||
}
|
||||
}
|
||||
$app = Bridge::create($builder->build());
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
__DIR__,
|
||||
'middlewares'
|
||||
]);
|
||||
if (file_exists($folder)) {
|
||||
$files = new FilesystemIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir()) {
|
||||
continue;
|
||||
}
|
||||
require_once $file->getRealPath();
|
||||
}
|
||||
}
|
||||
return $app;
|
||||
}
|
||||
return buildApp();
|
Reference in New Issue
Block a user