Can't create session file
private function createSession()
{
$data = array('IP' => $_SERVER['REMOTE_ADDR']);
if(!file_put_contents($this -> file, serialize($data)))
throw new Error('Can\'t create session file');
return $data;
}
{
$this -> file = CFG::get('tempDir') . '/session/' . md5($_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']);
$this -> data = $this -> getSession();
if($this -> data === false) $this -> data = $this -> createSession();
}
private function getSession()
{
public function __get($name)
{
if($name[0] >= 'A' && $name[0] <= 'Z') return $this['orm'] -> $name;
else if(array_key_exists($name, self::$objects)) return self::$objects[$name];
/** @var {$name} $name */
else return (self::$objects[$name] = new $name());
}
/**
public function getTranslateContent($table, $data) {
if(!$this->session->lang || $this->session->lang == $this->defaultLang)
return $data;
die('asd');
$trans = $this->getTranslate($table, $data);
if(isset($data[0]) && is_array($data[0])) {
}
public function init() {
$data = $this->site->getTopMenuChild();
$data = $this->translate->getTranslateContent('portal_sites', $data);
$lastnews = $this->note->getLastNotesLimit();
$this->tpl->add('LastNews', $lastnews['list']);
$lastrealizations = $this->realization->getLastRealizationsLimit();
$this->tpl->add('Realizations', $lastrealizations['list']);
/*if(($this->mobile->isMobile() && !$this->mobile->isTablet()) && !$_COOKIE['mobile']) {
$this->tpl->prefix = 'm.';
$this->mobileInit();
}*/
$this->init();
$css = scandir('css/animation');
unset($css[0], $css[1]);
$ctrl = new $mod();
$cfg = $ctrl['tpl'] -> buildMeta($ctrl);
if(method_exists($ctrl, $pre))
{
if(($resp = $ctrl -> $pre()) != null)
{
if(self::$useLayout === false || $this->layoutRender == false) return $resp;
else
{
$layout = isset($cfg['layout']) ? $cfg['layout'] : $this -> module;
$this -> module = $settings['module'];
$this -> action = $settings['action'];
$_GET = $settings['param'];
}
$data = $this -> execute();
if($this -> cfg -> pageAutoCache) $this['cache'] -> set($_SERVER['REQUEST_URI'], $data);
$this -> saveStage();
else $autoload = array('module' => 'front', 'action' => 'blocked');
$autoload = false;
require_once 'bootstrap.php';
$kernel = new bootstrap();
$source = $kernel -> run($autoload);
http::sendHeader();
echo $source;