5
----------------------------------------------------------------------------
7
net-based application engine
8
----------------------------------------------------------------------------
9
(C) direct Netware Group - All rights reserved
10
http://www.direct-netware.de/redirect.php?swg
12
This work is distributed under the W3C (R) Software License, but without any
13
warranty; without even the implied warranty of merchantability or fitness
14
for a particular purpose.
15
----------------------------------------------------------------------------
16
http://www.direct-netware.de/redirect.php?licenses;w3c
17
----------------------------------------------------------------------------
18
$Id: swg_db.php,v 1.7 2008/12/20 11:23:19 s4u Exp $
19
#echo(sWGbasicVersion)#
20
sWG/#echo(__FILEPATH__)#
21
----------------------------------------------------------------------------
24
* We need a unified interface for communication with SQL-compatible database
25
* servers. This is the abstract interface.
27
* @internal We are using phpDocumentor to automate the documentation process
28
* for creating the Developer's Manual. All sections including
29
* these special comments will be removed from the release source
31
* Use the following line to ensure 76 character sizes:
32
* ----------------------------------------------------------------------------
33
* @author direct Netware Group
34
* @copyright (C) direct Netware Group - All rights reserved
38
* @license http://www.direct-netware.de/redirect.php?licenses;w3c
39
* W3C (R) Software License
42
/* -------------------------------------------------------------------------
43
All comments will be removed in the "production" packages (they will be in
44
all development packets)
45
------------------------------------------------------------------------- */
47
//j// Functions and classes
49
/* -------------------------------------------------------------------------
50
Testing for required classes
51
------------------------------------------------------------------------- */
53
$g_continue_check = true;
54
if (defined ("CLASS_direct_db")) { $g_continue_check = false; }
55
if (!defined ("CLASS_direct_data_handler")) { $g_continue_check = false; }
57
if ($g_continue_check)
61
* This is the abstract interface to communicate with SQL servers.
63
* @author direct Netware Group
64
* @copyright (C) direct Netware Group - All rights reserved
67
* @uses CLASS_direct_data_handler
69
* @license http://www.direct-netware.de/redirect.php?licenses;w3c
70
* W3C (R) Software License
72
class direct_db extends direct_data_handler
75
* @var resource $db_driver Database layer
77
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $db_driver;
79
* @var string $db_driver_name Database layer name
81
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $db_driver_name;
83
* @var array $query_attributes SQL query attributes
85
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_attributes;
87
* @var integer $query_element Counter for the element tags
89
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_element;
91
* @var array $query_grouping SQL query GROUP BY
93
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_grouping;
95
* @var array $query_joins SQL query JOIN
97
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_joins;
99
* @var array $query_limit SQL query LIMIT
101
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_limit;
103
* @var array $query_offset SQL query OFFSET
105
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_offset;
107
* @var array $query_ordering SQL query ORDER BY
109
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_ordering;
111
* @var array $query_row_conditions SQL query WHERE
113
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_row_conditions;
115
* @var array $query_search_conditions SQL query search conditions
117
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_search_conditions;
119
* @var array $query_set_attributes SQL query SET
121
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_set_attributes;
123
* @var array $query_table SQL query FROM
125
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_table;
127
* @var array $query_type SQL query type
129
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_type;
131
* @var array $query_values SQL query VALUES
133
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_values;
135
* @var array $query_values_keys SQL query KEYS
137
/*#ifndef(PHP4) */protected/* #*//*#ifdef(PHP4):var:#*/ $query_values_keys;
139
/* -------------------------------------------------------------------------
140
Extend the class using old and new behavior
141
------------------------------------------------------------------------- */
143
//f// direct_db->__construct () and direct_db->direct_db ()
145
* Constructor (PHP5) __construct (direct_db)
147
* @param boolean $f_peristent True to establish a persistent connection
148
* @uses direct_basic_functions::include_file()
149
* @uses direct_basic_functions::settings_get()
150
* @uses direct_class_init()
151
* @uses direct_debug()
152
* @uses USE_debug_reporting
155
/*#ifndef(PHP4) */public /* #*/function __construct ($f_peristent = false)
157
global $direct_cachedata,$direct_classes,$direct_settings;
158
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->__construct (direct_db)- (#echo(__LINE__)#)"); }
160
/* -------------------------------------------------------------------------
161
My parent should be on my side to get the work done
162
------------------------------------------------------------------------- */
164
parent::__construct ();
166
/* -------------------------------------------------------------------------
167
Informing the system about available functions
168
------------------------------------------------------------------------- */
170
$this->functions['define_attributes'] = true;
171
$this->functions['define_grouping'] = true;
172
$this->functions['define_join'] = true;
173
$this->functions['define_limit'] = true;
174
$this->functions['define_offset'] = true;
175
$this->functions['define_ordering'] = true;
176
$this->functions['define_row_conditions'] = true;
177
$this->functions['define_row_conditions_encode'] = false;
178
$this->functions['define_search_conditions'] = true;
179
$this->functions['define_set_attributes'] = true;
180
$this->functions['define_set_attributes_encode'] = false;
181
$this->functions['define_values'] = true;
182
$this->functions['define_values_encode'] = false;
183
$this->functions['define_values_keys'] = true;
184
$this->functions['init_delete'] = false;
185
$this->functions['init_insert'] = false;
186
$this->functions['init_replace'] = false;
187
$this->functions['init_select'] = false;
188
$this->functions['init_update'] = false;
189
$this->functions['optimize_random'] = false;
190
$this->functions['query_exec'] = false;
191
$this->functions['v_close'] = array ();
192
$this->functions['v_connect'] = array ();
193
$this->functions['v_optimize'] = array ();
194
$this->functions['v_query_build'] = array ();
195
$this->functions['v_query_exec'] = array ();
196
$this->functions['v_secure'] = array ();
197
$this->functions['v_transaction_begin'] = array ();
198
$this->functions['v_transaction_commit'] = array ();
199
$this->functions['v_transaction_rollback'] = array ();
201
if (file_exists ($direct_settings['path_data']."/settings/swg_db.php"))
203
$direct_classes['basic_functions']->settings_get ($direct_settings['path_data']."/settings/swg_db.php");
205
if (isset ($direct_settings['db_driver'])) { $this->db_driver_name = $direct_settings['db_driver']; }
206
else { $this->db_driver_name = "mysql"; }
208
if (!isset ($direct_settings['db_dbprefix'])) { $direct_settings['db_dbprefix'] = "swg_"; }
210
if ($f_peristent) { $direct_settings['db_peristent'] = true; }
211
elseif (!isset ($direct_settings['db_peristent'])) { $direct_settings['db_peristent'] = $f_peristent; }
212
else { $direct_settings['db_peristent'] = false; }
214
if ($direct_classes['basic_functions']->include_file ($direct_settings['path_system']."/classes/swg_dbraw_".$this->db_driver_name.".php",1))
216
$f_dbraw_class = "direct_dbraw_".$this->db_driver_name;
217
if (class_exists ($f_dbraw_class,/*#ifndef(PHP4) */false/* #*/)) { $this->db_driver = new $f_dbraw_class (); }
219
if (is_object ($this->db_driver))
221
$this->functions['define_row_conditions_encode'] = true;
222
$this->functions['define_set_attributes_encode'] = true;
223
$this->functions['define_values_encode'] = true;
224
$this->functions['init_delete'] = true;
225
$this->functions['init_insert'] = true;
226
$this->functions['init_replace'] = true;
227
$this->functions['init_select'] = true;
228
$this->functions['init_update'] = true;
229
$this->functions['optimize_random'] = true;
230
$this->functions['query_exec'] = true;
232
/* -------------------------------------------------------------------------
233
Connect to the database abstraction layer
234
------------------------------------------------------------------------- */
236
$this->v_call_set ("v_connect",$this->db_driver,"connect");
237
$this->v_call_set ("v_disconnect",$this->db_driver,"disconnect");
238
$this->v_call_set ("v_optimize",$this->db_driver,"optimize");
239
$this->v_call_set ("v_query_build",$this->db_driver,"query_build");
240
$this->v_call_set ("v_query_exec",$this->db_driver,"query_exec");
241
$this->v_call_set ("v_secure",$this->db_driver,"secure");
242
$this->v_call_set ("v_transaction_begin",$this->db_driver,"transaction_begin");
243
$this->v_call_set ("v_transaction_commit",$this->db_driver,"transaction_commit");
244
$this->v_call_set ("v_transaction_rollback",$this->db_driver,"transaction_rollback");
247
else { trigger_error ("sWG/#echo(__FILEPATH__)# -db_class->__construct (direct_db)- (#echo(__LINE__)#) reporting: Fatal error while loading the raw SQL handler",E_USER_ERROR); }
249
else { trigger_error ("sWG/#echo(__FILEPATH__)# -db_class->__construct (direct_db)- (#echo(__LINE__)#) reporting: Fatal error while loading database settings",E_USER_ERROR); }
251
/* -------------------------------------------------------------------------
252
Set up some variables
253
------------------------------------------------------------------------- */
255
$this->query_attributes = "";
256
$this->query_element = 0;
257
$this->query_grouping = "";
258
$this->query_joins = array ();
259
$this->query_limit = 0;
260
$this->query_offset = 0;
261
$this->query_ordering = "";
262
$this->query_row_conditions = "";
263
$this->query_search_conditions = array ();
264
$this->query_set_attributes = array ();
265
$this->query_table = "";
266
$this->query_type = "";
267
$this->query_values = "";
268
$this->query_values_keys = array ();
272
* Constructor (PHP4) direct_db (direct_db)
274
* @param boolean $f_peristent True to establish a persistent connection
277
function direct_db ($f_peristent = false) { $this->__construct ($f_peristent = false); }
279
//f// direct_db->__destruct ()
281
* Destructor (PHP5) __destruct (direct_db)
282
* Closes the database connection on destruction.
284
* @uses direct_dbraw_*::disconnect()
287
/*#ifndef(PHP4) */public /* #*/function __destruct () { $this->v_disconnect (); }
289
//f// direct_db->define_attributes ($f_attribute_list)
291
* Defines SQL attributes. (Only supported for SQL SELECT)
293
* @param mixed $f_attribute_list Requested attributes (including AS
294
* definition) as array or a string for "*"
295
* @uses direct_debug()
296
* @uses USE_debug_reporting
297
* @return boolean False if query is empty or on error
300
/*#ifndef(PHP4) */public /* #*/function define_attributes ($f_attribute_list)
302
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_attributes (+f_attribute_list)- (#echo(__LINE__)#)"); }
304
if ($this->query_type == "select")
306
if (is_array ($f_attribute_list)) { $this->query_attributes = $f_attribute_list; }
307
else { $this->query_attributes = array ("*"); }
309
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_attributes ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
311
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_attributes ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
314
//f// direct_db->define_grouping ($f_attribute_list)
316
* Defines the SQL GROUP BY clause. (Only supported for SQL SELECT)
318
* @param mixed $f_attribute_list Requested grouping (including AS
319
* definition) as array or a string (for a single attribute)
320
* @uses direct_debug()
321
* @uses USE_debug_reporting
322
* @return boolean False if query is empty or on error
325
/*#ifndef(PHP4) */public /* #*/function define_grouping ($f_attribute_list)
327
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_grouping (+f_attribute_list)- (#echo(__LINE__)#)"); }
329
if ($this->query_type == "select")
331
if (is_array ($f_attribute_list)) { $this->query_grouping = $f_attribute_list; }
332
else { $this->query_grouping = array ($f_attribute_list); }
334
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_grouping ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
336
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_grouping ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
339
//f// direct_db->define_join ($f_requirements)
341
* Defines the SQL JOIN clause. (Only supported for SQL SELECT)
343
* @param string $f_type Type of JOIN
344
* @param string $f_table Name of the table (" AS Name" is valid)
345
* @param string $f_requirements ON definitions given as an array
346
* @uses direct_debug()
347
* @uses USE_debug_reporting
348
* @return boolean False if query is empty or on error
351
/*#ifndef(PHP4) */public /* #*/function define_join ($f_type,$f_table,$f_requirements)
353
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_join ($f_type,$f_table,+f_requirements)- (#echo(__LINE__)#)"); }
356
if ($this->query_type == "select")
358
if ((is_string ($f_requirements))||($f_type == "cross-join"))
360
$this->query_joins[] = array ("type" => $f_type,"table" => $f_table,"requirements" => $f_requirements);
365
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_join ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
368
//f// direct_db->define_limit ($f_limit)
370
* Defines a row limit for queries.
372
* @param integer $f_limit Limit for the query
373
* @uses direct_debug()
374
* @uses USE_debug_reporting
375
* @return boolean False if query is empty or on error
378
/*#ifndef(PHP4) */public /* #*/function define_limit ($f_limit)
380
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_limit ($f_limit)- (#echo(__LINE__)#)"); }
382
if (($this->query_type == "delete")||($this->query_type == "select")||($this->query_type == "update"))
384
$this->query_limit = $f_limit;
385
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_limit ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
387
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_limit ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
390
//f// direct_db->define_offset ($f_offset)
392
* Defines an offset for queries.
394
* @param integer $f_offset Offset for the query (0 for none)
395
* @uses direct_debug()
396
* @uses USE_debug_reporting
397
* @return boolean False if query is empty or on error
400
/*#ifndef(PHP4) */public /* #*/function define_offset ($f_offset)
402
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_offset ($f_offset)- (#echo(__LINE__)#)"); }
404
if ($this->query_type == "select")
406
$this->query_offset = $f_offset;
407
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_offset ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
409
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_offset ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
412
//f// direct_db->define_ordering ($f_ordering_list)
414
* Defines the SQL ORDER BY items.
416
* @param string $f_ordering_list XML-encoded elements how to order the list
417
* @uses direct_debug()
418
* @uses USE_debug_reporting
419
* @return boolean False if query is empty or on error
422
/*#ifndef(PHP4) */public /* #*/function define_ordering ($f_ordering_list)
424
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_ordering (+f_ordering_list)- (#echo(__LINE__)#)"); }
427
if ($this->query_type == "select")
429
if (is_string ($f_ordering_list))
431
$this->query_ordering = $f_ordering_list;
436
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_ordering ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
439
//f// direct_db->define_row_conditions ($f_requirements)
441
* Defines the SQL WHERE clause.
443
* @param string $f_requirements WHERE definitions given as an array
444
* @uses direct_debug()
445
* @uses USE_debug_reporting
446
* @return boolean False if query is empty or on error
449
/*#ifndef(PHP4) */public /* #*/function define_row_conditions ($f_requirements)
451
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_row_conditions (+f_requirements)- (#echo(__LINE__)#)"); }
454
if (($this->query_type == "delete")||($this->query_type == "select")||($this->query_type == "update"))
456
if (is_string ($f_requirements))
458
$this->query_row_conditions = $f_requirements;
463
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_row_conditions ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
466
//f// direct_db->define_row_conditions_encode ($f_attribute,$f_value,$f_type,$f_logical_operator = "==",$f_condition_mode = "and")
468
* Returns valid XML sqlbox code for WHERE. Useful to secure values of
469
* attributes against SQL injection.
471
* @param string $f_attribute Attribute
472
* @param string $f_value Value of the attribute
473
* @param string $f_type Value type (attribute, number, string)
474
* @param string $f_logical_operator Logical operator
475
* @param string $f_condition_mode Condition of this element
476
* @uses direct_db::v_secure()
477
* @uses direct_debug()
478
* @uses direct_xml_bridge::array2xml_item_encoder()
479
* @uses USE_debug_reporting
480
* @return boolean False if query is empty or on error
483
/*#ifndef(PHP4) */public /* #*/function define_row_conditions_encode ($f_attribute,$f_value,$f_type,$f_logical_operator = "==",$f_condition_mode = "and")
485
global $direct_classes,$direct_settings;
486
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_row_conditions_encode ($f_attribute,$f_value,$f_type,$f_logical_operator,$f_condition_mode)- (#echo(__LINE__)#)"); }
490
if (isset ($direct_classes['xml_bridge']))
496
$f_value = preg_replace ("#\W#","",$f_value);
501
preg_match ("#^(-|)(\d+)$#i",$f_value,$f_result_array);
502
if (!empty ($f_result_array)) { $f_value = $f_result_array[0]; }
506
case "sublevel": { break 1; }
510
if ($f_value !== NULL) { $this->v_secure ($f_value); }
514
if ($f_condition_mode != "or") { $f_condition_mode = "and"; }
516
switch ($f_logical_operator)
518
case "!=": { break 1; }
519
case "<": { break 1; }
520
case "<=": { break 1; }
521
case ">": { break 1; }
522
case ">=": { break 1; }
523
default: { $f_logical_operator = "=="; }
526
$f_xml_node_array = array (
527
"tag" => "element".$direct_settings['swg_id'].$this->query_element,
528
"attributes" => array ("attribute" => $f_attribute,"condition" => $f_condition_mode,"operator" => $f_logical_operator,"type" => $f_type)
531
if ($f_value === NULL)
533
$f_xml_node_array['attributes']['null'] = 1;
534
$f_xml_node_array['value'] = "";
536
else { $f_xml_node_array['value'] = $f_value; }
538
$this->query_element++;
539
$f_return = $direct_classes['xml_bridge']->array2xml_item_encoder ($f_xml_node_array,true,false);
542
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_row_conditions_encode ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
545
//f// direct_db->define_search_conditions ($f_list)
547
* Defines search conditions for the database.
549
* @param string $f_conditions Conditions to search for
550
* @uses direct_debug()
551
* @uses USE_debug_reporting
552
* @return boolean False if query is empty or on error
555
/*#ifndef(PHP4) */public /* #*/function define_search_conditions ($f_conditions)
557
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_search_conditions (+f_conditions)- (#echo(__LINE__)#)"); }
560
if ($this->query_type == "select")
562
if (is_string ($f_conditions))
564
$this->query_search_conditions = $f_conditions;
569
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_search_conditions ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
572
//f// direct_db->define_search_conditions_term ($f_term)
574
* Creates the search term definition XML code for the given term.
576
* @param string $f_term Term to search for
577
* @uses direct_db::v_secure()
578
* @uses direct_debug()
579
* @uses direct_xml_bridge::array2xml_item_encoder()
580
* @uses USE_debug_reporting
581
* @return boolean False if query is empty or on error
584
/*#ifndef(PHP4) */public /* #*/function define_search_conditions_term ($f_term)
586
global $direct_classes;
587
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_search_conditions_term (+f_term)- (#echo(__LINE__)#)"); }
591
if (isset ($direct_classes['xml_bridge']))
593
$f_xml_node_array = array (
594
"tag" => "searchterm",
598
$f_return = $direct_classes['xml_bridge']->array2xml_item_encoder ($f_xml_node_array,true,false);
601
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_search_conditions_term ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
604
//f// direct_db->define_set_attributes ($f_attribute_list)
606
* Defines the SQL SET clause.
608
* @param string $f_attribute_list Attributes to set
609
* @uses direct_debug()
610
* @uses USE_debug_reporting
611
* @return boolean False if query is empty or on error
614
/*#ifndef(PHP4) */public /* #*/function define_set_attributes ($f_attribute_list)
616
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_set_attributes (+f_attribute_list)- (#echo(__LINE__)#)"); }
618
$f_continue_check = true;
621
if (($this->query_type != "insert")&&($this->query_type != "replace")&&($this->query_type != "update")) { $f_continue_check = false; }
622
if (!empty ($this->query_values)) { $f_continue_check = false; }
624
if ($f_continue_check)
626
if (is_string ($f_attribute_list))
628
$this->query_set_attributes = $f_attribute_list;
633
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_set_attributes ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
636
//f// direct_db->define_set_attributes_encode ($f_attribute,$f_value,$f_type)
638
* Returns valid XML sqlbox code for SET. Useful to secure values against SQL
641
* @param string $f_attribute Attribute
642
* @param string $f_value Value string
643
* @param string $f_type Value type (attribute, number, string)
644
* @uses direct_db::v_secure()
645
* @uses direct_debug()
646
* @uses direct_xml_bridge::array2xml_item_encoder()
647
* @uses USE_debug_reporting
648
* @return boolean False if query is empty or on error
651
/*#ifndef(PHP4) */public /* #*/function define_set_attributes_encode ($f_attribute,$f_value,$f_type)
653
global $direct_classes,$direct_settings;
654
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_set_attributes_encode ($f_attribute,$f_value,$f_type)- (#echo(__LINE__)#)"); }
658
if (isset ($direct_classes['xml_bridge']))
664
$f_value = preg_replace ("#\W#","",$f_value);
669
preg_match ("#^(-|)(\d+)$#i",$f_value,$f_result_array);
670
if (!empty ($f_result_array)) { $f_value = $f_result_array[0]; }
677
if ($f_value !== NULL) { $this->v_secure ($f_value); }
681
$f_xml_node_array = array (
682
"tag" => "element".$direct_settings['swg_id'].$this->query_element,
683
"attributes" => array ("attribute" => $f_attribute,"type" => $f_type)
686
if ($f_value === NULL)
688
$f_xml_node_array['attributes']['null'] = 1;
689
$f_xml_node_array['value'] = "";
691
else { $f_xml_node_array['value'] = $f_value; }
693
$this->query_element++;
694
$f_return = $direct_classes['xml_bridge']->array2xml_item_encoder ($f_xml_node_array,true,false);
697
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_set_attributes_encode ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
700
//f// direct_db->define_values ($f_requirements)
702
* Defines the SQL VALUES element.
704
* @param string $f_values WHERE definitions given as an array
705
* @uses direct_debug()
706
* @uses USE_debug_reporting
707
* @return boolean False if query is empty or on error
710
/*#ifndef(PHP4) */public /* #*/function define_values ($f_values)
712
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_values (+f_values)- (#echo(__LINE__)#)"); }
715
$f_continue_check = true;
717
if (($this->query_type != "insert")&&($this->query_type != "replace")) { $f_continue_check = false; }
718
if (!empty ($this->query_set_attributes)) { $f_continue_check = false; }
720
if ($f_continue_check)
722
if (is_string ($f_values))
724
$this->query_values = $f_values;
729
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_values ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
732
//f// direct_db->define_values_encode ($f_value,$f_type)
734
* Returns valid XML sqlbox code for VALUES. Useful to secure values against
737
* @param string $f_value Value string
738
* @param string $f_type Value type (attribute, number, string)
739
* @uses direct_db::v_secure()
740
* @uses direct_debug()
741
* @uses direct_xml_bridge::array2xml_item_encoder()
742
* @uses USE_debug_reporting
743
* @return boolean False if query is empty or on error
746
/*#ifndef(PHP4) */public /* #*/function define_values_encode ($f_value,$f_type)
748
global $direct_classes,$direct_settings;
749
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_values_encode ($f_value,$f_type)- (#echo(__LINE__)#)"); }
753
if (isset ($direct_classes['xml_bridge']))
759
$f_value = preg_replace ("#\W#","",$f_value);
764
preg_match ("#^(-|)(\d+)$#i",$f_value,$f_result_array);
765
if (!empty ($f_result_array)) { $f_value = $f_result_array[0]; }
769
case "newrow": { break 1; }
773
if ($f_value !== NULL) { $this->v_secure ($f_value); }
777
$f_xml_node_array = array (
778
"tag" => "element".$direct_settings['swg_id'].$this->query_element,
779
"attributes" => array ("type" => $f_type)
782
if ($f_value === NULL)
784
$f_xml_node_array['attributes']['null'] = 1;
785
$f_xml_node_array['value'] = "";
787
else { $f_xml_node_array['value'] = $f_value; }
789
$this->query_element++;
790
$f_return = $direct_classes['xml_bridge']->array2xml_item_encoder ($f_xml_node_array,true,false);
793
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_values_encode ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
796
//f// direct_db->define_values_keys ($f_offset)
798
* Defines the key list for the SQL VALUES statement.
800
* @param array $f_keys_list Key list for VALUES
801
* @uses direct_debug()
802
* @uses USE_debug_reporting
803
* @return boolean False if query is empty or on error
806
/*#ifndef(PHP4) */public /* #*/function define_values_keys ($f_keys_list)
808
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->define_values_keys (+f_keys_list)- (#echo(__LINE__)#)"); }
811
if (($this->query_type == "insert")||($this->query_type == "replace"))
813
if (is_array ($f_keys_list))
815
$this->query_values_keys = $f_keys_list;
820
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->define_values_keys ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
823
//f// direct_db->init_delete ($f_table)
825
* Initiates a DELETE request.
827
* @param string $f_table Name of the table (" AS Name" is valid)
828
* @uses direct_class_function_check()
829
* @uses direct_debug()
830
* @uses USE_debug_reporting
831
* @return boolean False if query cache is not empty (Query not executed?)
834
/*#ifndef(PHP4) */public /* #*/function init_delete ($f_table)
836
global $direct_classes;
837
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->init_delete ($f_table)- (#echo(__LINE__)#)"); }
839
if ((direct_class_function_check ($direct_classes['db'],"v_query_build"))&&(!$this->query_type))
842
$this->query_attributes = array ("*");
843
$this->query_grouping = "";
844
$this->query_joins = array ();
845
$this->query_limit = 0;
846
$this->query_offset = 0;
847
$this->query_ordering = "";
848
$this->query_row_conditions = "";
849
$this->query_search_conditions = array ();
850
$this->query_set_attributes = array ();
851
$this->query_table = $f_table;
852
$this->query_type = "delete";
853
$this->query_values = "";
854
$this->query_values_keys = array ();
856
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_delete ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
858
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_delete ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
861
//f// direct_db->init_insert ($f_table)
863
* Initiates a INSERT request.
865
* @param string $f_table Name of the table (" AS Name" is valid)
866
* @uses direct_class_function_check()
867
* @uses direct_debug()
868
* @uses USE_debug_reporting
869
* @return boolean False if query cache is not empty (Query not executed?)
872
/*#ifndef(PHP4) */public /* #*/function init_insert ($f_table)
874
global $direct_classes;
875
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->init_insert ($f_table)- (#echo(__LINE__)#)"); }
877
if ((direct_class_function_check ($direct_classes['db'],"v_query_build"))&&(!$this->query_type))
880
$this->query_attributes = array ("*");
881
$this->query_grouping = "";
882
$this->query_joins = array ();
883
$this->query_limit = 0;
884
$this->query_offset = 0;
885
$this->query_ordering = "";
886
$this->query_row_conditions = "";
887
$this->query_search_conditions = array ();
888
$this->query_set_attributes = array ();
889
$this->query_table = $f_table;
890
$this->query_type = "insert";
891
$this->query_values = "";
892
$this->query_values_keys = array ();
894
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_insert ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
896
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_insert ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
899
//f// direct_db->init_replace ($f_table)
901
* Initiates a REPLACE request.
903
* @param string $f_table Name of the table (" AS Name" is valid)
904
* @uses direct_class_function_check()
905
* @uses direct_debug()
906
* @uses USE_debug_reporting
907
* @return boolean False if query cache is not empty (Query not executed?)
910
/*#ifndef(PHP4) */public /* #*/function init_replace ($f_table)
912
global $direct_classes;
913
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->init_replace ($f_table)- (#echo(__LINE__)#)"); }
915
if ((direct_class_function_check ($direct_classes['db'],"v_query_build"))&&(!$this->query_type))
918
$this->query_attributes = array ("*");
919
$this->query_grouping = "";
920
$this->query_joins = array ();
921
$this->query_limit = 0;
922
$this->query_offset = 0;
923
$this->query_ordering = "";
924
$this->query_row_conditions = "";
925
$this->query_search_conditions = array ();
926
$this->query_set_attributes = array ();
927
$this->query_table = $f_table;
928
$this->query_type = "replace";
929
$this->query_values = "";
930
$this->query_values_keys = array ();
932
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_replace ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
934
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_replace ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
937
//f// direct_db->init_select ($f_table)
939
* Initiates a SELECT request.
941
* @param string $f_table Name of the table (" AS Name" is valid)
942
* @uses direct_class_function_check()
943
* @uses direct_debug()
944
* @uses USE_debug_reporting
945
* @return boolean False if query cache is not empty (Query not executed?)
948
/*#ifndef(PHP4) */public /* #*/function init_select ($f_table)
950
global $direct_classes;
951
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->init_select ($f_table)- (#echo(__LINE__)#)"); }
953
if ((direct_class_function_check ($direct_classes['db'],"v_query_build"))&&(!$this->query_type))
956
$this->query_attributes = array ("*");
957
$this->query_grouping = "";
958
$this->query_joins = array ();
959
$this->query_limit = 0;
960
$this->query_offset = 0;
961
$this->query_ordering = "";
962
$this->query_row_conditions = "";
963
$this->query_search_conditions = array ();
964
$this->query_set_attributes = array ();
965
$this->query_table = $f_table;
966
$this->query_type = "select";
967
$this->query_values = "";
968
$this->query_values_keys = array ();
970
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_select ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
972
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_select ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
975
//f// direct_db->init_update ($f_table)
977
* Initiates a UPDATE request.
979
* @param string $f_table Name of the table (" AS Name" is valid)
980
* @uses direct_class_function_check()
981
* @uses direct_debug()
982
* @uses USE_debug_reporting
983
* @return boolean False if query cache is not empty (Query not executed?)
986
/*#ifndef(PHP4) */public /* #*/function init_update ($f_table)
988
global $direct_classes;
989
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->init_update ($f_table)- (#echo(__LINE__)#)"); }
991
if ((direct_class_function_check ($direct_classes['db'],"v_query_build"))&&(!$this->query_type))
994
$this->query_attributes = array ("*");
995
$this->query_grouping = "";
996
$this->query_joins = array ();
997
$this->query_limit = 0;
998
$this->query_offset = 0;
999
$this->query_ordering = "";
1000
$this->query_row_conditions = "";
1001
$this->query_search_conditions = array ();
1002
$this->query_set_attributes = array ();
1003
$this->query_table = $f_table;
1004
$this->query_type = "update";
1005
$this->query_values = "";
1006
$this->query_values_keys = array ();
1008
return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_update ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/;
1010
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->init_update ()- (#echo(__LINE__)#)",:#*/false/*#ifdef(DEBUG):,true):#*/; }
1013
//f// direct_db->optimize_random ($f_table)
1015
* Optimizes a given table randomly (1/3).
1017
* @param string $f_table Name of the table
1018
* @uses direct_db::v_optimize()
1019
* @uses direct_debug()
1020
* @uses USE_debug_reporting
1021
* @return boolean True on success
1024
/*#ifndef(PHP4) */public /* #*/function optimize_random ($f_table)
1026
if (USE_debug_reporting) { direct_debug (5,"sWG/#echo(__FILEPATH__)# -db_class->optimize_random ($f_table)- (#echo(__LINE__)#)"); }
1028
if ((mt_rand (0,30)) > 20) { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->optimize_random ()- (#echo(__LINE__)#)",(:#*/$this->v_optimize ($f_table)/*#ifdef(DEBUG):),true):#*/; }
1029
else { return /*#ifdef(DEBUG):direct_debug (7,"sWG/#echo(__FILEPATH__)# -direct_db->optimize_random ()- (#echo(__LINE__)#)",:#*/true/*#ifdef(DEBUG):,true):#*/; }
1032
//f// direct_db->query_exec ($f_answer)
1034
* Transmits defined data to the SQL builder and returns the result in a
1035
* developer specified format via $f_answer.
1037
* @param string $f_answer Defines the requested type that should be returned
1038
* The following types are supported: "ar", "co", "ma", "ms", "nr",
1040
* @uses direct_class_function_check()
1041
* @uses direct_dbraw_*::query_build()
1042
* @uses direct_debug()
1043
* @uses USE_debug_reporting
1044
* @return mixed Result returned by the server in the specified format
1047
/*#ifndef(PHP4) */public /* #*/function query_exec ($f_answer = "sa")
1049
global $direct_classes;
1050
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->query_exec ($f_answer)- (#echo(__LINE__)#)"); }
1054
if (direct_class_function_check ($direct_classes['db'],"v_query_build"))
1057
$f_data['answer'] = $f_answer;
1059
$f_data['attributes'] = $this->query_attributes;
1060
$this->query_attributes = "";
1062
$f_data['grouping'] = $this->query_grouping;
1063
$this->query_grouping = "";
1065
$f_data['limit'] = $this->query_limit;
1066
$this->query_limit = "";
1068
$f_data['offset'] = $this->query_offset;
1069
$this->query_offset = "";
1071
$f_data['ordering'] = $this->query_ordering;
1072
$this->query_ordering = "";
1074
$f_data['joins'] = $this->query_joins;
1075
$this->query_joins = array ();
1077
$f_data['row_conditions'] = $this->query_row_conditions;
1078
$this->query_row_conditions = "";
1080
$f_data['search_conditions'] = $this->query_search_conditions;
1081
$this->query_search_conditions = array ();
1083
$f_data['set_attributes'] = $this->query_set_attributes;
1084
$this->query_set_attributes = array ();
1086
$f_data['table'] = $this->query_table;
1087
$this->query_table = "";
1089
$f_data['type'] = $this->query_type;
1090
$this->query_type = "";
1092
$f_data['values'] = $this->query_values;
1093
$this->query_values = "";
1095
$f_data['values_keys'] = $this->query_values_keys;
1096
$this->query_values_keys = array ();
1098
$this->data = $this->v_query_build ($f_data);
1099
$f_return = $this->data;
1102
return /*#ifdef(DEBUG):direct_debug (9,"sWG/#echo(__FILEPATH__)# -direct_db->query_exec ()- (#echo(__LINE__)#)",:#*/$f_return/*#ifdef(DEBUG):,true):#*/;
1105
//f// direct_db->v_connect ()
1107
* Opens the connection to a database server and selects a database.
1109
* @uses direct_debug()
1110
* @uses direct_virtual_class::v_call_get()
1111
* @uses USE_debug_reporting
1112
* @return boolean True on success
1115
/*#ifndef(PHP4) */public /* #*/function v_connect ()
1117
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_connect ()- (#echo(__LINE__)#)"); }
1118
$f_call = $this->v_call_get ("v_connect");
1120
if ($f_call) { return $f_call[0]->{$f_call[1]} (); }
1121
else { return false; }
1124
//f// direct_db->v_disconnect ()
1126
* Closes an active database connection to the server.
1128
* @uses direct_debug()
1129
* @uses direct_virtual_class::v_call_get()
1130
* @uses USE_debug_reporting
1131
* @return boolean True on success
1134
/*#ifndef(PHP4) */public /* #*/function v_disconnect ()
1136
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_disconnect ()- (#echo(__LINE__)#)"); }
1137
$f_call = $this->v_call_get ("v_disconnect");
1139
if ($f_call) { return $f_call[0]->{$f_call[1]} (); }
1140
else { return false; }
1143
//f// direct_db->v_optimize ($f_table)
1145
* Optimizes a given table.
1147
* @param string $f_table Name of the table
1148
* @uses direct_debug()
1149
* @uses direct_virtual_class::v_call_get()
1150
* @uses USE_debug_reporting
1151
* @return boolean True on success
1154
/*#ifndef(PHP4) */public /* #*/function v_optimize ($f_table)
1156
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_optimize ($f_table)- (#echo(__LINE__)#)"); }
1157
$f_call = $this->v_call_get ("v_optimize");
1159
if ($f_call) { return $f_call[0]->{$f_call[1]} ($f_table); }
1160
else { return false; }
1163
//f// direct_db->v_query_build ($f_data)
1165
* Builds and runs the SQL statement using the connected database specific
1168
* @param array $f_data Array containing query specific information.
1169
* @uses direct_debug()
1170
* @uses direct_virtual_class::v_call_get()
1171
* @uses USE_debug_reporting
1172
* @return mixed Result returned by the server in the specified format
1175
/*#ifndef(PHP4) */public /* #*/function v_query_build ($f_data)
1177
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_query_build (+f_query)- (#echo(__LINE__)#)"); }
1178
$f_call = $this->v_call_get ("v_query_build");
1180
if ($f_call) { return $f_call[0]->{$f_call[1]} ($f_data); }
1181
else { return false; }
1184
//f// direct_db->v_query_exec ($f_answer,$f_query)
1186
* Transmits an SQL query and returns the result in a developer specified
1187
* format via $f_answer.
1189
* @param string $f_answer Defines the requested type that should be returned
1190
* The following types are supported: "ar", "co", "ma", "ms", "nr",
1192
* @param string $f_query Valid SQL query
1193
* @uses direct_debug()
1194
* @uses direct_virtual_class::v_call_get()
1195
* @uses USE_debug_reporting
1196
* @return mixed Result returned by the server in the specified format
1199
/*#ifndef(PHP4) */public /* #*/function v_query_exec ($f_answer,$f_query)
1201
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_query_exec ($f_answer,+f_query)- (#echo(__LINE__)#)"); }
1202
$f_call = $this->v_call_get ("v_query_exec");
1204
if ($f_call) { return $f_call[0]->{$f_call[1]} ($f_answer,$f_query); }
1205
else { return false; }
1208
//f// direct_db_mysql->v_secure (&$f_data)
1210
* Secures a given string to protect against SQL injections.
1212
* @param mixed &$f_data Input array or string
1213
* @uses direct_debug()
1214
* @uses direct_virtual_class::v_call_get()
1215
* @uses USE_debug_reporting
1218
/*#ifndef(PHP4) */public /* #*/function v_secure (&$f_data)
1220
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_secure (+f_data)- (#echo(__LINE__)#)"); }
1222
$f_call = $this->v_call_get ("v_secure");
1223
if ($f_call) { $f_call[0]->{$f_call[1]} ($f_data); }
1226
//f// direct_db_mysql->v_transaction_begin ()
1228
* Starts a transaction.
1230
* @uses direct_debug()
1231
* @uses direct_virtual_class::v_call_get()
1232
* @uses USE_debug_reporting
1235
/*#ifndef(PHP4) */public /* #*/function v_transaction_begin ()
1237
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_transaction_begin ()- (#echo(__LINE__)#)"); }
1238
$f_call = $this->v_call_get ("v_transaction_begin");
1240
if ($f_call) { return $f_call[0]->{$f_call[1]} (); }
1241
else { return false; }
1244
//f// direct_db_mysql->v_transaction_commit ()
1246
* Commits all transaction statements.
1248
* @uses direct_debug()
1249
* @uses direct_virtual_class::v_call_get()
1250
* @uses USE_debug_reporting
1253
/*#ifndef(PHP4) */public /* #*/function v_transaction_commit ()
1255
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_transaction_commit ()- (#echo(__LINE__)#)"); }
1256
$f_call = $this->v_call_get ("v_transaction_commit");
1258
if ($f_call) { return $f_call[0]->{$f_call[1]} (); }
1259
else { return false; }
1262
//f// direct_db_mysql->v_transaction_rollback ()
1264
* Calls the ROLLBACK statement.
1266
* @uses direct_debug()
1267
* @uses direct_virtual_class::v_call_get()
1268
* @uses USE_debug_reporting
1271
/*#ifndef(PHP4) */public /* #*/function v_transaction_rollback ()
1273
if (USE_debug_reporting) { direct_debug (8,"sWG/#echo(__FILEPATH__)# -db_class->v_transaction_rollback ()- (#echo(__LINE__)#)"); }
1274
$f_call = $this->v_call_get ("v_transaction_rollback");
1276
if ($f_call) { return $f_call[0]->{$f_call[1]} (); }
1277
else { return false; }
1281
/* -------------------------------------------------------------------------
1282
Mark this class as the most up-to-date one
1283
------------------------------------------------------------------------- */
1285
$direct_classes['@names']['db'] = "direct_db";
1286
define ("CLASS_direct_db",true);
'\\ No newline at end of file'