Phalcon Framework 4.1.2

Error: Call to a member function getRewriteUri() on null

/home/xpatlink/apps/xpatweb/cache/user/user_home_xpatlink_apps_xpatweb_xpatlink_layouts_default.volt.php (19)
#0unknown
#1Phalcon\Mvc\View\Engine\Volt->render
#2Phalcon\Mvc\View->engineRender
#3Phalcon\Mvc\View->processRender
#4Phalcon\Mvc\View->render
#5Phalcon\Mvc\Application->handle
/home/xpatlink/apps/xpatweb/public/index.php (262)
<?php
// 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;
 
    
 (new \Phalcon\Debug)->listen();
 
 
//echo phpinfo(); exit;
 
define('BASE_PATH', dirname(__DIR__));
define("BASE_URL", 'https://'. $_SERVER['HTTP_HOST']);
define('APP_PATH', BASE_PATH . '/Xpatlink');
define('HOMEIMAGE_PATH', BASE_PATH . '/public/images/homepage/');
define('CATEGORY_BANNER', BASE_PATH . '/public/images/categorybanners/');
define('MAGAZINE_PICTURE', BASE_PATH . '/public/images/issues/');
define('ADVERTS_PATH', BASE_PATH . '/public/images/xpatlink/');
define('ADTESTS_PATH', BASE_PATH . '/public/images/xpatlinktest/');
define('EVENTS_PATH', BASE_PATH . '/public/images/events/');
define('XPRESSION_PATH', BASE_PATH . '/public/images/xpression/');
define('XFOOD_PATH', BASE_PATH . '/public/images/xfood/');
define('XDEALS_PATH', BASE_PATH . '/public/images/xdeals/');
 
define('CATEGORYOG_PATH', BASE_PATH . '/public/images/categoryog/');
 
    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();
 
    //Specify routes for modules
    $di->set('router', function () {
 
        $router = new Router();
 
        $router->setDefaultModule("user");
 
        $router->add(
            "/:controller/:action",
            array(
                "module"     => 'user',
                "controller" => 1,
                "action"     => 2
            ));
 
        // $router->add(
        //     "/:controller/:action/:params",
        //     array(
        //         "module"     => 'user',
        //         "controller" => 1,
        //         "action"     => 2,
        //         "params"     => 3
        //     ));
 
        $router->add('/:controller/:action/:params',
        array(
            "module"     => 'user',
            "controller"=>1,
            "action"=>2,
            "params"=>3
        )
        )->convert('action', function($action){
            return lcfirst(Phalcon\Text::camelize($action));
        });
 
 
 
 
        return $router;
    });
 
    
 
 
require_once(APP_PATH . '/Library/DiFile.php');
   
    $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,
        ]);
     });
 
 
$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__ . '/../../Xpatlink/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('advertise',function () {
 
            include APP_PATH . '/Services/Advertise.php';
            return new Advertise();
        },
        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(
            'user' => array(
                'className' => 'Xpatlink\Modules\User\Module',
                'path'      => APP_PATH.'/Modules/User/Module.php',  
 
            ),
            'admin' => array(
                'className' => 'Xpatlink\Modules\Admin\Module',
                'path'      => APP_PATH.'/Modules/Admin/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/xpression/view/63-STRUGGLING TO BE AN ADULT
KeyValue
PHP_INI_SCAN_DIR/etc/php.d/:/home/xpatlink/apps/xpatweb/
USERxpatlink
HOME/home/xpatlink
SCRIPT_NAME/public/index.php
REQUEST_URI/xpression/view/63-STRUGGLING%20TO%20BE%20AN%20ADULT
QUERY_STRING_url=/xpression/view/63-STRUGGLING TO BE AN ADULT
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.1
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/public/xpression/view/63-STRUGGLING TO BE AN ADULT
REDIRECT_QUERY_STRING_url=/xpression/view/63-STRUGGLING TO BE AN ADULT
REMOTE_PORT52548
SCRIPT_FILENAME/home/xpatlink/apps/xpatweb/public/index.php
SERVER_ADMIN[no address given]
CONTEXT_DOCUMENT_ROOT/home/xpatlink/apps/xpatweb/
CONTEXT_PREFIX/
REQUEST_SCHEMEhttp
DOCUMENT_ROOT/home/xpatlink/apps/xpatweb
REMOTE_ADDR44.222.134.250
SERVER_PORT80
SERVER_ADDR127.0.0.1
SERVER_NAMExpatlink.info
SERVER_SOFTWAREApache
SERVER_SIGNATURE<address>Apache Server at xpatlink.info Port 80</address>\n
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_ACCEPT_ENCODINGbr,gzip
HTTP_IF_MODIFIED_SINCETue, 16 Apr 2024 16:05:51 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/)
HTTP_CONNECTIONupgrade
HTTP_X_FORWARDED_SSLon
HTTP_X_FORWARDED_PROTOhttps
HTTP_HTTPSon
HTTP_FORWARDED_REQUEST_URI/xpression/view/63-STRUGGLING%20TO%20BE%20AN%20ADULT
HTTP_X_FORWARDED_SERVERxpatlink.info
HTTP_X_FORWARDED_HOSTxpatlink.info
HTTP_HOSTxpatlink.info
proxy-nokeepalive1
HTTPSon
UNIQUE_IDZwB0f@vWUkUeDTZ0NR@NTQAAABQ
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_UNIQUE_IDZwB0f@vWUkUeDTZ0NR@NTQAAABQ
REDIRECT_REDIRECT_STATUS200
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_UNIQUE_IDZwB0f@vWUkUeDTZ0NR@NTQAAABQ
FCGI_ROLERESPONDER
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1728083071.1246
REQUEST_TIME1728083071
#Path
0/home/xpatlink/apps/xpatweb/public/index.php
1/home/xpatlink/apps/xpatweb/Xpatlink/Config/config.php
2/home/xpatlink/apps/xpatweb/Xpatlink/Library/DiFile.php
3/home/xpatlink/apps/xpatweb/Xpatlink/Modules/User/Module.php
4/home/xpatlink/apps/xpatweb/Xpatlink/Modules/User/controllers/XpressionController.php
5/home/xpatlink/apps/xpatweb/Xpatlink/Modules/User/controllers/ControllerBase.php
6/home/xpatlink/apps/xpatweb/Xpatlink/Modules/User/models/Xpression.php
7/home/xpatlink/apps/xpatweb/cache/user/user_home_xpatlink_apps_xpatweb_xpatlink_modules_user_views_xpression_view.volt.php
8/home/xpatlink/apps/xpatweb/cache/user/user_home_xpatlink_apps_xpatweb_xpatlink_layouts_default.volt.php
Memory
Usage2097152