Changeset 24912
- Timestamp:
- 11/26/08 10:11:56 (6 weeks ago)
- Location:
- development/zikula-1/includes/classes/adodb
- Files:
-
- 4 added
- 8 removed
- 101 modified
- 1 moved
-
adodb-active-record.inc.php (modified) (3 diffs)
-
adodb-csvlib.inc.php (modified) (4 diffs)
-
adodb-datadict.inc.php (modified) (2 diffs)
-
adodb-errorhandler.inc.php (modified) (1 diff)
-
adodb-error.inc.php (modified) (1 diff)
-
adodb-errorpear.inc.php (modified) (1 diff)
-
adodb-exceptions.inc.php (modified) (1 diff)
-
adodb.inc.php (modified) (26 diffs)
-
adodb-iterator.inc.php (modified) (1 diff)
-
adodb-lib.inc.php (modified) (4 diffs)
-
adodb-memcache.lib.inc.php (modified) (2 diffs)
-
adodb-pager.inc.php (modified) (2 diffs)
-
adodb-pear.inc.php (modified) (2 diffs)
-
adodb-perf.inc.php (modified) (4 diffs)
-
adodb-php4.inc.php (modified) (1 diff)
-
adodb-time.inc.php (modified) (11 diffs)
-
datadict/datadict-access.inc.php (modified) (1 diff)
-
datadict/datadict-db2.inc.php (modified) (1 diff)
-
datadict/datadict-firebird.inc.php (modified) (1 diff)
-
datadict/datadict-generic.inc.php (modified) (1 diff)
-
datadict/datadict-ibase.inc.php (modified) (1 diff)
-
datadict/datadict-informix.inc.php (modified) (1 diff)
-
datadict/datadict-mssql.inc.php (modified) (1 diff)
-
datadict/datadict-mssqlnative.inc.php (added)
-
datadict/datadict-mysql.inc.php (modified) (1 diff)
-
datadict/datadict-oci8.inc.php (modified) (1 diff)
-
datadict/datadict-postgres.inc.php (modified) (1 diff)
-
datadict/datadict-sapdb.inc.php (modified) (1 diff)
-
datadict/datadict-sybase.inc.php (modified) (1 diff)
-
docs-adodb.htm (deleted)
-
docs-datadict.htm (deleted)
-
docs/docs-active-record.htm (modified) (1 diff)
-
docs/docs-adodb.htm (modified) (10 diffs)
-
docs/docs-datadict.htm (modified) (1 diff)
-
docs/docs-perf.htm (modified) (1 diff)
-
docs/docs-session.htm (modified) (1 diff)
-
docs-perf.htm (deleted)
-
docs/readme_zikula.txt (moved) (moved from development/zikula-1/includes/classes/adodb/readme_postnuke.txt) (1 diff, 1 prop)
-
docs-session.htm (deleted)
-
drivers/adodb-access.inc.php (modified) (1 diff)
-
drivers/adodb-ado5.inc.php (modified) (1 diff)
-
drivers/adodb-ado_access.inc.php (modified) (1 diff)
-
drivers/adodb-ado.inc.php (modified) (1 diff)
-
drivers/adodb-ado_mssql.inc.php (modified) (1 diff)
-
drivers/adodb-borland_ibase.inc.php (modified) (1 diff)
-
drivers/adodb-csv.inc.php (modified) (1 diff)
-
drivers/adodb-db2.inc.php (modified) (3 diffs)
-
drivers/adodb-fbsql.inc.php (modified) (1 diff)
-
drivers/adodb-firebird.inc.php (modified) (1 diff)
-
drivers/adodb-ibase.inc.php (modified) (1 diff)
-
drivers/adodb-informix72.inc.php (modified) (1 diff)
-
drivers/adodb-informix.inc.php (modified) (1 diff)
-
drivers/adodb-ldap.inc.php (modified) (1 diff)
-
drivers/adodb-mssql.inc.php (modified) (5 diffs)
-
drivers/adodb-mssqlnative.inc.php (added)
-
drivers/adodb-mssqlpo.inc.php (modified) (1 diff)
-
drivers/adodb-mysqli.inc.php (modified) (11 diffs)
-
drivers/adodb-mysql.inc.php (modified) (6 diffs)
-
drivers/adodb-mysqlt.inc.php (modified) (1 diff)
-
drivers/adodb-netezza.inc.php (modified) (1 diff)
-
drivers/adodb-oci805.inc.php (modified) (1 diff)
-
drivers/adodb-oci8.inc.php (modified) (5 diffs)
-
drivers/adodb-oci8po.inc.php (modified) (1 diff)
-
drivers/adodb-odbc_db2.inc.php (modified) (1 diff)
-
drivers/adodb-odbc.inc.php (modified) (1 diff)
-
drivers/adodb-odbc_mssql.inc.php (modified) (1 diff)
-
drivers/adodb-odbc_oracle.inc.php (modified) (1 diff)
-
drivers/adodb-odbtp.inc.php (modified) (1 diff)
-
drivers/adodb-odbtp_unicode.inc.php (modified) (1 diff)
-
drivers/adodb-oracle.inc.php (modified) (1 diff)
-
drivers/adodb-pdo.inc.php (modified) (1 diff)
-
drivers/adodb-pdo_mssql.inc.php (modified) (1 diff)
-
drivers/adodb-pdo_mysql.inc.php (modified) (2 diffs)
-
drivers/adodb-pdo_oci.inc.php (modified) (1 diff)
-
drivers/adodb-pdo_pgsql.inc.php (modified) (1 diff)
-
drivers/adodb-postgres64.inc.php (modified) (2 diffs)
-
drivers/adodb-postgres7.inc.php (modified) (2 diffs)
-
drivers/adodb-postgres8.inc.php (modified) (1 diff)
-
drivers/adodb-postgres.inc.php (modified) (1 diff)
-
drivers/adodb-proxy.inc.php (modified) (1 diff)
-
drivers/adodb-sapdb.inc.php (modified) (1 diff)
-
drivers/adodb-sqlanywhere.inc.php (modified) (1 diff)
-
drivers/adodb-sqlite.inc.php (modified) (1 diff)
-
drivers/adodb-sqlitepo.inc.php (modified) (1 diff)
-
drivers/adodb-sybase_ase.inc.php (modified) (1 diff)
-
drivers/adodb-sybase.inc.php (modified) (4 diffs)
-
drivers/adodb-vfp.inc.php (modified) (1 diff)
-
lang/adodb-fa.inc.php (added)
-
old-changelog.htm (deleted)
-
perf/perf-db2.inc.php (modified) (1 diff)
-
perf/perf-informix.inc.php (modified) (1 diff)
-
perf/perf-mssql.inc.php (modified) (1 diff)
-
perf/perf-mssqlnative.inc.php (added)
-
perf/perf-mysql.inc.php (modified) (1 diff)
-
perf/perf-oci8.inc.php (modified) (4 diffs)
-
perf/perf-postgres.inc.php (modified) (1 diff)
-
pivottable.inc.php (modified) (1 diff)
-
readme.htm (deleted)
-
rsfilter.inc.php (modified) (1 diff)
-
session/adodb-compress-bzip2.php (modified) (1 diff)
-
session/adodb-compress-gzip.php (modified) (1 diff)
-
session/adodb-cryptsession2.php (modified) (1 diff)
-
session/adodb-cryptsession.php (modified) (1 diff)
-
session/adodb-encrypt-mcrypt.php (modified) (1 diff)
-
session/adodb-encrypt-md5.php (modified) (1 diff)
-
session/adodb-encrypt-secret.php (modified) (1 diff)
-
session/adodb-session2.php (modified) (2 diffs)
-
session/adodb-session-clob2.php (modified) (1 diff)
-
session/adodb-session-clob.php (modified) (1 diff)
-
session/adodb-session.php (modified) (3 diffs)
-
tips_portable_sql.htm (deleted)
-
toexport.inc.php (modified) (2 diffs)
-
tohtml.inc.php (modified) (3 diffs)
-
tute.htm (deleted)
Legend:
- Unmodified
- Added
- Removed
-
development/zikula-1/includes/classes/adodb/adodb-active-record.inc.php
r23689 r24912 2 2 /* 3 3 4 @version V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.4 @version v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. 5 5 Latest version is available at http://adodb.sourceforge.net 6 6 … … 347 347 } 348 348 349 // I have an ON INSERT trigger on a table that sets other columns in the table. 350 // So, I find that for myTable, I want to reload an active record after saving it. -- Malcolm Cook 351 function Reload() 352 { 353 $db =& $this->DB(); if (!$db) return false; 354 $table =& $this->TableInfo(); 355 $where = $this->GenWhere($db, $table); 356 return($this->Load($where)); 357 } 358 349 359 // set a numeric array (using natural table field ordering) as object properties 350 360 function Set(&$row) … … 413 423 if (empty($val)) return 'null'; 414 424 425 case 'B': 426 case 'N': 415 427 case 'C': 416 428 case 'X': -
development/zikula-1/includes/classes/adodb/adodb-csvlib.inc.php
r23689 r24912 9 9 /* 10 10 11 V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.11 v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. 12 12 Released under both BSD license and Lesser GPL library license. 13 13 Whenever there is any discrepancy between the two licenses, … … 265 265 */ 266 266 function adodb_write_file($filename, $contents,$debug=false) 267 { 267 { 268 268 # http://www.php.net/bugs.php?id=9203 Bug that flock fails on Windows 269 269 # So to simulate locking, we assume that rename is an atomic operation. … … 286 286 else $ok = false; 287 287 fclose($fd); 288 288 289 289 if ($ok) { 290 chmod($tmpname,0644);290 @chmod($tmpname,0644); 291 291 // the tricky moment 292 292 @unlink($filename); … … 306 306 else $ok = false; 307 307 fclose($fd); 308 chmod($filename,0644);308 @chmod($filename,0644); 309 309 }else { 310 310 fclose($fd); -
development/zikula-1/includes/classes/adodb/adodb-datadict.inc.php
r23689 r24912 2 2 3 3 /** 4 V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.4 v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. 5 5 Released under both BSD license and Lesser GPL library license. 6 6 Whenever there is any discrepancy between the two licenses, … … 986 986 && (isset($flds[0][2]) && is_numeric($flds[0][2]))) { 987 987 if ($this->debug) ADOConnection::outp(sprintf("<h3>%s cannot be changed to %s currently</h3>", $flds[0][0], $flds[0][1])); 988 #echo "<h3>$this->alterCol cannot be changed to $flds currently</h3>";988 //echo "<h3>$this->alterCol cannot be changed to $flds currently</h3>"; 989 989 continue; 990 990 } -
development/zikula-1/includes/classes/adodb/adodb-errorhandler.inc.php
r23689 r24912 1 1 <?php 2 2 /** 3 * @version V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.3 * @version v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. 4 4 * Released under both BSD license and Lesser GPL library license. 5 5 * Whenever there is any discrepancy between the two licenses, -
development/zikula-1/includes/classes/adodb/adodb-error.inc.php
r23689 r24912 1 1 <?php 2 2 /** 3 * @version V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.3 * @version v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. 4 4 * Released under both BSD license and Lesser GPL library license. 5 5 * Whenever there is any discrepancy between the two licenses, -
development/zikula-1/includes/classes/adodb/adodb-errorpear.inc.php
r23689 r24912 1 1 <?php 2 2 /** 3 * @version V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.3 * @version v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. 4 4 * Released under both BSD license and Lesser GPL library license. 5 5 Whenever there is any discrepancy between the two licenses, -
development/zikula-1/includes/classes/adodb/adodb-exceptions.inc.php
r23689 r24912 2 2 3 3 /** 4 * @version V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.4 * @version v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. 5 5 * Released under both BSD license and Lesser GPL library license. 6 6 * Whenever there is any discrepancy between the two licenses, -
development/zikula-1/includes/classes/adodb/adodb.inc.php
r23689 r24912 1 <?php 1 <?php 2 2 /* 3 3 * Set tabs to 4 for best viewing. … … 15 15 \mainpage 16 16 17 @version V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved.17 @version v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. 18 18 19 19 Released under both BSD license and Lesser GPL library license. You can choose which license … … 58 58 $ADODB_COMPAT_FETCH, // If $ADODB_COUNTRECS and this is true, $rs->fields is available on EOF 59 59 $ADODB_FETCH_MODE, // DEFAULT, NUM, ASSOC or BOTH. Default follows native driver default... 60 $ADODB_GETONE_EOF, 60 61 $ADODB_QUOTE_FIELDNAMES; // Allows you to force quotes (backticks) around field names in queries generated by getinsertsql and getupdatesql. 61 62 … … 154 155 $ADODB_CACHE_DIR, // directory to cache recordsets 155 156 $ADODB_FETCH_MODE, 157 $ADODB_GETONE_EOF, 156 158 $ADODB_FORCE_TYPE, 159 $ADODB_CACHE_CLASS, 160 $ADODB_CACHE, 157 161 $ADODB_QUOTE_FIELDNAMES; 158 162 159 163 $ADODB_FETCH_MODE = ADODB_FETCH_DEFAULT; 160 164 $ADODB_FORCE_TYPE = ADODB_FORCE_VALUE; 161 162 165 $ADODB_CACHE_CLASS = 'ADODB_Cache_File'; 166 $ADODB_GETONE_EOF = null; 167 163 168 if (!isset($ADODB_CACHE_DIR)) { 164 169 $ADODB_CACHE_DIR = '/tmp'; //(isset($_ENV['TMP'])) ? $_ENV['TMP'] : '/tmp'; … … 177 182 * ADODB version as a string. 178 183 */ 179 $ADODB_vers = ' V4.97 22 Jan 2008 (c) 2000-2008 John Lim (jlim#natsoft.com.my). All rights reserved. Released BSD & LGPL.';184 $ADODB_vers = 'v4.991 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com). All rights reserved. Released BSD & LGPL.'; 180 185 181 186 /** … … 227 232 } 228 233 } 234 235 // class for caching 236 class ADODB_Cache_File { 237 238 var $createdir = true; // requires creation of temp dirs 239 240 function ADODB_Cache_File() 241 { 242 global $ADODB_INCLUDED_CSV; 243 if (empty($ADODB_INCLUDED_CSV)) include(ADODB_DIR.'/adodb-csvlib.inc.php'); 244 } 245 246 // write serialised recordset to cache item/file 247 function writecache($filename, $contents, $debug, $secs2cache) 248 { 249 return adodb_write_file($filename, $contents,$debug); 250 } 251 252 // load serialised recordset and unserialise it 253 function &readcache($filename, &$err, $secs2cache, $rsClass) 254 { 255 $rs = csv2rs($filename,$err,$secs2cache,$rsClass); 256 return $rs; 257 } 258 259 // flush all items in cache 260 function flushall($debug=false) 261 { 262 global $ADODB_CACHE_DIR; 263 264 $rez = false; 265 266 if (strlen($ADODB_CACHE_DIR) > 1) { 267 $rez = $this->_dirFlush($ADODB_CACHE_DIR); 268 if ($debug) DOConnection::outp( "flushall: $dir<br><pre>\n". $rez."</pre>"); 269 } 270 return $rez; 271 } 272 273 // flush one file in cache 274 function flushcache($f, $debug=false) 275 { 276 if (!@unlink($f)) { 277 if ($debug) ADOConnection::outp( "flushcache: failed for $f"); 278 } 279 } 280 281 function getdirname($hash) 282 { 283 global $ADODB_CACHE_DIR; 284 if (!isset($this->notSafeMode)) $this->notSafeMode = !ini_get('safe_mode'); 285 return ($this->notSafeMode) ? $ADODB_CACHE_DIR.'/'.substr($hash,0,2) : $ADODB_CACHE_DIR; 286 } 287 288 // create temp directories 289 function createdir($hash, $debug) 290 { 291 $dir = $this->getdirname($hash); 292 if ($this->notSafeMode && !file_exists($dir)) { 293 $oldu = umask(0); 294 if (!@mkdir($dir,0771)) if(!is_dir($dir) && $debug) ADOConnection::outp("Cannot create $dir"); 295 umask($oldu); 296 } 297 298 return $dir; 299 } 300 301 /** 302 * Private function to erase all of the files and subdirectories in a directory. 303 * 304 * Just specify the directory, and tell it if you want to delete the directory or just clear it out. 305 * Note: $kill_top_level is used internally in the function to flush subdirectories. 306 */ 307 function _dirFlush($dir, $kill_top_level = false) 308 { 309 if(!$dh = @opendir($dir)) return; 310 311 while (($obj = readdir($dh))) { 312 if($obj=='.' || $obj=='..') continue; 313 $f = $dir.'/'.$obj; 314 315 if (strpos($obj,'.cache')) @unlink($f); 316 if (is_dir($f)) $this->_dirFlush($f, true); 317 } 318 if ($kill_top_level === true) @rmdir($dir); 319 return true; 320 } 321 } 322 323 229 324 230 325 //============================================================================================== … … 425 520 426 521 $this->_isPersistentConnection = false; 522 523 global $ADODB_CACHE; 524 if (empty($ADODB_CACHE)) $this->_CreateCache(); 525 427 526 if ($forceNew) { 428 527 if ($rez=$this->_nconnect($this->host, $this->user, $this->password, $this->database)) return true; … … 441 540 $fn($this->databaseType,'CONNECT',$this->ErrorNo(),$err,$this->host,$this->database,$this); 442 541 443 444 542 $this->_connectionID = false; 445 543 if ($this->debug) ADOConnection::outp( $this->host.': '.$err); … … 483 581 return $this->Connect($argHostname,$argUsername,$argPassword,$argDatabaseName); 484 582 583 485 584 if ($argHostname != "") $this->host = $argHostname; 486 585 if ($argUsername != "") $this->user = $argUsername; … … 489 588 490 589 $this->_isPersistentConnection = true; 590 591 global $ADODB_CACHE; 592 if (empty($ADODB_CACHE)) $this->_CreateCache(); 593 594 491 595 if ($rez = $this->_pconnect($this->host, $this->user, $this->password, $this->database)) return true; 492 596 if (isset($rez)) { … … 505 609 if ($this->debug) ADOConnection::outp( $this->host.': '.$err); 506 610 return $ret; 611 } 612 613 // create cache class. Code is backward compat with old memcache implementation 614 function _CreateCache() 615 { 616 global $ADODB_CACHE, $ADODB_CACHE_CLASS; 617 618 if ($this->memCache) { 619 global $ADODB_INCLUDED_MEMCACHE; 620 621 if (empty($ADODB_INCLUDED_MEMCACHE)) include(ADODB_DIR.'/adodb-memcache.lib.inc.php'); 622 $ADODB_CACHE = new ADODB_Cache_MemCache($this); 623 } else 624 $ADODB_CACHE = new $ADODB_CACHE_CLASS($this); 625 507 626 } 508 627 … … 1180 1299 $ADODB_COUNTRECS = false; 1181 1300 1182 if ($offset>0){ 1183 if ($secs2cache != 0) $rs = &$this->CacheExecute($secs2cache,$sql,$inputarr); 1184 else $rs = &$this->Execute($sql,$inputarr); 1185 } else { 1186 if ($secs2cache != 0) $rs = &$this->CacheExecute($secs2cache,$sql,$inputarr); 1187 else $rs = &$this->Execute($sql,$inputarr); 1188 } 1301 if ($secs2cache != 0) $rs = &$this->CacheExecute($secs2cache,$sql,$inputarr); 1302 else $rs = &$this->Execute($sql,$inputarr); 1303 1189 1304 $ADODB_COUNTRECS = $savec; 1190 1305 if ($rs && !$rs->EOF) { … … 1290 1405 } 1291 1406 1407 // $where should include 'WHERE fld=value' 1408 function GetMedian($table, $field,$where = '') 1409 {
