/var/www/clients/client1/web1/web/controller/class/controller/controller.php
$ret = true;
}
}
return $ret;
}
}
private function _loadConfigFromCache() {
if ($this->getMemcached()) {
$memcacheD = new \Memcached();
if ($memcacheD->addServer($this->getMemcached()->host, $this->getMemcached()->port)) {
if ($memcacheD->get('controller_config_1') !== false and $memcacheD->get('controller_config_2') !== false) {
CONTROLLER\CONFIG::setClasses($memcacheD->get('controller_config_1'));
$this->_config = $memcacheD->get('controller_config_2');
return false;
}
}
} else {
$config = file('tmp/cache/config.php');
$decoded = urldecode($config[1]);
try {
$unserialized = unserialize($decoded);
CONTROLLER\CONFIG::setClasses($unserialized);
} catch (\Exception $e) {
if (file_exists('/tmp/cache/config.php')) {
unlink('/tmp/cache/config.php');
}
return false;
// \CO\SYSTEM\HTTP\HEADER::redirect('/');
}
try {
$this->_config = unserialize(urldecode($config[2]));
} catch (\Exception $e) {
if (file_exists('/tmp/cache/config.php')) {
unlink('/tmp/cache/config.php');
}
return false;
}
// var_dump('from-filecache');
/var/www/clients/client1/web1/web/controller/class/controller/controller.php
$ret = true;
}
}
return $ret;
}
}
private function _loadConfigFromCache() {
if ($this->getMemcached()) {
$memcacheD = new \Memcached();
if ($memcacheD->addServer($this->getMemcached()->host, $this->getMemcached()->port)) {
if ($memcacheD->get('controller_config_1') !== false and $memcacheD->get('controller_config_2') !== false) {
CONTROLLER\CONFIG::setClasses($memcacheD->get('controller_config_1'));
$this->_config = $memcacheD->get('controller_config_2');
return false;
}
}
} else {
$config = file('tmp/cache/config.php');
$decoded = urldecode($config[1]);
try {
$unserialized = unserialize($decoded);
CONTROLLER\CONFIG::setClasses($unserialized);
} catch (\Exception $e) {
if (file_exists('/tmp/cache/config.php')) {
unlink('/tmp/cache/config.php');
}
return false;
// \CO\SYSTEM\HTTP\HEADER::redirect('/');
}
try {
$this->_config = unserialize(urldecode($config[2]));
} catch (\Exception $e) {
if (file_exists('/tmp/cache/config.php')) {
unlink('/tmp/cache/config.php');
}
return false;
}
// var_dump('from-filecache');
/var/www/clients/client1/web1/web/controller/class/controller/controller.php
ini_set('xdebug.var_display_max_children', '-1');
ini_set('xdebug.var_display_max_depth', '-1');
session_start();
spl_autoload_register(array($this, '_autoload'));
$this->_timer = new TIMER();
$this->_timer->add('CONTROLLER::init start');
// var_dump($this->_configLoadedFromCache());
ERROR::init();
// if ($this->_useConfigCache()) {
// $this->_loadConfigFromCache();
// if (CONTROLLER::getInstance()
// ->getConfig() == NULL) {
// die("A rendszer nincs konfigurálva.");
// }
// } else {
// $this->_generateConfigFromConfigFile();
// $this->_storeConfigToCache();
// }
if ($this->_useConfigCache()) {
if ($this->_loadConfigFromCache() == false) {
$this->_generateConfigFromConfigFile();
$this->_storeConfigToCache();
}
// if (CONTROLLER::getInstance()
// ->getConfig() == NULL) {
// die("A rendszer nincs konfigurálva.");
// }
} else {
$this->_generateConfigFromConfigFile();
$this->_storeConfigToCache();
}
RESPONSE::init();
REQUEST_HANDLER::init();
$this->_timer->add('CONTROLLER::init end');
$this->handleControllerOrModuleRedirects();
\CO\HELPER\POST::initByRawRequestBody();
}
private function handleControllerOrModuleRedirects() {
/var/www/clients/client1/web1/web/index.php
<?php
require_once(__DIR__ .'/functions.php');
require_once(__DIR__ .'/controller/class/controller/controller.php');
require_once 'controller/class/domain/domain.php';
ini_set("session.cookie_domain", \CO\SYSTEM\DOMAIN::getDomainName(false, true));
$controller = new CO\SYSTEM\CONTROLLER();
//$controller->useMemcached('127.0.0.1', 11211);
$controller->init();
\CO\HELPER\DATETIME::setTimezoneOffset('+01:00');
$controller->execute();