maj version dans config.xml
[mtweb] / data / mw_sgbd.php
1 <?php
2
3   class mw_sgbd{
4
5     var $sgbd_impl;
6     var $env;
7
8     function mw_sgbd($sgbd_impl, $env){
9       $this->sgbd_impl = $sgbd_impl;
10       $this->env = $env;
11     }
12
13     function extention_ok(){
14       return $this->sgbd_impl->extention_ok($this->env);
15     }
16
17     function connect($host, $base, $user, $password){
18       return $this->sgbd_impl->connect($host, $base, $user, $password);
19     }
20
21     function select_db($db_name){
22       return $this->sgbd_impl->select_db($db_name);
23     }
24
25     # ---------------------------------------------------------------------------------
26     #                                                                               SQL
27     #
28
29     function table_exists($table_name){
30       return $this->sgbd_impl->table_exists(
31         ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
32           str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $table_name)
33         : $table_name
34       );
35     }
36
37     function query($sql){
38       return $this->sgbd_impl->query(
39         ($prefix_codes = array_keys($this->env->bdd("table_prefix"))) ?
40           str_replace($prefix_codes, array_values($this->env->bdd("table_prefix")), $sql)
41         : $sql
42       );
43     }
44
45     function insert_id(){
46       return $this->sgbd_impl->insert_id();
47     }
48
49     function fetch_assoc($rst){
50       return $this->sgbd_impl->fetch_assoc($rst);
51     }
52
53     function free_result($rst){
54       return $this->sgbd_impl->free_result($rst);
55     }
56
57     function close(){
58       return $this->sgbd_impl->close();
59     }
60
61     # ---------------------------------------------------------------------------------
62     #                                                                               XML
63     #
64
65     function data_exists($data_path){
66       return $this->sgbd_impl->data_exists($data_path);
67     }
68
69     function create_data($data_path){
70       return $this->sgbd_impl->create_data($data_path);
71     }
72
73     function get_data($data_path, $data_id){
74       return $this->sgbd_impl->get_data($data_path, $data_id);
75     }
76
77     function open_data($data_path, $FETCH = true){
78       return $this->sgbd_impl->open_data($data_path, $FETCH);
79     }
80
81     function fetch_data($dh){
82       return $this->sgbd_impl->fetch_data($dh);
83     }
84
85     function add_data($data_path, $data){
86       return $this->sgbd_impl->add_data($data_path, $data);
87     }
88
89     function last_index($dh){
90       return $this->sgbd_impl->last_index($dh);
91     }
92
93     function set_data($data_path, $data_id, $data){
94       return $this->sgbd_impl->set_data($data_path, $data_id, $data);
95     }
96
97     function del_data($data_path, $data_id){
98       return $this->sgbd_impl->del_data($data_path, $data_id);
99     }
100
101     function close_data($dh){
102       return $this->sgbd_impl->close_data($dh);
103     }
104
105     function remove_data($data_path){
106       return $this->sgbd_impl->remove_data($data_path);
107     }
108
109   }
110
111 ?>