Compare commits

...
519 Commits
Author SHA1 Message Date
SVN Migration 0e743518e7 This commit was manufactured by cvs2svn to create tag 'php_5_0_5RC2'. 2005-08-25 17:41:09 +00:00
Zeev Suraski 2650819396 Bump version 2005-08-25 17:41:08 +00:00
Zeev Suraski 82e38322ed Roll RC2 2005-08-25 17:10:24 +00:00
Ilia Alshanetsky 9dd09fa253 MFH: Remainder of the 34191 bug fix. 2005-08-24 16:20:06 +00:00
Dmitry Stogov 78bafb0a0f Fixed boolean encoding (from 0/1 to false/true) to support some buggy soap SDKs.
Fixed support for missing nillable elements of sequnces.
2005-08-24 11:45:58 +00:00
Johannes Schlüter 11e98efaeb - MFH: Fix alphabetic order 2005-08-24 10:18:15 +00:00
Ilia Alshanetsky 4572d1ca93 MFH: removed unused vars 2005-08-23 15:20:48 +00:00
Greg Beaver 2e3affd121 sync with PEAR 1.3.6 2005-08-22 22:04:58 +00:00
Greg Beaver c64fd50c99 delete XML_RPC 1.3.1, add 1.4.0 2005-08-22 21:59:59 +00:00
Greg Beaver d0341050db sync with PEAR 1.3.6 2005-08-22 21:57:36 +00:00
Ilia Alshanetsky 8b5ef28849 MFH: Make dba extension support BerkleyDB 4.3. 2005-08-22 19:59:36 +00:00
Andrei Zmievski ce5840bfdd Upgrade to PCRE 6.0. 2005-08-22 16:56:13 +00:00
Greg Beaver a98e4ef9e8 argh, Archive_Tar is version 1.3.1, not 1.3.2 2005-08-22 16:12:17 +00:00
foobar 68babbb4cd reorder 2005-08-21 23:01:23 +00:00
Zeev Suraski 7547d0cfbd Roll 5.0.5RC1 2005-08-21 18:37:28 +00:00
Zeev Suraski 8e9f4c457e Backport Mike's patch for user sort functions 2005-08-21 18:36:34 +00:00
Ilia Alshanetsky 4e196361d8 MFH: Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). 2005-08-21 16:04:38 +00:00
Ilia Alshanetsky de2f172277 MFH: Fixed bug #34156 (memory usage remains elevated after memory limit is
reached)
2005-08-18 15:14:23 +00:00
Ilia Alshanetsky 06c10055d5 MFH: Fixed bug #33987 (php script as ErrorDocument causes crash in Apache 2). 2005-08-18 01:15:23 +00:00
foobar 42b7576ae8 MFH..thank god this ext is NOT in PHP_4_4 branch too.. 2005-08-17 17:04:37 +00:00
Dmitry Stogov 79fcfd26f3 Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54 seg fault) 2005-08-17 11:54:11 +00:00
Zeev Suraski 4f07d5a965 Add SoapClient::__setSoapHeaders() 2005-08-17 07:02:31 +00:00
Marcus Boerger 426f625c99 - MFH: Prevent E_STRICT from ending up as exception 2005-08-16 18:11:34 +00:00
Ilia Alshanetsky 9a0f85e1fa MFH: Fixed bug #34148 (+,- and . not supported as parts of scheme). 2005-08-16 14:15:43 +00:00
Ilia Alshanetsky ba508184f0 MFH: Input validation part 2. 2005-08-16 00:25:46 +00:00
Ilia Alshanetsky 0833aba80f MFH: Chunk the output 2005-08-15 23:23:51 +00:00
Ilia Alshanetsky 2d820b6dee MFH: input validation. 2005-08-15 16:06:28 +00:00
Antony Dovgal 215ed32e25 BFN 2005-08-11 21:21:56 +00:00
Antony Dovgal 03c4f24419 MF5.1: fix #34078 (Reflection API problems in methods with boolean or null default values) 2005-08-11 21:17:28 +00:00
Dmitry Stogov 5743a33991 Fixed bug #34062 (Crash in catch block when many arguments are used) 2005-08-10 13:11:29 +00:00
Dmitry Stogov 9183f91b50 Fixed bug #34064 (arr[] as param to function is allowed only if function receives argument by reference) 2005-08-10 10:37:24 +00:00
Dmitry Stogov 78ba9bf7d7 Fixed bug #33940 (array_map() fails to pass by reference when called recursively) 2005-08-10 08:23:53 +00:00
Dmitry Stogov b50858afb3 Fixed bug #29253 (array_diff with $GLOBALS argument fails) 2005-08-10 07:43:41 +00:00
Andrey Hristov f865b20700 BFN 2005-08-06 17:09:40 +00:00
Andrey Hristov 13fa7f7256 - fix int-long issue on 64bit (MFH)
- add data checking (MFH)
- add a comment
2005-08-06 16:56:06 +00:00
foobar 3f49790ce6 MFH 2005-08-05 20:39:21 +00:00
foobar f463d67389 MFB_4_4 2005-08-05 20:29:13 +00:00
Anantha Kesari H Y d530f46597 NetWare specific stat structure issues.
--Kamesh
2005-08-05 14:00:47 +00:00
Dmitry Stogov ac6c88a4dc Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP) 2005-08-04 10:35:37 +00:00
Dmitry Stogov 42d4af122b Fixed clone bug in ze1_compatibility mode 2005-08-04 08:46:53 +00:00
Dmitry Stogov c85bb04fa5 Fixed bug #33942 (the patch to #33156 crash cygwin except cli) 2005-08-02 17:01:33 +00:00
Edin Kadribasic 46079e009c A bit too much merging in the previous patch reverted.
We still need parsedate.c in PHP_5_0
2005-08-01 20:43:04 +00:00
Dmitry Stogov 03913f1308 Fixed bug #33723 (php_value overrides php_admin_value) 2005-08-01 08:12:42 +00:00
foobar c82f578f82 MFH 2005-07-29 13:00:11 +00:00
Anantha Kesari H Y 9555ebfabb In NetWare few of the programs like apache2 and ldap use winsock inclusinf sys/socket.h is not desirable.
--Kamesh
2005-07-29 09:20:02 +00:00
Anantha Kesari H Y 8d626495ed Cleaned up the NetWare specific code 2005-07-28 08:57:38 +00:00
Anantha Kesari H Y 5e2f93d2dd Cleaning up the NetWare code sitting in win32/sendmail.c.
Removing netware/sysexits.h
--Kamesh
2005-07-28 08:53:30 +00:00
Anantha Kesari H Y 767c3476f0 defined EX_OK and EX_TEMPFAIL in ext/standard/mail.c for NETWARE rather than including a sysexits.h
--Kamesh
2005-07-28 08:48:31 +00:00
Anantha Kesari H Y 4ef8f95450 removing redundant inclusion of headers for NETWARE
--Kamesh
2005-07-27 12:43:06 +00:00
Anantha Kesari H Y bf6759dd01 configure.in
moved the PHP_OS and PHP_UNAME definitions near the place other oses define them currently it is ggeting redined to build machine values when ./configure script is generated using autoconf version 2.13 but works fine with autoconf 2.51.
Defining the default EXTENSION_DIR for NetWare

--Kamesh
2005-07-27 11:44:08 +00:00
Anantha Kesari H Y af53d53b11 removed main/config.nw.h
-- Kamesh
2005-07-26 08:42:49 +00:00
Anantha Kesari H Y d6463e5a3f ext/pcre/pcrelib/internal.h
NetWare can make use autoconf based build.

main/php_sprintf.c
NetWare can make use autoconf based build.

ext/bcmath/libbcmath/src/config.h
NetWare can make use autoconf based build.

ext/mcve/mcve.c
NetWare can make use autoconf based build.

-- Kamesh
2005-07-26 08:38:25 +00:00
Marcus Boerger ae194a9a9c - MFH: Missing PDO build support 2005-07-25 22:31:07 +00:00
Marcus Boerger 9859b1f397 _ BFN 2005-07-25 21:07:19 +00:00
Marcus Boerger fddecc1352 - Add new test 2005-07-25 21:04:08 +00:00
Marcus Boerger 0d845f2ea4 - MFH: Synch (0.2a, 0.3 suport) 2005-07-25 21:03:33 +00:00
Marcus Boerger 0ddcc317e5 - MFH Bugfix #33853 2005-07-25 20:26:49 +00:00
Anantha Kesari H Y 80fdc3ac5e ext/standard/fsock.h
Removing redundant inclusion of headers for NetWare

ext/standard/lcg.c
NetWare LibC SDK sys/time.h implicitly includes sys/timval.h so nothing special needed for NetWare here.

--Kamesh
2005-07-25 13:10:19 +00:00
Wez Furlong 3b80c7560c merge build changes from HEAD, so that 5.0 builds on systems with recent cygwin
distros.
2005-07-22 18:09:34 +00:00
Anantha Kesari H Y 751bd7f024 NetWare can make use of Autoconf based build 2005-07-22 12:35:09 +00:00
Dmitry Stogov 43fa58a0c1 $context is not longer passed by reference, so its modification has no effect 2005-07-22 07:34:48 +00:00
Dmitry Stogov 5106b38ae5 Fixed bug #33802 (throw Exception in error handler causes crash) 2005-07-22 07:33:28 +00:00
Dmitry Stogov 9e20484a18 Fixed bug #33710 (ArrayAccess objects doen't initialize $this) 2005-07-19 07:33:24 +00:00
foobar 82ddbebbe4 MFB4_4: Fix compile problem with --regex=system on some systems 2005-07-18 23:10:08 +00:00
Brad House 3704f085ed BACKPORT FROM HEAD: sync missing functions from libmonetra-5 2005-07-18 20:11:10 +00:00
foobar 8688512c84 MFH 2005-07-18 18:39:37 +00:00
Dmitry Stogov 2fb797e325 Fixed bug #33558 (warning with nested calls to functions returning by reference) 2005-07-18 07:41:11 +00:00
Anantha Kesari H Y 522bdfb820 NetWare can make use the AutoConf based build system 2005-07-16 12:50:53 +00:00
Anantha Kesari H Y c7ef927a4b removing the redundant file libpq-fs.h 2005-07-16 12:47:18 +00:00
Anantha Kesari H Y 63394e6885 sapi/apache2filter/php_apache.h
Removing redundant CLIB_STAT_PATCH
sapi/apache2filter/sapi_apache2.c
Removing redundant CLIB_STAT_PATCH
-- Kamesh
2005-07-16 12:30:10 +00:00
Anantha Kesari H Y 41ce678468 main/fopen_wrappers.c
NetWare file names are case insensitive
main/main.c
NetWare has no sendmail binary. It uses the smart host mailing code avaiolable in php distro. Could not find a better place to put this than main/main.c.
main/php_open_temporary_file.c,v
Removed the unused variable in NetWare block.
main/php_streams.h
Removing the redundant CLIB_STAT_PATCH
main/safe_mode.c
NetWare has no uid.
-- Kamesh
2005-07-16 12:14:45 +00:00
Anantha Kesari H Y 05b895cd39 TSRM/tsrm_virtual_cwd.c
Removing the redundant CLIB_STAT_PATCH
TSRM/tsrm_virtual_cwd.h
Removing the redundant CLIB_STAT_PATCH
TSRM/TSRM.c
Netware pthreads support is good enough. So removing all these fixes of old times.
-- Kamesh
2005-07-16 11:50:59 +00:00
Anantha Kesari H Y 75841af9f6 NetWare specific dirname fixes.
--Kamesh
2005-07-16 11:18:35 +00:00
Anantha Kesari H Y 55518f5360 ext/standard/file.h NetWare LibC has fnmatch and realpath implemented.
ext/standard/filestat.c Removing redundant CLIB_STAT_PATCH and fixing some NetWare specific stat structure.
ext/standard/link.c Removing redundant CLIB_STAT_PATCH.
ext/standard/pageinfo.c Removing redundant CLIB_STAT_PATCH and fixing some NetWare specific stat structure.
ext/standard/syslog.c Except LOG_SYSLOG NetWare LibC has other macros defined.

-- Kamesh
2005-07-15 09:29:19 +00:00
foobar 740b23ecdf MFH 2005-07-14 00:15:35 +00:00
Ilia Alshanetsky b17ba8c110 MFH: Fixed bug #33673 (Added detection for partially uploaded files). 2005-07-13 20:51:12 +00:00
foobar 3c2689b7a7 MFH 2005-07-13 15:15:56 +00:00
Dmitry Stogov 2556bb635c Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF). (Nuno) 2005-07-12 07:18:57 +00:00
foobar 800e57ea5c MFH 2005-07-09 01:00:11 +00:00
foobar ddac7fe373 MFH 2005-07-09 00:47:01 +00:00
Dmitry Stogov 6d7ea1ac5e Fixed HTTP basic authentication headers during subrequsts to xsd files 2005-07-08 09:36:42 +00:00
Dmitry Stogov 042862140c Fixed support for <any> in base type of extension 2005-07-08 07:17:17 +00:00
Dmitry Stogov 1724f8e6a8 Fixed SIGSEGV on decoding <any> elements 2005-07-07 17:29:39 +00:00
Anantha Kesari H Y fcfc10f3ff zend_stream_getc uses fread internally. NetWare LibC fread reads 4(Which I believe EOT) for EOF(^D) character. This happens when fread is asked to read one and only character as is the case with cl interactive mode.
-- Kamesh
2005-07-07 15:39:35 +00:00
Anantha Kesari H Y ff870e6149 1)gwtcwd of NetWare LibC gives a cwd with a volume information.
So using getcwdpath which gives with volume information.
getcwdpath gives with directory seperator as \ which is against our DEFAULT_SLASH of /.
So finding and replacing \ with /
2)NetWare file path normalization code in virtual_file_ex.
-- Kamesh
2005-07-07 07:32:57 +00:00
Anantha Kesari H Y e0cfa4d51b COPY_WHEN_ABSOLUTE is not needed for NetWare.
NetWare can understand the file paths with volumnename with a colon, starting with / or \\ as absolute paths.
-- Kamesh
2005-07-07 06:38:49 +00:00
Edin Kadribasic 6dba27dc90 MFH: Export missing symbol 2005-07-06 21:19:13 +00:00
Dmitry Stogov da68b9b16f Fixed possible crash 2005-07-06 14:16:03 +00:00
Dmitry Stogov 02dee4ae0f Fixed test to support 64-bit platforms 2005-07-06 07:28:41 +00:00
Dmitry Stogov 342e04ca80 Fixed SIGSEGV during error processing on some systems (linux/ppc) 2005-07-06 06:59:07 +00:00
Dmitry Stogov 8fe2b1bed4 Fixed crash in ext\standard\tests\general_functions\bug32647.php on Windows 2005-07-05 14:14:03 +00:00
Dmitry Stogov f5da540a4a Fixed test file 2005-07-05 14:10:45 +00:00
Derick Rethans c741a9e719 - MFH: Fixed memory corruption in pg_copy_from() in case the as_null parameter was
passed.
2005-07-05 12:47:06 +00:00
Dmitry Stogov 06a2e4ce94 Fixed bug #33520 (crash if safe_mode is on and session.save_path is changed) 2005-07-04 12:47:26 +00:00
Dmitry Stogov 923ec1c813 Fixed bug #31158 (array_splice on $GLOBALS crashes) 2005-07-04 10:08:21 +00:00
Dmitry Stogov b8257c86e2 Fixed test fules (they assumend register_long_arrays=1) 2005-07-03 10:37:11 +00:00
Edin Kadribasic 701d735b4a MFH 2005-07-02 22:50:01 +00:00
Greg Beaver efa98f98a7 XML_RPC -> 1.3.1 2005-07-02 02:53:23 +00:00
Anantha Kesari H Y c65348f1ef NetWare LibC has reentrant versions of time functions this code is of no use.
-- Kamesh from hyanantha's account
2005-07-01 08:00:44 +00:00
Anantha Kesari H Y b64e13a8d8 As fork implementation of NetWare LibC still in experimental stages making the procve based solution ahead of HAVE_FORK. Later When fork becomes stable will revert this fix. 2005-07-01 05:53:06 +00:00
Anantha Kesari H Y ac33ea9aa3 this file is not needed anymore 2005-06-29 13:09:48 +00:00
Anantha Kesari H Y 76f175e312 This file is not used at all. 2005-06-29 12:43:25 +00:00
Anantha Kesari H Y 8b882a5b3f NetWare LibC has mktemp implementation 2005-06-29 12:15:50 +00:00
Anantha Kesari H Y 0a99718803 NetWare LibC has getpwnam, getlogin, getpwuid, getpid, this file is not needed anymore 2005-06-29 12:04:03 +00:00
Anantha Kesari H Y ba4a956864 NetWare LibC has readlink implementation 2005-06-29 11:44:49 +00:00
Anantha Kesari H Y 3190028b5b This file does nothing so removing this file 2005-06-29 11:21:27 +00:00
Anantha Kesari H Y 2e128a6e09 NetWare LibC has grp.h 2005-06-29 11:03:53 +00:00
Anantha Kesari H Y bcc763bfb9 NetWare LibC has param.h 2005-06-29 10:53:15 +00:00
Anantha Kesari H Y cd9eaf74b2 NetWare LibC itself pipe/popen/pclose implementation 2005-06-29 10:17:02 +00:00
Johannes Schlüter 150a72925b - MFH: Fix TSRM build 2005-06-29 09:29:08 +00:00
Anantha Kesari H Y 37d7c2b316 NetWare LibC itself has a pip/popen support 2005-06-29 09:22:20 +00:00
Anantha Kesari H Y 6e06124ea7 NetWare LibC has a pipe and popen implentation 2005-06-29 08:58:18 +00:00
Stanislav Malyshev 5cc99a6ac0 add comment 2005-06-29 08:44:41 +00:00
Stanislav Malyshev a67935f091 fix conditions 2005-06-29 08:36:30 +00:00
Anantha Kesari H Y 47536e7ac1 mktemp functionality is part of Regular NetWare LibC 2005-06-29 08:33:21 +00:00
Anantha Kesari H Y 093a132957 removing pwd.h as NetWare LibC itself supplies pwd.h for quite sometime 2005-06-29 07:01:50 +00:00
Anantha Kesari H Y 1b5f44e88c removed the unwanted NetWare Code 2005-06-29 06:46:59 +00:00
Anantha Kesari H Y d8ea4f11d1 Removing unwanted NetWare Code 2005-06-29 06:41:15 +00:00
Anantha Kesari H Y 0ad3be52c6 removing unwanted NetWare code 2005-06-29 06:28:31 +00:00
Antony Dovgal 2a328b9ba7 MFH: fix leak and improve CS a bit 2005-06-28 22:04:52 +00:00
foobar 96c20f31ba Removed unnecessary entry 2005-06-28 17:07:26 +00:00
Brian France f81d41c762 MFH:
Added a SG(server_context) NULL check to php_apache_getenv.

This can get called when "<key> = ${<key>}:/foo" is used in a .ini file, but <key> has not be set yet.
You will end up with a value of ":/foo", but at least it will not crash.
2005-06-28 16:38:03 +00:00
Anantha Kesari H Y 3059580aed removed redundant NEW_LIBC checks 2005-06-28 15:27:49 +00:00
Anantha Kesari H Y 2183cfb649 removed the unwanted NetWare Code 2005-06-28 15:22:39 +00:00
Anantha Kesari H Y 25cf53b352 removing unwanted NetWare portion 2005-06-28 15:19:35 +00:00
Anantha Kesari H Y eafc0420f0 removing redundant NEW_LIBC checks 2005-06-28 15:14:22 +00:00
Anantha Kesari H Y 7423659c35 removing the redundant NEW_LIBC checks 2005-06-28 14:57:31 +00:00
Anantha Kesari H Y a8a5e7573c removing redundant NEW_LIBC checks for NetWare 2005-06-28 14:49:14 +00:00
Anantha Kesari H Y 146e3220b7 removing redundant NEW_LIBC checks 2005-06-28 13:46:45 +00:00
Anantha Kesari H Y 348694d57c removing the redundant NEW_LIBC checks 2005-06-28 12:48:28 +00:00
Stanislav Malyshev 078c700804 fixes fo rnon-php objects (John Coggeshall) 2005-06-28 10:36:27 +00:00
Stanislav Malyshev 6cb09f8e0b fix non-PHP object handling (from John Coggeshall) 2005-06-28 09:17:19 +00:00
Antony Dovgal 6086495713 MFH: fix #33491 (crash after extending MySQLi internal class) 2005-06-27 18:22:00 +00:00
Antony Dovgal b330229b84 MFH: fix leak appearing when connect fails 2005-06-27 18:20:25 +00:00
Stanislav Malyshev c7200842cc fix various "Class entry requested for an object without PHP class" messages
when working with non-PHP objects.
# Using Z_OBJCE(object)->name is usually bad idea unless you know it's
# a pure PHP object
2005-06-27 17:42:06 +00:00
Stefan Esser bb1332fe02 MFH: also check password 2005-06-27 08:16:42 +00:00
Dmitry Stogov 1ed47a60c6 Fixed SIGSEGV on assigment string offset by reference 2005-06-27 06:15:02 +00:00
Dmitry Stogov 97ec1ff4de Fixed wrong include/requre occurrences in debug backtrace. 2005-06-27 06:02:58 +00:00
Holger Zimmermann 1bf24dcad9 Replaced PCHAR by CHAR * (not defined in pi3web_sapi header) 2005-06-26 16:36:59 +00:00
foobar e414432792 revert the conflicting part 2005-06-26 12:24:38 +00:00
Pierre Joye 3a2fb03556 - Bump xml_rpc version 2005-06-26 07:00:58 +00:00
Dmitry Stogov a029c98992 Partial fix for bug #26584 (Class member - array key overflow)
It doesn't fix integer overflow problem, but allows null, boolean and double keys in array constants in the same way as in runtime.
2005-06-24 09:25:02 +00:00
Dmitry Stogov 7094c2e6cf Fixed bug #30519 (Interface not existing says Class not found) 2005-06-24 08:45:44 +00:00
Dmitry Stogov f275a211cd Fixed bug #28377 (debug_backtrace is intermittently passing args) 2005-06-23 11:59:56 +00:00
Dmitry Stogov 71f96764db Fixed bug #32660 (Assignment by reference causes crash when field access is overloaded (__get)) 2005-06-23 11:04:58 +00:00
Dmitry Stogov 104346f695 Fixed test file according to latest debug_backtrace() fixes 2005-06-23 09:24:10 +00:00
Dmitry Stogov 867e81ddcf Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden methods) 2005-06-23 09:23:03 +00:00
Dmitry Stogov e4782e05ca Test for bug #27268. It is fixed in HEAD but not in PHP_5_0. 2005-06-23 08:24:42 +00:00
Rob Richards b53261c1f7 MFH: Fix bug #33299 (php:function no longer handles returned dom objects)
- maybe fix #33431/33432
2005-06-22 19:58:33 +00:00
Dmitry Stogov d2b516a17e Debug backtrace was fixed 2005-06-22 15:29:18 +00:00
Dmitry Stogov 5343858182 Fixed bug #29896 (Backtrace argument list out of sync) 2005-06-22 15:24:15 +00:00
Anantha Kesari H Y 90b5168603 removing the redundant NEW_LIBC checks 2005-06-22 11:29:07 +00:00
Anantha Kesari H Y 0cdfe8042a NetWare LibC has sys/param.h 2005-06-22 11:23:35 +00:00
Dmitry Stogov b5e1063103 Fixed bug in test file 2005-06-22 08:33:56 +00:00
Dmitry Stogov 21bdd33fff Fixed bug #33257 (array_splice() inconsistent when passed function instead of variable) 2005-06-22 08:31:19 +00:00
foobar b857a3579f MFH 2005-06-21 13:08:29 +00:00
Dmitry Stogov d861d47034 Fixed bug #31213 (Sideeffects caused by fix of bug #29493) 2005-06-21 12:10:59 +00:00
Dmitry Stogov d1b80a614a Remove unnecessary ZEND_FETCH_CLASS together with ZEND_DECLARE_INHERITED_CLASS
in case of early binding
2005-06-21 12:05:23 +00:00
Dmitry Stogov 0857ef4e0e ext/soap should use type defined in SoapVar(), if wsdl defines another type 2005-06-21 06:25:07 +00:00
Dmitry Stogov 52ea2ff77a Fixed test file (the bug was already fixed) 2005-06-21 06:08:10 +00:00
Antony Dovgal 758e9b813f MFH: fix memleak 2005-06-20 23:16:54 +00:00
Antony Dovgal 0d1eea3e50 MFH: reorder and prevent memleak: bailout after free() 2005-06-20 19:59:21 +00:00
Dmitry Stogov 68d3a2a4a3 Fixed possible crash on $x = $obj->$non_string 2005-06-20 18:25:12 +00:00
foobar 4e0748c5cf MFH: netware fixes 2005-06-20 13:46:02 +00:00
Antony Dovgal 6ba14f7c60 MFH: fix #29683 (headers_list() returns empty array) 2005-06-20 12:46:52 +00:00
foobar cee2f89bac MFH 2005-06-20 11:48:25 +00:00
Derick Rethans af2640314c - MFH: - Updated bundled shtool to version 2.0.2 2005-06-18 21:10:59 +00:00
Georg Richter 5a731ab4a8 MFH: fix for bug #33263 2005-06-17 16:37:07 +00:00
Antony Dovgal 3de754c066 MFH: improve error messages in internal classes 2005-06-17 11:28:43 +00:00
Dmitry Stogov 276f733eff Fixed bug #33277 (private method accessed by child class) 2005-06-17 10:51:10 +00:00
Antony Dovgal c2982d7dd0 MFH latest Jani's patch to 5_0 2005-06-15 17:19:41 +00:00
Georg Richter caa994f64a fixed parameter parse string for mysqli_stmt_attr_set 2005-06-15 14:04:23 +00:00
Rob Richards 386958ed03 BFN 2005-06-14 19:41:16 +00:00
Rob Richards 12d269131a MFH: Fixed bug #33340 (CLI Crash when calling php:function from XSLT) 2005-06-14 19:40:33 +00:00
Antony Dovgal d6091a30e2 MFH:
destroy session after destroying error handle
SQLT_CHR is allowed too
2005-06-13 09:31:03 +00:00
foobar 9ba95c7002 MFH 2005-06-10 12:35:21 +00:00
Dmitry Stogov 4e13631ec1 Added test file for bug #31177 (not fixed yet) 2005-06-10 10:44:54 +00:00
Dmitry Stogov ef4e1a153e Fixed support for ZEND_ACC_SHADOW in ReflectionProperty constructor 2005-06-10 10:22:50 +00:00
Stanislav Malyshev 7577029efd RIP abstrace private 2005-06-09 17:13:36 +00:00
Stanislav Malyshev 328a1117f1 Disallow abstract privae methods 2005-06-09 17:04:30 +00:00
Stanislav Malyshev 748de20686 #29689 2005-06-09 17:03:03 +00:00
Stanislav Malyshev 40f8b98419 fix #29689 and more private property problems 2005-06-09 16:59:57 +00:00
Dmitry Stogov 1bdfef5b38 Fixed double call to php_stream_close() on compiler errors 2005-06-09 16:56:59 +00:00
Stanislav Malyshev af2cbccc89 add test for this (to be fixed) bug 2005-06-09 16:51:14 +00:00
Ilia Alshanetsky a958154f5c MFH: Fixed compiler warning. 2005-06-09 16:13:24 +00:00
Dmitry Stogov 3c6eac005e Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may result in seg fault) 2005-06-09 10:14:51 +00:00
Dmitry Stogov 2010493086 Fixed bug (Crash on Windows and ZTS) that was introduced with fix for bug #26456 2005-06-09 08:54:24 +00:00
Dmitry Stogov 17953a4c1d Fixed reference counting and probable crash on fclose() or shutdown 2005-06-09 08:19:18 +00:00
Dmitry Stogov 33218a673f Fixed array type autodetection (use namespace name, but not the namespace prefix) 2005-06-09 08:17:09 +00:00
Ilia Alshanetsky 931158fde1 MFH: Fixed bug #33268 (iconv_strlen() works only with a parameter of < 3
in length).
2005-06-08 23:51:05 +00:00
Dmitry Stogov 5eb5dfa536 Fixed memory allocation bugs in array_reduce() with initial value (#22463 & #24980) 2005-06-08 19:54:46 +00:00
Dmitry Stogov 5e37deccc1 Fixed exception handling in getIterator() callback (bugs #26229 & #30725) 2005-06-08 18:53:39 +00:00
Dmitry Stogov d09cdd9f71 Fixed valgrind errors 2005-06-08 18:10:28 +00:00
foobar eab21631e8 MFH 2005-06-08 15:57:46 +00:00
Dmitry Stogov 79d65efb1d Fixed incorrect usage of zend_mangle_property_name() (valgrind errors) 2005-06-08 15:48:26 +00:00
Dmitry Stogov cff8050b83 Fixed bug #30140 (Problem with array in static properties) 2005-06-08 13:21:01 +00:00
Dmitry Stogov 8622b50012 Added test for bug #32322 (Return values by reference broken( using self::),example singleton instance) 2005-06-08 08:43:58 +00:00
Dmitry Stogov 4413882286 Fixed test file affected by fix for bug #30820 (static member conflict with $this->member silently ignored) 2005-06-08 08:06:27 +00:00
Dmitry Stogov bfc4de7e6f Fixed bug #30820 (static member conflict with $this->member silently ignored) 2005-06-08 08:05:27 +00:00
Dmitry Stogov 55e2692100 Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()) 2005-06-08 06:48:39 +00:00
foobar 2518165f92 MFH 2005-06-07 21:57:06 +00:00
foobar 79b610def8 MFH 2005-06-07 21:40:16 +00:00
Dmitry Stogov d544099dcb Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when called via STDIN) 2005-06-07 18:07:52 +00:00
foobar 3ae330cd00 MFH 2005-06-07 17:22:56 +00:00
Dmitry Stogov bfbbf5cedc Fixed memory allocation bugs. Probably this patch should fix bug #31725. 2005-06-07 15:38:37 +00:00
Ilia Alshanetsky 7de57d1a0f MFH: Fixed ZTS build. 2005-06-07 14:01:46 +00:00
Derick Rethans 221d961e02 - MFH: Added the --disable-zend-memory-manager switch to disable the Zend
memory manager.
#- I discussed this with Dmitry today - we found it useful.
2005-06-07 13:37:13 +00:00
Dmitry Stogov a7d4af0f34 Fixed memory leak in debug_print_backtrace() 2005-06-07 13:14:34 +00:00
Dmitry Stogov df96b038aa fixed memory leak in bug #28972 ([] operator overflow treatment is incorrect), not the bug itself. 2005-06-07 10:29:42 +00:00
Derick Rethans 5db859f053 - MF44: Problems with user defined error handler and references 2005-06-07 09:59:48 +00:00
Derick Rethans a235714d20 - MFH: Don't crash when compiled with the zend memory manager disabled. 2005-06-07 08:25:29 +00:00
Dmitry Stogov c8add6a3c2 Fixed bug #33243 (ze1_compatibility_mode does not work as expected) 2005-06-07 07:03:20 +00:00
Wez Furlong 6deefd1444 mfh: fix solaris build 2005-06-06 22:06:00 +00:00
Brad House a6f21df54c libmonetra 5.0 sync.
added m_validateidentifier, which is enabled by default to keep invalid pointer addresses from causing PHP to crash
kept compatability with older versions of libmonetra.
2005-06-06 16:43:55 +00:00
Ilia Alshanetsky baef306ffe MFH: Better storage size for output length. 2005-06-06 16:31:00 +00:00
Derick Rethans d8eb4055f0 - MH44: Problems with user defined error handler and wrong usage of references 2005-06-06 13:07:56 +00:00
Derick Rethans 2d4b98bf8b - Fixed bug #33242 (Mangled error message when stream fails). 2005-06-06 12:41:28 +00:00
foobar 3df7ed81db ws 2005-06-06 11:50:25 +00:00
Uwe Schindler 38d7c22ee0 Fix bug #33166 for other branches and new bug #33255 2005-06-06 11:00:48 +00:00
Dmitry Stogov 21d984c1bb Fixed bug #32799 (crash: calling the corresponding global var during the destruct) 2005-06-06 10:38:22 +00:00
Dmitry Stogov f5f6a1bb02 Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct) 2005-06-06 09:50:08 +00:00
Dmitry Stogov 52cd8053dc Added test for bug #32993 (implemented Iterator function current() don't throw
exception)
2005-06-06 08:25:22 +00:00
Dmitry Stogov 3452a4d9cb Fixed bug #33171 (foreach enumerates private fields declared in base classes) 2005-06-06 07:51:19 +00:00
Ilia Alshanetsky a40c67d2fa MFH: Fixed bug #33070 (Improved performance of bzdecompress() by several
orders of magnitude).
2005-06-05 18:05:07 +00:00
Magnus M��tt� f94cbfb33d MFH: Add skipif, test requires iconv. 2005-06-03 22:51:58 +00:00
Dmitry Stogov 3ba3e35a3e Fixed bug #30394 (Assignment operators yield wrong result with __get/__set) 2005-06-03 15:36:48 +00:00
Dmitry Stogov 695d12d0db Fixed bug #30080 (Passing array or non array of objects) 2005-06-03 15:02:09 +00:00
Dmitry Stogov 85a1e14e37 Fixed bug #27598 (list() array key assignment causes HUGE memory leak) 2005-06-03 13:57:01 +00:00
Dmitry Stogov 40d52ebc39 Fixed memory allocation bugs related to magic object handlers (__get(), __set(), ...) 2005-06-03 11:15:50 +00:00
George Schlossnagle b4ff2c495f On architectures that support va_copy (specifically x86_64 linux distros),
if you use va_list args more than once, you can corrupt memory - you
need to use va_copy instead.  man va_copy for details.

Also, derefrencing a void * to a long on 64 bit is totally uncool.
2005-06-03 07:31:59 +00:00
Ilia Alshanetsky 18ccd896c7 MFH: unnecessary variable. 2005-06-03 03:54:02 +00:00
foobar 710d2fef1c MFH: - Fixed bug #28605 (Need to use -[m]ieee option for Alpha CPUs) 2005-06-02 21:32:09 +00:00
Antony Dovgal 695b15b209 MFH: fix bug #33222 (segfault when CURL handle is closed in a callback).
fix segfaults when CURL callback functions throw exception.
2005-06-02 21:04:43 +00:00
Antony Dovgal fc325ce662 MFH: fix bug #33214 (odbc_next_result does not signal SQL errors with 2-statement SQL batches).
Path by rich at kastle dot com.
2005-06-02 15:42:44 +00:00
Derick Rethans 62a06d2d9e - That should have been removed, not commented out. 2005-06-02 08:51:10 +00:00
Derick Rethans 719b107576 - MFH: Fixed memory corruption in stristr(). 2005-06-02 08:31:03 +00:00
Ilia Alshanetsky 381734bede MFH: Fixed bug #33210 (relax jpeg recursive loop protection). 2005-06-01 22:28:38 +00:00
Dmitry Stogov 7a9d1fb1d5 Disabled search of recored separator outside of buffer 2005-06-01 15:11:15 +00:00
Dmitry Stogov eca56e4b59 Fixed bug #32941 (Sending structured SOAP fault kills a php) 2005-06-01 14:42:50 +00:00
Dmitry Stogov 05affa4c86 Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded) 2005-06-01 10:53:57 +00:00
Dmitry Stogov 7b23a065e8 Fixed "refcount" counting for autoglobals 2005-06-01 09:43:48 +00:00
Dmitry Stogov ce6b662ed6 Fixed possible memory corruption on request shutdown
`valgrind -q --tool=memcheck sapi/cli/php tests/reflection/001.phpt`
2005-05-31 17:40:48 +00:00
Dmitry Stogov 08fdbaecf8 Fixed usage of uninicialized variable 2005-05-31 14:35:25 +00:00
Magnus M��tt� 9285368cc1 MFH: Fix test 2005-05-31 13:46:59 +00:00
foobar ed160b9a19 MFH: - Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' modifier misbehave) 2005-05-31 12:55:33 +00:00
Ilia Alshanetsky 2063ff5a15 MFH: Fixed bug #33164 (Soap extension incorrectly detects HTTP/1.1). 2005-05-30 23:46:28 +00:00
foobar b1c2b7a493 - Fixed bug #33185 (--enable-session=shared does not build) 2005-05-30 15:13:57 +00:00
Sebastian Bergmann 4939dff84e MFH: Sync with config.m4. 2005-05-28 06:38:48 +00:00
Andrei Zmievski 1d019347cd Upgrade PCRE library to 5.0. 2005-05-27 18:07:33 +00:00
Dmitry Stogov 8ce349b8e0 Fixed bug #22836 (returning reference to uninitialized variable) 2005-05-27 16:05:52 +00:00
foobar f3797e0015 Move BFN to correct version.. 2005-05-27 07:21:11 +00:00
Ilia Alshanetsky c60e945965 Fixed bug #33080 (missing MFH of a fix for bug #31465) 2005-05-27 02:03:27 +00:00
Andrei Zmievski 19859a1b35 MFH 2005-05-26 21:49:32 +00:00
Dmitry Stogov 82be7f8f85 Fixed bug #33116 (crash when assigning class name to global variable in __autoload) 2005-05-26 14:40:12 +00:00
Marcus Boerger db4678d6af - Add new tests 2005-05-26 12:24:57 +00:00
Marcus Boerger a86cdc6952 - BFN 2005-05-26 11:59:36 +00:00
Marcus Boerger d7d5069d8b - MFH making SQLiteDatabase derivable 2005-05-26 11:56:03 +00:00
Ilia Alshanetsky 5a27a76b1b MFH: Added scheme validation for parse_url(). 2005-05-26 03:56:34 +00:00
Dmitry Stogov 00448a5211 Fixed bug #29971 (variables_order behaviour) 2005-05-25 17:41:18 +00:00
Stanislav Malyshev 2640b806d6 fix is_object on non-php objects 2005-05-25 10:58:26 +00:00
Ilia Alshanetsky 1930be2528 MFH: Return error on an invalid input to mime_content_type() function. 2005-05-25 03:06:07 +00:00
Andrei Zmievski 6b1cc632d1 MFH 2005-05-24 22:11:39 +00:00
Antony Dovgal 2843a96a82 MFH: make it compile on Win32 2005-05-24 10:14:05 +00:00
Ilia Alshanetsky f4a9417486 MFH: Fixed bug #32810 (temporary files not using plain file wrapper). 2005-05-23 21:49:53 +00:00
Antony Dovgal 254adf10bd revert by Wez's request 2005-05-23 15:37:10 +00:00
Antony Dovgal 770b04e09e BFN 2005-05-23 11:52:23 +00:00
Antony Dovgal f0893ba362 MFH: fix bug #32810 (fread after tmpfile() reads only 8192 bytes) 2005-05-23 11:52:12 +00:00
Antony Dovgal b3a89ba1ba MFH: fix test 2005-05-23 11:38:54 +00:00
foobar 9f24154bed MFH: Upgrade bundled shtool to 2.0.1 2005-05-23 09:46:17 +00:00
foobar d81b8bcb7b MFH: - Fixed bug #33017 ("make distclean" gives an error with VPATH build). 2005-05-23 09:41:51 +00:00
foobar 2399cb1321 Missed the bus now.. 2005-05-23 06:49:48 +00:00
Dmitry Stogov 16a1587e08 Handling responses with Content-Lenght: 0 2005-05-23 06:25:02 +00:00
Ilia Alshanetsky 3b4f3489f9 MFH: adjust highlight test. 2005-05-22 16:41:33 +00:00
Ilia Alshanetsky 4a3be1d920 MFH: Fixed bug #29338 (unencoded spaces get ignored after certain tags). 2005-05-22 16:40:49 +00:00
Antony Dovgal ac378c3b78 MFH: fix compile warning 2005-05-22 12:57:45 +00:00
Stanislav Malyshev c51ccc9243 fix leak 2005-05-22 11:11:42 +00:00
Rasmus Lerdorf 3526bcf9cf MFH Fixed bug 33072 - safemode/open_basedir check for runtime save_path
change
2005-05-21 18:54:57 +00:00
Rasmus Lerdorf 531f14ca6e Ah, never mind. Didn't notice a conflict on my last checkout. Jani's MFH
was fine.
2005-05-21 18:26:27 +00:00
Rasmus Lerdorf d98646435e Roll back Jani's blind MFH here. zend_call_destructors() is PHP 5.1 only. 2005-05-21 18:11:17 +00:00
Georg Richter ebec35f646 MFH:
- fix for bug #33090 (mysqli_prepare doesn't return an error)
- mysql_set_charset now works for MySQL >= 5.0.6
2005-05-21 08:54:57 +00:00
Grant Croker 119e74d6c2 - Fixed bug #30593 (--with-ingres option generates broken Makefile). 2005-05-20 16:13:27 +00:00
Rob Richards 5e63dccbb9 MFH: correct fix for bug #33059
- fix issue in other methods
2005-05-20 15:02:48 +00:00
Antony Dovgal bfdac383dc MFH:
fix bug #33076 (str_ireplace() incorrectly counts result string length and may cause segfault)
add test
2005-05-20 14:24:16 +00:00
Derick Rethans f4feaeeff9 - Update NEWS 2005-05-20 11:15:03 +00:00
Derick Rethans 2e0caa5f5f - MFH: Fixed bug #33013: "next month" was handled wrong. 2005-05-20 11:14:01 +00:00
Antony Dovgal 00b89e2d34 MFH: fix bug #32944 (Disabling session.use_cookies doesn't prevent reading session cookies) 2005-05-20 10:28:16 +00:00
foobar bdbc54c1ab reorder 2005-05-20 06:37:30 +00:00
Rasmus Lerdorf 8fa2dc1c64 . 2005-05-19 16:17:17 +00:00
Rasmus Lerdorf feac7f8dbb MFH Fix for bug #33057 - Don't send extraneous entity-headers on a 304 as per
RFC 2616 section 10.3.5
2005-05-19 16:06:38 +00:00
George Schlossnagle 496a8fbfbd support building on new-fangled 64bit linux distros that stick
libraries in /usr/lib64
2005-05-19 14:23:07 +00:00
Ilia Alshanetsky bb671b8928 MFH: Fixed bug #33059 (crash when moving xml attribute set in dtd). 2005-05-19 13:47:47 +00:00
Dmitry Stogov 4a3aae2b74 Backported fix for bug #30451 2005-05-19 10:37:09 +00:00
Dmitry Stogov 8e5c9a3d35 Strict warnings 2005-05-19 09:56:00 +00:00
Stanislav Malyshev 00e1c513c3 fix for #29890 - part 2 2005-05-18 18:10:17 +00:00
Stanislav Malyshev d16cfb98e1 test 2005-05-18 18:08:36 +00:00
Stanislav Malyshev cc65afef4d fix #29890 - crash when function call fails 2005-05-18 18:01:13 +00:00
Stanislav Malyshev 9d36b04b69 tests 2005-05-18 14:51:08 +00:00
Magnus M��tt� b8a50ab35b MFH: Fix tests. 2005-05-17 18:43:58 +00:00
Antony Dovgal 2cfff608bd MFH: gdImageGifCtx() is always available in bundled lib 2005-05-17 12:23:02 +00:00
Antony Dovgal 7d1ea234ff MFH: fix bugs #32742 (segmentation fault when the stream with a wrapper
is not closed), #32171 (Userspace stream wrapper crashes PHP)
2005-05-16 08:37:41 +00:00
Antony Dovgal cdf0dde4e4 BFN 2005-05-13 23:15:33 +00:00
Antony Dovgal 53db4b6087 MFH: fix bug #29975 (memory leaks when set_error_handler() is used inside error handler) 2005-05-13 23:15:21 +00:00
Georg Richter 146a948d37 MFH:
fixed windows compilation bug
renamed mysqli_set_character_set_name to mysqli_set_charset
2005-05-13 13:53:08 +00:00
Antony Dovgal a778e8ae49 MFH: fix #33019 (socket errors cause memory leaks in php_strerror())
patch by jwozniak23 at poczta dot onet dot pl
2005-05-12 16:27:06 +00:00
Antony Dovgal 28bcbea342 fix both win and gcc compile errors 2005-05-11 21:16:44 +00:00
Antony Dovgal 1887ae79d6 MFH: fix gcc-2.95 problems (reported by Adam Maccabee Trachtenberg) 2005-05-11 20:04:39 +00:00
Joe Orton 85afcb802d MFH: - Fixed bug #29119 (html_decode_entities handling of U+0152-U+0192 range)
(merge error from 4.3)
MFH: Mark pointers in entity tables as const.
2005-05-11 14:58:34 +00:00
Antony Dovgal d9918485df use & and check for the right value of result_type 2005-05-10 23:15:24 +00:00
foobar 2f8f30a9d1 missing blame tag :) 2005-05-10 21:45:25 +00:00
Antony Dovgal 3a121f0377 MFH: fix #32904 (pg_get_notify() ignores result_type parameter) 2005-05-10 20:13:58 +00:00
Dmitry Stogov 8709e2b651 Fixed transparent SoapFault passing 2005-05-10 13:57:47 +00:00
foobar 233a99a4e5 MFB: - Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems) 2005-05-10 13:22:12 +00:00
foobar 32c7c2f458 MFH: ws fix 2005-05-10 12:20:03 +00:00
foobar 9f562a55a4 - Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes snmpapp.conf
access errors). (Jani, ric at arizona dot edu)
2005-05-10 12:16:42 +00:00
Dmitry Stogov 909033e650 Fixed SIGSEGV 2005-05-10 10:20:38 +00:00
Dmitry Stogov 2284d365f9 "<?xml ..." header is not required by SOAP specification 2005-05-10 08:15:58 +00:00
Andrey Hristov 591103e629 MFH 2005-05-09 22:31:52 +00:00
Andrey Hristov b5e3c39343 warn the user if he wants to prepare before fetching all previous data
(in case mysqli_stmt_store_result() wasn't called or not enough calls
to mysqli_stmt_fetch()).
2005-05-09 21:47:36 +00:00
Zeev Suraski e7c2bb9077 Fix build 2005-05-09 16:01:12 +00:00
foobar 9ae244bca8 MFH: - getlogin() / getgroups() are not necessarily available everywhere 2005-05-09 12:16:11 +00:00
Rasmus Lerdorf 5493a5af6b MFH 2005-05-08 17:29:37 +00:00
foobar 353f3d693d MFH: unnecessary test 2005-05-08 15:59:18 +00:00
foobar c941788794 MFH: - Fixed bug #32932 (Oracle LDAP: ldap_get_entries invalid pointer) 2005-05-08 15:44:15 +00:00
Georg Richter db46216831 added new function mysqli_set_character_set_name
This function changes also the mysql->charset structure for
mysql_real_escape_string (see MySQL Bugs #8317 and #9637).
This bug will probably be fixed in MySQL 5.1
2005-05-08 08:47:40 +00:00
Ilia Alshanetsky 5906410a83 Fixed memory leak on error in FTP wrapper. 2005-05-07 16:07:36 +00:00
Wez Furlong e3049fe418 MFB: Fix for #32974 2005-05-07 14:58:02 +00:00
Georg Richter f37d8ad76a fix for 5_0. Statement constructor doesn't exist in 5_0 2005-05-07 07:55:01 +00:00
Andrey Hristov ffa626068b bail out just after detecting incorrect number of paramts to bind (MFH) 2005-05-07 07:47:24 +00:00
Ilia Alshanetsky 16b517057e MFH: Check ftp user name for control characters. 2005-05-06 18:43:13 +00:00
Antony Dovgal 0cd04dd8ee MFH: fix off-by-one in _php_image_output()
and prevent such errors in php_do_open_temporary_file()
2005-05-06 16:49:04 +00:00
Andrey Hristov 6477d350b2 init these variables (MFH) 2005-05-06 10:15:07 +00:00
Ilia Alshanetsky 5b90adb4f7 Added missing bit of the previous patch. 2005-05-06 02:19:36 +00:00
Ilia Alshanetsky 74a7342ac1 MFH: Fixed bug #32936 (http redirects URLs are not checked for control chars). 2005-05-06 02:18:22 +00:00
foobar 0d93c5366d typo 2005-05-06 00:21:27 +00:00
foobar d067b201cf reorder 2005-05-06 00:13:45 +00:00
Dmitry Stogov 89511b316a Fixed bug #31525 (object reference being dropped. $this getting lost) 2005-05-05 17:36:53 +00:00
Georg Richter fbe44d0345 MFH: fix for bug #32956
fixed memleak in mysql_close
     fixed data truncation in test 009.phpt
2005-05-05 13:30:31 +00:00
Georg Richter 8e3bf69780 MFH: fix for bug #32947 2005-05-05 12:33:56 +00:00
Stanislav Malyshev 24150c7b1d clarify some magic 2005-05-04 15:25:42 +00:00
Anantha Kesari H Y 3ccba5514f NetWare LibC dlsym works perfectly only thing that each of the extension need to export a symbol with FULL capital prefix. 2005-05-04 13:48:01 +00:00
Dmitry Stogov 8f95eb97e2 Fixed bug #30707 (Segmentation fault on exception in method) 2005-05-04 11:16:58 +00:00
Dmitry Stogov 39a1bc4a46 ws 2005-05-04 08:44:40 +00:00
Dmitry Stogov 7f3804f4ae Fixed bug #30162 (Catching exception in constructor couses lose of $this) 2005-05-04 08:41:56 +00:00
Rob Richards 659c0d344a BFN 2005-05-03 22:56:41 +00:00
Rob Richards 3bd4199865 MFH: Fix bug #32930 (class extending DOMDocument doesn't clone properly) 2005-05-03 22:55:45 +00:00
Marcus Boerger 6d72c22eea - Add test 2005-05-03 12:54:11 +00:00
Marcus Boerger 2a1d0e96c0 - Update tests affexted by fix 2005-05-03 12:52:08 +00:00
Dmitry Stogov 573c568e85 Fixed bug #32296 (get_class_methods output has changed between 5.0.2 and 5.0.3)
Now get_class_methods() shows accessible private and protected methods if it is called from class scope.
2005-05-03 08:50:13 +00:00
Marcus Boerger 311d262169 - BFN 2005-05-02 16:14:14 +00:00
Marcus Boerger d4f91d59dd - MFH Bugfix #30126 2005-05-02 16:03:01 +00:00
Ilia Alshanetsky feb4c90222 MFH: Fixed bug #32608 (html_entity_decode() converts single quotes even if
ENT_NOQUOTES is given).
2005-05-01 19:49:40 +00:00
Pierre Joye 5c966aaa06 - MFB: #32891, init old y positions to non possible values. -1 being used
if the center start a (x,0)
2005-05-01 05:52:54 +00:00
foobar 972c932097 MFH: - Fix problems with phpized ext/imap 2005-04-30 09:29:44 +00:00
foobar 1950289d3d MFH: - Added man pages for "phpize" and "php-config" scripts. (Jakub Vrana) 2005-04-30 04:30:20 +00:00
foobar 8369e2bfab MFH 2005-04-30 04:12:43 +00:00
foobar 9a53c1577f MFH: Moved phpextdist to dev/ 2005-04-30 03:02:49 +00:00
foobar c1b700d871 MFH 2005-04-29 10:40:39 +00:00
Andrey Hristov 015f87f5a9 missed to remove that. multi_query is no more a global. 2005-04-29 10:22:35 +00:00
foobar 94e8a7b47d MFH: Make sure E_STRICT is set always 2005-04-29 08:54:30 +00:00
Dmitry Stogov 39fec23c4c Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with array_push()) 2005-04-29 07:58:50 +00:00
Dmitry Stogov 79864e31c1 Fixed bug #32852 (Crash with singleton and __destruct when zend.ze1_compatibility_mode = On)
Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On)
Fixed bug #32080 (segfault when assigning object to itself with zend.ze1_compatibility_mode=On)
2005-04-29 07:03:35 +00:00
Dmitry Stogov 8aa7f7e3f9 Fixed WSDL cache bug 2005-04-29 05:38:31 +00:00
foobar 0a0d20f919 MFH: Add auto_globals_jit entry to php.ini-* (bug #29514) 2005-04-29 01:37:37 +00:00
Dmitry Stogov 11f5296b41 Fixed bug #29015 (Incorrect behavior of member vars(non string ones)-numeric mem vars und others) 2005-04-28 17:39:56 +00:00
Antony Dovgal 239a85c33e MFH: add test for bug #32828 2005-04-28 14:34:22 +00:00
foobar fda8417776 MFH 2005-04-28 14:24:21 +00:00
Antony Dovgal 05febcfc9a MFH: fix #32828 (Throwing exception in output_callback function with ob_start and
ob_end_clean leads to segfault)
2005-04-28 14:20:56 +00:00
Antony Dovgal 9c71c7530b MFH: handle unsupported datatypes and prevent segfault 2005-04-28 14:12:23 +00:00
foobar 926ec43123 MFH 2005-04-28 13:14:55 +00:00
Rob Richards a6306386c3 BFN 2005-04-28 12:19:09 +00:00
Rob Richards 37e937db25 MFH: Fix bug #32245 (xml_parser_free() in function assigned to the xml parser
gives a segfault)
2005-04-28 12:17:18 +00:00
foobar ea6ac022d6 MFH 2005-04-27 23:27:44 +00:00
foobar 99365dfd46 reword 2005-04-27 22:59:52 +00:00
Andrey Hristov 1ad623b515 update NEWS 2005-04-27 21:25:33 +00:00
Andrey Hristov d795792f8f change names 2005-04-27 21:23:44 +00:00
Andrey Hristov 5bad102755 BFN 2005-04-27 18:04:33 +00:00
Andrey Hristov e465c076f5 MFH (fix bug #31023)
#no test case because this has to be run with binary compiled with memory
#limit enabled.
2005-04-27 17:58:53 +00:00
Dmitry Stogov cfb4c916b8 Fixed bug #29210 (Function: is_callable - no support for private and protected classes). 2005-04-27 15:44:06 +00:00
Dmitry Stogov eb51b4f23a Fixed bug #29104 (Function declaration in method doesn't work) 2005-04-27 14:30:33 +00:00
foobar dedcaff2f2 MFH 2005-04-27 13:13:38 +00:00
Anantha Kesari H Y 896fe268fb check should be on host_alias rather than on target_alias, but somehow works on configure generated using autoconf 2.57. 2005-04-27 12:29:15 +00:00
Andrey Hristov 352d90baac BFN 2005-04-27 12:16:44 +00:00
Andrey Hristov 8595c6b6b8 - Fix bug 31668 (multi query fails every other time). The multi_query flag
was global and not per connection.
- use ecalloc() instead of calloc() for memory that will be freed with
  efree()
2005-04-27 12:03:05 +00:00
Dmitry Stogov 6644e5c5ec Fixed bug #32674 (exception in iterator causes crash) 2005-04-27 06:46:44 +00:00
Dmitry Stogov 519642125f Fixed bug #30889 (Conflict between __get/__set and ++ operator) 2005-04-26 13:23:08 +00:00
Dmitry Stogov 1a94c0f341 Fixed bug #30702 (cannot initialize class variable from class constant) 2005-04-26 09:27:07 +00:00
foobar aa6ecd5619 Netware stuff 2005-04-26 08:20:30 +00:00
Ilia Alshanetsky fce70d11e6 MFH: Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 2005-04-25 23:48:31 +00:00
foobar 7576762fb6 rbfn 2005-04-25 21:19:05 +00:00
foobar cadd10f56b MFH: revertos 2005-04-25 21:18:41 +00:00
foobar 8ba63bf7c0 reorder + shorten.. 2005-04-25 13:03:35 +00:00
Stanislav Malyshev 3656d13b68 fix 2005-04-25 12:44:19 +00:00
Stanislav Malyshev d225b1ce81 @- Fix #32773 and make right fix for GMP FPEs (Stas)
Fix #32773 and make right fix for GMP FPEs
2005-04-25 12:16:43 +00:00
Dmitry Stogov fae7e2bff2 Fixed bug #29944 (Function defined in switch, crashes). 2005-04-25 09:58:06 +00:00
Edin Kadribasic b0f4a8e912 BFN 2005-04-25 09:11:47 +00:00
Edin Kadribasic 584fb97aed MFH: Added T1LIB support on Windows (#32809) 2005-04-25 09:10:14 +00:00
Dmitry Stogov abe7b677f3 Fixed call to estrndup() with invalid lengt 2005-04-25 06:11:00 +00:00
Sebastian Bergmann 4dceadd4c1 MFH: Correct grammar. 2005-04-25 05:14:46 +00:00
Ilia Alshanetsky 40d04782e0 zval** not zval*. 2005-04-24 18:11:23 +00:00
Ilia Alshanetsky 5135548c9d MFH: Fixed bug #32802 (General cookie overrides more specific cookie). 2005-04-24 17:52:58 +00:00
foobar eb393b600c MFH: - Execute destructors earlier 2005-04-24 14:49:00 +00:00
foobar 81afaf32d7 typo 2005-04-23 23:57:56 +00:00
foobar 63a9f23f74 MFH: fix memleak 2005-04-23 21:15:54 +00:00
foobar 86e161007c MFH: - Fixed bug #32111 (Cookies can also be separated by colon) 2005-04-23 20:34:23 +00:00
Joe Orton 5fa11c0579 MFH: Fixed bug #32797 (invalid C code in xmlrpc extension). 2005-04-22 11:54:17 +00:00
Antony Dovgal 332f700522 fix C++ comments 2005-04-22 09:14:34 +00:00
Masaki Fujimoto 6d58950fe6 - MFH: Fix mbfl_encoding_detector_feed() and mbfl_mbfl_identify_encoding() behaviour 2005-04-22 05:03:25 +00:00
foobar 40108e7c04 MFH 2005-04-21 23:02:15 +00:00
foobar 46d47e77d0 MFH: expose EXEEXT and use with CLI/CGI 2005-04-21 15:13:16 +00:00
foobar fae392c88f BFN 2005-04-21 14:46:03 +00:00
foobar 485321056a MFH: - Fixed bug #32647 (Using register_shutdown_function() with invalid callback can crash PHP) 2005-04-21 14:45:55 +00:00
foobar 4924aa83f3 MFH: Added test for bug #32647 2005-04-21 14:18:27 +00:00
Dmitry Stogov ff8c742822 Fixed wrong SoapFault codes. The codes MUST be namespace qualified. 2005-04-21 12:27:54 +00:00
foobar 525e7171a4 MFH: - Possible fix for bug #32778 2005-04-21 11:19:53 +00:00
Antony Dovgal 4dac7613a2 add *.php to cvsignore 2005-04-21 10:20:09 +00:00
Brian France b601848ecd MFH: Added support for .cc files in extensions. 2005-04-20 20:50:12 +00:00
Dmitry Stogov 207248483e Fixed bug #32776 (SOAP doesn't support one-way operations) 2005-04-20 10:58:38 +00:00
Dmitry Stogov 1a635c7c89 space -> tab 2005-04-20 08:43:53 +00:00
Dmitry Stogov 4baee906ce Support for element's form and schema's elementFormDefault attributes (qualified/unqualified) 2005-04-20 08:31:10 +00:00
Dmitry Stogov 8594a3806f Some tests where fixed 2005-04-20 06:35:29 +00:00
foobar aad8b12fea reorder 2005-04-19 22:14:45 +00:00
foobar a2ad16ef21 MFH 2005-04-19 22:05:43 +00:00
Andrey Hristov 08c6d398cc FN 2005-04-19 17:35:04 +00:00
Andrey Hristov b01b5d8e58 MFH 2005-04-19 17:33:16 +00:00
Andrey Hristov 2d36d2dd9f fix test to be able to run not only over Unix socket but also over TCP/IP
and not only connected to localhost.
2005-04-19 15:42:45 +00:00
Andrey Hristov fd1fc2de89 BFN 2005-04-19 15:10:58 +00:00
Andrey Hristov fd13faea13 MFH 2005-04-19 13:42:31 +00:00
Wez Furlong 28a638fe7b BFN 2005-04-19 05:59:12 +00:00
Wez Furlong 7b6535c100 - Fix #32758 Cannot access safearray properties
- Fix #32759 incorrect determination of default value
2005-04-19 05:57:21 +00:00
Ilia Alshanetsky 047f1e936f MFH: Fixed bug #32753 (Undefined constant SQLITE_NOTADB). 2005-04-19 02:59:10 +00:00
Rob Richards d738786436 BFN 2005-04-18 23:09:09 +00:00
Rob Richards 9f0a5dc5e0 MFH: Fix bug #32755 Segfault in replaceChild() when DocumentFragment has no children
update test
2005-04-18 23:08:41 +00:00
Wez Furlong bba259101f Fix bugs #29583 and #31636 2005-04-18 16:22:38 +00:00
Dmitry Stogov d67b99c290 Fixed memory leak in debug_backtrace() 2005-04-18 07:24:25 +00:00
Georg Richter e61a96db00 MFH: fix for cursors 2005-04-18 06:03:58 +00:00
foobar 51a414ac42 MFH: - Fixed bug #30819 (Better support for LDAP SASL bind) 2005-04-17 16:26:30 +00:00
foobar 00330f2ae7 MFH: - Remove relic 2005-04-17 13:37:45 +00:00
foobar 1aa8063f2f MFH: - Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP response message) 2005-04-17 03:39:14 +00:00
foobar 0205c37cf8 retype 2005-04-16 12:26:51 +00:00
Uwe Schindler 17157f8092 MFH: use streams api for md5_file() and sha1_file() 2005-04-16 09:50:13 +00:00
Rasmus Lerdorf f157b9f12a MFH: The emboss and edge detection filter matrices were swapped 2005-04-16 00:16:14 +00:00
foobar 46e5e2d0c2 MFH 2005-04-15 22:25:46 +00:00
foobar 3a32a2f48a MFH 2005-04-15 22:21:05 +00:00
foobar 4f043328df MFH: - Use correct type (bug #32720) 2005-04-15 22:07:05 +00:00
Frank M. Kromann 20e400b6c0 Backporting prebuilt and videostring functions 2005-04-15 19:13:49 +00:00
Uwe Schindler f809403a2d MFH: fix various solaris problems by replacing stdio with posix io where possible 2005-04-15 09:14:53 +00:00
George Schlossnagle f52a914791 MFH - import correct handling of attribute's namespacing (broken in 5.0.4) 2005-04-15 06:53:07 +00:00
foobar 5450a0dcd1 - Regenerated with re2c 0.9.6 (fixes severe bugs) 2005-04-14 22:40:28 +00:00
foobar e50067c6ce MFH: - Add support for latest Birdstep 2005-04-14 21:17:42 +00:00
foobar 8516c7deb1 BFN 2005-04-14 15:48:55 +00:00
foobar fe7ea4ca83 MFH 2005-04-14 15:36:45 +00:00
Ilia Alshanetsky 0de3906316 MFB43: Fixed bug #31583 (php_std_date() uses short day names in
non-y2k_compliance mode).
2005-04-14 13:31:44 +00:00
Antony Dovgal a8541e0178 MFH: disable pg_cmdtuples() too, if there is no pg_affected_rows() 2005-04-13 22:11:55 +00:00
Derick Rethans 0a650df8da - MF43: Fixed bug #32699 (pg_affected_rows() was defined when it was not
available).
2005-04-13 21:46:32 +00:00
Moriyoshi Koizumi ade2667c70 - Commit the pending patch (bug #32311).
# Ugh, it wasn't committed yet.
2005-04-13 10:10:54 +00:00
Antony Dovgal ce6102342f MFH: add testcase for bug #30833 2005-04-13 08:23:59 +00:00
Frank M. Kromann b09e421111 MFH: Fix for #32682. Error on module shutdown when called from activescript 2005-04-12 17:46:06 +00:00
Ilia Alshanetsky 28e45cf6e4 MFH: Fixed compiler warning. 2005-04-12 16:42:20 +00:00
Antony Dovgal 4a23aa4535 MFH: fix #30833 (array_count_values modifying input array) 2005-04-12 14:01:06 +00:00
Stanislav Malyshev 4b9cca7c0c fi memory corruption if one on the on_modify handlers errors out 2005-04-12 12:59:36 +00:00
foobar 155eff97df fix typo (bug #32673) 2005-04-11 15:39:21 +00:00
Antony Dovgal 39e0e30af0 MFH: revert the patch 2005-04-11 15:19:40 +00:00
Dmitry Stogov 5efebee28a Fixed SIGSEGV on serializing data with circular references 2005-04-11 11:58:36 +00:00
Dmitry Stogov 55b18c598d Fixed bug #31502 (Wrong deserialization from session when using WDDX serializer ) 2005-04-11 10:41:33 +00:00
Dmitry Stogov d52c8ab857 Support for encoding/decoding of private and protected members 2005-04-11 09:28:11 +00:00
foobar 8037889e2c MFH 2005-04-10 19:22:42 +00:00
foobar 26b9ee7df1 MFH: - Fixed bug #32587 (Apache2: errors sent to error_log do not include timestamps)
# Also nuked the deprecated APLOG_NOERRNO's
2005-04-08 20:34:03 +00:00
foobar b4734f0dc6 regenerate with correct re2c version 2005-04-08 20:12:56 +00:00
Rob Richards 18335130cc BFN 2005-04-08 16:00:42 +00:00
Rob Richards e649f719bd - MFH Fixed bug #32615 (Segfault in replaceChild() using fragment when
previousSibling is NULL)
- add test
2005-04-08 15:59:38 +00:00
Ilia Alshanetsky 8fc219f0e3 MFH: Missing part of the patch for bug #32589 2005-04-08 15:04:44 +00:00
Marcus Boerger a16a9a753e - MFH Fix memory corruption 2005-04-08 14:36:39 +00:00
foobar 5050078bc0 MFH 2005-04-08 13:37:23 +00:00
Rob Richards 1832daf3cc fix test 2005-04-08 12:19:10 +00:00
Jon Parise 3efb2acb34 MFH 1.36: Spell "overridden" correctly. 2005-04-07 23:33:37 +00:00
Ilia Alshanetsky d9d53a1d69 MFH: Fixed bug #32533 (proc_get_status() returns the incorrect process status). 2005-04-07 23:08:48 +00:00
foobar c7a9ce70e8 missing entry 2005-04-07 22:29:21 +00:00
foobar 327c876dc6 BFN 2005-04-07 22:24:43 +00:00
foobar 5329f7ce4c MFH: - Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX) 2005-04-07 22:23:28 +00:00
foobar a4f8a9214c MFH 2005-04-07 22:03:47 +00:00
foobar 09a5954e67 MFH: Nuke duplication 2005-04-07 21:05:19 +00:00
foobar e0fef8b821 MFH: Use PHP_AUTOCONF / PHP_AUTOHEADER environment variables 2005-04-07 20:43:27 +00:00
foobar 4e9005d847 MFH 2005-04-07 20:23:19 +00:00
Dmitry Stogov 1c82847edd Fixed indentation 2005-04-07 16:16:28 +00:00
Dmitry Stogov ab8e8c6380 Fixed wrong result of cal_days_in_month() with bad dates 2005-04-07 16:12:47 +00:00
Zeev Suraski 1bb1e8f5fa MFH (Fix strdup() bug when USE_ZEND_ALLOC was disabled) 2005-04-07 14:00:00 +00:00
Uwe Schindler 69ba9df048 Bug #32614 - prevent from crahsing with segfault on solaris if fdopen() fails - this fixes NOT the stdio-problem on solaris! 2005-04-07 07:28:53 +00:00
foobar ff757583ff MFH 2005-04-06 22:15:40 +00:00
Ilia Alshanetsky cbf631cf84 bug fixing news. 2005-04-06 14:48:21 +00:00
Ilia Alshanetsky eaed8e0922 MFH: Fixed bug #32553 (mmap loads only the 1st 2000000 bytes on Win32). 2005-04-06 14:47:51 +00:00
Ilia Alshanetsky 84c1e20749 MFH: Removed php_check_syntax() function, it never worked properly. For now
use shell_exec("php -l script_name") or similar.
2005-04-06 14:21:03 +00:00
Ilia Alshanetsky 6a8e47ca98 MFH: Fixed bug #31363 (broken non-blocking flock()). 2005-04-06 13:59:48 +00:00
Antony Dovgal dfaf49e9fd MFH: do not try to read after EOF 2005-04-06 08:26:44 +00:00
Georg Richter e65f524f92 MFH: fix for #32282 (segfault in mysqli_fetch_array on 64-bit) 2005-04-06 06:48:13 +00:00
Antony Dovgal 69f10386f4 MFH: remove proto 2005-04-05 20:31:38 +00:00
Ilia Alshanetsky ee70304a32 MFH: Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets). 2005-04-05 14:48:28 +00:00
Ilia Alshanetsky 137eb633aa MFH: Fixed bug #30362 (stream_get_line() not reading data correctly). 2005-04-05 03:00:13 +00:00
foobar fe99a3a8a1 MFH: fix test 2005-04-04 22:32:11 +00:00
Sara Golemon 62eceedcc4 MFH rev 1.72 2005-04-04 19:48:14 +00:00
foobar e1f15df15c - Update 2005-04-04 18:53:01 +00:00
foobar 6696ac41c5 MFH 2005-04-04 18:15:41 +00:00
Stanislav Malyshev b1efdfae47 fix backtraces - non-Zend classes have names too 2005-04-04 17:22:20 +00:00
Uwe Schindler d7842bb07c Bug #32491 (File upload error - unable to create a temporary file) - Changing file upload from stdio to posix 2005-04-04 15:00:13 +00:00
Antony Dovgal bac150263b MFH: configure looks for incorrect db2 library 2005-04-04 10:52:19 +00:00
foobar eb6732ad60 MFH: - Fixed bug #28839 (SIGSEGV in interactive mode (php -a)).
MFH:   (kameshj at fastmail dot fm)
2005-04-03 21:57:06 +00:00
Ilia Alshanetsky 4c11305640 MFH: Fixed bug #32530 (chunk_split() does not append endstr if chunklen is
longer then the original string).
2005-04-03 18:09:25 +00:00
Antony Dovgal 43b641eab9 MFH: fix typo 2005-04-03 13:06:33 +00:00
Antony Dovgal 8325a296cb MFH: fix output_reset_rewrite_vars() returning false 2005-04-03 12:20:22 +00:00
Antony Dovgal 0d7b574472 MFH patch previously commited by Ilia
(memory leak when "S" is not listed in variable_order)
2005-04-03 11:55:44 +00:00
foobar 2fa9bcdc29 MFH 2005-04-03 11:18:22 +00:00
Moriyoshi Koizumi 27054e3850 - Reorder. 2005-04-03 07:51:11 +00:00
foobar 07081e2699 MFH 2005-04-03 00:12:34 +00:00
Greg Beaver 67745d4f44 remove -n switch 2005-04-02 23:51:24 +00:00
foobar 8013c023cb MFH 2005-04-02 23:20:18 +00:00
foobar 3d75c3fa8b MFH 2005-04-02 23:04:32 +00:00
Greg Beaver 912cb5d161 add missing file 2005-04-01 22:02:16 +00:00
Derick Rethans 56bad109e2 - MFH: internal_function->fn_flags is not initialized at this point 2005-03-31 15:44:52 +00:00
foobar e421488f99 MFH: c++ fix 2005-03-31 07:39:42 +00:00
Derick Rethans 21545018c3 - Back to dev so that we have working snapshots again. 2005-03-30 22:24:52 +00:00
491 changed files with 67151 additions and 17643 deletions

No files matched your search

+1 -1
View File
@@ -69,7 +69,7 @@ clean:
distclean: clean
rm -f config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h php5.spec sapi/apache/libphp5.module buildmk.stamp
egrep define'.*include/php' configure|sed 's/.*>//'|xargs rm -f
egrep define'.*include/php' $(top_srcdir)/configure|sed 's/.*>//'|xargs rm -f
find . -name Makefile | xargs rm -f
.PHONY: all clean install distclean test
+222 -2
View File
@@ -1,5 +1,225 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25 Aug 2005, PHP 5.0.5RC2
- Upgraded PCRE library to version 5.0. (Andrei)
- Removed php_check_syntax() function which never worked properly. (Ilia)
- Added new function mysqli_set_charset(). (Georg)
- Added man pages for "phpize" and "php-config" scripts. (Jakub Vrana)
- Added support for .cc files in extensions. (Brian)
- Added PHP_INT_MAX and PHP_INT_SIZE as predefined constants. (Andrey)
- Changed sha1_file() and md5_file() functions to use streams instead of
low level IO. (Uwe)
- Changed ming to support official 0.2a and 0.3 library versions. (Marcus)
- Fixed failing queries problem (FALSE returned) with mysqli_query() on 64 bit.
(Andrey)
- Fixed memory corruption in pg_copy_from() in case the as_null parameter was
passed. (Derick)
- Fixed ext/mysqli to allocate less memory when fetching bound params
of type (MEDIUM|LONG)BLOB/(MEDIUM|LONG)TEXT. (Andrey)
- Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
- Fixed memory corruption in stristr(). (Derick)
- Fixed segfaults when CURL callback functions throw exception. (Tony)
- Fixed various reentrancy bugs in user-sort functions, solves bugs #33286 and
#33295. (Mike Bretz)
- Fixed bug #34078 (Reflection API problems in methods with boolean or
null default values). (Tony)
- Fixed bug #34064 (arr[] as param to function is allowed only if function
receives argument by reference). (Dmitry)
- Fixed bug #34062 (Crash in catch block when many arguments are used).
(Dmitry)
- Fixed bug #33989 (extract($GLOBALS,EXTR_REFS) crashes PHP). (Dmitry)
- Fixed bug #33940 (array_map() fails to pass by reference when called
recursively). (Dmitry)
- Fixed bug #33853 (php:function call __autoload with lowercase param). (Marcus)
- Fixed bug #33802 (throw Exception in error handler causes crash). (Dmitry)
- Fixed bug #33723 (php_value overrides php_admin_value). (Dmitry)
- Fixed bug #33710 (ArrayAccess objects doen't initialize $this). (Dmitry)
- Fixed bug #33588 (LDAP: RootDSE query not possible). (Jani)
- Fixed bug #33558 (warning with nested calls to functions returning by
reference). (Dmitry)
- Fixed bug #33520 (crash if safe_mode is on and session.save_path is changed).
(Dmitry)
- Fixed bug #33491 (crash after extending MySQLi internal class). (Tony)
- Fixed bug #33340 (CLI Crash when calling php:function from XSLT). (Rob)
- Fixed bug #33277 (private method accessed by child class). (Dmitry)
- Fixed bug #33268 (iconv_strlen() works only with a parameter of < 3 in
length). (Ilia)
- Fixed bug #33263 (mysqli_real_escape doesn't work in __construct) (Georg)
- Fixed bug #33257 (array_splice() inconsistent when passed function instead
of variable). (Dmitry)
- Fixed bug #33243 (ze1_compatibility_mode does not work as expected). (Dmitry)
- Fixed bug #33242 (Mangled error message when stream fails). (Derick)
- Fixed bug #33222 (segfault when CURL handle is closed in a callback). (Tony)
- Fixed bug #33214 (odbc_next_result does not signal SQL errors with
2-statement SQL batches). (rich at kastle dot com, Tony)
- Fixed bug #33210 (relax jpeg recursive loop protection). (Ilia)
- Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' modifier
misbehave). (Jani)
- Fixed bug #33185 (--enable-session=shared does not build). (Jani)
- Fixed bug #33171 (foreach enumerates private fields declared in base
classes). (Dmitry)
- Fixed bug #33164 (Soap extension incorrectly detects HTTP/1.1). (Ilia)
- Fixed bug #33156 (cygwin version of setitimer doesn't accept ITIMER_PROF).
(Nuno)
- Fixed bug #33116 (crash when assigning class name to global variable in
__autoload). (Dmitry)
- Fixed bug #33090 (mysqli_prepare() doesn't return an error). (Georg)
- Fixed bug #33076 (str_ireplace() incorrectly counts result string length
and may cause segfault). (Tony)
- Fixed bug #33072 (Add a safemode/open_basedir check for runtime
"session.save_path" change using session_save_path() function). (Rasmus)
- Fixed bug #33070 (Improved performance of bzdecompress() by several orders
of magnitude). (Ilia)
- Fixed bug #33059 (crash when moving xml attribute set in dtd). (Ilia)
- Fixed bug #33057 (Don't send extraneous entity-headers on a 304 as per
RFC 2616 section 10.3.5) (Rasmus, Choitel)
- Fixed bug #33019 (socket errors cause memory leaks in php_strerror()).
(jwozniak23 at poczta dot onet dot pl, Tony).
- Fixed bug #33017 ("make distclean" gives an error with VPATH build). (Jani)
- Fixed bug #33013 ("next month" was handled wrong while parsing dates).
(Derick)
- Fixed bug #32981 (ReflectionMethod::getStaticVariables() causes apache2.0.54
seg fault). (Dmitry)
- Fixed bug #32956 (mysql_bind_result() doesn't support MYSQL_TYPE_NULL). (Georg)
- Fixed bug #32947 (Incorrect option for mysqli default password). (Georg)
- Fixed bug #32944 (Disabling session.use_cookies doesn't prevent reading
session cookies). (Jani, Tony)
- Fixed bug #32941 (Sending structured SOAP fault kills a php). (Dmitry)
- Fixed bug #32936 (http redirects URLs are not checked for control chars). (Ilia)
- Fixed bug #32933 (Cannot extend class "SQLiteDatabase"). (Marcus)
- Fixed bug #32932 (Oracle LDAP: ldap_get_entries(), invalid pointer). (Jani)
- Fixed bug #32930 (class extending DOMDocument doesn't clone properly). (Rob)
- Fixed bug #32904 (pg_get_notify() ignores result_type parameter). (Tony)
- Fixed bug #32852 (Crash with singleton and __destruct when
zend.ze1_compatibility_mode = On). (Dmitry)
- Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). (Ilia)
- Fixed bug #32810 (temporary files not using plain file wrapper). (Ilia)
- Fixed bug #32809 (Missing T1LIB support on Windows). (Edin)
- Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia)
- Fixed bugs #32800, #32830 (ext/odbc: Problems with 64bit systems). (Jani)
- Fixed bug #32799 (crash: calling the corresponding global var during the
destruct). (Dmitry)
- Fixed bug #32776 (SOAP doesn't support one-way operations). (Dmitry)
- Fixed bug #32773 (GMP functions break when second parameter is 0). (Stas)
- Fixed bug #32759 (incorrect determination of default value (COM)). (Wez)
- Fixed bug #32758 (Cannot access safearray properties in VB6 objects). (Wez)
- Fixed bug #32755 (Segfault in replaceChild() when DocumentFragment has
no children). (Rob)
- Fixed bug #32753 (Undefined constant SQLITE_NOTADB). (Ilia)
- Fixed bug #32742 (segmentation fault when the stream with a wrapper
is not closed). (Tony, Dmitry)
- Fixed bug #32699 (pg_affected_rows() was defined when it was not available).
(Derick)
- Fixed bug #32686 (Require/include file in destructor causes segfault).
(Marcus)
- Fixed bug #32682 (ext/mssql: Error on module shutdown when called from
activescript). (Frank)
- Fixed bug #32674 (exception in iterator causes crash). (Dmitry)
- Fixed bug #32660 (Assignment by reference causes crash when field access is
overloaded (__get)). (Dmitry)
- Fixed bug #32647 (Using register_shutdown_function() with invalid callback
can crash PHP). (Jani)
- Fixed bug #32615 (Segfault in replaceChild() using fragment when
previousSibling is NULL). (Rob)
- Fixed bug #32613 (ext/snmp: use of snmp_shutdown() causes snmpapp.conf
access errors). (Jani, ric at arizona dot edu)
- Fixed bug #32608 (html_entity_decode() converts single quotes even if
ENT_NOQUOTES is given). (Ilia)
- Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct).
(Dmitry)
- Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX). (Jani)
- Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets).
(Ilia)
- Fixed bug #32587 (Apache2: errors sent to error_log do not include
timestamps). (Jani)
- Fixed bug #32560 (configure looks for incorrect db2 library). (Tony)
- Fixed bug #32553 (mmap loads only the 1st 2000000 bytes on Win32). (Ilia)
- Fixed bug #32533 (proc_get_status() returns the incorrect process status). (Ilia)
- Fixed bug #32530 (chunk_split() does not append endstr if chunklen is
longer then the original string). (Ilia)
- Fixed bug #32491 (File upload error - unable to create a temporary file).
(Uwe Schindler)
- Fixed bug #32405 (mysqli::fetch() returns bad data - 64bit problem). (Andrey)
- Fixed bug #32282 (Segfault in mysqli_fetch_array on 64-bit). (Georg)
- Fixed bug #32296 (get_class_methods() output has changed between 5.0.2 and
5.0.3). (Dmitry)
- Fixed bug #32245 (xml_parser_free() in a function assigned to the xml parser
gives a segfault). (Rob)
- Fixed bug #32171 (Userspace stream wrapper crashes PHP). (Tony, Dmitry)
- Fixed bug #32080 (segfault when assigning object to itself with
zend.ze1_compatibility_mode=On). (Dmitry)
- Fixed bug #32013 (ext/mysqli bind_result causes fatal error: memory
limit). (Andrey)
- Fixed bug #31887 (ISAPI: Custom 5xx error does not return correct HTTP
response message). (Jani)
- Fixed bug #31828 (Crash with zend.ze1_compatibility_mode=On). (Dmitry)
- Fixed bug #31668 (multi_query works exactly every other time - multi query
d/e flag global and not per connection). (Andrey)
- Fixed bug #31636 (another crash when echoing a COM object). (Wez)
- Fixed bug #31583 (php_std_date() uses short day names in non-y2k_compliance
mode). (mike at php dot net)
- Fixed bug #31525 (object reference being dropped. $this getting lost).
(Stas, Dmitry)
- Fixed bug #31502 (Wrong deserialization from session when using WDDX
serializer). (Dmitry)
- Fixed bug #31465 (False warning in unpack() when working with *). (Ilia)
- Fixed bug #31363 (broken non-blocking flock()). ian at snork dot net
- Fixed bug #31213 (Sideeffects caused by fix of bug #29493). (Dmitry)
- Fixed bug #31158 (array_splice on $GLOBALS crashes). (Dmitry)
- Fixed bug #30961 (Wrong linenumber in ReflectionClass getStartLine()).
(Dmitry)
- Fixed bug #30889 (Conflict between __get/__set and ++ operator). (Dmitry)
- Fixed bug #30833 (array_count_values() modifying input array). (Tony)
- Fixed bug #30828 (debug_backtrace() reports incorrect class in overridden
methods). (Dmitry)
- Fixed bug #30820 (static member conflict with $this->member silently
ignored). (Dmitry)
- Fixed bug #30819 (Better support for LDAP SASL bind). (Jani)
- Fixed bug #30791 (magic methods (__sleep/__wakeup/__toString) call __call if
object is overloaded). (Dmitry)
- Fixed bug #30707 (Segmentation fault on exception in method). (Stas, Dmitry)
- Fixed bug #30702 (cannot initialize class variable from class constant).
(Dmitry)
- Fixed bug #30519 (Interface not existing says Class not found). (Dmitry)
- Fixed bug #30394 (Assignment operators yield wrong result with __get/__set).
(Dmitry)
- Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with
array_push()). (Dmitry)
- Fixed bug #30162 (Catching exception in constructor causes lose of $this).
(Dmitry)
- Fixed bug #30140 (Problem with array in static properties). (Dmitry)
- Fixed bug #30126 (Enhancement for error message for abstract classes).
(Marcus)
- Fixed bug #30080 (Passing array or non array of objects). (Dmitry)
- Fixed bug #29975 (memory leaks when set_error_handler() is used inside error
handler). (Tony)
- Fixed bug #29971 (variables_order behaviour). (Dmitry)
- Fixed bug #29944 (Function defined in switch, crashes). (Dmitry)
- Fixed bug #29896 (Backtrace argument list out of sync). (Dmitry)
- Fixed bug #29683 (headers_list() returns empty array). (Tony)
- Fixed bug #29583 (crash when echoing a COM object). (M.Sisolak, Wez)
- Fixed bug #29338 (unencoded spaces get ignored after certain tags). (Ilia)
- Fixed bug #29210 (Function: is_callable - no support for private and
protected classes). (Dmitry)
- Fixed bug #29104 (Function declaration in method doesn't work). (Dmitry)
- Fixed bug #29015 (Incorrect behavior of member vars(non string ones)-numeric
mem vars und others). (Dmitry)
- Fixed bug #28839 (SIGSEGV in interactive mode (php -a)).
(kameshj at fastmail dot fm)
- Fixed bug #28605 (Need to use -[m]ieee option for Alpha CPUs). (Jani)
- Fixed bug #28377 (debug_backtrace is intermittently passing args). (Dmitry)
- Fixed bug #27598 (list() array key assignment causes HUGE memory leak).
(Dmitry)
- Fixed bug #26456 (Wrong results from Reflection-API getDocComment() when
called via STDIN). (Dmitry)
- Fixed bug #25922 (In error handler, modifying 5th arg (errcontext) may result
in seg fault). (Dmitry)
- Fixed bug #22836 (returning reference to uninitialized variable). (Dmitry)
- Fixed bug #29689 (default value of protected member overrides default value of private)
and other private variable problems in inherited classes (Stas)
- Fixed bug #29253 (array_diff with $GLOBALS argument fails). (Dmitry)
- Abstract private methods are no longer allowed (Stas)
31 Mar 2005, PHP 5.0.4
- Added SNMPv2 support. (harrie)
- Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony)
@@ -13,6 +233,7 @@ PHP NEWS
to 3.7.0. (Moriyoshi)
- Updated bundled libmbfl library (used for multibyte functions). (Moriyoshi)
Fixed bugs:
. Bug #32311 (mb_encode_mimeheader() does not properly escape characters)
. Bug #32063 (mb_convert_encoding ignores named entity 'alpha')
. Bug #31911 (mb_decode_mimeheader() is case-sensitive to hex escapes)
. bug #30573 (compiler warnings in libmbfl due to invalid type cast)
@@ -52,7 +273,6 @@ PHP NEWS
- Fixed bug #32001 (xml_parse_into_struct() function exceeds maximum
execution time). (Rob, Moriyoshi)
- Fixed bug #31980 (Unicode exif data not available on Windows). (Edin)
- Fixed bug #31792 (getrusage() does not provide ru_nswap value). (Ilia)
- Fixed bug #31960 (msql_fetch_row() and msql_fetch_array() dropping columns
with NULL values). (Daniel Convissor)
- Fixed bug #31878 (Segmentation fault using clone keyword on nodes). (Rob)
@@ -64,6 +284,7 @@ PHP NEWS
- Fixed bug #31797 (exif_read_data() uses too low nesting limit). (Ilia)
- Fixed bug #31796 (readline completion handler does not handle empty return
values). (Ilia)
- Fixed bug #31792 (getrusage() does not provide ru_nswap value). (Ilia)
- Fixed bug #31755 (Cannot create SOAP header in no namespace). (Dmitry)
- Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick)
- Fixed bug #31751 (pg_parameter_status() missing on Windows). (Edin)
@@ -92,7 +313,6 @@ PHP NEWS
translation). (Ilia)
- Fixed bug #31480 (Possible infinite loop in imap_mail_compose()). (Ilia)
- Fixed bug #31479 (Fixed crash in chunk_split(), when chunklen > strlen). (Ilia)
- Fixed bug #31465 (False warning in unpack() when working with *). (Ilia)
- Fixed bug #31454 (session_set_save_handler crashes PHP when supplied
non-existent object ref). (Tony)
- Fixed bug #31444 (Memory leak in zend_language_scanner.c).
-18
View File
@@ -535,12 +535,6 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
#ifdef TSRM_WIN32
DeleteCriticalSection(mutexp);
free(mutexp);
#elif defined(NETWARE)
#ifdef USE_MPK
kMutexFree(mutexp);
#else
NXMutexFree(mutexp);
#endif
#elif defined(GNUPTH)
free(mutexp);
#elif defined(PTHREADS)
@@ -570,12 +564,6 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
#ifdef TSRM_WIN32
EnterCriticalSection(mutexp);
return 1;
#elif defined(NETWARE)
#ifdef USE_MPK
return kMutexLock(mutexp);
#else
return NXLock(mutexp);
#endif
#elif defined(GNUPTH)
return pth_mutex_acquire(mutexp, 0, NULL);
#elif defined(PTHREADS)
@@ -601,12 +589,6 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
#ifdef TSRM_WIN32
LeaveCriticalSection(mutexp);
return 1;
#elif defined(NETWARE)
#ifdef USE_MPK
return kMutexUnlock(mutexp);
#else
return NXUnlock(mutexp);
#endif
#elif defined(GNUPTH)
return pth_mutex_release(mutexp);
#elif defined(PTHREADS)
+1 -1
View File
@@ -87,7 +87,7 @@ int main() {
], [
dnl For cross compiling running this test is of no use. NetWare supports pthreads
pthreads_working=no
case $target_alias in
case $host_alias in
*netware*)
pthreads_working=yes
esac
+27 -32
View File
@@ -42,8 +42,7 @@
#endif
#ifdef NETWARE
/*#include "pipe.h"*/
#include "tsrm_nw.h"
#include <fsio.h>
#endif
#ifndef HAVE_REALPATH
@@ -142,15 +141,9 @@ static int php_check_dots(const char *element, int n)
static int php_is_dir_ok(const cwd_state *state)
{
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
struct stat buf;
if (stat(state->cwd, &buf) == 0 && S_ISDIR(buf.st_mode))
#else
struct stat_libc buf;
if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISDIR(buf.st_mode))
#endif
return (0);
return (1);
@@ -158,15 +151,9 @@ static int php_is_dir_ok(const cwd_state *state)
static int php_is_file_ok(const cwd_state *state)
{
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
struct stat buf;
if (stat(state->cwd, &buf) == 0 && S_ISREG(buf.st_mode))
#else
struct stat_libc buf;
if (stat(state->cwd, (struct stat*)(&buf)) == 0 && S_ISREG(buf.st_mode))
#endif
return (0);
return (1);
@@ -202,7 +189,20 @@ CWD_API void virtual_cwd_startup(void)
char cwd[MAXPATHLEN];
char *result;
#ifdef NETWARE
result = getcwdpath(cwd, NULL, 1);
if(result)
{
char *c=cwd;
while(c = strchr(c, '\\'))
{
*c='/';
++c;
}
}
#else
result = getcwd(cwd, sizeof(cwd));
#endif
if (!result) {
cwd[0] = '\0';
}
@@ -445,8 +445,19 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#elif defined(NETWARE)
/* If the token is a volume name, it will have colon at the end -- so, no slash before it */
if (ptr[ptr_length-1] != ':') {
/*
Below code keeps appending to state->cwd a File system seperator
cases where this appending should not happen is given below,
a) sys: should just be left as it is
b) sys:system should just be left as it is,
Colon is allowed only in the first token as volume names alone can have the : in their names.
Files and Directories cannot have : in their names
So the check goes like this,
For second token and above simply append the DEFAULT_SLASH to the state->cwd.
For first token check for the existence of :
if it exists don't append the DEFAULT_SLASH to the state->cwd.
*/
if(((state->cwd_length == 0) && (strchr(ptr, ':') == NULL)) || (state->cwd_length > 0)) {
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#else
@@ -716,7 +727,6 @@ CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC)
return retval;
}
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
{
cwd_state new_state;
@@ -730,21 +740,6 @@ CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC)
CWD_STATE_FREE(&new_state);
return retval;
}
#else
CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC)
{
cwd_state new_state;
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
virtual_file_ex(&new_state, path, NULL, 1);
retval = stat(new_state.cwd, (struct stat*)buf);
CWD_STATE_FREE(&new_state);
return retval;
}
#endif
#ifndef TSRM_WIN32
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC)
+1 -7
View File
@@ -74,10 +74,8 @@ typedef unsigned short mode_t;
#define DEFAULT_DIR_SEPARATOR ';'
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
#define IS_SLASH_P(c) IS_SLASH(*(c))
#define COPY_WHEN_ABSOLUTE(path) \
(strchr(path, ':') - path + 1) /* Take the volume name which ends with a colon */
#define IS_ABSOLUTE_PATH(path, len) \
(strchr(path, ':') != NULL) /* Colon indicates volume name */
((strchr(path, ':') != NULL) || ((len >= 1) && ((path[0] == '/') || (path[0] == '\\'))))
#else
#ifdef HAVE_DIRENT_H
@@ -141,11 +139,7 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC);
CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...);
CWD_API int virtual_creat(const char *path, mode_t mode TSRMLS_DC);
CWD_API int virtual_rename(char *oldname, char *newname TSRMLS_DC);
#if !(defined(NETWARE) && defined(CLIB_STAT_PATCH))
CWD_API int virtual_stat(const char *path, struct stat *buf TSRMLS_DC);
#else
CWD_API int virtual_stat(const char *path, struct stat_libc *buf TSRMLS_DC);
#endif
#if !defined(TSRM_WIN32) && !defined(NETWARE)
CWD_API int virtual_lstat(const char *path, struct stat *buf TSRMLS_DC);
#endif
+18
View File
@@ -136,6 +136,15 @@ AC_ARG_ENABLE(debug,
AC_DEFUN([LIBZEND_OTHER_CHECKS],[
AC_ARG_ENABLE(zend-memory-manager,
[ --disable-zend-memory-manager
Disable the Zend memory manager - FOR DEVELOPERS ONLY!!],
[
ZEND_USE_ZEND_ALLOC=$enableval
], [
ZEND_USE_ZEND_ALLOC=yes
])
AC_ARG_ENABLE(maintainer-zts,
[ --enable-maintainer-zts Enable thread safety - for code maintainers only],[
ZEND_MAINTAINER_ZTS=$enableval
@@ -165,6 +174,9 @@ AC_ARG_ENABLE(zend-multibyte,
ZEND_MULTIBYTE=no
])
AC_MSG_CHECKING(whether to enable the Zend memory manager)
AC_MSG_RESULT($ZEND_USE_ZEND_ALLOC)
AC_MSG_CHECKING(whether to enable thread-safety)
AC_MSG_RESULT($ZEND_MAINTAINER_ZTS)
@@ -195,6 +207,12 @@ fi
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
if test "$ZEND_USE_ZEND_ALLOC" = "yes"; then
AC_DEFINE(USE_ZEND_ALLOC,1,[Use Zend memory manager])
else
AC_DEFINE(USE_ZEND_ALLOC,0,[Use Zend memory manager])
fi
if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
AC_DEFINE(ZTS,1,[ ])
CFLAGS="$CFLAGS -DZTS"
+7
View File
@@ -98,6 +98,13 @@ int zend_sprintf(char *buffer, const char *format, ...);
#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
#ifdef NETWARE
#ifdef USE_WINSOCK
#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
#endif
#endif
/*
* Local variables:
* tab-width: 4
+1 -1
View File
@@ -39,5 +39,5 @@ echo "Done\n";
2
3
Done
test::destructor
test::__destruct
test::destructor
-8
View File
@@ -64,11 +64,3 @@ string(3) "foo"
Notice: Undefined variable: a in %s on line %d
Strict Standards: Only variable references should be returned by reference in %s on line %d
string(3) "foo"
'foo'
Notice: Undefined variable: a in %s on line %d
Strict Standards: Only variable references should be returned by reference in %s on line %d
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #27268 (Bad references accentuated by clone)
--FILE--
<?php
class A
{
public function &getA()
{
return $this->a;
}
}
$A = new A;
$A->a = array(1);
$x = $A->getA();
$clone = clone $A;
$clone->a = array();
print_r($A);
?>
--EXPECT--
A Object
(
[a] => Array
(
[0] => 1
)
)
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #27304
--FILE--
<?php
class Staticexample
{
static function test()
{
var_dump(isset($this));
}
}
$b = new Staticexample();
Staticexample::test();
$b->test();
?>
===DONE===
--EXPECT--
bool(false)
bool(false)
===DONE===
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #27598 (list() array key assignment causes HUGE memory leak)
--FILE--
<?php
list($out[0]) = array(1);
var_dump($out);
?>
--EXPECT--
array(1) {
[0]=>
int(1)
}
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #28377 (debug_backtrace is intermittently passing args)
--FILE--
<?php
function doit($a, $b)
{
$trace = debug_backtrace();
custom_callback('dereferenced', $trace);
custom_callback('direct', debug_backtrace());
}
function custom_callback($traceName, $btInfo)
{
echo $traceName ." -- args: ";
echo isset($btInfo[0]['args']) ? count($btInfo[0]['args']) : 'does not exist';
echo "\n";
}
doit('a','b');
?>
--EXPECT--
dereferenced -- args: 2
direct -- args: 2
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #29015 (Incorrect behavior of member vars(non string ones)-numeric mem vars und others)
--FILE--
<?php
$a = new stdClass();
$x = "";
$a->$x = "string('')";
var_dump($a);
?>
--EXPECTF--
Fatal error: Cannot access empty property in %sbug29015.php on line 4
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #29104 Function declaration in method doesn't work
--FILE--
<?php
class A
{
function g()
{
echo "function g - begin\n";
function f()
{
echo "function f\n";
}
echo "function g - end\n";
}
}
$a = new A;
$a->g();
f();
?>
--EXPECT--
function g - begin
function g - end
function f
+104
View File
@@ -0,0 +1,104 @@
--TEST--
Bug #29210 Function: is_callable - no support for private and protected classes
--FILE--
<?php
class test_class {
private function test_func1() {
echo "test_func1\n";
}
protected function test_func2() {
echo "test_func2\n";
}
static private function test_func3() {
echo "test_func3\n";
}
static protected function test_func4() {
echo "test_func4\n";
}
function test() {
if (is_callable(array($this,'test_func1'))) {
$this->test_func1();
} else {
echo "test_func1 isn't callable from inside\n";
}
if (is_callable(array($this,'test_func2'))) {
$this->test_func2();
} else {
echo "test_func2 isn't callable from inside\n";
}
if (is_callable(array('test_class','test_func3'))) {
test_class::test_func3();
} else {
echo "test_func3 isn't callable from inside\n";
}
if (is_callable(array('test_class','test_func4'))) {
test_class::test_func4();
} else {
echo "test_func4 isn't callable from inside\n";
}
}
}
class foo extends test_class {
function test() {
if (is_callable(array($this,'test_func1'))) {
$this->test_func1();
} else {
echo "test_func1 isn't callable from child\n";
}
if (is_callable(array($this,'test_func2'))) {
$this->test_func2();
} else {
echo "test_func2 isn't callable from child\n";
}
if (is_callable(array('test_class','test_func3'))) {
test_class::test_func3();
} else {
echo "test_func3 isn't callable from child\n";
}
if (is_callable(array('test_class','test_func4'))) {
test_class::test_func4();
} else {
echo "test_func4 isn't callable from child\n";
}
}
}
$object = new test_class;
$object->test();
if (is_callable(array($object,'test_func1'))) {
$object->test_func1();
} else {
echo "test_func1 isn't callable from outside\n";
}
if (is_callable(array($object,'test_func2'))) {
$object->test_func2();
} else {
echo "test_func2 isn't callable from outside\n";
}
if (is_callable(array('test_class','test_func3'))) {
test_class::test_func3();
} else {
echo "test_func3 isn't callable from outside\n";
}
if (is_callable(array('test_class','test_func4'))) {
test_class::test_func4();
} else {
echo "test_func4 isn't callable from outside\n";
}
$object = new foo();
$object->test();
?>
--EXPECT--
test_func1
test_func2
test_func3
test_func4
test_func1 isn't callable from outside
test_func2 isn't callable from outside
test_func3 isn't callable from outside
test_func4 isn't callable from outside
test_func1 isn't callable from child
test_func2
test_func3 isn't callable from child
test_func4
+62
View File
@@ -0,0 +1,62 @@
--TEST--
Bug #29689 (default value of protected member overrides default value of private)
--FILE--
<?php
class foo {
private $foo = 'foo';
private $foo2 = 'foo2';
function printFoo()
{
echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n";
}
}
class bar extends foo {
protected $foo = 'bar';
function printFoo()
{
parent::printFoo();
echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n";
}
}
class baz extends bar {
protected $foo = 'baz';
protected $foo2 = 'baz2';
}
class bar2 extends foo {
function printFoo()
{
parent::printFoo();
echo __CLASS__, ': ', $this->foo, " ", $this->foo2, "\n";
}
}
class baz2 extends bar2 {
protected $foo = 'baz2';
protected $foo2 = 'baz22';
}
$bar = new bar;
$bar->printFoo();
echo "---baz--\n";
$baz = new baz();
$baz->printFoo();
echo "---baz2--\n";
$baz = new baz2();
$baz->printFoo();
?>
--EXPECTF--
foo: foo foo2
bar: bar
Notice: Undefined property: bar::$foo2 in %s on line %d
---baz--
foo: foo foo2
bar: baz baz2
---baz2--
foo: foo foo2
bar2: baz2 baz22
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #29890 (crash if error handler fails)
--FILE--
<?php
function customErrorHandler($fErrNo,$fErrStr,$fErrFile,$fErrLine,&$fClass) {
echo "error :".$fErrStr."\n";
}
set_time_limit(5);
error_reporting(E_ALL);
set_error_handler("customErrorHandler");
define("TEST",2);
//should return a notice that the constant is already defined
define("TEST",3);
?>
--EXPECT--
error :Constant TEST already defined
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #29896 (Backtrace argument list out of sync)
--FILE--
<?php
function userErrorHandler($num, $msg, $file, $line, $vars)
{
debug_print_backtrace();
}
$OldErrorHandler = set_error_handler("userErrorHandler");
function GenerateError1($A1)
{
$a = $b;
}
function GenerateError2($A1)
{
GenerateError1("Test1");
}
GenerateError2("Test2");
?>
--EXPECTF--
#0 userErrorHandler(8, Undefined variable: b, %sbug29896.php, 11, Array ([A1] => Test1)) called at [%sbug29896.php:11]
#1 GenerateError1(Test1) called at [%sbug29896.php:16]
#2 GenerateError2(Test2) called at [%sbug29896.php:19]
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #29944 (Function defined in switch, crashes)
--FILE--
<?php
$a = 1;
switch ($a) {
case 1:
function foo($a) {
return "ok\n";
}
echo foo($a);
}
?>
--EXPECT--
ok
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #30080 (Passing array or non array of objects)
--FILE--
<?php
class foo {
function foo($arrayobj) {
var_dump($arrayobj);
}
}
new foo(array(new stdClass));
?>
--EXPECT--
array(1) {
[0]=>
object(stdClass)#2 (0) {
}
}
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #30140 (Problem with array in static properties)
--FILE--
<?php
class A {
public static $test1 = true;
public static $test2 = array();
public static $test3 = "str";
}
class B extends A {
}
A::$test1 = "x";
A::$test2 = "y";
A::$test3 = "z";
var_dump(A::$test1);
var_dump(A::$test2);
var_dump(A::$test3);
var_dump(B::$test1);
var_dump(B::$test2);
var_dump(B::$test3);
?>
--EXPECT--
string(1) "x"
string(1) "y"
string(1) "z"
string(1) "x"
string(1) "y"
string(1) "z"
+52
View File
@@ -0,0 +1,52 @@
--TEST--
Bug #30162 (Catching exception in constructor couses lose of $this)
--FILE--
<?php
class FIIFO {
public function __construct() {
$this->x = "x";
throw new Exception;
}
}
class hariCow extends FIIFO {
public function __construct() {
try {
parent::__construct();
} catch(Exception $e) {
}
$this->y = "y";
try {
$this->z = new FIIFO;
} catch(Exception $e) {
}
}
public function __toString() {
return "Rusticus in asino sedet.";
}
}
try {
$db = new FIIFO();
} catch(Exception $e) {
}
var_dump($db);
$db = new hariCow;
var_dump($db);
?>
--EXPECTF--
Notice: Undefined variable: db in %sbug30162.php on line 35
NULL
object(hariCow)#1 (2) {
["x"]=>
string(1) "x"
["y"]=>
string(1) "y"
}
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with array_push())
--INI--
zend.ze1_compatibility_mode=on
error_reporting=4095
--FILE--
<?php
class x { };
$first = new x;
$second = $first;
$container = array();
array_push($container, $first);
$first->first = " im in the first";
print_r($first);
print_r($second);
print_r($container);
?>
--EXPECTF--
Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 4
Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 5
Strict Standards: Implicit cloning object of class 'x' because of 'zend.ze1_compatibility_mode' in %sbug30332.php on line 7
x Object
(
[first] => im in the first
)
x Object
(
)
Array
(
[0] => x Object
(
)
)
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #30394 (Assignment operators yield wrong result with __get/__set)
--FILE--
<?php
class Container
{
public function __get( $what )
{
return $this->_p[ $what ];
}
public function __set( $what, $value )
{
$this->_p[ $what ] = $value;
}
private $_p = array();
}
$c = new Container();
$c->a = 1;
$c->a += 1;
print $c->a; // --> 2
print " - ";
$c->a += max( 0, 1 );
print $c->a; // --> 4 (!)
?>
--EXPECT--
2 - 3
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #30451 (static properties permissions broken)
--FILE--
<?php
class A {
protected static $property = TRUE;
protected static function method() {
return TRUE;
}
}
class B extends A {
public function __construct() {
var_dump(self::method());
var_dump(parent::method());
var_dump(self::$property);
var_dump(parent::$property);
}
}
new B;
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
bool(true)
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #30519 Interface not existing says Class not found
--FILE--
<?php
class test implements a {
}
?>
--EXPECTF--
Fatal error: Interface 'a' not found in %sbug30519.php on line 2
+39
View File
@@ -0,0 +1,39 @@
--TEST--
Bug #30702 cannot initialize class variable from class constant
--FILE--
<?php
class foo {
const C1=1;
}
class bar extends foo {
const C2=2;
public $c1=bar::C1;
public $c2=bar::C2;
public $c3=self::C1;
public $c4=self::C2;
public $c5=foo::C1;
public $c6=parent::C1;
}
$x= new bar();
var_dump($x);
?>
--EXPECT--
object(bar)#1 (6) {
["c1"]=>
int(1)
["c2"]=>
int(2)
["c3"]=>
int(1)
["c4"]=>
int(2)
["c5"]=>
int(1)
["c6"]=>
int(1)
}
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Bug #30707 (Segmentation fault on exception in method)
--FILE--
<?php
class C {
function byePHP($plop) {
echo "ok\n";
}
function plip() {
try {
$this->plap($this->plop());
} catch(Exception $e) {
}
}
function plap($a) {
}
function plop() {
throw new Exception;
}
}
$x = new C;
$x->byePHP($x->plip());
?>
--EXPECT--
ok
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #30791 magic methods (__sleep/__wakeup/__toString) call __call if object is overloaded
--FILE--
<?php
class a {
public $a = 4;
function __call($a,$b) {
return "unknown method";
}
}
$b = new a;
echo $b,"\n";
$c = unserialize(serialize($b));
echo $c,"\n";
var_dump($c);
?>
--EXPECT--
Object id #1
Object id #2
object(a)#2 (1) {
["a"]=>
int(4)
}
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #30820 (static member conflict with $this->member silently ignored)
--INI--
error_reporting=4095
--FILE--
<?php
class Blah {
private static $x;
public function show() {
Blah::$x = 1;
$this->x = 5; // no warning, but refers to different variable
echo 'Blah::$x = '. Blah::$x ."\n";
echo '$this->x = '. $this->x ."\n";
}
}
$b = new Blah();
$b->show();
?>
--EXPECTF--
Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 7
Blah::$x = 1
Strict Standards: Accessing static property Blah::$x as non static in %sbug30820.php on line 10
$this->x = 5
+61
View File
@@ -0,0 +1,61 @@
--TEST--
Bug #30828 (debug_backtrace() reports incorrect class in overridden methods)
--FILE--
<?php
class A {
function __construct() {
debug_print_backtrace();
$bt = debug_backtrace();
foreach ($bt as $t) {
print $t['class'].$t['type'].$t['function']."\n";
}
}
function foo() {
debug_print_backtrace();
$bt = debug_backtrace();
foreach ($bt as $t) {
print $t['class'].$t['type'].$t['function']."\n";
}
}
static function bar() {
debug_print_backtrace();
$bt = debug_backtrace();
foreach ($bt as $t) {
print $t['class'].$t['type'].$t['function']."\n";
}
}
}
class B extends A {
function __construct() {
parent::__construct();
}
function foo() {
parent::foo();
}
static function bar() {
parent::bar();
}
}
$b = new B();
$b->foo();
B::bar();
?>
--EXPECTF--
#0 A->__construct() called at [%sbug30828.php:30]
#1 B->__construct() called at [%sbug30828.php:42]
A->__construct
B->__construct
#0 A->foo() called at [%sbug30828.php:34]
#1 B->foo() called at [%sbug30828.php:43]
A->foo
B->foo
#0 A::bar() called at [%sbug30828.php:38]
#1 B::bar() called at [%sbug30828.php:44]
A::bar
B::bar
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #30889 Conflict between __get/__set and ++ operator
--FILE--
<?php
class overloaded
{
private $values;
function __construct()
{
$this->values = array('a' => 0);
}
function __set($name, $value)
{
print "set $name = $value ($name was ".$this->values[$name].")\n";
$this->values[$name] = $value;
}
function __get($name)
{
print "get $name (returns ".$this->values[$name].")\n";
return $this->values[$name];
}
}
$test = new overloaded();
$test->a++; // __get(), then __set()
++$test->a;
?>
--EXPECT--
get a (returns 0)
set a = 1 (a was 0)
get a (returns 1)
set a = 2 (a was 1)
+44
View File
@@ -0,0 +1,44 @@
--TEST--
Bug #31177 (Memory leak)
--FILE--
<?php
class DbGow {
public function query() {
throw new Exception;
}
public function select() {
return new DbGowRecordSet($this->query());
}
public function select2() {
new DbGowRecordSet($this->query());
}
}
class DbGowRecordSet {
public function __construct($resource) {
}
}
$db = new DbGow;
try {
$rs = $db->select();
} catch(Exception $e) {
echo "ok\n";
}
try {
$db->select2();
} catch(Exception $e) {
echo "ok\n";
}
?>
--EXPECT--
ok
ok
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #31525 (object reference being dropped. $this getting lost)
--INI--
error_reporting=4095
--FILE--
<?php
class Foo {
function getThis() {
return $this;
}
function destroyThis() {
$baz =& $this->getThis();
}
}
$bar = new Foo();
$bar->destroyThis();
var_dump($bar);
?>
--EXPECTF--
Strict Standards: Only variables should be assigned by reference in %sbug31525.php on line 7
object(Foo)#1 (0) {
}
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #31828 (Crash with zend.ze1_compatibility_mode=On)
--INI--
zend.ze1_compatibility_mode=on
error_reporting=4095
--FILE--
<?php
$o = new stdClass();
$o->id = 77;
$o->name = "Aerospace";
$a[] = $o;
$a = $a[0];
print_r($a);
?>
--EXPECTF--
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 2
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 5
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug31828.php on line 6
stdClass Object
(
[id] => 77
[name] => Aerospace
)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #32080 (segfault when assigning object to itself with zend.ze1_compatibility_mode=On)
--INI--
zend.ze1_compatibility_mode=on
error_reporting=4095
--FILE--
<?php
class test { }
$t = new test;
$t = $t; // gives segfault
var_dump($t);
?>
--EXPECTF--
Strict Standards: Implicit cloning object of class 'test' because of 'zend.ze1_compatibility_mode' in %sbug32080.php on line 3
Strict Standards: Implicit cloning object of class 'test' because of 'zend.ze1_compatibility_mode' in %sbug32080.php on line 5
object(test)#%d (0) {
}
+47
View File
@@ -0,0 +1,47 @@
--TEST--
Bug #32252 (Segfault when offsetSet throws an Exception (only without debug))
--FILE--
<?php
class Test implements ArrayAccess
{
function offsetExists($offset)
{
echo __METHOD__ . "($offset)\n";
return false;
}
function offsetGet($offset)
{
echo __METHOD__ . "($offset)\n";
return null;
}
function offsetSet($offset, $value)
{
echo __METHOD__ . "($offset, $value)\n";
throw new Exception("Ooops");
}
function offsetUnset($offset)
{
echo __METHOD__ . "($offset)\n";
}
}
$list = new Test();
try
{
$list[-1] = 123;
}
catch (Exception $e)
{
echo "CAUGHT\n";
}
?>
===DONE===
--EXPECT--
Test::offsetSet(-1, 123)
CAUGHT
===DONE===
+60
View File
@@ -0,0 +1,60 @@
--TEST--
Bug #32296 get_class_methods output has changed between 5.0.2 and 5.0.3
--FILE--
<?php
abstract class space{
function __construct(){}
abstract protected function unfold();
}
abstract class shape extends space{
private function x1() {}
protected final function unfold(){}
}
abstract class quad extends shape{
private function x2() {}
function buggy(){
$c = get_class($this);
$a = get_class_methods(get_class($this));
$b = get_class_methods($this);
print($c."\n".'a:');
print_r($a);
print('b:');
print_r($b);
}
}
class square extends quad{}
$a = new square();
$a->buggy();
print_r(get_class_methods("square"));
print_r(get_class_methods($a));
?>
--EXPECT--
square
a:Array
(
[0] => x2
[1] => buggy
[2] => unfold
[3] => __construct
)
b:Array
(
[0] => x2
[1] => buggy
[2] => unfold
[3] => __construct
)
Array
(
[0] => buggy
[1] => __construct
)
Array
(
[0] => buggy
[1] => __construct
)
+80
View File
@@ -0,0 +1,80 @@
--TEST--
Bug #32322 (Return values by reference broken( using self::),example singleton instance)
--INI--
error_reporting=4095
--FILE--
<?php
class test
{
private static $instance = null;
private $myname = '';
private function __construct( $value = '' )
{
echo "New class $value created \n";
$this -> myname = $value;
}
private function __clone() {}
static public function getInstance()
{
if ( self::$instance == null )
{
self::$instance = new test('Singleton1');
}
else {
echo "Using old class " . self::$instance -> myname . "\n";
}
return self::$instance;
}
static public function getInstance2()
{
static $instance2 = null;
if ( $instance2 == null )
{
$instance2 = new test('Singleton2');
}
else {
echo "Using old class " . $instance2 -> myname . "\n";
}
return $instance2;
}
public function __destruct()
{
if ( defined('SCRIPT_END') )
{
echo "Class " . $this -> myname . " destroyed at script end\n";
} else {
echo "Class " . $this -> myname . " destroyed beforce script end\n";
}
}
}
echo "Try static instance inside class :\n";
$getCopyofSingleton = test::getInstance();
$getCopyofSingleton = null;
$getCopyofSingleton = &test::getInstance();
$getCopyofSingleton = null;
$getCopyofSingleton = test::getInstance();
echo "Try static instance inside function :\n";
$getCopyofSingleton2 = test::getInstance2();
$getCopyofSingleton2 = null;
$getCopyofSingleton2 = &test::getInstance2();
$getCopyofSingleton2 = null;
$getCopyofSingleton2 = test::getInstance2();
define('SCRIPT_END',1);
?>
--EXPECTF--
Try static instance inside class :
New class Singleton1 created
Using old class Singleton1
Strict Standards: Only variables should be assigned by reference in %sbug32322.php on line 49
Using old class Singleton1
Try static instance inside function :
New class Singleton2 created
Using old class Singleton2
Strict Standards: Only variables should be assigned by reference in %sbug32322.php on line 55
Using old class Singleton2
Class Singleton1 destroyed at script end
Class Singleton2 destroyed at script end
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct)
--FILE--
<?php
class BUG {
public $error = "please fix this thing, it wasted a nice part of my life!\n";
static function instance() {return new BUG();}
function __destruct()
{
$c=get_class($this); unset($c);
echo get_class($this) ."\n";
if(defined('DEBUG_'.__CLASS__)){}
$c=get_class($this); //memory leak only
echo $this->error;
}
}
BUG::instance()->error;
echo "this is still executed\n";
?>
--EXPECT--
BUG
please fix this thing, it wasted a nice part of my life!
this is still executed
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #32660 Assignment by reference causes crash when field access is overloaded (__get)
--FILE--
<?php
class A
{
public $q;
function __construct()
{
$this->q = 3;//array();
}
function __get($name)
{
return $this->q;
}
}
$a = new A;
$b = "short";
$c =& $a->whatever;
$c = "long";
print_r($a);
$a->whatever =& $b;
$b = "much longer";
print_r($a);
?>
--EXPECTF--
A Object
(
[q] => long
)
Fatal error: Cannot assign by reference to overloaded object in %sbug32660.php on line 23
+62
View File
@@ -0,0 +1,62 @@
--TEST--
Bug #32674 exception in iterator causes crash
--FILE--
<?php
class collection implements Iterator {
private $_elements = array();
public function __construct() {
}
public function rewind() {
reset($this->_elements);
}
public function count() {
return count($this->_elements);
}
public function current() {
$element = current($this->_elements);
return $element;
}
public function next() {
$element = next($this->_elements);
return $element;
}
public function key() {
$this->_fillCollection();
$element = key($this->_elements);
return $element;
}
public function valid() {
throw new Exception('shit happend');
return ($this->current() !== false);
}
}
class class2 {
public $dummy;
}
$obj = new class2();
$col = new collection();
try {
foreach($col as $co) {
//irrelevant
}
echo 'shouldn`t get here';
//$dummy = 'this will not crash';
$obj->dummy = 'this will crash';
} catch (Exception $e) {
echo "ok\n";
}
?>
--EXPECT--
ok
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #32799 (crash: calling the corresponding global var during the destruct)
--FILE--
<?php
class test{
public $c=1;
function __destruct (){
$GLOBALS['p']->c++; // no warning
print $GLOBALS['p']->c."\n"; // segfault
var_dump($GLOBALS['p']);
}
}
$p=new test;
$p=null; //destroy the object by a new assignment (segfault)
?>
--EXPECT--
2
object(test)#1 (1) {
["c"]=>
int(2)
}
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Bug #32852 (Crash with singleton and __destruct when zend.ze1_compatibility_mode = On)
--INI--
zend.ze1_compatibility_mode=on
error_reporting=4095
--FILE--
<?php
class crashme {
private static $instance = null;
public function __construct() {
self::$instance = $this;
}
public function __destruct() {
echo "i'm called\n";
}
public static function singleton() {
if (!isset(self::$instance)) {
self::$instance = new crashme();
}
return self::$instance;
}
}
crashme::singleton();
?>
--EXPECTF--
Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 6
i'm called
Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 15
i'm called
Strict Standards: Implicit cloning object of class 'crashme' because of 'zend.ze1_compatibility_mode' in %sbug32852.php on line 17
i'm called
i'm called
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Bug #32993 (implemented Iterator function current() don't throw exception)
--FILE--
<?php
class Test implements Iterator {
public $arr = array();
public function rewind() { return reset($this->arr); }
public function current() { throw new Exception(); }
public function key() { return key($this->arr); }
public function next() { return next($this->arr); }
public function valid() { return (current($this->arr) !== false); }
}
$t = new Test();
$t->arr = array(1, 2, 3);
try {
foreach ($t as $v) {
echo "$v\n";
}
} catch (Exception $e) {
; // handle exception
}
echo "ok\n";
?>
--EXPECT--
ok
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #33116 (crash when assigning class name to global variable in __autoload)
--FILE--
<?php
function __autoload($class)
{
$GLOBALS['include'][] = $class;
eval("class DefClass{}");
}
$a = new DefClass;
print_r($a);
print_r($GLOBALS['include']);
?>
--EXPECT--
DefClass Object
(
)
Array
(
[0] => DefClass
)
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #33171 (foreach enumerates private fields declared in base classes)
--FILE--
<?php
class A
{
private $c = "A's c";
}
class B extends A
{
private $c = "B's c";
public function go()
{
foreach ($this as $key => $val)
{
echo "$key => $val\n";
}
}
};
$x = new B;
$x->go();
?>
--EXPECT--
c => B's c
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #33243 (ze1_compatibility_mode does not work as expected)
--INI--
zend.ze1_compatibility_mode=1
error_reporting=4095
--FILE--
<?php
$a->y->z = 0;
$b = $a; // should perform deep copy of $a
$b->y->z = 1; // hence this should have no effect on $a
var_dump($a);
?>
--EXPECTF--
Strict Standards: Creating default object from empty value in %sbug33243.php on line 2
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug33243.php on line 3
Strict Standards: Implicit cloning object of class 'stdClass' because of 'zend.ze1_compatibility_mode' in %sbug33243.php on line 5
object(stdClass)#%d (1) {
["y"]=>
object(stdClass)#%d (1) {
["z"]=>
int(0)
}
}
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #33257 array_splice() inconsistent when passed function instead of variable
--FILE--
<?php
class X {
protected static $arr = array("a", "b", "c");
public static function getArr() {
return self::$arr;
}
}
//$arr1 = X::getArr();
array_splice(X::getArr(), 1, 1);
print_r(X::getArr());
?>
--EXPECTF--
Fatal error: Only variables can be passed by reference in %sbug33257.php on line 10
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #33277 (private method accessed by child class)
--FILE--
<?
class foo {
private function bar() {
echo "private!\n";
}
}
class fooson extends foo {
function barson() {
$this->bar();
}
}
class foo2son extends fooson {
function bar() {
echo "public!\n";
}
}
$b = new foo2son();
$b->barson();
?>
--EXPECT--
public!
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #33558 (warning with nested calls to functions returning by reference)
--INI--
error_reporting=4095
--FILE--
<?php
function & foo() {
$var = 'ok';
return $var;
}
function & bar() {
return foo();
}
$a =& bar();
echo "$a\n";
?>
--EXPECT--
ok
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #33802 (throw Exception in error handler causes crash)
--FILE--
<?php
set_error_handler('errorHandler', E_USER_ERROR);
try{
test();
}catch(Exception $e){
}
restore_error_handler();
function test(){
trigger_error("error", E_USER_ERROR);
}
function errorHandler($errno, $errstr, $errfile, $errline) {
throw new Exception();
}
?>
ok
--EXPECT--
ok
+35
View File
@@ -0,0 +1,35 @@
--TEST--
Bug #34064 (arr[] as param to function in class gives invalid opcode)
--FILE--
<?php
class XmlTest {
function test_ref(&$test)
{
$test = "ok";
}
function test($test)
{
}
function run()
{
$ar = array();
$this->test_ref($ar[]);
var_dump($ar);
$this->test($ar[]);
}
}
$o = new XmlTest();
$o->run();
?>
--EXPECTF--
array(1) {
[0]=>
string(2) "ok"
}
Fatal error: Cannot use [] for reading in %sbug34064.php on line 18
+171
View File
@@ -0,0 +1,171 @@
--TEST--
Magic object handlers segfault and memory errors
--FILE--
<?php
function f($x) {
return $x;
}
class foo implements ArrayAccess {
function __get($property) {
$GLOBALS["y"] = $property;
}
function __set($property, $value) {
$GLOBALS["y"] = $property;
}
function __call($func, $args) {
$GLOBALS["y"] = $func;
}
function offsetGet($index) {
$GLOBALS["y"] = $index;
}
function offsetSet($index, $newval) {
$GLOBALS["y"] = $index;
}
function offsetExists($index) {
$GLOBALS["y"] = $index;
}
function offsetUnset($index) {
$GLOBALS["y"] = $index;
}
}
$x = new foo();
$y = null;
// IS_CONST
$z = $x->const_get;
echo $y,"\n";
$x->const_set = 1;
echo $y,"\n";
$x->const_call();
echo $y,"\n";
$z = $x["const_dim_get"];
echo $y,"\n";
$x["const_dim_set"] = 1;
echo $y,"\n";
isset($x["const_dim_isset"]);
echo $y,"\n";
unset($x["const_dim_unset"]);
echo $y,"\n";
// IS_CONST + conversion
$z = $x->{1};
echo $y,"\n";
$x->{2} = 1;
echo $y,"\n";
// IS_TMP_VAR
$c = "tmp";
$z = $x->{$c."_get"};
echo $y,"\n";
$x->{$c."_set"} = 1;
echo $y,"\n";
$x->{$c."_call"}();
echo $y,"\n";
$z = $x[$c."_dim_get"];
echo $y,"\n";
$x[$c."_dim_set"] = 1;
echo $y,"\n";
isset($x[$c."_dim_isset"]);
echo $y,"\n";
unset($x[$c."_dim_unset"]);
echo $y,"\n";
// IS_TMP_VAR + conversion
$c = 0;
$z = $x->{$c+3};
echo $y,"\n";
$x->{$c+4} = 1;
echo $y,"\n";
// IS_CV
$c = "cv_get";
$z = $x->{$c};
echo $y,"\n";
$c = "cv_set";
$x->{$c} = 1;
echo $y,"\n";
$c = "cv_call";
$x->{$c}();
echo $y,"\n";
$c = "cv_dim_get";
$z = $x[$c];
echo $y,"\n";
$c = "cv_dim_set";
$x[$c] = 1;
echo $y,"\n";
$c = "cv_dim_isset";
isset($x[$c]);
echo $y,"\n";
$c = "cv_dim_unset";
unset($x[$c]);
echo $y,"\n";
// IS_CV + conversion
$c = 5;
$z = $x->{$c};
echo $y,"\n";
$c = 6;
$x->{$c} = 1;
echo $y,"\n";
// IS_VAR
$z = $x->{f("var_get")};
echo $y,"\n";
$x->{f("var_set")} = 1;
echo $y,"\n";
$x->{f("var_call")}();
echo $y,"\n";
$z = $x[f("var_dim_get")];
echo $y,"\n";
$x[f("var_dim_set")] = 1;
echo $y,"\n";
isset($x[f("var_dim_isset")]);
echo $y,"\n";
unset($x[f("var_dim_unset")]);
echo $y,"\n";
// IS_VAR + conversion
$z = $x->{f(7)};
echo $y,"\n";
$x->{f(8)} = 1;
echo $y,"\n";
?>
--EXPECT--
const_get
const_set
const_call
const_dim_get
const_dim_set
const_dim_isset
const_dim_unset
1
2
tmp_get
tmp_set
tmp_call
tmp_dim_get
tmp_dim_set
tmp_dim_isset
tmp_dim_unset
3
4
cv_get
cv_set
cv_call
cv_dim_get
cv_dim_set
cv_dim_isset
cv_dim_unset
5
6
var_get
var_set
var_call
var_dim_get
var_dim_set
var_dim_isset
var_dim_unset
7
8
+15 -20
View File
@@ -803,6 +803,13 @@ void zend_deactivate_modules(TSRMLS_D)
} zend_end_try();
}
void zend_call_destructors(TSRMLS_D)
{
zend_try {
shutdown_destructors(TSRMLS_C);
} zend_end_try();
}
void zend_deactivate(TSRMLS_D)
{
/* we're no longer executing anything */
@@ -820,6 +827,8 @@ void zend_deactivate(TSRMLS_D)
shutdown_compiler(TSRMLS_C);
} zend_end_try();
zend_destroy_rsrc_list(&EG(regular_list) TSRMLS_CC);
zend_try {
zend_ini_deactivate(TSRMLS_C);
} zend_end_try();
@@ -872,8 +881,6 @@ ZEND_API void zend_error(int type, const char *format, ...)
char *error_filename;
uint error_lineno;
zval *orig_user_error_handler;
zval *orig_garbage[2];
int orig_garbage_ptr;
TSRMLS_FETCH();
/* Obtain relevant filename and lineno */
@@ -962,7 +969,7 @@ ZEND_API void zend_error(int type, const char *format, ...)
z_context->value.ht = EG(active_symbol_table);
z_context->type = IS_ARRAY;
ZVAL_ADDREF(z_context); /* we don't want this one to be freed */
zval_copy_ctor(z_context);
params = (zval ***) emalloc(sizeof(zval **)*5);
params[0] = &z_error_type;
@@ -974,12 +981,6 @@ ZEND_API void zend_error(int type, const char *format, ...)
orig_user_error_handler = EG(user_error_handler);
EG(user_error_handler) = NULL;
orig_garbage_ptr = EG(garbage_ptr);
EG(garbage_ptr) = 0;
if (orig_garbage_ptr > 0) {
memcpy(&orig_garbage, &EG(garbage), sizeof(zval*)*orig_garbage_ptr);
}
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) {
@@ -992,24 +993,18 @@ ZEND_API void zend_error(int type, const char *format, ...)
zend_error_cb(type, error_filename, error_lineno, format, args);
}
if (orig_garbage_ptr > 0) {
while (EG(garbage_ptr)) {
zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]);
}
EG(garbage_ptr) = orig_garbage_ptr;
memcpy(&EG(garbage), &orig_garbage, sizeof(zval*)*orig_garbage_ptr);
if (!EG(user_error_handler)) {
EG(user_error_handler) = orig_user_error_handler;
} else {
zval_ptr_dtor(&orig_user_error_handler);
}
EG(user_error_handler) = orig_user_error_handler;
efree(params);
zval_ptr_dtor(&z_error_message);
zval_ptr_dtor(&z_error_type);
zval_ptr_dtor(&z_error_filename);
zval_ptr_dtor(&z_error_lineno);
if (ZVAL_REFCOUNT(z_context) == 2) {
FREE_ZVAL(z_context);
}
zval_ptr_dtor(&z_context);
break;
}
+2 -1
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "2.0.4-dev"
#define ZEND_VERSION "2.0.5"
#define ZEND_ENGINE_2
@@ -452,6 +452,7 @@ END_EXTERN_C()
void zend_activate(TSRMLS_D);
void zend_deactivate(TSRMLS_D);
void zend_call_destructors(TSRMLS_D);
void zend_activate_modules(TSRMLS_D);
void zend_deactivate_modules(TSRMLS_D);
void zend_post_deactivate_modules(TSRMLS_D);
+95 -19
View File
@@ -152,7 +152,29 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr
}
while (param_count-->0) {
*(argument_array++) = (zval **) p-(arg_count--);
zval **value = (zval**)(p-arg_count);
if (EG(ze1_compatibility_mode) && Z_TYPE_PP(value) == IS_OBJECT) {
zval *value_ptr;
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(*value, &class_name, &class_name_len TSRMLS_CC);
ALLOC_ZVAL(value_ptr);
*value_ptr = **value;
INIT_PZVAL(value_ptr);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
if(!dup) {
efree(class_name);
}
value_ptr->value.obj = Z_OBJ_HANDLER_PP(value, clone_obj)(*value TSRMLS_CC);
zval_ptr_dtor(value);
*value = value_ptr;
}
*(argument_array++) = value;
arg_count--;
}
return SUCCESS;
@@ -161,7 +183,10 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr
ZEND_API void zend_wrong_param_count(TSRMLS_D)
{
zend_error(E_WARNING, "Wrong parameter count for %s()", get_active_function_name(TSRMLS_C));
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name(TSRMLS_C));
}
@@ -209,6 +234,20 @@ ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC)
}
}
/* returns 1 if you need to copy result, 0 if it's already a copy */
ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC)
{
if (Z_OBJ_HT_P(object)->get_class_name == NULL ||
Z_OBJ_HT_P(object)->get_class_name(object, class_name, class_name_len, 0 TSRMLS_CC) != SUCCESS) {
zend_class_entry *ce = Z_OBJCE_P(object);
*class_name = ce->name;
*class_name_len = ce->name_length;
return 1;
}
return 0;
}
static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec TSRMLS_DC)
{
@@ -452,8 +491,10 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
expected_type = zend_parse_arg_impl(arg, va, spec TSRMLS_CC);
if (expected_type) {
if (!quiet) {
zend_error(E_WARNING, "%s() expects parameter %d to be %s, %s given",
get_active_function_name(TSRMLS_C), arg_num, expected_type,
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s() expects parameter %d to be %s, %s given",
class_name, space, get_active_function_name(TSRMLS_C), arg_num, expected_type,
zend_zval_type_name(*arg));
}
return FAILURE;
@@ -690,8 +731,13 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC)
{
if (!class_type->constants_updated) {
zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry);
zend_class_entry *old_scope = *scope;
*scope = class_type;
zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
*scope = old_scope;
class_type->constants_updated = 1;
}
}
@@ -1305,7 +1351,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
if (ptr->flags) {
if (!(ptr->flags & ZEND_ACC_PPP_MASK)) {
zend_error(error_type, "Invalid access level for %s%s%s() - access must be exactly one of public, protected or private", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
internal_function->fn_flags |= ZEND_ACC_PUBLIC;
internal_function->fn_flags = ZEND_ACC_PUBLIC;
} else {
internal_function->fn_flags = ptr->flags;
}
@@ -1712,7 +1758,7 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_
return 1;
}
ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name)
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name)
{
char *lcname;
zend_bool retval = 0;
@@ -1723,7 +1769,7 @@ ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char
if (callable_name) {
*callable_name = estrndup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
}
if (syntax_only) {
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) {
return 1;
}
@@ -1760,7 +1806,7 @@ ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char
memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1);
}
if (syntax_only)
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY)
return 1;
lcname = zend_str_tolower_dup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
@@ -1789,14 +1835,27 @@ ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char
memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1);
}
if (syntax_only)
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY)
return 1;
}
if (ce) {
zend_function *fbc;
lcname = zend_str_tolower_dup(Z_STRVAL_PP(method), Z_STRLEN_PP(method));
if (zend_hash_exists(&ce->function_table, lcname, Z_STRLEN_PP(method)+1)) {
if (zend_hash_find(&ce->function_table, lcname, Z_STRLEN_PP(method)+1, (void **)&fbc) == SUCCESS) {
retval = 1;
if ((check_flags & IS_CALLABLE_CHECK_NO_ACCESS) == 0) {
if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) {
if (!zend_check_private(fbc, (Z_TYPE_PP(obj) == IS_STRING)?EG(scope):(*obj)->value.obj.handlers->get_class_entry(*obj TSRMLS_CC), lcname, Z_STRLEN_PP(method) TSRMLS_CC)) {
retval = 0;
}
} else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) {
if (!zend_check_protected(fbc->common.scope, EG(scope))) {
retval = 0;
}
}
}
}
/* check for __call too */
if (retval == 0 && ce->__call != 0) {
@@ -1828,8 +1887,10 @@ ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char
ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC)
{
char *lcname, *func;
char *lcname, *func, *class_name;
zend_bool retval = 0;
zend_class_entry **pce;
int class_name_len;
if (zend_is_callable(callable, 0, callable_name)) {
return 1;
@@ -1839,12 +1900,18 @@ ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRML
lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
if ((func = strstr(lcname, "::")) != NULL) {
zval_dtor(callable);
array_init(callable);
add_next_index_stringl(callable, lcname, func - lcname, 1);
func += 2;
add_next_index_stringl(callable, func, strlen(func), 1);
retval = 1;
*func = '\0';
class_name_len = func - lcname;
class_name = estrndup(Z_STRVAL_P(callable), class_name_len);
if (zend_lookup_class(class_name, class_name_len, &pce TSRMLS_CC) == SUCCESS) {
zval_dtor(callable);
array_init(callable);
add_next_index_stringl(callable, lcname, class_name_len, 1);
func += 2;
add_next_index_stringl(callable, func, strlen(func), 1);
retval = 1;
}
efree(class_name);
}
efree(lcname);
break;
@@ -1984,7 +2051,12 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->write_property) {
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", Z_OBJCE_P(object)->name, name);
char *class_name;
zend_uint class_name_len;
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, class_name);
}
ZVAL_STRINGL(&property, name, name_length, 0);
Z_OBJ_HT_P(object)->write_property(object, &property, value TSRMLS_CC);
@@ -2033,7 +2105,11 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->read_property) {
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be read", Z_OBJCE_P(object)->name, name);
char *class_name;
zend_uint class_name_len;
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
zend_error(E_CORE_ERROR, "Property %s of class %s cannot be read", name, class_name);
}
ZVAL_STRINGL(&property, name, name_length, 0);
value = Z_OBJ_HT_P(object)->read_property(object, &property, silent TSRMLS_CC);
+6 -1
View File
@@ -179,7 +179,11 @@ ZEND_API int zend_disable_function(char *function_name, uint function_name_lengt
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
ZEND_API void zend_wrong_param_count(TSRMLS_D);
ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name);
#define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0)
#define IS_CALLABLE_CHECK_NO_ACCESS (1<<1)
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name);
ZEND_API zend_bool zend_make_callable(zval *callable, char **callable_name TSRMLS_DC);
ZEND_API char *zend_get_module_version(char *module_name);
ZEND_API int zend_get_module_started(char *module_name);
@@ -197,6 +201,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object,
ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *name, int name_length, zend_bool silent TSRMLS_DC);
ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC);
ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uint *class_name_len TSRMLS_DC);
#define getThis() (this_ptr)
+2 -2
View File
@@ -75,7 +75,8 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
if (AG(memory_limit)<AG(allocated_memory)) {\
int php_mem_limit = AG(memory_limit); \
if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory) - rs) { \
AG(allocated_memory) -= rs; \
if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory)) { \
AG(memory_limit) = AG(allocated_memory) + 1048576; \
if (file) { \
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", php_mem_limit, file, lineno, s); \
@@ -388,7 +389,6 @@ ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
return p;
}
ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
char *p;
+6 -12
View File
@@ -85,8 +85,6 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
#define USE_ZEND_ALLOC 1
#if USE_ZEND_ALLOC
/* Standard wrapper macros */
@@ -124,15 +122,12 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
#define perealloc_recoverable_rel(ptr, size, persistent) ((persistent)?realloc((ptr), (size)):erealloc_recoverable_rel((ptr), (size)))
#define pestrdup_rel(s, persistent) ((persistent)?strdup(s):estrdup_rel(s))
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string))
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):(empty_string))
#else
#define _GNU_SOURCE
#include <string.h>
#undef _GNU_SOURCE
/* Standard wrapper macros */
#define emalloc(size) malloc(size)
#define safe_emalloc(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
@@ -141,7 +136,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
#define erealloc(ptr, size) realloc((ptr), (size))
#define erealloc_recoverable(ptr, size) realloc((ptr), (size))
#define estrdup(s) strdup(s)
#define estrndup(s, length) strndup((s), (length))
#define estrndup(s, length) zend_strndup((s), (length))
/* Relay wrapper macros */
#define emalloc_rel(size) malloc(size)
@@ -151,7 +146,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
#define erealloc_rel(ptr, size) realloc((ptr), (size))
#define erealloc_recoverable_rel(ptr, size) realloc((ptr), (size))
#define estrdup_rel(s) strdup(s)
#define estrndup_rel(s, length) strndup((s), (length))
#define estrndup_rel(s, length) zend_strndup((s), (length))
/* Selective persistent/non persistent allocation macros */
#define pemalloc(size, persistent) malloc(size)
@@ -167,11 +162,10 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
#define perealloc_rel(ptr, size, persistent) realloc((ptr), (size))
#define perealloc_recoverable_rel(ptr, size, persistent) realloc((ptr), (size))
#define pestrdup_rel(s, persistent) strdup(s)
#endif /* !USE_ZEND_ALLOC */
#define safe_estrdup(ptr) ((ptr)?(strdup(ptr)):(empty_string))
#define safe_estrndup(ptr, len) ((ptr)?(strndup((ptr), (len))):(empty_string))
#endif
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string))
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):(empty_string))
ZEND_API int zend_set_memory_limit(unsigned int memory_limit);
+113 -43
View File
@@ -523,6 +523,7 @@ ZEND_FUNCTION(get_class)
zval **arg;
char *name = "";
zend_uint name_len = 0;
int dup;
if (!ZEND_NUM_ARGS()) {
if (EG(scope)) {
@@ -538,19 +539,9 @@ ZEND_FUNCTION(get_class)
RETURN_FALSE;
}
if (Z_OBJ_HT_PP(arg)->get_class_name == NULL ||
Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_len, 0 TSRMLS_CC) != SUCCESS) {
zend_class_entry *ce;
dup = zend_get_object_classname(*arg, &name, &name_len TSRMLS_CC);
ce = zend_get_class_entry(*arg TSRMLS_CC);
if (!ce) {
RETURN_FALSE;
}
RETURN_STRINGL(ce->name, ce->name_length, 1);
}
RETURN_STRINGL(name, name_len, 0);
RETURN_STRINGL(name, name_len, dup);
}
/* }}} */
@@ -802,7 +793,6 @@ ZEND_FUNCTION(get_class_methods)
zend_class_entry *ce = NULL, **pce;
HashPosition pos;
zend_function *mptr;
int instanceof;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -824,14 +814,16 @@ ZEND_FUNCTION(get_class_methods)
RETURN_NULL();
}
instanceof = EG(scope) && instanceof_function(EG(scope), ce TSRMLS_CC);
array_init(return_value);
zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos);
while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) {
if ((mptr->common.fn_flags & ZEND_ACC_PUBLIC)
|| (instanceof && ((mptr->common.fn_flags & ZEND_ACC_PROTECTED) || EG(scope) == mptr->common.scope))) {
|| (EG(scope) &&
(((mptr->common.fn_flags & ZEND_ACC_PROTECTED) &&
instanceof_function(EG(scope), mptr->common.scope TSRMLS_CC))
|| ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) &&
EG(scope) == mptr->common.scope)))) {
MAKE_STD_ZVAL(method_name);
ZVAL_STRING(method_name, mptr->common.function_name, 1);
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
@@ -1528,6 +1520,12 @@ static zval *debug_backtrace_get_args(void ***curpos TSRMLS_DC)
(*arg)->refcount++;
add_next_index_zval(arg_array, *arg);
}
/* skip args from incomplete frames */
while ((((*curpos)-1) > EG(argument_stack).elements) && *((*curpos)-1)) {
(*curpos)--;
}
return arg_array;
}
@@ -1550,7 +1548,7 @@ void debug_print_backtrace_args(zval *arg_array TSRMLS_DC)
/* {{{ proto void debug_print_backtrace(void) */
ZEND_FUNCTION(debug_print_backtrace)
{
zend_execute_data *ptr;
zend_execute_data *ptr, *skip;
int lineno;
char *function_name;
char *filename;
@@ -1575,6 +1573,11 @@ ZEND_FUNCTION(debug_print_backtrace)
args -= *(ulong*)args;
frames_on_stack++;
/* skip args from incomplete frames */
while (((args-1) > EG(argument_stack).elements) && *(args-1)) {
args--;
}
if ((args-1) == EG(argument_stack).elements) {
arg_stack_consistent = 1;
break;
@@ -1588,14 +1591,35 @@ ZEND_FUNCTION(debug_print_backtrace)
cur_arg_pos -= 2;
frames_on_stack--;
if (arg_stack_consistent) {
/* skip args from incomplete frames */
while (((cur_arg_pos-1) > EG(argument_stack).elements) && *(cur_arg_pos-1)) {
cur_arg_pos--;
}
}
array_init(return_value);
while (ptr) {
class_name = call_type = NULL;
char *free_class_name = NULL;
class_name = call_type = NULL;
arg_array = NULL;
if (ptr->op_array) {
filename = ptr->op_array->filename;
lineno = ptr->opline->lineno;
skip = ptr;
/* skip internal handler */
if (!skip->op_array &&
skip->prev_execute_data &&
skip->prev_execute_data->opline &&
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL &&
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL_BY_NAME &&
skip->prev_execute_data->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
skip = skip->prev_execute_data;
}
if (skip->op_array) {
filename = skip->op_array->filename;
lineno = skip->opline->lineno;
} else {
filename = NULL;
lineno = 0;
@@ -1605,7 +1629,18 @@ ZEND_FUNCTION(debug_print_backtrace)
if (function_name) {
if (ptr->object) {
class_name = Z_OBJCE(*ptr->object)->name;
if (ptr->function_state.function->common.scope) {
class_name = ptr->function_state.function->common.scope->name;
} else {
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
if(!dup) {
free_class_name = class_name;
}
}
call_type = "->";
} else if (ptr->function_state.function->common.scope) {
class_name = ptr->function_state.function->common.scope->name;
@@ -1624,6 +1659,11 @@ ZEND_FUNCTION(debug_print_backtrace)
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
zend_bool build_filename_arg = 1;
if (!ptr->opline || ptr->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
/* can happen when calling eval from a custom sapi */
function_name = "unknown";
build_filename_arg = 0;
} else
switch (ptr->opline->op2.u.constant.value.lval) {
case ZEND_EVAL:
function_name = "eval";
@@ -1668,8 +1708,11 @@ ZEND_FUNCTION(debug_print_backtrace)
}
zend_printf(") called at [%s:%d]\n", filename, lineno);
include_filename = filename;
ptr = ptr->prev_execute_data;
ptr = skip->prev_execute_data;
++indent;
if (free_class_name) {
efree(free_class_name);
}
}
}
@@ -1677,12 +1720,11 @@ ZEND_FUNCTION(debug_print_backtrace)
ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRMLS_DC)
{
zend_execute_data *ptr;
zend_execute_data *ptr, *skip;
int lineno;
char *function_name;
char *filename;
char *class_name;
char *call_type;
char *include_filename = NULL;
zval *stack_frame;
void **cur_arg_pos = EG(argument_stack).top_element;
@@ -1697,6 +1739,11 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
args -= *(ulong*)args;
frames_on_stack++;
/* skip args from incomplete frames */
while (((args-1) > EG(argument_stack).elements) && *(args-1)) {
args--;
}
if ((args-1) == EG(argument_stack).elements) {
arg_stack_consistent = 1;
break;
@@ -1705,12 +1752,24 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
ptr = EG(current_execute_data);
/* skip "new Exception()" */
if ((skip_last == 0) && ptr->opline && (ptr->opline->opcode == ZEND_NEW)) {
ptr = ptr->prev_execute_data;
}
/* skip debug_backtrace() */
if (skip_last--) {
int arg_count = *((ulong*)(cur_arg_pos - 2));
cur_arg_pos -= (arg_count + 2);
frames_on_stack--;
ptr = ptr->prev_execute_data;
if (arg_stack_consistent) {
/* skip args from incomplete frames */
while (((cur_arg_pos-1) > EG(argument_stack).elements) && *(cur_arg_pos-1)) {
cur_arg_pos--;
}
}
}
array_init(return_value);
@@ -1719,9 +1778,20 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
MAKE_STD_ZVAL(stack_frame);
array_init(stack_frame);
if (ptr->op_array) {
filename = ptr->op_array->filename;
lineno = ptr->opline->lineno;
skip = ptr;
/* skip internal handler */
if (!skip->op_array &&
skip->prev_execute_data &&
skip->prev_execute_data->opline &&
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL &&
skip->prev_execute_data->opline->opcode != ZEND_DO_FCALL_BY_NAME &&
skip->prev_execute_data->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
skip = skip->prev_execute_data;
}
if (skip->op_array) {
filename = skip->op_array->filename;
lineno = skip->opline->lineno;
add_assoc_string_ex(stack_frame, "file", sizeof("file"), filename, 1);
add_assoc_long_ex(stack_frame, "line", sizeof("line"), lineno);
@@ -1738,19 +1808,20 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
add_assoc_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
if (ptr->object && Z_TYPE_P(ptr->object) == IS_OBJECT) {
class_name = Z_OBJCE(*ptr->object)->name;
call_type = "->";
if (ptr->function_state.function->common.scope) {
add_assoc_string_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
} else {
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, dup);
}
add_assoc_string_ex(stack_frame, "type", sizeof("type"), "->", 1);
} else if (ptr->function_state.function->common.scope) {
class_name = ptr->function_state.function->common.scope->name;
call_type = "::";
} else {
class_name = NULL;
call_type = NULL;
}
if (class_name) {
add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, 1);
add_assoc_string_ex(stack_frame, "type", sizeof("type"), call_type, 1);
add_assoc_string_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
add_assoc_string_ex(stack_frame, "type", sizeof("type"), "::", 1);
}
if ((! ptr->opline) || ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL))) {
@@ -1763,7 +1834,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
/* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */
zend_bool build_filename_arg = 1;
if (!ptr->opline) {
if (!ptr->opline || ptr->opline->opcode != ZEND_INCLUDE_OR_EVAL) {
/* can happen when calling eval from a custom sapi */
function_name = "unknown";
build_filename_arg = 0;
@@ -1814,7 +1885,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
include_filename = filename;
ptr = ptr->prev_execute_data;
ptr = skip->prev_execute_data;
}
}
/* }}} */
@@ -1893,7 +1964,6 @@ ZEND_FUNCTION(get_extension_funcs)
}
/* }}} */
/*
* Local variables:
* tab-width: 4
+137 -64
View File
@@ -418,6 +418,9 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
}
if (modifiers->u.constant.value.lval & ZEND_ACC_ABSTRACT) {
if(modifiers->u.constant.value.lval & ZEND_ACC_PRIVATE) {
zend_error(E_COMPILE_ERROR, "%s function %s::%s() cannot be declared private", method_type, CG(active_class_entry)->name, function_name->u.constant.value.str.val);
}
if (body->u.constant.value.lval == ZEND_ACC_ABSTRACT) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -483,6 +486,12 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
}
}
static inline zend_bool zend_is_function_or_method_call(znode *variable)
{
zend_uint type = variable->u.EA.type;
return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));
}
void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
{
@@ -494,6 +503,11 @@ void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
if (opline_is_fetch_this(last_op TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
}
if (zend_is_function_or_method_call(rvar)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
if (result) {
opline->result.op_type = IS_VAR;
opline->result.u.EA.type = 0;
@@ -717,13 +731,6 @@ void zend_check_writable_variable(znode *variable)
}
}
static inline zend_bool zend_is_function_or_method_call(znode *variable)
{
zend_uint type = variable->u.EA.type;
return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));
}
void zend_do_begin_variable_parse(TSRMLS_D)
{
zend_llist fetch_list;
@@ -738,51 +745,53 @@ void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC)
zend_llist *fetch_list_ptr;
zend_llist_element *le;
zend_op *opline, *opline_ptr=NULL;
int num_of_created_opcodes = 0;
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
le = fetch_list_ptr->head;
while (le) {
if (le) {
opline_ptr = (zend_op *)le->data;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
memcpy(opline, opline_ptr, sizeof(zend_op));
switch (type) {
case BP_VAR_R:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode -= 3;
break;
case BP_VAR_W:
break;
case BP_VAR_RW:
opline->opcode += 3;
break;
case BP_VAR_IS:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode += 6; /* 3+3 */
break;
case BP_VAR_FUNC_ARG:
opline->opcode += 9; /* 3+3+3 */
opline->extended_value = arg_offset;
break;
case BP_VAR_UNSET:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting");
}
opline->opcode += 12; /* 3+3+3+3 */
break;
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
CG(active_op_array)->uses_this = 1;
}
le = le->next;
num_of_created_opcodes++;
}
if (num_of_created_opcodes == 1 && opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
CG(active_op_array)->uses_this = 1;
while (1) {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
memcpy(opline, opline_ptr, sizeof(zend_op));
switch (type) {
case BP_VAR_R:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode -= 3;
break;
case BP_VAR_W:
break;
case BP_VAR_RW:
opline->opcode += 3;
break;
case BP_VAR_IS:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode += 6; /* 3+3 */
break;
case BP_VAR_FUNC_ARG:
opline->opcode += 9; /* 3+3+3 */
opline->extended_value = arg_offset;
break;
case BP_VAR_UNSET:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for unsetting");
}
opline->opcode += 12; /* 3+3+3+3 */
break;
}
le = le->next;
if (le == NULL) break;
opline_ptr = (zend_op *)le->data;
}
}
zend_llist_destroy(fetch_list_ptr);
@@ -894,7 +903,8 @@ void zend_do_free(znode *op1 TSRMLS_DC)
* Find JMP_NO_CTOR, mark the preceding ASSIGN and the
* proceeding INIT_FCALL_BY_NAME as unused
*/
if (opline->opcode == ZEND_JMP_NO_CTOR) {
if (opline->opcode == ZEND_JMP_NO_CTOR &&
opline->op1.u.var == op1->u.var) {
opline->op1.u.EA.type |= EXT_TYPE_UNUSED;
(opline-1)->result.u.EA.type |= EXT_TYPE_UNUSED;
(opline+1)->op1.u.EA.type |= EXT_TYPE_UNUSED;
@@ -965,7 +975,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
op_array.fn_flags = fn_flags;
op_array.pass_rest_by_reference = 0;
op_array.scope = CG(active_class_entry);
op_array.scope = is_method?CG(active_class_entry):NULL;
op_array.prototype = NULL;
op_array.line_start = zend_get_compiled_lineno(TSRMLS_C);
@@ -1074,9 +1084,10 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
}
if (CG(doc_comment)) {
CG(active_op_array)->doc_comment = estrndup(CG(doc_comment), CG(doc_comment_len));
CG(active_op_array)->doc_comment = CG(doc_comment);
CG(active_op_array)->doc_comment_len = CG(doc_comment_len);
RESET_DOC_COMMENT();
CG(doc_comment) = NULL;
CG(doc_comment_len) = 0;
}
}
@@ -1286,6 +1297,7 @@ void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC)
opline->op2 = *class_name;
}
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->result.u.EA.type = opline->extended_value;
opline->result.op_type = IS_CONST; /* FIXME: Hack so that INIT_FCALL_BY_NAME still knows this is a class */
*result = opline->result;
}
@@ -1370,6 +1382,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
int original_op=op;
zend_function **function_ptr_ptr, *function_ptr;
int send_by_reference;
int send_function = 0;
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
function_ptr = *function_ptr_ptr;
@@ -1394,6 +1407,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
if (op == ZEND_SEND_VAR && zend_is_function_or_method_call(param)) {
/* Method call */
op = ZEND_SEND_VAR_NO_REF;
send_function = ZEND_ARG_SEND_FUNCTION;
} else if (op == ZEND_SEND_VAL && param->op_type == IS_VAR) {
op = ZEND_SEND_VAR_NO_REF;
}
@@ -1432,9 +1446,9 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
if (op == ZEND_SEND_VAR_NO_REF) {
if (function_ptr) {
opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | send_by_reference;
opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | send_by_reference | send_function;
} else {
opline->extended_value = 0;
opline->extended_value = send_function;
}
} else {
if (function_ptr) {
@@ -1455,7 +1469,7 @@ static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
zend_op *opline;
if (switch_entry->cond.op_type != IS_VAR && switch_entry->cond.op_type != IS_TMP_VAR) {
return 0;
return (switch_entry->cond.op_type == IS_UNUSED);
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -1854,9 +1868,18 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
zend_property_info *child_info;
zend_class_entry *parent_ce = ce->parent;
if (parent_info->flags & ZEND_ACC_PRIVATE) {
if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) {
if (zend_hash_quick_find(&ce->properties_info, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &child_info)==SUCCESS) {
child_info->flags |= ZEND_ACC_CHANGED;
} else {
zend_hash_quick_update(&ce->properties_info, hash_key->arKey, hash_key->nKeyLength, hash_key->h, parent_info, sizeof(zend_property_info), (void **) &child_info);
if(ce->type & ZEND_INTERNAL_CLASS) {
zend_duplicate_property_info_internal(child_info);
} else {
zend_duplicate_property_info(child_info);
}
child_info->flags &= ~ZEND_ACC_PRIVATE; /* it's not private anymore */
child_info->flags |= ZEND_ACC_SHADOW; /* but it's a shadow of private */
}
return 0; /* don't copy access information to child */
}
@@ -1868,6 +1891,11 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
(child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->arKey);
}
if(parent_info->flags & ZEND_ACC_CHANGED) {
child_info->flags |= ZEND_ACC_CHANGED;
}
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s", ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {
@@ -2167,6 +2195,19 @@ void zend_do_early_binding(TSRMLS_D)
if (do_bind_inherited_class(opline, CG(class_table), *pce, 1 TSRMLS_CC) == NULL) {
return;
}
/* clear unnecessary ZEND_FETCH_CLASS opcode */
if (opline > CG(active_op_array)->opcodes &&
(opline-1)->opcode == ZEND_FETCH_CLASS) {
zend_op *fetch_class_opline = opline-1;
zval_dtor(&fetch_class_opline->op2.u.constant);
fetch_class_opline->opcode = ZEND_NOP;
memset(&fetch_class_opline->op1, 0, sizeof(znode));
memset(&fetch_class_opline->op2, 0, sizeof(znode));
SET_UNUSED(fetch_class_opline->op1);
SET_UNUSED(fetch_class_opline->op2);
SET_UNUSED(fetch_class_opline->result);
}
} else {
/* We currently don't early-bind classes that implement interfaces */
return;
@@ -2496,10 +2537,20 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
zend_initialize_class_data(new_class_entry, 1 TSRMLS_CC);
new_class_entry->filename = zend_get_compiled_filename(TSRMLS_C);
new_class_entry->line_start = zend_get_compiled_lineno(TSRMLS_C);
new_class_entry->ce_flags |= class_token->u.constant.value.lval;
new_class_entry->line_start = class_token->u.opline_num;
new_class_entry->ce_flags |= class_token->u.EA.type;
if (parent_class_name && parent_class_name->op_type != IS_UNUSED) {
switch (parent_class_name->u.EA.type) {
case ZEND_FETCH_CLASS_SELF:
zend_error(E_COMPILE_ERROR, "Cannot use 'self' as class name as it is reserved");
break;
case ZEND_FETCH_CLASS_PARENT:
zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as class name as it is reserved");
break;
default:
break;
}
doing_inheritance = 1;
}
@@ -2529,9 +2580,10 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
CG(implementing_class) = opline->result;
if (CG(doc_comment)) {
CG(active_class_entry)->doc_comment = estrndup(CG(doc_comment), CG(doc_comment_len));
CG(active_class_entry)->doc_comment = CG(doc_comment);
CG(active_class_entry)->doc_comment_len = CG(doc_comment_len);
RESET_DOC_COMMENT();
CG(doc_comment) = NULL;
CG(doc_comment_len) = 0;
}
}
@@ -2575,7 +2627,8 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
/* Inherit interfaces */
if (ce->num_interfaces > 0) {
ce->interfaces = (zend_class_entry **) erealloc(ce->interfaces, sizeof(zend_class_entry *)*ce->num_interfaces);
ce->interfaces = (zend_class_entry **) emalloc(sizeof(zend_class_entry *)*ce->num_interfaces);
memset(ce->interfaces, 0, sizeof(zend_class_entry *)*ce->num_interfaces);
}
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
@@ -2590,8 +2643,26 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
void zend_do_implements_interface(znode *interface_znode TSRMLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
zend_op *opline;
switch (interface_znode->u.EA.type) {
case ZEND_FETCH_CLASS_SELF:
zend_error(E_COMPILE_ERROR, "Cannot use 'self' as interface name as it is reserved");
break;
case ZEND_FETCH_CLASS_PARENT:
zend_error(E_COMPILE_ERROR, "Cannot use 'parent' as interface name as it is reserved");
break;
default:
if (CG(active_op_array)->last > 0) {
opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
if (opline->opcode == ZEND_FETCH_CLASS) {
opline->extended_value = ZEND_FETCH_CLASS_INTERFACE;
}
}
break;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_INTERFACE;
opline->op1 = CG(implementing_class);
opline->op2 = *interface_znode;
@@ -2958,9 +3029,16 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
zend_symtable_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
zval_dtor(&offset->u.constant);
break;
case IS_NULL:
zend_symtable_update(result->u.constant.value.ht, "", 1, &element, sizeof(zval *), NULL);
break;
case IS_LONG:
case IS_BOOL:
zend_hash_index_update(result->u.constant.value.ht, offset->u.constant.value.lval, &element, sizeof(zval *), NULL);
break;
case IS_DOUBLE:
zend_hash_index_update(result->u.constant.value.ht, (long)offset->u.constant.value.dval, &element, sizeof(zval *), NULL);
break;
}
} else {
zend_hash_next_index_insert(result->u.constant.value.ht, &element, sizeof(zval *), NULL);
@@ -3013,7 +3091,6 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
zend_llist_element *dimension;
zend_op *opline;
znode last_container;
int opcode_index;
int last_op_number;
zend_op *last_op;
@@ -3055,14 +3132,10 @@ void zend_do_list_end(znode *result, znode *expr TSRMLS_DC)
((list_llist_element *) le->data)->value = last_container;
zend_llist_destroy(&((list_llist_element *) le->data)->dimensions);
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
opcode_index = - 1;
last_op_number = get_next_op_number(CG(active_op_array))-1;
last_op = &CG(active_op_array)->opcodes[last_op_number];
if (last_op->opcode == ZEND_FETCH_OBJ_W) {
opcode_index = - 2;
}
zend_do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value TSRMLS_CC);
CG(active_op_array)->opcodes[CG(active_op_array)->last + opcode_index].result.u.EA.type |= EXT_TYPE_UNUSED;
zend_do_free(result TSRMLS_CC);
le = le->next;
}
zend_llist_destroy(&CG(dimension_llist));
+12 -4
View File
@@ -41,10 +41,13 @@
#define DEC_BPC(op_array) if (CG(interactive)) { ((op_array)->backpatch_count--); }
#define HANDLE_INTERACTIVE() if (CG(interactive)) { execute_new_code(TSRMLS_C); }
#define RESET_DOC_COMMENT() \
{ \
CG(doc_comment) = NULL; \
CG(doc_comment_len) = 0; \
#define RESET_DOC_COMMENT() \
{ \
if (CG(doc_comment)) { \
efree(CG(doc_comment)); \
CG(doc_comment) = NULL; \
} \
CG(doc_comment_len) = 0; \
}
typedef struct _zend_op_array zend_op_array;
@@ -131,6 +134,9 @@ typedef struct _zend_try_catch_element {
/* method flag (bc only), any method that has this flag can be used statically and non statically. */
#define ZEND_ACC_ALLOW_STATIC 0x10000
/* shadow of parent's private method/property */
#define ZEND_ACC_SHADOW 0x20000
char *zend_visibility_string(zend_uint fn_flags);
@@ -738,6 +744,7 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_FETCH_CLASS_MAIN 3
#define ZEND_FETCH_CLASS_GLOBAL 4
#define ZEND_FETCH_CLASS_AUTO 5
#define ZEND_FETCH_CLASS_INTERFACE 6
/* variable parsing type (compile-time) */
@@ -798,6 +805,7 @@ int zendlex(znode *zendlval TSRMLS_DC);
#define ZEND_ARG_SEND_BY_REF (1<<0)
#define ZEND_ARG_COMPILE_TIME_BOUND (1<<1)
#define ZEND_ARG_SEND_FUNCTION (1<<2)
#define AI_USE_PTR(ai) \
if ((ai).ptr_ptr) { \
+1
View File
@@ -22,6 +22,7 @@
#ifndef ZEND_CONFIG_W32_H
#define ZEND_CONFIG_W32_H
#define USE_ZEND_ALLOC 1
#define HAVE_ALLOCA 1
#define HAVE_LIMITS_H 1
#define _CRTDBG_MAP_ALLOC
+11 -1
View File
@@ -298,10 +298,20 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
TRACE_APPEND_STR("Array, ");
break;
case IS_OBJECT: {
char *class_name;
zend_uint class_name_len;
int dup;
TSRMLS_FETCH();
TRACE_APPEND_STR("Object(");
TRACE_APPEND_STRL(Z_OBJCE_PP(arg)->name, strlen(Z_OBJCE_PP(arg)->name));
dup = zend_get_object_classname(*arg, &class_name, &class_name_len TSRMLS_CC);
TRACE_APPEND_STRL(class_name, class_name_len);
if(!dup) {
efree(class_name);
}
TRACE_APPEND_STR("), ");
break;
}
+259 -154
View File
@@ -54,6 +54,17 @@ static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_
#define TEMP_VAR_STACK_LIMIT 2000
#define MAKE_REAL_ZVAL_PTR(val) \
do { \
zval *_tmp; \
ALLOC_ZVAL(_tmp); \
_tmp->value = (val)->value; \
_tmp->type = (val)->type; \
_tmp->refcount = 1; \
_tmp->is_ref = 0; \
val = _tmp; \
} while (0)
/* former zend_execute_locks.h */
static inline void zend_pzval_lock_func(zval *z)
{
@@ -154,22 +165,9 @@ static inline zval **_get_zval_ptr_ptr(znode *node, temp_variable *Ts TSRMLS_DC)
static inline void zend_fetch_property_address_inner(zval *object, znode *op2, znode *result, temp_variable *Ts, int type TSRMLS_DC)
{
zval *prop_ptr = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
zval tmp;
switch (op2->op_type) {
case IS_CONST:
/* already a constant string */
break;
case IS_VAR:
tmp = *prop_ptr;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
prop_ptr = &tmp;
break;
case IS_TMP_VAR:
convert_to_string(prop_ptr);
break;
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(prop_ptr);
}
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
@@ -192,10 +190,9 @@ static inline void zend_fetch_property_address_inner(zval *object, znode *op2, z
T(result->u.var).var.ptr_ptr = &EG(error_zval_ptr);
}
if (prop_ptr == &tmp) {
zval_dtor(prop_ptr);
if (EG(free_op2)) {
zval_ptr_dtor(&prop_ptr);
}
FREE_OP(Ts, op2, EG(free_op2));
}
@@ -258,7 +255,6 @@ void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, z
value_ptr->refcount = 1;
value_ptr->is_ref = 1;
}
*variable_ptr_ptr = value_ptr;
value_ptr->refcount++;
} else if (!variable_ptr->is_ref) {
@@ -393,15 +389,27 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
/* separate our value if necessary */
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
zval *orig_value = value;
char *class_name;
zend_uint class_name_len;
int dup;
ALLOC_ZVAL(value);
*value = *orig_value;
value->is_ref = 0;
value->refcount = 0;
dup = zend_get_object_classname(orig_value, &class_name, &class_name_len TSRMLS_CC);
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(orig_value)->name);
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
}
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(orig_value)->name);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
if(!dup) {
efree(class_name);
}
value->value.obj = Z_OBJ_HANDLER_P(orig_value, clone_obj)(orig_value TSRMLS_CC);
} else if (value_op->op_type == IS_TMP_VAR) {
zval *orig_value = value;
@@ -423,40 +431,29 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
value->refcount++;
if (opcode == ZEND_ASSIGN_OBJ) {
zval tmp;
switch (op2->op_type) {
case IS_CONST:
/* already a constant string */
break;
case IS_VAR:
tmp = *property_name;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
property_name = &tmp;
break;
case IS_TMP_VAR:
convert_to_string(property_name);
break;
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(property_name);
}
Z_OBJ_HT_P(object)->write_property(object, property_name, value TSRMLS_CC);
if (property_name == &tmp) {
zval_dtor(property_name);
}
} else {
/* Note: property_name in this case is really the array index! */
if (!Z_OBJ_HT_P(object)->write_dimension) {
zend_error(E_ERROR, "Cannot use object as array");
}
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(property_name);
}
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
}
FREE_OP(Ts, op2, EG(free_op2));
if (result) {
T(result->u.var).var.ptr = value;
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */
SELECTIVE_PZVAL_LOCK(value, result);
}
if (EG(free_op2)) {
zval_ptr_dtor(&property_name);
}
zval_ptr_dtor(&value);
}
@@ -566,40 +563,60 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
}
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(value)->name);
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
} else if (PZVAL_IS_REF(variable_ptr)) {
if (variable_ptr != value) {
if (variable_ptr != value) {
zend_uint refcount = variable_ptr->refcount;
zval garbage;
if (type != IS_TMP_VAR) {
value->refcount++;
}
garbage = *variable_ptr;
*variable_ptr = *value;
variable_ptr->refcount = refcount;
variable_ptr->is_ref = 1;
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(value)->name);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
if (type != IS_TMP_VAR) {
value->refcount--;
}
zendi_zval_dtor(garbage);
}
} else {
variable_ptr->refcount--;
if (variable_ptr->refcount == 0) {
zendi_zval_dtor(*variable_ptr);
} else {
ALLOC_ZVAL(variable_ptr);
*variable_ptr_ptr = variable_ptr;
if (variable_ptr != value) {
value->refcount++;
variable_ptr->refcount--;
if (variable_ptr->refcount == 0) {
zendi_zval_dtor(*variable_ptr);
} else {
ALLOC_ZVAL(variable_ptr);
*variable_ptr_ptr = variable_ptr;
}
*variable_ptr = *value;
INIT_PZVAL(variable_ptr);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
zval_ptr_dtor(&value);
}
*variable_ptr = *value;
INIT_PZVAL(variable_ptr);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(value)->name);
variable_ptr->value.obj = Z_OBJ_HANDLER_P(value, clone_obj)(value TSRMLS_CC);
}
if(!dup) {
efree(class_name);
}
} else if (PZVAL_IS_REF(variable_ptr)) {
if (variable_ptr!=value) {
zend_uint refcount = variable_ptr->refcount;
@@ -945,7 +962,7 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
new_zval->refcount++;
if (zend_hash_next_index_insert(container->value.ht, &new_zval, sizeof(zval *), (void **) retval) == FAILURE) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
*retval = &EG(uninitialized_zval_ptr);
*retval = &EG(error_zval_ptr);
new_zval->refcount--;
}
} else {
@@ -1003,8 +1020,12 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
zend_error(E_ERROR, "Cannot use object as array");
} else {
zval *dim = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
zval *overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
zval *overloaded_result;
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(dim);
}
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
if (overloaded_result) {
switch (type) {
case BP_VAR_RW:
@@ -1021,8 +1042,10 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
*retval = &EG(error_zval_ptr);
}
AI_USE_PTR(T(result->u.var).var);
FREE_OP(Ts, op2, EG(free_op2));
SELECTIVE_PZVAL_LOCK(**retval, result);
if (EG(free_op2)) {
zval_ptr_dtor(&dim);
}
}
break;
default: {
@@ -1140,41 +1163,29 @@ static void zend_fetch_property_address_read(znode *result, znode *op1, znode *o
} else {
*retval = EG(error_zval_ptr);
}
SELECTIVE_PZVAL_LOCK(*retval, result);
} else {
zval *offset;
zval tmp;
offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
switch (op2->op_type) {
case IS_CONST:
/* already a constant string */
break;
case IS_VAR:
tmp = *offset;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
offset = &tmp;
break;
case IS_TMP_VAR:
convert_to_string(offset);
break;
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(offset);
}
/* here we are sure we are dealing with an object */
*retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC);
if (offset == &tmp) {
zval_dtor(offset);
}
FREE_OP(Ts, op2, EG(free_op2));
if (RETURN_VALUE_UNUSED(result) && ((*retval)->refcount == 0)) {
zval_dtor(*retval);
FREE_ZVAL(*retval);
return; /* no need for locking */
} else {
SELECTIVE_PZVAL_LOCK(*retval, result);
}
if (EG(free_op2)) {
zval_ptr_dtor(&offset);
}
}
SELECTIVE_PZVAL_LOCK(*retval, result);
}
static void zend_pre_incdec_property(znode *result, znode *op1, znode *op2, temp_variable * Ts, int (*incdec_op)(zval *) TSRMLS_DC)
@@ -1197,6 +1208,10 @@ static void zend_pre_incdec_property(znode *result, znode *op1, znode *op2, temp
return;
}
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(property);
}
/* here we are sure we are dealing with an object */
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
@@ -1232,7 +1247,9 @@ static void zend_pre_incdec_property(znode *result, znode *op1, znode *op2, temp
zval_ptr_dtor(&z);
}
FREE_OP(Ts, op2, EG(free_op2));
if (EG(free_op2)) {
zval_ptr_dtor(&property);
}
}
static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, temp_variable * Ts, int (*incdec_op)(zval *) TSRMLS_DC)
@@ -1253,6 +1270,10 @@ static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, tem
return;
}
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(property);
}
/* here we are sure we are dealing with an object */
if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) {
@@ -1271,6 +1292,7 @@ static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, tem
if (!have_get_ptr) {
zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC);
zval *z_copy;
if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -1283,13 +1305,22 @@ static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, tem
}
*retval = *z;
zendi_zval_copy_ctor(*retval);
incdec_op(z);
ALLOC_ZVAL(z_copy);
*z_copy = *z;
zendi_zval_copy_ctor(*z_copy);
INIT_PZVAL(z_copy);
incdec_op(z_copy);
z->refcount++;
Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
Z_OBJ_HT_P(object)->write_property(object, property, z_copy TSRMLS_CC);
zval_ptr_dtor(&z_copy);
/* this would destroy z if it was returned with refcount == 0 and undo
recount++ above otherwise */
zval_ptr_dtor(&z);
}
FREE_OP(Ts, op2, EG(free_op2));
if (EG(free_op2)) {
zval_ptr_dtor(&property);
}
}
@@ -1328,7 +1359,7 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
#define SET_OPCODE(new_op) \
CHECK_SYMBOL_TABLES() \
EX(opline) = new_op;
EX(opline) = new_op; \
#define INC_OPCODE() \
if (!EG(exception)) { \
@@ -1638,7 +1669,6 @@ static inline int zend_binary_assign_op_obj_helper(int (*binary_op)(zval *result
zval *property = get_zval_ptr(&opline->op2, EX(Ts), &EG(free_op2), BP_VAR_R);
zval *free_value;
zval *value = get_zval_ptr(&op_data->op1, EX(Ts), &free_value, BP_VAR_R);
zval tmp;
znode *result = &opline->result;
zval **retval = &EX_T(result->u.var).var.ptr;
int have_get_ptr = 0;
@@ -1657,19 +1687,8 @@ static inline int zend_binary_assign_op_obj_helper(int (*binary_op)(zval *result
SELECTIVE_PZVAL_LOCK(*retval, result);
} else {
/* here we are sure we are dealing with an object */
switch (opline->op2.op_type) {
case IS_CONST:
/* already a constant string */
break;
case IS_VAR:
tmp = *property;
zval_copy_ctor(&tmp);
convert_to_string(&tmp);
property = &tmp;
break;
case IS_TMP_VAR:
convert_to_string(property);
break;
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(property);
}
/* here property is a string */
@@ -1722,11 +1741,9 @@ static inline int zend_binary_assign_op_obj_helper(int (*binary_op)(zval *result
zval_ptr_dtor(&z);
}
if (property == &tmp) {
zval_dtor(property);
if (EG(free_op2)) {
zval_ptr_dtor(&property);
}
FREE_OP(Ts, op2, EG(free_op2));
FREE_OP(Ts, value, free_value);
}
@@ -2114,6 +2131,9 @@ int zend_fetch_dim_func_arg_handler(ZEND_OPCODE_HANDLER_ARGS)
/* Behave like FETCH_DIM_W */
zend_fetch_dimension_address(&opline->result, &opline->op1, &opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC);
} else {
if (opline->op2.op_type == IS_UNUSED) {
zend_error(E_ERROR, "Cannot use [] for reading");
}
/* Behave like FETCH_DIM_R, except for locking used for list() */
zend_fetch_dimension_address(&opline->result, &opline->op1, &opline->op2, EX(Ts), BP_VAR_R TSRMLS_CC);
AI_USE_PTR(EX_T(opline->result.u.var).var);
@@ -2246,7 +2266,7 @@ int zend_assign_dim_handler(ZEND_OPCODE_HANDLER_ARGS)
zend_fetch_dimension_address(&op_data->op2, &opline->op1, &opline->op2, EX(Ts), BP_VAR_W TSRMLS_CC);
value = get_zval_ptr(&op_data->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (EG(free_op1)?IS_TMP_VAR:opline->op1.op_type), EX(Ts) TSRMLS_CC);
zend_assign_to_variable(&opline->result, &op_data->op2, &op_data->op1, value, (EG(free_op1)?IS_TMP_VAR:op_data->op1.op_type), EX(Ts) TSRMLS_CC);
}
/* assign_dim has two opcodes! */
INC_OPCODE();
@@ -2270,6 +2290,19 @@ int zend_assign_ref_handler(ZEND_OPCODE_HANDLER_ARGS)
{
zval **value_ptr_ptr = get_zval_ptr_ptr(&opline->op2, EX(Ts), BP_VAR_W);
if (opline->op2.op_type == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
opline->extended_value == ZEND_RETURNS_FUNCTION &&
!EX_T(opline->op2.u.var).var.fcall_returned_reference) {
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
zend_error(E_STRICT, "Only variables should be assigned by reference");
return zend_assign_handler(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
if (opline->op1.op_type == IS_VAR && EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
zend_error(E_ERROR, "Cannot assign by reference to overloaded object");
}
zend_assign_to_variable_reference(&opline->result, get_zval_ptr_ptr(&opline->op1, EX(Ts), BP_VAR_W), value_ptr_ptr, EX(Ts) TSRMLS_CC);
NEXT_OPCODE();
@@ -2454,7 +2487,7 @@ int zend_fetch_class_handler(ZEND_OPCODE_HANDLER_ARGS)
if (opline->op2.op_type == IS_UNUSED) {
EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, ZEND_FETCH_CLASS_AUTO, opline->extended_value TSRMLS_CC);
EX_T(opline->result.u.var).class_entry = zend_fetch_class(NULL, 0, opline->extended_value TSRMLS_CC);
NEXT_OPCODE();
}
@@ -2465,7 +2498,7 @@ int zend_fetch_class_handler(ZEND_OPCODE_HANDLER_ARGS)
EX_T(opline->result.u.var).class_entry = Z_OBJCE_P(class_name);
break;
case IS_STRING:
EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC);
EX_T(opline->result.u.var).class_entry = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), opline->extended_value TSRMLS_CC);
break;
default:
zend_error(E_ERROR, "Class name must be a valid object or a string");
@@ -2806,9 +2839,11 @@ int zend_do_fcall_common_helper(ZEND_OPCODE_HANDLER_ARGS)
if (EG(exception) && EX(fbc) && EX(fbc)->common.fn_flags&ZEND_ACC_CTOR) {
EG(This)->refcount--;
if (EG(This)->refcount == 1) {
zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
zend_object_store_ctor_failed(EG(This) TSRMLS_CC);
}
if (should_change_scope && EG(This) != current_this) {
zval_ptr_dtor(&EG(This));
}
zval_ptr_dtor(&EG(This));
} else if (should_change_scope) {
zval_ptr_dtor(&EG(This));
}
@@ -2879,10 +2914,11 @@ int zend_return_handler(ZEND_OPCODE_HANDLER_ARGS)
}
if (!(*retval_ptr_ptr)->is_ref) {
if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr
|| (opline->extended_value == ZEND_RETURNS_FUNCTION && !EX_T(opline->op1.u.var).var.fcall_returned_reference)) {
zend_error(E_STRICT, "Only variable references should be returned by reference");
if (opline->extended_value == ZEND_RETURNS_FUNCTION &&
EX_T(opline->op1.u.var).var.fcall_returned_reference) {
} else if (EX_T(opline->op1.u.var).var.ptr_ptr == &EX_T(opline->op1.u.var).var.ptr) {
PZVAL_LOCK(*retval_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
zend_error(E_STRICT, "Only variable references should be returned by reference");
goto return_by_value;
}
}
@@ -2896,16 +2932,27 @@ return_by_value:
retval_ptr = get_zval_ptr(&opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
if (EG(ze1_compatibility_mode) && Z_TYPE_P(retval_ptr) == IS_OBJECT) {
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(retval_ptr, &class_name, &class_name_len TSRMLS_CC);
ALLOC_ZVAL(*(EG(return_value_ptr_ptr)));
**EG(return_value_ptr_ptr) = *retval_ptr;
INIT_PZVAL(*EG(return_value_ptr_ptr));
if (Z_OBJ_HT_P(retval_ptr)->clone_obj == NULL) {
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(retval_ptr)->name);
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", class_name);
}
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", Z_OBJCE_P(retval_ptr)->name);
zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
(*EG(return_value_ptr_ptr))->value.obj = Z_OBJ_HT_P(retval_ptr)->clone_obj(retval_ptr TSRMLS_CC);
if(!dup) {
efree(class_name);
}
} else if (!EG(free_op1)) { /* Not a temp var */
if (PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0) {
if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
(PZVAL_IS_REF(retval_ptr) && retval_ptr->refcount > 0)) {
ALLOC_ZVAL(*(EG(return_value_ptr_ptr)));
**EG(return_value_ptr_ptr) = *retval_ptr;
(*EG(return_value_ptr_ptr))->is_ref = 0;
@@ -3036,7 +3083,10 @@ int zend_send_var_no_ref_handler(ZEND_OPCODE_HANDLER_ARGS)
} else if (!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
return zend_send_by_var_helper(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
{
if ((opline->extended_value & ZEND_ARG_SEND_FUNCTION) &&
!EX_T(opline->op1.u.var).var.fcall_returned_reference) {
zend_error(E_ERROR, "Only variables can be passed by reference");
} else {
zval *varptr;
varptr = get_zval_ptr(&opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
@@ -3291,7 +3341,7 @@ int zend_clone_handler(ZEND_OPCODE_HANDLER_ARGS)
NEXT_OPCODE();
}
ce = Z_OBJCE_P(obj);
ce = (Z_OBJ_HT_P(obj)->get_class_entry) ? Z_OBJCE_P(obj) : NULL;
clone = ce ? ce->clone : NULL;
clone_call = Z_OBJ_HT_P(obj)->clone_obj;
if (!clone_call) {
@@ -3654,62 +3704,70 @@ int zend_unset_dim_obj_handler(ZEND_OPCODE_HANDLER_ARGS)
long index;
if (container) {
HashTable *ht;
if (opline->extended_value == ZEND_UNSET_DIM) {
switch (Z_TYPE_PP(container)) {
case IS_ARRAY:
ht = Z_ARRVAL_PP(container);
case IS_ARRAY: {
HashTable *ht = Z_ARRVAL_PP(container);
switch (offset->type) {
case IS_DOUBLE:
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
if (offset->type == IS_DOUBLE) {
index = (long) offset->value.dval;
} else {
index = offset->value.lval;
}
zend_hash_index_del(ht, index);
break;
case IS_STRING:
zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1);
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
}
FREE_OP(EX(Ts), &opline->op2, EG(free_op2));
break;
}
case IS_OBJECT:
ht = NULL;
if (!Z_OBJ_HT_P(*container)->unset_dimension) {
zend_error(E_ERROR, "Cannot use object as array");
}
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(offset);
}
Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
if (EG(free_op2)) {
zval_ptr_dtor(&offset);
}
break;
case IS_STRING:
zend_error(E_ERROR, "Cannot unset string offsets");
return 0; /* bailed out before */
default:
ht = NULL;
FREE_OP(EX(Ts), &opline->op2, EG(free_op2));
break;
}
} else { /* ZEND_UNSET_OBJ */
ht = NULL;
if (Z_TYPE_PP(container) == IS_OBJECT) {
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(offset);
}
Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
}
}
if (ht) {
switch (offset->type) {
case IS_DOUBLE:
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
if (offset->type == IS_DOUBLE) {
index = (long) offset->value.dval;
} else {
index = offset->value.lval;
}
zend_hash_index_del(ht, index);
break;
case IS_STRING:
zend_symtable_del(ht, offset->value.str.val, offset->value.str.len+1);
break;
case IS_NULL:
zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
break;
if (EG(free_op2)) {
zval_ptr_dtor(&offset);
}
}
}
} else {
/* overloaded element */
FREE_OP(EX(Ts), &opline->op2, EG(free_op2));
}
FREE_OP(EX(Ts), &opline->op2, EG(free_op2));
NEXT_OPCODE();
}
@@ -3727,6 +3785,12 @@ int zend_fe_reset_handler(ZEND_OPCODE_HANDLER_ARGS)
if (array_ptr_ptr == NULL) {
ALLOC_INIT_ZVAL(array_ptr);
} else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
if(Z_OBJ_HT_PP(array_ptr_ptr)->get_class_entry == NULL) {
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
opline++;
SET_OPCODE(op_array->opcodes+opline->op2.u.opline_num);
return 0;
}
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
@@ -3747,7 +3811,7 @@ int zend_fe_reset_handler(ZEND_OPCODE_HANDLER_ARGS)
*tmp = *array_ptr;
INIT_PZVAL(tmp);
array_ptr = tmp;
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT) {
} else if (Z_TYPE_P(array_ptr) == IS_OBJECT && Z_OBJ_HT_P(array_ptr)->get_class_entry) {
ce = Z_OBJCE_P(array_ptr);
} else {
array_ptr->refcount++;
@@ -3760,7 +3824,6 @@ int zend_fe_reset_handler(ZEND_OPCODE_HANDLER_ARGS)
if (iter && !EG(exception)) {
array_ptr = zend_iterator_wrap(iter TSRMLS_CC);
} else {
zval_ptr_dtor(&array_ptr);
FREE_OP(Ts, op1, EG(free_op1));
if (!EG(exception)) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Object of type %s did not create an Iterator", ce->name);
@@ -3779,6 +3842,11 @@ int zend_fe_reset_handler(ZEND_OPCODE_HANDLER_ARGS)
iter->index = 0;
if (iter->funcs->rewind) {
iter->funcs->rewind(iter TSRMLS_CC);
if (EG(exception)) {
array_ptr->refcount--;
zval_ptr_dtor(&array_ptr);
NEXT_OPCODE();
}
}
} else if ((fe_ht = HASH_OF(array_ptr)) != NULL) {
/* probably redundant */
@@ -3855,13 +3923,28 @@ int zend_fe_fetch_handler(ZEND_OPCODE_HANDLER_ARGS)
/* This could cause an endless loop if index becomes zero again.
* In case that ever happens we need an additional flag. */
iter->funcs->move_forward(iter TSRMLS_CC);
if (EG(exception)) {
array->refcount--;
zval_ptr_dtor(&array);
NEXT_OPCODE();
}
}
if (!iter || iter->funcs->valid(iter TSRMLS_CC) == FAILURE) {
/* reached end of iteration */
if (EG(exception)) {
array->refcount--;
zval_ptr_dtor(&array);
NEXT_OPCODE();
}
SET_OPCODE(op_array->opcodes+opline->op2.u.opline_num);
return 0; /* CHECK_ME */
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
if (EG(exception)) {
array->refcount--;
zval_ptr_dtor(&array);
NEXT_OPCODE();
}
if (!value) {
/* failure in get_current_data */
SET_OPCODE(op_array->opcodes+opline->op2.u.opline_num);
@@ -3869,6 +3952,11 @@ int zend_fe_fetch_handler(ZEND_OPCODE_HANDLER_ARGS)
}
if (iter->funcs->get_current_key) {
key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
if (EG(exception)) {
array->refcount--;
zval_ptr_dtor(&array);
NEXT_OPCODE();
}
} else {
key_type = HASH_KEY_IS_LONG;
int_key = iter->index;
@@ -3991,12 +4079,13 @@ int zend_isset_isempty_var_handler(ZEND_OPCODE_HANDLER_ARGS)
static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HANDLER_ARGS)
{
zval **container = get_obj_zval_ptr_ptr(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zval *offset = get_zval_ptr(&opline->op2, EX(Ts), &EG(free_op2), BP_VAR_R);
zval **value = NULL;
int result = 0;
long index;
if (container) {
zval *offset = get_zval_ptr(&opline->op2, EX(Ts), &EG(free_op2), BP_VAR_R);
if ((*container)->type == IS_ARRAY) {
HashTable *ht;
int isset = 0;
@@ -4049,12 +4138,19 @@ static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HAN
}
break;
}
FREE_OP(EX(Ts), &opline->op2, EG(free_op2));
} else if ((*container)->type == IS_OBJECT) {
if (EG(free_op2)) {
MAKE_REAL_ZVAL_PTR(offset);
}
if (prop_dim) {
result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
} else {
result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
}
if (EG(free_op2)) {
zval_ptr_dtor(&offset);
}
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
zval tmp;
@@ -4076,6 +4172,9 @@ static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HAN
}
break;
}
FREE_OP(EX(Ts), &opline->op2, EG(free_op2));
} else {
FREE_OP(EX(Ts), &opline->op2, EG(free_op2));
}
}
@@ -4090,8 +4189,6 @@ static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HAN
break;
}
FREE_OP(EX(Ts), &opline->op2, EG(free_op2));
NEXT_OPCODE();
}
@@ -4234,7 +4331,7 @@ int zend_instanceof_handler(ZEND_OPCODE_HANDLER_ARGS)
zval *expr = get_zval_ptr(&opline->op1, EX(Ts), &EG(free_op1), BP_VAR_R);
zend_bool result;
if (Z_TYPE_P(expr) == IS_OBJECT) {
if (Z_TYPE_P(expr) == IS_OBJECT && Z_OBJ_HT_P(expr)->get_class_entry) {
result = instanceof_function(Z_OBJCE_P(expr), EX_T(opline->op2.u.var).class_entry TSRMLS_CC);
} else {
result = 0;
@@ -4284,6 +4381,7 @@ int zend_handle_exception_handler(ZEND_OPCODE_HANDLER_ARGS)
while (*stack_zval_pp != NULL) {
zval_ptr_dtor(stack_zval_pp);
EG(argument_stack).top_element--;
EG(argument_stack).top--;
stack_zval_pp--;
}
@@ -4298,6 +4396,13 @@ int zend_handle_exception_handler(ZEND_OPCODE_HANDLER_ARGS)
}
}
while (EX(fbc)) {
if (EX(object)) {
zval_ptr_dtor(&EX(object));
}
zend_ptr_stack_n_pop(&EG(arg_types_stack), 3, &EX(calling_scope), &EX(object), &EX(fbc));
}
if (encapsulating_block == -1) {
RETURN_FROM_EXECUTE_LOOP(execute_data);
} else {
+1
View File
@@ -49,6 +49,7 @@ ZEND_API extern void (*zend_execute_internal)(zend_execute_data *execute_data_pt
void init_executor(TSRMLS_D);
void shutdown_executor(TSRMLS_D);
void shutdown_destructors(TSRMLS_D);
ZEND_API void execute(zend_op_array *op_array TSRMLS_DC);
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC);
ZEND_API int zend_is_true(zval *op);
+77 -19
View File
@@ -185,6 +185,15 @@ void init_executor(TSRMLS_D)
EG(This) = NULL;
}
void shutdown_destructors(TSRMLS_D) {
zend_try {
zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
} zend_catch {
/* if we couldn't destruct cleanly, mark all objects as destructed anyway */
zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
} zend_end_try();
}
void shutdown_executor(TSRMLS_D)
{
zend_try {
@@ -204,7 +213,6 @@ void shutdown_executor(TSRMLS_D)
}
*/
zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator TSRMLS_CC);
zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
zend_hash_graceful_reverse_destroy(&EG(symbol_table));
} zend_catch {
/* if we couldn't destruct cleanly, mark all objects as destructed anyway */
@@ -277,11 +285,6 @@ void shutdown_executor(TSRMLS_D)
clean_non_persistent_constants(TSRMLS_C);
} zend_end_try();
/* The regular list must be destroyed after the main symbol table,
* op arrays, and constants are destroyed.
*/
zend_destroy_rsrc_list(&EG(regular_list) TSRMLS_CC);
zend_try {
#if ZEND_DEBUG
signal(SIGSEGV, original_sigsegv_handler);
@@ -384,15 +387,17 @@ ZEND_API zend_bool zend_is_executing(TSRMLS_D)
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
{
zval *zv = *zval_ptr;
#if DEBUG_ZEND>=2
printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1);
#endif
(*zval_ptr)->refcount--;
if ((*zval_ptr)->refcount==0) {
zval_dtor(*zval_ptr);
safe_free_zval_ptr_rel(*zval_ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC);
} else if ((*zval_ptr)->refcount == 1) {
(*zval_ptr)->is_ref = 0;
zv->refcount--;
if (zv->refcount==0) {
zval_dtor(zv);
safe_free_zval_ptr_rel(zv ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC);
} else if (zv->refcount == 1) {
zv->is_ref = 0;
}
}
@@ -427,11 +432,13 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
if (p->type == IS_CONSTANT) {
int refcount;
zend_uchar is_ref;
SEPARATE_ZVAL(pp);
SEPARATE_ZVAL_IF_NOT_REF(pp);
p = *pp;
refcount = p->refcount;
is_ref = p->is_ref;
if (!zend_get_constant(p->value.str.val, p->value.str.len, &const_value TSRMLS_CC)) {
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
@@ -448,15 +455,15 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
*p = const_value;
}
INIT_PZVAL(p);
p->refcount = refcount;
p->is_ref = is_ref;
} else if (p->type == IS_CONSTANT_ARRAY) {
zval **element, *new_val;
char *str_index;
uint str_index_len;
ulong num_index;
SEPARATE_ZVAL(pp);
SEPARATE_ZVAL_IF_NOT_REF(pp);
p = *pp;
p->type = IS_ARRAY;
@@ -562,6 +569,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
zend_op_array *original_op_array;
zend_op **original_opline_ptr;
zval *orig_free_op1, *orig_free_op2;
zval *orig_garbage[2];
int orig_garbage_ptr;
int (*orig_unary_op)(zval *result, zval *op1);
int (*orig_binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
zend_class_entry *current_scope;
@@ -587,6 +596,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
/* Initialize execute_data */
if (EG(current_execute_data)) {
execute_data = *EG(current_execute_data);
EX(op_array) = NULL;
EX(opline) = NULL;
} else {
/* This only happens when we're called outside any execute()'s
* It shouldn't be strictly necessary to NULL execute_data out,
@@ -753,6 +764,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
zval *new_zval;
if (fci->no_separation) {
if(i) {
/* hack to clean up the stack */
zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) (long) i, NULL);
zend_ptr_stack_clear_multiple(TSRMLS_C);
}
return FAILURE;
}
ALLOC_ZVAL(new_zval);
@@ -849,6 +865,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
orig_free_op2 = EG(free_op2);
orig_unary_op = EG(unary_op);
orig_binary_op = EG(binary_op);
orig_garbage_ptr = EG(garbage_ptr);
EG(garbage_ptr) = 0;
if (orig_garbage_ptr > 0) {
memcpy(&orig_garbage, &EG(garbage), sizeof(zval*)*orig_garbage_ptr);
}
zend_execute(EG(active_op_array) TSRMLS_CC);
if (!fci->symbol_table) {
zend_hash_destroy(EG(active_symbol_table));
@@ -862,6 +883,13 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
EG(free_op2) = orig_free_op2;
EG(unary_op) = orig_unary_op;
EG(binary_op) = orig_binary_op;
if (orig_garbage_ptr > 0) {
while (EG(garbage_ptr)) {
zval_ptr_dtor(&EG(garbage)[--EG(garbage_ptr)]);
}
EG(garbage_ptr) = orig_garbage_ptr;
memcpy(&EG(garbage), &orig_garbage, sizeof(zval*)*orig_garbage_ptr);
}
} else {
ALLOC_INIT_ZVAL(*fci->retval_ptr_ptr);
if (EX(function_state).function->common.scope) {
@@ -895,7 +923,7 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
{
zval **args[1];
zval autoload_function;
zval class_name, *class_name_ptr = &class_name;
zval *class_name_ptr;
zval *retval_ptr;
int retval;
char *lc_name;
@@ -934,8 +962,9 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
ZVAL_STRINGL(&autoload_function, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1, 0);
ALLOC_ZVAL(class_name_ptr);
INIT_PZVAL(class_name_ptr);
ZVAL_STRINGL(class_name_ptr, name, name_length, 0);
ZVAL_STRINGL(class_name_ptr, name, name_length, 1);
args[0] = &class_name_ptr;
@@ -943,6 +972,8 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
EG(exception) = NULL;
retval = call_user_function_ex(EG(function_table), NULL, &autoload_function, &retval_ptr, 1, args, 0, NULL TSRMLS_CC);
zval_ptr_dtor(&class_name_ptr);
zend_hash_del(EG(in_autoload), lc_name, name_length+1);
if (retval == FAILURE) {
@@ -1081,6 +1112,17 @@ void execute_new_code(TSRMLS_D)
opline->op2.u.constant.is_ref = 1;
opline->op2.u.constant.refcount = 2;
}
switch (opline->opcode) {
case ZEND_JMP:
opline->op1.u.jmp_addr = &CG(active_op_array)->opcodes[opline->op1.u.opline_num];
break;
case ZEND_JMPZ:
case ZEND_JMPNZ:
case ZEND_JMPZ_EX:
case ZEND_JMPNZ_EX:
opline->op2.u.jmp_addr = &CG(active_op_array)->opcodes[opline->op2.u.opline_num];
break;
}
opline->handler = zend_opcode_handlers[opline->opcode];
opline++;
}
@@ -1238,10 +1280,17 @@ void zend_set_timeout(long seconds)
t_r.it_value.tv_sec = seconds;
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
# ifdef __CYGWIN__
setitimer(ITIMER_REAL, &t_r, NULL);
signal(SIGALRM, zend_timeout);
sigemptyset(&sigset);
sigaddset(&sigset, SIGALRM);
# else
setitimer(ITIMER_PROF, &t_r, NULL);
signal(SIGPROF, zend_timeout);
sigemptyset(&sigset);
sigaddset(&sigset, SIGPROF);
# endif
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
}
# endif
@@ -1260,7 +1309,11 @@ void zend_unset_timeout(TSRMLS_D)
no_timeout.it_value.tv_sec = no_timeout.it_value.tv_usec = no_timeout.it_interval.tv_sec = no_timeout.it_interval.tv_usec = 0;
#ifdef __CYGWIN__
setitimer(ITIMER_REAL, &no_timeout, NULL);
#else
setitimer(ITIMER_PROF, &no_timeout, NULL);
#endif
}
# endif
#endif
@@ -1296,7 +1349,11 @@ check_fetch_type:
}
if (zend_lookup_class(class_name, class_name_len, &pce TSRMLS_CC)==FAILURE) {
zend_error(E_ERROR, "Class '%s' not found", class_name);
if (fetch_type == ZEND_FETCH_CLASS_INTERFACE) {
zend_error(E_ERROR, "Interface '%s' not found", class_name);
} else {
zend_error(E_ERROR, "Class '%s' not found", class_name);
}
}
return *pce;
}
@@ -1339,8 +1396,9 @@ void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC)
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t) zend_verify_abstract_class_function, &ai TSRMLS_CC);
if (ai.cnt) {
zend_error(E_ERROR, "Class %s contains %d abstract methods and must therefore be declared abstract (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
zend_error(E_ERROR, "Class %s contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
ce->name, ai.cnt,
ai.cnt > 1 ? "s" : "",
DISPLAY_ABSTRACT_FN(0),
DISPLAY_ABSTRACT_FN(1),
DISPLAY_ABSTRACT_FN(2)
+1 -1
View File
@@ -1054,7 +1054,7 @@ ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, uint
if (p) {
if (p->nKeyLength) {
if (duplicate) {
*str_index = estrndup(p->arKey, p->nKeyLength);
*str_index = estrndup(p->arKey, p->nKeyLength-1);
} else {
*str_index = p->arKey;
}
+3 -11
View File
@@ -71,17 +71,9 @@ ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC)
while (ptr<end) {
if (*ptr==' ') {
/* Series of spaces should be displayed as &nbsp;'s
* whereas single spaces should be displayed as a space
*/
if ((ptr+1) < end && *(ptr+1)==' ') {
do {
zend_html_putc(*ptr);
} while ((++ptr < end) && (*ptr==' '));
} else {
ZEND_PUTC(*ptr);
ptr++;
}
do {
zend_html_putc(*ptr);
} while ((++ptr < end) && (*ptr==' '));
} else {
zend_html_putc(*ptr++);
}
+6 -1
View File
@@ -48,7 +48,12 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage TSRMLS
{
if (ini_entry->modified) {
if (ini_entry->on_modify) {
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
zend_try {
/* even if on_modify bails out, we have to continue on with restoring,
since there can be allocated variables that would be freed on MM shutdown
and would lead to memory corruption later ini entry is modified again */
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC);
} zend_end_try();
}
efree(ini_entry->value);
ini_entry->value = ini_entry->orig_value;
+4 -4
View File
@@ -291,9 +291,9 @@ unticked_class_declaration_statement:
class_entry_type:
T_CLASS { $$.u.constant.value.lval = 0; }
| T_ABSTRACT T_CLASS { $$.u.constant.value.lval = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
| T_FINAL T_CLASS { $$.u.constant.value.lval = ZEND_ACC_FINAL_CLASS; }
T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = 0; }
| T_ABSTRACT T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
| T_FINAL T_CLASS { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_FINAL_CLASS; }
;
extends_from:
@@ -302,7 +302,7 @@ extends_from:
;
interface_entry:
T_INTERFACE { $$.u.constant.value.lval = ZEND_ACC_INTERFACE; }
T_INTERFACE { $$.u.opline_num = CG(zend_lineno); $$.u.EA.type = ZEND_ACC_INTERFACE; }
;
interface_extends_list:
+4 -2
View File
@@ -125,7 +125,8 @@ void startup_scanner(TSRMLS_D)
{
CG(heredoc) = NULL;
CG(heredoc_len)=0;
RESET_DOC_COMMENT();
CG(doc_comment) = NULL;
CG(doc_comment_len) = 0;
SCNG(yy_start_stack_ptr) = 0;
SCNG(yy_start_stack_depth) = 0;
SCNG(current_buffer) = NULL;
@@ -1464,6 +1465,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_IN_SCRIPTING>"/**"{WHITESPACE} {
CG(comment_start_line) = CG(zend_lineno);
RESET_DOC_COMMENT();
BEGIN(ST_DOC_COMMENT);
yymore();
}
@@ -1480,7 +1482,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_DOC_COMMENT>"*/" {
CG(doc_comment) = yytext; /* no copying - intentional */
CG(doc_comment) = estrndup(yytext, yyleng);
CG(doc_comment_len) = yyleng;
HANDLE_NEWLINES(yytext, yyleng);
BEGIN(ST_IN_SCRIPTING);
+11 -5
View File
@@ -114,16 +114,20 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
void *resource;
va_list resource_types;
int i;
char *space;
char *class_name;
if (default_id==-1) { /* use id */
if (!passed_id) {
if (resource_type_name) {
zend_error(E_WARNING, "%s(): no %s resource supplied", get_active_function_name(TSRMLS_C), resource_type_name);
class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s(): no %s resource supplied", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
}
return NULL;
} else if ((*passed_id)->type != IS_RESOURCE) {
if (resource_type_name) {
zend_error(E_WARNING, "%s(): supplied argument is not a valid %s resource", get_active_function_name(TSRMLS_C), resource_type_name);
class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s(): supplied argument is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
}
return NULL;
}
@@ -135,7 +139,8 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
resource = zend_list_find(id, &actual_resource_type);
if (!resource) {
if (resource_type_name) {
zend_error(E_WARNING, "%s(): %d is not a valid %s resource", get_active_function_name(TSRMLS_C), id, resource_type_name);
class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s(): %d is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), id, resource_type_name);
}
return NULL;
}
@@ -153,7 +158,8 @@ ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, c
va_end(resource_types);
if (resource_type_name) {
zend_error(E_WARNING, "%s(): supplied resource is not a valid %s resource", get_active_function_name(TSRMLS_C), resource_type_name);
class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%s%s%s(): supplied resource is not a valid %s resource", class_name, space, get_active_function_name(TSRMLS_C), resource_type_name);
}
return NULL;
+79 -43
View File
@@ -162,13 +162,7 @@ static int zend_verify_property_access(zend_property_info *property_info, zend_c
case ZEND_ACC_PUBLIC:
return 1;
case ZEND_ACC_PROTECTED:
while (ce) {
if (ce==EG(scope)) {
return 1;
}
ce = ce->parent;
}
return 0;
return zend_check_protected(ce, EG(scope));;
case ZEND_ACC_PRIVATE:
if (ce==EG(scope) && EG(scope)) {
return 1;
@@ -198,22 +192,41 @@ static inline zend_property_info *zend_get_property_info(zend_object *zobj, zval
zend_property_info *property_info = NULL;
zend_property_info *scope_property_info;
zend_bool denied_access = 0;
ulong h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member)+1);
if (zend_hash_quick_find(&zobj->ce->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &property_info)==SUCCESS) {
if (zend_verify_property_access(property_info, zobj->ce TSRMLS_CC)) {
if (property_info->flags & ZEND_ACC_CHANGED
&& !(property_info->flags & ZEND_ACC_PRIVATE)) {
/* We still need to make sure that we're not in a context
* where the right property is a different 'statically linked' private
* continue checking below...
*/
ulong h;
if (Z_STRVAL_P(member)[0] == '\0') {
if (!silent) {
if (Z_STRLEN_P(member) == 0) {
zend_error(E_ERROR, "Cannot access empty property");
} else {
return property_info;
zend_error(E_ERROR, "Cannot access property started with '\\0'");
}
}
return NULL;
}
h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
if (zend_hash_quick_find(&zobj->ce->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &property_info)==SUCCESS) {
if(property_info->flags & ZEND_ACC_SHADOW) {
/* if it's a shadow - go to access it's private */
property_info = NULL;
} else {
/* Try to look in the scope instead */
denied_access = 1;
if (zend_verify_property_access(property_info, zobj->ce TSRMLS_CC)) {
if (property_info->flags & ZEND_ACC_CHANGED
&& !(property_info->flags & ZEND_ACC_PRIVATE)) {
/* We still need to make sure that we're not in a context
* where the right property is a different 'statically linked' private
* continue checking below...
*/
} else {
if (!silent && (property_info->flags & ZEND_ACC_STATIC)) {
zend_error(E_STRICT, "Accessing static property %s::$%s as non static", zobj->ce->name, Z_STRVAL_P(member));
}
return property_info;
}
} else {
/* Try to look in the scope instead */
denied_access = 1;
}
}
}
if (EG(scope) != zobj->ce
@@ -221,6 +234,9 @@ static inline zend_property_info *zend_get_property_info(zend_object *zobj, zval
&& EG(scope)
&& zend_hash_quick_find(&EG(scope)->properties_info, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, h, (void **) &scope_property_info)==SUCCESS
&& scope_property_info->flags & ZEND_ACC_PRIVATE) {
if (!silent && (scope_property_info->flags & ZEND_ACC_STATIC)) {
zend_error(E_STRICT, "Accessing static property %s::$%s as non static", EG(scope)->name, Z_STRVAL_P(member));
}
return scope_property_info;
} else if (property_info) {
if (denied_access) {
@@ -255,9 +271,14 @@ ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name
if (!property_info) {
return FAILURE;
}
if (prop_info_name[0] == '\0' && prop_info_name[1] != '*' && !(property_info->flags & ZEND_ACC_PRIVATE)) {
/* we we're looking for a private prop but found a non private one of the same name */
return FAILURE;
if (prop_info_name[0] == '\0' && prop_info_name[1] != '*') {
if (!(property_info->flags & ZEND_ACC_PRIVATE)) {
/* we we're looking for a private prop but found a non private one of the same name */
return FAILURE;
} else if (strcmp(prop_info_name+1, property_info->name+1)) {
/* we we're looking for a private prop but found a private one of the same name but another class */
return FAILURE;
}
}
return zend_verify_property_access(property_info, zobj->ce TSRMLS_CC) ? SUCCESS : FAILURE;
}
@@ -265,7 +286,7 @@ ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name
zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
{
zend_object *zobj;
zval tmp_member;
zval *tmp_member = NULL;
zval **retval;
zval *rv = NULL;
zend_property_info *property_info;
@@ -275,10 +296,12 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
zobj = Z_OBJ_P(object);
if (member->type != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
ALLOC_ZVAL(tmp_member);
*tmp_member = *member;
INIT_PZVAL(tmp_member);
zval_copy_ctor(tmp_member);
convert_to_string(tmp_member);
member = tmp_member;
}
#if DEBUG_OBJECT_HANDLERS
@@ -306,8 +329,10 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
retval = &EG(uninitialized_zval_ptr);
}
}
if (member == &tmp_member) {
zval_dtor(member);
if (tmp_member) {
(*retval)->refcount++;
zval_ptr_dtor(&tmp_member);
(*retval)->refcount--;
}
return *retval;
}
@@ -316,7 +341,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
static void zend_std_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
{
zend_object *zobj;
zval tmp_member;
zval *tmp_member = NULL;
zval **variable_ptr;
int setter_done = 0;
zend_property_info *property_info;
@@ -324,10 +349,12 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
zobj = Z_OBJ_P(object);
if (member->type != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
ALLOC_ZVAL(tmp_member);
*tmp_member = *member;
INIT_PZVAL(tmp_member);
zval_copy_ctor(tmp_member);
convert_to_string(tmp_member);
member = tmp_member;
}
property_info = zend_get_property_info(zobj, member, 0 TSRMLS_CC);
@@ -371,8 +398,8 @@ static void zend_std_write_property(zval *object, zval *member, zval *value TSRM
}
zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &value, sizeof(zval *), (void **) &foo);
}
if (member == &tmp_member) {
zval_dtor(member);
if (tmp_member) {
zval_ptr_dtor(&tmp_member);
}
}
@@ -612,7 +639,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS)
* Returns the function address that should be called, or NULL
* if no such function exists.
*/
static inline zend_function *zend_check_private(zend_function *fbc, zend_class_entry *ce, int fn_flags, char *function_name_strval, int function_name_strlen TSRMLS_DC)
static inline zend_function *zend_check_private_int(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC)
{
if (!ce) {
return 0;
@@ -647,6 +674,11 @@ static inline zend_function *zend_check_private(zend_function *fbc, zend_class_e
}
ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC)
{
return zend_check_private_int(fbc, ce, function_name_strval, function_name_strlen TSRMLS_CC) != NULL;
}
/* Ensures that we're allowed to call a protected method.
*/
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
@@ -714,7 +746,8 @@ static union _zend_function *zend_std_get_method(zval *object, char *method_name
zend_function *priv_fbc;
if (zend_hash_find(&EG(scope)->function_table, lc_method_name, method_len+1, (void **) &priv_fbc)==SUCCESS
&& priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE) {
&& priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE
&& priv_fbc->common.scope == EG(scope)) {
fbc = priv_fbc;
}
}
@@ -723,7 +756,7 @@ static union _zend_function *zend_std_get_method(zval *object, char *method_name
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
updated_fbc = zend_check_private(fbc, object->value.obj.handlers->get_class_entry(object TSRMLS_CC), fbc->common.fn_flags, lc_method_name, method_len TSRMLS_CC);
updated_fbc = zend_check_private_int(fbc, object->value.obj.handlers->get_class_entry(object TSRMLS_CC), lc_method_name, method_len TSRMLS_CC);
if (!updated_fbc) {
zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name, EG(scope) ? EG(scope)->name : "");
}
@@ -761,7 +794,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
updated_fbc = zend_check_private(fbc, EG(scope), fbc->common.fn_flags, function_name_strval, function_name_strlen TSRMLS_CC);
updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC);
if (!updated_fbc) {
zend_error(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name_strval, EG(scope) ? EG(scope)->name : "");
}
@@ -785,7 +818,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *propert
zend_property_info *property_info;
zend_property_info std_property_info;
if (zend_hash_find(&ce->properties_info, property_name, property_name_len+1, (void **) &property_info)==FAILURE) {
if (zend_hash_find(&ce->properties_info, property_name, property_name_len+1, (void **) &property_info)==FAILURE || (property_info->flags & ZEND_ACC_SHADOW)) {
std_property_info.flags = ZEND_ACC_PUBLIC;
std_property_info.name = property_name;
std_property_info.name_length = property_name_len;
@@ -793,7 +826,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, char *propert
property_info = &std_property_info;
}
#if 1&&DEBUG_OBJECT_HANDLERS
#if DEBUG_OBJECT_HANDLERS
zend_printf("Access type for %s::%s is %s\n", ce->name, property_name, zend_visibility_string(property_info->flags));
#endif
@@ -944,6 +977,9 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
switch (type) {
case IS_STRING:
if (!zend_hash_exists(&Z_OBJCE_P(readobj)->function_table, "__tostring", sizeof("__tostring"))) {
return FAILURE;
}
ZVAL_STRING(&fname, "__tostring", 0);
if (call_user_function_ex(NULL, &readobj, &fname, &retval, 0, NULL, 0, NULL TSRMLS_CC) == SUCCESS) {
if (retval) {
+2
View File
@@ -137,6 +137,8 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
#define IS_ZEND_STD_OBJECT(z) ((z).type == IS_OBJECT && (Z_OBJ_HT((z))->get_class_entry != NULL))
#define HAS_CLASS_ENTRY(z) (Z_OBJ_HT(z)->get_class_entry != NULL)
ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce, char *function_name_strval, int function_name_strlen TSRMLS_DC);
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name TSRMLS_DC);
+25 -1
View File
@@ -111,9 +111,33 @@ ZEND_API zend_object *zend_objects_get_address(zval *zobject TSRMLS_DC)
return (zend_object *)zend_object_store_get_object(zobject TSRMLS_CC);
}
static void zval_add_ref_or_clone(zval **p)
{
if (Z_TYPE_PP(p) == IS_OBJECT && !PZVAL_IS_REF(*p)) {
TSRMLS_FETCH();
if (Z_OBJ_HANDLER_PP(p, clone_obj) == NULL) {
zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_PP(p)->name);
} else {
zval *orig = *p;
ALLOC_ZVAL(*p);
**p = *orig;
INIT_PZVAL(*p);
(*p)->value.obj = Z_OBJ_HT_PP(p)->clone_obj(orig TSRMLS_CC);
}
} else {
(*p)->refcount++;
}
}
ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object_value new_obj_val, zend_object *old_object, zend_object_handle handle TSRMLS_DC)
{
zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *));
if (EG(ze1_compatibility_mode)) {
zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref_or_clone, (void *) NULL /* Not used anymore */, sizeof(zval *));
} else {
zend_hash_copy(new_object->properties, old_object->properties, (copy_ctor_func_t) zval_add_ref, (void *) NULL /* Not used anymore */, sizeof(zval *));
}
if (old_object->ce->clone) {
zval *new_obj;
zval *clone_func_name;
+2
View File
@@ -151,7 +151,9 @@ ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC)
EG(objects_store).object_buckets[handle].destructor_called = 1;
if (obj->dtor) {
zobject->refcount++;
obj->dtor(obj->object, handle TSRMLS_CC);
zobject->refcount--;
}
}
if (obj->refcount == 1) {
+5 -3
View File
@@ -1284,24 +1284,26 @@ static inline void zend_free_obj_get_result(zval *op, int free_op)
}
#define COMPARE_RETURN_AND_FREE(retval) \
zend_free_obj_get_result(op1, free_op1); \
zend_free_obj_get_result(op2, free_op2); \
zend_free_obj_get_result(op1_orig, free_op1); \
zend_free_obj_get_result(op2_orig, free_op2); \
return retval;
ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
zend_bool free_op1 = 0, free_op2 = 0;
zval *op1_orig, *op2_orig;
if (op1->type == IS_OBJECT && Z_OBJ_HT_P(op1)->get) {
op1 = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC);
free_op1 = 1;
}
op1_orig = op1;
if (op2->type == IS_OBJECT && Z_OBJ_HT_P(op2)->get) {
op2 = Z_OBJ_HT_P(op2)->get(op2 TSRMLS_CC);
free_op2 = 1;
}
op2_orig = op2;
if ((op1->type == IS_NULL && op2->type == IS_STRING)
|| (op2->type == IS_NULL && op1->type == IS_STRING)) {
+18 -10
View File
@@ -257,7 +257,7 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
/* {{{ _class_string */
static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC)
{
int count, count_static_props = 0, count_static_funcs = 0;
int count, count_static_props = 0, count_static_funcs = 0, count_shadow_props = 0;
string sub_indent;
string_init(&sub_indent);
@@ -349,7 +349,9 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos);
while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) {
if (prop->flags & ZEND_ACC_STATIC) {
if(prop->flags & ZEND_ACC_SHADOW) {
count_shadow_props++;
} else if (prop->flags & ZEND_ACC_STATIC) {
count_static_props++;
}
zend_hash_move_forward_ex(&ce->properties_info, &pos);
@@ -365,9 +367,10 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos);
while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) {
if (prop->flags & ZEND_ACC_STATIC) {
if ((prop->flags & ZEND_ACC_STATIC) && !(prop->flags & ZEND_ACC_SHADOW)) {
_property_string(str, prop, NULL, sub_indent.string TSRMLS_CC);
}
zend_hash_move_forward_ex(&ce->properties_info, &pos);
}
}
@@ -415,7 +418,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
/* Default/Implicit properties */
if (&ce->properties_info) {
count = zend_hash_num_elements(&ce->properties_info) - count_static_props;
count = zend_hash_num_elements(&ce->properties_info) - count_static_props - count_shadow_props;
string_printf(str, "\n%s - Properties [%d] {\n", indent, count);
if (count > 0) {
HashPosition pos;
@@ -424,7 +427,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos);
while (zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop, &pos) == SUCCESS) {
if (!(prop->flags & ZEND_ACC_STATIC)) {
if (!(prop->flags & (ZEND_ACC_STATIC|ZEND_ACC_SHADOW))) {
_property_string(str, prop, NULL, sub_indent.string TSRMLS_CC);
}
zend_hash_move_forward_ex(&ce->properties_info, &pos);
@@ -1332,6 +1335,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
/* Return an empty array in case no static variables exist */
array_init(return_value);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
}
}
@@ -1745,7 +1749,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
zv_copy = precv->op2.u.constant;
zv = &zv_copy;
zval_update_constant(&zv, (void*)1 TSRMLS_CC);
zval_update_constant(&zv, (void*)0 TSRMLS_CC);
RETURN_ZVAL(zv, 1, 1);
}
/* }}} */
@@ -2315,7 +2319,7 @@ ZEND_METHOD(reflection_class, getConstructor)
/* }}} */
/* {{{ proto public ReflectionMethod ReflectionClass::getMethod(string name) throws ReflectionException
Returns the class' method specified by it's name */
Returns the class' method specified by its name */
ZEND_METHOD(reflection_class, getMethod)
{
reflection_object *intern;
@@ -2388,7 +2392,7 @@ ZEND_METHOD(reflection_class, getMethods)
/* }}} */
/* {{{ proto public ReflectionProperty ReflectionClass::getProperty(string name) throws ReflectionException
Returns the class' property specified by it's name */
Returns the class' property specified by its name */
ZEND_METHOD(reflection_class, getProperty)
{
reflection_object *intern;
@@ -2403,7 +2407,7 @@ ZEND_METHOD(reflection_class, getProperty)
}
GET_REFLECTION_OBJECT_PTR(ce);
if (zend_hash_find(&ce->properties_info, name, name_len + 1, (void**) &property_info) == SUCCESS) {
if (zend_hash_find(&ce->properties_info, name, name_len + 1, (void**) &property_info) == SUCCESS && (property_info->flags & ZEND_ACC_SHADOW) == 0) {
reflection_property_factory(ce, property_info, return_value TSRMLS_CC);
} else {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
@@ -2421,6 +2425,10 @@ static int _addproperty(zend_property_info *pptr, int num_args, va_list args, ze
zval *retval = va_arg(args, zval*);
long filter = va_arg(args, long);
if (pptr->flags & ZEND_ACC_SHADOW) {
return 0;
}
if (pptr->flags & filter) {
TSRMLS_FETCH();
ALLOC_ZVAL(property);
@@ -2904,7 +2912,7 @@ ZEND_METHOD(reflection_property, __construct)
/* returns out of this function */
}
if (zend_hash_find(&ce->properties_info, name_str, name_len + 1, (void **) &property_info) == FAILURE) {
if (zend_hash_find(&ce->properties_info, name_str, name_len + 1, (void **) &property_info) == FAILURE || (property_info->flags & ZEND_ACC_SHADOW)) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Property %s::$%s does not exist", ce->name, name_str);
return;
+9
View File
@@ -94,7 +94,16 @@ ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_
if (file_handle->handle.stream.interactive) {
int c = '*', n;
#ifdef NETWARE
/*
c != 4 check is there as fread of a character in NetWare LibC gives 4 upon ^D character.
Ascii value 4 is actually EOT character which is not defined anywhere in the LibC
or else we can use instead of hardcoded 4.
*/
for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != 4 && c != '\n'; ++n )
#else
for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n )
#endif
buf[n] = (char) c;
if ( c == '\n' )
buf[n++] = (char) c;
+58 -12
View File
@@ -146,7 +146,7 @@ dnl choose the right compiler/flags/etc. for the source-file
*.c[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
*.s[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
*.S[)] ac_comp="$b_c_pre $3 $ac_inc $b_c_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_c_post" ;;
*.cpp[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;;
*.cpp|*.cc[)] ac_comp="$b_cxx_pre $3 $ac_inc $b_cxx_meta -c $ac_srcdir$ac_src -o $ac_bdir$ac_obj.$b_lo $6$b_cxx_post" ;;
esac
dnl create a rule for the object/source combo
@@ -1086,20 +1086,33 @@ AC_DEFUN([PHP_CHECK_CC_OPTION],[
rm -rf conftest*
])
dnl
dnl PHP_REGEX
dnl
AC_DEFUN([PHP_REGEX],[
if test "$REGEX_TYPE" = "php"; then
AC_DEFINE(HSREGEX,1,[ ])
AC_DEFINE(REGEX,1,[ ])
PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c)
elif test "$REGEX_TYPE" = "system"; then
AC_DEFINE(REGEX,0,[ ])
fi
AC_MSG_CHECKING([which regex library to use])
AC_MSG_RESULT([$REGEX_TYPE])
if test "$REGEX_TYPE" = "php"; then
AC_DEFINE(HAVE_REGEX_T_RE_MAGIC, 1, [ ])
AC_DEFINE(HSREGEX,1,[ ])
AC_DEFINE(REGEX,1,[ ])
PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c)
elif test "$REGEX_TYPE" = "system"; then
AC_DEFINE(REGEX,0,[ ])
dnl Check if field re_magic exists in struct regex_t
AC_CACHE_CHECK([whether field re_magic exists in struct regex_t], ac_cv_regex_t_re_magic, [
AC_TRY_COMPILE([#include <sys/types.h>
#include <regex.h>], [regex_t rt; rt.re_magic;],
[ac_cv_regex_t_re_magic=yes], [ac_cv_regex_t_re_magic=no])
])
if test "$ac_cv_regex_t_re_magic" = "yes"; then
AC_DEFINE([HAVE_REGEX_T_RE_MAGIC], [ ], 1)
fi
fi
AC_MSG_CHECKING([which regex library to use])
AC_MSG_RESULT([$REGEX_TYPE])
])
dnl
dnl See if we have broken header files like SunOS has.
dnl
@@ -1182,6 +1195,10 @@ AC_DEFUN([PHP_SHARED_MODULE],[
suffix=so
link_cmd='ifelse($4,,[$(CC)],[$(CXX)]) -dynamic -flat_namespace -bundle -undefined suppress $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
;;
*netware*[)]
suffix=nlm
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
;;
*[)]
suffix=la
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
@@ -1270,6 +1287,11 @@ dnl ---------------------------------------------- Static module
if test "$3" = "shared" || test "$3" = "yes"; then
dnl ---------------------------------------------- Shared module
PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes)
case $host_alias in
*netware*)
PHP_ADD_LIBRARY_WITH_PATH(php5lib, netware, translit($1,a-z_-,A-Z__)_SHARED_LIBADD)
;;
esac
PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module)
fi
@@ -1680,6 +1702,10 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
unset OPENSSL_INCDIR
unset OPENSSL_LIBDIR
dnl Empty variable means 'no'
test -z "$PHP_OPENSSL" && PHP_OPENSSL=no
test -z "$PHP_IMAP_SSL" && PHP_IMAP_SSL=no
dnl Fallbacks for different configure options
if test "$PHP_OPENSSL" != "no"; then
PHP_OPENSSL_DIR=$PHP_OPENSSL
@@ -2069,3 +2095,23 @@ int main(void)
fi
])
dnl
dnl PHP_CHECK_PDO_INCLUDES([found [, not-found]])
dnl
AC_DEFUN([PHP_CHECK_PDO_INCLUDES],[
AC_CACHE_CHECK([for PDO includes], pdo_inc_path, [
AC_MSG_CHECKING([for PDO includes])
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$abs_srcdir/ext
elif test -f $prefix/include/php/ext/pdo/php_pdo_driver.h; then
pdo_inc_path=$prefix/include/php/ext
fi
])
if test -n "$pdo_inc_path"; then
ifelse([$1],[],:,[$1])
else
ifelse([$2],[],[AC_MSG_ERROR([Cannot find php_pdo_driver.h.])],[$2])
fi
])
+5 -2
View File
@@ -32,6 +32,9 @@ acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
targets = $(TOUCH_FILES) configure $(config_h_in)
PHP_AUTOCONF ?= 'autoconf'
PHP_AUTOHEADER ?= 'autoheader'
SUPPRESS_WARNINGS ?= 2>&1 | (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_DECL_YYTEXT is expanded from...|the top level)'||true)
all: $(targets)
@@ -45,7 +48,7 @@ $(config_h_in): configure acconfig.h
# correctly otherwise (timestamps are not updated)
@echo rebuilding $@
@rm -f $@
autoheader $(SUPPRESS_WARNINGS)
$(PHP_AUTOHEADER) $(SUPPRESS_WARNINGS)
$(TOUCH_FILES):
touch $(TOUCH_FILES)
@@ -56,5 +59,5 @@ aclocal.m4: configure.in acinclude.m4
configure: aclocal.m4 configure.in $(config_m4_files)
@echo rebuilding $@
autoconf $(SUPPRESS_WARNINGS)
$(PHP_AUTOCONF) $(SUPPRESS_WARNINGS)
+7 -2
View File
@@ -16,15 +16,20 @@
# | Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: buildcheck.sh,v 1.30.2.4 2005-01-20 01:41:52 sniper Exp $
# $Id: buildcheck.sh,v 1.30.2.6 2005-04-07 23:33:37 jon Exp $
#
echo "buildconf: checking installation..."
stamp=$1
# Allow the autoconf executable to be overridden by $PHP_AUTOCONF.
if test -z "$PHP_AUTOCONF"; then
PHP_AUTOCONF='autoconf'
fi
# autoconf 2.13 or newer
ac_version=`autoconf --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
if test -z "$ac_version"; then
echo "buildconf: autoconf not found."
echo " You need autoconf version 2.13 or newer installed"
+228 -151
View File
@@ -1,12 +1,12 @@
#!/bin/sh
##
## GNU shtool -- The GNU Portable Shell Tool
## Copyright (c) 1994-2002 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1994-2005 Ralf S. Engelschall <rse@engelschall.com>
##
## See http://www.gnu.org/software/shtool/ for more information.
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
##
## Version: 1.6.2 (02-Nov-2002)
## Version: 2.0.2 (15-Jun-2005)
## Contents: 4/19 available modules
##
@@ -54,7 +54,7 @@
## rotate Logfile rotation
## tarball Roll distribution tarballs
## subst Apply sed(1) substitution operations
## guessos Simple operating system guesser
## platform Platform Identification Utility
## arx Extended archive command
## slo Separate linker options by library class
## scpp Sharing C Pre-Processor
@@ -66,9 +66,9 @@ if [ $# -eq 0 ]; then
echo "$0:Hint: run \`$0 -h' for usage" 1>&2
exit 1
fi
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo "This is GNU shtool, version 1.6.2 (02-Nov-2002)"
echo "Copyright (c) 1994-2002 Ralf S. Engelschall <rse@engelschall.com>"
if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then
echo "This is GNU shtool, version 2.0.2 (15-Jun-2005)"
echo "Copyright (c) 1994-2005 Ralf S. Engelschall <rse@engelschall.com>"
echo "Report bugs to <bug-shtool@gnu.org>"
echo ''
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
@@ -80,7 +80,7 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo ' -r, --recreate recreate this shtool script via shtoolize'
echo ''
echo 'Available <cmd-name> [<cmd-options>] [<cmd-args>]:'
echo ' echo [-n|--newline] [-e|--expand] [<str> ...]'
echo ' echo [-n|--newline] [-e|--expand] [<string> ...]'
echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]'
echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode <mode>]'
echo ' [-o|--owner <owner>] [-g|--group <group>] [-e|--exec'
@@ -106,17 +106,21 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files'
echo ' <count>] [-s|--size <size>] [-c|--copy] [-r|--remove]'
echo ' [-a|--archive-dir <dir>] [-z|--compress [<tool>:]<level>]'
echo ' [-b|--background] [-d|--delay] [-p|--pad <len>] [-o|--owner'
echo ' <owner>] [-g|--group <group>] [-m|--mode <mode>] [-M|--migrate'
echo ' [-b|--background] [-d|--delay] [-p|--pad <len>] [-m|--mode'
echo ' <mode>] [-o|--owner <owner>] [-g|--group <group>] [-M|--migrate'
echo ' <cmd>] [-P|--prolog <cmd>] [-E|--epilog <cmd>] <file> [...]'
echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output <tarball>]'
echo ' [-c|--compress <prog>] [-d|--directory <dir>] [-u|--user'
echo ' <user>] [-g|--group <group>] [-e|--exclude <pattern>]'
echo ' <path> [<path> ...]'
echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-s|--stealth]'
echo ' [-i|--interactive] [-b|--backup <ext>] [-e|--exec <cmd>]'
echo ' [-f|--file <cmd-file>] [<file>] [...]'
echo ' guessos '
echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]'
echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup'
echo ' <ext>] [-e|--exec <cmd>] [-f|--file <cmd-file>] [<file>]'
echo ' [...]'
echo ' platform [-F|--format <format>] [-S|--sep <string>] [-C|--conc'
echo ' <string>] [-L|--lower] [-U|--upper] [-v|--verbose]'
echo ' [-c|--concise] [-n|--no-newline] [-t|--type <type>]'
echo ' [-V|--version] [-h|--help]'
echo ' arx [-t|--trace] [-C|--command <cmd>] <op> <archive> [<file>'
echo ' ...]'
echo ' slo [-p|--prefix <str>] -- -L<dir> -l<lib> [-L<dir> -l<lib>'
@@ -131,15 +135,15 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo ''
exit 0
fi
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
echo "GNU shtool 1.6.2 (02-Nov-2002)"
if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then
echo "GNU shtool 2.0.2 (15-Jun-2005)"
exit 0
fi
if [ ".$1" = ".-r" -o ".$1" = ."--recreate" ]; then
if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then
shtoolize -oshtool echo install mkdir path
exit 0
fi
if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then
shift
set -x
fi
@@ -166,7 +170,7 @@ gen_tmpfile=no
case $tool in
echo )
str_tool="echo"
str_usage="[-n|--newline] [-e|--expand] [<str> ...]"
str_usage="[-n|--newline] [-e|--expand] [<string> ...]"
arg_spec="0+"
opt_spec="n.e."
opt_alias="n:newline,e:expand"
@@ -261,7 +265,7 @@ eval `echo h.$opt_spec |\
# parse option alias string
eval `echo h:help,$opt_alias |\
tr 'x-' 'x_' | sed -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'`
sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'`
# interate over argument line
opt_PREV=''
@@ -286,12 +290,12 @@ while [ $# -gt 0 ]; do
--[a-zA-Z0-9]*=*)
eval `echo "x$1" |\
sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'`
opt_STR=`echo $opt_OPT | tr 'x-' 'x_'`
opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
;;
--[a-zA-Z0-9]*)
opt_OPT=`echo "x$1" | cut -c4-`
opt_STR=`echo $opt_OPT | tr 'x-' 'x_'`
opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}"
opt_ARG=''
;;
@@ -315,8 +319,8 @@ while [ $# -gt 0 ]; do
# determine whether option needs an argument
eval "opt_MODE=\$opt_MODE_${opt_OPT}"
if [ ".$opt_ARG" = . -a ".$opt_ARG_OK" != .yes ]; then
if [ ".$opt_MODE" = ".:" -o ".$opt_MODE" = ".+" ]; then
if [ ".$opt_ARG" = . ] && [ ".$opt_ARG_OK" != .yes ]; then
if [ ".$opt_MODE" = ".:" ] || [ ".$opt_MODE" = ".+" ]; then
opt_PREV="$opt_OPT"
continue
fi
@@ -375,6 +379,7 @@ esac
# establish a temporary file on request
if [ ".$gen_tmpfile" = .yes ]; then
# create (explicitly) secure temporary directory
if [ ".$TMPDIR" != . ]; then
tmpdir="$TMPDIR"
elif [ ".$TEMPDIR" != . ]; then
@@ -382,12 +387,40 @@ if [ ".$gen_tmpfile" = .yes ]; then
else
tmpdir="/tmp"
fi
tmpfile="$tmpdir/.shtool.$$"
rm -f $tmpfile >/dev/null 2>&1
touch $tmpfile
chmod 600 $tmpfile
tmpdir="$tmpdir/.shtool.$$"
( umask 077
rm -rf "$tmpdir" >/dev/null 2>&1 || true
mkdir "$tmpdir" >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2
exit 1
fi
)
# create (implicitly) secure temporary file
tmpfile="$tmpdir/shtool.tmp"
touch "$tmpfile"
fi
# utility function: map string to lower case
util_lower () {
echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
}
# utility function: map string to upper case
util_upper () {
echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
}
# cleanup procedure
shtool_exit () {
rc="$1"
if [ ".$gen_tmpfile" = .yes ]; then
rm -rf "$tmpdir" >/dev/null 2>&1 || true
fi
exit $rc
}
##
## DISPATCH INTO SCRIPT BODY
##
@@ -397,12 +430,11 @@ case $tool in
echo )
##
## echo -- Print string with optional construct expansion
## Copyright (c) 1998-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for WML as buildinfo
## Copyright (c) 1998-2005 Ralf S. Engelschall <rse@engelschall.com>
##
text="$*"
# check for broken escape sequence expansion
seo=''
bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'`
@@ -412,18 +444,18 @@ echo )
seo='-E'
fi
fi
# check for existing -n option (to suppress newline)
minusn=''
bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'`
if [ ".$bytes" = .3 ]; then
minusn='-n'
fi
# determine terminal bold sequence
term_bold=''
term_norm=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[Bb]'`" != . ]; then
case $TERM in
# for the most important terminal types we directly know the sequences
xterm|xterm*|vt220|vt220*)
@@ -459,96 +491,139 @@ echo )
break
fi
done
if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
if [ ".$term_bold" != . ] && [ ".$term_norm" != . ]; then
break;
fi
done
;;
esac
if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
if [ ".$term_bold" = . ] || [ ".$term_norm" = . ]; then
echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
term_bold=''
term_norm=''
fi
fi
# determine user name
username=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uUgG]'`" != . ]; then
username="$LOGNAME"
if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[uUgG]'`" != . ]; then
username="`(id -un) 2>/dev/null`"
if [ ".$username" = . ]; then
username="$USER"
if [ ".$username" = . ]; then
username="`(whoami) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$username" = . ]; then
username="`(who am i) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$username" = . ]; then
username='unknown'
fi
fi
fi
fi
fi
# determine user id
userid=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then
userid="`(id -u) 2>/dev/null`"
if [ ".$userid" = . ]; then
str="`(id) 2>/dev/null`"
if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then
userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'`
username=`echo $str | sed -e 's/^uid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'`
fi
if [ ".$userid" = . ]; then
userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid=`(ypcat passwd) 2>/dev/null |
egrep "^${username}:" | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid='?'
if [ ".$username" = . ]; then
username="$LOGNAME"
if [ ".$username" = . ]; then
username="$USER"
if [ ".$username" = . ]; then
username="`(whoami) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$username" = . ]; then
username="`(who am i) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$username" = . ]; then
username='unknown'
fi
fi
fi
fi
fi
fi
fi
# determine user id
userid=''
if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%U'`" != . ]; then
userid="`(id -u) 2>/dev/null`"
if [ ".$userid" = . ]; then
userid="`(id -u ${username}) 2>/dev/null`"
if [ ".$userid" = . ]; then
str="`(id) 2>/dev/null`"
if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then
userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*$//'`
fi
if [ ".$userid" = . ]; then
userid=`(getent passwd ${username}) 2>/dev/null | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid=`grep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid=`(ypcat passwd) 2>/dev/null |
grep "^${username}:" | \
sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$userid" = . ]; then
userid='?'
fi
fi
fi
fi
fi
fi
fi
# determine (primary) group id
groupid=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[gG]'`" != . ]; then
groupid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[gG]'`" != . ]; then
groupid="`(id -g ${username}) 2>/dev/null`"
if [ ".$groupid" = . ]; then
groupid=`(ypcat passwd) 2>/dev/null | egrep "^${username}:" | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
str="`(id) 2>/dev/null`"
if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then
groupid=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*//' -e 's/(.*$//'`
fi
if [ ".$groupid" = . ]; then
groupid='?'
groupid=`(getent passwd ${username}) 2>/dev/null | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
groupid=`grep "^${username}:" /etc/passwd 2>/dev/null | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
groupid=`(ypcat passwd) 2>/dev/null | grep "^${username}:" | \
sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
if [ ".$groupid" = . ]; then
groupid='?'
fi
fi
fi
fi
fi
fi
# determine (primary) group name
groupname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%g'`" != . ]; then
groupname=`egrep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
sed -e 's/:.*$//'`
if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%g'`" != . ]; then
groupname="`(id -gn ${username}) 2>/dev/null`"
if [ ".$groupname" = . ]; then
groupname=`(ypcat group) 2>/dev/null | \
egrep "^[^:]*:[^:]*:${groupid}:" | \
sed -e 's/:.*$//'`
str="`(id) 2>/dev/null`"
if [ ".`echo $str | grep 'gid[ ]*=[ ]*[0-9]*('`" != . ]; then
groupname=`echo $str | sed -e 's/^.*gid[ ]*=[ ]*[0-9]*(//' -e 's/).*$//'`
fi
if [ ".$groupname" = . ]; then
groupname='?'
groupname=`(getent group) 2>/dev/null | \
grep "^[^:]*:[^:]*:${groupid}:" | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
groupname=`grep "^[^:]*:[^:]*:${groupid}:" /etc/group 2>/dev/null | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
groupname=`(ypcat group) 2>/dev/null | \
grep "^[^:]*:[^:]*:${groupid}:" | \
sed -e 's/:.*$//'`
if [ ".$groupname" = . ]; then
groupname='?'
fi
fi
fi
fi
fi
fi
# determine host and domain name
hostname=''
domainname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then
if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%h'`" != . ]; then
hostname="`(uname -n) 2>/dev/null |\
awk '{ printf("%s", $1); }'`"
if [ ".$hostname" = . ]; then
@@ -565,16 +640,16 @@ echo )
;;
esac
fi
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then
if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%d'`" != . ]; then
if [ ".$domainname" = . ]; then
if [ -f /etc/resolv.conf ]; then
domainname="`egrep '^[ ]*domain' /etc/resolv.conf | sed -e 'q' |\
domainname="`grep '^[ ]*domain' /etc/resolv.conf | sed -e 'q' |\
sed -e 's/.*domain//' \
-e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
-e 's/^\.//' -e 's/^/./' |\
awk '{ printf("%s", $1); }'`"
if [ ".$domainname" = . ]; then
domainname="`egrep '^[ ]*search' /etc/resolv.conf | sed -e 'q' |\
domainname="`grep '^[ ]*search' /etc/resolv.conf | sed -e 'q' |\
sed -e 's/.*search//' \
-e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \
-e 's/ .*//' -e 's/ .*//' \
@@ -584,13 +659,13 @@ echo )
fi
fi
fi
# determine current time
time_day=''
time_month=''
time_year=''
time_monthname=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then
if [ ".$opt_e" = .yes ] && [ ".`echo $text | grep '%[DMYm]'`" != . ]; then
time_day=`date '+%d'`
time_month=`date '+%m'`
time_year=`date '+%Y' 2>/dev/null`
@@ -616,7 +691,7 @@ echo )
12) time_monthname='Dec' ;;
esac
fi
# expand special ``%x'' constructs
if [ ".$opt_e" = .yes ]; then
text=`echo $seo "$text" |\
@@ -633,7 +708,7 @@ echo )
-e "s/%Y/${time_year}/g" \
-e "s/%m/${time_monthname}/g" 2>/dev/null`
fi
# create output
if [ .$opt_n = .no ]; then
echo $seo "$text"
@@ -646,15 +721,16 @@ echo )
echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text"
fi
fi
shtool_exit 0
;;
install )
##
## install -- Install a program, script or datafile
## Copyright (c) 1997-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
## Copyright (c) 1997-2005 Ralf S. Engelschall <rse@engelschall.com>
##
# special case: "shtool install -d <dir> [...]" internally
# maps to "shtool mkdir -f -p -m 755 <dir> [...]"
if [ "$opt_d" = yes ]; then
@@ -672,11 +748,11 @@ install )
cmd="$cmd -t"
fi
for dir in "$@"; do
eval "$cmd $dir" || exit $?
eval "$cmd $dir" || shtool_exit $?
done
exit 0
shtool_exit 0
fi
# determine source(s) and destination
argc=$#
srcs=""
@@ -685,30 +761,30 @@ install )
shift
done
dstpath="$1"
# type check for destination
dstisdir=0
if [ -d $dstpath ]; then
dstpath=`echo "$dstpath" | sed -e 's:/$::'`
dstisdir=1
fi
# consistency check for destination
if [ $argc -gt 2 -a $dstisdir = 0 ]; then
if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then
echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2
exit 1
shtool_exit 1
fi
# iterate over all source(s)
for src in $srcs; do
dst=$dstpath
# if destination is a directory, append the input filename
if [ $dstisdir = 1 ]; then
dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'`
dst="$dst/$dstfile"
fi
# check for correct arguments
if [ ".$src" = ".$dst" ]; then
echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2
@@ -718,17 +794,17 @@ install )
echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2
continue
fi
# make a temp file name in the destination directory
dsttmp=`echo $dst |\
sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \
-e "s;\$;/#INST@$$#;"`
# verbosity
if [ ".$opt_v" = .yes ]; then
echo "$src -> $dst" 1>&2
fi
# copy or move the file name to the temp name
# (because we might be not allowed to change the source)
if [ ".$opt_C" = .yes ]; then
@@ -738,14 +814,14 @@ install )
if [ ".$opt_t" = .yes ]; then
echo "cp $src $dsttmp" 1>&2
fi
cp $src $dsttmp || exit $?
cp $src $dsttmp || shtool_exit $?
else
if [ ".$opt_t" = .yes ]; then
echo "mv $src $dsttmp" 1>&2
fi
mv $src $dsttmp || exit $?
mv $src $dsttmp || shtool_exit $?
fi
# adjust the target file
if [ ".$opt_e" != . ]; then
sed='sed'
@@ -755,34 +831,35 @@ install )
sed="$sed -e '$e'"
done
cp $dsttmp $dsttmp.old
eval "$sed <$dsttmp.old >$dsttmp" || exit $?
chmod u+w $dsttmp
eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $?
rm -f $dsttmp.old
fi
if [ ".$opt_s" = .yes ]; then
if [ ".$opt_t" = .yes ]; then
echo "strip $dsttmp" 1>&2
fi
strip $dsttmp || exit $?
strip $dsttmp || shtool_exit $?
fi
if [ ".$opt_o" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chown $opt_o $dsttmp" 1>&2
fi
chown $opt_o $dsttmp || exit $?
chown $opt_o $dsttmp || shtool_exit $?
fi
if [ ".$opt_g" != . ]; then
if [ ".$opt_t" = .yes ]; then
echo "chgrp $opt_g $dsttmp" 1>&2
fi
chgrp $opt_g $dsttmp || exit $?
chgrp $opt_g $dsttmp || shtool_exit $?
fi
if [ ".$opt_m" != ".-" ]; then
if [ ".$opt_t" = .yes ]; then
echo "chmod $opt_m $dsttmp" 1>&2
fi
chmod $opt_m $dsttmp || exit $?
chmod $opt_m $dsttmp || shtool_exit $?
fi
# determine whether to do a quick install
# (has to be done _after_ the strip was already done)
quick=no
@@ -793,7 +870,7 @@ install )
fi
fi
fi
# finally, install the file to the real destination
if [ $quick = yes ]; then
if [ ".$opt_t" = .yes ]; then
@@ -807,21 +884,21 @@ install )
rm -f $dst && mv $dsttmp $dst
fi
done
shtool_exit 0
;;
mkdir )
##
## mkdir -- Make one or more directories
## Copyright (c) 1996-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu>
## Cleaned up and enhanced for shtool
## Copyright (c) 1996-2005 Ralf S. Engelschall <rse@engelschall.com>
##
errstatus=0
for p in ${1+"$@"}; do
# if the directory already exists...
if [ -d "$p" ]; then
if [ ".$opt_f" = .no -a ".$opt_p" = .no ]; then
if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
echo "$msgprefix:Error: directory already exists: $p" 1>&2
errstatus=1
break
@@ -895,32 +972,32 @@ mkdir )
done
fi
done
exit $errstatus
shtool_exit $errstatus
;;
path )
##
## path -- Deal with program paths
## Copyright (c) 1998-2002 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for Apache
## Copyright (c) 1998-2005 Ralf S. Engelschall <rse@engelschall.com>
##
namelist="$*"
# check whether the test command supports the -x option
if [ -x /bin/sh ] 2>/dev/null; then
minusx="-x"
else
minusx="-r"
fi
# split path string
paths="`echo $opt_p |\
sed -e 's/^:/.:/' \
-e 's/::/:.:/g' \
-e 's/:$/:./' \
-e 's/:/ /g'`"
# SPECIAL REQUEST
# translate forward to reverse path
if [ ".$opt_r" = .yes ]; then
@@ -933,25 +1010,25 @@ path )
done
fi
echo $rp | sed -e 's:/$::'
exit 0
shtool_exit 0
fi
# SPECIAL REQUEST
# strip out directory or base name
if [ ".$opt_d" = .yes ]; then
echo "$namelist" |\
sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'
exit 0
shtool_exit 0
fi
if [ ".$opt_b" = .yes ]; then
echo "$namelist" |\
sed -e 's;.*/\([^/]*\)$;\1;'
exit 0
shtool_exit 0
fi
# MAGIC SITUATION
# Perl Interpreter (perl)
if [ ".$opt_m" = .yes -a ".$namelist" = .perl ]; then
if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then
rm -f $tmpfile >/dev/null 2>&1
touch $tmpfile
found=0
@@ -960,7 +1037,7 @@ path )
dir=`echo $dir | sed -e 's;/*$;;'`
nc=99
for name in perl perl5 miniperl; do
if [ $minusx "$dir/$name" -a ! -d "$dir/$name" ]; then
if [ $minusx "$dir/$name" ] && [ ! -d "$dir/$name" ]; then
perl="$dir/$name"
pv=`$perl -e 'printf("%.3f", $]);'`
echo "$pv:$pc:$nc:$perl" >>$tmpfile
@@ -974,15 +1051,15 @@ path )
perl="`cat $tmpfile | sort -r -u | sed -e 'q' | cut -d: -f4`"
rm -f $tmpfile >/dev/null 2>&1
echo "$perl"
exit 0
shtool_exit 0
fi
rm -f $tmpfile >/dev/null 2>&1
exit 1
shtool_exit 1
fi
# MAGIC SITUATION
# C pre-processor (cpp)
if [ ".$opt_m" = .yes -a ".$namelist" = .cpp ]; then
if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then
echo >$tmpfile.c "#include <assert.h>"
echo >>$tmpfile.c "Syntax Error"
# 1. try the standard cc -E approach
@@ -998,7 +1075,7 @@ path )
# 3. try a standalone cpp command in path and lib dirs
for path in $paths /lib /usr/lib /usr/local/lib; do
path=`echo $path | sed -e 's;/*$;;'`
if [ $minusx "$path/cpp" -a ! -d "$path/cpp" ]; then
if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then
cpp="$path/cpp"
break
fi
@@ -1017,30 +1094,30 @@ path )
rm -f $tmpfile.c $tmpfile.out >/dev/null 2>&1
if [ ".$cpp" != . ]; then
echo "$cpp"
exit 0
shtool_exit 0
fi
exit 1
shtool_exit 1
fi
# STANDARD SITUATION
# iterate over names
for name in $namelist; do
# iterate over paths
for path in $paths; do
path=`echo $path | sed -e 's;/*$;;'`
if [ $minusx "$path/$name" -a ! -d "$path/$name" ]; then
if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then
if [ ".$opt_s" != .yes ]; then
echo "$path/$name"
fi
exit 0
shtool_exit 0
fi
done
done
exit 1
shtool_exit 1
;;
esac
exit 0
shtool_exit 0
##EOF##
+48 -15
View File
@@ -40,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
MAJOR_VERSION=5
MINOR_VERSION=0
RELEASE_VERSION=4
EXTRA_VERSION=""
RELEASE_VERSION=5
EXTRA_VERSION="RC2"
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
dnl Define where extension directories are located in the configure context
@@ -180,6 +180,17 @@ PHP_C_BIGENDIAN
dnl Platform-specific compile settings.
dnl -------------------------------------------------------------------------
dnl See bug #28605
case $host_cpu in
alpha*)
if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -mieee"
else
CFLAGS="$CFLAGS -ieee"
fi
;;
esac
case $host_alias in
*solaris*)
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
@@ -204,12 +215,13 @@ case $host_alias in
fi
;;
*netware*)
PHP_OS="NetWare"
PHP_UNAME="NetWare"
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[hardcode for each of the cross compiler host])
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[hardcode for each of the cross compiler host])
PHP_BUILD_PROGRAM
PHP_ADD_SOURCES(win32, sendmail.c, -I$CFLAGS,php)
PHP_ADD_SOURCES(/main, internal_functions.c,,PHP_GLOBAL_OBJS)
PHP_ADD_SOURCES(win32, sendmail.c, -I$CFLAGS, PHP_GLOBAL_OBJS)
PHP5LIB_SHARED_LIBADD=\$\(EXTRA_LIBS\)
EXTENSION_DIR=sys:/php$MAJOR_VERSION/ext
PHP_SUBST(PHP5LIB_SHARED_LIBADD)
PHP_SHARED_MODULE(php5lib, PHP_GLOBAL_OBJS, netware)
;;
esac
@@ -402,8 +414,7 @@ unix.h \
utime.h \
sys/utsname.h \
sys/ipc.h \
dlfcn.h \
inttypes.h
dlfcn.h
],[],[],[
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
@@ -1103,10 +1114,20 @@ EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
PHP_UNAME=`uname -a | xargs`
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
PHP_OS=`uname | xargs`
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
case $host_alias in
*netware*)
PHP_OS="NetWare"
PHP_UNAME="NetWare"
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[hardcode for each of the cross compiler host])
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[hardcode for each of the cross compiler host])
;;
*)
PHP_UNAME=`uname -a | xargs`
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
PHP_OS=`uname | xargs`
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
;;
esac
if test "$PHP_SAPI_CLI" != "no"; then
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
@@ -1143,6 +1164,7 @@ PHP_SUBST(datadir)
PHP_SUBST(sysconfdir)
PHP_SUBST(AWK)
PHP_SUBST(EXEEXT)
PHP_SUBST(CC)
PHP_SUBST(CFLAGS)
PHP_SUBST(CFLAGS_CLEAN)
@@ -1268,7 +1290,16 @@ PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \
plain_wrapper.c userspace.c transports.c xp_socket.c mmap.c)
PHP_ADD_SOURCES(/main, internal_functions.c,, sapi)
PHP_ADD_SOURCES(/main, internal_functions_cli.c,, cli)
case $host_alias in
*netware*)
PHP_ADD_BUILD_DIR(win32)
PHP_ADD_BUILD_DIR(netware)
;;
*)
PHP_ADD_SOURCES(/main, internal_functions_cli.c,, cli)
;;
esac
PHP_ADD_SOURCES(/Zend, zend_language_parser.c zend_language_scanner.c \
zend_ini_parser.c zend_ini_scanner.c)
@@ -1313,9 +1344,11 @@ AC_DEFINE([HAVE_BUILD_DEFS_H], 1, [ ])
$php_shtool mkdir -p pear/scripts
$php_shtool mkdir -p scripts
$php_shtool mkdir -p scripts/man1
ALL_OUTPUT_FILES="php5.spec main/build-defs.h \
scripts/phpize scripts/php-config \
scripts/phpize scripts/man1/phpize.1 \
scripts/php-config scripts/man1/php-config.1 \
$PHP_OUTPUT_FILES"
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
-2
View File
@@ -1,7 +1,5 @@
#if PHP_WIN32
#include "../../../../main/config.w32.h"
#elif defined(NETWARE)
#include "config.nw.h"
#else
#include <php_config.h>
#endif
+35 -45
View File
@@ -40,9 +40,6 @@
#define PHP_BZ_ERRSTR 1
#define PHP_BZ_ERRBOTH 2
/* Blocksize of the decompression buffer */
#define PHP_BZ_DECOMPRESS_SIZE 4096
function_entry bz2_functions[] = {
PHP_FE(bzopen, NULL)
PHP_FE(bzread, NULL)
@@ -438,56 +435,49 @@ PHP_FUNCTION(bzcompress)
Decompresses BZip2 compressed data */
PHP_FUNCTION(bzdecompress)
{
zval **source, /* Source data to decompress */
**zsmall; /* (Optional) user specified small */
char *dest; /* Destination buffer, initially allocated */
int error, /* Error container */
iter = 1, /* Iteration count for the compression loop */
size, /* Current size to realloc the dest buffer to */
dest_len = PHP_BZ_DECOMPRESS_SIZE, /* Size of the destination length */
small = 0, /* The actual small */
argc = ZEND_NUM_ARGS(); /* Argument count */
if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &source, &zsmall) == FAILURE) {
WRONG_PARAM_COUNT;
char *source, *dest;
int source_len, error;
long small = 0;
unsigned long long size = 0;
bz_stream bzs;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &source, &source_len, &small)) {
RETURN_FALSE;
}
convert_to_string_ex(source);
/* optional small argument handling */
if (argc > 1) {
convert_to_long_ex(zsmall);
small = Z_LVAL_PP(zsmall);
bzs.bzalloc = NULL;
bzs.bzfree = NULL;
if (BZ2_bzDecompressInit(&bzs, 0, small) != BZ_OK) {
RETURN_FALSE;
}
/* Depending on the size of the source buffer, either allocate
the length of the source buffer or the a default decompression
size */
dest = emalloc(PHP_BZ_DECOMPRESS_SIZE > Z_STRLEN_PP(source) ? PHP_BZ_DECOMPRESS_SIZE : Z_STRLEN_PP(source));
bzs.next_in = source;
bzs.avail_in = source_len;
/* (de)Compression Loop */
do {
/* Handle the (re)allocation of the buffer */
size = dest_len * iter;
if (iter > 1) {
dest = erealloc(dest, size);
}
++iter;
/* Perform the decompression */
error = BZ2_bzBuffToBuffDecompress(dest, &size, Z_STRVAL_PP(source), Z_STRLEN_PP(source), small, 0);
} while (error == BZ_OUTBUFF_FULL);
/* in most cases bz2 offers at least 2:1 compression, so we use that as our base */
bzs.avail_out = source_len * 2;
bzs.next_out = dest = emalloc(bzs.avail_out + 1);
if (error != BZ_OK) {
efree(dest);
RETURN_LONG(error);
} else {
/* we might have allocated a little to much, so erealloc the buffer
down to size, before returning it */
while ((error = BZ2_bzDecompress(&bzs)) == BZ_OK && bzs.avail_in > 0) {
/* compression is better then 2:1, need to allocate more memory */
bzs.avail_out = source_len;
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
dest = erealloc(dest, size + bzs.avail_out + 1);
bzs.next_out = dest + size;
}
if (error == BZ_STREAM_END || error == BZ_OK) {
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
dest = erealloc(dest, size + 1);
dest[size] = 0;
RETURN_STRINGL(dest, size, 0);
dest[size] = '\0';
RETVAL_STRINGL(dest, size, 0);
} else { /* real error */
efree(dest);
RETVAL_LONG(error);
}
BZ2_bzDecompressEnd(&bzs);
}
/* }}} */
+11 -19
View File
@@ -246,6 +246,11 @@ PHP_FUNCTION(cal_days_in_month)
sdn_start = calendar->to_jd(year, month, 1);
if (sdn_start == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid date.");
RETURN_FALSE;
}
sdn_next = calendar->to_jd(year, 1 + month, 1);
if (sdn_next == 0) {
@@ -261,7 +266,7 @@ PHP_FUNCTION(cal_days_in_month)
Converts from a supported calendar to Julian Day Count */
PHP_FUNCTION(cal_to_jd)
{
long cal, month, day, year, jdate;
long cal, month, day, year;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llll", &cal, &month, &day, &year) != SUCCESS) {
RETURN_FALSE;
@@ -272,8 +277,7 @@ PHP_FUNCTION(cal_to_jd)
RETURN_FALSE;
}
jdate = cal_conversion_table[cal].to_jd(year, month, day);
RETURN_LONG(jdate);
RETURN_LONG(cal_conversion_table[cal].to_jd(year, month, day));
}
/* }}} */
@@ -342,15 +346,12 @@ PHP_FUNCTION(jdtogregorian)
PHP_FUNCTION(gregoriantojd)
{
long year, month, day;
int jdate;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
jdate = GregorianToSdn(year, month, day);
RETURN_LONG(jdate);
RETURN_LONG(GregorianToSdn(year, month, day));
}
/* }}} */
@@ -378,15 +379,12 @@ PHP_FUNCTION(jdtojulian)
PHP_FUNCTION(juliantojd)
{
long year, month, day;
int jdate;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
jdate = JulianToSdn(year, month, day);
RETURN_LONG(jdate);
RETURN_LONG(JulianToSdn(year, month, day));
}
/* }}} */
@@ -529,15 +527,12 @@ PHP_FUNCTION(jdtojewish)
PHP_FUNCTION(jewishtojd)
{
long year, month, day;
int jdate;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
jdate = JewishToSdn(year, month, day);
RETURN_LONG(jdate);
RETURN_LONG(JewishToSdn(year, month, day));
}
/* }}} */
@@ -565,15 +560,12 @@ PHP_FUNCTION(jdtofrench)
PHP_FUNCTION(frenchtojd)
{
long year, month, day;
int jdate;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll", &month, &day, &year) == FAILURE) {
RETURN_FALSE;
}
jdate = FrenchToSdn(year, month, day);
RETURN_LONG(jdate);
RETURN_LONG(FrenchToSdn(year, month, day));
}
/* }}} */
+2 -2
View File
@@ -398,7 +398,7 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
default:
desc = php_win_err(hr);
spprintf(&msg, 0, "Error %s", desc);
spprintf(&msg, 0, "Error [0x%08x] %s", hr, desc);
LocalFree(desc);
break;
}
@@ -620,7 +620,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
efree(vargs);
}
/* a bit strange this, but... */
/* a bit of a hack this, but it's needed for COM array access. */
if (hr == DISP_E_BADPARAMCOUNT)
return hr;
+2 -2
View File
@@ -194,12 +194,12 @@ PHP_MINIT_FUNCTION(com_dotnet)
INIT_CLASS_ENTRY(ce, "com_exception", NULL);
php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(), NULL TSRMLS_CC);
php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
// php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED;
/* php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
INIT_CLASS_ENTRY(ce, "com_safearray_proxy", NULL);
php_com_saproxy_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
php_com_saproxy_class_entry->ce_flags |= ZEND_ACC_FINAL;
// php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED;
/* php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
php_com_saproxy_class_entry->get_iterator = php_com_saproxy_iter_get;
INIT_CLASS_ENTRY(ce, "variant", NULL);
+22 -49
View File
@@ -49,7 +49,7 @@ static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC)
convert_to_string_ex(&member);
res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC);
DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC);
if (res == SUCCESS) {
php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC);
@@ -84,30 +84,6 @@ static void com_property_write(zval *object, zval *member, zval *value TSRMLS_DC
}
}
static HRESULT com_get_default_binding(php_com_dotnet_object *obj TSRMLS_DC)
{
VARDESC *vardesc;
int i;
if (!obj->typeinfo) {
return FAILURE;
}
for (i = 0; !obj->have_default_bind; i++) {
if (FAILED(ITypeInfo_GetVarDesc(obj->typeinfo, i, &vardesc))) {
return FAILURE;
}
if (vardesc->wVarFlags & VARFLAG_FDEFAULTBIND) {
obj->default_bind = (DISPID)vardesc->memid;
obj->have_default_bind = 1;
}
ITypeInfo_ReleaseVarDesc(obj->typeinfo, vardesc);
}
return obj->have_default_bind ? SUCCESS : FAILURE;
}
static zval *com_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
{
zval *return_value;
@@ -122,14 +98,9 @@ static zval *com_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
obj = CDNO_FETCH(object);
if (V_VT(&obj->v) == VT_DISPATCH) {
if (!obj->have_default_bind && !com_get_default_binding(obj TSRMLS_CC)) {
php_com_throw_exception(E_INVALIDARG, "this COM object has no default property" TSRMLS_CC);
return return_value;
}
VariantInit(&v);
if (SUCCESS == php_com_do_invoke_by_id(obj, obj->default_bind,
if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE,
DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 1, &offset TSRMLS_CC)) {
php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC);
VariantClear(&v);
@@ -163,17 +134,12 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
obj = CDNO_FETCH(object);
if (V_VT(&obj->v) == VT_DISPATCH) {
if (!obj->have_default_bind && !com_get_default_binding(obj TSRMLS_CC)) {
php_com_throw_exception(E_INVALIDARG, "this COM object has no default property" TSRMLS_CC);
return;
}
args[0] = offset;
args[1] = value;
VariantInit(&v);
if (SUCCESS == php_com_do_invoke_by_id(obj, obj->default_bind,
if (SUCCESS == php_com_do_invoke_by_id(obj, DISPID_VALUE,
DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args TSRMLS_CC)) {
VariantClear(&v);
}
@@ -524,23 +490,19 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
php_com_dotnet_object *obj;
VARIANT v;
VARTYPE vt = VT_EMPTY;
zval free_obj;
HRESULT res = S_OK;
if (should_free) {
zval_dtor(writeobj);
free_obj = *writeobj;
}
ZVAL_NULL(writeobj);
obj = CDNO_FETCH(readobj);
ZVAL_NULL(writeobj);
VariantInit(&v);
if (V_VT(&obj->v) == VT_DISPATCH) {
if (!obj->have_default_bind && !com_get_default_binding(obj TSRMLS_CC)) {
return FAILURE;
}
if (FAILURE == php_com_do_invoke_by_id(obj, obj->default_bind,
if (FAILURE == php_com_do_invoke_by_id(obj, DISPID_VALUE,
DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC)) {
return FAILURE;
}
@@ -564,12 +526,23 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
}
if (vt != VT_EMPTY) {
VariantChangeType(&v, &v, 0, vt);
res = VariantChangeType(&v, &v, 0, vt);
}
if (SUCCEEDED(res)) {
php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC);
}
php_com_zval_from_variant(writeobj, &v, obj->code_page TSRMLS_CC);
VariantClear(&v);
return SUCCESS;
if (should_free) {
zval_dtor(&free_obj);
}
if (SUCCEEDED(res)) {
return SUCCESS;
}
return FAILURE;
}
static int com_object_count(zval *object, long *count TSRMLS_DC)
+1
View File
@@ -400,6 +400,7 @@ static const struct {
{ VT_VOID, "VT_VOID" },
{ VT_PTR, "VT_PTR" },
{ VT_HRESULT, "VT_HRESULT" },
{ VT_SAFEARRAY, "VT_SAFEARRAY" },
{ 0, NULL }
};
-2
View File
@@ -37,10 +37,8 @@ typedef struct _php_com_dotnet_object {
ITypeInfo *typeinfo;
long code_page;
unsigned int have_default_bind:1;
zend_class_entry *ce;
DISPID default_bind; /* default property for array accesses */
/* associated event sink */
IDispatch *sink_dispatch;
+20 -6
View File
@@ -484,20 +484,22 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
fci.no_separation = 0;
fci.symbol_table = NULL;
ch->in_callback = 1;
error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
ch->in_callback = 0;
if (error == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION");
length = -1;
} else {
} else if (retval_ptr) {
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
convert_to_long_ex(&retval_ptr);
}
length = Z_LVAL_P(retval_ptr);
zval_ptr_dtor(&retval_ptr);
}
zval_ptr_dtor(argv[0]);
zval_ptr_dtor(argv[1]);
zval_ptr_dtor(&retval_ptr);
break;
}
}
@@ -554,20 +556,22 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
fci.no_separation = 0;
fci.symbol_table = NULL;
ch->in_callback = 1;
error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
ch->in_callback = 0;
if (error == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_READFUNCTION");
} else {
} else if (retval_ptr) {
if (Z_TYPE_P(retval_ptr) == IS_STRING) {
length = MIN(size * nmemb, Z_STRLEN_P(retval_ptr));
memcpy(data, Z_STRVAL_P(retval_ptr), length);
}
zval_ptr_dtor(&retval_ptr);
}
zval_ptr_dtor(argv[0]);
zval_ptr_dtor(argv[1]);
zval_ptr_dtor(argv[2]);
zval_ptr_dtor(&retval_ptr);
break;
}
}
@@ -625,19 +629,21 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
fci.params = argv;
fci.no_separation = 0;
ch->in_callback = 1;
error = zend_call_function(&fci, &t->fci_cache TSRMLS_CC);
ch->in_callback = 0;
if (error == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
length = -1;
} else {
} else if (retval_ptr) {
if (Z_TYPE_P(retval_ptr) != IS_LONG) {
convert_to_long_ex(&retval_ptr);
}
length = Z_LVAL_P(retval_ptr);
zval_ptr_dtor(&retval_ptr);
}
zval_ptr_dtor(argv[0]);
zval_ptr_dtor(argv[1]);
zval_ptr_dtor(&retval_ptr);
break;
}
@@ -773,6 +779,8 @@ static void alloc_curl_handle(php_curl **ch)
(*ch)->handlers->write_header = ecalloc(1, sizeof(php_curl_write));
(*ch)->handlers->read = ecalloc(1, sizeof(php_curl_read));
(*ch)->in_callback = 0;
memset(&(*ch)->err, 0, sizeof((*ch)->err));
zend_llist_init(&(*ch)->to_free.str, sizeof(char *), (void(*)(void *)) curl_free_string, 0);
@@ -1468,6 +1476,12 @@ PHP_FUNCTION(curl_close)
}
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
if (ch->in_callback) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to close CURL handle from a callback");
return;
}
if (ch->uses) {
ch->uses--;
} else {
+1
View File
@@ -121,6 +121,7 @@ typedef struct {
php_curl_handlers *handlers;
long id;
unsigned int uses;
zend_bool in_callback;
} php_curl;
typedef struct {
+1 -1
View File
@@ -258,7 +258,7 @@ AC_ARG_WITH(db4,
break
fi
done
PHP_DBA_DB_CHECK(4, db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
PHP_DBA_DB_CHECK(4, db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
fi
])
AC_DBA_STD_RESULT(db4,Berkeley DB4)
+5 -1
View File
@@ -10,7 +10,11 @@ if test -z "$PHP_LIBXML_DIR"; then
[ --with-libxml-dir[=DIR] DOM: libxml2 install prefix.], no, no)
fi
if test "$PHP_DOM" != "no" && test "$PHP_LIBXML" != "no"; then
if test "$PHP_DOM" != "no"; then
if test "$PHP_LIBXML" = "no"; then
AC_MSG_ERROR([DOM extension requires LIBXML extension, add --enable-libxml])
fi
PHP_SETUP_LIBXML(DOM_SHARED_LIBADD, [
AC_DEFINE(HAVE_DOM,1,[ ])
Loaded 100 of 491 files, more files were not shown because too many files have changed in this diff. Show more