Phalcon Framework 4.1.2

Error: Call to undefined method Phalcon\Mvc\Router::getRewriteUri()

/srv/dietetykpro/sklep.dietetykpro.pl/cache/_srv_dietetykpro_sklep.dietetykpro.pl_themes_dietetykpro_main_frontend_notfound.twig.php (149)
#0unknown
#1Phalcon\Mvc\View\Engine\Volt->render
#2Phalcon\Mvc\View->engineRender
#3Phalcon\Mvc\View->processRender
#4Phalcon\Mvc\View->render
/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Dispatcher/Plugin.php (116)
<?php
 
namespace SH\Dispatcher;
 
use Phalcon\Di\Injectable;
use Phalcon\Events\Event;
use Phalcon\Http\ResponseInterface;
use Phalcon\Mvc\Dispatcher;
 
/**
 * Class Plugin
 * @package SH\Dispatcher
 * @property \SH\Application $application
 */
class Plugin extends Injectable
{
    function beforeDispatch(Event $event, Dispatcher $dispatcher)
    {
        $controllerClass = $dispatcher->getControllerClass();
        $activeMethod = $dispatcher->getActiveMethod();
 
        if (preg_match('/FrontendController/', $controllerClass) || preg_match('/AclController/', $controllerClass)) {
            $user = $this->user->getIdentity();
 
            if ($user) {
                if ($user->role && $user->role !== 'su') {
                    $annotations = $this->annotations->get($controllerClass);
 
                    if ($annotations->getClassAnnotations() && $annotations->getClassAnnotations()->has('Acl')) {
                        $aclResource = $annotations->getClassAnnotations()->get('Acl');
                        $aclResource = $aclResource->getNamedParameter('label');
 
                        $aclMethod = $annotations->getMethodsAnnotations();
 
                        if (isset($aclMethod[$activeMethod])) {
                            $aclMethod = $aclMethod[$activeMethod];
 
                            if ($aclMethod->has('Acl')) {
                                $aclMethod = $aclMethod->get('Acl');
                                $aclMethod = $aclMethod->getNamedParameter('label');
 
                                if ($this->acl->isAllowed($user->role, $aclResource, $aclMethod) === false) {
                                    $this->response->redirect('/403');
 
                                    return false;
                                } else {
                                    return true;
                                }
                            }
                        }
                    }
                }
            }
        } else {
            $annotations = $this->annotations->get($controllerClass);
 
            if ($annotations->getClassAnnotations() && $annotations->getClassAnnotations()->has('Acl')) {
                $aclResource = $annotations->getClassAnnotations()->get('Acl');
                $aclResource = $aclResource->getNamedParameter('label');
 
                $aclMethod = $annotations->getMethodsAnnotations();
 
                if (isset($aclMethod[$activeMethod])) {
                    $aclMethod = $aclMethod[$activeMethod];
 
                    if ($aclMethod->has('Acl')) {
                        $aclMethod = $aclMethod->get('Acl');
                        $aclMethod = $aclMethod->getNamedParameter('label');
 
                        if ($this->acl->isAllowed($this->auth->getRoleName(), $aclResource, $aclMethod) === false) {
                            if ($this->auth->isGuest) {
                                $this->response->redirect('/admin/user/login');
                            } else {
                                $this->response->redirect('/admin/main/code403');
                            }
 
                            return false;
                        } else {
                            return true;
                        }
                    }
                }
            }
        }
 
        return true;
    }
 
    function beforeDispatchLoop(Event $event, Dispatcher $dispatcher)
    {
        $module = $this->application->getModule($dispatcher->getModuleName());
 
        if (is_array($module) && isset($module['className'])) {
            $module = $this->di->get($module['className']);
        }
        $namespace = $module->getNamespace();
        $namespace .= '\controllers';
 
        $dispatcher->setNamespaceName($namespace);
    }
 
    function afterDispatchLoop(Event $event, Dispatcher $dispatcher)
    {
        $results = $dispatcher->getReturnedValue();
 
        if ($results instanceof ResponseInterface || $results === false) {
            $this->view->disable();
        } else {
            if (is_array($results) || is_null($results)) {
                if ($results) {
                    $this->view->setVars($results);
                } else {
                    $results = [];
                }
 
                $this->view->render($this->router->getModuleName() . '/' . $dispatcher->getControllerName(), $dispatcher->getActionName(), $results);
            }
        }
    }
}
#5SH\Dispatcher\Plugin->afterDispatchLoop
#6Phalcon\Events\Manager->fireQueue
#7Phalcon\Events\Manager->fire
#8Phalcon\Dispatcher\AbstractDispatcher->dispatch
#9Phalcon\Mvc\Application->handle
/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Application.php (30)
<?php
 
namespace SH;
 
use Phalcon\Application\Exception;
 
/**
 * Class Application
 * @package SH
 * @property \SH\Views\MenuGenerator $MenuGenerator
 */
class Application extends \Phalcon\Mvc\Application
{
    protected $_moduleNamespace = '';
 
    public function handle($uri = null)
    {
        $nameSpaces = $this->loader->getNamespaces();
 
        if (isset($nameSpaces['app\modules']) === false) {
            throw new Exception("namespace app modules not defined");
        }
 
        $this->_moduleNamespace = $nameSpaces['app\modules'][0];
        $dirs = scandir($this->_moduleNamespace);
 
        $modules = $this->handleModules($this->_moduleNamespace, $dirs);
        $this->registerModules($modules);
 
        return parent::handle($uri);
    }
 
    protected function handleModules(string $path, array $dirs): array
    {
        $modules = [];
 
        foreach ($dirs as $dir) {
            $modulePath = "{$path}{$dir}";
            if (is_dir($modulePath) === false) {
                continue;
            } else {
                if (in_array($dir, ['.', '..'])) {
                    continue;
                } else {
                    if (file_exists($modulePath . "/Web.php") === false) {
                        continue;
                    }
                }
            }
 
            $moduleClass = str_replace($this->_moduleNamespace, '', $modulePath);
            $moduleClass = str_replace('/', '\\', $moduleClass);
            $moduleClass = 'app\modules\\' . $moduleClass . '\Web';
 
            $module = $this->getDI()->get($moduleClass);
            $module->registerAutoloaders($this->getDI());
            $module->registerServices($this->getDI());
 
            if (file_exists($modulePath . '/params/router.php')) {
                require_once $modulePath . '/params/router.php';
            }
 
            if (IS_ADMIN) {
                if (file_exists($modulePath . '/params/menu.php')) {
                    require_once $modulePath . '/params/menu.php';
                }
            }
 
            $modules[$dir] = ["className" => $moduleClass];
 
            $subModules = "{$modulePath}/modules/";
            if (is_dir($subModules)) {
                $subDirs = scandir($subModules);
                $subModules = $this->handleModules($subModules, $subDirs);
 
                $modules = array_merge($modules, $subModules);
            }
        }
 
        return $modules;
    }
}
#10SH\Application->handle
/srv/dietetykpro/sklep.dietetykpro.pl/public/index.php (59)
<?php
 
  $admin_dir = 'admin';
 
  defined('BASE_PATH') or define('BASE_PATH', dirname(__DIR__));
  defined('APP_PATH') or define('APP_PATH', BASE_PATH . '/app');
  define ('IS_CONSOLE', false);
 
  if (preg_match('/^\/' . $admin_dir . '\/$/', $_SERVER['REQUEST_URI'])) {
    header('Location: /admin');
    die;
  }
 
  if (preg_match('/' . $admin_dir . '/', $_SERVER['REQUEST_URI'])) {
    defined('IS_ADMIN') or define('IS_ADMIN', true);
  } else {
    defined('IS_ADMIN') or define('IS_ADMIN', false);
  }
 
  $config = null;
  $application = null;
 
  try {
    /**
     * Include Autoloader
     */
    $loader = include APP_PATH . '/config/web/loader.php';
 
    /**
     * The FactoryDefault Dependency Injector automatically registers
     * the services that provide a full stack framework.
     */
        $di = new \Phalcon\Di();
        $di->setShared('loader', $loader);
    /**
     * Read services
     */
    include APP_PATH . '/config/web/services.php';
 
    /**
     * Get config service for use in inline setup below
     */
    $config = $di->getConfig();
 
        if ($config->application->isDevelopment) {
            error_reporting(E_ALL);
            ini_set('display_errors', 1);
 
            $debug = new \Phalcon\Debug();
            $debug->listen();
        }
 
        /**
         * Handle the request
         */
        $application = new \SH\Application($di);
        $di->setShared('application', $application);
 
        $application->handle($_SERVER['REQUEST_URI'])->send();
 
  } catch (\Exception $e) {
    if (!(is_null($config) || is_null($application))) {
      if ($config->application->isDevelopment) {
        throw $e;
      } else {
        $application->response->redirect('/');
      }
    }
  }
KeyValue
_url/koszyk
KeyValue
USERwww-data
HOME/var/www
SCRIPT_NAME/index.php
REQUEST_URI/koszyk
QUERY_STRING_url=/koszyk
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.1
GATEWAY_INTERFACECGI/1.1
REDIRECT_QUERY_STRING_url=/koszyk
REDIRECT_URL/koszyk
REMOTE_PORT4205
SCRIPT_FILENAME/srv/dietetykpro/sklep.dietetykpro.pl/public/index.php
SERVER_ADMINadmin@smartheads.pl
CONTEXT_DOCUMENT_ROOT/srv/dietetykpro/sklep.dietetykpro.pl/public
CONTEXT_PREFIX
REQUEST_SCHEMEhttps
DOCUMENT_ROOT/srv/dietetykpro/sklep.dietetykpro.pl/public
REMOTE_ADDR52.15.72.229
SERVER_PORT443
SERVER_ADDR100.100.0.110
SERVER_NAMEsklep.dietetykpro.pl
SERVER_SOFTWAREApache/2.4.52 (Ubuntu)
SERVER_SIGNATURE<address>Apache/2.4.52 (Ubuntu) Server at sklep.dietetykpro.pl Port 443</address>\n
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
HTTP_HOSTsklep.dietetykpro.pl
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*/*
proxy-nokeepalive1
SSL_TLS_SNIsklep.dietetykpro.pl
HTTPSon
UNIQUE_IDZz7T68Oe6LImNI6t6sCG1AAAAE4
REDIRECT_STATUS200
REDIRECT_SSL_TLS_SNIsklep.dietetykpro.pl
REDIRECT_HTTPSon
REDIRECT_UNIQUE_IDZz7T68Oe6LImNI6t6sCG1AAAAE4
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1732170731.7444
REQUEST_TIME1732170731
#Path
0/srv/dietetykpro/sklep.dietetykpro.pl/public/index.php
1/srv/dietetykpro/sklep.dietetykpro.pl/app/config/web/loader.php
2/srv/dietetykpro/sklep.dietetykpro.pl/app/config/web/config.php
3/srv/dietetykpro/sklep.dietetykpro.pl/app/plugins/swiftmailer/lib/swift_required.php
4/srv/dietetykpro/sklep.dietetykpro.pl/app/plugins/swiftmailer/lib/classes/Swift.php
5/srv/dietetykpro/sklep.dietetykpro.pl/app/plugins/PHPExcel/Classes/PHPExcel.php
6/srv/dietetykpro/sklep.dietetykpro.pl/app/plugins/PHPExcel/Classes/PHPExcel/Autoloader.php
7/srv/dietetykpro/sklep.dietetykpro.pl/app/plugins/PHPExcel/Classes/PHPExcel/Shared/String.php
8/srv/dietetykpro/sklep.dietetykpro.pl/app/config/web/services.php
9/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Auth.php
10/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Query/Builder.php
11/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/DatabaseManager.php
12/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Application.php
13/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/acl/Web.php
14/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Info/NamespaceInfo.php
15/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Info/AclInfo.php
16/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/admins/Web.php
17/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/crm/Web.php
18/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/discounts/Web.php
19/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/howto/Web.php
20/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/main/Web.php
21/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/main/params/router.php
22/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/orders/Web.php
23/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/photos/Web.php
24/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/products/Web.php
25/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/stats/Web.php
26/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/user/Web.php
27/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/widgets/Web.php
28/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/www/Web.php
29/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/www/modules/newsletter/Web.php
30/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/www/modules/newsletter/params/router.php
31/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/www/modules/pages/Web.php
32/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/www/modules/pages/params/router.php
33/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/www/modules/seo/Web.php
34/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Dispatcher/Plugin.php
35/srv/dietetykpro/sklep.dietetykpro.pl/app/modules/main/controllers/FrontendController.php
36/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Controllers/FrontendController.php
37/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Controllers/Controller.php
38/srv/dietetykpro/sklep.dietetykpro.pl/app/vendor/Views/Filters.php
39/srv/dietetykpro/sklep.dietetykpro.pl/cache/_srv_dietetykpro_sklep.dietetykpro.pl_themes_dietetykpro_main_frontend_notfound.twig.php
Memory
Usage2097152