Compare commits

...
304 Commits
Author SHA1 Message Date
SVN Migration 4d173e6ba5 This commit was manufactured by cvs2svn to create tag 'php_5_0_2'. 2004-09-23 21:22:00 +00:00
Andi Gutmans 412fb096fa - Roll 5.0.2 2004-09-23 21:21:59 +00:00
Marcus Boerger c4c952f023 BFN 2004-09-23 18:45:27 +00:00
Marcus Boerger 10b2bb1cab MFH 2004-09-23 18:42:49 +00:00
Marcus Boerger 406847a6cd MFH Bugfix # 30209 2004-09-23 18:41:15 +00:00
SVN Migration 57c5bff123 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-09-23 18:38:35 +00:00
Dmitry Stogov 9062b2f967 Fixed bug #29566 (foreach/string handling strangeness (crash)). 2004-09-22 07:12:15 +00:00
Dmitry Stogov 29348ff48b Fixed bug #30182 (SOAP module processing WSDL file dumps core). 2004-09-22 05:57:36 +00:00
Uwe Schindler 2067727a80 changed order of processing of ini entries 2004-09-20 13:29:44 +00:00
Ilia Alshanetsky 6fcc1515cb MFH: Fixed bug #29913 (parse_url() is now binary safe). 2004-09-20 05:14:35 +00:00
Stanislav Malyshev 08e7f480e1 MFH destructor failure fix 2004-09-17 10:19:47 +00:00
Ilia Alshanetsky f521b61ce2 MFH: Fixed bug #30050 (Possible crash inside php_shutdown_config()). 2004-09-17 02:48:47 +00:00
Andi Gutmans 16bc64121f - Go with PHP 5.0.2RC1 2004-09-16 21:44:47 +00:00
Dmitry Stogov d8cd133a33 Fixed crash with SoapFault and register_shutdown_function(). 2004-09-16 08:11:07 +00:00
Sebastian Bergmann f1ec84159d MFH: ZTS fix. 2004-09-16 05:44:39 +00:00
Andi Gutmans b9a6022f15 - NEWS 2004-09-16 00:46:46 +00:00
Andi Gutmans b832343962 - MFH 2004-09-16 00:44:12 +00:00
Uwe Schindler 8e3e81256f Fixed bug #29805 (HTTP Authentication Issues) 2004-09-15 21:27:10 +00:00
Dmitry Stogov 24ec8acb2d Fixed invalid test name 2004-09-15 14:35:59 +00:00
Ilia Alshanetsky 820516e756 Fixed a bug causing ".123" * "90" and alike to return a 0. 2004-09-15 13:41:38 +00:00
Derick Rethans 09d555e3d0 - MFH: Windows has strcoll too. 2004-09-15 12:29:24 +00:00
Derick Rethans 9782bbd297 - MFH: Added new boolean (fourth) parameter to array_slice() that turns on the
preservation of keys in the returned array.
2004-09-15 11:51:56 +00:00
Dmitry Stogov 833331a53d Fixed possible crash 2004-09-15 10:35:09 +00:00
Dmitry Stogov a9b87039e4 Fixed bug #30045 (Cannot pass big integers (> 2147483647) in SOAP requests) 2004-09-14 12:13:39 +00:00
Magnus M��tt� 327125e313 Add missing stream unregister for sslv2 and 3. 2004-09-13 18:31:54 +00:00
Stefan Esser ce886edc0b MFH 2004-09-13 16:00:37 +00:00
Dmitry Stogov bb3e125185 Change soap's ctors to __construct(),
rename SoapClient->__call() to SoapClinet->__soapCall().
2004-09-13 11:54:06 +00:00
Stefan Esser f5722d61b4 MFH 2004-09-12 10:46:27 +00:00
Derick Rethans 7d77171b9b - Added the sorting flag SORT_LOCALE_STRING to the sort() functions which makes
them sort based on the current locale. (Derick)
2004-09-11 14:20:55 +00:00
Andi Gutmans 76d520e9a7 - MFH 2004-09-11 00:23:33 +00:00
Wez Furlong aa5feff190 BFN 2004-09-10 12:06:27 +00:00
Wez Furlong 16dd07c5e0 MFH: fix for Bug #29296 2004-09-10 11:44:10 +00:00
Dmitry Stogov 14c1dc4ab4 SoapClient->__call() is renamed to SoapClient->__soap_call(). 2004-09-10 09:03:25 +00:00
Dmitry Stogov 18079dd248 Using php_libxml_xmlCheckUTF8() from ext/libxml. 2004-09-10 09:00:32 +00:00
Wez Furlong ae5598fa85 MFH: avoid potential AT&T libc problems with tempnam() 2004-09-09 19:41:40 +00:00
Marcus Boerger 6183a1ed3e MFH Fix test script 2004-09-09 17:09:25 +00:00
Rasmus Lerdorf 177647c99b Stop at the index on an unmatched [ 2004-09-09 16:21:49 +00:00
Marcus Boerger 278aee14a5 MFH Drop namespace relict 2004-09-09 13:29:37 +00:00
Marcus Boerger 29048d8d7e Fix test 2004-09-09 11:33:31 +00:00
Marcus Boerger e3b65c75be MFH Fix __call's method signature 2004-09-09 09:54:06 +00:00
Marcus Boerger a3858e17e9 MFH signature check/method registration
# the new function is no ZEND_API in 5.0.* to prevent bumping API
2004-09-09 09:53:20 +00:00
Marcus Boerger 0d27154a49 MFH add new test 2004-09-09 07:46:43 +00:00
SVN Migration 9ab9402ed9 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-09-09 07:46:20 +00:00
Andi Gutmans db638b91b3 - MFH 2004-09-09 02:44:17 +00:00
Sara Golemon c1c1b21686 MFH (r.163) Handle maxlen when stream can't be mmaped 2004-09-08 18:45:05 +00:00
Rob Richards e62db3b3c8 MHF: fix issue with multiple xsl objects using registerPHPfunctions
- also fixes threading issue
2004-09-08 16:54:53 +00:00
Rob Richards f01310928c MFH: implement php_libxml_xmlCheckUTF8
- workaround for <= libxml2-2.6.13 function
2004-09-08 10:16:57 +00:00
Dmitry Stogov b003591f19 Make ext/soap work around libxml2 bug in xmlCheckUTF8 (2.6.7-2.6.13) 2004-09-07 14:41:29 +00:00
Marcus Boerger 9ae0e91ef4 MFH Fix handling of exceptions in dtors 2004-09-06 19:16:35 +00:00
Rob Richards c2c1590d52 BFN 2004-09-06 10:19:36 +00:00
Rob Richards 39916670cc MFH: Fixed bug #29945 (simplexml_load_file URL limitation 255 char) 2004-09-06 10:18:29 +00:00
Marcus Boerger 14b2c4a1f4 BFN 2004-09-05 17:43:37 +00:00
Marcus Boerger 2074b6ceee MFH bugfix 299885 2004-09-05 17:40:54 +00:00
Andi Gutmans 120ea84394 - MFH 2004-09-04 17:04:23 +00:00
Georg Richter 4ca31d911f MFH: LOAD DATA INFILE now uses PHP's fopen wrapper 2004-09-04 14:19:20 +00:00
Marcus Boerger 03a1a3675a MFH 2004-09-03 18:54:41 +00:00
Marcus Boerger 7052ece4e8 MFH: Fix protoe's 2004-09-03 18:41:10 +00:00
Ilia Alshanetsky f34dafccdb MFH: Adjusted input check. 2004-09-03 03:35:27 +00:00
Stanislav Malyshev 65052194b4 MFH: filestat fix 2004-09-02 09:44:59 +00:00
Derick Rethans 88d0d5427e - MFH: Added test for bug #29944. 2004-09-02 06:35:04 +00:00
Georg Richter 2c99f0230c fixed compiler warnings
fixed bug #29283
2004-09-02 04:52:07 +00:00
Ilia Alshanetsky ea138b85ab MFH: Fixed bug #29925 (Added a check to prevent illegal characters in
session key).
2004-09-02 02:44:12 +00:00
Marcus Boerger df93e470cc MFH: Fix seeking 2004-08-31 20:56:08 +00:00
SVN Migration e54698481c This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-31 20:54:32 +00:00
Sara Golemon 43004bcaaa MFH: Use user_agent ini setting if it's available. 2004-08-31 20:11:32 +00:00
Joe Orton 98c0dd4147 MFH: Do not rely on handling of integers which might be outside the
range of a 32-bit signed long.
2004-08-31 12:11:06 +00:00
Joe Orton 85f8b2a830 MFH: fix gettimeofday() tests to not fail if the same time is
returned by successive calls.
2004-08-31 11:49:19 +00:00
Antony Dovgal b8c51d4614 MFH: fix bug #29723 (file_get_contents() fails with the file:// wrapper under Win32) 2004-08-31 11:38:59 +00:00
Antony Dovgal 805fe58a28 MFH: this file shouldn't be in the repository at all 2004-08-31 08:31:45 +00:00
Ilia Alshanetsky f5c36b8d9e MFH: Added missing input validation to dio_write(). 2004-08-30 22:21:13 +00:00
Marcus Boerger 25ab185761 MFH: Add some information about array overloading 2004-08-30 18:49:49 +00:00
Rob Richards e7fcde565b MFH: remove cloning under ze1_compatibility_mode
- minor BC break but doesnt work right under compat mode anyways
2004-08-30 17:29:58 +00:00
Rob Richards 6164ea4840 MFH: remove cloning under ze1_compatibility_mode
- minor BC break but doesnt work right under compat mode anyways
2004-08-30 15:09:07 +00:00
Rob Richards 470ca9ef6f MFH: remove clone functionality 2004-08-30 15:00:07 +00:00
Stanislav Malyshev beffd8738e MFH fix #29893 2004-08-30 09:13:40 +00:00
Antony Dovgal bce14e2c6f MFH: add testcase for bug #29893 2004-08-30 09:11:06 +00:00
SVN Migration af2ee723dc This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-30 09:07:19 +00:00
Marcus Boerger 975771b431 MFH: String offset starts with 0 2004-08-29 19:15:57 +00:00
Ilia Alshanetsky 3f5e121f2b MFH: Fixed leak when serializing protected & private properties. 2004-08-29 17:16:21 +00:00
Marcus Boerger a000fe6c06 MFH: Bugfix #29882 isset crashes on arrays 2004-08-29 13:29:47 +00:00
Sergey Kartashoff ff8c3d2d67 - A fix for building of shared mnogosearch module 2004-08-29 10:59:15 +00:00
Derick Rethans e6df40e831 - MFH: Fixed bug #29873 (No defines around pcntl_*priority definitions). 2004-08-28 12:20:41 +00:00
Christian Stocker b559075a02 Marking DOM and XSL as "Working". This should have happened with the
release of PHP 5.0.0 already.
2004-08-27 22:41:38 +00:00
Marcus Boerger 1d87b34375 MFH: Fix by (mathieu dot bruneau at argontechnologies dot ca) 2004-08-27 20:39:17 +00:00
Andi Gutmans 942a83b246 - MFH 2004-08-27 16:49:54 +00:00
Dmitry Stogov 92689ec8e0 Fixed bug #29842 (soapclient return null value) 2004-08-27 07:06:07 +00:00
Ilia Alshanetsky dfb664c946 MFH: Fixed a nasty resource/memory/disk-space leak when opening zlib files
via wrapper stacking ala compress.zlib://http://...
2004-08-26 23:36:08 +00:00
Marcus Boerger 8c4eede77d MFH: Enforce semantics: Classes cannot extend Interfaces 2004-08-26 23:02:55 +00:00
Marcus Boerger 4ad82c5ef2 MFH: Add test 2004-08-26 23:01:45 +00:00
Marcus Boerger ca612d3fc0 MFH: Fix test 2004-08-26 23:01:21 +00:00
SVN Migration 87fca31a3f This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-26 22:53:52 +00:00
Marcus Boerger 54b2a4d6a0 BFN 2004-08-26 22:44:20 +00:00
Marcus Boerger 82a5d700e3 MFH: Bugfix 29828 2004-08-26 22:43:32 +00:00
Marcus Boerger 982ac8b7a2 MFH 2004-08-26 22:30:16 +00:00
SVN Migration 6aed779dc8 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-26 22:24:49 +00:00
Rob Richards 69fe08beb2 not experimental 2004-08-26 20:13:57 +00:00
Dmitry Stogov 412bae8482 Memory leaks were fixed. 2004-08-26 18:55:54 +00:00
Dmitry Stogov 27868d1799 Fixed bug #29839 (incorrect convert (xml:lang to lang)) 2004-08-26 18:36:47 +00:00
Dmitry Stogov bb19590b7e Fixed bug #29795 (SegFault with Soap and Amazon's Web Services)
Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled)
2004-08-26 15:23:57 +00:00
Dmitry Stogov 48dba110e2 Fixed bug #29844 (SOAP doesn't return the result of a valid SOAP request).
Fixed bug #29830 (SoapServer::setClass() should not export non-public methods).
2004-08-26 12:20:13 +00:00
Ilia Alshanetsky 255f9fc072 MFH: Fixed bug #29808 (array_count_values() breaks with numeric strings). 2004-08-26 00:26:22 +00:00
Andrei Zmievski 8f9fa59341 MFB. 2004-08-25 20:48:25 +00:00
Marcus Boerger 872f6e7af8 MFH: No short tags 2004-08-25 07:26:36 +00:00
Andrey Hristov ecca999733 . 2004-08-25 07:20:30 +00:00
Andi Gutmans 38d64188ff - Improve wording 2004-08-25 01:06:29 +00:00
Andi Gutmans 048aa76cc9 - NEWS 2004-08-25 01:04:27 +00:00
Andi Gutmans 5c3249d954 - MFH 2004-08-25 01:02:38 +00:00
Andrey Hristov b15b80c1b7 MFH 2004-08-24 22:03:12 +00:00
Marcus Boerger 5facf4becc TSRM fix 2004-08-24 21:41:02 +00:00
Marcus Boerger f5ebf71f49 Add new test 2004-08-24 21:40:12 +00:00
SVN Migration 7a69f34c69 This commit was manufactured by cvs2svn to create branch 'PHP_5_0'. 2004-08-24 21:35:47 +00:00
Andrei Zmievski f1b7a88393 MFB 2004-08-24 21:02:52 +00:00
Ilia Alshanetsky 853d714008 MFH: Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on
invalid data).
2004-08-24 15:25:59 +00:00
Rob Richards 077b8f2d25 MFH: fix segfault when object cloned 2004-08-24 13:33:48 +00:00
Christian Stocker b6bb43ef94 MFH ;)
(This extension is no more experimental)
2004-08-24 11:50:53 +00:00
Ilia Alshanetsky 6f20f9d285 MFH: Fixed possible crash inside dio_read(). 2004-08-23 17:27:46 +00:00
Zeev Suraski 2fb5c4394b Fix names 2004-08-23 13:14:27 +00:00
Derick Rethans 9ca8a571e9 - There was a bug # attached to this fix. 2004-08-23 09:56:05 +00:00
Derick Rethans 8ee05c9da8 - Fixed Apache 2.0 SAPI build against Apache 2 HEAD. (Patch by Joe Orton) 2004-08-23 09:00:09 +00:00
Ilia Alshanetsky a4430a9cfe MFH: Using int when long should be used. 2004-08-22 18:05:27 +00:00
Andrey Hristov 2be03f0d73 MFH (bug 26737) 2004-08-21 14:11:56 +00:00
Sara Golemon 85fe5f8c34 MFH Bufix#29777 Bad commenting 2004-08-21 00:01:44 +00:00
Ilia Alshanetsky c7f52698c1 MFB: removed unneeded bits. 2004-08-20 13:52:47 +00:00
Derick Rethans d775bca68f - 78 chars please. 2004-08-20 06:13:41 +00:00
Ilia Alshanetsky 6c763f3721 MFH: Added more missing cURL options. 2004-08-20 00:56:05 +00:00
Brian France 949e461e8f [MFH] If you send a post with a content-type header and then the next post without the content-type header, raw_post_data will not be set. This is because SG(request_info).post_entry is set to the first requests function pointer which makes it follow the wrong code path. 2004-08-19 20:34:04 +00:00
Antony Dovgal 59ed068c78 BFN 2004-08-19 15:23:54 +00:00
Antony Dovgal d8cd7dac07 MFH: ip2long() issues 2004-08-19 15:15:32 +00:00
Antony Dovgal 4945317c28 MFH: fix #29737 (ip2long should return -1 if IP is 255.255.255.255 and FALSE on error) 2004-08-19 14:03:44 +00:00
Derick Rethans 34f4400502 - Reorder 2004-08-19 12:44:35 +00:00
Christian Stocker 259f662488 MFH
- Fixed bug #29657 (xml_* functions throw non descriptive error).
  (Christian, Rob)
- Fixed bug #29711 (Changed ext/xml to default to UTF-8 output). (Rob)
2004-08-19 12:29:43 +00:00
Ilia Alshanetsky d349734059 MFH: Fixed bug #29727 (Added missing CURL authentication directives). 2004-08-18 21:27:27 +00:00
Antony Dovgal fa5f20cfce MFB: typo in config.m4 (potential configuration problem with Stronghold) 2004-08-18 07:19:45 +00:00
Andi Gutmans 435fff2cb1 - Fix typos 2004-08-17 23:09:37 +00:00
Antony Dovgal 9173e270b0 MFH: fix typo 2004-08-17 10:58:07 +00:00
Ilia Alshanetsky 40645cc0a6 MFH: Fixed bug #29594 (Use PHP's own tmpfile() implementation). 2004-08-16 23:08:56 +00:00
Zeev Suraski 33e114b37e *** empty log message *** 2004-08-16 12:34:20 +00:00
Zeev Suraski be85bd83e8 MFH 2004-08-16 12:25:40 +00:00
Marcus Boerger 29099a7470 BFN 2004-08-16 08:51:12 +00:00
Marcus Boerger 8823289f9f MFH: Fix bug #29447: Reflection API issues 2004-08-16 08:49:48 +00:00
Ilia Alshanetsky 78363147b8 MFH: Fixed bug #29678 (opendir() with ftp:// wrapper segfaults if path
does not have trailing slash).
2004-08-16 01:41:17 +00:00
Marcus Boerger ac7665fdc2 MFH: Remove unnecessary check 2004-08-15 15:50:37 +00:00
Georg Richter 1410d8c0b2 fixed default for mysqli_fetch_array 2004-08-15 05:50:29 +00:00
Marcus Boerger 5a4158421c MFH: Add missing check 2004-08-14 19:04:01 +00:00
Georg Richter 945115968c fixed bug #29656 (segfault on result and statement properties) 2004-08-13 16:27:35 +00:00
Antony Dovgal 970f1f9c7f MFH: fix yet another annoying compile warning 2004-08-13 15:02:05 +00:00
Antony Dovgal 65ef16ef31 MFH: fix compile warning 2004-08-13 14:54:50 +00:00
Derick Rethans 0186acacdb - MFH: Added PHP_EOL constant that contains the OS way of representing
newlines. (Patch by Paul Hudson)
2004-08-13 07:08:46 +00:00
Georg Richter bc4a269d3c minor fix in mysqli_prepare: copying stmt errormessag to mysql structure 2004-08-12 22:11:46 +00:00
Andi Gutmans 291441a34c - Back to 5.0.2-dev 2004-08-12 20:53:19 +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
353 changed files with 10593 additions and 21914 deletions

No files matched your search

+2 -2
View File
@@ -220,7 +220,7 @@ COMMENT: Using the new OCI8 driver is encouraged where possible.
EXTENSION: dom
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>, Marcus Boerger <helly@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
STATUS: Working
SINCE: 5.0
-------------------------------------------------------------------------------
EXTENSION: simplexml
@@ -247,7 +247,7 @@ STATUS: Experimental
EXTENSION: xsl
PRIMARY MAINTAINER: Christian Stocker <chregu@php.net>, Rob Richards <rrichards@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
STATUS: Working
SINCE: 5.0
-------------------------------------------------------------------------------
+1298 -379
View File
File diff suppressed because it is too large. Load diff
+113 -2
View File
@@ -1,7 +1,119 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2004, PHP 5.0.1
23 Sep 2004, PHP 5.0.2
- Added new boolean (fourth) parameter to array_slice() that turns on the
preservation of keys in the returned array. (Derick)
- Added the sorting flag SORT_LOCALE_STRING to the sort() functions which makes
them sort based on the current locale. (Derick)
- Added interface_exists() and make class_exists() only return true for real
classes. (Andrey)
- Added PHP_EOL constant that contains the OS way of representing newlines.
(Paul Hudson, Derick)
- Implemented periodic PCRE compiled regexp cache cleanup, to avoid memory
exhaustion. (Andrei)
- Renamed SoapClient->__call() to SoapClinet->__soapCall(). (Dmitry)
- Fixed bug with raw_post_data not getting set (Brian)
- Fixed a file-descriptor leak with phpinfo() and other 'special' URLs (Zeev)
- Fixed bug #30209 (ReflectionClass::getMethod() lowercases attribute).
(Marcus)
- Fixed bug #30182 (SOAP module processing WSDL file dumps core). (Dmitry)
- Fixed bug #30045 (Cannot pass big integers (> 2147483647) in SOAP requests).
(Dmitry)
- Fixed bug #29985 (unserialize()/ __PHP_Incomplete_class does not report
correctly class name). (Marcus, Tony)
- Fixed bug #29945 (simplexml_load_file URL limitation 255 char). (Rob)
- Fixed bug #29873 (No defines around pcntl_*priority definitions). (Derick)
- Fixed bug #29844 (SOAP doesn't return the result of a valid SOAP request).
(Dmitry)
- Fixed bug #29842 (soapclient return null value). (Dmitry)
- Fixed bug #29839 (incorrect convert (xml:lang to lang)). (Dmitry)
- Fixed bug #29830 (SoapServer::setClass() should not export non-public
methods). (Dmitry)
- Fixed bug #29828 (Interfaces no longer work). (Marcus)
- Fixed bug #29821 (Fixed possible crashes in convert_uudecode() on invalid
data). (Ilia)
- Fixed bug #29808 (array_count_values() breaks with numeric strings). (Ilia)
- Fixed bug #29805 (HTTP Authentication Issues). (Uwe Schindler)
- Fixed bug #29795 (SegFault with Soap and Amazon's Web Services). (Dmitry)
- Fixed bug #29737 (ip2long should return -1 if IP is 255.255.255.255 and FALSE
on error). (Tony)
- Fixed bug #29711 (Changed ext/xml to default to UTF-8 output). (Rob)
- Fixed bug #29678 (opendir() with ftp:// wrapper segfaults if path does not
have trailing slash). (Ilia)
- Fixed bug #29657 (xml_* functions throw non descriptive error).
(Christian, Rob)
- Fixed bug #29656 (segfault on result and statement properties). (Georg)
- Fixed bug #29566 (foreach/string handling strangeness (crash)). (Dmitry)
- Fixed bug #29447 (Reflection API issues). (Marcus)
- Fixed bug #29296 (Added sslv2 and sslv3 transports). (Wez)
- Fixed bug #29283 (Invalid statement handle in mysqli on execute). (Georg)
- Fixed bug #29913 (parse_url() is now binary safe). (Ilia)
- Fixed bug #27994 (segfault with Soapserver when WSDL-Cache is enabled).
(Dmitry)
- Fixed bug #27791 (Apache 2.0 SAPI build against Apache 2 HEAD). (Joe Orton,
Derick)
- Fixed bug #26737 (private/protected properties not serialized when user
declared method __sleep() exists). E_NOTICE thrown when __sleep() returns
name of non-existing member. (Andrey, Curt)
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 bug #27669 (PHP 5 didn't support all possibilities for calling static
methods dynamically). (Dmitry)
- 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)
@@ -10,7 +122,6 @@ PHP NEWS
- 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 #28895 (ReflectionClass::isAbstract always returns false). (Marcus)
- 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()).
+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.
+53 -5
View File
@@ -77,20 +77,24 @@
9. get_class() starting PHP 5 returns the name of the class as it was
declared which may lead to problems in older scripts that rely on
the previous behaviour - the class name is lowercased.
the previous behaviour - the class name is lowercased. Expect the
same behaviour from get_parent_class() when applicable.
Example :
<?php
class FooBar {
}
class ExtFooBar extends FooBar{}
$a = new FooBar();
var_dump(get_class($a));
var_dump(get_class($a), get_parent_class($a));
?>
Output (PHP 4):
string(6) "foobar"
string(9) "extfoobar"
Output (PHP 5):
string(6) "FooBar"
string(9) "ExtFooBar"
----------------------------------------------------------------------
Example code that will break :
//....
@@ -101,7 +105,51 @@
//...
}
//...
Possible solution is to search for get_class() in all your scripts and
use strtolower().
Possible solution is to search for get_class() and get_parent_class() in
all your scripts and use strtolower().
10. get_class_methods() returns the names of the methods of a class as they
declared. In PHP4 the names are all lowercased.
Example code :
<?php
class Foo{
function doFoo(){}
function hasFoo(){}
}
var_dump(get_class_methods("Foo"));
?>
Output (PHP4):
array(2) {
[0]=>
string(5) "dofoo"
[1]=>
string(6) "hasfoo"
}
Output (PHP5):
array(2) {
[0]=>
string(5) "doFoo"
[1]=>
string(6) "hasFoo"
}
11. Assignment $this is impossible. Starting PHP 5.0.0 $this has special
meaning in class methods and is recognized by the PHP parser. The latter
will generate a parse error when assignment to $this is found
Example code :
<?php
class Foo {
function assignNew($obj) {
$this = $obj;
}
}
$a = new Foo();
$b = new Foo();
$a->assignNew($b);
echo "I was executed\n";
?>
Output (PHP 4):
I was executed
Output (PHP 5):
PHP Fatal error: Cannot re-assign $this in /tmp/this_ex.php on line 4
+42 -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;
}
@@ -890,6 +890,47 @@ Changes in the Zend Engine 2.0
the use of all abstract methods declared in the interfaces Iterator
and IteratorAggregate respectively.
* Array overloading
Objects can be used with Array notation when they implement the
interface ArrayAccess. You cannot use such objects in standard
array functions, however you have full control over the array
notation. This allows lazy initialization or read only array.
Note that setting [] results in a call to offsetSet() with
index being NULL. That means that as with standard arrays you
cannot store NULL keys.
Example:
<?php
class ArrayClass implements ArrayAccess {
public $a = array();
function offsetExists($index) {
return array_key_exists($index, $this->a);
}
function offsetGet($index) {
return $this->a[$index];
}
function offsetSet($index, $newval) {
return $this->a[$index] = $newval;
}
function offsetUnset($index) {
unset($this->a[$index]);
}
}
$obj = new ArrayClass;
$obj[0] = 'bla'; // calls offsetSet(0,'bla')
$obj[] = 42; // calls offsetSet(NULL, 42)
$x = $obj[0]; // calls offsetGet(0)
$b = isset($obj[0]); // calls offsetExists(0)
unset($obj[0]); // calls offsetUnset(0)
?>
* __METHOD__
The pseudo constant __METHOD__ shows the current class and method
+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===
-1
View File
@@ -83,7 +83,6 @@ ZEND_INI_END()
ZEND_API int compiler_globals_id;
ZEND_API int executor_globals_id;
ZEND_API int alloc_globals_id;
zend_class_entry global_main_class;
HashTable *global_function_table;
HashTable *global_class_table;
HashTable *global_constants_table;
+2 -2
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "2.0.1-dev"
#define ZEND_VERSION "2.0.2"
#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) */
+81 -14
View File
@@ -316,11 +316,13 @@ static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec TSRMLS_DC)
*pl = Z_STRLEN_PP(arg);
break;
case IS_OBJECT: {
if (Z_OBJ_HANDLER_PP(arg, cast_object)
&& Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
*pl = Z_STRLEN_PP(arg);
*p = Z_STRVAL_PP(arg);
break;
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
SEPARATE_ZVAL_IF_NOT_REF(arg);
if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
*pl = Z_STRLEN_PP(arg);
*p = Z_STRVAL_PP(arg);
break;
}
}
}
@@ -1216,6 +1218,29 @@ ZEND_API int zend_startup_module(zend_module_entry *module)
return zend_register_module_ex(module TSRMLS_CC);
}
void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type TSRMLS_DC)
{
char lcname[16];
int name_len;
/* 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(fptr->common.function_name);
zend_str_tolower_copy(lcname, fptr->common.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 (name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 && !memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)) && fptr->common.num_args != 0) {
zend_error(error_type, "Destuctor %s::%s() cannot take arguments", ce->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)) && fptr->common.num_args != 0) {
zend_error(error_type, "Method %s::%s() cannot accept any arguments", ce->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)) && fptr->common.num_args != 1) {
zend_error(error_type, "Method %s::%s() must take exactly 1 argument", ce->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)) && fptr->common.num_args != 2) {
zend_error(error_type, "Method %s::%s() must take exactly 2 arguments", ce->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)) && fptr->common.num_args != 2) {
zend_error(error_type, "Method %s::%s() must take exactly 2 arguments", ce->name, ZEND_CALL_FUNC_NAME);
}
}
/* registers all functions in *library_functions in the function hash */
ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC)
@@ -1226,9 +1251,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
int count=0, unload=0;
HashTable *target_function_table = function_table;
int error_type;
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL;
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__call = NULL;
char *lowercase_name;
int fname_len;
char *lc_class_name;
int class_name_len;
if (type==MODULE_PERSISTENT) {
error_type = E_CORE_WARNING;
@@ -1240,6 +1267,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
target_function_table = CG(function_table);
}
internal_function->type = ZEND_INTERNAL_FUNCTION;
if (scope) {
class_name_len = strlen(scope->name);
lc_class_name = zend_str_tolower_dup(scope->name, class_name_len);
}
while (ptr->fname) {
internal_function->handler = ptr->handler;
@@ -1309,18 +1341,28 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
* If it's an old-style constructor, store it only if we don't have
* a constructor already.
*/
if (!strcmp(ptr->fname, scope->name) && !ctor) {
if ((fname_len == class_name_len) && !memcmp(lowercase_name, lc_class_name, class_name_len+1) && !ctor) {
ctor = reg_function;
} else if (!strcmp(ptr->fname, ZEND_CONSTRUCTOR_FUNC_NAME)) {
} else if ((fname_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
ctor = reg_function;
} else if (!strcmp(ptr->fname, ZEND_DESTRUCTOR_FUNC_NAME)) {
} else if ((fname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME))) {
dtor = reg_function;
if (internal_function->num_args) {
zend_error(error_type, "Destructor %s::%s() cannot take arguments", scope->name, ptr->fname);
}
} else if (!strcmp(ptr->fname, ZEND_CLONE_FUNC_NAME)) {
} else if ((fname_len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME))) {
clone = reg_function;
} else if ((fname_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME))) {
__call = reg_function;
} else if ((fname_len == sizeof(ZEND_GET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME))) {
__get = reg_function;
} else if ((fname_len == sizeof(ZEND_SET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME))) {
__set = reg_function;
} else {
reg_function = NULL;
}
if (reg_function) {
zend_check_magic_method_implementation(scope, reg_function, error_type TSRMLS_CC);
}
}
ptr++;
@@ -1328,6 +1370,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
free_alloca(lowercase_name);
}
if (unload) { /* before unloading, display all remaining bad function in the module */
if (scope) {
efree(lc_class_name);
}
while (ptr->fname) {
if (zend_hash_exists(target_function_table, ptr->fname, strlen(ptr->fname)+1)) {
zend_error(error_type, "Function registration failed - duplicate name - %s", ptr->fname);
@@ -1341,27 +1386,49 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
scope->constructor = ctor;
scope->destructor = dtor;
scope->clone = clone;
scope->__call = __call;
scope->__get = __get;
scope->__set = __set;
if (ctor) {
ctor->common.fn_flags |= ZEND_ACC_CTOR;
if (ctor->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Constructor %s::%s cannot be static", ctor->common.scope->name, ctor->common.function_name);
zend_error(error_type, "Constructor %s::%s() cannot be static", scope->name, ctor->common.function_name);
}
ctor->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
if (dtor) {
dtor->common.fn_flags |= ZEND_ACC_DTOR;
if (dtor->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Destructor %s::%s cannot be static", dtor->common.scope->name, dtor->common.function_name);
zend_error(error_type, "Destructor %s::%s() cannot be static", scope->name, dtor->common.function_name);
}
dtor->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
if (clone) {
clone->common.fn_flags |= ZEND_ACC_CLONE;
if (clone->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Constructor %s::%s cannot be static", clone->common.scope->name, clone->common.function_name);
zend_error(error_type, "Constructor %s::%s() cannot be static", scope->name, clone->common.function_name);
}
clone->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
if (__call) {
if (__call->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __call->common.function_name);
}
__call->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
if (__get) {
if (__get->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __get->common.function_name);
}
__get->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
if (__set) {
if (__set->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __set->common.function_name);
}
__set->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
efree(lc_class_name);
}
return SUCCESS;
}
+1
View File
@@ -168,6 +168,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
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);
void zend_check_magic_method_implementation(zend_class_entry *ce, zend_function *fptr, int error_type 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);
+1 -1
View File
@@ -481,7 +481,7 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
unsigned int i, j;
zend_mem_header *ptr;
for (i=1; i<MAX_CACHED_MEMORY; i++) {
for (i=0; i<MAX_CACHED_MEMORY; i++) {
for (j=0; j<AG(cache_count)[i]; j++) {
ptr = (zend_mem_header *) AG(cache)[i][j];
# if MEMORY_LIMIT
+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);
+69 -7
View File
@@ -44,6 +44,7 @@ static ZEND_FUNCTION(get_class);
static ZEND_FUNCTION(get_parent_class);
static ZEND_FUNCTION(method_exists);
static ZEND_FUNCTION(class_exists);
static ZEND_FUNCTION(interface_exists);
static ZEND_FUNCTION(function_exists);
#if ZEND_DEBUG
static ZEND_FUNCTION(leak);
@@ -102,6 +103,7 @@ static zend_function_entry builtin_functions[] = {
ZEND_FE(get_parent_class, NULL)
ZEND_FE(method_exists, NULL)
ZEND_FE(class_exists, NULL)
ZEND_FE(interface_exists, NULL)
ZEND_FE(function_exists, NULL)
#if ZEND_DEBUG
ZEND_FE(leak, NULL)
@@ -661,7 +663,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 +675,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 *));
}
}
/* }}} */
@@ -819,11 +850,42 @@ ZEND_FUNCTION(class_exists)
found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce);
free_alloca(lc_name);
RETURN_BOOL(found == SUCCESS);
RETURN_BOOL(found == SUCCESS && !((*ce)->ce_flags & ZEND_ACC_INTERFACE));
}
if (zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC) == SUCCESS) {
RETURN_TRUE;
RETURN_BOOL(((*ce)->ce_flags & ZEND_ACC_INTERFACE) == 0);
} else {
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto bool interface_exists(string classname [, bool autoload])
Checks if the class exists */
ZEND_FUNCTION(interface_exists)
{
char *iface_name, *lc_name;
zend_class_entry **ce;
int iface_name_len;
zend_bool autoload = 1;
int found;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &iface_name, &iface_name_len, &autoload) == FAILURE) {
return;
}
if (!autoload) {
lc_name = do_alloca(iface_name_len + 1);
zend_str_tolower_copy(lc_name, iface_name, iface_name_len);
found = zend_hash_find(EG(class_table), lc_name, iface_name_len+1, (void **) &ce);
free_alloca(lc_name);
RETURN_BOOL(found == SUCCESS && (*ce)->ce_flags & ZEND_ACC_INTERFACE);
}
if (zend_lookup_class(iface_name, iface_name_len, &ce TSRMLS_CC) == SUCCESS) {
RETURN_BOOL(((*ce)->ce_flags & ZEND_ACC_INTERFACE) > 0);
} else {
RETURN_FALSE;
}
+69 -59
View File
@@ -761,6 +761,9 @@ void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC)
opline->opcode += 3;
break;
case BP_VAR_IS:
if (opline->opcode == ZEND_FETCH_DIM_W && opline->op2.op_type == IS_UNUSED) {
zend_error(E_COMPILE_ERROR, "Cannot use [] for reading");
}
opline->opcode += 6; /* 3+3 */
break;
case BP_VAR_FUNC_ARG:
@@ -992,35 +995,37 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
fn_flags |= ZEND_ACC_PUBLIC;
}
short_class_name = do_alloca(short_class_name_length + 1);
zend_str_tolower_copy(short_class_name, CG(active_class_entry)->name, short_class_name_length);
/* Improve after RC: cache the lowercase class name */
if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) {
if (CG(active_class_entry)->constructor) {
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
} else {
if (!(CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE)) {
short_class_name = do_alloca(short_class_name_length + 1);
zend_str_tolower_copy(short_class_name, CG(active_class_entry)->name, short_class_name_length);
/* Improve after RC: cache the lowercase class name */
if ((short_class_name_length == name_len) && (!memcmp(short_class_name, lcname, name_len))) {
if (CG(active_class_entry)->constructor) {
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
} else {
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
}
} else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {
if (CG(active_class_entry)->constructor) {
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
}
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)))) {
CG(active_class_entry)->destructor = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)))) {
CG(active_class_entry)->clone = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
CG(active_class_entry)->__call = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_GET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)))) {
CG(active_class_entry)->__get = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_SET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)))) {
CG(active_class_entry)->__set = (zend_function *) CG(active_op_array);
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
}
} else if ((name_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)))) {
if (CG(active_class_entry)->constructor) {
zend_error(E_STRICT, "Redefining already defined constructor for class %s", CG(active_class_entry)->name);
}
CG(active_class_entry)->constructor = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)))) {
CG(active_class_entry)->destructor = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_CLONE_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CLONE_FUNC_NAME, sizeof(ZEND_CLONE_FUNC_NAME)))) {
CG(active_class_entry)->clone = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_CALL_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)))) {
CG(active_class_entry)->__call = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_GET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)))) {
CG(active_class_entry)->__get = (zend_function *) CG(active_op_array);
} else if ((name_len == sizeof(ZEND_SET_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)))) {
CG(active_class_entry)->__set = (zend_function *) CG(active_op_array);
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
free_alloca(short_class_name);
}
free_alloca(short_class_name);
efree(lcname);
} else {
@@ -1087,16 +1092,26 @@ 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");
if (CG(active_class_entry)) {
zend_check_magic_method_implementation(CG(active_class_entry), (zend_function*)CG(active_op_array), E_COMPILE_ERROR TSRMLS_CC);
} else {
/* 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 (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 +1129,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;
@@ -1298,36 +1309,27 @@ void zend_do_fetch_class_name(znode *result, znode *class_name_entry, znode *cla
result->u.constant.value.str.len = length;
}
void zend_do_begin_class_member_function_call(TSRMLS_D)
void zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC)
{
unsigned char *ptr = NULL;
long fetch_const_op_number = get_next_op_number(CG(active_op_array));
zend_op *last_op = &CG(active_op_array)->opcodes[fetch_const_op_number-1];
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
if (last_op->opcode == ZEND_FETCH_CONSTANT) { /* regular method call */
/* a tmp var is leaked here */
last_op->opcode = ZEND_INIT_STATIC_METHOD_CALL;
if(last_op->op2.op_type == IS_CONST &&
(sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(last_op->op2.u.constant) &&
memcmp(Z_STRVAL(last_op->op2.u.constant), ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) {
zval_dtor(&last_op->op2.u.constant);
SET_UNUSED(last_op->op2);
opline->opcode = ZEND_INIT_STATIC_METHOD_CALL;
opline->op1 = *class_name;
opline->op2 = *method_name;
if (opline->op2.op_type == IS_CONST) {
if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(opline->op2.u.constant) &&
memcmp(Z_STRVAL(opline->op2.u.constant), ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == 0) {
zval_dtor(&opline->op2.u.constant);
SET_UNUSED(opline->op2);
} else {
zend_lowercase_znode_if_const(&last_op->op2);
zend_str_tolower(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len);
}
} else if (last_op->opcode == ZEND_FETCH_R) { /* indirect method call */
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
last_op->op2.u.EA.type = ZEND_FETCH_LOCAL;
opline->opcode = ZEND_INIT_STATIC_METHOD_CALL;
opline->op1 = last_op->op2;
opline->op2 = last_op->result;
} else {
zend_error(E_COMPILE_ERROR, "Internal compiler error - please report!");
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_do_extended_fcall_begin(TSRMLS_C);
}
@@ -1675,9 +1677,11 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
if (!zend_hash_exists(&ce->function_table, lc_class_name, ce->name_length+1)) {
lc_parent_class_name = zend_str_tolower_dup(ce->parent->name, ce->parent->name_length);
if (zend_hash_find(&ce->parent->function_table, lc_parent_class_name, ce->parent->name_length+1, (void **)&function)==SUCCESS) {
/* inherit parent's constructor */
zend_hash_update(&ce->function_table, lc_class_name, ce->name_length+1, function, sizeof(zend_function), NULL);
function_add_ref(function);
if (function->common.fn_flags & ZEND_ACC_CTOR) {
/* inherit parent's constructor */
zend_hash_update(&ce->function_table, lc_class_name, ce->name_length+1, function, sizeof(zend_function), NULL);
function_add_ref(function);
}
}
efree(lc_parent_class_name);
}
@@ -1993,6 +1997,8 @@ void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRML
zend_hash_merge(&ce->constants_table, &parent_ce->constants_table, (void (*)(void *)) zval_add_ref, NULL, sizeof(zval *), 0);
zend_hash_merge_ex(&ce->function_table, &parent_ce->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);
do_inherit_parent_constructor(ce);
zend_verify_abstract_class(ce TSRMLS_CC);
}
@@ -2100,6 +2106,10 @@ ZEND_API zend_class_entry *do_bind_inherited_class(zend_op *opline, HashTable *c
ce = *pce;
}
if (parent_ce->ce_flags & ZEND_ACC_INTERFACE) {
zend_error(E_COMPILE_ERROR, "Class %s cannot extend from interface %s", ce->name, parent_ce->name);
}
zend_do_inheritance(ce, parent_ce TSRMLS_CC);
ce->refcount++;
+2 -1
View File
@@ -375,7 +375,7 @@ void zend_do_clone(znode *result, znode *expr TSRMLS_DC);
void zend_do_begin_dynamic_function_call(znode *function_name TSRMLS_DC);
void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC);
void zend_do_fetch_class_name(znode *result, znode *class_entry, znode *class_name TSRMLS_DC);
void zend_do_begin_class_member_function_call(TSRMLS_D);
void zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC);
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC);
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC);
void zend_do_handle_exception(TSRMLS_D);
@@ -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 */
+1
View File
@@ -55,6 +55,7 @@ typedef unsigned int uint;
#define HAVE_STDARG_H 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
#define HAVE_STRCOLL 1
#define snprintf _snprintf
#define vsnprintf _vsnprintf
+26 -16
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)
@@ -1330,7 +1331,11 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
}
#define RETURN_FROM_EXECUTE_LOOP(execute_data) \
efree(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 */
@@ -1349,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 *) safe_emalloc(sizeof(temp_variable), op_array->T, 0);
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);
@@ -1766,6 +1775,9 @@ static inline int zend_binary_assign_op_helper(int (*binary_op)(zval *result, zv
EX_T(opline->result.u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*EX_T(opline->result.u.var).var.ptr_ptr, &opline->result);
AI_USE_PTR(EX_T(opline->result.u.var).var);
if (increment_opline) {
INC_OPCODE();
}
NEXT_OPCODE();
}
@@ -2777,6 +2789,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));
@@ -2929,21 +2944,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;
@@ -3699,7 +3709,7 @@ int zend_fe_reset_handler(ZEND_OPCODE_HANDLER_ARGS)
if (opline->extended_value) {
array_ptr_ptr = get_zval_ptr_ptr(&opline->op1, EX(Ts), BP_VAR_R);
if (array_ptr_ptr == NULL) {
MAKE_STD_ZVAL(array_ptr);
ALLOC_INIT_ZVAL(array_ptr);
} else if (Z_TYPE_PP(array_ptr_ptr) == IS_OBJECT) {
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
@@ -4025,12 +4035,12 @@ static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HAN
} else if ((*container)->type == IS_STRING) { /* string offsets */
switch (opline->extended_value) {
case ZEND_ISSET:
if (offset->value.lval <= Z_STRLEN_PP(container)) {
if (offset->value.lval < Z_STRLEN_PP(container)) {
result = 1;
}
break;
case ZEND_ISEMPTY:
if (offset->value.lval <= Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
if (offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
result = 1;
}
break;
+5 -2
View File
@@ -208,6 +208,9 @@ void shutdown_executor(TSRMLS_D)
zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator TSRMLS_CC);
zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
zend_hash_graceful_reverse_destroy(&EG(symbol_table));
} zend_catch {
/* if we couldn't destruct cleanly, mark all objects as destructed anyway */
zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
} zend_end_try();
zend_try {
@@ -911,7 +914,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 +935,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;
+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;
+4 -4
View File
@@ -614,12 +614,12 @@ function_call:
T_STRING '(' { $2.u.opline_num = zend_do_begin_function_call(&$1 TSRMLS_CC); }
function_call_parameter_list
')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
| class_constant '(' { zend_do_begin_class_member_function_call(TSRMLS_C); zend_do_extended_fcall_begin(TSRMLS_C); }
| fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
function_call_parameter_list
')' { zend_do_end_function_call(NULL, &$$, &$4, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| static_member '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(TSRMLS_C); zend_do_extended_fcall_begin(TSRMLS_C); }
')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
function_call_parameter_list
')' { zend_do_end_function_call(NULL, &$$, &$4, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
')' { zend_do_end_function_call(NULL, &$$, &$6, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| variable_without_objects '(' { zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call(&$1 TSRMLS_CC); }
function_call_parameter_list ')'
{ zend_do_end_function_call(&$1, &$$, &$4, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
+6 -3
View File
@@ -76,10 +76,13 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
old_exception = EG(exception);
EG(exception) = NULL;
zend_call_method_with_0_params(&obj, object->ce, NULL, "__destruct", NULL);
if (EG(exception)) {
zval_ptr_dtor(&EG(exception));
if (old_exception) {
if (EG(exception)) {
zend_error(E_ERROR, "Ignoring exception from %s::__destruct() while an exception is already active", object->ce->name);
zval_ptr_dtor(&EG(exception));
}
EG(exception) = old_exception;
}
EG(exception) = old_exception;
}
}
+19
View File
@@ -58,6 +58,16 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
}
}
ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC)
{
zend_uint i = 1;
for (i = 1; i < objects->top ; i++) {
if (objects->object_buckets[i].valid) {
objects->object_buckets[i].destructor_called = 1;
}
}
}
ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC)
{
@@ -207,6 +217,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;
+2
View File
@@ -57,6 +57,7 @@ typedef struct _zend_objects_store {
BEGIN_EXTERN_C()
ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size);
ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC);
ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC);
ZEND_API void zend_objects_store_destroy(zend_objects_store *objects);
/* Store API functions */
@@ -68,6 +69,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);
+38 -1
View File
@@ -183,7 +183,15 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
}
#define DVAL_TO_LVAL(d, l) (l) = (d) > LONG_MAX ? (unsigned long) (d) : (long) (d)
#define DVAL_TO_LVAL(d, l) do { \
if ((d) > LONG_MAX) { \
l = LONG_MAX; \
} else if ((d) < LONG_MIN) { \
l = LONG_MIN; \
} else { \
l = (d); \
} \
} while (0)
#define zendi_convert_to_long(op, holder, result) \
if (op==result) { \
@@ -1221,6 +1229,35 @@ ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_D
return SUCCESS;
}
#if HAVE_STRCOLL
ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
int use_copy1, use_copy2;
zend_make_printable_zval(op1, &op1_copy, &use_copy1);
zend_make_printable_zval(op2, &op2_copy, &use_copy2);
if (use_copy1) {
op1 = &op1_copy;
}
if (use_copy2) {
op2 = &op2_copy;
}
result->value.lval = strcoll(op1->value.str.val, op2->value.str.val);
result->type = IS_LONG;
if (use_copy1) {
zval_dtor(op1);
}
if (use_copy2) {
zval_dtor(op2);
}
return SUCCESS;
}
#endif
ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
+5
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' && *str != '.') { /* ignore partial string matches */
return 0;
}
} else {
end_ptr_long=NULL;
@@ -177,6 +179,9 @@ ZEND_API int zval_is_true(zval *op);
ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
#if HAVE_STRCOLL
ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC);
#endif
ZEND_API void zend_str_tolower(char *str, unsigned int length);
ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned int length);
+32 -24
View File
@@ -1356,7 +1356,7 @@ ZEND_METHOD(reflection_function, returnsReference)
}
/* }}} */
/* {{{ proto public ReflectionParameter[] Reflection_Function::getParameters()
/* {{{ proto public ReflectionParameter[] ReflectionFunction::getParameters()
Returns an array of parameter objects for this function */
ZEND_METHOD(reflection_function, getParameters)
{
@@ -1541,7 +1541,7 @@ ZEND_METHOD(reflection_parameter, getName)
}
/* }}} */
/* {{{ proto public ReflectionClass 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)
{
@@ -1879,7 +1879,7 @@ ZEND_METHOD(reflection_method, getModifiers)
}
/* }}} */
/* {{{ proto public ReflectionClass Reflection_Method::getDeclaringClass()
/* {{{ proto public ReflectionClass ReflectionMethod::getDeclaringClass()
Get the declaring class */
ZEND_METHOD(reflection_method, getDeclaringClass)
{
@@ -2134,7 +2134,7 @@ ZEND_METHOD(reflection_class, getDocComment)
}
/* }}} */
/* {{{ proto public ReflectionMethod Reflection_Class::getConstructor()
/* {{{ proto public ReflectionMethod ReflectionClass::getConstructor()
Returns the class' constructor if there is one, NULL otherwise */
ZEND_METHOD(reflection_class, getConstructor)
{
@@ -2152,14 +2152,14 @@ ZEND_METHOD(reflection_class, getConstructor)
}
/* }}} */
/* {{{ proto public ReflectionMethod 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)
{
reflection_object *intern;
zend_class_entry *ce;
zend_function *mptr;
char *name;
char *name, *lc_name;
int name_len;
METHOD_NOTSTATIC;
@@ -2168,11 +2168,15 @@ ZEND_METHOD(reflection_class, getMethod)
}
GET_REFLECTION_OBJECT_PTR(ce);
zend_str_tolower(name, name_len);
if (zend_hash_find(&ce->function_table, name, name_len + 1, (void**) &mptr) == SUCCESS) {
lc_name = zend_str_tolower_dup(name, name_len);
if (zend_hash_find(&ce->function_table, lc_name, name_len + 1, (void**) &mptr) == SUCCESS) {
reflection_method_factory(ce, mptr, return_value TSRMLS_CC);
efree(lc_name);
} else {
RETURN_NULL();
efree(lc_name);
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Method %s does not exist", name);
return;
}
}
/* }}} */
@@ -2195,7 +2199,7 @@ static int _addmethod(zend_function *mptr, int num_args, va_list args, zend_hash
}
/* }}} */
/* {{{ proto public ReflectionMethod[] Reflection_Class::getMethods()
/* {{{ proto public ReflectionMethod[] ReflectionClass::getMethods()
Returns an array of this class' methods */
ZEND_METHOD(reflection_class, getMethods)
{
@@ -2221,7 +2225,7 @@ ZEND_METHOD(reflection_class, getMethods)
}
/* }}} */
/* {{{ proto public ReflectionProperty 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)
{
@@ -2240,7 +2244,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;
}
}
/* }}} */
@@ -2263,7 +2269,7 @@ static int _addproperty(zend_property_info *pptr, int num_args, va_list args, ze
}
/* }}} */
/* {{{ proto public ReflectionProperty[] Reflection_Class::getProperties()
/* {{{ proto public ReflectionProperty[] ReflectionClass::getProperties()
Returns an array of this class' properties */
ZEND_METHOD(reflection_class, getProperties)
{
@@ -2300,6 +2306,7 @@ ZEND_METHOD(reflection_class, getConstants)
METHOD_NOTSTATIC_NUMPARAMS(0);
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
}
/* }}} */
@@ -2320,6 +2327,7 @@ ZEND_METHOD(reflection_class, getConstant)
}
GET_REFLECTION_OBJECT_PTR(ce);
zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
if (zend_hash_find(&ce->constants_table, name, name_len + 1, (void **) &value) == FAILURE) {
RETURN_FALSE;
}
@@ -2383,7 +2391,7 @@ ZEND_METHOD(reflection_class, isFinal)
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);
}
/* }}} */
@@ -2478,7 +2486,7 @@ ZEND_METHOD(reflection_class, newInstance)
}
/* }}} */
/* {{{ proto public ReflectionClass[] Reflection_Class::getInterfaces()
/* {{{ proto public ReflectionClass[] ReflectionClass::getInterfaces()
Returns an array of interfaces this class implements */
ZEND_METHOD(reflection_class, getInterfaces)
{
@@ -2504,7 +2512,7 @@ ZEND_METHOD(reflection_class, getInterfaces)
}
/* }}} */
/* {{{ proto public ReflectionClass Reflection_Class::getParentClass()
/* {{{ proto public ReflectionClass ReflectionClass::getParentClass()
Returns the class' parent class, or, if none exists, FALSE */
ZEND_METHOD(reflection_class, getParentClass)
{
@@ -2541,7 +2549,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;
@@ -2559,7 +2567,7 @@ ZEND_METHOD(reflection_class, isSubclassOf)
/* no break */
default:
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Parameter one must either be a string or a Reflection_Class object");
"Parameter one must either be a string or a ReflectionClass object");
return;
}
@@ -2587,7 +2595,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;
@@ -2605,7 +2613,7 @@ ZEND_METHOD(reflection_class, implementsInterface)
/* no break */
default:
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Parameter one must either be a string or a Reflection_Class object");
"Parameter one must either be a string or a ReflectionClass object");
return;
}
@@ -2632,7 +2640,7 @@ ZEND_METHOD(reflection_class, isIterateable)
}
/* }}} */
/* {{{ proto public ReflectionExtension|NULL Reflection_Class::getExtension()
/* {{{ proto public ReflectionExtension|NULL ReflectionClass::getExtension()
Returns NULL or the extension the class belongs to */
ZEND_METHOD(reflection_class, getExtension)
{
@@ -2953,7 +2961,7 @@ ZEND_METHOD(reflection_property, setValue)
}
/* }}} */
/* {{{ proto public ReflectionClass Reflection_Property::getDeclaringClass()
/* {{{ proto public ReflectionClass ReflectionProperty::getDeclaringClass()
Get the declaring class */
ZEND_METHOD(reflection_property, getDeclaringClass)
{
@@ -3056,7 +3064,7 @@ ZEND_METHOD(reflection_extension, getVersion)
}
/* }}} */
/* {{{ proto public ReflectionFunction[] Reflection_Extension::getFunctions()
/* {{{ proto public ReflectionFunction[] ReflectionExtension::getFunctions()
Returns an array of this extension's fuctions */
ZEND_METHOD(reflection_extension, getFunctions)
{
@@ -3173,7 +3181,7 @@ static int add_extension_class(zend_class_entry **pce, int num_args, va_list arg
/* }}} */
/* {{{ proto public ReflectionClass[] ReflectionExtension::getClasses()
Returns an array containing Reflection_Class objects for all classes of this extension */
Returns an array containing ReflectionClass objects for all classes of this extension */
ZEND_METHOD(reflection_extension, getClasses)
{
reflection_object *intern;
+2 -2
View File
@@ -40,8 +40,8 @@ AC_CONFIG_HEADER(main/php_config.h)
MAJOR_VERSION=5
MINOR_VERSION=0
RELEASE_VERSION=1
EXTRA_VERSION="-dev"
RELEASE_VERSION=2
EXTRA_VERSION=""
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
dnl Define where extension directories are located in the configure context
+7 -2
View File
@@ -102,6 +102,7 @@ PHP_FUNCTION(com_dotnet_create_instance)
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 -1
View File
@@ -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;
+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);
}
+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; \
+11 -1
View File
@@ -220,6 +220,9 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_UNRESTRICTED_AUTH);
REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_EPRT);
REGISTER_CURL_CONSTANT(CURLOPT_HTTP200ALIASES);
REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFMODSINCE);
REGISTER_CURL_CONSTANT(CURL_TIMECOND_IFUNMODSINCE);
REGISTER_CURL_CONSTANT(CURL_TIMECOND_LASTMOD);
#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */
REGISTER_CURL_CONSTANT(CURLOPT_HTTPAUTH);
@@ -231,7 +234,11 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLAUTH_ANY);
REGISTER_CURL_CONSTANT(CURLAUTH_ANYSAFE);
#endif
#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */
REGISTER_CURL_CONSTANT(CURLOPT_PROXYAUTH);
#endif
/* Constants effecting the way CURLOPT_CLOSEPOLICY works */
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC);
@@ -912,6 +919,9 @@ PHP_FUNCTION(curl_setopt)
case CURLOPT_FTP_USE_EPRT:
#if LIBCURL_VERSION_NUM > 0x070a05 /* CURLOPT_HTTPAUTH is available since curl 7.10.6 */
case CURLOPT_HTTPAUTH:
#endif
#if LIBCURL_VERSION_NUM > 0x070a06 /* CURLOPT_PROXYAUTH is available since curl 7.10.7 */
case CURLOPT_PROXYAUTH:
#endif
case CURLOPT_UNRESTRICTED_AUTH:
case CURLOPT_PORT:
+1 -1
View File
@@ -299,7 +299,7 @@ php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename,
curl_easy_setopt(curlstream->curl, CURLOPT_PROGRESSDATA, stream);
curl_easy_setopt(curlstream->curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, "PHP/" PHP_VERSION);
curl_easy_setopt(curlstream->curl, CURLOPT_USERAGENT, FG(user_agent) ? FG(user_agent) : "PHP/" PHP_VERSION);
/* TODO: read cookies and options from context */
+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"
+10
View File
@@ -215,6 +215,11 @@ PHP_FUNCTION(dio_read)
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
if (bytes <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
RETURN_FALSE;
}
data = emalloc(bytes + 1);
res = read(f->fd, data, bytes);
if (res <= 0) {
@@ -244,6 +249,11 @@ PHP_FUNCTION(dio_write)
return;
}
if (trunc_len < 0 || trunc_len > data_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater or equal to zero and less then the length of the specified string.");
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
res = write(f->fd, data, trunc_len ? trunc_len : data_len);
-5
View File
@@ -1,5 +0,0 @@
this module is experimental,
its functions may change their names
or move to extension all together
so do not rely to much on them
you have been warned!
+7 -7
View File
@@ -1016,7 +1016,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name)
php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC);
local = xmlCharStrndup(name, name_len);
dom_namednode_iter(intern, 0, namednode, NULL, local, NULL);
dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC);
}
/* }}} end dom_document_get_elements_by_tag_name */
@@ -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) {
@@ -1216,7 +1216,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC);
local = xmlCharStrndup(name, name_len);
nsuri = xmlCharStrndup(uri, uri_len);
dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri);
dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC);
}
/* }}} end dom_document_get_elements_by_tag_name_ns */
+2 -2
View File
@@ -88,7 +88,7 @@ int dom_documenttype_entities_read(dom_object *obj, zval **retval TSRMLS_DC)
entityht = (xmlHashTable *) doctypep->entities;
intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC);
dom_namednode_iter(obj, XML_ENTITY_NODE, intern, entityht, NULL, NULL);
dom_namednode_iter(obj, XML_ENTITY_NODE, intern, entityht, NULL, NULL TSRMLS_CC);
return SUCCESS;
}
@@ -121,7 +121,7 @@ int dom_documenttype_notations_read(dom_object *obj, zval **retval TSRMLS_DC)
notationht = (xmlHashTable *) doctypep->notations;
intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC);
dom_namednode_iter(obj, XML_NOTATION_NODE, intern, notationht, NULL, NULL);
dom_namednode_iter(obj, XML_NOTATION_NODE, intern, notationht, NULL, NULL TSRMLS_CC);
return SUCCESS;
}
+2 -2
View File
@@ -455,7 +455,7 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name)
php_dom_create_interator(return_value, DOM_NODELIST TSRMLS_CC);
namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC);
local = xmlCharStrndup(name, name_len);
dom_namednode_iter(intern, 0, namednode, NULL, local, NULL);
dom_namednode_iter(intern, 0, namednode, NULL, local, NULL TSRMLS_CC);
}
/* }}} end dom_element_get_elements_by_tag_name */
@@ -777,7 +777,7 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name_ns)
namednode = (dom_object *)zend_objects_get_address(return_value TSRMLS_CC);
local = xmlCharStrndup(name, name_len);
nsuri = xmlCharStrndup(uri, uri_len);
dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri);
dom_namednode_iter(intern, 0, namednode, NULL, local, nsuri TSRMLS_CC);
}
/* }}} end dom_element_get_elements_by_tag_name_ns */
+2 -2
View File
@@ -351,7 +351,7 @@ int dom_node_child_nodes_read(dom_object *obj, zval **retval TSRMLS_DC)
} else {
php_dom_create_interator(*retval, DOM_NODELIST TSRMLS_CC);
intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC);
dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL);
dom_namednode_iter(obj, XML_ELEMENT_NODE, intern, NULL, NULL, NULL TSRMLS_CC);
}
return SUCCESS;
@@ -529,7 +529,7 @@ int dom_node_attributes_read(dom_object *obj, zval **retval TSRMLS_DC)
if (nodep->type == XML_ELEMENT_NODE) {
php_dom_create_interator(*retval, DOM_NAMEDNODEMAP TSRMLS_CC);
intern = (dom_object *)zend_objects_get_address(*retval TSRMLS_CC);
dom_namednode_iter(obj, XML_ATTRIBUTE_NODE, intern, NULL, NULL, NULL);
dom_namednode_iter(obj, XML_ATTRIBUTE_NODE, intern, NULL, NULL, NULL TSRMLS_CC);
} else {
ZVAL_NULL(*retval);
}
+29 -8
View File
@@ -35,6 +35,7 @@
#define PHP_XPTR 2
zend_object_handlers dom_object_handlers;
zend_object_handlers dom_ze1_object_handlers;
static HashTable classes;
@@ -333,7 +334,7 @@ zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC)
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);
php_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_P(zobject)->name);
}
obj->clone(obj->object, &new_object TSRMLS_CC);
@@ -346,11 +347,26 @@ zend_object_value dom_objects_store_clone_obj(zval *zobject TSRMLS_DC)
return retval;
}
zend_object_value dom_objects_ze1_clone_obj(zval *zobject TSRMLS_DC)
{
php_error(E_ERROR, "Cannot clone object of class %s due to 'zend.ze1_compatibility_mode'", Z_OBJCE_P(zobject)->name);
/* Return zobject->value.obj just to satisfy compiler */
return zobject->value.obj;
}
static zend_function_entry dom_functions[] = {
PHP_FE(dom_import_simplexml, NULL)
{NULL, NULL, NULL}
};
static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) {
if (EG(ze1_compatibility_mode)) {
return &dom_ze1_object_handlers;
} else {
return &dom_object_handlers;
}
}
zend_module_entry dom_module_entry = {
STANDARD_MODULE_HEADER,
"dom",
@@ -379,12 +395,17 @@ PHP_MINIT_FUNCTION(dom)
dom_object_handlers.get_property_ptr_ptr = NULL;
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
memcpy(&dom_ze1_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
dom_ze1_object_handlers.read_property = dom_read_property;
dom_ze1_object_handlers.write_property = dom_write_property;
dom_ze1_object_handlers.get_property_ptr_ptr = NULL;
dom_ze1_object_handlers.clone_obj = dom_objects_ze1_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);
@@ -806,7 +827,7 @@ void dom_objects_free_storage(void *object TSRMLS_DC)
}
/* }}} */
void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns)
void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC)
{
dom_nnodemap_object *mapptr;
zval *baseobj = NULL;
@@ -817,7 +838,7 @@ void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xml
baseobj->type = IS_OBJECT;
baseobj->is_ref = 1;
baseobj->value.obj.handle = basenode->handle;
baseobj->value.obj.handlers = &dom_object_handlers;
baseobj->value.obj.handlers = dom_get_obj_handlers(TSRMLS_C);
zval_copy_ctor(baseobj);
}
mapptr->baseobjptr = baseobj;
@@ -897,7 +918,7 @@ zend_object_value dom_objects_new(zend_class_entry *class_type TSRMLS_DC)
retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t)dom_objects_free_storage, dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
retval.handlers = &dom_object_handlers;
retval.handlers = dom_get_obj_handlers(TSRMLS_C);
return retval;
}
@@ -914,7 +935,7 @@ zend_object_value dom_xpath_objects_new(zend_class_entry *class_type TSRMLS_DC)
retval.handle = zend_objects_store_put(intern, NULL, (zend_objects_free_object_storage_t)dom_xpath_objects_free_storage, dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
retval.handlers = &dom_object_handlers;
retval.handlers = dom_get_obj_handlers(TSRMLS_C);
return retval;
}
@@ -978,7 +999,7 @@ zend_object_value dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_D
retval.handle = zend_objects_store_put(intern, dom_nnodemap_object_dtor, (zend_objects_free_object_storage_t)dom_nnodemap_objects_free_storage, dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
retval.handlers = &dom_object_handlers;
retval.handlers = dom_get_obj_handlers(TSRMLS_C);
return retval;
}
@@ -1015,7 +1036,7 @@ zval *php_dom_create_object(xmlNodePtr obj, int *found, zval *wrapper_in, zval *
return_value->type = IS_OBJECT;
return_value->is_ref = 1;
return_value->value.obj.handle = intern->handle;
return_value->value.obj.handlers = &dom_object_handlers;
return_value->value.obj.handlers = dom_get_obj_handlers(TSRMLS_C);
zval_copy_ctor(return_value);
*found = 1;
return return_value;
+1 -1
View File
@@ -104,7 +104,7 @@ int dom_has_feature(char *feature, char *version);
int dom_node_is_read_only(xmlNodePtr node);
int dom_node_children_valid(xmlNodePtr node);
void php_dom_create_interator(zval *return_value, int ce_type TSRMLS_DC);
void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns);
void dom_namednode_iter(dom_object *basenode, int ntype, dom_object *intern, xmlHashTablePtr ht, xmlChar *local, xmlChar *ns TSRMLS_DC);
xmlNodePtr create_notation(const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID);
xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index);
xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index);
+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">
-2
View File
@@ -1,2 +0,0 @@
enchant
Pierre-Alain Joye, Ilia Alshanetsky
-36
View File
@@ -1,36 +0,0 @@
dnl
dnl $Id$
dnl
PHP_ARG_WITH(enchant,for ENCHANT support,
[ --with-enchant[=DIR] Include enchant support.
GNU Aspell version 1.1.3 or higher required.])
if test "$PHP_ENCHANT" != "no"; then
PHP_NEW_EXTENSION(enchant, enchant.c, $ext_shared)
if test "$PHP_ENCHANT" != "yes"; then
ENCHANT_SEARCH_DIRS=$PHP_ENCHANT
else
ENCHANT_SEARCH_DIRS="/usr/local /usr"
fi
for i in $ENCHANT_SEARCH_DIRS; do
if test -f $i/include/enchant/enchant.h; then
ENCHANT_DIR=$i
ENCHANT_INCDIR=$i/include/enchant
elif test -f $i/include/enchant.h; then
ENCHANT_DIR=$i
ENCHANT_INCDIR=$i/include
fi
done
if test -z "$ENCHANT_DIR"; then
AC_MSG_ERROR(Cannot find enchant)
fi
ENCHANT_LIBDIR=$ENCHANT_DIR/lib
AC_DEFINE(HAVE_ENCHANT,1,[ ])
PHP_SUBST(ENCHANT_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(enchant, $ENCHANT_LIBDIR, ENCHANT_SHARED_LIBADD)
PHP_ADD_INCLUDE($ENCHANT_INCDIR)
fi
-9
View File
@@ -1,9 +0,0 @@
// $Id$
// vim:ft=javascript
ARG_ENABLE("enchant", "Enchant Support", "no");
if (PHP_ENCHANT == "yes") {
EXTENSION("enchant", "enchant.c");
AC_DEFINE('HAVE_ENCHANT', 1, 'Have Enchant support', false);
}
-25
View File
@@ -1,25 +0,0 @@
<?php
$tag = 'en_US';
$r = enchant_broker_init();
$bprovides = enchant_broker_describe($r);
echo "Current broker provides the following backend(s):\n";
print_r($bprovides);
if (enchant_broker_dict_exists($r,$tag)) {
$d = enchant_broker_request_dict($r, $tag);
$dprovides = enchant_dict_describe($d);
echo "dictionary $tag provides:\n";
$spellerrors = enchant_dict_check($d, "soong");
print_r($dprovides);
echo "found $spellerrors spell errors\n";
if ($spellerrors) {
$suggs = enchant_dict_suggest($d, "soong");
echo "Suggestions for 'soong':";
print_r($suggs);
}
enchant_broker_free_dict($d);
} else {
}
enchant_broker_free($r);
?>
-731
View File
@@ -1,731 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2004 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Pierre-Alain Joye <paj@pearfr.org> |
| Ilia Alshanetsky <ilia@prohost.org> |
+----------------------------------------------------------------------+
$Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "enchant.h"
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_enchant.h"
typedef EnchantBroker * EnchantBrokerPtr;
typedef struct _broker_struct enchant_broker;
typedef struct _dict_struct enchant_dict;
typedef enchant_broker * enchant_brokerPtr;
typedef enchant_dict * enchant_dictPtr;
typedef struct _broker_struct {
EnchantBroker *pbroker;
enchant_dict **dict;
unsigned int dictcnt;
zval *rsrc_id;
} _enchant_broker;
typedef struct _dict_struct {
unsigned int id;
EnchantDict *pdict;
enchant_broker *pbroker;
zval *rsrc_id;
enchant_dict *next;
enchant_dict *prev;
} _enchant_dict;
/* True global resources - no need for thread safety here */
static int le_enchant_broker;
static int le_enchant_dict;
/* If you declare any globals in php_enchant.h uncomment this:*/
/*ZEND_DECLARE_MODULE_GLOBALS(enchant)*/
/* {{{ enchant_functions[]
*
* Every user visible function must have an entry in enchant_functions[].
*/
function_entry enchant_functions[] = {
PHP_FE(enchant_broker_init, NULL)
PHP_FE(enchant_broker_free, NULL)
PHP_FE(enchant_broker_get_error, NULL)
PHP_FE(enchant_broker_request_dict, NULL)
PHP_FE(enchant_broker_request_pwl_dict, NULL)
PHP_FE(enchant_broker_free_dict, NULL)
PHP_FE(enchant_broker_dict_exists, NULL)
PHP_FE(enchant_broker_set_ordering, NULL)
PHP_FE(enchant_broker_describe, NULL)
PHP_FE(enchant_dict_check, NULL)
PHP_FE(enchant_dict_suggest, NULL)
PHP_FE(enchant_dict_add_to_personal, NULL)
PHP_FE(enchant_dict_add_to_session, NULL)
PHP_FE(enchant_dict_is_in_session, NULL)
PHP_FE(enchant_dict_store_replacement, NULL)
PHP_FE(enchant_dict_get_error, NULL)
PHP_FE(enchant_dict_describe, NULL)
PHP_FE(enchant_dict_quick_check, third_arg_force_ref)
{NULL, NULL, NULL} /* Must be the last line in enchant_functions[] */
};
/* }}} */
/* {{{ enchant_module_entry
*/
zend_module_entry enchant_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"enchant",
enchant_functions,
PHP_MINIT(enchant),
PHP_MSHUTDOWN(enchant),
NULL, /* Replace with NULL if there's nothing to do at request start */
NULL, /* Replace with NULL if there's nothing to do at request end */
PHP_MINFO(enchant),
#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
#endif
STANDARD_MODULE_PROPERTIES
};
/* }}} */
#ifdef COMPILE_DL_ENCHANT
ZEND_GET_MODULE(enchant)
#endif
static void
enumerate_providers_fn (const char * const name,
const char * const desc,
const char * const file,
void * ud)
{
zval *zdesc = (zval *) ud;
zval *tmp_array;
MAKE_STD_ZVAL(tmp_array);
array_init(tmp_array);
add_assoc_string(tmp_array, "name", (char *)name, 1);
add_assoc_string(tmp_array, "desc", (char *)desc, 1);
add_assoc_string(tmp_array, "file", (char *)file, 1);
if (Z_TYPE_P(zdesc)!=IS_ARRAY) {
array_init(zdesc);
}
add_next_index_zval(zdesc, tmp_array);
}
static void
describe_dict_fn (const char * const lang,
const char * const name,
const char * const desc,
const char * const file,
void * ud)
{
zval *zdesc = (zval *) ud;
array_init(zdesc);
add_assoc_string(zdesc, "lang", (char *)lang, 1);
add_assoc_string(zdesc, "name", (char *)name, 1);
add_assoc_string(zdesc, "desc", (char *)desc, 1);
add_assoc_string(zdesc, "file", (char *)file, 1);
}
static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
if (rsrc->ptr) {
enchant_broker *broker = (enchant_broker *)rsrc->ptr;
if (broker) {
if (broker->pbroker) {
if (broker->dictcnt && broker->dict) {
if (broker->dict) {
int total, tofree;
tofree = total = broker->dictcnt-1;
do {
zend_list_delete(Z_RESVAL_P(broker->dict[total]->rsrc_id));
efree(broker->dict[total]);
total--;
} while (total>=0);
}
efree(broker->dict);
broker->dict = NULL;
}
enchant_broker_free(broker->pbroker);
}
efree(broker);
}
}
}
static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
if (rsrc->ptr) {
enchant_dict *pdict = (enchant_dict *)rsrc->ptr;
if (pdict) {
if (pdict->pdict && pdict->pbroker) {
enchant_broker_free_dict(pdict->pbroker->pbroker, pdict->pdict);
}
if (pdict->id) {
pdict->pbroker->dict[pdict->id-1]->next = NULL;
}
}
}
}
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(enchant)
{
le_enchant_broker = zend_register_list_destructors_ex(php_enchant_broker_free, NULL, "enchant broker", module_number);
le_enchant_dict = zend_register_list_destructors_ex(php_enchant_dict_free, NULL, "enchant dict", module_number);
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(enchant)
{
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
static void __enumerate_providers_fn (const char * const name,
const char * const desc,
const char * const file,
void * ud)
{
php_info_print_table_row(3, name, desc, file);
}
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(enchant)
{
EnchantBroker *pbroker;
pbroker = enchant_broker_init();
php_info_print_table_start();
php_info_print_table_header(2, "enchant support", "enabled");
php_info_print_table_row(2, "Version", "@version@");
php_info_print_table_row(2, "Revision", "$Revision$");
php_info_print_table_end();
php_info_print_table_start();
enchant_broker_describe(pbroker, __enumerate_providers_fn, NULL);
php_info_print_table_end();
enchant_broker_free(pbroker);
}
/* }}} */
#define PHP_ENCHANT_GET_BROKER \
ZEND_FETCH_RESOURCE(pbroker, enchant_broker *, &broker, -1, "enchant_broker", le_enchant_broker); \
if (!pbroker || !pbroker->pbroker) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Resource broker invalid"); \
RETURN_FALSE; \
}
#define PHP_ENCHANT_GET_DICT \
ZEND_FETCH_RESOURCE(pdict, enchant_dict *, &dict, -1, "enchant dict", le_enchant_dict); \
if (!pdict || !pdict->pdict) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", "Invalid dictionary resource."); \
RETURN_FALSE; \
}
/* {{{ proto resource enchant_broker_init()
create a new broker object capable of requesting */
PHP_FUNCTION(enchant_broker_init)
{
enchant_broker *broker;
EnchantBroker *pbroker;
if (ZEND_NUM_ARGS()) {
ZEND_WRONG_PARAM_COUNT();
}
pbroker = enchant_broker_init();
if (pbroker) {
broker = (enchant_broker *) emalloc(sizeof(enchant_broker));
broker->pbroker = pbroker;
broker->dict = NULL;
broker->dictcnt = 0;
ZEND_REGISTER_RESOURCE(return_value, broker, le_enchant_broker);
broker->rsrc_id = return_value;
} else {
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto boolean enchant_free(resource broker)
Destroys the broker object and its dictionnaries */
PHP_FUNCTION(enchant_broker_free)
{
zval *broker;
enchant_broker *pbroker;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
zend_list_delete(Z_RESVAL_P(broker));
RETURN_TRUE;
}
/* }}} */
/* {{{ proto string enchant_broker_get_error(resource broker)
Returns the last error of the broker */
PHP_FUNCTION(enchant_broker_get_error)
{
zval *broker;
enchant_broker *pbroker;
char *msg;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
msg = enchant_broker_get_error(pbroker->pbroker);
if (msg) {
RETURN_STRING((char *)msg, 1);
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto resource enchant_broker_request_dict(resource broker, string tag)
create a new dictionary using tag, the non-empty language tag you wish to request
a dictionary for ("en_US", "de_DE", ...) */
PHP_FUNCTION(enchant_broker_request_dict)
{
zval *broker;
enchant_broker *pbroker;
enchant_dict *dict;
EnchantDict *d;
char *tag;
int taglen;
int pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
d = enchant_broker_request_dict(pbroker->pbroker, (const char *)tag);
if (d) {
if (pbroker->dictcnt) {
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
pos = pbroker->dictcnt++;
} else {
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
pos = 0;
pbroker->dictcnt++;
}
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
dict->id = pos;
dict->pbroker = pbroker;
dict->pdict = d;
dict->rsrc_id = return_value;
dict->prev = pos ? pbroker->dict[pos-1] : NULL;
dict->next = NULL;
pbroker->dict[pos] = dict;
if (pos) {
pbroker->dict[pos-1]->next = dict;
}
ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict);
} else {
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto resource enchant_broker_request_pwl_dict(resource dict, string filename)
creates a dictionary using a PWL file. A PWL file is personal word file one word per line.
It must exist before the call.*/
PHP_FUNCTION(enchant_broker_request_pwl_dict)
{
zval *broker;
enchant_broker *pbroker;
enchant_dict *dict;
EnchantDict *d;
char *pwl;
int pwllen;
int pos;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &pwl, &pwllen) == FAILURE) {
RETURN_FALSE;
}
if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl TSRMLS_CC)) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
d = enchant_broker_request_pwl_dict(pbroker->pbroker, (const char *)pwl);
if (d) {
if (pbroker->dictcnt) {
pos = pbroker->dictcnt++;
pbroker->dict = (enchant_dict **)erealloc(pbroker->dict, sizeof(enchant_dict *) * pbroker->dictcnt);
} else {
pbroker->dict = (enchant_dict **)emalloc(sizeof(enchant_dict *));
pos = 0;
pbroker->dictcnt++;
}
dict = pbroker->dict[pos] = (enchant_dict *)emalloc(sizeof(enchant_dict));
dict->id = pos;
dict->pbroker = pbroker;
dict->pdict = d;
dict->rsrc_id = return_value;
dict->prev = pos?pbroker->dict[pos-1]:NULL;
dict->next = NULL;
pbroker->dict[pos] = dict;
if (pos) {
pbroker->dict[pos-1]->next = dict;
}
ZEND_REGISTER_RESOURCE(return_value, dict, le_enchant_dict);
} else {
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto resource enchant_broker_free_dict(resource dict)
Free the dictionary resource */
PHP_FUNCTION(enchant_broker_free_dict)
{
zval *dict;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
zend_list_delete(Z_RESVAL_P(dict));
RETURN_TRUE;
}
/* }}} */
/* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag)
Wether a dictionary exists or not. Using non-empty tag */
PHP_FUNCTION(enchant_broker_dict_exists)
{
zval *broker;
char *tag;
int taglen;
enchant_broker * pbroker;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &broker, &tag, &taglen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
RETURN_BOOL(enchant_broker_dict_exists(pbroker->pbroker, tag));
}
/* }}} */
/* {{{ proto bool enchant_broker_set_ordering(resource broker, string tag, string ordering)
Declares a preference of dictionaries to use for the language
described/referred to by 'tag'. The ordering is a comma delimited
list of provider names. As a special exception, the "*" tag can
be used as a language tag to declare a default ordering for any
language that does not explictly declare an ordering. */
PHP_FUNCTION(enchant_broker_set_ordering)
{
zval *broker;
char *pordering;
int porderinglen;
char *ptag;
int ptaglen;
enchant_broker * pbroker;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &broker, &ptag, &ptaglen, &pordering, &porderinglen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
enchant_broker_set_ordering(pbroker->pbroker, ptag, pordering);
RETURN_TRUE;
}
/* }}} */
/* {{{ proto array enchant_broker_describe(resource broker)
Enumerates the Enchant providers and tells
you some rudimentary information about them. The same info is provided through phpinfo() */
PHP_FUNCTION(enchant_broker_describe)
{
EnchantBrokerDescribeFn describetozval = enumerate_providers_fn;
zval *broker;
enchant_broker * pbroker;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &broker) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_BROKER;
enchant_broker_describe(pbroker->pbroker, describetozval, (void *)return_value);
}
/* }}} */
/* {{{ proto bool enchant_dict_quick_check(resource dict, string word [, array &suggestions])
If the word is correctly spelled return true, otherwise return false, if suggestions variable
is provided, fill it with spelling alternatives. */
PHP_FUNCTION(enchant_dict_quick_check)
{
zval *dict, *sugg = NULL;
char *word;
int wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|z/", &dict, &word, &wordlen, &sugg) == FAILURE) {
RETURN_FALSE;
}
if (sugg) {
zval_dtor(sugg);
}
PHP_ENCHANT_GET_DICT;
if (enchant_dict_check(pdict->pdict, word, wordlen) > 0) {
if (!sugg && ZEND_NUM_ARGS() == 2) {
RETURN_FALSE;
}
int n_sugg;
char **suggs;
array_init(sugg);
suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg);
if (suggs && n_sugg) {
int i;
for (i = 0; i < n_sugg; i++) {
add_next_index_string(sugg, suggs[i], 1);
}
enchant_dict_free_suggestions(pdict->pdict, suggs);
}
RETURN_FALSE;
}
RETURN_TRUE;
}
/* }}} */
/* {{{ proto bool enchant_dict_check(resource dict, string word)
If the word is correctly spelled return true, otherwise return false */
PHP_FUNCTION(enchant_dict_check)
{
zval *dict;
char *word;
int wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
RETURN_BOOL(!enchant_dict_check(pdict->pdict, word, wordlen));
}
/* }}} */
/* {{{ proto array enchant_dict_suggest(resource dict, string word)
Will return a list of values if any of those pre-conditions are not met.*/
PHP_FUNCTION(enchant_dict_suggest)
{
zval *dict;
char *word;
int wordlen;
char **suggs;
enchant_dict *pdict;
int n_sugg;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
suggs = enchant_dict_suggest(pdict->pdict, word, wordlen, &n_sugg);
if (suggs && n_sugg) {
int i;
array_init(return_value);
for (i = 0; i < n_sugg; i++) {
add_next_index_string(return_value, suggs[i], 1);
}
enchant_dict_free_suggestions(pdict->pdict, suggs);
}
}
/* }}} */
/* {{{ proto void enchant_dict_add_to_personal(resource dict, string word)
add 'word' to personal word list */
PHP_FUNCTION(enchant_dict_add_to_personal)
{
zval *dict;
char *word;
int wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
enchant_dict_add_to_personal(pdict->pdict, word, wordlen);
}
/* }}} */
/* {{{ proto void enchant_dict_add_to_session(resource dict, string word)
add 'word' to this spell-checking session */
PHP_FUNCTION(enchant_dict_add_to_session)
{
zval *dict;
char *word;
int wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
enchant_dict_add_to_session(pdict->pdict, word, wordlen);
}
/* }}} */
/* {{{ proto bool enchant_dict_is_in_session(resource dict, string word)
whether or not 'word' exists in this spelling-session */
PHP_FUNCTION(enchant_dict_is_in_session)
{
zval *dict;
char *word;
int wordlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &dict, &word, &wordlen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
RETURN_BOOL(enchant_dict_is_in_session(pdict->pdict, word, wordlen));
}
/* }}} */
/* {{{ proto void enchant_dict_store_replacement(resource dict, string mis, string cor)
add a correction for 'mis' using 'cor'.
Notes that you replaced @mis with @cor, so it's possibly more likely
that future occurrences of @mis will be replaced with @cor. So it might
bump @cor up in the suggestion list.*/
PHP_FUNCTION(enchant_dict_store_replacement)
{
zval *dict;
char *mis, *cor;
int mislen, corlen;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &dict, &mis, &mislen, &cor, &corlen) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
enchant_dict_store_replacement(pdict->pdict, mis, mislen, cor, corlen);
}
/* }}} */
/* {{{ proto string enchant_dict_get_error(resource dict)
Returns the last error of the current spelling-session */
PHP_FUNCTION(enchant_dict_get_error)
{
zval *dict;
enchant_dict *pdict;
char *msg;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
msg = enchant_dict_get_error(pdict->pdict);
if (msg) {
RETURN_STRING((char *)msg, 1);
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto array enchant_dict_describe(resource dict)
Describes an individual dictionary 'dict' */
PHP_FUNCTION(enchant_dict_describe)
{
zval *dict;
enchant_dict *pdict;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &dict) == FAILURE) {
RETURN_FALSE;
}
PHP_ENCHANT_GET_DICT;
enchant_dict_describe(pdict->pdict, describe_dict_fn, (void *)return_value);
}
/* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
-73
View File
@@ -1,73 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE package SYSTEM "../pear/package.dtd">
<package>
<name>enchant</name>
<summary>libenchant binder, support near all spelling tools</summary>
<maintainers>
<maintainer>
<user>pajoye</user>
<name>Pierre-Alain Joye</name>
<email>paj@pearfr.org</email>
<role>lead</role>
</maintainer>
<maintainer>
<user>iliaa</user>
<name>Ilia Alshanetsky</name>
<email>ilia@php.net</email>
<role>developer</role>
</maintainer>
</maintainers>
<description>Enchant is a binder for libenchant. Libenchant provides a common
API for many spell libraries:
- aspell/pspell (intended to replace ispell)
- hspell (hebrew)
- ispell
- myspell (OpenOffice project, mozilla)
- uspell (primarily Yiddish, Hebrew, and Eastern European languages)
A plugin system allows to add custom spell support.
see www.abisource.com/enchant/</description>
<license>PHP</license>
<release>
<state>beta</state>
<version>0.2.1</version>
<date>2004-03-11</date>
<notes>- Fix possible leak in suggestions result
- Move to beta status</notes>
<filelist>
<file role="src" name="config.m4"/>
<file role="src" name="config.w32"/>
<file role="src" name="enchant.c"/>
<file role="src" name="php_enchant.h"/>
<file role="doc" name="CREDITS"/>
<dir name="docs" role="doc">
<dir name="examples">
<file name="example1.php"/>
</dir>
</dir>
</filelist>
<configureoptions>
<configureoption name="with-enchant" default="shared" prompt="libenchant prefix?"/>
</configureoptions>
<deps>
<dep type="php" rel="ge" version="5" />
</deps>
</release>
<changelog>
<release>
<state>alpha</state>
<version>0.2.0</version>
<notes>- Add Ilia Alshanetsky as maintainer
- Cleanup sources codes (ilia)
- Add enchant_dict_quick_check (ilia)</notes>
</release>
<release>
<version>0.1</version>
<state>alpha</state>
<date>2003-03-08</date>
<notes>Initial release</notes>
</release>
</changelog>
</package>
<!--
vim:et:ts=1:sw=1
-->
-80
View File
@@ -1,80 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2003 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Pierre-Alain Joye <paj@pearfr.org> |
+----------------------------------------------------------------------+
$Id$
*/
#ifndef PHP_ENCHANT_H
#define PHP_ENCHANT_H
extern zend_module_entry enchant_module_entry;
#define phpext_enchant_ptr &enchant_module_entry
#ifdef PHP_WIN32
#define PHP_ENCHANT_API __declspec(dllexport)
#else
#define PHP_ENCHANT_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
static void php_enchant_broker_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void php_enchant_dict_free(zend_rsrc_list_entry *rsrc TSRMLS_DC);
PHP_MINIT_FUNCTION(enchant);
PHP_MSHUTDOWN_FUNCTION(enchant);
PHP_MINFO_FUNCTION(enchant);
PHP_FUNCTION(enchant_broker_init);
PHP_FUNCTION(enchant_broker_free);
PHP_FUNCTION(enchant_broker_get_error);
PHP_FUNCTION(enchant_broker_request_dict);
PHP_FUNCTION(enchant_broker_request_pwl_dict);
PHP_FUNCTION(enchant_broker_free_dict);
PHP_FUNCTION(enchant_broker_dict_exists);
PHP_FUNCTION(enchant_broker_set_ordering);
PHP_FUNCTION(enchant_broker_describe);
PHP_FUNCTION(enchant_dict_check);
PHP_FUNCTION(enchant_dict_suggest);
PHP_FUNCTION(enchant_dict_add_to_personal);
PHP_FUNCTION(enchant_dict_add_to_session);
PHP_FUNCTION(enchant_dict_is_in_session);
PHP_FUNCTION(enchant_dict_store_replacement);
PHP_FUNCTION(enchant_dict_get_error);
PHP_FUNCTION(enchant_dict_describe);
PHP_FUNCTION(enchant_dict_quick_check);
#ifdef ZTS
#define ENCHANT_G(v) TSRMG(enchant_globals_id, zend_enchant_globals *, v)
#else
#define ENCHANT_G(v) (enchant_globals.v)
#endif
#endif /* PHP_ENCHANT_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
+7 -7
View File
@@ -270,7 +270,7 @@ sopno stopst;
/* figure out what it matched */
switch (OP(m->g->strip[ss])) {
case OEND:
assert(nope);
assert(PHP_REGEX_NOPE);
break;
case OCHAR:
sp++;
@@ -286,7 +286,7 @@ sopno stopst;
break;
case OBACK_:
case O_BACK:
assert(nope);
assert(PHP_REGEX_NOPE);
break;
/* cases where length of match is hard to find */
case OQUEST_:
@@ -389,7 +389,7 @@ sopno stopst;
case OOR1:
case OOR2:
case O_CH:
assert(nope);
assert(PHP_REGEX_NOPE);
break;
case OLPAREN:
i = OPND(m->g->strip[ss]);
@@ -402,7 +402,7 @@ sopno stopst;
m->pmatch[i].rm_eo = sp - m->offp;
break;
default: /* uh oh */
assert(nope);
assert(PHP_REGEX_NOPE);
break;
}
}
@@ -606,12 +606,12 @@ sopno lev; /* PLUS nesting level */
return(NULL);
break;
default: /* uh oh */
assert(nope);
assert(PHP_REGEX_NOPE);
break;
}
/* "can't happen" */
assert(nope);
assert(PHP_REGEX_NOPE);
/* NOTREACHED */
return((unsigned char *)NULL); /* dummy */
}
@@ -914,7 +914,7 @@ register states aft; /* states already known reachable after */
FWD(aft, aft, 1);
break;
default: /* ooooops... */
assert(nope);
assert(PHP_REGEX_NOPE);
break;
}
}
+1 -1
View File
@@ -16,7 +16,7 @@
#include "utils.h"
#include "regex2.h"
static int nope = 0; /* for use in asserts; shuts lint up */
#define PHP_REGEX_NOPE 0; /* for use in asserts; shuts lint up */
/* macros for manipulating states, small version */
#define states unsigned
-2
View File
@@ -1,2 +0,0 @@
fileinfo
Ilia Alshanetsky
View File
Whitespace-only changes.
-54
View File
@@ -1,54 +0,0 @@
dnl $Id$
dnl config.m4 for extension fileinfo
PHP_ARG_WITH(fileinfo, for fileinfo support,
[ --with-fileinfo=DIR Include fileinfo support])
if test "$PHP_FILEINFO" != "no"; then
SEARCH_PATH="/usr/local /usr"
SEARCH_FOR="/include/magic.h"
if test -r $PHP_FILEINFO/$SEARCH_FOR; then
FILEINFO_DIR=$PHP_FILEINFO
else
AC_MSG_CHECKING([for magic files in default path])
for i in $SEARCH_PATH ; do
if test -r $i/$SEARCH_FOR; then
FILEINFO_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$FILEINFO_DIR"; then
AC_MSG_RESULT([not found])
AC_MSG_ERROR([Please reinstall the libmagic distribution])
fi
PHP_ADD_INCLUDE($FILEINFO_DIR/include)
LIBNAME=magic
LIBSYMBOL=magic_open
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
[
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $FILEINFO_DIR/lib, FILEINFO_SHARED_LIBADD)
AC_DEFINE(HAVE_FILEINFOLIB,1,[ ])
],[
AC_MSG_ERROR([wrong magic lib version or lib not found])
],[
-L$FILEINFO_DIR/lib -lm -ldl
])
MAGIC_MIME_LOCATIONS="/usr/local/share/file/magic /usr/share/file/magic /etc/magic"
for i in $MAGIC_MIME_LOCATIONS; do
if test -f $i; then
PHP_DEFAULT_MAGIC_FILE=$i
break
fi
done
AC_DEFINE_UNQUOTED(PHP_DEFAULT_MAGIC_FILE,"$PHP_DEFAULT_MAGIC_FILE",[magic file path])
PHP_SUBST(FILEINFO_SHARED_LIBADD)
PHP_NEW_EXTENSION(fileinfo, fileinfo.c, $ext_shared)
fi
-433
View File
@@ -1,433 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2004 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Ilia Alshanetsky <ilia@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <magic.h>
/*
* HOWMANY specifies the maximum offset libmagic will look at
* this is currently hardcoded in the libmagic source but not exported
*/
#ifndef HOWMANY
#define HOWMANY 65536
#endif
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/file.h" /* needed for context stuff */
#include "php_fileinfo.h"
#include "fopen_wrappers.h" /* needed for is_url */
struct php_fileinfo {
long options;
struct magic_set *magic;
};
#ifndef PHP_DEFAULT_MAGIC_FILE
#define PHP_DEFAULT_MAGIC_FILE NULL
#endif
#ifdef ZEND_ENGINE_2
static zend_object_handlers finfo_object_handlers;
zend_class_entry *finfo_class_entry;
struct finfo_object {
zend_object zo;
struct php_fileinfo *ptr;
};
#define FILEINFO_DECLARE_INIT_OBJECT(object) \
zval *object = getThis();
#define FILEINFO_REGISTER_OBJECT(_object, _ptr) \
{ \
struct finfo_object *obj; \
obj = (struct finfo_object*)zend_object_store_get_object(_object TSRMLS_CC); \
obj->ptr = _ptr; \
}
#define FILEINFO_FROM_OBJECT(finfo, object) \
{ \
struct finfo_object *obj = zend_object_store_get_object(object TSRMLS_CC); \
finfo = obj->ptr; \
if (!finfo) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The invalid fileinfo object."); \
RETURN_FALSE; \
} \
}
/* {{{ finfo_objects_dtor
*/
static void finfo_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC)
{
struct finfo_object *intern = (struct finfo_object *) object;
if (intern->ptr) {
magic_close(intern->ptr->magic);
efree(intern->ptr);
}
efree(intern);
}
/* }}} */
/* {{{ finfo_objects_new
*/
PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_type TSRMLS_DC)
{
zend_object_value retval;
struct finfo_object *intern;
intern = emalloc(sizeof(struct finfo_object));
intern->zo.ce = class_type;
intern->zo.in_get = 0;
intern->zo.in_set = 0;
intern->zo.properties = NULL;
intern->ptr = NULL;
retval.handle = zend_objects_store_put(intern, finfo_objects_dtor, NULL, NULL TSRMLS_CC);
retval.handlers = (zend_object_handlers *) &finfo_object_handlers;
return retval;
}
/* }}} */
/* {{{ finfo_class_functions
*/
function_entry finfo_class_functions[] = {
ZEND_ME_MAPPING(finfo, finfo_open, NULL)
ZEND_ME_MAPPING(set_flags, finfo_set_flags,NULL)
ZEND_ME_MAPPING(file, finfo_file, NULL)
ZEND_ME_MAPPING(buffer, finfo_buffer, NULL)
{NULL, NULL, NULL}
};
/* }}} */
#else
#define FILEINFO_REGISTER_OBJECT(_object, _ptr) {}
#define FILEINFO_FROM_OBJECT(socket_id, object) {}
#define FILEINFO_DECLARE_INIT_OBJECT(object)
#define object 0
#endif
#define FINFO_SET_OPTION(magic, options) \
if (magic_setflags(magic, options) == -1) { \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to set option '%ld' %d:%s", \
options, magic_errno(magic), magic_error(magic)); \
RETURN_FALSE; \
}
/* True global resources - no need for thread safety here */
static int le_fileinfo;
void finfo_resource_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
if (rsrc->ptr) {
struct php_fileinfo *finfo = (struct php_fileinfo *) rsrc->ptr;
magic_close(finfo->magic);
efree(rsrc->ptr);
rsrc->ptr = NULL;
}
}
/* {{{ fileinfo_functions[]
*/
function_entry fileinfo_functions[] = {
PHP_FE(finfo_open, NULL)
PHP_FE(finfo_close, NULL)
PHP_FE(finfo_set_flags, NULL)
PHP_FE(finfo_file, NULL)
PHP_FE(finfo_buffer, NULL)
{NULL, NULL, NULL}
};
/* }}} */
/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(finfo)
{
#ifdef ZEND_ENGINE_2
zend_class_entry _finfo_class_entry;
INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", finfo_class_functions);
_finfo_class_entry.create_object = finfo_objects_new;
finfo_class_entry = zend_register_internal_class(&_finfo_class_entry TSRMLS_CC);
/* copy the standard object handlers to you handler table */
memcpy(&finfo_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
#endif /* ZEND_ENGINE_2 */
le_fileinfo = zend_register_list_destructors_ex(finfo_resource_destructor, NULL, "file_info", module_number);
REGISTER_LONG_CONSTANT("FILEINFO_NONE", MAGIC_NONE, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILEINFO_SYMLINK", MAGIC_SYMLINK, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILEINFO_MIME", MAGIC_MIME, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILEINFO_COMPRESS", MAGIC_COMPRESS, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILEINFO_DEVICES", MAGIC_DEVICES, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILEINFO_CONTINUE", MAGIC_CONTINUE, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILEINFO_PRESERVE_ATIME", MAGIC_PRESERVE_ATIME, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FILEINFO_RAW", MAGIC_RAW, CONST_CS|CONST_PERSISTENT);
return SUCCESS;
}
/* }}} */
/* {{{ fileinfo_module_entry
*/
zend_module_entry fileinfo_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"fileinfo",
fileinfo_functions,
PHP_MINIT(finfo),
NULL,
NULL,
NULL,
PHP_MINFO(fileinfo),
#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
#endif
STANDARD_MODULE_PROPERTIES
};
/* }}} */
#ifdef COMPILE_DL_FILEINFO
ZEND_GET_MODULE(fileinfo)
#endif
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(fileinfo)
{
php_info_print_table_start();
php_info_print_table_header(2, "fileinfo support", "enabled");
php_info_print_table_end();
}
/* }}} */
/* {{{ proto resource finfo_open([int options [, string arg]])
Create a new fileinfo resource. */
PHP_FUNCTION(finfo_open)
{
long options = MAGIC_NONE;
char *file = PHP_DEFAULT_MAGIC_FILE;
int file_len = 0;
struct php_fileinfo *finfo;
FILEINFO_DECLARE_INIT_OBJECT(object)
char resolved_path[MAXPATHLEN];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &options, &file, &file_len) == FAILURE) {
RETURN_FALSE;
}
if (file_len) { /* user specified filed, perform open_basedir checks */
if (!VCWD_REALPATH(file, resolved_path)) {
RETURN_FALSE;
}
file = resolved_path;
if ((PG(safe_mode) && (!php_checkuid(file, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(file TSRMLS_CC)) {
RETURN_FALSE;
}
}
finfo = emalloc(sizeof(struct php_fileinfo));
finfo->options = options;
finfo->magic = magic_open(options);
if (finfo->magic == NULL) {
efree(finfo);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid mode '%ld'.", options);
RETURN_FALSE;
}
if (magic_load(finfo->magic, file) == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database at '%s'.", file);
efree(finfo);
magic_close(finfo->magic);
RETURN_FALSE;
}
if (object) {
FILEINFO_REGISTER_OBJECT(object, finfo);
} else {
ZEND_REGISTER_RESOURCE(return_value, finfo, le_fileinfo);
}
}
/* }}} */
/* {{{ proto resource finfo_close(resource finfo)
Close fileinfo resource. */
PHP_FUNCTION(finfo_close)
{
struct php_fileinfo *finfo;
zval *zfinfo;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zfinfo) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo);
zend_list_delete(Z_RESVAL_P(zfinfo));
RETURN_TRUE;
}
/* }}} */
/* {{{ proto bool finfo_set_flags(resource finfo, int options)
Set libmagic configuration options. */
PHP_FUNCTION(finfo_set_flags)
{
long options;
struct php_fileinfo *finfo;
zval *zfinfo;
FILEINFO_DECLARE_INIT_OBJECT(object)
if (object) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &options) == FAILURE) {
RETURN_FALSE;
}
FILEINFO_FROM_OBJECT(finfo, object);
} else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zl", &zfinfo, &options) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo);
}
FINFO_SET_OPTION(finfo->magic, options)
finfo->options = options;
RETURN_TRUE;
}
/* }}} */
static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
long options = 0;
char *buffer, *tmp, *ret_val;
int buffer_len;
struct php_fileinfo *finfo;
zval *zfinfo, *zcontext = NULL;
FILEINFO_DECLARE_INIT_OBJECT(object)
if (object) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbz", &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
RETURN_FALSE;
}
FILEINFO_FROM_OBJECT(finfo, object);
} else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|lbz", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) {
RETURN_FALSE;
}
ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo);
}
/* Set options for the current file/buffer. */
if (options) {
FINFO_SET_OPTION(finfo->magic, options)
}
if (mode) { /* file */
/* determine if the file is a local file or remote URL */
char *tmp2;
php_stream_wrapper *wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_DC);
if (wrap && wrap->is_url) {
#ifdef ZEND_ENGINE_2
php_stream_context *context = php_stream_context_from_zval(zcontext, 0);
#else
php_stream_context *context = NULL;
#endif
php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb",
ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
if (!stream) {
RETURN_FALSE;
}
buffer_len = php_stream_copy_to_mem(stream, &tmp, HOWMANY, 0);
php_stream_close(stream);
if (buffer_len == 0) {
RETURN_FALSE;
}
} else { /* local file */
char resolved_path[MAXPATHLEN];
if (!VCWD_REALPATH(buffer, resolved_path)) {
RETURN_FALSE;
}
ret_val = (char *) magic_file(finfo->magic, buffer);
goto common;
}
} else { /* buffer */
tmp = buffer;
}
ret_val = (char *) magic_buffer(finfo->magic, tmp, buffer_len);
if (mode) {
efree(tmp);
}
common:
/* Restore options */
if (options) {
FINFO_SET_OPTION(finfo->magic, finfo->options)
}
if (!ret_val) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed identify data %d:%s",
magic_errno(finfo->magic), magic_error(finfo->magic));
RETURN_FALSE;
} else {
RETURN_STRING(ret_val, 1);
}
}
/* {{{ proto string finfo_file(resource finfo, char *file_name [, int options [, resource context]])
Return information about a file. */
PHP_FUNCTION(finfo_file)
{
_php_finfo_get_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ proto string finfo_buffer(resource finfo, char *string [, int options])
Return infromation about a string buffer. */
PHP_FUNCTION(finfo_buffer)
{
_php_finfo_get_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
-29
View File
@@ -1,29 +0,0 @@
<?php
if(!extension_loaded('fileinfo')) {
dl('fileinfo.' . PHP_SHLIB_SUFFIX);
}
if(!extension_loaded('fileinfo')) {
die("fileinfo extension is not avaliable, please compile it.\n");
}
// normal operation
$res = finfo_open(FILEINFO_MIME); /* return mime type ala mimetype extension */
$files = glob("*");
foreach ($files as $file) {
echo finfo_file($res, $file) . "\n";
}
finfo_close($res);
// OO mode
/*
* FILEINFO_PRESERVE_ATIME - if possible preserve the original access time
* FILEINFO_SYMLINK - follow symlinks
* FILEINFO_DEVICES - look at the contents of blocks or character special devices
* FILEINFO_COMPRESS - decompress compressed files
*/
$fi = new finfo(FILEINFO_PRESERVE_ATIME|FILEINFO_SYMLINK|FILEINFO_DEVICES|FILEINFO_COMPRESS);
$files = glob("*");
foreach ($files as $file) {
echo $fi->buffer(file_get_contents($file)) . "\n";
}
?>
-43
View File
@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE package SYSTEM "../pear/package.dtd">
<package>
<name>Fileinfo</name>
<summary>libmagic bindings</summary>
<maintainers>
<maintainer>
<user>iliaa</user>
<name>Ilia Alshanetsky</name>
<email>ilia@php.net</email>
<role>lead</role>
</maintainer>
</maintainers>
<description>
This extension allows retrieval of information regarding vast majority of file.
This information may include dimensions, quality, length etc...
Additionally it can also be used to retrieve the mime type for a particular
file and for text files proper language encoding.
</description>
<license>PHP</license>
<release>
<state>beta</state>
<version>0.2</version>
<date>2004-05-26</date>
<notes>
Fixed bug that caused PHP to refuse to recognize fileinfo.so.
</notes>
<filelist>
<file role="src" name="config.m4"/>
<file role="src" name="fileinfo.c"/>
<file role="src" name="php_fileinfo.h"/>
<file role="doc" name="CREDITS"/>
<file role="doc" name="EXPERIMENTAL"/>
<file role="doc" name="fileinfo.php"/>
</filelist>
<deps>
</deps>
</release>
</package>
<!--
vim:et:ts=1:sw=1
-->
-61
View File
@@ -1,61 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2004 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Ilia Alshanetsky <ilia@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef PHP_FILEINFO_H
#define PHP_FILEINFO_H
extern zend_module_entry fileinfo_module_entry;
#define phpext_fileinfo_ptr &fileinfo_module_entry
#ifdef PHP_WIN32
#define PHP_FILEINFO_API __declspec(dllexport)
#else
#define PHP_FILEINFO_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
PHP_MINFO_FUNCTION(fileinfo);
PHP_FUNCTION(finfo_open);
PHP_FUNCTION(finfo_close);
PHP_FUNCTION(finfo_set_flags);
PHP_FUNCTION(finfo_file);
PHP_FUNCTION(finfo_buffer);
#ifdef ZTS
#define FILEINFO_G(v) TSRMG(fileinfo_globals_id, zend_fileinfo_globals *, v)
#else
#define FILEINFO_G(v) (fileinfo_globals.v)
#endif
#endif /* PHP_FILEINFO_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
+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 \
+10 -5
View File
@@ -35,6 +35,7 @@
#include "SAPI.h"
#include "php_gd.h"
#include "ext/standard/info.h"
#include "php_open_temporary_file.h"
#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
@@ -115,6 +116,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 +458,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 +1348,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 +1380,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 +1535,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;
@@ -1763,7 +1768,7 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char
FILE *tmp;
char buf[4096];
tmp = tmpfile();
tmp = php_open_temporary_file("", "", NULL TSRMLS_CC);
if (tmp == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file");
RETURN_FALSE;
+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
+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",
+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");
}
}
}
+59 -24
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;
@@ -2441,7 +2457,7 @@ static size_t php_iconv_stream_filter_append_bucket(
while (icnt > 0) {
if ((ps == NULL ? iconv(self->cd, NULL, NULL, &pd, &ocnt):
iconv(self->cd, &ps, &icnt, &pd, &ocnt)) == (size_t)-1) {
iconv(self->cd, (char **)&ps, &icnt, &pd, &ocnt)) == (size_t)-1) {
#if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EILSEQ:
@@ -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
-103
View File
@@ -1,103 +0,0 @@
#ifndef _INCLUDED_IMAP_H
#define _INCLUDED_IMAP_H
#if COMPILE_DL
#undef HAVE_IMAP
#define HAVE_IMAP 1
#endif
#if HAVE_IMAP
#ifndef PHP_WIN32
#include "build-defs.h"
#endif
/* Functions accessable to PHP */
extern zend_module_entry imap_module_entry;
#define imap_module_ptr &imap_module_entry
extern PHP_MINIT_FUNCTION(imap);
extern PHP_RINIT_FUNCTION(imap);
extern PHP_RSHUTDOWN_FUNCTION(imap);
PHP_MINFO_FUNCTION(imap);
PHP_FUNCTION(imap_open);
PHP_FUNCTION(imap_popen);
PHP_FUNCTION(imap_reopen);
PHP_FUNCTION(imap_num_msg);
PHP_FUNCTION(imap_num_recent);
PHP_FUNCTION(imap_headers);
PHP_FUNCTION(imap_headerinfo);
PHP_FUNCTION(imap_rfc822_parse_headers);
PHP_FUNCTION(imap_body);
PHP_FUNCTION(imap_fetchstructure);
PHP_FUNCTION(imap_fetchbody);
PHP_FUNCTION(imap_expunge);
PHP_FUNCTION(imap_delete);
PHP_FUNCTION(imap_undelete);
PHP_FUNCTION(imap_check);
PHP_FUNCTION(imap_close);
PHP_FUNCTION(imap_mail_copy);
PHP_FUNCTION(imap_mail_move);
PHP_FUNCTION(imap_createmailbox);
PHP_FUNCTION(imap_renamemailbox);
PHP_FUNCTION(imap_deletemailbox);
PHP_FUNCTION(imap_listmailbox);
PHP_FUNCTION(imap_scanmailbox);
PHP_FUNCTION(imap_subscribe);
PHP_FUNCTION(imap_unsubscribe);
PHP_FUNCTION(imap_append);
PHP_FUNCTION(imap_ping);
PHP_FUNCTION(imap_base64);
PHP_FUNCTION(imap_qprint);
PHP_FUNCTION(imap_8bit);
PHP_FUNCTION(imap_binary);
PHP_FUNCTION(imap_mailboxmsginfo);
PHP_FUNCTION(imap_rfc822_write_address);
PHP_FUNCTION(imap_rfc822_parse_adrlist);
PHP_FUNCTION(imap_setflag_full);
PHP_FUNCTION(imap_clearflag_full);
PHP_FUNCTION(imap_sort);
PHP_FUNCTION(imap_fetchheader);
PHP_FUNCTION(imap_fetchtext);
PHP_FUNCTION(imap_uid);
PHP_FUNCTION(imap_msgno);
PHP_FUNCTION(imap_list);
PHP_FUNCTION(imap_list_full);
PHP_FUNCTION(imap_listscan);
PHP_FUNCTION(imap_lsub);
PHP_FUNCTION(imap_lsub_full);
PHP_FUNCTION(imap_create);
PHP_FUNCTION(imap_rename);
PHP_FUNCTION(imap_status);
PHP_FUNCTION(imap_bodystruct);
PHP_FUNCTION(imap_fetch_overview);
PHP_FUNCTION(imap_mail_compose);
PHP_FUNCTION(imap_alerts);
PHP_FUNCTION(imap_errors);
PHP_FUNCTION(imap_last_error);
PHP_FUNCTION(imap_mail);
PHP_FUNCTION(imap_search);
PHP_FUNCTION(imap_utf8);
PHP_FUNCTION(imap_utf7_decode);
PHP_FUNCTION(imap_utf7_encode);
PHP_FUNCTION(imap_mime_header_decode);
#else
#define imap_module_ptr NULL
#endif /* HAVE_IMAP */
#endif
#define phpext_imap_ptr imap_module_ptr
+26 -24
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);
}
+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%");
+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');
}
}
+42 -8
View File
@@ -253,15 +253,18 @@ int php_libxml_streams_IO_match_wrapper(const char *filename)
void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode, const int read_only)
{
char resolved_path[MAXPATHLEN + 1];
php_stream_statbuf ssbuf;
php_stream_context *context = NULL;
php_stream_wrapper *wrapper = NULL;
char *path_to_open = NULL;
char *resolved_path, *path_to_open = NULL;
void *ret_val = NULL;
TSRMLS_FETCH();
xmlURIUnescapeString(filename, 0, resolved_path);
path_to_open = resolved_path;
resolved_path = xmlURIUnescapeString(filename, 0, NULL);
if (resolved_path == NULL) {
return NULL;
}
/* logic copied from _php_stream_stat, but we only want to fail
if the wrapper supports stat, otherwise, figure it out from
@@ -272,15 +275,20 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode,
wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, ENFORCE_SAFE_MODE TSRMLS_CC);
if (wrapper && read_only && wrapper->wops->url_stat) {
if (wrapper->wops->url_stat(wrapper, path_to_open, 0, &ssbuf, NULL TSRMLS_CC) == -1) {
xmlFree(resolved_path);
return NULL;
}
}
if (LIBXML(stream_context)) {
context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context());
return php_stream_open_wrapper_ex((char *)resolved_path, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context);
ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context);
xmlFree(resolved_path);
return ret_val;
}
return php_stream_open_wrapper((char *)resolved_path, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
ret_val = php_stream_open_wrapper(path_to_open, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL);
xmlFree(resolved_path);
return ret_val;
}
void *php_libxml_streams_IO_open_read_wrapper(const char *filename)
@@ -377,7 +385,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);
@@ -497,6 +505,32 @@ PHP_FUNCTION(libxml_set_streams_context)
/* {{{ Common functions shared by extensions */
int php_libxml_xmlCheckUTF8(const unsigned char *s)
{
int i;
unsigned char c;
for (i = 0; (c = s[i++]);) {
if ((c & 0x80) == 0) {
} else if ((c & 0xe0) == 0xc0) {
if ((s[i++] & 0xc0) != 0x80) {
return 0;
}
} else if ((c & 0xf0) == 0xe0) {
if ((s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80) {
return 0;
}
} else if ((c & 0xf8) == 0xf0) {
if ((s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80) {
return 0;
}
} else {
return 0;
}
}
return 1;
}
int php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function)
{
php_libxml_func_handler export_hnd;
@@ -568,7 +602,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);
+2 -1
View File
@@ -77,9 +77,10 @@ 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, ...);
PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
#endif /* HAVE_LIBXML */
+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
+1
View File
@@ -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])
+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.
+1 -1
View File
@@ -47,7 +47,7 @@ PHP_ARG_WITH(mnogosearch,for mnoGoSearch support,
AC_DEFINE(HAVE_MNOGOSEARCH,1,[ ])
PHP_SUBST(MNOGOSEARCH_SHARED_LIBADD)
PHP_NEW_EXTENSION(mnogosearch, php_mnogo.c, $ext_shared)
PHP_SUBST(MNOGOSEARCH_SHARED_LIBADD)
fi
+14 -15
View File
@@ -430,7 +430,7 @@ DLEXPORT PHP_MINFO_FUNCTION(mnogosearch)
static char* MyRemoveHiLightDup(const char *s){
size_t len=strlen(s)+1;
char *d, *res = (char*)UdmMalloc(len);
char *d, *res = (char*)emalloc(len);
for(d=res; s[0]; s++)
{
@@ -1625,7 +1625,7 @@ 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);
@@ -1777,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 {
@@ -1839,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) {
@@ -1885,7 +1884,7 @@ DLEXPORT PHP_FUNCTION(udm_store_doc_cgi)
UdmResultFree(Res);
UdmDocFree(Doc);
UDM_FREE(HDoc);
efree(HDoc);
RETURN_TRUE;
}
@@ -2066,7 +2065,7 @@ 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);
}
@@ -2256,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';
@@ -2270,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
@@ -2286,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';
@@ -2305,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;
@@ -2489,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;
}
@@ -2513,7 +2512,7 @@ DLEXPORT PHP_FUNCTION(udm_cat_list)
c++;
}
#endif
free(buf);
efree(buf);
} else {
RETURN_FALSE;
}
@@ -2563,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;
}
@@ -2587,7 +2586,7 @@ DLEXPORT PHP_FUNCTION(udm_cat_path)
c++;
}
#endif
free(buf);
efree(buf);
} else {
RETURN_FALSE;
}
+1 -1
View File
@@ -46,7 +46,7 @@ if test "$PHP_MYSQLI" != "no"; then
AC_DEFINE(HAVE_MYSQLILIB,1,[ ])
PHP_CHECK_LIBRARY(mysqlclient, mysql_stmt_field_count,
[ ],[
AC_MSG_ERROR([MySQLI doesn't support versions < 4.1.3 anymore. Please update your libraries.])
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.])
+86 -79
View File
@@ -107,16 +107,11 @@ void php_clear_stmt_bind(MY_STMT *stmt)
/* {{{ php_clear_mysql */
void php_clear_mysql(MY_MYSQL *mysql) {
int i;
for (i=0; i < 3; i++) {
if (&mysql->callback_func[i]) {
zval_dtor(&mysql->callback_func[i]);
}
}
if (mysql->local_infile) {
zval_ptr_dtor(&mysql->local_infile);
if (mysql->li_read) {
printf("freeing...\n");
efree(Z_STRVAL_P(mysql->li_read));
FREE_ZVAL(mysql->li_read);
mysql->li_read = NULL;
}
}
/* }}} */
@@ -200,6 +195,24 @@ 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 mysqli object is still valid */
if (!strcmp(obj->zo.ce->name, "mysqli")) {
if (!obj->ptr ||
!((MYSQL *)((MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->mysql)->thread_id) {
retval = EG(uninitialized_zval_ptr);
return(retval);
}
} else
/* check if stmt object is still valid */
if (!strcmp(obj->zo.ce->name, "mysqli_stmt")) {
if (!obj->ptr ||
!((MYSQL_STMT *)((MY_STMT *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr)->stmt)->mysql) {
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 */
@@ -273,7 +286,7 @@ 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) {
if (obj->zo.ce != mysqli_link_class_entry) {
return obj->zo.ce->constructor;
} else {
static zend_internal_function f;
@@ -431,6 +444,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);
@@ -443,6 +457,14 @@ PHP_MINIT_FUNCTION(mysqli)
/* for mysqli_stmt_set_attr */
REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH", STMT_ATTR_UPDATE_MAX_LENGTH, CONST_CS | CONST_PERSISTENT);
#ifdef STMT_ATTR_CURSOR_TYPE
REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_CURSOR_TYPE", STMT_ATTR_CURSOR_TYPE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_NO_CURSOR", CURSOR_TYPE_NO_CURSOR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_READ_ONLY", CURSOR_TYPE_READ_ONLY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_FOR_UPDATE", CURSOR_TYPE_FOR_UPDATE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_SCROLLABLE", CURSOR_TYPE_SCROLLABLE, CONST_CS | CONST_PERSISTENT);
#endif
/* column information */
REGISTER_LONG_CONSTANT("MYSQLI_NOT_NULL_FLAG", NOT_NULL_FLAG, CONST_CS | CONST_PERSISTENT);
@@ -594,7 +616,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
}
fetchtype = override_flags;
} else {
fetchtype = MYSQLI_NUM;
fetchtype = MYSQLI_BOTH;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) {
return;
}
@@ -747,15 +769,23 @@ if (a) {\
memset(source, 0, LOCAL_INFILE_ERROR_LEN);\
memcpy(source, dest, LOCAL_INFILE_ERROR_LEN-1);
/* {{{ void php_set_local_infile_handler_default
*/
void php_set_local_infile_handler_default(MY_MYSQL *mysql) {
/* register internal callback functions */
mysql_set_local_infile_handler(mysql->mysql, &php_local_infile_init, &php_local_infile_read,
&php_local_infile_end, &php_local_infile_error, (void *)mysql);
mysql->li_read = NULL;
}
/* }}} */
/* {{{ php_local_infile_init
*/
int php_local_infile_init(void **ptr, const char *filename, void *userdata)
{
mysqli_local_infile *data;
MY_MYSQL *mysql;
zval ***callback_args;
int argc = 2;
int i, rc = 0;
php_stream_context *context = NULL;
TSRMLS_FETCH();
@@ -764,45 +794,28 @@ int php_local_infile_init(void **ptr, const char *filename, void *userdata)
return 1;
}
if (!(mysql = data->userdata = userdata)) {
if (!(mysql = (MY_MYSQL *)userdata)) {
LOCAL_INFILE_ERROR_MSG(data->error_msg, ER(CR_UNKNOWN_ERROR));
return 1;
}
ALLOC_CALLBACK_ARGS(callback_args, 0, argc);
ZVAL_STRING(*callback_args[0], (char *)filename, 1);
ZVAL_STRING(*callback_args[1], "", 1);
if (call_user_function_ex(EG(function_table),
NULL,
&mysql->callback_func[0],
&mysql->local_infile,
argc,
callback_args,
0,
NULL TSRMLS_CC) == SUCCESS) {
/* check if user callback function returned a valid filehandle */
convert_to_string_ex(callback_args[1]);
if (Z_TYPE_P(mysql->local_infile) != IS_RESOURCE) {
if (!strlen(Z_STRVAL_P(*callback_args[1]))) {
LOCAL_INFILE_ERROR_MSG(data->error_msg, ER(CR_UNKNOWN_ERROR));
} else {
LOCAL_INFILE_ERROR_MSG(data->error_msg, Z_STRVAL_P(*callback_args[1]));
}
rc = 1;
} else {
/* check open_basedir */
if (PG(open_basedir)) {
if (php_check_open_basedir_ex(filename, 0 TSRMLS_CC) == -1) {
LOCAL_INFILE_ERROR_MSG(data->error_msg, "open_basedir restriction in effect. Unable to open file");
return 1;
}
} else {
LOCAL_INFILE_ERROR_MSG(data->error_msg, "Can't execute load data local init callback function");
rc = 1;
}
FREE_CALLBACK_ARGS(callback_args, 0, argc);
mysql->li_stream = php_stream_open_wrapper_ex((char *)filename, "r", 0, NULL, context);
return rc;
if (mysql->li_stream == NULL) {
return 1;
}
data->userdata = mysql;
return 0;
}
/* }}} */
@@ -811,7 +824,8 @@ int php_local_infile_read(void *ptr, char *buf, uint buf_len)
mysqli_local_infile *data;
MY_MYSQL *mysql;
zval ***callback_args;
zval *retval;
zval *retval;
zval *fp;
int argc = 4;
int i;
long rc;
@@ -819,21 +833,35 @@ int php_local_infile_read(void *ptr, char *buf, uint buf_len)
TSRMLS_FETCH();
data= (mysqli_local_infile *)ptr;
mysql = data->userdata;
/* default processing */
if (!mysql->li_read) {
int count;
count = (int)php_stream_read(mysql->li_stream, buf, buf_len);
if (count < 0) {
LOCAL_INFILE_ERROR_MSG(data->error_msg, ER(2));
}
return count;
}
ALLOC_CALLBACK_ARGS(callback_args, 1, argc);
/* set parameters: filepointer, buffer, buffer_len, errormsg */
callback_args[0] = &mysql->local_infile;
MAKE_STD_ZVAL(fp);
php_stream_to_zval(mysql->li_stream, fp);
callback_args[0] = &fp;
ZVAL_STRING(*callback_args[1], "", 1);
ZVAL_LONG(*callback_args[2], buf_len);
ZVAL_STRING(*callback_args[3], "", 1);
if (call_user_function_ex(EG(function_table),
NULL,
&mysql->callback_func[1],
mysql->li_read,
&retval,
argc,
callback_args,
@@ -861,6 +889,7 @@ int php_local_infile_read(void *ptr, char *buf, uint buf_len)
}
FREE_CALLBACK_ARGS(callback_args, 1, argc);
efree(fp);
return rc;
}
@@ -869,6 +898,7 @@ int php_local_infile_read(void *ptr, char *buf, uint buf_len)
int php_local_infile_error(void *ptr, char *error_msg, uint error_msg_len)
{
mysqli_local_infile *data = (mysqli_local_infile *) ptr;
if (data) {
strcpy(error_msg, data->error_msg);
return 2000;
@@ -884,42 +914,19 @@ void php_local_infile_end(void *ptr)
{
mysqli_local_infile *data;
MY_MYSQL *mysql;
zval ***callback_args;
zval *retval;
int argc = 1;
int i;
TSRMLS_FETCH();
data= (mysqli_local_infile *)ptr;
mysql = data->userdata;
ALLOC_CALLBACK_ARGS(callback_args, 1, argc);
/* set parameters: filepointer, buffer, buffer_len, errormsg */
callback_args[0] = &mysql->local_infile;
call_user_function_ex(EG(function_table),
NULL,
&mysql->callback_func[2],
&retval,
argc,
callback_args,
0,
NULL TSRMLS_CC);
if (retval) {
zval_ptr_dtor(&retval);
if (!(mysql = data->userdata)) {
efree(data);
return;
}
if (mysql->local_infile) {
zval_ptr_dtor(&mysql->local_infile);
}
FREE_CALLBACK_ARGS(callback_args, 1, argc);
// efree(data);
php_stream_close(mysql->li_stream);
//efree(data);
return;
}
/* }}} */
+31 -35
View File
@@ -258,7 +258,6 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
for (i=start; i < var_cnt + start ; i++) {
ofs = i - start;
stmt->result.is_null[ofs] = 0;
col_type = (stmt->stmt->fields) ? stmt->stmt->fields[ofs].type : MYSQL_TYPE_STRING;
switch (col_type) {
@@ -406,7 +405,7 @@ PHP_FUNCTION(mysqli_close)
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
mysql_close(mysql->mysql);
php_clear_mysql(mysql);
MYSQLI_CLEAR_RESOURCE(&mysql_link);
RETURN_TRUE;
}
@@ -629,7 +628,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:
@@ -906,7 +905,7 @@ PHP_FUNCTION(mysqli_get_host_info)
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
RETURN_STRING((mysql->mysql->host_info) ? mysql->mysql->host_info : empty_string, 1);
RETURN_STRING((mysql->mysql->host_info) ? mysql->mysql->host_info : "", 1);
}
/* }}} */
@@ -971,7 +970,7 @@ PHP_FUNCTION(mysqli_info)
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
RETURN_STRING((mysql->mysql->info) ? mysql->mysql->info : empty_string, 1);
RETURN_STRING((mysql->mysql->info) ? mysql->mysql->info : "", 1);
}
/* }}} */
@@ -1036,7 +1035,6 @@ PHP_FUNCTION(mysqli_set_local_infile_default)
{
MY_MYSQL *mysql;
zval *mysql_link;
int i;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
return;
@@ -1044,52 +1042,41 @@ PHP_FUNCTION(mysqli_set_local_infile_default)
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
for (i=0; i < 3; i++) {
if (&mysql->callback_func[i]) {
zval_dtor(&mysql->callback_func[i]);
}
if (mysql->li_read) {
efree(Z_STRVAL_P(mysql->li_read));
zval_dtor(mysql->li_read);
mysql->li_read = NULL;
}
mysql_set_local_infile_default(mysql->mysql);
}
/* }}} */
/* {{{ proto bool mysqli_set_local_infile_handler(object link, callback init_func,
callback read_func, callback end_func)
/* {{{ proto bool mysqli_set_local_infile_handler(object link, callback read_func)
Set callback functions for LOAD DATA LOCAL INFILE */
PHP_FUNCTION(mysqli_set_local_infile_handler)
{
MY_MYSQL *mysql;
zval *mysql_link;
char *callback_name;
zval *callback_func[4];
int i;
zval *callback_func;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ozzzz", &mysql_link, mysqli_link_class_entry,
&callback_func[0], &callback_func[1], &callback_func[2], &callback_func[3]) == FAILURE) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz", &mysql_link, mysqli_link_class_entry,
&callback_func) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link");
/* check callback functions */
for (i=0; i < 3; i++) {
if (!zend_is_callable(callback_func[i], 0, &callback_name)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a valid callback function %s", callback_name);
efree(callback_name);
RETURN_FALSE;
}
/* check callback function */
if (!zend_is_callable(callback_func, 0, &callback_name)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a valid callback function %s", callback_name);
efree(callback_name);
RETURN_FALSE;
}
efree(callback_name);
/* save callback functions */
for (i=0; i < 3; i++) {
ZVAL_STRING(&mysql->callback_func[i], callback_func[i]->value.str.val, 1);
}
/* register internal callback functions */
mysql_set_local_infile_handler(mysql->mysql, &php_local_infile_init, &php_local_infile_read,
&php_local_infile_end, &php_local_infile_error, (void *)mysql);
/* save callback function */
ALLOC_ZVAL(mysql->li_read);
ZVAL_STRING(mysql->li_read, callback_func->value.str.val, 1);
}
/* }}} */
@@ -1243,6 +1230,12 @@ PHP_FUNCTION(mysqli_prepare)
if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) {
if (mysql_stmt_prepare(stmt->stmt, query, query_len)) {
if (stmt->stmt->last_errno) {
/* if we close the statement handle, we have to copy the errors to connection handle */
mysql->mysql->net.last_errno = stmt->stmt->last_errno;
strcpy(mysql->mysql->net.last_error, stmt->stmt->last_error);
strcpy(mysql->mysql->net.sqlstate, stmt->stmt->sqlstate);
}
mysql_stmt_close(stmt->stmt);
stmt->stmt = NULL;
}
@@ -1318,6 +1311,9 @@ PHP_FUNCTION(mysqli_real_connect)
php_mysqli_set_error(mysql_errno(mysql->mysql), (char *)mysql_error(mysql->mysql) TSRMLS_CC);
mysql->mysql->reconnect = MyG(reconnect);
/* set our own local_infile handler */
php_set_local_infile_handler_default(mysql);
if (object) {
((mysqli_object *) zend_object_store_get_object(object TSRMLS_CC))->valid = 1;
@@ -1720,7 +1716,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
if (rc = mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode)) {
if ((rc = mysql_stmt_attr_set(stmt->stmt, attr, (void *)&mode))) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -1742,7 +1738,7 @@ PHP_FUNCTION(mysqli_stmt_attr_get)
}
MYSQLI_FETCH_RESOURCE(stmt, MY_STMT *, &mysql_stmt, "mysqli_stmt");
if (rc = mysql_stmt_attr_get(stmt->stmt, attr, &value)) {
if ((rc = mysql_stmt_attr_get(stmt->stmt, attr, &value))) {
RETURN_FALSE;
}
RETURN_LONG(value);
+1
View File
@@ -203,6 +203,7 @@ function_entry mysqli_link_methods[] = {
PHP_FALIAS(master_query,mysqli_master_query,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)
+3 -2
View File
@@ -40,7 +40,6 @@ PHP_FUNCTION(mysqli_connect)
unsigned int hostname_len, username_len, passwd_len, dbname_len, socket_len;
long port=0;
if (getThis() && !ZEND_NUM_ARGS()) {
RETURN_NULL();
}
@@ -90,6 +89,9 @@ PHP_FUNCTION(mysqli_connect)
mysql->mysql->reconnect = MyG(reconnect);
/* set our own local_infile handler */
php_set_local_infile_handler_default(mysql);
mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE));
mysqli_resource->ptr = (void *)mysql;
@@ -247,7 +249,6 @@ PHP_FUNCTION(mysqli_query)
RETURN_FALSE;
}
if (!mysql_field_count(mysql->mysql)) {
if (MyG(report_mode) & MYSQLI_REPORT_INDEX) {
php_mysqli_report_index(query, mysql->mysql->server_status TSRMLS_CC);
+10
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);
@@ -191,6 +200,7 @@ MYSQLI_MAP_PROPERTY_FUNC_STRING(stmt_sqlstate_read, mysql_stmt_sqlstate, MYSQLI_
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},
+5 -4
View File
@@ -53,9 +53,8 @@ typedef struct {
typedef struct {
MYSQL *mysql;
/* callback functions for load data local infile support */
zval callback_func[3];
zval *local_infile;
zval *li_read;
php_stream *li_stream;
} MY_MYSQL;
typedef struct {
@@ -112,6 +111,7 @@ extern mysqli_property_entry mysqli_stmt_property_entries[];
extern void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flag, int into_object);
extern void php_clear_stmt_bind(MY_STMT *stmt);
void php_clear_mysql(MY_MYSQL *);
extern void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type);
extern void php_mysqli_report_error(char *sqlstate, int errorno, char *error TSRMLS_DC);
extern void php_mysqli_report_index(char *query, unsigned int status TSRMLS_DC);
@@ -119,6 +119,7 @@ extern int php_local_infile_init(void **, const char *, void *);
extern int php_local_infile_read(void *, char *, uint);
extern void php_local_infile_end(void *);
extern int php_local_infile_error(void *, char *, uint);
extern void php_set_local_infile_handler_default(MY_MYSQL *);
zend_class_entry *mysqli_link_class_entry;
zend_class_entry *mysqli_stmt_class_entry;
@@ -180,7 +181,7 @@ PHP_MYSQLI_EXPORT(zend_object_value) mysqli_objects_new(zend_class_entry * TSRML
} \
__ptr = (__type)my_res->ptr; \
if (!strcmp((char *)__name, "mysqli_stmt")) {\
if (!((MYSQL_STMT *)__ptr)->mysql) {\
if (!((MY_STMT *)__ptr)->stmt->mysql) {\
php_error(E_WARNING, "Statement isn't valid anymore");\
RETURN_NULL();\
}\
+1
View File
@@ -0,0 +1 @@
foo;bar
1 foo bar
+39
View File
@@ -0,0 +1,39 @@
--TEST--
local infile handler
--FILE--
<?php
include "connect.inc";
function my_read($fp, &$buffer, $buflen, &$error) {
$buffer = strrev(fread($fp, $buflen));
return(strlen($buffer));
}
/*** test mysqli_connect 127.0.0.1 ***/
$link = mysqli_connect("localhost", $user, $passwd, "test");
/* create temporary file */
$fp = fopen("061.csv", "w");
fwrite($fp, "foo;bar");
fclose($fp);
mysqli_query($link,"DROP TABLE IF EXISTS t_061");
mysqli_query($link,"CREATE TABLE t_061 (c1 varchar(10), c2 varchar(10))");
mysqli_query($link, "LOAD DATA LOCAL INFILE '061.csv' INTO TABLE t_061 FIELDS TERMINATED BY ';'");
mysqli_set_local_infile_handler($link, "my_read");
mysqli_query($link, "LOAD DATA LOCAL INFILE '061.csv' INTO TABLE t_061 FIELDS TERMINATED BY ';'");
if ($result = mysqli_query($link, "SELECT c1,c2 FROM t_061")) {
while (($row = mysqli_fetch_row($result))) {
printf("%s-%s\n", $row[0], $row[1]);
}
mysqli_free_result($result);
}
mysqli_close($link);
?>
--EXPECT--
foo-bar
rab-oof
+44
View File
@@ -0,0 +1,44 @@
--TEST--
constructor test
--FILE--
<?php
include "connect.inc";
/* class 1 calls parent constructor */
class mysql1 extends mysqli {
function __construct() {
parent::__construct("localhost", "root", "", "test");
}
}
/* class 2 has an own constructor */
class mysql2 extends mysqli {
function __construct() {
$this->connect("localhost", "root", "", "test");
}
}
/* class 3 has no constructor */
class mysql3 extends mysqli {
}
$foo[0] = new mysql1();
$foo[1] = new mysql2();
$foo[2] = new mysql3("localhost", "root", "", "test");
for ($i=0; $i < 3; $i++) {
if (($result = $foo[$i]->query("SELECT DATABASE()"))) {
$row = $result->fetch_row();
printf("%d: %s\n", $i, $row[0]);
$result->close();
}
$foo[$i]->close();
}
?>
--EXPECTF--
0: test
1: test
2: test
-29
View File
@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "oci8"=.\oci8.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
+4
View File
@@ -632,6 +632,8 @@ PHP_MINIT_FUNCTION(openssl)
}
php_stream_xport_register("ssl", php_openssl_ssl_socket_factory TSRMLS_CC);
php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory TSRMLS_CC);
php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory TSRMLS_CC);
php_stream_xport_register("tls", php_openssl_ssl_socket_factory TSRMLS_CC);
/* override the default tcp socket provider */
@@ -665,6 +667,8 @@ PHP_MSHUTDOWN_FUNCTION(openssl)
php_unregister_url_stream_wrapper("ftps" TSRMLS_CC);
php_stream_xport_unregister("ssl" TSRMLS_CC);
php_stream_xport_unregister("sslv2" TSRMLS_CC);
php_stream_xport_unregister("sslv3" TSRMLS_CC);
php_stream_xport_unregister("tls" TSRMLS_CC);
/* reinstate the default tcp handler */
Loaded 100 of 353 files, more files were not shown because too many files have changed in this diff. Show more