Compare commits

...
749 Commits
Author SHA1 Message Date
SVN Migration 6bc1a14f56 This commit was manufactured by cvs2svn to create tag 'php_5_2_1'. 2007-02-07 00:45:05 +00:00
Ilia Alshanetsky ee626ccb51 5.2.1 2007-02-07 00:45:04 +00:00
Ilia Alshanetsky 629d7cf43f Fixed Bug #40274 (Sessions fail with numeric root keys). 2007-02-06 00:01:18 +00:00
Andrei Zmievski 871fb78154 Update ! docs. 2007-02-05 17:57:51 +00:00
Andi Gutmans a11e0b5ef1 - Make sure to be ANSI C compliant 2007-02-05 05:15:16 +00:00
Frank M. Kromann b436ad2af5 #39213
Fix for '' returned as ' '.
This only works with FreeTDS as microsofts library returns a length of 1 for an empty string!
2007-02-04 21:19:37 +00:00
Frank M. Kromann 850998256c Fix win32 build 2007-02-04 00:21:51 +00:00
Marcus Boerger 0709a0490f - MFH Add PHPAPI to stuff needed by streams API for shared exts
- MFH Readonly issue fix to memory streams option handling (still not
  activated in 5.2.1 though)
2007-02-03 16:40:05 +00:00
andy wharmby 74cafe0840 Fixed bug #37927 (Prevent trap when COM extension processes argument of type VT_DISPATCH|VT_REF) 2007-02-02 15:44:06 +00:00
andy wharmby cda82bc0a3 Fixed bug #34564 (COM extension not returning modified "out" argument) 2007-02-02 15:27:35 +00:00
Ilia Alshanetsky a8c006235c Better generated parser 2007-02-02 00:03:33 +00:00
Ilia Alshanetsky 79dfb302b1 Fixed test mixup 2007-02-02 00:00:33 +00:00
Dmitry Stogov 44297ddea8 Removed dead code 2007-02-01 16:23:28 +00:00
Dmitry Stogov ed30d91cd6 Fixed possible crash because of dereference of NULL 2007-02-01 15:23:46 +00:00
Dmitry Stogov 009f5a3937 Enable canary protection in DEBUG mode only. 2007-02-01 15:08:10 +00:00
Antony Dovgal c313af32a9 MFH 2007-02-01 14:21:01 +00:00
Antony Dovgal 0c84a4d927 MFH: free class_name when necessary 2007-02-01 14:07:43 +00:00
Antony Dovgal 6e8654aae1 plug leak 2007-02-01 14:02:35 +00:00
Antony Dovgal 82f70c9493 fix leaks on error 2007-02-01 13:45:25 +00:00
Ilia Alshanetsky c219c6f4a8 Fixed bug #40285 (The PDO prepare parser goes into an infinite loop in
some instances).
2007-02-01 00:12:39 +00:00
Antony Dovgal 56bb90399e BFN 2007-01-31 13:57:58 +00:00
Antony Dovgal cdaff68610 MFH: improve tests 2007-01-31 13:56:16 +00:00
Antony Dovgal 4f6f150490 MFH: fix segfault on rebindinging and rexecuting a statement with LOBs
fix compile failure in ZTS mode when collections support is missing
2007-01-31 13:55:43 +00:00
Ilia Alshanetsky 9eb6d36c39 Prepare news file for release 2007-01-30 01:27:29 +00:00
Rui Hirokawa 693c9a7d2c fixed incompatibility with PHP 5.2.0 for encoding conversion between ShiftJIS(CP932), eucJP, ISO-2022-JP. 2007-01-29 22:53:47 +00:00
Dmitry Stogov d44cb7fa7b Prevent flush of closed handle on php_module_shutdown() 2007-01-29 19:36:01 +00:00
Pierre Joye 3265d023a4 - #40228 2007-01-29 15:25:35 +00:00
Pierre Joye 601a77b3a3 - #40228, ZipArchive::extractTo does create empty directories
recursively
2007-01-29 15:25:06 +00:00
Dmitry Stogov 52f6312866 Fixed bug #40259 (ob_start call many times - memory error). (Dmitry) 2007-01-29 11:21:31 +00:00
Antony Dovgal 58e96c4c10 nullify param.parameter and avoid destroying it twice 2007-01-27 21:53:26 +00:00
Marcus Boerger 0903f26151 - Disable memory streams set option until 5.2.2 2007-01-27 20:31:51 +00:00
Marcus Boerger d10beb67c3 - MFH truncate support for mem/temp streams 2007-01-27 20:25:11 +00:00
Antony Dovgal c98dcd5a21 use length - 1 when we fetch it from hashes 2007-01-26 15:33:18 +00:00
Dmitry Stogov cb443c6e5a Fixed bug #40231 (file_exists incorrectly reports false) 2007-01-26 15:15:16 +00:00
Antony Dovgal c5732112a9 fix leak
readuce size of the buffer to prevent ORA-01461
2007-01-26 15:07:45 +00:00
Ilia Alshanetsky 7c166ddf86 Back to dev 2007-01-26 00:21:20 +00:00
Ilia Alshanetsky 15bcf9e38e 5.2.1RC4 2007-01-26 00:15:03 +00:00
Antony Dovgal 46baad774f add package2.xml 2007-01-25 16:55:40 +00:00
Antony Dovgal 40ca697a67 add missing ifdefs 2007-01-25 14:38:45 +00:00
Antony Dovgal 4cb734b05f setlocale() returns static buffer, which must be copied 2007-01-25 13:37:04 +00:00
Antony Dovgal 0bc0e57b85 MFH: fix #40189 (possible endless loop in zlib.inflate stream filter) 2007-01-25 12:22:21 +00:00
Antony Dovgal de3c2038af PHP4 compatibility 2007-01-25 09:31:23 +00:00
Rasmus Lerdorf 49dbf804ad Fix typo 2007-01-25 06:12:58 +00:00
Ilia Alshanetsky 49c0823800 Added safety checks to the code 2007-01-25 00:27:19 +00:00
Ilia Alshanetsky 094a5717b1 Eliminate strcat() and strcpy() 2007-01-25 00:26:51 +00:00
Antony Dovgal 93951f1931 prepare to release 1.2.3 2007-01-24 14:34:13 +00:00
Ilia Alshanetsky eb6b99d7df strcat() -> strlcat() 2007-01-24 00:45:54 +00:00
Antony Dovgal d32dc5bda0 MFH 2007-01-24 00:33:51 +00:00
Nuno Lopes a2b7b84685 add test 2007-01-23 19:26:24 +00:00
Nuno Lopes 8e8b369bc2 fix a few crashes 2007-01-23 19:23:29 +00:00
Dmitry Stogov 1ef02490c3 Fixed bug #40200 (The FastCgi version has different realpath results than thread safe version) 2007-01-23 18:14:52 +00:00
Dmitry Stogov dfa95b718f Fixed wrong realpath() result for unexistent files on win32 2007-01-23 17:03:48 +00:00
Hannes Magnusson 14fb4afd5c Fix typo 2007-01-23 12:37:21 +00:00
Ilia Alshanetsky 17864fc3e9 emalloc() -> safe_emalloc() 2007-01-23 00:23:17 +00:00
Antony Dovgal 725217571e fix PECL bug #7295 (ORA-01405: fetched column value is NULL on LOB fields) 2007-01-22 12:49:22 +00:00
Dmitry Stogov 933c26de41 Fixed bug #39367 (clearstatcache() doesn't clear realpath cache)
Fixed bug #40092 (chroot() doesn't clear realpath cache)
2007-01-22 09:31:46 +00:00
Antony Dovgal a4ae84d014 MFH 2007-01-22 09:08:28 +00:00
Antony Dovgal b24fd9a3d6 fix test 2007-01-22 08:55:47 +00:00
Antony Dovgal 78e610b4f9 fix classname 2007-01-22 08:36:21 +00:00
Antony Dovgal eae1072ccc MFH 2007-01-22 08:21:57 +00:00
Antony Dovgal 2c36778e47 MFH: fix #40191 (use of array_unique() with objects triggers segfault) 2007-01-22 08:17:26 +00:00
Ilia Alshanetsky 8ddcd35d17 Fixed typos 2007-01-21 19:52:44 +00:00
Marcus Boerger 8ed3a86161 - MFH Add *.mem 2007-01-21 13:05:32 +00:00
Marcus Boerger d2c8a3bb63 - Add tests 2007-01-21 12:30:19 +00:00
Antony Dovgal d2c5721f41 MFH: catch overflow right away 2007-01-20 23:10:02 +00:00
Ilia Alshanetsky 9bf088ce36 Fixed bug #39450 (getenv() fills other super-globals). 2007-01-20 22:16:24 +00:00
Antony Dovgal 1b002cf39f use getenv() 2007-01-20 22:12:55 +00:00
Rob Richards 75fdefba0c MFH: fix accessing public key from x509 resource
add test
fix test under win32
2007-01-20 22:08:29 +00:00
Antony Dovgal 6bef5f8e80 typo in the test name 2007-01-20 19:19:29 +00:00
Ilia Alshanetsky a719e16f7c CS 2007-01-20 16:22:51 +00:00
Nuno Lopes 65975bfc15 new tests. bump code coverage to 81% 2007-01-20 12:50:19 +00:00
Nuno Lopes 4b8911d062 fix another crash 2007-01-20 12:49:35 +00:00
Nuno Lopes f3f2d827db fix crash. tests will follow 2007-01-20 12:27:18 +00:00
Antony Dovgal 216d041717 MFH 2007-01-19 22:33:25 +00:00
Antony Dovgal d291b4351e MFH 2007-01-19 21:00:35 +00:00
Antony Dovgal 4c6e1df9e2 MFH: improve utf8_mime2text() signature detection 2007-01-19 20:45:09 +00:00
Antony Dovgal a5f3e15114 MFH 2007-01-19 19:43:30 +00:00
Nuno Lopes 3e45bc0a51 update install instructions from phpdoc XMl sources 2007-01-19 19:25:02 +00:00
Nuno Lopes d27d7619be fix segfaults with new libtidy. the patch is backwards compatible 2007-01-19 18:50:26 +00:00
Antony Dovgal 7e74ff0ff1 MFH 2007-01-19 18:03:33 +00:00
Antony Dovgal 504e9e31f3 MFH: fix #40169 (CURLOPT_TCP_NODELAY only available in curl >= 7.11.2) 2007-01-19 15:38:51 +00:00
Pierre Joye 4dafc7a2fa - save/restore the alpha blending mode correctly in imagefill and
imagefilltoborder
2007-01-19 15:03:56 +00:00
Antony Dovgal ebd7c13e8b MFH: fix #40168 2007-01-19 14:50:11 +00:00
Ilia Alshanetsky aeddf73dc4 Fix win32 build 2007-01-19 00:17:43 +00:00
Ilia Alshanetsky 5500a08ba3 Back to dev 2007-01-19 00:13:49 +00:00
Ilia Alshanetsky cbd3a64136 5.2.1RC3 2007-01-19 00:03:21 +00:00
Ilia Alshanetsky ef3fcf2894 Added read-timeout context option "timeout" for HTTP streams.
# A patch mostly by Hannes
2007-01-19 00:02:13 +00:00
Ilia Alshanetsky 55eef07a71 Old bug fixing news 2007-01-18 23:29:34 +00:00
Ilia Alshanetsky 4383f51c44 Syntax highlighting fix for hex numbers.
# Patch by Matt Wilmas
2007-01-18 23:28:08 +00:00
Ilia Alshanetsky 6f98a771e6 Fixed bug #39993 (tr_TR.UTF-8 locale has problems with PHP). 2007-01-18 23:20:24 +00:00
Antony Dovgal 84a827e0d4 MFH 2007-01-18 16:21:32 +00:00
Nuno Lopes 58d4b44ae7 only 2 bits are needed for shutdown(2) method (only 3 possible values). this is new code in 5.2.1, so don't worry.. 2007-01-18 16:05:48 +00:00
Antony Dovgal 5f12c71382 MFH 2007-01-18 15:55:09 +00:00
Antony Dovgal 05c11fdfb2 MFH 2007-01-18 15:41:01 +00:00
Antony Dovgal c592304ac0 MFH: use snprintf() 2007-01-18 15:29:30 +00:00
Antony Dovgal e506abc408 MFH: improve check configure for new version of utf8_mime2text() 2007-01-18 14:05:21 +00:00
Antony Dovgal 04add4c727 MFH: use strlcat() 2007-01-18 14:03:38 +00:00
Antony Dovgal 5a23201d82 moved ext/informix to PECL 2007-01-18 12:28:10 +00:00
Antony Dovgal b6a89efcda fix folding 2007-01-18 12:20:15 +00:00
Antony Dovgal fc9970a6e9 MFH: fix #40129 (iconv extension doesn't compile with CodeWarrior on Netware)
patch by gk at gknw dot de
2007-01-17 20:32:53 +00:00
Antony Dovgal d6a4586197 MFH 2007-01-17 08:25:32 +00:00
Ilia Alshanetsky b4f76016fd Fixed output code inside odbc_result_all() 2007-01-16 18:56:06 +00:00
Antony Dovgal bb691f155c MFH: return false if realpath()/getcwd() fail 2007-01-16 14:42:38 +00:00
Antony Dovgal 5b4043554a MFH: free temp cwd_state struct on error 2007-01-16 14:02:19 +00:00
Antony Dovgal bd6c862fee MFH 2007-01-16 11:19:10 +00:00
Antony Dovgal 7ad1c3c5f2 MFH: add trailing '\0' to stream hashes 2007-01-15 17:07:08 +00:00
Antony Dovgal 7dd989fd4a revert the patch temporarily, I need to test a bigger patch in HEAD.. 2007-01-15 16:03:42 +00:00
Antony Dovgal c463e98e99 MFH 2007-01-15 14:59:49 +00:00
Antony Dovgal 4fca731b0b fix test 2007-01-15 10:31:14 +00:00
Antony Dovgal 7b70e5be45 missing comma 2007-01-15 10:08:34 +00:00
Antony Dovgal 9ca5652f70 fix error message and #40111 2007-01-15 10:04:44 +00:00
Frank M. Kromann c2cfc1eeee Fix mysql -> dblib 2007-01-15 01:56:09 +00:00
Ilia Alshanetsky d4fbb3ca53 Fixed bug #40127 (apache2handler doesnt compile on Netware). 2007-01-14 16:59:05 +00:00
Ilia Alshanetsky c5588fae3a Fixed bug #40121 (PDO_DBLIB driver wont free statements). 2007-01-14 16:57:50 +00:00
Hannes Magnusson a6ff74de28 Fix typo in error message 2007-01-14 14:22:40 +00:00
Ilia Alshanetsky f7d1d3ef44 Improve validation of argnum, width and precision. 2007-01-13 16:31:17 +00:00
Nuno Lopes 8815fdf5e0 OMG, this line was really bogus (and allocating huge amounts of memory unecessarly) 2007-01-13 11:21:21 +00:00
Nuno Lopes e22c9cd775 fix valgrind error in test bug24594.phpt
while at it, remove some dead code and change the pts vector to char to save (much) memory
# Pierre: one more to merge ;)
2007-01-13 11:16:15 +00:00
Frank M. Kromann 2cca49ac01 MFH: Kill warnings when mt is not installed or is found as the tape command under cygwin 2007-01-13 03:32:28 +00:00
Dmitry Stogov 2f586e965e Fixed bug #39969 (ini setting short_open_tag has no effect when using --enable-maintainer-zts) 2007-01-12 14:37:46 +00:00
Hannes Magnusson 6b7144d0b8 Fix build
#Thanks Andy
2007-01-12 14:31:28 +00:00
Antony Dovgal e351aedbdc MFH 2007-01-12 12:32:15 +00:00
Antony Dovgal e8d2c9489d MFH: nuke skeleton leftovers 2007-01-12 12:17:32 +00:00
Hannes Magnusson b865d176de Typo 2007-01-12 12:11:18 +00:00
Antony Dovgal 7d4ea80b07 MFH 2007-01-12 12:06:45 +00:00
Antony Dovgal 5941c1d28c MFH 2007-01-12 09:10:16 +00:00
Ilia Alshanetsky 25e7373009 Use long instead of int where long is expected. 2007-01-12 02:03:59 +00:00
Ilia Alshanetsky 2ae036f038 Fixed bug #40098 (php_fopen_primary_script() not thread safe).
Adjusted previous fixes for similar issue to handle sysconf() failures
2007-01-12 01:46:11 +00:00
Antony Dovgal ed30473f7c MFH 2007-01-11 22:23:20 +00:00
Dmitry Stogov 2e1a2438b5 Fixed bug #35634 (Erroneous "Class declarations may not be nested" error raised). (Carl P. Corliss) 2007-01-11 16:47:32 +00:00
Antony Dovgal 870bd0b99f MFH 2007-01-11 16:45:37 +00:00
Antony Dovgal 7c92982b5b MFH 2007-01-11 15:51:37 +00:00
Antony Dovgal f361d9e4f0 MFH: fix #39988 (type argument of oci_define_by_name() is ignored)
patch and tests by Chris Jones
2007-01-11 12:01:08 +00:00
Antony Dovgal 12d54fa683 MFH: fix #40078 (ORA-01405 when fetching NULL values using oci_bind_array_by_name()) 2007-01-11 11:27:52 +00:00
Sara Golemon 5e74c607a2 MFH 2007-01-11 02:33:07 +00:00
Johannes Schlüter a95781d9bf - MFH: Bump year 2007-01-10 22:17:27 +00:00
Ilia Alshanetsky b5228f0c6c Fixed bug #40091 (spl_autoload_register with 2 instances of the same class). 2007-01-10 18:14:37 +00:00
Ilia Alshanetsky 1c46fc5a45 Another bug fixed by Dmitry 2007-01-10 16:14:34 +00:00
Dmitry Stogov 7c750656f1 Fixed tests 2007-01-10 16:00:31 +00:00
Dmitry Stogov e470e22e20 - Fixed bug #35106 (nested foreach fails when array variable has a reference).
- Fixed bug #36214 (__get method works properly only when conditional operator is used).
- Fixed bug #39449 (Overloaded array properties do not work correctly).
- Fixed bug #39990 (Cannot "foreach" over overloaded properties).
2007-01-10 15:58:08 +00:00
Hannes Magnusson 4e0f1992ed Add missing ifdefs for shutdown() 2007-01-10 15:25:07 +00:00
Hannes Magnusson 3e0e2bb49d Fix ifdefs 2007-01-10 14:40:06 +00:00
Hannes Magnusson 5d75262062 Fix build on system where HAVE_SETLOCALE is not defined 2007-01-10 14:37:31 +00:00
Antony Dovgal 48b4cb96e0 BFN 2007-01-10 14:11:44 +00:00
Antony Dovgal 3f3509606d use RETURN_* instead of RETVAL_* and fix #40083 2007-01-10 12:03:11 +00:00
Dmitry Stogov ae792a06b0 Fixed SIGSEGV 2007-01-10 07:04:49 +00:00
Ilia Alshanetsky 78ca1de763 Fixed bug #40079 (php_get_current_user() not thread safe).
# Original patch from wharmby at uk dot ibm dot com
2007-01-09 23:27:22 +00:00
Sara Golemon 6a8f688af2 MFH: Add CURLOPT_TCP_NODELAY constant 2007-01-09 23:13:05 +00:00
Marcus Boerger 66bad4f93b - Ups wrong place 2007-01-09 18:50:45 +00:00
Marcus Boerger da1992fdb3 - BFN 2007-01-09 18:35:32 +00:00
Marcus Boerger 023144ffa9 - MFH Fix for #40073 2007-01-09 17:55:29 +00:00
Andrei Zmievski 39fa36a0be Fix 'b' prefix in highlighting and tokenizer. (Matt W) 2007-01-09 17:37:53 +00:00
Dmitry Stogov 5709b64739 Close open files in case of failure (Amit) 2007-01-09 16:27:17 +00:00
Ilia Alshanetsky 81729c1ece Prevent SESSION/GLOBALS overload via session decoding 2007-01-09 15:31:12 +00:00
Dmitry Stogov 38f942b880 Fixed bug #40076 (zend_alloc.c: Value of enumeration constant must be in range of signed integer) 2007-01-09 15:29:14 +00:00
Ilia Alshanetsky 96a8399e2f Added key_length intialization for intergers 2007-01-09 15:20:45 +00:00
Dmitry Stogov 8c086cae23 Fixed bug #40002 (Try/Catch performs poorly) 2007-01-09 15:06:07 +00:00
Dmitry Stogov cbd9822ed9 Bump year. 2007-01-09 11:53:08 +00:00
Antony Dovgal 1e352b3ae7 MFH: zerofill info_data and fix possible segfault
partly fixes #40073
2007-01-09 11:37:17 +00:00
Nuno Lopes 43369cef58 avoid calling MSHUTDOWN when built without libt1 2007-01-08 22:52:22 +00:00
Nuno Lopes 1790b05591 remove useless MSHUTDOWN function 2007-01-08 22:34:07 +00:00
Nuno Lopes ec66c5be3d make the hash_ops structures const and save some memory
# ram memory is so expensive these days...
2007-01-08 22:29:25 +00:00
Andrei Zmievski cdfed7f757 MFH 2007-01-08 22:24:11 +00:00
Ilia Alshanetsky 60e20922eb Use safe_emalloc() rather then emalloc() 2007-01-08 14:24:59 +00:00
Ilia Alshanetsky 13f006ac69 Fixed bug #38325 (spl_autoload_register() gaves wrong line for "class
not found").
2007-01-08 04:27:29 +00:00
Ilia Alshanetsky c5fb061cbf Provide means for opening file for zend with error supression. Allows us to
avoid INI hackery such as the one used in SPL.
2007-01-08 03:39:09 +00:00
Edin Kadribasic fec9895fc3 MFH: Make mt more silent 2007-01-08 00:27:06 +00:00
Ilia Alshanetsky 8df326e003 Fixed bug #39394 (Missing check for older variants of openssl). 2007-01-07 18:38:22 +00:00
Hannes Magnusson a688c62f57 Use relative timestamp
#Thanks Nuno :)
2007-01-07 07:58:28 +00:00
Ilia Alshanetsky 5babb6d10d Fixed bug #39979 (PGSQL_CONNECT_FORCE_NEW will causes next connect to
establish a new connection).
2007-01-07 04:36:40 +00:00
Ilia Alshanetsky 5068511748 Fixed bug #40036 (empty() does not work correctly with ArrayObject when
using ARRAY_AS_PROPS).
2007-01-07 03:52:44 +00:00
Ilia Alshanetsky cbf6f5b538 Fixed memory leaks on error 2007-01-07 03:12:14 +00:00
Nuno Lopes a431a09f47 MFH 2007-01-06 20:44:51 +00:00
Nuno Lopes 3eaf46af3e fix a few memleaks and double-free()s on error conditions 2007-01-06 20:16:25 +00:00
Nuno Lopes 9b253882fc fix build with libming 0.3 and older 2007-01-06 19:25:33 +00:00
Rob Richards 45a95f0898 update xmlwriter_write_dtd_entity parameters 2007-01-06 18:05:02 +00:00
Rob Richards 57792acabc MFH: parameter entity argument (pe) should be bool
update test
2007-01-06 18:03:43 +00:00
Ilia Alshanetsky d1891c3d8a removed dl() block 2007-01-06 17:35:44 +00:00
Hannes Magnusson 630254d55e Fix skipif 2007-01-06 16:56:38 +00:00
Hannes Magnusson c0e9579204 ext/XMLWriter updates 2007-01-06 16:50:55 +00:00
Hannes Magnusson 252b9e9fb1 MFH: bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not entity)
Add & improve test
2007-01-06 15:53:33 +00:00
Dmitry Stogov f694c1f1db Improved proc_open(). Now on Windows it can run external commands not through CMD.EXE 2007-01-06 09:02:02 +00:00
Sara Golemon 13f447eb64 MFH: (r-1.16) ttyname_r() is broken on BSD 2007-01-05 21:31:56 +00:00
Hannes Magnusson 3f9a4baa31 Fix test according to bug#40009 2007-01-05 15:22:35 +00:00
Hannes Magnusson 91b8c3b2b5 Fix tests
#We'll need to update these every year..
2007-01-05 15:21:45 +00:00
Ilia Alshanetsky 7d901eacbe %f -> %F 2007-01-05 15:06:55 +00:00
Ilia Alshanetsky 56a147fbff Back to dev 2007-01-04 23:55:56 +00:00
Ilia Alshanetsky e6c845cb2c 5.2.1RC2 2007-01-04 23:52:29 +00:00
Ilia Alshanetsky 7ba84b8807 Added missing open_basedir checks 2007-01-04 23:49:35 +00:00
Nuno Lopes 17ff2f42ff remove --show-details from lcov's genhtml, as currently we don't separate the coverage data per test, making this option useless
# gathering per test coverage data is possible, but way too slow and would require modifications to run-tests.php
2007-01-04 14:11:47 +00:00
Ilia Alshanetsky a078b56326 Fixed bug #40009 (http_build_query(array()) returns NULL). 2007-01-03 23:16:56 +00:00
Nuno Lopes b2fa0cb89d reduce the test data size even further or when running with valgrind it times out 2007-01-03 22:32:49 +00:00
Nuno Lopes b6dff166bf MFH: fix infinite cycle
#this was the infinite cycle that was bugging me in the gcov machine...
2007-01-03 22:05:24 +00:00
Antony Dovgal 7cf0e005fa MFH 2007-01-03 20:45:22 +00:00
Hannes Magnusson 9ad0ffbd33 MFH: revert pcrelib version string 2007-01-03 20:08:37 +00:00
Antony Dovgal 614e0b29ac MFH 2007-01-03 18:32:27 +00:00
Derick Rethans 3dcf540547 - Fixed bug #40012 (php_date.c doesnt compile on Netware). 2007-01-03 14:46:23 +00:00
Antony Dovgal 46e5e63f94 MFH 2007-01-03 13:48:54 +00:00
Antony Dovgal 97f0cf1208 fix test 2007-01-03 13:47:11 +00:00
Ilia Alshanetsky 9046eaa260 Use proper length 2007-01-03 04:05:12 +00:00
Ilia Alshanetsky b1cac0f72c Added filter callback
Unlink temporary file on error
2007-01-03 03:55:07 +00:00
Nuno Lopes 8a806d186e +- Fixed bug #37619 (proc_open() closes stdin on fork() failure). 2007-01-02 15:29:09 +00:00
Nuno Lopes f3d0a26e13 add EXTRA_LDFLAGS_PROGRAM to config.nice (as LDFLAG is quite useless) 2007-01-01 20:10:01 +00:00
Ilia Alshanetsky 18548c1041 fixed compiler warnings 2007-01-01 19:40:29 +00:00
Ilia Alshanetsky cb70d99ee2 fixed compiler warning 2007-01-01 19:35:47 +00:00
Ilia Alshanetsky 2df7386475 Update copyright year
# The rest of the files were already updated by Sebastian
2007-01-01 19:32:10 +00:00
Ilia Alshanetsky e095b94609 Fixed compiler warnings 2007-01-01 19:24:50 +00:00
Ilia Alshanetsky 5787b56554 Added missing entity functions (MFH from HEAD)
Fixed php_xmlwriter_streams_IO_close() docs
2007-01-01 19:21:48 +00:00
Sebastian Bergmann 4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Ilia Alshanetsky 6e0af2f4d5 Simplify code and change strchr() to memchr() 2006-12-31 22:47:13 +00:00
Ilia Alshanetsky ba64553913 Added boundary checks to php_binary deserializer 2006-12-31 22:25:55 +00:00
Ilia Alshanetsky 96489b4178 Fixed bug #39984 (redirect response code in header() could be ignored in
CGI sapi).
2006-12-31 19:22:01 +00:00
Marcus Boerger b8003b8461 - MFH Bugfix: #39996 Wrong PHPDoc comment for SplFileInfo::getType() 2006-12-31 18:20:22 +00:00
Nuno Lopes 169b207532 - Fixed bug #36427 (proc_open() / proc_close() leak handles on windows). 2006-12-31 15:27:13 +00:00
Nuno Lopes 877ee65622 Fixed bug #38542 (proc_get_status() returns wrong PID on windows) 2006-12-31 14:47:17 +00:00
Ilia Alshanetsky 5298554fb6 Added missing resource validation checks 2006-12-30 20:46:47 +00:00
Ilia Alshanetsky 3ca748d49c Added missing resource type checks 2006-12-30 20:21:25 +00:00
Rob Richards 3d11fb35ae BFN 2006-12-30 15:43:10 +00:00
Rob Richards 604f18c20d fix bug #39760 (cloning fails on nested SimpleXML-Object)
add test
2006-12-30 15:41:17 +00:00
Ilia Alshanetsky 7f376183f8 C++ comment 2006-12-30 02:28:15 +00:00
Ilia Alshanetsky 78d8808f42 Mark test as being 32bit only 2006-12-30 02:00:51 +00:00
Ilia Alshanetsky 6895045565 Simplify & optimize code
# Patch by Matt Wilmas
2006-12-30 01:57:01 +00:00
Ilia Alshanetsky 790b0b9edf Fixes test #50 2006-12-30 01:56:18 +00:00
Ilia Alshanetsky 79d524dc1e Fixed bug #39971 (pg_insert/pg_update do not allow now() to be used for
timestamp fields).
2006-12-29 00:34:30 +00:00
Antony Dovgal 2820e6c1fa MFH 2006-12-28 22:36:53 +00:00
Antony Dovgal 7b281be1ee that was not intentional
thanks Nuno
2006-12-28 22:12:08 +00:00
Antony Dovgal 28421f4f19 MFH 2006-12-28 21:02:14 +00:00
Antony Dovgal e5f95ec3e4 MFH 2006-12-28 20:45:27 +00:00
Nuno Lopes 559ab4b3f9 make this test run a little faster (is currently timeout with valgrind) 2006-12-28 19:52:37 +00:00
Ilia Alshanetsky 794845234e Added buffer length checks 2006-12-28 15:21:21 +00:00
Ilia Alshanetsky b154f188d1 Simplify code and eliminate strcat() usage 2006-12-28 15:09:29 +00:00
Nuno Lopes dae5040b61 MFH: force tidy.clean_output=0 2006-12-28 15:07:45 +00:00
Antony Dovgal ef9646c867 MFH 2006-12-28 14:26:36 +00:00
Antony Dovgal fdfa403388 MFH 2006-12-28 14:17:38 +00:00
Antony Dovgal 46a6bd7f9d MFH 2006-12-28 13:30:25 +00:00
Antony Dovgal 112462d102 MFH 2006-12-28 12:18:54 +00:00
Antony Dovgal d3a651a39e MFH 2006-12-28 12:01:50 +00:00
Ilia Alshanetsky 96d9d6f0f1 Avoid strcpy() & strcat() 2006-12-28 00:17:48 +00:00
Nuno Lopes 66e555c66f die("skip this is for PHP < 4.2.3"); 2006-12-27 15:22:28 +00:00
Nuno Lopes 54f3ff34b7 oops: remove uneeded code in the skip condition 2006-12-27 15:17:04 +00:00
Nuno Lopes d07a46ebab add fr_FR@euro to the setlocale list 2006-12-27 15:11:35 +00:00
Antony Dovgal b16f925e37 MFH 2006-12-27 10:31:10 +00:00
Antony Dovgal 65f50e7e31 MFH more test improvements by Chris Jones 2006-12-27 09:49:53 +00:00
Ilia Alshanetsky d101e113cf Fixed compiler warning 2006-12-26 17:17:52 +00:00
Ilia Alshanetsky 7fe60ada00 Don't forget to free url structure 2006-12-26 16:58:23 +00:00
Ilia Alshanetsky 5e576be36f Fixed bug #39878 (CURL doesn't compile on Sun Studio Pro). 2006-12-26 16:55:56 +00:00
Ilia Alshanetsky ffd41a503f Session deserializer protection. 2006-12-26 16:53:47 +00:00
Ilia Alshanetsky dc5be15a6f is_numeric_string() optimization 2006-12-26 16:45:39 +00:00
Ilia Alshanetsky ff9d0fcc78 is_numeric_string() optimization
# Original Patch by Matt Wilmas
2006-12-26 16:44:20 +00:00
Antony Dovgal 24124518ab MFH 2006-12-26 12:29:42 +00:00
Pierre Joye f458ff3dac - MFH: add better zlib detection 2006-12-26 10:42:50 +00:00
Pierre Joye 5a6f0e3059 - #39952 zip ignoring --with-libdir on zlib checks (judas dot
iscariote at gmail dot com)
2006-12-26 09:52:05 +00:00
Dmitry Stogov 67583e7aa5 Code review:
. fixed integer overflow
  . fixed buffer overflow/underflow
  . added more strict IP validation
  . reimplemented float number validation
2006-12-26 09:16:25 +00:00
Ilia Alshanetsky b85f1345a6 Ensure that OnUpdateLongGEZero is greater or equal to 0.
Added a update wrapper for ensuring >0 values
2006-12-25 23:55:59 +00:00
Ilia Alshanetsky e2c110bebf Allocation safety checks 2006-12-25 23:43:10 +00:00
Antony Dovgal 32d078f8e7 MFH 2006-12-25 22:40:23 +00:00
Ilia Alshanetsky 52d53543ac Allocation safety checks 2006-12-25 22:36:57 +00:00
Antony Dovgal 9c2b6efb77 MFH 2006-12-25 22:27:24 +00:00
Antony Dovgal 6ac8ffdfea MFH 2006-12-25 22:12:46 +00:00
Antony Dovgal 7dc7882745 MFH 2006-12-25 21:47:02 +00:00
Ilia Alshanetsky 7efb0a14f4 Use safe_emalloc() 2006-12-25 21:41:04 +00:00
Antony Dovgal 807a0966a9 fix weird strlen() usage 2006-12-25 21:18:01 +00:00
Antony Dovgal 6c50fa955b MFH 2006-12-25 21:08:02 +00:00
Ilia Alshanetsky 652c7096b2 Fixed test for 64bit systems 2006-12-25 21:07:53 +00:00
Antony Dovgal 3fd433c07d MFH 2006-12-25 20:53:50 +00:00
Antony Dovgal 2e3cd64566 MFH 2006-12-25 20:44:45 +00:00
Antony Dovgal 35db4d21b0 MFH 2006-12-25 20:03:43 +00:00
Dmitry Stogov 4480c5eb5d Fixed bug #39825 (foreach produces memory error) 2006-12-25 19:23:03 +00:00
Ilia Alshanetsky 0776e56437 Use %F (ignores locale) for internal representation of floats 2006-12-25 16:48:18 +00:00
Hannes Magnusson ff0a238043 Add missing NEWS entrys and update the README.UPDATE file 2006-12-25 16:03:38 +00:00
Antony Dovgal 9f76195869 MFH: fix bug #39890 (using autoconf 2.6x and --with-layout=GNU breaks PEAR install path) 2006-12-25 15:41:56 +00:00
Antony Dovgal 601f4cd129 MFH 2006-12-25 15:28:57 +00:00
Antony Dovgal c52bc49f50 fix test 2006-12-25 14:27:51 +00:00
Ilia Alshanetsky e3569ae80a Define SENDBUFLEN for older c-client libs 2006-12-25 14:23:18 +00:00
Dmitry Stogov e57a60698b Fixed bug #39944 (References broken) 2006-12-25 14:16:27 +00:00
Dmitry Stogov 5436160dc6 Fixed heap overflow 2006-12-25 13:11:23 +00:00
Dmitry Stogov 5823a2d28a Fixed possible size_t overflow 2006-12-25 12:16:33 +00:00
Antony Dovgal 04d4811532 MFH 2006-12-25 11:50:31 +00:00
Antony Dovgal 6e8a7d7b20 fix tests 2006-12-25 11:16:23 +00:00
Ilia Alshanetsky c5db57b495 Fixed buffer boundary protection 2006-12-24 22:15:06 +00:00
Ilia Alshanetsky 4f46c4e90f Added empty string checks 2006-12-24 20:50:02 +00:00
Rob Richards 51bca1b406 BFN 2006-12-24 12:32:56 +00:00
Rob Richards 47fb655a56 fix bug #33734 and related (Something strange with COM Object)
- caused by fix in com_handlers.c rev 1.22.2.5
2006-12-24 12:32:10 +00:00
Rob Richards a03f730875 BFN 2006-12-24 10:02:53 +00:00
Rob Richards b7ec6f90e0 - fix bug #33386 (ScriptControl only sees last function of class): com_wrapper.c
- fix bug #37588 (COM Property propputref converts to PHP function
  and can't be accesed): com_handlers.c
- fix bug #39596 (Creating Variant of type VT_ARRAY): com_variant.c
- add tests
2006-12-24 10:00:59 +00:00
Hannes Magnusson 6077df1a03 Fix typo 2006-12-24 01:29:20 +00:00
Ilia Alshanetsky eaf3d32157 Safety checks 2006-12-23 23:28:39 +00:00
Ilia Alshanetsky 1379ad02e3 Added checks for negative max length and overflow checks for overly long
strings.
2006-12-23 18:50:33 +00:00
Derick Rethans 7180422fdc - Fixed bug #39935 (Extensions tidy,mcrypt,mhash,pdo_sqlite ignores
--with-libdir).
2006-12-23 17:58:47 +00:00
Antony Dovgal 46b25155d2 MFH 2006-12-23 14:02:50 +00:00
Ilia Alshanetsky 72895cda6d Fixed bug #39884 (ReflectionParameter::getClass() throws exception for type
hint self).
2006-12-22 15:37:48 +00:00
Ilia Alshanetsky f40ebf4171 Fixed bug #36392 (wrong number of decimal digits with %e specifier in
sprintf).
2006-12-22 15:29:41 +00:00
Ilia Alshanetsky 7772e33ace Small optimization of the date() function 2006-12-22 15:21:34 +00:00
Antony Dovgal a7faaa1b14 new tests 2006-12-22 13:30:10 +00:00
Antony Dovgal fb18a8e760 more tests 2006-12-22 13:07:53 +00:00
Ilia Alshanetsky fd8f758ecd Fixed bug #39873 (number_format() breaks with locale & decimal points). 2006-12-22 04:03:15 +00:00
Antony Dovgal ed11386c3d MFH 2006-12-21 22:08:26 +00:00
Antony Dovgal b019cd99c6 MFH 2006-12-21 21:49:22 +00:00
Antony Dovgal 8854c3d51a MFH 2006-12-21 21:37:45 +00:00
Antony Dovgal 66d9c24ccc improve tests 2006-12-21 19:23:26 +00:00
Seiji Masugata 133d6bf2ca Fixed bug #39361, #39400 (mbstring function overloading problem). 2006-12-21 17:26:05 +00:00
Dmitry Stogov 5a1767e0d5 Fixed comments 2006-12-21 13:05:27 +00:00
Rob Richards 60941b02dc fix issues identitified by coverity 2006-12-21 12:51:26 +00:00
Antony Dovgal 6546914e68 new tests 2006-12-21 12:41:36 +00:00
Antony Dovgal bed14f8ab7 MFH 2006-12-21 11:08:00 +00:00
Dmitry Stogov 3ffc1c8f4a Default memory_limit value is set to 128M 2006-12-21 09:12:42 +00:00
Dmitry Stogov 91dc80ba9a Removed dependency from SHELL32.DLL 2006-12-21 09:01:10 +00:00
Ilia Alshanetsky 5ead613386 Fix a possible memory leak 2006-12-21 02:09:36 +00:00
Ilia Alshanetsky dba3fe385d Fixed possible memory leak 2006-12-21 01:57:05 +00:00
Antony Dovgal 6aec52bde7 MFH 2006-12-21 01:18:28 +00:00
Ilia Alshanetsky 1783b0e481 Optimize out zend_hash_num_elements() call 2006-12-21 01:16:10 +00:00
Antony Dovgal f807343197 MFH 2006-12-21 01:08:04 +00:00
Antony Dovgal ffa7e957c5 fix possible leaks 2006-12-21 01:00:58 +00:00
Antony Dovgal 41b55d9b78 MFH 2006-12-21 00:47:02 +00:00
Antony Dovgal 0abe62e027 MFH 2006-12-20 23:36:56 +00:00
Antony Dovgal a0e2ccf490 MFH 2006-12-20 23:30:30 +00:00
Antony Dovgal d040ec9b8e MFH 2006-12-20 23:19:56 +00:00
Antony Dovgal bbb923c7a8 MFH 2006-12-20 23:01:31 +00:00
Ilia Alshanetsky 87ffae250c fixed ZTS build 2006-12-20 19:48:12 +00:00
Antony Dovgal 7d2142a56e protect _SESSION, HTTP_SESSION_VARS and GLOBALS
maintain an internal reference of _SESSION, so that it won't be possible to destroy it from userspace
2006-12-20 19:31:28 +00:00
Ilia Alshanetsky ea491dba64 Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc). 2006-12-20 19:20:01 +00:00
Antony Dovgal 698ea5f48e MFH 2006-12-20 19:08:48 +00:00
Andrei Zmievski 0d7af28a40 More correct patch for b-prefixes. 2006-12-20 18:22:07 +00:00
Antony Dovgal c348c293c8 MFH: fix #39903 (Notice message when executing __halt_compiler() more than once) 2006-12-20 16:31:10 +00:00
Antony Dovgal ea013f92e9 use Z_* macros 2006-12-20 16:00:11 +00:00
Antony Dovgal 40f6288fa3 MFH 2006-12-20 15:12:38 +00:00
Derick Rethans a9d0abf82c - Fixed the validate email filter so that the letter "v" can also be used in
the user part of the email address. (Derick)
2006-12-20 14:39:01 +00:00
Antony Dovgal 0f2eed24bb MFH 2006-12-20 13:09:02 +00:00
Dmitry Stogov 53b088e60c Make MEMORY_LIMIT and ZEND_USE_MALLOC_MM to be always enabled. They don't make any significant slowdown, but incrise maintainability a lot. Note that the setting of memory_limit wasn't changes (neither in main/main.c nor in php.ini) and it still set to 16M. 2006-12-20 10:49:33 +00:00
Hannes Magnusson 1e19ee8785 - Fixed incorrect function names on FreeBSD where inet_pton() was named
__inet_pton() and inet_ntop() was named __inet_ntop()
- Fixed bug #39685 (iconv() - undefined function)
- Fixed bug #38852 (XML-RPC Breaks iconv)
2006-12-20 10:34:36 +00:00
Nuno Lopes 6a8a2e8b0e new test 2006-12-19 21:46:48 +00:00
Michael Wallner 2beee146b4 MFH: check CRYPTO_get_id_callback() if anyone else already set thread lock callbacks 2006-12-19 21:41:25 +00:00
Antony Dovgal 1ef3ca7bf7 on FreeBSD these locales have different names 2006-12-19 21:39:48 +00:00
Antony Dovgal 949a0934c8 MFH 2006-12-19 20:46:56 +00:00
Andrei Zmievski 16ea2ee640 Support 'b' prefix in front of string literals for forward compatibility
with PHP 6.
2006-12-19 17:26:17 +00:00
Nuno Lopes 078fda3d6e remove NOP code in json_determine_array_type(), as we already know the zval passed is an array (based on patch by Ron Korving) 2006-12-19 15:01:05 +00:00
Antony Dovgal 2c3db736c4 add missing SKIPIF sections 2006-12-19 14:16:23 +00:00
Antony Dovgal 4307af8cdf MFH 2006-12-19 13:27:09 +00:00
Antony Dovgal c34d863d3e MFH 2006-12-19 13:15:39 +00:00
Dmitry Stogov 5d8183f0b2 Support for systems without locale.h 2006-12-19 13:13:29 +00:00
Antony Dovgal d6db0ccc12 fix test on MacOS 2006-12-19 13:08:35 +00:00
Antony Dovgal 0ecaeb89d3 serialize() should use '.' as decimal point irrespectively to locale 2006-12-19 12:36:44 +00:00
Dmitry Stogov c43fc2afc8 Fixed bug #39815 (SOAP double encoding is not locale-independent) 2006-12-19 11:54:38 +00:00
Edin Kadribasic 39a7719f85 Updated list of available extensions in dlls.
Updated oci extension ini settings.
-- christopher.jones at oracle dot com
2006-12-19 10:34:10 +00:00
Edin Kadribasic 7e77d79b3c Enable full build with newer Microsoft compilers 2006-12-19 10:26:01 +00:00
Hannes Magnusson b12e3e1475 Fix tests 2006-12-19 10:03:24 +00:00
Dmitry Stogov 868ac7d3a3 Fixed bug #39869 (safe_read does not initialize errno). (michiel at boland dot org) 2006-12-19 09:17:04 +00:00
Dmitry Stogov 03312cc0d9 Added function stream_socket_shutdown(). It is a wraper for system shutdown() function, that shut downs part of a full-duplex connection 2006-12-19 08:58:58 +00:00
Brian Shire 8a3a61bcd0 BFN 2006-12-19 08:18:47 +00:00
Ilia Alshanetsky d257696604 Fixed bug #39845 (Persistent connections generate a warning in pdo_pgsql). 2006-12-18 17:56:25 +00:00
Ilia Alshanetsky b9531d5b07 Cleanup & optimize php_filter_encode_url() 2006-12-18 15:42:18 +00:00
Ilia Alshanetsky 090e14dfda Less hackish support for spaces at the start of tags within strip_tags() 2006-12-18 15:02:16 +00:00
Ilia Alshanetsky a938d8e386 Fixed bugs with trimming of spaces 2006-12-18 14:56:40 +00:00
Antony Dovgal a726dcaa99 MFH: fix #39850 (SplFileObject throws contradictory/wrong error messages when trying to open "php://wrong") 2006-12-18 14:56:20 +00:00
Dmitry Stogov 6e0b78cd4c Fixed bug #39832 (SOAP Server: parameter not matching the WSDL specified type are set to 0) 2006-12-18 14:39:23 +00:00
Antony Dovgal 908b1e562d MFH: fix possible invalid read (reproducible only on big-endian machines) 2006-12-18 13:16:54 +00:00
Zeev Suraski 9219d7aa57 Whitespace 2006-12-18 12:32:08 +00:00
Dmitry Stogov 1763dc162d Fixed random generation of cookies and canaries 2006-12-18 11:39:19 +00:00
Antony Dovgal 5fc3e649b6 MFH 2006-12-18 11:12:55 +00:00
Antony Dovgal 5e8eecb362 remove the comment, it's not valid anymore 2006-12-18 10:19:52 +00:00
Hannes Magnusson 9ef3575c25 MFH:
- make %f locale aware again
- fix precision loss with %F (noticed by Sebastian Nohn)
- add new tests
2006-12-18 09:26:54 +00:00
Dmitry Stogov cfbd58c987 MFH: __builtin_expect() exists only in GCC 3.0 and higher 2006-12-18 08:59:40 +00:00
Ilia Alshanetsky 7d7248390c Filter fixes:
Fixed possible double encoding problem with sanitizing filters
	Make use of space-strict strip_tags() function
2006-12-18 04:22:05 +00:00
Brian Shire 5bf3df531f Fixed bug #30074
extract with EXTR_REFS was setting EG(unitialized_zval_ptr)->is_ref=1, affecting subsequent usage
  Added test
2006-12-17 20:09:48 +00:00
Ilia Alshanetsky e8bc39d95d Fixed compiler warning 2006-12-17 18:30:36 +00:00
Ilia Alshanetsky 24cc05dc09 Fixed bug #39779 (Enable AUTH PLAIN mechanism in underlaying libc-client). 2006-12-17 18:22:53 +00:00
Hannes Magnusson 93a606a192 Fix build 2006-12-17 03:26:04 +00:00
Ilia Alshanetsky b75d079c89 Fixed bug #39846 (Invalid IPv4 treated as valid). 2006-12-16 21:48:05 +00:00
Andi Gutmans 5e36d7fcfe - I prefer cookie to be the first element. 2006-12-15 17:03:42 +00:00
Dmitry Stogov bf9e3e769c Added internal heap protection
. safe unlinking
  . cookies
  . canary protection (debug build only)
2006-12-15 13:25:26 +00:00
Ilia Alshanetsky 195b102126 back to dev 2006-12-15 01:22:35 +00:00
Ilia Alshanetsky 0ee7c30453 5.2.1RC1 2006-12-15 01:21:36 +00:00
Andrei Zmievski 8f5310afad Support for 'S' format in unserialize() (forward compatibility with PHP
6)
2006-12-15 00:58:08 +00:00
Ilia Alshanetsky eb8bab9f46 Fixed bug #39816 (apxs2filter ignores httpd.conf & .htaccess php config
settings).
2006-12-13 15:45:20 +00:00
Ilia Alshanetsky 563221783a Removed deadcode found by Ron Korving 2006-12-13 15:39:12 +00:00
Ilia Alshanetsky a055e93a27 optimize out strlen() calls
# Patch by Matt Wilmas
2006-12-13 15:31:47 +00:00
Ilia Alshanetsky 1c4806c515 Fixed bug #39201 (Possible crash in Apache 2 with 413 ErrorHandler). 2006-12-13 00:41:33 +00:00
Sara Golemon db87e11e6b MFH: Bugfix# 39435: 'foo' instanceof bar gives invalid opcode error 2006-12-12 23:25:23 +00:00
Antony Dovgal 18edb61440 fix test 2006-12-12 22:33:26 +00:00
Ilia Alshanetsky cbaaf1bc07 Fixed bug #39797 (virtual() does not reset changed INI settings). 2006-12-12 18:05:25 +00:00
Ilia Alshanetsky e034b4a8b0 Removed dummy vars.
# Patch by Matt Wilmas
2006-12-12 15:35:16 +00:00
Antony Dovgal beeb5ddec4 disable tests 2006-12-12 13:22:44 +00:00
Antony Dovgal fd23b700fb fix test 2006-12-12 13:11:36 +00:00
Antony Dovgal 2f5229c9fc MFH: skip BFILE tests if Oracle is not on localhost 2006-12-12 13:00:01 +00:00
Antony Dovgal dc64595467 MFH 2006-12-12 12:11:51 +00:00
Antony Dovgal 24b312f8d5 MFH: missing part of the fix for #39795 2006-12-12 12:06:37 +00:00
Antony Dovgal 53f89fad03 MFH 2006-12-12 10:16:06 +00:00
Antony Dovgal fc0e395678 add new tests 2006-12-12 09:33:33 +00:00
Antony Dovgal f5543e8279 MFH 2006-12-12 09:28:18 +00:00
Hannes Magnusson f4e63cbece Fix test 2006-12-12 09:15:25 +00:00
Hannes Magnusson 14b7a1bdd1 Fix skipif 2006-12-12 08:13:31 +00:00
Hannes Magnusson 0028eccadd Fix tests 2006-12-12 08:09:40 +00:00
Antony Dovgal a74c36a335 MFH: fix #39795 (build fails on AIX because crypt_r() uses different data struct) 2006-12-12 07:38:04 +00:00
Ilia Alshanetsky 2f291233e6 Fixed bug #39782 (setTime() on a DateTime constructed with a Weekday
yields incorrect results).
2006-12-11 21:04:40 +00:00
Ilia Alshanetsky 5218d956f0 Fixed typo 2006-12-11 15:59:41 +00:00
Ilia Alshanetsky 19e4dc5058 Removed bool<>long optimization as it causes issues with strict type checks 2006-12-11 15:34:35 +00:00
Ilia Alshanetsky 7e1973d9fc Minor optimization (2-3%) from Brian Shire 2006-12-11 15:16:07 +00:00
Ilia Alshanetsky d3aa695263 Fixed bug #39787 (PHP doesn't work with Apache 2.3). 2006-12-11 14:54:14 +00:00
Antony Dovgal ab765ca497 MFH 2006-12-11 12:34:09 +00:00
Antony Dovgal 03785ddb5f add new test 2006-12-11 12:32:06 +00:00
Ilia Alshanetsky f5b6604376 Fixed bug #39791 (Crash in strtotime() on overly long relative date
multipliers).
2006-12-11 05:04:36 +00:00
Marcus Boerger 66525a739e - MFH Fix comparison of RecursiveDualIterators 2006-12-10 23:44:49 +00:00
Ilia Alshanetsky e64cb1ae4d Optimize extract()
# Patch by Brian Shire
2006-12-10 19:43:03 +00:00
Pierre Joye 6ccde868be - #39286 entry 2006-12-10 02:56:35 +00:00
Pierre Joye 7ddd4ed1d7 - #39286, misleading error message when nvalid dimensions are given 2006-12-10 02:55:30 +00:00
Pierre Joye 7faf8325e7 - #39508, add test (imagefill crashes with small image) 2006-12-10 01:58:50 +00:00
Pierre Joye 0d444306c9 - #39780 entry 2006-12-10 01:39:09 +00:00
Pierre Joye 9e533e39b6 - MFH:#39780, PNG image with CRC/data error raises fatal error 2006-12-10 01:38:02 +00:00
Edin Kadribasic 99c041ade3 BFN 2006-12-10 01:26:51 +00:00
Edin Kadribasic 42e1c9a1e0 Fixed by #39751 by KevinJohnHoffman at gmail dot com 2006-12-10 01:23:41 +00:00
Hannes Magnusson d9f03aac34 MFH: sys_get_temp_dir() 2006-12-09 18:00:52 +00:00
Ilia Alshanetsky b8590f954d Fixed test 2006-12-09 16:41:24 +00:00
Ilia Alshanetsky 0236a7eaf4 Fixed bug #29840 (is_executable() does not honor safe_mode_exec_dir
setting).
2006-12-09 16:01:29 +00:00
Hannes Magnusson 3d5fec9cb5 MFH: new cookie tests 2006-12-09 15:58:09 +00:00
Ilia Alshanetsky 94e3f478d7 Fixed handling of multiple cookies with the same name.
Added support for cookies into run-tests.php
2006-12-09 14:14:29 +00:00
Ilia Alshanetsky 847741cb08 Strip leading spaces from cookie names, that can come from multi-cookie
headers where ; can be followed by any number of spaces.
2006-12-09 13:01:23 +00:00
Rob Richards e41f103431 BFN 2006-12-09 10:53:45 +00:00
Rob Richards c2c9908f88 fix heap corruption when adding/caching typelib (also fixes bug 39606)
add test
2006-12-09 10:52:09 +00:00
Ilia Alshanetsky d94453a4e5 Fixed tests 2006-12-09 03:17:49 +00:00
Ilia Alshanetsky 352e69d3f0 Fixed test 2006-12-09 03:07:32 +00:00
Antony Dovgal 7df81307c1 MFH 2006-12-08 21:18:43 +00:00
Antony Dovgal f71a310543 MFH: fix possible issue in the serializer, which might currupt struc when reallocating arguments stack 2006-12-08 20:59:31 +00:00
Antony Dovgal f8d4de338b MFH: fix #39732 (oci_bind_array_by_name doesn't work on Solaris 64bit) 2006-12-08 20:56:29 +00:00
Ilia Alshanetsky b7b0f4d988 Fixed bug #39759 (Can't use stored procedures fetching multiple result
sets in pdo_mysql).
2006-12-08 19:50:40 +00:00
Rob Richards 4991dba418 fix tests 2006-12-08 17:55:58 +00:00
Ilia Alshanetsky db7dad0ba0 Fixed bug #39763 (magic quotes are applied twice by ext/filter in
parse_str())
2006-12-08 17:50:04 +00:00
Antony Dovgal cdf5db41a7 -BFN 2006-12-08 17:11:42 +00:00
Antony Dovgal b32bf96363 revert the fix for #39763 2006-12-08 17:04:01 +00:00
Dmitry Stogov 108a2fc64c Fixed bug #39775 ("Indirect modification ..." message is not shown)
The fix breaks two SimpleXML tests those must be fixed
2006-12-08 15:55:31 +00:00
Antony Dovgal 1edf208421 add new tests by <zoe dot slattery at googlemail dot co dot uk> 2006-12-08 14:39:25 +00:00
Dmitry Stogov dd9b5a08f0 Fixed possible failure 2006-12-08 12:47:45 +00:00
Nuno Lopes 802e12674e add tests for old bug reports 2006-12-08 12:13:23 +00:00
Antony Dovgal feba2edba2 initialize variables 2006-12-07 20:45:58 +00:00
Antony Dovgal 6b8526efce MFH: fix #39763 (magic quotes are applied twice by ext/filter) 2006-12-07 11:00:08 +00:00
Ilia Alshanetsky 72ea6912f7 Fixed bug #39754 (Some POSIX extension functions not thread safe). 2006-12-07 01:41:18 +00:00
Rasmus Lerdorf 0110fca856 Typo 2006-12-06 21:20:39 +00:00
Antony Dovgal 60f3797200 MFH 2006-12-06 16:28:36 +00:00
Antony Dovgal da53237f41 MFH: add missing 'F' modified (noticed by Matt) 2006-12-06 14:47:36 +00:00
Rob Richards cf4c83dd2b Fix win32 build 2006-12-06 13:18:36 +00:00
Antony Dovgal b4d0d872e7 MFH 2006-12-06 10:49:27 +00:00
Antony Dovgal 8c8bf92311 news 2006-12-06 09:53:15 +00:00
Antony Dovgal 4d44a5b71d MFH: use BSD licensed implementation of double-to-string utilities instead of LGPL one
this patch also fixes thread safety issues in zend_strtod()
2006-12-06 09:52:51 +00:00
Antony Dovgal a813e112d4 MFH 2006-12-05 23:51:30 +00:00
Ilia Alshanetsky 62cd5a9bae Fixed bug #39724 (Broken build due to spl/filter usage of pcre extension). 2006-12-05 23:37:57 +00:00
Antony Dovgal 9ce985bbae cosmetic improvements 2006-12-05 23:03:19 +00:00
Frank M. Kromann 7fd9e4fce9 Remove PHP4.x stuff 2006-12-05 21:46:23 +00:00
Frank M. Kromann 5dca5450f2 #39429 Update API 2006-12-05 21:02:46 +00:00
Dmitry Stogov 68890ce196 Fixed bug #39721 (Runtime inheritance causes data corruption) 2006-12-05 19:03:51 +00:00
Antony Dovgal 5e7eed6a9a MFH: nuke redundant zval_ptr_dtor() call 2006-12-05 18:42:38 +00:00
Ilia Alshanetsky e5ad7bf299 Fixed bug #36798 (Error parsing named parameters with queries containing
high-ascii chars).
2006-12-05 18:04:59 +00:00
Ilia Alshanetsky 9a1abfbb7d Revert previous patch and it breaks builds with built-in cdb lib 2006-12-05 17:54:52 +00:00
Hannes Magnusson a41e70782b Fix test 2006-12-05 15:55:55 +00:00
Rob Richards e071d48604 BFN 2006-12-05 12:05:43 +00:00
Rob Richards 865f4d75be fix bug #39625 (Apache crashes on importStylesheet call) 2006-12-05 12:04:34 +00:00
Dmitry Stogov 7389f59f4d Fixed FastCGI impersonation for persistent connections on Windows 2006-12-05 08:55:15 +00:00
Dmitry Stogov 8f5786b6e8 Removed unused zend_mm.* 2006-12-05 08:07:57 +00:00
Ilia Alshanetsky 53a1403b53 Fixed bug #39571 (timeout ssl:// connections). 2006-12-05 01:39:07 +00:00
Pierre Joye ae1d0de24b - invalid filter 2006-12-05 01:25:29 +00:00
Pierre Joye 33f9ada038 - MFH: invalid filter id should not return unsafe values 2006-12-05 01:24:18 +00:00
Pierre Joye 145e7e470a - MFH: callback test 2006-12-04 21:33:22 +00:00
Pierre Joye bff08d46f1 - default filter is not string anymore (in comment)
- WS and error msg sync with head
2006-12-04 21:16:01 +00:00
Pierre Joye 5f2562e905 - MFH: init tmp var 2006-12-04 21:07:13 +00:00
Stanislav Malyshev 6b651f8e60 Improve tolower()-related functions on Windows and VC2005 by caching locale and using
tolower_l function.
# Gives 10-18% speedup on bench.php
# Does not change behaviour for non-windows
2006-12-04 18:37:15 +00:00
Ilia Alshanetsky 57a912e828 Fixed tests 2006-12-04 18:29:49 +00:00
Antony Dovgal ebef6661df MFH: fix build with Sun compiler, which doesn't support -O0 2006-12-04 18:28:49 +00:00
Antony Dovgal 44a3cad930 MFH: partly fix #39724
ext/spl has a soft dependcy from ext/pcre (not ext/pcre-regex)
2006-12-04 18:01:53 +00:00
Ilia Alshanetsky 8e907392b3 Fixed test (user is a reserved keyword in pgsql) 2006-12-04 17:55:46 +00:00
Antony Dovgal 459564e2d2 fix tests 2006-12-04 17:48:52 +00:00
Dmitry Stogov f7bc516502 Fixed bug #38274 (Memlimit fatal error sent to "wrong" stderr when using fastcgi) 2006-12-04 16:20:02 +00:00
Antony Dovgal bcf457d828 MFH: fix retval type 2006-12-04 15:58:48 +00:00
Ilia Alshanetsky 35f78f221b Fixed bug #37627 (session save_path check checks the parent directory). 2006-12-04 15:19:26 +00:00
Antony Dovgal dad67b1f65 MFH: look for tests in sapi/cli 2006-12-04 13:07:26 +00:00
Ilia Alshanetsky 7fb3715d43 Fixed bug #38319 (Remove bogus warnings from persistent PDO connections). 2006-12-04 03:07:44 +00:00
Ilia Alshanetsky 44045f8cb1 Fixed bug #38252 (Incorrect PDO error message on invalid default fetch mode). 2006-12-04 02:40:08 +00:00
Ilia Alshanetsky fc21d423fd Added test for previous bug 2006-12-04 00:40:31 +00:00
Ilia Alshanetsky 4356aad0ae Fixed bug #39483 (Problem with handling of \ char in prepared statements). 2006-12-04 00:38:46 +00:00
Ilia Alshanetsky e7c2bd6e40 Default to buffered queries (much faster)
Default to prepared statement emulation to avoid hitting MySQL bugs
2006-12-03 23:29:03 +00:00
Ilia Alshanetsky 44baca5aed Added missing check for mismatching number of tokens & bound params in
prepared statement emulation.
2006-12-03 23:27:44 +00:00
Ilia Alshanetsky b6bdd44962 Added "default" option that allows a default value to be set for an invalid
or missing value.
2006-12-03 21:27:36 +00:00
Ilia Alshanetsky 9666f1deae Config fix from Gentoo 2006-12-03 19:54:55 +00:00
Ilia Alshanetsky 7999c9d251 Fixed bug #39718 (possible crash if assert.callback is set in ini). 2006-12-03 17:13:11 +00:00
Ilia Alshanetsky b71ac5063e Fixed php_readdir_r() usage in scandir emulation 2006-12-03 15:52:17 +00:00
Antony Dovgal 361c8b4fb4 MFH 2006-12-03 14:37:32 +00:00
Antony Dovgal e1a63af85b MFH: fix leaks 2006-12-03 13:59:11 +00:00
Antony Dovgal 065be7056d MFH: fix AIX build 2006-12-03 13:46:37 +00:00
Hannes Magnusson f61b9635ba Fix test on fbsd 2006-12-03 08:04:57 +00:00
Nuno Lopes 0df2a37d1b new tests. increase coverage for more than 90% 2006-12-02 21:39:28 +00:00
Ilia Alshanetsky 916673a345 Fixed bug #39527 (Failure to retrieve results when multiple unbuffered,
prepared statements are used in pdo_mysql).
2006-12-02 17:53:44 +00:00
Frank M. Kromann 66eb5b1dde Fix win32 build 2006-12-01 20:24:58 +00:00
Frank M. Kromann a6b3682dba Fix win32 build 2006-12-01 20:17:50 +00:00
Ilia Alshanetsky f3e577375e Fixed typo 2006-12-01 20:10:35 +00:00
Dmitry Stogov abc5bb5f61 Bug #39438 (Fatal error: Out of memory) 2006-12-01 20:01:50 +00:00
Dmitry Stogov e70d7cfc90 typo 2006-12-01 19:41:57 +00:00
Ilia Alshanetsky b3004fb883 Fixed a possible memory corruption in dbase_open() with invalid open mode 2006-12-01 19:10:50 +00:00
Nuno Lopes e65bdffab5 tests + BFN 2006-12-01 16:37:39 +00:00
Nuno Lopes 8e0cf44164 fix bug #39458: ftp_nlist() returns false on empty dirs 2006-12-01 16:34:43 +00:00
Dmitry Stogov 0742edb396 Fixed bug #39702 (php crashes in the allocator on linux-m68k) 2006-12-01 15:33:06 +00:00
Dmitry Stogov de9574e872 Fixed bug #39640 (Segfault with "Allowed memory size exhausted") 2006-12-01 13:54:29 +00:00
Dmitry Stogov e8e9810dd9 Fixed bug #39652 (Wrong negative results from memeory_get_usage()) 2006-12-01 11:42:20 +00:00
Marcus Boerger 5ea32dc1e4 - MFH: Fix handling of recursive inner iterators 2006-12-01 09:29:15 +00:00
Ilia Alshanetsky 5f3e233ea7 Disallow \0 chars inside session.save_path 2006-12-01 00:27:20 +00:00
Ilia Alshanetsky c42d25dc33 Small hash table optimization 2006-11-30 23:51:24 +00:00
Ilia Alshanetsky b7dc2a51ad Added check for crypt_r() 2006-11-30 17:10:46 +00:00
Ilia Alshanetsky ac9927728a Added missing function checks 2006-11-30 16:48:03 +00:00
Ilia Alshanetsky ca89b6dedd last set of zts fixes 2006-11-30 16:38:37 +00:00
Ilia Alshanetsky c69555b948 Thread safety fixes. 2006-11-30 16:21:24 +00:00
Ilia Alshanetsky 930ac9a5d0 Thread-safety issues 2006-11-30 16:10:38 +00:00
Ilia Alshanetsky 891bd7888f Use reantrant crypt_r() whenever possible. 2006-11-30 15:59:53 +00:00
Ilia Alshanetsky 20b92bf4cc Use thread-safe code 2006-11-30 15:13:19 +00:00
Antony Dovgal 57130c653a fix test 2006-11-30 13:09:32 +00:00
Ilia Alshanetsky 52bd6de7f4 Thread safety fixed for *nix systems 2006-11-30 00:35:15 +00:00
Ilia Alshanetsky 466d9ba00a Fixed bug #39648 (Implementation of PHP functions chown() and chgrp() are
not thread safe).
2006-11-29 23:34:49 +00:00
Antony Dovgal 4cc29fef5c MFH 2006-11-29 22:53:26 +00:00
Derick Rethans ac7e6f5fec - Updated timezone database to version 2006.16. 2006-11-29 20:00:49 +00:00
Ilia Alshanetsky bfa4af46e1 Fixed bug #39663 (Memory leak in pg_get_notify() and a possible memory
corruption on Windows in pgsql and pdo_pgsql extensions).
2006-11-29 15:45:59 +00:00
Antony Dovgal 60bb494607 MFH: fix #39673 (file_get_contents causes bus error on certain offsets) 2006-11-29 11:12:59 +00:00
Rob Richards d5d1801df7 correct fix for bug #39662 to fix leak and tree corruption
fix test
2006-11-29 08:51:36 +00:00
Marcus Boerger ecd417c6ce - MFH: Add new example 2006-11-28 22:20:01 +00:00
Antony Dovgal 0966666256 MFH: resolve coverity issue #224 2006-11-28 21:20:33 +00:00
Antony Dovgal aaf120127e add php_unescape_html_entities() proto to the header
(fixes #39665)
2006-11-28 20:41:07 +00:00
Antony Dovgal d55eb93c94 MFH: fix #39662 (Segfault when calling asXML() of a cloned SimpleXMLElement) 2006-11-28 18:59:53 +00:00
Antony Dovgal bb30875db6 add test 2006-11-28 16:55:05 +00:00
Ilia Alshanetsky 2d4b8e19e2 Fixed bug #39656 (crash when calling fetch() on a PDO statment object
after closeCursor()).
2006-11-28 16:27:53 +00:00
Antony Dovgal 2c6a5df4ac BFN 2006-11-28 11:40:41 +00:00
Antony Dovgal 5a6c11d9f4 MFH: fix #39653 (ext/dba doesn't check for db-4.5 and db-4.4 when db4 support is enabled) 2006-11-28 11:39:19 +00:00
Pierre Joye a70264892b - fix warning
- addEmptyDir returns true on success
- remove useless semi column
2006-11-28 01:31:53 +00:00
Ilia Alshanetsky 34b55f2012 Replace non-threadsafe rand() with php_rand_r() 2006-11-28 00:22:05 +00:00
Antony Dovgal 9503b966ec MFH: fix #39564 (PDO::errorInfo() returns inconsistent information when sqlite3_step() fails) 2006-11-27 12:14:09 +00:00
Antony Dovgal a3c2958f22 MFH: fix test on FreeBSD 2006-11-27 11:43:59 +00:00
Alex Waugh 4e0446b6c9 MFH: Improve robustness of sending routines 2006-11-26 19:51:23 +00:00
Ilia Alshanetsky e6a3431315 Fixed bug #39623 (thread safety fixes on *nix for putenv() & mime_magic). 2006-11-26 17:02:13 +00:00
Ilia Alshanetsky f06eb4bf8b Fixed test, in some versions of c-client returned value is always uppercase 2006-11-26 16:31:43 +00:00
Ilia Alshanetsky 845c07f560 Fixed test 2006-11-26 16:29:42 +00:00
Ilia Alshanetsky 22ff526e99 Added a meta tag to phpinfo() output to prevent search engines from
indexing the page.
2006-11-26 16:26:18 +00:00
Antony Dovgal 93fc85b2af MFH: fix #39621 (str_replace() is not binary safe on strings with equal length) 2006-11-24 21:59:09 +00:00
Nuno Lopes e8384cbcca more tests 2006-11-24 20:18:54 +00:00
Nuno Lopes d64b17543c fix tests after Tony's commit and add a test for the bug he fixed 2006-11-24 15:47:45 +00:00
Antony Dovgal 050e32ed65 fix test 2006-11-24 13:40:43 +00:00
Antony Dovgal 158ad3ee2f add tests for CLI 2006-11-24 13:33:38 +00:00
Antony Dovgal 7f235792b3 MFH: fix #39583 (ftp_put() does not change transfer mode to ASCII) 2006-11-24 12:39:39 +00:00
Antony Dovgal 724f500c92 BFN 2006-11-24 10:30:02 +00:00
Antony Dovgal ffb9e15465 fix #39613 (Possible segfault in imap initialization due to missing module dependency)
patch by wharmby at uk dot ibm dot com
2006-11-24 10:28:51 +00:00
Antony Dovgal 090215cc7f nullify opened_path and filename (when required)
fixes invalid reads with `php-cli -F <script>`
2006-11-23 22:04:54 +00:00
Nuno Lopes 94a810755f add tests for 2 old bugs 2006-11-23 20:47:38 +00:00
Antony Dovgal 7172a53c3a do not set an env variable without a name and a value 2006-11-23 20:06:10 +00:00
Nuno Lopes ba8ba5a909 add two more tests (test bogus parameters and bogus server respsnes) 2006-11-23 17:34:34 +00:00
Ilia Alshanetsky af16066603 Fixed a possible crash 2006-11-23 14:41:35 +00:00
Dmitry Stogov c663787ab4 Fixed bug #39534 (Error in maths to calculate of ZEND_MM_ALIGNED_MIN_HEADER_SIZE). (wharmby at uk dot ibm dot com) 2006-11-23 09:32:39 +00:00
Dmitry Stogov 79c3defac0 Fixed bug #39548 (ZMSG_LOG_SCRIPT_NAME not routed to OutputDebugString() on Windows) 2006-11-23 08:37:21 +00:00
Dmitry Stogov 6a8f267db6 Fixed bug #39602 (Invalid session.save_handler crashes PHP) 2006-11-23 08:07:05 +00:00
Ilia Alshanetsky e8180067b9 Fixed a possible crash in dbase_open() on empty filename. 2006-11-22 17:30:34 +00:00
Pierre Joye efa9b7e20b - MFH: #39538, fgetcsv can't handle starting newlines and trailing odd
number of backslashes (David Soria Parra, Pierre)
2006-11-22 12:59:49 +00:00
Antony Dovgal a7ce772222 fix #39575 (move_uploaded_file() no longer working (safe mode related)) 2006-11-22 11:55:36 +00:00
Michael Wallner a09ef37d30 - fix ENV section handling 2006-11-22 10:45:06 +00:00
Antony Dovgal df1a1c8441 MFH: fix #39576 (array_walk() doesn't separate userdata zval) 2006-11-22 10:42:41 +00:00
Antony Dovgal 090a83b974 ensure that bucket->brigade is NULL in newly created bucket 2006-11-21 20:58:17 +00:00
Antony Dovgal 26ed531c64 add test 2006-11-21 18:17:11 +00:00
Antony Dovgal e412981f7b remove redundant error message
add test by <zoe dot slattery at googlemail dot com>
2006-11-21 17:42:11 +00:00
Ilia Alshanetsky 57eb7c0bad Adjust previous patch to work better 2006-11-21 15:53:23 +00:00
Antony Dovgal 1c6ee3030e add test 2006-11-21 11:11:39 +00:00
Antony Dovgal eb666b725f MFH: fix proto 2006-11-21 10:48:29 +00:00
Antony Dovgal 2f9a9c4248 add new test 2006-11-20 22:17:10 +00:00
Antony Dovgal c220da74ef MFH test 2006-11-20 20:55:51 +00:00
Marcus Boerger d4dc662621 - MFH: Fix arginfo 2006-11-20 20:04:03 +00:00
Marcus Boerger 164929d557 - MFH: Add new test 2006-11-20 19:58:01 +00:00
Ilia Alshanetsky fd8378d7d6 Fixed compiler warnings 2006-11-20 19:04:21 +00:00
Antony Dovgal 2ff721a93f MFH 2006-11-20 16:33:06 +00:00
Antony Dovgal 39ad6abbf8 fix test on Solaris 2006-11-20 16:28:26 +00:00
Antony Dovgal 296e2a3775 MFH 2006-11-20 11:12:42 +00:00
Nuno Lopes bd519ae0d9 new tests. what a crazy idea... 2006-11-19 18:37:28 +00:00
Ilia Alshanetsky 714abb7ea1 pack()/unpack() tests 2006-11-19 18:31:07 +00:00
Ilia Alshanetsky 0d338f463c Fixed bug #38770 (unpack() broken with longs on 64 bit machines). 2006-11-19 18:20:48 +00:00
Dmitry Stogov c06f9e1efe COM initialization/deinitialization are done only if necessary 2006-11-17 11:40:52 +00:00
Nuno Lopes cb4b75f155 remove old file (which was already removed from 4.4 and HEAD trees) 2006-11-16 18:58:02 +00:00
Ilia Alshanetsky c7d84b7451 Fixed compiler warnings 2006-11-16 17:33:39 +00:00
Hannes Magnusson 133bdb42e3 Fix ftruncate() with negative size on FreeBSD 2006-11-16 16:06:51 +00:00
Antony Dovgal cf04587553 fix tests 2006-11-16 13:49:20 +00:00
Antony Dovgal 36d66521c9 add new tests 2006-11-16 13:01:23 +00:00
Hannes Magnusson cf64728899 renamed to oo_getcomment.phpt 2006-11-16 08:52:15 +00:00
Pierre Joye 426dce9ce3 - mv oo_get_comment.phpt oo_getcomment.phpt 2006-11-15 23:53:46 +00:00
Pierre Joye c412409164 - MFH: #39217, serialNumber might be -1 when the value is too big 2006-11-15 23:28:06 +00:00
Antony Dovgal d1acb8d4eb add new tests, improve existing ones 2006-11-15 22:44:29 +00:00
Antony Dovgal eca1911b72 fix leak, add test 2006-11-15 22:10:19 +00:00
Sara Golemon 2eb308ff75 Backport md2, ripemd256, and ripemd320 algos from HEAD 2006-11-15 20:06:09 +00:00
Pierre Joye 892c00bb9f #9278 and #39506, force the binary mode for the zip operation only. At least I do not have to set/restore it in each function. 2006-11-15 19:14:02 +00:00
Ilia Alshanetsky 82fb3e00b8 Fixed bug #37773 (iconv_substr() gives "Unknown error" when string length =
1").
2006-11-15 18:34:57 +00:00
Dmitry Stogov 3f92ab719f typo 2006-11-15 17:53:27 +00:00
Antony Dovgal 9d6f7755b8 fix leak appearing when converting object to NULL
add test
2006-11-15 17:29:08 +00:00
Antony Dovgal 84ff4aaf1a add new tests 2006-11-15 17:27:03 +00:00
Pierre Joye 1d61562efe #39506 and PECL #9278, should fix the problem for the other SAPI (works for CLI, CGI and embed)
see: http://news.php.net/php.internals/26606 for the details
2006-11-15 16:24:24 +00:00
Dmitry Stogov 842b1b5a47 Fixed bug #39445 (Calling debug_backtrace() in the __toString() function produces a crash) 2006-11-15 16:05:11 +00:00
Dmitry Stogov 8619bf8332 Removed unnecessary getenv/putenv calls 2006-11-15 13:33:41 +00:00
Antony Dovgal 70288ef71e fix test on AIX 2006-11-15 12:11:17 +00:00
Antony Dovgal 567aed8316 fix test 2006-11-15 11:27:26 +00:00
Dmitry Stogov 0916ac47c9 Fixed wrong ext/filter behavior. It didn't register FastCGI environment variables and made memory leaks. 2006-11-15 11:13:02 +00:00
Antony Dovgal 60188ad863 fix test 2006-11-15 10:47:26 +00:00
Hannes Magnusson 849a7857ac Fix test (file_put_contents() now uses __toString) 2006-11-15 07:58:02 +00:00
Ilia Alshanetsky fca0e24410 Added missing object support to file_put_contents(). 2006-11-15 00:20:40 +00:00
Antony Dovgal 6640a1c861 one more test 2006-11-14 22:23:45 +00:00
Antony Dovgal 963b1db67f add new tests 2006-11-14 21:59:57 +00:00
Edin Kadribasic a3453eb8d4 Bundled lib upgrade 2006-11-14 19:59:31 +00:00
Edin Kadribasic 77986844c8 Tell linker that we're using stati libcurl 2006-11-14 19:57:13 +00:00
Derick Rethans de50222d1c - MFH: No idea if we actually support 16 bit systems, but this just looked wrong 2006-11-14 14:42:42 +00:00
Dmitry Stogov c1ba4fc989 Fixed VC2005 support 2006-11-14 14:20:26 +00:00
Dmitry Stogov 9b5a57f548 Fixed problem with spaces in libpath 2006-11-14 14:10:53 +00:00
Pierre Joye df56d24304 - #39508, do not use the 4 neighbors implementation for small images (w<4)
test will follow
2006-11-14 13:45:24 +00:00
Dmitry Stogov 5caf547a9f cgi.* and fastcgi.* directives are moved to INI subsystem. The new directive cgi.check_shebang_line can be used to ommiting checnk for "#! /usr/bin/php" line. 2006-11-14 10:31:47 +00:00
Antony Dovgal 89e93a02f3 add .libs to .cvsignore 2006-11-14 09:40:14 +00:00
Dmitry Stogov af74c7c9d2 Added comments 2006-11-14 09:15:55 +00:00
Ilia Alshanetsky b28cbe8b6f Fixed bug #36812 (pg_execute() modifies input array). 2006-11-13 22:10:37 +00:00
Antony Dovgal 923b785fd1 add new test 2006-11-13 21:27:48 +00:00
Antony Dovgal 017f3ae479 don't forget to close the stream when/if flock() fails 2006-11-13 20:31:27 +00:00
Antony Dovgal 34db368fe4 MFH: fix leaks in get_meta_tags() when used with b0rked HTML
add test
2006-11-13 20:18:12 +00:00
Antony Dovgal c301119fdf MFH: improve the fix and the test 2006-11-13 19:32:58 +00:00
Hannes Magnusson 5d92b4281f It's called addEmptyDir(), not createEmptyDir() 2006-11-13 18:30:59 +00:00
Ilia Alshanetsky 941c036297 Fixed bug #36644 (possible crash in variant_date_from_timestamp()). 2006-11-13 15:33:26 +00:00
Dmitry Stogov 682bbf19ef Use symbolic names 2006-11-13 15:13:20 +00:00
Antony Dovgal 69e0c84522 MFH 2006-11-13 15:00:05 +00:00
Antony Dovgal a2a20556d8 new test 2006-11-13 14:51:11 +00:00
Antony Dovgal 60a2df7db2 add a note that libxml2 2.6.2x is required 2006-11-13 12:54:04 +00:00
Antony Dovgal 79e4f5fd22 MFH: fix compile warning 2006-11-13 12:49:28 +00:00
Antony Dovgal b5b8fa4f6b fix test 2006-11-13 12:47:43 +00:00
Dmitry Stogov f00ee72c35 Fixed incorrect heap corruptiuon detection code 2006-11-13 10:28:46 +00:00
Hannes Magnusson a27d73b13d Add missing header installation.. 2006-11-12 19:00:33 +00:00
Ilia Alshanetsky 6e9c7c4aa9 Fixed generated file 2006-11-12 17:55:44 +00:00
Ilia Alshanetsky c32ed59e4e Fixed a memory leak when named & positional params are being used in the
same query.
2006-11-12 17:49:19 +00:00
Hannes Magnusson 3bf35bbc15 MFH: SplFileObject no longer overwrites SplFileInfo::getFilename() 2006-11-12 17:35:09 +00:00
Ilia Alshanetsky d4a64fba74 removed bogus char 2006-11-12 17:23:01 +00:00
Hannes Magnusson 1182b325c2 MFH: SplFileObject::getFilename() no longer overwrites SplFileInfo::getFilename()
(SplFileObject::getFilename() therefor only returns the filename now)
2006-11-12 17:16:13 +00:00
Ilia Alshanetsky e0d385a328 Optimized array functions utilizing php_splice(). 2006-11-12 17:13:22 +00:00
Marcus Boerger d3bda9a516 - MFH: Correct comments 2006-11-12 15:58:17 +00:00
Hannes Magnusson 7b81e554ae MFH: Fixed bug#36975 (natcasesort() causes array_pop() to misbehave) 2006-11-12 01:14:39 +00:00
Nuno Lopes 7d75155e01 fix leak in oo_stream.phpt 2006-11-12 00:41:16 +00:00
Nuno Lopes c0b0d0a81a fix leak in the object destrucotr when zip_close() fails (fixes oo_delete.phpt) 2006-11-12 00:31:03 +00:00
Nuno Lopes 232bb79bed fix leaks within zip entries in several tests 2006-11-11 23:43:00 +00:00
Nuno Lopes b3de830b61 fix leak in oo_setArchiveComment.phpt 2006-11-11 23:35:27 +00:00
Pierre Joye 8cb18e8d64 - fix leak in zip_close when the function's succeeded 2006-11-11 19:06:56 +00:00
Nuno Lopes 94404da606 fix the bug I introduced previously, sorry
anyway, convert the recursive version of the binary search to an iterative one
2006-11-10 23:27:11 +00:00
Antony Dovgal 88e827f3f1 MFH 2006-11-10 23:03:32 +00:00
Antony Dovgal 7563d4f573 fix possible issue with negative values in oci_set_prefetch
(reported by Chris Jones)
2006-11-10 20:13:36 +00:00
Andi Gutmans d98a8aa589 - Fix typo 2006-11-10 18:51:05 +00:00
Nuno Lopes ec46e5e510 mark a few variables and functions as static 2006-11-10 18:05:11 +00:00
Nuno Lopes fe8e53f7a7 mark the binary search delimiters as unsigned, so that the compiler can use a quick shift operation 2006-11-10 17:32:15 +00:00
Dmitry Stogov 3011278aab Fixed wrong realpath() result in case of unexistent path 2006-11-10 17:23:58 +00:00
Hannes Magnusson 16e6b2cf52 Fix tests 2006-11-10 17:04:03 +00:00
Dmitry Stogov c06626d8c6 Fixed wrong realpath() result in case of unexistent path 2006-11-10 16:57:17 +00:00
Antony Dovgal 4106eee7c7 fix segfault in ZTS mode when statements containing sub-statements are destroyed in wrong order 2006-11-10 16:33:41 +00:00
Dmitry Stogov 31bfc6e55b Fixed bug #39454 (Returning a SOAP array segfaults PHP) 2006-11-10 15:05:22 +00:00
Dmitry Stogov ce958eded5 stat() is reimplemented using using GetFileAttributesEx().
The new implementation is faster then implementation in MS VC CRT, but it doesn't support Windows 95.
2006-11-10 15:04:07 +00:00
Dmitry Stogov 40d3abba41 Fixed tests 2006-11-10 14:20:26 +00:00
Dmitry Stogov daed379550 Removed unnecessary ftell() calls (one call for each included PHP file) 2006-11-10 13:18:35 +00:00
Dmitry Stogov f22ae56bc9 Disabled reading from stream (calls to read()) after EOF 2006-11-10 13:10:16 +00:00
Dmitry Stogov f05ed6390c VCWD_REALPATH() is improved to use realpath cache without VIRTUAL_DIR 2006-11-10 12:59:27 +00:00
Derick Rethans 140edac7f9 - Forward port the binary cast, which will do the same as the string cast in
PHP 5.2.
2006-11-10 12:02:51 +00:00
Dmitry Stogov a4a77d3f91 Intialization code is moved from request startup to module startup 2006-11-10 12:02:10 +00:00
Dmitry Stogov 011e0cde62 Start timiout thread on Windows only if necessary 2006-11-10 11:49:35 +00:00
Dmitry Stogov 532b02cd19 Implemented registry cache that prevent registry lookup on each request. In case of modification of corresponding registry-tree PHP will reload it automatic. 2006-11-10 11:42:07 +00:00
Dmitry Stogov 41c81f20e1 opendir() is reimplemented using GetFistFile/GetNextFile those are faster then _findfirst/_findnext 2006-11-10 11:20:48 +00:00
Dmitry Stogov a5f951f27c Removed unnecessary checks for ISREG file and corresponding stat() calls on Windows 2006-11-10 10:55:26 +00:00
Dmitry Stogov ab5268fc84 typo 2006-11-10 10:47:52 +00:00
Dmitry Stogov f1b6587ebb Zend Memory Manager Improvements
. use HeapAlloc() instead of VirtualAlloc()
. use "win32" storage manager (instead of "malloc") on Windows by default
2006-11-10 10:44:40 +00:00
Dmitry Stogov fedc06d290 Fix warnings 2006-11-10 10:38:07 +00:00
Dmitry Stogov bcfc501ca6 Use $(CC) for linking instead of $(LD). This allows usage of advansed optimization techniques (like Intel's inner-procedure optimization) 2006-11-10 10:30:46 +00:00
Dmitry Stogov a930751112 Faster and better licensed implementation 2006-11-10 10:10:38 +00:00
Dmitry Stogov 9fd2b6deb4 Simplify the code base as this getpwd() was used only once 2006-11-10 09:56:16 +00:00
Ilia Alshanetsky 126be8ec7c Added missing API declarations. 2006-11-10 01:28:59 +00:00
Ilia Alshanetsky f06762b361 Fixed pecl bug #9179 (phpversion("filter") shows wrong version). 2006-11-10 01:08:17 +00:00
Ilia Alshanetsky ddae41877f Added missing PHPAPI declaration 2006-11-09 20:01:41 +00:00
Ilia Alshanetsky b3006ed2a5 Fixed bug #38456 (Apache2 segfaults when virtual() is called in .php
ErrorDocument).
2006-11-09 19:10:13 +00:00
Nuno Lopes fb06fa19e3 fix test for non English guys 2006-11-09 16:38:28 +00:00
Nuno Lopes 98dd25e04c fix an invalid read + invalid free() 2006-11-09 16:33:07 +00:00
Nuno Lopes d6802e1022 statification of local functions and variables.
also remove a few uneeded global variables
interesting new warnings:
/cvs/php5/ext/xmlwriter/php_xmlwriter.c:391: warning: 'xmlwriter_objects_clone' defined but not used
/cvs/php5/ext/xmlwriter/php_xmlwriter.c:1281: warning: 'zif_xmlwriter_start_dtd_entity' defined but not used
/cvs/php5/ext/xmlwriter/php_xmlwriter.c:1325: warning: 'zif_xmlwriter_end_dtd_entity' defined but not used
/cvs/php5/ext/xmlwriter/php_xmlwriter.c:1333: warning: 'zif_xmlwriter_write_dtd_entity' defined but not used
2006-11-09 16:04:34 +00:00
Hannes Magnusson 371400ae15 Add "As of 5.2.1" notes as requested 2006-11-09 12:35:12 +00:00
Hannes Magnusson 4989f0d899 New features/errormsgs/return values in ext/zip
New optional parameter in ext/ming
2006-11-09 11:44:13 +00:00
Frank M. Kromann 87b412dc3a Revert patch for warnings about missing headers. These are fixed in the latest version of libming.
Sync code for SWFMovie::streamMP3. This function will now return the number of frames in the file.
2006-11-09 09:19:21 +00:00
Dmitry Stogov 25f01e8ec3 Fixed tests 2006-11-09 08:29:18 +00:00
Ilia Alshanetsky e5f9b479af Fixed bug #38602 (header( "HTTP/1.0 ..." ) does not change proto version). 2006-11-09 00:13:26 +00:00
Antony Dovgal 1f061b3154 fix #39300 (make install fails if wget is not available)
add support of 'fetch'
2006-11-08 19:05:41 +00:00
Dmitry Stogov cc895444b1 HashTable copying optimization (Matt Wilmas) 2006-11-08 16:02:03 +00:00
Dmitry Stogov 41ae8de136 Fixed bug #39297 (Memory corryption because of indirect modification of overloaded array). 2006-11-08 13:38:28 +00:00
Dmitry Stogov a84a2eae6a Fixed bug #39344 (Unnecessary calls to OnModify callback routine for an extension INI directive). (wharmby at uk dot ibm dot com, Dmitry) 2006-11-08 11:04:27 +00:00
Dmitry Stogov 84b9dcb73f Fixed bug #38536 (SOAP returns an array of values instead of an object) 2006-11-08 10:05:19 +00:00
Ilia Alshanetsky d6b3b73490 Fixed tests 2006-11-07 20:24:38 +00:00
Ilia Alshanetsky 6e30ea1e3f BFN 2006-11-07 20:24:04 +00:00
Ilia Alshanetsky cb96148912 Fixed bug #33282 (Re-assignment by reference does not clear the is_ref flag)
# Original patch by Matt Wilmas
2006-11-07 20:23:30 +00:00
Ilia Alshanetsky 887b3484f7 Fixed bug #39398 (Booleans are not automatically translated to integers). 2006-11-07 17:57:17 +00:00
Johannes Schlüter c65a1f10cb - MFH: No C++ comments (fix #39414) 2006-11-07 15:19:11 +00:00
Hannes Magnusson 69dbaaacac MFH: arginfo fixes 2006-11-06 23:20:11 +00:00
Rasmus Lerdorf cdf8494879 It is allow_url_include not allow_fopen_include 2006-11-06 18:21:25 +00:00
Ilia Alshanetsky 07cdfefdee Fixed bug #39350 (crash with implode("\n", array(false))). 2006-11-06 17:21:05 +00:00
Hannes Magnusson 4cb16d8328 include php://input && data: have been disabled (with allow_fopen_include off)
new DateTime(new stdclass) now throws exception
imap_[re]open() has new optional parameter
2006-11-06 16:51:55 +00:00
Ilia Alshanetsky 5cc7f616c9 param parsing fix
# Thanks Hannes
2006-11-06 16:44:03 +00:00
Dmitry Stogov 7b8f30adcb Fixed bug #39121 (Incorrect return array handling in non-wsdl soap client) 2006-11-06 16:36:43 +00:00
Hannes Magnusson c263929002 MFH: throw exception on invalid parameters 2006-11-06 16:11:26 +00:00
Hannes Magnusson c32408e694 MFH: fix segfault & improve test 2006-11-06 15:21:45 +00:00
Dmitry Stogov 82f89748a4 Windows doesn't have chown(). Remove unused function and reference to undeclared macro VCWD_CHOWN(). 2006-11-06 14:54:52 +00:00
Dmitry Stogov 95fbb9514e MFH: Fixed decoding list of arrays (related to bug #39121) 2006-11-06 13:22:49 +00:00
Rasmus Lerdorf cea64d52fa data: and php:stdin/input allow_url_include checks 2006-11-05 20:08:58 +00:00
Ilia Alshanetsky 86a6812dbb Fixed bug #39362 (Added an option to imap_open/imap_reopen to control the
number of connection retries).
2006-11-05 18:31:41 +00:00
Pierre Joye 00f0e92dee - gdpng entry 2006-11-05 15:08:50 +00:00
Pierre Joye 5784602544 - Merge from gd-cvs, initialize the signature not the infile ctx
NB: good that we don't use getC :)
2006-11-05 15:04:50 +00:00
Marcus Boerger 79946dc8a0 - MFH: Make parameter parsing api check happy 2006-11-04 20:46:32 +00:00
Rasmus Lerdorf c8778c73c3 Mark memory streams as is_url 2006-11-04 20:43:28 +00:00
Marcus Boerger 15592390c5 - MFH Store length of autoload file exts 2006-11-04 20:27:28 +00:00
Frank M. Kromann 9df320c423 Fix win32 build 2006-11-04 17:25:14 +00:00
Pierre Joye 4e257c03a1 - WS 2006-11-04 14:34:33 +00:00
Pierre Joye 29242cfab9 - MFH: optimize horizontal and vertical lines 2006-11-04 14:27:07 +00:00
Hannes Magnusson 7b15d02b99 Fix build 2006-11-04 13:03:56 +00:00
Pierre Joye d05ef39c74 - MFH #39366, imagerotate does not use alpha with angles>45 2006-11-04 03:15:31 +00:00
Pierre Joye 59841dd25c - #39273 entry 2006-11-04 02:24:53 +00:00
Pierre Joye 541f9940ac - #39273, imagecopyresized and alpha channel 2006-11-04 02:21:06 +00:00
Pierre Joye b867123e30 - News entry for zip MFH 2006-11-04 00:09:04 +00:00
Ilia Alshanetsky 6f0a9d6f76 wrong bug # 2006-11-03 20:38:21 +00:00
Ilia Alshanetsky 6516d8e1d6 Fixed bug #39358 (INSTALL_HEADERS contains incorrect reference to
php_filter.h)
2006-11-03 20:08:38 +00:00
Ilia Alshanetsky 4f3889d5bf Fixed bug #39361 (Removed warning on empty haystack inside mb_strstr()). 2006-11-03 19:55:51 +00:00
Marcus Boerger f7948f7fef - BFN 2006-11-03 19:04:19 +00:00
Marcus Boerger 17b675132b - Fix version 2006-11-03 19:03:25 +00:00
Marcus Boerger da8b00a5e4 - MFH: Fixed bug #39320 2006-11-03 19:02:16 +00:00
Marcus Boerger 978dd0fdd9 - MFH: Fix issue with some mangeled properties 2006-11-03 19:01:40 +00:00
Marcus Boerger 2820e9cf1e - MFH: Fixed bug #38698 2006-11-03 19:00:46 +00:00
Marcus Boerger 76ba475d76 - MFH: Synch 2006-11-03 18:58:41 +00:00
Marcus Boerger 76b73a6ff2 - MFH: Include new headers only if present 2006-11-03 18:57:50 +00:00
Hannes Magnusson 49c109693a Add "comment" to make tracking the commit down easier 2006-11-03 18:07:53 +00:00
Pierre Joye 8ad0c6d543 - MFH:
- fix possible leak in statName and statIndex
 - add addEmptyDir() method
 - add zip_stat_init,zip_clear_error and zip_file_clear_error
 - add tests
 - Fix protos (Hannes)
 - setComment return value on success (Hannes)
2006-11-03 16:46:19 +00:00
Pierre Joye c002606a88 - fix build (var.s is for zstr) 2006-11-03 16:40:52 +00:00
Hannes Magnusson b11b08e987 MFH: fix parameter parsing in getrusage() 2006-11-03 15:48:39 +00:00
Hannes Magnusson 4deb09e72e Generated file 2006-11-03 15:41:09 +00:00
Hannes Magnusson 5006fb2ceb MFH: Fix double "wrong param count" messages 2006-11-03 15:13:17 +00:00
Hannes Magnusson 91c604d584 MFH: Add "wrong param" warning to strtotime() 2006-11-03 15:06:51 +00:00
Ilia Alshanetsky 0c7e63a07e Fixed bug #39354 (Allow building of curl extension against libcurl 7.16.0) 2006-11-03 14:53:14 +00:00
Hannes Magnusson ace3f94d20 MFH: Fix test 2006-11-03 14:51:02 +00:00
Hannes Magnusson 050f94f746 MFH: Fix double "wron param count" messages 2006-11-03 14:46:48 +00:00
Hannes Magnusson 11c47dc510 MFH: oneliners.. 2006-11-03 14:38:45 +00:00
Hannes Magnusson 07a16d19e0 MFH: use PHP_ME_MAPPING rather than ZEND_NAMED_FE/ZEND_FN 2006-11-03 14:36:11 +00:00
Hannes Magnusson 4f4e724b1b MFH: Remove SKIPIF 2006-11-03 14:17:40 +00:00
Hannes Magnusson bece30aee5 MFH: fix crash on invalid regex 2006-11-03 14:11:23 +00:00
Hannes Magnusson 9445a302ae MFH: missing includes 2006-11-03 14:06:59 +00:00
Ilia Alshanetsky 7ce23de84c Filter extension news 2006-11-03 13:54:49 +00:00
Ilia Alshanetsky 683f81f195 MFH: Fixed a possible crash when callback function returns a non-modified
value
2006-11-03 13:53:24 +00:00
Ilia Alshanetsky 6123f11021 MFH:
Added filter support for $_SERVER in cgi/apache2 sapis
	Make sure PHP_SELF is filtered in Apache 1 sapi
2006-11-03 13:51:48 +00:00
Ilia Alshanetsky bd2ab7bc15 Fixed bug #39215 (Inappropriate close of stdin/stdout/stderr). 2006-11-03 13:34:19 +00:00
Ilia Alshanetsky 3f71251ffa MFH: Fixed bug #39265 (Fixed path handling inside mod_files.sh). 2006-11-03 13:19:07 +00:00
Ilia Alshanetsky 57f295d3a6 Fixed bug #38680 (Added missing handling of basic types in json_decode).
# already in HEAD
2006-11-03 13:16:33 +00:00
Derick Rethans 7b48ca584c - Fixed API in doc. 2006-11-03 07:27:52 +00:00
Rui Hirokawa 501025306c fixed illegal encoding detection when mbstring.encoding_translation is enabled.(made by komura) 2006-11-03 02:26:50 +00:00
Rui Hirokawa 96d597b6a4 added japanese legacy encoding support (made by moriyama@miraclelinux.com) 2006-11-03 01:11:35 +00:00
Ilia Alshanetsky 3a533934c7 Added missing boundary checks. 2006-11-01 01:55:11 +00:00
Ilia Alshanetsky bc32d6b5cd Cleanup of 5.2 update file from Steph 2006-10-31 17:24:51 +00:00
Ilia Alshanetsky 8045c6bff8 Back to dev 2006-10-30 23:08:30 +00:00
1232 changed files with 46558 additions and 33767 deletions

No files matched your search

+323 -325
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -67,7 +67,7 @@ php_lcov.info: lcov-test
lcov-html: php_lcov.info
@echo "Generating lcov HTML"
@$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" --show-details php_lcov.info
@$(LTP_GENHTML) --legend --output-directory lcov_html/ --title "PHP Code Coverage" php_lcov.info
lcov-clean:
rm -f php_lcov.info
+365
View File
@@ -1,5 +1,369 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
08 Feb 2007, PHP 5.2.1
- Added read-timeout context option "timeout" for HTTP streams. (Hannes, Ilia).
- Added CURLOPT_TCP_NODELAY constant to Curl extension. (Sara)
- Added support for hex numbers of any size. (Matt)
- Added function stream_socket_shutdown(). It is a wrapper for system
shutdown() function, that shut downs part of a full-duplex connection.
(Dmitry)
- Added internal heap protection (Dmitry)
. memory-limit is always enabled (--enable-memory-limit removed)
. default value if memory-limit is set to 128M
. safe unlinking
. cookies
. canary protection (debug build only)
. random generation of cookies and canaries
- Added forward support for 'b' prefix in front of string literals. (Andrei)
- Added three new functions to ext/xmlwriter (Rob, Ilia)
. xmlwriter_start_dtd_entity()
. xmlwriter_end_dtd_entity()
. xmlwriter_write_dtd_entity()
- Added a meta tag to phpinfo() output to prevent search engines from indexing
the page. (Ilia)
- Added new function, sys_get_temp_dir(). (Hartmut)
- Added missing object support to file_put_contents(). (Ilia)
- Added support for md2, ripemd256 and ripemd320 algos to hash(). (Sara)
- Added forward support for (binary) cast. (Derick)
- Added optimization for imageline with horizontal and vertical lines (Pierre)
- Removed dependency from SHELL32.DLL. (Dmitry)
- Removed double "wrong parameter count" warnings in various functions.
(Hannes)
- Moved extensions to PECL:
. ext/informix (Derick, Tony)
- Changed double-to-string utilities to use BSD implementation. (Dmitry, Tony)
- Updated bundled libcURL to version 7.16.0 in the Windows distro. (Edin)
- Updated timezone database to version 2006.16. (Derick)
- cgi.* and fastcgi.* directives are moved to INI subsystem. The new directive
cgi.check_shebang_line can be used to omitting check for "#! /usr/bin/php"
line. (Dmitry).
- Improved proc_open(). Now on Windows it can run external commands not
through CMD.EXE. (Dmitry)
- VCWD_REALPATH() is improved to use realpath cache without VIRTUAL_DIR.
(Dmitry)
- ext/bcmath initialization code is moved from request startup to module
startup. (Dmitry)
- Zend Memory Manager Improvements (Dmitry)
. use HeapAlloc() instead of VirtualAlloc()
. use "win32" storage manager (instead of "malloc") on Windows by default
- Zip Extension Improvements (Pierre)
. Fixed leak in statName and stateIndex
. Fixed return setComment (Hannes)
. Added addEmptyDir method
- Filter Extension Improvements (Ilia, Pierre)
. Fixed a bug when callback function returns a non-modified value.
. Added filter support for $_SERVER in cgi/apache2 sapis.
. Make sure PHP_SELF is filtered in Apache 1 sapi.
. Fixed bug #39358 (INSTALL_HEADERS contains incorrect reference to
php_filter.h).
. Added "default" option that allows a default value to be set for an
invalid or missing value.
. Invalid filters fails instead of returning unsafe value
. Fixed possible double encoding problem with sanitizing filters
. Make use of space-strict strip_tags() function
. Fixed whitespace trimming
. Added support for FastCGI environment variables. (Dmitry)
- PDO_MySQL Extension Improvements (Ilia)
. Enabled buffered queries by default.
. Enabled prepared statement emulation by default.
- Small optimization of the date() function. (Matt,Ilia)
- Optimized the internal is_numeric_string() function. (Matt,Ilia)
- Optimized array functions utilizing php_splice(). (Ilia)
- Windows related optimizations (Dmitry, Stas)
. COM initialization/deinitialization are done only if necessary
. removed unnecessary checks for ISREG file and corresponding stat() calls
. opendir() is reimplementation using GetFistFile/GetNextFile those are
faster then _findfirst/_findnext
. implemented registry cache that prevent registry lookup on each request.
In case of modification of corresponding registry-tree PHP will reload it
automatic
. start timeout thread only if necessary
. stat() is reimplementation using GetFileAttributesEx(). The new
implementation is faster then implementation in MS VC CRT, but it doesn't
support Windows 95.
- Streams optimization (Dmitry)
. removed unnecessary ftell() calls (one call for each included PHP file)
. disabled calls to read() after EOF
- Fixed incorrect function names on FreeBSD where inet_pton() was named
__inet_pton() and inet_ntop() was named __inet_ntop(). (Hannes)
- Fixed FastCGI impersonation for persistent connections on Windows. (Dmitry)
- Fixed wrong signature initialization in imagepng (Takeshi Abe)
- Fixed ftruncate() with negative size on FreeBSD. (Hannes)
- Fixed segfault in RegexIterator when given invalid regex. (Hannes)
- Fixed segfault in SplFileObject->openFile()->getPathname(). (Hannes)
- Fixed segfault in ZTS mode when OCI8 statements containing sub-statements
are destroyed in wrong order. (Tony)
- Fixed the validate email filter so that the letter "v" can also be used in
the user part of the email address. (Derick)
- Fixed bug #40297 (compile failure in ZTS mode when collections support is
missing). (Tony)
- Fixed bug #40285 (The PDO prepare parser goes into an infinite loop in
some instances). (Ilia)
- Fixed Bug #40274 (Sessions fail with numeric root keys). (Ilia)
- Fixed bug #40259 (ob_start call many times - memory error). (Dmitry)
- Fixed bug #40231 (file_exists incorrectly reports false). (Dmitry)
- Fixed bug #40228 (ZipArchive::extractTo does create empty directories
recursively). (Pierre)
- Fixed bug #40200 (The FastCgi version has different realpath results than
thread safe version). (Dmitry)
- Fixed bug #40191 (use of array_unique() with objects triggers segfault).
(Tony)
- Fixed bug #40189 (possible endless loop in zlib.inflate stream filter).
(Greg, Tony)
- Fixed bug #40169 (CURLOPT_TCP_NODELAY only available in curl >= 7.11.2).
(Tony)
- Fixed bug #40129 (iconv extension doesn't compile with CodeWarrior on
Netware). (gk at gknw dot de, Tony)
- Fixed bug #40127 (apache2handler doesn't compile on Netware).
(gk at gknw dot de)
- Fixed bug #40121 (PDO_DBLIB driver wont free statements). (Ilia)
- Fixed bug #40098 (php_fopen_primary_script() not thread safe). (Ilia)
- Fixed bug #40092 (chroot() doesn't clear realpath cache). (Dmitry)
- Fixed bug #40091 (spl_autoload_register with 2 instances of the same class).
(Ilia)
- Fixed bug #40083 (milter SAPI functions always return false/null). (Tony)
- Fixed bug #40079 (php_get_current_user() not thread safe).
(Ilia, wharmby at uk dot ibm dot com)
- Fixed bug #40078 (ORA-01405 when fetching NULL values using
oci_bind_array_by_name()). (Tony)
- Fixed bug #40076 (zend_alloc.c: Value of enumeration constant must be in
range of signed integer). (Dmitry)
- Fixed bug #40073 (exif_read_data dies on certain images). (Tony, Marcus)
- Fixed bug #40036 (empty() does not work correctly with ArrayObject when
using ARRAY_AS_PROPS). (Ilia)
- Fixed bug #40012 (php_date.c doesn't compile on Netware).
(gk at gknw dot de, Derick)
- Fixed bug #40009 (http_build_query(array()) returns NULL). (Ilia)
- Fixed bug #40002 (Try/Catch performs poorly). (Dmitry)
- Fixed bug #39993 (tr_TR.UTF-8 locale has problems with PHP). (Ilia)
- Fixed bug #39990 (Cannot "foreach" over overloaded properties). (Dmitry)
- Fixed bug #39988 (type argument of oci_define_by_name() is ignored).
(Chris Jones, Tony)
- Fixed bug #39984 (redirect response code in header() could be ignored
in CGI sapi). (Ilia)
- Fixed bug #39979 (PGSQL_CONNECT_FORCE_NEW will causes next connect to
establish a new connection). (Ilia)
- Fixed bug #39971 (pg_insert/pg_update do not allow now() to be used
for timestamp fields). (Ilia)
- Fixed bug #39969 (ini setting short_open_tag has no effect when using
--enable-maintainer-zts). (Dmitry)
- Fixed bug #39952 (zip ignoring --with-libdir on zlib checks)
(judas dot iscariote at gmail dot com)
- Fixed bug #39944 (References broken). (Dmitry)
- Fixed bug #39935 (Extensions tidy,mcrypt,mhash,pdo_sqlite ignores
--with-libdir). (judas dot iscariote at gmail dot com, Derick)
- Fixed bug #39903 (Notice message when executing __halt_compiler() more than
once). (Tony)
- Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc). (Ilia)
- Fixed bug #39890 (using autoconf 2.6x and --with-layout=GNU breaks PEAR
install path). (Tony)
- Fixed bug #39884 (ReflectionParameter::getClass() throws exception for
type hint self). (thekid at php dot net)
- Fixed bug #39878 (CURL doesn't compile on Sun Studio Pro). (Ilia)
- Fixed bug #39873 (number_format() breaks with locale & decimal points).
(Ilia)
- Fixed bug #39869 (safe_read does not initialize errno).
(michiel at boland dot org, Dmitry)
- Fixed bug #39850 (SplFileObject throws contradictory/wrong error messages
when trying to open "php://wrong"). (Tony)
- Fixed bug #39846 (Invalid IPv4 treated as valid). (Ilia)
- Fixed bug #39845 (Persistent connections generate a warning in pdo_pgsql).
(Ilia)
- Fixed bug #39832 (SOAP Server: parameter not matching the WSDL specified
type are set to 0). (Dmitry)
- Fixed bug #39825 (foreach produces memory error). (Dmitry)
- Fixed bug #39816 (apxs2filter ignores httpd.conf & .htaccess php config
settings). (Ilia)
- Fixed bug #39815 (SOAP double encoding is not locale-independent). (Dmitry)
- Fixed bug #39797 (virtual() does not reset changed INI settings). (Ilia)
- Fixed bug #39795 (build fails on AIX because crypt_r() uses different
data struct). (Tony)
- Fixed bug #39791 (Crash in strtotime() on overly long relative date
multipliers). (Ilia)
- Fixed bug #39787 (PHP doesn't work with Apache 2.3).
(mv at binarysec dot com).
- Fixed bug #39782 (setTime() on a DateTime constructed with a Weekday
yields incorrect results). (Ilia)
- Fixed bug #39780 (PNG image with CRC/data error raises fatal error) (Pierre)
- Fixed bug #39779 (Enable AUTH PLAIN mechanism in underlying libc-client).
(michael dot heimpold at s2000 dot tu-chemnitz dot de, Ilia)
- Fixed bug #39775 ("Indirect modification ..." message is not shown).
(Dmitry)
- Fixed bug #39763 (magic quotes are applied twice by ext/filter in
parse_str()). (Ilia)
- Fixed bug #39760 (cloning fails on nested SimpleXML-Object). (Rob)
- Fixed bug #39759 (Can't use stored procedures fetching multiple result
sets in pdo_mysql). (Ilia)
- Fixed bug #39754 (Some POSIX extension functions not thread safe).
(Ilia, wharmby at uk dot ibm dot com)
- Fixed bug #39751 (putenv crash on Windows). (KevinJohnHoffman at gmail.com)
- Fixed bug #39732 (oci_bind_array_by_name doesn't work on Solaris 64bit).
(Tony)
- Fixed bug #39724 (Broken build due to spl/filter usage of pcre extension).
(Tony, Ilia)
- Fixed bug #39718 (possible crash if assert.callback is set in ini). (Ilia)
- Fixed bug #39702 (php crashes in the allocator on linux-m68k). (Dmitry)
- Fixed bug #39685 (iconv() - undefined function). (Hannes)
- Fixed bug #39673 (file_get_contents causes bus error on certain offsets).
(Tony)
- Fixed bug #39663 (Memory leak in pg_get_notify() and a possible memory
corruption on Windows in pgsql and pdo_pgsql extensions).
(Ilia, matteo at beccati dot com)
- Fixed bug #39662 (Segfault when calling asXML() of a cloned
SimpleXMLElement). (Rob, Tony)
- Fixed bug #39656 (crash when calling fetch() on a PDO statment object after
closeCursor()). (Ilia, Tony)
- Fixed bug #39653 (ext/dba doesn't check for db-4.5 and db-4.4 when db4
support is enabled). (Tony)
- Fixed bug #39652 (Wrong negative results from memory_get_usage()). (Dmitry)
- Fixed bug #39648 (Implementation of PHP functions chown() and chgrp() are
not thread safe). (Ilia, wharmby at uk dot ibm dot com)
- Fixed bug #39640 (Segfault with "Allowed memory size exhausted"). (Dmitry)
- Fixed bug #39625 (Apache crashes on importStylesheet call). (Rob)
- Fixed bug #39623 (thread safety fixes on *nix for putenv() & mime_magic).
(Ilia, wharmby at uk dot ibm dot com)
- Fixed bug #39621 (str_replace() is not binary safe on strings with equal
length). (Tony)
- Fixed bug #39613 (Possible segfault in imap initialization due to missing
module dependency). (wharmby at uk dot ibm dot com, Tony)
- Fixed bug #39606 (Use of com.typelib_file in PHP.ini STILL causes A/V). (Rob)
- Fixed bug #39602 (Invalid session.save_handler crashes PHP). (Dmitry)
- Fixed bug #39596 (Creating Variant of type VT_ARRAY). (Rob)
- Fixed bug #39583 (ftp_put() does not change transfer mode to ASCII). (Tony)
- Fixed bug #39576 (array_walk() doesn't separate user data zval). (Tony)
- Fixed bug #39575 (move_uploaded_file() no longer working (safe mode
related)). (Tony)
- Fixed bug #39571 (timeout ssl:// connections). (Ilia)
- Fixed bug #39564 (PDO::errorInfo() returns inconsistent information when
sqlite3_step() fails). (Tony)
- Fixed bug #39548 (ZMSG_LOG_SCRIPT_NAME not routed to OutputDebugString()
on Windows). (Dmitry)
- Fixed bug #39538 (fgetcsv can't handle starting newlines and trailing odd
number of backslashes). (David Soria Parra, Pierre)
- Fixed bug #39534 (Error in maths to calculate of
ZEND_MM_ALIGNED_MIN_HEADER_SIZE). (wharmby at uk dot ibm dot com, Dmitry)
- Fixed bug #39527 (Failure to retrieve results when multiple unbuffered,
prepared statements are used in pdo_mysql). (Ilia)
- Fixed bug #39508 (imagefill crashes with small images 3 pixels or less).
(Pierre)
- Fixed bug #39506 (Archive corrupt with ZipArchive::addFile method). (Pierre)
- Fixed bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not
entity). (Hannes)
- Fixed bug #39483 (Problem with handling of \ char in prepared statements).
(Ilia, suhachov at gmail dot com)
- Fixed bug #39458 (ftp_nlist() returns false on empty dirs). (Nuno)
- Fixed bug #39454 (Returning a SOAP array segfaults PHP). (Dmitry)
- Fixed bug #39450 (getenv() fills other super-globals). (Ilia, Tony)
- Fixed bug #39449 (Overloaded array properties do not work correctly).
(Dmitry)
- Fixed bug #39445 (Calling debug_backtrace() in the __toString()
function produces a crash). (Dmitry)
- Fixed bug #39438 (Fatal error: Out of memory). (Dmitry)
- Fixed bug #39435 ('foo' instanceof bar gives invalid opcode error). (Sara)
- Fixed bug #39414 (Syntax error while compiling with Sun Workshop Complier).
(Johannes)
- Fixed bug #39398 (Booleans are not automatically translated to integers).
(Ilia)
- Fixed bug #39394 (Missing check for older variants of openssl). (Ilia)
- Fixed bug #39367 (clearstatcache() doesn't clear realpath cache).
(j at pureftpd dot org, Dmitry)
- Fixed bug #39366 (imagerotate does not use alpha with angle > 45 degrees)
(Pierre)
- Fixed bug #39364 (Removed warning on empty haystack inside mb_strstr()).
(Ilia)
- Fixed bug #39362 (Added an option to imap_open/imap_reopen to control the
number of connection retries). (Ilia)
- Fixed bugs #39361 & #39400 (mbstring function overloading problem). (Seiji)
- Fixed bug #39354 (Allow building of curl extension against libcurl
7.16.0). (Ilia)
- Fixed bug #39350 (crash with implode("\n", array(false))). (Ilia)
- Fixed bug #39344 (Unnecessary calls to OnModify callback routine for
an extension INI directive). (wharmby at uk dot ibm dot com, Dmitry)
- Fixed bug #39320 (ZEND_HASH_APPLY_STOP causes deletion). (Marcus)
- Fixed bug #39313 (spl_autoload triggers Fatal error). (Marcus)
- Fixed bug #39300 (make install fails if wget is not available). (Tony)
- Fixed bug #39297 (Memory corruption because of indirect modification of
overloaded array). (Dmitry)
- Fixed bug #39286 (misleading error message when invalid dimensions are
given) (Pierre)
- Fixed bug #39273 (imagecopyresized may ignore alpha channel) (Pierre)
- Fixed bug #39265 (Fixed path handling inside mod_files.sh).
(michal dot taborsky at gmail dot com, Ilia)
- Fixed bug #39217 (serialNumber might be -1 when the value is too large).
(Pierre, Tony)
- Fixed bug #39215 (Inappropriate close of stdin/stdout/stderr). (Wez, Ilia)
- Fixed bug #39201 (Possible crash in Apache 2 with 413 ErrorHandler). (Ilia)
- Fixed bug #39151 (Parse error in recursiveiteratoriterator.php). (Marcus)
- Fixed bug #39121 (Incorrect return array handling in non-wsdl soap client).
(Dmitry)
- Fixed bug #39090 (DirectoryFilterDots doxygen docs and example is wrong).
(Marcus)
- Fixed bug #38852 (XML-RPC Breaks iconv). (Hannes)
- Fixed bug #38770 (unpack() broken with longs on 64 bit machines).
(Ilia, David Soria Parra).
- Fixed bug #38698 (for some keys cdbmake creates corrupted db and cdb can't
read valid db). (Marcus)
- Fixed bug #38680 (Added missing handling of basic types in json_decode).
(Ilia)
- Fixed bug #38604 (Fixed request time leak inside foreach() when iterating
through virtual properties). (Dmitry)
- Fixed bug #38602 (header( "HTTP/1.0 ..." ) does not change proto version).
(Ilia)
- Fixed bug #38542 (proc_get_status() returns wrong PID on windows). (Nuno)
- Fixed bug #38536 (SOAP returns an array of values instead of an object).
(Dmitry)
- Fixed bug #38456 (Apache2 segfaults when virtual() is called in .php
ErrorDocument). (Ilia)
- Fixed bug #38325 (spl_autoload_register() gives wrong line for "class not
found"). (Ilia)
- Fixed bug #38319 (Remove bogus warnings from persistent PDO connections).
(Ilia)
- Fixed bug #38274 (Memlimit fatal error sent to "wrong" stderr when using
fastcgi). (Dmitry)
- Fixed bug #38252 (Incorrect PDO error message on invalid default fetch
mode). (Ilia)
- Fixed bug #37927 (Prevent trap when COM extension processes argument of
type VT_DISPATCH|VT_REF) (Andy)
- Fixed bug #37773 (iconv_substr() gives "Unknown error" when string
length = 1"). (Ilia)
- Fixed bug #37627 (session save_path check checks the parent directory).
(Ilia)
- Fixed bug #37619 (proc_open() closes stdin on fork() failure).
(jdolecek at NetBSD dot org, Nuno)
- Fixed bug #37588 (COM Property propputref converts to PHP function
and can't be accesed). (Rob)
- Fixed bug #36975 (natcasesort() causes array_pop() to misbehave).
(Hannes)
- Fixed bug #36812 (pg_execute() modifies input array). (Ilia)
- Fixed bug #36798 (Error parsing named parameters with queries containing
high-ascii chars). (Ilia)
- Fixed bug #36644 (possible crash in variant_date_from_timestamp()). (Ilia)
- Fixed bug #36427 (proc_open() / proc_close() leak handles on windows).
(jdolecek at NetBSD dot org, Nuno)
- Fixed bug #36392 (wrong number of decimal digits with %e specifier in
sprintf). (Matt,Ilia)
- Fixed bug #36214 (__get method works properly only when conditional
operator is used). (Dmitry)
- Fixed bug #35634 (Erroneous "Class declarations may not be nested"
error raised). (Carl P. Corliss, Dmitry)
- Fixed bug #35106 (nested foreach fails when array variable has a
reference). (Dmitry)
- Fixed bug #34564 (COM extension not returning modified "out" argument) (Andy)
- Fixed bug #33734 (Something strange with COM Object). (Rob)
- Fixed bug #33386 (ScriptControl only sees last function of class). (Rob)
- Fixed bug #33282 (Re-assignment by reference does not clear the is_ref
flag) (Ilia, Dmitry, Matt Wilmas)
- Fixed bug #30074 (apparent symbol table error with
extract($blah, EXTR_REFS)) (Brian)
- Fixed bug #29840 (is_executable() does not honor safe_mode_exec_dir
setting). (Ilia)
- Fixed PECL bug #7295 (ORA-01405: fetched column value is NULL on LOB
fields). (Tony)
02 Nov 2006, PHP 5.2.0
- Updated bundled OpenSSL to version 0.9.8d in the Windows distro. (Edin)
- Updated Postgresql client libraries to 8.1.4 in the Windows distro. (Edin)
@@ -167,6 +531,7 @@ PHP NEWS
being applied when RAW filter is used. (Ilia)
- Fixed memory leaks in openssl streams context options. (Pierre)
- Fixed handling of extremely long paths inside tempnam() function. (Ilia)
- Fixed bug #39721 (Runtime inheritance causes data corruption). (Dmitry)
- Fixed bug #39304 (Segmentation fault with list unpacking of string offset).
(Dmitry)
- Fixed bug #39192 (Not including nsapi.h properly with SJSWS 7). This will
+2 -2
View File
@@ -51,8 +51,8 @@ Type specifiers
passed to it.
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
! - the parameter it follows can be of specified type or NULL (only applies
to 'a', 'o', 'O', 'r', and 'z'). If NULL is passed, the results
pointer is set to NULL as well.
to 's', 'a', 'o', 'O', 'r', 'h', 'C', 'z', and 'Z'). If NULL is passed,
the results pointer is set to NULL as well.
Examples
--------
+623 -452
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Thread Safe Resource Manager |
+----------------------------------------------------------------------+
| Copyright (c) 1999-2006, Andi Gutmans, Sascha Schumann, Zeev Suraski |
| Copyright (c) 1999-2007, Andi Gutmans, Sascha Schumann, Zeev Suraski |
| This source file is subject to the TSRM license, that is bundled |
| with this package in the file LICENSE |
+----------------------------------------------------------------------+
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Thread Safe Resource Manager |
+----------------------------------------------------------------------+
| Copyright (c) 1999-2006, Andi Gutmans, Sascha Schumann, Zeev Suraski |
| Copyright (c) 1999-2007, Andi Gutmans, Sascha Schumann, Zeev Suraski |
| This source file is subject to the TSRM license, that is bundled |
| with this package in the file LICENSE |
+----------------------------------------------------------------------+
+8 -5
View File
@@ -7,11 +7,15 @@
* on Windows 95/NT.
*/
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <direct.h>
/* struct dirent - same as Unix */
@@ -25,10 +29,10 @@ struct dirent {
/* typedef DIR - not the same as Unix */
typedef struct {
long handle; /* _findfirst/_findnext handle */
HANDLE handle; /* _findfirst/_findnext handle */
short offset; /* offset into directory */
short finished; /* 1 if there are not more files */
struct _finddata_t fileinfo; /* from _findfirst/_findnext */
WIN32_FIND_DATA fileinfo; /* from _findfirst/_findnext */
char *dir; /* the dir we are reading */
struct dirent dent; /* the dirent to return */
} DIR;
@@ -38,7 +42,6 @@ DIR *opendir(const char *);
struct dirent *readdir(DIR *);
int readdir_r(DIR *, struct dirent *, struct dirent **);
int closedir(DIR *);
void rewinddir(DIR *);
int rewinddir(DIR *);
#endif /* READDIR_H */
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+211 -65
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -35,11 +35,6 @@
#ifdef TSRM_WIN32
#include <io.h>
#include "tsrm_win32.h"
# if HAVE_NEWAPIS_H
# define WANT_GETLONGPATHNAME_WRAPPER
# define COMPILE_NEWAPIS_STUBS
# include <NewAPIs.h>
# endif
#endif
#ifdef NETWARE
@@ -140,11 +135,93 @@ static int php_check_dots(const char *element, int n)
#define CWD_STATE_FREE(s) \
free((s)->cwd);
#ifdef TSRM_WIN32
CWD_API int php_sys_stat(const char *path, struct stat *buf)
{
WIN32_FILE_ATTRIBUTE_DATA data;
__int64 t;
if (!GetFileAttributesEx(path, GetFileExInfoStandard, &data)) {
return stat(path, buf);
}
if (path[1] == ':') {
if (path[0] >= 'A' && path[0] <= 'Z') {
buf->st_dev = buf->st_rdev = path[0] - 'A';
} else {
buf->st_dev = buf->st_rdev = path[0] - 'a';
}
} else {
char cur_path[MAXPATHLEN+1];
DWORD len = sizeof(cur_path);
char *tmp = cur_path;
while(1) {
DWORD r = GetCurrentDirectory(len, tmp);
if (r < len) {
if (tmp[1] == ':') {
if (path[0] >= 'A' && path[0] <= 'Z') {
buf->st_dev = buf->st_rdev = path[0] - 'A';
} else {
buf->st_dev = buf->st_rdev = path[0] - 'a';
}
} else {
buf->st_dev = buf->st_rdev = -1;
}
break;
} else if (!r) {
buf->st_dev = buf->st_rdev = -1;
break;
} else {
len = r+1;
tmp = (char*)malloc(len);
}
}
if (tmp != cur_path) {
free(tmp);
}
}
buf->st_uid = buf->st_gid = buf->st_ino = 0;
buf->st_mode = (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG;
buf->st_mode |= (data.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE>>6));
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
int len = strlen(path);
if (path[len-4] == '.') {
if (_memicmp(path+len-3, "exe", 3) == 0 ||
_memicmp(path+len-3, "com", 3) == 0 ||
_memicmp(path+len-3, "bat", 3) == 0 ||
_memicmp(path+len-3, "cmd", 3) == 0) {
buf->st_mode |= (S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6));
}
}
}
buf->st_nlink = 1;
t = data.nFileSizeHigh;
t = t << 32;
t |= data.nFileSizeLow;
buf->st_size = t;
t = data.ftLastAccessTime.dwHighDateTime;
t = t << 32;
t |= data.ftLastAccessTime.dwLowDateTime;
buf->st_atime = (unsigned long)((t / 10000000) - 11644473600);
t = data.ftCreationTime.dwHighDateTime;
t = t << 32;
t |= data.ftCreationTime.dwLowDateTime;
buf->st_ctime = (unsigned long)((t / 10000000) - 11644473600);
t = data.ftLastWriteTime.dwHighDateTime;
t = t << 32;
t |= data.ftLastWriteTime.dwLowDateTime;
buf->st_mtime = (unsigned long)((t / 10000000) - 11644473600);
return 0;
}
#endif
static int php_is_dir_ok(const cwd_state *state)
{
struct stat buf;
if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
if (php_sys_stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
return (0);
return (1);
@@ -154,7 +231,7 @@ static int php_is_file_ok(const cwd_state *state)
{
struct stat buf;
if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
if (php_sys_stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
return (0);
return (1);
@@ -172,18 +249,7 @@ static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC)
static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC)
{
CWD_STATE_FREE(&cwd_globals->cwd);
{
int i;
for (i = 0; i < sizeof(cwd_globals->realpath_cache)/sizeof(cwd_globals->realpath_cache[0]); i++) {
realpath_cache_bucket *p = cwd_globals->realpath_cache[i];
while (p != NULL) {
realpath_cache_bucket *r = p;
p = p->next;
free(r);
}
}
}
realpath_cache_clean(TSRMLS_C);
}
static char *tsrm_strndup(const char *s, size_t length)
@@ -306,14 +372,51 @@ CWD_API char *virtual_getcwd(char *buf, size_t size TSRMLS_DC)
static inline unsigned long realpath_cache_key(const char *path, int path_len)
{
register unsigned long h;
register unsigned long h;
const char *e = path + path_len;
const char *e = path + path_len;
for (h = 2166136261U; path < e; ) {
h *= 16777619;
h ^= *path++;
}
return h;
for (h = 2166136261U; path < e;) {
h *= 16777619;
h ^= *path++;
}
return h;
}
CWD_API void realpath_cache_clean(TSRMLS_D)
{
int i;
for (i = 0; i < sizeof(CWDG(realpath_cache))/sizeof(CWDG(realpath_cache)[0]); i++) {
realpath_cache_bucket *p = CWDG(realpath_cache)[i];
while (p != NULL) {
realpath_cache_bucket *r = p;
p = p->next;
free(r);
}
CWDG(realpath_cache)[i] = NULL;
}
CWDG(realpath_cache_size) = 0;
}
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC)
{
unsigned long key = realpath_cache_key(path, path_len);
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
realpath_cache_bucket **bucket = &CWDG(realpath_cache)[n];
while (*bucket != NULL) {
if (key == (*bucket)->key && path_len == (*bucket)->path_len &&
memcmp(path, (*bucket)->path, path_len) == 0) {
realpath_cache_bucket *r = *bucket;
*bucket = (*bucket)->next;
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
free(r);
return;
} else {
bucket = &(*bucket)->next;
}
}
}
static inline void realpath_cache_add(const char *path, int path_len, const char *realpath, int realpath_len, time_t t TSRMLS_DC)
@@ -334,7 +437,7 @@ static inline void realpath_cache_add(const char *path, int path_len, const char
n = bucket->key % (sizeof(CWDG(realpath_cache)) / sizeof(CWDG(realpath_cache)[0]));
bucket->next = CWDG(realpath_cache)[n];
CWDG(realpath_cache)[n] = bucket;
CWDG(realpath_cache_size) += size;
CWDG(realpath_cache_size) += size;
}
}
@@ -405,7 +508,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
path_length = orig_path_len;
}
if (use_realpath && CWDG(realpath_cache_size_limit)) {
if (use_realpath != CWD_EXPAND && CWDG(realpath_cache_size_limit)) {
t = CWDG(realpath_cache_ttl)?time(NULL):0;
if ((bucket = realpath_cache_find(path, path_length, t TSRMLS_CC)) != NULL) {
int len = bucket->realpath_len;
@@ -425,11 +528,14 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
}
}
if (use_realpath) {
if (use_realpath != CWD_EXPAND) {
#if !defined(TSRM_WIN32) && !defined(NETWARE)
char resolved_path[MAXPATHLEN];
if (!realpath(path, resolved_path)) { /* Note: Not threadsafe on older *BSD's */
if (use_realpath == CWD_REALPATH) {
return 1;
}
goto no_realpath;
}
CWD_STATE_COPY(&old_state, state);
@@ -444,6 +550,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
char *ptr, *path_copy, *free_path;
char *tok = NULL;
int ptr_length;
#ifdef TSRM_WIN32
int is_unc = 0;
#endif
no_realpath:
@@ -464,6 +573,7 @@ no_realpath:
state->cwd[1] = '\0';
state->cwd_length = 1;
path_copy += 2;
is_unc = 2;
} else {
#endif
state->cwd = (char *) realloc(state->cwd, 1);
@@ -529,7 +639,7 @@ no_realpath:
memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1);
#ifdef TSRM_WIN32
if (use_realpath) {
if (use_realpath != CWD_EXPAND) {
WIN32_FIND_DATA data;
HANDLE hFind;
@@ -542,6 +652,15 @@ no_realpath:
memcpy(&state->cwd[state->cwd_length], data.cFileName, length+1);
ptr_length = length;
FindClose(hFind);
} else if (use_realpath == CWD_REALPATH) {
if (is_unc) {
is_unc--;
} else {
free(free_path);
CWD_STATE_FREE(state);
*state = old_state;
return 1;
}
}
}
#endif
@@ -561,7 +680,7 @@ no_realpath:
}
}
if (use_realpath && CWDG(realpath_cache_size_limit)) {
if (use_realpath != CWD_EXPAND && CWDG(realpath_cache_size_limit)) {
realpath_cache_add(path, path_length, state->cwd, state->cwd_length, t TSRMLS_CC);
}
@@ -582,7 +701,7 @@ no_realpath:
CWD_API int virtual_chdir(const char *path TSRMLS_DC)
{
return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, 1)?-1:0;
return virtual_file_ex(&CWDG(cwd), path, php_is_dir_ok, CWD_REALPATH)?-1:0;
}
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path TSRMLS_DC) TSRMLS_DC)
@@ -624,7 +743,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path TSRMLS_DC)
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, path, NULL, 1)==0) {
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
memcpy(real_path, new_state.cwd, len);
@@ -645,7 +764,7 @@ CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_f
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
retval = virtual_file_ex(&new_state, path, verify_path, 1);
retval = virtual_file_ex(&new_state, path, verify_path, CWD_FILEPATH);
*filepath = new_state.cwd;
@@ -668,7 +787,8 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC)
}
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, path, NULL, 1)) {
if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
CWD_STATE_FREE(&new_state);
return NULL;
}
@@ -684,7 +804,8 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC)
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, pathname, NULL, 1)) {
if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -707,7 +828,8 @@ CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC)
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, filename, NULL, 0)) {
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -724,7 +846,8 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC)
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, filename, NULL, 1)) {
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -741,7 +864,8 @@ CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int li
int ret;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, filename, NULL, 0)) {
if (virtual_file_ex(&new_state, filename, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -766,7 +890,8 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...)
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, path, NULL, 1)) {
if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -792,7 +917,8 @@ CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC)
int f;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, path, NULL, 1)) {
if (virtual_file_ex(&new_state, path, NULL, CWD_FILEPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -809,13 +935,16 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC)
int retval;
CWD_STATE_COPY(&old_state, &CWDG(cwd));
if (virtual_file_ex(&old_state, oldname, NULL, 0)) {
if (virtual_file_ex(&old_state, oldname, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&old_state);
return -1;
}
oldname = old_state.cwd;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, newname, NULL, 0)) {
if (virtual_file_ex(&new_state, newname, NULL, CWD_FILEPATH)) {
CWD_STATE_FREE(&old_state);
CWD_STATE_FREE(&new_state);
return -1;
}
newname = new_state.cwd;
@@ -834,11 +963,12 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, path, NULL, 1)) {
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
retval = stat(new_state.cwd, buf);
retval = php_sys_stat(new_state.cwd, buf);
CWD_STATE_FREE(&new_state);
return retval;
@@ -851,7 +981,8 @@ CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, path, NULL, 0)) {
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -868,7 +999,8 @@ CWD_API int virtual_unlink(const char *path TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, path, NULL, 0)) {
if (virtual_file_ex(&new_state, path, NULL, CWD_EXPAND)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -884,7 +1016,8 @@ CWD_API int virtual_mkdir(const char *pathname, mode_t mode TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, pathname, NULL, 1)) {
if (virtual_file_ex(&new_state, pathname, NULL, CWD_FILEPATH)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -903,7 +1036,8 @@ CWD_API int virtual_rmdir(const char *pathname TSRMLS_DC)
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, pathname, NULL, 0)) {
if (virtual_file_ex(&new_state, pathname, NULL, CWD_EXPAND)) {
CWD_STATE_FREE(&new_state);
return -1;
}
@@ -923,7 +1057,8 @@ CWD_API DIR *virtual_opendir(const char *pathname TSRMLS_DC)
DIR *retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
if (virtual_file_ex(&new_state, pathname, NULL, 1)) {
if (virtual_file_ex(&new_state, pathname, NULL, CWD_REALPATH)) {
CWD_STATE_FREE(&new_state);
return NULL;
}
@@ -1033,25 +1168,36 @@ CWD_API FILE *virtual_popen(const char *command, const char *type TSRMLS_DC)
#endif
/* On AIX & Tru64 when a file does not exist realpath() returns
* NULL, and sets errno to ENOENT. Unlike in other libc implementations
* the destination is not filled and remains undefined. Therefor, we
* must populate it manually using strcpy as done on systems with no
* realpath() function.
*/
#if defined(__osf__) || defined(_AIX)
char *php_realpath_hack(const char *src, char *dest)
CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC)
{
char *ret;
cwd_state new_state;
char cwd[MAXPATHLEN];
if ((ret = realpath(src, dest)) == NULL && errno == ENOENT) {
return strcpy(dest, src);
if (!IS_ABSOLUTE_PATH(path, strlen(path)) &&
VCWD_GETCWD(cwd, MAXPATHLEN)) {
new_state.cwd = strdup(cwd);
new_state.cwd_length = strlen(cwd);
} else {
return ret;
new_state.cwd = (char*)malloc(1);
new_state.cwd[0] = '\0';
new_state.cwd_length = 0;
}
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
free(new_state.cwd);
return NULL;
}
if (real_path) {
int copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length;
memcpy(real_path, new_state.cwd, copy_len);
real_path[copy_len] = '\0';
free(new_state.cwd);
return real_path;
} else {
return new_state.cwd;
}
}
#endif
/*
+21 -15
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -126,6 +126,12 @@ typedef unsigned short mode_t;
#define CWD_API
#endif
#ifdef TSRM_WIN32
CWD_API int php_sys_stat(const char *path, struct stat *buf);
#else
# define php_sys_stat stat
#endif
typedef struct _cwd_state {
char *cwd;
int cwd_length;
@@ -172,10 +178,6 @@ CWD_API int virtual_access(const char *pathname, int mode TSRMLS_DC);
#endif
#endif
#if defined(__osf__) || defined(_AIX)
char *php_realpath_hack(const char *src, char *dest);
#endif
#if HAVE_UTIME
CWD_API int virtual_utime(const char *filename, struct utimbuf *buf TSRMLS_DC);
#endif
@@ -184,8 +186,17 @@ CWD_API int virtual_chmod(const char *filename, mode_t mode TSRMLS_DC);
CWD_API int virtual_chown(const char *filename, uid_t owner, gid_t group, int link TSRMLS_DC);
#endif
/* One of the following constants must be used as the last argument
in virtual_file_ex() call. */
#define CWD_EXPAND 0 /* expand "." and ".." but dont resolve symlinks */
#define CWD_FILEPATH 1 /* resolve symlinks if file is exist otherwise expand */
#define CWD_REALPATH 2 /* call realpath(), resolve symlinks. File must exist */
CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath);
CWD_API char *tsrm_realpath(const char *path, char *real_path TSRMLS_DC);
#define REALPATH_CACHE_TTL (2*60) /* 2 minutes */
#define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */
@@ -215,6 +226,9 @@ extern virtual_cwd_globals cwd_globals;
# define CWDG(v) (cwd_globals.v)
#endif
CWD_API void realpath_cache_clean(TSRMLS_D);
CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC);
/* The actual macros to be used in programs using TSRM
* If the program defines VIRTUAL_DIR it will use the
* virtual_* functions
@@ -265,7 +279,7 @@ extern virtual_cwd_globals cwd_globals;
#define VCWD_CHDIR(path) chdir(path)
#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
#define VCWD_GETWD(buf) getwd(buf)
#define VCWD_STAT(path, buff) stat(path, buff)
#define VCWD_STAT(path, buff) php_sys_stat(path, buff)
#define VCWD_LSTAT(path, buff) lstat(path, buff)
#define VCWD_UNLINK(path) unlink(path)
#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode)
@@ -278,15 +292,7 @@ extern virtual_cwd_globals cwd_globals;
#define VCWD_ACCESS(pathname, mode) access(pathname, mode)
#endif
#ifdef HAVE_REALPATH
#if defined(__osf__) || defined(_AIX)
#define VCWD_REALPATH(path, real_path) php_realpath_hack(path, real_path)
#else
#define VCWD_REALPATH(path, real_path) realpath(path, real_path)
#endif
#else
#define VCWD_REALPATH(path, real_path) strcpy(real_path, path)
#endif
#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC)
#if HAVE_UTIME
#define VCWD_UTIME(path, time) utime(path, time)
+11 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -86,11 +86,19 @@ TSRM_API void tsrm_win32_shutdown(void)
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
{
SHFILEINFO sfi;
if (mode == 1 /*X_OK*/) {
#if 1
/* This code is not supported by Windows 98,
* but we don't support it anymore */
DWORD type;
return GetBinaryType(pathname, &type)?0:-1;
#else
SHFILEINFO sfi;
return access(pathname, 0) == 0 &&
SHGetFileInfo(pathname, 0, &sfi, sizeof(SHFILEINFO), SHGFI_EXETYPE) != 0 ? 0 : -1;
#endif
} else {
return access(pathname, mode);
}
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2006 The PHP Group |
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -14,7 +14,7 @@ libZend_la_SOURCES=\
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \
zend_objects_API.c zend_ts_hash.c zend_stream.c zend_mm.c \
zend_objects_API.c zend_ts_hash.c zend_stream.c \
zend_default_classes.c \
zend_iterators.c zend_interfaces.c zend_exceptions.c \
zend_strtod.c zend_multibyte.c
-8
View File
@@ -195,10 +195,6 @@ SOURCE=.\zend_llist.c
# End Source File
# Begin Source File
SOURCE=.\zend_mm.c
# End Source File
# Begin Source File
SOURCE=.\zend_object_handlers.c
# End Source File
# Begin Source File
@@ -371,10 +367,6 @@ SOURCE=.\zend_llist.h
# End Source File
# Begin Source File
SOURCE=.\zend_mm.h
# End Source File
# Begin Source File
SOURCE=.\zend_modules.h
# End Source File
# Begin Source File
+7 -23
View File
@@ -129,13 +129,6 @@ AC_ARG_WITH(zend-vm,
PHP_ZEND_VM=CALL
])
AC_ARG_ENABLE(malloc-mm,
[ --enable-malloc-mm Use environment variable for run-time malloc/emalloc
selection - FOR DEVELOPERS ONLY!!],
[
ZEND_USE_MALLOC_MM=$enableval
])
AC_ARG_ENABLE(maintainer-zts,
[ --enable-maintainer-zts Enable thread safety - for code maintainers only!!],[
ZEND_MAINTAINER_ZTS=$enableval
@@ -151,13 +144,6 @@ AC_ARG_ENABLE(inline-optimization,
ZEND_INLINE_OPTIMIZATION=yes
])
AC_ARG_ENABLE(memory-limit,
[ --enable-memory-limit Compile with memory limit support], [
ZEND_MEMORY_LIMIT=$enableval
],[
ZEND_MEMORY_LIMIT=no
])
AC_ARG_ENABLE(zend-multibyte,
[ --enable-zend-multibyte Compile with zend multibyte support], [
ZEND_MULTIBYTE=$enableval
@@ -174,9 +160,6 @@ AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
AC_MSG_CHECKING(whether to enable inline optimization for GCC)
AC_MSG_RESULT($ZEND_INLINE_OPTIMIZATION)
AC_MSG_CHECKING(whether to enable a memory limit)
AC_MSG_RESULT($ZEND_MEMORY_LIMIT)
AC_MSG_CHECKING(whether to enable Zend debugging)
AC_MSG_RESULT($ZEND_DEBUG)
@@ -217,12 +200,6 @@ if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
LIBZEND_CPLUSPLUS_CHECKS
fi
if test "$ZEND_MEMORY_LIMIT" = "yes"; then
AC_DEFINE(MEMORY_LIMIT, 1, [Memory limit])
else
AC_DEFINE(MEMORY_LIMIT, 0, [Memory limit])
fi
if test "$ZEND_MULTIBYTE" = "yes"; then
AC_DEFINE(ZEND_MULTIBYTE, 1, [ ])
fi
@@ -404,3 +381,10 @@ AC_DEFUN([LIBZEND_CPLUSPLUS_CHECKS],[
])
AC_MSG_CHECKING(whether /dev/urandom exists)
if test -r "/dev/urandom" && test -c "/dev/urandom"; then
AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define if the target system has /dev/urandom device])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
-8
View File
@@ -229,10 +229,6 @@ SOURCE=.\zend_llist.c
# End Source File
# Begin Source File
SOURCE=.\zend_mm.c
# End Source File
# Begin Source File
SOURCE=.\zend_object_handlers.c
# End Source File
# Begin Source File
@@ -409,10 +405,6 @@ SOURCE=.\zend_llist.h
# End Source File
# Begin Source File
SOURCE=.\zend_mm.h
# End Source File
# Begin Source File
SOURCE=.\zend_modules.h
# End Source File
# Begin Source File
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1
View File
@@ -1,4 +1,5 @@
<?php
date_default_timezone_set("UTC");
function simple() {
$a = 0;
+82
View File
@@ -0,0 +1,82 @@
--TEST--
builtin functions tests
--FILE--
<?php
var_dump(get_resource_type());
var_dump(get_resource_type(""));
$fp = fopen(__FILE__, "r");
var_dump(get_resource_type($fp));
fclose($fp);
var_dump(get_resource_type($fp));
var_dump(get_loaded_extensions(true));
var_dump(gettype(get_loaded_extensions()));
var_dump(count(get_loaded_extensions()));
define("USER_CONSTANT", "test");
var_dump(get_defined_constants(true, true));
var_dump(gettype(get_defined_constants(true)));
var_dump(gettype(get_defined_constants()));
var_dump(count(get_defined_constants()));
function test () {
}
var_dump(get_defined_functions(true));
var_dump(gettype(get_defined_functions()));
var_dump(count(get_defined_functions()));
var_dump(get_declared_interfaces(true));
var_dump(gettype(get_declared_interfaces()));
var_dump(count(get_declared_interfaces()));
var_dump(get_extension_funcs());
var_dump(get_extension_funcs(true));
var_dump(gettype(get_extension_funcs("standard")));
var_dump(count(get_extension_funcs("standard")));
var_dump(gettype(get_extension_funcs("zend")));
var_dump(count(get_extension_funcs("zend")));
echo "Done\n";
?>
--EXPECTF--
Warning: Wrong parameter count for get_resource_type() in %s on line %d
NULL
Warning: Supplied argument is not a valid resource handle in %s on line %d
bool(false)
string(6) "stream"
string(7) "Unknown"
Warning: Wrong parameter count for get_loaded_extensions() in %s on line %d
NULL
string(5) "array"
int(%d)
Warning: Wrong parameter count for get_defined_constants() in %s on line %d
NULL
string(5) "array"
string(5) "array"
int(%d)
Warning: Wrong parameter count for get_defined_functions() in %s on line %d
NULL
string(5) "array"
int(%d)
Warning: Wrong parameter count for get_declared_interfaces() in %s on line %d
NULL
string(5) "array"
int(%d)
Warning: Wrong parameter count for get_extension_funcs() in %s on line %d
NULL
bool(false)
string(5) "array"
int(%d)
string(5) "array"
int(%d)
Done
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #33282 (Re-assignment by reference does not clear the is_ref flag)
--FILE--
<?php
$a = array(1, 2, 3);
$r = &$a[0];
$r = &$a[1];
$r = &$a[2];
var_dump($a);
?>
--EXPECT--
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
&int(3)
}
+2 -2
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #34617 (zend_deactivate: objects_store used after zend_objects_store_destroy is called)
--SKIPIF--
<?php if (!extension_loaded("xml")) print "skip"; ?>
<?php if (!extension_loaded("xml")) print "skip the xml extension not available"; ?>
--FILE--
<?php
class Thing {}
@@ -15,4 +15,4 @@ function boom()
boom();
?>
--EXPECT--
ok
ok
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #35106 (nested foreach fails when array variable has a reference)
--FILE--
<?php
$a=array("1","2");
$b=&$a;
foreach($a as $i){
echo $i;
foreach($a as $p);
}
echo "\n";
?>
--EXPECT--
12
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #35634 (Erroneous "Class declarations may not be nested" error raised)
--INI--
error_reporting=0
--FILE--
<?php
if (defined("pass3")) {
class ErrorClass {
}
} else if (defined("pass2")) {
class TestClass {
function __construct() {
}
function TestClass() {
$this->__construct();
}
}
} else {
function errorHandler($errorNumber, $errorMessage, $fileName, $lineNumber) {
define("pass3", 1);
include(__FILE__);
die("Error: $errorMessage ($fileName:$lineNumber)\n");
}
set_error_handler('errorHandler');
define("pass2", 1);
include(__FILE__);
}
?>
--EXPECTF--
Error: Redefining already defined constructor for class TestClass (%sbug35634.php:12)
+54
View File
@@ -0,0 +1,54 @@
--TEST--
Bug #36214 (__get method works properly only when conditional operator is used)
--SKIPIF--
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
--FILE--
<?php
class context {
public $stack = array();
public function __set($name,$var) {
$this->stack[$name] = $var;return;
}
public function &__get($name) {
return $this->stack[$name];
}
}
$ctx = new context;
$ctx->comment_preview = array();
$ctx->comment_preview[0] = 1;
$ctx->comment_preview[1] = 2;
var_dump($ctx->comment_preview);
$comment_preview = array();
$comment_preview[0] = 1;
$comment_preview[1] = 2;
$ctx->comment_preview = $comment_preview;
var_dump($ctx->comment_preview);
$ctx->comment_preview = new ArrayObject();
$ctx->comment_preview[0] = 1;
$ctx->comment_preview[1] = 2;
var_dump($ctx->comment_preview);
?>
--EXPECT--
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
array(2) {
[0]=>
int(1)
[1]=>
int(2)
}
object(ArrayObject)#2 (2) {
[0]=>
int(1)
[1]=>
int(2)
}
+45
View File
@@ -0,0 +1,45 @@
--TEST--
Bug #39297 (Memory corryption because of indirect modification of overloaded array)
--FILE--
<?php
function compareByRef(&$first, &$second) {
return $first === $second;
}
class MyTree implements ArrayAccess {
public $parent;
public $children = array();
public function offsetExists($offset) {
}
public function offsetUnset($offset) {
}
public function offsetSet($offset, $value) {
echo "offsetSet()\n";
$cannonicalName = strtolower($offset);
$this->children[$cannonicalName] = $value;
$value->parent = $this;
}
public function offsetGet($offset) {
echo "offsetGet()\n";
$cannonicalName = strtolower($offset);
return $this->children[$cannonicalName];
}
}
$id = 'Test';
$root = new MyTree();
$child = new MyTree();
$root[$id] = $child;
var_dump(compareByRef($root[$id], $child));
?>
--EXPECT--
offsetSet()
offsetGet()
bool(true)
+45
View File
@@ -0,0 +1,45 @@
--TEST--
Bug #39438 (Fatal error: Out of memory)
--INI--
memory_limit=16M
--FILE--
<?php
$i=0;
$test2=array(
'a1_teasermenu' => array(
'downloadcounter' => 2777,
'versions' => array(
'0.1.0' => array (
'title' => 'A1 Teasermenu',
'description' => 'Displays a teaser for advanced subpages or a selection of advanced pages',
'state' => 'stable',
'reviewstate' => 0,
'category' => 'plugin',
'downloadcounter' => 2787,
'lastuploaddate' => 1088427240,
'dependencies' => array (
'depends' => array(
'typo3' =>'',
'php' =>'',
'cms' => ''
),
'conflicts' => array('' =>'')
),
'authorname' => 'Mirko Balluff',
'authoremail' => 'balluff@amt1.de',
'ownerusername' => 'amt1',
't3xfilemd5' => '3a4ec198b6ea8d0bc2d69d9b7400398f',
)
)
)
);
$test=array();
while($i<1200) {
$test[]=$test2;
$i++;
}
$out=serialize($test);
echo "ok\n";
?>
--EXPECT--
ok
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #39445 (Calling debug_backtrace() in the __toString() function produces a crash)
--FILE--
<?php
class test {
public function __toString() {
debug_backtrace();
return 'lowercase';
}
}
$test = new test();
echo strtoupper($test);
?>
--EXPECT--
LOWERCASE
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Bug #39449 (Overloaded array properties do not work correctly)
--FILE--
<?php
class A {
private $keys = array();
public function & __get($val) {
return $this->keys[$val];
}
public function __set($k, $v) {
$this->keys[$k] = $v;
}
}
$a =new A();
$a->arr = array('a','b','c');
$b = &$a->arr;
$b[]= 'd';
foreach ($a->arr as $k => $v) {
echo "$k => $v\n";
}
$a->arr[]='d';
foreach ($a->arr as $k => $v) {
echo "$k => $v\n";
}
?>
--EXPECT--
0 => a
1 => b
2 => c
3 => d
0 => a
1 => b
2 => c
3 => d
4 => d
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #39602 (Invalid session.save_handler crashes PHP)
--SKIPIF--
<?php if (!extension_loaded("session")) die("skip"); ?>
--INI--
session.save_handler=qwerty
--FILE--
<?php
ini_set("session.save_handler","files");
$x = new stdClass();
echo "ok";
?>
--EXPECT--
ok
Fatal error: Unknown: Cannot find save handler qwerty in Unknown on line 0
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #39721 (Runtime inheritance causes data corruption)
--FILE--
<?php
class test2 {
private static $instances = 0;
public $instance;
public function __construct() {
$this->instance = ++self::$instances;
}
}
$foo = new test2();
if (is_object($foo)) {
class test2_child extends test2 {
}
}
$child = new test2_child();
echo $foo->instance . "\n";
echo $child->instance . "\n";
?>
--EXPECT--
1
2
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #39775 ("Indirect modification ..." message is not shown)
--FILE--
<?php
class test {
var $array = array();
function __get($var) {
$v =& $this->array;
return $this->array;
}
}
$t = new test;
$t->anything[] = 'bar';
print_r($t->anything);
?>
--EXPECTF--
Notice: Indirect modification of overloaded property test::$anything has no effect in %sbug39775.php on line 10
Array
(
)
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #39825 (foreach produces memory error)
--FILE--
<?php
$array = array(1 => 2, "foo" => "bar");
$obj = (object)$array;
foreach ($obj as $name => $value) {
echo "$name -> $value\n";
}
?>
--EXPECT--
1 -> 2
foo -> bar
+88
View File
@@ -0,0 +1,88 @@
--TEST--
Bug #39944 (References broken)
--FILE--
<?php
$intTheValue = 0;
function &getValue() {
global $intTheValue;
return $intTheValue;
}
function setValue(&$int, $iNewValue) {
$int = $iNewValue;
}
setValue(getValue(), 10);
echo "intTheValue = {$intTheValue}\n";
$b = &$intTheValue;
setValue(getValue(), 10);
echo "intTheValue = {$intTheValue}\n";
/****/
$arrTheArray = array();
function &getArray() {
global $arrTheArray;
return $arrTheArray;
}
function addToArray(&$arr, $strToAdd) {
$arr[] = $strToAdd;
}
addToArray(getArray(), "xx1");
$a = getArray();
addToArray($a, "xx2");
$b = &$arrTheArray;
addToArray($b, "xx3");
addToArray(getArray(), "xx4");
$a = getArray();
addToArray($a, "xx5");
echo "arrTheArray = " . print_r($arrTheArray, 1);
/****/
class RefTest {
protected $arr;
function Add($strToAdd) {
$this->addToArray($this->getArray(), $strToAdd);
}
function &getArray() {
if (!$this->arr)
$this->arr = array();
return $this->arr;
}
private function addToArray(&$arr, $strToAdd) {
$arr[] = $strToAdd;
}
}
$objRefTest = new RefTest();
$objRefTest->Add("xx1");
$objRefTest->Add("xx2");
$objRefTest->Add("xx3");
echo "objRefTest->getArray() = " . print_r($objRefTest->getArray(), 1);
?>
--EXPECT--
intTheValue = 10
intTheValue = 10
arrTheArray = Array
(
[0] => xx1
[1] => xx3
[2] => xx4
)
objRefTest->getArray() = Array
(
[0] => xx1
[1] => xx2
[2] => xx3
)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #39990 (Cannot "foreach" over overloaded properties)
--FILE--
<?php
class Foo {
public function __get($name) {
return array('Hello', 'World');
}
}
$obj=new Foo();
foreach($obj->arr as $value)
echo "$value\n";
?>
--EXPECT--
Hello
World
+1 -2
View File
@@ -11,6 +11,5 @@ echo "ok\n";
?>
--EXPECTF--
ok
Notice: Undefined variable: b in %sunset_cv08.php on line %d
ok
ok
+51 -22
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -101,7 +101,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */
/* version information */
static char *zend_version_info;
static uint zend_version_info_length;
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2006 Zend Technologies\n"
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2007 Zend Technologies\n"
#define PRINT_ZVAL_INDENT 4
@@ -131,9 +131,9 @@ static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent,
if (is_object) {
char *prop_name, *class_name;
zend_unmangle_property_name(string_key, str_len-1, &class_name, &prop_name);
int mangled = zend_unmangle_property_name(string_key, str_len-1, &class_name, &prop_name);
ZEND_PUTS_EX(prop_name);
if (class_name) {
if (class_name && mangled == SUCCESS) {
if (class_name[0]=='*') {
ZEND_PUTS_EX(":protected");
} else {
@@ -214,7 +214,7 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
}
break;
case IS_RESOURCE:
expr_copy->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG);
expr_copy->value.str.val = (char *) emalloc(sizeof("Resource id #") + MAX_LENGTH_OF_LONG);
expr_copy->value.str.len = sprintf(expr_copy->value.str.val, "Resource id #%ld", expr->value.lval);
break;
case IS_ARRAY:
@@ -426,13 +426,25 @@ static void register_standard_class(TSRMLS_D)
zend_hash_add(CG(class_table), "stdclass", sizeof("stdclass"), &zend_standard_class_def, sizeof(zend_class_entry *), NULL);
}
#ifdef ZTS
static zend_bool asp_tags_default = 0;
static zend_bool short_tags_default = 1;
static zend_bool ct_pass_ref_default = 1;
static zend_bool extended_info_default = 0;
#else
# define asp_tags_default 0
# define short_tags_default 1
# define ct_pass_ref_default 1
# define extended_info_default 0
#endif
static void zend_set_default_compile_time_values(TSRMLS_D)
{
/* default compile-time values */
CG(asp_tags) = 0;
CG(short_tags) = 1;
CG(allow_call_time_pass_reference) = 1;
CG(extended_info) = 0;
CG(asp_tags) = asp_tags_default;
CG(short_tags) = short_tags_default;
CG(allow_call_time_pass_reference) = ct_pass_ref_default;
CG(extended_info) = extended_info_default;
}
@@ -522,8 +534,9 @@ static void executor_globals_dtor(zend_executor_globals *executor_globals TSRMLS
static void zend_new_thread_end_handler(THREAD_T thread_id TSRMLS_DC)
{
zend_copy_ini_directives(TSRMLS_C);
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
if (zend_copy_ini_directives(TSRMLS_C) == SUCCESS) {
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
}
}
#endif
@@ -570,6 +583,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
fpsetmask(0);
#endif
zend_startup_strtod();
zend_startup_extensions_mechanism();
/* Set up utility functions and values */
@@ -693,6 +707,12 @@ void zend_post_startup(TSRMLS_D)
*GLOBAL_FUNCTION_TABLE = *compiler_globals->function_table;
*GLOBAL_CLASS_TABLE = *compiler_globals->class_table;
*GLOBAL_CONSTANTS_TABLE = *executor_globals->zend_constants;
asp_tags_default = CG(asp_tags);
short_tags_default = CG(short_tags);
ct_pass_ref_default = CG(allow_call_time_pass_reference);
extended_info_default = CG(extended_info);
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
free(compiler_globals->function_table);
free(compiler_globals->class_table);
@@ -700,7 +720,7 @@ void zend_post_startup(TSRMLS_D)
free(EG(zend_constants));
executor_globals_ctor(executor_globals, tsrm_ls);
global_persistent_list = &EG(persistent_list);
zend_new_thread_end_handler(tsrm_thread_id() TSRMLS_CC);
zend_copy_ini_directives(TSRMLS_C);
}
#endif
@@ -728,6 +748,7 @@ void zend_shutdown(TSRMLS_D)
zend_hash_destroy(GLOBAL_CONSTANTS_TABLE);
free(GLOBAL_CONSTANTS_TABLE);
zend_shutdown_strtod();
#ifdef ZTS
GLOBAL_FUNCTION_TABLE = NULL;
GLOBAL_CLASS_TABLE = NULL;
@@ -897,6 +918,8 @@ ZEND_API void zend_error(int type, const char *format, ...)
char *error_filename;
uint error_lineno;
zval *orig_user_error_handler;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
TSRMLS_FETCH();
/* Obtain relevant filename and lineno */
@@ -1004,7 +1027,18 @@ ZEND_API void zend_error(int type, const char *format, ...)
orig_user_error_handler = EG(user_error_handler);
EG(user_error_handler) = NULL;
/* User error handler may include() additinal PHP files.
* If an error was generated during comilation PHP will compile
* such scripts recursivly, but some CG() variables may be
* inconsistent. */
in_compilation = zend_is_compiling(TSRMLS_C);
if (in_compilation) {
saved_class_entry = CG(active_class_entry);
CG(active_class_entry) = NULL;
}
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC)==SUCCESS) {
if (retval) {
if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) {
@@ -1017,6 +1051,10 @@ ZEND_API void zend_error(int type, const char *format, ...)
zend_error_cb(type, error_filename, error_lineno, format, args);
}
if (in_compilation) {
CG(active_class_entry) = saved_class_entry;
}
if (!EG(user_error_handler)) {
EG(user_error_handler) = orig_user_error_handler;
}
@@ -1096,15 +1134,6 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
EG(return_value_ptr_ptr) = retval ? retval : &local_retval;
zend_execute(EG(active_op_array) TSRMLS_CC);
if (EG(exception)) {
char ex_class_name[128];
EG(opline_ptr) = NULL;
if (Z_TYPE_P(EG(exception)) == IS_OBJECT) {
strncpy(ex_class_name, Z_OBJ_CLASS_NAME_P(EG(exception)), 127);
ex_class_name[127] = '\0';
} else {
strcpy(ex_class_name, "Unknown Exception");
}
if (EG(user_exception_handler)) {
zval *orig_user_exception_handler;
zval ***params, *retval2, *old_exception;
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+7 -8
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -2095,18 +2095,17 @@ static zend_function_entry disabled_class_new[] = {
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC)
{
zend_class_entry *disabled_class;
disabled_class = (zend_class_entry *) emalloc(sizeof(zend_class_entry));
zend_class_entry disabled_class;
zend_str_tolower(class_name, class_name_length);
if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
return FAILURE;
}
INIT_CLASS_ENTRY((*disabled_class), class_name, disabled_class_new);
disabled_class->create_object = display_disabled_class;
disabled_class->name_length = class_name_length;
zend_register_internal_class(disabled_class TSRMLS_CC);
return 1;
INIT_CLASS_ENTRY(disabled_class, class_name, disabled_class_new);
disabled_class.create_object = display_disabled_class;
disabled_class.name_length = class_name_length;
zend_register_internal_class(&disabled_class TSRMLS_CC);
return SUCCESS;
}
static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, zend_class_entry *ce_org, zval *callable, zend_class_entry **ce_ptr, zend_function **fptr_ptr TSRMLS_DC)
+4 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -48,6 +48,9 @@ typedef struct _zend_function_entry {
#define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags) { zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },
#define ZEND_RAW_NAMED_FE(zend_name, name, arg_info) ZEND_RAW_FENTRY(#zend_name, name, arg_info, 0)
#define ZEND_NAMED_FE(zend_name, name, arg_info) ZEND_FENTRY(zend_name, name, arg_info, 0)
#define ZEND_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, 0)
#define ZEND_DEP_FE(name, arg_info) ZEND_FENTRY(name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
+434 -232
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+21 -14
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -201,7 +201,7 @@ ZEND_FUNCTION(func_get_arg)
RETURN_FALSE;
}
convert_to_long_ex(z_requested_offset);
requested_offset = (*z_requested_offset)->value.lval;
requested_offset = Z_LVAL_PP(z_requested_offset);
if (requested_offset < 0) {
zend_error(E_WARNING, "func_get_arg(): The argument number should be >= 0");
@@ -281,7 +281,7 @@ ZEND_NAMED_FUNCTION(zend_if_strlen)
ZEND_WRONG_PARAM_COUNT();
}
convert_to_string_ex(str);
RETVAL_LONG((*str)->value.str.len);
RETVAL_LONG(Z_STRLEN_PP(str));
}
/* }}} */
@@ -517,8 +517,8 @@ repeat:
zval_ptr_dtor(&val_free);
}
c.flags = case_sensitive; /* non persistent */
c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
c.name_len = (*var)->value.str.len+1;
c.name = zend_strndup(Z_STRVAL_PP(var), Z_STRLEN_PP(var));
c.name_len = Z_STRLEN_PP(var)+1;
c.module_number = PHP_USER_CONSTANT;
if (zend_register_constant(&c TSRMLS_CC) == SUCCESS) {
RETURN_TRUE;
@@ -541,7 +541,7 @@ ZEND_FUNCTION(defined)
}
convert_to_string_ex(var);
if (zend_get_constant((*var)->value.str.val, (*var)->value.str.len, &c TSRMLS_CC)) {
if (zend_get_constant(Z_STRVAL_PP(var), Z_STRLEN_PP(var), &c TSRMLS_CC)) {
zval_dtor(&c);
RETURN_TRUE;
} else {
@@ -1085,9 +1085,9 @@ ZEND_FUNCTION(function_exists)
ZEND_WRONG_PARAM_COUNT();
}
convert_to_string_ex(function_name);
lcname = zend_str_tolower_dup((*function_name)->value.str.val, (*function_name)->value.str.len);
lcname = zend_str_tolower_dup(Z_STRVAL_PP(function_name), Z_STRLEN_PP(function_name));
retval = (zend_hash_find(EG(function_table), lcname, (*function_name)->value.str.len+1, (void **)&func) == SUCCESS);
retval = (zend_hash_find(EG(function_table), lcname, Z_STRLEN_PP(function_name)+1, (void **)&func) == SUCCESS);
efree(lcname);
@@ -1115,7 +1115,7 @@ ZEND_FUNCTION(leak)
if (ZEND_NUM_ARGS()>=1) {
if (zend_get_parameters_ex(1, &leak)==SUCCESS) {
convert_to_long_ex(leak);
leakbytes = (*leak)->value.lval;
leakbytes = Z_LVAL_PP(leak);
}
}
@@ -1172,7 +1172,7 @@ ZEND_FUNCTION(trigger_error)
ZEND_WRONG_PARAM_COUNT();
}
convert_to_long_ex(z_error_type);
error_type = (*z_error_type)->value.lval;
error_type = Z_LVAL_PP(z_error_type);
switch (error_type) {
case E_USER_ERROR:
case E_USER_WARNING:
@@ -1188,7 +1188,7 @@ ZEND_FUNCTION(trigger_error)
ZEND_WRONG_PARAM_COUNT();
}
convert_to_string_ex(z_error_message);
zend_error(error_type, "%s", (*z_error_message)->value.str.val);
zend_error(error_type, "%s", Z_STRVAL_PP(z_error_message));
RETURN_TRUE;
}
/* }}} */
@@ -1416,11 +1416,16 @@ ZEND_FUNCTION(get_defined_functions)
zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t) copy_function_name, 2, internal, user);
if (zend_hash_add(Z_ARRVAL_P(return_value), "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
zval_ptr_dtor(&internal);
zval_ptr_dtor(&user);
zval_dtor(return_value);
zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()");
RETURN_FALSE;
}
if (zend_hash_add(Z_ARRVAL_P(return_value), "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
zval_ptr_dtor(&user);
zval_dtor(return_value);
zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()");
RETURN_FALSE;
}
@@ -1577,7 +1582,7 @@ ZEND_FUNCTION(get_loaded_extensions)
/* }}} */
/* {{{ proto array get_defined_constants(void)
/* {{{ proto array get_defined_constants([mixed categorize])
Return an array containing the names and values of all defined constants */
ZEND_FUNCTION(get_defined_constants)
{
@@ -1661,7 +1666,9 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
while (--arg_count >= 0) {
arg = (zval **) p++;
if (*arg) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
if (Z_TYPE_PP(arg) != IS_OBJECT) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(arg);
}
(*arg)->refcount++;
add_next_index_zval(arg_array, *arg);
} else {
@@ -1924,7 +1931,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
}
/* skip debug_backtrace() */
if (skip_last--) {
if (skip_last-- && ptr) {
int arg_count = *((ulong*)(cur_arg_pos - 2));
cur_arg_pos -= (arg_count + 2);
frames_on_stack--;
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+87 -43
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -1535,11 +1535,10 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
if (original_op==ZEND_SEND_REF
&& !CG(allow_call_time_pass_reference)) {
zend_error(E_COMPILE_WARNING,
"Call-time pass-by-reference has been deprecated - argument passed by value; "
"Call-time pass-by-reference has been deprecated; "
"If you would like to pass it by reference, modify the declaration of %s(). "
"If you would like to enable call-time pass-by-reference, you can set "
"allow_call_time_pass_reference to true in your INI file. "
"However, future versions may not support this any longer. ",
"allow_call_time_pass_reference to true in your INI file. ",
(function_ptr?function_ptr->common.function_name:"[runtime function name]"));
}
@@ -1686,19 +1685,15 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
if (expr) {
opline->op1 = *expr;
if (do_end_vparse && zend_is_function_or_method_call(expr)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
}
} else {
opline->op1.op_type = IS_CONST;
INIT_ZVAL(opline->op1.u.constant);
}
if (do_end_vparse) {
if (zend_is_function_or_method_call(expr)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
}
SET_UNUSED(opline->op2);
}
@@ -1726,16 +1721,35 @@ void zend_do_first_catch(znode *open_parentheses TSRMLS_DC)
void zend_initialize_try_catch_element(znode *try_token TSRMLS_DC)
{
int jmp_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
zend_llist jmp_list;
zend_llist *jmp_list_ptr;
opline->opcode = ZEND_JMP;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
/* save for backpatching */
zend_llist_init(&jmp_list, sizeof(int), NULL, 0);
zend_stack_push(&CG(bp_stack), (void *) &jmp_list, sizeof(zend_llist));
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &jmp_op_number);
zend_add_catch_element(try_token->u.opline_num, get_next_op_number(CG(active_op_array)) TSRMLS_CC);
}
void zend_do_mark_last_catch(znode *first_catch, znode *last_additional_catch TSRMLS_DC)
{
CG(active_op_array)->last--;
zend_do_if_end(TSRMLS_C);
if (last_additional_catch->u.opline_num == -1) {
CG(active_op_array)->opcodes[first_catch->u.opline_num].op1.u.EA.type = 1;
CG(active_op_array)->opcodes[first_catch->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
} else {
CG(active_op_array)->opcodes[last_additional_catch->u.opline_num].op1.u.EA.type = 1;
CG(active_op_array)->opcodes[last_additional_catch->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
}
DEC_BPC(CG(active_op_array));
}
@@ -1772,6 +1786,18 @@ void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var,
void zend_do_end_catch(znode *try_token TSRMLS_DC)
{
int jmp_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
zend_llist *jmp_list_ptr;
opline->opcode = ZEND_JMP;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
/* save for backpatching */
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &jmp_op_number);
CG(active_op_array)->opcodes[try_token->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
}
@@ -2189,13 +2215,18 @@ ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, zend_class_entry
}
}
static void inherit_static_prop(zval **p)
static int inherit_static_prop(zval **p, int num_args, va_list args, zend_hash_key *key)
{
(*p)->refcount++;
(*p)->is_ref = 1;
}
HashTable *target = va_arg(args, HashTable*);
if (!zend_hash_quick_exists(target, key->arKey, key->nKeyLength, key->h)) {
SEPARATE_ZVAL_TO_MAKE_IS_REF(p);
if (zend_hash_quick_add(target, key->arKey, key->nKeyLength, key->h, p, sizeof(zval*), NULL) == SUCCESS) {
(*p)->refcount++;
}
}
return ZEND_HASH_APPLY_KEEP;
}
ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC)
{
@@ -2216,9 +2247,9 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
if (parent_ce->type != ce->type) {
/* User class extends internal class */
zend_update_class_constants(parent_ce TSRMLS_CC);
zend_hash_merge(&ce->default_static_members, CE_STATIC_MEMBERS(parent_ce), (void (*)(void *)) inherit_static_prop, NULL, sizeof(zval *), 0);
zend_hash_apply_with_arguments(CE_STATIC_MEMBERS(parent_ce), (apply_func_args_t)inherit_static_prop, 1, &ce->default_static_members);
} else {
zend_hash_merge(&ce->default_static_members, &parent_ce->default_static_members, (void (*)(void *)) inherit_static_prop, NULL, sizeof(zval *), 0);
zend_hash_apply_with_arguments(&parent_ce->default_static_members, (apply_func_args_t)inherit_static_prop, 1, &ce->default_static_members TSRMLS_CC);
}
zend_hash_merge_ex(&ce->properties_info, &parent_ce->properties_info, (copy_ctor_func_t) (ce->type & ZEND_INTERNAL_CLASS ? zend_duplicate_property_info_internal : zend_duplicate_property_info), sizeof(zend_property_info), (merge_checker_func_t) do_inherit_property_access_check, ce);
@@ -2735,19 +2766,22 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
{
zend_op *opline;
int doing_inheritance = 0;
zend_class_entry *new_class_entry = emalloc(sizeof(zend_class_entry));
char *lcname = zend_str_tolower_dup(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len);
zend_class_entry *new_class_entry;
char *lcname;
if (CG(active_class_entry)) {
zend_error(E_COMPILE_ERROR, "Class declarations may not be nested");
return;
}
lcname = zend_str_tolower_dup(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len);
if (!(strcmp(lcname, "self") && strcmp(lcname, "parent"))) {
efree(lcname);
zend_error(E_COMPILE_ERROR, "Cannot use '%s' as class name as it is reserved", class_name->u.constant.value.str.val);
}
new_class_entry = emalloc(sizeof(zend_class_entry));
new_class_entry->type = ZEND_USER_CLASS;
new_class_entry->name = class_name->u.constant.value.str.val;
new_class_entry->name_length = class_name->u.constant.value.str.len;
@@ -3622,6 +3656,10 @@ void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type
}
}
if (expr->op_type == IS_CONST) {
zend_error(E_COMPILE_ERROR, "instanceof expects an object instance, constant given");
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INSTANCEOF;
opline->result.op_type = IS_TMP_VAR;
@@ -3634,11 +3672,12 @@ void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type
}
void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, znode *array, int variable TSRMLS_DC)
void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, znode *array, znode *as_token, int variable TSRMLS_DC)
{
zend_op *opline;
zend_bool is_variable;
zend_bool push_container = 0;
zend_op dummy_opline;
if (variable) {
if (zend_is_function_or_method_call(array)) {
@@ -3646,6 +3685,8 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
} else {
is_variable = 1;
}
/* save the location of FETCH_W instruction(s) */
open_brackets_token->u.opline_num = get_next_op_number(CG(active_op_array));
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
if (CG(active_op_array)->last > 0 &&
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) {
@@ -3657,6 +3698,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
}
} else {
is_variable = 0;
open_brackets_token->u.opline_num = get_next_op_number(CG(active_op_array));
}
/* save the location of FE_RESET */
@@ -3671,28 +3713,17 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
opline->op1 = *array;
SET_UNUSED(opline->op2);
opline->extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0;
*open_brackets_token = opline->result;
{
zend_op dummy_opline;
dummy_opline.result = opline->result;
if (push_container) {
dummy_opline.op1 = CG(active_op_array)->opcodes[CG(active_op_array)->last-2].op1;
} else {
znode tmp;
dummy_opline.result = opline->result;
if (push_container) {
dummy_opline.op1 = CG(active_op_array)->opcodes[CG(active_op_array)->last-2].op1;
} else {
znode tmp;
tmp.op_type = IS_UNUSED;
dummy_opline.op1 = tmp;
}
zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op));
tmp.op_type = IS_UNUSED;
dummy_opline.op1 = tmp;
}
}
void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, znode *as_token TSRMLS_DC)
{
zend_op *opline;
zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op));
/* save the location of FE_FETCH */
as_token->u.opline_num = get_next_op_number(CG(active_op_array));
@@ -3701,7 +3732,7 @@ void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, zno
opline->opcode = ZEND_FE_FETCH;
opline->result.op_type = IS_VAR;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *open_brackets_token;
opline->op1 = dummy_opline.result;
opline->extended_value = 0;
SET_UNUSED(opline->op2);
@@ -3713,7 +3744,7 @@ void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, zno
}
void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, znode *key TSRMLS_DC)
void zend_do_foreach_cont(znode *foreach_token, znode *open_brackets_token, znode *as_token, znode *value, znode *key TSRMLS_DC)
{
zend_op *opline;
znode dummy, value_node;
@@ -3744,6 +3775,19 @@ void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, z
/* Mark extended_value for assign-by-reference */
opline->extended_value |= ZEND_FE_FETCH_BYREF;
CG(active_op_array)->opcodes[foreach_token->u.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE;
} else {
zend_op *foreach_copy;
zend_op *fetch = &CG(active_op_array)->opcodes[foreach_token->u.opline_num];
zend_op *end = &CG(active_op_array)->opcodes[open_brackets_token->u.opline_num];
/* Change "write context" into "read context" */
fetch->extended_value = 0; /* reset ZEND_FE_RESET_VARIABLE */
while (fetch != end) {
(--fetch)->opcode -= 3; /* FETCH_W -> FETCH_R */
}
/* prevent double SWITCH_FREE */
zend_stack_top(&CG(foreach_copy_stack), (void **) &foreach_copy);
foreach_copy->op1.op_type = IS_UNUSED;
}
value_node = opline->result;
+3 -4
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -476,9 +476,8 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type TSRMLS_DC);
void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, znode *array, int variable TSRMLS_DC);
void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, znode *as_token TSRMLS_DC);
void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, znode *key TSRMLS_DC);
void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, znode *array, znode *as_token, int variable TSRMLS_DC);
void zend_do_foreach_cont(znode *foreach_token, znode *open_brackets_token, znode *as_token, znode *value, znode *key TSRMLS_DC);
void zend_do_foreach_end(znode *foreach_token, znode *as_token TSRMLS_DC);
void zend_do_declare_begin(TSRMLS_D);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+43 -40
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -32,8 +32,7 @@ zend_class_entry *error_exception_ce;
static zend_object_handlers default_exception_handlers;
ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
void zend_throw_exception_internal(zval *exception TSRMLS_DC)
void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
{
if (exception != NULL) {
if (EG(exception)) {
@@ -58,11 +57,9 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC)
EG(opline_before_exception) = EG(current_execute_data)->opline;
EG(current_execute_data)->opline = &EG(active_op_array)->opcodes[EG(active_op_array)->last-1-1];
}
/* }}} */
ZEND_API void zend_clear_exception(TSRMLS_D)
ZEND_API void zend_clear_exception(TSRMLS_D) /* {{{ */
{
if (!EG(exception)) {
return;
@@ -74,8 +71,9 @@ ZEND_API void zend_clear_exception(TSRMLS_D)
EG(opline_before_exception) = NULL;
#endif
}
/* }}} */
static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_type, int skip_top_traces TSRMLS_DC)
static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_type, int skip_top_traces TSRMLS_DC) /* {{{ */
{
zval tmp, obj;
zend_object *object;
@@ -99,17 +97,19 @@ static zend_object_value zend_default_exception_new_ex(zend_class_entry *class_t
return Z_OBJVAL(obj);
}
/* }}} */
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC)
static zend_object_value zend_default_exception_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
return zend_default_exception_new_ex(class_type, 0 TSRMLS_CC);
}
/* }}} */
static zend_object_value zend_error_exception_new(zend_class_entry *class_type TSRMLS_DC)
static zend_object_value zend_error_exception_new(zend_class_entry *class_type TSRMLS_DC) /* {{{ */
{
return zend_default_exception_new_ex(class_type, 2 TSRMLS_CC);
}
/* }}} */
/* {{{ proto Exception Exception::__clone()
Clone the exception object */
@@ -120,7 +120,6 @@ ZEND_METHOD(exception, __clone)
}
/* }}} */
/* {{{ proto Exception::__construct(string message, int code)
Exception constructor */
ZEND_METHOD(exception, __construct)
@@ -146,7 +145,6 @@ ZEND_METHOD(exception, __construct)
}
/* }}} */
/* {{{ proto ErrorException::__construct(string message, int code, int severity [, string filename [, int lineno]])
ErrorException constructor */
ZEND_METHOD(error_exception, __construct)
@@ -187,7 +185,7 @@ ZEND_METHOD(error_exception, __construct)
ZEND_WRONG_PARAM_COUNT(); \
}
static void _default_exception_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC)
static void _default_exception_get_entry(zval *object, char *name, int name_len, zval *return_value TSRMLS_DC) /* {{{ */
{
zval *value;
@@ -197,7 +195,7 @@ static void _default_exception_get_entry(zval *object, char *name, int name_len,
zval_copy_ctor(return_value);
INIT_PZVAL(return_value);
}
/* }}} */
/* {{{ proto string Exception::getFile()
Get the file in which the exception occurred */
@@ -209,7 +207,6 @@ ZEND_METHOD(exception, getFile)
}
/* }}} */
/* {{{ proto int Exception::getLine()
Get the line in which the exception occurred */
ZEND_METHOD(exception, getLine)
@@ -220,7 +217,6 @@ ZEND_METHOD(exception, getLine)
}
/* }}} */
/* {{{ proto string Exception::getMessage()
Get the exception message */
ZEND_METHOD(exception, getMessage)
@@ -231,7 +227,6 @@ ZEND_METHOD(exception, getMessage)
}
/* }}} */
/* {{{ proto int Exception::getCode()
Get the exception code */
ZEND_METHOD(exception, getCode)
@@ -242,7 +237,6 @@ ZEND_METHOD(exception, getCode)
}
/* }}} */
/* {{{ proto array Exception::getTrace()
Get the stack trace for the location in which the exception occurred */
ZEND_METHOD(exception, getTrace)
@@ -253,7 +247,6 @@ ZEND_METHOD(exception, getTrace)
}
/* }}} */
/* {{{ proto int ErrorException::getSeverity()
Get the exception severity */
ZEND_METHOD(error_exception, getSeverity)
@@ -264,7 +257,7 @@ ZEND_METHOD(error_exception, getSeverity)
}
/* }}} */
/* {{{ ZEND_METHOD(exception, gettraceasstring) */
/* {{{ gettraceasstring() macros */
#define TRACE_APPEND_CHR(chr) \
*str = (char*)erealloc(*str, *len + 1 + 1); \
(*str)[(*len)++] = chr
@@ -285,7 +278,9 @@ ZEND_METHOD(error_exception, getSeverity)
TRACE_APPEND_STRL(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); \
}
static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_key *hash_key)
/* }}} */
static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char **str;
int *len;
@@ -381,8 +376,9 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
}
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
static int _build_trace_string(zval **frame, int num_args, va_list args, zend_hash_key *hash_key)
static int _build_trace_string(zval **frame, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char *s_tmp, **str;
int *len, *num;
@@ -404,7 +400,7 @@ static int _build_trace_string(zval **frame, int num_args, va_list args, zend_ha
} else {
line = 0;
}
s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 2 + 1);
s_tmp = emalloc(Z_STRLEN_PP(file) + MAX_LENGTH_OF_LONG + 4 + 1);
sprintf(s_tmp, "%s(%ld): ", Z_STRVAL_PP(file), line);
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
efree(s_tmp);
@@ -425,7 +421,7 @@ static int _build_trace_string(zval **frame, int num_args, va_list args, zend_ha
TRACE_APPEND_STR(")\n");
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
/* {{{ proto string Exception::getTraceAsString()
Obtain the backtrace for the exception as a string (instead of an array) */
@@ -448,7 +444,7 @@ ZEND_METHOD(exception, getTraceAsString)
}
/* }}} */
int zend_spprintf(char **message, int max_len, char *format, ...)
int zend_spprintf(char **message, int max_len, char *format, ...) /* {{{ */
{
va_list arg;
int len;
@@ -458,7 +454,7 @@ int zend_spprintf(char **message, int max_len, char *format, ...)
va_end(arg);
return len;
}
/* }}} */
/* {{{ proto string Exception::__toString()
Obtain the string representation of the Exception object */
@@ -522,6 +518,7 @@ ZEND_METHOD(exception, __toString)
}
/* }}} */
/* {{{ internal structs */
/* All functions that may be used in uncaught exception handlers must be final
* and must not throw exceptions. Otherwise we would need a facility to handle
* such exceptions in that handler.
@@ -564,8 +561,9 @@ static zend_function_entry error_exception_functions[] = {
ZEND_ME(error_exception, getSeverity, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
{NULL, NULL, NULL}
};
/* }}} */
void zend_register_default_exception(TSRMLS_D)
void zend_register_default_exception(TSRMLS_D) /* {{{ */
{
zend_class_entry ce;
@@ -587,19 +585,21 @@ void zend_register_default_exception(TSRMLS_D)
error_exception_ce->create_object = zend_error_exception_new;
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
}
/* }}} */
ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D)
ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D) /* {{{ */
{
return default_exception_ce;
}
/* }}} */
ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D)
ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D) /* {{{ */
{
return error_exception_ce;
}
/* }}} */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC)
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC) /* {{{ */
{
zval *ex;
@@ -625,9 +625,9 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa
zend_throw_exception_internal(ex TSRMLS_CC);
return ex;
}
/* }}} */
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...)
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...) /* {{{ */
{
va_list arg;
char *message;
@@ -640,16 +640,17 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
efree(message);
return zexception;
}
/* }}} */
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char *message, long code, int severity TSRMLS_DC)
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char *message, long code, int severity TSRMLS_DC) /* {{{ */
{
zval *ex = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
zend_update_property_long(default_exception_ce, ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
return ex;
}
/* }}} */
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...)
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...) /* {{{ */
{
va_list args;
@@ -657,9 +658,10 @@ static void zend_error_va(int type, const char *file, uint lineno, const char *f
zend_error_cb(type, file, lineno, format, args);
va_end(args);
}
/* }}} */
/* This function doesn't return as it calls E_ERROR */
ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
ZEND_API void zend_exception_error(zval *exception TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce_exception = Z_OBJCE_P(exception);
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
@@ -698,9 +700,9 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
zend_error(E_ERROR, "Uncaught exception '%s'", ce_exception->name);
}
}
/* }}} */
ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC)
ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC) /* {{{ */
{
zend_class_entry *exception_ce;
@@ -715,6 +717,7 @@ ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC)
}
zend_throw_exception_internal(exception TSRMLS_CC);
}
/* }}} */
/*
* Local variables:
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+21 -18
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -64,7 +64,7 @@ static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_
#define TEMP_VAR_STACK_LIMIT 2000
static inline void zend_pzval_unlock_func(zval *z, zend_free_op *should_free)
static inline void zend_pzval_unlock_func(zval *z, zend_free_op *should_free, int unref)
{
if (!--z->refcount) {
z->refcount = 1;
@@ -73,7 +73,7 @@ static inline void zend_pzval_unlock_func(zval *z, zend_free_op *should_free)
/* should_free->is_var = 1; */
} else {
should_free->var = 0;
if (z->is_ref && z->refcount == 1) {
if (unref && z->is_ref && z->refcount == 1) {
z->is_ref = 0;
}
}
@@ -87,7 +87,8 @@ static inline void zend_pzval_unlock_free_func(zval *z)
}
}
#define PZVAL_UNLOCK(z, f) zend_pzval_unlock_func(z, f)
#define PZVAL_UNLOCK(z, f) zend_pzval_unlock_func(z, f, 1)
#define PZVAL_UNLOCK_EX(z, f, u) zend_pzval_unlock_func(z, f, u)
#define PZVAL_UNLOCK_FREE(z) zend_pzval_unlock_free_func(z)
#define PZVAL_LOCK(z) (z)->refcount++
#define RETURN_VALUE_UNUSED(pzn) (((pzn)->u.EA.type & EXT_TYPE_UNUSED))
@@ -411,11 +412,7 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va
*variable_ptr_ptr = value_ptr;
value_ptr->refcount++;
variable_ptr->refcount--;
if (variable_ptr->refcount==0) {
zendi_zval_dtor(*variable_ptr);
FREE_ZVAL(variable_ptr);
}
zval_ptr_dtor(&variable_ptr);
} else if (!variable_ptr->is_ref) {
if (variable_ptr_ptr == value_ptr_ptr) {
SEPARATE_ZVAL(variable_ptr_ptr);
@@ -1166,16 +1163,22 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
if (overloaded_result) {
switch (type) {
case BP_VAR_RW:
case BP_VAR_W:
if (Z_TYPE_P(overloaded_result) != IS_OBJECT
&& !overloaded_result->is_ref) {
zend_error_noreturn(E_ERROR, "Objects used as arrays in post/pre increment/decrement must return values by reference");
}
break;
}
if (!overloaded_result->is_ref &&
(type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET)) {
if (overloaded_result->refcount > 0) {
zval *tmp = overloaded_result;
ALLOC_ZVAL(overloaded_result);
*overloaded_result = *tmp;
zval_copy_ctor(overloaded_result);
overloaded_result->is_ref = 0;
overloaded_result->refcount = 0;
}
if (Z_TYPE_P(overloaded_result) != IS_OBJECT) {
zend_class_entry *ce = Z_OBJCE_P(container);
zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ce->name);
}
}
retval = &overloaded_result;
} else {
retval = &EG(error_zval_ptr);
+7 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -41,6 +41,12 @@ typedef union _temp_variable {
zval *str;
zend_uint offset;
} str_offset;
struct {
zval **ptr_ptr;
zval *ptr;
zend_bool fcall_returned_reference;
HashPointer fe_pos;
} fe;
zend_class_entry *class_entry;
} temp_variable;
+20 -7
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -870,6 +870,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) (long) i, NULL);
zend_ptr_stack_clear_multiple(TSRMLS_C);
}
if (call_via_handler) {
zval_ptr_dtor(&method_name);
zval_ptr_dtor(&params_array);
}
return FAILURE;
}
ALLOC_ZVAL(new_zval);
@@ -1113,11 +1118,14 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSR
int retval;
if (retval_ptr) {
pv.value.str.len = strlen(str)+sizeof("return ;")-1;
pv.value.str.val = emalloc(pv.value.str.len+1);
strcpy(pv.value.str.val, "return ");
strcat(pv.value.str.val, str);
strcat(pv.value.str.val, " ;");
int l = strlen(str);
Z_STRLEN(pv) = l+sizeof("return ;")-1;
Z_STRVAL(pv) = emalloc(Z_STRLEN(pv) + 1);
memcpy(Z_STRVAL(pv), "return ", sizeof("return ")-1);
memcpy(Z_STRVAL(pv) + sizeof("return ")-1, str, l);
Z_STRVAL(pv)[Z_STRLEN(pv)-2] = ' ';
Z_STRVAL(pv)[Z_STRLEN(pv)-1] = ';';
Z_STRVAL(pv)[Z_STRLEN(pv)] = '\0';
} else {
pv.value.str.len = strlen(str);
pv.value.str.val = estrndup(str, pv.value.str.len);
@@ -1381,6 +1389,9 @@ void zend_set_timeout(long seconds)
TSRMLS_FETCH();
EG(timeout_seconds) = seconds;
if(!seconds) {
return;
}
#ifdef ZEND_WIN32
if (timeout_thread_initialized==0 && InterlockedIncrement(&timeout_thread_initialized)==1) {
/* We start up this process-wide thread here and not in zend_startup(), because if Zend
@@ -1419,7 +1430,9 @@ void zend_set_timeout(long seconds)
void zend_unset_timeout(TSRMLS_D)
{
#ifdef ZEND_WIN32
PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0);
if(timeout_thread_initialized) {
PostThreadMessage(timeout_thread_id, WM_UNREGISTER_ZEND_TIMEOUT, (WPARAM) GetCurrentThreadId(), (LPARAM) 0);
}
#else
# ifdef HAVE_SETITIMER
{
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+69 -14
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -141,11 +141,16 @@ ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunctio
SET_INCONSISTENT(HT_OK);
while ((1U << i) < nSize) {
i++;
if (nSize >= 0x80000000) {
/* prevent overflow */
ht->nTableSize = 0x80000000;
} else {
while ((1U << i) < nSize) {
i++;
}
ht->nTableSize = 1 << i;
}
ht->nTableSize = 1 << i;
ht->nTableMask = ht->nTableSize - 1;
ht->pDestructor = pDestructor;
ht->arBuckets = NULL;
@@ -647,12 +652,15 @@ ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht)
SET_INCONSISTENT(HT_DESTROYED);
}
/* This is used to selectively delete certain entries from a hashtable.
* destruct() receives the data and decides if the entry should be deleted
* or not
/* This is used to recurse elements and selectively delete certain entries
* from a hashtable. apply_func() receives the data and decides if the entry
* should be deleted or recursion should be stopped. The following three
* return codes are possible:
* ZEND_HASH_APPLY_KEEP - continue
* ZEND_HASH_APPLY_STOP - stop iteration
* ZEND_HASH_APPLY_REMOVE - delete the element, combineable with the former
*/
ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
{
Bucket *p;
@@ -662,11 +670,16 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
HASH_PROTECT_RECURSION(ht);
p = ht->pListHead;
while (p != NULL) {
if (apply_func(p->pData TSRMLS_CC)) {
int result = apply_func(p->pData TSRMLS_CC);
if (result & ZEND_HASH_APPLY_REMOVE) {
p = zend_hash_apply_deleter(ht, p);
} else {
p = p->pListNext;
}
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
}
HASH_UNPROTECT_RECURSION(ht);
}
@@ -681,17 +694,22 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
HASH_PROTECT_RECURSION(ht);
p = ht->pListHead;
while (p != NULL) {
if (apply_func(p->pData, argument TSRMLS_CC)) {
int result = apply_func(p->pData, argument TSRMLS_CC);
if (result & ZEND_HASH_APPLY_REMOVE) {
p = zend_hash_apply_deleter(ht, p);
} else {
p = p->pListNext;
}
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
}
HASH_UNPROTECT_RECURSION(ht);
}
ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t destruct, int num_args, ...)
ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int num_args, ...)
{
Bucket *p;
va_list args;
@@ -703,15 +721,21 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t de
p = ht->pListHead;
while (p != NULL) {
int result;
va_start(args, num_args);
hash_key.arKey = p->arKey;
hash_key.nKeyLength = p->nKeyLength;
hash_key.h = p->h;
if (destruct(p->pData, num_args, args, &hash_key)) {
result = apply_func(p->pData, num_args, args, &hash_key);
if (result & ZEND_HASH_APPLY_REMOVE) {
p = zend_hash_apply_deleter(ht, p);
} else {
p = p->pListNext;
}
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
va_end(args);
}
@@ -754,7 +778,7 @@ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_fun
p = source->pListHead;
while (p) {
if (p->nKeyLength) {
zend_hash_update(target, p->arKey, p->nKeyLength, p->pData, size, &new_entry);
zend_hash_quick_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size, &new_entry);
} else {
zend_hash_index_update(target, p->h, p->pData, size, &new_entry);
}
@@ -779,7 +803,7 @@ ZEND_API void _zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_f
p = source->pListHead;
while (p) {
if (p->nKeyLength>0) {
if (_zend_hash_add_or_update(target, p->arKey, p->nKeyLength, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) {
if (_zend_hash_quick_add_or_update(target, p->arKey, p->nKeyLength, p->h, p->pData, size, &t, mode ZEND_FILE_LINE_RELAY_CC)==SUCCESS && pCopyConstructor) {
pCopyConstructor(t);
}
} else {
@@ -987,6 +1011,37 @@ ZEND_API int zend_hash_num_elements(HashTable *ht)
}
ZEND_API int zend_hash_get_pointer(HashTable *ht, HashPointer *ptr)
{
ptr->pos = ht->pInternalPointer;
if (ht->pInternalPointer) {
ptr->h = ht->pInternalPointer->h;
return 1;
} else {
ptr->h = 0;
return 0;
}
}
ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr)
{
if (ht->pInternalPointer != ptr->pos) {
Bucket *p;
IS_CONSISTENT(ht);
p = ht->arBuckets[ptr->h & ht->nTableMask];
while (p != NULL) {
if (p == ptr->pos) {
ht->pInternalPointer = p;
return 1;
}
p = p->pNext;
}
return 0;
}
return 1;
}
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos)
{
IS_CONSISTENT(ht);
+9 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -176,6 +176,14 @@ ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *p
ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, char *str_index, uint str_length, ulong num_index, HashPosition *pos);
typedef struct _HashPointer {
HashPosition pos;
ulong h;
} HashPointer;
ZEND_API int zend_hash_get_pointer(HashTable *ht, HashPointer *ptr);
ZEND_API int zend_hash_set_pointer(HashTable *ht, const HashPointer *ptr);
#define zend_hash_has_more_elements(ht) \
zend_hash_has_more_elements_ex(ht, NULL)
#define zend_hash_move_forward(ht) \
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+25 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -126,7 +126,6 @@ ZEND_API int zend_copy_ini_directives(TSRMLS_D)
return FAILURE;
}
zend_hash_copy(EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry));
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP TSRMLS_CC);
return SUCCESS;
}
#endif
@@ -214,6 +213,7 @@ ZEND_API void zend_unregister_ini_entries(int module_number TSRMLS_DC)
}
#ifdef ZTS
static int zend_ini_refresh_cache(zend_ini_entry *p, int stage TSRMLS_DC)
{
if (p->on_modify) {
@@ -227,6 +227,7 @@ ZEND_API void zend_ini_refresh_caches(int stage TSRMLS_DC)
{
zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) zend_ini_refresh_cache, (void *)(long) stage TSRMLS_CC);
}
#endif
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage)
@@ -529,6 +530,28 @@ ZEND_API ZEND_INI_MH(OnUpdateLong)
return SUCCESS;
}
ZEND_API ZEND_INI_MH(OnUpdateLongGEZero)
{
long *p, tmp;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
char *base;
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
tmp = zend_atoi(new_value, new_value_length);
if (tmp < 0) {
return FAILURE;
}
p = (long *) (base+(size_t) mh_arg1);
*p = tmp;
return SUCCESS;
}
ZEND_API ZEND_INI_MH(OnUpdateReal)
{
+2 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -175,6 +175,7 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
ZEND_API ZEND_INI_MH(OnUpdateBool);
ZEND_API ZEND_INI_MH(OnUpdateLong);
ZEND_API ZEND_INI_MH(OnUpdateLongGEZero);
ZEND_API ZEND_INI_MH(OnUpdateReal);
ZEND_API ZEND_INI_MH(OnUpdateString);
ZEND_API ZEND_INI_MH(OnUpdateStringUnempty);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+9 -9
View File
@@ -162,7 +162,7 @@ top_statement:
statement
| function_declaration_statement { zend_do_early_binding(TSRMLS_C); }
| class_declaration_statement { zend_do_early_binding(TSRMLS_C); }
| T_HALT_COMPILER '(' ')' ';' { REGISTER_MAIN_LONG_CONSTANT("__COMPILER_HALT_OFFSET__", zend_get_scanned_file_offset(TSRMLS_C), CONST_CS); YYACCEPT; }
| T_HALT_COMPILER '(' ')' ';' { zval c; if (zend_get_constant("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1, &c TSRMLS_CC)) { zval_dtor(&c); zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used once per request"); } else { REGISTER_MAIN_LONG_CONSTANT("__COMPILER_HALT_OFFSET__", zend_get_scanned_file_offset(TSRMLS_C), CONST_CS); } YYACCEPT; }
;
@@ -214,14 +214,14 @@ unticked_statement:
| expr ';' { zend_do_free(&$1 TSRMLS_CC); }
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
| T_UNSET '(' unset_variables ')' ';'
| T_FOREACH '(' variable { zend_do_foreach_begin(&$1, &$2, &$3, 1 TSRMLS_CC); } T_AS
{ zend_do_foreach_fetch(&$1, &$2, &$5 TSRMLS_CC); }
foreach_variable foreach_optional_arg ')' { zend_do_foreach_cont(&$1, &$5, &$7, &$8 TSRMLS_CC); }
foreach_statement { zend_do_foreach_end(&$1, &$5 TSRMLS_CC); }
| T_FOREACH '(' expr_without_variable { zend_do_foreach_begin(&$1, &$2, &$3, 0 TSRMLS_CC); } T_AS
{ zend_do_foreach_fetch(&$1, &$2, &$5 TSRMLS_CC); }
variable foreach_optional_arg ')' { zend_check_writable_variable(&$7); zend_do_foreach_cont(&$1, &$5, &$7, &$8 TSRMLS_CC); }
foreach_statement { zend_do_foreach_end(&$1, &$5 TSRMLS_CC); }
| T_FOREACH '(' variable T_AS
{ zend_do_foreach_begin(&$1, &$2, &$3, &$4, 1 TSRMLS_CC); }
foreach_variable foreach_optional_arg ')' { zend_do_foreach_cont(&$1, &$2, &$4, &$6, &$7 TSRMLS_CC); }
foreach_statement { zend_do_foreach_end(&$1, &$4 TSRMLS_CC); }
| T_FOREACH '(' expr_without_variable T_AS
{ zend_do_foreach_begin(&$1, &$2, &$3, &$4, 0 TSRMLS_CC); }
variable foreach_optional_arg ')' { zend_check_writable_variable(&$6); zend_do_foreach_cont(&$1, &$2, &$4, &$6, &$7 TSRMLS_CC); }
foreach_statement { zend_do_foreach_end(&$1, &$4 TSRMLS_CC); }
| T_DECLARE { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_declare_begin(TSRMLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(&$1 TSRMLS_CC); }
| ';' /* empty statement */
| T_TRY { zend_do_try(&$1 TSRMLS_CC); } '{' inner_statement_list '}'
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+52 -34
View File
@@ -286,6 +286,11 @@ int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2)
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle TSRMLS_DC)
{
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
/* zend_file_handle_dtor() operates on the copy, so we have to NULLify the original here */
file_handle->opened_path = NULL;
if (file_handle->free_filename) {
file_handle->filename = NULL;
}
}
@@ -983,6 +988,10 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_STRING_CAST;
}
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"binary"{TABS_AND_SPACES}")" {
return T_STRING_CAST;
}
<ST_IN_SCRIPTING>"("{TABS_AND_SPACES}"array"{TABS_AND_SPACES}")" {
return T_ARRAY_CAST;
}
@@ -1227,38 +1236,43 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>{LNUM} {
errno = 0;
zendlval->value.lval = strtol(yytext, NULL, 0);
if (errno == ERANGE) { /* overflow */
zendlval->value.dval = zend_strtod(yytext, NULL);
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
zendlval->value.lval = strtol(yytext, NULL, 0);
} else {
zendlval->type = IS_LONG;
return T_LNUMBER;
}
}
<ST_IN_SCRIPTING>{HNUM} {
errno = 0;
zendlval->value.lval = strtoul(yytext, NULL, 16);
if (errno == ERANGE) { /* overflow */
/* not trying strtod - it returns trash on 0x-es */
zendlval->value.lval = LONG_MAX; /* maximal long */
zend_error(E_NOTICE,"Hex number is too big: %s", yytext);
} else {
if (zendlval->value.lval < 0) {
/* maintain consistency with the old way */
zendlval->value.dval = (unsigned long) zendlval->value.lval;
errno = 0;
zendlval->value.lval = strtol(yytext, NULL, 0);
if (errno == ERANGE) { /* Overflow */
zendlval->value.dval = zend_strtod(yytext, NULL);
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
zendlval->type = IS_LONG;
}
zendlval->type = IS_LONG;
return T_LNUMBER;
}
<ST_IN_SCRIPTING>{HNUM} {
char *hex = yytext + 2; /* Skip "0x" */
int len = yyleng - 2;
/* Skip any leading 0s */
while (*hex == '0') {
hex++;
len--;
}
if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
zendlval->value.lval = strtol(hex, NULL, 16);
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {
zendlval->value.dval = zend_hex_strtod(hex, NULL);
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>{LNUM}|{HNUM} { /* treat numbers (almost) as strings inside encapsulated strings */
zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
zendlval->value.str.len = yyleng;
@@ -1560,12 +1574,13 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>(["]([^$"\\]|("\\".))*["]) {
<ST_IN_SCRIPTING>("b"?["]([^$"\\]|("\\".))*["]) {
register char *s, *t;
char *end;
int bprefix = (*yytext == 'b') ? 1 : 0;
zendlval->value.str.val = estrndup(yytext+1, yyleng-2);
zendlval->value.str.len = yyleng-2;
zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2);
zendlval->value.str.len = yyleng-bprefix-2;
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng);
@@ -1650,12 +1665,13 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>([']([^'\\]|("\\".))*[']) {
<ST_IN_SCRIPTING>("b"?[']([^'\\]|("\\".))*[']) {
register char *s, *t;
char *end;
int bprefix = (*yytext == 'b') ? 1 : 0;
zendlval->value.str.val = estrndup(yytext+1, yyleng-2);
zendlval->value.str.len = yyleng-2;
zendlval->value.str.val = estrndup(yytext+bprefix+1, yyleng-bprefix-2);
zendlval->value.str.len = yyleng-bprefix-2;
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng);
@@ -1698,17 +1714,19 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>["] {
<ST_IN_SCRIPTING>b?["] {
BEGIN(ST_DOUBLE_QUOTES);
return '\"';
}
<ST_IN_SCRIPTING>"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} {
<ST_IN_SCRIPTING>"b"?"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} {
char *s;
int bprefix = (*yytext == 'b') ? 1 : 0;
CG(zend_lineno)++;
CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0);
s = yytext+3;
CG(heredoc_len) = yyleng-bprefix-3-1-(yytext[yyleng-2]=='\r'?1:0);
s = yytext+bprefix+3;
while ((*s == ' ') || (*s == '\t')) {
s++;
CG(heredoc_len)--;
@@ -1725,7 +1743,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>['] {
<ST_IN_SCRIPTING>b?['] {
BEGIN(ST_SINGLE_QUOTE);
return '\'';
}
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
-475
View File
@@ -1,475 +0,0 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#if 0
#include "zend.h"
#include "zend_mm.h"
#if WIN32|WINNT
# ifndef inline
# define inline __inline
# endif
#endif
#define ZEND_MM_FREE_BLOCK 0
#define ZEND_MM_USED_BLOCK 1
#ifndef MAX
#define MAX(a, b) (((a)>(b))?(a):(b))
#endif
#ifndef ZEND_MM_ALIGNMENT
#define ZEND_MM_ALIGNMENT 8
#define ZEND_MM_ALIGNMENT_LOG2 3
#endif
#define ZEND_MM_ALIGNMENT_MASK ~(ZEND_MM_ALIGNMENT-1)
#define ZEND_MM_BUCKET_INDEX(true_size) (true_size >> ZEND_MM_ALIGNMENT_LOG2)
/* Aligned header size */
#define ZEND_MM_ALIGNED_SIZE(size) ((size + ZEND_MM_ALIGNMENT - 1) & ZEND_MM_ALIGNMENT_MASK)
#define ZEND_MM_ALIGNED_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_block))
#define ZEND_MM_ALIGNED_FREE_HEADER_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_free_block))
#define ZEND_MM_ALIGNED_SEGMENT_SIZE ZEND_MM_ALIGNED_SIZE(sizeof(zend_mm_segment))
/* Memory calculations */
#define ZEND_MM_BLOCK_AT(blk, offset) ((zend_mm_block *) (((char *) (blk))+(offset)))
#define ZEND_MM_DATA_OF(p) ((void *) (((char *) (p))+ZEND_MM_ALIGNED_HEADER_SIZE))
#define ZEND_MM_HEADER_OF(blk) ZEND_MM_BLOCK_AT(blk, -(int)ZEND_MM_ALIGNED_HEADER_SIZE)
/* Debug output */
#define ZEND_MM_DEBUG(stmt)
/* Start Heap Code */
static int left_child[ZEND_HEAP_MAX_BUCKETS];
static int left_child_of_right_brother[ZEND_HEAP_MAX_BUCKETS];
static inline void zend_heap_init(zend_heap heap)
{
int i;
for (i=0; i<ZEND_HEAP_MAX_BUCKETS; i++) {
left_child[i] = 2*i+1;
left_child_of_right_brother[i] = 2*i+3;
}
memset(heap, 0, sizeof(zend_heap));
}
static inline void zend_heap_activate_leaf(zend_heap heap, int node)
{
int i = node + ZEND_HEAP_MAX_BUCKETS-1;
heap[i] = node;
do {
i = (i-1)>>1; /* (i-1)/2 */
if (heap[i] < node) {
heap[i] = node;
} else {
break;
}
} while (i > 0);
}
static inline void zend_heap_deactivate_leaf(zend_heap heap, int node)
{
int i = node + ZEND_HEAP_MAX_BUCKETS-1;
heap[i] = 0;
do {
i = (i-1)>>1; /* (i-1)/2 */
if (heap[i] == node) {
heap[i] = MAX(heap[2*i+1], heap[2*i+2]);
} else {
break;
}
} while (i > 0);
}
static inline int zend_heap_search_leaf(zend_heap heap, int value)
{
int i = 1;
if (heap[0] < value) {
return 0;
}
while (i < ZEND_HEAP_MAX_BUCKETS) {
if (heap[i] >= value) {
/* Go to left child */
i = left_child[i];
} else {
/* Go to left child of right brother */
i = left_child_of_right_brother[i];
}
}
if (heap[i] >= value) {
return heap[i];
} else {
return heap[i+1];
}
}
/* End Heap Code */
static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block)
{
zend_mm_free_block **free_list_bucket;
size_t index = ZEND_MM_BUCKET_INDEX(mm_block->size);
if (index < ZEND_MM_NUM_BUCKETS) {
free_list_bucket = &heap->free_buckets[index];
if (*free_list_bucket == NULL) {
zend_heap_activate_leaf(heap->heap, index);
}
} else {
free_list_bucket = &heap->free_buckets[0];
}
mm_block->next_free_block = *free_list_bucket;
if (*free_list_bucket != NULL) {
mm_block->next_free_block->prev_free_block = mm_block;
}
*free_list_bucket = mm_block;
mm_block->prev_free_block = NULL;
}
static inline void zend_mm_remove_from_free_list(zend_mm_heap *heap, zend_mm_free_block *mm_block)
{
if (mm_block->prev_free_block) {
mm_block->prev_free_block->next_free_block = mm_block->next_free_block;
} else {
zend_mm_free_block **free_list_bucket;
size_t index = ZEND_MM_BUCKET_INDEX(mm_block->size);
if (index < ZEND_MM_NUM_BUCKETS) {
free_list_bucket = &heap->free_buckets[index];
*free_list_bucket = mm_block->next_free_block;
if (*free_list_bucket == NULL) {
zend_heap_deactivate_leaf(heap->heap, index);
}
} else {
free_list_bucket = &heap->free_buckets[0];
*free_list_bucket = mm_block->next_free_block;
}
}
if (mm_block->next_free_block) {
mm_block->next_free_block->prev_free_block = mm_block->prev_free_block;
}
}
static inline void zend_mm_create_new_free_block(zend_mm_heap *heap, zend_mm_block *mm_block, size_t true_size)
{
int remaining_size;
zend_mm_free_block *new_free_block;
/* calculate sizes */
remaining_size = mm_block->size - true_size;
if (remaining_size < ZEND_MM_ALIGNED_FREE_HEADER_SIZE) {
/* keep best_fit->size as is, it'll include this extra space */
return;
}
/* prepare new free block */
mm_block->size = true_size;
new_free_block = (zend_mm_free_block *) ZEND_MM_BLOCK_AT(mm_block, mm_block->size);
new_free_block->type = ZEND_MM_FREE_BLOCK;
new_free_block->size = remaining_size;
new_free_block->prev_size = true_size;
/* update the next block's prev_size */
ZEND_MM_BLOCK_AT(new_free_block, new_free_block->size)->prev_size = new_free_block->size;
/* add the new free block to the free list */
zend_mm_add_to_free_list(heap, new_free_block);
}
zend_bool zend_mm_add_memory_block(zend_mm_heap *heap, size_t block_size)
{
/* We need to make sure that block_size is big enough for the minimum segment size */
zend_mm_free_block *mm_block;
zend_mm_block *guard_block;
zend_mm_segment *segment;
/* align block size downwards */
block_size = block_size & ZEND_MM_ALIGNMENT_MASK;
segment = (zend_mm_segment *) malloc(block_size);
if (!segment) {
return 1;
}
/* fprintf(stderr, "Allocating segment %X\n", segment); */
segment->next_segment = heap->segments_list;
heap->segments_list = segment;
block_size -= ZEND_MM_ALIGNED_SEGMENT_SIZE;
mm_block = (zend_mm_free_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
mm_block->size = block_size - ZEND_MM_ALIGNED_HEADER_SIZE; /* keep one guard block in the end */
mm_block->type = ZEND_MM_FREE_BLOCK;
mm_block->prev_size = 0; /* Size is always at least ZEND_MM_ALIGNED_HEADER_SIZE big (>0) so 0 is OK */
/* setup guard block */
guard_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size);
guard_block->type = ZEND_MM_USED_BLOCK;
guard_block->size = ZEND_MM_ALIGNED_HEADER_SIZE;
guard_block->guard_block = 1;
guard_block->prev_size = mm_block->size;
ZEND_MM_DEBUG(("Setup guard block at 0x%0.8X\n", guard_block));
zend_mm_add_to_free_list(heap, mm_block);
return 0;
}
/* Notes:
* - This function may alter the block_sizes values to match platform alignment
* - This function does *not* perform sanity checks on the arguments
*/
zend_bool zend_mm_startup(zend_mm_heap *heap, size_t block_size)
{
heap->block_size = block_size;
heap->segments_list = NULL;
memset(heap->free_buckets, 0, sizeof(heap->free_buckets));
zend_heap_init(heap->heap);
return zend_mm_add_memory_block(heap, block_size);
}
void zend_mm_shutdown(zend_mm_heap *heap)
{
zend_mm_segment *segment = heap->segments_list;
zend_mm_segment *prev;
while (segment) {
prev = segment;
segment = segment->next_segment;
/* fprintf(stderr, "Freeing segment %X\n", prev);*/
free(prev);
}
heap->segments_list = NULL;
}
void *zend_mm_alloc(zend_mm_heap *heap, size_t size)
{
size_t true_size;
zend_mm_free_block *p, *best_fit=NULL;
zend_mm_free_block **free_list_bucket;
size_t index;
/* The max() can probably be optimized with an if () which checks more specific cases */
true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE);
index = ZEND_MM_BUCKET_INDEX(true_size);
if (index < ZEND_MM_NUM_BUCKETS) {
free_list_bucket = &heap->free_buckets[index];
if (*free_list_bucket) {
best_fit = *free_list_bucket;
goto zend_mm_finished_searching_for_block;
} else {
int leaf;
leaf = zend_heap_search_leaf(heap->heap, index);
if (leaf != 0) {
best_fit = heap->free_buckets[leaf];
goto zend_mm_finished_searching_for_block;
}
}
}
for (p = heap->free_buckets[0]; p; p = p->next_free_block) {
if (p->size == true_size) {
best_fit = p;
break;
}
if ((p->size > true_size) && (!best_fit || (best_fit->size > p->size))) { /* better fit */
best_fit = p;
}
}
zend_mm_finished_searching_for_block:
if (!best_fit) {
if (true_size > (heap->block_size - ZEND_MM_ALIGNED_SEGMENT_SIZE - ZEND_MM_ALIGNED_HEADER_SIZE)) {
/* Make sure we add a memory block which is big enough */
if (zend_mm_add_memory_block(heap, true_size + ZEND_MM_ALIGNED_SEGMENT_SIZE + ZEND_MM_ALIGNED_HEADER_SIZE)) {
zend_error(E_ERROR, "Out of memory: cannot allocate %zd bytes!", true_size);
return NULL;
}
} else {
if (zend_mm_add_memory_block(heap, heap->block_size)) {
zend_error(E_ERROR, "Out of memory: cannot allocate %zd bytes!", heap->block_size);
return NULL;
}
}
return zend_mm_alloc(heap, size);
}
/* mark as used */
best_fit->type = ZEND_MM_USED_BLOCK;
((zend_mm_block *) best_fit)->guard_block = 0;
/* remove from free list */
zend_mm_remove_from_free_list(heap, best_fit);
zend_mm_create_new_free_block(heap, (zend_mm_block *) best_fit, true_size);
return ZEND_MM_DATA_OF(best_fit);
}
void zend_mm_free(zend_mm_heap *heap, void *p)
{
zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p);
zend_mm_block *prev_block, *next_block;
if (mm_block->type != ZEND_MM_USED_BLOCK) {
/* error */
return;
}
next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size);
/* merge with previous block if empty */
if (mm_block->prev_size != 0
&& (prev_block=ZEND_MM_BLOCK_AT(mm_block, -(int)mm_block->prev_size))->type == ZEND_MM_FREE_BLOCK) {
zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) prev_block);
prev_block->size += mm_block->size;
mm_block = prev_block;
next_block->prev_size = mm_block->size;
}
/* merge with the next block if empty */
if (next_block->type == ZEND_MM_FREE_BLOCK) {
mm_block->size += next_block->size;
zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size); /* recalculate */
next_block->prev_size = mm_block->size;
}
mm_block->type = ZEND_MM_FREE_BLOCK;
zend_mm_add_to_free_list(heap, (zend_mm_free_block *) mm_block);
}
void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size)
{
zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p);
zend_mm_block *next_block;
size_t true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE);
next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size);
if (true_size <= mm_block->size) {
zend_mm_create_new_free_block(heap, mm_block, true_size);
if (next_block->type == ZEND_MM_FREE_BLOCK) {
zend_mm_block *new_next_block;
new_next_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size);
if (new_next_block != next_block) { /* A new free block was created */
zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) new_next_block);
zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
new_next_block->size += next_block->size;
/* update the next block's prev_size */
ZEND_MM_BLOCK_AT(new_next_block, new_next_block->size)->prev_size = new_next_block->size;
zend_mm_add_to_free_list(heap, (zend_mm_free_block *) new_next_block);
}
}
return p;
}
if ((mm_block->prev_size == 0) && (next_block->type == ZEND_MM_USED_BLOCK) &&
(next_block->guard_block)) {
zend_mm_segment *segment = (zend_mm_segment *) ((char *)mm_block - ZEND_MM_ALIGNED_SEGMENT_SIZE);
zend_mm_segment *segment_copy = segment;
zend_mm_block *guard_block;
size_t realloc_to_size;
/* segment size, size of block and size of guard block */
realloc_to_size = ZEND_MM_ALIGNED_SEGMENT_SIZE+true_size+ZEND_MM_ALIGNED_HEADER_SIZE;
segment = realloc(segment, realloc_to_size);
if (!segment) {
return NULL;
}
if (segment != segment_copy) {
if (heap->segments_list == segment_copy) {
heap->segments_list = segment;
} else {
zend_mm_segment *seg = heap->segments_list;
while (seg) {
if (seg->next_segment == segment_copy) {
seg->next_segment = segment;
break;
}
seg = seg->next_segment;
}
}
mm_block = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
}
mm_block->size = true_size;
/* setup guard block */
guard_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size);
guard_block->type = ZEND_MM_USED_BLOCK;
guard_block->size = ZEND_MM_ALIGNED_HEADER_SIZE;
guard_block->guard_block = 1;
guard_block->prev_size = mm_block->size;
return ZEND_MM_DATA_OF(mm_block);
}
if (next_block->type != ZEND_MM_FREE_BLOCK || (mm_block->size + next_block->size < true_size)) {
void *ptr;
ptr = zend_mm_alloc(heap, size);
memcpy(ptr, p, mm_block->size - ZEND_MM_ALIGNED_HEADER_SIZE);
zend_mm_free(heap, p);
return ptr;
}
zend_mm_remove_from_free_list(heap, (zend_mm_free_block *) next_block);
mm_block->size += next_block->size;
/* update the next block's prev_size */
ZEND_MM_BLOCK_AT(mm_block, mm_block->size)->prev_size = mm_block->size;
zend_mm_create_new_free_block(heap, mm_block, true_size);
return p;
}
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
-85
View File
@@ -1,85 +0,0 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#if 0
#ifndef _ZEND_MM_H
#define _ZEND_MM_H
#include <sys/types.h>
#include "zend.h"
#include "zend_types.h"
#ifdef ZEND_WIN32
#undef ZEND_MM
#else
/* #define ZEND_MM */
#undef ZEND_MM
#endif
/* mm block type */
typedef struct _zend_mm_block {
unsigned int size : 31;
unsigned int type : 1;
size_t prev_size;
unsigned int guard_block : 1;
} zend_mm_block;
typedef struct _zend_mm_free_block {
unsigned int size : 31;
unsigned int type : 1;
size_t prev_size;
struct _zend_mm_free_block *prev_free_block;
struct _zend_mm_free_block *next_free_block;
} zend_mm_free_block;
typedef struct _zend_mm_segment {
struct _zend_mm_segment *next_segment;
} zend_mm_segment;
#define ZEND_MM_NUM_BUCKETS 16
#define ZEND_HEAP_MAX_BUCKETS ZEND_MM_NUM_BUCKETS
typedef int zend_heap[2*ZEND_HEAP_MAX_BUCKETS-1];
typedef struct _zend_mm_heap {
zend_mm_segment *segments_list;
size_t block_size;
zend_mm_free_block *free_buckets[ZEND_MM_NUM_BUCKETS];
zend_heap heap;
} zend_mm_heap;
zend_bool zend_mm_startup(zend_mm_heap *heap, size_t block_size);
void zend_mm_shutdown(zend_mm_heap *heap);
void *zend_mm_alloc(zend_mm_heap *heap, size_t size);
void zend_mm_free(zend_mm_heap *heap, void *p);
void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size);
#endif /* _ZEND_MM_H */
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+11 -8
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -334,14 +334,17 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
if (rv) {
retval = &rv;
if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && rv->refcount > 0) {
zval *tmp = rv;
if (!rv->is_ref &&
(type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET)) {
if (rv->refcount > 0) {
zval *tmp = rv;
ALLOC_ZVAL(rv);
*rv = *tmp;
zval_copy_ctor(rv);
rv->is_ref = 0;
rv->refcount = 0;
ALLOC_ZVAL(rv);
*rv = *tmp;
zval_copy_ctor(rv);
rv->is_ref = 0;
rv->refcount = 0;
}
if (Z_TYPE_P(rv) != IS_OBJECT) {
zend_error(E_NOTICE, "Indirect modification of overloaded property %s::$%s has no effect", zobj->ce->name, Z_STRVAL_P(member));
}
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+5 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -64,8 +64,11 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC)
{
zend_uint i = 1;
zend_uint i;
if (!objects->object_buckets) {
return;
}
for (i = 1; i < objects->top ; i++) {
if (objects->object_buckets[i].valid) {
objects->object_buckets[i].destructor_called = 1;
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
Loaded 100 of 1232 files, more files were not shown because too many files have changed in this diff. Show more