Compare commits

..
414 Commits
Author SHA1 Message Date
SVN Migration 095b48f772 This commit was manufactured by cvs2svn to create tag 'php_5_0_1'. 2004-08-12 20:39:37 +00:00
Andi Gutmans d8c1e99f02 - Roll 5.0.1 2004-08-12 20:39:36 +00:00
Chuck Hagenbuch 8d0cc271bf More spaces -> tabs. 2004-08-12 19:32:18 +00:00
Ilia Alshanetsky bbde60d6d2 MFH: Properly fix the msgno check inside imap_fetchbody(). 2004-08-12 19:20:17 +00:00
Chuck Hagenbuch e2b820f0ea MFH: fix. 2004-08-12 18:02:03 +00:00
Derick Rethans c970dbb647 - Reorder a bit and add . 2004-08-12 07:25:32 +00:00
Andi Gutmans 29c32f04e3 - Back to -dev 2004-08-12 06:39:26 +00:00
Andi Gutmans 00c6777aa1 - 5.0.1RC2 2004-08-12 06:35:22 +00:00
Magnus M��tt� 143ae77156 Add missing NEWS entry (bug 29147). 2004-08-12 05:42:13 +00:00
Marcus Boerger 87ba25b722 MFH: Change to use md5_file() 2004-08-12 00:38:12 +00:00
Ilia Alshanetsky dc77b5700c MFH: Fixed memory leak. 2004-08-11 23:25:52 +00:00
Ilia Alshanetsky 0e5c01290d Fixed bug #29607 (highlighting code with HEREDOC produces invalid output). 2004-08-11 22:38:31 +00:00
Derick Rethans ba16543ef5 - Tix Fypo 2004-08-11 15:23:00 +00:00
Derick Rethans f65e4feda4 - MFH: Added a notice to getimagesize in case zlib is not available and a
compressed SWF movie has been passed to the function.
2004-08-11 12:31:37 +00:00
Derick Rethans 20181fde3d - Reworded this a bit 2004-08-11 12:24:41 +00:00
Christian Stocker 491ed1813e MFH (fix test) 2004-08-11 08:24:41 +00:00
Derick Rethans caa5dbe679 - MFH: Patch to allow the Zend memory allocators to be disabled. 2004-08-11 06:13:12 +00:00
Sara Golemon 7e6d72f030 MFH: Fix format specifiers 2004-08-11 04:29:26 +00:00
Sara Golemon 6ea962c767 MFH: $errmsg should have been forced reference 2004-08-11 04:10:44 +00:00
Marcus Boerger c87b2d0cee BFN (small but important change) 2004-08-10 22:40:14 +00:00
Ilia Alshanetsky c2c31547c2 Bug fixing news. 2004-08-10 22:17:31 +00:00
Ilia Alshanetsky 21851b0001 MFH: Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then
returning the value).
2004-08-10 22:16:50 +00:00
Dmitry Stogov bd96cca64f Fixed bug #28969 (Wrong data encoding of special characters) 2004-08-10 16:30:31 +00:00
SVN Migration 02893ad216 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-10 16:18:09 +00:00
Wez Furlong 4f88703159 BFN 2004-08-10 13:47:30 +00:00
Wez Furlong abc62474bf MFH: Fix for #29256 2004-08-10 13:45:58 +00:00
Christian Stocker 3a9754715a MFH (Fix segfault on error in xslt) 2004-08-10 08:02:00 +00:00
Andi Gutmans 2f212ab8d5 - Back to -dev 2004-08-10 07:28:09 +00:00
Andi Gutmans 71be1ed5f1 - 5.0.1RC1 2004-08-10 07:17:05 +00:00
Moriyoshi Koizumi 1c6896076f - Bugfix #29493 (extract(array, EXTR_REFS) misbehaves with elements referred
twice or more times)
2004-08-10 06:01:20 +00:00
Andi Gutmans 6a2d265af6 - The documentation team has re-wroten the installation part of the manual. 2004-08-10 05:36:12 +00:00
Ilia Alshanetsky 6fe9c3735a MFH: Fixed bug #29581 (Typo inside php.ini comments for mysql.trace_mode). 2004-08-10 00:44:23 +00:00
Andi Gutmans 5d43cf4ec4 - Update NEWS 2004-08-09 22:24:10 +00:00
Andi Gutmans 8b3b1eb121 Update credits for php docs 2004-08-09 21:53:19 +00:00
Dmitry Stogov 836a7b1a88 Included ext/soap fixes from CVS HEAD. 2004-08-09 05:50:06 +00:00
Georg Richter c26edafb17 fixed bug #29577 (MYSQLI_CLIENT_FOUND_ROWS undefined) 2004-08-09 04:33:40 +00:00
Ilia Alshanetsky a9bf810ba2 Remove \r characters from file. 2004-08-08 21:25:55 +00:00
Christian Stocker a737e92b08 Fixed bug #29573. 2004-08-08 18:09:46 +00:00
Christian Stocker 54ae55a949 MFH (fix for Bug #29573 : Segmentation fault when php function(called from XSLT templat) throw exception
and Zero Byte Memory Leaks)
2004-08-08 18:05:47 +00:00
Wez Furlong 5ab53094fa BFN 2004-08-07 21:04:51 +00:00
Wez Furlong aff24aed0d MFH: Fix for Bug #29490 from Michael Sisolak 2004-08-07 21:01:43 +00:00
Sara Golemon b915644ec4 MFH ZTS Fix 2004-08-06 17:35:59 +00:00
Wez Furlong 28c71a667a MFH: avoid possible segfault with stream_socket_client and bogus flags. 2004-08-06 14:18:49 +00:00
Ilia Alshanetsky d45c4f86d3 MFH: php_error() -> php_error_docref() 2004-08-05 23:57:53 +00:00
Edin Kadribasic 8060534f63 MFH: Export php_libxml_error_handler for windows build (#29541) 2004-08-05 21:03:15 +00:00
Antony Dovgal 80bdf7eae5 MFH: remove all references to @ thing, as it's not recommended 2004-08-05 14:19:59 +00:00
Ilia Alshanetsky 2dad2b3882 MFH: Eliminate unneeded variable. 2004-08-05 00:44:32 +00:00
Frank M. Kromann aa0a80bea8 Revert. ADD_EXTENSION_DEP is available in this branch! 2004-08-04 19:22:12 +00:00
Frank M. Kromann dec171c4bf No extension dependency in this branch 2004-08-04 17:22:14 +00:00
Frank M. Kromann 6d5779844f MFH: Move iconv exports to the iconv extension and make libxml depend on iconv 2004-08-04 17:13:11 +00:00
SVN Migration 94ed0368b9 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-04 16:46:49 +00:00
Zeev Suraski 6c8d9c8c8e Fix prototypes 2004-08-04 16:39:56 +00:00
Zeev Suraski 9de0be49d6 Fix prototypes 2004-08-04 14:40:53 +00:00
Georg Richter 5a76218edd fixed bug #29522 2004-08-04 13:02:40 +00:00
Marcus Boerger d84c321376 MFH missing part 2004-08-04 10:32:43 +00:00
Ilia Alshanetsky b3262ff512 MFH: Fixed argument handling in sun* functions. 2004-08-04 00:28:05 +00:00
Edin Kadribasic a825563c0b Typofix 2004-08-03 22:56:15 +00:00
Edin Kadribasic da476e0da9 MFH 2004-08-03 22:50:18 +00:00
Marcus Boerger 46107c39a4 MFH 2004-08-03 17:10:58 +00:00
Marcus Boerger a263d88c81 BFN 2004-08-03 17:07:56 +00:00
Marcus Boerger 9158cd2494 - MFH Bug #29505 get_class_vars() severely broken when used with arrays 2004-08-03 17:02:35 +00:00
SVN Migration 2e98f2dd1a This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-03 16:59:54 +00:00
Antony Dovgal 902b4bda6a MFH: typo in ini parameter name 2004-08-03 06:26:59 +00:00
Antony Dovgal 87b52bb5cd MFH: fix typo in php.ini-dist & php.ini-recommended 2004-08-03 06:21:17 +00:00
Greg Beaver e6199b5279 commit for win32 - binary so line endings are always preserved - ..and in PHP_5_0, where it also belongs 2004-08-03 04:36:56 +00:00
SVN Migration e7f995106c This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-03 04:36:01 +00:00
Ilia Alshanetsky 3bcb1f3af1 MFH: Allow sqlite_fetch_column_types() to properly handle table names with
spaces in them.
2004-08-02 22:43:42 +00:00
Marcus Boerger 13a652c81c MFH Change to use memcmp instead of strcmp 2004-08-02 22:43:16 +00:00
Ilia Alshanetsky 5ddd062e36 MFH: A gentler (performance wise) allocation of buffer for temp variables. 2004-08-02 02:35:03 +00:00
Marcus Boerger 4bedc6bb31 - Add new tests 2004-08-01 21:55:58 +00:00
Marcus Boerger 70f94e52ea - Enforce protocol on magic methods/functions 2004-08-01 21:55:39 +00:00
Wez Furlong 87c3363fa9 MFH usleep fix, and BFN. 2004-08-01 00:35:11 +00:00
Wez Furlong ca1dc06e04 MFH: zts fix 2004-07-31 16:37:18 +00:00
Wez Furlong b5ed0a1d3d MFH: streams fixes 2004-07-31 11:00:11 +00:00
Wez Furlong 19c8eeb4e8 MFH: zts fix for ini entries and dl() 2004-07-30 15:05:02 +00:00
Wez Furlong 293e62c99d MFH: win32 zts fix 2004-07-30 14:39:18 +00:00
Wez Furlong 2da7dd5982 MFH: various ZTS fixes 2004-07-30 14:24:59 +00:00
Edin Kadribasic 6325b1b630 MFH 2004-07-30 12:40:54 +00:00
Edin Kadribasic 9244e0eee1 MFH 2004-07-30 09:59:06 +00:00
Edin Kadribasic 712d951ffc MFH 2004-07-30 09:30:30 +00:00
Ilia Alshanetsky 40773632e0 MFH: Fixed bug #29443 (Sanity check for wbmp detection). 2004-07-30 01:10:42 +00:00
Edin Kadribasic 88628a2319 MFH 2004-07-29 22:26:52 +00:00
Edin Kadribasic 31120ba5f7 MFH: Fix informix compilation on Windows (bug #29340) 2004-07-29 21:12:47 +00:00
Timm Friebe 75276870db - MFH:
. Fixed bug #29064 (Exact numeric/decimal/money datatypes lose precision)
  . Fixed bug #27843 (sybase_query() triggers (spurious?) notices when
    query is a stored procedure)
  . Fixed multiple memory leaks with sybase_unbuffered_query()
  . Changed sybase_query() to ignore store_results = false in  buffering
    mode, it would yield unpredictable results
  . Fixed sybase_unbuffered_query() when used with store_results = false
  . Changed sybase_fetch_object() to ignore second argument when passed
    as NULL
  . Made sybase_data_seek() error message more verbose
  . Fixed memory leak in shutdown when not all rows where selected in an
    unbuffered query
# sort of, empty_string -> STR_EMPTY_ALLOC patch ommitted
2004-07-29 20:05:46 +00:00
SVN Migration fc0b122460 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-07-29 03:58:02 +00:00
Ilia Alshanetsky d976c362ac MFH: Fixed but #29437 (Possible crash inside array_walk_recursive()). 2004-07-29 00:35:12 +00:00
Wez Furlong 6c82c26884 BFN 2004-07-29 00:17:01 +00:00
Wez Furlong a0ef3e1865 MFH: #29431 2004-07-28 23:53:04 +00:00
Wez Furlong 4f91645642 MFH:
#29258: variant_date_from_timestamp() does not honour timezone
#29392: com_dotnet crashes when echo'ing an object
2004-07-28 23:48:26 +00:00
Wez Furlong 46b2bef868 Moved to PECL 2004-07-28 23:39:36 +00:00
Ilia Alshanetsky 26319ee1a1 MFH: Better address availability check. 2004-07-28 23:34:30 +00:00
Ilia Alshanetsky 42a8242676 MFH: Fixed possible crash in stream_socket_recvfrom() when length
parameter has a negative value.
2004-07-28 23:21:56 +00:00
Marcus Boerger 57ab773c70 MFH 2004-07-28 22:55:26 +00:00
Andi Gutmans 219364ee55 - Fix MAC OSX to always use native DSO loading 2004-07-28 19:07:26 +00:00
Christian Stocker 8b5fc29c7a MFH
Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob)
2004-07-28 12:42:16 +00:00
Ilia Alshanetsky 21f4b69b2b MFH: Fixed bug #29342 (strtotime() does not handle empty date string
properly).
2004-07-28 01:44:41 +00:00
Ilia Alshanetsky f76ce400eb MFH: Fixed bug 29395 (sqlite_escape_string() returns bogus data on empty
strings).
2004-07-27 16:40:46 +00:00
Ilia Alshanetsky 16204148bb MFH: Added missing comma. 2004-07-27 12:44:35 +00:00
Ilia Alshanetsky 1f2d017ae1 MFH: Fixed bug #29349 (imagecreatefromstring() crashes with external GD
library).
2004-07-27 00:27:07 +00:00
Georg Richter 1b10ad424a MFH: fixed bug 29335 2004-07-26 07:22:01 +00:00
Georg Richter 3e65f6bf57 MFH: fixed bug in mysqli->client_version 2004-07-26 05:45:41 +00:00
Marcus Boerger f84d03b2bc - Update/Add tests 2004-07-25 19:35:30 +00:00
SVN Migration 2db28891e4 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-07-25 19:21:22 +00:00
Ilia Alshanetsky 7adc26fd8b MFH: Fixed bug #29369 (Uploaded files with ' or " in their names get their
names truncated at those characters).
2004-07-25 19:19:28 +00:00
Marcus Boerger fe80df5446 BFN 2004-07-25 17:38:44 +00:00
Marcus Boerger 8588815ef3 - MFH: Fix bug #29368 : The destructor is called when an exception is
thrown from the constructor
2004-07-25 17:37:55 +00:00
Georg Richter a70fc67b0b fixed bug #29311 2004-07-23 12:48:20 +00:00
SVN Migration b5c53ae6c7 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-07-23 12:47:37 +00:00
Edin Kadribasic 3d018fb061 MFB: Updated version number 2004-07-23 02:28:36 +00:00
Ilia Alshanetsky 3845e2c145 MFH: Fixed bug #29333 (output_buffering + trans_sess_id can corrupt output) 2004-07-23 02:05:51 +00:00
Stefan Esser 1930c2c33b MFH 2004-07-22 22:59:11 +00:00
SVN Migration 1e2b92b517 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-07-22 22:39:01 +00:00
Marcus Boerger 983fa5a21e Fix testcase 2004-07-22 18:39:45 +00:00
Georg Richter 3ecbb5c314 MFH: changed warning (bug #29298) for outdated client library 2004-07-22 07:25:31 +00:00
Sara Golemon 8fa1628958 MFH: This should fix binary safety for bound results. 2004-07-22 03:26:59 +00:00
Edin Kadribasic e52b580cad MFH: Fix for #28929 by Michael Sisolak 2004-07-21 22:53:27 +00:00
Edin Kadribasic 4b28e0a8f1 MFH: Build fix 2004-07-21 22:22:21 +00:00
Ilia Alshanetsky 91f5ceb3be MFH: Fixed bug #29209 (imap_fetchbody() doesn't check message index). 2004-07-21 21:57:09 +00:00
Marcus Boerger 603758b484 BFN 2004-07-21 18:38:23 +00:00
Marcus Boerger b6b575c1d5 MFH: Fixded #29291: get_class_vars() return names with NULLs 2004-07-21 18:37:36 +00:00
Christian Stocker e2f3142c78 MFH. Fix for Bug 29010 "make test does not wait to email address" (by Sebastian Nohn) 2004-07-21 11:20:33 +00:00
Ilia Alshanetsky 7623887079 MFH: Abort earlier on invalid format. 2004-07-21 00:14:50 +00:00
Moriyoshi Koizumi 1bd6ec4c91 - MFH (ctype.c: 1.31): Correct range checks.
- MFH (ctype.c: 1.31): Normalize negative values.
2004-07-20 20:09:27 +00:00
Moriyoshi Koizumi 33a6aefce8 oops... 2004-07-20 19:36:00 +00:00
Marcus Boerger d3f8aaecd8 BFN 2004-07-20 19:30:09 +00:00
Marcus Boerger 049cca1711 MFH 2004-07-20 19:25:18 +00:00
Moriyoshi Koizumi a40df45348 - MFH (iconv.c: 1.119): Fix possible leaks / segfaults in persistent iconv
filter.
2004-07-20 18:48:23 +00:00
Marcus Boerger 8f42eaae01 BFN 2004-07-20 18:25:48 +00:00
Marcus Boerger ebeefd9f7d MFH bugfix 28895 2004-07-20 18:23:49 +00:00
Moriyoshi Koizumi 646f9a4a8b - MFH (filters.c: 1.41): Add more null checks. 2004-07-20 18:17:07 +00:00
Moriyoshi Koizumi b4fa1661af - MFH (filters.c: 1.40): pemalloc() might return NULL 2004-07-20 18:04:36 +00:00
Stanislav Malyshev ba3c63dbc9 export ini parser 2004-07-20 08:45:04 +00:00
Sebastian Bergmann 350535d498 BFN: Fixed ReflectionClass::getMethod() and ReflectionClass::getProperty() to raise an ReflectionException instead of returning NULL on failure. 2004-07-20 05:48:45 +00:00
Ilia Alshanetsky 467caa4307 MFH: Fixed bug #29226 (ctype_* functions missing validation of numeric
string representations).
2004-07-20 01:03:18 +00:00
Sergey Kartashoff 01b6956d61 - A Bug #29147 was fixed. Thanks to Antony Dovgal <tony2001 at phpclub.net>
for his patch.
2004-07-19 19:46:52 +00:00
Marcus Boerger 61c3a669b4 - MFH protos and error message 2004-07-19 19:24:37 +00:00
Moriyoshi Koizumi befb6e9b80 - MFH (bug29119.phpt: 1.2): Fix test name 2004-07-19 18:49:46 +00:00
Moriyoshi Koizumi 35e43dabe1 - MFH (html.c: 1.98, bug29199.phpt: 1.1): Fix bug #29199 (html_entity_decode()
misbehaves with UTF-8)
2004-07-19 17:53:00 +00:00
SVN Migration b905779950 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-07-19 17:51:42 +00:00
Moriyoshi Koizumi 04c32887f1 - MFH (iconv.c: 1.118): Fix a bug in iconv stream filter that prevents
pending buckets from being processed.
2004-07-19 08:35:48 +00:00
Moriyoshi Koizumi e0a39d68d8 - MFH (config.m4: 1.52): Fix VPATH build. (patch by Joe Orton) 2004-07-19 05:09:46 +00:00
Moriyoshi Koizumi 92ec8541c1 - MFH: rename php_compat.h to php_onig_compat.h to avoid name conflict.
(reported by Joe Orton, thanks.)
2004-07-19 05:06:01 +00:00
SVN Migration 82a7ef78f3 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-07-19 05:04:34 +00:00
Ilia Alshanetsky 236c42c14e MFH: Fixed bug #28633 (sprintf incorrectly adding padding to floats). 2004-07-18 17:28:04 +00:00
SVN Migration b8fdc56a8b This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-07-18 17:27:51 +00:00
Rob Richards 17ad61bd7f enable exslt support for win32 builds
WS fixes for exslt tests
2004-07-18 13:22:46 +00:00
Rob Richards ec1507ea9d add missing optional value param to createElementNS (chregu) 2004-07-18 13:15:50 +00:00
Rob Richards 69bd1f31fd Fixed bug #29221 (Segfault using DOM ownerDocument in a PHP object) 2004-07-18 11:44:25 +00:00
Moriyoshi Koizumi b9d4af72e9 - MFH (sapi_apache2.c: 1.41): request_dtor should be called if a fatal error
occurs during activation phase.
2004-07-17 21:31:43 +00:00
Sara Golemon fbbc036830 BFN 2004-07-16 23:45:21 +00:00
Sara Golemon c2b0fdd647 MFH: convert.* filters not consuming buckets_in on PSFS_FLUSH_* 2004-07-16 23:42:00 +00:00
Marcus Boerger 3706b626fe BFN 2004-07-16 07:27:34 +00:00
Marcus Boerger edbfc48fdd MFH 2004-07-16 07:26:49 +00:00
Ilia Alshanetsky 59c6886c65 Fixed bug #28800 (strings beginning with "inf" improperly converted). 2004-07-16 02:02:09 +00:00
SVN Migration 8091552925 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-07-15 19:41:23 +00:00
Marcus Boerger 1916223883 - Fix prototype 2004-07-15 19:41:22 +00:00
Marcus Boerger f2377c4d1f Synch comments 2004-07-15 19:09:37 +00:00
Dan Kalowsky f20849d12e Bug 29058 (patch submitted by bug reporter) 2004-07-15 15:09:12 +00:00
Magnus M��tt� cfc8accd3e Test for bug 26737:
Protected and private variables are not saved on serialization
when a user defined __sleep is used.
2004-07-15 11:52:04 +00:00
Antony Dovgal f6eb507b2c fix #29012 (Potential race during first connection) thanks to cjbj at hotmail dot com 2004-07-15 11:00:14 +00:00
Ilia Alshanetsky a75608c1de Fixed Bug #29075 (strnatcmp() incorrectly handles whitespace).
# Original Patch by: curt@php.net
2004-07-15 01:26:03 +00:00
5a9875f293 ChangeLog update 2004-07-15 00:33:10 +00:00
Edin Kadribasic 546e5bbc43 Made php -m output sorted case-insensitevly 2004-07-14 22:30:29 +00:00
Stefan Esser 90f151470c same bug. 2004-07-14 09:55:24 +00:00
Derick Rethans edce707f3b - Fixed text. 2004-07-14 09:54:02 +00:00
Stefan Esser 446f4d1bc2 Security Fix broken! Destroyed Basic auth. Blame: me
4.3.x not affected
2004-07-14 09:43:26 +00:00
Stanislav Malyshev d673ec0184 be consistent with write_dimension 2004-07-14 09:04:13 +00:00
Stanislav Malyshev 28d72ce2fd fix #28957 2004-07-14 09:01:58 +00:00
John Coggeshall 51ae1cc7bd Changing the Tidy version to 2.0 2004-07-14 02:41:53 +00:00
12c826c2e7 ChangeLog update 2004-07-14 00:33:30 +00:00
Sara Golemon c4bf45e39a Bugfix# 28829 bcmath values for 0, 1, and 2 initialized/freed at wrong time for threaded sapis. 2004-07-14 00:14:43 +00:00
Zeev Suraski 2ec89aa8e1 Add {{{ proto's 2004-07-13 20:41:55 +00:00
Andi Gutmans c18badbfbf - 5.0.1-dev 2004-07-13 19:56:49 +00:00
Marcus Boerger 1ea22c9004 Bugfix #29116 Zend constant warning uses memory after free (jdolecek at NetBSD dot org) 2004-07-13 19:22:11 +00:00
Andi Gutmans 399e2ca69f - Roll PHP 5.0.0 2004-07-13 19:05:31 +00:00
Wez Furlong cfb84391d0 add missing break 2004-07-13 17:14:49 +00:00
Georg Richter bfd3c9ecfb prototype fixes 2004-07-13 17:04:16 +00:00
Rob Richards d64a00da04 initial xmlwriter code 2004-07-13 17:01:30 +00:00
Wez Furlong 971fcd4254 Looks like Sara forgot to change this too. 2004-07-13 16:34:56 +00:00
Georg Richter f61dbf06a1 changed mysqli_stmt_reset (returns now bool instead of void) 2004-07-13 16:12:28 +00:00
Stefan Esser 0b9d614988 Fixed typo 2004-07-13 11:30:50 +00:00
Alan Knowles 6284b34e6e remove test dependance on postgres ** this still fails however 2004-07-13 07:20:45 +00:00
Alan Knowles ad2b89c9a3 ensure that test passes on systems without postgres built in. 2004-07-13 07:12:06 +00:00
196259d334 ChangeLog update 2004-07-13 00:32:43 +00:00
Wez Furlong ae40d0ef2a Fix file_get_contents() bug... 2004-07-12 20:59:24 +00:00
Timm Friebe e532feb29c - Initial release 2004-07-12 20:26:53 +00:00
Ilia Alshanetsky 905fbfd85e Added missing constant and correct bound column retrieval. When bound
columns are specified only return status (TRUE/FALSE) indicator.
2004-07-12 20:12:39 +00:00
Ilia Alshanetsky ddb32b11b2 Fixed a bug that could result in false failed query reporting on
INSERT/UPDATE/DELETE queries.
2004-07-12 20:09:19 +00:00
Ilia Alshanetsky 11371cd0a8 Missing patch. 2004-07-12 18:49:47 +00:00
Ilia Alshanetsky 7daa1cfecc Fixed bug #28999 (fixed behaviour of exec() to work as it did in 4.X). 2004-07-12 18:48:30 +00:00
Ilia Alshanetsky a8996a8ac6 Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts). 2004-07-12 17:47:29 +00:00
Ilia Alshanetsky 0ad4c5037c Touch the file so that build system does not try to rebuild it. 2004-07-12 17:44:40 +00:00
Andi Gutmans 334ddd1248 - Convert zend_class_entry -> zend_class_entry * 2004-07-12 16:38:45 +00:00
Christian Stocker 14a61929b9 implement the clone code for the XSLTProcessor object and fix #29108
"xslt segfaults when ze1_compatibility_mode is on" (By Rob Richards)
2004-07-12 13:04:01 +00:00
Antony Dovgal 08486a0ea3 fix #28978 (multiple OCIBindByName on the same placeholder eats memory) 2004-07-12 07:40:05 +00:00
83e4bb727b ChangeLog update 2004-07-12 00:32:48 +00:00
Andrey Hristov c401890d17 reorder + add 2004-07-11 21:41:33 +00:00
Andrey Hristov 0eef82a733 fixing bug #28974 : overflow in array_slice()
The same kind of overflow appeared in array_splice(), substr() and
substr_replace()
2004-07-11 21:15:04 +00:00
Stefan Esser 0e8de752fd Ooups... 2004-07-11 21:14:50 +00:00
Stefan Esser 8c075de7c7 Fixed: PARSE_TYPE parameter to input_filter
Fixed: input_filter should also be able to filter empty variables by name
2004-07-11 20:13:39 +00:00
Andrey Hristov 268d3d7ba3 fixing bug #28739
array_*diff() and array_*intersect() not clearing the fci cache before work.
FCI call cache was introduced in HEAD. All functions that perform sorting
of arrays clear the fci cache before work. array_*diff() and\ array_*intersect()
were somehow missed to be updated.
2004-07-11 19:20:05 +00:00
Andrey Hristov bc69bdb01a fixing the name of the test 2004-07-11 18:19:43 +00:00
Andrey Hristov 7af08c0c34 fixing bug 29038:
EXTR_PREFIX_SAME is prevented from creating a new variable when the key
is a empty string. EXTR_PREFIX_ALL is also prevented from doing that,
but works for numbers.
2004-07-11 18:18:05 +00:00
Timm Friebe cd75bd4f65 - Initial release 2004-07-11 16:57:38 +00:00
Timm Friebe a14c66445a - Added simple test for float exceeding the float precision
# See bug #29064
2004-07-11 16:57:12 +00:00
Timm Friebe 1e6ccabd5f - Initial release 2004-07-11 16:31:32 +00:00
Timm Friebe d6c0fdfd2f - Initial release 2004-07-11 16:10:03 +00:00
Ilia Alshanetsky 4ebcb2ecfe Fixed bug #29008 (array_combine() does not handle non-numeric/string keys). 2004-07-11 15:23:57 +00:00
ed6ebf011b ChangeLog update 2004-07-11 00:33:01 +00:00
Jon Parise d46f8078f5 DragonFly BSD is derived from FreeBSD and requires the same floating point
precision fix.
2004-07-10 19:29:01 +00:00
Wez Furlong a0957e24b7 Fix #28402: no need for -ldl 2004-07-10 12:49:34 +00:00
Wez Furlong b52f7a01af Bump PHP 5 sqlite extension number to 2.0
(put some distance between it and the 4.3 version)
2004-07-10 12:30:18 +00:00
Wez Furlong e563b4eafa Upgrade bundled library to 2.8.14 + misc fixes
(http://www.sqlite.org/cvstrac/chngview?cn=1742)
2004-07-10 12:27:51 +00:00
Wez Furlong cd732f1a3f RIP: greedy ready problems
This allows people to use fread($fp, filesize($filename)) for regular files,
but packet-based non-greedy reads for everything else.
2004-07-10 10:54:09 +00:00
Andi Gutmans e5cfb1d05c - Better stability during premature shutdown of request startup 2004-07-10 07:46:17 +00:00
Ilia Alshanetsky 41b639fffe Fixed function proto. 2004-07-09 17:49:08 +00:00
69e20cf219 ChangeLog update 2004-07-09 00:33:24 +00:00
Ilia Alshanetsky 79c28f7618 Fixed bug #29049 (array sorting via user function/method does not validate
it).
2004-07-08 17:07:22 +00:00
Sergey Kartashoff c176a0ae20 - A bugfix in search words hilightling code (mnogosearch extension). 2004-07-08 05:22:14 +00:00
Ilia Alshanetsky f28b063c28 Last dangerous alloca() bits. 2004-07-08 01:18:43 +00:00
e080db4303 ChangeLog update 2004-07-08 00:32:27 +00:00
Edin Kadribasic 5e605e6dc2 Added memory-limit to the list of excluded force-on options 2004-07-07 12:25:10 +00:00
Georg Richter 9db1075c0e added check in config.m4 for deprecated library
added support for new 4.1.3-beta functions
	mysqli_stmt_field_count
	mysqli_stmt_attr_set
	mysqli_stmt_attr_get
removed support for deprecated/old api functions
fixed bug in constructor_get
2004-07-07 08:02:27 +00:00
1d89ed6ee3 ChangeLog update 2004-07-07 00:32:37 +00:00
Ilia Alshanetsky 5201e62d0d Fixed bug #29034 (wordwrap() returns a boolean when passed empty string). 2004-07-06 22:16:42 +00:00
Sergey Kartashoff c144fdf680 - Some fixes in mnogosearch extension 2004-07-06 19:08:45 +00:00
Marcus Boerger a2592aa5fb - Revert storing handle, got lost in 1.92, noticed by Kamesh Jayachandran
<kameshj at fastmail dot fm>
2004-07-06 18:48:39 +00:00
Ard Biesheuvel 1b4e0b81e3 Don't copy ini items to module globals
(fixed unregistered bug with mangled default_db setting)
2004-07-06 13:46:19 +00:00
Sebastian Bergmann b5aa8db6a3 Fix ZTS build. 2004-07-06 08:01:07 +00:00
Dmitry Stogov 8ad22e4279 Fixed bug #28751 (SoapServer does not call _autoload()) 2004-07-06 07:30:33 +00:00
ea5dc3d577 ChangeLog update 2004-07-06 00:33:32 +00:00
Ilia Alshanetsky 7f7f566318 Eliminate alloca() calls where they can be affected by the users. 2004-07-05 21:31:35 +00:00
Ilia Alshanetsky 2ba792cd0b Don't use alloca() where it can reached by the users. 2004-07-05 21:16:29 +00:00
Marcus Boerger c884ad017c - Bugfix: #29019 Database not closing 2004-07-05 19:36:10 +00:00
Andi Gutmans 82b4d74fd4 - Disable zend_mm for 5.0.0 2004-07-05 17:06:41 +00:00
Sascha Schumann f51ff68dfa - revert to proper behaviour 2004-07-05 11:41:31 +00:00
Moriyoshi Koizumi 8989a96789 - Add test for bug #28325. 2004-07-05 07:53:41 +00:00
447223f48a ChangeLog update 2004-07-05 00:32:17 +00:00
Ilia Alshanetsky d5fc8152f3 Eliminate potentially dangerous alloca(). 2004-07-04 17:13:58 +00:00
Ilia Alshanetsky a41a54f7fa Fixed bug #28963 (Missing space for \0 in address allocation). 2004-07-04 16:52:59 +00:00
Marcus Boerger c5b9577df8 Fix TSRM build 2004-07-04 11:14:17 +00:00
beb3674b7a ChangeLog update 2004-07-04 00:32:20 +00:00
Moriyoshi Koizumi 0f2c97f627 BFN 2004-07-03 16:14:46 +00:00
Moriyoshi Koizumi a92af73136 - Bugfix #28325 (circular reference serialisation). 2004-07-03 16:10:28 +00:00
ac3b484388 ChangeLog update 2004-07-03 00:32:18 +00:00
Andi Gutmans c3e9cd9c91 - Should fix mem leak with ZEND_MM. I made this change a while ago and
- rolled it back but I don't remember why. Please test!
2004-07-03 00:16:39 +00:00
ae5301c5d5 ChangeLog update 2004-07-02 00:32:17 +00:00
Ilia Alshanetsky 2ba0608e48 Do not use alloca() where it can be easily abused by the users.
# This probably should go into reflection code as well.
2004-07-01 16:28:32 +00:00
Sterling Hughes e8f984d77a fix bug wrt to CURLOPT_POSTFIELDS where if you passed it code like:
$fields = array('foo' => 'bar');
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_exec($ch);
as opposed to :

curl_setopt($ch, CURLOPT_POSTFIELDS, array('foo' => 'bar'));

you'll get a segv or no results, depending on the mood and cycle of the
moon.
2004-07-01 06:50:46 +00:00
Sara Golemon 76766f2d31 That hashtable should never have been an argument.... 2004-07-01 04:43:29 +00:00
d24e005477 ChangeLog update 2004-07-01 00:32:13 +00:00
Frank M. Kromann e0fe48e8a0 Fix for #28512. news entry 2004-06-30 19:51:28 +00:00
Frank M. Kromann 2067ce4079 Fix for #28512. Allocate enough space to store data 2004-06-30 19:46:57 +00:00
Ilia Alshanetsky bdfd8c60ea Another instance where alloca() is not needed. 2004-06-30 13:43:16 +00:00
Ard Biesheuvel 81dbc2fcef Fixed Ilia's alloca() issue/exploit
Removed pointless RINIT()
Use macros for consistent resource type names
2004-06-30 10:55:03 +00:00
Ilia Alshanetsky 690ca62dd3 Do not use alloca() where it can be abused through user input. 2004-06-30 01:12:06 +00:00
0850c7a348 ChangeLog update 2004-06-30 00:32:27 +00:00
Wez Furlong 8f435013ff Fix for Bug #28964 fread "greedy" behaviour 2004-06-29 21:51:53 +00:00
2aa678b088 ChangeLog update 2004-06-29 00:32:44 +00:00
Ilia Alshanetsky ed7d1e82c6 Removed pointless allocation check. 2004-06-28 22:31:28 +00:00
Sebastian Bergmann b163696106 Fix #28921 (Bad grammar in INSTALL). 2004-06-28 16:41:01 +00:00
Derick Rethans da2a1977b5 - Fixed bug with leap year checking. 2004-06-28 14:33:57 +00:00
Ard Biesheuvel 77804efa77 Revert at Derick's request 2004-06-28 11:41:08 +00:00
Ard Biesheuvel d1efeb2e58 BFN 2004-06-28 11:28:12 +00:00
Ard Biesheuvel 16e2d61435 MFB Fixed bug #28897 (-1 returned as -0.000 for 64-bit scaled int) 2004-06-28 11:27:05 +00:00
98672f41ba ChangeLog update 2004-06-28 00:33:21 +00:00
Ilia Alshanetsky 53bf5ccbea Removed unneeded if(). 2004-06-27 21:49:47 +00:00
Marcus Boerger 91f0369c80 Add more tests 2004-06-27 13:28:01 +00:00
Marcus Boerger 46e9abe602 Add more tests 2004-06-27 13:15:31 +00:00
99b5263afd ChangeLog update 2004-06-27 00:32:20 +00:00
Marcus Boerger 962b593455 BFN 2004-06-26 22:08:19 +00:00
Moriyoshi Koizumi d200a703e7 *** empty log message *** 2004-06-26 17:04:39 +00:00
Uwe Schindler 3bb7e73656 replace strncpy with strlcpy 2004-06-26 10:30:07 +00:00
Stefan Esser 59d55efb17 As long we pass values by reference this is needed. Ugly! 2004-06-26 08:09:28 +00:00
Stefan Esser ff716cbd3e Fixed input_filter functions need emalloc()ed values. 2004-06-26 07:57:37 +00:00
Stefan Esser 9e5ea7d229 strip_tags() news 2004-06-26 07:46:08 +00:00
Stefan Esser a27d5d842a IE we love you all... 2004-06-26 07:43:02 +00:00
Moriyoshi Koizumi 4eccf848ec - WS 2004-06-26 05:41:14 +00:00
Moriyoshi Koizumi b33f7ab671 - Fix bug #28466 (mbstring_convert_variables() problem). 2004-06-26 05:39:00 +00:00
f125cb60cc ChangeLog update 2004-06-26 00:32:25 +00:00
Edin Kadribasic 42f7b8026c MFB: Memory leak fix (patch by Joe Orton)
Fixes #28113. Adapted to php5 by Magnus Määttä.
2004-06-25 13:00:48 +00:00
Wez Furlong 5aa568254a export zend stream functions for zend extensions under windows 2004-06-25 12:55:11 +00:00
2f94546824 ChangeLog update 2004-06-25 00:32:18 +00:00
Sara Golemon a4032b68c6 Ease off on severity of new error (Using Resources as array offsets) 2004-06-24 16:35:34 +00:00
Ilia Alshanetsky e4e71fd8ba MFB: Fixed bug #1713 (possible crash inside tidy_get_error_buffer()). 2004-06-24 14:20:59 +00:00
Stefan Esser 476c9a3b3d Fixed zend_parse_parameters arguments... 2004-06-24 08:49:00 +00:00
Ilia Alshanetsky 81abbc66fc Added missing safe_mode & open_basedir checks. 2004-06-24 00:48:58 +00:00
ca14c9b1af ChangeLog update 2004-06-24 00:32:21 +00:00
Sara Golemon 56b153390b BugFix #28879 Inconsistent behavior between explicit and implicit array creation.
Changes:

Throw E_WARNING "Illegal offset type" when explicitly creating
array elements with objects, arrays, or resorces as indexes.
This matches implicit creation w/ obj/arr indices.

Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)"
when implicitly creating array with resource as index. (BC)
2004-06-23 23:20:44 +00:00
George Schlossnagle 9e187415f9 fix for inheritability 2004-06-23 18:06:00 +00:00
Georg Richter f063bdec06 added php_mysqli_construct_get to support __construct in extended classes 2004-06-23 16:47:25 +00:00
Ard Biesheuvel dc701bfdab Changed name to all caps 2004-06-23 13:42:06 +00:00
Ard Biesheuvel 391cbac1f2 Return all results as strings until I can convince the other guys that
it should be otherwise
2004-06-23 13:26:09 +00:00
Ard Biesheuvel 18cd69ef74 Fixed some int-long issues 2004-06-23 13:20:54 +00:00
Uwe Schindler 8327d4e2bd Addendum to bug #28878: change ini keys as PHP_INI_SYSTEM
Also: Adding "bucket" parameter to non-ini-keys, Elemination of double CONTENT_TYPE/_LENGTH environment variables
2004-06-23 13:02:01 +00:00
Dmitry Stogov 2b216967f2 Added SOAP configuration directives 2004-06-23 08:18:42 +00:00
d632106e6e ChangeLog update 2004-06-23 00:32:34 +00:00
Andrei Zmievski 279770743f MFB (better error checking in pcre_fullinfo() calls). 2004-06-22 22:21:58 +00:00
Ilia Alshanetsky 869a90f015 Fixed possible buffer overflow. 2004-06-22 20:27:46 +00:00
Alex Leigh ef81373201 Updated the author's contact information. 2004-06-22 18:08:03 +00:00
Uwe Schindler e276023d82 Fix bug #28878: php.ini values in php5_execute 2004-06-22 15:37:40 +00:00
Dmitry Stogov 4ea8f4b9f2 BUGFIX: Segfault if server's URL has no path. ("http://192.168.8.1:180") 2004-06-22 12:42:17 +00:00
c055a54343 ChangeLog update 2004-06-22 00:32:17 +00:00
Ilia Alshanetsky a3bd8bcd7b Added missing safe_mode check. 2004-06-21 22:53:52 +00:00
Sara Golemon 8f2686df35 BFN 2004-06-21 21:09:13 +00:00
Sara Golemon a2c24ae90e BugFix#28868 (Part Two): This fixes thread unsafety in the userspace
filters which relates to the fix just applied for userspace wrappers.
2004-06-21 21:08:05 +00:00
Marcus Boerger dc66fb1f10 Fixed bug #28822: ArrayObject::offsetExists() works inverted 2004-06-21 19:15:27 +00:00
Sara Golemon 7fcfa8865e BugFix#28868: Wrapper hash not thread-safe.
Userdefined wrappers were being registered into a global wrapper hash
which can cross threads.  Termination of once instance then has the
potential to leave an active stream in another instance with no wrapper
leading to segfault.
2004-06-21 18:58:55 +00:00
Dmitry Stogov d9226a1dd0 Support for HTTP redirection. 2004-06-21 12:56:33 +00:00
Tomas V.V.Cox 1fb65c4c29 More output magic on nested exceptions 2004-06-21 04:36:17 +00:00
Tomas V.V.Cox 24ec6e5a5c Be more consistent with CS 2004-06-21 04:06:18 +00:00
Tomas V.V.Cox 8957eac122 Some API changes:
- addObserver() params order switched
- signal() -> _signal()
- public:getCauseMessage() -> private:_getCauseMessage()
- some more docs
2004-06-21 03:53:39 +00:00
907bdcbc7e ChangeLog update 2004-06-21 00:32:07 +00:00
Ilia Alshanetsky a99e4b5969 Removed unneeded checks around Zend allocation macros. 2004-06-20 21:40:43 +00:00
Tomas V.V.Cox d3de81fb00 First release of the PEAR_Exception class
(dedicated to otherbird)
2004-06-20 19:08:37 +00:00
Marcus Boerger 3df3aedbe0 BFN 2004-06-20 16:49:49 +00:00
Marcus Boerger de8b457181 Fix 2nd issue of bug #28831 2004-06-20 16:46:27 +00:00
Marcus Boerger 9219b746bb BFN 2004-06-20 09:39:09 +00:00
Marcus Boerger 43b4b086db Bugfix #28851: call_user_func_array has typo in error message 2004-06-20 09:37:35 +00:00
0e6607aa51 ChangeLog update 2004-06-20 00:32:22 +00:00
Jan Lehnardt 536e7448f6 - do it right (phpize path issue) 2004-06-19 20:32:07 +00:00
Jan Lehnardt f4f844af19 - phpize now can handle directories with spaces in their name (#28847) 2004-06-19 19:39:56 +00:00
Sebastian Bergmann f0903895c1 Reflection_* -> Reflection*. Patch by Timm Friebe. 2004-06-19 16:52:04 +00:00
8586e6505f ChangeLog update 2004-06-19 00:32:22 +00:00
Sara Golemon 2f7c5d30b5 Another typo in converting array index doubles to long. 2004-06-18 18:33:46 +00:00
George Schlossnagle 6cc2073d91 tests for the crash in bug 28213 2004-06-18 18:10:52 +00:00
George Schlossnagle 6d182a8456 fix for 28213.
class_name and call_type should be reinitialized on every loop iter.
2004-06-18 17:34:58 +00:00
Martin Jansen 6910e6432a * Replaced the nonexistent word "postfix" with "suffix". 2004-06-18 14:41:01 +00:00
Sara Golemon 851b6d4475 String lengths should never be char pointers. 2004-06-18 00:44:37 +00:00
Ilia Alshanetsky 0c72b185fd Fixed possible memory leak. 2004-06-18 00:44:35 +00:00
Ilia Alshanetsky cfbf5b24b7 Fixed bug #28818 (Apache 2 sapis do not export st_dev). 2004-06-18 00:36:58 +00:00
cf8a8a3189 ChangeLog update 2004-06-18 00:32:27 +00:00
Sara Golemon 96a8b63865 String length in parse_parameters should be int 2004-06-17 18:23:47 +00:00
ad2651a74a ChangeLog update 2004-06-17 00:32:34 +00:00
Ilia Alshanetsky 23d71171cf Properly handly high ascii values in soundex(). 2004-06-17 00:17:49 +00:00
Ard Biesheuvel 5232a5afea 64-bit bugsquash party 2004-06-16 23:57:25 +00:00
Stig Bakken 6527a454c6 * don't register object on destructors list if it does not define its
own emulated destructor
2004-06-16 16:26:12 +00:00
c9908cf81d ChangeLog update 2004-06-16 00:32:45 +00:00
Stefan Esser 585628ba67 Fixed: made 3rd parameter to strrpos 64bit safe. 2004-06-15 22:38:18 +00:00
Marcus Boerger 47c72816d3 BFN 2004-06-15 20:40:58 +00:00
Marcus Boerger 4fec06587b #28789: ReflectionProperty getValue() fails on public static members 2004-06-15 20:39:49 +00:00
Pierre Joye 0f5e09c192 - Fix #1602 (reported by Cox)
Do not display var=value using config-get (easy scripting)
2004-06-15 16:48:49 +00:00
Pierre Joye 98e59d58ba - Fix licence (#1645)
- update my status there, reflecting the fact for the past 11 months
2004-06-15 16:33:46 +00:00
Ard Biesheuvel 350e5aa862 Refactored statement allocation
Added emulated support for named input parameters
2004-06-15 14:16:22 +00:00
Rob Richards 196506caa1 BFN 2004-06-15 11:51:09 +00:00
Rob Richards 7c7c353b1e Fixed bug #28771 (Segfault when using xslt and clone)
Add test case for bug #28721
2004-06-15 11:50:56 +00:00
Ard Biesheuvel f91395898c Un-revert param index fix 2004-06-15 10:22:21 +00:00
Ard Biesheuvel e48d127244 Revert (at Wez's request) 2004-06-15 10:06:41 +00:00
313c153274 ChangeLog update 2004-06-15 00:32:13 +00:00
Antony Dovgal 0a896dd987 add tests 2004-06-14 20:10:27 +00:00
Antony Dovgal 73060a89ee fix config.m4
add fold markers
2004-06-14 19:58:35 +00:00
Marcus Boerger afc5a6145c Need {} here 2004-06-14 19:09:42 +00:00
Ard Biesheuvel 2cc63714a0 Added support for fetching and binding to blob fields 2004-06-14 10:56:49 +00:00
533cdf740f ChangeLog update 2004-06-14 00:32:15 +00:00
Ard Biesheuvel 2b21476207 Release isc statement handle when dtor is called
Don't separate() bound zvals
2004-06-13 23:24:31 +00:00
Ard Biesheuvel 1d7a4ed492 Report param binding error 2004-06-13 22:09:54 +00:00
Ilia Alshanetsky d26ddca966 Standardize error reporting. 2004-06-13 17:04:36 +00:00
Pierre Joye 495925381e - Typo (#1627) (cox) 2004-06-13 14:06:01 +00:00
Ard Biesheuvel cb4612c735 Added double param type 2004-06-13 10:35:01 +00:00
Rob Richards ac772dcf53 BFN 2004-06-13 10:13:12 +00:00
Rob Richards e73d498947 Fix bug #28721 (appendChild() and insertBefore() unset DOMText) 2004-06-13 10:12:47 +00:00
7fefbbb177 ChangeLog update 2004-06-13 00:32:14 +00:00
Ard Biesheuvel e1519d6f17 GCC fixes 2004-06-12 22:17:16 +00:00
Ard Biesheuvel c84c5640e7 Revert 2004-06-12 20:52:07 +00:00
Ard Biesheuvel 6b3cda310a Added client/server info attributes 2004-06-12 18:56:07 +00:00
Ard Biesheuvel 8a3975191e Hope I finally got it right this time 2004-06-12 18:42:13 +00:00
Ard Biesheuvel a312bb5ee3 Folding markers 2004-06-12 17:09:33 +00:00
Ard Biesheuvel ad568aab6f Improved error handling
Added some comments
2004-06-12 16:58:20 +00:00
Ard Biesheuvel c8c0ddb73d Removed dependency on regular interbase extension
Added support for all datatypes except BLOBs
2004-06-12 16:07:52 +00:00
Ard Biesheuvel 1fb48b5091 Removed dependency on regular interbase extension 2004-06-12 16:05:49 +00:00
Ard Biesheuvel 216c8ffdcd Use snaps. LIB path 2004-06-12 14:59:45 +00:00
Ard Biesheuvel 15fa07f0f6 Changed LIB path 2004-06-12 10:23:31 +00:00
Greg Beaver 22fa023c88 fix bug #1610: pear package doesn't validate deps
It was never validating deps at all!
2004-06-12 06:15:55 +00:00
Greg Beaver 9873fa5e42 fix bug #1615: installer must create extension dir if it doesn't exist, patch by Tomas 2004-06-12 05:48:10 +00:00
Greg Beaver 37b73ad2d4 fix bug #1617, exception never returned from PEAR_ErrorStack->push() 2004-06-12 05:36:40 +00:00
Ard Biesheuvel c29704e066 New test 2004-06-12 03:11:16 +00:00
Ard Biesheuvel 493b89c3b1 Nearly complete implementation
No date/time fields yet ...
2004-06-12 03:09:48 +00:00
Ard Biesheuvel 39a690321a Added export macros 2004-06-12 02:49:47 +00:00
Ard Biesheuvel 50ac5db2b4 Added double param type
Added param struct initialiser
Reversed param parsing order (long <=> string)
2004-06-12 02:35:34 +00:00
Ard Biesheuvel 1e3854597c Initial revision (incomplete) 2004-06-11 01:37:06 +00:00
d0c4b3d3ec ChangeLog update 2004-06-11 00:34:13 +00:00
Ilia Alshanetsky b9fc9a6ad1 hypot() is not experimental. 2004-06-10 19:38:24 +00:00
Ilia Alshanetsky af5501027f Fixed bug #28723 (Fixed mbstring config.m4 to work on OSes where test
command does not support -e parameter).
2004-06-10 14:06:17 +00:00
Marcus Boerger 7318238236 Changed that a bit 2004-06-10 13:39:30 +00:00
Marcus Boerger 4da11644de - Require a single white-space char after /** to start a doc comment that
way we prevent /*** from becoming a doc comment (as requested Derick).
2004-06-10 13:38:31 +00:00
Marcus Boerger c756609658 Add missing declaration 2004-06-10 12:32:09 +00:00
Marcus Boerger eb0cb6f6ed Small code layout change 2004-06-10 12:11:16 +00:00
Marcus Boerger 2784cf206d BFN 2004-06-10 11:57:04 +00:00
Marcus Boerger eefdd0ea49 Do not require NEWLINE at start of doccomment 2004-06-10 11:40:34 +00:00
Marcus Boerger 17a363a8f8 BFN 2004-06-10 11:29:15 +00:00
Marcus Boerger e8e4ff0aa1 Bugfix #28699: Reflection api bugs 2004-06-10 11:28:29 +00:00
Dmitry Stogov 0282ad792a Fixed bug #28702 (SOAP does not parse WSDL service address correctly). 2004-06-10 09:07:09 +00:00
622f7679f7 ChangeLog update 2004-06-10 00:32:42 +00:00
Frank M. Kromann 36702d5f41 Allow compilation on Win32.
Need to implement a few Windows specific functions.
2004-06-09 19:27:36 +00:00
Marcus Boerger bd05792560 BFN 2004-06-09 19:26:55 +00:00
Marcus Boerger 4213153365 Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP 2004-06-09 19:25:42 +00:00
Ilia Alshanetsky f0ffe7c85b Fixed bug #28175 (Allow bundled GD to compile against freetype 2.1.2). 2004-06-09 14:50:05 +00:00
Ilia Alshanetsky 3e638c84c0 Fixed bug #28525 (gmp_powm() does not work with hexadecimal string modulo
represented as a string).
Patch by: pickett at sumu dot org
2004-06-09 14:39:33 +00:00
Ilia Alshanetsky ccc580f408 Fixed memory leak on error in win32's opendir() emulation. (Patch by Wez) 2004-06-09 14:18:14 +00:00
1f73efcaab ChangeLog update 2004-06-09 00:32:35 +00:00
Ard Biesheuvel 4713ce294d Interbase news 2004-06-08 20:25:49 +00:00
Greg Beaver 1f20b7a626 partial fix, bug #1163: rpm build doesn't build properly 2004-06-08 18:26:20 +00:00
Greg Beaver d14e259823 fix bug #1550: Builder does not set path to match bin_dir 2004-06-08 18:15:11 +00:00
Greg Beaver 29a09f984c fix bug #1378: user/pass must be urldecoded from parse_url in Remote.php 2004-06-08 18:03:46 +00:00
Greg Beaver 628e5530b9 fix bug #1153: PEAR command doesn't work after upgrading
reverting earlier fix - people must have register_argc_argv=on set in php.ini for PEAR to work.
2004-06-08 17:56:22 +00:00
Greg Beaver b175cdfd71 fix bug #1581: unhelpful error message if "pear blatch" is typed 2004-06-08 17:49:19 +00:00
Ilia Alshanetsky 49fb6260b6 Fixed bug #1580 (Tidy configuration settings leak memory). 2004-06-08 14:55:14 +00:00
Ilia Alshanetsky b8c9e83664 Fixed bug #28692 (\0 in Authenticate header passed via safe_mode). 2004-06-08 13:23:38 +00:00
Ard Biesheuvel 4ea43fe019 ... back from the dead 2004-06-08 10:04:09 +00:00
Georg Richter 202d2990a9 fixed crash (changed MYSQL TO MY_MYSQL in mysql_stmt_init) 2004-06-08 06:20:58 +00:00
3fc91aff97 ChangeLog update 2004-06-08 00:32:15 +00:00
Andi Gutmans 0bdbbd379e - Go back to -dev (Shouldn't need another RC) 2004-06-07 18:57:34 +00:00
Ilia Alshanetsky ceb70dbc68 Fixed bug #28668 (glob() does not work with relative paths on Windows). 2004-06-07 18:30:16 +00:00
Frank M. Kromann f05924db37 Fix build on win32 2004-06-07 18:03:51 +00:00
317 changed files with 19714 additions and 12844 deletions

No files matched your search

+1442
View File
File diff suppressed because it is too large. Load diff
+1298 -379
View File
File diff suppressed because it is too large. Load diff
+84
View File
@@ -1,5 +1,88 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12 Aug 2004, PHP 5.0.1
- Changed destructor mechanism so that destructors are called prior to request
shutdown. (Marcus)
- Rewritten UNIX and Windows install help files. (Documentation Team)
- Updated several libraries bundled with the windows release which now
includes libxml2-2.6.11, libxslt-1.1.7 and iconv-1.9.1. (Rob, Edin)
- Improved and moved ActiveScript SAPI to PECL. (Wez)
- Fixed bug #29606 (php_strip_whitespace() prints to stdout rather then
returning the value). (Ilia)
- Fixed bug #29577 (MYSQLI_CLIENT_FOUND_ROWS undefined) (Georg)
- Fixed bug #29573 (Segmentation fault, when exception thrown within
PHP function called from XSLT). (Christian)
- Fixed bug #29522 (accessing properties without connection) (Georg)
- Fixed bug #29505 (get_class_vars() severely broken when used with arrays).
(Marcus)
- Fixed bug #29490 (.Net object instantiation failed). (Michael Sisolak).
- Fixed bug #29474 (win32: usleep() doesn't work). (Wez)
- Fixed bug #29449 (win32: feof() hangs on empty tcp stream). (Wez)
- Fixed bug #29437 (Possible crash inside array_walk_recursive()). (Ilia)
- Fixed bug #29431 (crash when parsing invalid address; invalid address
returned by stream_socket_recvfrom(), stream_socket_getname()). (Wez)
- Fixed bug #29409 (Segfault in PHP functions called from XSLT). (Rob)
- Fixed unloading of dynamically loaded extensions.
(Marcus, kameshj at fastmail dot fm)
- Fixed bug #29395 (sqlite_escape_string() returns bogus data on empty
strings). (Ilia, Tony)
- Fixed bug #29392 (com_dotnet crashes when echo'ing an object). (Wez)
- Fixed bug #29368 (The destructor is called when an exception is thrown from
the constructor). (Marcus)
- Fixed bug #29354 (Exception constructor marked as both public and protected).
(Marcus)
- Fixed bug #29342 (strtotime() does not handle empty date string properly).
(Ilia)
- Fixed bug #29340 (win32 build produces invalid php_ifx.dll). (Edin)
- Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default) (Georg)
- Fixed bug #29291 (get_class_vars() return names with NULLs). (Marcus)
- Fixed bug #29264 (gettext extension not working). (Edin)
- Fixed bug #29258 (variant_date_from_timestamp() does not honour
timezone). (Wez)
- Fixed bug #29256 (error when sending large packets on a socket). (Dmitry)
- Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry)
- Fixed bug #29147 (Compile Error in mnoGoSearch functions). (Sergey, Antony)
- Fixed bug #29132 ($_SERVER["PHP_AUTH_USER"] isn't defined). (Stefan)
- Fixed bug #29119 (html_entity_decode() misbehaves with UTF-8). (Moriyoshi)
- Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry)
- Fixed bug #29061 (soap extension segfaults). (Dmitry)
- Fixed bug #28985 (__getTypes() returning nothing on complex WSDL). (Dmitry)
- Fixed bug #28969 (Wrong data encoding of special characters). (Dmitry)
- Fixed bug #28895 (ReflectionClass::isAbstract always returns false). (Marcus)
- Fixed bug #28829 (Thread-unsafety in bcmath elementary values). (Sara)
- Fixed bug #28464 (catch() does not catch exceptions by interfaces). (Marcus)
- Fixed ReflectionClass::getMethod() and ReflectionClass::getProperty() to
raise an ReflectionException instead of returning NULL on failure.
(Sebastian)
- Fixed convert.* filters to consume remaining buckets_in on flush. (Sara)
- Fixed bug in mysqli->client_version. (Georg)
13 Jul 2004, PHP 5.0.0
- Updated PCRE to provide better error handling in certain cases. (Andrei)
- Changed doc comments to require a single white space after '/**'. (Marcus)
- Fixed bug #29019 (Database not closing). (Marcus)
- Fixed bug #29008 (array_combine() does not handle non-numeric/string keys).
(Ilia)
- Fixed bug #28999 (fixed behaviour of exec() to work as it did in 4.X). (Ilia)
- Fixed bug #28868 (Internal filter registry not thread safe). (Sara)
- Fixed bug #28851 (call_user_func_array has typo in error message). (Marcus)
- Fixed bug #28831 (ArrayObject::offsetGet() does the work of offsetUnset()).
(Marcus)
- Fixed bug #28822 (ArrayObject::offsetExists() works inverted). (Marcus)
- Fixed bug #28789 (ReflectionProperty getValue() fails on public static
members). (Marcus)
- Fixed bug #28771 (Segfault when using xslt and clone). (Rob)
- Fixed bug #28751 (SoapServer does not call _autoload()). (Dmitry)
- Fixed bug #28739 (array_*diff() and array_*intersect() not clearing the fci
cache before work). (Andrey)
- Fixed bug #28721 (appendChild() and insertBefore() unset DOMText).(Rob)
- Fixed bug #28702 (SOAP does not parse WSDL service address correctly). (Dmitry)
- Fixed bug #28699 (Reflection api bugs). (Marcus)
- Fixed bug #28694 (ReflectionExtension::getFunctions() crashes PHP). (Marcus)
- Fixed bug #28512 (Allocate enough space to store MSSQL data). (Frank)
- Fixed bug #28325 (Circular references not properly serialised). (Moriyoshi)
- Fixed strip_tags() to correctly handle '\0' characters. (Stefan)
7 Jun 2004, PHP 5 Release Candidate 3
- Moved the PDFLib extension to PECL. (Wez)
- Added MySQL 4.1.2-alpha and 4.1.3-beta support to MySQLI extension. (Georg)
@@ -8,6 +91,7 @@ PHP NEWS
- Added count() support for COM arrays. (Wez)
- Added Firebird/InterBase UDF source that allows PHP functions to be called
from SQL (Ard)
- Removed Firebird/Interbase function ibase_timefmt() (Ard)
- Changed user error handler mechanism to relay to built-in error handler if it
returns false. (Andrei)
- Changed class type hints for function parameters to not allow the passing of
+10 -18
View File
@@ -37,8 +37,11 @@ The next few rules are more of a technical nature.
messages every day. Woe be to those who attempt to mess with it.
2. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file. Also see
the note below about automatically updating NEWS in your commit message.
bug fixes, improvements, etc., should go into the NEWS file.
NB! Lines, starting with @ will go automagically into NEWS file, but
this is NOT recommended, though. Please, add news entries directly to
NEWS file and don't forget to keep them adjusted and sorted.
3. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
@@ -59,14 +62,10 @@ The next few rules are more of a technical nature.
The format of the commit messages is pretty simple.
If a line begins with #, it is taken to be a comment and will not appear
in the ChangeLog. If the line begins with @, it will be redirected to the
NEWS file. Everything else goes into the ChangeLog.
in the ChangeLog. Everything else goes into the ChangeLog.
It is important to note that if your comment or news logline spans multiple
lines, you have to put # or @ at the beginning of _every_ such line. Every
entry in NEWS has to have a name after it, so if you did it with someone's
help, put both your names there. Your name WILL NOT be automatically put
at the end of the NEWS entry - so, please provide it yourself.
lines, you have to put # at the beginning of _every_ such line.
Example. Say you modified two files, datetime.c and string.c. In datetime.c
you added a new format option for date() function, and in string.c you fixed
@@ -78,17 +77,12 @@ For datetime.c:
(PHP date) Added new 'K' format modifier for printing out number of
days until New Year's Eve.
@- Added new 'K' format modifier that will output the number of days
@ until New Year's Eve. (Bob)
For string.c:
(php_trim) Fixed a memory leak resulting from improper use of zval_dtor().
# Man, that thing was leaking all over the place!
@- Fixed memory leak in trim(). (Bob)
The lines above marked with @ will go into NEWS file automagically, and the
# lines will be omitted from the ChangeLog. Alternatively, you might want
to modify NEWS file directly and not use the @ lines.
The # lines will be omitted from the ChangeLog automagically.
If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
@@ -97,12 +91,10 @@ bug report when developers are browsing CVS via. LXR or Bonsai.
Example:
Fixed pgsql notice handler double free crash bug. Bug #14016
@ Fixed pgsql notice handler double free crash bug. Bug #14016
If you don't see your messages in ChangeLog and NEWS right away, don't worry!
If you don't see your messages in ChangeLog right away, don't worry!
These files are updated once a day, so your stuff will not show up until
somewhat later. Don't go adding stuff to NEWS by hand if you already put @
lines in the commit message.
somewhat later.
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
to look at PHP CVS repository in various ways.
+1 -1
View File
@@ -155,7 +155,7 @@ PHP_FUNCTION(my_get_raw)
HashTable *hash_ptr;
char *raw_var;
if(zend_parse_parameters(2 TSRMLS_CC, "ls|l", &arg, &var, &var_len) == FAILURE) {
if(zend_parse_parameters(2 TSRMLS_CC, "ls", &arg, &var, &var_len) == FAILURE) {
return;
}
+157
View File
@@ -1,3 +1,160 @@
2004-07-14 Stanislav Malyshev <stas@zend.com>
* zend_object_handlers.c:
be consistent with write_dimension
* zend_object_handlers.c:
fix #28957
2004-07-13 Andi Gutmans <andi@zend.com>
* zend.h:
- 5.0.1-dev
2004-07-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_constants.c:
Bugfix #29116 Zend constant warning uses memory after free (jdolecek at
NetBSD dot org)
2004-07-13 Andi Gutmans <andi@zend.com>
* (php_5_0_0)
zend.h:
- Roll PHP 5.0.0
2004-07-12 Ilia Alshanetsky <ilia@prohost.org>
* (php_5_0_0RC4)
zend_execute.c:
Fixed bug #29086 & #28064 (PHP crashes on extremly long scripts).
2004-07-12 Andi Gutmans <andi@zend.com>
* (php_5_0_0RC4)
zend.c:
- Convert zend_class_entry -> zend_class_entry *
2004-07-10 Jon Parise <jon+php@csh.rit.edu>
* zend.c:
DragonFly BSD is derived from FreeBSD and requires the same floating point
precision fix.
2004-07-10 Andi Gutmans <andi@zend.com>
* zend_alloc.c
zend_hash.c
zend_variables.c:
- Better stability during premature shutdown of request startup
2004-07-05 Andi Gutmans <andi@zend.com>
* zend_mm.h:
- Disable zend_mm for 5.0.0
2004-07-03 Andi Gutmans <andi@zend.com>
* zend_alloc.c:
- Should fix mem leak with ZEND_MM. I made this change a while ago and
- rolled it back but I don't remember why. Please test!
2004-07-01 Ilia Alshanetsky <ilia@prohost.org>
* zend_constants.c:
Do not use alloca() where it can be easily abused by the users.
2004-06-25 Wez Furlong <wez.php@thebrainroom.net>
* zend_stream.c
zend_stream.h:
export zend stream functions for zend extensions under windows
2004-06-24 Sara Golemon <php@alphaweb.net>
* zend_execute.c:
Ease off on severity of new error (Using Resources as array offsets)
2004-06-23 Sara Golemon <php@alphaweb.net>
* zend_execute.c:
BugFix #28879 Inconsistent behavior between explicit and implicit array
creation.
Changes:
Throw E_WARNING "Illegal offset type" when explicitly creating
array elements with objects, arrays, or resorces as indexes.
This matches implicit creation w/ obj/arr indices.
Throw E_WARNING "Resource ID#%ld used as offset, casting to integer (%ld)"
when implicitly creating array with resource as index. (BC)
2004-06-19 Sebastian Bergmann <sb@sebastian-bergmann.de>
* zend_reflection_api.c:
Reflection_* -> Reflection*. Patch by Timm Friebe.
2004-06-18 Sara Golemon <php@alphaweb.net>
* zend_execute.c:
Another typo in converting array index doubles to long.
2004-06-18 George Schlossnagle <george@omniti.com>
* zend_builtin_functions.c:
fix for 28213.
class_name and call_type should be reinitialized on every loop iter.
2004-06-17 Sara Golemon <php@alphaweb.net>
* zend_builtin_functions.c:
String length in parse_parameters should be int
2004-06-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_reflection_api.c:
2004-06-14 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_language_scanner.l:
Need {} here
2004-06-10 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_language_scanner.l:
- Require a single white-space char after /** to start a doc comment that
way we prevent /*** from becoming a doc comment (as requested Derick).
* zend_API.h:
Add missing declaration
* zend_reflection_api.c:
Small code layout change
* zend_language_scanner.l:
Do not require NEWLINE at start of doccomment
* zend_reflection_api.c:
Bugfix #28699: Reflection api bugs
2004-06-09 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_reflection_api.c:
Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP
2004-06-07 Andi Gutmans <andi@zend.com>
* zend.h:
- Go back to -dev (Shouldn't need another RC)
* (php_5_0_0RC3)
zend.h:
- Roll RC3
2004-06-06 Stefan Esser <sesser@suspekt.org>
* zend_compile.h
+1 -1
View File
@@ -545,7 +545,7 @@ Changes in the Zend Engine 2.0
<?php
class Exception {
function __construct(string $message=NULL, int $code=0) {
function __construct(/*string*/ $message=NULL, /*int*/ $code=0) {
if (func_num_args()) {
$this->message = $message;
}
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #29505 (get_class_vars() severely broken when used with arrays)
--FILE--
<?php
class Test {
public $empty = array();
public $three = array(1, "b"=>"c", 3=>array());
}
var_dump(get_class_vars('Test'));
?>
===DONE===
--EXPECT--
array(2) {
["empty"]=>
array(0) {
}
["three"]=>
array(3) {
[0]=>
int(1)
["b"]=>
string(1) "c"
[3]=>
array(0) {
}
}
}
===DONE===
+6 -6
View File
@@ -429,7 +429,7 @@ static void zend_set_default_compile_time_values(TSRMLS_D)
static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS_DC)
{
zend_function tmp_func;
zend_class_entry tmp_class;
zend_class_entry *tmp_class;
compiler_globals->compiled_filename = NULL;
@@ -439,7 +439,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
zend_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
zend_hash_copy(compiler_globals->class_table, global_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry));
zend_hash_copy(compiler_globals->class_table, global_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry *));
zend_set_default_compile_time_values(TSRMLS_C);
@@ -512,8 +512,8 @@ static void alloc_globals_dtor(zend_alloc_globals *alloc_globals_p TSRMLS_DC)
#endif
#ifdef __FreeBSD__
/* FreeBSD floating point precision fix */
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
#include <floatingpoint.h>
#endif
@@ -554,8 +554,8 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
alloc_globals_ctor(&alloc_globals TSRMLS_CC);
#endif
#ifdef __FreeBSD__
/* FreeBSD floating point precision fix */
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
fpsetmask(0);
#endif
+2 -2
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "2.0.0RC3"
#define ZEND_VERSION "2.0.1"
#define ZEND_ENGINE_2
@@ -91,7 +91,7 @@ const char *zend_mh_bundle_error(void);
#endif /* HAVE_MACH_O_DYLD_H */
#if defined(HAVE_LIBDL)
#if defined(HAVE_LIBDL) && !defined(HAVE_MACH_O_DYLD_H)
# ifndef RTLD_LAZY
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
+1
View File
@@ -167,6 +167,7 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC);
ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC);
ZEND_API int zend_register_module(zend_module_entry *module_entry);
ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
ZEND_API zend_class_entry *zend_register_internal_class(zend_class_entry *class_entry TSRMLS_DC);
ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *class_entry, zend_class_entry *parent_ce, char *parent_name TSRMLS_DC);
+6 -3
View File
@@ -75,7 +75,7 @@ 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 (AG(memory_limit)+1048576 > AG(allocated_memory) - rs) { \
if (EG(in_execution) && AG(memory_limit)+1048576 > AG(allocated_memory) - rs) { \
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); \
@@ -496,10 +496,12 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
#endif /* !ZEND_DISABLE_MEMORY_CACHE */
#if defined(ZEND_MM) && !ZEND_DEBUG
zend_mm_shutdown(&AG(mm_heap));
if (full_shutdown) {
zend_mm_shutdown(&AG(mm_heap));
return;
}
zend_mm_startup(&AG(mm_heap), 256*1024);
#elif defined(ZEND_WIN32) && !ZEND_DEBUG
if (full_shutdown && AG(memory_heap)) {
HeapDestroy(AG(memory_heap));
@@ -621,10 +623,11 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
#endif
#if defined(ZEND_MM) && ZEND_DEBUG
zend_mm_shutdown(&AG(mm_heap));
if (full_shutdown) {
zend_mm_shutdown(&AG(mm_heap));
return;
}
zend_mm_startup(&AG(mm_heap), 256*1024);
#elif defined(ZEND_WIN32) && ZEND_DEBUG
if (full_shutdown && AG(memory_heap)) {
HeapDestroy(AG(memory_heap));
+50
View File
@@ -85,6 +85,10 @@ 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 */
#define emalloc(size) _emalloc((size) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
#define safe_emalloc(nmemb, size, offset) _safe_emalloc((nmemb), (size), (offset) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
@@ -123,6 +127,52 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
#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))
#define efree(ptr) free(ptr)
#define ecalloc(nmemb, size) calloc((nmemb), (size))
#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))
/* Relay wrapper macros */
#define emalloc_rel(size) malloc(size)
#define safe_emalloc_rel(nmemb, size, offset) malloc((nmemb) * (size) + (offset))
#define efree_rel(ptr) free(ptr)
#define ecalloc_rel(nmemb, size) calloc((nmemb), (size))
#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))
/* Selective persistent/non persistent allocation macros */
#define pemalloc(size, persistent) malloc(size)
#define pefree(ptr, persistent) free(ptr)
#define pecalloc(nmemb, size, persistent) calloc((nmemb), (size))
#define perealloc(ptr, size, persistent) realloc((ptr), (size))
#define perealloc_recoverable(ptr, size, persistent) realloc((ptr), (size))
#define pestrdup(s, persistent) strdup(s)
#define pemalloc_rel(size, persistent) malloc(size)
#define pefree_rel(ptr, persistent) free(ptr)
#define pecalloc_rel(nmemb, size, persistent) calloc((nmemb), (size))
#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)
#define safe_estrdup(ptr) ((ptr)?(strdup(ptr)):(empty_string))
#define safe_estrndup(ptr, len) ((ptr)?(strndup((ptr), (len))):(empty_string))
#endif
ZEND_API int zend_set_memory_limit(unsigned int memory_limit);
ZEND_API void start_memory_manager(TSRMLS_D);
+36 -6
View File
@@ -661,7 +661,6 @@ ZEND_FUNCTION(get_class_vars)
{
zval **class_name;
zend_class_entry *ce, **pce;
zval *tmp;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -674,11 +673,41 @@ ZEND_FUNCTION(get_class_vars)
} else {
ce = *pce;
array_init(return_value);
if (!ce->constants_updated) {
zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
ce->constants_updated = 1;
if (zend_hash_num_elements(&ce->default_properties) > 0) {
HashPosition pos;
zval **prop;
zend_hash_internal_pointer_reset_ex(&ce->default_properties, &pos);
while (zend_hash_get_current_data_ex(&ce->default_properties, (void **) &prop, &pos) == SUCCESS) {
char *key, *class_name, *prop_name;
uint key_len;
ulong num_index;
zval *prop_copy;
zend_hash_get_current_key_ex(&ce->default_properties, &key, &key_len, &num_index, 0, &pos);
zend_hash_move_forward_ex(&ce->default_properties, &pos);
zend_unmangle_property_name(key, &class_name, &prop_name);
if (class_name && class_name[0] != '*' && strcmp(class_name, ce->name)) {
/* filter privates from base classes */
continue;
}
/* copy: enforce read only access */
ALLOC_ZVAL(prop_copy);
*prop_copy = **prop;
zval_copy_ctor(prop_copy);
INIT_PZVAL(prop_copy);
/* this is necessary to make it able to work with default array
* properties, returned to user */
if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || Z_TYPE_P(prop_copy) == IS_CONSTANT) {
zval_update_constant(&prop_copy, 0 TSRMLS_CC);
}
add_assoc_zval(return_value, prop_name, prop_copy);
}
}
zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
}
}
/* }}} */
@@ -805,7 +834,7 @@ ZEND_FUNCTION(class_exists)
{
char *class_name, *lc_name;
zend_class_entry **ce;
long class_name_len;
int class_name_len;
zend_bool autoload = 1;
int found;
@@ -1484,6 +1513,7 @@ ZEND_FUNCTION(debug_print_backtrace)
array_init(return_value);
while (ptr) {
class_name = call_type = NULL;
if (ptr->op_array) {
filename = ptr->op_array->filename;
lineno = ptr->opline->lineno;
+25 -8
View File
@@ -1087,16 +1087,37 @@ void zend_do_handle_exception(TSRMLS_D)
void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
{
char lcname[16];
int name_len;
zend_do_extended_info(TSRMLS_C);
zend_do_return(NULL, 0 TSRMLS_CC);
zend_do_handle_exception(TSRMLS_C);
pass_two(CG(active_op_array) TSRMLS_CC);
if (CG(active_class_entry)
&& !strcmp(CG(active_op_array)->function_name, ZEND_CLONE_FUNC_NAME)
&& CG(active_op_array)->num_args != 0) {
zend_error(E_COMPILE_ERROR, "The clone method cannot accept any arguments");
/* we don't care if the function name is longer, in fact lowercasing only
* the beginning of the name speeds up the check process */
name_len = strlen(CG(active_op_array)->function_name);
zend_str_tolower_copy(lcname, CG(active_op_array)->function_name, MIN(name_len, sizeof(lcname)-1));
lcname[sizeof(lcname)-1] = '\0'; // zend_str_tolower_copy won't necessarily set the zero byte
if (CG(active_class_entry)) {
if (name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)) && CG(active_op_array)->num_args != 0) {
zend_error(E_COMPILE_ERROR, "Destuctor %s::%s() cannot take arguments", CG(active_class_entry)->name, ZEND_DESTRUCTOR_FUNC_NAME);
} else if (name_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)) && CG(active_op_array)->num_args != 0) {
zend_error(E_COMPILE_ERROR, "Method %s::%s() cannot accept any arguments", CG(active_class_entry)->name, ZEND_CLONE_FUNC_NAME);
} else if (name_len == sizeof(ZEND_GET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)) && CG(active_op_array)->num_args != 1) {
zend_error(E_COMPILE_ERROR, "Method %s::%s() must take exactly 1 argument", CG(active_class_entry)->name, ZEND_GET_FUNC_NAME);
} else if (name_len == sizeof(ZEND_SET_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)) && CG(active_op_array)->num_args != 2) {
zend_error(E_COMPILE_ERROR, "Method %s::%s() must take exactly 2 arguments", CG(active_class_entry)->name, ZEND_SET_FUNC_NAME);
} else if (name_len == sizeof(ZEND_CALL_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)) && CG(active_op_array)->num_args != 2) {
zend_error(E_COMPILE_ERROR, "Method %s::%s() must take exactly 2 arguments", CG(active_class_entry)->name, ZEND_CALL_FUNC_NAME);
}
} else {
if (name_len == sizeof(ZEND_AUTOLOAD_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)) && CG(active_op_array)->num_args != 1) {
zend_error(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME);
}
}
CG(active_op_array)->line_end = zend_get_compiled_lineno(TSRMLS_C);
@@ -1114,10 +1135,6 @@ void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initia
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
zend_arg_info *cur_arg_info;
if (CG(active_class_entry) && CG(active_class_entry)->destructor == (zend_function *) CG(active_op_array))
{
zend_error(E_COMPILE_ERROR, "Destuctor %s::%s() cannot take arguments", CG(active_class_entry)->name, CG(active_op_array)->function_name);
}
CG(active_op_array)->num_args++;
opline->opcode = op;
opline->result = *var;
+1
View File
@@ -840,6 +840,7 @@ END_EXTERN_C()
#define ZEND_GET_FUNC_NAME "__get"
#define ZEND_SET_FUNC_NAME "__set"
#define ZEND_CALL_FUNC_NAME "__call"
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
#endif /* ZEND_COMPILE_H */
+10 -13
View File
@@ -231,10 +231,8 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
scope = CG(active_class_entry);
}
class_name = do_alloca(class_name_len+1);
memcpy(class_name, name, class_name_len);
class_name[class_name_len] = '\0';
class_name = estrndup(name, class_name_len);
if (class_name_len == sizeof("self")-1 && strcmp(class_name, "self") == 0) {
if (scope) {
ce = &scope;
@@ -255,7 +253,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
retval = 0;
}
}
free_alloca(class_name);
efree(class_name);
if (retval && ce) {
if (zend_hash_find(&((*ce)->constants_table), constant_name, const_name_len+1, (void **) &ret_constant) != SUCCESS) {
@@ -275,9 +273,8 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
}
if (zend_hash_find(EG(zend_constants), name, name_len+1, (void **) &c) == FAILURE) {
lookup_name = do_alloca(name_len+1);
zend_str_tolower_copy(lookup_name, name, name_len);
lookup_name[name_len] = '\0';
lookup_name = estrndup(name, name_len);
zend_str_tolower(lookup_name, name_len);
if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) {
if ((c->flags & CONST_CS) && memcmp(c->name, name, name_len)!=0) {
@@ -286,7 +283,7 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
} else {
retval=0;
}
free_alloca(lookup_name);
efree(lookup_name);
}
if (retval) {
@@ -312,23 +309,23 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
if (!(c->flags & CONST_CS)) {
/* keep in mind that c->name_len already contains the '\0' */
lowercase_name = do_alloca(c->name_len);
zend_str_tolower_copy(lowercase_name, c->name, c->name_len - 1);
lowercase_name = estrndup(c->name, c->name_len);
zend_str_tolower(lowercase_name, c->name_len);
name = lowercase_name;
} else {
name = c->name;
}
if (zend_hash_add(EG(zend_constants), name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
zend_error(E_NOTICE,"Constant %s already defined", name);
free(c->name);
if (!(c->flags & CONST_PERSISTENT)) {
zval_dtor(&c->value);
}
zend_error(E_NOTICE,"Constant %s already defined", name);
ret = FAILURE;
}
if (lowercase_name) {
free_alloca(lowercase_name);
efree(lowercase_name);
}
return ret;
}
+1 -1
View File
@@ -30,7 +30,7 @@ typedef struct _dynamic_array {
} dynamic_array;
BEGIN_EXTERN_C()
ZEND_API int zend_dynamic_array_init(dynamic_array *da);
ZEND_API int zend_dynamic_array_init(dynamic_array *da, unsigned int element_size, unsigned int size);
ZEND_API void *zend_dynamic_array_push(dynamic_array *da);
ZEND_API void *zend_dynamic_array_pop(dynamic_array *da);
ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index);
+25 -15
View File
@@ -52,6 +52,7 @@ static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_
#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))
#define T(offset) (*(temp_variable *)((char *) Ts + offset))
#define TEMP_VAR_STACK_LIMIT 2000
/* former zend_execute_locks.h */
static inline void zend_pzval_lock_func(zval *z)
@@ -839,8 +840,10 @@ fetch_string_dim:
}
}
break;
case IS_DOUBLE:
case IS_RESOURCE:
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", dim->value.lval, dim->value.lval);
/* Fall Through */
case IS_DOUBLE:
case IS_BOOL:
case IS_LONG: {
long index;
@@ -1328,7 +1331,11 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
}
#define RETURN_FROM_EXECUTE_LOOP(execute_data) \
free_alloca(EX(Ts)); \
if (EX(op_array)->T < TEMP_VAR_STACK_LIMIT) { \
free_alloca(EX(Ts)); \
} else { \
efree(EX(Ts)); \
} \
EG(in_execution) = EX(original_in_execution); \
EG(current_execute_data) = EX(prev_execute_data); \
return 1; /* CHECK_ME */
@@ -1347,7 +1354,11 @@ ZEND_API void execute(zend_op_array *op_array TSRMLS_DC)
/* Initialize execute_data */
EX(fbc) = NULL;
EX(object) = NULL;
EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable)*op_array->T);
if (op_array->T < TEMP_VAR_STACK_LIMIT) {
EX(Ts) = (temp_variable *) do_alloca(sizeof(temp_variable) * op_array->T);
} else {
EX(Ts) = (temp_variable *) safe_emalloc(sizeof(temp_variable), op_array->T, 0);
}
EX(op_array) = op_array;
EX(original_in_execution) = EG(in_execution);
EX(prev_execute_data) = EG(current_execute_data);
@@ -2775,6 +2786,9 @@ int zend_do_fcall_common_helper(ZEND_OPCODE_HANDLER_ARGS)
if (EG(This)) {
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);
}
zval_ptr_dtor(&EG(This));
} else if (should_change_scope) {
zval_ptr_dtor(&EG(This));
@@ -2927,21 +2941,16 @@ int zend_catch_handler(ZEND_OPCODE_HANDLER_ARGS)
}
ce = Z_OBJCE_P(EG(exception));
if (ce != EX_T(opline->op1.u.var).class_entry) {
while (ce->parent) {
if (ce->parent == EX_T(opline->op1.u.var).class_entry) {
goto exception_should_be_taken;
if (!instanceof_function(ce, EX_T(opline->op1.u.var).class_entry TSRMLS_CC)) {
if (opline->op1.u.EA.type) {
zend_throw_exception_internal(NULL TSRMLS_CC);
NEXT_OPCODE();
}
ce = ce->parent;
SET_OPCODE(&op_array->opcodes[opline->extended_value]);
return 0; /* CHECK_ME */
}
if (opline->op1.u.EA.type) {
zend_throw_exception_internal(NULL TSRMLS_CC);
NEXT_OPCODE();
}
SET_OPCODE(&op_array->opcodes[opline->extended_value]);
return 0; /* CHECK_ME */
}
exception_should_be_taken:
zend_hash_update(EG(active_symbol_table), opline->op2.u.constant.value.str.val,
opline->op2.u.constant.value.str.len+1, &EG(exception), sizeof(zval *), (void **) NULL);
EG(exception) = NULL;
@@ -3402,6 +3411,7 @@ static inline int zend_init_add_array_helper(ZEND_OPCODE_HANDLER_ARGS)
zend_hash_update(array_ptr->value.ht, "", sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zval_ptr_dtor(&expr_ptr);
/* do nothing */
break;
@@ -3659,7 +3669,7 @@ int zend_unset_dim_obj_handler(ZEND_OPCODE_HANDLER_ARGS)
case IS_BOOL:
case IS_LONG:
if (offset->type == IS_DOUBLE) {
index = (long) offset->value.lval;
index = (long) offset->value.dval;
} else {
index = offset->value.lval;
}
+2 -2
View File
@@ -911,7 +911,7 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
return FAILURE;
}
ZVAL_STRINGL(&autoload_function, "__autoload", sizeof("__autoload")-1, 0);
ZVAL_STRINGL(&autoload_function, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1, 0);
INIT_PZVAL(class_name_ptr);
ZVAL_STRINGL(class_name_ptr, name, name_length, 0);
@@ -932,7 +932,7 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
if (EG(exception)) {
free_alloca(lc_name);
zend_error(E_ERROR, "__autoload(%s) threw an exception of type '%s'", name, Z_OBJCE_P(EG(exception))->name);
zend_error(E_ERROR, "Function %s(%s) threw an exception of type '%s'", ZEND_AUTOLOAD_FUNC_NAME, name, Z_OBJCE_P(EG(exception))->name);
return FAILURE;
}
EG(exception) = exception;
+17 -11
View File
@@ -137,6 +137,7 @@ ZEND_API ulong zend_hash_func(char *arKey, uint nKeyLength)
ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
{
uint i = 3;
Bucket **tmp;
SET_INCONSISTENT(HT_OK);
@@ -146,18 +147,8 @@ ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunctio
ht->nTableSize = 1 << i;
ht->nTableMask = ht->nTableSize - 1;
/* Uses ecalloc() so that Bucket* == NULL */
if (persistent) {
ht->arBuckets = (Bucket **) calloc(ht->nTableSize, sizeof(Bucket *));
if (!ht->arBuckets) {
return FAILURE;
}
} else {
ht->arBuckets = (Bucket **) ecalloc_rel(ht->nTableSize, sizeof(Bucket *));
}
ht->pDestructor = pDestructor;
ht->arBuckets = NULL;
ht->pListHead = NULL;
ht->pListTail = NULL;
ht->nNumOfElements = 0;
@@ -166,6 +157,21 @@ ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunctio
ht->persistent = persistent;
ht->nApplyCount = 0;
ht->bApplyProtection = 1;
/* Uses ecalloc() so that Bucket* == NULL */
if (persistent) {
tmp = (Bucket **) calloc(ht->nTableSize, sizeof(Bucket *));
if (!tmp) {
return FAILURE;
}
ht->arBuckets = tmp;
} else {
tmp = (Bucket **) ecalloc_rel(ht->nTableSize, sizeof(Bucket *));
if (tmp) {
ht->arBuckets = tmp;
}
}
return SUCCESS;
}
+10 -4
View File
@@ -159,6 +159,12 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
switch (token_type) {
case T_END_HEREDOC:
zend_html_puts(token.value.str.val, token.value.str.len TSRMLS_CC);
{
char *ptr = LANG_SCNG(yy_text);
if (ptr[LANG_SCNG(yy_leng) - 1] != ';') {
zend_html_putc('\n');
}
}
break;
default:
zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC);
@@ -203,7 +209,7 @@ ZEND_API void zend_strip(TSRMLS_D)
switch (token_type) {
case T_WHITESPACE:
if (!prev_space) {
putchar(' ');
zend_write(" ", sizeof(" ") - 1);
prev_space = 1;
}
/* lack of break; is intentional */
@@ -215,9 +221,9 @@ ZEND_API void zend_strip(TSRMLS_D)
case T_END_HEREDOC: {
char *ptr = LANG_SCNG(yy_text);
fwrite(ptr, LANG_SCNG(yy_leng) - 1, 1, stdout);
zend_write(ptr, LANG_SCNG(yy_leng) - 1);
/* The ensure that we only write one ; and that it followed by the required newline */
putchar('\n');
zend_write("\n", sizeof("\n") - 1);
if (ptr[LANG_SCNG(yy_leng) - 1] == ';') {
lex_scan(&token TSRMLS_CC);
}
@@ -226,7 +232,7 @@ ZEND_API void zend_strip(TSRMLS_D)
break;
default:
fwrite(LANG_SCNG(yy_text), LANG_SCNG(yy_leng), 1, stdout);
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
break;
}
+16 -1
View File
@@ -147,10 +147,25 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num
zend_ini_entry *p = ini_entry;
zend_ini_entry *hashed_ini_entry;
zval default_value;
HashTable *directives = registered_zend_ini_directives;
#ifdef ZTS
/* if we are called during the request, eg: from dl(),
* then we should not touch the global directives table,
* and should update the per-(request|thread) version instead.
* This solves two problems: one is that ini entries for dl()'d
* extensions will now work, and the second is that updating the
* global hash here from dl() is not mutex protected and can
* lead to death.
*/
if (directives != EG(ini_directives)) {
directives = EG(ini_directives);
}
#endif
while (p->name) {
p->module_number = module_number;
if (zend_hash_add(registered_zend_ini_directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
if (zend_hash_add(directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
zend_unregister_ini_entries(module_number TSRMLS_CC);
return FAILURE;
}
+1 -1
View File
@@ -192,7 +192,7 @@ END_EXTERN_C()
/* INI parsing engine */
typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg);
BEGIN_EXTERN_C()
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
END_EXTERN_C()
#define ZEND_INI_PARSER_ENTRY 1
+1 -1
View File
@@ -139,7 +139,7 @@ static void ini_error(char *str)
}
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
ZEND_API int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
{
int retval;
zend_ini_parser_param ini_parser_param;
+1 -1
View File
@@ -1445,7 +1445,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
}
<ST_IN_SCRIPTING>"/**"{NEWLINE} {
<ST_IN_SCRIPTING>"/**"{WHITESPACE} {
CG(comment_start_line) = CG(zend_lineno);
BEGIN(ST_DOC_COMMENT);
yymore();
+2 -1
View File
@@ -31,7 +31,8 @@
#ifdef ZEND_WIN32
#undef ZEND_MM
#else
#define ZEND_MM
/* #define ZEND_MM */
#undef ZEND_MM
#endif
/* mm block type */
+7
View File
@@ -381,7 +381,14 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
zval *retval;
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
if(offset == NULL) {
/* [] construct */
zval offset_null;
INIT_ZVAL(offset_null);
offset = &offset_null;
}
zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset);
if (!retval) {
if (!EG(exception)) {
zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name);
+9
View File
@@ -207,6 +207,15 @@ ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC
}
/* Called when the ctor was terminated by an exception */
ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC)
{
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
EG(objects_store).object_buckets[handle].destructor_called = 1;
}
/* Proxy objects workings */
typedef struct _zend_proxy_object {
zval *object;
+1
View File
@@ -68,6 +68,7 @@ ZEND_API zend_object_value zend_objects_store_clone_obj(zval *object TSRMLS_DC);
ZEND_API void *zend_object_store_get_object(zval *object TSRMLS_DC);
/* See comment in zend_objects_API.c before you use this */
ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC);
ZEND_API void zend_object_store_ctor_failed(zval *zobject TSRMLS_DC);
ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC);
+2
View File
@@ -87,6 +87,8 @@ static inline zend_bool is_numeric_string(char *str, int length, long *lval, dou
*lval = local_lval;
}
return IS_LONG;
} else if (end_ptr_long == str && *end_ptr_long != '\0') { /* ignore partial string matches */
return 0;
}
} else {
end_ptr_long=NULL;
+135 -120
View File
@@ -185,6 +185,7 @@ static void reflection_free_objects_storage(zend_object *object TSRMLS_DC)
if (intern->free_ptr && intern->ptr) {
efree(intern->ptr);
intern->ptr = NULL;
}
if (intern->obj) {
zval_ptr_dtor(&intern->obj);
@@ -221,6 +222,7 @@ static zend_object_value reflection_objects_new(zend_class_entry *class_type TSR
intern->zo.in_set = 0;
intern->ptr = NULL;
intern->obj = NULL;
intern->free_ptr = 0;
ALLOC_HASHTABLE(intern->zo.properties);
zend_hash_init(intern->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
@@ -241,6 +243,7 @@ static zval * reflection_instanciate(zend_class_entry *pce, zval *object TSRMLS_
return object;
}
static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC);
static void _function_string(string *str, zend_function *fptr, char *indent TSRMLS_DC);
static void _property_string(string *str, zend_property_info *prop, char *prop_name, char* indent TSRMLS_DC);
static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *indent TSRMLS_DC);
@@ -322,11 +325,8 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
while (zend_hash_get_current_data_ex(&ce->constants_table, (void **) &value, &pos) == SUCCESS) {
zend_hash_get_current_key_ex(&ce->constants_table, &key, &key_len, &num_index, 0, &pos);
string_printf(str, "%s Constant [ %s %s ] { }\n",
indent,
zend_zval_type_name(*value),
key);
_const_string(str, key, *value, indent TSRMLS_CC);
zend_hash_move_forward_ex(&ce->constants_table, &pos);
}
}
@@ -490,6 +490,16 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
}
/* }}} */
/* {{{ _const_string */
static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC)
{
string_printf(str, "%s Constant [ %s %s ] { }\n",
indent,
zend_zval_type_name(value),
name);
}
/* }}} */
/* {{{ _parameter_string */
static void _parameter_string(string *str, struct _zend_arg_info *arg_info, int offset, char* indent TSRMLS_DC)
{
@@ -848,7 +858,7 @@ static void reflection_function_factory(zend_function *function, zval *object TS
reflection_instanciate(reflection_function_ptr, object TSRMLS_CC);
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
intern->ptr = function;
intern->free_ptr = function != NULL;
intern->free_ptr = 0;
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL);
}
/* }}} */
@@ -1099,7 +1109,7 @@ ZEND_METHOD(reflection, getModifierNames)
}
/* }}} */
/* {{{ proto public static mixed Reflection_Function::export(string name, [, bool return]) throws Reflection_Exception
/* {{{ proto public static mixed ReflectionFunction::export(string name, [, bool return]) throws ReflectionException
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
ZEND_METHOD(reflection_function, export)
{
@@ -1107,7 +1117,7 @@ ZEND_METHOD(reflection_function, export)
}
/* }}} */
/* {{{ proto public Reflection_Function::__construct(string name)
/* {{{ proto public ReflectionFunction::__construct(string name)
Constructor. Throws an Exception in case the given function does not exist */
ZEND_METHOD(reflection_function, __construct)
{
@@ -1145,7 +1155,7 @@ ZEND_METHOD(reflection_function, __construct)
}
/* }}} */
/* {{{ proto public string Reflection_Function::__toString()
/* {{{ proto public string ReflectionFunction::__toString()
Returns a string representation */
ZEND_METHOD(reflection_function, __toString)
{
@@ -1161,7 +1171,7 @@ ZEND_METHOD(reflection_function, __toString)
}
/* }}} */
/* {{{ proto public string Reflection_Function::getName()
/* {{{ proto public string ReflectionFunction::getName()
Returns this function's name */
ZEND_METHOD(reflection, function_getName)
{
@@ -1170,7 +1180,7 @@ ZEND_METHOD(reflection, function_getName)
}
/* }}} */
/* {{{ proto public bool Reflection_Function::isInternal()
/* {{{ proto public bool ReflectionFunction::isInternal()
Returns whether this is an internal function */
ZEND_METHOD(reflection, function_isInternal)
{
@@ -1183,7 +1193,7 @@ ZEND_METHOD(reflection, function_isInternal)
}
/* }}} */
/* {{{ proto public bool Reflection_Function::isUserDefined()
/* {{{ proto public bool ReflectionFunction::isUserDefined()
Returns whether this is an user-defined function */
ZEND_METHOD(reflection_function, isUserDefined)
{
@@ -1196,7 +1206,7 @@ ZEND_METHOD(reflection_function, isUserDefined)
}
/* }}} */
/* {{{ proto public string Reflection_Function::getFileName()
/* {{{ proto public string ReflectionFunction::getFileName()
Returns the filename of the file this function was declared in */
ZEND_METHOD(reflection_function, getFileName)
{
@@ -1212,7 +1222,7 @@ ZEND_METHOD(reflection_function, getFileName)
}
/* }}} */
/* {{{ proto public int Reflection_Function::getStartLine()
/* {{{ proto public int ReflectionFunction::getStartLine()
Returns the line this function's declaration starts at */
ZEND_METHOD(reflection_function, getStartLine)
{
@@ -1228,7 +1238,7 @@ ZEND_METHOD(reflection_function, getStartLine)
}
/* }}} */
/* {{{ proto public int Reflection_Function::getEndLine()
/* {{{ proto public int ReflectionFunction::getEndLine()
Returns the line this function's declaration ends at */
ZEND_METHOD(reflection_function, getEndLine)
{
@@ -1244,7 +1254,7 @@ ZEND_METHOD(reflection_function, getEndLine)
}
/* }}} */
/* {{{ proto public string Reflection_Function::getDocComment()
/* {{{ proto public string ReflectionFunction::getDocComment()
Returns the doc comment for this function */
ZEND_METHOD(reflection_function, getDocComment)
{
@@ -1260,7 +1270,7 @@ ZEND_METHOD(reflection_function, getDocComment)
}
/* }}} */
/* {{{ proto public array Reflection_Function::getStaticVariables()
/* {{{ proto public array ReflectionFunction::getStaticVariables()
Returns an associative array containing this function's static variables and their values */
ZEND_METHOD(reflection_function, getStaticVariables)
{
@@ -1279,7 +1289,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
}
/* }}} */
/* {{{ proto public mixed Reflection_Function::invoke(mixed* args)
/* {{{ proto public mixed ReflectionFunction::invoke(mixed* args)
Invokes the function */
ZEND_METHOD(reflection_function, invoke)
{
@@ -1332,7 +1342,7 @@ ZEND_METHOD(reflection_function, invoke)
}
/* }}} */
/* {{{ proto public bool Reflection_Function::returnsReference()
/* {{{ proto public bool ReflectionFunction::returnsReference()
Gets whether this function returns a reference */
ZEND_METHOD(reflection_function, returnsReference)
{
@@ -1346,7 +1356,7 @@ ZEND_METHOD(reflection_function, returnsReference)
}
/* }}} */
/* {{{ proto public Reflection_Parameter[] Reflection_Function::getParameters()
/* {{{ proto public ReflectionParameter[] Reflection_Function::getParameters()
Returns an array of parameter objects for this function */
ZEND_METHOD(reflection_function, getParameters)
{
@@ -1373,7 +1383,7 @@ ZEND_METHOD(reflection_function, getParameters)
}
/* }}} */
/* {{{ proto public static mixed Reflection_Parameter::export(mixed function, mixed parameter, [, bool return]) throws Reflection_Exception
/* {{{ proto public static mixed ReflectionParameter::export(mixed function, mixed parameter, [, bool return]) throws ReflectionException
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
ZEND_METHOD(reflection_parameter, export)
{
@@ -1381,7 +1391,7 @@ ZEND_METHOD(reflection_parameter, export)
}
/* }}} */
/* {{{ proto public Reflection_Parameter::__construct(mixed function, mixed parameter)
/* {{{ proto public ReflectionParameter::__construct(mixed function, mixed parameter)
Constructor. Throws an Exception in case the given method does not exist */
ZEND_METHOD(reflection_parameter, __construct)
{
@@ -1506,7 +1516,7 @@ ZEND_METHOD(reflection_parameter, __construct)
}
/* }}} */
/* {{{ proto public string Reflection_Parameter::__toString()
/* {{{ proto public string ReflectionParameter::__toString()
Returns a string representation */
ZEND_METHOD(reflection_parameter, __toString)
{
@@ -1522,7 +1532,7 @@ ZEND_METHOD(reflection_parameter, __toString)
}
/* }}} */
/* {{{ proto public string Reflection_Parameter::getName()
/* {{{ proto public string ReflectionParameter::getName()
Returns this parameters's name */
ZEND_METHOD(reflection_parameter, getName)
{
@@ -1531,7 +1541,7 @@ ZEND_METHOD(reflection_parameter, getName)
}
/* }}} */
/* {{{ proto public Reflection_Class Reflection_Parameter::getClass()
/* {{{ proto public ReflectionClass ReflectionParameter::getClass()
Returns this parameters's class hint or NULL if there is none */
ZEND_METHOD(reflection_parameter, getClass)
{
@@ -1559,7 +1569,7 @@ ZEND_METHOD(reflection_parameter, getClass)
}
/* }}} */
/* {{{ proto public bool Reflection_Parameter::allowsNull()
/* {{{ proto public bool ReflectionParameter::allowsNull()
Returns whether NULL is allowed as this parameters's value */
ZEND_METHOD(reflection_parameter, allowsNull)
{
@@ -1573,7 +1583,7 @@ ZEND_METHOD(reflection_parameter, allowsNull)
}
/* }}} */
/* {{{ proto public bool Reflection_Parameter::isPassedByReference()
/* {{{ proto public bool ReflectionParameter::isPassedByReference()
Returns whether this parameters is passed to by reference */
ZEND_METHOD(reflection_parameter, isPassedByReference)
{
@@ -1587,7 +1597,7 @@ ZEND_METHOD(reflection_parameter, isPassedByReference)
}
/* }}} */
/* {{{ proto public static mixed Reflection_Method::export(mixed class, string name, [, bool return]) throws Reflection_Exception
/* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name, [, bool return]) throws ReflectionException
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
ZEND_METHOD(reflection_method, export)
{
@@ -1595,7 +1605,7 @@ ZEND_METHOD(reflection_method, export)
}
/* }}} */
/* {{{ proto public Reflection_Method::__construct(mixed class, string name)
/* {{{ proto public ReflectionMethod::__construct(mixed class, string name)
Constructor. Throws an Exception in case the given method does not exist */
ZEND_METHOD(reflection_method, __construct)
{
@@ -1662,7 +1672,7 @@ ZEND_METHOD(reflection_method, __construct)
}
/* }}} */
/* {{{ proto public string Reflection_Method::__toString()
/* {{{ proto public string ReflectionMethod::__toString()
Returns a string representation */
ZEND_METHOD(reflection_method, __toString)
{
@@ -1678,7 +1688,7 @@ ZEND_METHOD(reflection_method, __toString)
}
/* }}} */
/* {{{ proto public mixed Reflection_Method::invoke(mixed object, mixed* args)
/* {{{ proto public mixed ReflectionMethod::invoke(mixed object, mixed* args)
Invokes the function. Pass a */
ZEND_METHOD(reflection_method, invoke)
{
@@ -1781,7 +1791,7 @@ ZEND_METHOD(reflection_method, invoke)
}
/* }}} */
/* {{{ proto public bool Reflection_Method::isFinal()
/* {{{ proto public bool ReflectionMethod::isFinal()
Returns whether this method is final */
ZEND_METHOD(reflection_method, isFinal)
{
@@ -1789,7 +1799,7 @@ ZEND_METHOD(reflection_method, isFinal)
}
/* }}} */
/* {{{ proto public bool Reflection_Method::isAbstract()
/* {{{ proto public bool ReflectionMethod::isAbstract()
Returns whether this method is abstract */
ZEND_METHOD(reflection_method, isAbstract)
{
@@ -1797,7 +1807,7 @@ ZEND_METHOD(reflection_method, isAbstract)
}
/* }}} */
/* {{{ proto public bool Reflection_Method::isPublic()
/* {{{ proto public bool ReflectionMethod::isPublic()
Returns whether this method is public */
ZEND_METHOD(reflection_method, isPublic)
{
@@ -1805,7 +1815,7 @@ ZEND_METHOD(reflection_method, isPublic)
}
/* }}} */
/* {{{ proto public bool Reflection_Method::isPrivate()
/* {{{ proto public bool ReflectionMethod::isPrivate()
Returns whether this method is private */
ZEND_METHOD(reflection_method, isPrivate)
{
@@ -1813,7 +1823,7 @@ ZEND_METHOD(reflection_method, isPrivate)
}
/* }}} */
/* {{{ proto public bool Reflection_Method::isProtected()
/* {{{ proto public bool ReflectionMethod::isProtected()
Returns whether this method is protected */
ZEND_METHOD(reflection_method, isProtected)
{
@@ -1821,7 +1831,7 @@ ZEND_METHOD(reflection_method, isProtected)
}
/* }}} */
/* {{{ proto public bool Reflection_Method::isStatic()
/* {{{ proto public bool ReflectionMethod::isStatic()
Returns whether this method is static */
ZEND_METHOD(reflection_method, isStatic)
{
@@ -1829,7 +1839,7 @@ ZEND_METHOD(reflection_method, isStatic)
}
/* }}} */
/* {{{ proto public bool Reflection_Method::isConstructor()
/* {{{ proto public bool ReflectionMethod::isConstructor()
Returns whether this method is the constructor */
ZEND_METHOD(reflection_method, isConstructor)
{
@@ -1842,7 +1852,7 @@ ZEND_METHOD(reflection_method, isConstructor)
}
/* }}} */
/* {{{ proto public bool Reflection_Method::isDestructor()
/* {{{ proto public bool ReflectionMethod::isDestructor()
Returns whether this method is static */
ZEND_METHOD(reflection_method, isDestructor)
{
@@ -1855,7 +1865,7 @@ ZEND_METHOD(reflection_method, isDestructor)
}
/* }}} */
/* {{{ proto public int Reflection_Method::getModifiers()
/* {{{ proto public int ReflectionMethod::getModifiers()
Returns a bitfield of the access modifiers for this method */
ZEND_METHOD(reflection_method, getModifiers)
{
@@ -1869,7 +1879,7 @@ ZEND_METHOD(reflection_method, getModifiers)
}
/* }}} */
/* {{{ proto public Reflection_Class Reflection_Method::getDeclaringClass()
/* {{{ proto public ReflectionClass ReflectionMethod::getDeclaringClass()
Get the declaring class */
ZEND_METHOD(reflection_method, getDeclaringClass)
{
@@ -1883,7 +1893,7 @@ ZEND_METHOD(reflection_method, getDeclaringClass)
}
/* }}} */
/* {{{ proto public static mixed Reflection_Class::export(mixed argument, [, bool return]) throws Reflection_Exception
/* {{{ proto public static mixed ReflectionClass::export(mixed argument, [, bool return]) throws ReflectionException
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
ZEND_METHOD(reflection_class, export)
{
@@ -1942,7 +1952,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
}
/* }}} */
/* {{{ proto public Reflection_Class::__construct(mixed argument) throws Reflection_Exception
/* {{{ proto public ReflectionClass::__construct(mixed argument) throws ReflectionException
Constructor. Takes a string or an instance as an argument */
ZEND_METHOD(reflection_class, __construct)
{
@@ -1950,7 +1960,7 @@ ZEND_METHOD(reflection_class, __construct)
}
/* }}} */
/* {{{ proto public array Reflection_Class::getStaticProperties()
/* {{{ proto public array ReflectionClass::getStaticProperties()
Returns an associative array containing all static property values of the class */
ZEND_METHOD(reflection_class, getStaticProperties)
{
@@ -1965,7 +1975,7 @@ ZEND_METHOD(reflection_class, getStaticProperties)
}
/* }}} */
/* {{{ proto public array Reflection_Class::getDefaultProperties()
/* {{{ proto public array ReflectionClass::getDefaultProperties()
Returns an associative array containing copies of all default property values of the class */
ZEND_METHOD(reflection_class, getDefaultProperties)
{
@@ -2009,7 +2019,7 @@ ZEND_METHOD(reflection_class, getDefaultProperties)
}
/* }}} */
/* {{{ proto public string Reflection_Class::__toString()
/* {{{ proto public string ReflectionClass::__toString()
Returns a string representation */
ZEND_METHOD(reflection_class, __toString)
{
@@ -2025,7 +2035,7 @@ ZEND_METHOD(reflection_class, __toString)
}
/* }}} */
/* {{{ proto public string Reflection_Class::getName()
/* {{{ proto public string ReflectionClass::getName()
Returns the class' name */
ZEND_METHOD(reflection_class, getName)
{
@@ -2034,7 +2044,7 @@ ZEND_METHOD(reflection_class, getName)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isInternal()
/* {{{ proto public bool ReflectionClass::isInternal()
Returns whether this class is an internal class */
ZEND_METHOD(reflection_class, isInternal)
{
@@ -2047,7 +2057,7 @@ ZEND_METHOD(reflection_class, isInternal)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isUserDefined()
/* {{{ proto public bool ReflectionClass::isUserDefined()
Returns whether this class is user-defined */
ZEND_METHOD(reflection_class, isUserDefined)
{
@@ -2060,7 +2070,7 @@ ZEND_METHOD(reflection_class, isUserDefined)
}
/* }}} */
/* {{{ proto public string Reflection_Class::getFileName()
/* {{{ proto public string ReflectionClass::getFileName()
Returns the filename of the file this class was declared in */
ZEND_METHOD(reflection_class, getFileName)
{
@@ -2076,7 +2086,7 @@ ZEND_METHOD(reflection_class, getFileName)
}
/* }}} */
/* {{{ proto public int Reflection_Class::getStartLine()
/* {{{ proto public int ReflectionClass::getStartLine()
Returns the line this class' declaration starts at */
ZEND_METHOD(reflection_class, getStartLine)
{
@@ -2092,7 +2102,7 @@ ZEND_METHOD(reflection_class, getStartLine)
}
/* }}} */
/* {{{ proto public int Reflection_Class::getEndLine()
/* {{{ proto public int ReflectionClass::getEndLine()
Returns the line this class' declaration ends at */
ZEND_METHOD(reflection_class, getEndLine)
{
@@ -2108,7 +2118,7 @@ ZEND_METHOD(reflection_class, getEndLine)
}
/* }}} */
/* {{{ proto public string Reflection_Class::getDocComment()
/* {{{ proto public string ReflectionClass::getDocComment()
Returns the doc comment for this class */
ZEND_METHOD(reflection_class, getDocComment)
{
@@ -2124,7 +2134,7 @@ ZEND_METHOD(reflection_class, getDocComment)
}
/* }}} */
/* {{{ proto public Reflection_Method Reflection_Class::getConstructor()
/* {{{ proto public ReflectionMethod ReflectionClass::getConstructor()
Returns the class' constructor if there is one, NULL otherwise */
ZEND_METHOD(reflection_class, getConstructor)
{
@@ -2142,7 +2152,7 @@ ZEND_METHOD(reflection_class, getConstructor)
}
/* }}} */
/* {{{ proto public Reflection_Method Reflection_Class::getMethod(string name)
/* {{{ proto public ReflectionMethod ReflectionClass::getMethod(string name) throws ReflectionException
Returns the class' method specified by it's name */
ZEND_METHOD(reflection_class, getMethod)
{
@@ -2162,7 +2172,9 @@ ZEND_METHOD(reflection_class, getMethod)
if (zend_hash_find(&ce->function_table, name, name_len + 1, (void**) &mptr) == SUCCESS) {
reflection_method_factory(ce, mptr, return_value TSRMLS_CC);
} else {
RETURN_NULL();
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Method %s does not exist", name);
return;
}
}
/* }}} */
@@ -2185,7 +2197,7 @@ static int _addmethod(zend_function *mptr, int num_args, va_list args, zend_hash
}
/* }}} */
/* {{{ proto public Reflection_Method[] Reflection_Class::getMethods()
/* {{{ proto public ReflectionMethod[] ReflectionClass::getMethods()
Returns an array of this class' methods */
ZEND_METHOD(reflection_class, getMethods)
{
@@ -2211,7 +2223,7 @@ ZEND_METHOD(reflection_class, getMethods)
}
/* }}} */
/* {{{ proto public Reflection_Property Reflection_Class::getProperty(string name)
/* {{{ proto public ReflectionProperty ReflectionClass::getProperty(string name) throws ReflectionException
Returns the class' property specified by it's name */
ZEND_METHOD(reflection_class, getProperty)
{
@@ -2230,7 +2242,9 @@ ZEND_METHOD(reflection_class, getProperty)
if (zend_hash_find(&ce->properties_info, name, name_len + 1, (void**) &property_info) == SUCCESS) {
reflection_property_factory(ce, property_info, return_value TSRMLS_CC);
} else {
RETURN_NULL();
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Property %s does not exist", name);
return;
}
}
/* }}} */
@@ -2253,7 +2267,7 @@ static int _addproperty(zend_property_info *pptr, int num_args, va_list args, ze
}
/* }}} */
/* {{{ proto public Reflection_Property[] Reflection_Class::getProperties()
/* {{{ proto public ReflectionProperty[] ReflectionClass::getProperties()
Returns an array of this class' properties */
ZEND_METHOD(reflection_class, getProperties)
{
@@ -2279,7 +2293,7 @@ ZEND_METHOD(reflection_class, getProperties)
}
/* }}} */
/* {{{ proto public array Reflection_Class::getConstants()
/* {{{ proto public array ReflectionClass::getConstants()
Returns an associative array containing this class' constants and their values */
ZEND_METHOD(reflection_class, getConstants)
{
@@ -2294,7 +2308,7 @@ ZEND_METHOD(reflection_class, getConstants)
}
/* }}} */
/* {{{ proto public mixed Reflection_Class::getConstant(string name)
/* {{{ proto public mixed ReflectionClass::getConstant(string name)
Returns the class' constant specified by its name */
ZEND_METHOD(reflection_class, getConstant)
{
@@ -2330,7 +2344,7 @@ static void _class_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isInstantiable()
/* {{{ proto public bool ReflectionClass::isInstantiable()
Returns whether this class is instantiable */
ZEND_METHOD(reflection_class, isInstantiable)
{
@@ -2353,7 +2367,7 @@ ZEND_METHOD(reflection_class, isInstantiable)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isInterface()
/* {{{ proto public bool ReflectionClass::isInterface()
Returns whether this is an interface or a class */
ZEND_METHOD(reflection_class, isInterface)
{
@@ -2361,7 +2375,7 @@ ZEND_METHOD(reflection_class, isInterface)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isFinal()
/* {{{ proto public bool ReflectionClass::isFinal()
Returns whether this class is final */
ZEND_METHOD(reflection_class, isFinal)
{
@@ -2369,15 +2383,15 @@ ZEND_METHOD(reflection_class, isFinal)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isAbstract()
/* {{{ proto public bool ReflectionClass::isAbstract()
Returns whether this class is abstract */
ZEND_METHOD(reflection_class, isAbstract)
{
_class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_IMPLICIT_ABSTRACT_CLASS);
_class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
}
/* }}} */
/* {{{ proto public int Reflection_Class::getModifiers()
/* {{{ proto public int ReflectionClass::getModifiers()
Returns a bitfield of the access modifiers for this class */
ZEND_METHOD(reflection_class, getModifiers)
{
@@ -2391,7 +2405,7 @@ ZEND_METHOD(reflection_class, getModifiers)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isInstance(stdclass object)
/* {{{ proto public bool ReflectionClass::isInstance(stdclass object)
Returns whether the given object is an instance of this class */
ZEND_METHOD(reflection_class, isInstance)
{
@@ -2408,7 +2422,7 @@ ZEND_METHOD(reflection_class, isInstance)
}
/* }}} */
/* {{{ proto public stdclass Reflection_Class::newInstance(mixed* args, ...)
/* {{{ proto public stdclass ReflectionClass::newInstance(mixed* args, ...)
Returns an instance of this class */
ZEND_METHOD(reflection_class, newInstance)
{
@@ -2468,7 +2482,7 @@ ZEND_METHOD(reflection_class, newInstance)
}
/* }}} */
/* {{{ proto public Reflection_Class[] Reflection_Class::getInterfaces()
/* {{{ proto public ReflectionClass[] ReflectionClass::getInterfaces()
Returns an array of interfaces this class implements */
ZEND_METHOD(reflection_class, getInterfaces)
{
@@ -2494,7 +2508,7 @@ ZEND_METHOD(reflection_class, getInterfaces)
}
/* }}} */
/* {{{ proto public Reflection_Class Reflection_Class::getParentClass()
/* {{{ proto public ReflectionClass ReflectionClass::getParentClass()
Returns the class' parent class, or, if none exists, FALSE */
ZEND_METHOD(reflection_class, getParentClass)
{
@@ -2512,7 +2526,7 @@ ZEND_METHOD(reflection_class, getParentClass)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isSubclassOf(string|reflection_class class)
/* {{{ proto public bool ReflectionClass::isSubclassOf(string|reflection_class class)
Returns whether this class is a subclass of another class */
ZEND_METHOD(reflection_class, isSubclassOf)
{
@@ -2531,7 +2545,7 @@ ZEND_METHOD(reflection_class, isSubclassOf)
case IS_STRING:
if (zend_lookup_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), &pce TSRMLS_CC) == FAILURE) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Interface %s doesn't exist", Z_STRVAL_P(class_name));
"Interface %s does not exist", Z_STRVAL_P(class_name));
return;
}
class_ce = *pce;
@@ -2558,7 +2572,7 @@ ZEND_METHOD(reflection_class, isSubclassOf)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::implementsInterface(string|reflection_class interface_name)
/* {{{ proto public bool ReflectionClass::implementsInterface(string|reflection_class interface_name)
Returns whether this class is a subclass of another class */
ZEND_METHOD(reflection_class, implementsInterface)
{
@@ -2577,7 +2591,7 @@ ZEND_METHOD(reflection_class, implementsInterface)
case IS_STRING:
if (zend_lookup_class(Z_STRVAL_P(interface), Z_STRLEN_P(interface), &pce TSRMLS_CC) == FAILURE) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Interface %s doesn't exist", Z_STRVAL_P(interface));
"Interface %s does not exist", Z_STRVAL_P(interface));
return;
}
interface_ce = *pce;
@@ -2608,7 +2622,7 @@ ZEND_METHOD(reflection_class, implementsInterface)
}
/* }}} */
/* {{{ proto public bool Reflection_Class::isIterateable()
/* {{{ proto public bool ReflectionClass::isIterateable()
Returns whether this class is iterateable (can be used inside foreach) */
ZEND_METHOD(reflection_class, isIterateable)
{
@@ -2622,7 +2636,7 @@ ZEND_METHOD(reflection_class, isIterateable)
}
/* }}} */
/* {{{ proto public Reflection_Extension|NULL Reflection_Class::getExtension()
/* {{{ proto public ReflectionExtension|NULL Reflection_Class::getExtension()
Returns NULL or the extension the class belongs to */
ZEND_METHOD(reflection_class, getExtension)
{
@@ -2638,7 +2652,7 @@ ZEND_METHOD(reflection_class, getExtension)
}
/* }}} */
/* {{{ proto public string|false Reflection_Class::getExtensionName()
/* {{{ proto public string|false ReflectionClass::getExtensionName()
Returns false or the name of the extension the class belongs to */
ZEND_METHOD(reflection_class, getExtensionName)
{
@@ -2656,7 +2670,7 @@ ZEND_METHOD(reflection_class, getExtensionName)
}
/* }}} */
/* {{{ proto public static mixed Reflection_Object::export(mixed argument, [, bool return]) throws Reflection_Exception
/* {{{ proto public static mixed ReflectionObject::export(mixed argument, [, bool return]) throws ReflectionException
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
ZEND_METHOD(reflection_object, export)
{
@@ -2664,7 +2678,7 @@ ZEND_METHOD(reflection_object, export)
}
/* }}} */
/* {{{ proto public Reflection_Object::__construct(mixed argument) throws Reflection_Exception
/* {{{ proto public ReflectionObject::__construct(mixed argument) throws ReflectionException
Constructor. Takes an instance as an argument */
ZEND_METHOD(reflection_object, __construct)
{
@@ -2672,7 +2686,7 @@ ZEND_METHOD(reflection_object, __construct)
}
/* }}} */
/* {{{ proto public static mixed Reflection_Property::export(mixed class, string name, [, bool return]) throws Reflection_Exception
/* {{{ proto public static mixed ReflectionProperty::export(mixed class, string name, [, bool return]) throws ReflectionException
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
ZEND_METHOD(reflection_property, export)
{
@@ -2680,11 +2694,11 @@ ZEND_METHOD(reflection_property, export)
}
/* }}} */
/* {{{ proto public Reflection_Property::__construct(mixed class, string name)
/* {{{ proto public ReflectionProperty::__construct(mixed class, string name)
Constructor. Throws an Exception in case the given property does not exist */
ZEND_METHOD(reflection_property, __construct)
{
zval *name, *classname;
zval *propname, *classname;
char *name_str;
int name_len;
zval *object;
@@ -2693,7 +2707,6 @@ ZEND_METHOD(reflection_property, __construct)
zend_class_entry *ce;
zend_property_info *property_info;
property_reference *reference;
char *lcname;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &classname, &name_str, &name_len) == FAILURE) {
return;
@@ -2725,10 +2738,7 @@ ZEND_METHOD(reflection_property, __construct)
/* returns out of this function */
}
lcname = do_alloca(name_len + 1);
zend_str_tolower_copy(lcname, name_str, name_len);
if (zend_hash_find(&ce->properties_info, lcname, name_len + 1, (void **) &property_info) == FAILURE) {
free_alloca(lcname);
if (zend_hash_find(&ce->properties_info, name_str, name_len + 1, (void **) &property_info) == FAILURE) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Property %s::$%s does not exist", ce->name, name_str);
return;
@@ -2739,7 +2749,7 @@ ZEND_METHOD(reflection_property, __construct)
zend_class_entry *tmp_ce = ce->parent;
zend_property_info *tmp_info;
while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, lcname, name_len + 1, (void **) &tmp_info) == SUCCESS) {
while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, name_str, name_len + 1, (void **) &tmp_info) == SUCCESS) {
if (tmp_info->flags & ZEND_ACC_PRIVATE) {
/* private in super class => NOT the same property */
break;
@@ -2750,15 +2760,13 @@ ZEND_METHOD(reflection_property, __construct)
}
}
free_alloca(lcname);
MAKE_STD_ZVAL(classname);
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL);
MAKE_STD_ZVAL(name);
ZVAL_STRING(name, property_info->name, 1);
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL);
MAKE_STD_ZVAL(propname);
ZVAL_STRING(propname, property_info->name, 1);
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &propname, sizeof(zval *), NULL);
reference = (property_reference*) emalloc(sizeof(property_reference));
reference->ce = ce;
@@ -2768,7 +2776,7 @@ ZEND_METHOD(reflection_property, __construct)
}
/* }}} */
/* {{{ proto public string Reflection_Property::__toString()
/* {{{ proto public string ReflectionProperty::__toString()
Returns a string representation */
ZEND_METHOD(reflection_property, __toString)
{
@@ -2784,7 +2792,7 @@ ZEND_METHOD(reflection_property, __toString)
}
/* }}} */
/* {{{ proto public string Reflection_Property::getName()
/* {{{ proto public string ReflectionProperty::getName()
Returns the class' name */
ZEND_METHOD(reflection_property, getName)
{
@@ -2803,7 +2811,7 @@ static void _property_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask)
RETURN_BOOL(ref->prop->flags & mask);
}
/* {{{ proto public bool Reflection_Property::isPublic()
/* {{{ proto public bool ReflectionProperty::isPublic()
Returns whether this property is public */
ZEND_METHOD(reflection_property, isPublic)
{
@@ -2811,7 +2819,7 @@ ZEND_METHOD(reflection_property, isPublic)
}
/* }}} */
/* {{{ proto public bool Reflection_Property::isPrivate()
/* {{{ proto public bool ReflectionProperty::isPrivate()
Returns whether this property is private */
ZEND_METHOD(reflection_property, isPrivate)
{
@@ -2819,7 +2827,7 @@ ZEND_METHOD(reflection_property, isPrivate)
}
/* }}} */
/* {{{ proto public bool Reflection_Property::isProtected()
/* {{{ proto public bool ReflectionProperty::isProtected()
Returns whether this property is protected */
ZEND_METHOD(reflection_property, isProtected)
{
@@ -2827,7 +2835,7 @@ ZEND_METHOD(reflection_property, isProtected)
}
/* }}} */
/* {{{ proto public bool Reflection_Property::isStatic()
/* {{{ proto public bool ReflectionProperty::isStatic()
Returns whether this property is static */
ZEND_METHOD(reflection_property, isStatic)
{
@@ -2835,7 +2843,7 @@ ZEND_METHOD(reflection_property, isStatic)
}
/* }}} */
/* {{{ proto public bool Reflection_Property::isDefault()
/* {{{ proto public bool ReflectionProperty::isDefault()
Returns whether this property is default (declared at compilation time). */
ZEND_METHOD(reflection_property, isDefault)
{
@@ -2843,7 +2851,7 @@ ZEND_METHOD(reflection_property, isDefault)
}
/* }}} */
/* {{{ proto public int Reflection_Property::getModifiers()
/* {{{ proto public int ReflectionProperty::getModifiers()
Returns a bitfield of the access modifiers for this property */
ZEND_METHOD(reflection_property, getModifiers)
{
@@ -2857,7 +2865,7 @@ ZEND_METHOD(reflection_property, getModifiers)
}
/* }}} */
/* {{{ proto public mixed Reflection_Property::getValue(stdclass object)
/* {{{ proto public mixed ReflectionProperty::getValue(stdclass object)
Returns this property's value */
ZEND_METHOD(reflection_property, getValue)
{
@@ -2869,7 +2877,7 @@ ZEND_METHOD(reflection_property, getValue)
METHOD_NOTSTATIC;
GET_REFLECTION_OBJECT_PTR(ref);
if (ref->prop->flags & ~ZEND_ACC_PUBLIC) {
if (!(ref->prop->flags & ZEND_ACC_PUBLIC)) {
_DO_THROW("Cannot access non-public member");
/* Returns from this function */
}
@@ -2878,9 +2886,16 @@ ZEND_METHOD(reflection_property, getValue)
return;
}
if (zend_hash_quick_find(Z_OBJPROP_P(object), ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) {
zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name);
/* Bails out */
if ((ref->prop->flags & ZEND_ACC_STATIC)) {
if (zend_hash_quick_find(Z_OBJCE_P(object)->static_members, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) {
zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name);
/* Bails out */
}
} else {
if (zend_hash_quick_find(Z_OBJPROP_P(object), ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) {
zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name);
/* Bails out */
}
}
*return_value= **member;
@@ -2888,7 +2903,7 @@ ZEND_METHOD(reflection_property, getValue)
}
/* }}} */
/* {{{ proto public void Reflection_Property::setValue(stdclass object, mixed value)
/* {{{ proto public void ReflectionProperty::setValue(stdclass object, mixed value)
Sets this property's value */
ZEND_METHOD(reflection_property, setValue)
{
@@ -2942,7 +2957,7 @@ ZEND_METHOD(reflection_property, setValue)
}
/* }}} */
/* {{{ proto public Reflection_Class Reflection_Property::getDeclaringClass()
/* {{{ proto public ReflectionClass ReflectionProperty::getDeclaringClass()
Get the declaring class */
ZEND_METHOD(reflection_property, getDeclaringClass)
{
@@ -2955,7 +2970,7 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
reflection_class_factory(ref->ce, return_value TSRMLS_CC);
}
/* {{{ proto public static mixed Reflection_Extension::export(string name, [, bool return]) throws Reflection_Exception
/* {{{ proto public static mixed ReflectionExtension::export(string name, [, bool return]) throws ReflectionException
Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
ZEND_METHOD(reflection_extension, export)
{
@@ -2963,7 +2978,7 @@ ZEND_METHOD(reflection_extension, export)
}
/* }}} */
/* {{{ proto public Reflection_Extension::__construct(string name)
/* {{{ proto public ReflectionExtension::__construct(string name)
Constructor. Throws an Exception in case the given extension does not exist */
ZEND_METHOD(reflection_extension, __construct)
{
@@ -3001,7 +3016,7 @@ ZEND_METHOD(reflection_extension, __construct)
}
/* }}} */
/* {{{ proto public string Reflection_Extension::__toString()
/* {{{ proto public string ReflectionExtension::__toString()
Returns a string representation */
ZEND_METHOD(reflection_extension, __toString)
{
@@ -3017,7 +3032,7 @@ ZEND_METHOD(reflection_extension, __toString)
}
/* }}} */
/* {{{ proto public string Reflection_Extension::getName()
/* {{{ proto public string ReflectionExtension::getName()
Returns this extension's name */
ZEND_METHOD(reflection_extension, getName)
{
@@ -3026,7 +3041,7 @@ ZEND_METHOD(reflection_extension, getName)
}
/* }}} */
/* {{{ proto public string Reflection_Extension::getVersion()
/* {{{ proto public string ReflectionExtension::getVersion()
Returns this extension's version */
ZEND_METHOD(reflection_extension, getVersion)
{
@@ -3045,7 +3060,7 @@ ZEND_METHOD(reflection_extension, getVersion)
}
/* }}} */
/* {{{ proto public Reflection_Function[] Reflection_Extension::getFunctions()
/* {{{ proto public ReflectionFunction[] ReflectionExtension::getFunctions()
Returns an array of this extension's fuctions */
ZEND_METHOD(reflection_extension, getFunctions)
{
@@ -3093,7 +3108,7 @@ static int _addconstant(zend_constant *constant, int num_args, va_list args, zen
return 0;
}
/* {{{ proto public array Reflection_Extension::getConstants()
/* {{{ proto public array ReflectionExtension::getConstants()
Returns an associative array containing this extension's constants and their values */
ZEND_METHOD(reflection_extension, getConstants)
{
@@ -3125,7 +3140,7 @@ static int _addinientry(zend_ini_entry *ini_entry, int num_args, va_list args, z
}
/* }}} */
/* {{{ proto public array Reflection_Extension::getINIEntries()
/* {{{ proto public array ReflectionExtension::getINIEntries()
Returns an associative array containing this extension's INI entries and their values */
ZEND_METHOD(reflection_extension, getINIEntries)
{
@@ -3161,7 +3176,7 @@ static int add_extension_class(zend_class_entry **pce, int num_args, va_list arg
}
/* }}} */
/* {{{ proto public ReflectionClass[] Reflection_Extension::getClasses()
/* {{{ proto public ReflectionClass[] ReflectionExtension::getClasses()
Returns an array containing Reflection_Class objects for all classes of this extension */
ZEND_METHOD(reflection_extension, getClasses)
{
@@ -3176,7 +3191,7 @@ ZEND_METHOD(reflection_extension, getClasses)
}
/* }}} */
/* {{{ proto public array Reflection_Extension::getClassNames()
/* {{{ proto public array ReflectionExtension::getClassNames()
Returns an array containing all names of all classes of this extension */
ZEND_METHOD(reflection_extension, getClassNames)
{
+4 -4
View File
@@ -49,7 +49,7 @@ ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSR
return (handle->handle.fp) ? SUCCESS : FAILURE;
}
int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC)
ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC)
{
switch (file_handle->type) {
case ZEND_HANDLE_FILENAME:
@@ -90,7 +90,7 @@ int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC)
return SUCCESS;
}
size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC)
ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC)
{
if (file_handle->handle.stream.interactive) {
int c = '*', n;
@@ -105,7 +105,7 @@ size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSR
return file_handle->handle.stream.reader(file_handle->handle.stream.handle, buf, len TSRMLS_CC);
}
int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC)
ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC)
{
char buf;
@@ -115,7 +115,7 @@ int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC)
return EOF;
}
int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC)
ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC)
{
return 0;
}
+4 -4
View File
@@ -49,10 +49,10 @@ typedef struct _zend_file_handle {
BEGIN_EXTERN_C()
ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSRMLS_DC);
int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC);
int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC);
size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC);
ZEND_API int zend_stream_ferror(zend_file_handle *file_handle TSRMLS_DC);
ZEND_API int zend_stream_getc(zend_file_handle *file_handle TSRMLS_DC);
ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t len TSRMLS_DC);
ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC);
END_EXTERN_C()
#define zend_stream_close(handle) zend_file_handle_dtor((handle))
+5 -3
View File
@@ -140,14 +140,16 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
case IS_CONSTANT_ARRAY: {
zval *tmp;
HashTable *original_ht = zvalue->value.ht;
HashTable *tmp_ht = NULL;
TSRMLS_FETCH();
if (zvalue->value.ht == &EG(symbol_table)) {
return SUCCESS; /* do nothing */
}
ALLOC_HASHTABLE_REL(zvalue->value.ht);
zend_hash_init(zvalue->value.ht, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(zvalue->value.ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
ALLOC_HASHTABLE_REL(tmp_ht);
zend_hash_init(tmp_ht, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
zvalue->value.ht = tmp_ht;
}
break;
case IS_OBJECT:
+2 -2
View File
@@ -40,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
MAJOR_VERSION=5
MINOR_VERSION=0
RELEASE_VERSION=0
EXTRA_VERSION="RC3"
RELEASE_VERSION=1
EXTRA_VERSION=""
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
dnl Define where extension directories are located in the configure context
+24 -8
View File
@@ -53,8 +53,8 @@ zend_module_entry bcmath_module_entry = {
bcmath_functions,
PHP_MINIT(bcmath),
PHP_MSHUTDOWN(bcmath),
NULL,
NULL,
PHP_RINIT(bcmath),
PHP_RSHUTDOWN(bcmath),
PHP_MINFO(bcmath),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
@@ -86,8 +86,6 @@ PHP_MINIT_FUNCTION(bcmath)
REGISTER_INI_ENTRIES();
bc_init_numbers(TSRMLS_C);
return SUCCESS;
}
/* }}} */
@@ -96,15 +94,33 @@ PHP_MINIT_FUNCTION(bcmath)
*/
PHP_MSHUTDOWN_FUNCTION(bcmath)
{
_bc_free_num_ex(&BCG(_zero_), 1);
_bc_free_num_ex(&BCG(_one_), 1);
_bc_free_num_ex(&BCG(_two_), 1);
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(bcmath)
{
bc_init_numbers(TSRMLS_C);
return SUCCESS;
}
/* }}} */
/* {{{ PHP_RSHUTDOWN_FUNCTION
*/
PHP_RSHUTDOWN_FUNCTION(bcmath)
{
_bc_free_num_ex(&BCG(_zero_), 1);
_bc_free_num_ex(&BCG(_one_), 1);
_bc_free_num_ex(&BCG(_two_), 1);
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
+2
View File
@@ -30,6 +30,8 @@ extern zend_module_entry bcmath_module_entry;
PHP_MINIT_FUNCTION(bcmath);
PHP_MSHUTDOWN_FUNCTION(bcmath);
PHP_RINIT_FUNCTION(bcmath);
PHP_RSHUTDOWN_FUNCTION(bcmath);
PHP_MINFO_FUNCTION(bcmath);
PHP_FUNCTION(bcadd);
+3 -3
View File
@@ -37,7 +37,7 @@ PHP_FUNCTION(com_create_instance)
php_com_dotnet_object *obj;
char *module_name, *typelib_name = NULL, *server_name = NULL;
char *user_name = NULL, *domain_name = NULL, *password = NULL;
long module_name_len, typelib_name_len, server_name_len,
int module_name_len, typelib_name_len, server_name_len,
user_name_len, domain_name_len, password_len;
OLECHAR *moniker;
CLSID clsid;
@@ -287,7 +287,7 @@ PHP_FUNCTION(com_get_active_object)
{
CLSID clsid;
char *module_name;
long module_name_len;
int module_name_len;
long code_page = COMG(code_page);
IUnknown *unk = NULL;
IDispatch *obj = NULL;
@@ -799,7 +799,7 @@ PHP_FUNCTION(com_message_pump)
PHP_FUNCTION(com_load_typelib)
{
char *name;
long namelen;
int namelen;
ITypeLib *pTL = NULL;
zend_bool cs = TRUE;
int codepage = COMG(code_page);
+8 -3
View File
@@ -98,10 +98,11 @@ PHP_FUNCTION(com_dotnet_create_instance)
zval *object = getThis();
php_com_dotnet_object *obj;
char *assembly_name, *datatype_name;
long assembly_name_len, datatype_name_len;
int assembly_name_len, datatype_name_len;
struct dotnet_runtime_stuff *stuff;
IObjectHandle *handle;
DISPPARAMS params;
OLECHAR *olestring;
VARIANT vargs[2];
VARIANT retval;
HRESULT hr;
@@ -138,10 +139,14 @@ PHP_FUNCTION(com_dotnet_create_instance)
VariantInit(&retval);
V_VT(&vargs[0]) = VT_BSTR;
V_BSTR(&vargs[0]) = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page TSRMLS_CC);
olestring = php_com_string_to_olestring(datatype_name, datatype_name_len, obj->code_page TSRMLS_CC);
V_BSTR(&vargs[0]) = SysAllocStringByteLen((char*)olestring, datatype_name_len * sizeof(OLECHAR));
efree(olestring);
V_VT(&vargs[1]) = VT_BSTR;
V_BSTR(&vargs[1]) = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page TSRMLS_CC);
olestring = php_com_string_to_olestring(assembly_name, assembly_name_len, obj->code_page TSRMLS_CC);
V_BSTR(&vargs[1]) = SysAllocStringByteLen((char*)olestring, assembly_name_len * sizeof(OLECHAR));
efree(olestring);
hr = IDispatch_Invoke(stuff->dotnet_domain, stuff->create_instance, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
DISPATCH_METHOD, &params, &retval, NULL, NULL);
+1 -1
View File
@@ -194,7 +194,7 @@ 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);
+35 -11
View File
@@ -286,11 +286,19 @@ static void function_dtor(void *pDest)
}
}
static PHP_FUNCTION(com_method_handler)
{
Z_OBJ_HANDLER_P(getThis(), call_method)(
((zend_internal_function*)EG(function_state_ptr)->function)->function_name,
INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
static union _zend_function *com_method_get(zval *object, char *name, int len TSRMLS_DC)
{
zend_internal_function f, *fptr = NULL;
php_com_dotnet_object *obj;
union _zend_function *func;
DISPID dummy;
obj = CDNO_FETCH(object);
@@ -298,6 +306,10 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
return NULL;
}
if (FAILED(php_com_get_id_of_name(obj, name, len, &dummy TSRMLS_CC))) {
return NULL;
}
/* check cache */
if (obj->method_cache == NULL || FAILURE == zend_hash_find(obj->method_cache, name, len, (void**)&fptr)) {
f.type = ZEND_OVERLOADED_FUNCTION;
@@ -306,7 +318,10 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
f.scope = obj->ce;
f.fn_flags = 0;
f.function_name = estrndup(name, len);
f.handler = PHP_FN(com_method_handler);
fptr = &f;
if (obj->typeinfo) {
/* look for byref params */
ITypeComp *comp;
@@ -346,6 +361,9 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
case DESCKIND_TYPECOMP:
ITypeComp_Release(bindptr.lptcomp);
break;
case DESCKIND_NONE:
break;
}
if (TI) {
ITypeInfo_Release(TI);
@@ -356,21 +374,27 @@ static union _zend_function *com_method_get(zval *object, char *name, int len TS
}
}
/* save this method in the cache */
if (!obj->method_cache) {
ALLOC_HASHTABLE(obj->method_cache);
zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0);
}
if (fptr) {
/* save this method in the cache */
if (!obj->method_cache) {
ALLOC_HASHTABLE(obj->method_cache);
zend_hash_init(obj->method_cache, 2, NULL, function_dtor, 0);
}
zend_hash_update(obj->method_cache, name, len, &f, sizeof(f), (void**)&fptr);
zend_hash_update(obj->method_cache, name, len, &f, sizeof(f), (void**)&fptr);
}
}
/* duplicate this into a new chunk of emalloc'd memory,
* since the engine will efree it */
func = emalloc(sizeof(*fptr));
memcpy(func, fptr, sizeof(*fptr));
if (fptr) {
/* duplicate this into a new chunk of emalloc'd memory,
* since the engine will efree it */
func = emalloc(sizeof(*fptr));
memcpy(func, fptr, sizeof(*fptr));
return func;
return func;
}
return NULL;
}
static int com_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
+2 -2
View File
@@ -375,7 +375,7 @@ CPH_METHOD(SaveToFile)
{
HRESULT res;
char *filename, *fullpath = NULL;
long filename_len;
int filename_len;
zend_bool remember = TRUE;
OLECHAR *olefilename = NULL;
CPH_FETCH();
@@ -438,7 +438,7 @@ CPH_METHOD(LoadFromFile)
{
HRESULT res;
char *filename, *fullpath;
long filename_len;
int filename_len;
long flags = 0;
OLECHAR *olefilename;
CPH_FETCH();
+4 -4
View File
@@ -168,7 +168,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
VariantInit(&v);
/* we can return a real value */
indices = do_alloca(dims * sizeof(LONG));
indices = emalloc(dims * sizeof(LONG));
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
@@ -191,7 +191,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
res = SafeArrayGetElement(sa, indices, &v.lVal);
}
free_alloca(indices);
efree(indices);
if (SUCCEEDED(res)) {
php_com_wrap_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC);
@@ -244,7 +244,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
VARTYPE vt;
dims = SafeArrayGetDim(V_ARRAY(&proxy->obj->v));
indices = do_alloca(dims * sizeof(LONG));
indices = emalloc(dims * sizeof(LONG));
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
convert_to_long(proxy->indices[i]);
@@ -272,7 +272,7 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v.lVal);
}
free_alloca(indices);
efree(indices);
VariantClear(&v);
if (FAILED(res)) {
+9 -8
View File
@@ -260,7 +260,7 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC
/* {{{ com_variant_create_instance - ctor for new VARIANT() */
PHP_FUNCTION(com_variant_create_instance)
{
VARTYPE vt = VT_EMPTY;
/* VARTYPE == unsigned short */ long vt = VT_EMPTY;
long codepage = CP_ACP;
zval *object = getThis();
php_com_dotnet_object *obj;
@@ -290,7 +290,7 @@ PHP_FUNCTION(com_variant_create_instance)
if (ZEND_NUM_ARGS() >= 2) {
res = VariantChangeType(&obj->v, &obj->v, 0, vt);
res = VariantChangeType(&obj->v, &obj->v, 0, (VARTYPE)vt);
if (FAILED(res)) {
char *werr, *msg;
@@ -788,7 +788,7 @@ PHP_FUNCTION(variant_date_to_timestamp)
Returns a variant date representation of a unix timestamp */
PHP_FUNCTION(variant_date_from_timestamp)
{
int timestamp;
long timestamp;
SYSTEMTIME systime;
struct tm *tmv;
VARIANT res;
@@ -799,7 +799,8 @@ PHP_FUNCTION(variant_date_from_timestamp)
}
VariantInit(&res);
tmv = gmtime(&timestamp);
tzset();
tmv = localtime(&timestamp);
memset(&systime, 0, sizeof(systime));
systime.wDay = tmv->tm_mday;
@@ -841,7 +842,7 @@ PHP_FUNCTION(variant_set_type)
{
zval *zobj;
php_com_dotnet_object *obj;
VARTYPE vt;
/* VARTYPE == unsigned short */ long vt;
HRESULT res;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
@@ -850,7 +851,7 @@ PHP_FUNCTION(variant_set_type)
}
obj = CDNO_FETCH(zobj);
res = VariantChangeType(&obj->v, &obj->v, 0, vt);
res = VariantChangeType(&obj->v, &obj->v, 0, (VARTYPE)vt);
if (SUCCEEDED(res)) {
if (vt != VT_DISPATCH && obj->typeinfo) {
@@ -876,7 +877,7 @@ PHP_FUNCTION(variant_cast)
{
zval *zobj;
php_com_dotnet_object *obj;
VARTYPE vt;
/* VARTYPE == unsigned short */ long vt;
VARIANT vres;
HRESULT res;
@@ -887,7 +888,7 @@ PHP_FUNCTION(variant_cast)
obj = CDNO_FETCH(zobj);
VariantInit(&vres);
res = VariantChangeType(&vres, &obj->v, 0, vt);
res = VariantChangeType(&vres, &obj->v, 0, (VARTYPE)vt);
if (SUCCEEDED(res)) {
php_com_wrap_variant(return_value, &vres, obj->code_page TSRMLS_CC);
+9 -5
View File
@@ -296,12 +296,16 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
} else if (wFlags & DISPATCH_PROPERTYPUT) {
zend_update_property(Z_OBJCE_P(disp->object), disp->object, Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, *params[0] TSRMLS_CC);
} else if (wFlags & DISPATCH_METHOD) {
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name,
&retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
ret = S_OK;
} else {
zend_try {
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name,
&retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
ret = S_OK;
} else {
ret = DISP_E_EXCEPTION;
}
} zend_catch {
ret = DISP_E_EXCEPTION;
}
} zend_end_try();
} else {
trace("Don't know how to handle this invocation %08x\n", wFlags);
}
+1 -1
View File
@@ -36,7 +36,7 @@ typedef struct _php_com_dotnet_object {
VARIANT v;
ITypeInfo *typeinfo;
int code_page;
long code_page;
unsigned int have_default_bind:1;
zend_class_entry *ce;
+1 -1
View File
@@ -726,7 +726,7 @@ PHP_FUNCTION(cpdf_set_font)
int id, type;
CPDFdoc *pdf;
if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(ht, 4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) {
WRONG_PARAM_COUNT;
}
+7 -1
View File
@@ -97,7 +97,13 @@ PHP_MINFO_FUNCTION(ctype)
return; \
switch (Z_TYPE_P(c)) { \
case IS_LONG: \
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
} else if (Z_LVAL_P(c) >= -128) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
} \
SEPARATE_ZVAL(&c); \
convert_to_string(c); \
case IS_STRING: \
{ \
char *p; \
+1 -1
View File
@@ -1084,7 +1084,7 @@ PHP_FUNCTION(curl_setopt)
error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, string_key,
CURLFORM_NAMELENGTH, string_key_len - 1,
(ZVAL_REFCOUNT(*zvalue) > 1 ? CURLFORM_PTRCONTENTS : CURLFORM_COPYCONTENTS), postval,
CURLFORM_COPYCONTENTS, postval,
CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current),
CURLFORM_END);
}
+4 -4
View File
@@ -14,7 +14,7 @@ magic_quotes_runtime=1
require_once('test.inc');
echo "database handler: $handler\n";
// print md5 checksum of test.cdb which is generated by cdb_make program
var_dump(md5(implode('',file(dirname(__FILE__).'/test.cdb'))));
var_dump(md5_file(dirname(__FILE__).'/test.cdb'));
if (($db_make=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("1", "1", $db_make);
dba_insert("2", "2", $db_make);
@@ -26,7 +26,7 @@ magic_quotes_runtime=1
// dba_replace cdb_make doesn't know replace
dba_close($db_make);
// write md5 checksum of generated database file
var_dump(md5(implode('',file($db_file))));
var_dump(md5_file($db_file));
// no need to test created database: this is done by dba_cdb_read.phpt
} else {
echo "Error creating database\n";
@@ -34,5 +34,5 @@ magic_quotes_runtime=1
?>
--EXPECT--
database handler: cdb_make
string(32) "723d19f39c1b15b3b455dd64323148d1"
string(32) "723d19f39c1b15b3b455dd64323148d1"
string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
+9
View File
@@ -0,0 +1,9 @@
// $Id$
// vim:ft=javascript
ARG_ENABLE("dio", "Enable the direct I/O support", "no");
if (PHP_DIO != "no") {
EXTENSION("dio", "dio.c");
AC_DEFINE('HAVE_DIO', 1, 'dio support');
}
+28
View File
@@ -27,9 +27,15 @@
#include <sys/stat.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#ifndef PHP_WIN32
#include <termios.h>
#endif
/* e.g. IRIX does not have CRTSCTS */
#ifndef CRTSCTS
@@ -45,14 +51,20 @@ static int le_fd;
function_entry dio_functions[] = {
PHP_FE(dio_open, NULL)
#ifndef PHP_WIN32
PHP_FE(dio_truncate, NULL)
#endif
PHP_FE(dio_stat, NULL)
PHP_FE(dio_seek, NULL)
#ifndef PHP_WIN32
PHP_FE(dio_fcntl, NULL)
#endif
PHP_FE(dio_read, NULL)
PHP_FE(dio_write, NULL)
PHP_FE(dio_close, NULL)
#ifndef PHP_WIN32
PHP_FE(dio_tcsetattr, NULL)
#endif
{NULL, NULL, NULL}
};
@@ -94,15 +106,22 @@ PHP_MINIT_FUNCTION(dio)
RDIOC(O_EXCL);
RDIOC(O_TRUNC);
RDIOC(O_APPEND);
#ifdef O_NONBLOCK
RDIOC(O_NONBLOCK);
#endif
#ifdef O_NDELAY
RDIOC(O_NDELAY);
#endif
#ifdef O_SYNC
RDIOC(O_SYNC);
#endif
#ifdef O_ASYNC
RDIOC(O_ASYNC);
#endif
#ifdef O_NOCTTY
RDIOC(O_NOCTTY);
#endif
#ifndef PHP_WIN32
RDIOC(S_IRWXU);
RDIOC(S_IRUSR);
RDIOC(S_IWUSR);
@@ -127,6 +146,7 @@ PHP_MINIT_FUNCTION(dio)
RDIOC(F_UNLCK);
RDIOC(F_RDLCK);
RDIOC(F_WRLCK);
#endif
return SUCCESS;
}
@@ -235,6 +255,7 @@ PHP_FUNCTION(dio_write)
}
/* }}} */
#ifndef PHP_WIN32
/* {{{ proto bool dio_truncate(resource fd, int offset)
Truncate file descriptor fd to offset bytes */
PHP_FUNCTION(dio_truncate)
@@ -257,6 +278,7 @@ PHP_FUNCTION(dio_truncate)
RETURN_TRUE;
}
/* }}} */
#endif
#define ADD_FIELD(f, v) add_assoc_long_ex(return_value, (f), sizeof(f), v);
@@ -288,8 +310,10 @@ PHP_FUNCTION(dio_stat)
ADD_FIELD("gid", s.st_gid);
ADD_FIELD("device_type", s.st_rdev);
ADD_FIELD("size", s.st_size);
#ifndef PHP_WIN32
ADD_FIELD("block_size", s.st_blksize);
ADD_FIELD("blocks", s.st_blocks);
#endif
ADD_FIELD("atime", s.st_atime);
ADD_FIELD("mtime", s.st_mtime);
ADD_FIELD("ctime", s.st_ctime);
@@ -315,6 +339,7 @@ PHP_FUNCTION(dio_seek)
}
/* }}} */
#ifndef PHP_WIN32
/* {{{ proto mixed dio_fcntl(resource fd, int cmd[, mixed arg])
Perform a c library fcntl on fd */
PHP_FUNCTION(dio_fcntl)
@@ -415,7 +440,9 @@ PHP_FUNCTION(dio_fcntl)
}
}
/* }}} */
#endif
#ifndef PHP_WIN32
/* {{{ proto mixed dio_tcsetattr(resource fd, array args )
Perform a c library tcsetattr on fd */
PHP_FUNCTION(dio_tcsetattr)
@@ -576,6 +603,7 @@ PHP_FUNCTION(dio_tcsetattr)
RETURN_TRUE;
}
/* }}} */
#endif
/* {{{ proto void dio_close(resource fd)
Close the file descriptor given by fd */
+5 -5
View File
@@ -1063,7 +1063,7 @@ PHP_FUNCTION(dom_document_import_node)
/* }}} end dom_document_import_node */
/* {{{ proto DOMElement dom_document_create_element_ns(string namespaceURI, string qualifiedName);
/* {{{ proto DOMElement dom_document_create_element_ns(string namespaceURI, string qualifiedName [,string value]);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrElNS
Since: DOM Level 2
*/
@@ -1073,13 +1073,13 @@ PHP_FUNCTION(dom_document_create_element_ns)
xmlDocPtr docp;
xmlNodePtr nodep = NULL;
xmlNsPtr nsptr = NULL;
int ret, uri_len = 0, name_len = 0;
char *uri, *name;
int ret, uri_len = 0, name_len = 0, value_len = 0;
char *uri, *name, *value = NULL;
char *localname = NULL, *prefix = NULL;
int errorcode;
dom_object *intern;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len) == FAILURE) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os!s|s", &id, dom_document_class_entry, &uri, &uri_len, &name, &name_len, &value, &value_len) == FAILURE) {
return;
}
@@ -1089,7 +1089,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
if (errorcode == 0) {
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
nodep = xmlNewDocNode (docp, NULL, localname, NULL);
nodep = xmlNewDocNode (docp, NULL, localname, value);
if (nodep != NULL && uri != NULL) {
nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri);
if (nsptr == NULL) {
+148 -64
View File
@@ -874,6 +874,11 @@ PHP_FUNCTION(dom_node_insert_before)
}
DOM_GET_OBJ(parentp, id, xmlNodePtr, intern);
if (dom_node_children_valid(parentp) == FAILURE) {
RETURN_FALSE;
}
DOM_GET_OBJ(child, node, xmlNodePtr, childobj);
new_child = NULL;
@@ -896,6 +901,11 @@ PHP_FUNCTION(dom_node_insert_before)
RETURN_FALSE;
}
if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty");
RETURN_FALSE;
}
if (child->doc == NULL && parentp->doc != NULL) {
childobj->document = intern->document;
php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
@@ -912,25 +922,25 @@ PHP_FUNCTION(dom_node_insert_before)
xmlUnlinkNode(child);
}
if (child->type == XML_TEXT_NODE) {
if (refp->type == XML_TEXT_NODE) {
xmlChar *tmp;
if (child->type == XML_TEXT_NODE && (refp->type == XML_TEXT_NODE ||
(refp->prev != NULL && refp->prev->type == XML_TEXT_NODE))) {
if (child->doc == NULL) {
xmlSetTreeDoc(child, parentp->doc);
}
new_child = child;
new_child->parent = refp->parent;
new_child->next = refp;
new_child->prev = refp->prev;
refp->prev = new_child;
if (new_child->prev != NULL) {
new_child->prev->next = new_child;
}
if (new_child->parent != NULL) {
if (new_child->parent->children == refp) {
new_child->parent->children = new_child;
}
}
tmp = xmlStrdup(child->content);
tmp = xmlStrcat(tmp, refp->content);
xmlNodeSetContent(refp, tmp);
xmlFree(tmp);
php_libxml_node_free_resource(child TSRMLS_CC);
DOM_RET_OBJ(rv, refp, &ret, intern);
return;
}
if ((refp->prev != NULL) && (refp->prev->type == XML_TEXT_NODE)
&& (refp->name == refp->prev->name)) {
xmlNodeAddContent(refp->prev, child->content);
php_libxml_node_free_resource(child TSRMLS_CC);
DOM_RET_OBJ(rv, refp->prev, &ret, intern);
return;
}
} else if (child->type == XML_ATTRIBUTE_NODE) {
xmlAttrPtr lastattr;
@@ -947,29 +957,56 @@ PHP_FUNCTION(dom_node_insert_before)
return;
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
xmlNodePtr fragment;
fragment = child;
new_child = child->children;
child = new_child;
while (child->next != NULL) {
child->parent = parentp;
if (child->doc != parentp->doc) {
xmlSetTreeDoc(child, parentp->doc);
}
child = child->next;
}
child->parent = parentp;
if (child->doc != parentp->doc) {
xmlSetTreeDoc(child, parentp->doc);
}
if (refp->prev != NULL) {
refp->prev->next = new_child;
} else {
parentp->children = new_child;
}
new_child->prev = refp->prev;
refp->prev = child;
child->next = refp;
fragment->children = NULL;
}
if (new_child == NULL) {
new_child = xmlAddPrevSibling(refp, child);
}
new_child = xmlAddPrevSibling(refp, child);
} else {
if (child->parent == parentp){
xmlUnlinkNode(child);
}
if (child->type == XML_TEXT_NODE) {
if ((parentp->type == XML_TEXT_NODE) &&
(parentp->content != NULL) &&
(parentp != child)) {
xmlNodeAddContent(parentp, child->content);
php_libxml_node_free_resource(child TSRMLS_CC);
DOM_RET_OBJ(rv, parentp, &ret, intern);
return;
if (child->type == XML_TEXT_NODE && parentp->last != NULL && parentp->last->type == XML_TEXT_NODE) {
child->parent = parentp;
if (child->doc == NULL) {
xmlSetTreeDoc(child, parentp->doc);
}
if ((parentp->last != NULL) && (parentp->last->type == XML_TEXT_NODE) &&
(parentp->last->name == child->name) &&
(parentp->last != child)) {
xmlNodeAddContent(parentp->last, child->content);
php_libxml_node_free_resource(child TSRMLS_CC);
DOM_RET_OBJ(rv, parentp->last, &ret, intern);
return;
new_child = child;
if (parentp->children == NULL) {
parentp->children = child;
parentp->last = child;
} else {
child = parentp->last;
child->next = new_child;
new_child->prev = child;
parentp->last = new_child;
}
} else if (child->type == XML_ATTRIBUTE_NODE) {
xmlAttrPtr lastattr;
@@ -987,15 +1024,37 @@ PHP_FUNCTION(dom_node_insert_before)
return;
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
new_child = xmlAddChildList(parentp, child->children);
if (new_child != NULL) {
child->children = NULL;
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
xmlNodePtr fragment;
fragment = child;
new_child = child->children;
if (parentp->children == NULL) {
parentp->children = new_child;
} else {
child = parentp->last;
child->next = new_child;
new_child->prev = child;
}
DOM_RET_OBJ(rv, new_child, &ret, intern);
return;
child = new_child;
while (child->next != NULL) {
child->parent = parentp;
if (child->doc != parentp->doc) {
xmlSetTreeDoc(child, parentp->doc);
}
child = child->next;
}
child->parent = parentp;
if (child->doc != parentp->doc) {
xmlSetTreeDoc(child, parentp->doc);
}
parentp->last = child;
fragment->children = NULL;
}
if (new_child == NULL) {
new_child = xmlAddChild(parentp, child);
}
new_child = xmlAddChild(parentp, child);
}
if (NULL == new_child) {
@@ -1186,6 +1245,11 @@ PHP_FUNCTION(dom_node_append_child)
RETURN_FALSE;
}
if (child->type == XML_DOCUMENT_FRAG_NODE && child->children == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Document Fragment is empty");
RETURN_FALSE;
}
if (child->doc == NULL && nodep->doc != NULL) {
childobj->document = intern->document;
php_libxml_increment_doc_ref((php_libxml_node_object *)childobj, NULL TSRMLS_CC);
@@ -1195,20 +1259,20 @@ PHP_FUNCTION(dom_node_append_child)
xmlUnlinkNode(child);
}
if (child->type == XML_TEXT_NODE) {
if ((nodep->type == XML_TEXT_NODE) &&
(nodep->content != NULL)) {
xmlNodeAddContent(nodep, child->content);
php_libxml_node_free_resource(child TSRMLS_CC);
DOM_RET_OBJ(rv, nodep, &ret, intern);
return;
if (child->type == XML_TEXT_NODE && nodep->last != NULL && nodep->last->type == XML_TEXT_NODE) {
child->parent = nodep;
if (child->doc == NULL) {
xmlSetTreeDoc(child, nodep->doc);
}
if ((nodep->last != NULL) && (nodep->last->type == XML_TEXT_NODE) &&
(nodep->last->name == child->name)) {
xmlNodeAddContent(nodep->last, child->content);
php_libxml_node_free_resource(child TSRMLS_CC);
DOM_RET_OBJ(rv, nodep->last, &ret, intern);
return;
new_child = child;
if (nodep->children == NULL) {
nodep->children = child;
nodep->last = child;
} else {
child = nodep->last;
child->next = new_child;
new_child->prev = child;
nodep->last = new_child;
}
} else if (child->type == XML_ATTRIBUTE_NODE) {
xmlAttrPtr lastattr;
@@ -1223,20 +1287,40 @@ PHP_FUNCTION(dom_node_append_child)
php_libxml_node_free_resource((xmlNodePtr) lastattr TSRMLS_CC);
}
}
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
new_child = xmlAddChildList(nodep, child->children);
if (new_child != NULL) {
child->children = NULL;
} else if (child->type == XML_DOCUMENT_FRAG_NODE) {
xmlNodePtr fragment;
fragment = child;
new_child = child->children;
if (nodep->children == NULL) {
nodep->children = new_child;
} else {
child = nodep->last;
child->next = new_child;
new_child->prev = child;
}
DOM_RET_OBJ(rv, new_child, &ret, intern);
return;
child = new_child;
while (child->next != NULL) {
child->parent = nodep;
if (child->doc != nodep->doc) {
xmlSetTreeDoc(child, nodep->doc);
}
child = child->next;
}
child->parent = nodep;
if (child->doc != nodep->doc) {
xmlSetTreeDoc(child, nodep->doc);
}
nodep->last = child;
fragment->children = NULL;
}
new_child = xmlAddChild(nodep, child);
if (new_child == NULL) {
php_error(E_WARNING, "Couldn't append node");
RETURN_FALSE;
new_child = xmlAddChild(nodep, child);
if (new_child == NULL) {
php_error(E_WARNING, "Couldn't append node");
RETURN_FALSE;
}
}
dom_reconcile_ns(nodep->doc, new_child);
+25 -2
View File
@@ -322,6 +322,30 @@ PHP_FUNCTION(dom_import_simplexml)
}
/* }}} */
zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC)
{
zend_object_value retval;
void *new_object;
dom_object *intern;
struct _store_object *obj;
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
if (obj->clone == NULL) {
zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %s", Z_OBJCE_P(zobject)->name);
}
obj->clone(obj->object, &new_object TSRMLS_CC);
retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC);
intern = (dom_object *) new_object;
intern->handle = retval.handle;
retval.handlers = Z_OBJ_HT_P(zobject);
return retval;
}
static zend_function_entry dom_functions[] = {
PHP_FE(dom_import_simplexml, NULL)
{NULL, NULL, NULL}
@@ -353,14 +377,13 @@ PHP_MINIT_FUNCTION(dom)
dom_object_handlers.read_property = dom_read_property;
dom_object_handlers.write_property = dom_write_property;
dom_object_handlers.get_property_ptr_ptr = NULL;
dom_object_handlers.clone_obj = zend_objects_store_clone_obj;
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
zend_hash_init(&classes, 0, NULL, NULL, 1);
INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);
dom_domexception_class_entry = zend_register_internal_class_ex(&ce, zend_exception_get_default(), NULL TSRMLS_CC);
dom_domexception_class_entry->ce_flags |= ZEND_ACC_FINAL;
dom_domexception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED;
zend_declare_property_long(dom_domexception_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC);
REGISTER_DOM_CLASS(ce, "DOMStringList", NULL, php_dom_domstringlist_class_functions, dom_domstringlist_class_entry);
+485
View File
@@ -0,0 +1,485 @@
--TEST--
Bug # 28721: (appendChild() and insertBefore() unset DOMText)
--SKIPIF--
<?php require_once('skipif.php'); ?>
--FILE--
<?php
function print_node(DomNode $node) {
echo "name (value): " . $node->nodeName . " (" . $node->nodeValue . ")\n";
}
function print_node_r(DomNode $node) {
static $indent = "";
echo "\n" . $indent;
print_node($node);
echo $indent . "parent: ";
if ( $node->parentNode )
print_node($node->parentNode);
else
echo "NULL\n";
echo $indent . "previousSibling: ";
if ( $node->previousSibling )
print_node($node->previousSibling);
else
echo "NULL\n";
echo $indent . "nextSibling: ";
if ( $node->nextSibling )
print_node($node->nextSibling);
else
echo "NULL\n";
if ( !$node->hasChildNodes() )
return;
foreach ($node->childNodes as $child) {
$old_indent = $indent;
$indent .= " ";
print_node_r($child);
$indent = $old_indent;
}
}
function err_handler($errno, $errstr, $errfile, $errline) {
echo "Error ($errno) on line $errline: $errstr\n";
}
// Record 'DocumentFragment is empty' warnings
set_error_handler("err_handler", E_WARNING);
$xml = new DomDocument();
$p = $xml->createElement("p");
$p->appendChild($t1 = $xml->createTextNode(" t1 "));
$p->appendChild($b = $xml->createElement("b"));
$b->appendChild($xml->createTextNode("X"));
$p->appendChild($t2 = $xml->createTextNode(" t2 "));
$p->appendChild($xml->createTextNode(" xxx "));
print_node_r($p);
echo "\nAppend t1 to p:\n";
$ret = $p->appendChild($t1);
print_node_r($p);
echo "\n";
echo "t1 == ret: ";
var_dump( $t1 === $ret );
$d = $xml->createElement("div");
$d->appendChild($t3 = $xml->createTextNode(" t3 "));
$d->appendChild($b = $xml->createElement("b"));
$b->appendChild($xml->createElement("X"));
$d->appendChild($t4 = $xml->createTextNode(" t4 "));
$d->appendChild($xml->createTextNode(" xxx "));
echo "\ndiv:\n";
print_node_r($d);
echo "\nInsert t4 before t3:\n";
$ret = $d->insertBefore($t4, $t3);
print_node_r($d);
echo "\n";
$frag = $xml->createDocumentFragment();
$t5 = $frag->appendChild($xml->createTextNode(" t5 "));
$frag->appendChild($i = $xml->createElement("i"));
$i->appendChild($xml->createTextNode(" frob "));
$frag->appendChild($xml->createTextNOde(" t6 "));
echo "\np:\n";
print_node_r($p);
echo "\nFragment:\n";
print_node_r($frag);
echo "\nAppending fragment to p:\n";
$p->appendChild($frag);
print_node_r($p);
echo "\nFragment:\n";
print_node_r($frag);
echo "\ndiv:\n";
print_node_r($d);
echo "\nInserting fragment before t4\n";
$d->insertBefore($frag, $t4);
print_node_r($d);
echo "\np:\n";
print_node_r($p);
?>
--EXPECT--
name (value): p ( t1 X t2 xxx )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t1 )
parent: name (value): p ( t1 X t2 xxx )
previousSibling: NULL
nextSibling: name (value): b (X)
name (value): b (X)
parent: name (value): p ( t1 X t2 xxx )
previousSibling: name (value): #text ( t1 )
nextSibling: name (value): #text ( t2 )
name (value): #text (X)
parent: name (value): b (X)
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t2 )
parent: name (value): p ( t1 X t2 xxx )
previousSibling: name (value): b (X)
nextSibling: name (value): #text ( xxx )
name (value): #text ( xxx )
parent: name (value): p ( t1 X t2 xxx )
previousSibling: name (value): #text ( t2 )
nextSibling: NULL
Append t1 to p:
name (value): p (X t2 xxx t1 )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): b (X)
parent: name (value): p (X t2 xxx t1 )
previousSibling: NULL
nextSibling: name (value): #text ( t2 )
name (value): #text (X)
parent: name (value): b (X)
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t2 )
parent: name (value): p (X t2 xxx t1 )
previousSibling: name (value): b (X)
nextSibling: name (value): #text ( xxx )
name (value): #text ( xxx )
parent: name (value): p (X t2 xxx t1 )
previousSibling: name (value): #text ( t2 )
nextSibling: name (value): #text ( t1 )
name (value): #text ( t1 )
parent: name (value): p (X t2 xxx t1 )
previousSibling: name (value): #text ( xxx )
nextSibling: NULL
t1 == ret: bool(true)
div:
name (value): div ( t3 t4 xxx )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t3 )
parent: name (value): div ( t3 t4 xxx )
previousSibling: NULL
nextSibling: name (value): b ()
name (value): b ()
parent: name (value): div ( t3 t4 xxx )
previousSibling: name (value): #text ( t3 )
nextSibling: name (value): #text ( t4 )
name (value): X ()
parent: name (value): b ()
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t4 )
parent: name (value): div ( t3 t4 xxx )
previousSibling: name (value): b ()
nextSibling: name (value): #text ( xxx )
name (value): #text ( xxx )
parent: name (value): div ( t3 t4 xxx )
previousSibling: name (value): #text ( t4 )
nextSibling: NULL
Insert t4 before t3:
name (value): div ( t4 t3 xxx )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t4 )
parent: name (value): div ( t4 t3 xxx )
previousSibling: NULL
nextSibling: name (value): #text ( t3 )
name (value): #text ( t3 )
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): #text ( t4 )
nextSibling: name (value): b ()
name (value): b ()
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): #text ( t3 )
nextSibling: name (value): #text ( xxx )
name (value): X ()
parent: name (value): b ()
previousSibling: NULL
nextSibling: NULL
name (value): #text ( xxx )
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): b ()
nextSibling: NULL
p:
name (value): p (X t2 xxx t1 )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): b (X)
parent: name (value): p (X t2 xxx t1 )
previousSibling: NULL
nextSibling: name (value): #text ( t2 )
name (value): #text (X)
parent: name (value): b (X)
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t2 )
parent: name (value): p (X t2 xxx t1 )
previousSibling: name (value): b (X)
nextSibling: name (value): #text ( xxx )
name (value): #text ( xxx )
parent: name (value): p (X t2 xxx t1 )
previousSibling: name (value): #text ( t2 )
nextSibling: name (value): #text ( t1 )
name (value): #text ( t1 )
parent: name (value): p (X t2 xxx t1 )
previousSibling: name (value): #text ( xxx )
nextSibling: NULL
Fragment:
name (value): #document-fragment ()
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t5 )
parent: name (value): #document-fragment ()
previousSibling: NULL
nextSibling: name (value): i ( frob )
name (value): i ( frob )
parent: name (value): #document-fragment ()
previousSibling: name (value): #text ( t5 )
nextSibling: name (value): #text ( t6 )
name (value): #text ( frob )
parent: name (value): i ( frob )
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t6 )
parent: name (value): #document-fragment ()
previousSibling: name (value): i ( frob )
nextSibling: NULL
Appending fragment to p:
name (value): p (X t2 xxx t1 t5 frob t6 )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): b (X)
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: NULL
nextSibling: name (value): #text ( t2 )
name (value): #text (X)
parent: name (value): b (X)
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t2 )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): b (X)
nextSibling: name (value): #text ( xxx )
name (value): #text ( xxx )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): #text ( t2 )
nextSibling: name (value): #text ( t1 )
name (value): #text ( t1 )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): #text ( xxx )
nextSibling: name (value): #text ( t5 )
name (value): #text ( t5 )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): #text ( t1 )
nextSibling: name (value): i ( frob )
name (value): i ( frob )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): #text ( t5 )
nextSibling: name (value): #text ( t6 )
name (value): #text ( frob )
parent: name (value): i ( frob )
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t6 )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): i ( frob )
nextSibling: NULL
Fragment:
name (value): #document-fragment ()
parent: NULL
previousSibling: NULL
nextSibling: NULL
div:
name (value): div ( t4 t3 xxx )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t4 )
parent: name (value): div ( t4 t3 xxx )
previousSibling: NULL
nextSibling: name (value): #text ( t3 )
name (value): #text ( t3 )
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): #text ( t4 )
nextSibling: name (value): b ()
name (value): b ()
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): #text ( t3 )
nextSibling: name (value): #text ( xxx )
name (value): X ()
parent: name (value): b ()
previousSibling: NULL
nextSibling: NULL
name (value): #text ( xxx )
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): b ()
nextSibling: NULL
Inserting fragment before t4
Error (2) on line 109: DOMNode::insertBefore(): Document Fragment is empty
name (value): div ( t4 t3 xxx )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t4 )
parent: name (value): div ( t4 t3 xxx )
previousSibling: NULL
nextSibling: name (value): #text ( t3 )
name (value): #text ( t3 )
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): #text ( t4 )
nextSibling: name (value): b ()
name (value): b ()
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): #text ( t3 )
nextSibling: name (value): #text ( xxx )
name (value): X ()
parent: name (value): b ()
previousSibling: NULL
nextSibling: NULL
name (value): #text ( xxx )
parent: name (value): div ( t4 t3 xxx )
previousSibling: name (value): b ()
nextSibling: NULL
p:
name (value): p (X t2 xxx t1 t5 frob t6 )
parent: NULL
previousSibling: NULL
nextSibling: NULL
name (value): b (X)
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: NULL
nextSibling: name (value): #text ( t2 )
name (value): #text (X)
parent: name (value): b (X)
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t2 )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): b (X)
nextSibling: name (value): #text ( xxx )
name (value): #text ( xxx )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): #text ( t2 )
nextSibling: name (value): #text ( t1 )
name (value): #text ( t1 )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): #text ( xxx )
nextSibling: name (value): #text ( t5 )
name (value): #text ( t5 )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): #text ( t1 )
nextSibling: name (value): i ( frob )
name (value): i ( frob )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): #text ( t5 )
nextSibling: name (value): #text ( t6 )
name (value): #text ( frob )
parent: name (value): i ( frob )
previousSibling: NULL
nextSibling: NULL
name (value): #text ( t6 )
parent: name (value): p (X t2 xxx t1 t5 frob t6 )
previousSibling: name (value): i ( frob )
nextSibling: NULL
+1 -1
View File
@@ -23,7 +23,7 @@ function adjustDoctype($xml) {
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><title>Hello world</title></head><body><p>
This is a not well-formed<br/>
html files with undeclared entities 
html files with undeclared entities&#xA0;
</p></body></html>
--- save as HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+4 -1
View File
@@ -259,6 +259,7 @@ AC_DEFUN(PHP_GD_CHECK_VERSION,[
PHP_CHECK_LIBRARY(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdCacheCreate, [AC_DEFINE(HAVE_GD_CACHE_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdFontCacheShutdown, [AC_DEFINE(HAVE_GD_THREAD_SAFE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdNewDynamicCtxEx, [AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
])
dnl
@@ -272,7 +273,7 @@ if test "$PHP_GD" = "yes"; then
libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c libgd/gdfontmb.c libgd/gdfontl.c \
libgd/gdfontg.c libgd/gdtables.c libgd/gdft.c libgd/gdcache.c libgd/gdkanji.c \
libgd/wbmp.c libgd/gd_wbmp.c libgd/gdhelpers.c libgd/gd_topal.c libgd/gd_gif_in.c \
libgd/xbm.c"
libgd/xbm.c libgd/gd_gif_out.c "
dnl check for fabsf and floorf which are available since C99
AC_CHECK_FUNCS(fabsf floorf)
@@ -306,7 +307,9 @@ dnl These are always available with bundled library
AC_DEFINE(HAVE_GD_XBM, 1, [ ])
AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ])
AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])
AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ])
AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ])
AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])
dnl Make sure the libgd/ is first in the include path
GDLIB_CFLAGS="-DHAVE_LIBPNG"
+2 -1
View File
@@ -13,7 +13,7 @@ if (PHP_GD != "no") {
EXTENSION("gd", "gd.c gdttf.c", null, "-Iext/gd/libgd", "php_gd2.dll");
ADD_SOURCES("ext/gd/libgd", "gd2copypal.c gd_arc_f_buggy.c gd.c \
gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \
gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gdhelpers.c gd_io.c gd_io_dp.c \
gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \
gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \
gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c xbm.c", "gd");
AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
@@ -21,6 +21,7 @@ if (PHP_GD != "no") {
/D HAVE_GD_BUNDLED=1 \
/D HAVE_GD_GD2 \
/D HAVE_GD_GIF_READ=1 \
/D HAVE_GD_GIF_CREATE=1 \
/D HAVE_GDIMAGECOLORRESOLVE=1 \
/D HAVE_GD_IMAGESETBRUSH=1 \
/D HAVE_GD_IMAGESETTILE=1 \
+8 -4
View File
@@ -115,6 +115,10 @@ extern int gdImageColorResolve(gdImagePtr, int, int, int);
int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b);
#endif
#ifndef HAVE_GD_DYNAMIC_CTX_EX
#define gdNewDynamicCtxEx(len, data, val) gdNewDynamicCtx(len, data)
#endif
/* Section Filters Declarations */
/* IMPORTANT NOTE FOR NEW FILTER
* Do not forget to update:
@@ -453,7 +457,7 @@ PHP_RSHUTDOWN_FUNCTION(gd)
/* }}} */
#if HAVE_GD_BUNDLED
#define PHP_GD_VERSION_STRING "bundled (2.0.23 compatible)"
#define PHP_GD_VERSION_STRING "bundled (2.0.28 compatible)"
#elif HAVE_LIBGD20
#define PHP_GD_VERSION_STRING "2.0 or higher"
#elif HAVE_GDIMAGECOLORRESOLVE
@@ -1343,7 +1347,7 @@ static int _php_image_type (char data[8])
#ifdef HAVE_GD_WBMP
else {
gdIOCtx *io_ctx;
io_ctx = gdNewDynamicCtx(8, data);
io_ctx = gdNewDynamicCtxEx(8, data, 0);
if (io_ctx) {
if (getmbi((int(*)(void *)) gdGetC, io_ctx) == 0 && skipheader((int(*)(void *)) gdGetC, io_ctx) == 0 ) {
#if HAVE_LIBGD204
@@ -1375,7 +1379,7 @@ gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioc
gdImagePtr im;
gdIOCtx *io_ctx;
io_ctx = gdNewDynamicCtx (Z_STRLEN_PP(data), Z_STRVAL_PP(data));
io_ctx = gdNewDynamicCtxEx(Z_STRLEN_PP(data), Z_STRVAL_PP(data), 0);
if (!io_ctx) {
return NULL;
@@ -1530,7 +1534,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
goto out_err;
}
io_ctx = gdNewDynamicCtx(buff_size, buff);
io_ctx = gdNewDynamicCtxEx(buff_size, buff, 0);
if (!io_ctx) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context");
goto out_err;
+8 -4
View File
@@ -43,8 +43,8 @@ RSC=rc.exe
# PROP Intermediate_Dir "Release_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -73,8 +73,8 @@ LINK32=link.exe
# PROP Intermediate_Dir "Debug_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -213,6 +213,10 @@ SOURCE=.\libgd\gd_gd2.c
SOURCE=.\libgd\gd_gif_in.c
# End Source File
# Begin Source File
SOURCE=.\libgd\gd_gif_out.c
# End Source File
# Begin Source File
SOURCE=.\libgd\gd_io.c
+5
View File
@@ -407,8 +407,11 @@ void gdImageColorDeallocate(gdImagePtr im, int color);
conversion to palette is not great (for small images
it can be negative) and the quality loss is ugly. */
gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im, int ditherFlag, int colorsWanted);
void gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted);
/* An attempt at getting the results of gdImageTrueColorToPalette
to look a bit more like the original (im1 is the original
and im2 is the palette version */
@@ -428,6 +431,8 @@ void gdImageColorTransparent(gdImagePtr im, int color);
void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src);
void gdImagePng(gdImagePtr im, FILE *out);
void gdImagePngCtx(gdImagePtr im, gdIOCtx *out);
void gdImageGif(gdImagePtr im, FILE *out);
void gdImageGifCtx(gdImagePtr im, gdIOCtx *out);
/* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all,
* 1 is FASTEST but produces larger files, 9 provides the best
* compression (smallest files) but takes a long time to compress, and
+759
View File
@@ -0,0 +1,759 @@
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "gd.h"
/* Code drawn from ppmtogif.c, from the pbmplus package
**
** Based on GIFENCOD by David Rowley <mgardi@watdscu.waterloo.edu>. A
** Lempel-Zim compression based on "compress".
**
** Modified by Marcel Wijkstra <wijkstra@fwi.uva.nl>
**
** Copyright (C) 1989 by Jef Poskanzer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation. This software is provided "as is" without express or
** implied warranty.
**
** The Graphics Interchange Format(c) is the Copyright property of
** CompuServe Incorporated. GIF(sm) is a Service Mark property of
** CompuServe Incorporated.
*/
/*
* a code_int must be able to hold 2**GIFBITS values of type int, and also -1
*/
typedef int code_int;
#ifdef SIGNED_COMPARE_SLOW
typedef unsigned long int count_int;
typedef unsigned short int count_short;
#else /*SIGNED_COMPARE_SLOW*/
typedef long int count_int;
#endif /*SIGNED_COMPARE_SLOW*/
/* 2.0.28: threadsafe */
#define maxbits GIFBITS
/* should NEVER generate this code */
#define maxmaxcode ((code_int)1 << GIFBITS)
#define HSIZE 5003 /* 80% occupancy */
#define hsize HSIZE /* Apparently invariant, left over from
compress */
typedef struct {
int Width, Height;
int curx, cury;
long CountDown;
int Pass;
int Interlace;
int n_bits; /* number of bits/code */
code_int maxcode; /* maximum code, given n_bits */
count_int htab [HSIZE];
unsigned short codetab [HSIZE];
code_int free_ent; /* first unused entry */
/*
* block compression parameters -- after all codes are used up,
* and compression rate changes, start over.
*/
int clear_flg;
int offset;
long int in_count; /* length of input */
long int out_count; /* # of codes output (for debugging) */
int g_init_bits;
gdIOCtx * g_outfile;
int ClearCode;
int EOFCode;
unsigned long cur_accum;
int cur_bits;
/*
* Number of characters so far in this 'packet'
*/
int a_count;
/*
* Define the storage for the packet accumulator
*/
char accum[ 256 ];
} GifCtx;
static int gifPutWord(int w, gdIOCtx *out);
static int colorstobpp(int colors);
static void BumpPixel (GifCtx *ctx);
static int GIFNextPixel (gdImagePtr im, GifCtx *ctx);
static void GIFEncode (gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im);
static void compress (int init_bits, gdIOCtx *outfile, gdImagePtr im, GifCtx *ctx);
static void output (code_int code, GifCtx *ctx);
static void cl_block (GifCtx *ctx);
static void cl_hash (register count_int chsize, GifCtx *ctx);
static void char_init (GifCtx *ctx);
static void char_out (int c, GifCtx *ctx);
static void flush_char (GifCtx *ctx);
void * gdImageGifPtr (gdImagePtr im, int *size)
{
void *rv;
gdIOCtx *out = gdNewDynamicCtx (2048, NULL);
gdImageGifCtx (im, out);
rv = gdDPExtractData (out, size);
out->gd_free (out);
return rv;
}
void gdImageGif (gdImagePtr im, FILE * outFile)
{
gdIOCtx *out = gdNewFileCtx (outFile);
gdImageGifCtx (im, out);
out->gd_free (out);
}
void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out)
{
gdImagePtr pim = 0, tim = im;
int interlace, transparent, BitsPerPixel;
interlace = im->interlace;
transparent = im->transparent;
if (im->trueColor) {
/* Expensive, but the only way that produces an
acceptable result: mix down to a palette
based temporary image. */
pim = gdImageCreatePaletteFromTrueColor(im, 1, 256);
if (!pim) {
return;
}
tim = pim;
}
BitsPerPixel = colorstobpp(tim->colorsTotal);
/* All set, let's do it. */
GIFEncode(
out, tim->sx, tim->sy, interlace, 0, transparent, BitsPerPixel,
tim->red, tim->green, tim->blue, tim);
if (pim) {
/* Destroy palette based temporary image. */
gdImageDestroy( pim);
}
}
static int
colorstobpp(int colors)
{
int bpp = 0;
if ( colors <= 2 )
bpp = 1;
else if ( colors <= 4 )
bpp = 2;
else if ( colors <= 8 )
bpp = 3;
else if ( colors <= 16 )
bpp = 4;
else if ( colors <= 32 )
bpp = 5;
else if ( colors <= 64 )
bpp = 6;
else if ( colors <= 128 )
bpp = 7;
else if ( colors <= 256 )
bpp = 8;
return bpp;
}
/*****************************************************************************
*
* GIFENCODE.C - GIF Image compression interface
*
* GIFEncode( FName, GHeight, GWidth, GInterlace, Background, Transparent,
* BitsPerPixel, Red, Green, Blue, gdImagePtr )
*
*****************************************************************************/
#define TRUE 1
#define FALSE 0
/*
* Bump the 'curx' and 'cury' to point to the next pixel
*/
static void
BumpPixel(GifCtx *ctx)
{
/*
* Bump the current X position
*/
++(ctx->curx);
/*
* If we are at the end of a scan line, set curx back to the beginning
* If we are interlaced, bump the cury to the appropriate spot,
* otherwise, just increment it.
*/
if( ctx->curx == ctx->Width ) {
ctx->curx = 0;
if( !ctx->Interlace )
++(ctx->cury);
else {
switch( ctx->Pass ) {
case 0:
ctx->cury += 8;
if( ctx->cury >= ctx->Height ) {
++(ctx->Pass);
ctx->cury = 4;
}
break;
case 1:
ctx->cury += 8;
if( ctx->cury >= ctx->Height ) {
++(ctx->Pass);
ctx->cury = 2;
}
break;
case 2:
ctx->cury += 4;
if( ctx->cury >= ctx->Height ) {
++(ctx->Pass);
ctx->cury = 1;
}
break;
case 3:
ctx->cury += 2;
break;
}
}
}
}
/*
* Return the next pixel from the image
*/
static int
GIFNextPixel(gdImagePtr im, GifCtx *ctx)
{
int r;
if( ctx->CountDown == 0 )
return EOF;
--(ctx->CountDown);
r = gdImageGetPixel(im, ctx->curx, ctx->cury);
BumpPixel(ctx);
return r;
}
/* public */
static void
GIFEncode(gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im)
{
int B;
int RWidth, RHeight;
int LeftOfs, TopOfs;
int Resolution;
int ColorMapSize;
int InitCodeSize;
int i;
GifCtx ctx;
ctx.Interlace = GInterlace;
ctx.in_count = 1;
memset(&ctx, 0, sizeof(ctx));
ColorMapSize = 1 << BitsPerPixel;
RWidth = ctx.Width = GWidth;
RHeight = ctx.Height = GHeight;
LeftOfs = TopOfs = 0;
Resolution = BitsPerPixel;
/*
* Calculate number of bits we are expecting
*/
ctx.CountDown = (long)ctx.Width * (long)ctx.Height;
/*
* Indicate which pass we are on (if interlace)
*/
ctx.Pass = 0;
/*
* The initial code size
*/
if( BitsPerPixel <= 1 )
InitCodeSize = 2;
else
InitCodeSize = BitsPerPixel;
/*
* Set up the current x and y position
*/
ctx.curx = ctx.cury = 0;
/*
* Write the Magic header
*/
gdPutBuf(Transparent < 0 ? "GIF87a" : "GIF89a", 6, fp );
/*
* Write out the screen width and height
*/
gifPutWord( RWidth, fp );
gifPutWord( RHeight, fp );
/*
* Indicate that there is a global colour map
*/
B = 0x80; /* Yes, there is a color map */
/*
* OR in the resolution
*/
B |= (Resolution - 1) << 5;
/*
* OR in the Bits per Pixel
*/
B |= (BitsPerPixel - 1);
/*
* Write it out
*/
gdPutC( B, fp );
/*
* Write out the Background colour
*/
gdPutC( Background, fp );
/*
* Byte of 0's (future expansion)
*/
gdPutC( 0, fp );
/*
* Write out the Global Colour Map
*/
for( i=0; i<ColorMapSize; ++i ) {
gdPutC( Red[i], fp );
gdPutC( Green[i], fp );
gdPutC( Blue[i], fp );
}
/*
* Write out extension for transparent colour index, if necessary.
*/
if ( Transparent >= 0 ) {
gdPutC( '!', fp );
gdPutC( 0xf9, fp );
gdPutC( 4, fp );
gdPutC( 1, fp );
gdPutC( 0, fp );
gdPutC( 0, fp );
gdPutC( (unsigned char) Transparent, fp );
gdPutC( 0, fp );
}
/*
* Write an Image separator
*/
gdPutC( ',', fp );
/*
* Write the Image header
*/
gifPutWord( LeftOfs, fp );
gifPutWord( TopOfs, fp );
gifPutWord( ctx.Width, fp );
gifPutWord( ctx.Height, fp );
/*
* Write out whether or not the image is interlaced
*/
if( ctx.Interlace )
gdPutC( 0x40, fp );
else
gdPutC( 0x00, fp );
/*
* Write out the initial code size
*/
gdPutC( InitCodeSize, fp );
/*
* Go and actually compress the data
*/
compress( InitCodeSize+1, fp, im, &ctx );
/*
* Write out a Zero-length packet (to end the series)
*/
gdPutC( 0, fp );
/*
* Write the GIF file terminator
*/
gdPutC( ';', fp );
}
/***************************************************************************
*
* GIFCOMPR.C - GIF Image compression routines
*
* Lempel-Ziv compression based on 'compress'. GIF modifications by
* David Rowley (mgardi@watdcsu.waterloo.edu)
*
***************************************************************************/
/*
* General DEFINEs
*/
#define GIFBITS 12
#ifdef NO_UCHAR
typedef char char_type;
#else /*NO_UCHAR*/
typedef unsigned char char_type;
#endif /*NO_UCHAR*/
/*
*
* GIF Image compression - modified 'compress'
*
* Based on: compress.c - File compression ala IEEE Computer, June 1984.
*
* By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)
* Jim McKie (decvax!mcvax!jim)
* Steve Davies (decvax!vax135!petsd!peora!srd)
* Ken Turkowski (decvax!decwrl!turtlevax!ken)
* James A. Woods (decvax!ihnp4!ames!jaw)
* Joe Orost (decvax!vax135!petsd!joe)
*
*/
#include <ctype.h>
#define ARGVAL() (*++(*argv) || (--argc && *++argv))
#ifdef COMPATIBLE /* But wrong! */
# define MAXCODE(n_bits) ((code_int) 1 << (n_bits) - 1)
#else /*COMPATIBLE*/
# define MAXCODE(n_bits) (((code_int) 1 << (n_bits)) - 1)
#endif /*COMPATIBLE*/
#define HashTabOf(i) ctx->htab[i]
#define CodeTabOf(i) ctx->codetab[i]
/*
* To save much memory, we overlay the table used by compress() with those
* used by decompress(). The tab_prefix table is the same size and type
* as the codetab. The tab_suffix table needs 2**GIFBITS characters. We
* get this from the beginning of htab. The output stack uses the rest
* of htab, and contains characters. There is plenty of room for any
* possible stack (stack used to be 8000 characters).
*/
#define tab_prefixof(i) CodeTabOf(i)
#define tab_suffixof(i) ((char_type*)(htab))[i]
#define de_stack ((char_type*)&tab_suffixof((code_int)1<<GIFBITS))
/*
* compress stdin to stdout
*
* Algorithm: use open addressing double hashing (no chaining) on the
* prefix code / next character combination. We do a variant of Knuth's
* algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime
* secondary probe. Here, the modular division first probe is gives way
* to a faster exclusive-or manipulation. Also do block compression with
* an adaptive reset, whereby the code table is cleared when the compression
* ratio decreases, but after the table fills. The variable-length output
* codes are re-sized at this point, and a special CLEAR code is generated
* for the decompressor. Late addition: construct the table according to
* file size for noticeable speed improvement on small files. Please direct
* questions about this implementation to ames!jaw.
*/
static void
output(code_int code, GifCtx *ctx);
static void
compress(int init_bits, gdIOCtxPtr outfile, gdImagePtr im, GifCtx *ctx)
{
register long fcode;
register code_int i /* = 0 */;
register int c;
register code_int ent;
register code_int disp;
register code_int hsize_reg;
register int hshift;
/*
* Set up the globals: g_init_bits - initial number of bits
* g_outfile - pointer to output file
*/
ctx->g_init_bits = init_bits;
ctx->g_outfile = outfile;
/*
* Set up the necessary values
*/
ctx->offset = 0;
ctx->out_count = 0;
ctx->clear_flg = 0;
ctx->in_count = 1;
ctx->maxcode = MAXCODE(ctx->n_bits = ctx->g_init_bits);
ctx->ClearCode = (1 << (init_bits - 1));
ctx->EOFCode = ctx->ClearCode + 1;
ctx->free_ent = ctx->ClearCode + 2;
char_init(ctx);
ent = GIFNextPixel( im, ctx );
hshift = 0;
for ( fcode = (long) hsize; fcode < 65536L; fcode *= 2L )
++hshift;
hshift = 8 - hshift; /* set hash code range bound */
hsize_reg = hsize;
cl_hash( (count_int) hsize_reg, ctx ); /* clear hash table */
output( (code_int)ctx->ClearCode, ctx );
#ifdef SIGNED_COMPARE_SLOW
while ( (c = GIFNextPixel( im )) != (unsigned) EOF ) {
#else /*SIGNED_COMPARE_SLOW*/
while ( (c = GIFNextPixel( im, ctx )) != EOF ) { /* } */
#endif /*SIGNED_COMPARE_SLOW*/
++(ctx->in_count);
fcode = (long) (((long) c << maxbits) + ent);
i = (((code_int)c << hshift) ^ ent); /* xor hashing */
if ( HashTabOf (i) == fcode ) {
ent = CodeTabOf (i);
continue;
} else if ( (long)HashTabOf (i) < 0 ) /* empty slot */
goto nomatch;
disp = hsize_reg - i; /* secondary hash (after G. Knott) */
if ( i == 0 )
disp = 1;
probe:
if ( (i -= disp) < 0 )
i += hsize_reg;
if ( HashTabOf (i) == fcode ) {
ent = CodeTabOf (i);
continue;
}
if ( (long)HashTabOf (i) > 0 )
goto probe;
nomatch:
output ( (code_int) ent, ctx );
++(ctx->out_count);
ent = c;
#ifdef SIGNED_COMPARE_SLOW
if ( (unsigned) ctx->free_ent < (unsigned) maxmaxcode) {
#else /*SIGNED_COMPARE_SLOW*/
if ( ctx->free_ent < maxmaxcode ) { /* } */
#endif /*SIGNED_COMPARE_SLOW*/
CodeTabOf (i) = ctx->free_ent++; /* code -> hashtable */
HashTabOf (i) = fcode;
} else
cl_block(ctx);
}
/*
* Put out the final code.
*/
output( (code_int)ent, ctx );
++(ctx->out_count);
output( (code_int) ctx->EOFCode, ctx );
}
/*****************************************************************
* TAG( output )
*
* Output the given code.
* Inputs:
* code: A n_bits-bit integer. If == -1, then EOF. This assumes
* that n_bits =< (long)wordsize - 1.
* Outputs:
* Outputs code to the file.
* Assumptions:
* Chars are 8 bits long.
* Algorithm:
* Maintain a GIFBITS character long buffer (so that 8 codes will
* fit in it exactly). Use the VAX insv instruction to insert each
* code in turn. When the buffer fills up empty it and start over.
*/
static unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F,
0x001F, 0x003F, 0x007F, 0x00FF,
0x01FF, 0x03FF, 0x07FF, 0x0FFF,
0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF };
static void
output(code_int code, GifCtx *ctx)
{
ctx->cur_accum &= masks[ ctx->cur_bits ];
if( ctx->cur_bits > 0 )
ctx->cur_accum |= ((long)code << ctx->cur_bits);
else
ctx->cur_accum = code;
ctx->cur_bits += ctx->n_bits;
while( ctx->cur_bits >= 8 ) {
char_out( (unsigned int)(ctx->cur_accum & 0xff), ctx );
ctx->cur_accum >>= 8;
ctx->cur_bits -= 8;
}
/*
* If the next entry is going to be too big for the code size,
* then increase it, if possible.
*/
if ( ctx->free_ent > ctx->maxcode || ctx->clear_flg ) {
if( ctx->clear_flg ) {
ctx->maxcode = MAXCODE (ctx->n_bits = ctx->g_init_bits);
ctx->clear_flg = 0;
} else {
++(ctx->n_bits);
if ( ctx->n_bits == maxbits )
ctx->maxcode = maxmaxcode;
else
ctx->maxcode = MAXCODE(ctx->n_bits);
}
}
if( code == ctx->EOFCode ) {
/*
* At EOF, write the rest of the buffer.
*/
while( ctx->cur_bits > 0 ) {
char_out( (unsigned int)(ctx->cur_accum & 0xff), ctx);
ctx->cur_accum >>= 8;
ctx->cur_bits -= 8;
}
flush_char(ctx);
}
}
/*
* Clear out the hash table
*/
static void
cl_block (GifCtx *ctx) /* table clear for block compress */
{
cl_hash ( (count_int) hsize, ctx );
ctx->free_ent = ctx->ClearCode + 2;
ctx->clear_flg = 1;
output( (code_int)ctx->ClearCode, ctx);
}
static void
cl_hash(register count_int chsize, GifCtx *ctx) /* reset code table */
{
register count_int *htab_p = ctx->htab+chsize;
register long i;
register long m1 = -1;
i = chsize - 16;
do { /* might use Sys V memset(3) here */
*(htab_p-16) = m1;
*(htab_p-15) = m1;
*(htab_p-14) = m1;
*(htab_p-13) = m1;
*(htab_p-12) = m1;
*(htab_p-11) = m1;
*(htab_p-10) = m1;
*(htab_p-9) = m1;
*(htab_p-8) = m1;
*(htab_p-7) = m1;
*(htab_p-6) = m1;
*(htab_p-5) = m1;
*(htab_p-4) = m1;
*(htab_p-3) = m1;
*(htab_p-2) = m1;
*(htab_p-1) = m1;
htab_p -= 16;
} while ((i -= 16) >= 0);
for ( i += 16; i > 0; --i )
*--htab_p = m1;
}
/******************************************************************************
*
* GIF Specific routines
*
******************************************************************************/
/*
* Set up the 'byte output' routine
*/
static void
char_init(GifCtx *ctx)
{
ctx->a_count = 0;
}
/*
* Add a character to the end of the current packet, and if it is 254
* characters, flush the packet to disk.
*/
static void
char_out(int c, GifCtx *ctx)
{
ctx->accum[ ctx->a_count++ ] = c;
if( ctx->a_count >= 254 )
flush_char(ctx);
}
/*
* Flush the packet to disk, and reset the accumulator
*/
static void
flush_char(GifCtx *ctx)
{
if( ctx->a_count > 0 ) {
gdPutC( ctx->a_count, ctx->g_outfile );
gdPutBuf( ctx->accum, ctx->a_count, ctx->g_outfile );
ctx->a_count = 0;
}
}
static int gifPutWord(int w, gdIOCtx *out)
{
/* Byte order is little-endian */
gdPutC(w & 0xFF, out);
gdPutC((w >> 8) & 0xFF, out);
return 0;
}
+1333 -1137
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -914,7 +914,7 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
}
/* EAM DEBUG */
#if (defined(FREETYPE_MAJOR) && (FREETYPE_MAJOR >=2 ) && (FREETYPE_MINOR >= 1))
#if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2)))
if (font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL) {
/* I do not know the significance of the constant 0xf000.
* It was determined by inspection of the character codes
+2 -1
View File
@@ -27,7 +27,6 @@
#if HAVE_LIBINTL
#include <stdio.h>
#include <libintl.h>
#include "ext/standard/info.h"
#include "php_gettext.h"
@@ -57,6 +56,8 @@ function_entry php_gettext_functions[] = {
};
/* }}} */
#include <libintl.h>
zend_module_entry php_gettext_module_entry = {
STANDARD_MODULE_HEADER,
"gettext",
+1 -2
View File
@@ -842,8 +842,7 @@ ZEND_FUNCTION(gmp_powm)
}
FETCH_GMP_ZVAL(gmpnum_mod, mod_arg);
convert_to_long_ex(mod_arg);
if (!Z_LVAL_PP(mod_arg)) {
if (!mpz_cmp_ui(*gmpnum_mod, 0)) {
RETURN_FALSE;
}
+1 -1
View File
@@ -3,7 +3,7 @@ dnl $Id$
dnl
PHP_ARG_WITH(iconv, for iconv support,
[ --without-iconv[=DIR] Include iconv support], yes)
[ --without-iconv[=DIR] Exclude iconv support], yes)
if test "$PHP_ICONV" != "no"; then
+3 -1
View File
@@ -12,6 +12,8 @@ if (PHP_ICONV != "no") {
AC_DEFINE("HAVE_LIBICONV", 1, "Define if libiconv is available");
AC_DEFINE("PHP_ICONV_IMPL", "\"libiconv\"", "Which iconv implementation to use");
AC_DEFINE("ICONV_SUPPORTS_ERRNO", 1, "Whether iconv supports errno or not");
if (!PHP_ICONV_SHARED) {
ADD_DEF_FILE("ext\\iconv\\php_iconv.def");
}
}
}
+58 -23
View File
@@ -2344,7 +2344,7 @@ static php_iconv_err_t php_iconv_stream_filter_ctor(php_iconv_stream_filter *sel
/* }}} */
/* {{{ php_iconv_stream_filter_append_bucket */
static size_t php_iconv_stream_filter_append_bucket(
static int php_iconv_stream_filter_append_bucket(
php_iconv_stream_filter *self,
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_out,
@@ -2367,7 +2367,11 @@ static size_t php_iconv_stream_filter_append_bucket(
}
out_buf_size = ocnt = prev_ocnt = initial_out_buf_size;
out_buf = pd = pemalloc(out_buf_size, self->persistent);
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
return FAILURE;
}
pd = out_buf;
if (self->stub_len > 0) {
pt = self->stub;
@@ -2407,14 +2411,26 @@ static size_t php_iconv_stream_filter_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, self->persistent TSRMLS_CC);
if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
goto out_failure;
}
php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
out_buf_size = ocnt = initial_out_buf_size;
out_buf = pd = pemalloc(out_buf_size, self->persistent);
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
return FAILURE;
}
pd = out_buf;
} else {
new_out_buf = perealloc(out_buf, new_out_buf_size, self->persistent);
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
goto out_failure;
}
php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
ocnt += (new_out_buf_size - out_buf_size);
out_buf = new_out_buf;
@@ -2472,14 +2488,26 @@ static size_t php_iconv_stream_filter_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, self->persistent TSRMLS_CC);
if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
goto out_failure;
}
php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
out_buf_size = ocnt = initial_out_buf_size;
out_buf = pd = pemalloc(out_buf_size, self->persistent);
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
return FAILURE;
}
pd = out_buf;
} else {
new_out_buf = perealloc(out_buf, new_out_buf_size, self->persistent);
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
goto out_failure;
}
php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
ocnt += (new_out_buf_size - out_buf_size);
out_buf = new_out_buf;
@@ -2506,17 +2534,19 @@ static size_t php_iconv_stream_filter_append_bucket(
}
if (out_buf_size - ocnt > 0) {
new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, self->persistent TSRMLS_CC);
if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
goto out_failure;
}
php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
} else {
pefree(out_buf, self->persistent);
pefree(out_buf, persistent);
}
*consumed += buf_len - icnt;
return SUCCESS;
out_failure:
pefree(out_buf, self->persistent);
pefree(out_buf, persistent);
return FAILURE;
}
@@ -2531,27 +2561,32 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
size_t consumed = 0;
php_iconv_stream_filter *self = (php_iconv_stream_filter *)filter->abstract;
if (flags != PSFS_FLAG_NORMAL) {
if (php_iconv_stream_filter_append_bucket(self, stream, filter, buckets_out, NULL, 0, &consumed, self->persistent TSRMLS_CC) != SUCCESS) {
while (buckets_in->head != NULL) {
bucket = buckets_in->head;
php_stream_bucket_unlink(bucket TSRMLS_CC);
if (php_iconv_stream_filter_append_bucket(self, stream, filter,
buckets_out, bucket->buf, bucket->buflen, &consumed,
php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
goto out_failure;
}
} else {
while (buckets_in->head != NULL) {
bucket = buckets_in->head;
php_stream_bucket_unlink(bucket TSRMLS_CC);
php_stream_bucket_delref(bucket TSRMLS_CC);
}
if (php_iconv_stream_filter_append_bucket(self, stream, filter, buckets_out, bucket->buf, bucket->buflen, &consumed, self->persistent TSRMLS_CC) != SUCCESS) { goto out_failure;
}
php_stream_bucket_delref(bucket TSRMLS_CC);
if (flags != PSFS_FLAG_NORMAL) {
if (php_iconv_stream_filter_append_bucket(self, stream, filter,
buckets_out, NULL, 0, &consumed,
php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
goto out_failure;
}
}
if (bytes_consumed) {
if (bytes_consumed != NULL) {
*bytes_consumed = consumed;
}
return PSFS_PASS_ON;
out_failure:
+6
View File
@@ -0,0 +1,6 @@
EXPORTS
_libiconv_version
libiconv_close
libiconv
libiconv_open
libiconv_set_relocation_prefix
+27 -25
View File
@@ -112,7 +112,7 @@ function_entry imap_functions[] = {
PHP_FE(imap_qprint, NULL)
PHP_FE(imap_8bit, NULL)
PHP_FE(imap_binary, NULL)
PHP_FE(imap_utf8, NULL)
PHP_FE(imap_utf8, NULL)
PHP_FE(imap_status, NULL)
PHP_FE(imap_mailboxmsginfo, NULL)
PHP_FE(imap_setflag_full, NULL)
@@ -131,24 +131,24 @@ function_entry imap_functions[] = {
PHP_FE(imap_utf7_encode, NULL)
PHP_FE(imap_mime_header_decode, NULL)
PHP_FE(imap_thread, NULL)
PHP_FE(imap_timeout, NULL)
PHP_FE(imap_timeout, NULL)
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
PHP_FE(imap_get_quota, NULL)
PHP_FE(imap_get_quotaroot, NULL)
PHP_FE(imap_set_quota, NULL)
PHP_FE(imap_setacl, NULL)
PHP_FE(imap_getacl, NULL)
PHP_FE(imap_setacl, NULL)
PHP_FE(imap_getacl, NULL)
#endif
PHP_FE(imap_mail, NULL)
PHP_FALIAS(imap_header, imap_headerinfo, NULL)
PHP_FALIAS(imap_listmailbox, imap_list, NULL)
PHP_FALIAS(imap_getmailboxes, imap_list_full, NULL)
PHP_FALIAS(imap_scanmailbox, imap_listscan, NULL)
PHP_FALIAS(imap_listsubscribed, imap_lsub, NULL)
PHP_FALIAS(imap_getsubscribed, imap_lsub_full, NULL)
PHP_FALIAS(imap_header, imap_headerinfo, NULL)
PHP_FALIAS(imap_listmailbox, imap_list, NULL)
PHP_FALIAS(imap_getmailboxes, imap_list_full, NULL)
PHP_FALIAS(imap_scanmailbox, imap_listscan, NULL)
PHP_FALIAS(imap_listsubscribed, imap_lsub, NULL)
PHP_FALIAS(imap_getsubscribed, imap_lsub_full, NULL)
PHP_FALIAS(imap_fetchtext, imap_body, NULL)
PHP_FALIAS(imap_scan, imap_listscan, NULL)
PHP_FALIAS(imap_create, imap_createmailbox, NULL)
@@ -182,6 +182,12 @@ ZEND_GET_MODULE(imap)
/* True globals, no need for thread safety */
static int le_imap;
#define PHP_IMAP_CHECK_MSGNO(msgindex) \
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number"); \
RETURN_FALSE; \
} \
/* {{{ mail_close_it
*/
static void mail_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC)
@@ -1529,11 +1535,8 @@ PHP_FUNCTION(imap_headerinfo)
convert_to_string_ex(defaulthost);
}
if (!Z_LVAL_PP(msgno) || Z_LVAL_PP(msgno) < 1 || (unsigned) Z_LVAL_PP(msgno) > imap_le_struct->imap_stream->nmsgs) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
RETURN_FALSE;
}
PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
if (mail_fetchstructure(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL)) {
cache = mail_elt(imap_le_struct->imap_stream, Z_LVAL_PP(msgno));
} else {
@@ -1779,10 +1782,7 @@ PHP_FUNCTION(imap_fetchstructure)
} else {
msgindex = Z_LVAL_PP(msgno);
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
RETURN_FALSE;
}
PHP_IMAP_CHECK_MSGNO(msgindex);
mail_fetchstructure_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), &body , myargc == 3 ? Z_LVAL_PP(flags) : NIL);
@@ -1816,7 +1816,12 @@ PHP_FUNCTION(imap_fetchbody)
if (myargc == 4) {
convert_to_long_ex(flags);
}
if (myargc < 4 || !(Z_LVAL_PP(flags) & FT_UID)) {
/* only perform the check if the msgno is a message number and not a UID */
PHP_IMAP_CHECK_MSGNO(Z_LVAL_PP(msgno));
}
body = mail_fetchbody_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), Z_STRVAL_PP(sec), &len, myargc==4 ? Z_LVAL_PP(flags) : NIL);
if (!body) {
@@ -2512,10 +2517,7 @@ PHP_FUNCTION(imap_fetchheader)
msgindex = Z_LVAL_PP(msgno);
}
if ((msgindex < 1) || ((unsigned) msgindex > imap_le_struct->imap_stream->nmsgs)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad message number");
RETURN_FALSE;
}
PHP_IMAP_CHECK_MSGNO(msgindex);
RETVAL_STRING(mail_fetchheader_full(imap_le_struct->imap_stream, Z_LVAL_PP(msgno), NIL, NIL, (myargc == 3 ? Z_LVAL_PP(flags) : NIL)), 1);
}
@@ -3708,7 +3710,7 @@ static void _php_imap_parse_address (ADDRESS *addresslist, char **fulladdress, z
addresstmp = addresslist;
if ((len = _php_imap_address_size(addresstmp))) {
tmpstr = (char *) malloc (len);
tmpstr = (char *) malloc(len + 1);
tmpstr[0] = '\0';
rfc822_write_address(tmpstr, addresstmp);
*fulladdress = tmpstr;
+1 -1
View File
@@ -17,7 +17,7 @@ if (PHP_INFORMIX != "no") {
ADD_FLAG("CFLAGS_INFORMIX", "/I " + php_ifx_dir + "\\incl\\esql ");
EXTENSION('informix', 'ifx.c', null, "/D IFX_VERSION=921 /D HAVE_IFX_IUS=1", "php_ifx.dll");
EXTENSION('informix', 'ifx.c', null, "/D IFX_VERSION=921 /D HAVE_IFX_IUS=1 /D HAVE_IFX=1", "php_ifx.dll");
MFO.WriteLine(configure_module_dirname + "\\ifx.c: " + configure_module_dirname + "\\ifx.ec");
MFO.WriteLine("\t<<informix_build.bat");
MFO.WriteLine("PATH " + php_ifx_bin + ";%PATH%");
+16 -15
View File
@@ -23,6 +23,7 @@
#endif
#include "php.h"
#include "php_ini.h"
#if HAVE_IBASE
@@ -553,7 +554,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
case SQL_TIMESTAMP:
convert_to_string(val);
#ifdef HAVE_STRPTIME
strptime(Z_STRVAL_P(val), IBG(timestampformat), &t);
strptime(Z_STRVAL_P(val), INI_STR("ibase.timestampformat"), &t);
#else
n = sscanf(Z_STRVAL_P(val), "%d%*[/]%d%*[/]%d %d%*[:]%d%*[:]%d",
&t.tm_mon, &t.tm_mday, &t.tm_year, &t.tm_hour, &t.tm_min, &t.tm_sec);
@@ -571,7 +572,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
case SQL_TYPE_DATE:
convert_to_string(val);
#ifdef HAVE_STRPTIME
strptime(Z_STRVAL_P(val), IBG(dateformat), &t);
strptime(Z_STRVAL_P(val), INI_STR("ibase.dateformat"), &t);
#else
n = sscanf(Z_STRVAL_P(val), "%d%*[/]%d%*[/]%d", &t.tm_mon, &t.tm_mday, &t.tm_year);
@@ -588,7 +589,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /
case SQL_TYPE_TIME:
convert_to_string(val);
#ifdef HAVE_STRPTIME
strptime(Z_STRVAL_P(val), IBG(timeformat), &t);
strptime(Z_STRVAL_P(val), INI_STR("ibase.timeformat"), &t);
#else
n = sscanf(Z_STRVAL_P(val), "%d%*[:]%d%*[:]%d", &t.tm_hour, &t.tm_min, &t.tm_sec);
@@ -678,16 +679,16 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{
t = *gmtime(&Z_LVAL_P(b_var));
} else {
#ifdef HAVE_STRPTIME
char *format = IBG(timestampformat);
char *format = INI_STR("ibase.timestampformat");
convert_to_string(b_var);
switch (var->sqltype & ~1) {
case SQL_TYPE_DATE:
format = IBG(dateformat);
format = INI_STR("ibase.dateformat");
break;
case SQL_TYPE_TIME:
format = IBG(timeformat);
format = INI_STR("ibase.timeformat");
}
if (! strptime(Z_STRVAL_P(b_var), format, &t)) {
/* strptime() cannot handle it, so let IB have a try */
@@ -1083,9 +1084,9 @@ PHP_FUNCTION(ibase_query)
_php_ibase_module_error("CREATE DATABASE is not allowed in SQL safe mode"
TSRMLS_CC);
} else if ((IBG(max_links) != -1) && (IBG(num_links) >= IBG(max_links))) {
} else if (((l = INI_INT("ibase.max_links")) != -1) && (IBG(num_links) >= l)) {
_php_ibase_module_error("CREATE DATABASE is not allowed: maximum link count "
"(%ld) reached" TSRMLS_CC, IBG(max_links));
"(%ld) reached" TSRMLS_CC, l);
} else if (isc_dsql_execute_immediate(IB_STATUS, &db, &trans, (short)query_len,
query, SQL_DIALECT_CURRENT, NULL)) {
@@ -1143,7 +1144,7 @@ PHP_FUNCTION(ibase_query)
break;
}
} else if (bind_n > 0) {
bind_args = (zval ***) do_alloca(sizeof(zval **) * ZEND_NUM_ARGS());
bind_args = (zval ***) emalloc(sizeof(zval **) * ZEND_NUM_ARGS());
if (FAILURE == zend_get_parameters_array_ex(ZEND_NUM_ARGS(), bind_args)) {
break;
@@ -1169,7 +1170,7 @@ PHP_FUNCTION(ibase_query)
_php_ibase_free_query(&ib_query TSRMLS_CC);
if (bind_args) {
free_alloca(bind_args);
efree(bind_args);
}
}
/* }}} */
@@ -1321,7 +1322,7 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{
if (n >= 0) {
l = sprintf(string_data, "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -scale, n % f);
} else if (n < -f) {
} else if (n <= -f) {
l = sprintf(string_data, "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -scale, -n % f);
} else {
l = sprintf(string_data, "-0.%0*" LL_MASK "d", -scale, -n % f);
@@ -1340,7 +1341,7 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{
if (n >= 0) {
l = sprintf(string_data, "%ld.%0*ld", n / f, -scale, n % f);
} else if (n < -f) {
} else if (n <= -f) {
l = sprintf(string_data, "%ld.%0*ld", n / f, -scale, -n % f);
} else {
l = sprintf(string_data, "-0.%0*ld", -scale, -n % f);
@@ -1355,15 +1356,15 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{
ZVAL_DOUBLE(val, *(double *) data);
break;
case SQL_DATE: /* == case SQL_TIMESTAMP: */
format = IBG(timestampformat);
format = INI_STR("ibase.timestampformat");
isc_decode_timestamp((ISC_TIMESTAMP *) data, &t);
goto format_date_time;
case SQL_TYPE_DATE:
format = IBG(dateformat);
format = INI_STR("ibase.dateformat");
isc_decode_sql_date((ISC_DATE *) data, &t);
goto format_date_time;
case SQL_TYPE_TIME:
format = IBG(timeformat);
format = INI_STR("ibase.timeformat");
isc_decode_sql_time((ISC_TIME *) data, &t);
format_date_time:
+61 -66
View File
@@ -174,7 +174,7 @@ zend_module_entry ibase_module_entry = {
ibase_functions,
PHP_MINIT(ibase),
PHP_MSHUTDOWN(ibase),
PHP_RINIT(ibase),
NULL,
PHP_RSHUTDOWN(ibase),
PHP_MINFO(ibase),
NO_VERSION_YET,
@@ -284,7 +284,7 @@ void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */
/* Transaction resource: make sure it refers to one link only, then
fetch it; database link is stored in ib_trans->db_link[]. */
IBDEBUG("Type is le_trans");
ZEND_FETCH_RESOURCE(*trans, ibase_trans *, link_id, -1, "InterBase transaction", le_trans);
ZEND_FETCH_RESOURCE(*trans, ibase_trans *, link_id, -1, LE_TRANS, le_trans);
if ((*trans)->link_cnt > 1) {
_php_ibase_module_error("Link id is ambiguous: transaction spans multiple connections."
TSRMLS_CC);
@@ -297,7 +297,7 @@ void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */
IBDEBUG("Type is le_[p]link or id not found");
/* Database link resource, use default transaction. */
*trans = NULL;
ZEND_FETCH_RESOURCE2(*ib_link, ibase_db_link *, link_id, -1, "InterBase link", le_link, le_plink);
ZEND_FETCH_RESOURCE2(*ib_link, ibase_db_link *, link_id, -1, LE_LINK, le_link, le_plink);
}
/* }}} */
@@ -436,22 +436,23 @@ static PHP_INI_DISP(php_ibase_password_displayer_cb)
/* {{{ startup, shutdown and info functions */
PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("ibase.allow_persistent", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_persistent, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY_EX("ibase.max_persistent", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_persistent, zend_ibase_globals, ibase_globals, display_link_numbers)
STD_PHP_INI_ENTRY_EX("ibase.max_links", "-1", PHP_INI_SYSTEM, OnUpdateLong, max_links, zend_ibase_globals, ibase_globals, display_link_numbers)
STD_PHP_INI_ENTRY("ibase.default_db", NULL, PHP_INI_SYSTEM, OnUpdateString, default_db, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY("ibase.default_user", NULL, PHP_INI_ALL, OnUpdateString, default_user, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY_EX("ibase.default_password", NULL, PHP_INI_ALL, OnUpdateString, default_password, zend_ibase_globals, ibase_globals,php_ibase_password_displayer_cb)
STD_PHP_INI_ENTRY("ibase.default_charset", NULL, PHP_INI_ALL, OnUpdateString, default_charset, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY("ibase.timestampformat", IB_DEF_DATE_FMT " " IB_DEF_TIME_FMT, PHP_INI_ALL, OnUpdateString, timestampformat, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY("ibase.dateformat", IB_DEF_DATE_FMT, PHP_INI_ALL, OnUpdateString, dateformat, zend_ibase_globals, ibase_globals)
STD_PHP_INI_ENTRY("ibase.timeformat", IB_DEF_TIME_FMT, PHP_INI_ALL, OnUpdateString, timeformat, zend_ibase_globals, ibase_globals)
PHP_INI_ENTRY_EX("ibase.allow_persistent", "1", PHP_INI_SYSTEM, NULL, zend_ini_boolean_displayer_cb)
PHP_INI_ENTRY_EX("ibase.max_persistent", "-1", PHP_INI_SYSTEM, NULL, display_link_numbers)
PHP_INI_ENTRY_EX("ibase.max_links", "-1", PHP_INI_SYSTEM, NULL, display_link_numbers)
PHP_INI_ENTRY("ibase.default_db", NULL, PHP_INI_SYSTEM, NULL)
PHP_INI_ENTRY("ibase.default_user", NULL, PHP_INI_ALL, NULL)
PHP_INI_ENTRY_EX("ibase.default_password", NULL, PHP_INI_ALL, NULL, php_ibase_password_displayer_cb)
PHP_INI_ENTRY("ibase.default_charset", NULL, PHP_INI_ALL, NULL)
PHP_INI_ENTRY("ibase.timestampformat", IB_DEF_DATE_FMT " " IB_DEF_TIME_FMT, PHP_INI_ALL, NULL)
PHP_INI_ENTRY("ibase.dateformat", IB_DEF_DATE_FMT, PHP_INI_ALL, NULL)
PHP_INI_ENTRY("ibase.timeformat", IB_DEF_TIME_FMT, PHP_INI_ALL, NULL)
PHP_INI_END()
static void php_ibase_init_globals(zend_ibase_globals *ibase_globals)
{
ibase_globals->num_persistent = 0;
ibase_globals->sql_code = 0;
ibase_globals->num_persistent = ibase_globals->num_links = 0;
ibase_globals->sql_code = *ibase_globals->errmsg = 0;
ibase_globals->default_link = -1;
}
PHP_MINIT_FUNCTION(ibase)
@@ -460,9 +461,9 @@ PHP_MINIT_FUNCTION(ibase)
REGISTER_INI_ENTRIES();
le_link = zend_register_list_destructors_ex(_php_ibase_close_link, NULL, "interbase link", module_number);
le_plink = zend_register_list_destructors_ex(php_ibase_commit_link_rsrc, _php_ibase_close_plink, "interbase link persistent", module_number);
le_trans = zend_register_list_destructors_ex(_php_ibase_free_trans, NULL, "interbase transaction", module_number);
le_link = zend_register_list_destructors_ex(_php_ibase_close_link, NULL, LE_LINK, module_number);
le_plink = zend_register_list_destructors_ex(php_ibase_commit_link_rsrc, _php_ibase_close_plink, LE_PLINK, module_number);
le_trans = zend_register_list_destructors_ex(_php_ibase_free_trans, NULL, LE_TRANS, module_number);
REGISTER_LONG_CONSTANT("IBASE_DEFAULT", PHP_IBASE_DEFAULT, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IBASE_CREATE", PHP_IBASE_CREATE, CONST_PERSISTENT);
@@ -490,16 +491,6 @@ PHP_MINIT_FUNCTION(ibase)
return SUCCESS;
}
PHP_RINIT_FUNCTION(ibase)
{
IBG(default_link)= -1;
IBG(num_links) = IBG(num_persistent);
RESET_ERRMSG;
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(ibase)
{
#ifndef PHP_WIN32
@@ -527,6 +518,11 @@ PHP_MSHUTDOWN_FUNCTION(ibase)
PHP_RSHUTDOWN_FUNCTION(ibase)
{
IBG(num_links) = IBG(num_persistent);
IBG(default_link)= -1;
RESET_ERRMSG;
return SUCCESS;
}
@@ -616,7 +612,7 @@ int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db T
static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* {{{ */
{
char hash[16], *args[] = { NULL, NULL, NULL, NULL, NULL };
char *c, hash[16], *args[] = { NULL, NULL, NULL, NULL, NULL };
int i, len[] = { 0, 0, 0, 0, 0 };
long largs[] = { 0, 0, 0 };
PHP_MD5_CTX hash_context;
@@ -634,21 +630,21 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
}
/* restrict to the server/db in the .ini if in safe mode */
if ((!len[DB] || PG(sql_safe_mode)) && IBG(default_db)) {
args[DB] = IBG(default_db);
len[DB] = strlen(IBG(default_db));
if ((!len[DB] || PG(sql_safe_mode)) && (c = INI_STR("ibase.default_db"))) {
args[DB] = c;
len[DB] = strlen(c);
}
if (!len[USER] && IBG(default_user)) {
args[USER] = IBG(default_user);
len[USER] = strlen(args[USER]);
if (!len[USER] && (c = INI_STR("ibase.default_user"))) {
args[USER] = c;
len[USER] = strlen(c);
}
if (!len[PASS] && IBG(default_password)) {
args[PASS] = IBG(default_password);
len[PASS] = strlen(args[PASS]);
if (!len[PASS] && (c = INI_STR("ibase.default_password"))) {
args[PASS] = c;
len[PASS] = strlen(c);
}
if (!len[CSET] && IBG(default_charset)) {
args[CSET] = IBG(default_charset);
len[CSET] = strlen(args[CSET]);
if (!len[CSET] && (c = INI_STR("ibase.default_charset"))) {
args[CSET] = c;
len[CSET] = strlen(c);
}
/* don't want usernames and passwords floating around */
@@ -681,6 +677,8 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
/* ... or a persistent one */
switch (zend_hash_find(&EG(persistent_list), hash, sizeof(hash), (void *) &le)) {
long l;
static char info[] = { isc_info_base_level, isc_info_end };
char result[8];
ISC_STATUS status[20];
@@ -702,7 +700,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
/* no link found, so we have to open one */
if (IBG(max_links) != -1 && IBG(num_links) >= IBG(max_links)) {
if ((l = INI_INT("ibase.max_links")) != -1 && IBG(num_links) >= l) {
_php_ibase_module_error("Too many open links (%ld)" TSRMLS_CC, IBG(num_links));
RETURN_FALSE;
}
@@ -713,7 +711,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
}
/* use non-persistent if allowed number of persistent links is exceeded */
if (!persistent || (IBG(max_persistent) != -1 && IBG(num_persistent) >= IBG(max_persistent))) {
if (!persistent || ((l = INI_INT("ibase.max_persistent") != -1) && IBG(num_persistent) >= l)) {
ib_link = (ibase_db_link *) emalloc(sizeof(ibase_db_link));
ZEND_REGISTER_RESOURCE(return_value, ib_link, le_link);
} else {
@@ -763,7 +761,7 @@ PHP_FUNCTION(ibase_connect)
Open a persistent connection to an InterBase database */
PHP_FUNCTION(ibase_pconnect)
{
_php_ibase_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, IBG(allow_persistent));
_php_ibase_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INI_INT("ibase.allow_persistent"));
}
/* }}} */
@@ -794,8 +792,7 @@ PHP_FUNCTION(ibase_close)
break;
}
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, "InterBase link",
le_link, le_plink);
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, LE_LINK, le_link, le_plink);
zend_list_delete(link_id);
RETURN_TRUE;
}
@@ -829,8 +826,8 @@ PHP_FUNCTION(ibase_drop_db)
break;
}
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, "InterBase link",
le_link, le_plink);
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, LE_LINK, le_link, le_plink);
if (isc_drop_database(IB_STATUS, &ib_link->handle)) {
_php_ibase_error(TSRMLS_C);
RETURN_FALSE;
@@ -865,22 +862,22 @@ PHP_FUNCTION(ibase_trans)
argn = ZEND_NUM_ARGS();
/* (1+argn) is an upper bound for the number of links this trans connects to */
ib_link = (ibase_db_link **) do_alloca(sizeof(ibase_db_link *) * (1+argn));
ib_link = (ibase_db_link **) safe_emalloc(sizeof(ibase_db_link *),1+argn,0);
if (argn > 0) {
long trans_argl = 0;
char *tpb;
ISC_TEB *teb;
zval ***args = (zval ***) do_alloca(sizeof(zval **) * argn);
zval ***args = (zval ***) safe_emalloc(sizeof(zval **),argn,0);
if (zend_get_parameters_array_ex(argn, args) == FAILURE) {
free_alloca(args);
free_alloca(ib_link);
efree(args);
efree(ib_link);
RETURN_FALSE;
}
teb = (ISC_TEB *) do_alloca(sizeof(ISC_TEB) * argn);
tpb = (char *) do_alloca(TPB_MAX_SIZE * argn);
teb = (ISC_TEB *) safe_emalloc(sizeof(ISC_TEB),argn,0);
tpb = (char *) safe_emalloc(TPB_MAX_SIZE,argn,0);
/* enumerate all the arguments: assume every non-resource argument
specifies modifiers for the link ids that follow it */
@@ -889,7 +886,7 @@ PHP_FUNCTION(ibase_trans)
if (Z_TYPE_PP(args[i]) == IS_RESOURCE) {
ZEND_FETCH_RESOURCE2(ib_link[link_cnt], ibase_db_link *, args[i], -1,
"InterBase link", le_link, le_plink);
LE_LINK, le_link, le_plink);
/* copy the most recent modifier string into tbp[] */
memcpy(&tpb[TPB_MAX_SIZE * link_cnt], last_tpb, TPB_MAX_SIZE);
@@ -946,14 +943,14 @@ PHP_FUNCTION(ibase_trans)
result = isc_start_multiple(IB_STATUS, &tr_handle, link_cnt, teb);
}
free_alloca(args);
free_alloca(tpb);
free_alloca(teb);
efree(args);
efree(tpb);
efree(teb);
}
if (link_cnt == 0) {
link_cnt = 1;
ZEND_FETCH_RESOURCE2(ib_link[0], ibase_db_link *, NULL, IBG(default_link), "InterBase link",
ZEND_FETCH_RESOURCE2(ib_link[0], ibase_db_link *, NULL, IBG(default_link), LE_LINK,
le_link, le_plink);
result = isc_start_transaction(IB_STATUS, &tr_handle, 1, &ib_link[0]->handle, tpb_len, last_tpb);
}
@@ -961,7 +958,7 @@ PHP_FUNCTION(ibase_trans)
/* start the transaction */
if (result) {
_php_ibase_error(TSRMLS_C);
free_alloca(ib_link);
efree(ib_link);
RETURN_FALSE;
}
@@ -987,7 +984,7 @@ PHP_FUNCTION(ibase_trans)
(*l)->trans = ib_trans;
(*l)->next = NULL;
}
free_alloca(ib_link);
efree(ib_link);
ZEND_REGISTER_RESOURCE(return_value, ib_trans, le_trans);
}
/* }}} */
@@ -1044,7 +1041,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
int type;
case 0:
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), "InterBase link",
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK,
le_link, le_plink);
if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) {
/* this link doesn't have a default transaction */
@@ -1060,14 +1057,12 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{
}
/* one id was passed, could be db or trans id */
if (zend_list_find(Z_LVAL_PP(arg), &type) && type == le_trans) {
ZEND_FETCH_RESOURCE(trans, ibase_trans *, arg, -1, "InterBase transaction",
le_trans);
ZEND_FETCH_RESOURCE(trans, ibase_trans *, arg, -1, LE_TRANS, le_trans);
convert_to_long_ex(arg);
res_id = Z_LVAL_PP(arg);
} else {
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, arg, -1, "InterBase link",
le_link, le_plink);
ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, arg, -1, LE_LINK, le_link, le_plink);
if (ib_link->tr_list == NULL || ib_link->tr_list->trans == NULL) {
/* this link doesn't have a default transaction */
+22 -5
View File
@@ -23,8 +23,8 @@ CFG=interbase - Win32 Debug_TS
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
# PROP Scc_ProjName "interbase"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib php5ts_debug.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_interbase.dll" /pdbtype:sept /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Debug_TS"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php5ts_debug.lib gds32_ms.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_interbase.dll" /pdbtype:sept /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Debug_TS"
!ELSEIF "$(CFG)" == "interbase - Win32 Release_TS"
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib /nologo /dll /machine:I386
# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_interbase.dll" /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
# ADD LINK32 php5ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib gds32_ms.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_interbase.dll" /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
!ENDIF
@@ -94,6 +94,22 @@ LINK32=link.exe
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\ibase_blobs.c
# End Source File
# Begin Source File
SOURCE=.\ibase_events.c
# End Source File
# Begin Source File
SOURCE=.\ibase_query.c
# End Source File
# Begin Source File
SOURCE=.\ibase_service.c
# End Source File
# Begin Source File
SOURCE=.\interbase.c
# End Source File
# End Group
@@ -111,7 +127,8 @@ SOURCE=.\php_interbase.h
# Begin Source File
SOURCE=.\interbase.rc
# ADD RSC /i "..\..\main" /i "..\..\win32" /d "PHP_H"
# ADD BASE RSC /l 0x413
# ADD RSC /l 0x413 /i "..\..\main" /i "..\..\win32" /d "PHP_H"
# End Source File
# End Group
# End Target
-1
View File
@@ -66,7 +66,6 @@ BEGIN
BEGIN
VALUE "FileDescription", "PHP Interbase module\0"
VALUE "FileVersion", PHP_VERSION "\0"
VALUE "File Revision", FILE_REVISION "\0"
VALUE "LegalCopyright", "Copyright © 2003 The PHP Group\0"
VALUE "Build Type", BUILD_TYPE "\0"
VALUE "Client Library", CLIENT_LIB "\0"
-4
View File
@@ -64,10 +64,6 @@ ZEND_BEGIN_MODULE_GLOBALS(ibase)
ISC_STATUS status[20];
long default_link;
long num_links, num_persistent;
long max_links, max_persistent;
long allow_persistent;
char *default_db, *default_user, *default_password, *default_charset;
char *timestampformat, *dateformat, *timeformat;
char errmsg[MAX_ERRMSG];
long sql_code;
ZEND_END_MODULE_GLOBALS(ibase)
+1 -4
View File
@@ -616,10 +616,7 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
}
num_attribs = zend_hash_num_elements(Z_ARRVAL_PP(attrs));
if ((ldap_attrs = safe_emalloc((num_attribs+1), sizeof(char *), 0)) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not allocate memory");
RETURN_FALSE;
}
ldap_attrs = safe_emalloc((num_attribs+1), sizeof(char *), 0);
for (i = 0; i<num_attribs; i++) {
if (zend_hash_index_find(Z_ARRVAL_PP(attrs), i, (void **) &attr) == FAILURE) {
+1
View File
@@ -15,6 +15,7 @@ if (PHP_LIBXML == "yes") {
if (!PHP_LIBXML_SHARED) {
ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
}
ADD_EXTENSION_DEP('libxml', 'iconv');
}
}
+2 -2
View File
@@ -377,7 +377,7 @@ void php_libxml_ctx_warning(void *ctx, const char *msg, ...)
va_end(args);
}
void php_libxml_error_handler(void *ctx, const char *msg, ...)
PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...)
{
va_list args;
va_start(args, msg);
@@ -568,7 +568,7 @@ int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC) {
obj_node = (php_libxml_node_ptr *) object->node;
ret_refcount = --obj_node->refcount;
if (ret_refcount == 0) {
if (obj_node->node != NULL && obj_node->node->type != XML_DOCUMENT_NODE) {
if (obj_node->node != NULL) {
obj_node->node->_private = NULL;
}
efree(obj_node);
+1 -1
View File
@@ -77,7 +77,7 @@ PHP_LIBXML_API int php_libxml_register_export(zend_class_entry *ce, php_libxml_e
void php_libxml_node_free_resource(xmlNodePtr node TSRMLS_DC);
/* When object dtor is called as node may still be referenced */
void php_libxml_node_decrement_resource(php_libxml_node_object *object TSRMLS_DC);
void php_libxml_error_handler(void *ctx, const char *msg, ...);
PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...);
void php_libxml_ctx_warning(void *ctx, const char *msg, ...);
void php_libxml_ctx_error(void *ctx, const char *msg, ...);
+339 -6
View File
@@ -13,13 +13,22 @@ __xmlGenericError
__xmlGenericErrorContext
__xmlGetWarningsDefaultValue
__xmlIndentTreeOutput
xmlIsBaseCharGroup DATA
xmlIsCharGroup DATA
xmlIsCombiningGroup DATA
xmlIsDigitGroup DATA
xmlIsExtenderGroup DATA
xmlIsIdeographicGroup DATA
xmlIsPubidChar_tab DATA
__xmlKeepBlanksDefaultValue
xmlLastError DATA
__xmlLineNumbersDefaultValue
__xmlLoadExtDtdDefaultValue
xmlMalloc DATA
xmlMallocAtomic DATA
xmlMemStrdup DATA
__xmlParserDebugEntities
xmlParserMaxDepth DATA
__xmlParserVersion
__xmlPedanticParserDefaultValue
xmlRealloc DATA
@@ -28,6 +37,7 @@ __xmlSaveNoEmptyTags
xmlStringComment DATA
xmlStringText DATA
xmlStringTextNoenc DATA
xmlStructuredError DATA
__xmlSubstituteEntitiesDefaultValue
__xmlTreeIndentString
xmlXPathNAN DATA
@@ -72,6 +82,13 @@ htmlAutoCloseTag
htmlCreateFileParserCtxt
htmlCreateMemoryParserCtxt
htmlCreatePushParserCtxt
htmlCtxtReadDoc
htmlCtxtReadFd
htmlCtxtReadFile
htmlCtxtReadIO
htmlCtxtReadMemory
htmlCtxtReset
htmlCtxtUseOptions
htmlDefaultSAXHandlerInit
htmlDocContentDumpFormatOutput
htmlDocContentDumpOutput
@@ -104,6 +121,11 @@ htmlParseDocument
htmlParseElement
htmlParseEntityRef
htmlParseFile
htmlReadDoc
htmlReadFd
htmlReadFile
htmlReadIO
htmlReadMemory
htmlSAXParseDoc
htmlSAXParseFile
htmlSaveFile
@@ -159,6 +181,7 @@ xmlAddRef
xmlAddSibling
xmlAllocOutputBuffer
xmlAllocParserInputBuffer
xmlAttrSerializeTxtContent
xmlAutomataCompile
xmlAutomataGetInitState
xmlAutomataIsDeterminist
@@ -181,6 +204,7 @@ xmlBufferCat
xmlBufferContent
xmlBufferCreate
xmlBufferCreateSize
xmlBufferCreateStatic
xmlBufferDump
xmlBufferEmpty
xmlBufferFree
@@ -194,6 +218,7 @@ xmlBufferWriteChar
xmlBufferWriteQuotedString
xmlBuildQName
xmlBuildURI
xmlByteConsumed
xmlC14NDocDumpMemory
xmlC14NDocSave
xmlC14NDocSaveTo
@@ -223,9 +248,11 @@ xmlCharEncCloseFunc
xmlCharEncFirstLine
xmlCharEncInFunc
xmlCharEncOutFunc
xmlCharInRange
xmlCharStrdup
xmlCharStrndup
xmlCheckFilename
xmlCheckHTTPInput
xmlCheckLanguageID
xmlCheckUTF8
xmlCheckVersion
@@ -233,6 +260,7 @@ xmlCleanupCharEncodingHandlers
xmlCleanupEncodingAliases
xmlCleanupGlobals
xmlCleanupInputCallbacks
xmlCleanupMemory
xmlCleanupOutputCallbacks
xmlCleanupParser
xmlCleanupPredefinedEntities
@@ -249,6 +277,7 @@ xmlCopyElementContent
xmlCopyElementTable
xmlCopyEntitiesTable
xmlCopyEnumeration
xmlCopyError
xmlCopyNamespace
xmlCopyNamespaceList
xmlCopyNode
@@ -266,7 +295,26 @@ xmlCreateIntSubset
xmlCreateMemoryParserCtxt
xmlCreatePushParserCtxt
xmlCreateURI
xmlCreateURLParserCtxt
xmlCtxtGetLastError
xmlCtxtReadDoc
xmlCtxtReadFd
xmlCtxtReadFile
xmlCtxtReadIO
xmlCtxtReadMemory
xmlCtxtReset
xmlCtxtResetLastError
xmlCtxtResetPush
xmlCtxtUseOptions
xmlCurrentChar
xmlDictCreate
xmlDictCreateSub
xmlDictFree
xmlDictLookup
xmlDictOwns
xmlDictQLookup
xmlDictReference
xmlDictSize
xmlDebugDumpAttr
xmlDebugDumpAttrList
xmlDebugDumpDTD
@@ -282,6 +330,14 @@ xmlDefaultSAXHandlerInit
xmlDelEncodingAlias
xmlDeregisterNodeDefault
xmlDetectCharEncoding
xmlDictCreate
xmlDictCreateSub
xmlDictFree
xmlDictLookup
xmlDictOwns
xmlDictQLookup
xmlDictReference
xmlDictSize
xmlDocCopyNode
xmlDocDump
xmlDocDumpFormatMemory
@@ -303,6 +359,7 @@ xmlElemDump
xmlEncodeEntities
xmlEncodeEntitiesReentrant
xmlEncodeSpecialChars
xmlErrMemory
xmlFileClose
xmlFileMatch
xmlFileOpen
@@ -327,11 +384,14 @@ xmlFreeNs
xmlFreeNsList
xmlFreeParserCtxt
xmlFreeParserInputBuffer
xmlFreePattern
xmlFreePatternList
xmlFreeProp
xmlFreePropList
xmlFreeRMutex
xmlFreeRefTable
xmlFreeTextReader
xmlFreeTextWriter
xmlFreeURI
xmlFreeValidCtxt
xmlGcMemGet
@@ -356,6 +416,7 @@ xmlGetGlobalState
xmlGetID
xmlGetIntSubset
xmlGetLastChild
xmlGetLastError
xmlGetLineNo
xmlGetNoNsProp
xmlGetNodePath
@@ -379,6 +440,9 @@ xmlHashFree
xmlHashLookup
xmlHashLookup2
xmlHashLookup3
xmlHashQLookup
xmlHashQLookup2
xmlHashQLookup3
xmlHashRemoveEntry
xmlHashRemoveEntry2
xmlHashRemoveEntry3
@@ -425,6 +489,12 @@ xmlIsMixedElement
xmlIsPubidChar
xmlIsRef
xmlIsXHTML
xmlIsBaseCharGroup DATA
xmlIsCharGroup DATA
xmlIsCombiningGroup DATA
xmlIsDigitGroup DATA
xmlIsExtenderGroup DATA
xmlIsIdeographicGroup DATA
xmlKeepBlanksDefault
xmlLineNumbersDefault
xmlLinkGetData
@@ -461,6 +531,8 @@ xmlLoadSGMLSuperCatalog
xmlLockLibrary
xmlLsCountNode
xmlLsOneNode
xmlMallocAtomicLoc
xmlMallocLoc
xmlMemDisplay
xmlMemFree
xmlMemGet
@@ -468,6 +540,7 @@ xmlMemMalloc
xmlMemRealloc
xmlMemSetup
xmlMemShow
xmlMemStrdupLoc
xmlMemUsed
xmlMemoryDump
xmlMemoryStrdup
@@ -501,13 +574,16 @@ xmlNanoFTPUpdateURL
xmlNanoHTTPAuthHeader
xmlNanoHTTPCleanup
xmlNanoHTTPClose
xmlNanoHTTPEncoding
xmlNanoHTTPFetch
xmlNanoHTTPInit
xmlNanoHTTPMethod
xmlNanoHTTPMethodRedir
xmlNanoHTTPMimeType
xmlNanoHTTPOpen
xmlNanoHTTPOpenRedir
xmlNanoHTTPRead
xmlNanoHTTPRedir
xmlNanoHTTPReturnCode
xmlNanoHTTPSave
xmlNanoHTTPScanProxy
@@ -551,11 +627,18 @@ xmlNewTextChild
xmlNewTextLen
xmlNewTextReader
xmlNewTextReaderFilename
xmlNewTextWriter
xmlNewTextWriterDoc
xmlNewTextWriterFilename
xmlNewTextWriterMemory
xmlNewTextWriterPushParser
xmlNewTextWriterTree
xmlNewValidCtxt
xmlNextChar
xmlNoNetExternalEntityLoader
xmlNodeAddContent
xmlNodeAddContentLen
xmlNodeBufGetContent
xmlNodeDump
xmlNodeDumpOutput
xmlNodeGetBase
@@ -655,6 +738,7 @@ xmlParserInputBufferCreateFile
xmlParserInputBufferCreateFilename
xmlParserInputBufferCreateIO
xmlParserInputBufferCreateMem
xmlParserInputBufferCreateStatic
xmlParserInputBufferGrow
xmlParserInputBufferPush
xmlParserInputBufferRead
@@ -666,12 +750,32 @@ xmlParserPrintFileInfo
xmlParserValidityError
xmlParserValidityWarning
xmlParserWarning
xmlPatternMatch
xmlPatterncompile
xmlPedanticParserDefault
xmlPopInput
xmlPrintURI
xmlPushInput
xmlRMutexLock
xmlRMutexUnlock
xmlReadDoc
xmlReadFd
xmlReadFile
xmlReadIO
xmlReadMemory
xmlReaderForDoc
xmlReaderForFd
xmlReaderForFile
xmlReaderForIO
xmlReaderForMemory
xmlReaderNewDoc
xmlReaderNewFd
xmlReaderNewFile
xmlReaderNewIO
xmlReaderNewMemory
xmlReaderNewWalker
xmlReaderWalker
xmlReallocLoc
xmlReconciliateNs
xmlRecoverDoc
xmlRecoverFile
@@ -712,10 +816,47 @@ xmlRelaxNGValidateFullElement
xmlRelaxNGValidatePopElement
xmlRelaxNGValidatePushCData
xmlRelaxNGValidatePushElement
xmlRelaxParserSetFlag
xmlRemoveID
xmlRemoveProp
xmlRemoveRef
xmlReplaceNode
xmlResetError
xmlResetLastError
xmlSAX2AttributeDecl
xmlSAX2CDataBlock
xmlSAX2Characters
xmlSAX2Comment
xmlSAX2ElementDecl
xmlSAX2EndDocument
xmlSAX2EndElement
xmlSAX2EndElementNs
xmlSAX2EntityDecl
xmlSAX2ExternalSubset
xmlSAX2GetColumnNumber
xmlSAX2GetEntity
xmlSAX2GetLineNumber
xmlSAX2GetParameterEntity
xmlSAX2GetPublicId
xmlSAX2GetSystemId
xmlSAX2HasExternalSubset
xmlSAX2HasInternalSubset
xmlSAX2IgnorableWhitespace
xmlSAX2InitDefaultSAXHandler
xmlSAX2InitDocbDefaultSAXHandler
xmlSAX2InitHtmlDefaultSAXHandler
xmlSAX2InternalSubset
xmlSAX2IsStandalone
xmlSAX2NotationDecl
xmlSAX2ProcessingInstruction
xmlSAX2Reference
xmlSAX2ResolveEntity
xmlSAX2SetDocumentLocator
xmlSAX2StartDocument
xmlSAX2StartElement
xmlSAX2StartElementNs
xmlSAX2UnparsedEntityDecl
xmlSAXDefaultVersion
xmlSAXParseDTD
xmlSAXParseDoc
xmlSAXParseEntity
@@ -725,6 +866,7 @@ xmlSAXParseMemory
xmlSAXParseMemoryWithData
xmlSAXUserParseFile
xmlSAXUserParseMemory
xmlSAXVersion
xmlSaveFile
xmlSaveFileEnc
xmlSaveFileTo
@@ -745,6 +887,7 @@ xmlSchemaFreeValidCtxt
xmlSchemaFreeValue
xmlSchemaGetPredefinedType
xmlSchemaInitTypes
xmlSchemaNewDocParserCtxt
xmlSchemaNewFacet
xmlSchemaNewMemParserCtxt
xmlSchemaNewParserCtxt
@@ -770,6 +913,7 @@ xmlSetListDoc
xmlSetNs
xmlSetNsProp
xmlSetProp
xmlSetStructuredErrorFunc
xmlSetTreeDoc
xmlSetupParserForBuffer
xmlShell
@@ -794,6 +938,9 @@ xmlSplitQName3
xmlSprintfElementContent
xmlStopParser
xmlStrEqual
xmlStrPrintf
xmlStrQEqual
xmlStrVPrintf
xmlStrcasecmp
xmlStrcasestr
xmlStrcat
@@ -803,22 +950,33 @@ xmlStrdup
xmlStringCurrentChar
xmlStringDecodeEntities
xmlStringGetNodeList
xmlStringLenDecodeEntities
xmlStringLenGetNodeList
xmlStrlen
xmlStrncasecmp
xmlStrncat
xmlStrncatNew
xmlStrncmp
xmlStrndup
xmlStrstr
xmlStrsub
xmlSubstituteEntitiesDefault
xmlSwitchEncoding
xmlSwitchInputEncoding
xmlSwitchToEncoding
xmlTextConcat
xmlTextMerge
xmlTextReaderAttributeCount
xmlTextReaderBaseUri
xmlTextReaderClose
xmlTextReaderConstBaseUri
xmlTextReaderConstLocalName
xmlTextReaderConstName
xmlTextReaderConstNamespaceUri
xmlTextReaderConstPrefix
xmlTextReaderConstString
xmlTextReaderConstValue
xmlTextReaderConstXmlLang
xmlTextReaderCurrentDoc
xmlTextReaderCurrentNode
xmlTextReaderDepth
@@ -847,9 +1005,12 @@ xmlTextReaderMoveToNextAttribute
xmlTextReaderName
xmlTextReaderNamespaceUri
xmlTextReaderNext
xmlTextReaderNextSibling
xmlTextReaderNodeType
xmlTextReaderNormalization
xmlTextReaderPrefix
xmlTextReaderPreserve
xmlTextReaderPreservePattern
xmlTextReaderQuoteChar
xmlTextReaderRead
xmlTextReaderReadAttributeValue
@@ -861,8 +1022,77 @@ xmlTextReaderRelaxNGSetSchema
xmlTextReaderRelaxNGValidate
xmlTextReaderSetErrorHandler
xmlTextReaderSetParserProp
xmlTextReaderSetStructuredErrorHandler
xmlTextReaderValue
xmlTextReaderXmlLang
xmlTextWriterEndAttribute
xmlTextWriterEndCDATA
xmlTextWriterEndComment
xmlTextWriterEndDTD
xmlTextWriterEndDocument
xmlTextWriterEndElement
xmlTextWriterEndPI
xmlTextWriterFlush
xmlTextWriterFullEndElement
xmlTextWriterSetIndent
xmlTextWriterSetIndentString
xmlTextWriterStartAttribute
xmlTextWriterStartAttributeNS
xmlTextWriterStartCDATA
xmlTextWriterStartComment
xmlTextWriterStartDTD
xmlTextWriterStartDTDAttlist
xmlTextWriterStartDTDElement
xmlTextWriterStartDTDEntity
xmlTextWriterStartDocument
xmlTextWriterStartElement
xmlTextWriterStartElementNS
xmlTextWriterStartPI
xmlTextWriterWriteAttribute
xmlTextWriterWriteAttributeNS
xmlTextWriterWriteBase64
xmlTextWriterWriteBinHex
xmlTextWriterWriteCDATA
xmlTextWriterWriteComment
xmlTextWriterWriteDTD
xmlTextWriterWriteDTDAttlist
xmlTextWriterWriteDTDElement
xmlTextWriterWriteDTDEntity
xmlTextWriterWriteDTDExternalEntity
xmlTextWriterWriteDTDInternalEntity
xmlTextWriterWriteDTDNotation
xmlTextWriterWriteElement
xmlTextWriterWriteElementNS
xmlTextWriterWriteFormatAttribute
xmlTextWriterWriteFormatAttributeNS
xmlTextWriterWriteFormatCDATA
xmlTextWriterWriteFormatComment
xmlTextWriterWriteFormatDTD
xmlTextWriterWriteFormatDTDAttlist
xmlTextWriterWriteFormatDTDElement
xmlTextWriterWriteFormatDTDInternalEntity
xmlTextWriterWriteFormatElement
xmlTextWriterWriteFormatElementNS
xmlTextWriterWriteFormatPI
xmlTextWriterWriteFormatRaw
xmlTextWriterWriteFormatString
xmlTextWriterWritePI
xmlTextWriterWriteRaw
xmlTextWriterWriteRawLen
xmlTextWriterWriteString
xmlTextWriterWriteVFormatAttribute
xmlTextWriterWriteVFormatAttributeNS
xmlTextWriterWriteVFormatCDATA
xmlTextWriterWriteVFormatComment
xmlTextWriterWriteVFormatDTD
xmlTextWriterWriteVFormatDTDAttlist
xmlTextWriterWriteVFormatDTDElement
xmlTextWriterWriteVFormatDTDInternalEntity
xmlTextWriterWriteVFormatElement
xmlTextWriterWriteVFormatElementNS
xmlTextWriterWriteVFormatPI
xmlTextWriterWriteVFormatRaw
xmlTextWriterWriteVFormatString
xmlThrDefBufferAllocScheme
xmlThrDefDefaultBufferSize
xmlThrDefDeregisterNodeDefault
@@ -877,8 +1107,10 @@ xmlThrDefPedanticParserDefaultValue
xmlThrDefRegisterNodeDefault
xmlThrDefSaveNoEmptyTags
xmlThrDefSetGenericErrorFunc
xmlThrDefSetStructuredErrorFunc
xmlThrDefSubstituteEntitiesDefaultValue
xmlThrDefTreeIndentString
xmlUCSIsAegeanNumbers
xmlUCSIsAlphabeticPresentationForms
xmlUCSIsArabic
xmlUCSIsArabicPresentationFormsA
@@ -893,6 +1125,7 @@ xmlUCSIsBopomofo
xmlUCSIsBopomofoExtended
xmlUCSIsBoxDrawing
xmlUCSIsBraillePatterns
xmlUCSIsBuhid
xmlUCSIsByzantineMusicalSymbols
xmlUCSIsCJKCompatibility
xmlUCSIsCJKCompatibilityForms
@@ -942,11 +1175,14 @@ xmlUCSIsCatZp
xmlUCSIsCatZs
xmlUCSIsCherokee
xmlUCSIsCombiningDiacriticalMarks
xmlUCSIsCombiningDiacriticalMarksforSymbols
xmlUCSIsCombiningHalfMarks
xmlUCSIsCombiningMarksforSymbols
xmlUCSIsControlPictures
xmlUCSIsCurrencySymbols
xmlUCSIsCypriotSyllabary
xmlUCSIsCyrillic
xmlUCSIsCyrillicSupplement
xmlUCSIsDeseret
xmlUCSIsDevanagari
xmlUCSIsDingbats
@@ -959,12 +1195,14 @@ xmlUCSIsGeorgian
xmlUCSIsGothic
xmlUCSIsGreek
xmlUCSIsGreekExtended
xmlUCSIsGreekandCoptic
xmlUCSIsGujarati
xmlUCSIsGurmukhi
xmlUCSIsHalfwidthandFullwidthForms
xmlUCSIsHangulCompatibilityJamo
xmlUCSIsHangulJamo
xmlUCSIsHangulSyllables
xmlUCSIsHanunoo
xmlUCSIsHebrew
xmlUCSIsHighPrivateUseSurrogates
xmlUCSIsHighSurrogates
@@ -975,18 +1213,26 @@ xmlUCSIsKanbun
xmlUCSIsKangxiRadicals
xmlUCSIsKannada
xmlUCSIsKatakana
xmlUCSIsKatakanaPhoneticExtensions
xmlUCSIsKhmer
xmlUCSIsKhmerSymbols
xmlUCSIsLao
xmlUCSIsLatin1Supplement
xmlUCSIsLatinExtendedA
xmlUCSIsLatinExtendedAdditional
xmlUCSIsLatinExtendedB
xmlUCSIsLetterlikeSymbols
xmlUCSIsLimbu
xmlUCSIsLinearBIdeograms
xmlUCSIsLinearBSyllabary
xmlUCSIsLowSurrogates
xmlUCSIsMalayalam
xmlUCSIsMathematicalAlphanumericSymbols
xmlUCSIsMathematicalOperators
xmlUCSIsMiscellaneousMathematicalSymbolsA
xmlUCSIsMiscellaneousMathematicalSymbolsB
xmlUCSIsMiscellaneousSymbols
xmlUCSIsMiscellaneousSymbolsandArrows
xmlUCSIsMiscellaneousTechnical
xmlUCSIsMongolian
xmlUCSIsMusicalSymbols
@@ -996,23 +1242,40 @@ xmlUCSIsOgham
xmlUCSIsOldItalic
xmlUCSIsOpticalCharacterRecognition
xmlUCSIsOriya
xmlUCSIsOsmanya
xmlUCSIsPhoneticExtensions
xmlUCSIsPrivateUse
xmlUCSIsPrivateUseArea
xmlUCSIsRunic
xmlUCSIsShavian
xmlUCSIsSinhala
xmlUCSIsSmallFormVariants
xmlUCSIsSpacingModifierLetters
xmlUCSIsSpecials
xmlUCSIsSuperscriptsandSubscripts
xmlUCSIsSupplementalArrowsA
xmlUCSIsSupplementalArrowsB
xmlUCSIsSupplementalMathematicalOperators
xmlUCSIsSupplementaryPrivateUseAreaA
xmlUCSIsSupplementaryPrivateUseAreaB
xmlUCSIsSyriac
xmlUCSIsTagalog
xmlUCSIsTagbanwa
xmlUCSIsTags
xmlUCSIsTaiLe
xmlUCSIsTaiXuanJingSymbols
xmlUCSIsTamil
xmlUCSIsTelugu
xmlUCSIsThaana
xmlUCSIsThai
xmlUCSIsTibetan
xmlUCSIsUgaritic
xmlUCSIsUnifiedCanadianAboriginalSyllabics
xmlUCSIsVariationSelectors
xmlUCSIsVariationSelectorsSupplement
xmlUCSIsYiRadicals
xmlUCSIsYiSyllables
xmlUCSIsYijingHexagramSymbols
xmlURIEscape
xmlURIEscapeStr
xmlURIUnescapeString
@@ -1058,8 +1321,14 @@ xmlValidatePushCData
xmlValidatePushElement
xmlValidateQName
xmlValidateRoot
xmlXIncludeFreeContext
xmlXIncludeNewContext
xmlXIncludeProcess
xmlXIncludeProcessFlags
xmlXIncludeProcessNode
xmlXIncludeProcessTree
xmlXIncludeProcessTreeFlags
xmlXIncludeSetFlags
xmlXPathAddValues
xmlXPathBooleanFunction
xmlXPathCastBooleanToNumber
@@ -1078,6 +1347,7 @@ xmlXPathCastToNumber
xmlXPathCastToString
xmlXPathCeilingFunction
xmlXPathCmpNodes
xmlXPathCtxtCompile
xmlXPathCompareValues
xmlXPathCompile
xmlXPathCompiledEval
@@ -1087,6 +1357,7 @@ xmlXPathConvertBoolean
xmlXPathConvertNumber
xmlXPathConvertString
xmlXPathCountFunction
xmlXPathCtxtCompile
xmlXPathDebugDumpCompExpr
xmlXPathDebugDumpObject
xmlXPathDifference
@@ -1094,6 +1365,7 @@ xmlXPathDistinct
xmlXPathDistinctSorted
xmlXPathDivValues
xmlXPathEqualValues
xmlXPathErr
xmlXPathEval
xmlXPathEvalExpr
xmlXPathEvalExpression
@@ -1208,6 +1480,7 @@ xmlXPathWrapCString
xmlXPathWrapExternal
xmlXPathWrapNodeSet
xmlXPathWrapString
xmlXPathErr
xmlXPatherror
xmlXPtrBuildNodeList
xmlXPtrEval
@@ -1230,9 +1503,69 @@ xmlXPtrNewRangePointNode
xmlXPtrNewRangePoints
xmlXPtrRangeToFunction
xmlXPtrWrapLocationSet
_libiconv_version
libiconv_close
libiconv
libiconv_open
libiconv_set_relocation_prefix
xmlNewTextWriter
xmlNewTextWriterDoc
xmlNewTextWriterFilename
xmlNewTextWriterMemory
xmlNewTextWriterPushParser
xmlNewTextWriterTree
xmlFreeTextWriter
xmlTextWriterEndAttribute
xmlTextWriterEndCDATA
xmlTextWriterEndComment
xmlTextWriterEndDTD
xmlTextWriterEndDTDAttlist
xmlTextWriterEndDTDElement
xmlTextWriterEndDTDEntity
xmlTextWriterEndDocument
xmlTextWriterEndElement
xmlTextWriterEndPI
xmlTextWriterFlush
xmlTextWriterFullEndElement
xmlTextWriterSetIndent
xmlTextWriterSetIndentString
xmlTextWriterStartAttribute
xmlTextWriterStartAttributeNS
xmlTextWriterStartCDATA
xmlTextWriterStartComment
xmlTextWriterStartDTD
xmlTextWriterStartDTDAttlist
xmlTextWriterStartDTDElement
xmlTextWriterStartDTDEntity
xmlTextWriterStartDocument
xmlTextWriterStartElement
xmlTextWriterStartElementNS
xmlTextWriterStartPI
xmlTextWriterWriteAttribute
xmlTextWriterWriteAttributeNS
xmlTextWriterWriteBase64
xmlTextWriterWriteBinHex
xmlTextWriterWriteCDATA
xmlTextWriterWriteComment
xmlTextWriterWriteDTD
xmlTextWriterWriteDTDAttlist
xmlTextWriterWriteDTDElement
xmlTextWriterWriteDTDEntity
xmlTextWriterWriteDTDExternalEntity
xmlTextWriterWriteDTDExternalEntityContents
xmlTextWriterWriteDTDInternalEntity
xmlTextWriterWriteDTDNotation
xmlTextWriterWriteElement
xmlTextWriterWriteElementNS
xmlTextWriterWriteFormatAttribute
xmlTextWriterWriteFormatAttributeNS
xmlTextWriterWriteFormatCDATA
xmlTextWriterWriteFormatComment
xmlTextWriterWriteFormatDTD
xmlTextWriterWriteFormatDTDAttlist
xmlTextWriterWriteFormatDTDElement
xmlTextWriterWriteFormatDTDInternalEntity
xmlTextWriterWriteFormatElement
xmlTextWriterWriteFormatElementNS
xmlTextWriterWriteFormatPI
xmlTextWriterWriteFormatRaw
xmlTextWriterWriteFormatString
xmlTextWriterWritePI
xmlTextWriterWriteRaw
xmlTextWriterWriteRawLen
xmlTextWriterWriteString
+2 -1
View File
@@ -37,7 +37,7 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
if test "$ext_shared" = "no"; then
out="php_config.h"
else
if test -e "$ext_builddir/config.h.in"; then
if test -f "$ext_builddir/config.h.in"; then
out="$abs_builddir/config.h"
else
out="php_config.h"
@@ -84,6 +84,7 @@ int main() { return foo(10, "", 3.14); }
PHP_MBSTRING_ADD_CFLAG([-DNOT_RUBY])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma])
PHP_MBSTRING_ADD_BUILD_DIR([oniguruma/enc])
PHP_MBSTRING_ADD_INCLUDE([oniguruma])
PHP_MBSTRING_ADD_CONFIG_HEADER([oniguruma/config.h])
+4
View File
@@ -343,10 +343,14 @@ int _php_mb_encoding_handler_ex(int data_type, zval *arg, char *res, char *separ
val_len = len_list[n];
}
n++;
/* we need val to be emalloc()ed */
val = estrndup(val, val_len);
if (sapi_module.input_filter(data_type, var, &val, val_len, &new_val_len TSRMLS_CC)) {
/* add variable to symbol table */
php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
}
efree(val);
if (convd != NULL){
mbfl_string_clear(&resvar);
mbfl_string_clear(&resval);
+1
View File
@@ -2614,6 +2614,7 @@ detect_end:
stack[stack_level] = var;
stack_level++;
var = hash_entry;
SEPARATE_ZVAL(hash_entry);
target_hash = HASH_OF(*var);
if (target_hash != NULL) {
zend_hash_internal_pointer_reset(target_hash);
+1 -1
View File
@@ -8,7 +8,7 @@
#ifndef ONIGURUMA_H
#define ONIGURUMA_H
#include "php_compat.h"
#include "php_onig_compat.h"
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 2
File renamed without changes.
+27 -4
View File
@@ -33,7 +33,7 @@ unset($c);
$a = "あいうえお";
$b = array(&$a);
$c = $b;
mb_convert_variables("euc-jp", "shift_jis", $c);
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
@@ -43,7 +43,7 @@ unset($c);
$a = "あいうえお";
$b = array($a);
$c = &$b;
mb_convert_variables("euc-jp", "shift_jis", $c);
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
@@ -53,7 +53,17 @@ unset($c);
$a = "あいうえお";
$b = array(&$a);
$c = &$b;
mb_convert_variables("euc-jp", "shift_jis", $c);
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
unset($b);
unset($c);
$a = array(array("�����"));
$b = $a;
$c = $b;
mb_convert_variables("EUC-JP", "Shift_JIS", $c);
debug_zval_dump($b);
debug_zval_dump($c);
unset($a);
@@ -97,4 +107,17 @@ array(1) refcount(1){
[0]=>
string(10) "、「、、、ヲ、ィ、ェ" refcount(2)
}
array(1) refcount(3){
[0]=>
array(1) refcount(1){
[0]=>
string(10) "�����" refcount(1)
}
}
array(1) refcount(2){
[0]=>
array(1) refcount(1){
[0]=>
string(10) "丐中丹尹云" refcount(1)
}
}
+51 -32
View File
@@ -429,21 +429,38 @@ DLEXPORT PHP_MINFO_FUNCTION(mnogosearch)
}
static char* MyRemoveHiLightDup(const char *s){
size_t len=strlen(s)+1;
char *res=malloc(len);
char *d;
for(d=res;s[0];s++){
switch(s[0]){
case '\2':
case '\3':
break;
default:
*d++=*s;
}
}
*d='\0';
return res;
size_t len=strlen(s)+1;
char *d, *res = (char*)emalloc(len);
for(d=res; s[0]; s++)
{
switch(s[0])
{
case '\2':
case '\3':
break;
case '&':
if (s[1] == '#')
{
char *e;
int code= 0;
for (e= (char *)s+2; (*e >= '0') && (*e <= '9'); code= code*10 + e[0]-'0', e++);
if (*e == ';')
{
*d++= (code < 128) ? code : '?';
s= e;
break;
}
}
/* pass through */
default:
*d++=*s;
}
}
*d='\0';
return res;
}
/* {{{ proto int udm_alloc_agent(string dbaddr [, string dbmode])
@@ -1608,19 +1625,22 @@ DLEXPORT PHP_FUNCTION(udm_make_excerpt)
al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr(&(Res->Doc[row].Sections), "URL", "")));
UdmVarListReplaceInt(&(Res->Doc[row].Sections), "STORED_ID", UdmCRC32(al, strlen(al)));
free(al);
efree(al);
#if UDM_VERSION_ID >= 30216
Excerpt = UdmExcerptDoc(Agent, Res, &(Res->Doc[row]), ExcerptSize, ExcerptPadding);
if (Excerpt) {
UdmVarListReplaceStr(&(Res->Doc[row].Sections),"Body",Excerpt);
UDM_FREE(Excerpt);
}
#else
Excerpt = UdmExcerptDoc(Agent, Res, &(Res->Doc[row]), 256);
#endif
if ((Excerpt != NULL) && (strlen(Excerpt) > 6)) {
char *HlExcerpt = UdmHlConvert(&Res->WWList, Excerpt, Agent->Conf->lcs, Agent->Conf->bcs);
UdmVarListReplaceStr(&(Res->Doc[row].Sections),"Body",HlExcerpt);
UDM_FREE(HlExcerpt);
}
#endif
if (Excerpt != NULL && (UdmVarListFindStr(&(Res->Doc[row].Sections), "Z", NULL) == NULL)) {
UdmVarListReplaceInt(&(Res->Doc[row].Sections),"ST",1);
UDM_FREE(Excerpt);
@@ -1757,7 +1777,7 @@ DLEXPORT PHP_FUNCTION(udm_get_res_field_ex)
char *al;
al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr(&(Res->Doc[row].Sections), field, "")));
UdmVarListReplaceStr(&Res->Doc[row].Sections,field,al);
free(al);
efree(al);
}
RETURN_STRING((char *)UdmVarListFindStr(&Res->Doc[row].Sections,field,""),1);
} else {
@@ -1819,12 +1839,11 @@ DLEXPORT PHP_FUNCTION(udm_store_doc_cgi)
if(!Doc->Buf.content) {
UdmResultFree(Res);
UdmDocFree(Doc);
UDM_FREE(HDoc);
RETURN_FALSE;
}
HEnd=HDoc = (char*)UdmMalloc(UDM_MAXDOCSIZE + 32);
HEnd=HDoc = (char*)emalloc(UDM_MAXDOCSIZE + 32);
*HEnd='\0';
if (strncasecmp(content_type, "text/plain", 10) == 0) {
@@ -1865,7 +1884,7 @@ DLEXPORT PHP_FUNCTION(udm_store_doc_cgi)
UdmResultFree(Res);
UdmDocFree(Doc);
UDM_FREE(HDoc);
efree(HDoc);
RETURN_TRUE;
}
@@ -2046,9 +2065,9 @@ DLEXPORT PHP_FUNCTION(udm_get_res_field)
char *al;
al = (char *)MyRemoveHiLightDup((const char *)(UdmVarListFindStr(&(Res->Doc[row].Sections), "URL", "")));
UdmVarListReplaceStr(&Res->Doc[row].Sections,"URL",al);
free(al);
efree(al);
RETURN_STRING((char *)UdmVarListFindStr(&Res->Doc[row].Sections,"URL",""),1);
RETURN_STRING((char *)UdmVarListFindStr(&(Res->Doc[row].Sections),"URL",""),1);
}
#else
RETURN_STRING((Res->Doc[row].url)?(Res->Doc[row].url):"",1);
@@ -2236,7 +2255,7 @@ DLEXPORT PHP_FUNCTION(udm_get_res_param)
len += Res->WWList.Word[i].len + 64;
{
size_t wsize=(1+len)*sizeof(char);
char *wordinfo = (char*) malloc(wsize);
char *wordinfo = (char*) emalloc(wsize);
*wordinfo = '\0';
@@ -2250,7 +2269,7 @@ DLEXPORT PHP_FUNCTION(udm_get_res_param)
sprintf(UDM_STREND(wordinfo)," %s : stopword", Res->WWList.Word[i].word);
}
}
RETURN_STRING(wordinfo,1);
RETURN_STRING(wordinfo,0);
}
}
#else
@@ -2266,7 +2285,7 @@ DLEXPORT PHP_FUNCTION(udm_get_res_param)
len += Res->WWList.Word[i].len + 64;
{
size_t wsize=(1+len)*sizeof(char);
char *wordinfo = (char*) malloc(wsize);
char *wordinfo = (char*) emalloc(wsize);
int corder = (size_t)-1, ccount = 0;
*wordinfo = '\0';
@@ -2285,7 +2304,7 @@ DLEXPORT PHP_FUNCTION(udm_get_res_param)
sprintf(UDM_STREND(wordinfo),"%s%s : %d / %d", (*wordinfo) ? ", " : "", Res->WWList.Word[i].word, Res->WWList.Word[i].count, ccount);
} else continue;
}
RETURN_STRING(wordinfo,1);
RETURN_STRING(wordinfo,0);
}
}
break;
@@ -2469,7 +2488,7 @@ DLEXPORT PHP_FUNCTION(udm_cat_list)
#endif
array_init(return_value);
if (!(buf=calloc(1,UDMSTRSIZ+1))) {
if (!(buf=ecalloc(1,UDMSTRSIZ+1))) {
RETURN_FALSE;
}
@@ -2493,7 +2512,7 @@ DLEXPORT PHP_FUNCTION(udm_cat_list)
c++;
}
#endif
free(buf);
efree(buf);
} else {
RETURN_FALSE;
}
@@ -2543,7 +2562,7 @@ DLEXPORT PHP_FUNCTION(udm_cat_path)
#endif
array_init(return_value);
if (!(buf=calloc(1,UDMSTRSIZ+1))) {
if (!(buf=ecalloc(1,UDMSTRSIZ+1))) {
RETURN_FALSE;
}
@@ -2567,7 +2586,7 @@ DLEXPORT PHP_FUNCTION(udm_cat_path)
c++;
}
#endif
free(buf);
efree(buf);
} else {
RETURN_FALSE;
}
+8 -2
View File
@@ -1290,7 +1290,7 @@ PS_OPEN_FUNC(msession)
{
int port;
int len = strlen(save_path)+1;
char * path = alloca(len);
char * path = emalloc(len);
char * szport;
strcpy(path, save_path);
@@ -1309,7 +1309,13 @@ PS_OPEN_FUNC(msession)
ELOG( "ps_open_msession");
PS_SET_MOD_DATA((void *)1); /* session.c needs a non-zero here! */
return PHPMsessionConnect(path, port) ? SUCCESS : FAILURE;
if (PHPMsessionConnect(path, port)) {
efree(path);
return SUCCESS;
} else {
efree(path);
return FAILURE;
}
}
PS_CLOSE_FUNC(msession)
+19 -3
View File
@@ -348,6 +348,7 @@ PHP_RINIT_FUNCTION(mssql)
PHP_RSHUTDOWN_FUNCTION(mssql)
{
STR_FREE(MS_SQL_G(appname));
MS_SQL_G(appname) = NULL;
if (MS_SQL_G(server_message)) {
STR_FREE(MS_SQL_G(server_message));
MS_SQL_G(server_message) = NULL;
@@ -843,9 +844,22 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
if ((column_type != SQLDATETIME && column_type != SQLDATETIM4) || MS_SQL_G(datetimeconvert)) {
if (column_type == SQLDATETIM4) res_length += 14;
if (column_type == SQLDATETIME) res_length += 10;
switch (column_type) {
case SQLDATETIM4 :
res_length += 14;
break;
case SQLDATETIME :
res_length += 10;
break;
case SQLMONEY :
case SQLMONEY4 :
case SQLMONEYN :
case SQLDECIMAL :
case SQLNUMERIC :
res_length += 5;
break;
}
res_buf = (unsigned char *) emalloc(res_length+1);
res_length = dbconvert(NULL,coltype(offset),dbdata(mssql_ptr->link,offset), res_length, SQLCHAR,res_buf,-1);
} else {
@@ -909,6 +923,8 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
case SQLMONEY :
case SQLMONEY4 :
case SQLMONEYN :
case SQLDECIMAL :
case SQLNUMERIC :
res_length += 5;
break;
}
+1 -1
View File
@@ -36,8 +36,8 @@
#include "sqlfront.h"
#include "sqldb.h"
#if HAVE_FREETDS
typedef short TDS_SHORT;
#if HAVE_FREETDS
#define SQLTEXT SYBTEXT
#define SQLCHAR SYBCHAR
#define SQLVARCHAR SYBVARCHAR
+4 -4
View File
@@ -44,10 +44,10 @@ if test "$PHP_MYSQLI" != "no"; then
PHP_EVAL_INCLINE($MYSQLI_INCLINE)
PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD)
AC_DEFINE(HAVE_MYSQLILIB,1,[ ])
PHP_CHECK_LIBRARY(mysqlclient, mysql_bind_param,
[
AC_DEFINE(HAVE_MYSQLI_OLDAPI,1,[ ])
],[],[])
PHP_CHECK_LIBRARY(mysqlclient, mysql_stmt_field_count,
[ ],[
AC_MSG_ERROR([MySQLI doesn't support versions < 4.1.3 (for MySQL 4.1.x) and < 5.0.1 for (MySQL 5.0.x) anymore. Please update your libraries.])
],[])
],[
AC_MSG_ERROR([wrong mysql library version or lib not found. Check config.log for more information.])
],[
+34 -2
View File
@@ -132,7 +132,7 @@ static void mysqli_objects_free_storage(zend_object *object TSRMLS_DC)
FREE_HASHTABLE(intern->zo.properties);
/* link object */
if (intern->zo.ce == mysqli_link_class_entry) {
if (instanceof_function(intern->zo.ce, mysqli_link_class_entry TSRMLS_CC)) {
if (my_res && my_res->ptr) {
MY_MYSQL *mysql = (MY_MYSQL *)my_res->ptr;
@@ -200,6 +200,13 @@ zval *mysqli_read_property(zval *object, zval *member, int type TSRMLS_DC)
ret = zend_hash_find(obj->prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) &hnd);
}
if (ret == SUCCESS) {
/* check if connection is still valid */
if (!obj->ptr ||
!((MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql)->thread_id) {
retval = EG(uninitialized_zval_ptr);
return(retval);
}
ret = hnd->read_func(obj, &retval TSRMLS_CC);
if (ret == SUCCESS) {
/* ensure we're creating a temporary variable */
@@ -269,6 +276,27 @@ void mysqli_add_property(HashTable *h, char *pname, mysqli_read_t r_func, mysqli
}
/* }}} */
static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC)
{
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
if (obj->zo.ce != mysqli_link_class_entry && obj->zo.ce->constructor) {
return obj->zo.ce->constructor;
} else {
static zend_internal_function f;
f.function_name = mysqli_link_class_entry->name;
f.scope = mysqli_link_class_entry;
f.arg_info = NULL;
f.num_args = 0;
f.fn_flags = 0;
f.type = ZEND_INTERNAL_FUNCTION;
f.handler = ZEND_FN(mysqli_connect);
return (union _zend_function*)&f;
}
}
/* {{{ mysqli_objects_new
*/
PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry *class_type TSRMLS_DC)
@@ -374,6 +402,7 @@ PHP_MINIT_FUNCTION(mysqli)
mysqli_object_handlers.read_property = mysqli_read_property;
mysqli_object_handlers.write_property = mysqli_write_property;
mysqli_object_handlers.get_property_ptr_ptr = NULL;
mysqli_object_handlers.get_constructor = php_mysqli_constructor_get;
zend_hash_init(&classes, 0, NULL, NULL, 1);
@@ -409,6 +438,7 @@ PHP_MINIT_FUNCTION(mysqli)
REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_INTERACTIVE", CLIENT_INTERACTIVE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_IGNORE_SPACE", CLIENT_IGNORE_SPACE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_NO_SCHEMA", CLIENT_NO_SCHEMA, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_FOUND_ROWS", CLIENT_FOUND_ROWS, CONST_CS | CONST_PERSISTENT);
/* for mysqli_query */
REGISTER_LONG_CONSTANT("MYSQLI_STORE_RESULT", 0, CONST_CS | CONST_PERSISTENT);
@@ -419,6 +449,8 @@ PHP_MINIT_FUNCTION(mysqli)
REGISTER_LONG_CONSTANT("MYSQLI_NUM", MYSQLI_NUM, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_BOTH", MYSQLI_BOTH, CONST_CS | CONST_PERSISTENT);
/* for mysqli_stmt_set_attr */
REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH", STMT_ATTR_UPDATE_MAX_LENGTH, CONST_CS | CONST_PERSISTENT);
/* column information */
REGISTER_LONG_CONSTANT("MYSQLI_NOT_NULL_FLAG", NOT_NULL_FLAG, CONST_CS | CONST_PERSISTENT);
@@ -570,7 +602,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
}
fetchtype = override_flags;
} else {
fetchtype = MYSQLI_NUM;
fetchtype = MYSQLI_ASSOC;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) {
return;
}
+89 -55
View File
@@ -240,7 +240,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
var_cnt = argc - start;
if (var_cnt != stmt->stmt->field_count) {
if (var_cnt != mysql_stmt_field_count(stmt->stmt)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statmement.");
efree(args);
RETURN_FALSE;
@@ -321,11 +321,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
}
}
#ifndef HAVE_MYSQLI_OLDAPI
rc = mysql_stmt_bind_result(stmt->stmt, bind);
#else
rc = mysql_bind_result(stmt->stmt, bind);
#endif
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
if (rc) {
@@ -565,11 +561,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
}
}
}
#ifndef HAVE_MYSQLI_OLDAPI
if (mysql_stmt_execute(stmt->stmt)) {
#else
if (mysql_execute(stmt->stmt)) {
#endif
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
RETURN_FALSE;
}
@@ -607,11 +599,7 @@ PHP_FUNCTION(mysqli_stmt_fetch)
memset(stmt->result.buf[i].val, 0, stmt->result.buf[i].buflen);
}
}
#ifndef HAVE_MYSQLI_OLDAPI
if (!(ret = mysql_stmt_fetch(stmt->stmt))) {
#else
if (!(ret = mysql_fetch(stmt->stmt))) {
#endif
for (i = 0; i < stmt->result.var_cnt; i++) {
if (stmt->result.vars[i]->type == IS_STRING && stmt->result.vars[i]->value.str.len) {
efree(stmt->result.vars[i]->value.str.val);
@@ -641,7 +629,7 @@ PHP_FUNCTION(mysqli_stmt_fetch)
ZVAL_LONG(stmt->result.vars[i], llval);
}
} else {
ZVAL_STRING(stmt->result.vars[i], stmt->result.buf[i].val, 1);
ZVAL_STRINGL(stmt->result.vars[i], stmt->result.buf[i].val, stmt->result.buf[i].buflen, 1);
}
break;
default:
@@ -1213,25 +1201,6 @@ PHP_FUNCTION(mysqli_options)
}
/* }}} */
/* {{{ proto int mysqli_param_count(object stmt) {
Return the number of parameter for the given statement */
PHP_FUNCTION(mysqli_stmt_param_count)
{
MY_STMT *stmt;
zval *mysql_stmt;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
#ifndef HAVE_MYSQLI_OLDAPI
RETURN_LONG(mysql_stmt_param_count(stmt->stmt));
#else
RETURN_LONG(mysql_param_count(stmt->stmt));
#endif
}
/* }}} */
/* {{{ proto bool mysqli_ping(object link)
Ping a server connection or reconnect if there is no connection */
@@ -1272,7 +1241,7 @@ PHP_FUNCTION(mysqli_prepare)
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) {
if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) {
if (mysql_stmt_prepare(stmt->stmt, query, query_len)) {
mysql_stmt_close(stmt->stmt);
stmt->stmt = NULL;
@@ -1445,11 +1414,7 @@ PHP_FUNCTION(mysqli_stmt_send_long_data)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter number");
RETURN_FALSE;
}
#ifndef HAVE_MYSQLI_OLDAPI
if (mysql_stmt_send_long_data(stmt->stmt, param_nr, data, data_len)) {
#else
if (mysql_send_long_data(stmt->stmt, param_nr, data, data_len)) {
#endif
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1547,7 +1512,22 @@ PHP_FUNCTION(mysqli_stmt_data_seek)
}
/* }}} */
#ifndef HAVE_MYSQLI_OLDAPI
/* {{{ proto int mysqli_stmt_field_count(object stmt) {
Return the number of result columns for the given statement */
PHP_FUNCTION(mysqli_stmt_field_count)
{
MY_STMT *stmt;
zval *mysql_stmt;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
RETURN_LONG(mysql_stmt_field_count(stmt->stmt));
}
/* }}} */
/* {{{ proto void mysqli_stmt_free_result(object stmt)
Free stored result memory for the given statement handle */
PHP_FUNCTION(mysqli_stmt_free_result)
@@ -1584,7 +1564,23 @@ PHP_FUNCTION(mysqli_stmt_insert_id)
}
/* }}} */
/* {{{ proto void mysqli_stmt_reset(object stmt)
/* {{{ proto int mysqli_stmt_param_count(object stmt) {
Return the number of parameter for the given statement */
PHP_FUNCTION(mysqli_stmt_param_count)
{
MY_STMT *stmt;
zval *mysql_stmt;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
RETURN_LONG(mysql_stmt_param_count(stmt->stmt));
}
/* }}} */
/* {{{ proto bool mysqli_stmt_reset(object stmt)
reset a prepared statement */
PHP_FUNCTION(mysqli_stmt_reset)
{
@@ -1597,12 +1593,12 @@ PHP_FUNCTION(mysqli_stmt_reset)
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
mysql_stmt_reset(stmt->stmt);
return;
if (mysql_stmt_reset(stmt->stmt)) {
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
#endif
/* {{{ proto mixed mysqli_stmt_num_rows(object stmt)
Return the number of rows in statements result set */
@@ -1649,7 +1645,6 @@ PHP_FUNCTION(mysqli_select_db)
/* {{{ proto string mysqli_sqlstate(object link)
Returns the SQLSTATE error from previous MySQL operation */
#if MYSQL_VERSION_ID >= 40101
PHP_FUNCTION(mysqli_sqlstate)
{
MY_MYSQL *mysql;
@@ -1661,7 +1656,6 @@ PHP_FUNCTION(mysqli_sqlstate)
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
RETURN_STRING((char *)mysql_sqlstate(mysql->mysql),1);
}
#endif
/* }}} */
/* {{{ proto bool mysqli_ssl_set(object link ,string key ,string cert ,string ca ,string capath ,string cipher])
@@ -1711,6 +1705,50 @@ PHP_FUNCTION(mysqli_stat)
/* }}} */
/* {{{ proto int mysqli_stmt_attr_set(object stmt, long attr, bool mode)
*/
PHP_FUNCTION(mysqli_stmt_attr_set)
{
MY_STMT *stmt;
zval *mysql_stmt;
ulong mode;
ulong attr;
int rc;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Olb", &mysql_stmt, mysqli_stmt_class_entry, &attr, &mode) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
if (rc = mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode)) {
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
/* {{{ proto int mysqli_stmt_attr_get(object stmt, long attr)
*/
PHP_FUNCTION(mysqli_stmt_attr_get)
{
MY_STMT *stmt;
zval *mysql_stmt;
ulong value;
ulong attr;
int rc;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &mysql_stmt, mysqli_stmt_class_entry, &attr) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
if (rc = mysql_stmt_attr_get(stmt->stmt, attr, &value)) {
RETURN_FALSE;
}
RETURN_LONG(value);
}
/* }}} */
/* {{{ proto int mysqli_stmt_errno(object stmt)
*/
PHP_FUNCTION(mysqli_stmt_errno)
@@ -1743,12 +1781,12 @@ PHP_FUNCTION(mysqli_stmt_error)
}
/* }}} */
/* {{{ proto object mysqli_stmt_init(object link)
/* {{{ proto mixed mysqli_stmt_init(object link)
Initialize statement object
*/
PHP_FUNCTION(mysqli_stmt_init)
{
MYSQL *mysql;
MY_MYSQL *mysql;
MY_STMT *stmt;
zval *mysql_link;
MYSQLI_RESOURCE *mysqli_resource;
@@ -1756,11 +1794,11 @@ PHP_FUNCTION(mysqli_stmt_init)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",&mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link");
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT));
if (!(stmt->stmt = mysql_stmt_init(mysql))) {
if (!(stmt->stmt = mysql_stmt_init(mysql->mysql))) {
efree(stmt);
RETURN_FALSE;
}
@@ -1771,7 +1809,7 @@ PHP_FUNCTION(mysqli_stmt_init)
}
/* }}} */
/* {{{ proto bool mysqli_stmt_prepare(object link, string query)
/* {{{ proto bool mysqli_stmt_prepare(object stmt, string query)
prepare server side statement with query
*/
PHP_FUNCTION(mysqli_stmt_prepare)
@@ -1808,11 +1846,7 @@ PHP_FUNCTION(mysqli_stmt_result_metadata)
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
#ifndef HAVE_MYSQLI_OLDAPI
if (!(result = mysql_stmt_result_metadata(stmt->stmt))){
#else
if (!(result = mysql_get_metadata(stmt->stmt))){
#endif
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);
RETURN_FALSE;
}
+6 -14
View File
@@ -117,20 +117,19 @@ function_entry mysqli_functions[] = {
PHP_FE(mysqli_rpl_probe, NULL)
PHP_FE(mysqli_rpl_query_type, NULL)
PHP_FE(mysqli_select_db, NULL)
#ifndef HAVE_MYSQLI_OLDAPI
PHP_FE(mysqli_stmt_attr_get, NULL)
PHP_FE(mysqli_stmt_attr_set, NULL)
PHP_FE(mysqli_stmt_field_count, NULL)
PHP_FE(mysqli_stmt_init, NULL)
PHP_FE(mysqli_stmt_prepare, NULL)
#endif
PHP_FE(mysqli_stmt_result_metadata, NULL)
PHP_FE(mysqli_stmt_send_long_data, NULL)
PHP_FE(mysqli_stmt_bind_param, third_arg_force_by_ref_rest)
PHP_FE(mysqli_stmt_bind_result, second_arg_force_by_ref_rest)
PHP_FE(mysqli_stmt_fetch, NULL)
#ifndef HAVE_MYSQLI_OLDAPI
PHP_FE(mysqli_stmt_free_result, NULL)
PHP_FE(mysqli_stmt_insert_id, NULL)
PHP_FE(mysqli_stmt_reset, NULL)
#endif
PHP_FE(mysqli_stmt_param_count, NULL)
PHP_FE(mysqli_send_query, NULL)
#ifdef HAVE_EMBEDDED_MYSQLI
@@ -138,9 +137,7 @@ function_entry mysqli_functions[] = {
PHP_FE(mysqli_server_init, NULL)
#endif
PHP_FE(mysqli_slave_query, NULL)
#if MYSQL_VERSION_ID >= 40101
PHP_FE(mysqli_sqlstate, NULL)
#endif
PHP_FE(mysqli_ssl_set, NULL)
PHP_FE(mysqli_stat, NULL)
PHP_FE(mysqli_stmt_affected_rows, NULL)
@@ -149,9 +146,7 @@ function_entry mysqli_functions[] = {
PHP_FE(mysqli_stmt_errno, NULL)
PHP_FE(mysqli_stmt_error, NULL)
PHP_FE(mysqli_stmt_num_rows, NULL)
#if MYSQL_VERSION_ID >= 40101
PHP_FE(mysqli_stmt_sqlstate, NULL)
#endif
PHP_FE(mysqli_store_result, NULL)
PHP_FE(mysqli_stmt_store_result, NULL)
PHP_FE(mysqli_thread_id, NULL)
@@ -206,9 +201,9 @@ function_entry mysqli_link_methods[] = {
PHP_FALIAS(set_local_infile_default,mysqli_set_local_infile_default,NULL)
PHP_FALIAS(set_local_infile_handler,mysqli_set_local_infile_handler,NULL)
PHP_FALIAS(master_query,mysqli_master_query,NULL)
PHP_FALIAS(mysqli, mysqli_connect, NULL)
PHP_FALIAS(multi_query,mysqli_multi_query,NULL)
PHP_FALIAS(more_results,mysqli_more_results, NULL)
PHP_FALIAS(mysqli, mysqli_connect, NULL)
PHP_FALIAS(next_result, mysqli_next_result, NULL)
PHP_FALIAS(options,mysqli_options,NULL)
PHP_FALIAS(ping,mysqli_ping,NULL)
@@ -227,9 +222,7 @@ function_entry mysqli_link_methods[] = {
PHP_FALIAS(slave_query,mysqli_slave_query,NULL)
PHP_FALIAS(ssl_set,mysqli_ssl_set,NULL)
PHP_FALIAS(stat,mysqli_stat,NULL)
#ifndef HAVE_MYSQLI_OLDAPI
PHP_FALIAS(stmt_init,mysqli_stmt_init, NULL)
#endif
PHP_FALIAS(store_result,mysqli_store_result,NULL)
PHP_FALIAS(thread_safe,mysqli_thread_safe,NULL)
PHP_FALIAS(use_result,mysqli_use_result,NULL)
@@ -264,7 +257,8 @@ function_entry mysqli_result_methods[] = {
* Every user visible function must have an entry in mysqli_stmt_functions[].
*/
function_entry mysqli_stmt_methods[] = {
PHP_FALIAS(affected_rows,mysqli_stmt_affected_rows,NULL)
PHP_FALIAS(attr_get,mysqli_stmt_attr_get,NULL)
PHP_FALIAS(attr_set,mysqli_stmt_attr_set,NULL)
PHP_FALIAS(bind_param,mysqli_stmt_bind_param,second_arg_force_by_ref_rest)
PHP_FALIAS(bind_result,mysqli_stmt_bind_result,all_args_force_by_ref)
PHP_FALIAS(close,mysqli_stmt_close,NULL)
@@ -275,11 +269,9 @@ function_entry mysqli_stmt_methods[] = {
PHP_FALIAS(num_rows, mysqli_stmt_num_rows,NULL)
PHP_FALIAS(send_long_data,mysqli_stmt_send_long_data,NULL)
PHP_FALIAS(stmt,mysqli_prepare,NULL)
#ifndef HAVE_MYSQLI_OLDAPI
PHP_FALIAS(free_result,mysqli_stmt_free_result,NULL)
PHP_FALIAS(reset,mysqli_stmt_reset,NULL)
PHP_FALIAS(prepare,mysqli_stmt_prepare, NULL)
#endif
PHP_FALIAS(store_result,mysqli_stmt_store_result,NULL)
{NULL, NULL, NULL}
};
+27 -3
View File
@@ -80,6 +80,15 @@ int __func(mysqli_object *obj, zval **retval TSRMLS_DC)\
/* {{{ property link_client_version_read */
int link_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
ALLOC_ZVAL(*retval);
ZVAL_LONG(*retval, MYSQL_VERSION_ID);
return SUCCESS;
}
/* }}} */
/* {{{ property link_client_info_read */
int link_client_info_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
ALLOC_ZVAL(*retval);
ZVAL_STRING(*retval, MYSQL_SERVER_VERSION, 1);
@@ -87,6 +96,19 @@ int link_client_version_read(mysqli_object *obj, zval **retval TSRMLS_DC)
}
/* }}} */
/* {{{ property link_test_read */
int link_test_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
long i;
ALLOC_ZVAL(*retval);
array_init(*retval);
for (i=0; i < 10; i++)
add_index_long(*retval, i, i + 10);
return SUCCESS;
}
/*i }}} */
/* {{{ property link_connect_errno_read */
int link_connect_errno_read(mysqli_object *obj, zval **retval TSRMLS_DC)
{
@@ -171,14 +193,16 @@ MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_affected_rows_read, mysql_stmt_affected_rows,
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_insert_id_read, mysql_stmt_insert_id, MYSQLI_GET_STMT(), my_ulonglong);
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_num_rows_read, mysql_stmt_num_rows, MYSQLI_GET_STMT(), my_ulonglong);
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_param_count_read, mysql_stmt_param_count, MYSQLI_GET_STMT(), ulong);
//MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(), ulong);
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_field_count_read, mysql_stmt_field_count, MYSQLI_GET_STMT(), ulong);
MYSQLI_MAP_PROPERTY_FUNC_LONG(stmt_errno_read, mysql_stmt_errno, MYSQLI_GET_STMT(), ulong);
MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_error_read, mysql_stmt_error, MYSQLI_GET_STMT());
MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_GET_STMT());
mysqli_property_entry mysqli_link_property_entries[] = {
{"affected_rows", link_affected_rows_read, NULL},
{"client_info", link_client_info_read, NULL},
{"client_version", link_client_version_read, NULL},
{"test", link_test_read, NULL},
{"connect_errno", link_connect_errno_read, NULL},
{"connect_error", link_connect_error_read, NULL},
{"errno", link_errno_read, NULL},
@@ -212,9 +236,9 @@ mysqli_property_entry mysqli_stmt_property_entries[] = {
{"param_count", stmt_param_count_read, NULL},
/* TODO: stmt->field_count doesn't work currently, remove comments until mysqli_stmt_field_count
is implemented in client library
{"field_count", stmt_field_count_read, NULL},
is implemented in client library
*/
{"field_count", stmt_field_count_read, NULL},
{"errno", stmt_errno_read, NULL},
{"error", stmt_error_read, NULL},
-4
View File
@@ -52,7 +52,6 @@ void php_mysqli_report_error(char *sqlstate, int errorno, char *error TSRMLS_DC)
/* {{{ void php_mysqli_report_index() */
void php_mysqli_report_index(char *query, unsigned int status TSRMLS_DC) {
#if MYSQL_VERSION_ID > 40101
char index[15];
if (status & SERVER_QUERY_NO_GOOD_INDEX_USED) {
@@ -63,9 +62,6 @@ void php_mysqli_report_index(char *query, unsigned int status TSRMLS_DC) {
return;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s used in query/prepared statement %s", index, query);
#else
return;
#endif
}
/* }}} */
Loaded 100 of 317 files, more files were not shown because too many files have changed in this diff. Show more