Phalcon Framework 3.4.5

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

/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (418)
#0Phalcon\Mvc\Dispatcher->_throwDispatchException(ImagesController handler class cannot be loaded, 2)
#1Phalcon\Dispatcher->dispatch()
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (418)
<?php
 
namespace App;
 
use Application\Cache\Manager as CacheManager;
use Application\Mvc\Helper\CmsCache;
use Konsol\Model\Options;
 
 
class Bootstrap{
 
    public function run(){
 
        try {
 
            $this->initDefined();
 
            $di = new \Phalcon\DI\FactoryDefault();
            $loader = new \Phalcon\Loader();
 
            // Config
            $config = require_once PATHS['APPS'] . '/config/application.php';
 
 
            $config = new \Phalcon\Config($config);
 
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            $di->set('config', $config);
 
 
            // URL
            $url = new \Phalcon\Mvc\Url();
            $url->setBasePath($config->base_path);
            $url->setBaseUri($config->base_path);
            $di->set('url', $url);
 
 
 
            // Database
            $di->set('db', new \Phalcon\Db\Adapter\Pdo\Mysql([
                "host" => $config->database->host,
                "username" => $config->database->username,
                "password" => $config->database->password,
                "dbname" => $config->database->dbname,
                "charset" => $config->database->charset,
                "port" => $config->database->port,
            ]));
 
 
            //SET MODULES
            $this->getModules($di);
 
 
            // Loader
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            // View
            $this->initView($di,$config);
 
 
            // Cache
            $this->initCache($di);
 
            // Application
            $application = new \Phalcon\Mvc\Application();
            $application->registerModules($config->modules->toArray());
 
 
            // Events Manager, Dispatcher
            $this->initEventManager($di);
 
 
            $di->set('session', function () use ($di) {
                $session = new \Phalcon\Session\Adapter\Files();
                session_name(HOST_HASH);
                $session->start();
                return $session;
            });
 
            $di->set('cookie', function () {
                $cookies = new \Phalcon\Http\Response\Cookies();
                $cookies->useEncryption(true);
                return $cookies;
            });
 
            $di->set('crypt', function () {
                $crypt = new \Phalcon\Crypt();
                $crypt->setCipher('aes-256-ctr');
                $crypt->setKey("T4\xb1\x8d\xa9\x98\x05\\\x8c\xbe\x1d\x07&[\x99\x18\xa4~Lc1\xbeW\xb3");
                return $crypt;
            });
 
            $di->set('localization', new \YobisiKonsol\Plugin\Localization());
 
            $di->set('helper', new \Application\Mvc\Helper());
 
            $di->set('auth', new \Konsol\Model\Auth());
 
            $di->set('acl', new \YobisiKonsol\Plugin\Acl());
 
 
            // JS Assets
            $this->initAssetsManager($di);
 
 
            // Toast helper
            $di->set('toast', new \Application\Mvc\Helper\Toast());
 
            // Flash helper
            $di->set('flash', new \Phalcon\Flash\Session());
 
 
            // Routing
            $this->initRouting($application, $di);
 
            $application->setDI($di);
 
 
            // Main dispatching process
            $response = $this->dispatch($di);
            $response->send();
 
 
        } catch (\Exception $e) {
 
            return $this->initCatch($di,  $e,[
                "code" => "bootstrap_initCatch",
                "message" => "Uygulama çalıştırılırken hata oluştu"
            ]);
 
        }
 
    }
 
    private function initRouting($application, $di){
 
 
 
 
        foreach ($application->getModules() as $module) {
            try {
                $initClassName = str_replace('\Module', '\Init', $module['className']);
                if (class_exists($initClassName)) {
                    new $initClassName();
                }
 
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Init.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
 
            }
        }
 
 
        $router = new \Application\Mvc\Router\DefaultRouter();
        $router->setDi($di);
        foreach ($application->getModules() as $module) {
            try {
                $routesClassName = str_replace('\Module', '\Routes', $module['className']);
                if (class_exists($routesClassName)) {
                    $routesClass = new $routesClassName();
                    $router = $routesClass->init($router);
                }
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Routes.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
            }
        }
 
        $di->set('router', $router);
 
    }
 
 
    private function initAssetsManager($di){
 
        $assetsManager = new \Application\Assets\Manager();
 
        $di->set('assets', $assetsManager);
    }
 
    private function initEventManager($di)
    {
 
 
        $eventsManager = new \Phalcon\Events\Manager();
        $dispatcher    = new \Phalcon\Mvc\Dispatcher();
 
 
        $eventsManager->attach("dispatch", function ($event, $dispatcher, $exception) use ($di) {
            if ($event->getType() == 'beforeException') {
 
                switch ($exception->getCode()) {
                    case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                    case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
 
                        return $this->initCatch($di, $exception,[
                            "code" => "dispatch:beforeException",
                            "message" => "Sayfa çalıştırılırken beklenmedik hata oluştu"
                        ]);
                }
            }//error pages redirect
        });
 
        /*
         * Plugins
         */
        $events  = [];
        $plugins = glob(PATHS['APPS']  .'plugins/*.php');
 
        foreach ($plugins as $plugin_path):
 
            $plugin_name = rtrim(basename($plugin_path), ".php");
            $namespace = "YobisiKonsol\Plugin\\" . $plugin_name;
 
            $variables = get_class_vars($namespace);
            if(!$event_type = $variables['event_type']) continue;
 
            $events[$event_type][] = $namespace;//plugin
 
        endforeach;
 
        foreach ($events as $event_type => $namespaces):
 
            $eventsManager->attach($event_type, function ($event, $dispatcher) use ($di, $namespaces) {
                foreach ($namespaces as $namespace):
                    $item = new $namespace();
                    if(method_exists($item,"execute")) $item->execute();
                endforeach;
            });
 
        endforeach;
 
 
 
 
        // Profiler
 
        //$is_profiler = Options::findFirstByKey('profiler');
        $is_profiler = @$_GET['profiler'] ?? false;
        if ($is_profiler) {
            $profiler = new \Phalcon\Db\Profiler();
            $di->set('profiler', $profiler);
            $eventsManager->attach('db', function ($event, $db) use ($profiler) {
 
                if ($event->getType() == 'beforeQuery') {
                    $profiler->startProfile($db->getSQLStatement());
                }
                if ($event->getType() == 'afterQuery') {
                    $profiler->stopProfile();
                }
            });
            $di->get('view')->setVar('profiler',$di->get('profiler'));
        }
 
        $db = $di->get('db');
        $db->setEventsManager($eventsManager);
 
        $dispatcher->setEventsManager($eventsManager);
        $di->set('dispatcher', $dispatcher);
    }
 
    private function initView($di,$config = [])
    {
 
 
        $view = new \Phalcon\Mvc\View();
 
        define('MAIN_VIEW_PATH', PATHS['MODULES'] . "Konsol/Views/");
 
        $view->setViewsDir(MAIN_VIEW_PATH);
        $view->setMainView(MAIN_VIEW_PATH . '/konsol');
        $view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
        $view->setLayout('/konsol');
        $view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
 
 
        // Volt
        $volt = new \Application\Mvc\View\Engine\Volt($view, $di);
 
 
        $volt->setOptions([
            'compiledPath' => PATHS['APPS'] . '/../data/cache/volt/',
            'compileAlways' => (DEBUG_MODE) ? true : false
        ]);
        $volt->initCompiler();
 
 
        $phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
        $viewEngines = [
            ".volt" => $volt,
            ".phtml" => $phtml,
        ];
 
        $view->registerEngines($viewEngines);
 
        $ajax = $di->get('request')->getQuery('_ajax');
 
        if ($ajax) $view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
 
 
        $view->setVar('config',$config);
        $di->set('view', $view);
 
        return $view;
    }
 
    private function initCache($di)
    {
        $config = $di->get('config');
 
 
        $cacheFrontend = new \Phalcon\Cache\Frontend\Data([
            "lifetime" => 60,
            "prefix" => HOST_HASH,
        ]);
 
        $cache = null;
        switch ($config->cache) {
            case 'memcache':
                $cache = new \Phalcon\Cache\Backend\Memcache(
                    $cacheFrontend, [
                    "host" => $config->memcache->host,
                    "port" => $config->memcache->port,
                ]);
                break;
            case 'memcached':
                $cache = new \Phalcon\Cache\Backend\Libmemcached(
                    $cacheFrontend, [
                    "host" => $config->memcached->host,
                    "port" => $config->memcached->port,
                ]);
                break;
      case 'redis':
        
        $cache = new \Phalcon\Cache\Backend\Redis(
          $cacheFrontend, [
            "host" => $config->redis->host,
            "port" => $config->redis->port,
            "auth" => $config->redis->auth,
            "statsKey" => $config->redis->statsKey,
            "persistent" => $config->redis->persistent,
            "index" => $config->redis->index
          ]);
 
                break;
            default:
                $cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
                    "cacheDir" => PATHS['APPS'] . "/../data/cache/backend/",
                    'lifetime' => 172800
                ]);
        }
 
        \Application\Widget\Proxy::$cache = $cache; // Modules Widget System
 
        $modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
 
        $di->set('cache', $cache, true);
        $di->set('modelsCache', $cache, true);
        $di->set('modelsMetadata', $modelsMetadata);
        $di->set('cacheManager', new CacheManager());
    }
 
    private function dispatch($di){
 
 
        $router = $di->get('router');
 
        $router->handle();
 
 
        $view       = $di->get('view');
        $dispatcher = $di->get('dispatcher');
        $response   = $di->get('response');
 
        $dispatcher->setModuleName($router->getModuleName());
        $dispatcher->setControllerName($router->getControllerName());
        $dispatcher->setActionName($router->getActionName());
        $dispatcher->setParams($router->getParams());
 
        $moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
 
 
        $ModuleClassName = $moduleName . '\Module';
        if (class_exists($ModuleClassName)) {
            $module = new $ModuleClassName();
            $module->registerAutoloaders();
            $module->registerServices($di);
        }
 
        $view->start();
 
        try {
 
            $dispatcher->dispatch();
 
        } catch (\Phalcon\Exception $error) {
 
            return $this->initCatch($di,  $error,[
                "code" => "dispatch:catch",
                "message" => "Uygulama çalıştırılırken beklenmedik hata oluştu"
            ]);
 
        }
 
 
        $view->render(
            $dispatcher->getControllerName(),
            $dispatcher->getActionName(),
            $dispatcher->getParams()
        );
 
        $view->finish();
 
        // AJAX
        $request = $di['request'];
        $_ajax = $request->getQuery('_ajax');
 
        if ($_ajax) {
 
            $view->setLayout('ajax');
 
            $contents = $view->getContent();
 
            $return = new \stdClass();
            $return->status = true;
            $return->title  = $di->get('helper')->title()->get();
            $return->html   = $contents;
 
 
            $headers = $response->getHeaders()->toArray();
            if (isset($headers[404]) || isset($headers[503])) {
                $return->status = false;
            }
            $response->setContentType('application/json', 'UTF-8');
            $response->setContent(json_encode($return));
        } else {
            $response->setContent($view->getContent());
        }
 
        return $response;
    }
 
    private function getModules($di){
 
        try {
 
            $config = $di->get('config');
            $db = $di->get('db');
            $cache = new \Application\Mvc\Helper\CmsCache();
 
 
            if (APPLICATION_ENV == "development") $db->query("SET @@GLOBAL.sql_mode=''");//fix group_by error
 
            $user_modules = $cache::getInstance()->get('modules');
 
 
            if (!$user_modules):
 
                //GET_MODULES
                $statement = $db->prepare('SELECT * FROM modules WHERE status = ? order by priority ASC');
                $statement->execute(array("active"));
                $user_modules = $statement->fetchAll(\Phalcon\Db::FETCH_ASSOC);
 
 
                $cache::getInstance()->save('modules', $user_modules);
 
            endif;
 
 
            //SET_MODULES
            require_once PATHS['APPS'] . '/modules/Application/Loader/Modules.php';
 
            $modules = new \Application\Loader\Modules();
            $modules_config = $modules->modulesConfig($user_modules);
 
 
            foreach ($modules_config['loader']['namespaces'] as $key => $module)
                $config->loader->namespaces[$key] = $module;
 
            foreach ($modules_config['modules'] as $key => $module)
                $config->modules[$key] = $module;
 
 
            return $config;
 
        }catch (\Throwable $e){
 
            $params = [
                "code" => "bootstrap_modules_catch",
                "message" => $e->getMessage(),
                "file" => $e->getFile(),
                "line" => $e->getLine(),
            ];
            return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
        }
 
    }
 
 
    private function initDefined(){
        /*
         * geliştirici modunu açar
         */
 
 
 
        $root_dir = rtrim(__DIR__,'app');
        define('PATHS',[
            "ROOT"     => $root_dir,
            "APPS"     => $root_dir  . 'app/',
            "MODULES"  => $root_dir  . "app/modules/",
            "PLUGINS"  => $root_dir  . "app/plugins/",
            "DATA"     => $root_dir  . "data/",
            "CACHE"    => $root_dir  . "data/cache/",
            "PUBLIC"   => $root_dir  . 'public/',
            "MEDIA"    => $root_dir  . "public/media/",
            "ASSETS"   => $root_dir  . "public/assets/",
        ]);
 
 
 
 
 
 
 
    }
 
    private function initCatch($di, $exception = null,$params = []){
 
 
        $debug = new \Phalcon\Debug();
        $debug->listen()->onUncaughtException($exception);
 
        if (DEBUG_MODE):
            if($exception):
                try {
                    $debug = new \Phalcon\Debug();
                    $debug->listen()->onUncaughtException($exception);
                    return true;
                }catch (\Throwable $e){
 
                }
            endif;
        endif;
 
 
        /*
        $redirect_url = "./hata/500?" . http_build_query($params);
 
        header("HTTP/1.0 404 Not Found");
        header('Location: '.$redirect_url);
        die();
        */
 
 
 
        //return $di->get('response')->redirect('hata/404?' . http_build_query($params))->send();
        return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
    }
 
 
 
}
#2App\Bootstrap->dispatch(Object(Phalcon\Di\FactoryDefault))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (129)
<?php
 
namespace App;
 
use Application\Cache\Manager as CacheManager;
use Application\Mvc\Helper\CmsCache;
use Konsol\Model\Options;
 
 
class Bootstrap{
 
    public function run(){
 
        try {
 
            $this->initDefined();
 
            $di = new \Phalcon\DI\FactoryDefault();
            $loader = new \Phalcon\Loader();
 
            // Config
            $config = require_once PATHS['APPS'] . '/config/application.php';
 
 
            $config = new \Phalcon\Config($config);
 
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            $di->set('config', $config);
 
 
            // URL
            $url = new \Phalcon\Mvc\Url();
            $url->setBasePath($config->base_path);
            $url->setBaseUri($config->base_path);
            $di->set('url', $url);
 
 
 
            // Database
            $di->set('db', new \Phalcon\Db\Adapter\Pdo\Mysql([
                "host" => $config->database->host,
                "username" => $config->database->username,
                "password" => $config->database->password,
                "dbname" => $config->database->dbname,
                "charset" => $config->database->charset,
                "port" => $config->database->port,
            ]));
 
 
            //SET MODULES
            $this->getModules($di);
 
 
            // Loader
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            // View
            $this->initView($di,$config);
 
 
            // Cache
            $this->initCache($di);
 
            // Application
            $application = new \Phalcon\Mvc\Application();
            $application->registerModules($config->modules->toArray());
 
 
            // Events Manager, Dispatcher
            $this->initEventManager($di);
 
 
            $di->set('session', function () use ($di) {
                $session = new \Phalcon\Session\Adapter\Files();
                session_name(HOST_HASH);
                $session->start();
                return $session;
            });
 
            $di->set('cookie', function () {
                $cookies = new \Phalcon\Http\Response\Cookies();
                $cookies->useEncryption(true);
                return $cookies;
            });
 
            $di->set('crypt', function () {
                $crypt = new \Phalcon\Crypt();
                $crypt->setCipher('aes-256-ctr');
                $crypt->setKey("T4\xb1\x8d\xa9\x98\x05\\\x8c\xbe\x1d\x07&[\x99\x18\xa4~Lc1\xbeW\xb3");
                return $crypt;
            });
 
            $di->set('localization', new \YobisiKonsol\Plugin\Localization());
 
            $di->set('helper', new \Application\Mvc\Helper());
 
            $di->set('auth', new \Konsol\Model\Auth());
 
            $di->set('acl', new \YobisiKonsol\Plugin\Acl());
 
 
            // JS Assets
            $this->initAssetsManager($di);
 
 
            // Toast helper
            $di->set('toast', new \Application\Mvc\Helper\Toast());
 
            // Flash helper
            $di->set('flash', new \Phalcon\Flash\Session());
 
 
            // Routing
            $this->initRouting($application, $di);
 
            $application->setDI($di);
 
 
            // Main dispatching process
            $response = $this->dispatch($di);
            $response->send();
 
 
        } catch (\Exception $e) {
 
            return $this->initCatch($di,  $e,[
                "code" => "bootstrap_initCatch",
                "message" => "Uygulama çalıştırılırken hata oluştu"
            ]);
 
        }
 
    }
 
    private function initRouting($application, $di){
 
 
 
 
        foreach ($application->getModules() as $module) {
            try {
                $initClassName = str_replace('\Module', '\Init', $module['className']);
                if (class_exists($initClassName)) {
                    new $initClassName();
                }
 
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Init.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
 
            }
        }
 
 
        $router = new \Application\Mvc\Router\DefaultRouter();
        $router->setDi($di);
        foreach ($application->getModules() as $module) {
            try {
                $routesClassName = str_replace('\Module', '\Routes', $module['className']);
                if (class_exists($routesClassName)) {
                    $routesClass = new $routesClassName();
                    $router = $routesClass->init($router);
                }
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Routes.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
            }
        }
 
        $di->set('router', $router);
 
    }
 
 
    private function initAssetsManager($di){
 
        $assetsManager = new \Application\Assets\Manager();
 
        $di->set('assets', $assetsManager);
    }
 
    private function initEventManager($di)
    {
 
 
        $eventsManager = new \Phalcon\Events\Manager();
        $dispatcher    = new \Phalcon\Mvc\Dispatcher();
 
 
        $eventsManager->attach("dispatch", function ($event, $dispatcher, $exception) use ($di) {
            if ($event->getType() == 'beforeException') {
 
                switch ($exception->getCode()) {
                    case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                    case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
 
                        return $this->initCatch($di, $exception,[
                            "code" => "dispatch:beforeException",
                            "message" => "Sayfa çalıştırılırken beklenmedik hata oluştu"
                        ]);
                }
            }//error pages redirect
        });
 
        /*
         * Plugins
         */
        $events  = [];
        $plugins = glob(PATHS['APPS']  .'plugins/*.php');
 
        foreach ($plugins as $plugin_path):
 
            $plugin_name = rtrim(basename($plugin_path), ".php");
            $namespace = "YobisiKonsol\Plugin\\" . $plugin_name;
 
            $variables = get_class_vars($namespace);
            if(!$event_type = $variables['event_type']) continue;
 
            $events[$event_type][] = $namespace;//plugin
 
        endforeach;
 
        foreach ($events as $event_type => $namespaces):
 
            $eventsManager->attach($event_type, function ($event, $dispatcher) use ($di, $namespaces) {
                foreach ($namespaces as $namespace):
                    $item = new $namespace();
                    if(method_exists($item,"execute")) $item->execute();
                endforeach;
            });
 
        endforeach;
 
 
 
 
        // Profiler
 
        //$is_profiler = Options::findFirstByKey('profiler');
        $is_profiler = @$_GET['profiler'] ?? false;
        if ($is_profiler) {
            $profiler = new \Phalcon\Db\Profiler();
            $di->set('profiler', $profiler);
            $eventsManager->attach('db', function ($event, $db) use ($profiler) {
 
                if ($event->getType() == 'beforeQuery') {
                    $profiler->startProfile($db->getSQLStatement());
                }
                if ($event->getType() == 'afterQuery') {
                    $profiler->stopProfile();
                }
            });
            $di->get('view')->setVar('profiler',$di->get('profiler'));
        }
 
        $db = $di->get('db');
        $db->setEventsManager($eventsManager);
 
        $dispatcher->setEventsManager($eventsManager);
        $di->set('dispatcher', $dispatcher);
    }
 
    private function initView($di,$config = [])
    {
 
 
        $view = new \Phalcon\Mvc\View();
 
        define('MAIN_VIEW_PATH', PATHS['MODULES'] . "Konsol/Views/");
 
        $view->setViewsDir(MAIN_VIEW_PATH);
        $view->setMainView(MAIN_VIEW_PATH . '/konsol');
        $view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
        $view->setLayout('/konsol');
        $view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
 
 
        // Volt
        $volt = new \Application\Mvc\View\Engine\Volt($view, $di);
 
 
        $volt->setOptions([
            'compiledPath' => PATHS['APPS'] . '/../data/cache/volt/',
            'compileAlways' => (DEBUG_MODE) ? true : false
        ]);
        $volt->initCompiler();
 
 
        $phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
        $viewEngines = [
            ".volt" => $volt,
            ".phtml" => $phtml,
        ];
 
        $view->registerEngines($viewEngines);
 
        $ajax = $di->get('request')->getQuery('_ajax');
 
        if ($ajax) $view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
 
 
        $view->setVar('config',$config);
        $di->set('view', $view);
 
        return $view;
    }
 
    private function initCache($di)
    {
        $config = $di->get('config');
 
 
        $cacheFrontend = new \Phalcon\Cache\Frontend\Data([
            "lifetime" => 60,
            "prefix" => HOST_HASH,
        ]);
 
        $cache = null;
        switch ($config->cache) {
            case 'memcache':
                $cache = new \Phalcon\Cache\Backend\Memcache(
                    $cacheFrontend, [
                    "host" => $config->memcache->host,
                    "port" => $config->memcache->port,
                ]);
                break;
            case 'memcached':
                $cache = new \Phalcon\Cache\Backend\Libmemcached(
                    $cacheFrontend, [
                    "host" => $config->memcached->host,
                    "port" => $config->memcached->port,
                ]);
                break;
      case 'redis':
        
        $cache = new \Phalcon\Cache\Backend\Redis(
          $cacheFrontend, [
            "host" => $config->redis->host,
            "port" => $config->redis->port,
            "auth" => $config->redis->auth,
            "statsKey" => $config->redis->statsKey,
            "persistent" => $config->redis->persistent,
            "index" => $config->redis->index
          ]);
 
                break;
            default:
                $cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
                    "cacheDir" => PATHS['APPS'] . "/../data/cache/backend/",
                    'lifetime' => 172800
                ]);
        }
 
        \Application\Widget\Proxy::$cache = $cache; // Modules Widget System
 
        $modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
 
        $di->set('cache', $cache, true);
        $di->set('modelsCache', $cache, true);
        $di->set('modelsMetadata', $modelsMetadata);
        $di->set('cacheManager', new CacheManager());
    }
 
    private function dispatch($di){
 
 
        $router = $di->get('router');
 
        $router->handle();
 
 
        $view       = $di->get('view');
        $dispatcher = $di->get('dispatcher');
        $response   = $di->get('response');
 
        $dispatcher->setModuleName($router->getModuleName());
        $dispatcher->setControllerName($router->getControllerName());
        $dispatcher->setActionName($router->getActionName());
        $dispatcher->setParams($router->getParams());
 
        $moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
 
 
        $ModuleClassName = $moduleName . '\Module';
        if (class_exists($ModuleClassName)) {
            $module = new $ModuleClassName();
            $module->registerAutoloaders();
            $module->registerServices($di);
        }
 
        $view->start();
 
        try {
 
            $dispatcher->dispatch();
 
        } catch (\Phalcon\Exception $error) {
 
            return $this->initCatch($di,  $error,[
                "code" => "dispatch:catch",
                "message" => "Uygulama çalıştırılırken beklenmedik hata oluştu"
            ]);
 
        }
 
 
        $view->render(
            $dispatcher->getControllerName(),
            $dispatcher->getActionName(),
            $dispatcher->getParams()
        );
 
        $view->finish();
 
        // AJAX
        $request = $di['request'];
        $_ajax = $request->getQuery('_ajax');
 
        if ($_ajax) {
 
            $view->setLayout('ajax');
 
            $contents = $view->getContent();
 
            $return = new \stdClass();
            $return->status = true;
            $return->title  = $di->get('helper')->title()->get();
            $return->html   = $contents;
 
 
            $headers = $response->getHeaders()->toArray();
            if (isset($headers[404]) || isset($headers[503])) {
                $return->status = false;
            }
            $response->setContentType('application/json', 'UTF-8');
            $response->setContent(json_encode($return));
        } else {
            $response->setContent($view->getContent());
        }
 
        return $response;
    }
 
    private function getModules($di){
 
        try {
 
            $config = $di->get('config');
            $db = $di->get('db');
            $cache = new \Application\Mvc\Helper\CmsCache();
 
 
            if (APPLICATION_ENV == "development") $db->query("SET @@GLOBAL.sql_mode=''");//fix group_by error
 
            $user_modules = $cache::getInstance()->get('modules');
 
 
            if (!$user_modules):
 
                //GET_MODULES
                $statement = $db->prepare('SELECT * FROM modules WHERE status = ? order by priority ASC');
                $statement->execute(array("active"));
                $user_modules = $statement->fetchAll(\Phalcon\Db::FETCH_ASSOC);
 
 
                $cache::getInstance()->save('modules', $user_modules);
 
            endif;
 
 
            //SET_MODULES
            require_once PATHS['APPS'] . '/modules/Application/Loader/Modules.php';
 
            $modules = new \Application\Loader\Modules();
            $modules_config = $modules->modulesConfig($user_modules);
 
 
            foreach ($modules_config['loader']['namespaces'] as $key => $module)
                $config->loader->namespaces[$key] = $module;
 
            foreach ($modules_config['modules'] as $key => $module)
                $config->modules[$key] = $module;
 
 
            return $config;
 
        }catch (\Throwable $e){
 
            $params = [
                "code" => "bootstrap_modules_catch",
                "message" => $e->getMessage(),
                "file" => $e->getFile(),
                "line" => $e->getLine(),
            ];
            return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
        }
 
    }
 
 
    private function initDefined(){
        /*
         * geliştirici modunu açar
         */
 
 
 
        $root_dir = rtrim(__DIR__,'app');
        define('PATHS',[
            "ROOT"     => $root_dir,
            "APPS"     => $root_dir  . 'app/',
            "MODULES"  => $root_dir  . "app/modules/",
            "PLUGINS"  => $root_dir  . "app/plugins/",
            "DATA"     => $root_dir  . "data/",
            "CACHE"    => $root_dir  . "data/cache/",
            "PUBLIC"   => $root_dir  . 'public/',
            "MEDIA"    => $root_dir  . "public/media/",
            "ASSETS"   => $root_dir  . "public/assets/",
        ]);
 
 
 
 
 
 
 
    }
 
    private function initCatch($di, $exception = null,$params = []){
 
 
        $debug = new \Phalcon\Debug();
        $debug->listen()->onUncaughtException($exception);
 
        if (DEBUG_MODE):
            if($exception):
                try {
                    $debug = new \Phalcon\Debug();
                    $debug->listen()->onUncaughtException($exception);
                    return true;
                }catch (\Throwable $e){
 
                }
            endif;
        endif;
 
 
        /*
        $redirect_url = "./hata/500?" . http_build_query($params);
 
        header("HTTP/1.0 404 Not Found");
        header('Location: '.$redirect_url);
        die();
        */
 
 
 
        //return $di->get('response')->redirect('hata/404?' . http_build_query($params))->send();
        return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
    }
 
 
 
}
#3App\Bootstrap->run()
/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php (30)
<?php
 
 
    /*
     * Yobisi.Konsol
     *
     */
    //session_name('subdomain_session');
 
 
    error_reporting(@$_GET['debug'] ? E_ALL : 1);
 
    define('APPLICATION_ENV', ($_SERVER['HTTP_HOST'] == "localhost") ? "development" : "production");
 
 
    if (isset($_GET['debug_mode'])):
        define('DEBUG_MODE', $_SESSION['DEBUG_MODE'] = (bool) $_GET['debug_mode']);
    elseif (isset($_SESSION['DEBUG_MODE'])):
        define('DEBUG_MODE', (bool)$_SESSION['DEBUG_MODE']);
    else:
        define('DEBUG_MODE', (APPLICATION_ENV == "development") ? true : false);
    endif;
 
 
 
    try {
 
        require_once '../app/Bootstrap.php';
        $bootstrap = new App\Bootstrap();
        $bootstrap->run();
 
 
    } catch (Exception $e) {
 
 
        if (DEBUG_MODE):
 
            $debug = new \Phalcon\Debug();
            die($debug->listen()->onUncaughtException($e));
 
        else:
 
 
 
            /*
            $params = ["message" => $e->getMessage(), "file" => $e->getFile(), "line" => $e->getLine(),];
 
            $redirect_url = "hata/500?" . http_build_query([
                    "message" => $e->getMessage(),
                    "file" => $e->getFile(),
                    "line" => $e->getLine()
                ]);
 
            header("HTTP/1.0 404 Not Found");
            header('Location: '.$redirect_url);
            die();
            */
 
            include "error.php";
        endif;
 
    }
KeyValue
_url/images/media/MTY0MzNiMjQ4MDExZmI.jpg
KeyValue
USERdenizliyeniolay.com_a706vjldz7n
HOME/var/www/vhosts/denizliyeniolay.com
SCRIPT_NAME/public/index.php
REQUEST_URI/images/media/MTY0MzNiMjQ4MDExZmI.jpg
QUERY_STRING_url=/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.0
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/public/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_QUERY_STRING_url=/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REMOTE_PORT52818
SCRIPT_FILENAME/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php
SERVER_ADMINroot@localhost
CONTEXT_DOCUMENT_ROOT/var/www/vhosts/denizliyeniolay.com/httpdocs
CONTEXT_PREFIX
REQUEST_SCHEMEhttps
DOCUMENT_ROOT/var/www/vhosts/denizliyeniolay.com/httpdocs
REMOTE_ADDR172.70.178.187
SERVER_PORT443
SERVER_ADDR127.0.0.1
SERVER_NAMEdenizliyeniolay.com
SERVER_SOFTWAREApache
SERVER_SIGNATURE
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_COOKIEfikker-61vm-nk2N=MgPGRI6oXLV7DSLWJk4y6wNi63F1ZE0E
HTTP_CF_CONNECTING_IP18.223.170.103
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_ACCEPT*/*
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_RAY8e019b2a6baedadc-ORD
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_CF_IPCOUNTRYUS
HTTP_CDN_LOOPcloudflare; loops=1
HTTP_CONNECTIONclose
HTTP_X_ACCEL_INTERNAL/internal-nginx-static-location
HTTP_X_FORWARDED_FOR18.223.170.103
HTTP_X_REAL_IP172.70.178.187
HTTP_HOSTdenizliyeniolay.com
proxy-nokeepalive1
HTTPSon
PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
REDIRECT_REDIRECT_STATUS200
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_REDIRECT_SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_REDIRECT_UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
FCGI_ROLERESPONDER
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1731195189.0344
REQUEST_TIME1731195189
#Path
0/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php
1/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php
2/var/www/vhosts/denizliyeniolay.com/httpdocs/app/config/application.php
3/var/www/vhosts/denizliyeniolay.com/httpdocs/app/config/environment/production.php
4/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/autoload.php
5/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/autoload_real.php
6/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/ClassLoader.php
7/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/autoload_static.php
8/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
9/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-php72/bootstrap.php
10/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-intl-idn/bootstrap.php
11/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-mbstring/bootstrap.php
12/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/ralouphie/getallheaders/src/getallheaders.php
13/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/promises/src/functions_include.php
14/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/promises/src/functions.php
15/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-iconv/bootstrap.php
16/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/deprecation-contracts/function.php
17/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/swiftmailer/swiftmailer/lib/swift_required.php
18/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
19/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/mtdowling/jmespath.php/src/JmesPath.php
20/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/guzzle/src/functions_include.php
21/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/guzzle/src/functions.php
22/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/aws/aws-sdk-php/src/functions.php
23/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/CmsCache.php
24/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Loader/Modules.php
25/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/View/Engine/Volt.php
26/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Widget/Proxy.php
27/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Cache/Manager.php
28/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Acl.php
29/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Localization.php
30/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/MobileDetect.php
31/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/PhoneFormat.php
32/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Redirects.php
33/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/SendSMS.php
34/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Slugger.php
35/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/StaticMenu.php
36/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/TimeAgo.php
37/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Title.php
38/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Language.php
39/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/Translate.php
40/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper.php
41/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Auth.php
42/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Users/Model/Users.php
43/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Model/Model.php
44/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Assets/Manager.php
45/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/Toast.php
46/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Init.php
47/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Helper/Cdn.php
48/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Helper/Position.php
49/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Form/Options/IntegrationForm.php
50/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Form/Form.php
51/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php
52/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Init.php
53/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/Logger.php
54/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/AbstractLogger.php
55/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/LogLevel.php
56/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Users/Init.php
57/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Init.php
58/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostTypes.php
59/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostTaxonomies.php
60/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostsFinder.php
61/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/TermsFinder.php
62/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Router/Resources.php
63/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Constants/Init.php
64/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/MenuMaker/Init.php
65/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Pages/Init.php
66/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Sitemap/Init.php
67/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Whatsapp/Init.php
68/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Whatsapp/Widget/WhatsappWidget.php
69/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Widget/AbstractWidget.php
70/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/YobiForm/Init.php
71/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Theme/Init.php
72/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Init.php
73/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Helper/HaberFinder.php
74/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Reklam/Init.php
75/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/KoseYazilari/Init.php
76/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/CookieAlert/Init.php
77/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/CookieAlert/Widget/FrontendWidget.php
78/var/www/vhosts/denizliyeniolay.com/httpdocs/data/cache/volt/%%var%%www%%vhosts%%denizliyeniolay.com%%httpdocs%%app%%modules%%cookiealert%%views%%widget%%floating.volt.php
79/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Popup/Init.php
80/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Popup/Widget/FrontendWidget.php
81/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Model/Posts.php
82/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Model/Translate/PostsMeta.php
83/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Model/Translate.php
84/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Media.php
85/var/www/vhosts/denizliyeniolay.com/httpdocs/data/cache/volt/%%var%%www%%vhosts%%denizliyeniolay.com%%httpdocs%%app%%modules%%popup%%views%%widget%%popup.volt.php
86/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Redirects/Init.php
87/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Bildirimler/Init.php
88/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Router/DefaultRouter.php
89/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Routes.php
90/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Routes.php
91/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Routes.php
92/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Constants/Routes.php
93/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/MenuMaker/Routes.php
94/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Sitemap/Routes.php
95/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/YobiForm/Routes.php
96/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Theme/Routes.php
97/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Routes.php
98/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/KoseYazilari/Routes.php
99/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Redirects/Routes.php
100/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Bildirimler/Routes.php
101/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Utils/ModuleName.php
102/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php
Memory
Usage2097152
Phalcon\Mvc\Dispatcher\Exception: ImagesController handler class cannot be loaded
Phalcon Framework 3.4.5

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

/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (418)
#0Phalcon\Mvc\Dispatcher->_throwDispatchException(ImagesController handler class cannot be loaded, 2)
#1Phalcon\Dispatcher->dispatch()
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (418)
<?php
 
namespace App;
 
use Application\Cache\Manager as CacheManager;
use Application\Mvc\Helper\CmsCache;
use Konsol\Model\Options;
 
 
class Bootstrap{
 
    public function run(){
 
        try {
 
            $this->initDefined();
 
            $di = new \Phalcon\DI\FactoryDefault();
            $loader = new \Phalcon\Loader();
 
            // Config
            $config = require_once PATHS['APPS'] . '/config/application.php';
 
 
            $config = new \Phalcon\Config($config);
 
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            $di->set('config', $config);
 
 
            // URL
            $url = new \Phalcon\Mvc\Url();
            $url->setBasePath($config->base_path);
            $url->setBaseUri($config->base_path);
            $di->set('url', $url);
 
 
 
            // Database
            $di->set('db', new \Phalcon\Db\Adapter\Pdo\Mysql([
                "host" => $config->database->host,
                "username" => $config->database->username,
                "password" => $config->database->password,
                "dbname" => $config->database->dbname,
                "charset" => $config->database->charset,
                "port" => $config->database->port,
            ]));
 
 
            //SET MODULES
            $this->getModules($di);
 
 
            // Loader
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            // View
            $this->initView($di,$config);
 
 
            // Cache
            $this->initCache($di);
 
            // Application
            $application = new \Phalcon\Mvc\Application();
            $application->registerModules($config->modules->toArray());
 
 
            // Events Manager, Dispatcher
            $this->initEventManager($di);
 
 
            $di->set('session', function () use ($di) {
                $session = new \Phalcon\Session\Adapter\Files();
                session_name(HOST_HASH);
                $session->start();
                return $session;
            });
 
            $di->set('cookie', function () {
                $cookies = new \Phalcon\Http\Response\Cookies();
                $cookies->useEncryption(true);
                return $cookies;
            });
 
            $di->set('crypt', function () {
                $crypt = new \Phalcon\Crypt();
                $crypt->setCipher('aes-256-ctr');
                $crypt->setKey("T4\xb1\x8d\xa9\x98\x05\\\x8c\xbe\x1d\x07&[\x99\x18\xa4~Lc1\xbeW\xb3");
                return $crypt;
            });
 
            $di->set('localization', new \YobisiKonsol\Plugin\Localization());
 
            $di->set('helper', new \Application\Mvc\Helper());
 
            $di->set('auth', new \Konsol\Model\Auth());
 
            $di->set('acl', new \YobisiKonsol\Plugin\Acl());
 
 
            // JS Assets
            $this->initAssetsManager($di);
 
 
            // Toast helper
            $di->set('toast', new \Application\Mvc\Helper\Toast());
 
            // Flash helper
            $di->set('flash', new \Phalcon\Flash\Session());
 
 
            // Routing
            $this->initRouting($application, $di);
 
            $application->setDI($di);
 
 
            // Main dispatching process
            $response = $this->dispatch($di);
            $response->send();
 
 
        } catch (\Exception $e) {
 
            return $this->initCatch($di,  $e,[
                "code" => "bootstrap_initCatch",
                "message" => "Uygulama çalıştırılırken hata oluştu"
            ]);
 
        }
 
    }
 
    private function initRouting($application, $di){
 
 
 
 
        foreach ($application->getModules() as $module) {
            try {
                $initClassName = str_replace('\Module', '\Init', $module['className']);
                if (class_exists($initClassName)) {
                    new $initClassName();
                }
 
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Init.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
 
            }
        }
 
 
        $router = new \Application\Mvc\Router\DefaultRouter();
        $router->setDi($di);
        foreach ($application->getModules() as $module) {
            try {
                $routesClassName = str_replace('\Module', '\Routes', $module['className']);
                if (class_exists($routesClassName)) {
                    $routesClass = new $routesClassName();
                    $router = $routesClass->init($router);
                }
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Routes.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
            }
        }
 
        $di->set('router', $router);
 
    }
 
 
    private function initAssetsManager($di){
 
        $assetsManager = new \Application\Assets\Manager();
 
        $di->set('assets', $assetsManager);
    }
 
    private function initEventManager($di)
    {
 
 
        $eventsManager = new \Phalcon\Events\Manager();
        $dispatcher    = new \Phalcon\Mvc\Dispatcher();
 
 
        $eventsManager->attach("dispatch", function ($event, $dispatcher, $exception) use ($di) {
            if ($event->getType() == 'beforeException') {
 
                switch ($exception->getCode()) {
                    case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                    case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
 
                        return $this->initCatch($di, $exception,[
                            "code" => "dispatch:beforeException",
                            "message" => "Sayfa çalıştırılırken beklenmedik hata oluştu"
                        ]);
                }
            }//error pages redirect
        });
 
        /*
         * Plugins
         */
        $events  = [];
        $plugins = glob(PATHS['APPS']  .'plugins/*.php');
 
        foreach ($plugins as $plugin_path):
 
            $plugin_name = rtrim(basename($plugin_path), ".php");
            $namespace = "YobisiKonsol\Plugin\\" . $plugin_name;
 
            $variables = get_class_vars($namespace);
            if(!$event_type = $variables['event_type']) continue;
 
            $events[$event_type][] = $namespace;//plugin
 
        endforeach;
 
        foreach ($events as $event_type => $namespaces):
 
            $eventsManager->attach($event_type, function ($event, $dispatcher) use ($di, $namespaces) {
                foreach ($namespaces as $namespace):
                    $item = new $namespace();
                    if(method_exists($item,"execute")) $item->execute();
                endforeach;
            });
 
        endforeach;
 
 
 
 
        // Profiler
 
        //$is_profiler = Options::findFirstByKey('profiler');
        $is_profiler = @$_GET['profiler'] ?? false;
        if ($is_profiler) {
            $profiler = new \Phalcon\Db\Profiler();
            $di->set('profiler', $profiler);
            $eventsManager->attach('db', function ($event, $db) use ($profiler) {
 
                if ($event->getType() == 'beforeQuery') {
                    $profiler->startProfile($db->getSQLStatement());
                }
                if ($event->getType() == 'afterQuery') {
                    $profiler->stopProfile();
                }
            });
            $di->get('view')->setVar('profiler',$di->get('profiler'));
        }
 
        $db = $di->get('db');
        $db->setEventsManager($eventsManager);
 
        $dispatcher->setEventsManager($eventsManager);
        $di->set('dispatcher', $dispatcher);
    }
 
    private function initView($di,$config = [])
    {
 
 
        $view = new \Phalcon\Mvc\View();
 
        define('MAIN_VIEW_PATH', PATHS['MODULES'] . "Konsol/Views/");
 
        $view->setViewsDir(MAIN_VIEW_PATH);
        $view->setMainView(MAIN_VIEW_PATH . '/konsol');
        $view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
        $view->setLayout('/konsol');
        $view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
 
 
        // Volt
        $volt = new \Application\Mvc\View\Engine\Volt($view, $di);
 
 
        $volt->setOptions([
            'compiledPath' => PATHS['APPS'] . '/../data/cache/volt/',
            'compileAlways' => (DEBUG_MODE) ? true : false
        ]);
        $volt->initCompiler();
 
 
        $phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
        $viewEngines = [
            ".volt" => $volt,
            ".phtml" => $phtml,
        ];
 
        $view->registerEngines($viewEngines);
 
        $ajax = $di->get('request')->getQuery('_ajax');
 
        if ($ajax) $view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
 
 
        $view->setVar('config',$config);
        $di->set('view', $view);
 
        return $view;
    }
 
    private function initCache($di)
    {
        $config = $di->get('config');
 
 
        $cacheFrontend = new \Phalcon\Cache\Frontend\Data([
            "lifetime" => 60,
            "prefix" => HOST_HASH,
        ]);
 
        $cache = null;
        switch ($config->cache) {
            case 'memcache':
                $cache = new \Phalcon\Cache\Backend\Memcache(
                    $cacheFrontend, [
                    "host" => $config->memcache->host,
                    "port" => $config->memcache->port,
                ]);
                break;
            case 'memcached':
                $cache = new \Phalcon\Cache\Backend\Libmemcached(
                    $cacheFrontend, [
                    "host" => $config->memcached->host,
                    "port" => $config->memcached->port,
                ]);
                break;
      case 'redis':
        
        $cache = new \Phalcon\Cache\Backend\Redis(
          $cacheFrontend, [
            "host" => $config->redis->host,
            "port" => $config->redis->port,
            "auth" => $config->redis->auth,
            "statsKey" => $config->redis->statsKey,
            "persistent" => $config->redis->persistent,
            "index" => $config->redis->index
          ]);
 
                break;
            default:
                $cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
                    "cacheDir" => PATHS['APPS'] . "/../data/cache/backend/",
                    'lifetime' => 172800
                ]);
        }
 
        \Application\Widget\Proxy::$cache = $cache; // Modules Widget System
 
        $modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
 
        $di->set('cache', $cache, true);
        $di->set('modelsCache', $cache, true);
        $di->set('modelsMetadata', $modelsMetadata);
        $di->set('cacheManager', new CacheManager());
    }
 
    private function dispatch($di){
 
 
        $router = $di->get('router');
 
        $router->handle();
 
 
        $view       = $di->get('view');
        $dispatcher = $di->get('dispatcher');
        $response   = $di->get('response');
 
        $dispatcher->setModuleName($router->getModuleName());
        $dispatcher->setControllerName($router->getControllerName());
        $dispatcher->setActionName($router->getActionName());
        $dispatcher->setParams($router->getParams());
 
        $moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
 
 
        $ModuleClassName = $moduleName . '\Module';
        if (class_exists($ModuleClassName)) {
            $module = new $ModuleClassName();
            $module->registerAutoloaders();
            $module->registerServices($di);
        }
 
        $view->start();
 
        try {
 
            $dispatcher->dispatch();
 
        } catch (\Phalcon\Exception $error) {
 
            return $this->initCatch($di,  $error,[
                "code" => "dispatch:catch",
                "message" => "Uygulama çalıştırılırken beklenmedik hata oluştu"
            ]);
 
        }
 
 
        $view->render(
            $dispatcher->getControllerName(),
            $dispatcher->getActionName(),
            $dispatcher->getParams()
        );
 
        $view->finish();
 
        // AJAX
        $request = $di['request'];
        $_ajax = $request->getQuery('_ajax');
 
        if ($_ajax) {
 
            $view->setLayout('ajax');
 
            $contents = $view->getContent();
 
            $return = new \stdClass();
            $return->status = true;
            $return->title  = $di->get('helper')->title()->get();
            $return->html   = $contents;
 
 
            $headers = $response->getHeaders()->toArray();
            if (isset($headers[404]) || isset($headers[503])) {
                $return->status = false;
            }
            $response->setContentType('application/json', 'UTF-8');
            $response->setContent(json_encode($return));
        } else {
            $response->setContent($view->getContent());
        }
 
        return $response;
    }
 
    private function getModules($di){
 
        try {
 
            $config = $di->get('config');
            $db = $di->get('db');
            $cache = new \Application\Mvc\Helper\CmsCache();
 
 
            if (APPLICATION_ENV == "development") $db->query("SET @@GLOBAL.sql_mode=''");//fix group_by error
 
            $user_modules = $cache::getInstance()->get('modules');
 
 
            if (!$user_modules):
 
                //GET_MODULES
                $statement = $db->prepare('SELECT * FROM modules WHERE status = ? order by priority ASC');
                $statement->execute(array("active"));
                $user_modules = $statement->fetchAll(\Phalcon\Db::FETCH_ASSOC);
 
 
                $cache::getInstance()->save('modules', $user_modules);
 
            endif;
 
 
            //SET_MODULES
            require_once PATHS['APPS'] . '/modules/Application/Loader/Modules.php';
 
            $modules = new \Application\Loader\Modules();
            $modules_config = $modules->modulesConfig($user_modules);
 
 
            foreach ($modules_config['loader']['namespaces'] as $key => $module)
                $config->loader->namespaces[$key] = $module;
 
            foreach ($modules_config['modules'] as $key => $module)
                $config->modules[$key] = $module;
 
 
            return $config;
 
        }catch (\Throwable $e){
 
            $params = [
                "code" => "bootstrap_modules_catch",
                "message" => $e->getMessage(),
                "file" => $e->getFile(),
                "line" => $e->getLine(),
            ];
            return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
        }
 
    }
 
 
    private function initDefined(){
        /*
         * geliştirici modunu açar
         */
 
 
 
        $root_dir = rtrim(__DIR__,'app');
        define('PATHS',[
            "ROOT"     => $root_dir,
            "APPS"     => $root_dir  . 'app/',
            "MODULES"  => $root_dir  . "app/modules/",
            "PLUGINS"  => $root_dir  . "app/plugins/",
            "DATA"     => $root_dir  . "data/",
            "CACHE"    => $root_dir  . "data/cache/",
            "PUBLIC"   => $root_dir  . 'public/',
            "MEDIA"    => $root_dir  . "public/media/",
            "ASSETS"   => $root_dir  . "public/assets/",
        ]);
 
 
 
 
 
 
 
    }
 
    private function initCatch($di, $exception = null,$params = []){
 
 
        $debug = new \Phalcon\Debug();
        $debug->listen()->onUncaughtException($exception);
 
        if (DEBUG_MODE):
            if($exception):
                try {
                    $debug = new \Phalcon\Debug();
                    $debug->listen()->onUncaughtException($exception);
                    return true;
                }catch (\Throwable $e){
 
                }
            endif;
        endif;
 
 
        /*
        $redirect_url = "./hata/500?" . http_build_query($params);
 
        header("HTTP/1.0 404 Not Found");
        header('Location: '.$redirect_url);
        die();
        */
 
 
 
        //return $di->get('response')->redirect('hata/404?' . http_build_query($params))->send();
        return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
    }
 
 
 
}
#2App\Bootstrap->dispatch(Object(Phalcon\Di\FactoryDefault))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (129)
<?php
 
namespace App;
 
use Application\Cache\Manager as CacheManager;
use Application\Mvc\Helper\CmsCache;
use Konsol\Model\Options;
 
 
class Bootstrap{
 
    public function run(){
 
        try {
 
            $this->initDefined();
 
            $di = new \Phalcon\DI\FactoryDefault();
            $loader = new \Phalcon\Loader();
 
            // Config
            $config = require_once PATHS['APPS'] . '/config/application.php';
 
 
            $config = new \Phalcon\Config($config);
 
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            $di->set('config', $config);
 
 
            // URL
            $url = new \Phalcon\Mvc\Url();
            $url->setBasePath($config->base_path);
            $url->setBaseUri($config->base_path);
            $di->set('url', $url);
 
 
 
            // Database
            $di->set('db', new \Phalcon\Db\Adapter\Pdo\Mysql([
                "host" => $config->database->host,
                "username" => $config->database->username,
                "password" => $config->database->password,
                "dbname" => $config->database->dbname,
                "charset" => $config->database->charset,
                "port" => $config->database->port,
            ]));
 
 
            //SET MODULES
            $this->getModules($di);
 
 
            // Loader
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            // View
            $this->initView($di,$config);
 
 
            // Cache
            $this->initCache($di);
 
            // Application
            $application = new \Phalcon\Mvc\Application();
            $application->registerModules($config->modules->toArray());
 
 
            // Events Manager, Dispatcher
            $this->initEventManager($di);
 
 
            $di->set('session', function () use ($di) {
                $session = new \Phalcon\Session\Adapter\Files();
                session_name(HOST_HASH);
                $session->start();
                return $session;
            });
 
            $di->set('cookie', function () {
                $cookies = new \Phalcon\Http\Response\Cookies();
                $cookies->useEncryption(true);
                return $cookies;
            });
 
            $di->set('crypt', function () {
                $crypt = new \Phalcon\Crypt();
                $crypt->setCipher('aes-256-ctr');
                $crypt->setKey("T4\xb1\x8d\xa9\x98\x05\\\x8c\xbe\x1d\x07&[\x99\x18\xa4~Lc1\xbeW\xb3");
                return $crypt;
            });
 
            $di->set('localization', new \YobisiKonsol\Plugin\Localization());
 
            $di->set('helper', new \Application\Mvc\Helper());
 
            $di->set('auth', new \Konsol\Model\Auth());
 
            $di->set('acl', new \YobisiKonsol\Plugin\Acl());
 
 
            // JS Assets
            $this->initAssetsManager($di);
 
 
            // Toast helper
            $di->set('toast', new \Application\Mvc\Helper\Toast());
 
            // Flash helper
            $di->set('flash', new \Phalcon\Flash\Session());
 
 
            // Routing
            $this->initRouting($application, $di);
 
            $application->setDI($di);
 
 
            // Main dispatching process
            $response = $this->dispatch($di);
            $response->send();
 
 
        } catch (\Exception $e) {
 
            return $this->initCatch($di,  $e,[
                "code" => "bootstrap_initCatch",
                "message" => "Uygulama çalıştırılırken hata oluştu"
            ]);
 
        }
 
    }
 
    private function initRouting($application, $di){
 
 
 
 
        foreach ($application->getModules() as $module) {
            try {
                $initClassName = str_replace('\Module', '\Init', $module['className']);
                if (class_exists($initClassName)) {
                    new $initClassName();
                }
 
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Init.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
 
            }
        }
 
 
        $router = new \Application\Mvc\Router\DefaultRouter();
        $router->setDi($di);
        foreach ($application->getModules() as $module) {
            try {
                $routesClassName = str_replace('\Module', '\Routes', $module['className']);
                if (class_exists($routesClassName)) {
                    $routesClass = new $routesClassName();
                    $router = $routesClass->init($router);
                }
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Routes.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
            }
        }
 
        $di->set('router', $router);
 
    }
 
 
    private function initAssetsManager($di){
 
        $assetsManager = new \Application\Assets\Manager();
 
        $di->set('assets', $assetsManager);
    }
 
    private function initEventManager($di)
    {
 
 
        $eventsManager = new \Phalcon\Events\Manager();
        $dispatcher    = new \Phalcon\Mvc\Dispatcher();
 
 
        $eventsManager->attach("dispatch", function ($event, $dispatcher, $exception) use ($di) {
            if ($event->getType() == 'beforeException') {
 
                switch ($exception->getCode()) {
                    case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                    case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
 
                        return $this->initCatch($di, $exception,[
                            "code" => "dispatch:beforeException",
                            "message" => "Sayfa çalıştırılırken beklenmedik hata oluştu"
                        ]);
                }
            }//error pages redirect
        });
 
        /*
         * Plugins
         */
        $events  = [];
        $plugins = glob(PATHS['APPS']  .'plugins/*.php');
 
        foreach ($plugins as $plugin_path):
 
            $plugin_name = rtrim(basename($plugin_path), ".php");
            $namespace = "YobisiKonsol\Plugin\\" . $plugin_name;
 
            $variables = get_class_vars($namespace);
            if(!$event_type = $variables['event_type']) continue;
 
            $events[$event_type][] = $namespace;//plugin
 
        endforeach;
 
        foreach ($events as $event_type => $namespaces):
 
            $eventsManager->attach($event_type, function ($event, $dispatcher) use ($di, $namespaces) {
                foreach ($namespaces as $namespace):
                    $item = new $namespace();
                    if(method_exists($item,"execute")) $item->execute();
                endforeach;
            });
 
        endforeach;
 
 
 
 
        // Profiler
 
        //$is_profiler = Options::findFirstByKey('profiler');
        $is_profiler = @$_GET['profiler'] ?? false;
        if ($is_profiler) {
            $profiler = new \Phalcon\Db\Profiler();
            $di->set('profiler', $profiler);
            $eventsManager->attach('db', function ($event, $db) use ($profiler) {
 
                if ($event->getType() == 'beforeQuery') {
                    $profiler->startProfile($db->getSQLStatement());
                }
                if ($event->getType() == 'afterQuery') {
                    $profiler->stopProfile();
                }
            });
            $di->get('view')->setVar('profiler',$di->get('profiler'));
        }
 
        $db = $di->get('db');
        $db->setEventsManager($eventsManager);
 
        $dispatcher->setEventsManager($eventsManager);
        $di->set('dispatcher', $dispatcher);
    }
 
    private function initView($di,$config = [])
    {
 
 
        $view = new \Phalcon\Mvc\View();
 
        define('MAIN_VIEW_PATH', PATHS['MODULES'] . "Konsol/Views/");
 
        $view->setViewsDir(MAIN_VIEW_PATH);
        $view->setMainView(MAIN_VIEW_PATH . '/konsol');
        $view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
        $view->setLayout('/konsol');
        $view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
 
 
        // Volt
        $volt = new \Application\Mvc\View\Engine\Volt($view, $di);
 
 
        $volt->setOptions([
            'compiledPath' => PATHS['APPS'] . '/../data/cache/volt/',
            'compileAlways' => (DEBUG_MODE) ? true : false
        ]);
        $volt->initCompiler();
 
 
        $phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
        $viewEngines = [
            ".volt" => $volt,
            ".phtml" => $phtml,
        ];
 
        $view->registerEngines($viewEngines);
 
        $ajax = $di->get('request')->getQuery('_ajax');
 
        if ($ajax) $view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
 
 
        $view->setVar('config',$config);
        $di->set('view', $view);
 
        return $view;
    }
 
    private function initCache($di)
    {
        $config = $di->get('config');
 
 
        $cacheFrontend = new \Phalcon\Cache\Frontend\Data([
            "lifetime" => 60,
            "prefix" => HOST_HASH,
        ]);
 
        $cache = null;
        switch ($config->cache) {
            case 'memcache':
                $cache = new \Phalcon\Cache\Backend\Memcache(
                    $cacheFrontend, [
                    "host" => $config->memcache->host,
                    "port" => $config->memcache->port,
                ]);
                break;
            case 'memcached':
                $cache = new \Phalcon\Cache\Backend\Libmemcached(
                    $cacheFrontend, [
                    "host" => $config->memcached->host,
                    "port" => $config->memcached->port,
                ]);
                break;
      case 'redis':
        
        $cache = new \Phalcon\Cache\Backend\Redis(
          $cacheFrontend, [
            "host" => $config->redis->host,
            "port" => $config->redis->port,
            "auth" => $config->redis->auth,
            "statsKey" => $config->redis->statsKey,
            "persistent" => $config->redis->persistent,
            "index" => $config->redis->index
          ]);
 
                break;
            default:
                $cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
                    "cacheDir" => PATHS['APPS'] . "/../data/cache/backend/",
                    'lifetime' => 172800
                ]);
        }
 
        \Application\Widget\Proxy::$cache = $cache; // Modules Widget System
 
        $modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
 
        $di->set('cache', $cache, true);
        $di->set('modelsCache', $cache, true);
        $di->set('modelsMetadata', $modelsMetadata);
        $di->set('cacheManager', new CacheManager());
    }
 
    private function dispatch($di){
 
 
        $router = $di->get('router');
 
        $router->handle();
 
 
        $view       = $di->get('view');
        $dispatcher = $di->get('dispatcher');
        $response   = $di->get('response');
 
        $dispatcher->setModuleName($router->getModuleName());
        $dispatcher->setControllerName($router->getControllerName());
        $dispatcher->setActionName($router->getActionName());
        $dispatcher->setParams($router->getParams());
 
        $moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
 
 
        $ModuleClassName = $moduleName . '\Module';
        if (class_exists($ModuleClassName)) {
            $module = new $ModuleClassName();
            $module->registerAutoloaders();
            $module->registerServices($di);
        }
 
        $view->start();
 
        try {
 
            $dispatcher->dispatch();
 
        } catch (\Phalcon\Exception $error) {
 
            return $this->initCatch($di,  $error,[
                "code" => "dispatch:catch",
                "message" => "Uygulama çalıştırılırken beklenmedik hata oluştu"
            ]);
 
        }
 
 
        $view->render(
            $dispatcher->getControllerName(),
            $dispatcher->getActionName(),
            $dispatcher->getParams()
        );
 
        $view->finish();
 
        // AJAX
        $request = $di['request'];
        $_ajax = $request->getQuery('_ajax');
 
        if ($_ajax) {
 
            $view->setLayout('ajax');
 
            $contents = $view->getContent();
 
            $return = new \stdClass();
            $return->status = true;
            $return->title  = $di->get('helper')->title()->get();
            $return->html   = $contents;
 
 
            $headers = $response->getHeaders()->toArray();
            if (isset($headers[404]) || isset($headers[503])) {
                $return->status = false;
            }
            $response->setContentType('application/json', 'UTF-8');
            $response->setContent(json_encode($return));
        } else {
            $response->setContent($view->getContent());
        }
 
        return $response;
    }
 
    private function getModules($di){
 
        try {
 
            $config = $di->get('config');
            $db = $di->get('db');
            $cache = new \Application\Mvc\Helper\CmsCache();
 
 
            if (APPLICATION_ENV == "development") $db->query("SET @@GLOBAL.sql_mode=''");//fix group_by error
 
            $user_modules = $cache::getInstance()->get('modules');
 
 
            if (!$user_modules):
 
                //GET_MODULES
                $statement = $db->prepare('SELECT * FROM modules WHERE status = ? order by priority ASC');
                $statement->execute(array("active"));
                $user_modules = $statement->fetchAll(\Phalcon\Db::FETCH_ASSOC);
 
 
                $cache::getInstance()->save('modules', $user_modules);
 
            endif;
 
 
            //SET_MODULES
            require_once PATHS['APPS'] . '/modules/Application/Loader/Modules.php';
 
            $modules = new \Application\Loader\Modules();
            $modules_config = $modules->modulesConfig($user_modules);
 
 
            foreach ($modules_config['loader']['namespaces'] as $key => $module)
                $config->loader->namespaces[$key] = $module;
 
            foreach ($modules_config['modules'] as $key => $module)
                $config->modules[$key] = $module;
 
 
            return $config;
 
        }catch (\Throwable $e){
 
            $params = [
                "code" => "bootstrap_modules_catch",
                "message" => $e->getMessage(),
                "file" => $e->getFile(),
                "line" => $e->getLine(),
            ];
            return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
        }
 
    }
 
 
    private function initDefined(){
        /*
         * geliştirici modunu açar
         */
 
 
 
        $root_dir = rtrim(__DIR__,'app');
        define('PATHS',[
            "ROOT"     => $root_dir,
            "APPS"     => $root_dir  . 'app/',
            "MODULES"  => $root_dir  . "app/modules/",
            "PLUGINS"  => $root_dir  . "app/plugins/",
            "DATA"     => $root_dir  . "data/",
            "CACHE"    => $root_dir  . "data/cache/",
            "PUBLIC"   => $root_dir  . 'public/',
            "MEDIA"    => $root_dir  . "public/media/",
            "ASSETS"   => $root_dir  . "public/assets/",
        ]);
 
 
 
 
 
 
 
    }
 
    private function initCatch($di, $exception = null,$params = []){
 
 
        $debug = new \Phalcon\Debug();
        $debug->listen()->onUncaughtException($exception);
 
        if (DEBUG_MODE):
            if($exception):
                try {
                    $debug = new \Phalcon\Debug();
                    $debug->listen()->onUncaughtException($exception);
                    return true;
                }catch (\Throwable $e){
 
                }
            endif;
        endif;
 
 
        /*
        $redirect_url = "./hata/500?" . http_build_query($params);
 
        header("HTTP/1.0 404 Not Found");
        header('Location: '.$redirect_url);
        die();
        */
 
 
 
        //return $di->get('response')->redirect('hata/404?' . http_build_query($params))->send();
        return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
    }
 
 
 
}
#3App\Bootstrap->run()
/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php (30)
<?php
 
 
    /*
     * Yobisi.Konsol
     *
     */
    //session_name('subdomain_session');
 
 
    error_reporting(@$_GET['debug'] ? E_ALL : 1);
 
    define('APPLICATION_ENV', ($_SERVER['HTTP_HOST'] == "localhost") ? "development" : "production");
 
 
    if (isset($_GET['debug_mode'])):
        define('DEBUG_MODE', $_SESSION['DEBUG_MODE'] = (bool) $_GET['debug_mode']);
    elseif (isset($_SESSION['DEBUG_MODE'])):
        define('DEBUG_MODE', (bool)$_SESSION['DEBUG_MODE']);
    else:
        define('DEBUG_MODE', (APPLICATION_ENV == "development") ? true : false);
    endif;
 
 
 
    try {
 
        require_once '../app/Bootstrap.php';
        $bootstrap = new App\Bootstrap();
        $bootstrap->run();
 
 
    } catch (Exception $e) {
 
 
        if (DEBUG_MODE):
 
            $debug = new \Phalcon\Debug();
            die($debug->listen()->onUncaughtException($e));
 
        else:
 
 
 
            /*
            $params = ["message" => $e->getMessage(), "file" => $e->getFile(), "line" => $e->getLine(),];
 
            $redirect_url = "hata/500?" . http_build_query([
                    "message" => $e->getMessage(),
                    "file" => $e->getFile(),
                    "line" => $e->getLine()
                ]);
 
            header("HTTP/1.0 404 Not Found");
            header('Location: '.$redirect_url);
            die();
            */
 
            include "error.php";
        endif;
 
    }
KeyValue
_url/images/media/MTY0MzNiMjQ4MDExZmI.jpg
KeyValue
USERdenizliyeniolay.com_a706vjldz7n
HOME/var/www/vhosts/denizliyeniolay.com
SCRIPT_NAME/public/index.php
REQUEST_URI/images/media/MTY0MzNiMjQ4MDExZmI.jpg
QUERY_STRING_url=/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.0
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/public/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_QUERY_STRING_url=/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REMOTE_PORT52818
SCRIPT_FILENAME/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php
SERVER_ADMINroot@localhost
CONTEXT_DOCUMENT_ROOT/var/www/vhosts/denizliyeniolay.com/httpdocs
CONTEXT_PREFIX
REQUEST_SCHEMEhttps
DOCUMENT_ROOT/var/www/vhosts/denizliyeniolay.com/httpdocs
REMOTE_ADDR172.70.178.187
SERVER_PORT443
SERVER_ADDR127.0.0.1
SERVER_NAMEdenizliyeniolay.com
SERVER_SOFTWAREApache
SERVER_SIGNATURE
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_COOKIEfikker-61vm-nk2N=MgPGRI6oXLV7DSLWJk4y6wNi63F1ZE0E
HTTP_CF_CONNECTING_IP18.223.170.103
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_ACCEPT*/*
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_RAY8e019b2a6baedadc-ORD
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_CF_IPCOUNTRYUS
HTTP_CDN_LOOPcloudflare; loops=1
HTTP_CONNECTIONclose
HTTP_X_ACCEL_INTERNAL/internal-nginx-static-location
HTTP_X_FORWARDED_FOR18.223.170.103
HTTP_X_REAL_IP172.70.178.187
HTTP_HOSTdenizliyeniolay.com
proxy-nokeepalive1
HTTPSon
PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
REDIRECT_REDIRECT_STATUS200
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_REDIRECT_SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_REDIRECT_UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
FCGI_ROLERESPONDER
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1731195189.0344
REQUEST_TIME1731195189
#Path
0/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php
1/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php
2/var/www/vhosts/denizliyeniolay.com/httpdocs/app/config/application.php
3/var/www/vhosts/denizliyeniolay.com/httpdocs/app/config/environment/production.php
4/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/autoload.php
5/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/autoload_real.php
6/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/ClassLoader.php
7/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/autoload_static.php
8/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
9/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-php72/bootstrap.php
10/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-intl-idn/bootstrap.php
11/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-mbstring/bootstrap.php
12/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/ralouphie/getallheaders/src/getallheaders.php
13/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/promises/src/functions_include.php
14/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/promises/src/functions.php
15/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-iconv/bootstrap.php
16/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/deprecation-contracts/function.php
17/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/swiftmailer/swiftmailer/lib/swift_required.php
18/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
19/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/mtdowling/jmespath.php/src/JmesPath.php
20/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/guzzle/src/functions_include.php
21/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/guzzle/src/functions.php
22/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/aws/aws-sdk-php/src/functions.php
23/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/CmsCache.php
24/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Loader/Modules.php
25/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/View/Engine/Volt.php
26/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Widget/Proxy.php
27/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Cache/Manager.php
28/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Acl.php
29/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Localization.php
30/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/MobileDetect.php
31/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/PhoneFormat.php
32/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Redirects.php
33/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/SendSMS.php
34/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Slugger.php
35/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/StaticMenu.php
36/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/TimeAgo.php
37/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Title.php
38/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Language.php
39/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/Translate.php
40/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper.php
41/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Auth.php
42/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Users/Model/Users.php
43/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Model/Model.php
44/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Assets/Manager.php
45/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/Toast.php
46/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Init.php
47/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Helper/Cdn.php
48/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Helper/Position.php
49/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Form/Options/IntegrationForm.php
50/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Form/Form.php
51/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php
52/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Init.php
53/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/Logger.php
54/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/AbstractLogger.php
55/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/LogLevel.php
56/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Users/Init.php
57/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Init.php
58/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostTypes.php
59/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostTaxonomies.php
60/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostsFinder.php
61/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/TermsFinder.php
62/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Router/Resources.php
63/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Constants/Init.php
64/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/MenuMaker/Init.php
65/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Pages/Init.php
66/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Sitemap/Init.php
67/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Whatsapp/Init.php
68/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Whatsapp/Widget/WhatsappWidget.php
69/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Widget/AbstractWidget.php
70/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/YobiForm/Init.php
71/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Theme/Init.php
72/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Init.php
73/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Helper/HaberFinder.php
74/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Reklam/Init.php
75/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/KoseYazilari/Init.php
76/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/CookieAlert/Init.php
77/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/CookieAlert/Widget/FrontendWidget.php
78/var/www/vhosts/denizliyeniolay.com/httpdocs/data/cache/volt/%%var%%www%%vhosts%%denizliyeniolay.com%%httpdocs%%app%%modules%%cookiealert%%views%%widget%%floating.volt.php
79/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Popup/Init.php
80/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Popup/Widget/FrontendWidget.php
81/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Model/Posts.php
82/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Model/Translate/PostsMeta.php
83/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Model/Translate.php
84/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Media.php
85/var/www/vhosts/denizliyeniolay.com/httpdocs/data/cache/volt/%%var%%www%%vhosts%%denizliyeniolay.com%%httpdocs%%app%%modules%%popup%%views%%widget%%popup.volt.php
86/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Redirects/Init.php
87/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Bildirimler/Init.php
88/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Router/DefaultRouter.php
89/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Routes.php
90/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Routes.php
91/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Routes.php
92/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Constants/Routes.php
93/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/MenuMaker/Routes.php
94/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Sitemap/Routes.php
95/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/YobiForm/Routes.php
96/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Theme/Routes.php
97/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Routes.php
98/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/KoseYazilari/Routes.php
99/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Redirects/Routes.php
100/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Bildirimler/Routes.php
101/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Utils/ModuleName.php
102/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php
Memory
Usage2097152
Phalcon\Http\Response\Exception: Response was already sent
Phalcon Framework 3.4.5

Phalcon\Http\Response\Exception: Response was already sent

phalcon/http/response.zep (626)
#0Phalcon\Http\Response->send()
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (583)
<?php
 
namespace App;
 
use Application\Cache\Manager as CacheManager;
use Application\Mvc\Helper\CmsCache;
use Konsol\Model\Options;
 
 
class Bootstrap{
 
    public function run(){
 
        try {
 
            $this->initDefined();
 
            $di = new \Phalcon\DI\FactoryDefault();
            $loader = new \Phalcon\Loader();
 
            // Config
            $config = require_once PATHS['APPS'] . '/config/application.php';
 
 
            $config = new \Phalcon\Config($config);
 
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            $di->set('config', $config);
 
 
            // URL
            $url = new \Phalcon\Mvc\Url();
            $url->setBasePath($config->base_path);
            $url->setBaseUri($config->base_path);
            $di->set('url', $url);
 
 
 
            // Database
            $di->set('db', new \Phalcon\Db\Adapter\Pdo\Mysql([
                "host" => $config->database->host,
                "username" => $config->database->username,
                "password" => $config->database->password,
                "dbname" => $config->database->dbname,
                "charset" => $config->database->charset,
                "port" => $config->database->port,
            ]));
 
 
            //SET MODULES
            $this->getModules($di);
 
 
            // Loader
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            // View
            $this->initView($di,$config);
 
 
            // Cache
            $this->initCache($di);
 
            // Application
            $application = new \Phalcon\Mvc\Application();
            $application->registerModules($config->modules->toArray());
 
 
            // Events Manager, Dispatcher
            $this->initEventManager($di);
 
 
            $di->set('session', function () use ($di) {
                $session = new \Phalcon\Session\Adapter\Files();
                session_name(HOST_HASH);
                $session->start();
                return $session;
            });
 
            $di->set('cookie', function () {
                $cookies = new \Phalcon\Http\Response\Cookies();
                $cookies->useEncryption(true);
                return $cookies;
            });
 
            $di->set('crypt', function () {
                $crypt = new \Phalcon\Crypt();
                $crypt->setCipher('aes-256-ctr');
                $crypt->setKey("T4\xb1\x8d\xa9\x98\x05\\\x8c\xbe\x1d\x07&[\x99\x18\xa4~Lc1\xbeW\xb3");
                return $crypt;
            });
 
            $di->set('localization', new \YobisiKonsol\Plugin\Localization());
 
            $di->set('helper', new \Application\Mvc\Helper());
 
            $di->set('auth', new \Konsol\Model\Auth());
 
            $di->set('acl', new \YobisiKonsol\Plugin\Acl());
 
 
            // JS Assets
            $this->initAssetsManager($di);
 
 
            // Toast helper
            $di->set('toast', new \Application\Mvc\Helper\Toast());
 
            // Flash helper
            $di->set('flash', new \Phalcon\Flash\Session());
 
 
            // Routing
            $this->initRouting($application, $di);
 
            $application->setDI($di);
 
 
            // Main dispatching process
            $response = $this->dispatch($di);
            $response->send();
 
 
        } catch (\Exception $e) {
 
            return $this->initCatch($di,  $e,[
                "code" => "bootstrap_initCatch",
                "message" => "Uygulama çalıştırılırken hata oluştu"
            ]);
 
        }
 
    }
 
    private function initRouting($application, $di){
 
 
 
 
        foreach ($application->getModules() as $module) {
            try {
                $initClassName = str_replace('\Module', '\Init', $module['className']);
                if (class_exists($initClassName)) {
                    new $initClassName();
                }
 
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Init.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
 
            }
        }
 
 
        $router = new \Application\Mvc\Router\DefaultRouter();
        $router->setDi($di);
        foreach ($application->getModules() as $module) {
            try {
                $routesClassName = str_replace('\Module', '\Routes', $module['className']);
                if (class_exists($routesClassName)) {
                    $routesClass = new $routesClassName();
                    $router = $routesClass->init($router);
                }
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Routes.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
            }
        }
 
        $di->set('router', $router);
 
    }
 
 
    private function initAssetsManager($di){
 
        $assetsManager = new \Application\Assets\Manager();
 
        $di->set('assets', $assetsManager);
    }
 
    private function initEventManager($di)
    {
 
 
        $eventsManager = new \Phalcon\Events\Manager();
        $dispatcher    = new \Phalcon\Mvc\Dispatcher();
 
 
        $eventsManager->attach("dispatch", function ($event, $dispatcher, $exception) use ($di) {
            if ($event->getType() == 'beforeException') {
 
                switch ($exception->getCode()) {
                    case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                    case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
 
                        return $this->initCatch($di, $exception,[
                            "code" => "dispatch:beforeException",
                            "message" => "Sayfa çalıştırılırken beklenmedik hata oluştu"
                        ]);
                }
            }//error pages redirect
        });
 
        /*
         * Plugins
         */
        $events  = [];
        $plugins = glob(PATHS['APPS']  .'plugins/*.php');
 
        foreach ($plugins as $plugin_path):
 
            $plugin_name = rtrim(basename($plugin_path), ".php");
            $namespace = "YobisiKonsol\Plugin\\" . $plugin_name;
 
            $variables = get_class_vars($namespace);
            if(!$event_type = $variables['event_type']) continue;
 
            $events[$event_type][] = $namespace;//plugin
 
        endforeach;
 
        foreach ($events as $event_type => $namespaces):
 
            $eventsManager->attach($event_type, function ($event, $dispatcher) use ($di, $namespaces) {
                foreach ($namespaces as $namespace):
                    $item = new $namespace();
                    if(method_exists($item,"execute")) $item->execute();
                endforeach;
            });
 
        endforeach;
 
 
 
 
        // Profiler
 
        //$is_profiler = Options::findFirstByKey('profiler');
        $is_profiler = @$_GET['profiler'] ?? false;
        if ($is_profiler) {
            $profiler = new \Phalcon\Db\Profiler();
            $di->set('profiler', $profiler);
            $eventsManager->attach('db', function ($event, $db) use ($profiler) {
 
                if ($event->getType() == 'beforeQuery') {
                    $profiler->startProfile($db->getSQLStatement());
                }
                if ($event->getType() == 'afterQuery') {
                    $profiler->stopProfile();
                }
            });
            $di->get('view')->setVar('profiler',$di->get('profiler'));
        }
 
        $db = $di->get('db');
        $db->setEventsManager($eventsManager);
 
        $dispatcher->setEventsManager($eventsManager);
        $di->set('dispatcher', $dispatcher);
    }
 
    private function initView($di,$config = [])
    {
 
 
        $view = new \Phalcon\Mvc\View();
 
        define('MAIN_VIEW_PATH', PATHS['MODULES'] . "Konsol/Views/");
 
        $view->setViewsDir(MAIN_VIEW_PATH);
        $view->setMainView(MAIN_VIEW_PATH . '/konsol');
        $view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
        $view->setLayout('/konsol');
        $view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
 
 
        // Volt
        $volt = new \Application\Mvc\View\Engine\Volt($view, $di);
 
 
        $volt->setOptions([
            'compiledPath' => PATHS['APPS'] . '/../data/cache/volt/',
            'compileAlways' => (DEBUG_MODE) ? true : false
        ]);
        $volt->initCompiler();
 
 
        $phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
        $viewEngines = [
            ".volt" => $volt,
            ".phtml" => $phtml,
        ];
 
        $view->registerEngines($viewEngines);
 
        $ajax = $di->get('request')->getQuery('_ajax');
 
        if ($ajax) $view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
 
 
        $view->setVar('config',$config);
        $di->set('view', $view);
 
        return $view;
    }
 
    private function initCache($di)
    {
        $config = $di->get('config');
 
 
        $cacheFrontend = new \Phalcon\Cache\Frontend\Data([
            "lifetime" => 60,
            "prefix" => HOST_HASH,
        ]);
 
        $cache = null;
        switch ($config->cache) {
            case 'memcache':
                $cache = new \Phalcon\Cache\Backend\Memcache(
                    $cacheFrontend, [
                    "host" => $config->memcache->host,
                    "port" => $config->memcache->port,
                ]);
                break;
            case 'memcached':
                $cache = new \Phalcon\Cache\Backend\Libmemcached(
                    $cacheFrontend, [
                    "host" => $config->memcached->host,
                    "port" => $config->memcached->port,
                ]);
                break;
      case 'redis':
        
        $cache = new \Phalcon\Cache\Backend\Redis(
          $cacheFrontend, [
            "host" => $config->redis->host,
            "port" => $config->redis->port,
            "auth" => $config->redis->auth,
            "statsKey" => $config->redis->statsKey,
            "persistent" => $config->redis->persistent,
            "index" => $config->redis->index
          ]);
 
                break;
            default:
                $cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
                    "cacheDir" => PATHS['APPS'] . "/../data/cache/backend/",
                    'lifetime' => 172800
                ]);
        }
 
        \Application\Widget\Proxy::$cache = $cache; // Modules Widget System
 
        $modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
 
        $di->set('cache', $cache, true);
        $di->set('modelsCache', $cache, true);
        $di->set('modelsMetadata', $modelsMetadata);
        $di->set('cacheManager', new CacheManager());
    }
 
    private function dispatch($di){
 
 
        $router = $di->get('router');
 
        $router->handle();
 
 
        $view       = $di->get('view');
        $dispatcher = $di->get('dispatcher');
        $response   = $di->get('response');
 
        $dispatcher->setModuleName($router->getModuleName());
        $dispatcher->setControllerName($router->getControllerName());
        $dispatcher->setActionName($router->getActionName());
        $dispatcher->setParams($router->getParams());
 
        $moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
 
 
        $ModuleClassName = $moduleName . '\Module';
        if (class_exists($ModuleClassName)) {
            $module = new $ModuleClassName();
            $module->registerAutoloaders();
            $module->registerServices($di);
        }
 
        $view->start();
 
        try {
 
            $dispatcher->dispatch();
 
        } catch (\Phalcon\Exception $error) {
 
            return $this->initCatch($di,  $error,[
                "code" => "dispatch:catch",
                "message" => "Uygulama çalıştırılırken beklenmedik hata oluştu"
            ]);
 
        }
 
 
        $view->render(
            $dispatcher->getControllerName(),
            $dispatcher->getActionName(),
            $dispatcher->getParams()
        );
 
        $view->finish();
 
        // AJAX
        $request = $di['request'];
        $_ajax = $request->getQuery('_ajax');
 
        if ($_ajax) {
 
            $view->setLayout('ajax');
 
            $contents = $view->getContent();
 
            $return = new \stdClass();
            $return->status = true;
            $return->title  = $di->get('helper')->title()->get();
            $return->html   = $contents;
 
 
            $headers = $response->getHeaders()->toArray();
            if (isset($headers[404]) || isset($headers[503])) {
                $return->status = false;
            }
            $response->setContentType('application/json', 'UTF-8');
            $response->setContent(json_encode($return));
        } else {
            $response->setContent($view->getContent());
        }
 
        return $response;
    }
 
    private function getModules($di){
 
        try {
 
            $config = $di->get('config');
            $db = $di->get('db');
            $cache = new \Application\Mvc\Helper\CmsCache();
 
 
            if (APPLICATION_ENV == "development") $db->query("SET @@GLOBAL.sql_mode=''");//fix group_by error
 
            $user_modules = $cache::getInstance()->get('modules');
 
 
            if (!$user_modules):
 
                //GET_MODULES
                $statement = $db->prepare('SELECT * FROM modules WHERE status = ? order by priority ASC');
                $statement->execute(array("active"));
                $user_modules = $statement->fetchAll(\Phalcon\Db::FETCH_ASSOC);
 
 
                $cache::getInstance()->save('modules', $user_modules);
 
            endif;
 
 
            //SET_MODULES
            require_once PATHS['APPS'] . '/modules/Application/Loader/Modules.php';
 
            $modules = new \Application\Loader\Modules();
            $modules_config = $modules->modulesConfig($user_modules);
 
 
            foreach ($modules_config['loader']['namespaces'] as $key => $module)
                $config->loader->namespaces[$key] = $module;
 
            foreach ($modules_config['modules'] as $key => $module)
                $config->modules[$key] = $module;
 
 
            return $config;
 
        }catch (\Throwable $e){
 
            $params = [
                "code" => "bootstrap_modules_catch",
                "message" => $e->getMessage(),
                "file" => $e->getFile(),
                "line" => $e->getLine(),
            ];
            return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
        }
 
    }
 
 
    private function initDefined(){
        /*
         * geliştirici modunu açar
         */
 
 
 
        $root_dir = rtrim(__DIR__,'app');
        define('PATHS',[
            "ROOT"     => $root_dir,
            "APPS"     => $root_dir  . 'app/',
            "MODULES"  => $root_dir  . "app/modules/",
            "PLUGINS"  => $root_dir  . "app/plugins/",
            "DATA"     => $root_dir  . "data/",
            "CACHE"    => $root_dir  . "data/cache/",
            "PUBLIC"   => $root_dir  . 'public/',
            "MEDIA"    => $root_dir  . "public/media/",
            "ASSETS"   => $root_dir  . "public/assets/",
        ]);
 
 
 
 
 
 
 
    }
 
    private function initCatch($di, $exception = null,$params = []){
 
 
        $debug = new \Phalcon\Debug();
        $debug->listen()->onUncaughtException($exception);
 
        if (DEBUG_MODE):
            if($exception):
                try {
                    $debug = new \Phalcon\Debug();
                    $debug->listen()->onUncaughtException($exception);
                    return true;
                }catch (\Throwable $e){
 
                }
            endif;
        endif;
 
 
        /*
        $redirect_url = "./hata/500?" . http_build_query($params);
 
        header("HTTP/1.0 404 Not Found");
        header('Location: '.$redirect_url);
        die();
        */
 
 
 
        //return $di->get('response')->redirect('hata/404?' . http_build_query($params))->send();
        return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
    }
 
 
 
}
#1App\Bootstrap->initCatch(Object(Phalcon\Di\FactoryDefault), Object(Phalcon\Mvc\Dispatcher\Exception), Array([code] => dispatch:catch, [message] => Uygulama çalıştırılırken beklenmedik hata oluştu))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (423)
<?php
 
namespace App;
 
use Application\Cache\Manager as CacheManager;
use Application\Mvc\Helper\CmsCache;
use Konsol\Model\Options;
 
 
class Bootstrap{
 
    public function run(){
 
        try {
 
            $this->initDefined();
 
            $di = new \Phalcon\DI\FactoryDefault();
            $loader = new \Phalcon\Loader();
 
            // Config
            $config = require_once PATHS['APPS'] . '/config/application.php';
 
 
            $config = new \Phalcon\Config($config);
 
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            $di->set('config', $config);
 
 
            // URL
            $url = new \Phalcon\Mvc\Url();
            $url->setBasePath($config->base_path);
            $url->setBaseUri($config->base_path);
            $di->set('url', $url);
 
 
 
            // Database
            $di->set('db', new \Phalcon\Db\Adapter\Pdo\Mysql([
                "host" => $config->database->host,
                "username" => $config->database->username,
                "password" => $config->database->password,
                "dbname" => $config->database->dbname,
                "charset" => $config->database->charset,
                "port" => $config->database->port,
            ]));
 
 
            //SET MODULES
            $this->getModules($di);
 
 
            // Loader
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            // View
            $this->initView($di,$config);
 
 
            // Cache
            $this->initCache($di);
 
            // Application
            $application = new \Phalcon\Mvc\Application();
            $application->registerModules($config->modules->toArray());
 
 
            // Events Manager, Dispatcher
            $this->initEventManager($di);
 
 
            $di->set('session', function () use ($di) {
                $session = new \Phalcon\Session\Adapter\Files();
                session_name(HOST_HASH);
                $session->start();
                return $session;
            });
 
            $di->set('cookie', function () {
                $cookies = new \Phalcon\Http\Response\Cookies();
                $cookies->useEncryption(true);
                return $cookies;
            });
 
            $di->set('crypt', function () {
                $crypt = new \Phalcon\Crypt();
                $crypt->setCipher('aes-256-ctr');
                $crypt->setKey("T4\xb1\x8d\xa9\x98\x05\\\x8c\xbe\x1d\x07&[\x99\x18\xa4~Lc1\xbeW\xb3");
                return $crypt;
            });
 
            $di->set('localization', new \YobisiKonsol\Plugin\Localization());
 
            $di->set('helper', new \Application\Mvc\Helper());
 
            $di->set('auth', new \Konsol\Model\Auth());
 
            $di->set('acl', new \YobisiKonsol\Plugin\Acl());
 
 
            // JS Assets
            $this->initAssetsManager($di);
 
 
            // Toast helper
            $di->set('toast', new \Application\Mvc\Helper\Toast());
 
            // Flash helper
            $di->set('flash', new \Phalcon\Flash\Session());
 
 
            // Routing
            $this->initRouting($application, $di);
 
            $application->setDI($di);
 
 
            // Main dispatching process
            $response = $this->dispatch($di);
            $response->send();
 
 
        } catch (\Exception $e) {
 
            return $this->initCatch($di,  $e,[
                "code" => "bootstrap_initCatch",
                "message" => "Uygulama çalıştırılırken hata oluştu"
            ]);
 
        }
 
    }
 
    private function initRouting($application, $di){
 
 
 
 
        foreach ($application->getModules() as $module) {
            try {
                $initClassName = str_replace('\Module', '\Init', $module['className']);
                if (class_exists($initClassName)) {
                    new $initClassName();
                }
 
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Init.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
 
            }
        }
 
 
        $router = new \Application\Mvc\Router\DefaultRouter();
        $router->setDi($di);
        foreach ($application->getModules() as $module) {
            try {
                $routesClassName = str_replace('\Module', '\Routes', $module['className']);
                if (class_exists($routesClassName)) {
                    $routesClass = new $routesClassName();
                    $router = $routesClass->init($router);
                }
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Routes.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
            }
        }
 
        $di->set('router', $router);
 
    }
 
 
    private function initAssetsManager($di){
 
        $assetsManager = new \Application\Assets\Manager();
 
        $di->set('assets', $assetsManager);
    }
 
    private function initEventManager($di)
    {
 
 
        $eventsManager = new \Phalcon\Events\Manager();
        $dispatcher    = new \Phalcon\Mvc\Dispatcher();
 
 
        $eventsManager->attach("dispatch", function ($event, $dispatcher, $exception) use ($di) {
            if ($event->getType() == 'beforeException') {
 
                switch ($exception->getCode()) {
                    case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                    case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
 
                        return $this->initCatch($di, $exception,[
                            "code" => "dispatch:beforeException",
                            "message" => "Sayfa çalıştırılırken beklenmedik hata oluştu"
                        ]);
                }
            }//error pages redirect
        });
 
        /*
         * Plugins
         */
        $events  = [];
        $plugins = glob(PATHS['APPS']  .'plugins/*.php');
 
        foreach ($plugins as $plugin_path):
 
            $plugin_name = rtrim(basename($plugin_path), ".php");
            $namespace = "YobisiKonsol\Plugin\\" . $plugin_name;
 
            $variables = get_class_vars($namespace);
            if(!$event_type = $variables['event_type']) continue;
 
            $events[$event_type][] = $namespace;//plugin
 
        endforeach;
 
        foreach ($events as $event_type => $namespaces):
 
            $eventsManager->attach($event_type, function ($event, $dispatcher) use ($di, $namespaces) {
                foreach ($namespaces as $namespace):
                    $item = new $namespace();
                    if(method_exists($item,"execute")) $item->execute();
                endforeach;
            });
 
        endforeach;
 
 
 
 
        // Profiler
 
        //$is_profiler = Options::findFirstByKey('profiler');
        $is_profiler = @$_GET['profiler'] ?? false;
        if ($is_profiler) {
            $profiler = new \Phalcon\Db\Profiler();
            $di->set('profiler', $profiler);
            $eventsManager->attach('db', function ($event, $db) use ($profiler) {
 
                if ($event->getType() == 'beforeQuery') {
                    $profiler->startProfile($db->getSQLStatement());
                }
                if ($event->getType() == 'afterQuery') {
                    $profiler->stopProfile();
                }
            });
            $di->get('view')->setVar('profiler',$di->get('profiler'));
        }
 
        $db = $di->get('db');
        $db->setEventsManager($eventsManager);
 
        $dispatcher->setEventsManager($eventsManager);
        $di->set('dispatcher', $dispatcher);
    }
 
    private function initView($di,$config = [])
    {
 
 
        $view = new \Phalcon\Mvc\View();
 
        define('MAIN_VIEW_PATH', PATHS['MODULES'] . "Konsol/Views/");
 
        $view->setViewsDir(MAIN_VIEW_PATH);
        $view->setMainView(MAIN_VIEW_PATH . '/konsol');
        $view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
        $view->setLayout('/konsol');
        $view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
 
 
        // Volt
        $volt = new \Application\Mvc\View\Engine\Volt($view, $di);
 
 
        $volt->setOptions([
            'compiledPath' => PATHS['APPS'] . '/../data/cache/volt/',
            'compileAlways' => (DEBUG_MODE) ? true : false
        ]);
        $volt->initCompiler();
 
 
        $phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
        $viewEngines = [
            ".volt" => $volt,
            ".phtml" => $phtml,
        ];
 
        $view->registerEngines($viewEngines);
 
        $ajax = $di->get('request')->getQuery('_ajax');
 
        if ($ajax) $view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
 
 
        $view->setVar('config',$config);
        $di->set('view', $view);
 
        return $view;
    }
 
    private function initCache($di)
    {
        $config = $di->get('config');
 
 
        $cacheFrontend = new \Phalcon\Cache\Frontend\Data([
            "lifetime" => 60,
            "prefix" => HOST_HASH,
        ]);
 
        $cache = null;
        switch ($config->cache) {
            case 'memcache':
                $cache = new \Phalcon\Cache\Backend\Memcache(
                    $cacheFrontend, [
                    "host" => $config->memcache->host,
                    "port" => $config->memcache->port,
                ]);
                break;
            case 'memcached':
                $cache = new \Phalcon\Cache\Backend\Libmemcached(
                    $cacheFrontend, [
                    "host" => $config->memcached->host,
                    "port" => $config->memcached->port,
                ]);
                break;
      case 'redis':
        
        $cache = new \Phalcon\Cache\Backend\Redis(
          $cacheFrontend, [
            "host" => $config->redis->host,
            "port" => $config->redis->port,
            "auth" => $config->redis->auth,
            "statsKey" => $config->redis->statsKey,
            "persistent" => $config->redis->persistent,
            "index" => $config->redis->index
          ]);
 
                break;
            default:
                $cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
                    "cacheDir" => PATHS['APPS'] . "/../data/cache/backend/",
                    'lifetime' => 172800
                ]);
        }
 
        \Application\Widget\Proxy::$cache = $cache; // Modules Widget System
 
        $modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
 
        $di->set('cache', $cache, true);
        $di->set('modelsCache', $cache, true);
        $di->set('modelsMetadata', $modelsMetadata);
        $di->set('cacheManager', new CacheManager());
    }
 
    private function dispatch($di){
 
 
        $router = $di->get('router');
 
        $router->handle();
 
 
        $view       = $di->get('view');
        $dispatcher = $di->get('dispatcher');
        $response   = $di->get('response');
 
        $dispatcher->setModuleName($router->getModuleName());
        $dispatcher->setControllerName($router->getControllerName());
        $dispatcher->setActionName($router->getActionName());
        $dispatcher->setParams($router->getParams());
 
        $moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
 
 
        $ModuleClassName = $moduleName . '\Module';
        if (class_exists($ModuleClassName)) {
            $module = new $ModuleClassName();
            $module->registerAutoloaders();
            $module->registerServices($di);
        }
 
        $view->start();
 
        try {
 
            $dispatcher->dispatch();
 
        } catch (\Phalcon\Exception $error) {
 
            return $this->initCatch($di,  $error,[
                "code" => "dispatch:catch",
                "message" => "Uygulama çalıştırılırken beklenmedik hata oluştu"
            ]);
 
        }
 
 
        $view->render(
            $dispatcher->getControllerName(),
            $dispatcher->getActionName(),
            $dispatcher->getParams()
        );
 
        $view->finish();
 
        // AJAX
        $request = $di['request'];
        $_ajax = $request->getQuery('_ajax');
 
        if ($_ajax) {
 
            $view->setLayout('ajax');
 
            $contents = $view->getContent();
 
            $return = new \stdClass();
            $return->status = true;
            $return->title  = $di->get('helper')->title()->get();
            $return->html   = $contents;
 
 
            $headers = $response->getHeaders()->toArray();
            if (isset($headers[404]) || isset($headers[503])) {
                $return->status = false;
            }
            $response->setContentType('application/json', 'UTF-8');
            $response->setContent(json_encode($return));
        } else {
            $response->setContent($view->getContent());
        }
 
        return $response;
    }
 
    private function getModules($di){
 
        try {
 
            $config = $di->get('config');
            $db = $di->get('db');
            $cache = new \Application\Mvc\Helper\CmsCache();
 
 
            if (APPLICATION_ENV == "development") $db->query("SET @@GLOBAL.sql_mode=''");//fix group_by error
 
            $user_modules = $cache::getInstance()->get('modules');
 
 
            if (!$user_modules):
 
                //GET_MODULES
                $statement = $db->prepare('SELECT * FROM modules WHERE status = ? order by priority ASC');
                $statement->execute(array("active"));
                $user_modules = $statement->fetchAll(\Phalcon\Db::FETCH_ASSOC);
 
 
                $cache::getInstance()->save('modules', $user_modules);
 
            endif;
 
 
            //SET_MODULES
            require_once PATHS['APPS'] . '/modules/Application/Loader/Modules.php';
 
            $modules = new \Application\Loader\Modules();
            $modules_config = $modules->modulesConfig($user_modules);
 
 
            foreach ($modules_config['loader']['namespaces'] as $key => $module)
                $config->loader->namespaces[$key] = $module;
 
            foreach ($modules_config['modules'] as $key => $module)
                $config->modules[$key] = $module;
 
 
            return $config;
 
        }catch (\Throwable $e){
 
            $params = [
                "code" => "bootstrap_modules_catch",
                "message" => $e->getMessage(),
                "file" => $e->getFile(),
                "line" => $e->getLine(),
            ];
            return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
        }
 
    }
 
 
    private function initDefined(){
        /*
         * geliştirici modunu açar
         */
 
 
 
        $root_dir = rtrim(__DIR__,'app');
        define('PATHS',[
            "ROOT"     => $root_dir,
            "APPS"     => $root_dir  . 'app/',
            "MODULES"  => $root_dir  . "app/modules/",
            "PLUGINS"  => $root_dir  . "app/plugins/",
            "DATA"     => $root_dir  . "data/",
            "CACHE"    => $root_dir  . "data/cache/",
            "PUBLIC"   => $root_dir  . 'public/',
            "MEDIA"    => $root_dir  . "public/media/",
            "ASSETS"   => $root_dir  . "public/assets/",
        ]);
 
 
 
 
 
 
 
    }
 
    private function initCatch($di, $exception = null,$params = []){
 
 
        $debug = new \Phalcon\Debug();
        $debug->listen()->onUncaughtException($exception);
 
        if (DEBUG_MODE):
            if($exception):
                try {
                    $debug = new \Phalcon\Debug();
                    $debug->listen()->onUncaughtException($exception);
                    return true;
                }catch (\Throwable $e){
 
                }
            endif;
        endif;
 
 
        /*
        $redirect_url = "./hata/500?" . http_build_query($params);
 
        header("HTTP/1.0 404 Not Found");
        header('Location: '.$redirect_url);
        die();
        */
 
 
 
        //return $di->get('response')->redirect('hata/404?' . http_build_query($params))->send();
        return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
    }
 
 
 
}
#2App\Bootstrap->dispatch(Object(Phalcon\Di\FactoryDefault))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (129)
<?php
 
namespace App;
 
use Application\Cache\Manager as CacheManager;
use Application\Mvc\Helper\CmsCache;
use Konsol\Model\Options;
 
 
class Bootstrap{
 
    public function run(){
 
        try {
 
            $this->initDefined();
 
            $di = new \Phalcon\DI\FactoryDefault();
            $loader = new \Phalcon\Loader();
 
            // Config
            $config = require_once PATHS['APPS'] . '/config/application.php';
 
 
            $config = new \Phalcon\Config($config);
 
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            $di->set('config', $config);
 
 
            // URL
            $url = new \Phalcon\Mvc\Url();
            $url->setBasePath($config->base_path);
            $url->setBaseUri($config->base_path);
            $di->set('url', $url);
 
 
 
            // Database
            $di->set('db', new \Phalcon\Db\Adapter\Pdo\Mysql([
                "host" => $config->database->host,
                "username" => $config->database->username,
                "password" => $config->database->password,
                "dbname" => $config->database->dbname,
                "charset" => $config->database->charset,
                "port" => $config->database->port,
            ]));
 
 
            //SET MODULES
            $this->getModules($di);
 
 
            // Loader
            $loader->registerDirs([PATHS['APPS'] . "/plugins/"]);
            $loader->registerNamespaces($config->loader->namespaces->toArray());
            $loader->registerFiles([PATHS['APPS'] . '/../vendor/autoload.php']);
            $loader->register();
 
 
            // View
            $this->initView($di,$config);
 
 
            // Cache
            $this->initCache($di);
 
            // Application
            $application = new \Phalcon\Mvc\Application();
            $application->registerModules($config->modules->toArray());
 
 
            // Events Manager, Dispatcher
            $this->initEventManager($di);
 
 
            $di->set('session', function () use ($di) {
                $session = new \Phalcon\Session\Adapter\Files();
                session_name(HOST_HASH);
                $session->start();
                return $session;
            });
 
            $di->set('cookie', function () {
                $cookies = new \Phalcon\Http\Response\Cookies();
                $cookies->useEncryption(true);
                return $cookies;
            });
 
            $di->set('crypt', function () {
                $crypt = new \Phalcon\Crypt();
                $crypt->setCipher('aes-256-ctr');
                $crypt->setKey("T4\xb1\x8d\xa9\x98\x05\\\x8c\xbe\x1d\x07&[\x99\x18\xa4~Lc1\xbeW\xb3");
                return $crypt;
            });
 
            $di->set('localization', new \YobisiKonsol\Plugin\Localization());
 
            $di->set('helper', new \Application\Mvc\Helper());
 
            $di->set('auth', new \Konsol\Model\Auth());
 
            $di->set('acl', new \YobisiKonsol\Plugin\Acl());
 
 
            // JS Assets
            $this->initAssetsManager($di);
 
 
            // Toast helper
            $di->set('toast', new \Application\Mvc\Helper\Toast());
 
            // Flash helper
            $di->set('flash', new \Phalcon\Flash\Session());
 
 
            // Routing
            $this->initRouting($application, $di);
 
            $application->setDI($di);
 
 
            // Main dispatching process
            $response = $this->dispatch($di);
            $response->send();
 
 
        } catch (\Exception $e) {
 
            return $this->initCatch($di,  $e,[
                "code" => "bootstrap_initCatch",
                "message" => "Uygulama çalıştırılırken hata oluştu"
            ]);
 
        }
 
    }
 
    private function initRouting($application, $di){
 
 
 
 
        foreach ($application->getModules() as $module) {
            try {
                $initClassName = str_replace('\Module', '\Init', $module['className']);
                if (class_exists($initClassName)) {
                    new $initClassName();
                }
 
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Init.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
 
            }
        }
 
 
        $router = new \Application\Mvc\Router\DefaultRouter();
        $router->setDi($di);
        foreach ($application->getModules() as $module) {
            try {
                $routesClassName = str_replace('\Module', '\Routes', $module['className']);
                if (class_exists($routesClassName)) {
                    $routesClass = new $routesClassName();
                    $router = $routesClass->init($router);
                }
            }catch (\Throwable $exception){
 
                $this->initCatch($di,$exception,[
                    "code" => "init_routing",
                    "message" => sprintf('%s modülünün Routes.php dosyasında hata !',$module['className']),
                    "error_code" => $exception->getCode(),
                    "error_message" => $exception->getMessage(),
                    "file" => $exception->getFile(),
                    "line" => $exception->getLine()
                ]);
            }
        }
 
        $di->set('router', $router);
 
    }
 
 
    private function initAssetsManager($di){
 
        $assetsManager = new \Application\Assets\Manager();
 
        $di->set('assets', $assetsManager);
    }
 
    private function initEventManager($di)
    {
 
 
        $eventsManager = new \Phalcon\Events\Manager();
        $dispatcher    = new \Phalcon\Mvc\Dispatcher();
 
 
        $eventsManager->attach("dispatch", function ($event, $dispatcher, $exception) use ($di) {
            if ($event->getType() == 'beforeException') {
 
                switch ($exception->getCode()) {
                    case \Phalcon\Dispatcher::EXCEPTION_HANDLER_NOT_FOUND:
                    case \Phalcon\Dispatcher::EXCEPTION_ACTION_NOT_FOUND:
 
                        return $this->initCatch($di, $exception,[
                            "code" => "dispatch:beforeException",
                            "message" => "Sayfa çalıştırılırken beklenmedik hata oluştu"
                        ]);
                }
            }//error pages redirect
        });
 
        /*
         * Plugins
         */
        $events  = [];
        $plugins = glob(PATHS['APPS']  .'plugins/*.php');
 
        foreach ($plugins as $plugin_path):
 
            $plugin_name = rtrim(basename($plugin_path), ".php");
            $namespace = "YobisiKonsol\Plugin\\" . $plugin_name;
 
            $variables = get_class_vars($namespace);
            if(!$event_type = $variables['event_type']) continue;
 
            $events[$event_type][] = $namespace;//plugin
 
        endforeach;
 
        foreach ($events as $event_type => $namespaces):
 
            $eventsManager->attach($event_type, function ($event, $dispatcher) use ($di, $namespaces) {
                foreach ($namespaces as $namespace):
                    $item = new $namespace();
                    if(method_exists($item,"execute")) $item->execute();
                endforeach;
            });
 
        endforeach;
 
 
 
 
        // Profiler
 
        //$is_profiler = Options::findFirstByKey('profiler');
        $is_profiler = @$_GET['profiler'] ?? false;
        if ($is_profiler) {
            $profiler = new \Phalcon\Db\Profiler();
            $di->set('profiler', $profiler);
            $eventsManager->attach('db', function ($event, $db) use ($profiler) {
 
                if ($event->getType() == 'beforeQuery') {
                    $profiler->startProfile($db->getSQLStatement());
                }
                if ($event->getType() == 'afterQuery') {
                    $profiler->stopProfile();
                }
            });
            $di->get('view')->setVar('profiler',$di->get('profiler'));
        }
 
        $db = $di->get('db');
        $db->setEventsManager($eventsManager);
 
        $dispatcher->setEventsManager($eventsManager);
        $di->set('dispatcher', $dispatcher);
    }
 
    private function initView($di,$config = [])
    {
 
 
        $view = new \Phalcon\Mvc\View();
 
        define('MAIN_VIEW_PATH', PATHS['MODULES'] . "Konsol/Views/");
 
        $view->setViewsDir(MAIN_VIEW_PATH);
        $view->setMainView(MAIN_VIEW_PATH . '/konsol');
        $view->setLayoutsDir(MAIN_VIEW_PATH . '/layouts/');
        $view->setLayout('/konsol');
        $view->setPartialsDir(MAIN_VIEW_PATH . '/partials/');
 
 
        // Volt
        $volt = new \Application\Mvc\View\Engine\Volt($view, $di);
 
 
        $volt->setOptions([
            'compiledPath' => PATHS['APPS'] . '/../data/cache/volt/',
            'compileAlways' => (DEBUG_MODE) ? true : false
        ]);
        $volt->initCompiler();
 
 
        $phtml = new \Phalcon\Mvc\View\Engine\Php($view, $di);
        $viewEngines = [
            ".volt" => $volt,
            ".phtml" => $phtml,
        ];
 
        $view->registerEngines($viewEngines);
 
        $ajax = $di->get('request')->getQuery('_ajax');
 
        if ($ajax) $view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_LAYOUT);
 
 
        $view->setVar('config',$config);
        $di->set('view', $view);
 
        return $view;
    }
 
    private function initCache($di)
    {
        $config = $di->get('config');
 
 
        $cacheFrontend = new \Phalcon\Cache\Frontend\Data([
            "lifetime" => 60,
            "prefix" => HOST_HASH,
        ]);
 
        $cache = null;
        switch ($config->cache) {
            case 'memcache':
                $cache = new \Phalcon\Cache\Backend\Memcache(
                    $cacheFrontend, [
                    "host" => $config->memcache->host,
                    "port" => $config->memcache->port,
                ]);
                break;
            case 'memcached':
                $cache = new \Phalcon\Cache\Backend\Libmemcached(
                    $cacheFrontend, [
                    "host" => $config->memcached->host,
                    "port" => $config->memcached->port,
                ]);
                break;
      case 'redis':
        
        $cache = new \Phalcon\Cache\Backend\Redis(
          $cacheFrontend, [
            "host" => $config->redis->host,
            "port" => $config->redis->port,
            "auth" => $config->redis->auth,
            "statsKey" => $config->redis->statsKey,
            "persistent" => $config->redis->persistent,
            "index" => $config->redis->index
          ]);
 
                break;
            default:
                $cache = new \Phalcon\Cache\Backend\File($cacheFrontend, [
                    "cacheDir" => PATHS['APPS'] . "/../data/cache/backend/",
                    'lifetime' => 172800
                ]);
        }
 
        \Application\Widget\Proxy::$cache = $cache; // Modules Widget System
 
        $modelsMetadata = new \Phalcon\Mvc\Model\Metadata\Memory();
 
        $di->set('cache', $cache, true);
        $di->set('modelsCache', $cache, true);
        $di->set('modelsMetadata', $modelsMetadata);
        $di->set('cacheManager', new CacheManager());
    }
 
    private function dispatch($di){
 
 
        $router = $di->get('router');
 
        $router->handle();
 
 
        $view       = $di->get('view');
        $dispatcher = $di->get('dispatcher');
        $response   = $di->get('response');
 
        $dispatcher->setModuleName($router->getModuleName());
        $dispatcher->setControllerName($router->getControllerName());
        $dispatcher->setActionName($router->getActionName());
        $dispatcher->setParams($router->getParams());
 
        $moduleName = \Application\Utils\ModuleName::camelize($router->getModuleName());
 
 
        $ModuleClassName = $moduleName . '\Module';
        if (class_exists($ModuleClassName)) {
            $module = new $ModuleClassName();
            $module->registerAutoloaders();
            $module->registerServices($di);
        }
 
        $view->start();
 
        try {
 
            $dispatcher->dispatch();
 
        } catch (\Phalcon\Exception $error) {
 
            return $this->initCatch($di,  $error,[
                "code" => "dispatch:catch",
                "message" => "Uygulama çalıştırılırken beklenmedik hata oluştu"
            ]);
 
        }
 
 
        $view->render(
            $dispatcher->getControllerName(),
            $dispatcher->getActionName(),
            $dispatcher->getParams()
        );
 
        $view->finish();
 
        // AJAX
        $request = $di['request'];
        $_ajax = $request->getQuery('_ajax');
 
        if ($_ajax) {
 
            $view->setLayout('ajax');
 
            $contents = $view->getContent();
 
            $return = new \stdClass();
            $return->status = true;
            $return->title  = $di->get('helper')->title()->get();
            $return->html   = $contents;
 
 
            $headers = $response->getHeaders()->toArray();
            if (isset($headers[404]) || isset($headers[503])) {
                $return->status = false;
            }
            $response->setContentType('application/json', 'UTF-8');
            $response->setContent(json_encode($return));
        } else {
            $response->setContent($view->getContent());
        }
 
        return $response;
    }
 
    private function getModules($di){
 
        try {
 
            $config = $di->get('config');
            $db = $di->get('db');
            $cache = new \Application\Mvc\Helper\CmsCache();
 
 
            if (APPLICATION_ENV == "development") $db->query("SET @@GLOBAL.sql_mode=''");//fix group_by error
 
            $user_modules = $cache::getInstance()->get('modules');
 
 
            if (!$user_modules):
 
                //GET_MODULES
                $statement = $db->prepare('SELECT * FROM modules WHERE status = ? order by priority ASC');
                $statement->execute(array("active"));
                $user_modules = $statement->fetchAll(\Phalcon\Db::FETCH_ASSOC);
 
 
                $cache::getInstance()->save('modules', $user_modules);
 
            endif;
 
 
            //SET_MODULES
            require_once PATHS['APPS'] . '/modules/Application/Loader/Modules.php';
 
            $modules = new \Application\Loader\Modules();
            $modules_config = $modules->modulesConfig($user_modules);
 
 
            foreach ($modules_config['loader']['namespaces'] as $key => $module)
                $config->loader->namespaces[$key] = $module;
 
            foreach ($modules_config['modules'] as $key => $module)
                $config->modules[$key] = $module;
 
 
            return $config;
 
        }catch (\Throwable $e){
 
            $params = [
                "code" => "bootstrap_modules_catch",
                "message" => $e->getMessage(),
                "file" => $e->getFile(),
                "line" => $e->getLine(),
            ];
            return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
        }
 
    }
 
 
    private function initDefined(){
        /*
         * geliştirici modunu açar
         */
 
 
 
        $root_dir = rtrim(__DIR__,'app');
        define('PATHS',[
            "ROOT"     => $root_dir,
            "APPS"     => $root_dir  . 'app/',
            "MODULES"  => $root_dir  . "app/modules/",
            "PLUGINS"  => $root_dir  . "app/plugins/",
            "DATA"     => $root_dir  . "data/",
            "CACHE"    => $root_dir  . "data/cache/",
            "PUBLIC"   => $root_dir  . 'public/',
            "MEDIA"    => $root_dir  . "public/media/",
            "ASSETS"   => $root_dir  . "public/assets/",
        ]);
 
 
 
 
 
 
 
    }
 
    private function initCatch($di, $exception = null,$params = []){
 
 
        $debug = new \Phalcon\Debug();
        $debug->listen()->onUncaughtException($exception);
 
        if (DEBUG_MODE):
            if($exception):
                try {
                    $debug = new \Phalcon\Debug();
                    $debug->listen()->onUncaughtException($exception);
                    return true;
                }catch (\Throwable $e){
 
                }
            endif;
        endif;
 
 
        /*
        $redirect_url = "./hata/500?" . http_build_query($params);
 
        header("HTTP/1.0 404 Not Found");
        header('Location: '.$redirect_url);
        die();
        */
 
 
 
        //return $di->get('response')->redirect('hata/404?' . http_build_query($params))->send();
        return $di->get('response')->redirect('public/error.php?' . http_build_query($params))->send();
 
    }
 
 
 
}
#3App\Bootstrap->run()
/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php (30)
<?php
 
 
    /*
     * Yobisi.Konsol
     *
     */
    //session_name('subdomain_session');
 
 
    error_reporting(@$_GET['debug'] ? E_ALL : 1);
 
    define('APPLICATION_ENV', ($_SERVER['HTTP_HOST'] == "localhost") ? "development" : "production");
 
 
    if (isset($_GET['debug_mode'])):
        define('DEBUG_MODE', $_SESSION['DEBUG_MODE'] = (bool) $_GET['debug_mode']);
    elseif (isset($_SESSION['DEBUG_MODE'])):
        define('DEBUG_MODE', (bool)$_SESSION['DEBUG_MODE']);
    else:
        define('DEBUG_MODE', (APPLICATION_ENV == "development") ? true : false);
    endif;
 
 
 
    try {
 
        require_once '../app/Bootstrap.php';
        $bootstrap = new App\Bootstrap();
        $bootstrap->run();
 
 
    } catch (Exception $e) {
 
 
        if (DEBUG_MODE):
 
            $debug = new \Phalcon\Debug();
            die($debug->listen()->onUncaughtException($e));
 
        else:
 
 
 
            /*
            $params = ["message" => $e->getMessage(), "file" => $e->getFile(), "line" => $e->getLine(),];
 
            $redirect_url = "hata/500?" . http_build_query([
                    "message" => $e->getMessage(),
                    "file" => $e->getFile(),
                    "line" => $e->getLine()
                ]);
 
            header("HTTP/1.0 404 Not Found");
            header('Location: '.$redirect_url);
            die();
            */
 
            include "error.php";
        endif;
 
    }
KeyValue
_url/images/media/MTY0MzNiMjQ4MDExZmI.jpg
KeyValue
USERdenizliyeniolay.com_a706vjldz7n
HOME/var/www/vhosts/denizliyeniolay.com
SCRIPT_NAME/public/index.php
REQUEST_URI/images/media/MTY0MzNiMjQ4MDExZmI.jpg
QUERY_STRING_url=/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.0
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/public/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_QUERY_STRING_url=/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REMOTE_PORT52818
SCRIPT_FILENAME/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php
SERVER_ADMINroot@localhost
CONTEXT_DOCUMENT_ROOT/var/www/vhosts/denizliyeniolay.com/httpdocs
CONTEXT_PREFIX
REQUEST_SCHEMEhttps
DOCUMENT_ROOT/var/www/vhosts/denizliyeniolay.com/httpdocs
REMOTE_ADDR172.70.178.187
SERVER_PORT443
SERVER_ADDR127.0.0.1
SERVER_NAMEdenizliyeniolay.com
SERVER_SOFTWAREApache
SERVER_SIGNATURE
PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_COOKIEfikker-61vm-nk2N=MgPGRI6oXLV7DSLWJk4y6wNi63F1ZE0E
HTTP_CF_CONNECTING_IP18.223.170.103
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_ACCEPT*/*
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_RAY8e019b2a6baedadc-ORD
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_CF_IPCOUNTRYUS
HTTP_CDN_LOOPcloudflare; loops=1
HTTP_CONNECTIONclose
HTTP_X_ACCEL_INTERNAL/internal-nginx-static-location
HTTP_X_FORWARDED_FOR18.223.170.103
HTTP_X_REAL_IP172.70.178.187
HTTP_HOSTdenizliyeniolay.com
proxy-nokeepalive1
HTTPSon
PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
REDIRECT_REDIRECT_STATUS200
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_REDIRECT_SCRIPT_URL/images/media/MTY0MzNiMjQ4MDExZmI.jpg
REDIRECT_REDIRECT_UNIQUE_IDZy-xNTwpSUme-xvpTDTaHQAAAQg
FCGI_ROLERESPONDER
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1731195189.0344
REQUEST_TIME1731195189
#Path
0/var/www/vhosts/denizliyeniolay.com/httpdocs/public/index.php
1/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php
2/var/www/vhosts/denizliyeniolay.com/httpdocs/app/config/application.php
3/var/www/vhosts/denizliyeniolay.com/httpdocs/app/config/environment/production.php
4/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/autoload.php
5/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/autoload_real.php
6/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/ClassLoader.php
7/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/composer/autoload_static.php
8/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
9/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-php72/bootstrap.php
10/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-intl-idn/bootstrap.php
11/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-mbstring/bootstrap.php
12/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/ralouphie/getallheaders/src/getallheaders.php
13/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/promises/src/functions_include.php
14/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/promises/src/functions.php
15/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/polyfill-iconv/bootstrap.php
16/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/symfony/deprecation-contracts/function.php
17/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/swiftmailer/swiftmailer/lib/swift_required.php
18/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/swiftmailer/swiftmailer/lib/classes/Swift.php
19/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/mtdowling/jmespath.php/src/JmesPath.php
20/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/guzzle/src/functions_include.php
21/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/guzzlehttp/guzzle/src/functions.php
22/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/aws/aws-sdk-php/src/functions.php
23/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/CmsCache.php
24/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Loader/Modules.php
25/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/View/Engine/Volt.php
26/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Widget/Proxy.php
27/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Cache/Manager.php
28/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Acl.php
29/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Localization.php
30/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/MobileDetect.php
31/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/PhoneFormat.php
32/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Redirects.php
33/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/SendSMS.php
34/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Slugger.php
35/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/StaticMenu.php
36/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/TimeAgo.php
37/var/www/vhosts/denizliyeniolay.com/httpdocs/app/plugins/Title.php
38/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Language.php
39/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/Translate.php
40/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper.php
41/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Auth.php
42/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Users/Model/Users.php
43/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Model/Model.php
44/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Assets/Manager.php
45/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper/Toast.php
46/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Init.php
47/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Helper/Cdn.php
48/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Helper/Position.php
49/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Form/Options/IntegrationForm.php
50/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Form/Form.php
51/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php
52/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Init.php
53/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/Logger.php
54/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/AbstractLogger.php
55/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Helper/LogLevel.php
56/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Users/Init.php
57/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Init.php
58/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostTypes.php
59/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostTaxonomies.php
60/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/PostsFinder.php
61/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Helper/TermsFinder.php
62/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Router/Resources.php
63/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Constants/Init.php
64/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/MenuMaker/Init.php
65/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Pages/Init.php
66/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Sitemap/Init.php
67/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Whatsapp/Init.php
68/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Whatsapp/Widget/WhatsappWidget.php
69/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Widget/AbstractWidget.php
70/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/YobiForm/Init.php
71/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Theme/Init.php
72/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Init.php
73/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Helper/HaberFinder.php
74/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Reklam/Init.php
75/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/KoseYazilari/Init.php
76/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/CookieAlert/Init.php
77/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/CookieAlert/Widget/FrontendWidget.php
78/var/www/vhosts/denizliyeniolay.com/httpdocs/data/cache/volt/%%var%%www%%vhosts%%denizliyeniolay.com%%httpdocs%%app%%modules%%cookiealert%%views%%widget%%floating.volt.php
79/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Popup/Init.php
80/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Popup/Widget/FrontendWidget.php
81/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Model/Posts.php
82/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Model/Translate/PostsMeta.php
83/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Model/Translate.php
84/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Media.php
85/var/www/vhosts/denizliyeniolay.com/httpdocs/data/cache/volt/%%var%%www%%vhosts%%denizliyeniolay.com%%httpdocs%%app%%modules%%popup%%views%%widget%%popup.volt.php
86/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Redirects/Init.php
87/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Bildirimler/Init.php
88/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Router/DefaultRouter.php
89/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Routes.php
90/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Logs/Routes.php
91/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Routes.php
92/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Constants/Routes.php
93/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/MenuMaker/Routes.php
94/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Sitemap/Routes.php
95/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/YobiForm/Routes.php
96/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Theme/Routes.php
97/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/News/Routes.php
98/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/KoseYazilari/Routes.php
99/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Redirects/Routes.php
100/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Bildirimler/Routes.php
101/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Utils/ModuleName.php
102/var/www/vhosts/denizliyeniolay.com/httpdocs/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php
Memory
Usage2097152
Beklenmedik Hata Oluştu

HATA!

Beklenmedik Hata Oluştu