Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

   1  <?php
   2  /*
   3  @version   v5.21.0  2021-02-27
   4  @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
   5  @copyright (c) 2014      Damien Regad, Mark Newnham and the ADOdb community
   6    Released under both BSD license and Lesser GPL library license.
   7    Whenever there is any discrepancy between the two licenses,
   8    the BSD license will take precedence.
   9  Set tabs to 4 for best viewing.
  10  
  11    Latest version is available at https://adodb.org/
  12  
  13    Support Borland Interbase 6.5 and later
  14  
  15  */
  16  
  17  // security - hide paths
  18  if (!defined('ADODB_DIR')) die();
  19  
  20  include_once(ADODB_DIR."/drivers/adodb-ibase.inc.php");
  21  
  22  class ADODB_borland_ibase extends ADODB_ibase {
  23  	 var $databaseType = "borland_ibase";
  24  
  25  	function BeginTrans()
  26  	 {
  27  	 	 if ($this->transOff) return true;
  28  	 	 $this->transCnt += 1;
  29  	 	 $this->autoCommit = false;
  30  	  	 $this->_transactionID = ibase_trans($this->ibasetrans, $this->_connectionID);
  31  	 	 return $this->_transactionID;
  32  	 }
  33  
  34  	function ServerInfo()
  35  	 {
  36  	 	 $arr['dialect'] = $this->dialect;
  37  	 	 switch($arr['dialect']) {
  38  	 	 case '':
  39  	 	 case '1': $s = 'Interbase 6.5, Dialect 1'; break;
  40  	 	 case '2': $s = 'Interbase 6.5, Dialect 2'; break;
  41  	 	 default:
  42  	 	 case '3': $s = 'Interbase 6.5, Dialect 3'; break;
  43  	 	 }
  44  	 	 $arr['version'] = '6.5';
  45  	 	 $arr['description'] = $s;
  46  	 	 return $arr;
  47  	 }
  48  
  49  	 // Note that Interbase 6.5 uses ROWS instead - don't you love forking wars!
  50  	 // 	 	 SELECT col1, col2 FROM table ROWS 5 -- get 5 rows
  51  	 //	 	 SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
  52  	 // Firebird uses
  53  	 //	 	 SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE
  54  	function SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
  55  	 {
  56  	 	 $nrows = (int) $nrows;
  57  	 	 $offset = (int) $offset;
  58  	 	 if ($nrows > 0) {
  59  	 	 	 if ($offset <= 0) $str = " ROWS $nrows ";
  60  	 	 	 else {
  61  	 	 	 	 $a = $offset+1;
  62  	 	 	 	 $b = $offset+$nrows;
  63  	 	 	 	 $str = " ROWS $a TO $b";
  64  	 	 	 }
  65  	 	 } else {
  66  	 	 	 // ok, skip
  67  	 	 	 $a = $offset + 1;
  68  	 	 	 $str = " ROWS $a TO 999999999"; // 999 million
  69  	 	 }
  70  	 	 $sql .= $str;
  71  
  72  	 	 return ($secs2cache) ?
  73  	 	 	 	 $this->CacheExecute($secs2cache,$sql,$inputarr)
  74  	 	 	 :
  75  	 	 	 	 $this->Execute($sql,$inputarr);
  76  	 }
  77  
  78  };
  79  
  80  
  81  class  ADORecordSet_borland_ibase extends ADORecordSet_ibase {
  82  
  83  	 var $databaseType = "borland_ibase";
  84  
  85  }