public static function startSession() { if (!$_SESSION) { session_start(); } $maincfg = ErApplication::getMainCfg(); self::$_storage = $maincfg['application']['session']['mainstorage']; }
private function __construct() { $this->_tplConf = ErApplication::fileExists('template.cfg', 'php') ? require_once "template.cfg.php" : null; if ($this->_tplConf) { $this->_blocks = $this->_tplConf["blocks"]; $this->_ctrls = $this->_tplConf["Controller"]; foreach ($this->_blocks as $block) { $this->_prepareView[$block] = array(); } } $this->_messages = ErMessenger::getInstance(); $config = ErApplication::getMainCfg(); $this->_dataPath = $config['application']['paths']['data']; }
private function __construct() { $mainCfg = ErApplication::getMainCfg(); $host = $mainCfg["dbsettings"]["host"]; $name = $mainCfg["dbsettings"]["name"]; $login = $mainCfg["dbsettings"]["login"]; $password = $mainCfg["dbsettings"]["password"]; try { $this->connDB = new PDO("mysql:host=" . $host . ";dbname=" . $name, $login, $password, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")); // $stmt = $this->connDB->prepare("set_client='utf8'"); // $stmt->execute(); // $stmt = $this->connDB->prepare("set character_set_results='utf8'"); // $stmt->execute(); // $stmt = $this->connDB->prepare("set collation_connection='utf8_general_ci'"); // $stmt->execute(); // $stmt = $this->connDB->prepare("SET NAMES utf8"); // $stmt->execute(); } catch (PDOException $e) { echo "Error!: " . $e->getMessage() . "<br/>"; die; } }