Phalcon Framework 3.3.2

Error: Class 'Util' not found

/home/inquangcao/live/app/home/view/default_error.phtml (52)
#0unknown
#1Phalcon\Mvc\View\Engine\Php->render(/home/inquangcao/live/app/home/view/default_error.phtml, Array(68), true)
#2Phalcon\Mvc\View->_engineRender(Array([.phtml] => Object(Phalcon\Mvc\View\Engine\Php)), default_error, true, true, null)
#3Phalcon\Mvc\View->render(error, error404)
#4Phalcon\Mvc\Application->handle()
/home/inquangcao/live/web/home/index.php (248)
<?php
define('START_TIME', microtime(true));
 
use Phalcon\Mvc\Application;
use Phalcon\Mvc\Url;
use Phalcon\Mvc\Router;
use Phalcon\Mvc\View;
use Phalcon\Mvc\Dispatcher;
use Phalcon\Mvc\Model\MetaData\Apc as MetaDataApc;
use Phalcon\Config\Adapter\Ini;
use Phalcon\DI\FactoryDefault;
use Phalcon\Loader;
use Phalcon\Db\Adapter\Pdo\Mysql;
use Phalcon\Session\Adapter\Files as Session;
use Phalcon\Flash\Session as FlashSession;
use Phalcon\Http\Response\Cookies;
use Phalcon\Crypt;
use Phalcon\Security;
use Phalcon\Exception;
use Phalcon\Events\Manager as EventsManager;
use Phalcon\Acl\Adapter\Memory as Acl;
use Phalcon\Cache\Frontend\Data;
use Phalcon\Cache\Backend\Apc;
use Phalcon\Tag;
use Phalcon\Logger\Adapter\File as Logger;
use Phalcon\Logger as LoggerConstant;
 
date_default_timezone_set('Asia/Bangkok');
ini_set('display_errors', false);
error_reporting(E_ALL);
 
define('ROOT', realpath(dirname(dirname(dirname(__FILE__)))));
 
try {
    $loader = new Loader();
    $loader->registerDirs(array(
        ROOT . '/app/home/',
        ROOT . '/app/datasource/',
        ROOT . '/app/apimbn/'
    ));
 
    $loader->registerNamespaces(array(
        'ITECH\ApiMBN' => ROOT . '/app/apimbn',
        'ITECH\Home' => ROOT . '/app/home',
    ));
    $loader->register();
 
 
    $di = new FactoryDefault();
 
    $config = new Ini(ROOT . '/app/home/config/parameter.ini');
    $di->setShared('config', $config);
 
    $di->setShared('db', function() use ($config) {
        $debug = false;
        $connection = new Mysql(array(
            'host' => $config->db->host,
            'port' => $config->db->port,
            'username' => $config->db->username,
            'password' => $config->db->password,
            'dbname' => $config->db->dbname,
            'charset' => $config->db->charset
        ));
 
        if ($debug) {
            $e = new EventsManager();
            $logger = new Logger(ROOT . '/app/home/log/db_master_' . date('Ymd') . '.log');
 
            $e->attach('db', function($event, $connection) use ($logger) {
                if ($event->getType() == 'beforeQuery') {
                    $sql = $connection->getSQLVariables();
 
                    if (count($sql)) {
                      $logger->log($connection->getSQLStatement() . ' ' . join(', ', $sql), LoggerConstant::INFO);
                    } else {
                      $logger->log($connection->getSQLStatement(), LoggerConstant::INFO);
                    }
                }
            });
            $connection->setEventsManager($e);
        }
 
        return $connection;
    });
 
    $di->setShared('db_slave', function() use ($config) {
        $debug = false;
        $connection = new Mysql(array(
            'host' => $config->db_slave->host,
            'port' => $config->db->port,
            'username' => $config->db_slave->username,
            'password' => $config->db_slave->password,
            'dbname' => $config->db_slave->dbname,
            'charset' => $config->db_slave->charset
        ));
 
        if ($debug) {
            $e = new EventsManager();
            $logger = new Logger(ROOT . '/app/home/log/db_slave_' . date('Ymd') . '.log');
 
            $e->attach('db', function($event, $connection) use ($logger) {
                if ($event->getType() == 'beforeQuery') {
                    $sql = $connection->getSQLVariables();
 
                    if (count($sql)) {
                      $logger->log($connection->getSQLStatement() . ' ' . join(', ', $sql), LoggerConstant::INFO);
                    } else {
                      $logger->log($connection->getSQLStatement(), LoggerConstant::INFO);
                    }
                }
            });
            $connection->setEventsManager($e);
        }
 
        return $connection;
    });
 
    $di->setShared('url', function() use ($config) {
        $url = new Url();
        $url->setBaseUri($config->application->base_url);
        return $url;
    });
 
    $di->setShared('view', function() {
        $view = new View();
        $view->setViewsDir(ROOT . '/app/home/view/');
        return $view;
    });
 
    $di->setShared('tag', new Tag());
    
    $di->setShared('cache', function() use ($config) {
        $data_cache = new Data(array(
            'lifetime' => $config->cache->lifetime + rand(1, 100)
        ));
        $cache = new Apc($data_cache, array(
            'prefix' => $config->cache->prefix
        ));
 
        return $cache;
    });
 
    $di->setShared('modelsCache', function() use ($config) {
        $data_cache = new Data(array(
            'lifetime' => $config->cache->lifetime
        ));
        $cache = new Apc($data_cache, array(
            'prefix' => $config->cache->prefix
        ));
        return $cache;
    });
 
    $di->setShared('modelsMetadata', function() use ($config) {
        $metaData = new MetaDataApc(array(
            'prefix' => $config->cache->metadata_prefix,
            'lifetime' => $config->cache->metadata_lifetime + rand(1, 100)
        ));
        return $metaData;
    });
 
    $di->setShared('security', function() {
        $security = new Security();
        return $security;
    });
 
    $di->setShared('session', function() {
        $session = new Session();
        $session->start();
        return $session;
    });
 
    $di->setShared('crypt', function() use ($config) {
        $crypt = new Crypt();
        $crypt->setKey($config->application->cookie_key);
        return $crypt;
    });
 
    $di->setShared('cookies', function() {
        $cookies = new Cookies();
        $cookies->useEncryption(true);
        return $cookies;
    });
 
    $di->setShared('flashSession', function() {
        return new FlashSession(array(
            'error' => 'alert alert-danger',
            'success' => 'alert alert-success',
            'warning' => 'alert alert-warning'
        ));
    });
 
    $di->setShared('dispatcher', function() {
        $dispatcher = new Dispatcher();
        $dispatcher->setDefaultNamespace('ITECH\Home\Controller\\');
 
        $events_manager = new EventsManager();
        $events_manager->attach('dispatch', function($event, $dispatcher, $exception) {
            $debug = false;
            $type = $event->getType();
            if ($type == 'beforeException') {
                if (!$debug) {
                    if ($exception->getCode() == Dispatcher::EXCEPTION_HANDLER_NOT_FOUND || $exception->getCode() == Dispatcher::EXCEPTION_ACTION_NOT_FOUND) {
                        $dispatcher->forward(array(
                            'module' => 'home',
                            'controller' => 'error',
                            'action' => 'error404'
                        ));
                        return false;
                    } else {
                        $dispatcher->forward(array(
                            'module' => 'home',
                            'controller' => 'error',
                            'action' => 'error',
                            'params' => array($exception)
                        ));
                        return false;
                    }
                }
            }
        });
 
        $dispatcher->setEventsManager($events_manager);
        return $dispatcher;
    });
 
    $di->setShared('acl', function() {
        $acl = new Acl();
        return $acl;
    });
 
    $di->setShared('logger', function() {
        $logger = new Logger(ROOT . '/app/home/log/debug_' . date('Ymd') . '.log');
        return $logger;
    });
 
    $application = new Application(); 
    $debug = new \Phalcon\Debug();
    $debug->listen();
    initModules($application);
    initRouter($di, $application);    
 
    $registry = new \Phalcon\Registry();
    $di->set('registry', $registry);
    $registry->modules = $application->getModules();
 
    $application->setDI($di);
 
    echo $application->handle()->getContent();
} catch (Exception $e) {
    throw new Exception($e->getMessage());
} catch (PDOException $e) {
    throw new PDOException($e->getMessage());
}
 
 
 
function initRouter(FactoryDefault &$di, $application) {
    $router = new Router(false);
 
    require_once ROOT . '/app/home/config/router.php';
 
    if(class_exists('ITECH\ApiMBN\Router') && isset($application->getModules()['apimbn'])) {
        $ApiMBNR = new ITECH\ApiMBN\Router();
        $ApiMBNR->init($router);
    }
 
    $router->setUriSource(Router::URI_SOURCE_SERVER_REQUEST_URI);
    $router->notFound(array(
        'module' => 'home',
        'controller' => 'error',
        'action' => 'error404'
    ));
    $router->removeExtraSlashes(true);
 
    $di->setShared('router', $router);
}
 
function initModules(&$application) {
    global $configApiMBn;
 
    $dirConfig = ROOT . '/app/datasource/configJson/muabannhanh.json';
    if (file_exists($dirConfig)) {
        $content = file_get_contents($dirConfig);
        $configApiMBn = json_decode($content, true);
    }
 
    $args = array(
        'home' => array(
            'className' => 'ITECH\Home\Module',
            'path' => ROOT . '/app/home/Module.php'
        ),
        'datasource' => array(
            'className' => 'ITECH\Datasource\Module',
            'path' => ROOT . '/app/datasource/Module.php'
        ),
    );
 
    if (isset($configApiMBn['on_off']) && $configApiMBn['on_off'] == 'on') {
 
        if(class_exists('ITECH\ApiMBN\Router')) {
 
            $args['apimbn']= array(
                'className' => 'ITECH\ApiMBN\Module',
                'path' => ROOT . '/app/apimbn/Module.php'
            );
        }
    }
 
    $application->registerModules($args);
}
KeyValue
_url/ http:/inpp.com.vn/gia-cong-cho-in-pp-gia-re-lam-menu-493.html
KeyValue
USERinquangcao
HOME/home/inquangcao
HTTP_CONNECTIONKeep-Alive
HTTP_HOSTinquangcao.com
HTTP_ACCEPT_ENCODINGbr,gzip
HTTP_IF_MODIFIED_SINCEWed, 22 Jan 2020 01:31:56 GMT
HTTP_ACCEPT_LANGUAGEen-US,en;q=0.5
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENTCCBot/2.0 (https://commoncrawl.org/faq/)
SCRIPT_FILENAME/home/inquangcao/live/web/home/index.php
PATH_TRANSLATED/home/inquangcao/live/web/home
PATH_INFO
REDIRECT_STATUS200
SERVER_NAMEinquangcao.com
SERVER_PORT443
SERVER_ADDR192.168.200.94
REMOTE_PORT48632
REMOTE_ADDR3.226.245.48
SERVER_SOFTWAREnginx/1.12.1
GATEWAY_INTERFACECGI/1.1
HTTPSon
REQUEST_SCHEMEhttps
SERVER_PROTOCOLHTTP/1.1
DOCUMENT_ROOT/home/inquangcao/live/web/home
DOCUMENT_URI/index.php
REQUEST_URI/%20http:/inpp.com.vn/gia-cong-cho-in-pp-gia-re-lam-menu-493.html
SCRIPT_NAME/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING_url=/%20http:/inpp.com.vn/gia-cong-cho-in-pp-gia-re-lam-menu-493.html
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1597367459.069
REQUEST_TIME1597367459
#Path
0/home/inquangcao/live/web/home/index.php
1/home/inquangcao/live/app/home/config/router.php
2/home/inquangcao/live/app/apimbn/Router.php
3/home/inquangcao/live/app/home/Module.php
4/home/inquangcao/live/app/home/controller/ErrorController.php
5/home/inquangcao/live/app/home/lib/Config.php
6/home/inquangcao/live/app/datasource/lib/MobileDetect.php
7/home/inquangcao/live/app/home/component/LinkComponent.php
8/home/inquangcao/live/app/datasource/repository/LinkRepository.php
9/home/inquangcao/live/app/datasource/model/Link.php
10/home/inquangcao/live/app/datasource/model/BaseModel.php
11/home/inquangcao/live/app/home/view/default/component/link/main_menu.phtml
12/home/inquangcao/live/app/datasource/lib/Util.php
13/home/inquangcao/live/app/home/component/ArticleComponent.php
14/home/inquangcao/live/app/datasource/lib/Constant.php
15/home/inquangcao/live/app/datasource/model/Category.php
16/home/inquangcao/live/app/datasource/model/ArticleCategory.php
17/home/inquangcao/live/app/home/view/default/error/error404.phtml
18/home/inquangcao/live/app/home/view/default_error.phtml
19/home/inquangcao/live/app/home/view/default/element/layout/_asset.phtml
20/home/inquangcao/live/app/home/view/default/element/layout/_header.phtml
21/home/inquangcao/live/app/home/view/default/element/layout/_footer.phtml
Memory
Usage2097152