1
|
|
|
<?php |
|
|
|
|
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
5
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
6
|
|
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
7
|
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
8
|
|
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
9
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
10
|
|
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
11
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
12
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
13
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
14
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
15
|
|
|
* |
16
|
|
|
* This software consists of voluntary contributions made by many individuals |
17
|
|
|
* and is licensed under the MIT license. For more information, see |
18
|
|
|
* @category |
19
|
|
|
* @package sistema/nucleo |
20
|
|
|
* @copyright Copyright (c) 2006 - 2014 webcol.net (http://www.webcol.net/calima) |
21
|
|
|
* @license https://github.com/webcol/Calima/blob/master/LICENSE MIT |
22
|
|
|
* @version ##BETA 1.0##, ##2014 - 2015## |
23
|
|
|
* <http://www.calimaframework.com>. |
24
|
|
|
*/ |
25
|
|
|
|
26
|
|
|
|
27
|
|
|
//verificamos la version de php en tu servidor web o local |
28
|
|
|
if (version_compare(PHP_VERSION, '5.3.20', '<')) |
29
|
|
|
{ |
30
|
|
|
die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
//Cargamos los Espacios de nombres para el nucleo y los ayudantes |
34
|
|
|
//Utilizamos un alias |
35
|
|
|
use Sistema\Nucleo as Sisnuc; |
36
|
|
|
use Sistema\Ayudantes as Sisayu; |
37
|
|
|
|
38
|
|
|
|
39
|
|
|
class dataControlador extends Sisnuc\CFControlador |
40
|
|
|
{ |
41
|
|
|
private $_exc; |
|
|
|
|
42
|
|
|
private $_ayuda; |
43
|
|
|
private $_seg; |
44
|
|
|
private $_sesion; |
45
|
|
|
|
46
|
|
View Code Duplication |
public function __construct() { |
47
|
|
|
parent::__construct(); |
48
|
|
|
|
49
|
|
|
$this->_ayuda= new Sisayu\CFPHPAyuda; |
50
|
|
|
//$this->cargaAyudante('CfPHPAyuda'); |
51
|
|
|
//$this->cargaAyudante('CfPHPSeguridad'); |
52
|
|
|
$this->_seg= new Sisayu\CfPHPSeguridad; |
53
|
|
|
|
54
|
|
|
$this->_sesion=new Sisnuc\CFSesion(); |
55
|
|
|
|
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function index() |
|
|
|
|
59
|
|
|
{ |
60
|
|
|
// Se verifica que en el archivo de configuracion.php la constante Cf_CONFIG_INICIO==true |
61
|
|
|
//Si esta en True se lanza el instalador de Cf |
62
|
|
|
if(Cf_CONFIG_INICIO==true){ |
|
|
|
|
63
|
|
|
$this->_sesion->iniciarSesion('_s', false); |
64
|
|
|
if($_SESSION['nivel']==1){ |
65
|
|
|
$this->_vista->titulo = 'CalimaFramework'; |
|
|
|
|
66
|
|
|
$this->_vista->imprimirVista('index', 'data'); |
|
|
|
|
67
|
|
|
}else{ |
68
|
|
|
$this->_ayuda->redireccionUrl('usuario'); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
}elseif (Cf_CONFIG_INICIO=='false') { |
72
|
|
|
|
73
|
|
|
$this->_vista->titulo = 'CalimaFramework'; |
74
|
|
|
$this->_vista->imprimirVista('index', 'data'); |
|
|
|
|
75
|
|
|
|
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
} |
The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.
The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.
To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.