Permalink
Browse files

Versión v2.0.0 Estable

  • Loading branch information...
prinick96 committed Aug 25, 2017
1 parent a19c8fa commit 5d9cb67cd1a8ac43c9686581a8e674939a8677a1
Showing 3,262 changed files with 151,973 additions and 158,997 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -0,0 +1 @@
/app/templates/.cache/**/*.php
@@ -1,15 +1,16 @@
<FilesMatch "(\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|json|lock|swp|py|xml|phtml|g)|~)$">
<Files .htaccess>
Order allow,deny
Deny from all
</Files>

<FilesMatch "(\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|json|lock|swp|xml|twig|gitignore|yml|md)|~)$">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

<Files .htaccess>
Order allow,deny
Deny from all
</Files>

RewriteEngine On
# RerwiteBase / # 1&1 host y derviados que presenten problemas con el Router
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
RewriteRule ^(.*)$ index.php?routing=$1 [QSA,L]
@@ -0,0 +1,9 @@
version: 2.0.0
package: Ocrend Framework 2
doc: http://framework.ocrend.com
github: http://github.com/prinick96/Ocrend-Framework
programmers:
author: Brayan Narváez
email: prinick@ocrend.com
comments: "Desarrollo de software para web a medida."
web: http://www.ocrend.com
File renamed without changes.
@@ -0,0 +1 @@
Deny from all
@@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Ocrend Framewok 2 package.
*
* (c) Ocrend Software <info@ocrend.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Ocrend\Kernel\Config;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Yaml\Exception\ParseException;
/**
* Inicializa la configuración del sistema.
*
* @author Brayan Narváez <prinick@ocrend.com>
*/
final class Config {
/**
* Ruta con parámetros de configuración
*
* @var string
*/
const FILE_CONFIG_ROUTE = API_INTERFACE . 'Ocrend/Kernel/Config/Ocrend.ini.yml';
/**
* Lee la configuración del archivo self::FILE_CONFIG_ROUTE
*
* @return array : Arreglo con la configuración en el archivo .yml
*/
final public function readConfig() : array {
return Yaml::parse(file_get_contents(self::FILE_CONFIG_ROUTE));
}
}
@@ -0,0 +1,44 @@
# This file is part of the Ocrend Framewok 2 package.
#
# (c) Ocrend Software <info@ocrend.com>
#
# For the full copyright and license information, please view the LICENS
# file that was distributed with this source code.

# Conexión con la base de datos principal
database:
host: localhost
user: root
pass:
name: ocrend
port: 1521
protocol: TCP
motor: mysql

# Configuración de servidor SMTP
phpmailer:
host:
user:
pass:
port: 465

# Configuración de sesiones
sessions:
unique: 0CR3ND2017
life_time: 3600

# Variables del framework
framework:
debug: false
version: 2.0.0

# Configuración del sitio
site:
name: Ocrend Framework 2
author: Brayan Narváez
author_email: prinick@ocrend.com
timezone: America/Caracas
url: http://localhost/Ocrend-Framework/
router:
path: localhost/Ocrend-Framework/
protocol: http
@@ -0,0 +1,94 @@
<?php
/*
* This file is part of the Ocrend Framewok 2 package.
*
* (c) Ocrend Software <info@ocrend.com>
* @author Brayan Narváez <prinick@ocrend.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Ocrend\Kernel\Config\Config;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\ExceptionHandler;
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\Debug\Debug;
/**
* Lanzador inicial del sistema.
*
* @author Brayan Narváez <prinick@ocrend.com>
*/
//---------------------------------------------------------------------------------------------
/**
* Manejador de excepciones y errores
*/
ErrorHandler::register();
ExceptionHandler::register();
//---------------------------------------------------------------------------------------------
/**
* Versión mínima de PHP
*/
if (version_compare(phpversion(), '7.0.0', '<')) {
throw new \RuntimeException('La versión actual de PHP es ' . phpversion() . ' y como mínimo se require la versión 7.0.0');
}
//---------------------------------------------------------------------------------------------
/**
* Lectura y escritura de caché para Twig
*/
if(!is_writable(API_INTERFACE . 'app/templates/.cache/') || !is_readable(API_INTERFACE . 'app/templates/.cache/')) {
throw new \RuntimeException('Debe conceder permisos de escritura y lectura a la ruta ' . API_INTERFACE . 'app/templates/.cache/ ó crearla si no existe.');
}
//---------------------------------------------------------------------------------------------
/**
* Obtiene la configuración inicial del sistema, conexión a la base de datos,
* constantes de phpmailer, credenciales de la api de paypal, etc.
*/
$config = (new Config)->readConfig();
//---------------------------------------------------------------------------------------------
/**
* Capa orientada a objetos para el uso de sesiones más seguras en PHP
*/
$session = new Session(new NativeSessionStorage(
array(
'cookie_lifetime' => $config['sessions']['life_time']
)
));
$session->start();
//---------------------------------------------------------------------------------------------
/**
* Capa orientada a objetos de HTTPFoundation
*/
$http = Request::createFromGlobals();
//---------------------------------------------------------------------------------------------
/**
* Estatus del DEBUG
*/
if($config['framework']['debug']) {
Debug::enable();
}
//---------------------------------------------------------------------------------------------
/**
* Define el timezone actual
*/
date_default_timezone_set($config['site']['timezone']);
Oops, something went wrong.

0 comments on commit 5d9cb67

Please sign in to comment.