<?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 );
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
67spl_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
76trace('System ready', 'main', MAIN_FOLDER, TRACE_LOW);
You can see detailed error trace in the console.
render ()
/var/www/homologacao.gazinsemijoias.com.br/index.php 19
_processContent ()
/var/www/homologacao.gazinsemijoias.com.br/Modules/Core/Navigation/Page.php 401
require ('/var/www/homologacao.gazinsemijoias.com.br/View/produtos.php')
/var/www/homologacao.gazinsemijoias.com.br/Modules/Core/Navigation/Page.php 310
verifySEOCategory ()
/var/www/homologacao.gazinsemijoias.com.br/View/produtos.php 22
{closure} ()
/var/www/homologacao.gazinsemijoias.com.br/Controllers/Produtos.php 554
You can see detailed error trace in the console.
main
System ready
'/var/www/homologacao.gazinsemijoias.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.208'
Navigation\Navigation
Interpreting URI
'produtos/embalagens'
Navigation\Page
Instancing using class 'Pagina'
'Pagina'
Navigation\Page
Instancing using class 'ShopperMethod\Shopper'
'ShopperMethod\\Shopper'
Navigation\Tags
Including asset
'getnet/payment'
Navigation\Tags
Including asset
'vue'
Navigation\Tags
Including asset
'tools'
Navigation\Tags
Including asset
'assembler'
Navigation\Tags
Including asset
'shopper'
Navigation\Page
Incorporating transactional functions from class 'ShopperMethod\Shopper'
array ( 0 => 'listCustomerDatatable', 1 => 'saveCustomer', 2 => 'createCustomer', 3 => 'removeCustomer', 4 => 'customerLogin', 5 => 'customerLogout', 6 => 'customerCreate', 7 => 'customerRecoverPassword', 8 => 'customerResetPassword', 9 => 'getCustomerOrders', 10 => 'getDiscounts', 11 => 'retrieveByID', 12 => 'listAllDiscounts', 13 => 'saveDiscount', 14 => 'removeDiscount', 15 => 'cartRemoveItem', 16 => 'cartRemoveTransport', 17 => 'cartAddItem', 18 => 'cartUpdateOrder', 19 => 'cartAddCoupon', 20 => 'cartRemoveCoupon', 21 => 'cartPaymentMethods', 22 => 'cartTransportMethods', 23 => 'cartProcessPayment', 24 => 'addToWishlist', 25 => 'removeFromWishlist', 26 => 'listWishlist', )
Navigation\Tags
Including asset
'modal'
Navigation\Page
Incorporating transactional functions from class 'Pagina'
array ( 0 => 'saveNewsletter', 1 => 'contato', 2 => 'trabalheConosco', 3 => 'getBanners', 4 => 'getBannersQuadrados', 5 => 'getBannersParallax', )
Navigation\Page
Won't re-instance using class 'ShopperMethod\Shopper'
'ShopperMethod\\Shopper'
Navigation\Tags
Including asset
'modal'
Navigation\Tags
Asset doesn't exist
'css/produtos/bundle'
Navigation\Tags
Including asset
'vue/dynamic'
Navigation\Tags
Including asset
'shopper/components/item/bundle'
Navigation\Tags
Including asset
'components/produtos/bundle'
Navigation\Tags
Including asset
'components/produto-view/bundle'
Navigation\Page
Instancing using class 'ShopperMethod\Catalog'
'ShopperMethod\\Catalog'
Navigation\Page
Incorporating transactional functions from class 'ShopperMethod\Catalog'
array ( 0 => 'listItems', 1 => 'getAllCategories', 2 => 'getRandomItems', 3 => 'getHighlightItems', 4 => 'mountHome', 5 => 'getCompleteItemBySlug', )
Navigation\Page
Instancing using class 'Produtos'
'Produtos'
Navigation\Page
Incorporating transactional functions from class 'Produtos'
array ( 0 => 'lastStockData', 1 => 'listItems', 2 => 'listRelatedItems', )
Navigation\Page
Instancing using class 'Cliente'
'Cliente'
Navigation\Page
Incorporating transactional functions from class 'Cliente'
array ( 0 => 'cadastrar', 1 => 'validateEmail', 2 => 'listOrdersCliente', 3 => 'alterarCadastro', 4 => 'realizaLogin', 5 => 'saveAprovacao', )
Icecream
Executing query
array ( 'query' => 'SELECT id,slug,id_parent_category,title,visible,sort,meta_title,meta_description,meta_keywords FROM shopper_category AS category WHERE date_delete IS NULL AND slug = :6935513df39f1 AND id_parent_category IS NULL ORDER BY sort ASC,title ASC ', 'params' => array ( ':6935513df39f1' => 'embalagens', ), )