public function __construct($para = array()) { if(!empty($para)) { $this->_table = $para['table']; $this->_pk = $para['pk']; } if(isset($this->_pre_cache_key) && (($ttl = getglobal('setting/memory/'.$this->_table)) !== null || ($ttl = $this->_cache_ttl) !== null) && memory('check')) { $this->_cache_ttl = $ttl; $this->_allowmem = true; } $this->repair();//解决表是否崩溃,新加进去的代码 $this->_init_extend(); parent::__construct(); } //解决表是否崩溃,新加进去的一个自己检查是否需要修复的代码 public function repair() { $query1=DB::query('CHECK TABLE '.DB::table($this->_table)); $checkresult =mysql_fetch_array($query1, MYSQL_ASSOC); //echo(DB::table($this->_table)); //exit; if($checkresult['Msg_text'] != 'OK') { DB::query('REPAIR TABLE '.DB::table($this->_table)); } } |