Phalcon Framework 5.6.2

Phalcon\Mvc\Dispatcher\Exception: Web\Controllers\CamerasAndPhotographyController handler class cannot be loaded

/home/sahara/apps/inmlhiiiinjl/public/index.php (539)
#0Phalcon\Mvc\Dispatcher->throwDispatchException
#1Phalcon\Dispatcher\AbstractDispatcher->dispatch
#2Phalcon\Mvc\Application->handle
/home/sahara/apps/inmlhiiiinjl/public/index.php (539)
<?php
 
//echo phpinfo(); exit;
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
use Phalcon\Mvc\Router,
    Phalcon\Mvc\Application,
    Phalcon\DI\FactoryDefault,
    Phalcon\Security,
    Phalcon\Loader;
   
    use Phalcon\Logger;
    use Phalcon\Logger\Adapter\File as FileAdapter;
    use Phalcon\Http\Cookie;
    use Phalcon\Http\Response\Cookies;
    
    use Phalcon\Logger\Adapter\Stream;
    use Phalcon\Html\Helper\Doctype;
    use Phalcon\Html\Escaper;
    $escaper = new Escaper();
    $helper  = new Doctype($escaper);
//(new \Phalcon\Debug)->listen();
    use Phalcon\Support\Debug;
    $debug = new Debug();
    $debug->listen();
 
define('BASE_PATH', dirname(__DIR__));
define("BASE_URL", 'https://'. $_SERVER['HTTP_HOST']);
define('APP_PATH', BASE_PATH . '');
define('TEMPLATE', 'templates/');
 
 
    define('ROOT_PATH', dirname(__DIR__));
    $config = include APP_PATH . "/config/config.php";
 
//try {
 
    /**
     * The FactoryDefault Dependency Injector automatically registers
     * the services that provide a full stack framework.
     */
 
 
    $di = new FactoryDefault();
 
 
 
    $di->setShared('connection', function () use ($config) {
        return new \Phalcon\Db\Adapter\Pdo\Mysql([
            "host" => $config->database->host,
            "username" => $config->database->username,
            "password" => $config->database->password,
            "dbname" => $config->database->dbname,
        ]);
     });
 
    require_once(APP_PATH . '/library/diFile.php');
    //Specify routes for modules
    $di->set('router', function () {
 
        $router = new Router();
 
        $module =  'www';
 
 
        $router->setDefaultModule($module);
 
        $router->add(
            "/",
            array(
                "module"     => $module,
                "controller" => 'index',
                "action"     => 'index',
        ));
 
        $router->add(
            "/:controller",
            array(
                "module"     => $module,
                "controller" => 1,
                "action"     => 'index'
        ));
        $router->add(
            "/:controller/",
            array(
                "module"     => $module,
                "controller" => 1,
                "action"     => 'index'
        ));
 
        $router->add(
            "/:controller/:action",
            array(
                "module"     => $module,
                "controller" => 1,
                "action"     => 2
        ));
 
        $router->add('/:controller/:action/',
        array(
            "module"     => $module,
            "controller"=>1,
            "action"=>2,
            "params"=>3
        )
        );
        $router->add('/:controller/:action/:params',
        array(
            "module"     => $module,
            "controller"=>1,
            "action"=>2,
            "params"=>3
        )
        );
 
 
        //sahara module
                  //slab module
        $sahara = 'sahara';
        $router->add(
            "/".$sahara,
            array(
                "module"     => 'sahara',
                "controller" => 'index',
                "action"     => 'index',
        ));
 
        $router->add(
            "/".$sahara."/",
            array(
                "module"     => 'sahara',
                "controller" => 'index',
                "action"     => 'index',
        ));
 
        $router->add(
            "/".$sahara."/:controller",
            array(
                "module"     => 'sahara',
                "controller" => 1,
                "action"     => 'index'
        ));
        $router->add(
            "/".$sahara."/:controller/",
            array(
                "module"     => 'sahara',
                "controller" => 1,
                "action"     => 'index'
        ));
 
        $router->add(
            "/".$sahara."/:controller/:action",
            array(
                "module"     => 'sahara',
                "controller" => 1,
                "action"     => 2
        ));
 
        $router->add("/".$sahara."/:controller/:action/",
        array(
            "module"     => 'sahara',
            "controller"=>1,
            "action"=>2,
            "params"=>3
        )
        );
        $router->add("/".$sahara."/:controller/:action/:params",
        array(
            "module"     => 'sahara',
            "controller"=>1,
            "action"=>2,
            "params"=>3
        )
        );
 
 
        // $slabmodules = ['inventory','shop','sales','leasing','support','tenders','marketing','website','customers'];
 
        // foreach ($slabmodules as $key => $value) {
        //     $_controller = 'main';
        //     $router->add(
        //         "/".$slab."/".$value,
        //         array(
        //             "module"     => 'slab',
        //             "controller" => $_controller,
        //             "action"     => 'index',
        //             "SLAB_MODULE" => $value
        //     ));
        //     $router->add(
        //         "/".$slab."/".$value."/",
        //         array(
        //             "module"     => 'slab',
        //             "controller" => $_controller,
        //             "action"     => 'index',
        //             "SLAB_MODULE" => $value
        //     ));
 
        //     $router->add(
        //         "/".$slab."/".$value."/:action",
        //         array(
        //             "module"     => 'slab',
        //             "controller" => $_controller,
        //             "action"     => 2,
        //             "SLAB_MODULE" => $value
        //     ));
 
        //     $router->add("/".$slab."/".$value."/:action/",
        //     array(
        //         "module"     => 'slab',
        //         "controller"=>$_controller,
        //         "action"=>2,
        //         "SLAB_MODULE" => $value
        //     )
        //     );
        //     $router->add("/".$slab."/".$value."/:action/:params",
        //     array(
        //         "module"     => 'slab',
        //         "controller"=>$_controller,
        //         "action"=>2,
        //         "params"=>3,
        //         "SLAB_MODULE" => $value
        //     )
        //     );
        // }
 
       //end slab module
 
 
        // products
 
          
          $products[700911483] = 'copy-printer';
          $products[390036435] = 'consumables';
          $products[265834157] = 'etr-machines';
          $products[262031572] = 'paper-shredders';
          $products[507279378] = 'photocopiers';
          $products[448243161] = 'printers';
          $products[545222025] = 'telephone-systems';
          $products[654456067] = 'laptops';
          $products[535686558] = 'desktops';
          $products[240813391] = 'networking';
          $products[319541512] = 'cameras-and-photography';
          $products[867537469] = 'electronics';
          $products[525003363] = 'electronics';
          $products[161610912] = 'phones-and-tablets';
          $products[723174557] = 'money-counter';
          $products[828362971] = 'shredders';
          $products[844223768] = 'binders';
          $products[226844082] = 'projectors';
 
        foreach ($products as $key => $value) {
            $router->add(
                "/".$value,
                array(
                    "module"     => $module,
                    "controller" => 'products',
                    "action"     => 'index',
                    "product" => $value,
                    "categoryId" => $key
            ));
            $router->add(
                "/".$value."/",
                array(
                    "module"     => $module,
                    "controller" => 'products',
                    "action"     => 'index',
                    "product" => $value,
                    "categoryId" => $key
            ));
 
            // $router->add(
            //     "/".$value."/:action",
            //     array(
            //         "module"     => $module,
            //         "controller" => 'products',
            //         "action"     => 'filter',
            //         "product" => $value,
            //         "categoryId" => $key
            // ));
 
            // $router->add("/".$value."/:action/",
            // array(
            //     "module"     => $module,
            //     "controller"=> 'products',
            //     "action"=> 'filter',
            //     "product" => $value
            // )
            // );
            // $router->add("/".$value."/:action/:params",
            // array(
            //     "module"     => $module,
            //     "controller"=>'products',
            //     "action"=> 'filter',
            //     "params"=>2,
            //     "product" => $value
            // )
            // );
        }
 
       //end products
 
 
 
        // product
 
        $productlist =  array();
        $productlist[939038626] = 'photocopiers/ECOSYS-M3145idn';
          
        foreach ($productlist as $key => $value) {
 
 
            $router->add(
                "/".$value,
                array(
                    "module"     => $module,
                    "controller" => 'product',
                    "action"     => 'index',
                    "productId" => $key
            ));
 
            $router->add(
                "/".$value."/",
                array(
                    "module"     => $module,
                    "controller" => 'product',
                    "action"     => 'index',
                    "productId" => $key
            ));
 
 
        }
 
       //end product
 
 
 
 
         //images
            $images =  array();
            $images[APP_PATH.'/frontend/image/'] = 'saharabg.png';
 
 
            foreach ($images as $key => $value) {
                 $router->add(
                "/".$value,
                array(
                    "module"     => $module,
                    "controller" => 'image',
                    "action"     => 'index',
                    "path"        => $key,
                    "name"        => $value,
                ));
                $router->add(
                    "/".$value."/",
                    array(
                    "module"     => $module,
                    "controller" => 'image',
                    "action"     => 'index',
                    "path"        => $key,
                    "name"        => $value,    
                ));
 
                $router->add(
                    "/".$value."/{token}",
                    array(
                    "module"     => $module,
                    "controller" => 'image',
                    "action"     => 'index',
                    "path"        => $key,
                    "name"        => $value,
                    "token"     => 1,
                
                ));
            }
        //end images
 
        
 
        return $router;
    });
 
     
 
$di->setShared('session', function() {
 
    // $session = new \Phalcon\Session\Adapter\Stream();
    // $session->start();
    // return $session;
 
    $session = new Phalcon\Session\Manager();
    $files = new Phalcon\Session\Adapter\Stream( [
        'savePath' => '/tmp',
    ]);
    $session->setAdapter($files)->start();
    return $session;
 
});
 
    // $di->setShared('random', function() {
    //     $random = new Phalcon\Security\Random();
     
    //     return $random;
    // });
 
    // $di->set('flash', function () {
    //     $flash = new \Phalcon\Flash\Direct (
    //         array(
    //             'error'   => 'alert alert-danger',
    //             'success' => 'alert alert-success',
    //             'notice'  => 'alert alert-info',
    //             'warning' => 'alert alert-warning'
    //         )
    //     );
 
    //     return $flash;
    // });
 
    // $di->setShared('flashSession', function () {
    //     $flash = new \Phalcon\Flash\Session (
    //         // array(
    //         //  'error'   => 'alert alert-danger',
    //         //  'success' => 'alert alert-success',
    //         //  'notice'  => 'alert alert-info',
    //         //  'warning' => 'alert alert-warning'
    //         // )
    //     );
 
    //     return $flash;
    // });
 
 
      $di->set(
    "logger",
    function () {
        $logger = new FileAdapter("__DIR__ . '/../../logger.log");
 
        return $logger;
    }
    );
 
 
    $di->setShared('controllerPath', function () {
       
        if (!empty($_SERVER['REQUEST_URI'])) {
            $uriParts = explode('?', $_SERVER['REQUEST_URI']);
            $segment = explode('/', $uriParts[0]);
           // $uri = str_replace('/', '', $uriParts[0]);
            $uri = $segment[1].'/';
        } else {
            $uri = '/';
        }
        return $uri;
    });
 
    $di->set('users',function () {
 
            include APP_PATH . '/services/users.php';
            return new Users();
        },
        true
    );
 
     $di->set('categories',function () {
 
            include APP_PATH . '/services/categories.php';
            return new Categories();
        },
        true
    );
 
     $di->set('flash',function () {
 
            include APP_PATH . '/services/flash.php';
            return new Flash();
        },
        true
    );
 
    $di->set('directpay',function () {
 
            include APP_PATH . '/services/directpay.php';
            return new Directpay();
        },
        true
    );
 
    $di->set('item',function () {
 
            include APP_PATH . '/services/item.php';
            return new Item();
        },
        true
    );
 
   
     $di->set('redis',function () {
 
 
            include BASE_PATH . '/vendor/autoload.php';
 
            include BASE_PATH . '/vendor/predis/Autoloader.php';
 
            Predis\Autoloader::register();
 
           /* $client = new Predis\Client();
            $client->set('foo', 'bar');
            $value = $client->get('foo');*/
 
            $redis = new Predis\Client(array(
                "scheme" => "tcp",
                "host" => "127.0.0.1",
                "port" => 6379
            ));
 
            return $redis;
 
        });
    $application = new \Phalcon\Mvc\Application($di);
 
        //Create an application
 
    // Register the installed modules
    $application->registerModules(
        array(
            'www' => array(
                'className' => 'Web\Module',
                'path'      => APP_PATH.'/www/module.php',  
 
            ),
            'sahara' => array(
                'className' => 'Sahara\Module',
                'path'      => APP_PATH.'/sahara/module.php',  
 
            )
        )
    );
    $request = new \Phalcon\Http\Request();
    echo $application->handle($request->getURI())->getContent();
 
/*} catch (\Exception $e) {
    echo $e->getMessage() . '<br>';
    echo '<pre>' . $e->getTraceAsString() . '</pre>';
}*/
KeyValue
_url/cameras-and-photography/Hikvision-DS-7732NI-E4--16P-network-video-recorder-with-32-channels/856205999
KeyValue
PHP_INI_SCAN_DIR/etc/php.d/:/home/sahara/apps/inmlhiiiinjl/
USERsahara
HOME/home/sahara
ORACLE_HOME/usr/lib/oracle/21/client64/lib
SCRIPT_NAME/public/index.php
REQUEST_URI/cameras-and-photography/Hikvision-DS-7732NI-E4--16P-network-video-recorder-with-32-channels/856205999
QUERY_STRING_url=/cameras-and-photography/Hikvision-DS-7732NI-E4--16P-network-video-recorder-with-32-channels/856205999
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.1
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/public/cameras-and-photography/Hikvision-DS-7732NI-E4--16P-network-video-recorder-with-32-channels/856205999
REDIRECT_QUERY_STRING_url=/cameras-and-photography/Hikvision-DS-7732NI-E4--16P-network-video-recorder-with-32-channels/856205999
REMOTE_PORT36994
SCRIPT_FILENAME/home/sahara/apps/inmlhiiiinjl/public/index.php
SERVER_ADMIN[no address given]
CONTEXT_DOCUMENT_ROOT/home/sahara/apps/inmlhiiiinjl/
CONTEXT_PREFIX/
REQUEST_SCHEMEhttp
DOCUMENT_ROOT/home/sahara/apps/inmlhiiiinjl
REMOTE_ADDR18.117.183.206
SERVER_PORT80
SERVER_ADDR127.0.0.1
SERVER_NAMEtechmart.co.ke
SERVER_SOFTWAREApache
SERVER_SIGNATURE<address>Apache Server at techmart.co.ke Port 80</address>\n
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_ACCEPT_ENCODINGgzip, br, zstd, deflate
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT*/*
HTTP_CONNECTIONupgrade
HTTP_X_FORWARDED_SSLon
HTTP_X_FORWARDED_PROTOhttps
HTTP_HTTPSon
HTTP_FORWARDED_REQUEST_URI/cameras-and-photography/Hikvision-DS-7732NI-E4--16P-network-video-recorder-with-32-channels/856205999
HTTP_X_FORWARDED_SERVERtechmart.co.ke
HTTP_X_FORWARDED_HOSTtechmart.co.ke
HTTP_HOSTtechmart.co.ke
proxy-nokeepalive1
HTTPSon
UNIQUE_IDZ4@Q4-FvOWxduRIuewdq1QAAAJU
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_UNIQUE_IDZ4@Q4-FvOWxduRIuewdq1QAAAJU
REDIRECT_REDIRECT_STATUS200
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_UNIQUE_IDZ4@Q4-FvOWxduRIuewdq1QAAAJU
FCGI_ROLERESPONDER
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1737461987.7519
REQUEST_TIME1737461987
#Path
0/home/sahara/apps/inmlhiiiinjl/public/index.php
1/home/sahara/apps/inmlhiiiinjl/config/config.php
2/home/sahara/apps/inmlhiiiinjl/library/diFile.php
3/home/sahara/apps/inmlhiiiinjl/www/module.php
Memory
Usage2097152