Permalink
Browse files

Upgraded to ADOdb 4.5.1. Contains a lot of small fixes and speed-ups.

  • Loading branch information...
moodler
moodler committed Aug 7, 2004
1 parent f5f346a commit fab7e07e19490b12b925356394b3fc15ef0812b4
Showing with 1,550 additions and 827 deletions.
  1. +53 −1 lib/adodb/adodb-csvlib.inc.php
  2. +1 −1 lib/adodb/adodb-datadict.inc.php
  3. +1 −1 lib/adodb/adodb-errorhandler.inc.php
  4. +1 −1 lib/adodb/adodb-exceptions.inc.php
  5. +8 −9 lib/adodb/adodb-iterator.inc.php
  6. +146 −37 lib/adodb/adodb-lib.inc.php
  7. +2 −1 lib/adodb/adodb-pager.inc.php
  8. +2 −2 lib/adodb/adodb-perf.inc.php
  9. +1 −1 lib/adodb/adodb-php4.inc.php
  10. +23 −10 lib/adodb/adodb-time.inc.php
  11. +359 −116 lib/adodb/adodb-xmlschema.inc.php
  12. +183 −206 lib/adodb/adodb.inc.php
  13. +1 −1 lib/adodb/datadict/datadict-access.inc.php
  14. +1 −1 lib/adodb/datadict/datadict-db2.inc.php
  15. +1 −1 lib/adodb/datadict/datadict-firebird.inc.php
  16. +1 −1 lib/adodb/datadict/datadict-generic.inc.php
  17. +1 −1 lib/adodb/datadict/datadict-ibase.inc.php
  18. +1 −1 lib/adodb/datadict/datadict-informix.inc.php
  19. +1 −1 lib/adodb/datadict/datadict-mssql.inc.php
  20. +1 −1 lib/adodb/datadict/datadict-mysql.inc.php
  21. +1 −1 lib/adodb/datadict/datadict-oci8.inc.php
  22. +1 −1 lib/adodb/datadict/datadict-postgres.inc.php
  23. +1 −1 lib/adodb/datadict/datadict-sybase.inc.php
  24. +1 −1 lib/adodb/drivers/adodb-access.inc.php
  25. +14 −4 lib/adodb/drivers/adodb-ado.inc.php
  26. +1 −1 lib/adodb/drivers/adodb-ado_access.inc.php
  27. +1 −2 lib/adodb/drivers/adodb-ado_mssql.inc.php
  28. +1 −1 lib/adodb/drivers/adodb-borland_ibase.inc.php
  29. +1 −1 lib/adodb/drivers/adodb-csv.inc.php
  30. +6 −6 lib/adodb/drivers/adodb-db2.inc.php
  31. +1 −1 lib/adodb/drivers/adodb-firebird.inc.php
  32. +40 −43 lib/adodb/drivers/adodb-ibase.inc.php
  33. +1 −2 lib/adodb/drivers/adodb-informix72.inc.php
  34. +1 −1 lib/adodb/drivers/adodb-ldap.inc.php
  35. +28 −7 lib/adodb/drivers/adodb-mssql.inc.php
  36. +68 −41 lib/adodb/drivers/adodb-mysql.inc.php
  37. +76 −79 lib/adodb/drivers/adodb-mysqli.inc.php
  38. +60 −14 lib/adodb/drivers/adodb-mysqlt.inc.php
  39. +1 −2 lib/adodb/drivers/adodb-netezza.inc.php
  40. +49 −6 lib/adodb/drivers/adodb-oci8.inc.php
  41. +59 −43 lib/adodb/drivers/adodb-oci8po.inc.php
  42. +21 −9 lib/adodb/drivers/adodb-odbc.inc.php
  43. +14 −4 lib/adodb/drivers/adodb-odbc_mssql.inc.php
  44. +1 −1 lib/adodb/drivers/adodb-odbc_oracle.inc.php
  45. +2 −7 lib/adodb/drivers/adodb-odbtp.inc.php
  46. +2 −3 lib/adodb/drivers/adodb-odbtp_unicode.inc.php
  47. +3 −3 lib/adodb/drivers/adodb-oracle.inc.php
  48. +1 −1 lib/adodb/drivers/adodb-pdo.inc.php
  49. +1 −1 lib/adodb/drivers/adodb-postgres.inc.php
  50. +7 −7 lib/adodb/drivers/adodb-postgres64.inc.php
  51. +1 −1 lib/adodb/drivers/adodb-postgres7.inc.php
  52. +1 −1 lib/adodb/drivers/adodb-proxy.inc.php
  53. +1 −1 lib/adodb/drivers/adodb-sapdb.inc.php
  54. +1 −1 lib/adodb/drivers/adodb-sqlite.inc.php
  55. +1 −1 lib/adodb/drivers/adodb-sqlitepo.inc.php
  56. +2 −2 lib/adodb/drivers/adodb-sybase.inc.php
  57. +1 −3 lib/adodb/drivers/adodb-vfp.inc.php
  58. +1 −1 lib/adodb/perf/perf-db2.inc.php
  59. +1 −1 lib/adodb/perf/perf-informix.inc.php
  60. +1 −1 lib/adodb/perf/perf-mssql.inc.php
  61. +1 −1 lib/adodb/perf/perf-mysql.inc.php
  62. +20 −5 lib/adodb/perf/perf-oci8.inc.php
  63. +1 −1 lib/adodb/perf/perf-postgres.inc.php
  64. +0 −2 lib/adodb/session/adodb-compress-bzip2.php
  65. +0 −1 lib/adodb/session/adodb-compress-gzip.php
  66. +0 −1 lib/adodb/session/adodb-cryptsession.php
  67. +0 −1 lib/adodb/session/adodb-encrypt-mcrypt.php
  68. +0 −2 lib/adodb/session/adodb-encrypt-md5.php
  69. +0 −2 lib/adodb/session/adodb-encrypt-secret.php
  70. +0 −1 lib/adodb/session/adodb-session-clob.php
  71. +0 −1 lib/adodb/session/adodb-session.php
  72. +1 −1 lib/adodb/tests/benchmark.php
  73. +1 −1 lib/adodb/tests/test-datadict.php
  74. +14 −9 lib/adodb/tests/test-php5.php
  75. +4 −2 lib/adodb/tests/test-xmlschema.php
  76. +94 −23 lib/adodb/tests/test.php
  77. +1 −1 lib/adodb/tests/test2.php
  78. +1 −1 lib/adodb/tests/test3.php
  79. +1 −1 lib/adodb/tests/test4.php
  80. +1 −1 lib/adodb/tests/test5.php
  81. +1 −1 lib/adodb/tests/testcache.php
  82. +24 −25 lib/adodb/tests/testdatabases.inc.php
  83. +17 −3 lib/adodb/tests/testoci8.php
  84. +1 −1 lib/adodb/tests/testoci8cursor.php
  85. +1 −1 lib/adodb/tests/testpaging.php
  86. +1 −1 lib/adodb/tests/testpear.php
  87. +9 −2 lib/adodb/tests/testsessions.php
  88. +1 −1 lib/adodb/tohtml.inc.php
  89. +38 −33 lib/adodb/xmlschema.dtd
  90. +54 −0 lib/adodb/xsl/remove-0.2.xsl
@@ -7,7 +7,7 @@
$ADODB_INCLUDED_CSV = 1;
/*
- V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
+ V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
@@ -249,4 +249,56 @@ function &csv2rs($url,&$err,$timeout=0)
$rs->InitArrayFields($arr,$flds);
return $rs;
}
+
+
+ /**
+ * Save a file $filename and its $contents (normally for caching) with file locking
+ */
+ function adodb_write_file($filename, $contents,$debug=false)
+ {
+ # http://www.php.net/bugs.php?id=9203 Bug that flock fails on Windows
+ # So to simulate locking, we assume that rename is an atomic operation.
+ # First we delete $filename, then we create a $tempfile write to it and
+ # rename to the desired $filename. If the rename works, then we successfully
+ # modified the file exclusively.
+ # What a stupid need - having to simulate locking.
+ # Risks:
+ # 1. $tempfile name is not unique -- very very low
+ # 2. unlink($filename) fails -- ok, rename will fail
+ # 3. adodb reads stale file because unlink fails -- ok, $rs timeout occurs
+ # 4. another process creates $filename between unlink() and rename() -- ok, rename() fails and cache updated
+ if (strncmp(PHP_OS,'WIN',3) === 0) {
+ // skip the decimal place
+ $mtime = substr(str_replace(' ','_',microtime()),2);
+ // getmypid() actually returns 0 on Win98 - never mind!
+ $tmpname = $filename.uniqid($mtime).getmypid();
+ if (!($fd = fopen($tmpname,'a'))) return false;
+ $ok = ftruncate($fd,0);
+ if (!fwrite($fd,$contents)) $ok = false;
+ fclose($fd);
+ chmod($tmpname,0644);
+ // the tricky moment
+ @unlink($filename);
+ if (!@rename($tmpname,$filename)) {
+ unlink($tmpname);
+ $ok = false;
+ }
+ if (!$ok) {
+ if ($debug) ADOConnection::outp( " Rename $tmpname ".($ok? 'ok' : 'failed'));
+ }
+ return $ok;
+ }
+ if (!($fd = fopen($filename, 'a'))) return false;
+ if (flock($fd, LOCK_EX) && ftruncate($fd, 0)) {
+ $ok = fwrite( $fd, $contents );
+ fclose($fd);
+ chmod($filename,0644);
+ }else {
+ fclose($fd);
+ if ($debug)ADOConnection::outp( " Failed acquiring lock for $filename<br>\n");
+ $ok = false;
+ }
+
+ return $ok;
+ }
?>
@@ -1,7 +1,7 @@
<?php
/**
- V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
+ V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -1,6 +1,6 @@
<?php
/**
- * @version V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
@@ -1,7 +1,7 @@
<?php
/**
- * @version V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
+ * @version V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
* Released under both BSD license and Lesser GPL library license.
* Whenever there is any discrepancy between the two licenses,
* the BSD license will take precedence.
@@ -1,7 +1,7 @@
<?php
/*
- V4.50 6 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
+ V4.51 29 July 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
@@ -58,14 +58,7 @@ function __call($func, $params)
{
return call_user_func_array(array($this->rs, $func), $params);
}
-
- function __toString()
- {
- if (isset($rs->databaseType)) $s = ' for '.$rs->databaseType;
- else $s = '';
-
- return 'ADODB Iterator'.$s;
- }
+
function hasMore()
{
@@ -79,6 +72,12 @@ class ADODB_BASE_RS implements IteratorAggregate {
function getIterator() {
return new ADODB_Iterator($this);
}
+
+ function __toString()
+ {
+ include_once(ADODB_DIR.'/toexport.inc.php');
+ return _adodb_export($this,',',',',false,true);
+ }
}
?>
Oops, something went wrong.

0 comments on commit fab7e07

Please sign in to comment.