8 function mw_sgbd($sgbd_impl, $env){
9 $this->sgbd_impl = $sgbd_impl;
13 function extention_ok(){
14 return $this->sgbd_impl->extention_ok($this->env);
17 function authentication_required(){
18 return $this->sgbd_impl->authentication_required();
21 function connect($host, $base, $user, $password){
22 return $this->sgbd_impl->connect($host, $base, $user, $password);
25 function select_db($db_name){
26 return $this->sgbd_impl->select_db($db_name);
29 # ---------------------------------------------------------------------------------
33 function desc_table($table_name){
34 if(!method_exists($this->sgbd_impl, "desc_table")) return false;
35 return $this->sgbd_impl->desc_table(
36 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
37 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
42 function table_exists($table_name){
43 if(!method_exists($this->sgbd_impl, "table_exists")) return false;
44 return $this->sgbd_impl->table_exists(
45 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
46 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
51 function field_exists($table_name, $field_name){
52 if(!method_exists($this->sgbd_impl, "field_exists")) return false;
53 return $this->sgbd_impl->field_exists(
55 $prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
56 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
63 if(!method_exists($this->sgbd_impl, "query")) return false;
64 return $this->sgbd_impl->query(
65 ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
66 str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $sql)
72 if(!method_exists($this->sgbd_impl, "insert_id")) return false;
73 return $this->sgbd_impl->insert_id();
76 function fetch_assoc($rst){
77 if(!method_exists($this->sgbd_impl, "fetch_assoc")) return false;
78 return $this->sgbd_impl->fetch_assoc($rst);
81 function free_result($rst){
82 if(!method_exists($this->sgbd_impl, "")) return false;
83 return $this->sgbd_impl->free_result($rst);
87 if(!method_exists($this->sgbd_impl, "")) return false;
88 return $this->sgbd_impl->close();
91 # ---------------------------------------------------------------------------------
95 function data_exists($data_path){
96 if(!method_exists($this->sgbd_impl, "data_exists")) return false;
97 return $this->sgbd_impl->data_exists($data_path);
100 function create_data($data_path){
101 if(!method_exists($this->sgbd_impl, "create_data")) return false;
102 return $this->sgbd_impl->create_data($data_path);
105 function get_data($data_path, $data_id){
106 if(!method_exists($this->sgbd_impl, "get_data")) return false;
107 return $this->sgbd_impl->get_data($data_path, $data_id);
110 function open_data($data_path, $FETCH = true){
111 if(!method_exists($this->sgbd_impl, "open_data")) return false;
112 return $this->sgbd_impl->open_data($data_path, $FETCH);
115 function fetch_data($dh){
116 if(!method_exists($this->sgbd_impl, "fetch_data")) return false;
117 return $this->sgbd_impl->fetch_data($dh);
120 function add_data($data_path, $data, $index = null){
121 if(!method_exists($this->sgbd_impl, "add_data")) return false;
122 return $this->sgbd_impl->add_data($data_path, $data, $index);
125 function last_index($dh){
126 if(!method_exists($this->sgbd_impl, "last_index")) return false;
127 return $this->sgbd_impl->last_index($dh);
130 function set_data($data_path, $data_id, $data){
131 if(!method_exists($this->sgbd_impl, "set_data")) return false;
132 return $this->sgbd_impl->set_data($data_path, $data_id, $data);
135 function del_data($data_path, $data_id){
136 if(!method_exists($this->sgbd_impl, "del_data")) return false;
137 return $this->sgbd_impl->del_data($data_path, $data_id);
140 function close_data($dh){
141 if(!method_exists($this->sgbd_impl, "close_data")) return false;
142 return $this->sgbd_impl->close_data($dh);
145 function remove_data($data_path){
146 if(!method_exists($this->sgbd_impl, "remove_data")) return false;
147 return $this->sgbd_impl->remove_data($data_path);