1
<?xml version="1.0" encoding="iso-8859-1"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
5
<!-- template designed by Marco Von Ballmoos -->
6
<title>Docs For Class MDB</title>
7
<link rel="stylesheet" href="../media/stylesheet.css" />
8
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
11
<div class="page-body">
12
<h2 class="class-name">Class MDB</h2>
14
<a name="sec-description"></a>
15
<div class="info-box">
16
<div class="info-box-title">Description</div>
18
<span class="disabled">Description</span> |
19
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
22
<div class="info-box-body">
23
<!-- ========== Info from phpDoc block ========= -->
24
<p class="short-description">The main 'MDB' class is simply a container class with some static methods for creating DB objects as well as some utility functions common to all parts of DB.</p>
25
<p class="description"><p>The object model of DB is as follows (indentation means inheritance):</p><p>MDB The main DB class. This is simply a utility class with some 'static' methods for creating MDB objects as well as common utility functions for other MDB classes.</p><p>MDB_common The base for each DB implementation. Provides default | implementations (in OO lingo virtual methods) for | the actual DB implementations as well as a bunch of | query utility functions. | +-MDB_mysql The DB implementation for MySQL. Inherits MDB_Common. When calling MDB::factory or MDB::connect for MySQL connections, the object returned is an instance of this class. +-MDB_pgsql The DB implementation for PostGreSQL. Inherits MDB_Common. When calling MDB::factory or MDB::connect for PostGreSQL connections, the object returned is an instance of this class.</p><p>MDB_Date This class provides several method to convert from and to MDB timestamps.</p><p>MDB_Manager This class handles the xml schema management.</p></p>
27
<li><span class="field">author:</span> Lukas Smith <<a href="mailto:smith@backendmedia.com">smith@backendmedia.com</a>></li>
28
<li><span class="field">version:</span> $Id: MDB.php,v 1.59.4.12 2004/02/28 10:37:54 quipo Exp $</li>
31
Located in <a class="field" href="_lib---MDB.php.html">/lib/MDB.php</a> (line <span class="field">188</span>)
43
<a name="sec-method-summary"></a>
44
<div class="info-box">
45
<div class="info-box-title">Method Summary</span></div>
47
<a href="#sec-description">Description</a> |
48
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
50
<div class="info-box-body">
51
<div class="method-summary">
53
<div class="method-definition">
54
<span class="method-result">int</span>
55
<a href="#apiVersion" title="details" class="method-name">apiVersion</a>
58
<div class="method-definition">
59
<span class="method-result">mixed</span>
60
<a href="#connect" title="details" class="method-name">&connect</a>
61
(<span class="var-type">mixed</span> <span class="var-name">$dsn</span>, [<span class="var-type">mixed</span> <span class="var-name">$options</span> = <span class="var-default">FALSE</span>])
63
<div class="method-definition">
64
<span class="method-result">string</span>
65
<a href="#errorMessage" title="details" class="method-name">errorMessage</a>
66
(<span class="var-type">int</span> <span class="var-name">$value</span>)
68
<div class="method-definition">
69
<span class="method-result">mixed</span>
70
<a href="#factory" title="details" class="method-name">&factory</a>
71
(<span class="var-type">string</span> <span class="var-name">$type</span>)
73
<div class="method-definition">
74
<span class="method-result">bool</span>
75
<a href="#isConnection" title="details" class="method-name">isConnection</a>
76
(<span class="var-type">mixed</span> <span class="var-name">$value</span>)
78
<div class="method-definition">
79
<span class="method-result">boolean</span>
80
<a href="#isError" title="details" class="method-name">isError</a>
81
(<span class="var-type">int</span> <span class="var-name">$value</span>)
83
<div class="method-definition">
84
<span class="method-result">boolean</span>
85
<a href="#isManip" title="details" class="method-name">isManip</a>
86
(<span class="var-type">string</span> <span class="var-name">$query</span>)
88
<div class="method-definition">
89
<span class="method-result">$file</span>
90
<a href="#loadFile" title="details" class="method-name">loadFile</a>
91
(<span class="var-type"></span> <span class="var-name">$file</span>)
93
<div class="method-definition">
94
<span class="method-result">array</span>
95
<a href="#parseDSN" title="details" class="method-name">parseDSN</a>
96
(<span class="var-type">string</span> <span class="var-name">$dsn</span>)
98
<div class="method-definition">
99
<span class="method-result">void</span>
100
<a href="#setOptions" title="details" class="method-name">setOptions</a>
101
(<span class="var-type"></span> <span class="var-name">&$db</span>, <span class="var-type">mixed</span> <span class="var-name">$options</span>, <span class="var-type">object</span> <span class="var-name">$db</span>)
103
<div class="method-definition">
104
<span class="method-result">mixed</span>
105
<a href="#singleton" title="details" class="method-name">&singleton</a>
106
([<span class="var-type">mixed</span> <span class="var-name">$dsn</span> = <span class="var-default">NULL</span>], [<span class="var-type">mixed</span> <span class="var-name">$options</span> = <span class="var-default">FALSE</span>])
113
<a name="sec-methods"></a>
114
<div class="info-box">
115
<div class="info-box-title">Methods</div>
116
<div class="nav-bar">
117
<a href="#sec-description">Description</a> |
118
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
121
<div class="info-box-body">
122
<A NAME='method_detail'></A>
124
<a name="methodapiVersion" id="apiVersion"><!-- --></a>
127
<div class="method-header">
128
<span class="method-title">apiVersion</span> (line <span class="line-number">426</span>)
131
<!-- ========== Info from phpDoc block ========= -->
132
<p class="short-description">Return the MDB API version</p>
134
<li><span class="field">return:</span> the MDB API version number</li>
135
<li><span class="field">access:</span> public</li>
138
<div class="method-signature">
139
<span class="method-result">int</span>
140
<span class="method-name">
149
<a name="methodconnect" id="connect"><!-- --></a>
150
<div class="evenrow">
152
<div class="method-header">
153
<span class="method-title">connect</span> (line <span class="line-number">289</span>)
156
<!-- ========== Info from phpDoc block ========= -->
157
<p class="short-description">Create a new MDB connection object and connect to the specified database</p>
158
<p class="description"><p>IMPORTANT: In order for MDB to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk).</p><p>For example: $mdb =& MDB::connect($dsn); ^^ And not: $mdb = MDB::connect($dsn); ^^</p></p>
160
<li><span class="field">return:</span> a newly created MDB connection object, or a MDB error object on error</li>
161
<li><span class="field">see:</span> MDB::parseDSN</li>
162
<li><span class="field">access:</span> public</li>
165
<div class="method-signature">
166
<span class="method-result">mixed</span>
167
<span class="method-name">
170
(<span class="var-type">mixed</span> <span class="var-name">$dsn</span>, [<span class="var-type">mixed</span> <span class="var-name">$options</span> = <span class="var-default">FALSE</span>])
173
<ul class="parameters">
175
<span class="var-type">mixed</span>
176
<span class="var-name">$dsn</span><span class="var-description">: 'data source name', see the MDB::parseDSN method for a description of the dsn format. Can also be specified as an array of the format returned by MDB::parseDSN.</span> </li>
178
<span class="var-type">mixed</span>
179
<span class="var-name">$options</span><span class="var-description">: An associative array of option names and their values.</span> </li>
184
<a name="methoderrorMessage" id="errorMessage"><!-- --></a>
187
<div class="method-header">
188
<span class="method-title">errorMessage</span> (line <span class="line-number">495</span>)
191
<!-- ========== Info from phpDoc block ========= -->
192
<p class="short-description">Return a textual error message for a MDB error code</p>
194
<li><span class="field">return:</span> error message, or false if the error code was not recognized</li>
195
<li><span class="field">access:</span> public</li>
198
<div class="method-signature">
199
<span class="method-result">string</span>
200
<span class="method-name">
203
(<span class="var-type">int</span> <span class="var-name">$value</span>)
206
<ul class="parameters">
208
<span class="var-type">int</span>
209
<span class="var-name">$value</span><span class="var-description">: error code</span> </li>
214
<a name="methodfactory" id="factory"><!-- --></a>
215
<div class="evenrow">
217
<div class="method-header">
218
<span class="method-title">factory</span> (line <span class="line-number">249</span>)
221
<!-- ========== Info from phpDoc block ========= -->
222
<p class="short-description">Create a new DB connection object for the specified database</p>
223
<p class="description"><p>type IMPORTANT: In order for MDB to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk).</p><p>For example: $mdb =& MDB::factory($dsn); ^^ And not: $mdb = MDB::factory($dsn); ^^</p></p>
225
<li><span class="field">return:</span> a newly created MDB connection object, or a MDB error object on error</li>
226
<li><span class="field">access:</span> public</li>
229
<div class="method-signature">
230
<span class="method-result">mixed</span>
231
<span class="method-name">
234
(<span class="var-type">string</span> <span class="var-name">$type</span>)
237
<ul class="parameters">
239
<span class="var-type">string</span>
240
<span class="var-name">$type</span><span class="var-description">: database type, for example 'mysql'</span> </li>
245
<a name="methodisConnection" id="isConnection"><!-- --></a>
248
<div class="method-header">
249
<span class="method-title">isConnection</span> (line <span class="line-number">457</span>)
252
<!-- ========== Info from phpDoc block ========= -->
253
<p class="short-description">Tell whether a value is a MDB connection</p>
255
<li><span class="field">return:</span> whether $value is a MDB connection</li>
256
<li><span class="field">access:</span> public</li>
259
<div class="method-signature">
260
<span class="method-result">bool</span>
261
<span class="method-name">
264
(<span class="var-type">mixed</span> <span class="var-name">$value</span>)
267
<ul class="parameters">
269
<span class="var-type">mixed</span>
270
<span class="var-name">$value</span><span class="var-description">: value to test</span> </li>
275
<a name="methodisError" id="isError"><!-- --></a>
276
<div class="evenrow">
278
<div class="method-header">
279
<span class="method-title">isError</span> (line <span class="line-number">441</span>)
282
<!-- ========== Info from phpDoc block ========= -->
283
<p class="short-description">Tell whether a result code from a MDB method is an error</p>
285
<li><span class="field">return:</span> whether $value is an MDB_Error</li>
286
<li><span class="field">access:</span> public</li>
289
<div class="method-signature">
290
<span class="method-result">boolean</span>
291
<span class="method-name">
294
(<span class="var-type">int</span> <span class="var-name">$value</span>)
297
<ul class="parameters">
299
<span class="var-type">int</span>
300
<span class="var-name">$value</span><span class="var-description">: result code</span> </li>
305
<a name="methodisManip" id="isManip"><!-- --></a>
308
<div class="method-header">
309
<span class="method-title">isManip</span> (line <span class="line-number">474</span>)
312
<!-- ========== Info from phpDoc block ========= -->
313
<p class="short-description">Tell whether a query is a data manipulation query (insert, update or delete) or a data definition query (create, drop, alter, grant, revoke).</p>
315
<li><span class="field">return:</span> whether $query is a data manipulation query</li>
316
<li><span class="field">access:</span> public</li>
319
<div class="method-signature">
320
<span class="method-result">boolean</span>
321
<span class="method-name">
324
(<span class="var-type">string</span> <span class="var-name">$query</span>)
327
<ul class="parameters">
329
<span class="var-type">string</span>
330
<span class="var-name">$query</span><span class="var-description">: the query</span> </li>
335
<a name="methodloadFile" id="loadFile"><!-- --></a>
336
<div class="evenrow">
338
<div class="method-header">
339
<span class="method-title">loadFile</span> (line <span class="line-number">412</span>)
342
<!-- ========== Info from phpDoc block ========= -->
343
<p class="short-description">load a file (like 'Date.php' or 'Manager.php')</p>
345
<li><span class="field">return:</span> name of the file to be included from the MDB dir without the '.php' extension (like 'Date' or 'Manager')</li>
346
<li><span class="field">access:</span> public</li>
349
<div class="method-signature">
350
<span class="method-result">$file</span>
351
<span class="method-name">
354
(<span class="var-type"></span> <span class="var-name">$file</span>)
357
<ul class="parameters">
359
<span class="var-type"></span>
360
<span class="var-name">$file</span> </li>
365
<a name="methodparseDSN" id="parseDSN"><!-- --></a>
368
<div class="method-header">
369
<span class="method-title">parseDSN</span> (line <span class="line-number">581</span>)
372
<!-- ========== Info from phpDoc block ========= -->
373
<p class="short-description">Parse a data source name</p>
374
<p class="description"><p>A array with the following keys will be returned: phptype: Database backend used in PHP (mysql, odbc etc.) dbsyntax: Database used with regards to SQL syntax etc. protocol: Communication protocol to use (tcp, unix etc.) hostspec: Host specification (hostname[:port]) database: Database to use on the DBMS server username: User name for login password: Password for login</p><p>The format of the supplied DSN is in its fullest form:</p><p>phptype(dbsyntax)://username:password@protocol+hostspec/database</p><p>Most variations are allowed:</p><p>phptype://username:password@protocol+hostspec:110//usr/db_file.db phptype://username:password@hostspec/database_name phptype://username:password@hostspec phptype://username@hostspec phptype://hostspec/database phptype://hostspec phptype(dbsyntax) phptype</p></p>
376
<li><span class="field">return:</span> an associative array</li>
377
<li><span class="field">author:</span> Tomas V.V.Cox <<a href="mailto:cox@idecnet.com">cox@idecnet.com</a>></li>
378
<li><span class="field">access:</span> public</li>
381
<div class="method-signature">
382
<span class="method-result">array</span>
383
<span class="method-name">
386
(<span class="var-type">string</span> <span class="var-name">$dsn</span>)
389
<ul class="parameters">
391
<span class="var-type">string</span>
392
<span class="var-name">$dsn</span><span class="var-description">: Data Source Name to be parsed</span> </li>
397
<a name="methodsetOptions" id="setOptions"><!-- --></a>
398
<div class="evenrow">
400
<div class="method-header">
401
<span class="method-title">setOptions</span> (line <span class="line-number">201</span>)
404
<!-- ========== Info from phpDoc block ========= -->
405
<p class="short-description">set option array in an exiting database object</p>
407
<li><span class="field">access:</span> public</li>
410
<div class="method-signature">
411
<span class="method-result">void</span>
412
<span class="method-name">
415
(<span class="var-type"></span> <span class="var-name">&$db</span>, <span class="var-type">mixed</span> <span class="var-name">$options</span>, <span class="var-type">object</span> <span class="var-name">$db</span>)
418
<ul class="parameters">
420
<span class="var-type">object</span>
421
<span class="var-name">$db</span><span class="var-description">: MDB object</span> </li>
423
<span class="var-type">mixed</span>
424
<span class="var-name">$options</span><span class="var-description">: An associative array of option names and their values.</span> </li>
426
<span class="var-type"></span>
427
<span class="var-name">&$db</span> </li>
432
<a name="methodsingleton" id="singleton"><!-- --></a>
435
<div class="method-header">
436
<span class="method-title">singleton</span> (line <span class="line-number">365</span>)
439
<!-- ========== Info from phpDoc block ========= -->
440
<p class="short-description">Returns a MDB connection with the requested DSN.</p>
441
<p class="description"><p>A newnew MDB connection object is only created if no object with the reuested DSN exists yet.</p><p>IMPORTANT: In order for MDB to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk).</p><p>For example: $mdb =& MDB::sngleton($dsn); ^^ And not: $mdb = MDB::singleton($dsn); ^^</p></p>
443
<li><span class="field">return:</span> a newly created MDB connection object, or a MDB error object on error</li>
444
<li><span class="field">see:</span> MDB::parseDSN</li>
445
<li><span class="field">access:</span> public</li>
448
<div class="method-signature">
449
<span class="method-result">mixed</span>
450
<span class="method-name">
453
([<span class="var-type">mixed</span> <span class="var-name">$dsn</span> = <span class="var-default">NULL</span>], [<span class="var-type">mixed</span> <span class="var-name">$options</span> = <span class="var-default">FALSE</span>])
456
<ul class="parameters">
458
<span class="var-type">mixed</span>
459
<span class="var-name">$dsn</span><span class="var-description">: 'data source name', see the MDB::parseDSN method for a description of the dsn format. Can also be specified as an array of the format returned by MDB::parseDSN.</span> </li>
461
<span class="var-type">mixed</span>
462
<span class="var-name">$options</span><span class="var-description">: An associative array of option names and their values.</span> </li>
472
<p class="notes" id="credit">
473
Documentation generated on Sun, 22 Jun 2008 00:40:50 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
b'\\ No newline at end of file'