Index: trunk/extensions/Offline/DatabaseBz2.php |
— | — | @@ -24,9 +24,9 @@ |
25 | 25 | * http://www.gnu.org/copyleft/gpl.html |
26 | 26 | **/ |
27 | 27 | |
28 | | -class DatabaseBz2 extends Database |
| 28 | +class DatabaseBz2 extends DatabaseBase |
29 | 29 | { |
30 | | - function select( $table, $fields, $conds='', $fname = 'Database::select', $options = array() ) |
| 30 | + function select( $table, $fields, $conds='', $fname = 'DatabaseBase::select', $options = array() ) |
31 | 31 | { |
32 | 32 | $row = array(); |
33 | 33 | $title = false; |
— | — | @@ -79,167 +79,11 @@ |
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | | -////////////////////////////////////////////////BOILERPLATE FOLLOWS |
84 | | - |
85 | | - |
86 | | -#------------------------------------------------------------------------------ |
87 | | -# Accessors |
88 | | -#------------------------------------------------------------------------------ |
89 | | - function failFunction( $function = NULL ) { |
90 | | - return null; |
91 | | - } |
92 | | - |
93 | | - function setOutputPage( $out ) { |
94 | | - return null; |
95 | | - } |
96 | | - |
97 | | - function debug( $debug = NULL ) { |
98 | | - return null; |
99 | | - } |
100 | | - |
101 | | - function bufferResults( $buffer = NULL ) { |
102 | | - return null; |
103 | | - } |
104 | | - |
105 | | - function ignoreErrors( $ignoreErrors = NULL ) { |
106 | | - return true; |
107 | | - } |
108 | | - |
109 | | - function trxLevel( $level = NULL ) { |
110 | | - return 0; |
111 | | - } |
112 | | - |
113 | | - function errorCount( $count = NULL ) { |
114 | | - return 0; |
115 | | - } |
116 | | - |
117 | | - function getLBInfo( $name = NULL ) { |
118 | | - return true; |
119 | | - } |
120 | | - |
121 | | - function setLBInfo( $name, $value = NULL ) { |
122 | | - return true; |
123 | | - } |
124 | | - |
125 | | - function cascadingDeletes() { |
126 | | - return false; |
127 | | - } |
128 | | - |
129 | | - function cleanupTriggers() { |
130 | | - return false; |
131 | | - } |
132 | | - |
133 | | - function strictIPs() { |
134 | | - return false; |
135 | | - } |
136 | | - |
137 | | - function realTimestamps() { |
138 | | - return false; |
139 | | - } |
140 | | - |
141 | | - function implicitGroupby() { |
142 | | - return true; |
143 | | - } |
144 | | - |
145 | | - function implicitOrderby() { |
146 | | - return true; |
147 | | - } |
148 | | - |
149 | | - function searchableIPs() { |
150 | | - return false; |
151 | | - } |
152 | | - |
153 | | - function functionalIndexes() { |
154 | | - return false; |
155 | | - } |
156 | | - |
157 | | - function lastQuery() { |
158 | | - return true; |
159 | | - } |
160 | | - function isOpen() { |
161 | | - return true; |
162 | | - } |
163 | | - |
164 | | - function setFlag( $flag ) { |
165 | | - return true; |
166 | | - } |
167 | | - |
168 | | - function clearFlag( $flag ) { |
169 | | - return true; |
170 | | - } |
171 | | - |
172 | | - function getFlag( $flag ) { |
173 | | - return true; |
174 | | - } |
175 | | - |
176 | | - function getProperty( $name ) { |
177 | | - return true; |
178 | | - } |
179 | | - |
180 | | - |
181 | | - function __construct( $server = false, $user = false, $password = false, $dbName = false, |
182 | | - $failFunction = false, $flags = 0, $tablePrefix = 'get from global' ) { |
183 | | - null; |
184 | | - } |
185 | | - |
186 | | - static function newFromParams( $server, $user, $password, $dbName, $failFunction = false, $flags = 0 ) { |
187 | | - return new Database( $server, $user, $password, $dbName, $failFunction, $flags ); |
188 | | - } |
189 | | - |
190 | 83 | function open( $server, $user, $password, $dbName ) { |
191 | 84 | //TODO test article load using TestDumpReader |
192 | 85 | return true; |
193 | 86 | } |
194 | 87 | |
195 | | - function close() { |
196 | | - return true; |
197 | | - } |
198 | | - |
199 | | - function reportConnectionError( $error = 'Unknown error' ) { |
200 | | - return null; |
201 | | - } |
202 | | - |
203 | | - public function query( $sql, $fname = '', $tempIgnore = false ) { |
204 | | - return null; |
205 | | - } |
206 | | - |
207 | | - function doQuery( $sql ) { |
208 | | - return true; |
209 | | - } |
210 | | - |
211 | | - function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) { |
212 | | - return null; |
213 | | - } |
214 | | - |
215 | | - |
216 | | - function prepare( $sql, $func = 'Database::prepare' ) { |
217 | | - return null; |
218 | | - } |
219 | | - |
220 | | - function freePrepared( $prepared ) { |
221 | | - return null; |
222 | | - } |
223 | | - |
224 | | - function execute( $prepared, $args = null ) { |
225 | | - return true; |
226 | | - } |
227 | | - |
228 | | - function safeQuery( $query, $args = null ) { |
229 | | - return true; |
230 | | - } |
231 | | - |
232 | | - function fillPrepared( $preparedQuery, $args ) { |
233 | | - return true; |
234 | | - } |
235 | | - |
236 | | - function fillPreparedArg( $matches ) { |
237 | | - return true; |
238 | | - } |
239 | | - |
240 | | - function freeResult( $res ) { |
241 | | - return null; |
242 | | - } |
243 | | - |
244 | 88 | function fetchObject( $res ) { |
245 | 89 | // cast to object |
246 | 90 | if (!$res) |
— | — | @@ -299,255 +143,30 @@ |
300 | 144 | return 0; |
301 | 145 | } |
302 | 146 | |
303 | | - function set( $table, $var, $value, $cond, $fname = 'Database::set' ) { |
304 | | - return null; |
305 | | - } |
306 | | - |
| 147 | +/* |
307 | 148 | function selectField( $table, $var, $cond='', $fname = 'Database::selectField', $options = array() ) { |
308 | 149 | return $this->fetchObject($this->select($table, array($var), $cond)); |
309 | 150 | } |
| 151 | +*/ |
310 | 152 | |
311 | | - function makeSelectOptions( $options ) { |
312 | | - return null; |
313 | | - } |
314 | | - |
315 | | - function selectRow( $table, $vars, $conds, $fname = 'Database::selectRow', $options = array() ) { |
316 | | - return $this->fetchObject($this->select($table, $vars, $conds)); |
317 | | - } |
318 | | - |
319 | | - function estimateRowCount( $table, $vars='*', $conds='', $fname = 'Database::estimateRowCount', $options = array() ) { |
320 | | - return 0; |
321 | | - } |
322 | | - |
323 | | - |
324 | | - static function generalizeSQL( $sql ) { |
325 | | - return null; |
326 | | - } |
327 | | - |
328 | | - function fieldExists( $table, $field, $fname = 'Database::fieldExists' ) { |
329 | | - return null; |
330 | | - } |
331 | | - |
332 | | - function indexExists( $table, $index, $fname = 'Database::indexExists' ) { |
333 | | - return null; |
334 | | - } |
335 | | - |
336 | | - |
337 | 153 | function indexInfo( $table, $index, $fname = 'Database::indexInfo' ) { |
338 | 154 | return null; |
339 | 155 | } |
340 | 156 | |
341 | | - function tableExists( $table ) { |
342 | | - return null; |
343 | | - } |
344 | | - |
345 | 157 | function fieldInfo( $table, $field ) { |
346 | 158 | return null; |
347 | 159 | } |
348 | 160 | |
349 | | - function fieldType( $res, $index ) { |
350 | | - return null; |
351 | | - } |
352 | | - |
353 | | - function indexUnique( $table, $index ) { |
354 | | - return null; |
355 | | - } |
356 | | - |
357 | | - function insert( $table, $a, $fname = 'Database::insert', $options = array() ) { |
358 | | - return null; |
359 | | - } |
360 | | - |
361 | | - function makeUpdateOptions( $options ) { |
362 | | - return null; |
363 | | - } |
364 | | - |
365 | | - function update( $table, $values, $conds, $fname = 'Database::update', $options = array() ) { |
366 | | - return null; |
367 | | - } |
368 | | - |
369 | | - function makeList( $a, $mode = LIST_COMMA ) { |
370 | | - return null; |
371 | | - } |
372 | | - |
373 | | - function selectDB( $db ) { |
374 | | - return null; |
375 | | - } |
376 | | - |
377 | | - function tableName( $name ) { |
378 | | - return null; |
379 | | - } |
380 | | - |
381 | | - public function tableNames() { |
382 | | - return null; |
383 | | - } |
384 | | - |
385 | | - public function tableNamesN() { |
386 | | - return null; |
387 | | - } |
388 | | - |
389 | | - function tableNamesWithUseIndex( $tables, $use_index ) { |
390 | | - return null; |
391 | | - } |
392 | | - |
393 | 161 | function strencode( $s ) { |
394 | 162 | return true; |
395 | 163 | } |
396 | 164 | |
397 | | - function addQuotes( $s ) { |
398 | | - return true; |
399 | | - } |
400 | | - |
401 | | - function escapeLike( $s ) { |
402 | | - return true; |
403 | | - } |
404 | | - |
405 | | - function nextSequenceValue( $seqName ) { |
406 | | - return null; |
407 | | - } |
408 | | - |
409 | | - function useIndexClause( $index ) { |
410 | | - return true; |
411 | | - } |
412 | | - |
413 | | - function replace( $table, $uniqueIndexes, $rows, $fname = 'Database::replace' ) { |
414 | | - return null; |
415 | | - } |
416 | | - |
417 | | - function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = 'Database::deleteJoin' ) { |
418 | | - return null; |
419 | | - } |
420 | | - |
421 | | - function textFieldSize( $table, $field ) { |
422 | | - return null; |
423 | | - } |
424 | | - |
425 | | - function lowPriorityOption() { |
426 | | - } |
427 | | - |
428 | | - function delete( $table, $conds, $fname = 'Database::delete' ) { |
429 | | - return true; |
430 | | - } |
431 | | - |
432 | | - function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'Database::insertSelect', |
433 | | - $insertOptions = array(), $selectOptions = array() ) |
434 | | - { |
435 | | - return null; |
436 | | - } |
437 | | - |
438 | | - function limitResult($sql, $limit, $offset=false) { |
439 | | - return null; |
440 | | - } |
441 | | - |
442 | | - function limitResultForUpdate($sql, $num) { |
443 | | - return null; |
444 | | - } |
445 | | - |
446 | | - function conditional( $cond, $trueVal, $falseVal ) { |
447 | | - return null; |
448 | | - } |
449 | | - |
450 | | - function wasDeadlock() { |
451 | | - return null; |
452 | | - } |
453 | | - |
454 | | - function deadlockLoop() { |
455 | | - return null; |
456 | | - } |
457 | | - |
458 | | - function masterPosWait( $file, $pos, $timeout ) { |
459 | | - return null; |
460 | | - } |
461 | | - |
462 | | - function getSlavePos() { |
463 | | - return null; |
464 | | - } |
465 | | - |
466 | | - function getMasterPos() { |
467 | | - return null; |
468 | | - } |
469 | | - |
470 | | - function begin( $fname = 'Database::begin' ) { |
471 | | - } |
472 | | - |
473 | | - function commit( $fname = 'Database::commit' ) { |
474 | | - } |
475 | | - |
476 | | - function rollback( $fname = 'Database::rollback' ) { |
477 | | - } |
478 | | - |
479 | | - function immediateBegin( $fname = 'Database::immediateBegin' ) { |
480 | | - } |
481 | | - |
482 | | - function immediateCommit( $fname = 'Database::immediateCommit' ) { |
483 | | - } |
484 | | - |
485 | | - function timestamp( $ts=0 ) { |
486 | | - } |
487 | | - |
488 | | - function timestampOrNull( $ts = null ) { |
489 | | - } |
490 | | - |
491 | | - function resultObject( $result ) { |
492 | | - return new ResultWrapper($this, $result); |
493 | | - } |
494 | | - |
495 | | - function aggregateValue ($valuedata,$valuename='value') { |
496 | | - } |
497 | | - |
498 | 165 | static function getSoftwareLink() { |
499 | | - return "[http://www.mysql.com/ MySQL]"; |
| 166 | + return "[http://www.mysql.com/ MySQL]"; //XXX |
500 | 167 | } |
501 | 168 | |
502 | 169 | function getServerVersion() { |
| 170 | + //XXX |
503 | 171 | } |
504 | 172 | |
505 | | - function ping() { |
506 | | - return true; |
507 | | - } |
508 | | - |
509 | | - function getLag() { |
510 | | - return 0; |
511 | | - } |
512 | | - |
513 | | - function getStatus($which="%") { |
514 | | - return true; |
515 | | - } |
516 | | - |
517 | | - function maxListLen() { |
518 | | - return 0; |
519 | | - } |
520 | | - |
521 | | - function encodeBlob($b) { |
522 | | - return $b; |
523 | | - } |
524 | | - |
525 | | - function decodeBlob($b) { |
526 | | - return $b; |
527 | | - } |
528 | | - |
529 | | - public function setTimeout( $timeout ) { |
530 | | - } |
531 | | - |
532 | | - function sourceFile( $filename, $lineCallback = false, $resultCallback = false ) { |
533 | | - return null; |
534 | | - } |
535 | | - |
536 | | - function sourceStream( $fp, $lineCallback = false, $resultCallback = false ) { |
537 | | - return true; |
538 | | - } |
539 | | - |
540 | | - |
541 | | - protected function replaceVars( $ins ) { |
542 | | - return true; |
543 | | - } |
544 | | - |
545 | | - protected function tableNameCallback( $matches ) { |
546 | | - } |
547 | | - |
548 | | - /* |
549 | | - * Build a concatenation list to feed into a SQL query |
550 | | - */ |
551 | | - function buildConcat( $stringList ) { |
552 | | - return true; |
553 | | - } |
554 | 173 | } |