Estructura central
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,10 +4,11 @@ composer.lock
|
||||
|
||||
# Environment
|
||||
.env
|
||||
/config/env/
|
||||
/bootstrap/env/
|
||||
|
||||
# Blade
|
||||
/cache/
|
||||
|
||||
# Uploads
|
||||
/public/uploads/
|
||||
/resources/data/
|
||||
|
57
bootstrap/app.php
Normal file
57
bootstrap/app.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
use DI\ContainerBuilder as Builder;
|
||||
use DI\Bridge\Slim\Bridge;
|
||||
|
||||
require_once 'composer.php';
|
||||
|
||||
$builder = new Builder();
|
||||
|
||||
$folders = [
|
||||
'base',
|
||||
'env'
|
||||
];
|
||||
|
||||
if (isset($__environment)) {
|
||||
$folders []= $__environment;
|
||||
}
|
||||
|
||||
$files = [
|
||||
'config',
|
||||
'setup'
|
||||
];
|
||||
|
||||
foreach ($files as $file) {
|
||||
foreach ($folders as $folder) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
__DIR__,
|
||||
$folder,
|
||||
$file . '.php'
|
||||
]);
|
||||
if (!file_exists($filename)) {
|
||||
continue;
|
||||
}
|
||||
$builder->addDefinitions($filename);
|
||||
}
|
||||
}
|
||||
|
||||
$container = $builder->build();
|
||||
$container->set('env', $__environment);
|
||||
$app = Bridge::create($container);
|
||||
$app->setBasePath($container->get('base_url'));
|
||||
|
||||
foreach ($folders as $folder) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
__DIR__,
|
||||
$folder,
|
||||
'middleware.php'
|
||||
]);
|
||||
if (!file_exists($filename)) {
|
||||
continue;
|
||||
}
|
||||
include_once $filename;
|
||||
}
|
||||
|
||||
include_once implode(DIRECTORY_SEPARATOR, [
|
||||
$container->get('folders.routes'),
|
||||
'router.php'
|
||||
]);
|
8
bootstrap/base/config.php
Normal file
8
bootstrap/base/config.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
return [
|
||||
'language' => 'es',
|
||||
'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'])),
|
||||
'folders.data' => DI\string(implode(DIRECTORY_SEPARATOR, ['{folders.resources}', 'data']))
|
||||
];
|
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'
|
||||
]);
|
24
bootstrap/web/config.php
Normal file
24
bootstrap/web/config.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
return [
|
||||
'folders.templates' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.resources}',
|
||||
'views'
|
||||
])),
|
||||
'folders.cache' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.base}',
|
||||
'cache'
|
||||
])),
|
||||
'urls.assets' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{urls.base}',
|
||||
'assets'
|
||||
])),
|
||||
'urls.styles' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{urls.assets}',
|
||||
'styles'
|
||||
])),
|
||||
'file.visits' => DI\string(implode(DIRECTORY_SEPARATOR, [
|
||||
'{folders.data}',
|
||||
'visitas.json'
|
||||
])),
|
||||
'visits.time' => 12 * 60 * 60
|
||||
];
|
2
bootstrap/web/middleware.php
Normal file
2
bootstrap/web/middleware.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
$app->add(new ProVM\KI\Common\Middleware\Visits($app->getContainer()->get('file.visits'), $app->getContainer()->get('visits.time')));
|
59
bootstrap/web/setup.php
Normal file
59
bootstrap/web/setup.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface as Container;
|
||||
|
||||
return [
|
||||
'urls' => function(Container $c) {
|
||||
return (object) [
|
||||
'base' => $c->get('base_url'),
|
||||
'facebook' => '',
|
||||
'linkedin' => '',
|
||||
'twitter' => '',
|
||||
'youtube' => ''
|
||||
];
|
||||
},
|
||||
'assets' => function(Container $c) {
|
||||
return (object) [
|
||||
'styles' => [
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.css',
|
||||
implode(DIRECTORY_SEPARATOR, [
|
||||
$c->get('urls.styles'),
|
||||
'main.css'
|
||||
])
|
||||
],
|
||||
'fonts' => [
|
||||
'text/css' => [
|
||||
'https://fonts.googleapis.com/css2?family=Roboto:wght@300;900&display=swap',
|
||||
'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'
|
||||
]
|
||||
],
|
||||
'scripts' => [
|
||||
'https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.8.4/semantic.min.js'
|
||||
]
|
||||
];
|
||||
},
|
||||
'visitas' => function(Container $c) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$c->get('folders.data'),
|
||||
'visitas.json'
|
||||
]);
|
||||
$file = json_decode(trim(file_get_contents($filename)));
|
||||
return $file->visits;
|
||||
},
|
||||
Slim\Views\Blade::class => function(Container $c) {
|
||||
return new Slim\Views\Blade(
|
||||
$c->get('folders.templates'),
|
||||
$c->get('folders.cache'),
|
||||
null,
|
||||
[
|
||||
'page_language' => $c->get('language'),
|
||||
'urls' => $c->get('urls'),
|
||||
'assets' => $c->get('assets')
|
||||
]
|
||||
);
|
||||
}
|
||||
];
|
31
composer.json
Normal file
31
composer.json
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "provm/capitalinvestments",
|
||||
"description": "Web para Capital Investments",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"slim/slim": "^4.5",
|
||||
"php-di/slim-bridge": "^3.0",
|
||||
"rubellum/slim-blade-view": "^0.1.1",
|
||||
"nyholm/psr7": "^1.2",
|
||||
"nyholm/psr7-server": "^0.4.1",
|
||||
"nesbot/carbon": "^2.32"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5",
|
||||
"kint-php/kint": "^3.3",
|
||||
"zeuxisoo/slim-whoops": "^0.7.2"
|
||||
},
|
||||
"license": "UNLICENSED",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aldarien",
|
||||
"email": "aldarien85@gmail.com"
|
||||
}
|
||||
],
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ProVM\\KI\\Common\\": "common",
|
||||
"ProVM\\KI\\": "src"
|
||||
}
|
||||
}
|
||||
}
|
4
public/.htaccess
Normal file
4
public/.htaccess
Normal file
@ -0,0 +1,4 @@
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule ^ index.php [QSA,L]
|
47
public/assets/styles/main.css
Normal file
47
public/assets/styles/main.css
Normal file
@ -0,0 +1,47 @@
|
||||
/*body {
|
||||
font-family: Roboto, sans-serif !important;
|
||||
}*/
|
||||
|
||||
.brand {
|
||||
color: #000070 !important;
|
||||
}
|
||||
.inverted.brand {
|
||||
background-color: #000070 !important;
|
||||
color: white !important;
|
||||
}
|
||||
.button.brand {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
header #franja {
|
||||
background-color: #707070;
|
||||
color: white !important;
|
||||
}
|
||||
header #franja .menu {
|
||||
color: inherit !important;
|
||||
}
|
||||
header #franja .menu .spacer {
|
||||
width: 3rem;
|
||||
}
|
||||
header #franja .menu .input {
|
||||
height: 1.3rem !important;
|
||||
}
|
||||
header #franja a {
|
||||
color: inherit;
|
||||
}
|
||||
header .menu {
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
header .menu .logo {
|
||||
font-size: 2rem;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.menu {
|
||||
font-family: inherit !important;
|
||||
}
|
||||
.item {
|
||||
font-family: inherit !important;
|
||||
color: inherit !important;
|
||||
}
|
10
public/index.php
Normal file
10
public/index.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$__environment = 'web';
|
||||
|
||||
require_once realpath(implode(DIRECTORY_SEPARATOR, [
|
||||
dirname(__DIR__),
|
||||
'bootstrap',
|
||||
'app.php'
|
||||
]));
|
||||
|
||||
$app->run();
|
Reference in New Issue
Block a user