@@ -108,7 +108,7 @@ class DB
108
108
* will be written by classes/DB/DB***.class.php
109
109
* @var array
110
110
*/
111
- var $ supported_list = array ();
111
+ static $ supported_list = array ();
112
112
113
113
/**
114
114
* location of query cache
@@ -139,7 +139,7 @@ class DB
139
139
* @param string $db_type type of db
140
140
* @return DB return DB object instance
141
141
*/
142
- function & getInstance ($ db_type = NULL )
142
+ function getInstance ($ db_type = NULL )
143
143
{
144
144
if (!$ db_type )
145
145
{
@@ -208,20 +208,18 @@ function getSupportedList()
208
208
* this list return by child class
209
209
* @return array return enable DBMS list in supported dbms list
210
210
*/
211
- function getEnableList ()
211
+ public static function getEnableList ()
212
212
{
213
- is_a ($ this , 'DB ' ) ? $ self = $ this : $ self = self ::getInstance ();
214
-
215
- if (!$ self ->supported_list )
213
+ if (!self ::$ supported_list )
216
214
{
217
215
$ oDB = new DB ();
218
- $ self-> supported_list = $ oDB ->_getSupportedList ();
216
+ self :: $ supported_list = $ oDB ->_getSupportedList ();
219
217
}
220
218
221
219
$ enableList = array ();
222
- if (is_array ($ self-> supported_list ))
220
+ if (is_array (self :: $ supported_list ))
223
221
{
224
- foreach ($ self-> supported_list AS $ key => $ value )
222
+ foreach (self :: $ supported_list AS $ key => $ value )
225
223
{
226
224
if ($ value ->enable )
227
225
{
@@ -237,20 +235,18 @@ function getEnableList()
237
235
* this list return by child class
238
236
* @return array return disable DBMS list in supported dbms list
239
237
*/
240
- function getDisableList ()
238
+ public static function getDisableList ()
241
239
{
242
- is_a ($ this , 'DB ' ) ? $ self = $ this : $ self = self ::getInstance ();
243
-
244
- if (!$ self ->supported_list )
240
+ if (!self ::$ supported_list )
245
241
{
246
242
$ oDB = new DB ();
247
- $ self-> supported_list = $ oDB ->_getSupportedList ();
243
+ self :: $ supported_list = $ oDB ->_getSupportedList ();
248
244
}
249
245
250
246
$ disableList = array ();
251
- if (is_array ($ self-> supported_list ))
247
+ if (is_array (self :: $ supported_list ))
252
248
{
253
- foreach ($ self-> supported_list AS $ key => $ value )
249
+ foreach (self :: $ supported_list AS $ key => $ value )
254
250
{
255
251
if (!$ value ->enable )
256
252
{
@@ -271,8 +267,8 @@ function _getSupportedList()
271
267
static $ get_supported_list = '' ;
272
268
if (is_array ($ get_supported_list ))
273
269
{
274
- $ this -> supported_list = $ get_supported_list ;
275
- return $ this -> supported_list ;
270
+ self :: $ supported_list = $ get_supported_list ;
271
+ return self :: $ supported_list ;
276
272
}
277
273
$ get_supported_list = array ();
278
274
$ db_classes_path = _XE_PATH_ . "classes/db/ " ;
@@ -293,7 +289,7 @@ function _getSupportedList()
293
289
294
290
unset($ oDB );
295
291
require_once ($ class_file );
296
- $ oDB = new $ class_name ();
292
+ $ oDB = new $ class_name (FALSE );
297
293
298
294
if (!$ oDB )
299
295
{
@@ -310,8 +306,8 @@ function _getSupportedList()
310
306
// sort
311
307
@usort ($ get_supported_list , array ($ this , '_sortDBMS ' ));
312
308
313
- $ this -> supported_list = $ get_supported_list ;
314
- return $ this -> supported_list ;
309
+ self :: $ supported_list = $ get_supported_list ;
310
+ return self :: $ supported_list ;
315
311
}
316
312
317
313
/**
@@ -1346,7 +1342,7 @@ function actDBClassFinish()
1346
1342
* @param boolean $force force load DBParser instance
1347
1343
* @return DBParser
1348
1344
*/
1349
- function & getParser ($ force = FALSE )
1345
+ function getParser ($ force = FALSE )
1350
1346
{
1351
1347
static $ dbParser = NULL ;
1352
1348
if (!$ dbParser || $ force )
0 commit comments