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)); } } |
版權聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 解決discuz表崩潰 is marked as crashed之類問題