EXCEPTION

Trying to access array offset on value of type bool

/var/www/bensocial/dev.bensocial.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        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'$classTRACE_ERROR);
64    throw new 
Exception("Class '$class' not found"1);
65}
66
67
//Auto registrar classes
68
spl_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
77
trace('System ready''main'MAIN_FOLDERTRACE_LOW);
78

Error trace

You can see detailed error trace in the console.

System trace

You can see detailed error trace in the console.