EXCEPTION

Undefined index: title

/var/www/homologacao.gazinsemijoias.com.br/main.php 27

1 <?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
9
define('REQUIRED_PHP_VERSION', '7.1');
10
11
define('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 */
18
function normalizeDirSeparator($file)
19{
20    return 
preg_replace("/\\/|\\\\/", DIRECTORY_SEPARATOR, $file);
21}
22
23require_once(
'utils.php');
24
25
set_error_handler(
26    function (
$errno, $errstr, $errfile, $errline) {
27        throw new Exception($errstr, $errno);

28    }
29);
30
31
set_exception_handler(
32    function (
$err) {
33        
HandlerException($err);
34    }
35);
36
37
//Função de carregamento automático das classes
38
function _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    );
51
52    foreach (
$folders as $folder) {
53        
$file = MAIN_FOLDER . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $folder) . DIRECTORY_SEPARATOR . normalizeDirSeparator($class) . '.php';
54
55        if (
file_exists($file)) {
56            
//trace("Loading class '$class' from file '$file'", 'main', $class, TRACE_LOW);
57            
require_once($file);
58            return;
59        }
60    }
61
62    
trace("Class '$class' not found", 'main', $class, TRACE_ERROR);
63    throw new 
Exception("Class '$class' not found", 1);
64}
65
66
//Auto registrar classes
67
spl_autoload_register('_autoload');
68
69
$composerAutoloadFile = MAIN_FOLDER . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
70
71if (
file_exists($composerAutoloadFile))
72    require_once(
$composerAutoloadFile);
73else
74    
Error('The composer autoload is not installed. Run composer install on console');
75
76
trace('System ready', 'main', MAIN_FOLDER, TRACE_LOW);

Error trace

You can see detailed error trace in the console.

System trace

You can see detailed error trace in the console.