Phalcon Framework 3.4.5

RedisException: Connection refused

/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php (42)
#0Redis->connect(185.136.160.201, 6379, 0)
#1Phalcon\Cache\Backend\Redis->_connect()
#2Phalcon\Cache\Backend\Redis->get(options_08823d7765bc84cc22e480b803fc17d8, 3600)
#3Phalcon\Mvc\Model\Query->execute()
#4Phalcon\Mvc\Model::findFirst(Array([conditions] => key = :key: and lang = :lang:, [bind] => Array([key] => google_analytics, [lang] => tr), [cache] => Array([key] => options_08823d7765bc84cc22e480b803fc17d8)))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php (42)
<?php
 
namespace Konsol\Model;
 
use Application\Mvc\Helper\Output;
use Phalcon\Mvc\Model\Message;
use Application\Mvc\Model\Model;
use Posts\Model\Posts;
 
class Options extends Model
{
 
 
    public $key;
    public $lang;
    public $value;
    public $type = "text";
    public $copy = true;
 
 
    public function initialize()
    {
 
        //exit(var_dump($this->columnMap()));
        $this->hasOne("value", "Konsol\Model\Media", "id", ["alias" => "media_relation"]);
    }
 
    public function getSource()
    {
        return 'options';
    }
 
 
 
    public static function get($key,$lang = false){
 
        $lang   = ($lang) ? $lang : Language::getCurrentLanguage();
        $option = self::findFirst([
            "conditions" => "key = :key: and lang = :lang:",
            "bind" => ["key" => $key, "lang" => $lang],
            "cache" => [
                "key" => 'options_' . md5( $lang  . "-" . $key)
            ]
        ]);
 
        return $option;
    }
 
    public static function getOption($key,$default = false,$lang = false){
        $option = self::get($key,$lang);
        return ($option) ? $option->getValue() : $default;
    }
 
    public static function set($key,$value,$type = "text"){
 
        try {
 
            $model = self::get($key);
 
            if ($model) {
 
                if (self::isNull($value))
                    return self::remove($key, $value, $type);
 
                if($model->getValue() == $value)
                    return true;//Değişiklik yoksa atla
 
            } else {
 
                if(self::isNull($value))
                    return false;
 
                $model = new \Konsol\Model\Options();
                $model->setKey($key);
                $model->setLang(Language::getCurrentLanguage());
            }
 
            $model->setType($type);
            $model->setValue($value);
 
 
            if (!$model->save())
                Output::set(false, "Ayarlar kaldırılırken hata !", 'setOption_1000');//$this->gtThrowable($e)
 
 
            return true;
 
        }catch (\Throwable $e){
 
            Output::set(false, "Ayarlar kaldırılırken hata !", 'setOption_catch',[
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ]);//$this->gtThrowable($e)
        }
 
    }
 
    public static function remove($key){
 
        try {
 
            $option = self::get($key);
 
            if (!$option) return true;
 
            if (!$option->delete())
                Output::set(false, "Ayarlar kaldırılırken hata !", 'remove_3000');//$this->errorMessage($option->getMessages())
 
            return true;
 
        }catch (\Throwable $e){
 
            Output::set(false, "Ayarlar kaldırılırken hata !", 'remove_catch',[
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ]);//$this->gtThrowable($e)
 
        }
 
    }
 
    public function afterUpdate()
    {
 
        $this->getDi()->get('modelsCache')->delete(md5("options_" . $this->getKey()));
 
    }
 
 
 
    public function getKey()
    {
        return $this->key;
    }
    public function setKey($key)
    {
        $this->key = $key;
    }
 
 
    public function getLang()
    {
        return $this->lang;
    }
    public function setLang($lang)
    {
        $this->lang = $lang;
    }
 
 
    public function getType()
    {
        return $this->type;
    }
    public function setType($type)
    {
        $this->type = $type;
    }
 
 
    public function getCopy()
    {
        return $this->copy;
    }
    public function setCopy($copy)
    {
        $this->copy = $copy;
    }
 
 
 
    public function getValue($default = false){
 
        $value = ($this->getType() == "media") ? $this->getMedia($this->value) : $this->value;
        return (isset($value)) ? $value : $default;
    }
 
    public function setValue($value,$force = false){
        $this->value = ($this->getType() == "media" && $force !== true) ? $this->setMedia($value) : $value;
        return $this;
    }
 
 
 
    public function beforeValidation()
    {
 
 
        if(!$this->getLang()) $this->setLang(Language::getCurrentLanguage());
 
        if(!$this->getType()) $this->setType("text");
 
    }
 
    public function afterCreate()
    {
        $this->updateCache();
        $this->languagesOperations('create');
 
    }
 
    public function afterSave()
    {
 
 
        $this->updateCache();
        $this->languagesOperations('update');
    }
 
    public function afterDelete()
    {
        $this->updateCache();
        $this->languagesOperations('delete');
    }
 
    private function updateCache()
    {
 
        $cache = $this->getDi()->get('cache');
 
        $cache->delete('options_' . md5( $this->getLang()  . "-" . $this->getKey()));
 
 
    }
 
 
 
 
    /*
     * Helpers
     */
 
 
 
    public function setOptions($options){
 
        try{
 
            foreach($options as $option):
 
                self::set($option['key'],$option['value'],$option['type']);
 
            endforeach;//form loop
 
            return true;
 
        } catch (\Throwable $e) {
 
            $this->output(false, "Ayarlar kaydedilirken beklenmedik hata oluştu.", "set_options_catch", $this->getThrowable($e));
 
        }
 
    }
 
 
    public function getOptionsByForm($form){
 
        try {
 
            $options = new \stdClass();
 
            foreach ($form->getElements() as $element) {
 
                $key = $element->getName();
                $value = self::getOption($element->getName());
                if (!isset($value)) continue;
 
                $options->{$key} = $value;
            }
 
 
 
            return $options;
 
        }catch (\Throwable $e){
            return false;
        }
 
    }
 
    public function setOptionsByForm($form,$redirect_url = false){
 
        try{
 
 
            $request = $this->di->get('request');
 
 
            if (!$form->isValid($request->getPost()))
                return false;
 
            $options = array();
 
            foreach($form->getElements() as $element):
 
                $options[] = [
                    'key'   => $element->getName(),
                    'value' => $request->getPost($element->getName()),
                    'type'  => (get_class($element ) == "Application\Form\Element\Uploader") ? "media" : "text"
                ];
 
            endforeach;//form loop
 
 
 
            self::setOptions($options);
 
            $this->output(true, "Ayarlar başarıyla kaydedildi.", "set_options_success",[
                "options"  => $options,
                "redirect" => $redirect_url
            ]);
 
        } catch (\Throwable $e) {
 
            $this->output(false, "Ayarlar kaydedilirken beklenmedik hata oluştu.", "set_options_catch", $this->getThrowable($e));
 
        }
 
    }
 
 
 
    public function languagesOperations($operation = "create"){
 
        if($this->getCopy()):
            $languages = Language::getLanguages();
            if(count($languages) > 1):
                foreach ($languages as $language):
                    switch ($operation):
                        case "create":
                            $this->createLanguage($language['iso']);
                        break;
                        case "update":
                            if($this->getType() == "media"):
                                $this->updateLanguage($language['iso']);
                            endif;
                        break;
                        case "delete":
                            $this->deleteLanguage($language['iso']);
                        break;
                        default:
                            exit('Geçersiz operasyon');
                    endswitch;
                endforeach;
            endif;
        endif;
 
        return true;
    }
 
    public function createLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $check = self::count([
               "conditions" => "lang = :lang: and key = :key:",
               "bind" => ["lang" => $lang_iso, "key"  => $this->getKey()]
            ]);
            if($check > 0) return false;
 
            $model = new Options();
            $model->setLang($lang_iso);
            $model->setKey($this->getKey());
            $model->setValue($this->value,true);
            $model->setType($this->getType());
            $model->setCopy(false);
 
            if (!$model->create()) {
                $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_copy_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_copy_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null,
                "value" => $this->value
            ]);
 
        }
 
    }
 
    public function updateLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
 
            $model = self::get($this->getKey(),$lang_iso);
            if(!$model)
                return $this->createLanguage($lang_iso);
 
 
            $model->setType($this->getType());
            $model->setValue($this->value,true);
            $model->setCopy(false);
 
 
            if (!$model->update()) {
 
                $this->output(false,sprintf('%s dili güncellenirken hata oluştu',$lang_iso),"option_update_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_update_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null
            ]);
 
        }
 
    }
 
    public function deleteLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $model = self::get($this->getKey(),$lang_iso);
            if(!$model) return true;
 
            if (!$model->delete()) {
                $this->output(false,sprintf('%s dili silinirken hata oluştu',$lang_iso),"option_delete_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili silinirken hata oluştu',$lang_iso),"option_delete_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null
            ]);
 
        }
 
    }
 
 
 
 
    public function copyLanguages(){
 
        if(!$this->getCopy()) return false;
 
        $languages = Language::getLanguages();
 
        if(count($languages) > 1):
            foreach ($languages as $language):
                $this->copyLanguage($language['iso']);
            endforeach;
        endif;
 
        return true;
    }
 
 
    public function copyLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $model = new Options();
            $model->setLang($lang_iso);
            $model->setKey($this->getKey());
            $model->setValue($this->value);
            $model->setType($this->getType());
            $model->setCopy(false);
 
            if (!$model->create()) {
                return false;
                /*
                return $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"options_lang_copy_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
                */
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            /*
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"options_lang_copy_1305",[
                'error' => $this->getThrowable($e),
                'item'  => $model->toArray()
            ]);
            */
            return false;
 
        }
 
    }
 
 
}
#5Konsol\Model\Options::get(google_analytics, tr)
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php (50)
<?php
 
namespace Konsol\Model;
 
use Application\Mvc\Helper\Output;
use Phalcon\Mvc\Model\Message;
use Application\Mvc\Model\Model;
use Posts\Model\Posts;
 
class Options extends Model
{
 
 
    public $key;
    public $lang;
    public $value;
    public $type = "text";
    public $copy = true;
 
 
    public function initialize()
    {
 
        //exit(var_dump($this->columnMap()));
        $this->hasOne("value", "Konsol\Model\Media", "id", ["alias" => "media_relation"]);
    }
 
    public function getSource()
    {
        return 'options';
    }
 
 
 
    public static function get($key,$lang = false){
 
        $lang   = ($lang) ? $lang : Language::getCurrentLanguage();
        $option = self::findFirst([
            "conditions" => "key = :key: and lang = :lang:",
            "bind" => ["key" => $key, "lang" => $lang],
            "cache" => [
                "key" => 'options_' . md5( $lang  . "-" . $key)
            ]
        ]);
 
        return $option;
    }
 
    public static function getOption($key,$default = false,$lang = false){
        $option = self::get($key,$lang);
        return ($option) ? $option->getValue() : $default;
    }
 
    public static function set($key,$value,$type = "text"){
 
        try {
 
            $model = self::get($key);
 
            if ($model) {
 
                if (self::isNull($value))
                    return self::remove($key, $value, $type);
 
                if($model->getValue() == $value)
                    return true;//Değişiklik yoksa atla
 
            } else {
 
                if(self::isNull($value))
                    return false;
 
                $model = new \Konsol\Model\Options();
                $model->setKey($key);
                $model->setLang(Language::getCurrentLanguage());
            }
 
            $model->setType($type);
            $model->setValue($value);
 
 
            if (!$model->save())
                Output::set(false, "Ayarlar kaldırılırken hata !", 'setOption_1000');//$this->gtThrowable($e)
 
 
            return true;
 
        }catch (\Throwable $e){
 
            Output::set(false, "Ayarlar kaldırılırken hata !", 'setOption_catch',[
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ]);//$this->gtThrowable($e)
        }
 
    }
 
    public static function remove($key){
 
        try {
 
            $option = self::get($key);
 
            if (!$option) return true;
 
            if (!$option->delete())
                Output::set(false, "Ayarlar kaldırılırken hata !", 'remove_3000');//$this->errorMessage($option->getMessages())
 
            return true;
 
        }catch (\Throwable $e){
 
            Output::set(false, "Ayarlar kaldırılırken hata !", 'remove_catch',[
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ]);//$this->gtThrowable($e)
 
        }
 
    }
 
    public function afterUpdate()
    {
 
        $this->getDi()->get('modelsCache')->delete(md5("options_" . $this->getKey()));
 
    }
 
 
 
    public function getKey()
    {
        return $this->key;
    }
    public function setKey($key)
    {
        $this->key = $key;
    }
 
 
    public function getLang()
    {
        return $this->lang;
    }
    public function setLang($lang)
    {
        $this->lang = $lang;
    }
 
 
    public function getType()
    {
        return $this->type;
    }
    public function setType($type)
    {
        $this->type = $type;
    }
 
 
    public function getCopy()
    {
        return $this->copy;
    }
    public function setCopy($copy)
    {
        $this->copy = $copy;
    }
 
 
 
    public function getValue($default = false){
 
        $value = ($this->getType() == "media") ? $this->getMedia($this->value) : $this->value;
        return (isset($value)) ? $value : $default;
    }
 
    public function setValue($value,$force = false){
        $this->value = ($this->getType() == "media" && $force !== true) ? $this->setMedia($value) : $value;
        return $this;
    }
 
 
 
    public function beforeValidation()
    {
 
 
        if(!$this->getLang()) $this->setLang(Language::getCurrentLanguage());
 
        if(!$this->getType()) $this->setType("text");
 
    }
 
    public function afterCreate()
    {
        $this->updateCache();
        $this->languagesOperations('create');
 
    }
 
    public function afterSave()
    {
 
 
        $this->updateCache();
        $this->languagesOperations('update');
    }
 
    public function afterDelete()
    {
        $this->updateCache();
        $this->languagesOperations('delete');
    }
 
    private function updateCache()
    {
 
        $cache = $this->getDi()->get('cache');
 
        $cache->delete('options_' . md5( $this->getLang()  . "-" . $this->getKey()));
 
 
    }
 
 
 
 
    /*
     * Helpers
     */
 
 
 
    public function setOptions($options){
 
        try{
 
            foreach($options as $option):
 
                self::set($option['key'],$option['value'],$option['type']);
 
            endforeach;//form loop
 
            return true;
 
        } catch (\Throwable $e) {
 
            $this->output(false, "Ayarlar kaydedilirken beklenmedik hata oluştu.", "set_options_catch", $this->getThrowable($e));
 
        }
 
    }
 
 
    public function getOptionsByForm($form){
 
        try {
 
            $options = new \stdClass();
 
            foreach ($form->getElements() as $element) {
 
                $key = $element->getName();
                $value = self::getOption($element->getName());
                if (!isset($value)) continue;
 
                $options->{$key} = $value;
            }
 
 
 
            return $options;
 
        }catch (\Throwable $e){
            return false;
        }
 
    }
 
    public function setOptionsByForm($form,$redirect_url = false){
 
        try{
 
 
            $request = $this->di->get('request');
 
 
            if (!$form->isValid($request->getPost()))
                return false;
 
            $options = array();
 
            foreach($form->getElements() as $element):
 
                $options[] = [
                    'key'   => $element->getName(),
                    'value' => $request->getPost($element->getName()),
                    'type'  => (get_class($element ) == "Application\Form\Element\Uploader") ? "media" : "text"
                ];
 
            endforeach;//form loop
 
 
 
            self::setOptions($options);
 
            $this->output(true, "Ayarlar başarıyla kaydedildi.", "set_options_success",[
                "options"  => $options,
                "redirect" => $redirect_url
            ]);
 
        } catch (\Throwable $e) {
 
            $this->output(false, "Ayarlar kaydedilirken beklenmedik hata oluştu.", "set_options_catch", $this->getThrowable($e));
 
        }
 
    }
 
 
 
    public function languagesOperations($operation = "create"){
 
        if($this->getCopy()):
            $languages = Language::getLanguages();
            if(count($languages) > 1):
                foreach ($languages as $language):
                    switch ($operation):
                        case "create":
                            $this->createLanguage($language['iso']);
                        break;
                        case "update":
                            if($this->getType() == "media"):
                                $this->updateLanguage($language['iso']);
                            endif;
                        break;
                        case "delete":
                            $this->deleteLanguage($language['iso']);
                        break;
                        default:
                            exit('Geçersiz operasyon');
                    endswitch;
                endforeach;
            endif;
        endif;
 
        return true;
    }
 
    public function createLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $check = self::count([
               "conditions" => "lang = :lang: and key = :key:",
               "bind" => ["lang" => $lang_iso, "key"  => $this->getKey()]
            ]);
            if($check > 0) return false;
 
            $model = new Options();
            $model->setLang($lang_iso);
            $model->setKey($this->getKey());
            $model->setValue($this->value,true);
            $model->setType($this->getType());
            $model->setCopy(false);
 
            if (!$model->create()) {
                $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_copy_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_copy_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null,
                "value" => $this->value
            ]);
 
        }
 
    }
 
    public function updateLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
 
            $model = self::get($this->getKey(),$lang_iso);
            if(!$model)
                return $this->createLanguage($lang_iso);
 
 
            $model->setType($this->getType());
            $model->setValue($this->value,true);
            $model->setCopy(false);
 
 
            if (!$model->update()) {
 
                $this->output(false,sprintf('%s dili güncellenirken hata oluştu',$lang_iso),"option_update_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_update_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null
            ]);
 
        }
 
    }
 
    public function deleteLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $model = self::get($this->getKey(),$lang_iso);
            if(!$model) return true;
 
            if (!$model->delete()) {
                $this->output(false,sprintf('%s dili silinirken hata oluştu',$lang_iso),"option_delete_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili silinirken hata oluştu',$lang_iso),"option_delete_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null
            ]);
 
        }
 
    }
 
 
 
 
    public function copyLanguages(){
 
        if(!$this->getCopy()) return false;
 
        $languages = Language::getLanguages();
 
        if(count($languages) > 1):
            foreach ($languages as $language):
                $this->copyLanguage($language['iso']);
            endforeach;
        endif;
 
        return true;
    }
 
 
    public function copyLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $model = new Options();
            $model->setLang($lang_iso);
            $model->setKey($this->getKey());
            $model->setValue($this->value);
            $model->setType($this->getType());
            $model->setCopy(false);
 
            if (!$model->create()) {
                return false;
                /*
                return $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"options_lang_copy_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
                */
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            /*
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"options_lang_copy_1305",[
                'error' => $this->getThrowable($e),
                'item'  => $model->toArray()
            ]);
            */
            return false;
 
        }
 
    }
 
 
}
#6Konsol\Model\Options::getOption(google_analytics, false)
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Application/Mvc/Helper.php (132)
<?php
 
/**
 * Helper
 * @copyright Copyright (c) 2018 - 2019 Yobisi (https://www.yobisi.com)
 * @author Ahmet ALTINTAŞ <[email protected]>
 */
 
namespace Application\Mvc;
 
use Application\Mvc\Helper\CmsCache;
use Application\Mvc\Router\DefaultRouter;
use Konsol\Model\Language;
use Konsol\Model\Media;
use Konsol\Model\Modules;
use Konsol\Model\Options;
use League\Flysystem\Exception;
use Logs\Helper\Logger;
use Phalcon\Mvc\Model\Transaction\Failed;
use Users\Model\RoleResource;
use YobisiKonsol\Plugin\Acl;
use YobisiKonsol\Plugin\StaticMenu;
 
 
class Helper extends \Phalcon\Mvc\User\Component
{
 
    private $translate = null;
    private $admin_translate = null;
    public $menu;
 
    public function __construct()
    {
 
    }
 
    public function translate($string){
        $translate = $this->di->get('translate');
        return $translate->get($string);
    }
 
    public function at($string, $placeholders = null){
        return $this->translate($string, $placeholders);
    }
 
 
    public function widget($namespace = 'Index', $class = 'Index', $params = [])
    {
 
        try {
 
            return new \Application\Widget\Proxy($namespace, $class, $params);
 
        } catch (Failed $e) {
 
            throw new Failed("Bileşen çekilirken hata oluştu,", $e->getMessage());
        }
 
    }
 
 
    public function redirect($url, $code = 302){
 
        return $this->response->redirect($url)->send();
 
    }
 
 
 
 
    public function langUrl($url,$base_url = true){
 
        $current_url = \Konsol\Model\Language::getLanguage("current","url");
        $lang_url   =  ($current_url) ?  $current_url . '/' . $url :  $url;
 
        return ($base_url) ?  $this->url->get($lang_url) : $lang_url;
    }
 
 
    public function language($key = null){
        return Language::getLanguage("current",$key);
    }
 
 
    public function languages()
    {
 
        return Language::getLanguages();
    }
 
 
    public function langSwitcher($lang,$default_url = 'konsol/index')
    {
        return  \Application\Mvc\Helper\LangSwitcher::render($lang, $default_url);
    }
 
 
    public function isAdminSession()
    {
        $session = $this->getDi()->get('session');
        $auth = $session->get('auth');
        if ($auth) {
            if ($auth->is_admin == true) {
                return true;
            }
        }
    }
 
    public function error($code = 404)
    {
        $helper = new \Application\Mvc\Helper\ErrorReporting();
        return $helper->{'error' . $code}();
 
    }
 
    public function title($title = null, $h1 = true)
    {
        return \Application\Mvc\Helper\Title::getInstance($title, $h1);
    }
 
    public function meta()
    {
        return \Application\Mvc\Helper\Meta::getInstance();
    }
 
    public function publicResources()
    {
        return \Application\Mvc\Router\Resources::getInstance();
    }
 
    public function getOption($key,$default = false){
        return Options::getOption($key,$default);
    }
 
    public function getOptionMedia($key, $default = false){
        $media = Options::getOption($key);
        return ($media) ? $media->getFirst()->getFile() : $default;
    }
 
    public function setOption($key, $value,$type = "text"){
        return Options::set($key,$value,$type);
    }
 
 
    public function getActiveTheme(){
        return Options::getOption('site_title');
 
    }
 
    public function staticMenu($position){
        $static_menu = new StaticMenu();
        return $static_menu->getInstance($position);
    }
 
 
 
 
    public function dbProfiler()
    {
        $object = new \Application\Mvc\Helper\DbProfiler();
        return $object->DbOutput();
    }
 
 
    public function modulePartial($template, $data, $module = null){
        try {
 
            $view = clone $this->getDi()->get('view');
            $partialsDir = '';
 
            $partialsDir = PATHS['MODULES'] . $module . '/Views/';
            if(!file_exists($partialsDir) && $module):
                $moduleName = \Application\Utils\ModuleName::camelize($module);
                $partialsDir = PATHS['MODULES'] . $moduleName . '/Views/';
            endif;
 
            $view->setViewsDir($partialsDir);
            $view->setPartialsDir($partialsDir . "widget/");
 
 
            if(!$view->exists("widget/".$template)):
                if(DEBUG_MODE):
                    echo "<h2 class='widget-error'>Dosya çekilirken hata oluştu</h2>";
                endif;
                echo "<!-- Bileşen dosyası çekilirken hata oluştu => " . $view->getPartialsDir() ."$template.volt ! -->";
                return false;
            endif;
 
            return $view->partial($template, $data);
 
 
        } catch (Exception $e) {
 
            exit("Konsol.Error code : helper_1003");
        }
    }
 
    public function getWidget($template, $data, $module = null)
    {
        $view = clone $this->getDi()->get('view');
        $partialsDir = '';
        if ($module) {
            $moduleName = \Application\Utils\ModuleName::camelize($module);
            $partialsDir = '../../../modules/' . $moduleName . '/views/';
        }
 
        $view->setPartialsDir($partialsDir);
 
        return $view->partial($template, $data);
    }
 
 
    public function getImage($data, $default = null, $key = "file"){
 
        $image = ($data) ? is_array($data) ? $data[0] : null : null;
        $output = ($image) ? $image[$key] : $default;
 
        return $output;
    }
 
    public function getImageUrl($data, $default = null)
    {
 
 
        $image_url = $this->getImage($data, $default);
 
        $output = ($image_url != $default) ? $this->url->get($image_url) : $default;
 
        return $output;
 
    }
 
 
    public function timthumb($image, $width = 250, $height = 200, $zc = 1)
    {
 
 
        if (!$image):
            $theme = $this->getOption("active_theme");
            $image = "public/assets/modules/$theme/images/resim-yok.jpg";
        endif;
 
        $url = $width . "/" . $height . "/" . $zc . "/" . $image;
        //$url = $this->url->get($url);
        $url = $this->url->get($url);
 
        return $url;
 
    }
 
 
 
    /**
     * Aranılan modül yüklü mü, değil mi kontrol eder.
     *
     *
     * @param $module
     * @return bool
     *
     */
 
    public function date($date,$format = "%e %B %Y, %A"){
 
        return strftime($format, strtotime($date));
 
    }
 
    /*
     * Modules
     */
 
    public function isModule($module){
 
        $modules = CmsCache::getInstance()->get('modules');
 
        if(array_search($module, array_column($modules, 'name')) !== false){
            return true;
        }else if(array_search($module, array_column($modules, 'slug')) !== false){
            return true;
        }
 
        return false;
 
    }
 
    public function getModule($moduleName, $key = null)
    {
 
 
        $modules = CmsCache::getInstance()->get('modules');
 
        $moduleIndex = (array_search($moduleName, array_column($modules, 'name')));
 
 
        if ($moduleIndex != false) return false;
 
        $module = $modules[$moduleIndex];
 
 
        $output = ($key) ? $module[$key] : $module;
 
        return $output;
 
    }
 
    public function isAllowed($module,$controller = null,$action = null){
        return $this->di->get('acl')->isAllowed($module,$controller,$action);
    }
 
 
 
    public function getMediaUrl($media,$default = null,$width = false,$height = false,$crop = "2",$extension = "jpg"){
 
        //Media Object veya Resim için KEY Olabilir
        $image_url = $default;
 
        if($media && is_object($media)):
            $fileUrl    = (get_class($media) == "Konsol\Model\Media") ? $media->getFile() : $media->getFirst()->getFile();
            if($fileUrl):
                $image_url  = ($width && $height) ? $this->di->get('helper')->thumb($fileUrl,$width,$height,$crop,$extension) : $fileUrl;
            endif;
        endif;
 
 
        return $image_url ? $this->di->get('url')->get($image_url) : false;
    }
 
 
    public function thumb($image, $width = 250, $height = 200, $zc = 1,$extension = "webp"){
 
        if(!$extension) $extension = ($e = $this->di->get('config')->fileconfig->extension) ? $e : "jpg";
        $image     = preg_replace('/(.*)\.[^.]+$/i',"$1",$image);
 
        $image_path = "{$image}.{$extension}";
        return $this->di->get('url')->get($image_path);
 
    }
 
}
#7Application\Mvc\Helper->getOption(google_analytics)
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Init.php (220)
<?php
 
namespace Konsol;
 
use Konsol\Form\Options\IntegrationForm;
use Konsol\Model\Auth;
use Phalcon\Mvc\User\Component;
use Phalcon\Forms\Element\Text;
 
 
class Init extends Component{
 
 
    public function __construct(){
 
 
 
 
        $this->di->set('cdn', new \Konsol\Helper\Cdn());
        $this->di->set('positions',  new \Konsol\Helper\Position());
 
 
 
 
        $this->addResources();
        $this->setIntegrations();
        $this->addMenu_sidebar();
        $this->addMenu_options();
        $this->addKonsolMenu();
        $this->addScripts();
 
    }
 
 
    private function addResources(){
 
        $this->di->get('acl')->addResource("all","konsol","index");
        $this->di->get('acl')->addResource("all","konsol","error");
        $this->di->get('acl')->addResource("all","konsol","login");
    }
 
    private function addKonsolMenu(){
 
      $this->helper->staticMenu("konsol_header")->addMenu('clearcache', [
            "name" => "Önbellek Temizle",
            "title" => "Önbellek Temizle",
            "icon" => "fa-trash-alt",
            "target" => "_blank",
            "url" => $this->url->get("konsol/index/clearCache")
        ]);
 
        if (!$this->auth->getIsAdmin()) return false;
 
        $this->helper->staticMenu("konsol_header")->addMenu('developer', [
            "title" => "Geliştirici Menüsü",
            "name" => "Geliştirici",
            "url" => '#',
            "position" => 3,
            "icon" => "fa-code"
        ]);
 
 
 
      
        $this->helper->staticMenu("konsol_header")->addSubmenu('developer', [
            "title" => "Log Kayıtları",
            "icon" => "fa-list-ol",
            "target" => "_blank",
            "url" => $this->url->get("logs/admin/index")
        ]);
 
 
        $this->helper->staticMenu("konsol_header")->addSubmenu('developer', [
            "title" => "Veritabanı yedekle",
            "icon" => "fa-download",
            "target" => "_blank",
            "url" => $this->url->get("konsol/index/dbbackup")
        ]);
 
 
        $this->helper->staticMenu("konsol_header")->addSubmenu('developer', [
            "title" => "Modüller",
            "icon" => "fa-home",
            "target" => "_blank",
            "url" => $this->url->get("konsol/modules")
        ]);
 
 
 
    }
 
    private function addMenu_sidebar(){
 
 
        $this->helper->staticMenu("konsol_sidebar")->addMenu('dashboard', [
            "title" => "Genel Bakış",
            "url" => "konsol/index",
            "position" => -1,
            "icon" => "fas fa-home"
        ]);
 
 
        $this->helper->staticMenu("konsol_sidebar")->addMenu('options', [
            "title" => "Ayarlar",
            "url" => "konsol/options/index",
            "position" => 100,
            "icon" => "fas fa-cogs"
        ]);
 
 
        $this->helper->staticMenu("konsol_sidebar")->addMenu('inbox', [
            "title" => "Gelen Kutusu",
            "url" => "konsol/options/index",
            "position" => 1,
            "icon" => "fas fa-inbox"
        ]);
 
        $this->helper->staticMenu("konsol_sidebar")->addSubmenu('inbox', [
            "title" => "Bildirimler",
            "url" => "konsol/notifications/index",
            "icon" => "fas fa-bells"
        ]);
 
 
 
 
    }
 
 
    private function addMenu_options(){
 
 
 
        $this->helper->staticMenu("options")->addMenu('options', [
            "title" => "Genel",
            "desc" => "Mağazanızın ayrıntılarını görüntüleyin ve güncelleyin",
            "url" => "konsol/options/general",
            "position" => 1,
            "icon" => "far fa-cogs"
        ]);
 
        $this->helper->staticMenu("options")->addMenu('system', [
            "title" => "Sistem",
            "desc" => "Önbellek, bakım ve hata modu özelliklerini yönetin",
            "url" => "konsol/options/system",
            "position" => 2,
            "icon" => "far fa-cogs"
        ]);
 
        $this->helper->staticMenu("options")->addMenu('smtp', [
            "title" => "Mail",
            "desc" => "Gönderim yapılacak eposta bilgilerini yönetin",
            "url" => "konsol/options/smtp",
            "position" => 2,
            "icon" => "far fa-envelope"
        ]);
 
        $this->helper->staticMenu("options")->addMenu('optlanguageions', [
            "title" => "Dil",
            "desc" => "Müşterilerinizin mağazanızı görüntüleyebileği dilleri yönetin",
            "url" => "konsol/language/index",
            "position" => 3,
            "icon" => "far fa-language"
        ]);
 
        $this->helper->staticMenu("options")->addMenu('integration', [
            "title" => "Entegrasyonlar",
            "desc" => "Mağazanızı 3.parti entegrasyonlar ile senkronize edin",
            "url" => "konsol/options/integration",
            "position" => 4,
            "icon" => "far fa-sync-alt"
        ]);
 
        /*
        $this->helper->staticMenu("options")->addMenu('localization', [
            "title" => "Yerelleştirme",
            "desc" => "Mağazanızın görüntülecek tarih ve saat formatlarını yönetin",
            "url" => "konsol/options/localization",
            "position" => 5,
            "icon" => "far fa-business-time"
        ]);
        */
 
 
 
        $this->helper->staticMenu("options")->addMenu('modules', [
            "icon" => "far fa-box-check",
            "title" => "Modüller",
            "desc" => "Mağazanızda kullanılan modülleri yönetin ve yeni ekleyin",
            "url" => "konsol/modules/index/module",
            "position" => 4
        ]);
 
 
 
        if ($this->helper->isModule('Posts'))
            $this->helper->staticMenu("options")->addMenu('themes', [
                "icon" => "far fa-store-alt",
                "title" => "Temalar",
                "desc" => "Müşterilerin mağazanızı ziyaret ettiğinde görüntüleceği temayı yönetin.",
                "url" => "konsol/modules/index/theme",
                "position" => 4
            ]);
 
 
 
    }
 
 
 
 
 
    private function setIntegrations(){
 
 
        $integrations = $this->view->integrations =         $integrations = new IntegrationForm();;
        foreach ($integrations as $index => $element) {
 
            $key   = $element->getName();
            $value = $this->helper->getOption($element->getName());
 
            if(!$value) continue;
 
            if(is_a($element,'Phalcon\Forms\Element\Textarea')):
 
                $this->positions->add("konsol_head_tag","<!-- start $key--> \n".$value."\n<!-- end $key -->");
 
            elseif(is_a($element,'Phalcon\Forms\Element\Text')):
 
                $this->helper->meta()->set($key,$value);
            endif;
        }
 
    }
 
 
 
    private function addScripts(){
 
 
        $scripts_header = $this->assets->collection('konsol_scripts_header');
        $scripts_header_main = $this->assets->collection('konsol_scripts_header_main');
 
        $stylesheet_header = $this->assets->collection('konsol_stylesheet_header');
        $stylesheet_header_main = $this->assets->collection('konsol_stylesheet_header_main');
 
 
        $stylesheet_footer = $this->assets->collection('konsol_stylesheet_footer');
        $stylesheet_footer_main = $this->assets->collection('konsol_stylesheet_footer_main');
 
        $scripts_footer = $this->assets->collection('konsol_scripts_footer');
        $scripts_footer_main = $this->assets->collection('konsol_scripts_footer_main');
 
 
        $login_scripts    = $this->assets->collection('konsol_login_scripts');
        $login_stylesheet = $this->assets->collection('konsol_login_stylesheet');
 
 
        /**
         * konsol_scripts
         */
 
 
        $version = '2.0.9';
        $developer = false;
 
 
 
        $stylesheet_header_main->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/preloader.min.css");
        $stylesheet_header_main->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/bootstrap.min.css");
 
 
        $stylesheet_header_main->addCss("//cdn.yobi.si/plugins/font-awesome5-pro/css/all.min.css");
        $stylesheet_header->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/konsol.css");
        $scripts_header_main->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/jquery/jquery.min.js");
        $scripts_header_main->addJs("//cdn.yobi.si/plugins/jquery-ui/js/jquery-ui.js");
        $scripts_header_main->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/bootstrap/js/bootstrap.bundle.min.js");
        $scripts_header_main->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/metismenu/metisMenu.min.js");
        $scripts_footer->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/pace-js/pace.min.js");
 
 
        //MOMENT
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/moment/locales/tr.js");
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/module-js/modulejs.min.js");
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/moment/js/moment.js");
 
 
 
        //SWEETALERT
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/sweetalert/1.1.3/sweetalert.min.js");
        $stylesheet_footer_main->addCss("//cdn.yobi.si/plugins/sweetalert/1.1.3/sweetalert.min.css");
 
        //OVERHANGJS
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/overhang-js/dist/overhang.min.js");
        $stylesheet_footer_main->addCss("//cdn.yobi.si/plugins/overhang-js/dist/overhang.min.css");
 
        //PARSLEY
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/parsley/dist/parsley.min.js");
 
 
        //APP
        $scripts_footer->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/js/konsol4.js");
        $scripts_footer->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/js/app.js");
 
 
        //LOGIN
        $login_stylesheet->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/bootstrap.min.css");
        $login_stylesheet->addCss("//cdn.yobi.si/plugins/font-awesome5-pro/css/all.min.css");
        $login_stylesheet->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/konsol.css");
        $login_scripts->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/jquery/jquery.min.js");
 
 
        //$this->positions->add('konsol_body_end',$this->helper->widget("Konsol","Block")->canliDestek());
 
 
    }
 
}
#8Konsol\Init->setIntegrations()
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Init.php (26)
<?php
 
namespace Konsol;
 
use Konsol\Form\Options\IntegrationForm;
use Konsol\Model\Auth;
use Phalcon\Mvc\User\Component;
use Phalcon\Forms\Element\Text;
 
 
class Init extends Component{
 
 
    public function __construct(){
 
 
 
 
        $this->di->set('cdn', new \Konsol\Helper\Cdn());
        $this->di->set('positions',  new \Konsol\Helper\Position());
 
 
 
 
        $this->addResources();
        $this->setIntegrations();
        $this->addMenu_sidebar();
        $this->addMenu_options();
        $this->addKonsolMenu();
        $this->addScripts();
 
    }
 
 
    private function addResources(){
 
        $this->di->get('acl')->addResource("all","konsol","index");
        $this->di->get('acl')->addResource("all","konsol","error");
        $this->di->get('acl')->addResource("all","konsol","login");
    }
 
    private function addKonsolMenu(){
 
      $this->helper->staticMenu("konsol_header")->addMenu('clearcache', [
            "name" => "Önbellek Temizle",
            "title" => "Önbellek Temizle",
            "icon" => "fa-trash-alt",
            "target" => "_blank",
            "url" => $this->url->get("konsol/index/clearCache")
        ]);
 
        if (!$this->auth->getIsAdmin()) return false;
 
        $this->helper->staticMenu("konsol_header")->addMenu('developer', [
            "title" => "Geliştirici Menüsü",
            "name" => "Geliştirici",
            "url" => '#',
            "position" => 3,
            "icon" => "fa-code"
        ]);
 
 
 
      
        $this->helper->staticMenu("konsol_header")->addSubmenu('developer', [
            "title" => "Log Kayıtları",
            "icon" => "fa-list-ol",
            "target" => "_blank",
            "url" => $this->url->get("logs/admin/index")
        ]);
 
 
        $this->helper->staticMenu("konsol_header")->addSubmenu('developer', [
            "title" => "Veritabanı yedekle",
            "icon" => "fa-download",
            "target" => "_blank",
            "url" => $this->url->get("konsol/index/dbbackup")
        ]);
 
 
        $this->helper->staticMenu("konsol_header")->addSubmenu('developer', [
            "title" => "Modüller",
            "icon" => "fa-home",
            "target" => "_blank",
            "url" => $this->url->get("konsol/modules")
        ]);
 
 
 
    }
 
    private function addMenu_sidebar(){
 
 
        $this->helper->staticMenu("konsol_sidebar")->addMenu('dashboard', [
            "title" => "Genel Bakış",
            "url" => "konsol/index",
            "position" => -1,
            "icon" => "fas fa-home"
        ]);
 
 
        $this->helper->staticMenu("konsol_sidebar")->addMenu('options', [
            "title" => "Ayarlar",
            "url" => "konsol/options/index",
            "position" => 100,
            "icon" => "fas fa-cogs"
        ]);
 
 
        $this->helper->staticMenu("konsol_sidebar")->addMenu('inbox', [
            "title" => "Gelen Kutusu",
            "url" => "konsol/options/index",
            "position" => 1,
            "icon" => "fas fa-inbox"
        ]);
 
        $this->helper->staticMenu("konsol_sidebar")->addSubmenu('inbox', [
            "title" => "Bildirimler",
            "url" => "konsol/notifications/index",
            "icon" => "fas fa-bells"
        ]);
 
 
 
 
    }
 
 
    private function addMenu_options(){
 
 
 
        $this->helper->staticMenu("options")->addMenu('options', [
            "title" => "Genel",
            "desc" => "Mağazanızın ayrıntılarını görüntüleyin ve güncelleyin",
            "url" => "konsol/options/general",
            "position" => 1,
            "icon" => "far fa-cogs"
        ]);
 
        $this->helper->staticMenu("options")->addMenu('system', [
            "title" => "Sistem",
            "desc" => "Önbellek, bakım ve hata modu özelliklerini yönetin",
            "url" => "konsol/options/system",
            "position" => 2,
            "icon" => "far fa-cogs"
        ]);
 
        $this->helper->staticMenu("options")->addMenu('smtp', [
            "title" => "Mail",
            "desc" => "Gönderim yapılacak eposta bilgilerini yönetin",
            "url" => "konsol/options/smtp",
            "position" => 2,
            "icon" => "far fa-envelope"
        ]);
 
        $this->helper->staticMenu("options")->addMenu('optlanguageions', [
            "title" => "Dil",
            "desc" => "Müşterilerinizin mağazanızı görüntüleyebileği dilleri yönetin",
            "url" => "konsol/language/index",
            "position" => 3,
            "icon" => "far fa-language"
        ]);
 
        $this->helper->staticMenu("options")->addMenu('integration', [
            "title" => "Entegrasyonlar",
            "desc" => "Mağazanızı 3.parti entegrasyonlar ile senkronize edin",
            "url" => "konsol/options/integration",
            "position" => 4,
            "icon" => "far fa-sync-alt"
        ]);
 
        /*
        $this->helper->staticMenu("options")->addMenu('localization', [
            "title" => "Yerelleştirme",
            "desc" => "Mağazanızın görüntülecek tarih ve saat formatlarını yönetin",
            "url" => "konsol/options/localization",
            "position" => 5,
            "icon" => "far fa-business-time"
        ]);
        */
 
 
 
        $this->helper->staticMenu("options")->addMenu('modules', [
            "icon" => "far fa-box-check",
            "title" => "Modüller",
            "desc" => "Mağazanızda kullanılan modülleri yönetin ve yeni ekleyin",
            "url" => "konsol/modules/index/module",
            "position" => 4
        ]);
 
 
 
        if ($this->helper->isModule('Posts'))
            $this->helper->staticMenu("options")->addMenu('themes', [
                "icon" => "far fa-store-alt",
                "title" => "Temalar",
                "desc" => "Müşterilerin mağazanızı ziyaret ettiğinde görüntüleceği temayı yönetin.",
                "url" => "konsol/modules/index/theme",
                "position" => 4
            ]);
 
 
 
    }
 
 
 
 
 
    private function setIntegrations(){
 
 
        $integrations = $this->view->integrations =         $integrations = new IntegrationForm();;
        foreach ($integrations as $index => $element) {
 
            $key   = $element->getName();
            $value = $this->helper->getOption($element->getName());
 
            if(!$value) continue;
 
            if(is_a($element,'Phalcon\Forms\Element\Textarea')):
 
                $this->positions->add("konsol_head_tag","<!-- start $key--> \n".$value."\n<!-- end $key -->");
 
            elseif(is_a($element,'Phalcon\Forms\Element\Text')):
 
                $this->helper->meta()->set($key,$value);
            endif;
        }
 
    }
 
 
 
    private function addScripts(){
 
 
        $scripts_header = $this->assets->collection('konsol_scripts_header');
        $scripts_header_main = $this->assets->collection('konsol_scripts_header_main');
 
        $stylesheet_header = $this->assets->collection('konsol_stylesheet_header');
        $stylesheet_header_main = $this->assets->collection('konsol_stylesheet_header_main');
 
 
        $stylesheet_footer = $this->assets->collection('konsol_stylesheet_footer');
        $stylesheet_footer_main = $this->assets->collection('konsol_stylesheet_footer_main');
 
        $scripts_footer = $this->assets->collection('konsol_scripts_footer');
        $scripts_footer_main = $this->assets->collection('konsol_scripts_footer_main');
 
 
        $login_scripts    = $this->assets->collection('konsol_login_scripts');
        $login_stylesheet = $this->assets->collection('konsol_login_stylesheet');
 
 
        /**
         * konsol_scripts
         */
 
 
        $version = '2.0.9';
        $developer = false;
 
 
 
        $stylesheet_header_main->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/preloader.min.css");
        $stylesheet_header_main->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/bootstrap.min.css");
 
 
        $stylesheet_header_main->addCss("//cdn.yobi.si/plugins/font-awesome5-pro/css/all.min.css");
        $stylesheet_header->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/konsol.css");
        $scripts_header_main->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/jquery/jquery.min.js");
        $scripts_header_main->addJs("//cdn.yobi.si/plugins/jquery-ui/js/jquery-ui.js");
        $scripts_header_main->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/bootstrap/js/bootstrap.bundle.min.js");
        $scripts_header_main->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/metismenu/metisMenu.min.js");
        $scripts_footer->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/pace-js/pace.min.js");
 
 
        //MOMENT
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/moment/locales/tr.js");
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/module-js/modulejs.min.js");
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/moment/js/moment.js");
 
 
 
        //SWEETALERT
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/sweetalert/1.1.3/sweetalert.min.js");
        $stylesheet_footer_main->addCss("//cdn.yobi.si/plugins/sweetalert/1.1.3/sweetalert.min.css");
 
        //OVERHANGJS
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/overhang-js/dist/overhang.min.js");
        $stylesheet_footer_main->addCss("//cdn.yobi.si/plugins/overhang-js/dist/overhang.min.css");
 
        //PARSLEY
        $scripts_footer_main->addJs("//cdn.yobi.si/plugins/parsley/dist/parsley.min.js");
 
 
        //APP
        $scripts_footer->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/js/konsol4.js");
        $scripts_footer->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/js/app.js");
 
 
        //LOGIN
        $login_stylesheet->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/bootstrap.min.css");
        $login_stylesheet->addCss("//cdn.yobi.si/plugins/font-awesome5-pro/css/all.min.css");
        $login_stylesheet->addCss("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/css/konsol.css");
        $login_scripts->addJs("//cdn.yobi.si/konsol/modules/Konsol/" . $version . "/libs/jquery/jquery.min.js");
 
 
        //$this->positions->add('konsol_body_end',$this->helper->widget("Konsol","Block")->canliDestek());
 
 
    }
 
}
#9Konsol\Init->__construct()
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (153)
<?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();
 
    }
 
 
 
}
#10App\Bootstrap->initRouting(Object(Phalcon\Mvc\Application), Object(Phalcon\Di\FactoryDefault))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (123)
<?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();
 
    }
 
 
 
}
#11App\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/etiket/milli-egitim-dunya-sampiyonunu-agirladi
KeyValue
USERdenizliyeniolay.com_a706vjldz7n
HOME/var/www/vhosts/denizliyeniolay.com
SCRIPT_NAME/public/index.php
REQUEST_URI/etiket/milli-egitim-dunya-sampiyonunu-agirladi
QUERY_STRING_url=/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.0
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/public/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_QUERY_STRING_url=/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REMOTE_PORT50644
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.130.113
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_CF_VISITOR{"scheme":"https"}
HTTP_CF_CONNECTING_IP3.17.183.27
HTTP_ACCEPT*/*
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_IPCOUNTRYUS
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_CDN_LOOPcloudflare; loops=1
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_RAY8debaca5ce3e2bdb-ORD
HTTP_CONNECTIONclose
HTTP_X_ACCEL_INTERNAL/internal-nginx-static-location
HTTP_X_FORWARDED_FOR3.17.183.27
HTTP_X_REAL_IP172.70.130.113
HTTP_HOSTdenizliyeniolay.com
proxy-nokeepalive1
HTTPSon
PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
REDIRECT_REDIRECT_STATUS200
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_REDIRECT_SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_REDIRECT_UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
FCGI_ROLERESPONDER
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1730964782.8388
REQUEST_TIME1730964782
#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
Memory
Usage2097152
RedisException: Connection refused
Phalcon Framework 3.4.5

RedisException: Connection refused

/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php (42)
#0Redis->connect(185.136.160.201, 6379, 0)
#1Phalcon\Cache\Backend\Redis->_connect()
#2Phalcon\Cache\Backend\Redis->get(options_2660c84df5cec8f43cf496440f59eb85, 3600)
#3Phalcon\Mvc\Model\Query->execute()
#4Phalcon\Mvc\Model::findFirst(Array([conditions] => key = :key: and lang = :lang:, [bind] => Array([key] => active_theme, [lang] => tr), [cache] => Array([key] => options_2660c84df5cec8f43cf496440f59eb85)))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php (42)
<?php
 
namespace Konsol\Model;
 
use Application\Mvc\Helper\Output;
use Phalcon\Mvc\Model\Message;
use Application\Mvc\Model\Model;
use Posts\Model\Posts;
 
class Options extends Model
{
 
 
    public $key;
    public $lang;
    public $value;
    public $type = "text";
    public $copy = true;
 
 
    public function initialize()
    {
 
        //exit(var_dump($this->columnMap()));
        $this->hasOne("value", "Konsol\Model\Media", "id", ["alias" => "media_relation"]);
    }
 
    public function getSource()
    {
        return 'options';
    }
 
 
 
    public static function get($key,$lang = false){
 
        $lang   = ($lang) ? $lang : Language::getCurrentLanguage();
        $option = self::findFirst([
            "conditions" => "key = :key: and lang = :lang:",
            "bind" => ["key" => $key, "lang" => $lang],
            "cache" => [
                "key" => 'options_' . md5( $lang  . "-" . $key)
            ]
        ]);
 
        return $option;
    }
 
    public static function getOption($key,$default = false,$lang = false){
        $option = self::get($key,$lang);
        return ($option) ? $option->getValue() : $default;
    }
 
    public static function set($key,$value,$type = "text"){
 
        try {
 
            $model = self::get($key);
 
            if ($model) {
 
                if (self::isNull($value))
                    return self::remove($key, $value, $type);
 
                if($model->getValue() == $value)
                    return true;//Değişiklik yoksa atla
 
            } else {
 
                if(self::isNull($value))
                    return false;
 
                $model = new \Konsol\Model\Options();
                $model->setKey($key);
                $model->setLang(Language::getCurrentLanguage());
            }
 
            $model->setType($type);
            $model->setValue($value);
 
 
            if (!$model->save())
                Output::set(false, "Ayarlar kaldırılırken hata !", 'setOption_1000');//$this->gtThrowable($e)
 
 
            return true;
 
        }catch (\Throwable $e){
 
            Output::set(false, "Ayarlar kaldırılırken hata !", 'setOption_catch',[
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ]);//$this->gtThrowable($e)
        }
 
    }
 
    public static function remove($key){
 
        try {
 
            $option = self::get($key);
 
            if (!$option) return true;
 
            if (!$option->delete())
                Output::set(false, "Ayarlar kaldırılırken hata !", 'remove_3000');//$this->errorMessage($option->getMessages())
 
            return true;
 
        }catch (\Throwable $e){
 
            Output::set(false, "Ayarlar kaldırılırken hata !", 'remove_catch',[
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ]);//$this->gtThrowable($e)
 
        }
 
    }
 
    public function afterUpdate()
    {
 
        $this->getDi()->get('modelsCache')->delete(md5("options_" . $this->getKey()));
 
    }
 
 
 
    public function getKey()
    {
        return $this->key;
    }
    public function setKey($key)
    {
        $this->key = $key;
    }
 
 
    public function getLang()
    {
        return $this->lang;
    }
    public function setLang($lang)
    {
        $this->lang = $lang;
    }
 
 
    public function getType()
    {
        return $this->type;
    }
    public function setType($type)
    {
        $this->type = $type;
    }
 
 
    public function getCopy()
    {
        return $this->copy;
    }
    public function setCopy($copy)
    {
        $this->copy = $copy;
    }
 
 
 
    public function getValue($default = false){
 
        $value = ($this->getType() == "media") ? $this->getMedia($this->value) : $this->value;
        return (isset($value)) ? $value : $default;
    }
 
    public function setValue($value,$force = false){
        $this->value = ($this->getType() == "media" && $force !== true) ? $this->setMedia($value) : $value;
        return $this;
    }
 
 
 
    public function beforeValidation()
    {
 
 
        if(!$this->getLang()) $this->setLang(Language::getCurrentLanguage());
 
        if(!$this->getType()) $this->setType("text");
 
    }
 
    public function afterCreate()
    {
        $this->updateCache();
        $this->languagesOperations('create');
 
    }
 
    public function afterSave()
    {
 
 
        $this->updateCache();
        $this->languagesOperations('update');
    }
 
    public function afterDelete()
    {
        $this->updateCache();
        $this->languagesOperations('delete');
    }
 
    private function updateCache()
    {
 
        $cache = $this->getDi()->get('cache');
 
        $cache->delete('options_' . md5( $this->getLang()  . "-" . $this->getKey()));
 
 
    }
 
 
 
 
    /*
     * Helpers
     */
 
 
 
    public function setOptions($options){
 
        try{
 
            foreach($options as $option):
 
                self::set($option['key'],$option['value'],$option['type']);
 
            endforeach;//form loop
 
            return true;
 
        } catch (\Throwable $e) {
 
            $this->output(false, "Ayarlar kaydedilirken beklenmedik hata oluştu.", "set_options_catch", $this->getThrowable($e));
 
        }
 
    }
 
 
    public function getOptionsByForm($form){
 
        try {
 
            $options = new \stdClass();
 
            foreach ($form->getElements() as $element) {
 
                $key = $element->getName();
                $value = self::getOption($element->getName());
                if (!isset($value)) continue;
 
                $options->{$key} = $value;
            }
 
 
 
            return $options;
 
        }catch (\Throwable $e){
            return false;
        }
 
    }
 
    public function setOptionsByForm($form,$redirect_url = false){
 
        try{
 
 
            $request = $this->di->get('request');
 
 
            if (!$form->isValid($request->getPost()))
                return false;
 
            $options = array();
 
            foreach($form->getElements() as $element):
 
                $options[] = [
                    'key'   => $element->getName(),
                    'value' => $request->getPost($element->getName()),
                    'type'  => (get_class($element ) == "Application\Form\Element\Uploader") ? "media" : "text"
                ];
 
            endforeach;//form loop
 
 
 
            self::setOptions($options);
 
            $this->output(true, "Ayarlar başarıyla kaydedildi.", "set_options_success",[
                "options"  => $options,
                "redirect" => $redirect_url
            ]);
 
        } catch (\Throwable $e) {
 
            $this->output(false, "Ayarlar kaydedilirken beklenmedik hata oluştu.", "set_options_catch", $this->getThrowable($e));
 
        }
 
    }
 
 
 
    public function languagesOperations($operation = "create"){
 
        if($this->getCopy()):
            $languages = Language::getLanguages();
            if(count($languages) > 1):
                foreach ($languages as $language):
                    switch ($operation):
                        case "create":
                            $this->createLanguage($language['iso']);
                        break;
                        case "update":
                            if($this->getType() == "media"):
                                $this->updateLanguage($language['iso']);
                            endif;
                        break;
                        case "delete":
                            $this->deleteLanguage($language['iso']);
                        break;
                        default:
                            exit('Geçersiz operasyon');
                    endswitch;
                endforeach;
            endif;
        endif;
 
        return true;
    }
 
    public function createLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $check = self::count([
               "conditions" => "lang = :lang: and key = :key:",
               "bind" => ["lang" => $lang_iso, "key"  => $this->getKey()]
            ]);
            if($check > 0) return false;
 
            $model = new Options();
            $model->setLang($lang_iso);
            $model->setKey($this->getKey());
            $model->setValue($this->value,true);
            $model->setType($this->getType());
            $model->setCopy(false);
 
            if (!$model->create()) {
                $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_copy_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_copy_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null,
                "value" => $this->value
            ]);
 
        }
 
    }
 
    public function updateLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
 
            $model = self::get($this->getKey(),$lang_iso);
            if(!$model)
                return $this->createLanguage($lang_iso);
 
 
            $model->setType($this->getType());
            $model->setValue($this->value,true);
            $model->setCopy(false);
 
 
            if (!$model->update()) {
 
                $this->output(false,sprintf('%s dili güncellenirken hata oluştu',$lang_iso),"option_update_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_update_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null
            ]);
 
        }
 
    }
 
    public function deleteLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $model = self::get($this->getKey(),$lang_iso);
            if(!$model) return true;
 
            if (!$model->delete()) {
                $this->output(false,sprintf('%s dili silinirken hata oluştu',$lang_iso),"option_delete_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili silinirken hata oluştu',$lang_iso),"option_delete_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null
            ]);
 
        }
 
    }
 
 
 
 
    public function copyLanguages(){
 
        if(!$this->getCopy()) return false;
 
        $languages = Language::getLanguages();
 
        if(count($languages) > 1):
            foreach ($languages as $language):
                $this->copyLanguage($language['iso']);
            endforeach;
        endif;
 
        return true;
    }
 
 
    public function copyLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $model = new Options();
            $model->setLang($lang_iso);
            $model->setKey($this->getKey());
            $model->setValue($this->value);
            $model->setType($this->getType());
            $model->setCopy(false);
 
            if (!$model->create()) {
                return false;
                /*
                return $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"options_lang_copy_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
                */
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            /*
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"options_lang_copy_1305",[
                'error' => $this->getThrowable($e),
                'item'  => $model->toArray()
            ]);
            */
            return false;
 
        }
 
    }
 
 
}
#5Konsol\Model\Options::get(active_theme, tr)
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php (50)
<?php
 
namespace Konsol\Model;
 
use Application\Mvc\Helper\Output;
use Phalcon\Mvc\Model\Message;
use Application\Mvc\Model\Model;
use Posts\Model\Posts;
 
class Options extends Model
{
 
 
    public $key;
    public $lang;
    public $value;
    public $type = "text";
    public $copy = true;
 
 
    public function initialize()
    {
 
        //exit(var_dump($this->columnMap()));
        $this->hasOne("value", "Konsol\Model\Media", "id", ["alias" => "media_relation"]);
    }
 
    public function getSource()
    {
        return 'options';
    }
 
 
 
    public static function get($key,$lang = false){
 
        $lang   = ($lang) ? $lang : Language::getCurrentLanguage();
        $option = self::findFirst([
            "conditions" => "key = :key: and lang = :lang:",
            "bind" => ["key" => $key, "lang" => $lang],
            "cache" => [
                "key" => 'options_' . md5( $lang  . "-" . $key)
            ]
        ]);
 
        return $option;
    }
 
    public static function getOption($key,$default = false,$lang = false){
        $option = self::get($key,$lang);
        return ($option) ? $option->getValue() : $default;
    }
 
    public static function set($key,$value,$type = "text"){
 
        try {
 
            $model = self::get($key);
 
            if ($model) {
 
                if (self::isNull($value))
                    return self::remove($key, $value, $type);
 
                if($model->getValue() == $value)
                    return true;//Değişiklik yoksa atla
 
            } else {
 
                if(self::isNull($value))
                    return false;
 
                $model = new \Konsol\Model\Options();
                $model->setKey($key);
                $model->setLang(Language::getCurrentLanguage());
            }
 
            $model->setType($type);
            $model->setValue($value);
 
 
            if (!$model->save())
                Output::set(false, "Ayarlar kaldırılırken hata !", 'setOption_1000');//$this->gtThrowable($e)
 
 
            return true;
 
        }catch (\Throwable $e){
 
            Output::set(false, "Ayarlar kaldırılırken hata !", 'setOption_catch',[
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ]);//$this->gtThrowable($e)
        }
 
    }
 
    public static function remove($key){
 
        try {
 
            $option = self::get($key);
 
            if (!$option) return true;
 
            if (!$option->delete())
                Output::set(false, "Ayarlar kaldırılırken hata !", 'remove_3000');//$this->errorMessage($option->getMessages())
 
            return true;
 
        }catch (\Throwable $e){
 
            Output::set(false, "Ayarlar kaldırılırken hata !", 'remove_catch',[
                'message' => $e->getMessage(),
                'file' => $e->getFile(),
                'line' => $e->getLine(),
            ]);//$this->gtThrowable($e)
 
        }
 
    }
 
    public function afterUpdate()
    {
 
        $this->getDi()->get('modelsCache')->delete(md5("options_" . $this->getKey()));
 
    }
 
 
 
    public function getKey()
    {
        return $this->key;
    }
    public function setKey($key)
    {
        $this->key = $key;
    }
 
 
    public function getLang()
    {
        return $this->lang;
    }
    public function setLang($lang)
    {
        $this->lang = $lang;
    }
 
 
    public function getType()
    {
        return $this->type;
    }
    public function setType($type)
    {
        $this->type = $type;
    }
 
 
    public function getCopy()
    {
        return $this->copy;
    }
    public function setCopy($copy)
    {
        $this->copy = $copy;
    }
 
 
 
    public function getValue($default = false){
 
        $value = ($this->getType() == "media") ? $this->getMedia($this->value) : $this->value;
        return (isset($value)) ? $value : $default;
    }
 
    public function setValue($value,$force = false){
        $this->value = ($this->getType() == "media" && $force !== true) ? $this->setMedia($value) : $value;
        return $this;
    }
 
 
 
    public function beforeValidation()
    {
 
 
        if(!$this->getLang()) $this->setLang(Language::getCurrentLanguage());
 
        if(!$this->getType()) $this->setType("text");
 
    }
 
    public function afterCreate()
    {
        $this->updateCache();
        $this->languagesOperations('create');
 
    }
 
    public function afterSave()
    {
 
 
        $this->updateCache();
        $this->languagesOperations('update');
    }
 
    public function afterDelete()
    {
        $this->updateCache();
        $this->languagesOperations('delete');
    }
 
    private function updateCache()
    {
 
        $cache = $this->getDi()->get('cache');
 
        $cache->delete('options_' . md5( $this->getLang()  . "-" . $this->getKey()));
 
 
    }
 
 
 
 
    /*
     * Helpers
     */
 
 
 
    public function setOptions($options){
 
        try{
 
            foreach($options as $option):
 
                self::set($option['key'],$option['value'],$option['type']);
 
            endforeach;//form loop
 
            return true;
 
        } catch (\Throwable $e) {
 
            $this->output(false, "Ayarlar kaydedilirken beklenmedik hata oluştu.", "set_options_catch", $this->getThrowable($e));
 
        }
 
    }
 
 
    public function getOptionsByForm($form){
 
        try {
 
            $options = new \stdClass();
 
            foreach ($form->getElements() as $element) {
 
                $key = $element->getName();
                $value = self::getOption($element->getName());
                if (!isset($value)) continue;
 
                $options->{$key} = $value;
            }
 
 
 
            return $options;
 
        }catch (\Throwable $e){
            return false;
        }
 
    }
 
    public function setOptionsByForm($form,$redirect_url = false){
 
        try{
 
 
            $request = $this->di->get('request');
 
 
            if (!$form->isValid($request->getPost()))
                return false;
 
            $options = array();
 
            foreach($form->getElements() as $element):
 
                $options[] = [
                    'key'   => $element->getName(),
                    'value' => $request->getPost($element->getName()),
                    'type'  => (get_class($element ) == "Application\Form\Element\Uploader") ? "media" : "text"
                ];
 
            endforeach;//form loop
 
 
 
            self::setOptions($options);
 
            $this->output(true, "Ayarlar başarıyla kaydedildi.", "set_options_success",[
                "options"  => $options,
                "redirect" => $redirect_url
            ]);
 
        } catch (\Throwable $e) {
 
            $this->output(false, "Ayarlar kaydedilirken beklenmedik hata oluştu.", "set_options_catch", $this->getThrowable($e));
 
        }
 
    }
 
 
 
    public function languagesOperations($operation = "create"){
 
        if($this->getCopy()):
            $languages = Language::getLanguages();
            if(count($languages) > 1):
                foreach ($languages as $language):
                    switch ($operation):
                        case "create":
                            $this->createLanguage($language['iso']);
                        break;
                        case "update":
                            if($this->getType() == "media"):
                                $this->updateLanguage($language['iso']);
                            endif;
                        break;
                        case "delete":
                            $this->deleteLanguage($language['iso']);
                        break;
                        default:
                            exit('Geçersiz operasyon');
                    endswitch;
                endforeach;
            endif;
        endif;
 
        return true;
    }
 
    public function createLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $check = self::count([
               "conditions" => "lang = :lang: and key = :key:",
               "bind" => ["lang" => $lang_iso, "key"  => $this->getKey()]
            ]);
            if($check > 0) return false;
 
            $model = new Options();
            $model->setLang($lang_iso);
            $model->setKey($this->getKey());
            $model->setValue($this->value,true);
            $model->setType($this->getType());
            $model->setCopy(false);
 
            if (!$model->create()) {
                $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_copy_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_copy_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null,
                "value" => $this->value
            ]);
 
        }
 
    }
 
    public function updateLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
 
            $model = self::get($this->getKey(),$lang_iso);
            if(!$model)
                return $this->createLanguage($lang_iso);
 
 
            $model->setType($this->getType());
            $model->setValue($this->value,true);
            $model->setCopy(false);
 
 
            if (!$model->update()) {
 
                $this->output(false,sprintf('%s dili güncellenirken hata oluştu',$lang_iso),"option_update_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"option_update_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null
            ]);
 
        }
 
    }
 
    public function deleteLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $model = self::get($this->getKey(),$lang_iso);
            if(!$model) return true;
 
            if (!$model->delete()) {
                $this->output(false,sprintf('%s dili silinirken hata oluştu',$lang_iso),"option_delete_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            $this->output(false,sprintf('%s dili silinirken hata oluştu',$lang_iso),"option_delete_1305",[
                'error' => $this->getThrowable($e),
                'item'  => ($model) ?  $model->toArray() : null
            ]);
 
        }
 
    }
 
 
 
 
    public function copyLanguages(){
 
        if(!$this->getCopy()) return false;
 
        $languages = Language::getLanguages();
 
        if(count($languages) > 1):
            foreach ($languages as $language):
                $this->copyLanguage($language['iso']);
            endforeach;
        endif;
 
        return true;
    }
 
 
    public function copyLanguage($lang_iso){
 
        try {
 
            if ($lang_iso == $this->getLang()) return false;//Şuanki dili es geç
 
            $language = Language::getLanguage($lang_iso);
 
            $model = new Options();
            $model->setLang($lang_iso);
            $model->setKey($this->getKey());
            $model->setValue($this->value);
            $model->setType($this->getType());
            $model->setCopy(false);
 
            if (!$model->create()) {
                return false;
                /*
                return $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"options_lang_copy_1304",[
                    'error' => $this->errorMessage($model->getMessages()),
                    'item'  => $model->toArray()
                ]);
                */
 
            }
 
            return true;
 
        }catch (\Throwable $e){
 
            /*
            $this->output(false,sprintf('%s dili kopyalanırken hata oluştu',$lang_iso),"options_lang_copy_1305",[
                'error' => $this->getThrowable($e),
                'item'  => $model->toArray()
            ]);
            */
            return false;
 
        }
 
    }
 
 
}
#6Konsol\Model\Options::getOption(active_theme)
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Posts/Init.php (33)
<?php
/**
 * Created by PhpStorm.
 * User: aaltintas03
 * Date: 26.11.2018
 * Time: 17:15
 */
 
namespace Posts;
 
use Konsol\Model\Language;
use Konsol\Model\Options;
use Phalcon\Mvc\User\Component;
 
class Init extends Component{
 
 
    private $active_theme;
    private $theme_name;
 
    public function __construct(){
 
 
 
        $this->di->set('post_types', new \Posts\Helper\PostTypes());
        $this->di->set('taxonomies', new \Posts\Helper\PostTaxonomies());
 
        $this->di->get('view')->setVar('get_posts',new \Posts\Helper\PostsFinder());
        $this->di->get('view')->setVar('get_terms',new \Posts\Helper\TermsFinder());
 
 
 
        $this->active_theme = Options::getOption('active_theme');
        $this->theme_name   = ($this->active_theme) ? \Phalcon\Text::camelize($this->active_theme) : false;
        define('ACTIVE_THEME',$this->active_theme);
        define('ACTIVE_THEME_NAME',$this->theme_name);
 
 
 
        $this->setMenu();
 
        $this->setRouter();
 
        $this->setThemeOptions();
 
 
 
    }
 
    private function setRouter(){
 
        if(!$this->active_theme) return false;
 
        $this->di->get('helper')->publicResources()->add($this->active_theme, "index", array('*'),"all");
 
        $this->di->get('helper')->publicResources()->add($this->active_theme, "error", array('*'),"all");
 
    }
 
    private function setMenu(){
 
 
        $this->helper->StaticMenu('options')->addMenu('customfields', [
            "title" => "Özel Alanlar",
            "desc" => "İçeriklerinizde kişiselleştirilmiş özel alanlar üretin",
            "url" => "posts/customfields",
            "icon" => "far fa-cogs",
            "position" => 8
        ]);
 
        $this->helper->StaticMenu('sidebar')->addSubmenu('design', [
            "title" => "Temalar",
            "url" => "konsol/themes/index",
            "position" => 1
        ]);
 
 
 
        $this->helper->StaticMenu('konsol_index')->addMenu('themes', [
            "title" => "Temalar",
            "url" => "konsol/themes/index",
            "icon" => "far fa-palette",
            "position" => 40
        ]);
 
 
        if(!$this->active_theme) return false;
 
 
        $this->helper->StaticMenu('konsol_header')->addMenu('website',[
            'name'          => "Siteye Git",
            'title'          => "Siteye gitmek için tıklayın.",
            'url'            => $this->url->get(),
            'icon'           => "fa-external-link-alt",
            'target'         => "_blank",
            'position'  => 1 //soldan sağa menü pozisyonu
        ]);
 
 
        $languages = Language::getLanguages();
 
 
        if(count($languages) > 1):
            foreach ($languages as $language):
                $this->helper->StaticMenu('konsol_header')->addSubmenu('website',[
                    'title'           => $language['name'],
                    'url'            => $this->url->get($language['url']),
                    'target'         => "_blank",
                    'icon'         => "fa-language",
                    'position'  => 1 //soldan sağa menü pozisyonu
                ]);
            endforeach;
        endif;
 
 
 
        }
 
 
 
    private function setThemeOptions(){
 
 
        if(!$this->theme_name) return false;
 
        $this->setThemeOptions_views();
 
        $this->setThemeOptions_scripts();
 
    }
 
 
 
    private function setThemeOptions_views(){
 
 
        $THEME_PATH = PATHS['MODULES']  . $this->theme_name;
 
        define('THEME_DIR', $THEME_PATH);
 
        $this->di->get('view')->setViewsDir($THEME_PATH . "/Views");
        $this->di->get('view')->setLayoutsDir(THEME_DIR . "/Views");
 
        $this->di->get('view')->setMainView("index");
        $this->di->get('view')->setPartialsDir("_partials/");
        $this->di->get('view')->setLayout(THEME_DIR . "/Views/index");
 
 
 
    }
 
 
    private function setThemeOptions_scripts(){
 
 
        /*
        * HEADER
        */
        $scripts_header         = $this->assets->collection('scripts_header');
        $scripts_header_main    = $this->assets->collection('scripts_header_main');
 
        $stylesheet_header_main = $this->assets->collection('stylesheet_header_main');
        $stylesheet_header      = $this->assets->collection('stylesheet_header');
 
 
        /*
         * FOOTER
         */
 
        $scripts_header_cdn    = $this->assets->collection('scripts_header_cdn')->setLocal(false)->join(false);
        $stylesheet_header_cdn = $this->assets->collection('stylesheet_header_cdn')->setLocal(false)->join(false);
 
        $scripts_footer_cdn    = $this->assets->collection('scripts_footer_cdn')->setLocal(false)->join(false);
        $stylesheet_footer_cdn = $this->assets->collection('stylesheet_footer_cdn')->setLocal(false)->join(false);
 
 
    }
 
 
 
 
}
#7Posts\Init->__construct()
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (153)
<?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();
 
    }
 
 
 
}
#8App\Bootstrap->initRouting(Object(Phalcon\Mvc\Application), Object(Phalcon\Di\FactoryDefault))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (123)
<?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();
 
    }
 
 
 
}
#9App\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/etiket/milli-egitim-dunya-sampiyonunu-agirladi
KeyValue
USERdenizliyeniolay.com_a706vjldz7n
HOME/var/www/vhosts/denizliyeniolay.com
SCRIPT_NAME/public/index.php
REQUEST_URI/etiket/milli-egitim-dunya-sampiyonunu-agirladi
QUERY_STRING_url=/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.0
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/public/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_QUERY_STRING_url=/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REMOTE_PORT50644
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.130.113
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_CF_VISITOR{"scheme":"https"}
HTTP_CF_CONNECTING_IP3.17.183.27
HTTP_ACCEPT*/*
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_IPCOUNTRYUS
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_CDN_LOOPcloudflare; loops=1
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_RAY8debaca5ce3e2bdb-ORD
HTTP_CONNECTIONclose
HTTP_X_ACCEL_INTERNAL/internal-nginx-static-location
HTTP_X_FORWARDED_FOR3.17.183.27
HTTP_X_REAL_IP172.70.130.113
HTTP_HOSTdenizliyeniolay.com
proxy-nokeepalive1
HTTPSon
PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
REDIRECT_REDIRECT_STATUS200
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_REDIRECT_SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_REDIRECT_UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
FCGI_ROLERESPONDER
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1730964782.8388
REQUEST_TIME1730964782
#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
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(RedisException), Array([code] => init_routing, [message] => Posts\Module modülünün Init.php dosyasında hata !, [error_code] => 0, [error_message] => Connection refused, [file] => /var/www/vhosts/denizliyeniolay.com/httpdocs/app/modules/Konsol/Model/Options.php, [line] => 42))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (164)
<?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->initRouting(Object(Phalcon\Mvc\Application), Object(Phalcon\Di\FactoryDefault))
/var/www/vhosts/denizliyeniolay.com/httpdocs/app/Bootstrap.php (123)
<?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/etiket/milli-egitim-dunya-sampiyonunu-agirladi
KeyValue
USERdenizliyeniolay.com_a706vjldz7n
HOME/var/www/vhosts/denizliyeniolay.com
SCRIPT_NAME/public/index.php
REQUEST_URI/etiket/milli-egitim-dunya-sampiyonunu-agirladi
QUERY_STRING_url=/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REQUEST_METHODGET
SERVER_PROTOCOLHTTP/1.0
GATEWAY_INTERFACECGI/1.1
REDIRECT_URL/public/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_QUERY_STRING_url=/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REMOTE_PORT50644
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.130.113
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_CF_VISITOR{"scheme":"https"}
HTTP_CF_CONNECTING_IP3.17.183.27
HTTP_ACCEPT*/*
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_IPCOUNTRYUS
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_CDN_LOOPcloudflare; loops=1
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_RAY8debaca5ce3e2bdb-ORD
HTTP_CONNECTIONclose
HTTP_X_ACCEL_INTERNAL/internal-nginx-static-location
HTTP_X_FORWARDED_FOR3.17.183.27
HTTP_X_REAL_IP172.70.130.113
HTTP_HOSTdenizliyeniolay.com
proxy-nokeepalive1
HTTPSon
PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
REDIRECT_STATUS200
REDIRECT_HTTPSon
REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
REDIRECT_REDIRECT_STATUS200
REDIRECT_REDIRECT_HTTPSon
REDIRECT_REDIRECT_PERL5LIB/usr/share/awstats/lib:/usr/share/awstats/plugins
REDIRECT_REDIRECT_SCRIPT_URIhttps://denizliyeniolay.com/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_REDIRECT_SCRIPT_URL/etiket/milli-egitim-dunya-sampiyonunu-agirladi
REDIRECT_REDIRECT_UNIQUE_IDZyxtLnlobYuFVrBi-C9BUgAAAJU
FCGI_ROLERESPONDER
PHP_SELF/public/index.php
REQUEST_TIME_FLOAT1730964782.8388
REQUEST_TIME1730964782
#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
Memory
Usage2097152
Beklenmedik Hata Oluştu

HATA!

Beklenmedik Hata Oluştu