exec("TRUNCATE TABLE pre_plugin"); $list = self::getList(); foreach($list as $name){ if($config = self::getConfig($name)){ if($config['name']!=$name)continue; $DB->exec("INSERT INTO pre_plugin VALUES (:name, :showname, :author, :link, :types, :inputs, :select)", [':name'=>$config['name'], ':showname'=>$config['showname'], ':author'=>$config['author'], ':link'=>$config['link'], ':types'=>$config['types'], ':inputs'=>$config['inputs'], ':select'=>$config['select']]); } } return true; } static public function get($name){ global $DB; $result = $DB->getRow("SELECT * FROM pre_plugin WHERE name='$name'"); return $result; } static public function getAll(){ global $DB; $result = $DB->getAll("SELECT * FROM pre_plugin"); return $result; } }