static function load() { if (isset(self::$_data)) { return; } $file = SP_DATA . '/config'; $data = file_get_contents($file); $data = @unserialize($data); if ($data !== false) { self::$_data = $data; debug('{Config} загрузка из файла - успешно'); return true; } else { // TODO: в случае провала загрузки - загружать последний удачный бэкап настроек debug('{Config} загрузка из файла - провал', true); return false; } }
private static function load_data() { if (null == self::$_data) { self::$_data = FileStore::read(__CLASS__); if (self::$_data === null) { self::$_data = array('global' => array()); } } }