EXCEPTION

Trying to access array offset on value of type bool

/var/www/vidasreais/dev.vidasreais.com.br/main.php 36

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
$composerAutoloadFile MAIN_FOLDER DIRECTORY_SEPARATOR 'vendor' DIRECTORY_SEPARATOR 'autoload.php';
26
27if (
file_exists($composerAutoloadFile)){
28    require_once(
$composerAutoloadFile);
29}
30else{
31    
Error('The composer autoload is not installed. Run composer install on console');
32}
33
34
set_error_handler(
35    function (
$errno$errstr$errfile$errline) {
36        throw new Exception($errstr$errno);

37    }
38);
39
40
set_exception_handler(
41    function (
$err) {
42        
HandlerException($err);
43    }
44);
45
46
//Função de carregamento automático das classes
47
function _autoload($class)
48{
49    
$folders = array(
50        array(
'Modules''Custom'),
51        array(
'Modules''Core'),
52        array(
'Modules''Classes'),
53        array(
'Controllers'),
54        array(
'Modules''Traits'),
55        array(
'vendor'),
56        array(
'Modules''Libraries'),
57        array(
'Modules''Interfaces'),
58        array(
'Models'),
59        array(
"Scripts")
60    );
61
62    foreach (
$folders as $folder) {
63        
$file MAIN_FOLDER DIRECTORY_SEPARATOR implode(DIRECTORY_SEPARATOR$folder) . DIRECTORY_SEPARATOR normalizeDirSeparator($class) . '.php';
64
65        if (
file_exists($file)) {
66            
//trace("Loading class '$class' from file '$file'", 'main', $class, TRACE_LOW);
67            
require_once($file);
68            return;
69        }
70    }
71
72    
trace("Class '$class' not found"'main'$classTRACE_ERROR);
73    throw new 
Exception("Class '$class' not found"1);
74}
75
76
//Auto registrar classes
77
spl_autoload_register('_autoload');
78
trace('System ready''main'MAIN_FOLDERTRACE_LOW);
79

Error trace

You can see detailed error trace in the console.

System trace

You can see detailed error trace in the console.