PageRenderTime 48ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/libraries/joomla/database/database.php

https://bitbucket.org/asosso/joomla15
PHP | 1090 lines | 768 code | 67 blank | 255 comment | 31 complexity | acd3b33ace26d50a3255296797f1fc62 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. <?php
  2. /**
  3. * @version $Id: database.php 14401 2010-01-26 14:10:00Z louis $
  4. * @package Joomla.Framework
  5. * @subpackage Database
  6. * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
  7. * @license GNU/GPL, see LICENSE.php
  8. * Joomla! is free software. This version may have been modified pursuant
  9. * to the GNU General Public License, and as distributed it includes or
  10. * is derivative of works licensed under the GNU General Public License or
  11. * other free or open source software licenses.
  12. * See COPYRIGHT.php for copyright notices and details.
  13. */
  14. // Check to ensure this file is within the rest of the framework
  15. defined('JPATH_BASE') or die();
  16. /**
  17. * Database connector class
  18. *
  19. * @abstract
  20. * @package Joomla.Framework
  21. * @subpackage Database
  22. * @since 1.0
  23. */
  24. class JDatabase extends JObject
  25. {
  26. /**
  27. * The database driver name
  28. *
  29. * @var string
  30. */
  31. var $name = '';
  32. /**
  33. * The query sql string
  34. *
  35. * @var string
  36. **/
  37. var $_sql = '';
  38. /**
  39. * The database error number
  40. *
  41. * @var int
  42. **/
  43. var $_errorNum = 0;
  44. /**
  45. * The database error message
  46. *
  47. * @var string
  48. */
  49. var $_errorMsg = '';
  50. /**
  51. * The prefix used on all database tables
  52. *
  53. * @var string
  54. */
  55. var $_table_prefix = '';
  56. /**
  57. * The connector resource
  58. *
  59. * @var resource
  60. */
  61. var $_resource = '';
  62. /**
  63. * The last query cursor
  64. *
  65. * @var resource
  66. */
  67. var $_cursor = null;
  68. /**
  69. * Debug option
  70. *
  71. * @var boolean
  72. */
  73. var $_debug = 0;
  74. /**
  75. * The limit for the query
  76. *
  77. * @var int
  78. */
  79. var $_limit = 0;
  80. /**
  81. * The for offset for the limit
  82. *
  83. * @var int
  84. */
  85. var $_offset = 0;
  86. /**
  87. * The number of queries performed by the object instance
  88. *
  89. * @var int
  90. */
  91. var $_ticker = 0;
  92. /**
  93. * A log of queries
  94. *
  95. * @var array
  96. */
  97. var $_log = null;
  98. /**
  99. * The null/zero date string
  100. *
  101. * @var string
  102. */
  103. var $_nullDate = null;
  104. /**
  105. * Quote for named objects
  106. *
  107. * @var string
  108. */
  109. var $_nameQuote = null;
  110. /**
  111. * UTF-8 support
  112. *
  113. * @var boolean
  114. * @since 1.5
  115. */
  116. var $_utf = 0;
  117. /**
  118. * The fields that are to be quote
  119. *
  120. * @var array
  121. * @since 1.5
  122. */
  123. var $_quoted = null;
  124. /**
  125. * Legacy compatibility
  126. *
  127. * @var bool
  128. * @since 1.5
  129. */
  130. var $_hasQuoted = null;
  131. /**
  132. * Database object constructor
  133. *
  134. * @access public
  135. * @param array List of options used to configure the connection
  136. * @since 1.5
  137. */
  138. function __construct( $options )
  139. {
  140. $prefix = array_key_exists('prefix', $options) ? $options['prefix'] : 'jos_';
  141. // Determine utf-8 support
  142. $this->_utf = $this->hasUTF();
  143. //Set charactersets (needed for MySQL 4.1.2+)
  144. if ($this->_utf){
  145. $this->setUTF();
  146. }
  147. $this->_table_prefix = $prefix;
  148. $this->_ticker = 0;
  149. $this->_errorNum = 0;
  150. $this->_log = array();
  151. $this->_quoted = array();
  152. $this->_hasQuoted = false;
  153. // Register faked "destructor" in PHP4 to close all connections we might have made
  154. if (version_compare(PHP_VERSION, '5') == -1) {
  155. register_shutdown_function(array(&$this, '__destruct'));
  156. }
  157. }
  158. /**
  159. * Returns a reference to the global Database object, only creating it
  160. * if it doesn't already exist.
  161. *
  162. * The 'driver' entry in the parameters array specifies the database driver
  163. * to be used (defaults to 'mysql' if omitted). All other parameters are
  164. * database driver dependent.
  165. *
  166. * @param array Parameters to be passed to the database driver
  167. * @return JDatabase A database object
  168. * @since 1.5
  169. */
  170. function &getInstance( $options = array() )
  171. {
  172. static $instances;
  173. if (!isset( $instances )) {
  174. $instances = array();
  175. }
  176. $signature = serialize( $options );
  177. if (empty($instances[$signature]))
  178. {
  179. $driver = array_key_exists('driver', $options) ? $options['driver'] : 'mysql';
  180. $select = array_key_exists('select', $options) ? $options['select'] : true;
  181. $database = array_key_exists('database', $options) ? $options['database'] : null;
  182. $driver = preg_replace('/[^A-Z0-9_\.-]/i', '', $driver);
  183. $path = dirname(__FILE__).DS.'database'.DS.$driver.'.php';
  184. if (file_exists($path)) {
  185. require_once($path);
  186. } else {
  187. JError::setErrorHandling(E_ERROR, 'die'); //force error type to die
  188. $error = JError::raiseError( 500, JTEXT::_('Unable to load Database Driver:') .$driver);
  189. return $error;
  190. }
  191. $adapter = 'JDatabase'.$driver;
  192. $instance = new $adapter($options);
  193. if ( $error = $instance->getErrorMsg() )
  194. {
  195. JError::setErrorHandling(E_ERROR, 'ignore'); //force error type to die
  196. $error = JError::raiseError( 500, JTEXT::_('Unable to connect to the database:') .$error);
  197. return $error;
  198. }
  199. $instances[$signature] = & $instance;
  200. }
  201. return $instances[$signature];
  202. }
  203. /**
  204. * Database object destructor
  205. *
  206. * @abstract
  207. * @access private
  208. * @return boolean
  209. * @since 1.5
  210. */
  211. function __destruct()
  212. {
  213. return true;
  214. }
  215. /**
  216. * Get the database connectors
  217. *
  218. * @access public
  219. * @return array An array of available session handlers
  220. */
  221. function getConnectors()
  222. {
  223. jimport('joomla.filesystem.folder');
  224. $handlers = JFolder::files(dirname(__FILE__).DS.'database', '.php$');
  225. $names = array();
  226. foreach($handlers as $handler)
  227. {
  228. $name = substr($handler, 0, strrpos($handler, '.'));
  229. $class = 'JDatabase'.ucfirst($name);
  230. if(!class_exists($class)) {
  231. require_once(dirname(__FILE__).DS.'database'.DS.$name.'.php');
  232. }
  233. if(call_user_func_array( array( trim($class), 'test' ), null)) {
  234. $names[] = $name;
  235. }
  236. }
  237. return $names;
  238. }
  239. /**
  240. * Test to see if the MySQLi connector is available
  241. *
  242. * @static
  243. * @access public
  244. * @return boolean True on success, false otherwise.
  245. */
  246. function test()
  247. {
  248. return false;
  249. }
  250. /**
  251. * Determines if the connection to the server is active.
  252. *
  253. * @access public
  254. * @return boolean
  255. * @since 1.5
  256. */
  257. function connected()
  258. {
  259. return false;
  260. }
  261. /**
  262. * Determines UTF support
  263. *
  264. * @abstract
  265. * @access public
  266. * @return boolean
  267. * @since 1.5
  268. */
  269. function hasUTF() {
  270. return false;
  271. }
  272. /**
  273. * Custom settings for UTF support
  274. *
  275. * @abstract
  276. * @access public
  277. * @since 1.5
  278. */
  279. function setUTF() {
  280. }
  281. /**
  282. * Adds a field or array of field names to the list that are to be quoted
  283. *
  284. * @access public
  285. * @param mixed Field name or array of names
  286. * @since 1.5
  287. */
  288. function addQuoted( $quoted )
  289. {
  290. if (is_string( $quoted )) {
  291. $this->_quoted[] = $quoted;
  292. } else {
  293. $this->_quoted = array_merge( $this->_quoted, (array)$quoted );
  294. }
  295. $this->_hasQuoted = true;
  296. }
  297. /**
  298. * Splits a string of queries into an array of individual queries
  299. *
  300. * @access public
  301. * @param string The queries to split
  302. * @return array queries
  303. */
  304. function splitSql( $queries )
  305. {
  306. $start = 0;
  307. $open = false;
  308. $open_char = '';
  309. $end = strlen($queries);
  310. $query_split = array();
  311. for($i=0;$i<$end;$i++) {
  312. $current = substr($queries,$i,1);
  313. if(($current == '"' || $current == '\'')) {
  314. $n = 2;
  315. while(substr($queries,$i - $n + 1, 1) == '\\' && $n < $i) {
  316. $n ++;
  317. }
  318. if($n%2==0) {
  319. if ($open) {
  320. if($current == $open_char) {
  321. $open = false;
  322. $open_char = '';
  323. }
  324. } else {
  325. $open = true;
  326. $open_char = $current;
  327. }
  328. }
  329. }
  330. if(($current == ';' && !$open)|| $i == $end - 1) {
  331. $query_split[] = substr($queries, $start, ($i - $start + 1));
  332. $start = $i + 1;
  333. }
  334. }
  335. return $query_split;
  336. }
  337. /**
  338. * Checks if field name needs to be quoted
  339. *
  340. * @access public
  341. * @param string The field name
  342. * @return bool
  343. */
  344. function isQuoted( $fieldName )
  345. {
  346. if ($this->_hasQuoted) {
  347. return in_array( $fieldName, $this->_quoted );
  348. } else {
  349. return true;
  350. }
  351. }
  352. /**
  353. * Sets the debug level on or off
  354. *
  355. * @access public
  356. * @param int 0 = off, 1 = on
  357. */
  358. function debug( $level ) {
  359. $this->_debug = intval( $level );
  360. }
  361. /**
  362. * Get the database UTF-8 support
  363. *
  364. * @access public
  365. * @return boolean
  366. * @since 1.5
  367. */
  368. function getUTFSupport() {
  369. return $this->_utf;
  370. }
  371. /**
  372. * Get the error number
  373. *
  374. * @access public
  375. * @return int The error number for the most recent query
  376. */
  377. function getErrorNum() {
  378. return $this->_errorNum;
  379. }
  380. /**
  381. * Get the error message
  382. *
  383. * @access public
  384. * @return string The error message for the most recent query
  385. */
  386. function getErrorMsg($escaped = false)
  387. {
  388. if($escaped) {
  389. return addslashes($this->_errorMsg);
  390. } else {
  391. return $this->_errorMsg;
  392. }
  393. }
  394. /**
  395. * Get a database escaped string
  396. *
  397. * @param string The string to be escaped
  398. * @param boolean Optional parameter to provide extra escaping
  399. * @return string
  400. * @access public
  401. * @abstract
  402. */
  403. function getEscaped( $text, $extra = false )
  404. {
  405. return;
  406. }
  407. /**
  408. * Get a database error log
  409. *
  410. * @access public
  411. * @return array
  412. */
  413. function getLog( )
  414. {
  415. return $this->_log;
  416. }
  417. /**
  418. * Get the total number of queries made
  419. *
  420. * @access public
  421. * @return array
  422. */
  423. function getTicker( )
  424. {
  425. return $this->_ticker;
  426. }
  427. /**
  428. * Quote an identifier name (field, table, etc)
  429. *
  430. * @access public
  431. * @param string The name
  432. * @return string The quoted name
  433. */
  434. function nameQuote( $s )
  435. {
  436. // Only quote if the name is not using dot-notation
  437. if (strpos( $s, '.' ) === false)
  438. {
  439. $q = $this->_nameQuote;
  440. if (strlen( $q ) == 1) {
  441. return $q . $s . $q;
  442. } else {
  443. return $q{0} . $s . $q{1};
  444. }
  445. }
  446. else {
  447. return $s;
  448. }
  449. }
  450. /**
  451. * Get the database table prefix
  452. *
  453. * @access public
  454. * @return string The database prefix
  455. */
  456. function getPrefix()
  457. {
  458. return $this->_table_prefix;
  459. }
  460. /**
  461. * Get the database null date
  462. *
  463. * @access public
  464. * @return string Quoted null/zero date string
  465. */
  466. function getNullDate()
  467. {
  468. return $this->_nullDate;
  469. }
  470. /**
  471. * Sets the SQL query string for later execution.
  472. *
  473. * This function replaces a string identifier <var>$prefix</var> with the
  474. * string held is the <var>_table_prefix</var> class variable.
  475. *
  476. * @access public
  477. * @param string The SQL query
  478. * @param string The offset to start selection
  479. * @param string The number of results to return
  480. * @param string The common table prefix
  481. */
  482. function setQuery( $sql, $offset = 0, $limit = 0, $prefix='#__' )
  483. {
  484. $this->_sql = $this->replacePrefix( $sql, $prefix );
  485. $this->_limit = (int) $limit;
  486. $this->_offset = (int) $offset;
  487. }
  488. /**
  489. * This function replaces a string identifier <var>$prefix</var> with the
  490. * string held is the <var>_table_prefix</var> class variable.
  491. *
  492. * @access public
  493. * @param string The SQL query
  494. * @param string The common table prefix
  495. */
  496. function replacePrefix( $sql, $prefix='#__' )
  497. {
  498. $sql = trim( $sql );
  499. $escaped = false;
  500. $quoteChar = '';
  501. $n = strlen( $sql );
  502. $startPos = 0;
  503. $literal = '';
  504. while ($startPos < $n) {
  505. $ip = strpos($sql, $prefix, $startPos);
  506. if ($ip === false) {
  507. break;
  508. }
  509. $j = strpos( $sql, "'", $startPos );
  510. $k = strpos( $sql, '"', $startPos );
  511. if (($k !== FALSE) && (($k < $j) || ($j === FALSE))) {
  512. $quoteChar = '"';
  513. $j = $k;
  514. } else {
  515. $quoteChar = "'";
  516. }
  517. if ($j === false) {
  518. $j = $n;
  519. }
  520. $literal .= str_replace( $prefix, $this->_table_prefix,substr( $sql, $startPos, $j - $startPos ) );
  521. $startPos = $j;
  522. $j = $startPos + 1;
  523. if ($j >= $n) {
  524. break;
  525. }
  526. // quote comes first, find end of quote
  527. while (TRUE) {
  528. $k = strpos( $sql, $quoteChar, $j );
  529. $escaped = false;
  530. if ($k === false) {
  531. break;
  532. }
  533. $l = $k - 1;
  534. while ($l >= 0 && $sql{$l} == '\\') {
  535. $l--;
  536. $escaped = !$escaped;
  537. }
  538. if ($escaped) {
  539. $j = $k+1;
  540. continue;
  541. }
  542. break;
  543. }
  544. if ($k === FALSE) {
  545. // error in the query - no end quote; ignore it
  546. break;
  547. }
  548. $literal .= substr( $sql, $startPos, $k - $startPos + 1 );
  549. $startPos = $k+1;
  550. }
  551. if ($startPos < $n) {
  552. $literal .= substr( $sql, $startPos, $n - $startPos );
  553. }
  554. return $literal;
  555. }
  556. /**
  557. * Get the active query
  558. *
  559. * @access public
  560. * @return string The current value of the internal SQL vairable
  561. */
  562. function getQuery()
  563. {
  564. return $this->_sql;
  565. }
  566. /**
  567. * Execute the query
  568. *
  569. * @abstract
  570. * @access public
  571. * @return mixed A database resource if successful, FALSE if not.
  572. */
  573. function query()
  574. {
  575. return;
  576. }
  577. /**
  578. * Get the affected rows by the most recent query
  579. *
  580. * @abstract
  581. * @access public
  582. * @return int The number of affected rows in the previous operation
  583. * @since 1.0.5
  584. */
  585. function getAffectedRows()
  586. {
  587. return;
  588. }
  589. /**
  590. * Execute a batch query
  591. *
  592. * @abstract
  593. * @access public
  594. * @return mixed A database resource if successful, FALSE if not.
  595. */
  596. function queryBatch( $abort_on_error=true, $p_transaction_safe = false)
  597. {
  598. return false;
  599. }
  600. /**
  601. * Diagnostic function
  602. *
  603. * @abstract
  604. * @access public
  605. */
  606. function explain()
  607. {
  608. return;
  609. }
  610. /**
  611. * Get the number of rows returned by the most recent query
  612. *
  613. * @abstract
  614. * @access public
  615. * @param object Database resource
  616. * @return int The number of rows
  617. */
  618. function getNumRows( $cur=null )
  619. {
  620. return;
  621. }
  622. /**
  623. * This method loads the first field of the first row returned by the query.
  624. *
  625. * @abstract
  626. * @access public
  627. * @return The value returned in the query or null if the query failed.
  628. */
  629. function loadResult()
  630. {
  631. return;
  632. }
  633. /**
  634. * Load an array of single field results into an array
  635. *
  636. * @abstract
  637. */
  638. function loadResultArray($numinarray = 0)
  639. {
  640. return;
  641. }
  642. /**
  643. * Fetch a result row as an associative array
  644. *
  645. * @abstract
  646. */
  647. function loadAssoc()
  648. {
  649. return;
  650. }
  651. /**
  652. * Load a associactive list of database rows
  653. *
  654. * @abstract
  655. * @access public
  656. * @param string The field name of a primary key
  657. * @return array If key is empty as sequential list of returned records.
  658. */
  659. function loadAssocList( $key='' )
  660. {
  661. return;
  662. }
  663. /**
  664. * This global function loads the first row of a query into an object
  665. *
  666. *
  667. * @abstract
  668. * @access public
  669. * @param object
  670. */
  671. function loadObject( )
  672. {
  673. return;
  674. }
  675. /**
  676. * Load a list of database objects
  677. *
  678. * @abstract
  679. * @access public
  680. * @param string The field name of a primary key
  681. * @return array If <var>key</var> is empty as sequential list of returned records.
  682. * If <var>key</var> is not empty then the returned array is indexed by the value
  683. * the database key. Returns <var>null</var> if the query fails.
  684. */
  685. function loadObjectList( $key='' )
  686. {
  687. return;
  688. }
  689. /**
  690. * Load the first row returned by the query
  691. *
  692. * @abstract
  693. * @access public
  694. * @return The first row of the query.
  695. */
  696. function loadRow()
  697. {
  698. return;
  699. }
  700. /**
  701. * Load a list of database rows (numeric column indexing)
  702. *
  703. * If <var>key</var> is not empty then the returned array is indexed by the value
  704. * the database key. Returns <var>null</var> if the query fails.
  705. *
  706. * @abstract
  707. * @access public
  708. * @param string The field name of a primary key
  709. * @return array
  710. */
  711. function loadRowList( $key='' )
  712. {
  713. return;
  714. }
  715. /**
  716. * Inserts a row into a table based on an objects properties
  717. * @param string The name of the table
  718. * @param object An object whose properties match table fields
  719. * @param string The name of the primary key. If provided the object property is updated.
  720. */
  721. function insertObject( $table, &$object, $keyName = NULL )
  722. {
  723. return;
  724. }
  725. /**
  726. * Update an object in the database
  727. *
  728. * @abstract
  729. * @access public
  730. * @param string
  731. * @param object
  732. * @param string
  733. * @param boolean
  734. */
  735. function updateObject( $table, &$object, $keyName, $updateNulls=true )
  736. {
  737. return;
  738. }
  739. /**
  740. * Print out an error statement
  741. *
  742. * @param boolean If TRUE, displays the last SQL statement sent to the database
  743. * @return string A standised error message
  744. */
  745. function stderr( $showSQL = false )
  746. {
  747. if ( $this->_errorNum != 0 ) {
  748. return "DB function failed with error number $this->_errorNum"
  749. ."<br /><font color=\"red\">$this->_errorMsg</font>"
  750. .($showSQL ? "<br />SQL = <pre>$this->_sql</pre>" : '');
  751. } else {
  752. return "DB function reports no errors";
  753. }
  754. }
  755. /**
  756. * Get the ID generated from the previous INSERT operation
  757. *
  758. * @abstract
  759. * @access public
  760. * @return mixed
  761. */
  762. function insertid()
  763. {
  764. return;
  765. }
  766. /**
  767. * Get the database collation
  768. *
  769. * @abstract
  770. * @access public
  771. * @return string Collation in use
  772. */
  773. function getCollation()
  774. {
  775. return;
  776. }
  777. /**
  778. * Get the version of the database connector
  779. *
  780. * @abstract
  781. */
  782. function getVersion()
  783. {
  784. return 'Not available for this connector';
  785. }
  786. /**
  787. * List tables in a database
  788. *
  789. * @abstract
  790. * @access public
  791. * @return array A list of all the tables in the database
  792. */
  793. function getTableList()
  794. {
  795. return;
  796. }
  797. /**
  798. * Shows the CREATE TABLE statement that creates the given tables
  799. *
  800. * @abstract
  801. * @access public
  802. * @param array|string A table name or a list of table names
  803. * @return array A list the create SQL for the tables
  804. */
  805. function getTableCreate( $tables )
  806. {
  807. return;
  808. }
  809. /**
  810. * Retrieves information about the given tables
  811. *
  812. * @abstract
  813. * @access public
  814. * @param array|string A table name or a list of table names
  815. * @param boolean Only return field types, default true
  816. * @return array An array of fields by table
  817. */
  818. function getTableFields( $tables, $typeonly = true )
  819. {
  820. return;
  821. }
  822. // ----
  823. // ADODB Compatibility Functions
  824. // ----
  825. /**
  826. * Get a quoted database escaped string
  827. *
  828. * @param string A string
  829. * @param boolean Default true to escape string, false to leave the string unchanged
  830. * @return string
  831. * @access public
  832. */
  833. function Quote( $text, $escaped = true )
  834. {
  835. return '\''.($escaped ? $this->getEscaped( $text ) : $text).'\'';
  836. }
  837. /**
  838. * ADODB compatability function
  839. *
  840. * @access public
  841. * @param string SQL
  842. * @since 1.5
  843. */
  844. function GetCol( $query )
  845. {
  846. $this->setQuery( $query );
  847. return $this->loadResultArray();
  848. }
  849. /**
  850. * ADODB compatability function
  851. *
  852. * @access public
  853. * @param string SQL
  854. * @return object
  855. * @since 1.5
  856. */
  857. function Execute( $query )
  858. {
  859. jimport( 'joomla.database.recordset' );
  860. $query = trim( $query );
  861. $this->setQuery( $query );
  862. if (preg_match('#^select#i', $query )) {
  863. $result = $this->loadRowList();
  864. return new JRecordSet( $result );
  865. } else {
  866. $result = $this->query();
  867. if ($result === false) {
  868. return false;
  869. } else {
  870. return new JRecordSet( array() );
  871. }
  872. }
  873. }
  874. /**
  875. * ADODB compatability function
  876. *
  877. * @access public
  878. * @since 1.5
  879. */
  880. function SelectLimit( $query, $count, $offset=0 )
  881. {
  882. jimport( 'joomla.database.recordset' );
  883. $this->setQuery( $query, $offset, $count );
  884. $result = $this->loadRowList();
  885. return new JRecordSet( $result );
  886. }
  887. /**
  888. * ADODB compatability function
  889. *
  890. * @access public
  891. * @since 1.5
  892. */
  893. function PageExecute( $sql, $nrows, $page, $inputarr=false, $secs2cache=0 )
  894. {
  895. jimport( 'joomla.database.recordset' );
  896. $this->setQuery( $sql, $page*$nrows, $nrows );
  897. $result = $this->loadRowList();
  898. return new JRecordSet( $result );
  899. }
  900. /**
  901. * ADODB compatability function
  902. *
  903. * @access public
  904. * @param string SQL
  905. * @return array
  906. * @since 1.5
  907. */
  908. function GetRow( $query )
  909. {
  910. $this->setQuery( $query );
  911. $result = $this->loadRowList();
  912. return $result[0];
  913. }
  914. /**
  915. * ADODB compatability function
  916. *
  917. * @access public
  918. * @param string SQL
  919. * @return mixed
  920. * @since 1.5
  921. */
  922. function GetOne( $query )
  923. {
  924. $this->setQuery( $query );
  925. $result = $this->loadResult();
  926. return $result;
  927. }
  928. /**
  929. * ADODB compatability function
  930. *
  931. * @since 1.5
  932. */
  933. function BeginTrans()
  934. {
  935. }
  936. /**
  937. * ADODB compatability function
  938. *
  939. * @since 1.5
  940. */
  941. function RollbackTrans()
  942. {
  943. }
  944. /**
  945. * ADODB compatability function
  946. *
  947. * @since 1.5
  948. */
  949. function CommitTrans()
  950. {
  951. }
  952. /**
  953. * ADODB compatability function
  954. *
  955. * @since 1.5
  956. */
  957. function ErrorMsg()
  958. {
  959. return $this->getErrorMsg();
  960. }
  961. /**
  962. * ADODB compatability function
  963. *
  964. * @since 1.5
  965. */
  966. function ErrorNo()
  967. {
  968. return $this->getErrorNum();
  969. }
  970. /**
  971. * ADODB compatability function
  972. *
  973. * @since 1.5
  974. */
  975. function GenID( $foo1=null, $foo2=null )
  976. {
  977. return '0';
  978. }
  979. }