Changeset 18609 for tmp/version-2_5-test/data/module/DB/dbase.php
- Timestamp:
- 2010/03/11 10:35:11 (16 years ago)
- File:
-
- 1 edited
-
tmp/version-2_5-test/data/module/DB/dbase.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tmp/version-2_5-test/data/module/DB/dbase.php
r15532 r18609 19 19 * @author Tomas V.V. Cox <[email protected]> 20 20 * @author Daniel Convissor <[email protected]> 21 * @copyright 1997-200 5The PHP Group21 * @copyright 1997-2007 The PHP Group 22 22 * @license http://www.php.net/license/3_0.txt PHP License 3.0 23 23 * @version CVS: $Id$ … … 40 40 * @author Tomas V.V. Cox <[email protected]> 41 41 * @author Daniel Convissor <[email protected]> 42 * @copyright 1997-200 5The PHP Group42 * @copyright 1997-2007 The PHP Group 43 43 * @license http://www.php.net/license/3_0.txt PHP License 3.0 44 * @version Release: @package_version@44 * @version Release: 1.7.14RC1 45 45 * @link http://pear.php.net/package/DB 46 46 */ … … 189 189 * ); 190 190 * 191 * $db = &DB::connect($dsn, $options);191 * $db = DB::connect($dsn, $options); 192 192 * if (PEAR::isError($db)) { 193 193 * die($db->getMessage()); … … 215 215 * is the only way to find errors from the dbase extension. 216 216 */ 217 ini_set('track_errors', 1);217 @ini_set('track_errors', 1); 218 218 $php_errormsg = ''; 219 219 … … 274 274 // emulate result resources 275 275 $this->res_row[(int)$this->result] = 0; 276 $tmp = &new DB_result($this, $this->result++);276 $tmp = new DB_result($this, $this->result++); 277 277 return $tmp; 278 278 } … … 327 327 328 328 // }}} 329 // {{{ freeResult() 330 331 /** 332 * Deletes the result set and frees the memory occupied by the result set. 333 * 334 * This method is a no-op for dbase, as there aren't result resources in 335 * the same sense as most other database backends. 336 * 337 * @param resource $result PHP's query result resource 338 * 339 * @return bool TRUE on success, FALSE if $result is invalid 340 * 341 * @see DB_result::free() 342 */ 343 function freeResult($result) 344 { 345 return true; 346 } 347 348 // }}} 329 349 // {{{ numCols() 330 350 … … 369 389 370 390 // }}} 371 // {{{ quoteSmart() 372 373 /** 374 * Formats input so it can be safely used in a query 375 * 376 * @param mixed $in the data to be formatted 377 * 378 * @return mixed the formatted data. The format depends on the input's 379 * PHP type: 380 * + null = the string <samp>NULL</samp> 381 * + boolean = <samp>T</samp> if true or 382 * <samp>F</samp> if false. Use the <kbd>Logical</kbd> 383 * data type. 384 * + integer or double = the unquoted number 385 * + other (including strings and numeric strings) = 386 * the data with single quotes escaped by preceeding 387 * single quotes then the whole string is encapsulated 388 * between single quotes 389 * 391 // {{{ quoteBoolean() 392 393 /** 394 * Formats a boolean value for use within a query in a locale-independent 395 * manner. 396 * 397 * @param boolean the boolean value to be quoted. 398 * @return string the quoted string. 390 399 * @see DB_common::quoteSmart() 391 * @since Method available since Release 1.6.0 392 */ 393 function quoteSmart($in) 394 { 395 if (is_int($in) || is_double($in)) { 396 return $in; 397 } elseif (is_bool($in)) { 398 return $in ? 'T' : 'F'; 399 } elseif (is_null($in)) { 400 return 'NULL'; 401 } else { 402 return "'" . $this->escapeSimple($in) . "'"; 403 } 404 } 405 400 * @since Method available since release 1.7.8. 401 */ 402 function quoteBoolean($boolean) { 403 return $boolean ? 'T' : 'F'; 404 } 405 406 406 // }}} 407 407 // {{{ tableInfo()
Note: See TracChangeset
for help on using the changeset viewer.
