Phalcon Framework 1.3.4

Phalcon\Mvc\Dispatcher\Exception: Nube\Frontend\Controllers\ImagesController handler class cannot be loaded

/var/www/vhosts/intranet.pyma.com/httpdocs/apps/Bootstrap.php (358)
#0Phalcon\Mvc\Dispatcher->_throwDispatchException(Nube\Frontend\Controllers\ImagesController handler class cannot be loaded, 2)
#1Phalcon\Dispatcher->dispatch()
#2Phalcon\Mvc\Application->handle()
<?php
 
class Bootstrap
{
 
    public static function run()
    {
        $debug = new \Phalcon\Debug();
        $debug->listen();
 
        $config = new \Phalcon\Config\Adapter\Ini(__DIR__ . "/config/".APPLICATION_ENV.".ini");
 
        Phalcon\Tag::setAutoescape(false); 
        
        // DI Container
        $di = new Phalcon\DI\FactoryDefault();
        
        // Loader, registering namespaces
        $loader = new Phalcon\Loader();
        $loader->registerNamespaces(array(
            'Nube\Module' => __DIR__ . '/library/Nube/Module'
        ));
        $loader->register();
 
        $di->set('nimodules', function() use ($config){
            return new \Nube\Module\Loader(__DIR__, $config->modules->load->toArray());
        });
        
        $loader->registerNamespaces(array(
            'Nube\Core' => __DIR__ . '/core/',
            'Nube\Core\Controllers' => __DIR__ . '/core/controllers/',
            'Nube\Core\Models' => __DIR__ . '/core/models/',
            'Nube\Backend' => __DIR__ . '/backend/',
            'Nube\Frontend' => __DIR__ . '/frontend/',
            'Nube\Frontend\Forms' => __DIR__ . '/frontend/forms/',
            'Phalcon' => __DIR__ . '/library/Phalcon/',
            'Nube\Forms' => __DIR__ . '/library/Nube/Forms/',
            'Nube\Mvc' => __DIR__ . '/library/Nube/Mvc/',
            'Nube\Translate' => __DIR__ . '/library/Nube/Translate/',
            'Nube\Utils' => __DIR__ . '/library/Nube/Utils/',
            'Esendex' => __DIR__ . '/library/Esendex',
            'Phpmailer' => __DIR__ . '/library/Phpmailer'
        ) + $di->get('nimodules')->getNamespaces(), true);
        
        $loader->registerClasses(array(
            "PHPExcel" => __DIR__ . '/library/Prefixed/PHPExcel.php',
            "FPDI" => __DIR__ . '/library/Prefixed/fpdi/fpdi.php',
            "FPDF" => __DIR__ . '/library/Prefixed/fpdf/fpdf.php',
            "PDFMerger" => __DIR__ . '/library/Prefixed/PDFMerger.php'
        ), true);
        
        $loader->registerPrefixes(array(
            'PHPExcel_' => __DIR__ . '/library/Prefixed/PHPExcel/'
        ), true);
        
//        $loader->registerNamespaces($loader->getNamespaces () + $di->get('nimodules')->getNamespaces());
        $loader->register();
        
        $application = new Phalcon\Mvc\Application();
 
        /**
         * Register application modules
         */
        $application->registerModules(array(
                'core' => array(
                        'className' => 'Nube\Core\Module',
                        'path' => __DIR__ . '/core/Module.php'
                ),
                'backend' => array(
                        'className' => 'Nube\Backend\Module',
                        'path' => __DIR__ . '/backend/Module.php'
                ),
                'frontend' => array(
                        'className' => 'Nube\Frontend\Module',
                        'path' => __DIR__ . '/frontend/Module.php'
                )
        ) + $di->get('nimodules')->getModulesReg());
        
//        $application->registerModules($NI_Loader->getModulesReg());
//$debugger = new \Nube\Utils\Debug();
//$debugger->dump($application->getModules());exit;
        // Routing
        $router = new Phalcon\Mvc\Router();
 
        $router->setDefaultModule('frontend');
        $router->setDefaultController('index');
        $router->setDefaultAction('index');
 
        foreach ($application->getModules() as $module) {
            $routesClassName = preg_replace('/Module$/', 'Routes', $module['className']);
            if (class_exists($routesClassName)) {
                $routesClass = new $routesClassName();
                $router = $routesClass->add($router);
            }
        }
//$debugger = new \Nube\Utils\Debug();
//$debugger->dump($router);exit;
        $di->set('router', $router);
 
        // URL component
        $di->set('url', function() use ($config) {
                    $url = new Nube\Mvc\Url();
                    $url->setBaseUri($config->path->uri);
                    $url->setBasePath($config->path->uri);
                    return $url;
                }, true);
 
        $di->set('globalconfig', $config->global);
        // View
//        $view = new Phalcon\Mvc\View();
//        $view->setLayoutsDir($config->view->layoutsDir); // path with layouts
//        $view->setPartialsDir($config->view->partialsDir); // relative path with partials
//        $view->setLayout('main'); // default layout
//        $view->registerEngines(array(
//            ".phtml" => function($view, $di) {
//                $volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
//                $volt->setOptions(array('compiledPath' => __DIR__ . '/cache/volt/'));
//                return $volt;
//            }
//        ));
//        $di->set('view', $view);
//
        // Database
        $di->set('db', function() use ($config) {
            
                $eventsManager = new Phalcon\Events\Manager();
 
//                $logger = new Phalcon\Logger\Adapter\File(__DIR__."/logs/debug.log");
//
//                //Listen all the database events
//                $eventsManager->attach('db', function($event, $connection) use ($logger) {
//                    if ($event->getType() == 'beforeQuery') {
//                        $logger->log($connection->getSQLStatement(), Phalcon\Logger::INFO);
//                    }
//                });
 
                $connection = new Phalcon\Db\Adapter\Pdo\Mysql(array(
                    'host' => $config->database->host,
                    'username' => $config->database->username,
                    'password' => $config->database->password,
                    'dbname' => $config->database->dbname
//                        'charset' => $config->database->charset,
                ));
 
                //Assign the eventsManager to the db adapter instance
                $connection->setEventsManager($eventsManager);
 
                return $connection;
            });
 
//        // Cache
//        $cache = new Phalcon\Cache\Backend\Memcache(
//                new Phalcon\Cache\Frontend\Data(array(
//            "lifetime" => 60,
//            "prefix" => 'phalcon-modular-app',
//                )), array(
//            "host" => "localhost",
//            "port" => "11211"
//        ));
//        $di->set('cache', $cache);
//        $di->set('viewCache', $cache); // optional
//        $di->set('modelsCache', $cache); //
        // ModelsMetadata
//        if (APPLICATION_ENV == 'dev') {
            $modelsMetadata = new Phalcon\Mvc\Model\Metadata\Memory();
//        } else {
//            $modelsMetadata = new Phalcon\Mvc\Model\MetaData\Apc(array(
//                "lifetime" => 3600,
//                "prefix" => "phalcon-metadata"
//            ));
//        }
 
        $di->set('modelsMetadata', $modelsMetadata);
 
        // Translator
        
        $di->set('translator', function() use($di){
            //Ask browser what is the best language
            $language = $di->get('request')->getBestLanguage();
 
            //Check if we have a translation file for that lang
            if (!file_exists(__DIR__ . '/languages/'.$language)) {
               $language = 'es_ES';
            } 
            $translate = new Nube\Translate\Adapter\Gettext(array(
                'locale' => $language,
                'file' => 'messages',
                'directory' => __DIR__ . '/languages/'
            ));
            $domains = $di->get('nimodules')->getTranslations();
            foreach ($domains as $domain => $folder){
                $translate->addDomain(array(
                    'locale' => $language,
                    'file' => $domain,
                    'directory' => $folder
                ));
            }
            
            return $translate;
            
        });
            
        
        
        // Permissions
        $di->setShared('acl', function() use($di) {
            
            if ($di->get('session')->has('auth')){
                $user = unserialize($di->get('session')->get('user'));
                if (!file_exists(__DIR__ . "/cache/acl.data.".$user->id)) {
                    $acl = new \Phalcon\Acl\Adapter\Memory();
                    $acl->setDefaultAction(\Phalcon\Acl::DENY);
 
//                    $role = new \Phalcon\Acl\Role($user->id);
                    $acl->addRole('r'.$user->id);
//                        $roles = \Nube\Core\Models\ACLRoles::find();
//                        foreach($roles as $role){
//                            if ($role->countparentObj() == 0){
//                                $acl->addRole($role->name);
//                            }
//                            else{
//                                $acl->addRole($role->name, $role->parent->name);
//                            }
//                        }
 
                    $resources = \Nube\Core\Models\ACLResources::find();
                    foreach ($resources as $resource){
                        $customersResource = new \Phalcon\Acl\Resource($resource->controller);
                        $acl->addResource($customersResource, $resource->action);
                    }
 
                    $permissions = \Nube\Core\Models\ACLPermissions::find(array(
                            "conditions" => "id_usuario = ?1",
                            "bind"       => array(1 => $user->id)));
                    foreach($permissions as $permission){
                            $acl->allow('r'.$user->id, @$permission->resourceObj->controller, @$permission->resourceObj->action);
                    }
                    // Store serialized list into plain file
                   // file_put_contents(__DIR__ . "/cache/acl.data.".$user->id, serialize($acl));
 
                } else {
                     //Restore acl object from serialized file
                     $acl = unserialize(file_get_contents(__DIR__ . "/cache/acl.data.".$user->id));
                }
                return $acl;
            }
            return null;
        });
                
        // Session
        $di->setShared('session', function() use ($config) {
                    ini_set("session.cookie_lifetime", $config->global->session_timeout);
                    ini_set("session.gc_maxlifetime", $config->global->session_timeout);
                    ini_set("session.gc_probability", 0);
                    session_set_cookie_params(0);
                    $session = new Phalcon\Session\Adapter\Files();
                    $session->start();
                    return $session;
                });
                
 
        // Flash messenger
        $di->set('flash', function() {
                    $flash = new Phalcon\Flash\Session(array(
                        'error' => 'alert alert-error',
                        'success' => 'alert alert-success',
                        'notice' => 'alert alert-info',
                    ));
                    return $flash;
                });
 
        // Assets
        $assetsManager = new Phalcon\Assets\Manager();
 
        $assetsManager->collection('js')
                ->addJs('js/jquery-2.0.3.min.js')
                ->addJs('js/jquery.custom-select.js')
                ->addJs('js/jquery.custom-checkbox.js')
                ->addJs('js/jquery.custom-radio.js')
                ->addJs('js/knockout-3.2.0.js')
                ->addJs('js/main.js')
        ->addJs('js/jquery-ui.js');
//                ->setPrefix($config->path->uri);
        $assetsManager->collection('jsltie9');
 
        $assetsManager->collection('jsMin')
                ->addFilter(new Phalcon\Assets\Filters\Jsmin())
                ->setTargetPath('public/js/output.js')
                ->setTargetUri('js/output.js?t='.microtime(true))
//                ->setPrefix($config->path->uri)
                ->setLocal(true)
                ->join(true);
 
        $assetsManager->collection('css')->addCss('css/reset.css')->addCss('css/jquery-ui.css');
//                ->setPrefix($config->path->uri);
 
        $assetsManager->collection('cssMin')
                ->addFilter(new Phalcon\Assets\Filters\Cssmin())
                ->setTargetPath('public/css/output.css')
                ->setTargetUri('css/output.css?t='.microtime(true))
//                ->setPrefix($config->path->uri)
                ->setLocal(true)
                ->join(true);
        
        $assetsManager->collection('csslteie9');
 
 
 
        $di->set('assets', $assetsManager);
 
        $dispatcher = new \Phalcon\Mvc\Dispatcher();
 
        $eventsManager = new \Phalcon\Events\Manager();
        $eventsManager->attach("dispatch", function($event, $dispatcher, $exception) use ($di) {
 
                    if ($event->getType() == 'beforeDispatchLoop') {
                        $dispatcher->setActionName(\Phalcon\Text::camelize($dispatcher->getActionName()));
                        return false;
                    }
                    
                    if ($event->getType() == 'beforeNotFoundAction') {
                        $dispatcher->forward(array(
                            'module' => 'frontend',
                            'controller' => 'error',
                            'action' => 'notFound'
                        ));
                        return false;
                    }
 
                    if ($event->getType() == 'beforeException') {
                        switch ($exception->getCode()) {
                            case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                            case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
                                $dispatcher->forward(array(
                                    'module' => 'frontend',
                                    'controller' => 'error',
                                    'action' => 'notFound'
                                ));
                                return false;
                        }
                    }
                });
 
        //Bind the EventsManager to the dispatcher
        $dispatcher->setEventsManager($eventsManager);
 
        $di->setShared('dispatcher', $dispatcher);
        
        $di->set('debug', function(){
            $debugger = new \Nube\Utils\Debug();
            return $debugger;
        });
 
        // Handle the request
        $application->setDI($di);
 
        // The core of all the work of the controller occurs when handle() is invoked:
        echo $application->handle($di->get('url')->resolve())->getContent();
 
    }
 
}
#3Bootstrap::run()
<?php
 header("Access-Control-Allow-Origin: https://saas.nube-saas.com");
 header("Access-Control-Allow-Credentials: true");
date_default_timezone_set('Europe/Madrid');
setlocale(LC_ALL, 'es-ES');
 
error_reporting(E_ALL); ini_set('display_errors', true);
 
 
defined('APPLICATION_ENV') ||
        define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
 
chdir(dirname(__DIR__));
 
require_once __DIR__ . '/../apps/Bootstrap.php';
Bootstrap::run();
 
 
//use Phalcon\Mvc\Application;
//
//try {
//
//  /**
//   * Include services
//   */
//  require __DIR__ . '/../config/services.php';
//
//  /**
//   * Handle the request
//   */
//  $application = new Application();
//        
//  /**
//   * Include modules
//   */
//  require __DIR__ . '/../config/modules.php';
//        
//  /**
//   * Assign the DI
//   */
//  $application->setDI($di);
//        
////        echo '<pre>';
////        print_r($application->getDI()->get('dispatcher'));
////        echo '</pre>';
//  echo $application->handle()->getContent();
//
//} catch (Phalcon\Exception $e) {
//    echo $e->getMessage();echo "<pre>"; print_r($e->getTraceAsString()); echo "</pre>";
////  echo $e->getMessage(); echo "<pre>"; print_r($e->getTrace()); echo "</pre>";
//} catch (PDOException $e){
//  echo $e->getMessage(); echo "<pre>"; print_r($e->getTrace()); echo "</pre>";
//}
KeyValue
_url/images/documentacion/FT_BN4BlancoNieve_ExtraMate_PYMA.pdf
KeyValue
USERpyma
HOME/var/www/vhosts/intranet.pyma.com
FCGI_ROLERESPONDER
REDIRECT_REDIRECT_STATUS200
REDIRECT_APPLICATION_ENVprod
REDIRECT_STATUS200
APPLICATION_ENVprod
proxy-nokeepalive1
HTTP_HOSTintranet.pyma.com
HTTP_X_REAL_IP18.204.2.53
HTTP_X_ACCEL_INTERNAL/internal-nginx-static-location
HTTP_CONNECTIONclose
HTTP_USER_AGENTCCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGEen-US,en;q=0.5
HTTP_ACCEPT_ENCODINGgzip
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVER_SIGNATURE<address>Apache Server at intranet.pyma.com Port 80</address>\n
SERVER_SOFTWAREApache
SERVER_NAMEintranet.pyma.com
SERVER_ADDR10.5.0.6
SERVER_PORT80
REMOTE_ADDR18.204.2.53
DOCUMENT_ROOT/var/www/vhosts/intranet.pyma.com/httpdocs
REQUEST_SCHEMEhttp
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT/var/www/vhosts/intranet.pyma.com/httpdocs
SERVER_ADMIN[no address given]
SCRIPT_FILENAME/var/www/vhosts/intranet.pyma.com/httpdocs/public/index.php
REMOTE_PORT56530
REDIRECT_URL/public/images/documentacion/FT_BN4BlancoNieve_ExtraMate_PYMA.pdf
REDIRECT_QUERY_STRING_url=/images/documentacion/FT_BN4BlancoNieve_ExtraMate_PYMA.pdf
GATEWAY_INTERFACECGI/1.1
SERVER_PROTOCOLHTTP/1.0
REQUEST_METHODGET
QUERY_STRING_url=/images/documentacion/FT_BN4BlancoNieve_ExtraMate_PYMA.pdf
REQUEST_URI/images/documentacion/FT_BN4BlancoNieve_ExtraMate_PYMA.pdf
SCRIPT_NAME/public/index.php
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1569123006.3039
REQUEST_TIME1569123006
#Path
0/var/www/vhosts/intranet.pyma.com/httpdocs/public/index.php
1/var/www/vhosts/intranet.pyma.com/httpdocs/apps/Bootstrap.php
2/var/www/vhosts/intranet.pyma.com/httpdocs/apps/library/Nube/Module/Loader.php
3/var/www/vhosts/intranet.pyma.com/httpdocs/apps/core/Routes.php
4/var/www/vhosts/intranet.pyma.com/httpdocs/apps/backend/Routes.php
5/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/home/Routes.php
6/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/clientes/Routes.php
7/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/proveedores/Routes.php
8/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/albaranes/Routes.php
9/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/facturasemitidas/Routes.php
10/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/facturasrecibidas/Routes.php
11/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/articulos/Routes.php
12/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/informes/Routes.php
13/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/asociados/Routes.php
14/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/proveedorespyma/Routes.php
15/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/pintores/Routes.php
16/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/introduccionconsumos/Routes.php
17/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/introduccionobjetivos/Routes.php
18/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/tablon/Routes.php
19/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/productos/Routes.php
20/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/documentacion/Routes.php
21/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/configuracion/Routes.php
22/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/productospyp/Routes.php
23/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/proveedorespyp/Routes.php
24/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/tarjetasregalo/Routes.php
25/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/puntospintores/Routes.php
26/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/tienda/Routes.php
27/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/informespyp/Routes.php
28/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/fidelizacion/Routes.php
29/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/gestionpedidos/Routes.php
30/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/tesoreria/Routes.php
31/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/remesas/Routes.php
32/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/exportaciona3con/Routes.php
33/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/estadisticas/Routes.php
34/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/stock/Routes.php
35/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/presupuestos/Routes.php
36/var/www/vhosts/intranet.pyma.com/httpdocs/apps/modules/gestionimagenes/Routes.php
37/var/www/vhosts/intranet.pyma.com/httpdocs/apps/library/Nube/Mvc/Url.php
38/var/www/vhosts/intranet.pyma.com/httpdocs/apps/frontend/Module.php
Memory
Usage1048576