コード例 #1
0
 /**
  * Drops a database table
  *
  * @version 1.0
  * @since 1.0
  * @return bool | Exception on failure. True on success.
  */
 public function uninstall()
 {
     if ($this->debug_on) {
         extract($this->debug_handler->event(array('pid' => $this->process_id, 'text' => "method_start", 'file' => __FILE__, 'class' => __CLASS__, 'function' => __FUNCTION__, 'line' => __LINE__, 'parent' => $this, 'vars' => compact(array_keys(get_defined_vars())))));
     }
     $db = new FOX_db(array('pid' => $this->process_id));
     try {
         $db->runDropTable($this->_struct());
     } catch (FOX_exception $child) {
         throw new FOX_exception(array('numeric' => 1, 'text' => "Failed to remove table", 'data' => array('struct' => $this->_struct()), 'file' => __FILE__, 'class' => __CLASS__, 'function' => __FUNCTION__, 'line' => __LINE__, 'child' => $child));
     }
     if ($this->debug_on) {
         extract($this->debug_handler->event(array('pid' => $this->process_id, 'text' => "method_end", 'file' => __FILE__, 'class' => __CLASS__, 'function' => __FUNCTION__, 'line' => __LINE__, 'parent' => $this, 'vars' => compact(array_keys(get_defined_vars())))));
     }
     return true;
 }
コード例 #2
0
 function tearDown()
 {
     $tdb = new FOX_db();
     $tdb->runDropTable(self::$struct);
     parent::tearDown();
 }