Bosquejo
This commit is contained in:
50
bootstrap/app.php
Normal file
50
bootstrap/app.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
use DI\ContainerBuilder as Builder;
|
||||
use DI\Bridge\Slim\Bridge;
|
||||
|
||||
include_once 'composer.php';
|
||||
|
||||
$builder = new Builder();
|
||||
$folders = ['common'];
|
||||
if (isset($__environment)) {
|
||||
$folders []= $__environment;
|
||||
}
|
||||
|
||||
$files = [
|
||||
'config',
|
||||
'setup'
|
||||
];
|
||||
foreach ($folders as $folder) {
|
||||
foreach ($files as $file) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
__DIR__,
|
||||
$folder,
|
||||
$file . '.php'
|
||||
]);
|
||||
if (file_exists($filename)) {
|
||||
$builder->addDefinitions($filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$container = $builder->build();
|
||||
$app = Bridge::create($container);
|
||||
$app->setBasePath($container->get('urls.base'));
|
||||
$app->addRoutingMiddleware();
|
||||
$app->addErrorMiddleware(true, true, true);
|
||||
|
||||
foreach ($folders as $folder) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
__DIR__,
|
||||
$folder,
|
||||
'middleware.php'
|
||||
]);
|
||||
if (file_exists($filename)) {
|
||||
include_once $filename;
|
||||
}
|
||||
}
|
||||
|
||||
include_once implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.routes'),
|
||||
'router.php'
|
||||
]);
|
13
bootstrap/common/config.php
Normal file
13
bootstrap/common/config.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
return [
|
||||
'urls.base' => '/provm/totalsport',
|
||||
'folders.base' => dirname(__DIR__, 2),
|
||||
'folders.resources' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.base}',
|
||||
'resources'
|
||||
])),
|
||||
'folders.routes' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.resources}',
|
||||
'routes'
|
||||
]))
|
||||
];
|
6
bootstrap/composer.php
Normal file
6
bootstrap/composer.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
require_once implode(DIRECTORY_SEPARATOR, [
|
||||
dirname(__DIR__),
|
||||
'vendor',
|
||||
'autoload.php'
|
||||
]);
|
68
bootstrap/web/config.php
Normal file
68
bootstrap/web/config.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
return [
|
||||
'folders.cache' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.resources}',
|
||||
'cache'
|
||||
])),
|
||||
'folders.templates' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.resources}',
|
||||
'views'
|
||||
])),
|
||||
'folders.data' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.resources}',
|
||||
'data'
|
||||
])),
|
||||
'urls' => [
|
||||
'base' => DI\string('{urls.base}'),
|
||||
'assets' => DI\string(implode('/', [
|
||||
'{urls.base}',
|
||||
'assets'
|
||||
])),
|
||||
'styles' => DI\string(implode('/', [
|
||||
'{urls.base}',
|
||||
'assets',
|
||||
'styles'
|
||||
])),
|
||||
'servicios' => DI\string(implode('/', [
|
||||
'{urls.base}',
|
||||
'servicios'
|
||||
])),
|
||||
'eventos' => DI\string(implode('/', [
|
||||
'{urls.base}',
|
||||
'eventos'
|
||||
])),
|
||||
'map' => 'https://maps.google.com/maps?hl=es&q=Avenida%20Nueva%20Providencia%201945,%20Providencia&ie=UTF8&z=16&iwloc=B&output=embed'
|
||||
],
|
||||
'assets' => [
|
||||
'styles' => [
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.css',
|
||||
DI\string(implode('/', [
|
||||
'{urls.base}',
|
||||
'assets',
|
||||
'styles',
|
||||
'main.css'
|
||||
])),
|
||||
DI\string(implode('/', [
|
||||
'{urls.base}',
|
||||
'assets',
|
||||
'styles',
|
||||
'header.css'
|
||||
]))
|
||||
],
|
||||
'scripts' => [
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.js'
|
||||
],
|
||||
'fonts' => (object) [
|
||||
'text/css' => [
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/brand-icons.woff',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/brand-icons.woff2',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/icons.woff',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/icons.woff2',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/outline-icons.woff',
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/themes/default/assets/fonts/outline-icons.woff2',
|
||||
'https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;900&display=swap'
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
16
bootstrap/web/setup.php
Normal file
16
bootstrap/web/setup.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
|
||||
return [
|
||||
Slim\Views\Blade::class => function(Container $c) {
|
||||
return new Slim\Views\Blade(
|
||||
$c->get('folders.templates'),
|
||||
$c->get('folders.cache'),
|
||||
null,
|
||||
[
|
||||
'urls' => (object) $c->get('urls'),
|
||||
'assets' => (object) $c->get('assets')
|
||||
]
|
||||
);
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user