/** * Cleanup querybuilder * * If $deep, call also Database->clean() * * @param bool $deep * * @return \Comodojo\Database\EnhancedDatabase */ public function clean($deep = false) { $this->table = null; $this->distinct = false; $this->keys = null; $this->keys_array = array(); $this->values = null; $this->values_array = array(); $this->where = null; $this->join = null; $this->using = null; $this->on = null; $this->order_by = null; $this->group_by = null; $this->having = null; $this->columns = array(); if (filter_var($deep, FILTER_VALIDATE_BOOLEAN)) { $this->table_prefix = null; parent::clean(); } return $this; }
private static function installDatabase() { $queries = self::getInstallQueries(); try { $db = new Database(EXTENDER_DATABASE_MODEL, EXTENDER_DATABASE_HOST, EXTENDER_DATABASE_PORT, EXTENDER_DATABASE_NAME, EXTENDER_DATABASE_USER, EXTENDER_DATABASE_PASS); foreach ($queries as $query) { $db->query($query); } } catch (DatabaseException $de) { unset($db); throw new ShellException("Database error: " . $de->getMessage()); } unset($db); }