<?php
2
3/**
4 * Módulo padrão para todas as funções, responsável por carregar as classes e incluir funções globais
5 *
6 * @author Lucas/Postali
7 */
8
9define('REQUIRED_PHP_VERSION', '7.1');
10
11define('MAIN_FOLDER', __DIR__);
12
13/**
14 * Nomraliza os separadores de um nome de arquivo
15 * @param string $file Nome do arquivo
16 * @return string
17 */
18function normalizeDirSeparator($file)
19{
20 return preg_replace("/\\/|\\\\/", DIRECTORY_SEPARATOR, $file);
21}
22
23require_once('utils.php');
24
25set_error_handler(
26 function ($errno, $errstr, $errfile, $errline) {
27 throw new Exception($errstr, $errno);
28 }
29);
30
31set_exception_handler(
32 function ($err) {
33 HandlerException($err);
34 }
35);
36
37//Função de carregamento automático das classes
38function _autoload($class)
39{
40 $folders = array(
41 array('Modules', 'Custom'),
42 array('Modules', 'Core'),
43 array('Modules', 'Classes'),
44 array('Controllers'),
45 array('Modules', 'Traits'),
46 array('vendor'),
47 array('Modules', 'Libraries'),
48 array('Modules', 'Interfaces'),
49 array('Models'),
50 array("Scripts")
51 );
52
53 foreach ($folders as $folder) {
54 $file = MAIN_FOLDER . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $folder) . DIRECTORY_SEPARATOR . normalizeDirSeparator($class) . '.php';
55
56 if (file_exists($file)) {
57 //trace("Loading class '$class' from file '$file'", 'main', $class, TRACE_LOW);
58 require_once($file);
59 return;
60 }
61 }
62
63 trace("Class '$class' not found", 'main', $class, TRACE_ERROR);
64 throw new Exception("Class '$class' not found", 1);
65}
66
67//Auto registrar classes
68spl_autoload_register('_autoload');
69
70$composerAutoloadFile = MAIN_FOLDER . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
71
72if (file_exists($composerAutoloadFile))
73 require_once($composerAutoloadFile);
74else
75 Error('The composer autoload is not installed. Run composer install on console');
76
77trace('System ready', 'main', MAIN_FOLDER, TRACE_LOW);
78
You can see detailed error trace in the console.
render ()
/var/www/vidasreais/dev.vidasreais.com.br/index.php 19
_processContent ()
/var/www/vidasreais/dev.vidasreais.com.br/Modules/Core/Navigation/Page.php 402
require ('/var/www/vidasreais/dev.vidasreais.com.br/View/painel-empregador/eventos.php')
/var/www/vidasreais/dev.vidasreais.com.br/Modules/Core/Navigation/Page.php 313
listTipoEventoForEmployer ()
/var/www/vidasreais/dev.vidasreais.com.br/View/painel-empregador/eventos.php 173
{closure} ()
/var/www/vidasreais/dev.vidasreais.com.br/Controllers/Evento/Tipo.php 67
You can see detailed error trace in the console.
main
System ready
'/var/www/vidasreais/dev.vidasreais.com.br'
web
Starting session
true
web
Starting web module
''
Culture
Auto discovering culture
NULL
Culture
Setting culture
'Brasil'
Navigation\Navigation
Setting Navigation default timezone
'America/Sao_Paulo'
Navigation\Navigation
Setting Navigation default language
false
web
User
'216.73.216.133'
Navigation\Navigation
Interpreting URI
'painel-empregador/eventos'
Navigation\Tags
Including asset
'css/painel-empregador/eventos'
Navigation\Tags
Including asset
'vue'
Navigation\Tags
Including asset
'vue/dynamic'
Navigation\Tags
Including asset
'modal'
Navigation\Tags
Including asset
'sistema'
Navigation\Tags
Including asset
'tools'
Navigation\Tags
Including asset
'sweet'
Navigation\Tags
Including asset
'request'
Navigation\Page
Instancing using class 'Evento\Tipo'
'Evento\\Tipo'
Navigation\Page
Incorporating transactional functions from class 'Evento\Tipo'
array ( 0 => 'list', 1 => 'save', 2 => 'remove', )
Navigation\Tags
Including asset
'request'
Navigation\Page
Instancing using class 'Evento\Aberto'
'Evento\\Aberto'
Navigation\Page
Incorporating transactional functions from class 'Evento\Aberto'
array ( 0 => 'list', 1 => 'retrieveEvento', 2 => 'createBeneficios', 3 => 'removeBeneficios', 4 => 'removeSingleBeneficio', 5 => 'payBeneficio', 6 => 'listForEmployer', 7 => 'validationProtocolOrDocument', 8 => 'newEventoAberto', 9 => 'updateEvento', 10 => 'remove', )
Icecream
Executing query
array ( 'query' => 'SELECT empregador_meta.id AS id_meta,empregador_meta.name,empregador_meta.type,empregador_meta.title,empregador_meta.mask,empregador_meta.default,empregador_meta.root FROM empregador_meta WHERE empregador_meta.date_delete IS NULL ORDER BY empregador_meta.sort ', 'params' => array ( ), )
Icecream
Executing query
array ( 'query' => 'SELECT empregador_meta_options.id,empregador_meta_options.id_meta,empregador_meta_options.title,empregador_meta_options.name FROM empregador_meta_options WHERE empregador_meta_options.date_delete IS NULL AND empregador_meta_options.id_meta IN (\'25\',\'24\',\'23\',\'26\',\'1\',\'2\',\'5\',\'6\',\'7\',\'8\',\'10\',\'11\',\'12\',\'13\',\'14\',\'21\',\'20\',\'15\',\'22\',\'16\',\'27\',\'28\',\'29\',\'17\') ', 'params' => array ( ), )