public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Updated cms_selflink to use the hierarchy manager for prev/next links
Updated ADODB to 4.70


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@2430 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Fri Jan 13 07:33:33 -0800 2006
commit  6a5d04a2063a8add3dac85954676957066c24653
tree    07f71dfc7cfe85c154cdf99760bcc52bdac35fd2
parent  b75260f00bec78f2a8ee165275fb881b65ec102a
...
2
3
4
 
 
 
5
6
7
...
2
3
4
5
6
7
8
9
10
0
@@ -2,6 +2,9 @@ Version 0.12 -- Subversion
0
 -----------------
0
 * Added the {metadata} tag for both global and page level
0
 metdata.
0
+* Added the hierarchy manager for proper caching of site
0
+structure
0
+* Updated to ADODB 4.70
0
 
0
 Version 0.11.2 "Scarborough" -- Dec 21 2005
0
 -----------------
...
108
109
110
111
112
113
114
...
108
109
110
 
111
112
113
0
@@ -108,7 +108,6 @@ if (isset($pageinfo) && $pageinfo !== FALSE)
0
 
0
   $gCms->variables['page_name'] = $pageinfo->content_alias;
0
   $gCms->variables['position'] = $pageinfo->content_hierarchy;
0
- $gCms->variables['position'] = $pageinfo->content_hierarchy;
0
   $gCms->variables['friendly_position'] = ContentManager::CreateFriendlyHierarchyPosition($pageinfo->content_hierarchy);
0
   
0
 }
...
1
2
3
4
 
5
6
7
...
737
738
739
 
 
 
 
 
740
741
742
 
743
744
745
...
1
2
3
 
4
5
6
7
...
737
738
739
740
741
742
743
744
745
746
 
747
748
749
750
0
@@ -1,7 +1,7 @@
0
 <?php
0
 
0
 /**
0
- V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
0
+ V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
0
   Released under both BSD license and Lesser GPL library license.
0
   Whenever there is any discrepancy between the two licenses,
0
   the BSD license will take precedence.
0
@@ -737,9 +737,14 @@ class ADODB_DataDict {
0
       $holdflds = array();
0
       foreach($flds as $k=>$v) {
0
         if ( isset($cols[$k]) && is_object($cols[$k]) ) {
0
+ // If already not allowing nulls, then don't change
0
+ $obj = $cols[$k];
0
+ if (isset($obj->not_null) && $obj->not_null)
0
+ $v = str_replace('NOT NULL','',$v);
0
+
0
           $c = $cols[$k];
0
           $ml = $c->max_length;
0
- $mt = &$this->MetaType($c->type,$ml);
0
+ $mt = $this->MetaType($c->type,$ml);
0
           if ($ml == -1) $ml = '';
0
           if ($mt == 'X') $ml = $v['SIZE'];
0
           if (($mt != $v['TYPE']) || $ml != $v['SIZE']) {
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 <?php
0
 
0
 /*
0
- V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
0
+ V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
0
   Released under both BSD license and Lesser GPL library license.
0
   Whenever there is any discrepancy between the two licenses,
0
   the BSD license will take precedence.
...
7
8
9
10
 
11
12
13
...
57
58
59
60
61
 
 
 
 
62
63
64
...
284
285
286
 
 
 
 
 
 
287
288
289
...
919
920
921
922
 
 
 
923
924
 
925
926
 
927
928
929
...
947
948
949
950
 
951
952
953
 
954
955
956
...
7
8
9
 
10
11
12
13
...
57
58
59
 
 
60
61
62
63
64
65
66
...
286
287
288
289
290
291
292
293
294
295
296
297
...
927
928
929
 
930
931
932
933
 
934
935
 
936
937
938
939
...
957
958
959
 
960
961
962
 
963
964
965
966
0
@@ -7,7 +7,7 @@ global $ADODB_INCLUDED_LIB;
0
 $ADODB_INCLUDED_LIB = 1;
0
 
0
 /*
0
- @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim\@natsoft.com.my). All rights reserved.
0
+ @version V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim\@natsoft.com.my). All rights reserved.
0
   Released under both BSD license and Lesser GPL library license.
0
   Whenever there is any discrepancy between the two licenses,
0
   the BSD license will take precedence. See License.txt.
0
@@ -57,8 +57,10 @@ function _adodb_replace(&$zthis, $table, $fieldArray, $keyCol, $autoQuote, $has_
0
     
0
     $where = false;
0
     foreach ($keyCol as $v) {
0
- if ($where) $where .= " and $v=$fieldArray[$v]";
0
- else $where = "$v=$fieldArray[$v]";
0
+ if (isset($fieldArray[$v])) {
0
+ if ($where) $where .= ' and '.$v.'='.$fieldArray[$v];
0
+ else $where = $v.'='.$fieldArray[$v];
0
+ }
0
     }
0
     
0
     if ($uSet && $where) {
0
@@ -284,6 +286,12 @@ function _adodb_getmenu_gp(&$zthis, $name,$defstr='',$blank1stItem=true,$multipl
0
   query rewriting techniques...
0
   
0
   Does not work with UNIONs, except with postgresql and oracle.
0
+
0
+ Usage:
0
+
0
+ $conn->Connect(...);
0
+ $cnt = _adodb_getcount($conn, $sql);
0
+
0
 */
0
 function _adodb_getcount(&$zthis, $sql,$inputarr=false,$secs2cache=0)
0
 {
0
@@ -919,11 +927,13 @@ function _adodb_debug_execute(&$zthis, $sql, $inputarr)
0
   $dbt = $zthis->databaseType;
0
   if (isset($zthis->dsnType)) $dbt .= '-'.$zthis->dsnType;
0
   if ($inBrowser) {
0
- $ss = htmlspecialchars($ss);
0
+ if ($ss) {
0
+ $ss = '<code>'.htmlspecialchars($ss).'</code>';
0
+ }
0
     if ($zthis->debug === -1)
0
- ADOConnection::outp( "<br>\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; <code>$ss</code>\n<br>\n",false);
0
+ ADOConnection::outp( "<br />\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; $ss\n<br />\n",false);
0
     else
0
- ADOConnection::outp( "<hr>\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; <code>$ss</code>\n<hr>\n",false);
0
+ ADOConnection::outp( "<hr />\n($dbt): ".htmlspecialchars($sqlTxt)." &nbsp; $ss\n<hr />\n",false);
0
   } else {
0
     ADOConnection::outp("-----\n($dbt): ".$sqlTxt."\n-----\n",false);
0
   }
0
@@ -947,10 +957,10 @@ function _adodb_debug_execute(&$zthis, $sql, $inputarr)
0
   return $qID;
0
 }
0
 
0
-
0
+# pretty print the debug_backtrace function
0
 function _adodb_backtrace($printOrArr=true,$levels=9999,$skippy=0)
0
 {
0
- if ((float) PHPVERSION() < 4.3) return '';
0
+ if (!function_exists('debug_backtrace')) return '';
0
   
0
   $html = (isset($_SERVER['HTTP_USER_AGENT']));
0
   $fmt = ($html) ? "</font><font color=#808080 size=-1> %% line %4d, file: <a href=\"file:/%s\">%s</a></font>" : "%% line %4d, file: %s";
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 <?php
0
 
0
 /*
0
- V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
0
+ V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
0
   Released under both BSD license and Lesser GPL library license.
0
   Whenever there is any discrepancy between the two licenses,
0
   the BSD license will take precedence.
...
1
2
3
4
 
5
6
7
...
241
242
243
 
 
244
245
246
247
 
 
 
248
249
250
...
359
360
361
362
 
363
364
365
...
689
690
691
692
 
693
694
695
696
697
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
698
699
700
...
703
704
705
 
706
707
708
...
912
913
914
915
916
 
 
917
918
919
...
1262
1263
1264
1265
 
1266
1267
1268
1269
 
1270
1271
1272
...
1
2
3
 
4
5
6
7
...
241
242
243
244
245
246
 
 
 
247
248
249
250
251
252
...
361
362
363
 
364
365
366
367
...
691
692
693
 
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
...
727
728
729
730
731
732
733
...
937
938
939
 
 
940
941
942
943
944
...
1287
1288
1289
 
1290
1291
1292
1293
 
1294
1295
1296
1297
0
@@ -1,7 +1,7 @@
0
 <?php
0
 /**
0
 ADOdb Date Library, part of the ADOdb abstraction library
0
-Download: http://php.weblogs.com/adodb_date_time_library
0
+Download: http://phplens.com/phpeverywhere/
0
 
0
 PHP native date functions use integer timestamps for computations.
0
 Because of this, dates are restricted to the years 1901-2038 on Unix
0
@@ -241,10 +241,12 @@ b. Implement daylight savings, which looks awfully complicated, see
0
 
0
 
0
 CHANGELOG
0
+- 08 Sept 2005 0.22
0
+In adodb_date2(), $is_gmt not supported properly. Fixed.
0
 
0
-- 18 July 2005 0.21
0
-- In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat.
0
-- Added support for negative months in adodb_mktime().
0
+- 18 July 2005 0.21
0
+In PHP 4.3.11, the 'r' format has changed. Leading 0 in day is added. Changed for compat.
0
+Added support for negative months in adodb_mktime().
0
 
0
 - 24 Feb 2005 0.20
0
 Added limited strftime/gmstrftime support. x10 improvement in performance of adodb_date().
0
@@ -359,7 +361,7 @@ First implementation.
0
 /*
0
   Version Number
0
 */
0
-define('ADODB_DATE_VERSION',0.21);
0
+define('ADODB_DATE_VERSION',0.22);
0
 
0
 /*
0
   This code was originally for windows. But apparently this problem happens
0
@@ -689,12 +691,34 @@ adodb_date_gentable();
0
 
0
 for ($i=1970; $i > 1500; $i--) {
0
 
0
-echo "<hr>$i ";
0
+echo "<hr />$i ";
0
   adodb_date_test_date($i,1,1);
0
 }
0
 
0
 */
0
 
0
+
0
+$_month_table_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31);
0
+$_month_table_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31);
0
+
0
+function adodb_validdate($y,$m,$d)
0
+{
0
+global $_month_table_normal,$_month_table_leaf;
0
+
0
+ if (_adodb_is_leap_year($y)) $marr =& $_month_table_leaf;
0
+ else $marr =& $_month_table_normal;
0
+
0
+ if ($m > 12 || $m < 1) return false;
0
+
0
+ if ($d > 31 || $d < 1) return false;
0
+
0
+ if ($marr[$m] < $d) return false;
0
+
0
+ if ($y < 1000 && $y > 3000) return false;
0
+
0
+ return true;
0
+}
0
+
0
 /**
0
   Low-level function that returns the getdate() array. We have a special
0
   $fast flag, which if set to true, will return fewer array values,
0
@@ -703,6 +727,7 @@ echo "<hr>$i ";
0
 function _adodb_getdate($origd=false,$fast=false,$is_gmt=false)
0
 {
0
 static $YRS;
0
+global $_month_table_normal,$_month_table_leaf;
0
 
0
   $d = $origd - ($is_gmt ? 0 : adodb_get_gmt_diff());
0
   
0
@@ -912,8 +937,8 @@ function adodb_date2($fmt, $d=false, $is_gmt=false)
0
     if ($rr[1] <= 100 && $rr[2]<= 1) return adodb_date($fmt,false,$is_gmt);
0
   
0
     // h-m-s-MM-DD-YY
0
- if (!isset($rr[5])) $d = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1]);
0
- else $d = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1]);
0
+ if (!isset($rr[5])) $d = adodb_mktime(0,0,0,$rr[2],$rr[3],$rr[1],false,$is_gmt);
0
+ else $d = @adodb_mktime($rr[5],$rr[6],$rr[7],$rr[2],$rr[3],$rr[1],false,$is_gmt);
0
   }
0
   
0
   return adodb_date($fmt,$d,$is_gmt);
0
@@ -1262,11 +1287,11 @@ global $ADODB_DATE_LOCALE;
0
       case 'S': $fmtdate .= 's'; break;
0
       case 't': $fmtdate .= "\t"; break;
0
       case 'T': $fmtdate .= 'H:i:s'; break;
0
- case 'u': $fmtdate .= '?u'; $parseu = true; break; // wrong strftime=1-based, date=0-basde
0
+ case 'u': $fmtdate .= '?u'; $parseu = true; break; // wrong strftime=1-based, date=0-based
0
       case 'U': $fmtdate .= '?U'; $parseU = true; break;// wrong strftime=1-based, date=0-based
0
       case 'x': $fmtdate .= $ADODB_DATE_LOCALE[0]; break;
0
       case 'X': $fmtdate .= $ADODB_DATE_LOCALE[1]; break;
0
- case 'w': $fmtdate .= '?w'; $parseu = true; break; // wrong strftime=1-based, date=0-basde
0
+ case 'w': $fmtdate .= '?w'; $parseu = true; break; // wrong strftime=1-based, date=0-based
0
       case 'W': $fmtdate .= '?W'; $parseU = true; break;// wrong strftime=1-based, date=0-based
0
       case 'y': $fmtdate .= 'y'; break;
0
       case 'Y': $fmtdate .= 'Y'; break;
...
1
 
2
3
4
...
14
15
16
17
 
18
19
20
...
28
29
30
31
32
 
33
34
35
...
172
173
174
175
 
176
177
178
...
315
316
317
318
319
320
321
...
794
795
796
797
 
798
799
800
...
803
804
805
806
 
807
808
809
...
861
862
863
864
865
866
867
...
1108
1109
1110
1111
 
1112
1113
1114
...
1118
1119
1120
1121
 
1122
1123
1124
 
1125
1126
1127
...
1358
1359
1360
1361
1362
 
 
 
 
1363
1364
1365
...
1383
1384
1385
1386
1387
 
 
 
 
1388
1389
1390
...
1673
1674
1675
1676
 
1677
1678
1679
...
2030
2031
2032
2033
2034
 
 
2035
2036
2037
2038
2039
 
2040
2041
2042
...
2050
2051
2052
2053
 
2054
2055
2056
...
2587
2588
2589
2590
2591
 
 
 
 
2592
2593
2594
...
2746
2747
2748
2749
 
 
 
2750
2751
2752
...
3665
3666
3667
 
3668
3669
3670
...
3786
3787
3788
 
3789
3790
3791
3792
3793
3794
3795
3796
3797
...
3872
3873
3874
3875
3876
 
 
 
3877
3878
...
 
1
2
3
4
...
14
15
16
 
17
18
19
20
...
28
29
30
 
 
31
32
33
34
...
171
172
173
 
174
175
176
177
...
314
315
316
 
317
318
319
...
792
793
794
 
795
796
797
798
...
801
802
803
 
804
805
806
807
...
859
860
861
 
862
863
864
...
1105
1106
1107
 
1108
1109
1110
1111
...
1115
1116
1117
 
1118
1119
1120
 
1121
1122
1123
1124
...
1355
1356
1357
 
 
1358
1359
1360
1361
1362
1363
1364
...
1382
1383
1384
 
 
1385
1386
1387
1388
1389
1390
1391
...
1674
1675
1676
 
1677
1678
1679
1680
...
2031
2032
2033
 
 
2034
2035
2036
2037
2038
2039
 
2040
2041
2042
2043
...
2051
2052
2053
 
2054
2055
2056
2057
...
2588
2589
2590
 
 
2591
2592
2593
2594
2595
2596
2597
...
2749
2750
2751
 
2752
2753
2754
2755
2756
2757
...
3670
3671
3672
3673
3674
3675
3676
...
3792
3793
3794
3795
3796
3797
3798
3799
3800
 
3801
3802
3803
...
3878
3879
3880
 
 
3881
3882
3883
3884
3885
0
@@ -1,4 +1,4 @@
0
-<?php
0
+<?php
0
 /*
0
  * Set tabs to 4 for best viewing.
0
  *
0
@@ -14,7 +14,7 @@
0
 /**
0
   \mainpage   
0
   
0
- @version V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved.
0
+ @version V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved.
0
 
0
   Released under both BSD license and Lesser GPL library license. You can choose which license
0
   you prefer.
0
@@ -28,8 +28,7 @@
0
   ADO, SAP DB, SQLite and ODBC. We have had successful reports of connecting to Progress and
0
   other databases via ODBC.
0
 
0
- Latest Download at http://php.weblogs.com/adodb<br>
0
- Manual is at http://php.weblogs.com/adodb_manual
0
+ Latest Download at http://adodb.sourceforge.net/
0
   
0
  */
0
  
0
@@ -172,7 +171,7 @@
0
     /**
0
      * ADODB version as a string.
0
      */
0
- $ADODB_vers = 'V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
0
+ $ADODB_vers = 'V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';
0
   
0
     /**
0
      * Determines whether recordset->RecordCount() is used.
0
@@ -315,7 +314,6 @@
0
   var $_evalAll = false;
0
   var $_affected = false;
0
   var $_logsql = false;
0
-
0
 
0
   
0
   /**
0
@@ -794,7 +792,7 @@
0
   {
0
     if ($this->fnExecute) {
0
       $fn = $this->fnExecute;
0
- $ret = $fn($this,$sql,$inputarr);
0
+ $ret =& $fn($this,$sql,$inputarr);
0
       if (isset($ret)) return $ret;
0
     }
0
     if ($inputarr) {
0
@@ -803,7 +801,7 @@
0
       $element0 = reset($inputarr);
0
       # is_object check because oci8 descriptors can be passed in
0
       $array_2d = is_array($element0) && !is_object(reset($element0));
0
-
0
+
0
       if (!is_array($sql) && !$this->_bindInputArray) {
0
         $sqlarr = explode('?',$sql);
0
           
0
@@ -861,7 +859,6 @@
0
   
0
   function &_Execute($sql,$inputarr=false)
0
   {
0
-
0
     if ($this->debug) {
0
       global $ADODB_INCLUDED_LIB;
0
       if (empty($ADODB_INCLUDED_LIB)) include_once(ADODB_DIR.'/adodb-lib.inc.php');
0
@@ -1108,7 +1105,7 @@
0
           // access includes ties in result
0
           if ($isaccess) {
0
             $sql = preg_replace(
0
- '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
0
+ '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
0
 
0
             if ($secs2cache>0) {
0
               $ret =& $this->CacheExecute($secs2cache, $sql,$inputarr);
0
@@ -1118,10 +1115,10 @@
0
             return $ret; // PHP5 fix
0
           } else if ($ismssql){
0
             $sql = preg_replace(
0
- '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
0
+ '/(^\s*select\s+(distinctrow|distinct)?)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
0
           } else {
0
             $sql = preg_replace(
0
- '/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.$nrows.' ',$sql);
0
+ '/(^\s*select\s)/i','\\1 '.$this->hasTop.' '.((integer)$nrows).' ',$sql);
0
           }
0
       } else {
0
         $nn = $nrows + $offset;
0
@@ -1358,8 +1355,10 @@
0
     $rs =& $this->Execute($sql,$inputarr);
0
     $ADODB_COUNTRECS = $savec;
0
     if (!$rs)
0
- if (defined('ADODB_PEAR')) return ADODB_PEAR_Error();
0
- else {
0
+ if (defined('ADODB_PEAR')) {
0
+ $cls = ADODB_PEAR_Error();
0
+ return $cls;
0
+ } else {
0
         $false = false;
0
         return $false;
0
       }
0
@@ -1383,8 +1382,10 @@
0
     $ADODB_COUNTRECS = $savec;
0
     
0
     if (!$rs)
0
- if (defined('ADODB_PEAR')) return ADODB_PEAR_Error();
0
- else {
0
+ if (defined('ADODB_PEAR')) {
0
+ $cls = ADODB_PEAR_Error();
0
+ return $cls;
0
+ } else {
0
         $false = false;
0
         return $false;
0
       }
0
@@ -1673,7 +1674,7 @@
0
   {
0
     $sql = 'SELECT * FROM '.$table;
0
     if ($where!==FALSE) $sql .= ' WHERE '.$where;
0
- else if ($mode == 'UPDATE') {
0
+ else if ($mode == 'UPDATE' || $mode == 2 /* DB_AUTOQUERY_UPDATE */) {
0
       ADOConnection::outp('AutoExecute: Illegal mode=UPDATE with empty WHERE clause');
0
       return false;
0
     }
0
@@ -2030,13 +2031,13 @@
0
    * List columns in a database as an array of ADOFieldObjects.
0
    * See top of file for definition of object.
0
    *
0
- * @param table table name to query
0
- * @param upper uppercase table name (required by some databases)
0
+ * @param $table table name to query
0
+ * @param $normalize makes table name case-insensitive (required by some databases)
0
    * @schema is optional database schema to use - not supported by all databases.
0
    *
0
    * @return array of ADOFieldObjects for current table.
0
    */
0
- function &MetaColumns($table,$upper=true)
0
+ function &MetaColumns($table,$normalize=true)
0
   {
0
   global $ADODB_FETCH_MODE;
0
     
0
@@ -2050,7 +2051,7 @@
0
       $save = $ADODB_FETCH_MODE;
0
       $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
0
       if ($this->fetchMode !== false) $savem = $this->SetFetchMode(false);
0
- $rs = $this->Execute(sprintf($this->metaColumnsSQL,($upper)?strtoupper($table):$table));
0
+ $rs = $this->Execute(sprintf($this->metaColumnsSQL,($normalize)?strtoupper($table):$table));
0
       if (isset($savem)) $this->SetFetchMode($savem);
0
       $ADODB_FETCH_MODE = $save;
0
       if ($rs === false || $rs->EOF) return $false;
0
@@ -2587,8 +2588,10 @@
0
    */
0
   function &GetArray($nRows = -1)
0
   {
0
- global $ADODB_EXTENSION; if ($ADODB_EXTENSION) return adodb_getall($this,$nRows);
0
-
0
+ global $ADODB_EXTENSION; if ($ADODB_EXTENSION) {
0
+ $results = adodb_getall($this,$nRows);
0
+ return $results;
0
+ }
0
     $results = array();
0
     $cnt = 0;
0
     while (!$this->EOF && $nRows != $cnt) {
0
@@ -2746,7 +2749,9 @@
0
         }
0
       }
0
     }
0
- return $results;
0
+
0
+ $ref =& $results; # workaround accelerator incompat with PHP 4.4 :(
0
+ return $ref;
0
   }
0
   
0
   
0
@@ -3665,6 +3670,7 @@
0
     $false = false;
0
     if (strpos($db,'://')) {
0
       $origdsn = $db;
0
+ $db = str_replace('_','%95',$db);
0
       $dsna = @parse_url($db);
0
       
0
       if (!$dsna) {
0
@@ -3786,12 +3792,12 @@
0
     }
0
     
0
     switch($drivername) {
0
+ case 'mysqli': $drivername='mysql'; break;
0
     case 'firebird15': $drivername = 'firebird'; break;
0
     case 'oracle': $drivername = 'oci8'; break;
0
     case 'access': if ($perf) $drivername = ''; break;
0
     case 'db2' : break;
0
     case 'sapdb' : break;
0
- case 'mysqli' : $drivername = 'mysql'; break;
0
     default:
0
       $drivername = 'generic';
0
       break;
0
@@ -3872,6 +3878,7 @@
0
     if (empty($ADODB_INCLUDED_LIB)) include_once(ADODB_DIR.'/adodb-lib.inc.php');
0
     return _adodb_backtrace($printOrArr,$levels);
0
   }
0
-
0
-} // defined
0
+
0
+
0
+}
0
 ?>
0
\ No newline at end of file
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 <?php
0
 
0
 /**
0
- V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
0
+ V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
0
   Released under both BSD license and Lesser GPL library license.
0
   Whenever there is any discrepancy between the two licenses,
0
   the BSD license will take precedence.
...
1
2
3
4
 
5
6
7
...
1
2
3
 
4
5
6
7
0
@@ -1,7 +1,7 @@
0
 <?php
0
 
0
 /**
0
- V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
0
+ V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
0
   Released under both BSD license and Lesser GPL library license.
0
   Whenever there is any discrepancy between the two licenses,
0
   the BSD license will take precedence.
...
1
2
3
4
 
5
6
7
...
21
22
23
 
24
25
26
...
134
135
136
137
 
138
139
140
 
 
 
141
142
143
...
214
215
216
217
 
218
219
220
...
355
356
357
 
 
 
 
 
 
 
 
 
 
358
359
360
...
1
2
3
 
4
5
6
7
...
21
22
23
24
25
26
27
...
135
136
137
 
138
139
 
 
140
141
142
143
144
145
...
216
217
218
 
219
220
221
222
...
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
0
@@ -1,7 +1,7 @@
0
 <?php
0
 
0
 /**
0
- V4.65 22 July 2005 (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
0
+ V4.70 06 Jan 2006 (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
0
   Released under both BSD license and Lesser GPL library license.
0
   Whenever there is any discrepancy between the two licenses,
0
   the BSD license will take precedence.
0
@@ -21,6 +21,7 @@ class ADODB2_postgres extends ADODB_DataDict {
0
   var $addCol = ' ADD COLUMN';
0
   var $quote = '"';
0
   var $renameTable = 'ALTER TABLE %s RENAME TO %s'; // at least since 7.1
0
+ var $dropTable = 'DROP TABLE %s CASCADE';
0
   
0
   function MetaType($t,$len=-1,$fieldobj=false)
0
   {
0
@@ -134,10 +135,11 @@ class ADODB2_postgres extends ADODB_DataDict {
0
       if (($not_null = preg_match('/NOT NULL/i',$v))) {
0
         $v = preg_replace('/NOT NULL/i','',$v);
0
       }
0
- if (preg_match('/^([^ ]+) .*(DEFAULT [^ ]+)/',$v,$matches)) {
0
+ if (preg_match('/^([^ ]+) .*DEFAULT ([^ ]+)/',$v,$matches)) {
0
         list(,$colname,$default) = $matches;
0
- $sql[] = $alter . str_replace($default,'',$v);
0
- $sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET ' . $default;
0
+ $sql[] = $alter . str_replace('DEFAULT '.$default,'',$v);
0
+ $sql[] = 'UPDATE '.$tabname.' SET '.$colname.'='.$default;
0
+ $sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET DEFAULT ' . $default;
0
       } else {        
0
         $sql[] = $alter . $v;
0
       }
0
@@ -214,7 +216,7 @@ class ADODB2_postgres extends ADODB_DataDict {
0
         // we need to explicit convert varchar to a number to be able to do an AlterColumn of a char column to a nummeric one
0
         if (preg_match('/'.$fld->name.' (I|I2|I4|I8|N|F)/i',$tableflds,$matches) &&
0
           in_array($fld->type,array('varchar','char','text','bytea'))) {
0
- $copyflds[] = "to_number($fld->name,'S99D99')";
0
+ $copyflds[] = "to_number($fld->name,'S9999999999999D99')";
0
         } else {
0
           $copyflds[] = $fld->name;
0
         }
0
@@ -355,5 +357,15 @@ CREATE [ UNIQUE ] INDEX index_name ON table
0
     
0
     return $sql;
0
   }
0
+
0
+ function _GetSize($ftype, $ty, $fsize, $fprec)
0
+ {
0
+ if (strlen($fsize) && $ty != 'X' && $ty != 'B' && $ty != 'I' && strpos($ftype,'(') === false) {
0
+ $ftype .= "(".$fsize;
0
+ if (strlen($fprec)) $ftype .= ",".$fprec;
0
+ $ftype .= ')';
0
+ }
0
+ return $ftype;
0
+ }
0
 }
0
 ?>
0
\ No newline at end of file