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    Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
  14  */
  15  
  16  // security - hide paths
  17  if (!defined('ADODB_DIR')) die();
  18  
  19  if (!defined('_ADODB_ODBC_LAYER')) {
  20  	 include_once(ADODB_DIR."/drivers/adodb-odbc.inc.php");
  21  }
  22  if (!defined('ADODB_VFP')){
  23  define('ADODB_VFP',1);
  24  class ADODB_vfp extends ADODB_odbc {
  25  	 var $databaseType = "vfp";
  26  	 var $fmtDate = "{^Y-m-d}";
  27  	 var $fmtTimeStamp = "{^Y-m-d, h:i:sA}";
  28  	 var $replaceQuote = "'+chr(39)+'" ;
  29  	 var $true = '.T.';
  30  	 var $false = '.F.';
  31  	 var $hasTop = 'top';	 	 // support mssql SELECT TOP 10 * FROM TABLE
  32  	 var $_bindInputArray = false; // strangely enough, setting to true does not work reliably
  33  	 var $sysTimeStamp = 'datetime()';
  34  	 var $sysDate = 'date()';
  35  	 var $ansiOuter = true;
  36  	 var $hasTransactions = false;
  37  	 var $curmode = false ; // See sqlext.h, SQL_CUR_DEFAULT == SQL_CUR_USE_DRIVER == 2L
  38  
  39  	function Time()
  40  	 {
  41  	 	 return time();
  42  	 }
  43  
  44  	function BeginTrans() { return false;}
  45  
  46  	 // quote string to be sent back to database
  47  	function qstr($s,$nofixquotes=false)
  48  	 {
  49  	 	 if (!$nofixquotes) return  "'".str_replace("\r\n","'+chr(13)+'",str_replace("'",$this->replaceQuote,$s))."'";
  50  	 	 return "'".$s."'";
  51  	 }
  52  
  53  
  54  	 // TOP requires ORDER BY for VFP
  55  	function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
  56  	 {
  57  	 	 $this->hasTop = preg_match('/ORDER[ \t\r\n]+BY/is',$sql) ? 'top' : false;
  58  	 	 $ret = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
  59  	 	 return $ret;
  60  	 }
  61  
  62  
  63  
  64  };
  65  
  66  
  67  class  ADORecordSet_vfp extends ADORecordSet_odbc {
  68  
  69  	 var $databaseType = "vfp";
  70  
  71  
  72  	function MetaType($t, $len = -1, $fieldobj = false)
  73  	 {
  74  	 	 if (is_object($t)) {
  75  	 	 	 $fieldobj = $t;
  76  	 	 	 $t = $fieldobj->type;
  77  	 	 	 $len = $fieldobj->max_length;
  78  	 	 }
  79  	 	 switch (strtoupper($t)) {
  80  	 	 case 'C':
  81  	 	 	 if ($len <= $this->blobSize) return 'C';
  82  	 	 case 'M':
  83  	 	 	 return 'X';
  84  
  85  	 	 case 'D': return 'D';
  86  
  87  	 	 case 'T': return 'T';
  88  
  89  	 	 case 'L': return 'L';
  90  
  91  	 	 case 'I': return 'I';
  92  
  93  	 	 default: return ADODB_DEFAULT_METATYPE;
  94  	 	 }
  95  	 }
  96  }
  97  
  98  } //define