static function check_init() { if (!count(SDB::get_tables_list())) { $sql = file_get_contents(BASE . 'conf/simple.' . conf('db.type') . '.sql'); if (conf('db.type') == 'mysql') { $spl = explode(';', $sql); foreach ($spl as $part) { $cmd = new SDBCommand($part); $cmd->execute(); } } else { $cmd = new SDBCommand($sql); $cmd->execute(); } SDB::reset_cached_data(); $fl = new FileItem(); $fl->parent_id = 0; $fl->name = 's'; $fl->type = FileItem::Folder; $fl->save(); Initiator::fill_db(S_BASE, $fl->id); } }
<?php if (!count(SDB::get_tables_list())) { $sql = file_get_contents(BASE . '../common/examples.' . conf('db.type') . '.sql'); if (conf('db.type') == 'mysql') { $spl = explode(';', $sql); foreach ($spl as $part) { $cmd = new SDBCommand($part); $cmd->execute(); } } else { $cmd = new SDBCommand($sql); $cmd->execute(); } SDB::reset_cached_data(); }