Phalcon Framework 5.11.0

ParseError: Unclosed '{' on line 54

/srv/sites/simplyfit.shtest.pl/cache/_srv_sites_simplyfit.shtest.pl_themes_simplyfit_layouts_headers_default.twig.php (69)
# Phalcon\Mvc\View\Engine\Volt -> render
# Phalcon\Mvc\View -> engineRender
# Phalcon\Mvc\View -> partial
# Phalcon\Mvc\View\Engine\AbstractEngine -> partial
/srv/sites/simplyfit.shtest.pl/cache/_srv_sites_simplyfit.shtest.pl_themes_simplyfit_articles_frontend_index.twig.php (60)
                            
# Phalcon\Mvc\View\Engine\Volt -> render
# Phalcon\Mvc\View -> engineRender
# Phalcon\Mvc\View -> processRender
# Phalcon\Mvc\View -> render
/srv/sites/simplyfit.shtest.pl/app/vendor/Dispatcher/Plugin.php (120)
<?php
 
namespace SH\Dispatcher;
 
use Phalcon\Di\Injectable;
use Phalcon\Events\Event;
use Phalcon\Http\ResponseInterface;
use Phalcon\Mvc\Dispatcher;
use SH\Application;
 
/**
 * Class Plugin
 * @package SH\Dispatcher
 * @property Application $application
 */
class Plugin extends Injectable
{
    function beforeDispatch(Event $event, Dispatcher $dispatcher): bool
    {
        $controllerClass = $dispatcher->getControllerClass();
        $activeMethod = $dispatcher->getActiveMethod();
 
        if (str_contains($controllerClass, 'FrontendController') || str_contains($controllerClass, 'AclController')) {
            return true;
            $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/auth/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);
            }
        }
    }
}
                            
# SH\Dispatcher\Plugin -> afterDispatchLoop
# Phalcon\Events\Manager -> fireQueue
# Phalcon\Events\Manager -> fire
# Phalcon\Dispatcher\AbstractDispatcher -> dispatch
# Phalcon\Mvc\Application -> handle
/srv/sites/simplyfit.shtest.pl/app/vendor/Application.php (34)
<?php
 
namespace SH;
 
use Phalcon\Application\Exception;
 
//use const SH\IS_ADMIN;
 
/**
 * Class Application
 * @package SH
 * @property \SH\Views\MenuGenerator $MenuGenerator
 * @property \Phalcon\Autoload\Loader $loader
 */
class Application extends \Phalcon\Mvc\Application
{
    protected $_moduleNamespace = '';
 
    public function handle($uri = ''): \Phalcon\Http\ResponseInterface|bool
    {
        $nameSpaces = $this->loader->getNamespaces();
 
        if (isset($nameSpaces['app\modules\\']) === false) {
            throw new Exception("namespace app modules not defined");
        }
 
        $key = array_key_first((array)$nameSpaces['app\modules\\']);
        $this->_moduleNamespace = $nameSpaces['app\modules\\'][$key];
        $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 (file_exists($modulePath . '/params/router_api.php')) {
                require_once $modulePath . '/params/router_api.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;
    }
}
                            
# SH\Application -> handle
/srv/sites/simplyfit.shtest.pl/public/index.php (54)
<?php
 
function dump ($stuff) {
    echo '<pre>' . print_r($stuff, true) . '</pre>'; 
}
 
function dd ($stuff) {
    dump($stuff);
}
 
date_default_timezone_set('Europe/Warsaw');
 
$admin_dir = 'admin';
 
defined('BASE_PATH') or define('BASE_PATH', dirname(__DIR__));
defined('APP_PATH') or define('APP_PATH', BASE_PATH . '/app');
const 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);
}
 
try {
    $loader = include APP_PATH . '/config/web/loader.php';
 
    $di = new Phalcon\Di\Di();
    $di->setShared('loader', $loader);
 
    include APP_PATH . '/config/web/services.php';
 
    $config = $di->get('config');
 
    if ($config->application->isDevelopment) {
        error_reporting(E_ALL);
        ini_set('display_errors', 1);
 
        $debug = new \Phalcon\Support\Debug();
        $debug->listen();
    }
 
    /**
     * Handle the request
     */
    $application = new \SH\Application($di);
    $di->setShared('application', $application);
 
    $application->handle($_SERVER['REQUEST_URI'])->send();
} catch (\Exception $e) {
    echo $e->getMessage();
}
                            
Key
Value
_url /artykuly
kategorie 32,10,9,8
Key
Value
USER www-data
HOME /var/www
SCRIPT_NAME /index.php
REQUEST_URI /artykuly?kategorie=32%2C10%2C9%2C8
QUERY_STRING _url=/artykuly&kategorie=32%2C10%2C9%2C8
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_QUERY_STRING _url=/artykuly&kategorie=32%2C10%2C9%2C8
REDIRECT_URL /artykuly
REMOTE_PORT 37837
SCRIPT_FILENAME /srv/sites/simplyfit.shtest.pl/public/index.php
SERVER_ADMIN admin@smartheads.pl
CONTEXT_DOCUMENT_ROOT /srv/sites/simplyfit.shtest.pl/public
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /srv/sites/simplyfit.shtest.pl/public
REMOTE_ADDR 216.73.216.230
SERVER_PORT 443
SERVER_ADDR 100.100.0.130
SERVER_NAME www.simplyfit.shtest.pl
SERVER_SOFTWARE Apache/2.4.52 (Ubuntu)
SERVER_SIGNATURE <address>Apache/2.4.52 (Ubuntu) Server at www.simplyfit.shtest.pl Port 443</address>\n
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
HTTP_HOST www.simplyfit.shtest.pl
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_COOKIE PHPSESSID=58b2952b143792c6757216e940740bc0
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
proxy-nokeepalive 1
SSL_TLS_SNI www.simplyfit.shtest.pl
HTTPS on
UNIQUE_ID aiiWzt3Ha3EvAdJGNbsYxAAAAQ0
REDIRECT_STATUS 200
REDIRECT_SSL_TLS_SNI www.simplyfit.shtest.pl
REDIRECT_HTTPS on
REDIRECT_UNIQUE_ID aiiWzt3Ha3EvAdJGNbsYxAAAAQ0
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1781044942.0418
REQUEST_TIME 1781044942
#
Path
0 /srv/sites/simplyfit.shtest.pl/public/index.php
1 /srv/sites/simplyfit.shtest.pl/app/config/web/loader.php
2 /srv/sites/simplyfit.shtest.pl/app/config/web/services.php
3 /srv/sites/simplyfit.shtest.pl/app/vendor/Auth.php
4 /srv/sites/simplyfit.shtest.pl/app/vendor/Query/Builder.php
5 /srv/sites/simplyfit.shtest.pl/app/vendor/DatabaseManager.php
6 /srv/sites/simplyfit.shtest.pl/app/config/web/config.php
7 /srv/sites/simplyfit.shtest.pl/app/vendor/Application.php
8 /srv/sites/simplyfit.shtest.pl/app/modules/acl/Web.php
9 /srv/sites/simplyfit.shtest.pl/app/vendor/Info/NamespaceInfo.php
10 /srv/sites/simplyfit.shtest.pl/app/vendor/Info/AclInfo.php
11 /srv/sites/simplyfit.shtest.pl/app/modules/admins/Web.php
12 /srv/sites/simplyfit.shtest.pl/app/modules/auth/Web.php
13 /srv/sites/simplyfit.shtest.pl/app/modules/auth/params/router.php
14 /srv/sites/simplyfit.shtest.pl/app/modules/auth/params/router_api.php
15 /srv/sites/simplyfit.shtest.pl/app/modules/categories/Web.php
16 /srv/sites/simplyfit.shtest.pl/app/modules/categories/params/router.php
17 /srv/sites/simplyfit.shtest.pl/app/modules/cities/Web.php
18 /srv/sites/simplyfit.shtest.pl/app/modules/cities/params/router.php
19 /srv/sites/simplyfit.shtest.pl/app/modules/config/Web.php
20 /srv/sites/simplyfit.shtest.pl/app/modules/config/modules/settlements/Web.php
21 /srv/sites/simplyfit.shtest.pl/app/modules/contact/Web.php
22 /srv/sites/simplyfit.shtest.pl/app/modules/contact/params/router.php
23 /srv/sites/simplyfit.shtest.pl/app/modules/dietician/Web.php
24 /srv/sites/simplyfit.shtest.pl/app/modules/diets/Web.php
25 /srv/sites/simplyfit.shtest.pl/app/modules/diets/params/router.php
26 /srv/sites/simplyfit.shtest.pl/app/modules/main/Web.php
27 /srv/sites/simplyfit.shtest.pl/app/modules/main/params/router.php
28 /srv/sites/simplyfit.shtest.pl/app/modules/main/params/router_api.php
29 /srv/sites/simplyfit.shtest.pl/app/modules/pages/Web.php
30 /srv/sites/simplyfit.shtest.pl/app/modules/pages/params/router.php
31 /srv/sites/simplyfit.shtest.pl/app/modules/pages/modules/articles/Web.php
32 /srv/sites/simplyfit.shtest.pl/app/modules/pages/modules/articles/params/router.php
33 /srv/sites/simplyfit.shtest.pl/app/modules/pages/modules/home/Web.php
34 /srv/sites/simplyfit.shtest.pl/app/modules/pages/modules/seo/Web.php
35 /srv/sites/simplyfit.shtest.pl/app/modules/pages/modules/sites/Web.php
36 /srv/sites/simplyfit.shtest.pl/app/modules/payout/Web.php
37 /srv/sites/simplyfit.shtest.pl/app/modules/previews/Web.php
38 /srv/sites/simplyfit.shtest.pl/app/modules/previews/params/router.php
39 /srv/sites/simplyfit.shtest.pl/app/modules/profile/Web.php
40 /srv/sites/simplyfit.shtest.pl/app/modules/profile/params/router.php
41 /srv/sites/simplyfit.shtest.pl/app/modules/promotions/Web.php
42 /srv/sites/simplyfit.shtest.pl/app/modules/reviews/Web.php
43 /srv/sites/simplyfit.shtest.pl/app/modules/reviews/params/router.php
44 /srv/sites/simplyfit.shtest.pl/app/modules/sale/Web.php
45 /srv/sites/simplyfit.shtest.pl/app/modules/sale/params/router.php
46 /srv/sites/simplyfit.shtest.pl/app/modules/sale/params/router_api.php
47 /srv/sites/simplyfit.shtest.pl/app/modules/sale/modules/orders/Web.php
48 /srv/sites/simplyfit.shtest.pl/app/modules/sale/modules/orderssf/Web.php
49 /srv/sites/simplyfit.shtest.pl/app/modules/static/Web.php
50 /srv/sites/simplyfit.shtest.pl/app/modules/static/params/router.php
51 /srv/sites/simplyfit.shtest.pl/app/modules/stats/Web.php
52 /srv/sites/simplyfit.shtest.pl/app/modules/uploader/Web.php
53 /srv/sites/simplyfit.shtest.pl/app/modules/uploader/params/router.php
54 /srv/sites/simplyfit.shtest.pl/app/modules/user/Web.php
55 /srv/sites/simplyfit.shtest.pl/app/modules/user/params/router.php
56 /srv/sites/simplyfit.shtest.pl/app/modules/user/params/router_api.php
57 /srv/sites/simplyfit.shtest.pl/app/modules/visits/Web.php
58 /srv/sites/simplyfit.shtest.pl/app/modules/visits/params/router.php
59 /srv/sites/simplyfit.shtest.pl/app/modules/widgets/Web.php
60 /srv/sites/simplyfit.shtest.pl/app/config/params.php
61 /srv/sites/simplyfit.shtest.pl/app/vendor/Dispatcher/Plugin.php
62 /srv/sites/simplyfit.shtest.pl/app/modules/pages/modules/articles/controllers/FrontendController.php
63 /srv/sites/simplyfit.shtest.pl/app/vendor/Controllers/FrontendController.php
64 /srv/sites/simplyfit.shtest.pl/app/vendor/Controllers/Controller.php
65 /srv/sites/simplyfit.shtest.pl/app/translation/pl.php
66 /srv/sites/simplyfit.shtest.pl/app/config/uparams.php
67 /srv/sites/simplyfit.shtest.pl/app/modules/pages/models/ArticlesTable.php
68 /srv/sites/simplyfit.shtest.pl/app/modules/categories/models/CategoriesTable.php
69 /srv/sites/simplyfit.shtest.pl/app/vendor/Views/Filters.php
70 /srv/sites/simplyfit.shtest.pl/cache/_srv_sites_simplyfit.shtest.pl_themes_simplyfit_articles_frontend_index.twig.php
71 /srv/sites/simplyfit.shtest.pl/app/vendor/Views/System.php
Memory
Usage 2097152