Compare commits

...
Author SHA1 Message Date
SVN Migration dac069bb9e This commit was manufactured by cvs2svn to create tag 'php_5_0_0RC3RC2'. 2004-06-03 08:17:16 +00:00
Andi Gutmans 02032ccf9f - Prepare for RC3RC2 2004-06-03 08:17:15 +00:00
40b17e6c5c ChangeLog update 2004-06-03 03:03:17 +00:00
Ard Biesheuvel bf4af0f4ca Ton of fixes 2004-06-02 21:43:31 +00:00
Ard Biesheuvel 86aecbbe31 Initial revision of PHP/Interbase UDF lib
# This will allow users running the embedded engine
# to call PHP functions from inside their SQL statements
2004-06-02 21:15:27 +00:00
Andi Gutmans f7ca8821b2 - Don't use ZEND_MM in Windows 2004-06-02 15:05:10 +00:00
Stanislav Malyshev 176f6d8e6e fix incdec - make value's refcount non-zero when passing to
write_property - otherwise __set caller cleanup could kill it.
2004-06-02 12:48:19 +00:00
c59be44de1 ChangeLog update 2004-06-02 00:32:03 +00:00
Ard Biesheuvel 39edbe5192 Don't be too strict if the number of binding arguments provided exceeds the expected number 2004-06-01 23:31:43 +00:00
Ilia Alshanetsky 6b35037ca2 No need to NULL terminate manually, snprintf() does it for us already. 2004-06-01 21:04:33 +00:00
Ilia Alshanetsky 98a6986d97 Fixed bug #28597 (xmlrpc_encode_request() incorrectly encodes chars in
200-210 range).
Patch by: fernando dot nemec at folha dot com dot br
2004-06-01 20:16:06 +00:00
Ilia Alshanetsky db9f1fafa5 Fixed leak inside MINFO function.
Fixed crash inside enchant_dict_suggest() when there are no suggestions.
Added missing safe_mode/open_basedir check inside
enchant_broker_request_pwl_dict().
Fixed various function prototypes.
2004-06-01 18:59:49 +00:00
Ard Biesheuvel b027552ca3 Removed debugging code 2004-06-01 17:14:47 +00:00
Greg Beaver 5b565c1eb1 update dependency to PEAR 1.4.0dev5 2004-06-01 14:51:49 +00:00
Greg Beaver 27a4b575e8 test files for PEAR are now installable! 2004-06-01 14:29:59 +00:00
Greg Beaver cb0b01f7c2 file needed for registry test 2004-06-01 14:27:54 +00:00
Greg Beaver a0ebaab052 add needed package.xml files for channel tests 2004-06-01 14:15:41 +00:00
Greg Beaver e78e1dd5e8 update to include all new unit tests and files 2004-06-01 13:55:49 +00:00
Greg Beaver 58483c8776 begin work on making the tests installable 2004-06-01 13:45:55 +00:00
Greg Beaver 472de86f8d prepare for actual installable unit tests 2004-06-01 13:22:28 +00:00
Greg Beaver 86953ab0f5 fix unit tests for 1.4.0dev4 2004-06-01 13:11:15 +00:00
Derick Rethans 0ede231c76 - Reorder 2004-06-01 11:54:00 +00:00
Andi Gutmans 6f34d891f5 - NEWS 2004-06-01 11:47:14 +00:00
Andi Gutmans 2e19f82a7f - If user error handler returns "false" then we relay to the built in error
handler
2004-06-01 11:45:46 +00:00
Ard Biesheuvel ff3a363d7a Use constant IBASE_CREATE instead of just 0 2004-06-01 08:38:33 +00:00
Ard Biesheuvel 302fd9a77f Woops, missed one 2004-06-01 00:50:05 +00:00
Ard Biesheuvel 5a8a9a59e2 Fixed bug #28569 (connection id is not thread safe) 2004-06-01 00:44:20 +00:00
95910aa26c ChangeLog update 2004-06-01 00:32:37 +00:00
Marcus Boerger 9b8eee74d9 Refcount must not be set separatley again. 2004-05-31 21:49:52 +00:00
Marcus Boerger 20b60f49d9 Add missing initialization 2004-05-31 21:46:00 +00:00
Marcus Boerger 21315c08b7 Add missing initialization 2004-05-31 21:43:43 +00:00
Marcus Boerger 374ac86e33 #28589: Segfault in Reflection API 2004-05-31 21:38:01 +00:00
Pierre Joye f6354c3a1a MFB: missing ';' 2004-05-31 21:04:21 +00:00
Ilia Alshanetsky 9e970ef9a8 Added missing argument check. 2004-05-31 21:01:29 +00:00
Ilia Alshanetsky 22dfb88bf1 Fix build. 2004-05-31 20:25:37 +00:00
Ard Biesheuvel 3be22062fa Fix typo in error message 2004-05-31 13:43:06 +00:00
Ard Biesheuvel e9125d6338 Improved handling of 'CREATE DATABASE ...' by ibase_query()
Improved param handling of ibase_query() and ibase_execute()
2004-05-31 13:40:25 +00:00
Rob Richards 5b0f34ae80 Fix bug #28584: DOMText::splitText() does not split text properly (benjcarson)
Prototype fixes
2004-05-31 12:50:28 +00:00
Zeev Suraski 7d04465b74 Fix prototypes 2004-05-31 12:27:49 +00:00
Rob Richards 1d82c42493 fix leak when using relaxng
interim fix for isolating our streams handling
- once libxml supports overriding streams this should be changed
  for security reasons
2004-05-31 11:20:46 +00:00
Zeev Suraski 846c5a252e Fix typo 2004-05-31 08:58:32 +00:00
468ae7b88a ChangeLog update 2004-05-31 00:33:13 +00:00
Brad House cae0fd23f0 Update the mcve module for libmonetra 4.0
A compatability layer has been introduced which should mean all
scripts written for v 3.2 of the module should continue working,
as well as compilation should still work against libmcve 3.2.x.
This module eventually needs to be renamed to 'monetra' to reflect
the naming change of the underlying library.
2004-05-30 22:41:24 +00:00
Ard Biesheuvel fda04a0ed3 Restrict 'CREATE DATABASE' in sql safe mode 2004-05-30 20:40:36 +00:00
Ard Biesheuvel 17da85ba9b Fix Win32 build
Added missing 'break'
2004-05-30 20:24:46 +00:00
Ilia Alshanetsky 4a7962b31f Fixed memory leak on ifx_error(). 2004-05-30 18:58:47 +00:00
Ilia Alshanetsky 33d72ede4e Fixed bug #28564 (Problem building informix as a shared extension).
Patch by: roques at mti dot ag
2004-05-30 17:56:52 +00:00
Zeev Suraski a2ea2d7173 Fix prototypes 2004-05-30 17:53:12 +00:00
Ard Biesheuvel 18fa78842d Fix unregistered bug (segfault on uninitialised pointer)
Return string("0 ") from ibase_query() if query succeeded but did not affect any rows
2004-05-30 17:51:19 +00:00
Zeev Suraski e54165e406 No meaning for unsigned 2004-05-30 17:34:11 +00:00
Zeev Suraski e11b518c95 Fix prototype 2004-05-30 17:32:32 +00:00
Greg Beaver 2e7e8f30fc fix unit tests for 1.4.0dev3 2004-05-30 17:02:34 +00:00
Ard Biesheuvel f7ce70672c Use default character set in generated test DB 2004-05-30 16:59:43 +00:00
Ard Biesheuvel bd2ddd9fae Fix HTML/table layout in info() entry 2004-05-30 16:41:28 +00:00
Ard Biesheuvel 56ca01da1f Removed ibase_timefmt() - use ini_set() instead
Improved phpinfo() appearance
2004-05-30 16:20:25 +00:00
Zeev Suraski 8b861ec798 Update to PHP-style prototypes
(a PHP function returning char *?  What were you smoking? :)
2004-05-30 15:12:08 +00:00
Brad House 43db887482 manually check for egrep 2004-05-30 14:33:45 +00:00
39729083ee ChangeLog update 2004-05-30 00:32:48 +00:00
Wez Furlong bd818c0118 Turn this off then 2004-05-29 09:27:18 +00:00
Greg Beaver a865b5d0c7 testing file 2004-05-29 09:21:31 +00:00
Greg Beaver 09ee88f9bf modify php_dump.php, .cvsignore ignores *.php
move include to the place where it is used
2004-05-29 09:09:46 +00:00
Greg Beaver 71e0c354ff update _installFile() test for channels 2004-05-29 09:06:09 +00:00
Greg Beaver 32fd0f3ffa update checkDeps/extractDownloadFilename tests for channels 2004-05-29 09:03:43 +00:00
Greg Beaver 478aff5c22 update registry test for channels 2004-05-29 09:02:47 +00:00
Greg Beaver 73124c04be use fake pearweb - now anyone can run the download unit tests.
These tests require channels to pass
2004-05-29 09:02:26 +00:00
Greg Beaver d4070174d8 fake pearweb package files, for unit testing downloads without an installed pearweb 2004-05-29 09:00:52 +00:00
Greg Beaver d87e221f44 config unit tests, ready for channels 2004-05-29 08:59:26 +00:00
Greg Beaver 918d45198a new unit tests
pearweb mock object is complete
2004-05-29 08:51:59 +00:00
Greg Beaver 8c5c17c3a1 update for conflicting file test 2004-05-29 08:49:01 +00:00
Greg Beaver 1f31e7ddea new package.xml needed to test conflicting files error 2004-05-29 08:48:01 +00:00
ba2b5623c3 ChangeLog update 2004-05-29 00:32:22 +00:00
Wez Furlong 7171429f21 Don't rely on TIOCNOTTY. 2004-05-29 00:30:11 +00:00
Ard Biesheuvel 5f53ee1537 Changed default date format to ISO
Enable sync flag in connect()
2004-05-28 23:39:33 +00:00
John Coggeshall 6b02a01c20 'tidy' should not be final, but 'tidyNode' should be. 2004-05-28 20:32:52 +00:00
Ard Biesheuvel 850c6a27f6 Fix commit/rollback of multi-link transactions
Some CS
2004-05-28 20:11:34 +00:00
Andrei Zmievski 915a990330 Allow user-defined error handlers to indicate whether default error
handler should be re-invoked, by returning true or false.
2004-05-28 17:28:33 +00:00
Ilia Alshanetsky 6544f8d47e Fixed memory leak on error. 2004-05-28 14:17:46 +00:00
Ilia Alshanetsky e389e255e6 The engine will take care out-of-memory situation for us. 2004-05-28 14:14:26 +00:00
Stefan Esser 23813d603c Fixed off-by-one in http_fopen_wrapper 2004-05-28 13:38:06 +00:00
Wez Furlong 54bbe548fe Hopefully resolve proc_open build issues.
If we need anything more elaborate than this, then we can move to a configure
time check as Sascha suggests.
2004-05-28 13:25:51 +00:00
Christian Stocker c59471cd1f fix memleak in php callbacks 2004-05-28 13:04:19 +00:00
Stefan Esser 2e3b9ec278 Fixed off-by-one in php_parse_url. 2004-05-28 11:33:23 +00:00
Derick Rethans 27344aaed6 - Added date/time parser thingy. 2004-05-28 10:47:15 +00:00
Derick Rethans f964cc09d2 - Fixed ip2long() behavior if an invalid IP address was passed to the
function. This makes it possible to distingiush between "255.255.255.255"
  and a wrong one.
2004-05-28 10:45:18 +00:00
Marcus Boerger 9797f49466 Add more outstanding patches 2004-05-28 09:14:44 +00:00
Marcus Boerger 0aceba0a8d Remove finished tasks 2004-05-28 09:12:07 +00:00
Marcus Boerger a8ced60e04 Remove finished tasks 2004-05-28 09:06:56 +00:00
Marcus Boerger 9d76829963 Add more things 2004-05-28 09:03:00 +00:00
Marcus Boerger 0ef420a71e Prevent possible problems with illegal properties 2004-05-28 08:55:10 +00:00
Derick Rethans 877ecb3c81 - Make the default mask for user defined error handlers include ALL errors,
including E_STRICT.
2004-05-28 08:08:56 +00:00
7489718769 ChangeLog update 2004-05-28 00:31:45 +00:00
Ilia Alshanetsky df71910d0e Better skip condition check for session tests. 2004-05-27 20:53:26 +00:00
Andrei Zmievski 844e7eb945 5.1 tasks. 2004-05-27 16:22:47 +00:00
Andi Gutmans e51105c6a6 - Back to RC3-dev until we roll final 2004-05-27 15:03:46 +00:00
Wez Furlong b369925372 Fix #25939 for good this time.
# How could I miss this??
2004-05-27 13:04:14 +00:00
Derick Rethans ab34eb7330 Put similar items next to eachother 2004-05-27 12:28:41 +00:00
Andi Gutmans d470f93506 - More news 2004-05-27 12:01:14 +00:00
Andi Gutmans bca3e30484 - Fix problem with exceptions returning from include(). (Dmitry) 2004-05-27 11:59:58 +00:00
Andi Gutmans 5a9d648f1f - RC3RC1 2004-05-27 11:39:35 +00:00
Rob Richards edae935c26 namespace/tagname validation fixes (Adam Trachtenberg)
added new test
2004-05-27 11:15:45 +00:00
Andi Gutmans 7f887852a6 - NEWS 2004-05-27 08:30:14 +00:00
Dmitry Stogov 99a0504a6b Memory leaks were fixed 2004-05-27 08:19:29 +00:00
Dmitry Stogov 2b3e184245 BUGFIX: Prevent crash on error in send_http_soap_request() 2004-05-27 07:58:22 +00:00
e3e7ef94a5 ChangeLog update 2004-05-27 00:32:10 +00:00
Wez Furlong 6f5c0992a3 Fix leak on systems where alloca isn't really alloca. 2004-05-26 22:19:44 +00:00
Wez Furlong dd9ac710f1 Fix silly mistake.
Thanks Antony :)
2004-05-26 21:19:21 +00:00
Andrei Zmievski 81efd46186 Avoid unnecessary and silly copying of constant name when registering. 2004-05-26 21:01:37 +00:00
Andi Gutmans 97dee3a8c2 - Fix memory manager problem 2004-05-26 20:55:16 +00:00
Ilia Alshanetsky b59d5af951 Prepare for 0.2 release. 2004-05-26 20:25:58 +00:00
Ilia Alshanetsky 190227899a Turn off session.auto_start to prevent test failures. 2004-05-26 18:23:21 +00:00
Ilia Alshanetsky de58df089f Prevent test failure when fi_FI locale is not available. 2004-05-26 18:18:14 +00:00
Pierre Joye 07e4ab6946 - Remove this test, it still segfaults anyway (less noise in tests :) )
Already removed in PHP_4_3 branch
2004-05-26 18:12:43 +00:00
Andi Gutmans b5daf7078e - Use FREE_HASHTABLE instead of efree() 2004-05-26 18:00:27 +00:00
Edin Kadribasic 9cc4fb18b6 PQfreemem() is only available in 7.4 2004-05-26 17:45:03 +00:00
Wez Furlong 429bce6519 Apparently it is better to specify 500 here for unix98 bits and pieces. 2004-05-26 14:55:32 +00:00
Wez Furlong 6ef90672d8 Fix build... 2004-05-26 10:11:20 +00:00
Sebastian Bergmann 2fbfcd7482 Update Reflection API class names. Whitespace fixes. 2004-05-26 07:00:39 +00:00
Derick Rethans 17df3ec21b - Fixed bug #28523 (Typo in ext/sockets/sockets.c) 2004-05-26 06:53:04 +00:00
c50a4252cd ChangeLog update 2004-05-26 00:33:37 +00:00
Stefan Esser 7dc95709c8 break is better 2004-05-25 22:12:40 +00:00
Wez Furlong 2e73bbfdc1 Allow use of scrollable cursor for ODBC 2004-05-25 18:57:50 +00:00
Wez Furlong 70bd032076 Use the correct label for the error message 2004-05-25 18:34:46 +00:00
Wez Furlong d13d9c6047 Allow setting the cursor name for ODBC statements, so that:
UPDATE foo set .... WHERE CURRENT OF <NAME>

statements will work.
2004-05-25 18:33:51 +00:00
Wez Furlong d2a8d5a80f get/set attributes for statements 2004-05-25 18:32:48 +00:00
Wez Furlong 4d232fb17c Add flag to control the use of the ODBC cursor emulation library.
The default (which should be safe) is to use the cursor library if it is needed.
If for some reason either the driver or the emulation is broken, you may
override this from your script.
2004-05-25 17:44:36 +00:00
Wez Furlong 7a87af3321 Some definitions for cursors.
Define a mechanism for driver-specific attributes.
Use a refcount for the stmt structure.
2004-05-25 17:43:24 +00:00
Edin Kadribasic c7a2cf7385 Whitespace: editor in the wrong mode ;) 2004-05-25 17:38:58 +00:00
Edin Kadribasic 16a53a00ea Add transaction support 2004-05-25 17:36:22 +00:00
Brad House 7f44f8ee94 PHP_SETUP_OPENSSL is NOT SNMP_SHARED_LIBADD, it's MCVE_SHARED_LIBADD
requires AC_PROG_EGREP when you phpize
2004-05-25 17:08:42 +00:00
Ilia Alshanetsky cf75eb8a6f Cleanup. 2004-05-25 16:49:32 +00:00
Ilia Alshanetsky 402de24fc4 One more leak down. 2004-05-25 16:40:54 +00:00
Ilia Alshanetsky b7ecaca17f More leak fixes. 2004-05-25 16:38:28 +00:00
Edin Kadribasic ff1cbb8460 Use binary safe function for quoting 2004-05-25 16:24:29 +00:00
Antony Dovgal 737bc357cb fix couple of memory leaks 2004-05-25 14:57:56 +00:00
Ilia Alshanetsky 0c762dff03 More possible leak fixes (Thanks Tony). 2004-05-25 14:47:22 +00:00
Ilia Alshanetsky 2685fad6b7 Fixed memory leak. 2004-05-25 14:39:26 +00:00
Ilia Alshanetsky 9280b88a8c One more memory leak. 2004-05-25 14:35:49 +00:00
Ilia Alshanetsky d782abf416 More leak fixes. 2004-05-25 14:30:07 +00:00
Andi Gutmans 2917ff1e7d - Nuke unused decleration 2004-05-25 14:19:19 +00:00
Ilia Alshanetsky ce3891347f Fixed memory leak. 2004-05-25 14:12:15 +00:00
Ilia Alshanetsky 6304e5d7cb Kill unused var. 2004-05-25 13:51:00 +00:00
Wez Furlong 1360e3478c Merge that nicer error message here too 2004-05-25 13:25:22 +00:00
Wez Furlong 6873d6839d *sigh*, obviously, we need this to be able to use sapi_module.name 2004-05-25 13:23:20 +00:00
Wez Furlong ff0ee48537 DEBUG -> PHP_DEBUG 2004-05-25 13:17:01 +00:00
Wez Furlong 7916ef2ee1 Allow sqlite to build as a shared ext under win32 2004-05-25 13:01:05 +00:00
Wez Furlong 146255f35c check if it matches... not if it doesn't... 2004-05-25 13:00:25 +00:00
Wez Furlong c6dff79138 In debug mode, under CLI don't close stderr.
This is so that we can see any error reports.

# for extra paranoia, could limit this check to happen only after the script is
# finished running.
2004-05-25 12:59:15 +00:00
Wez Furlong 32956a25bf add "clean-pecl" rule for nuking pecl objects 2004-05-25 12:57:45 +00:00
Wez Furlong a4f03b8086 Tidy this up a little bit for win32. 2004-05-25 12:44:35 +00:00
Wez Furlong e6551f081d Throw exception during ctor 2004-05-25 12:03:41 +00:00
Andi Gutmans 02884a08f5 - More fixes 2004-05-25 10:09:46 +00:00
Andi Gutmans 6704ab4b35 - Make fix compile. 2004-05-25 09:25:22 +00:00
Andi Gutmans db90fc4c90 - Fix memory leak in mem cache in conjunction with Zend MM. How come no one
- noticed this? :)
2004-05-25 08:33:11 +00:00
1e36c786ae ChangeLog update 2004-05-25 00:32:04 +00:00
Pierre Joye 5b71225f1b - Fix #28506, negative angle returns "random arcs"
while (angle < 0) angle += 2*M_PI is used now
2004-05-24 19:52:28 +00:00
Ilia Alshanetsky 396bf39311 Fixed bug #28508 (Do not make hypot() available if not supported by libc). 2004-05-24 17:02:12 +00:00
Wez Furlong 81b3231b5d Moved pdflib extension to PECL 2004-05-24 16:41:41 +00:00
9926a97e26 ChangeLog update 2004-05-24 00:32:46 +00:00
Andi Gutmans 0b0c5d3fac - Fix problem with object being destroyed more than once 2004-05-23 20:33:09 +00:00
Andi Gutmans ef9878647d - Fix the following script (it crashed):
<?php
   class ErrorHandler {
     function __construct() {
       set_error_handler(array(&$this, 'handle'));
     }

     function __destruct() {
       restore_error_handler();
     }

     function handle($code, $msg, $file, $line, $locals) {
     }
   }

   new ErrorHandler();
?>
2004-05-23 20:27:32 +00:00
Ilia Alshanetsky e4c5e85697 Fixed leaks on fatal errors in tidy. 2004-05-23 17:22:21 +00:00
Andi Gutmans bd892a164b - NEWS 2004-05-23 16:24:21 +00:00
Andi Gutmans c495c54069 - Fix typo although it isn't being built 2004-05-23 16:05:09 +00:00
Andi Gutmans e410a0f5b1 - Fixed bug #27640 memory leak of registered_zend_ini_directives (Dmitry) 2004-05-23 16:02:36 +00:00
Andrey Hristov 4760dd4fc5 adding this 2004-05-23 15:26:55 +00:00
Andrey Hristov 794065776a Ansrei reverted this 2004-05-23 15:21:38 +00:00
Wez Furlong ad99c124c4 Finally a fix for #23220: IIS does not cleanly close SSL connections.
Also enable the safe and recommended bug work around options in the SSL
context.
2004-05-23 10:36:08 +00:00
Stefan Esser bed3f4ce0b This is more correct. 2004-05-23 10:00:59 +00:00
Greg Beaver ad57096a8b Fix #1395: PEAR_ErrorStack::staticCallback needs to instantiate the stack
Fix up default callback, so that it can be set for each package as well as for all packages.

Callbacks now have 3 levels of control, which may be a bit too complex, default callbacks might have to go for debugging reasons.  Either that or some kind of origination information should be appended to the error array describing which callbacks were called, so debugging is at least possible
2004-05-23 06:06:10 +00:00
Greg Beaver 6f7d0b2a6a in preparation for testing all remote functionality, use a mock object for a functioning pearweb server 2004-05-23 05:33:25 +00:00
a4de015ec7 ChangeLog update 2004-05-23 00:33:49 +00:00
Wez Furlong 055848d83a prep for release 2004-05-22 20:58:36 +00:00
Ard Biesheuvel 8b1fca9e3a Use dummy status vector in ibase_connect()
Added fbird_ aliases for all ibase_ functions
# See comment in code for more info
# Please let me know if there are any namespace issues involved
2004-05-22 18:50:58 +00:00
Wez Furlong d39117c234 Fix buglet in dbh closing. 2004-05-22 15:04:26 +00:00
Wez Furlong 35494bb569 Enable ODBC Connection Pooling.
Theoretically better than PHP persistent connections, since ODBC itself takes
care of resetting the connections back to a "ground" state.

Connection pooling defaults to ON, since this is generally useful.
You can turn it off by using:

pdo_odbc.connection_pooling=off

in your php.ini file.

You may configure how ODBC matches connection details to existing connections
by setting this value to "strict" (the default) or "relaxed".  You are
encouraged to read the ODBC specs before changing this value.
2004-05-22 14:51:26 +00:00
Wez Furlong ce5e317cc5 ok MSVC, why didn't you spot *that* one?? 2004-05-22 00:38:11 +00:00
e136b9311c ChangeLog update 2004-05-22 00:32:18 +00:00
Wez Furlong 8d9c384f7f Fix doer()
Implement error handling for ODBC
2004-05-22 00:30:00 +00:00
Ilia Alshanetsky b4ef3d186a Add self to credits. 2004-05-21 22:45:27 +00:00
George Schlossnagle 84cfbe5efe pierre's thingy 2004-05-21 22:36:52 +00:00
George Schlossnagle e872491f80 /me learns to read 2004-05-21 22:30:58 +00:00
George Schlossnagle 88942c9834 both places 2004-05-21 22:27:30 +00:00
George Schlossnagle 553698f35d drop the dev 2004-05-21 22:27:02 +00:00
Wez Furlong 758b7f1ad4 Bump the version number 2004-05-21 22:26:45 +00:00
George Schlossnagle 4d01a5c2d1 ok, apprently we _don't_ want to count the nulls. 2004-05-21 22:24:20 +00:00
George Schlossnagle 1ee89e1bea remove debugging 2004-05-21 22:20:25 +00:00
George Schlossnagle 518cf77f32 fix fubar'd emulated bindings 2004-05-21 22:19:33 +00:00
Wez Furlong dc57cff2a6 Prep for release 2004-05-21 21:20:00 +00:00
Timm Friebe 3a168b52e7 - Fixed expected return value from test #2
Invalid resources yield bool(false) in PHP5, NULL in PHP4
2004-05-21 21:01:21 +00:00
Timm Friebe 342d7b6968 - Removed currently leaking auto-cancel test
- Fixed expected return value from sybase_num_rows() when an
  invalid resource is passed (returns false instead of NULL)
2004-05-21 20:54:39 +00:00
Timm Friebe df5396677d - Fixed expected return value from var_dump()
- Cleaned up SQL statement
# This bug has been fixed, but this test should be kept anyways,
# just to make sure it does not reappear
2004-05-21 20:53:01 +00:00
Timm Friebe 8eac91345b - Fixed bug #28354 2004-05-21 20:29:38 +00:00
Timm Friebe b20be6a27b - Initial release 2004-05-21 19:45:55 +00:00
Edin Kadribasic 640bed4cf5 Prepare release 2004-05-21 19:09:43 +00:00
Wez Furlong 40ab777dc8 Update package/module 2004-05-21 17:33:58 +00:00
Wez Furlong 25049d6cf8 Add some blurb 2004-05-21 17:31:49 +00:00
Wez Furlong 9462eb6db5 Ok, so we do need to rinit here after all. 2004-05-21 17:17:55 +00:00
Wez Furlong fbccd1438c Update to reflect recent changes in dl() 2004-05-21 17:08:36 +00:00
Wez Furlong 597124e128 Update package/module 2004-05-21 16:53:32 +00:00
Wez Furlong 500922f9a2 Update package file 2004-05-21 16:38:41 +00:00
Wez Furlong e419d735c4 Better error message to save looking in the wrong place. 2004-05-21 16:36:37 +00:00
Ilia Alshanetsky 3a5e5ca4d4 Implement ODBC doer. 2004-05-21 16:17:22 +00:00
Wez Furlong 798d437b05 Fix return type here too 2004-05-21 15:33:18 +00:00
Wez Furlong a53edd047e Fix return type 2004-05-21 15:29:09 +00:00
Wez Furlong 5e408e4ee9 Fix setAttribute for oci.
Fix some compiler warnings
2004-05-21 15:25:22 +00:00
Derick Rethans 42bc9637b2 - Fixed order (again) 2004-05-21 15:09:34 +00:00
Dmitry Stogov b9bb0d77a0 Fixed bug #28239 (No results returned on SOAP call, no error given) 2004-05-21 14:50:19 +00:00
Wez Furlong d8d7dd7e14 Allow lazy fetch to work with numeric offsets.
Fix named parameters...
2004-05-21 14:31:51 +00:00
Ilia Alshanetsky 37d8a82b4d Fixed compiler warning. 2004-05-21 14:27:48 +00:00
Ard Biesheuvel c6773a06cd Removed strcpy() call from most common case
Added test for hash index generation
2004-05-21 14:24:34 +00:00
Wez Furlong 64f0ec7bde Update for placeholder flags 2004-05-21 14:15:03 +00:00
Wez Furlong 8f5b212612 store the name length in the same manner as it is stored in zvals 2004-05-21 14:14:32 +00:00
Wez Furlong ed83c5bee5 Tidy up placeholder flags 2004-05-21 14:09:51 +00:00
Ard Biesheuvel 27c3c301bd Added test for duplicate field names when returning rows as hashes or objects
# This change should be in 5.0.0, as it might break BC
2004-05-21 13:46:04 +00:00
Wez Furlong bf48daa8d5 Version 1 of PDO_FETCH_LAZY 2004-05-21 13:26:58 +00:00
Ard Biesheuvel 126531a44b Make sure METADATALENGTH is defined (used by IB 7) 2004-05-21 13:14:56 +00:00
Derick Rethans cb1e4ab6c8 - Fixed TSRM problem in latest commit. 2004-05-21 08:16:13 +00:00
Derick Rethans bc7ad69fbc - Fixed bug #28456 (Problem with enclosed / in uploaded file names) 2004-05-21 08:11:43 +00:00
Greg Beaver f30b95fcf0 fix missing assignment
$this->_errors = array_filter($this->_errors);
2004-05-21 03:43:58 +00:00
Greg Beaver 981948641c fix for BC break
staticGetErrors adds the parameter $level between $purge and $merge, as it will be as common (or more common) as $purge.
2004-05-21 03:33:51 +00:00
Greg Beaver aaa7263bdd Several issues resolved.
fix 1444: PEAR_ErrorStack->push() needs to validate $msg and $code as string/int
add error level checking to hasErrors() and getErrors().
BC break!!:
staticGetErrors adds the parameter $level between $purge and $merge, as it will be as common (or more common) as $purge.
2004-05-21 03:33:19 +00:00
3d9c47eed0 ChangeLog update 2004-05-21 00:39:44 +00:00
Ilia Alshanetsky 9cccfa57b6 Fixed stream leak on error. 2004-05-20 23:37:59 +00:00
Wez Furlong 221710e820 Specify that OCI returns column names in upper case by default 2004-05-20 22:29:26 +00:00
Wez Furlong f0a001a953 Implement case folding of column names as a portability option. 2004-05-20 22:28:53 +00:00
Ilia Alshanetsky 41784bfcff Kill unused var. 2004-05-20 22:24:30 +00:00
Wez Furlong e0ac3f66ae Implement PDO_FETCH_OBJ
# todo (after initial release) - specify a particular class, reuse existing
# objects etc.
2004-05-20 22:06:42 +00:00
Wez Furlong 4cdf143184 Fix build on win32 2004-05-20 21:50:25 +00:00
Andrey Hristov 19d0283ce8 for now removing ":public". Waiting for a decision? ":public" will require
quite a lot of phpt files changes.
2004-05-20 21:15:42 +00:00
Andrey Hristov 44de5a0e8e fixing the tests so to work with the new var_dump() (dumping private and
protected member variables)
2004-05-20 21:13:14 +00:00
Ilia Alshanetsky 43a04beb46 Make username & password parameters optional. 2004-05-20 20:25:22 +00:00
Ilia Alshanetsky afb3979882 Fixed parameter order. 2004-05-20 20:22:07 +00:00
Ilia Alshanetsky ebd608ba18 Added getAttribute() handler.
Fixed leak inside exec().
2004-05-20 20:04:11 +00:00
Edin Kadribasic 7f6343e60d Use native PostgreSQL connect string e.g.
$db = new PDO("pgsql:dbname=template1 user=postgres password=secret");
2004-05-20 19:58:51 +00:00
George Schlossnagle e155ad208a sigh... need to include the null byte in hash keys 2004-05-20 19:19:04 +00:00
Ilia Alshanetsky 15fb957c61 Added MySQL getAttribute() support. 2004-05-20 19:17:32 +00:00
Wez Furlong 5023a7c61c Enable setting the different error modes via PDO::setAttribute() 2004-05-20 19:16:49 +00:00
Ilia Alshanetsky 726e188cce Fixed typo. 2004-05-20 19:14:44 +00:00
Ilia Alshanetsky 42a2b22a4a Added missing user-land constants. 2004-05-20 19:12:24 +00:00
Edin Kadribasic 9cfeb25667 We quote with ' in real databases 2004-05-20 19:09:36 +00:00
Ilia Alshanetsky e596466a1f Added getAttribute() method. 2004-05-20 19:09:35 +00:00
George Schlossnagle b7b7bedabd remove debug 2004-05-20 18:50:21 +00:00
George Schlossnagle c22cb0477c off by one error 2004-05-20 18:44:12 +00:00
George Schlossnagle 3366916203 set active_query_string to null in case of failure 2004-05-20 18:29:59 +00:00
Ilia Alshanetsky 1c2b47c408 Make sure that the error string is freed. 2004-05-20 18:19:03 +00:00
Ilia Alshanetsky b7784d96b0 Fixed possible crash. 2004-05-20 18:10:16 +00:00
Ilia Alshanetsky cf33729c20 Better error message. 2004-05-20 18:05:44 +00:00
Ilia Alshanetsky f8d045619a Last insert id (oids) support. 2004-05-20 18:00:24 +00:00
Wez Furlong 3ec72d3ed9 Revert; obviously I missed the function at the bottom of the file... 2004-05-20 17:59:27 +00:00
George Schlossnagle d16625b803 Support ? as a bind in emulated prepares
Throw informative error when pdo_parse_param fails
2004-05-20 17:56:09 +00:00
Andrey Hristov aafb2b1581 var_dump() now shows private and protected member variables.
Not BC is that since now the public variables are explicitly shown as public
Example :

class a{ protected $a=1; private $b=2;var $c=3;} $a=new a(); var_dump($a);

object(a)#1 (3) {
  ["a:protected"]=>
  int(1)
  ["b:private"]=>
  int(2)
  ["c:public"]=>
  int(3)
}
2004-05-20 17:46:20 +00:00
Ilia Alshanetsky 38eb52b8a7 Make doer() work.
Make error reporting system work.
2004-05-20 17:43:56 +00:00
Wez Furlong 892ec5f535 Export this, so extensions may throw their own exception objects that
they have already instantiated.
2004-05-20 17:41:09 +00:00
George Schlossnagle e3e2370490 keys need to be null-terminated (how did this not get committed before???)
bind-by-name includes the leading : in the name
2004-05-20 17:34:52 +00:00
Wez Furlong 04ccc0134d Add methods for error handling 2004-05-20 17:22:13 +00:00
George Schlossnagle 76b7b5d1e2 iactually support :\w+ as binds 2004-05-20 17:04:57 +00:00
Derick Rethans ee9cc68848 - Removed unused INI sections. 2004-05-20 17:03:24 +00:00
Dmitry Stogov 38ef28e41b Allowing user defined SOAP transports with SoapClient::__doRequest() 2004-05-20 16:55:03 +00:00
Wez Furlong af2aa721df zts fix ;) 2004-05-20 16:17:37 +00:00
Ilia Alshanetsky 40b04cd54b Correctly report errors for statment problems. 2004-05-20 16:13:13 +00:00
Ilia Alshanetsky 0d6aa20880 Error handling support.
Fixed possible crash when trying to fetch data from a failed query.
2004-05-20 15:51:25 +00:00
Ilia Alshanetsky fbbb41a53b Fixed typo. 2004-05-20 15:45:16 +00:00
Ilia Alshanetsky e770b2b411 Fixed compiler warnings. 2004-05-20 13:57:09 +00:00
Wez Furlong d55e20660b Don't dup here either 2004-05-20 10:30:29 +00:00
Wez Furlong 0699938bc4 Don't dup here, PDO will do it as needed 2004-05-20 10:28:26 +00:00
Derick Rethans dcb0ee6ec4 - Allow extra parameters to mail to be forced also from virtual host settings. 2004-05-20 10:24:39 +00:00
Wez Furlong d9decf0dfc Fix prototype.
Use user-supplied path before the default when looking for headers
2004-05-20 10:24:17 +00:00
Edin Kadribasic fa1b0a51d3 Make it compile on windows 2004-05-20 03:02:58 +00:00
Edin Kadribasic 9d6c259988 PostgreSQL PDO driver. 2004-05-20 02:27:49 +00:00
9f5e4a19be ChangeLog update 2004-05-20 00:33:36 +00:00
Ilia Alshanetsky 28aca30c13 Free vars before calling E_ERROR. 2004-05-20 00:11:23 +00:00
Wez Furlong 04c35e3d91 re-jig error handling, and make it co-operate with the PDO error handling system.
Implement $dbh->exec() for OCI.
2004-05-20 00:06:30 +00:00
Wez Furlong e7c72f8455 First cut at a "unified" error handling API. The main thing that is missing
currently is a switch in the dbh to indicate what to do with the errors.
2004-05-20 00:05:22 +00:00
Wez Furlong 08ce920c9e Fix win32 build 2004-05-19 21:36:22 +00:00
Marcus Boerger 0a242a52b3 - Allow to build with ext/mysqli 2004-05-19 20:57:02 +00:00
Marcus Boerger fd90645613 - Allow to compile as builtin module 2004-05-19 20:56:06 +00:00
Ilia Alshanetsky 862247693f Row count cannot be calculated in MySQL without buffering the query. 2004-05-19 20:44:28 +00:00
Ilia Alshanetsky c98a99c263 Added fetchAll and fetchSingle methods for data retrieval. 2004-05-19 20:38:53 +00:00
Ilia Alshanetsky 676dfcf581 Timeout stuff. 2004-05-19 20:38:25 +00:00
Ilia Alshanetsky f4b5abc948 Added support for setting timeout value. 2004-05-19 20:34:57 +00:00
Ilia Alshanetsky 56abe4de4a Prevent possible crash when working with column containing NULL. 2004-05-19 20:34:01 +00:00
George Schlossnagle 38a409c02f exec() now returns affected row count 2004-05-19 19:31:33 +00:00
George Schlossnagle 129997216b exec() now returns row count 2004-05-19 19:27:53 +00:00
George Schlossnagle ee1241ab1a builds on stock rh9 now 2004-05-19 18:51:01 +00:00
Frank M. Kromann 7c5c0fbbea Set correct Win32 line endings and fix ZTS compilation 2004-05-19 18:04:47 +00:00
Ilia Alshanetsky 074ba3fbc0 Added lastInsertId() method for retrieving last insert id.
Made affectedRows() work for MySQL.
Populate error value in MySQL on error.
2004-05-19 17:35:39 +00:00
Ilia Alshanetsky 5a4c3234b9 Skip spaces between connection params. 2004-05-19 17:09:48 +00:00
Ard Biesheuvel fd7a92f046 Fixed unregistered bug (memory leak in printf() & friends) 2004-05-19 16:46:29 +00:00
Ilia Alshanetsky a5a908c4bf Better include path detection. 2004-05-19 16:26:06 +00:00
Wez Furlong 1a91f75193 Add simple error code values and a place to store them 2004-05-19 16:21:43 +00:00
Wez Furlong 641f2c0c40 Let it install correctly when built via phpize 2004-05-19 15:27:27 +00:00
Ilia Alshanetsky c328a15469 More errno stuff. 2004-05-19 15:17:52 +00:00
Ilia Alshanetsky 3dddc0bade Fixed possible crash on connection error. 2004-05-19 15:14:55 +00:00
Ilia Alshanetsky b5f8bd8e9e Simplify config via the use of mysql_config.
Fixed errno naming conflict.
2004-05-19 15:12:05 +00:00
Ilia Alshanetsky c11d6ca38b Copy the headers 2004-05-19 14:27:32 +00:00
Edin Kadribasic bbcf09a833 Typo 2004-05-19 14:23:59 +00:00
Edin Kadribasic e8abbca3a6 Fix configure 2004-05-19 14:02:36 +00:00
Wez Furlong fd6b885a19 Revise $dbh->exec().
The driver doer() method should populate dbh->affected_rows if it can determine its value.
2004-05-19 13:55:41 +00:00
Wez Furlong 6cd27ff8be Add $dbh->exec() method.
Rename $dbh->beginWork() to $dbh->beginTransaction().
2004-05-19 13:43:07 +00:00
Ilia Alshanetsky a0b3e87003 Abort if driver cannot be registered. 2004-05-19 13:34:40 +00:00
Edin Kadribasic 7a214b66ae Cosmetics 2004-05-19 13:28:05 +00:00
Ilia Alshanetsky 741e31bdf3 Removed unused vars. 2004-05-19 13:27:54 +00:00
Wez Furlong 777484b561 update prototype 2004-05-19 12:40:50 +00:00
Wez Furlong f7de5001e2 Update prototype 2004-05-19 12:40:31 +00:00
Wez Furlong 8759648192 Update prepare() prototype.
Attempt to hunt down the cause of a build warning under win32 by adjust the
name of the error function.
2004-05-19 12:40:11 +00:00
Wez Furlong 4116d9fb0e Expand the prepare() prototype to accept additional options. 2004-05-19 12:37:31 +00:00
Sebastian Bergmann 681ded13bc ZTS fix. 2004-05-19 09:23:15 +00:00
Marcus Boerger 29cfd6d24f - Remove unused blocks 2004-05-19 08:56:50 +00:00
Marcus Boerger d94136fc30 - Remove unused blocks 2004-05-19 08:45:46 +00:00
bd29f379e7 ChangeLog update 2004-05-19 00:34:15 +00:00
Ilia Alshanetsky 65e1741d2d Fixed possible memory leak. 2004-05-18 23:26:53 +00:00
Ilia Alshanetsky 46eb5401e7 Better header detection. 2004-05-18 23:07:22 +00:00
Ilia Alshanetsky aecad9e37b Fixed build. 2004-05-18 22:45:53 +00:00
Ilia Alshanetsky cb1239a338 Allow static builds. 2004-05-18 22:31:13 +00:00
Marcus Boerger 007a076cd0 Fix test 2004-05-18 21:27:08 +00:00
Marcus Boerger c8e72410be - Need to operate on module pointer in hash table 2004-05-18 21:19:15 +00:00
Wez Furlong 8d9ced8282 Fix #27638: not cleaning up object files in win32 build 2004-05-18 21:07:01 +00:00
George Schlossnagle f02fb4ada4 should be a strcmp, not a strncmp, thanks, wez 2004-05-18 20:57:19 +00:00
Marcus Boerger 6882000c53 - Make start and length parameter to Limititerator::__construct optional 2004-05-18 20:39:35 +00:00
George Schlossnagle 8233053d24 was leaking query_string's 2004-05-18 20:33:30 +00:00
George Schlossnagle 5f4cfcb009 support the read-only property 'queryString' 2004-05-18 20:26:24 +00:00
Wez Furlong d80297b251 Fix bug #28438: win32 build fails in non-zts mode 2004-05-18 20:14:54 +00:00
George Schlossnagle 2e4c3ea35f forgotten off the last commit 2004-05-18 19:30:43 +00:00
Wez Furlong c4ca0f3378 Give user a nice message when PDO isn't initialized prior to a driver. 2004-05-18 19:30:22 +00:00
Wez Furlong b54a4dfeeb Minor tweaks 2004-05-18 19:25:45 +00:00
Wez Furlong bdd4b84c29 typo.. 2004-05-18 19:25:23 +00:00
Wez Furlong df69bf6c06 mySQL, not Oracle ;) 2004-05-18 19:06:47 +00:00
Wez Furlong 9ec5c3526e Add to win32 build 2004-05-18 19:03:27 +00:00
Ilia Alshanetsky caed65f547 Fixed search path for MySQL. 2004-05-18 18:42:36 +00:00
George Schlossnagle 71728cc2b2 initial import of mysql 3.x pdo driver 2004-05-18 18:01:52 +00:00
Stanislav Malyshev da26db3054 Z_TYPE_P is for zvals 2004-05-18 16:13:57 +00:00
Wez Furlong 17d009c3b4 Update generated parser 2004-05-18 15:58:17 +00:00
Wez Furlong e37b622d3f Add parser to win32 build 2004-05-18 15:58:00 +00:00
Wez Furlong 2a9fa24458 Tweaks for win32 2004-05-18 15:57:46 +00:00
George Schlossnagle 85e3a1bc3b for those without re2c 2004-05-18 15:38:25 +00:00
Wez Furlong f76725902b Fix dl() and extension= 2004-05-18 15:26:32 +00:00
Wez Furlong b949bfe651 Register according to the type specified by the module.
(Helps to fix dl() bug)
2004-05-18 15:26:13 +00:00
George Schlossnagle 70f06be16a license/copyright block 2004-05-18 15:22:58 +00:00
George Schlossnagle a97e1a6646 handle binding/quoting of queries for drivers with emulated prepares 2004-05-18 15:19:31 +00:00
Ilia Alshanetsky 3e0cbfb077 Fixed command line escaping routines for win32. 2004-05-18 13:43:24 +00:00
Edin Kadribasic b1efed9dde Move declarations to the begining of function.
This allows it to actually compile on windows.
2004-05-18 12:32:05 +00:00
Edin Kadribasic e489d93abc TSRM fix 2004-05-18 10:53:53 +00:00
Edin Kadribasic 3b64493a3d No length parameter -> estrdup() 2004-05-18 10:49:06 +00:00
Wez Furlong 3455498219 Probe for some functions; allows pdo_oci to build on the snap machine again. 2004-05-18 10:00:01 +00:00
Wez Furlong 0460174a0d Primitive support for probing headers for functions using a regexp 2004-05-18 09:58:45 +00:00
Wez Furlong c9f736ab6e Skeleton for emulated prepare() 2004-05-18 08:59:27 +00:00
Wez Furlong 5a9864ed2b Update to match new prototype 2004-05-18 08:47:10 +00:00
Wez Furlong 940c896e15 Quoting here leads to problems with databases that really support bound parameters.
We should do this conditionally based on the emulate_prepare flag.
2004-05-18 08:45:28 +00:00
George Schlossnagle 2e36e9d06d only rewrite tmp if quoter returns true 2004-05-18 05:34:52 +00:00
George Schlossnagle 636cc3e1dc auto-quote values before binding them in at execute time 2004-05-18 05:31:01 +00:00
George Schlossnagle 7d40971563 use new prototype 2004-05-18 05:01:16 +00:00
George Schlossnagle 2e281baab9 we need the source string length for binary safe string handling 2004-05-18 05:00:52 +00:00
Wez Furlong 12acb64696 package.xml 2004-05-18 00:45:58 +00:00
Wez Furlong 2653f34210 Skeleton package file 2004-05-18 00:40:01 +00:00
4d7b0e114d ChangeLog update 2004-05-18 00:35:47 +00:00
Sara Golemon b094db390e Bugfix#28404 When type is double we need to access dval, not lval 2004-05-18 00:04:22 +00:00
Wez Furlong d4c5556b8b Let is build under unix.
Tested against IBM DB2 and unixODBC.
Could work with others.
2004-05-17 22:20:11 +00:00
George Schlossnagle fd73439882 include guard 2004-05-17 21:12:30 +00:00
Ilia Alshanetsky 0a38683b14 Correct output. 2004-05-17 20:58:57 +00:00
Sara Golemon cceecdbcdb BugFix# 27982: Provide error message when trying to overwrite an existant file without overwrite context option. 2004-05-17 20:31:59 +00:00
Andrei Zmievski 427561446f Revert the .ini vars patch. Will have to try again next Christmas
apparently.
2004-05-17 20:09:37 +00:00
Wez Furlong cf4127b6b9 Allow PDO OCI to build under unix.
Don't build by default under win32.
2004-05-17 18:17:39 +00:00
Wez Furlong dd84731577 Allow PDO to build as a self-contained extension.
Install headers so that other self-contained extensions may them.
2004-05-17 18:13:03 +00:00
Andrei Zmievski 26eaab7641 Fix the apparent bug (; at the end of parse rule block). 2004-05-17 17:12:07 +00:00
Wez Furlong 79c513db96 Some pedantic fixes for gcc. 2004-05-17 17:00:35 +00:00
Derick Rethans 255a5a8a5b - Document the smtp_port setting in php.ini 2004-05-17 16:30:22 +00:00
Wez Furlong d6c4dee168 ODBC (v3 ish) driver for PDO.
Will not build under unix yet.
2004-05-17 15:43:01 +00:00
Wez Furlong 1b1ced539b OCI driver for PDO, supporting bound input and output parameters.
Will not build under unix yet.
2004-05-17 15:42:33 +00:00
Wez Furlong 684be9cf36 Hello PDO.
Still more to come.  Give it a couple of days before starting to write drivers
for the other databases; a few things might change, so I'd like to coordinate
that, but in a couple of days.
2004-05-17 15:41:51 +00:00
Wez Furlong 3a4f33e31f As discussed with Andi, add this helper API for setting the object pointer from
within the constructor.

Please read the comment for notes about how to use it; in general, you don't
need it, so don't use it.
2004-05-17 11:27:16 +00:00
7d15d8cc3e ChangeLog update 2004-05-17 00:33:01 +00:00
Pierre Joye 9e9576ecfa - T_WHITESPACE for the 1st test... 2004-05-16 21:00:24 +00:00
Pierre Joye a937ae4762 - PHP allows spaces before :: (parent :: foo(); )
Nota bene, requires another change to really check the syntax:
  loop back to the first non white space element and valid it (parent,
  string or var)
2004-05-16 20:55:29 +00:00
Timm Friebe 77c75e786b - Fixed test for LONG_MIN / LONG_MAX for 64-bit platforms 2004-05-16 20:33:44 +00:00
Timm Friebe 425ae98916 - Fixed auto-conversion from long to double when LONG_MAX /
LONG_MIN where overflown
2004-05-16 20:30:35 +00:00
Timm Friebe 7bbe13ac4d - Initial release 2004-05-16 20:28:31 +00:00
Pierre Joye 915e9a555e - Fix #1329, closedir on exit (kameshj at fastmail dot fm) 2004-05-16 15:43:30 +00:00
Pierre Joye d049b24dfd - Fix #1330, unused variable 2004-05-16 15:39:07 +00:00
Pierre Joye 59727034b7 - Fix #1249 (wrong print out the wrong state with force option)
- some NL issues, sorry, commit now too
2004-05-16 15:37:13 +00:00
Ilia Alshanetsky bb88a86240 Do not allocate error buffer at the start of every request. 2004-05-16 15:34:53 +00:00
Marcus Boerger ed5ce047db - Add new test 2004-05-16 14:48:45 +00:00
Ilia Alshanetsky fbd3e0da40 Added missing safe_mode & open_basedir checks. 2004-05-16 14:38:19 +00:00
Marcus Boerger 251b627684 - Fix printf with floats 2004-05-16 14:01:45 +00:00
Wez Furlong 6d7346f4b9 ; 2004-05-16 12:10:35 +00:00
Wez Furlong 57cf4805a9 Add config.w32 template to ext_skel 2004-05-16 11:49:35 +00:00
Rob Richards 9e3956b313 constructors throw DOMException
add DOM_PHP_ERR DomException code
validate tagnames in constructors
use C style comments
update TODO
2004-05-16 10:30:16 +00:00
Brad House 92c72cb8d8 update config.m4 for libmonetra 4.0 compatability.
Library no longer has MCVE_ symbols, the header file has #define\'s to
convert MCVE_ -> M_ to reflect the Monetra name change from MCVE.
More updates to follow.
2004-05-16 02:59:34 +00:00
72d12fb320 ChangeLog update 2004-05-15 00:36:05 +00:00
Andrei Zmievski 66181dde3b .ini variables patch notice 2004-05-14 21:10:02 +00:00
Andrei Zmievski e97f733515 Adding ability to refer to existing .ini variables from within .ini
files. Example:

open_basedir = ${open_basedir} ":/new/dir"
2004-05-14 20:58:15 +00:00
Ilia Alshanetsky 5b4dc50c01 Fixed possible memory leak inside popen(). 2004-05-14 16:12:03 +00:00
01e92c81e7 ChangeLog update 2004-05-14 00:32:50 +00:00
Ilia Alshanetsky d24465ba8a Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). 2004-05-13 17:44:23 +00:00
Ilia Alshanetsky 50260570b4 Make isapi more compatible with apache sapis as far as the creation
$_COOKIE super-global and various $_SERVER values.
2004-05-13 17:21:39 +00:00
Stanislav Malyshev 0821f8f7d9 add sqlite_exec() 2004-05-13 14:19:10 +00:00
Ilia Alshanetsky f7f966f96f Skip session tests if session.save_path is not writable. 2004-05-13 12:53:47 +00:00
Wez Furlong 6571a32c87 Add --enable-memory-limit configure option (defaults to off) 2004-05-13 12:14:56 +00:00
Marcus Boerger fbb28b36b7 - Once ts_free_id() will be used, we cannot call ctors for deleted ids
when creating new threads.
2004-05-13 06:53:21 +00:00
b30bc204c9 ChangeLog update 2004-05-13 00:59:25 +00:00
Marcus Boerger aa7454aba4 - Centralize register and hash operations for startup/register_module
in new zend_register_module_ex().
2004-05-12 23:05:28 +00:00
Marcus Boerger 950ddcc9c2 - Revert to 1.249 2004-05-12 23:03:38 +00:00
Marcus Boerger 88a02ba159 - More work on ts_free_id() but still keep it out 2004-05-12 22:28:28 +00:00
Marcus Boerger c0be906309 ifdef out the ts_free_id until php 5.1 and until it is complete 2004-05-12 22:17:01 +00:00
Ilia Alshanetsky d6ba95c618 Fixed various possible memory leaks. 2004-05-12 20:17:19 +00:00
Ilia Alshanetsky ca5c6a1e91 Fixed bug #28374 (Possible unterminated loop inside
_php_pgsql_trim_message()).
2004-05-12 16:49:47 +00:00
Ard Biesheuvel 8428d0088c Fixed a couple of inconsistencies in param binding
# Previously, empty strings were either rejected (for scaled integers)
# or silently converted to 0 (unscaled integers & floats). Also, in some
# cases, null zvals were converted to empty strings, which were
# consequently rejected as unconvertible values.
# In the new situation, empty strings will be handled as NULLs for
# fields that cannot distinguish between the two (numeric/date/time).
# Additionally, all range and value checking is now carried out by the
# database, so there is a consistent interface for error handling.
2004-05-12 15:16:51 +00:00
Ard Biesheuvel afc9cb151b Dropped support for ancient Interbase versions (< 6)
# This has no consequences for Firebird, as its initial release was based on IB 6
2004-05-12 14:29:42 +00:00
Ard Biesheuvel b4939dfa9a Made ibase_timefmt() check its args more thoroughly and nuked a pointless malloc() 2004-05-12 13:14:55 +00:00
Ard Biesheuvel ecfd014357 Made ibase_gen_id() bail out on incorrect args 2004-05-12 13:07:35 +00:00
Marcus Boerger 8e52e04c30 - Implement ts_free_id() 2004-05-12 10:30:46 +00:00
Marcus Boerger 40a9fd5f76 - Touch 2004-05-12 10:19:06 +00:00
Marcus Boerger 05a9f544a7 - Move hash table destruction to proper location 2004-05-12 10:17:12 +00:00
Marcus Boerger 2d6770f0e6 - Added missing UNREGISTER_INI_ENTRIES 2004-05-12 10:15:48 +00:00
8de360fdbe ChangeLog update 2004-05-12 00:33:00 +00:00
Ilia Alshanetsky bd92164eff Make vprintf() and printf() return the length of the string printed.
Make fprintf() and vfprints() return the correct length of the string
printed.
2004-05-11 19:51:46 +00:00
Ilia Alshanetsky 69b712410b Reset opt_name to NULL to ensure it's not re-used if numeric keys can be
found inside the options array.
2004-05-11 15:59:07 +00:00
Derick Rethans 500f634db9 - Fixed defines 2004-05-11 15:30:54 +00:00
Andi Gutmans 4f77a021ce - Don't allow passing NULL to type hinted parameter. 2004-05-11 14:28:40 +00:00
Ilia Alshanetsky 1842676706 Fixed bug #28355 (glob() does not return error on Linux when it does not
have permission to open the directory).
2004-05-11 13:34:19 +00:00
9540037bb7 ChangeLog update 2004-05-11 00:32:24 +00:00
Ilia Alshanetsky 97d91c7656 Fixed crash inside cpdf_place_inline_image() when working with truecolor
images.
2004-05-10 22:13:08 +00:00
Rob Richards d3b364fdc7 add chregu as maintainer
prep for next release
2004-05-10 20:46:32 +00:00
Christian Stocker 7f9a606b62 Adding next() method 2004-05-10 20:39:04 +00:00
Marcus Boerger 68c22fba72 - Documentation update
- Checkin doxygen config file
# A patched version of doxygen is needed, hopefully 1.3.8 will contain it
2004-05-10 17:26:03 +00:00
Zeev Suraski 428e722d88 - Fix comparison of objects
- Clarify convert_object_to_type()
2004-05-10 14:56:21 +00:00
Rob Richards dbe02eff78 check for dom support
remove comment
2004-05-10 14:38:32 +00:00
Christian Stocker 33cd5e9b43 - added expand support (see http://www.xmlsoft.org/xmlreader.html#Mixing for the details behind
that)
 CVS: ----------------------------------------------------------------------
2004-05-10 13:31:14 +00:00
Stefan Esser 2224276a13 Checking MEMORY_LIMIT before doing emalloc/erealloc solves several ugly problems. 2004-05-10 12:17:25 +00:00
Zeev Suraski 9518107e8e Fix Win32 build 2004-05-10 12:06:09 +00:00
Marcus Boerger b0d27f9e85 - Decouple NAN and INF 2004-05-10 07:23:38 +00:00
Ilia Alshanetsky 9a50bd2de1 Missing part of the upgrade patch. 2004-05-10 02:18:49 +00:00
Marcus Boerger 3988ee2df9 - Fix problems with c mode 2004-05-10 01:42:43 +00:00
5cbb4ab242 ChangeLog update 2004-05-10 00:32:12 +00:00
Ilia Alshanetsky 468e834ef1 Fixed bug #28289 (incorrect resolving of relative paths by glob() in
windows).
2004-05-09 19:01:13 +00:00
Ilia Alshanetsky a4c3c3cd47 GD bug fixing news. 2004-05-09 18:26:40 +00:00
Ilia Alshanetsky f11d064b6a Fixed bug #28304 (Missing bounds check inside imagefilter()). 2004-05-09 18:25:33 +00:00
Ilia Alshanetsky 9557b4013a Fixed bug #28311 (Transparency detection code is off by 1). 2004-05-09 17:47:31 +00:00
Ilia Alshanetsky d3fda74acf Fixed bug #28267 (php_image_filter_contrast calls gdImageBrightness). 2004-05-09 17:39:20 +00:00
Ilia Alshanetsky 6e9c4b3125 Upgrade bundled GD library to 2.0.23.
Fixed bug #28175 (build problem for people using FreeType 2.1.0-2.1.2).
2004-05-09 17:33:50 +00:00
Wez Furlong f8518cc83a Implement com_get_active_object() and a helper object for working with
persistent COM objects.
(That's the last of the stuff I want to sneak in before 5.0 is released).
2004-05-09 15:21:29 +00:00
Wez Furlong 6f8233897e Urgh!
Use the correct function to free messages from php_win_err(), otherwise
we say hello to Mr. S. Fault.
2004-05-09 14:28:19 +00:00
Derick Rethans ca47676650 - Fixed news 2004-05-09 14:22:02 +00:00
John Coggeshall 7b54f02f25 Tell ppl about it. 2004-05-09 14:00:30 +00:00
John Coggeshall 399022f3c5 Renamed tidy_node to tidyNode, removed the tidy_exception class and updated
the tests.
2004-05-09 14:00:14 +00:00
Stanislav Malyshev 255d87b1b8 Add __EXTENSIONS__ define - otherwise it won't compile on Solaris 2004-05-09 11:08:04 +00:00
c9dc23da36 ChangeLog update 2004-05-09 00:35:06 +00:00
Ilia Alshanetsky 28eaa612c1 Fixed typo. 2004-05-08 17:37:28 +00:00
Derick Rethans f7afbb9370 - Fixed type which prevented this extension from being loaded as shared
extension.
2004-05-08 17:34:07 +00:00
Marcus Boerger c7b2568269 - Docu updates
- Add missing example file
- Fix aggregation of inner iterators in examples
2004-05-08 12:35:21 +00:00
Marcus Boerger 629a25643c - Update docu 2004-05-08 12:26:28 +00:00
Marcus Boerger a6feb3f405 - Update examples
- Update documentation
- Move classes/interfaces already implemented in c to new subdir internal
2004-05-08 12:24:15 +00:00
Sergey Kartashoff 26fea0bd80 - mnoGoSearch extension was updated to support CachedCopies of
mnogosearch-3.2.16 or later. Udm_Get_Agent_Param and
  Udm_Store_Doc_Cgi functions were added. MnoGoSearch-3.2.3 stored API
  was removed.
2004-05-08 11:50:40 +00:00
Sara Golemon 96132bf4fe if statement logic would never eval to false. 2004-05-08 05:58:18 +00:00
55ec6950ce ChangeLog update 2004-05-08 00:33:46 +00:00
Rob Richards 0953c573ad allow ->open() and ->XML() to be called statically 2004-05-07 18:38:21 +00:00
Wez Furlong 6686b3f722 spot the vim user 2004-05-07 17:47:27 +00:00
Wez Furlong ce05cea7ee Fix Bug #28317: Avoid recursion in libpcre on windows platform. 2004-05-07 17:47:02 +00:00
Ard Biesheuvel bfcc12ef78 Fix unregistered bug in zval pointer/array juggling
# Thinko: element of a **zval[] is usually not a *zval[]
# I can't believe this has gone undetected for 4+ years!
2004-05-07 15:11:07 +00:00
Marcus Boerger bfc3e689de - Fix bug #28309 2004-05-07 06:13:21 +00:00
5927a5eb18 ChangeLog update 2004-05-07 00:31:54 +00:00
Marcus Boerger 7388b6b9ac - Update examples 2004-05-06 22:55:25 +00:00
Marcus Boerger af7d85db25 - interfaces 'extends' not 'implements' other interfaces 2004-05-06 21:46:40 +00:00
Marcus Boerger 592ee79fc1 - Update documentation 2004-05-06 21:20:50 +00:00
Derick Rethans 5b5207292b - Fixed test 2004-05-06 17:45:27 +00:00
Jay Smith 8f306fd749 Fixed a segfault. (It's possible for large offsets to make strrpos()
read past the end of the haystack string...)
2004-05-06 16:11:50 +00:00
Stanislav Malyshev c6bec7db3b fix line endings 2004-05-06 15:41:59 +00:00
Stanislav Malyshev 74ab20817a Fix fastCGI breakage: due to calling flush on unitialized requests,
request was aborted unless ignore_user_abort is set
2004-05-06 15:23:53 +00:00
Sara Golemon 0dae58bb2a Bugfix #28300 Userspace stream/filter names don't need to be lowercased. 2004-05-06 14:29:33 +00:00
Marc Boeren 35bdc36c5b Call functions by their new, proper names instead of what are now aliases.
Change OCIFetchInto (deprecated) to oci_fetch_array.
2004-05-06 12:22:14 +00:00
Marcus Boerger a9070ba130 Add protos 2004-05-06 09:01:31 +00:00
Marcus Boerger 635052875e Count support for ArrayIterator & ArrayObject 2004-05-06 08:57:20 +00:00
3e038d4398 ChangeLog update 2004-05-06 00:31:51 +00:00
Ard Biesheuvel 18d9462a22 Fixed unregistered bug: array count is incorrect when binding array ids
Fixed unregistered bug: empty numeric/datetime param argument is coerced to
	a string that cannot be handled by the IB API layer
2004-05-05 22:18:35 +00:00
Sara Golemon 0180c36951 BugFix#28287 stream_*_register() not calling __autoload(). 2004-05-05 18:18:57 +00:00
Dmitry Stogov 962ab19c99 Support for classes with __call() method on server side. 2004-05-05 10:52:33 +00:00
Dmitry Stogov 7bddbd7bd0 php_error() -> php_error_docref() (Marcus, Dmitry) 2004-05-05 10:31:26 +00:00
fd0ec1cb45 ChangeLog update 2004-05-05 01:16:24 +00:00
Wez Furlong 4a645e09af news 2004-05-04 15:11:06 +00:00
Wez Furlong 263723ec9b Update for count_elements handler for overloaded objects. 2004-05-04 15:03:48 +00:00
Wez Furlong d056b25c3f Add count_elements handler for overloaded objects. 2004-05-04 15:03:28 +00:00
Wez Furlong 5b5b10f0ca Just in case this header isn't present on the snaps machine. 2004-05-04 15:00:25 +00:00
Wez Furlong c921ceb49c Improve stability.
Give it a new CLSID and change the engine name to ActivePHP5.
Globals registered by the scripting host are now auto-globals and don't
need to be declared global when accessed from within functions.
2004-05-04 14:54:01 +00:00
Ard Biesheuvel d6838a86f3 ibase_query(): Be careful not to return true on error conditions 2004-05-04 12:42:54 +00:00
Martin Jansen 46f2330c19 * Providing the full URL to the coding standards. 2004-05-04 10:43:24 +00:00
Rob Richards adeb21cd8e add package.xml 2004-05-04 08:23:10 +00:00
711422e1e4 ChangeLog update 2004-05-04 00:35:07 +00:00
Wez Furlong 173cf83629 Enable writing to SafeArray dimensions. 2004-05-03 20:10:58 +00:00
Wez Furlong 92d87a6a8d Fix problem when assigning to a variable that holds an instance of
a COM/VARIANT/DOTNET object.
2004-05-03 18:19:07 +00:00
Wez Furlong 8ca144bba5 Fixup some constants and error handling.
Remove unfinished and un-needed function.
2004-05-03 15:51:41 +00:00
Uwe Schindler b39a1e5195 Security fix: Put '\0' string termination before loop 2004-05-03 12:23:25 +00:00
fc4500f7ec ChangeLog update 2004-05-03 00:36:07 +00:00
Marcus Boerger c122763bc0 - Look for missing classes in include_path 2004-05-02 22:55:22 +00:00
Marcus Boerger e72a305091 Update examples 2004-05-02 22:07:32 +00:00
Andi Gutmans 3317070941 - Fix comparison of two objects in non-compatibility mode. 2004-05-02 15:40:46 +00:00
Marcus Boerger 6a4e1fff78 Use caseinsensitive sort 2004-05-02 13:23:30 +00:00
Wez Furlong 4d5ce8cd08 Fix Bug #28251 2004-05-02 11:13:08 +00:00
Marcus Boerger 9216b3d182 Add a notice on STDIN 2004-05-02 09:14:02 +00:00
17a4cea930 ChangeLog update 2004-05-02 00:35:19 +00:00
Marcus Boerger f571b188f9 Don't load modules twice 2004-05-01 20:34:15 +00:00
5fbad6bed5 ChangeLog update 2004-05-01 00:36:00 +00:00
Marcus Boerger ecf8650a36 Autoload class as long as needed 2004-04-30 19:01:06 +00:00
Derick Rethans 5c9d3842bd - HTML entity to ISO char. 2004-04-30 18:00:24 +00:00
Greg Beaver d14b94b8df fix to work with only the installed version of PEAR 2004-04-30 16:45:46 +00:00
Greg Beaver 11be5f887b fix included files and put error messages in PEAR_Downloader where they are needed 2004-04-30 16:37:39 +00:00
Ilia Alshanetsky 91e9545f4f Fixed bug #28228 (number_format() does not allow empty decimal separator). 2004-04-30 13:26:01 +00:00
Marcus Boerger 6f699cea5f Bugfix #28229 (PATCH run-tests tripped up by spaces in names) 2004-04-30 08:18:54 +00:00
Greg Beaver bf87bf816c remove notices in E_ALL for config test in PHP 4.3.6 2004-04-30 03:39:04 +00:00
Greg Beaver 56d7d95c67 hopefully fix this test for all cases 2004-04-30 03:35:43 +00:00
Greg Beaver e349a5e41d update to begin process for next release (release is not imminent) 2004-04-30 02:09:03 +00:00
Greg Beaver 94ff299736 fix unit test to work with 1.3.2 (which will be needed) 2004-04-30 02:06:11 +00:00
Greg Beaver af03ecf9e1 fix 1186: notice in PEAR_Common undeclared $_packageName 2004-04-30 02:05:45 +00:00
Greg Beaver 65ecfc28cf fix unit test with PEAR 1.3.1 2004-04-30 01:57:35 +00:00
66f14d696e ChangeLog update 2004-04-30 00:35:30 +00:00
Marcus Boerger 7f01ec57bf SPL is meant to be in uppercase letters, do it now it works 2004-04-29 23:02:11 +00:00
Marcus Boerger 9aab7d7cdf An oumlaut doesn't work here, need ASCII only 2004-04-29 22:57:23 +00:00
Marcus Boerger a9bdb2ed88 - Fix protos and add notes to the docs
- Reorder func prototypes to show what is common and what is specific
2004-04-29 22:52:49 +00:00
Marcus Boerger 74f21310e3 - ArrayObject::append() must not be called when it refers to an object 2004-04-29 22:25:45 +00:00
Ilia Alshanetsky 6fd3a52665 Fixed bug #28196 (missing error constants in cURL extension). 2004-04-29 16:25:42 +00:00
Ilia Alshanetsky e81addb5ca C++ comments. 2004-04-29 12:59:26 +00:00
Wez Furlong 4b4fae6aa4 another down... 2004-04-29 10:19:16 +00:00
Stanislav Malyshev 239ae7b5fc Fix bug #27876 2004-04-29 09:47:29 +00:00
Marcus Boerger bf5f758c93 - Remove unused variable
- Respect visibility in count() and add a test for that
2004-04-29 07:22:02 +00:00
17d544632e ChangeLog update 2004-04-29 00:36:06 +00:00
Wez Furlong 38795b88ed Add "--disable-all" switch, which will force all arguments to "no" if
they are not specified explicitly. (like the snapshot build, but in
reverse).
2004-04-29 00:17:09 +00:00
Wez Furlong 1ee2b46d2f Should have tested this change before committing. 2004-04-28 23:24:33 +00:00
Marcus Boerger 1721e5d44e - More examples 2004-04-28 21:52:51 +00:00
Marcus Boerger 69e792ee7b Count() was missing 2004-04-28 21:45:41 +00:00
Marcus Boerger 1e264fc509 - Add tests for the examples 2004-04-28 20:10:21 +00:00
Marcus Boerger 4cdc3117c7 - DOS 2 UNIX 2004-04-28 19:58:47 +00:00
Marcus Boerger 63a490cd90 Fix c++ builds 2004-04-28 19:20:28 +00:00
Ilia Alshanetsky 738aa1099f Added missing skip condition. 2004-04-28 15:14:47 +00:00
Wez Furlong 027d450166 Fix for Bug #28161 (and probably others that I can't find in the bug db;
the search interface sucks).

Expand the proxy object so it can handle psuedo array style properties.

ASP/VB code like this:

	headObj.Attribute("RID") = rid

can be expressed like this in PHP:

	$headObj->Attribute['RID'] = $rid;

In theory, this feature can be used for "multi dimensional" properties:

	headObj.Attribute("RID", "Foo") = rid;

like this:

	$headObj->Attribute['RID']['Foo'] = $rid;
2004-04-28 08:23:22 +00:00
b97ecc1820 ChangeLog update 2004-04-28 00:33:46 +00:00
Sara Golemon 1335bc8fb8 Don't strip off those []s, it'll only create problems in wrappers and elsewhere. 2004-04-27 19:28:11 +00:00
Sara Golemon 99b6724a4c BugFix 28187 parse_url does not handle scheme://[0123:4567::89]:12345/etc style IPv6 embedded address URLs 2004-04-27 19:13:13 +00:00
Marcus Boerger e44c06c14e - More examples 2004-04-27 18:15:00 +00:00
Marcus Boerger 953a09969f - Optional parameter to class_exists() that can be used to bypass
__autoload() which can be helpfull in __autoload() itself.
2004-04-27 18:09:40 +00:00
Ilia Alshanetsky 32321488ab Removed C++ style comments. 2004-04-27 17:33:59 +00:00
Marcus Boerger 11690da164 - Some pretection against out-of-memory situations 2004-04-27 17:12:11 +00:00
Marcus Boerger c56ca79733 Fix test 2004-04-27 15:48:20 +00:00
Marcus Boerger 11ce65aeaf - Fix warnings 2004-04-27 15:47:55 +00:00
Marcus Boerger 7a5380297b - Fix ArrayIterator iteration
- Make it seekable
2004-04-27 15:42:45 +00:00
Marcus Boerger 7f37b3f651 Fix LimitIterator by using new handler 2004-04-27 15:41:26 +00:00
Marcus Boerger c896fa34a8 Fix documentation 2004-04-27 15:39:33 +00:00
Marcus Boerger e1cd098925 - no unneccessary retval initialization
- new c-level iterator handler invalidate_current that is optionally
  used to clear internal caching like in implementation of Iterator
2004-04-27 15:38:07 +00:00
Andi Gutmans e780c42f21 - Fix prototypes 2004-04-27 15:18:33 +00:00
Ilia Alshanetsky c527cc8708 Fixed bug #28184 (C++ comments in GD library sources). 2004-04-27 14:59:07 +00:00
Rob Richards 80fd6dcaa4 add relaxNG support
set xml base directory so it is consistant
add validation examples
2004-04-27 10:46:21 +00:00
Greg Beaver 1f22d848e9 fix bug 1242 - notice if multi-dimensional array is passed as a parameter
add optional parameter to staticHasErrors() that allows error determination for a single package
2004-04-27 04:31:39 +00:00
e744a448ab ChangeLog update 2004-04-27 00:35:21 +00:00
Marcus Boerger b526220462 Complete implementation 2004-04-26 22:01:12 +00:00
Marcus Boerger 5ffeb236f4 Update 2004-04-26 21:34:45 +00:00
Ilia Alshanetsky e7d225fda8 Removed pointless check. 2004-04-26 20:14:11 +00:00
Marcus Boerger 54e5ad6b6e Fix prototype 2004-04-26 18:54:18 +00:00
Antony Dovgal af96ad84b5 hmm. this comma is supposed to be a semicolon. 2004-04-26 14:49:41 +00:00
210244b339 ChangeLog update 2004-04-26 00:35:44 +00:00
Derick Rethans c452e275e7 - MFB: Fixed bug #28147 (Crash with drawing anti-alised lines) 2004-04-25 19:45:02 +00:00
Ilia Alshanetsky be901ebeaf Fixed test. 2004-04-25 16:50:47 +00:00
Marcus Boerger e058626c66 Add new iterator example AppendIterator and use it in findfile.php example.
# The initial idea came from a request by Sebastian
2004-04-25 13:06:15 +00:00
Marcus Boerger 9238d1bbbc With the new inheritance rules we need an explicit append method. 2004-04-25 13:04:36 +00:00
Marcus Boerger 5fff6fa361 Skip correct amount of stack entries 2004-04-25 11:28:46 +00:00
Marcus Boerger c5abb9b24c Capture potential problem by error message 2004-04-25 11:25:25 +00:00
Marcus Boerger 286f75c891 Show number of classes 2004-04-25 11:22:56 +00:00
Marcus Boerger 8116ba4249 BFN 2004-04-25 11:19:57 +00:00
Marcus Boerger 5b755c40ea Fix several issues
- bugfix #27063
- bugfix #27929
- bugfix #28099
- bugfix #28125
# The amount of code is needed to solve the return by reference problem.
# dual_it and derived also need their own iterator handlers to be able
# to return by reference.
2004-04-25 11:14:11 +00:00
Andi Gutmans 87a9f7bdbb - RC3-dev 2004-04-25 10:13:08 +00:00
Andi Gutmans 1ccf8dde15 - This was forgotten 2004-04-25 09:15:57 +00:00
Andi Gutmans 94c44ea9eb - RC2 2004-04-25 08:32:50 +00:00
Wez Furlong df14ec2fe2 Spell it out. 2004-04-25 00:41:34 +00:00
a4e94e33b3 ChangeLog update 2004-04-25 00:34:28 +00:00
Ilia Alshanetsky 4e4d861046 Fixed test. 2004-04-24 22:38:51 +00:00
f977f8a90b ChangeLog update 2004-04-24 00:34:14 +00:00
Andi Gutmans 399073f9d4 - Fixed bug #27923. foreach() without a key should not check if the key
- is a reference (Adam)
2004-04-23 21:53:46 +00:00
Andi Gutmans fa2e902436 NEWS 2004-04-23 21:51:39 +00:00
Derick Rethans 43aed8f70b This was already in NEWS for the branch, removing 2004-04-23 18:20:20 +00:00
Derick Rethans 858fc0015f Cleanup NEWS 2004-04-23 18:19:03 +00:00
Rasmus Lerdorf 191a661f8c MFB: Fix for bug #27810 2004-04-23 18:08:58 +00:00
Rob Richards 838d30a5cd move libxml error handler ro rinit/rshutdown to keep it local to php 2004-04-23 17:31:44 +00:00
Ilia Alshanetsky 7a11fe48b6 Fixed bug #28087 (Do not force mysql.trace_mode to 0 on every request). 2004-04-23 17:03:52 +00:00
Derick Rethans 9ee23d7066 - Fixed buffer overflow in phpinfo() for Zend Extension Api NO. 2004-04-23 13:28:25 +00:00
Wez Furlong 16f8b66e46 Another one bites the dust 2004-04-23 13:28:05 +00:00
Dmitry Stogov eba2aa9bd0 Support for <![CDATA[ ]]> for string/hexbinary/base64binary data 2004-04-23 12:22:41 +00:00
Sara Golemon d5e0742e8d In-HEAD bugfix# 28115 2004-04-23 03:37:20 +00:00
f1bad5dab7 ChangeLog update 2004-04-23 00:36:46 +00:00
Marcus Boerger af17964ef4 Avoid warning to interfere test result 2004-04-22 22:55:18 +00:00
Ilia Alshanetsky 9da8328bae Empty query checks, bug #28112. 2004-04-22 22:34:29 +00:00
Marcus Boerger 920e4235a4 Add test for bug #28112 2004-04-22 22:29:41 +00:00
Marcus Boerger ddfb337577 bugfix #28112 2004-04-22 22:26:02 +00:00
Wez Furlong 696663bc3d Add test 2004-04-22 14:29:33 +00:00
Wez Furlong 91dc1a516a A working fix for the safearray mapping bug. 2004-04-22 14:27:11 +00:00
Wez Furlong 73f49c16f4 The fix for the vc7 libc putenv bug is also needed here to avoid a crash. 2004-04-22 14:26:03 +00:00
Hartmut Holzgraefe 9833b429d6 Depercating mime_magic in favor of PECL::fileinfo 2004-04-22 01:24:12 +00:00
Wez Furlong c50726fa4b (probable) fix for Bug #27974: PHP Arrays are not mapped to VARIANTs. 2004-04-22 00:50:49 +00:00
f52e75742b ChangeLog update 2004-04-22 00:35:20 +00:00
Ilia Alshanetsky 8694cd135d Fixed possible crash inside pg_copy_(to|from) function if delimiter is more
then 1 character long.
2004-04-22 00:31:55 +00:00
Ilia Alshanetsky d641ba3eae More C++ comments. 2004-04-21 23:16:34 +00:00
Ilia Alshanetsky 1b80b33b87 C++ comments are ungood ;). 2004-04-21 23:06:26 +00:00
Wez Furlong 03b4f344a0 News about the ssl server socket bug 2004-04-21 23:02:56 +00:00
Wez Furlong e9920ede1f Fix bug #28096 - stream_socket_accept() on an SSL server socket doesn't
enable SSL on the accepted socket.

- Add cipher list context option
- Add helpful hint about why SSL server socket fails with mysterious
  error (eg: you need an SSL certificate for most ciphers).
2004-04-21 23:02:06 +00:00
Hartmut Holzgraefe 375b5df63d libmagic will only consume up to HOWMANY (hardcoded to 65536) bytes
from a file, so lets save bandwith and memory by limiting us to this
2004-04-21 22:49:35 +00:00
Dmitry Stogov c94f0276b0 Support for multiref data 2004-04-21 16:57:18 +00:00
Wez Furlong 0fb4bf9771 Fixed bug #19749 (shouldn't mmap() files larger than memory_limit) 2004-04-21 12:02:47 +00:00
Andi Gutmans 206f0da25a - RC2-dev 2004-04-21 10:34:27 +00:00
Andi Gutmans 40c20d3d72 - Prepare for RC2RC2 (if everything is OK especially Zeev's interface
- patch I'll roll RC2 tomorrow).
2004-04-21 09:59:52 +00:00
Wez Furlong d6cb1431ac yaz moved 2004-04-21 08:57:16 +00:00
Wez Furlong 8090684c5a Moved ext/yaz to PECL. 2004-04-21 08:56:34 +00:00
Zeev Suraski 242aa98b0a Restore fatal error in case a method that's supposed to implement an
interface/abstract method, breaks its prototype
2004-04-21 08:44:37 +00:00
Derick Rethans 142edcf01f - Reorder news 2004-04-21 07:23:40 +00:00
42f26b6fae ChangeLog update 2004-04-21 00:35:41 +00:00
Ilia Alshanetsky 8a23a020e9 Fixed possible memory leaks.
Prevent shm_attach() from destroying non-shm resources.
2004-04-21 00:11:28 +00:00
Frank M. Kromann bfdcc96274 mssql related fixes 2004-04-20 23:55:02 +00:00
Frank M. Kromann 9909a36992 Fix #28007. Compile fails when the SHORT type is undefined (older versions of FreeTDS) 2004-04-20 23:37:08 +00:00
Frank M. Kromann c5f8871734 Fix problem getting return value from stored procedure when it returns multiple results 2004-04-20 23:30:51 +00:00
John Coggeshall 04764e1942 minor update 2004-04-20 18:29:16 +00:00
John Coggeshall 8e1391ce49 No need for exception function, and renamed the 'error_buf' prop to
errorBuffer to conform with the rest of the ext.
2004-04-20 18:28:09 +00:00
Andi Gutmans 844b4738fd - Fix news 2004-04-20 14:18:56 +00:00
Andi Gutmans 71f99771b0 - More news 2004-04-20 14:15:57 +00:00
Andi Gutmans 173782b73e - Fix bug #27283 - Exceptions where the last catch() statement was sometimes
- skipped.
2004-04-20 14:14:55 +00:00
Christian Stocker 65bc57a81f - make static methods calls work from within xslt
- extended tests
2004-04-20 09:24:24 +00:00
e9c3ac04f5 ChangeLog update 2004-04-20 00:35:29 +00:00
Ilia Alshanetsky 39f820b8b8 Fixed compiler warnings. 2004-04-20 00:26:48 +00:00
Marcus Boerger dddbe6f60e Add new tests (by magnus) 2004-04-20 00:00:51 +00:00
Rob Richards f726dc7af1 add ext/libxml/ to the headers path 2004-04-19 19:46:00 +00:00
Rob Richards 5094e4e67c initial revision
requires PHP 5
2004-04-19 18:55:02 +00:00
Marcus Boerger be85c9049b show ini entries and classes for extensions. 2004-04-19 18:02:49 +00:00
Wez Furlong daa90c915c Fix #27865; don't dup STDIN, STDOUT or STDERR when running under CLI. 2004-04-19 17:41:39 +00:00
Derick Rethans 3326b8790e - Is it really this hard?</jani> 2004-04-19 15:15:49 +00:00
John Coggeshall bf937669e0 Adding tidy error handling news 2004-04-19 15:14:31 +00:00
Wez Furlong 73af3afdbe and the news 2004-04-19 15:08:11 +00:00
Wez Furlong 398b4a2fbb Add pty support to proc_open() for systems with Unix98 ptys.
# With permission from Andi
2004-04-19 15:07:30 +00:00
Edin Kadribasic 9bf6b05b87 No need to export anything. Fixes win32 build 2004-04-19 14:13:41 +00:00
7537d97280 ChangeLog update 2004-04-19 00:34:18 +00:00
Ilia Alshanetsky 60292114a0 Simplify code via the use of macros. 2004-04-18 21:49:10 +00:00
Derick Rethans abff9671fb - Whitespace 2004-04-18 14:04:48 +00:00
John Coggeshall 544cdffd90 Fixing a tidy_getopt() bug, and converting all exceptions to E_WARNING 2004-04-18 07:58:19 +00:00
20d52aa8dc ChangeLog update 2004-04-18 00:34:17 +00:00
Derick Rethans c8c5e8bbe6 - MFH: Fix for bug #28042 (greek letters in html to entitity mapping not
correct)
2004-04-17 23:08:02 +00:00
Marcus Boerger d58fe0357d Retval may not be set when zend_execute() is overloaded 2004-04-17 14:02:40 +00:00
57049aff26 ChangeLog update 2004-04-17 00:34:11 +00:00
John Coggeshall ba43e31e24 Fixed construct bug and Windows build. 2004-04-16 21:51:59 +00:00
Derick Rethans 2ed9c955b8 - Fix initializations 2004-04-16 18:55:19 +00:00
Uwe Schindler fb25210072 set Sybase default APPNAME to ("PHP " PHP_VERSION) 2004-04-16 16:27:19 +00:00
John Coggeshall 1fb0de4a6d Modified error handling:
- Trivial errors have been reduced to E_NOTICEs if possible
  - Bad, but not script-stopping errors (i.e. file not file) are E_WARNING
  - Truly bad things that make the extension unusable are not E_ERROR

  Exceptions are thrown only in a OO context for E_WARNINGs.
2004-04-16 15:46:41 +00:00
355678208d ChangeLog update 2004-04-16 00:36:43 +00:00
Marcus Boerger 43e44e4e9f Bugfix #28012, now for snprintf 2004-04-15 23:08:22 +00:00
Marcus Boerger c007130382 Bugfix #28012 spprintf() output inconsistent for %p 2004-04-15 23:04:49 +00:00
Marcus Boerger a455d7846d Handle failure in get_current_data 2004-04-15 21:32:34 +00:00
Andi Gutmans 14edc95ff8 - Temporary fix for bug #27869
- George, you need to implement clone in order for "clone" and
- compatibility mode to work.
2004-04-15 17:25:51 +00:00
Wez Furlong 8307c0204c Fix bug that prevented --without-gd from working 2004-04-15 16:09:36 +00:00
Hartmut Holzgraefe 1d444f9ad2 typo 2004-04-15 15:27:08 +00:00
Hartmut Holzgraefe 702ca7f53f be a bit more explanatory ... 2004-04-15 15:03:26 +00:00
Ilia Alshanetsky dda0dd4825 Fixed test failure if session.use_trans_sid is enabled. 2004-04-15 13:37:50 +00:00
foobar 4a45a8e948 Remove duplicate entries 2004-04-15 12:25:57 +00:00
Wez Furlong 81835bbf47 been stable for a long time now 2004-04-15 11:52:40 +00:00
Dmitry Stogov 8d8c50fed3 Fixed bug #27681 (soap extension fails without HAVE_TM_GMTOFF). 2004-04-15 10:27:53 +00:00
Dmitry Stogov 0d42248ad8 Calls to zend_exception_error() were removed. 2004-04-15 09:35:27 +00:00
foobar 724a221a7b reorder..is this so hard..? :) 2004-04-15 02:37:42 +00:00
c4435ad7b2 ChangeLog update 2004-04-15 00:35:44 +00:00
Marcus Boerger 1c7fdeac21 BFN 2004-04-14 23:41:22 +00:00
Marcus Boerger 00da44519c Bugfix #27997 2004-04-14 23:26:56 +00:00
Frank M. Kromann 6ba2e4bc51 Declare variables before calling functions. This makes tidy compile on Win32. 2004-04-14 19:01:45 +00:00
Andi Gutmans 4774563966 - Add comment 2004-04-14 17:12:04 +00:00
Edin Kadribasic d5c6825241 According to Wez, this is not needed.
It also breaks win32 build.
2004-04-14 13:56:18 +00:00
Andi Gutmans 245dd7367d - RC2-dev 2004-04-14 11:24:17 +00:00
Andi Gutmans acc4cd17ce - RC2RC1 2004-04-14 11:03:47 +00:00
Derick Rethans 3c28fbd6dd - Enable iconv by default 2004-04-14 07:42:38 +00:00
66f5637723 ChangeLog update 2004-04-14 00:35:36 +00:00
Marcus Boerger 087ed66b69 Classnames shall start with an uppercase character 2004-04-13 20:25:49 +00:00
Marcus Boerger 27aee6b1dd Update error messages in tests 2004-04-13 19:08:54 +00:00
Marcus Boerger f0c91bac50 New tests (and ordering of tests) 2004-04-13 19:06:39 +00:00
Marcus Boerger ad2471cbbb Bugfix #27979 2004-04-13 19:06:16 +00:00
Ilia Alshanetsky 793140873b Another setting leak in session code (bug #27963). 2004-04-13 18:18:22 +00:00
Sara Golemon a7ba08a0bd Export symbols needed by bz2_filter 2004-04-13 17:54:47 +00:00
Wez Furlong d16ad34368 This wasn't updated for new parameters for object handlers yet... 2004-04-13 17:51:36 +00:00
foobar e1c7a424ce BFN 2004-04-13 17:28:23 +00:00
Stanislav Malyshev 3c84c9c4bd fix bug #27979 2004-04-13 16:21:24 +00:00
Zeev Suraski 2310acb57a Fix debug_backtrace to show arguments again
We need to merge code from debug_backtrace & debug_print_backtrace at
some point!
2004-04-13 16:07:19 +00:00
Andi Gutmans 4f47f33402 - Fix API no of Engine 2. The first number is the engine version and the
- rest is the API_NO. This way engine2_api_no is always greater than
- engine1_api_no.
2004-04-13 15:27:36 +00:00
Andi Gutmans 979da66118 - Add hook for exception handler (Derick) 2004-04-13 15:19:21 +00:00
Ilia Alshanetsky 254c8d6ce9 Fixed bug #27963 (Session lifetime setting may leak between requests). 2004-04-13 00:39:05 +00:00
9d10977fd7 ChangeLog update 2004-04-13 00:34:35 +00:00
Derick Rethans 2c259a7979 - Add fontpath for win98/XP (Patch by Friedhelm Betz) 2004-04-12 21:42:42 +00:00
Marcus Boerger 33cdc9ed36 Fix order of macro parameter (synch with other macros) 2004-04-12 13:02:54 +00:00
Andi Gutmans 67502a2e7d - modifyable -> modifiable 2004-04-12 12:22:26 +00:00
John Coggeshall 9b21e0d0a9 - Removed things related to attribute classes / consts which no
longer exist in Tidy
- Changed protos in comment blocks to studlyCaps
- Fixed problem where Tidy would throw exceptions if called from
  a procedural context. Tidy will now cause E_ERRORs if called from
  procedural form.
2004-04-12 03:14:19 +00:00
15bc137fef ChangeLog update 2004-04-12 00:33:45 +00:00
Ilia Alshanetsky 8075d977e1 Open basedir & safe_mode exception when copying or attaching to a memory
only database.
2004-04-11 18:53:32 +00:00
14e2e82cf5 ChangeLog update 2004-04-11 00:33:36 +00:00
Marcus Boerger ad4755e257 studlyCaps 2004-04-10 13:56:27 +00:00
f95488a3c9 ChangeLog update 2004-04-10 00:34:29 +00:00
Sara Golemon 3feae65f70 BugFix: Copy/Paste mistake referenced undefined variable on platforms without gettimeofday() 2004-04-09 19:18:59 +00:00
Ard Biesheuvel ff66870b4c Changed ibase_user_[add|modify|delete]() to use service resources 2004-04-09 18:45:30 +00:00
Ilia Alshanetsky 824f9a4d11 Fixed bug #27928 (sqlite incorrectly handles invalid filenames). 2004-04-09 18:02:05 +00:00
Andi Gutmans 7bedd9f824 - NEWS 2004-04-09 14:43:20 +00:00
Andi Gutmans 4a24cbe276 - Fix bug #26441 (When __set() returned a value it corrupted it) 2004-04-09 14:42:06 +00:00
Greg Beaver 8a91c1d5b8 re-organize as per PEAR-Core discussion 2004-04-09 07:38:48 +00:00
Greg Beaver dfa4a5d927 as per PEAR-Core discussion, remove all but absolutely essential
packages for the installer, and for PEAR_Frontend_Web
2004-04-09 01:12:41 +00:00
ca8dc5aca3 ChangeLog update 2004-04-09 00:33:16 +00:00
Greg Beaver 7ab7b99ac1 oops, PHPUnit2, not PHPUnit 2004-04-08 23:52:36 +00:00
Marcus Boerger 6e3b81e385 Add new test 2004-04-08 22:47:13 +00:00
Marcus Boerger 42370213f7 Fix toString() issue again 2004-04-08 22:46:43 +00:00
Marcus Boerger 84ddc25df6 BFN 2004-04-08 20:38:17 +00:00
Marcus Boerger 8ccfca0c41 Bugfix #27519 Reflection_Function constructor crashes with non-existant
function's name
2004-04-08 20:37:06 +00:00
Derick Rethans 3ec166aba4 - Add missing "CEST" timezone 2004-04-08 19:21:05 +00:00
Frank M. Kromann b2913063e0 Remove debug output 2004-04-08 19:08:37 +00:00
Jon Parise ba863b4558 Include Mail 1.1.3 with PHP 5. 2004-04-08 18:27:26 +00:00
Derick Rethans 1f932c30d6 - Added reworded destructor change 2004-04-08 16:19:58 +00:00
Derick Rethans b91a947d5e - Added test and not the diff ;-) 2004-04-08 16:17:35 +00:00
foobar 5d3900a2e9 remove crap 2004-04-08 15:58:35 +00:00
Greg Beaver b3cec4d9d4 Dan wants tabs -> spaces 2004-04-08 15:03:21 +00:00
Greg Beaver eaa48d3743 forgot phpunit -> phpunit2 for php5 2004-04-08 14:59:31 +00:00
Stefan Esser 6b12a45247 Fixed: possible remote overflow and possible efree(NULL) crash 2004-04-08 14:58:04 +00:00
Greg Beaver fdc1b53183 this should update the list
# Pierre-Alain, have you tested frontend_web with pager 2 yet?
2004-04-08 14:30:13 +00:00
Derick Rethans 9d4f01a8af - Test case for bug #20382 2004-04-08 14:18:23 +00:00
Wez Furlong 5e8d0919cf Add code to fetch the pear bundle based on pear/go-pear-list.php
For the moment, this is turned off, but it should be turned on ready for
the next RC.
(waiting for feedback from Edin and the PEAR guys)
2004-04-08 13:36:11 +00:00
Wez Furlong 61144768ed Add this list here, so that pear-core guys can manipulate the PEAR bundle
for the win32 snapshot.
2004-04-08 13:32:50 +00:00
Wez Furlong a8757b11e6 Enable mbregex in win32 build 2004-04-08 11:01:51 +00:00
foobar bb276eb8d4 - Fix test file outputs. 2004-04-08 08:39:41 +00:00
foobar 1789e67088 pfft.. 2004-04-08 07:56:50 +00:00
456c023e83 ChangeLog update 2004-04-08 00:35:41 +00:00
Moriyoshi Koizumi d3a8b31310 - Add missing checks. Maybe fixes PR #27680 2004-04-08 00:30:06 +00:00
Edin Kadribasic 31de856abb Allow compilation with gdlib 1.8 2004-04-07 22:27:32 +00:00
Frank M. Kromann d956e33ed2 avoid deleting needed files when the .cvsignore file contains empty lines (mysqli) 2004-04-07 18:48:23 +00:00
Frank M. Kromann 9a10491752 Export symbols required by zlib_filter extension 2004-04-07 18:47:09 +00:00
Rob Richards fb39035e77 Fix class name 2004-04-07 16:48:11 +00:00
Rob Richards e8340dd2c5 BFN 2004-04-07 16:25:55 +00:00
Rob Richards e32f012e65 Fix bug #27821 xml_parse segfaults when xml_set_object called from class method
fix memleaks in compat.c
2004-04-07 16:24:17 +00:00
Andi Gutmans c534a9e782 - Hopefully fix the debug_backtrace() code. 2004-04-07 15:29:09 +00:00
foobar 99a2a59f01 cleanup 2004-04-07 15:25:29 +00:00
Andi Gutmans 7264ffe50d - Fix crash bug in zend_debug_backtrace(). No idea how come this survived
- for so long....
2004-04-07 14:02:29 +00:00
foobar f1823e58da Revert the patch to "fix" #27664 and added more informal error msg. 2004-04-07 13:56:33 +00:00
Ard Biesheuvel 59f0817205 Don't define ibase_service struct type unless its member types are defined 2004-04-07 10:36:00 +00:00
Stanislav Malyshev 72e2e4fea3 Fix incomplete class for the new object model 2004-04-07 08:06:09 +00:00
84930ecbdf ChangeLog update 2004-04-07 00:34:16 +00:00
634 changed files with 19453 additions and 13034 deletions

No files matched your search

+2976
View File
File diff suppressed because it is too large. Load diff
+64 -3
View File
@@ -1,24 +1,85 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ????? 2004, PHP 5 Release Candidate 2
- Force destructors to have empty signatures. (Marcus)
?? ??? 2004, PHP 5 Release Candidate 3
- Moved the PDFLib extension to PECL. (Wez)
- Added support for dumping private/protected properties to var_dump().
(Andrey)
- Added count() support for COM arrays. (Wez)
- Changed user error handler mechanism to relay to built-in error handler if it
returns false. (Andrei)
- Changed class type hints for function parameters to not allow the passing of
NULL values. (Andi)
- Changed tidy_node to tidyNode and removed tidy_exception. (John)
- Fixed ip2long() to return FALSE if an IP address passed to this function
is not valid. (Derick)
- Fixed memory leak in memory manager. (Andi)
- Fixed problem with exceptions returning from include(). (Dmitry)
- Fixed bug #28311 (Transparency detection code is off by 1).
(Ilia, pikeman at pikeman dot sytes dot net)
- Fixed bug #28304 (Missing bounds check inside imagefilter()). (Ilia)
- Fixed bug #28300 (Userspace stream/filter names forced to lowercase). (Sara)
- Fixed bug #28287 (stream_*_register() not calling __autoload()). (Sara)
- Fixed bug #28267 (php_image_filter_contrast calls gdImageBrightness). (Ilia)
- Fixed bug #28239 (No results returned on SOAP call, no error given). (Dmitry)
- Fixed bug #28161 (COM: Array style properties could not be accessed). (Wez)
- Fixed bug #28125 (ArrayObject leaks when accessing elements). (Marcus)
- Fixed bug #28099 (ArrayObject doesn't implement ArrayAccess). (Marcus)
- Fixed bug #27929 (SPL: change visibility of ArrayIterator::__construct).
(Marcus)
- Fixed bug #27640 (memory leak of registered_zend_ini_directives). (Dmitry)
- Fixed bug #27063 (SPL: ArrayObject does not handle PPP correctly). (Marcus)
25 Apr 2004, PHP 5 Release Candidate 2
- Implementing an interface/abstract method with the wrong prototype is now
a fatal error. (Zeev)
- Reimplemented zend.ze1_compatibility_mode to have better PHP 4 compliance.
(Dmitry, Andi)
- Under CLI, fclose() on php://stdin, php://stdout and php://stderr will now
close the real stream. Please update your CLI scripts to use STDIN, STDOUT
and STDERR constants instead of fopen()/fclose(). (Wez)
- Moved yaz extension to PECL. (Wez)
- Added pty support to proc_open(). (Wez)
- Added possibility to check in which extension an internal class was defined
in using reflection API. (Marcus)
- Changed tidy error handling to no longer use exceptions and
renamed the "error_buf" property to errorBuffer. (John)
- Changed class and method names to use studlyCaps convention. (Marcus)
- Changed language parser to throw errors when a non-empty signature is used in
a destructor definition. (Marcus)
- Changed HTTP file uploads not to throw E_WARNINGs and E_NOTICEs. The error
value in the $_FILES global should be used for error handling. (Derick)
- Changed SQLite extension to use studlyCaps convention in its OO API. (Marcus)
- Changed __construct() to always take precedence over old style constructor.
(Dmitry)
- Fixed handling of return values from storred procedures in mssql_execute()
with multiple result sets returned. (Frank)
- Fixed bug #28096 (stream_socket_accept() doesn't work with ssl). (Wez)
- Fixed bug #28007 (compile mssql extension with old versions of FreeTDS
fails). (Frank)
- Fixed bug #27997 (SPL: Crash with getInnerIterator()). (Marcus)
- Fixed bug #27974 (COM doesn't pass array parameters). (Wez)
- Fixed bug #27928 (sqlite incorrectly handles invalid filenames). (Ilia)
- Fixed bug $27923 (in some cases using foreach() to iterate over values
led to a false error message about the key being a reference). (Adam)
- Fixed bug #27865 (STDIN, STDOUT, STDERR are dup()d under CLI). (Wez)
- Fixed bug #27821 (xml_parse() segfaults when xml_set_object() is called from
class method). (Andi, Rob)
- Fixed bug #27742 (WDSL SOAP Parsing Schema bug). (Dmitry)
- Fixed bug #27722 (Segfault on schema without targetNamespace). (Dmitry)
- Fixed bug #27719 (mktime issues on and around DST changeover). (Rasmus)
- Fixed bug #27681 (soap extension fails without HAVE_TM_GMTOFF). (Dmitry)
- Fixed bug #27641 (Object cloning in ze1_compatibility_mode was reimplemented)
(Dmitry, Andi)
- Fixed bug #27628 (Simplify the process of making a POST request via stream
context). (Ilia)
- Fixed bug #27619 (filters not applied to pre-buffered stream data). (Sara)
- Fixed bug #27519 (Reflection_Function constructor crashes with non-existant
function's name). (Marcus)
- Fixed bug #27469 (serialize() objects of incomplete class). (Dmitry)
- Fixed bug #27457 (handling of numeric indexes in strtr()). (Dmitry)
- Fixed bug #27397 (debug_backtrace() not showing function arguments). (Zeev)
- Fixed bug #27283 (The last catch statement was sometimes skipped). (Andi)
- Fixed bug #26441 (When __set() returned a value it corrupted it). (Andi)
- Fixed bug #19749 (shouldn't mmap() files larger than memory_limit). (Wez)
18 March 2004, PHP 5 Release Candidate 1
- Fixed numerous bugs with the just-in-time auto-global initialization, that
+11 -2
View File
@@ -1,11 +1,20 @@
[IMPORTANT NOTICE]
------------------
Please do not ask developers why some or all tests are failing in
your environment! Let us know if you find why it fails. Thank you.
Failed tests usualy indicate a problem with your local system setup
and not within PHP itself (at least for official PHP release versions).
You may decide to automaticaly submit a test summary to our QA workflow
at the end of a test run.
Please do *not* submit a failed test as a bug or ask for help on why
it failed on your system without providing substantial backup information
on *why* the test failed on your special setup. Thank you :-)
[Testing Basics]
----------------
The easiest way to test your PHP build is to run "make test" from the
command line after successfully compiling. This will run the complete
tests for all enabled functionalities and extensions using the PHP
CLI binary.
To execute test scripts, you must build PHP with some SAPI, then you
type "make test" to execute all or some test scripts saved under
"tests" directory under source root directory.
-4
View File
@@ -7,13 +7,9 @@ Zend
dimensional arrays.
* Look at replacing c-lib call tolower().
* Make hash API functions work with HASH_OF() to save time.
* Allow to set a default value for call-by-reference-parameters.
eg: function hello (&$pallo = NULL) {}
* Add configure test to determine if dlsym() requires underscore and set
DLSYM_NEEDS_UNDERSCORE accordingly. Perl and zsh have it in configure,
for example. (DONE?)
* Allow foreach ($array as $k => &$val) syntax. right now we cannot
traverse an array without copying each element.
* Native large number support (probably with GNU GMP)
* Const'ify APIs. Right now, many functions leave parameters untouched,
but don't declare those as const. This makes interaction with other
+17
View File
@@ -0,0 +1,17 @@
Zend Engine
-----------
- Look at making zend_constant value member be a zval* instead of zval. (Andi)
- Add the patch for referring to existing .ini vars in .ini files. (Andrei)
- Implement inheritance rules for type hints. (Marcus)
- Implement true/false/NULL as keywords (apply the patch). (Andi, Marcus)
- Implement typehinting for arrays (apply the patch). (Andi, Marcus)
- Find a keyword for the if-set-or operator (apply the patch). (Marcus, all)
- Fix ZTS destruction (apply the patch). (Marcus)
Build System
------------
- Implement load order of built-in extensions (apply the patch). (Wez)
Standard Library
----------------
- Implement new time/date parsing and handling functions. (Derick)
-102
View File
@@ -16,83 +16,6 @@ Responsibility: Andi, Stig?
Time frame: ?
Component: Introspection
get_function_definition(<is_callable> [field]) =>
array(
file => filename
line_start =>
line_end =>
parameters => array( name, byref, default )
static_variables => array( name, value/default )
scope => 'namespace' | 'class' | null
namespace => classname | namespacename | 'main'
protection => protection_flags
phpdoc => pre-scanned-phpdoc-string
type => 'internal' | 'user'
)
get_class_definition(<class> [field]) =>
array(
type => 'internal' | 'user'
file => filename
line_start =>
line_end =>
name => pretty-name
parent => classname | namespace | null
flags => bitfield (ABSTRACT)
methods => array( array( name, phpdoc ) )
default_properties => array( array( name, value, phpdoc ) )
private_properties => array( array( name, value, phpdoc ) )
protected_properties => array( array( name, value, phpdoc ) )
public_properties => array( array( name, value, phpdoc ) )
static_members => array( array( name, value, phpdoc ) )
constants => array( array( name, value, phpdoc ) )
classes => array( array( name, phpdoc ) )
phpdoc => pre-scanned-phpdoc-string
)
get_constant_definition(<constant> [field]) =>
array(
file => filename
line_start =>
line_end =>
name =>
value =>
phpdoc =>
)
get_global_variable_defintion(<name> [field]) =>
array(
file =>
line_start =>
line_end =>
name =>
phpdoc =>
)
We tried to take into account the implementation of each piece of
information, and there are some that are problematic, especially those
regarding constants and global variables (where do we store the extra
information?)
With "pre-scanned-phpdoc-string" we mean converting:
/**
* Blah blah blah
* @param foo ...
*/
to:
Blah blah blah
@param foo
The rest of the phpdoc handling should be left to an extension.
Responsibility: Stig, Andrei, Harald
Time frame: ?
Component: Redesign of API Versioning
Responsibility: ?
Time frame: 1 month
@@ -172,31 +95,6 @@ Responsibility: Sterling, Harald
Time frame: ?
Component: MySQL Extension
Complete rewrite, leveraging the new MySQL 4 / MySQL 5
features.
Responsibility: Georg Richter, Zak Greant
Timeframe: ?
Component: XML
- Rewrite DOMXML and incorporate all (or most of) W3C-DOM2.
- Use the new ZE2 features (Exceptions, setter/getter).
- Add SAX(2), XML Schema.
- XSLT, HTML, XPath, XPointer, DTD Validation will still be
supported, have to find a meaningful API for it.
- Break BC, warn users now.
- Look at the libxml2 patch by lukas schröder and see if we can prevent
memory leaks with it (anyway, getting rid of mem-leaks and intelligent
memory management is on top prio...)
- In the longer term, domxml (or another name, as with todays features
domxml is a little bit misleading) shall be the main xml-class, which
covers most of what's needed for decent XML support in PHP ;)
But there is certainly place for others like Sablotron etc.
Responsibility: Christian Stocker
Timeframe: ?
Component: Test Suite
Extending the test suite with atleast a test for every
function in an extension that doesn't require external
+53 -14
View File
@@ -34,6 +34,9 @@ typedef struct {
size_t size;
ts_allocate_ctor ctor;
ts_allocate_dtor dtor;
#ifdef MBO_0
int done;
#endif
} tsrm_resource_type;
@@ -158,18 +161,14 @@ TSRM_API void tsrm_shutdown(void)
next_p = p->next;
for (j=0; j<p->count; j++) {
/*
Disabled calling dtors on tsrm_shutdown - calling dtors
in tsrm_shutdown makes modules registering TSRM ids
to crash, if they have dtors, since the module is unloaded
before tsrm_shutdown is called. Can be re-enabled after
tsrm_free_id is implemented.
if (resource_types_table && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j], &p->storage);
if (p->storage[j]) {
#ifdef MBO_0
if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j], &p->storage);
}
#endif
free(p->storage[j]);
}
*/
free(p->storage[j]);
}
free(p->storage);
free(p);
@@ -227,6 +226,9 @@ TSRM_API ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].size = size;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].ctor = ctor;
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].dtor = dtor;
#ifdef MBO_0
resource_types_table[TSRM_UNSHUFFLE_RSRC_ID(*rsrc_id)].done = 0;
#endif
/* enlarge the arrays for the already active threads */
for (i=0; i<tsrm_tls_table_size; i++) {
@@ -281,9 +283,16 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
tsrm_new_thread_begin_handler(thread_id, &((*thread_resources_ptr)->storage));
}
for (i=0; i<id_count; i++) {
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
if (resource_types_table[i].ctor) {
resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage);
#if MBO_0
if (resource_types_table[i].done) {
(*thread_resources_ptr)->storage[i] = NULL;
} else
#endif
{
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
if (resource_types_table[i].ctor) {
resource_types_table[i].ctor((*thread_resources_ptr)->storage[i], &(*thread_resources_ptr)->storage);
}
}
}
@@ -428,6 +437,36 @@ void ts_free_thread(void)
/* deallocates all occurrences of a given id */
void ts_free_id(ts_rsrc_id id)
{
#ifdef MBO_0
int i;
int j = TSRM_UNSHUFFLE_RSRC_ID(id);
tsrm_mutex_lock(tsmm_mutex);
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Freeing resource id %d", id));
if (tsrm_tls_table) {
for (i=0; i<tsrm_tls_table_size; i++) {
tsrm_tls_entry *p = tsrm_tls_table[i];
while (p) {
if (p->count > j && p->storage[j]) {
if (resource_types_table && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j], &p->storage);
}
free(p->storage[j]);
p->storage[j] = NULL;
}
p = p->next;
}
}
}
resource_types_table[j].done = 1;
tsrm_mutex_unlock(tsmm_mutex);
TSRM_ERROR((TSRM_ERROR_LEVEL_CORE, "Successfully freed resource id %d", id));
#endif
}
+404
View File
@@ -1,3 +1,407 @@
2004-06-02 Andi Gutmans <andi@zend.com>
* zend_mm.h:
- Don't use ZEND_MM in Windows
2004-06-02 Stanislav Malyshev <stas@zend.com>
* zend_execute.c:
fix incdec - make value's refcount non-zero when passing to
write_property - otherwise __set caller cleanup could kill it.
2004-06-01 Andi Gutmans <andi@zend.com>
* zend.c:
- If user error handler returns "false" then we relay to the built in error
handler
2004-05-31 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_reflection_api.c:
Refcount must not be set separatley again.
* zend_reflection_api.c
zend_reflection_api.c:
Add missing initialization
* zend_compile.c:
2004-05-28 Andrei Zmievski <andreiz@gmail.com>
* zend.c:
Allow user-defined error handlers to indicate whether default error
handler should be re-invoked, by returning true or false.
2004-05-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_execute.c:
Prevent possible problems with illegal properties
2004-05-28 Derick Rethans <php@derickrethans.nl>
* zend_builtin_functions.c:
- Make the default mask for user defined error handlers include ALL errors,
including E_STRICT.
2004-05-27 Andi Gutmans <andi@zend.com>
* zend.h:
- Back to RC3-dev until we roll final
* (php_5_0_0RC3RC1)
zend_execute.c:
- Fix problem with exceptions returning from include(). (Dmitry)
* (php_5_0_0RC3RC1)
zend.h:
- RC3RC1
2004-05-26 Wez Furlong <wez.php@thebrainroom.net>
* zend_object_handlers.c:
Fix leak on systems where alloca isn't really alloca.
2004-05-26 Andrei Zmievski <andreiz@gmail.com>
* zend_constants.c:
Avoid unnecessary and silly copying of constant name when registering.
2004-05-26 Andi Gutmans <andi@zend.com>
* zend_alloc.c:
- Fix memory manager problem
2004-05-26 Sebastian Bergmann <sb@sebastian-bergmann.de>
* ZEND_CHANGES:
Update Reflection API class names. Whitespace fixes.
2004-05-25 Andi Gutmans <andi@zend.com>
* zend_objects_API.h:
- Nuke unused decleration
* zend_alloc.c
zend_alloc.h:
- More fixes
* zend_alloc.c
zend_alloc.h:
- Make fix compile.
* zend_alloc.c
zend_alloc.h:
- Fix memory leak in mem cache in conjunction with Zend MM. How come no one
- noticed this? :)
2004-05-23 Andi Gutmans <andi@zend.com>
* zend_objects_API.c:
- Fix problem with object being destroyed more than once
* zend_builtin_functions.c:
- Fix the following script (it crashed):
<?php
class ErrorHandler {
function __construct() {
set_error_handler(array(&$this, 'handle'));
}
function __destruct() {
restore_error_handler();
}
function handle($code, $msg, $file, $line, $locals) {
}
}
new ErrorHandler();
?>
2004-05-20 Wez Furlong <wez.php@thebrainroom.net>
* zend_exceptions.c
zend_exceptions.h:
Revert; obviously I missed the function at the bottom of the file...
* zend_exceptions.c
zend_exceptions.h:
Export this, so extensions may throw their own exception objects that
they have already instantiated.
2004-05-18 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_API.c:
- Need to operate on module pointer in hash table
2004-05-18 Wez Furlong <wez.php@thebrainroom.net>
* zend_execute_API.c:
Fix bug #28438: win32 build fails in non-zts mode
2004-05-18 Stanislav Malyshev <stas@zend.com>
* zend_API.c:
Z_TYPE_P is for zvals
2004-05-18 Wez Furlong <wez.php@thebrainroom.net>
* zend_API.c:
Register according to the type specified by the module.
(Helps to fix dl() bug)
2004-05-18 Sara Golemon <php@alphaweb.net>
* zend_execute.c:
Bugfix#28404 When type is double we need to access dval, not lval
2004-05-17 Andrei Zmievski <andreiz@gmail.com>
* zend_ini_parser.y
zend_ini_scanner.l:
Revert the .ini vars patch. Will have to try again next Christmas
apparently.
* zend_ini_parser.y:
Fix the apparent bug (; at the end of parse rule block).
2004-05-17 Wez Furlong <wez.php@thebrainroom.net>
* zend_objects_API.c
zend_objects_API.h:
As discussed with Andi, add this helper API for setting the object pointer
from
within the constructor.
Please read the comment for notes about how to use it; in general, you
don't
need it, so don't use it.
2004-05-14 Andrei Zmievski <andrei@gravitonic.com>
* zend_ini_parser.y
zend_ini_scanner.l:
Adding ability to refer to existing .ini variables from within .ini
files. Example:
open_basedir = ${open_basedir} ":/new/dir"
2004-05-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_API.c:
- Centralize register and hash operations for startup/register_module
in new zend_register_module_ex().
* zend_API.c:
- Revert to 1.249
2004-05-11 Andi Gutmans <andi@zend.com>
* zend_compile.c:
- Don't allow passing NULL to type hinted parameter.
2004-05-10 Zeev Suraski <zeev@zend.com>
* zend_operators.c:
- Fix comparison of objects
- Clarify convert_object_to_type()
2004-05-10 Stefan Esser <sesser@suspekt.org>
* zend_alloc.c:
Checking MEMORY_LIMIT before doing emalloc/erealloc solves several ugly
problems.
2004-05-04 Wez Furlong <wez.php@thebrainroom.net>
* zend_iterators.c
zend_object_handlers.c
zend_object_handlers.h
zend_objects_API.c:
Add count_elements handler for overloaded objects.
2004-05-02 Andi Gutmans <andi@zend.com>
* zend_operators.c:
- Fix comparison of two objects in non-compatibility mode.
2004-05-01 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_API.c:
Don't load modules twice
2004-04-29 Stanislav Malyshev <stas@zend.com>
* zend_execute.c:
Fix bug #27876
2004-04-28 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_exceptions.h:
Fix c++ builds
2004-04-27 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_builtin_functions.c:
- Optional parameter to class_exists() that can be used to bypass
__autoload() which can be helpfull in __autoload() itself.
* zend_interfaces.c:
- Fix warnings
* zend_interfaces.c
zend_interfaces.h
zend_iterators.h:
- no unneccessary retval initialization
- new c-level iterator handler invalidate_current that is optionally
used to clear internal caching like in implementation of Iterator
2004-04-27 Andi Gutmans <andi@zend.com>
* zend_reflection_api.c:
- Fix prototypes
2004-04-26 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_reflection_api.c:
Fix prototype
2004-04-25 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_builtin_functions.c:
Skip correct amount of stack entries
* zend_interfaces.c:
Capture potential problem by error message
* zend_reflection_api.c:
Show number of classes
2004-04-25 Andi Gutmans <andi@zend.com>
* zend.h:
- RC3-dev
* (php_5_0_0RC2)
zend.h:
- RC2
2004-04-23 Andi Gutmans <andi@zend.com>
* zend_compile.c:
- Fixed bug #27923. foreach() without a key should not check if the key
- is a reference (Adam)
2004-04-21 Andi Gutmans <andi@zend.com>
* zend.h:
- RC2-dev
* (php_5_0_0RC2RC2)
zend.h:
- Prepare for RC2RC2 (if everything is OK especially Zeev's interface
- patch I'll roll RC2 tomorrow).
2004-04-21 Zeev Suraski <zeev@zend.com>
* (php_5_0_0RC2RC2)
zend_compile.c:
Restore fatal error in case a method that's supposed to implement an
interface/abstract method, breaks its prototype
2004-04-20 Andi Gutmans <andi@zend.com>
* zend_language_parser.y:
- Fix bug #27283 - Exceptions where the last catch() statement was
sometimes
- skipped.
2004-04-19 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_reflection_api.c:
show ini entries and classes for extensions.
2004-04-17 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend.c:
Retval may not be set when zend_execute() is overloaded
2004-04-15 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_execute.c:
Handle failure in get_current_data
2004-04-14 Andi Gutmans <andi@zend.com>
* zend_extensions.h:
- Add comment
* zend.h:
- RC2-dev
* (php_5_0_0RC2RC1)
zend.h:
- RC2RC1
2004-04-13 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_exceptions.c:
Classnames shall start with an uppercase character
2004-04-13 Zeev Suraski <zeev@zend.com>
* zend_builtin_functions.c:
Fix debug_backtrace to show arguments again
We need to merge code from debug_backtrace & debug_print_backtrace at
some point!
2004-04-13 Andi Gutmans <andi@zend.com>
* zend_extensions.h:
- Fix API no of Engine 2. The first number is the engine version and the
- rest is the API_NO. This way engine2_api_no is always greater than
- engine1_api_no.
* zend.c
zend_exceptions.c
zend_exceptions.h:
- Add hook for exception handler (Derick)
2004-04-12 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_API.h:
Fix order of macro parameter (synch with other macros)
2004-04-12 Andi Gutmans <andi@zend.com>
* OBJECTS2_HOWTO
zend_extensions.h
zend_ini.c
zend_ini.h
zend_modules.h:
- modifyable -> modifiable
2004-04-09 Andi Gutmans <andi@zend.com>
* zend_object_handlers.c:
- Fix bug #26441 (When __set() returned a value it corrupted it)
2004-04-08 Marcus Boerger <marcus.boerger@post.rwth-aachen.de>
* zend_reflection_api.c:
Bugfix #27519 Reflection_Function constructor crashes with non-existant
function's name
2004-04-07 Andi Gutmans <andi@zend.com>
* zend_builtin_functions.c:
- Hopefully fix the debug_backtrace() code.
* zend_builtin_functions.c:
- Fix crash bug in zend_debug_backtrace(). No idea how come this survived
- for so long....
2004-04-04 Ilia Alshanetsky <ilia@prohost.org>
* zend_objects_API.c:
+1 -1
View File
@@ -51,7 +51,7 @@ write_property is used to directly write object's property by
name. This handler is used to assign property variables or to change them
in operations like += or ++ (unless get_property_zval_ptr is also set).
get_property_zval_ptr is used to obtain pointer to modifyable zval for
get_property_zval_ptr is used to obtain pointer to modifiable zval for
operations like += or ++. This should be used only if your object model
stores properties as real zval's that can be modified from outside.
Otherwise this handler should be NULL and the engine will use
+99 -99
View File
@@ -21,9 +21,9 @@ Changes in the Zend Engine 2.0
* $this
Unlike in Zend Engine 1 the pseudo variable $this cannot be
exchanged in Zend Engine 2. You can of course modify or work with
an object by using $this but you cannot replace $this with another
Unlike in Zend Engine 1 the pseudo variable $this cannot be
exchanged in Zend Engine 2. You can of course modify or work with
an object by using $this but you cannot replace $this with another
object to change the original object.
Example:
@@ -35,17 +35,17 @@ Changes in the Zend Engine 2.0
$this = $other;
}
}
$object = new Foo;
$object->prop = 'Hello';
$other = new Foo;
$other->prop = 'Bye';
$object->replace($other);
print $object->prop; // still shows 'Hello'
?>
Zend Engine 2.0 will issue a compile error, if an assignment
@@ -53,9 +53,9 @@ Changes in the Zend Engine 2.0
* Private and Protected Members.
The Zend Engine 2.0 introduces private and protected member
variables. Note that for performance reasons no error message is
emitted in case of an illegal access to a private or protectecd
The Zend Engine 2.0 introduces private and protected member
variables. Note that for performance reasons no error message is
emitted in case of an illegal access to a private or protectecd
member variable.
Example:
@@ -75,7 +75,7 @@ Changes in the Zend Engine 2.0
class MyClass2 extends MyClass {
protected $Foo;
function printHello() {
MyClass::printHello(); /* Should print */
print "MyClass2::printHello() " . $this->Hello; /* Shouldn't print out anything */
@@ -96,9 +96,9 @@ Changes in the Zend Engine 2.0
print $obj->Foo; /* Shouldn't print out anything */
$obj->printHello();
?>
Protected member variables can be accessed in classes extending the
class they are declared in, whereas private member variables can
Protected member variables can be accessed in classes extending the
class they are declared in, whereas private member variables can
only be accessed by the class they belong to.
* Private and protected methods.
@@ -130,14 +130,14 @@ Changes in the Zend Engine 2.0
$o->aPublicMethod();
?>
Old code that has no user-defined classes or functions named
Old code that has no user-defined classes or functions named
'public', 'protected' or 'private' should run without modifications.
* Abstract Classes and Methods.
The Zend Engine 2.0 introduces abstract classes and methods. An
abstract method only declares the method's signature and does not
provide an implementation. A class that contains abstract methods
The Zend Engine 2.0 introduces abstract classes and methods. An
abstract method only declares the method's signature and does not
provide an implementation. A class that contains abstract methods
needs to be declared abstract.
Example:
@@ -160,7 +160,7 @@ Changes in the Zend Engine 2.0
Classes that do not have abstract methods can be declared abstract
to prevent them from being instantiated.
Old code that has no user-defined classes or functions named
Old code that has no user-defined classes or functions named
'abstract' should run without modifications.
* Interfaces.
@@ -182,13 +182,13 @@ Changes in the Zend Engine 2.0
}
?>
Old code that has no user-defined classes or functions named
Old code that has no user-defined classes or functions named
'interface' or 'implements' should run without modifications.
An interface may extend one or more base interfaces (but not
An interface may extend one or more base interfaces (but not
implement them). Neither a class nor an interface can inherit
methods of the same name from different root interfaces.
methods of the same name from different root interfaces.
Interfaces may contain abstract static methods.
Example:
@@ -197,7 +197,7 @@ Changes in the Zend Engine 2.0
interface Printable {
function dump();
}
interface Streamable extends Printable {
function writeToStream();
static function readFromStream();
@@ -215,14 +215,14 @@ Changes in the Zend Engine 2.0
}
}
?>
A class that does not implement all interface methods must be
A class that does not implement all interface methods must be
declared as an abstract class.
* Class Type Hints.
While remaining loosely typed the Zend Engine 2.0 introduces the
ability to use class type hints to declare the expected class of
While remaining loosely typed the Zend Engine 2.0 introduces the
ability to use class type hints to declare the expected class of
objects that are passed as parameters to a method.
Example:
@@ -275,7 +275,7 @@ Changes in the Zend Engine 2.0
* Final methods and classes.
The Zend Engine 2.0 introduces the "final" keyword to declare
final methods. Those cannot be overridden by sub-classes.
final methods. Those cannot be overridden by sub-classes.
Example:
@@ -287,8 +287,8 @@ Changes in the Zend Engine 2.0
}
?>
It is furthermore possible to make a class final. Doing this
prevents a class from being specialized (it cannot be inherited
It is furthermore possible to make a class final. Doing this
prevents a class from being specialized (it cannot be inherited
by another class). There's no need to declare the methods of
a final class themselves as final.
@@ -304,7 +304,7 @@ Changes in the Zend Engine 2.0
Properties cannot be final. See per-class constants below.
Old code that has no user-defined classes or functions named
Old code that has no user-defined classes or functions named
'final' should run without modifications.
* Object Cloning.
@@ -339,9 +339,9 @@ Changes in the Zend Engine 2.0
all of the object's properties. If a __clone() method is
defined, then it will be responsible to set the necessary
properties in the created object. For convenience, the engine
ensures, that the clone will be initialized with all of the
properties from the source object, so that developers can start
with a by-value replica of the source object, and only override
ensures, that the clone will be initialized with all of the
properties from the source object, so that developers can start
with a by-value replica of the source object, and only override
properties that need to be changed.
Example:
@@ -374,7 +374,7 @@ Changes in the Zend Engine 2.0
print $obj_clone->name . "\n";
print $obj_clone->address . "\n";
?>
* Unified Constructors.
The Zend Engine allows developers to declare constructor methods
@@ -474,7 +474,7 @@ Changes in the Zend Engine 2.0
echo 'Foo::constant = ' . Foo::constant . "\n";
?>
Old code that has no user-defined classes or functions
Old code that has no user-defined classes or functions
named 'const' will run without modifications.
* Exceptions.
@@ -483,16 +483,16 @@ Changes in the Zend Engine 2.0
introduces a exception model similar to that of other programming
languages. But there is no catch all and no finally clause.
Old code that has no user-defined classes or functions 'catch',
Old code that has no user-defined classes or functions 'catch',
'throw' and 'try' will run without modifications.
Exceptions can be rethrown in catch blocks. Also it is possible to
have multiple catch blocks. In that case the caught exception is
have multiple catch blocks. In that case the caught exception is
compared with the classtype of each catch block from top to bottom
and the first block that has a 'instanceof' match gets executed.
When the catch block finishes execution continues at the end of
When the catch block finishes execution continues at the end of
the last catch block. If no catch block has a 'instanceof' match
then the next try/catch block is searched until no more try/catch
then the next try/catch block is searched until no more try/catch
blocks are available. In that case the exception is an uncaught
exception and the program terminates with showing the exception.
@@ -529,18 +529,18 @@ Changes in the Zend Engine 2.0
echo $exception;
}
?>
Even though the above example shows that it is possible to define
exception classes that don't inherit from Exception it is best to
do so. This is because the internal Exception class can gather a
lot of information otherwise not available. The PHP code emulation
code would look something like shown below. The comments show the
meaning of each property. As the code shows it is possible to read
meaning of each property. As the code shows it is possible to read
any available information by using the getter methods. But since
some of the methods are used internally they are marked final. All
in all the class is very restrictive because it must be ensured
some of the methods are used internally they are marked final. All
in all the class is very restrictive because it must be ensured
that anything used internally always works as expected.
Emulating class Exception:
<?php
@@ -555,15 +555,15 @@ Changes in the Zend Engine 2.0
$this->trace = debug_backtrace();
$this->string = StringFormat($this);
}
protected $message = 'Unknown exception'; // exception message
protected $message = 'Unknown exception'; // exception message
protected $code = 0; // user defined exception code
protected $file; // source filename of exception
protected $line; // source line of exception
private $trace; // backtrace of exception
private $string; // internal only!!
final function getMessage() {
return $this->message;
}
@@ -592,19 +592,19 @@ Changes in the Zend Engine 2.0
}
}
?>
If you derive your exception classes from this Exception base class
your exceptions will be nicely shown in the builtin handler for
your exceptions will be nicely shown in the builtin handler for
uncaught exceptions.
Note: The method getMessage() is a final read only access method to
Note: The method getMessage() is a final read only access method to
the private proeprty message that is set in the constructor. If you
feel a need to overwrite the exception display then overload method
__toString() in your derived class or implement your own extneral
__toString() in your derived class or implement your own extneral
exception display function to accomplish your desired formatting.
Example:
<?php
function display_exception(Exception $ex)
{
@@ -612,7 +612,7 @@ Changes in the Zend Engine 2.0
echo $ex->getTrace();
echo '</pre>';
}
try
{
// your code here
@@ -662,9 +662,9 @@ Changes in the Zend Engine 2.0
}
print foo::$my_static;
$obj = foo;
print $obj->my_prop;
?>
@@ -691,14 +691,14 @@ Changes in the Zend Engine 2.0
* instanceof.
New support for an instanceof operator which checks if an object
is of a certain class or interface type.
Example:
<?php
class Foo {
}
$obj = new Foo();
if ($obj instanceof Foo) {
print "Yay!\n";
@@ -720,9 +720,9 @@ Changes in the Zend Engine 2.0
* __autoload().
The __autoload() interceptor function will be automatically called
when an undeclared class is to be instantiated. The name of that
class will be passed to the __autoload() interceptor function as its
The __autoload() interceptor function will be automatically called
when an undeclared class is to be instantiated. The name of that
class will be passed to the __autoload() interceptor function as its
only argument. __autoload() must succeed in loading the class. If it
doesn't then an E_ERROR is emitted.
@@ -817,24 +817,24 @@ Changes in the Zend Engine 2.0
}
?>
Each class whose instances can be iterated with foreach should
Each class whose instances can be iterated with foreach should
implement the empty interface 'Traversable'. Hence any object
that says it implements 'Traversable' can be used with foreach.
The interfaces 'IteratorAggregate' and 'Iterator' allow to specify
how class objects are iterated in PHP code. The first of them simply
has a method 'getIterator' which must return an object that either
implements the interface 'Iterator' or is instantiated from an
has a method 'getIterator' which must return an object that either
implements the interface 'Iterator' or is instantiated from an
internal class that can be iterated.
Example:
<?php
class ObjectIterator implements Iterator {
private $obj;
private $num;
function __construct($obj) {
$this->obj = $obj;
}
@@ -859,23 +859,23 @@ Changes in the Zend Engine 2.0
$this->num++;
}
}
class Object implements IteratorAggregate {
public $max = 3;
function getIterator() {
return new ObjectIterator($this);
}
}
}
$obj = new Object;
// this foreach ...
foreach($obj as $key => $val) {
echo "$key = $val\n";
}
// matches the following 7 lines with the for directive.
$it = $obj->getIterator();
for($it->rewind(); $it->valid(); $it->next()) {
@@ -886,14 +886,14 @@ Changes in the Zend Engine 2.0
unset($it);
?>
The matching for directive is very intersting here since it shows
The matching for directive is very intersting here since it shows
the use of all abstract methods declared in the interfaces Iterator
and IteratorAggregate respectively.
* __METHOD__
The pseudo constant __METHOD__ shows the current class and method
when used inside a method and the function when used outside of a
The pseudo constant __METHOD__ shows the current class and method
when used inside a method and the function when used outside of a
class.
Example:
@@ -911,9 +911,9 @@ Changes in the Zend Engine 2.0
* __toString()
The magic method __toString() allows to overload the object to
string conversion. This conversion is only done automatically for
the printing functions (echo, print) but not for other functions
The magic method __toString() allows to overload the object to
string conversion. This conversion is only done automatically for
the printing functions (echo, print) but not for other functions
that expect strings. Also the function __toString is not used in
places where objects are not allowed but strings are like array
indices. Note that specialized objects may be converted to a string
@@ -940,16 +940,16 @@ Changes in the Zend Engine 2.0
?>
* Reflection API
PHP5 comes with a complete reflection API that adds the ability to
PHP 5 comes with a complete Reflection API that adds the ability to
reverse-engineer classes, interfaces, functions and methods as well
as extensions.
The reflection API also offers ways of getting doc comments for
The Reflection API also offers ways of getting doc comments for
functions, classes and methods.
Nearly all aspects of object oriented code can be reflected by
using the reflection API which is documented separatley:
using the Reflection API which is documented separately:
http://sitten-polizei.de/php/reflection_api/docs/language.reflection.html
Example:
@@ -962,11 +962,11 @@ Changes in the Zend Engine 2.0
}
}
reflection_class::export('Foo');
reflection_object::export(new Foo);
reflection_method::export('Foo', 'func');
reflection_property::export('Foo', 'prop');
reflection_extension::export('standard');
ReflectionClass::export('Foo');
ReflectionObject::export(new Foo);
ReflectionMethod::export('Foo', 'func');
ReflectionProperty::export('Foo', 'prop');
ReflectionExtension::export('standard');
?>
* New memory manager
@@ -977,7 +977,7 @@ Changes in the Zend Engine 2.0
* Others
Probably other changes which we forgot to list. This list will be kept up-to-date
as much as possible.
Changes in the Zend Engine 1.0
+5 -1
View File
@@ -581,6 +581,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_compile_file = compile_file;
zend_execute = execute;
zend_execute_internal = NULL;
zend_throw_exception_hook = NULL;
zend_init_opcodes_handlers();
@@ -973,6 +974,9 @@ ZEND_API void zend_error(int type, const char *format, ...)
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC)==SUCCESS) {
if (retval) {
if (Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval) == 0) {
zend_error_cb(type, error_filename, error_lineno, format, args);
}
zval_ptr_dtor(&retval);
}
} else {
@@ -1091,7 +1095,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
zval_ptr_dtor(EG(return_value_ptr_ptr));
local_retval = NULL;
}
} else if (!retval) {
} else if (!retval && *EG(return_value_ptr_ptr)) {
zval_ptr_dtor(EG(return_value_ptr_ptr));
local_retval = NULL;
}
+1 -1
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "2.0.0RC2-dev"
#define ZEND_VERSION "2.0.0RC3RC2"
#define ZEND_ENGINE_2
+50 -32
View File
@@ -1158,25 +1158,57 @@ ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *valu
return SUCCESS;
}
ZEND_API int zend_register_module_ex(zend_module_entry *module TSRMLS_DC)
{
int name_len;
char *lcname;
zend_module_entry *module_ptr;
if (!module) {
return FAILURE;
}
#if 0
zend_printf("%s: Registering module %d\n", module->name, module->module_number);
#endif
name_len = strlen(module->name);
lcname = zend_str_tolower_dup(module->name, name_len);
if (zend_hash_add(&module_registry, lcname, name_len+1, (void *)module, sizeof(zend_module_entry), (void**)&module_ptr)==FAILURE) {
zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name);
efree(lcname);
return FAILURE;
}
efree(lcname);
module = module_ptr;
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type TSRMLS_CC)==FAILURE) {
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
return FAILURE;
}
if (!module->module_started && module->module_startup_func) {
EG(current_module) = module;
if (module->module_startup_func(module->type, module->module_number TSRMLS_CC)==FAILURE) {
zend_error(E_CORE_ERROR,"Unable to start %s module", module->name);
EG(current_module) = NULL;
return FAILURE;
}
EG(current_module) = NULL;
}
module->module_started=1;
return SUCCESS;
}
ZEND_API int zend_startup_module(zend_module_entry *module)
{
if (module) {
module->module_number = zend_next_free_module();
if (module->module_startup_func) {
TSRMLS_FETCH();
TSRMLS_FETCH();
EG(current_module) = module;
if (module->module_startup_func(MODULE_PERSISTENT, module->module_number TSRMLS_CC)==FAILURE) {
zend_error(E_CORE_ERROR,"Unable to start %s module", module->name);
EG(current_module) = NULL;
return FAILURE;
}
EG(current_module) = NULL;
}
module->type = MODULE_PERSISTENT;
zend_register_module(module);
}
return SUCCESS;
module->module_number = zend_next_free_module();
module->type = MODULE_PERSISTENT;
return zend_register_module_ex(module TSRMLS_CC);
}
@@ -1357,23 +1389,9 @@ ZEND_API void zend_unregister_functions(zend_function_entry *functions, int coun
ZEND_API int zend_register_module(zend_module_entry *module)
{
int retval, name_len;
char *lcname;
TSRMLS_FETCH();
#if 0
zend_printf("%s: Registering module %d\n", module->name, module->module_number);
#endif
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type TSRMLS_CC)==FAILURE) {
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
return FAILURE;
}
module->module_started=1;
name_len = strlen(module->name);
lcname = zend_str_tolower_dup(module->name, name_len);
retval = zend_hash_add(&module_registry, lcname, name_len+1, (void *)module, sizeof(zend_module_entry), NULL);
efree(lcname);
return retval;
return zend_register_module_ex(module TSRMLS_CC);
}
+1 -1
View File
@@ -53,7 +53,7 @@ typedef struct _zend_function_entry {
#define ZEND_FALIAS(name, alias, arg_info) ZEND_FENTRY(name, ZEND_FN(alias), arg_info, 0)
#define ZEND_ME(classname, name, arg_info, flags) ZEND_FENTRY(name, ZEND_FN(classname##_##name), arg_info, flags)
#define ZEND_ABSTRACT_ME(classname, name, arg_info) ZEND_FENTRY(name, NULL, arg_info, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
#define ZEND_MALIAS(name, classname, alias, arg_info, flags) \
#define ZEND_MALIAS(classname, name, alias, arg_info, flags) \
ZEND_FENTRY(name, ZEND_FN(classname##_##alias), arg_info, flags)
#define ZEND_ME_MAPPING(name, func_name, arg_types) ZEND_NAMED_FE(name, ZEND_FN(func_name), arg_types)
+48 -49
View File
@@ -99,6 +99,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
#endif
#if ZEND_DEBUG || !defined(ZEND_MM)
#define REMOVE_POINTER_FROM_LIST(p) \
if (p==AG(head)) { \
AG(head) = p->pNext; \
@@ -108,14 +109,21 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
if (p->pNext) { \
p->pNext->pLast = p->pLast; \
}
#else
#define REMOVE_POINTER_FROM_LIST(p)
#endif
#define ADD_POINTER_TO_LIST(p) \
#if ZEND_DEBUG || !defined(ZEND_MM)
#define ADD_POINTER_TO_LIST(p) \
p->pNext = AG(head); \
if (AG(head)) { \
AG(head)->pLast = p; \
} \
AG(head) = p; \
p->pLast = (zend_mem_header *) NULL;
#else
#define ADD_POINTER_TO_LIST(p)
#endif
#define DECLARE_CACHE_VARS() \
unsigned int real_size; \
@@ -164,6 +172,12 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
if (CACHE_INDEX<MAX_CACHED_MEMORY) {
AG(cache_stats)[CACHE_INDEX][0]++;
}
#endif
#if MEMORY_LIMIT
CHECK_MEMORY_LIMIT(size, SIZE);
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
AG(allocated_memory_peak) = AG(allocated_memory);
}
#endif
p = (zend_mem_header *) ZEND_DO_MALLOC(sizeof(zend_mem_header) + MEM_HEADER_PADDING + SIZE + END_MAGIC_SIZE);
#if !ZEND_DISABLE_MEMORY_CACHE
@@ -183,9 +197,7 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
return (void *)p;
}
p->cached = 0;
#if ZEND_DEBUG || !defined(ZEND_MM)
ADD_POINTER_TO_LIST(p);
#endif
p->size = size; /* Save real size for correct cache output */
#if ZEND_DEBUG
p->filename = __zend_filename;
@@ -199,12 +211,6 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
# endif
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
#endif
#if MEMORY_LIMIT
CHECK_MEMORY_LIMIT(size, SIZE);
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
AG(allocated_memory_peak) = AG(allocated_memory);
}
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING);
@@ -272,9 +278,7 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
}
#endif
HANDLE_BLOCK_INTERRUPTIONS();
#if ZEND_DEBUG || !defined(ZEND_MM)
REMOVE_POINTER_FROM_LIST(p);
#endif
#if MEMORY_LIMIT
AG(allocated_memory) -= SIZE;
@@ -331,9 +335,13 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
HANDLE_BLOCK_INTERRUPTIONS();
#if ZEND_DEBUG || !defined(ZEND_MM)
REMOVE_POINTER_FROM_LIST(p);
#if MEMORY_LIMIT
CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
AG(allocated_memory_peak) = AG(allocated_memory);
}
#endif
REMOVE_POINTER_FROM_LIST(p);
p = (zend_mem_header *) ZEND_DO_REALLOC(p, sizeof(zend_mem_header)+MEM_HEADER_PADDING+SIZE+END_MAGIC_SIZE);
if (!p) {
if (!allow_failure) {
@@ -344,27 +352,17 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
exit(1);
#endif
}
#if ZEND_DEBUG || !defined(ZEND_MM)
ADD_POINTER_TO_LIST(orig);
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *)NULL;
}
#if ZEND_DEBUG || !defined(ZEND_MM)
ADD_POINTER_TO_LIST(p);
#endif
#if ZEND_DEBUG
p->filename = __zend_filename;
p->lineno = __zend_lineno;
p->magic = MEM_BLOCK_START_MAGIC;
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
#endif
#if MEMORY_LIMIT
CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
if (AG(allocated_memory) > AG(allocated_memory_peak)) {
AG(allocated_memory_peak) = AG(allocated_memory);
}
#endif
p->size = size;
@@ -468,7 +466,7 @@ ZEND_API void start_memory_manager(TSRMLS_D)
}
ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
{
#if ZEND_DEBUG || !defined(ZEND_MM)
zend_mem_header *p, *t;
@@ -477,13 +475,33 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
zend_uint grand_total_leaks=0;
#endif
#if !ZEND_DISABLE_MEMORY_CACHE
/* Free memory cache even on partial shutdown to avoid fragmentation */
if (1 || full_shutdown) {
unsigned int i, j;
zend_mem_header *ptr;
for (i=1; 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
AG(allocated_memory) -= REAL_SIZE(ptr->size);
# endif
REMOVE_POINTER_FROM_LIST(ptr);
ZEND_DO_FREE(ptr);
}
AG(cache_count)[i] = 0;
}
}
#endif /* !ZEND_DISABLE_MEMORY_CACHE */
#if defined(ZEND_MM) && !ZEND_DEBUG
if (clean_cache) {
if (full_shutdown) {
zend_mm_shutdown(&AG(mm_heap));
return;
}
#elif defined(ZEND_WIN32) && !ZEND_DEBUG
if (clean_cache && AG(memory_heap)) {
if (full_shutdown && AG(memory_heap)) {
HeapDestroy(AG(memory_heap));
return;
}
@@ -506,32 +524,13 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
}
#endif /* ZEND_ENABLE_FAST_CACHE */
#if !ZEND_DISABLE_MEMORY_CACHE && !defined(ZEND_MM)
if (1 || clean_cache) {
unsigned int i, j;
zend_mem_header *ptr;
for (i=1; 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
AG(allocated_memory) -= REAL_SIZE(ptr->size);
#endif
REMOVE_POINTER_FROM_LIST(ptr);
ZEND_DO_FREE(ptr);
}
AG(cache_count)[i] = 0;
}
}
#endif /* !ZEND_DISABLE_MEMORY_CACHE */
#if ZEND_DEBUG || !defined(ZEND_MM)
p = AG(head);
t = AG(head);
while (t) {
if (!t->cached) {
#if ZEND_DEBUG
if (!t->cached && !t->reported) {
if (!t->reported) {
zend_mem_header *iterator;
int total_leak=0, total_leak_count=0;
@@ -584,7 +583,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
zval display_memory_cache_stats;
int i, j;
if (clean_cache) {
if (full_shutdown) {
/* we're shutting down completely, don't even touch the INI subsystem */
break;
}
@@ -622,12 +621,12 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
#endif
#if defined(ZEND_MM) && ZEND_DEBUG
if (clean_cache) {
if (full_shutdown) {
zend_mm_shutdown(&AG(mm_heap));
return;
}
#elif defined(ZEND_WIN32) && ZEND_DEBUG
if (clean_cache && AG(memory_heap)) {
if (full_shutdown && AG(memory_heap)) {
HeapDestroy(AG(memory_heap));
return;
}
+1 -1
View File
@@ -126,7 +126,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE
ZEND_API int zend_set_memory_limit(unsigned int memory_limit);
ZEND_API void start_memory_manager(TSRMLS_D);
ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC);
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC);
#if ZEND_DEBUG
ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
+29 -14
View File
@@ -799,20 +799,30 @@ ZEND_FUNCTION(method_exists)
}
/* }}} */
/* {{{ proto bool class_exists(string classname)
/* {{{ proto bool class_exists(string classname [, bool autoload])
Checks if the class exists */
ZEND_FUNCTION(class_exists)
{
zval **class_name;
char *class_name, *lc_name;
zend_class_entry **ce;
long class_name_len;
zend_bool autoload = 1;
int found;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &class_name, &class_name_len, &autoload) == FAILURE) {
return;
}
convert_to_string_ex(class_name);
if (!autoload) {
lc_name = do_alloca(class_name_len + 1);
zend_str_tolower_copy(lc_name, class_name, class_name_len);
found = zend_hash_find(EG(class_table), lc_name, class_name_len+1, (void **) &ce);
free_alloca(lc_name);
RETURN_BOOL(found == SUCCESS);
}
if (zend_lookup_class(Z_STRVAL_PP(class_name), Z_STRLEN_PP(class_name), &ce TSRMLS_CC) == SUCCESS) {
if (zend_lookup_class(class_name, class_name_len, &ce TSRMLS_CC) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -950,7 +960,7 @@ ZEND_FUNCTION(set_error_handler)
zval *error_handler;
zend_bool had_orig_error_handler=0;
char *error_handler_name = NULL;
long error_type = E_ALL;
long error_type = E_ALL | E_STRICT;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &error_handler, &error_type) == FAILURE) {
return;
@@ -995,8 +1005,12 @@ ZEND_FUNCTION(set_error_handler)
ZEND_FUNCTION(restore_error_handler)
{
if (EG(user_error_handler)) {
zval_ptr_dtor(&EG(user_error_handler));
zval *zeh = EG(user_error_handler);
EG(user_error_handler) = NULL;
zval_ptr_dtor(&zeh);
}
if (zend_ptr_stack_num_elements(&EG(user_error_handlers))==0) {
EG(user_error_handler) = NULL;
} else {
@@ -1447,14 +1461,14 @@ ZEND_FUNCTION(debug_print_backtrace)
ZEND_WRONG_PARAM_COUNT();
}
while (--args >= EG(argument_stack).elements) {
while (--args > EG(argument_stack).elements) {
if (*args--) {
break;
}
args -= *(ulong*)args;
frames_on_stack++;
if (args == EG(argument_stack).elements) {
if ((args-1) == EG(argument_stack).elements) {
arg_stack_consistent = 1;
break;
}
@@ -1567,14 +1581,14 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
int arg_stack_consistent = 0;
int frames_on_stack = 0;
while (--args >= EG(argument_stack).elements) {
while (--args > EG(argument_stack).elements) {
if (*args--) {
break;
}
args -= *(ulong*)args;
frames_on_stack++;
if (args == EG(argument_stack).elements) {
if ((args-1) == EG(argument_stack).elements) {
arg_stack_consistent = 1;
break;
}
@@ -1584,8 +1598,9 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
/* skip debug_backtrace() */
ptr = ptr->prev_execute_data;
if (skip_last) {
cur_arg_pos -= 2;
if (skip_last--) {
int arg_count = *((ulong*)(cur_arg_pos - 2));
cur_arg_pos -= (arg_count + 2);
frames_on_stack--;
}
+20 -8
View File
@@ -1138,6 +1138,7 @@ void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initia
if (class_type->op_type != IS_UNUSED) {
cur_arg_info->class_name = class_type->u.constant.value.str.val;
cur_arg_info->class_name_len = class_type->u.constant.value.str.len;
cur_arg_info->allow_null = 0;
} else {
cur_arg_info->class_name = NULL;
cur_arg_info->class_name_len = 0;
@@ -1711,16 +1712,20 @@ static void do_inherit_method(zend_function *function)
}
static zend_bool zend_do_perform_implementation_check(zend_function *fe)
static zend_bool zend_do_perform_implementation_check(zend_function *fe, zend_function *proto)
{
zend_uint i;
zend_function *proto = fe->common.prototype;
/* If it's a user function then arg_info == NULL means we don't have any parameters but we still need to do the arg number checks. We are only willing to ignore this for internal functions because extensions don't always define arg_info. */
if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) {
return 1;
}
/* No implementation checks for constructors */
if (fe->common.fn_flags & ZEND_ACC_CTOR) {
return 1;
}
/* check number of arguments */
if (proto->common.required_num_args != fe->common.required_num_args
|| proto->common.num_args > fe->common.num_args) {
@@ -1818,15 +1823,21 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
}
}
child->common.prototype = parent;
if (parent_flags & ZEND_ACC_ABSTRACT) {
child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
child->common.prototype = parent;
} else {
child->common.prototype = parent->common.prototype;
}
/* Check E_STRICT before the check so that we save some time */
if(EG(error_reporting) & E_STRICT) {
if (!(child->common.fn_flags & ZEND_ACC_CTOR) && !zend_do_perform_implementation_check(child)) {
zend_error(E_STRICT, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
if (child->common.prototype) {
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
}
} else if (EG(error_reporting) & E_STRICT) { /* Check E_STRICT before the check so that we save some time */
if (!zend_do_perform_implementation_check(child, parent)) {
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with that of %s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(parent), parent->common.function_name);
}
}
@@ -3323,7 +3334,7 @@ void zend_do_foreach_cont(znode *value, znode *key, znode *as_token, znode *fore
value = tmp;
}
if (key->u.EA.type & ZEND_PARSED_REFERENCE_VARIABLE) {
if ((key->op_type != IS_UNUSED) && (key->u.EA.type & ZEND_PARSED_REFERENCE_VARIABLE)) {
zend_error(E_COMPILE_ERROR, "Key element cannot be a reference");
}
@@ -3735,6 +3746,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
ce->parent = NULL;
ce->num_interfaces = 0;
ce->interfaces = NULL;
ce->module = NULL;
}
}
+9 -7
View File
@@ -302,7 +302,8 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result TSRMLS_DC
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
{
char *lowercase_name;
char *lowercase_name = NULL;
char *name;
int ret = SUCCESS;
#if 0
@@ -313,21 +314,22 @@ ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC)
/* keep in mind that c->name_len already contains the '\0' */
lowercase_name = do_alloca(c->name_len);
zend_str_tolower_copy(lowercase_name, c->name, c->name_len - 1);
name = lowercase_name;
} else {
lowercase_name = do_alloca(c->name_len + 1);
memcpy(lowercase_name, c->name, c->name_len);
lowercase_name[c->name_len] = '\0';
name = c->name;
}
if (zend_hash_add(EG(zend_constants), lowercase_name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
if (zend_hash_add(EG(zend_constants), name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
free(c->name);
if (!(c->flags & CONST_PERSISTENT)) {
zval_dtor(&c->value);
}
zend_error(E_NOTICE,"Constant %s already defined", lowercase_name);
zend_error(E_NOTICE,"Constant %s already defined", name);
ret = FAILURE;
}
free_alloca(lowercase_name);
if (lowercase_name) {
free_alloca(lowercase_name);
}
return ret;
}
+6 -1
View File
@@ -30,6 +30,7 @@
zend_class_entry *default_exception_ce;
static zend_object_handlers default_exception_handlers;
ZEND_API void zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
void zend_throw_exception_internal(zval *exception TSRMLS_DC)
@@ -45,6 +46,10 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC)
zend_error(E_ERROR, "Exception thrown without a stack frame");
}
if (zend_throw_exception_hook) {
zend_throw_exception_hook(exception TSRMLS_CC);
}
if ((EG(current_execute_data)->opline+1)->opcode == ZEND_HANDLE_EXCEPTION) {
/* no need to rethrow the exception */
return;
@@ -439,7 +444,7 @@ void zend_register_default_exception(TSRMLS_D)
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "exception", default_exception_functions);
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
default_exception_ce->create_object = zend_default_exception_new;
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+2
View File
@@ -40,6 +40,8 @@ ZEND_API void zend_throw_exception_ex(zend_class_entry *exception_ce, long code
ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
ZEND_API void zend_clear_exception(TSRMLS_D);
extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
/* show an exception using zend_error(E_ERROR,...) */
ZEND_API void zend_exception_error(zval *exception TSRMLS_DC);
+13 -7
View File
@@ -447,7 +447,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
FREE_OP(Ts, op2, EG(free_op2));
if (result) {
T(result->u.var).var.ptr = value;
T(result->u.var).var.ptr_ptr = NULL; /* see if we can remove this */
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */
SELECTIVE_PZVAL_LOCK(value, result);
}
zval_ptr_dtor(&value);
@@ -1275,11 +1275,9 @@ static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, tem
*retval = *z;
zendi_zval_copy_ctor(*retval);
incdec_op(z);
z->refcount++;
Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
if (z->refcount == 0) {
zval_dtor(z);
FREE_ZVAL(z);
}
zval_ptr_dtor(&z);
}
FREE_OP(Ts, op2, EG(free_op2));
@@ -3574,6 +3572,9 @@ int zend_include_or_eval_handler(ZEND_OPCODE_HANDLER_ARGS)
EG(function_state_ptr) = &EX(function_state);
destroy_op_array(new_op_array TSRMLS_CC);
efree(new_op_array);
if (EG(exception)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
}
} else {
if (return_value_used) {
ALLOC_ZVAL(EX_T(opline->result.u.var).var.ptr);
@@ -3793,7 +3794,7 @@ int zend_fe_fetch_handler(ZEND_OPCODE_HANDLER_ARGS)
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
zend_hash_move_forward(fe_ht);
} while (zend_check_property_access(zobj, str_key TSRMLS_CC) != SUCCESS);
} while (key_type != HASH_KEY_IS_STRING || zend_check_property_access(zobj, str_key TSRMLS_CC) != SUCCESS);
zend_unmangle_property_name(str_key, &class_name, &prop_name);
str_key_len = strlen(prop_name);
str_key = estrndup(prop_name, str_key_len);
@@ -3825,6 +3826,11 @@ int zend_fe_fetch_handler(ZEND_OPCODE_HANDLER_ARGS)
return 0; /* CHECK_ME */
}
iter->funcs->get_current_data(iter, &value TSRMLS_CC);
if (!value) {
/* failure in get_current_data */
SET_OPCODE(op_array->opcodes+opline->op2.u.opline_num);
return 0; /* CHECK_ME */
}
if (iter->funcs->get_current_key) {
key_type = iter->funcs->get_current_key(iter, &str_key, &str_key_len, &int_key TSRMLS_CC);
} else {
@@ -3967,7 +3973,7 @@ static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HAN
case IS_BOOL:
case IS_LONG:
if (offset->type == IS_DOUBLE) {
index = (long) offset->value.lval;
index = (long) offset->value.dval;
} else {
index = offset->value.lval;
}
+4 -1
View File
@@ -1101,14 +1101,17 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa
if (lParam==0) {
KillTimer(timeout_window, wParam);
} else {
#ifdef ZTS
void ***tsrm_ls;
#endif
SetTimer(timeout_window, wParam, lParam*1000, NULL);
#ifdef ZTS
tsrm_ls = ts_resource_ex(0, &wParam);
if (!tsrm_ls) {
/* shouldn't normally happen */
break;
}
#endif
EG(timed_out) = 0;
}
break;
+4 -1
View File
@@ -24,7 +24,10 @@
#include "zend_compile.h"
#define ZEND_EXTENSION_API_NO 90021012
/* The first number is the engine version and the rest is the date.
* This way engine 2 API no. is always greater than engine 1 API no..
*/
#define ZEND_EXTENSION_API_NO 220040412
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
+1 -1
View File
@@ -202,7 +202,7 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
return FAILURE;
}
if (!(ini_entry->modifyable & modify_type)) {
if (!(ini_entry->modifiable & modify_type)) {
return FAILURE;
}
+29 -29
View File
@@ -64,7 +64,7 @@ typedef struct _zend_ini_entry zend_ini_entry;
struct _zend_ini_entry {
int module_number;
int modifyable;
int modifiable;
char *name;
uint name_length;
ZEND_INI_MH((*on_modify));
@@ -113,44 +113,44 @@ END_EXTERN_C()
#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = {
#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } };
#define ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, displayer) \
{ 0, modifyable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer },
#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer) \
{ 0, modifiable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer },
#define ZEND_INI_ENTRY3(name, default_value, modifyable, on_modify, arg1, arg2, arg3) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, NULL)
#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL)
#define ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL, displayer)
#define ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL, displayer)
#define ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, arg1, arg2) \
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL)
#define ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, arg1, arg2) \
ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL)
#define ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, NULL, NULL, displayer)
#define ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, NULL, NULL, displayer)
#define ZEND_INI_ENTRY1(name, default_value, modifyable, on_modify, arg1) \
ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, NULL)
#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1) \
ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL)
#define ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, NULL, NULL, NULL, displayer)
#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer)
#define ZEND_INI_ENTRY(name, default_value, modifyable, on_modify) \
ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, NULL)
#define ZEND_INI_ENTRY(name, default_value, modifiable, on_modify) \
ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, NULL)
#ifdef ZTS
#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id)
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer)
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb)
#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id)
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \
ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer)
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb)
#else
#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr)
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer)
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr)
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer) \
ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer)
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
#endif
#define INI_INT(name) zend_ini_long((name), sizeof(name), 0)
+11 -13
View File
@@ -108,7 +108,7 @@ static zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRMLS
/* }}} */
/* {{{ zend_user_it_dtor */
ZEND_API void zend_user_it_free_current(zend_object_iterator *_iter TSRMLS_DC)
static void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
@@ -125,10 +125,7 @@ static void zend_user_it_dtor(zend_object_iterator *_iter TSRMLS_DC)
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
if (iter->value) {
zval_ptr_dtor(&iter->value);
iter->value = NULL;
}
zend_user_it_invalidate_current(_iter TSRMLS_CC);
zval_ptr_dtor(&object);
efree(iter);
}
@@ -186,12 +183,15 @@ static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval);
if (!retval) {
*int_key = 0;
zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name);
return HASH_KEY_IS_LONG;
}
switch (retval->type) {
default:
zend_error(E_WARNING, "Illegal type returned from %s::key()", iter->ce->name);
case IS_NULL:
*str_key = "";
*str_key_len = 0;
*int_key = 0;
zval_ptr_dtor(&retval);
return HASH_KEY_IS_LONG;
@@ -199,7 +199,6 @@ static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_
case IS_STRING:
*str_key = estrndup(retval->value.str.val, retval->value.str.len);
*str_key_len = retval->value.str.len+1;
*int_key = 0;
zval_ptr_dtor(&retval);
return HASH_KEY_IS_STRING;
@@ -225,10 +224,7 @@ static void zend_user_it_move_forward(zend_object_iterator *_iter TSRMLS_DC)
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
if (iter->value) {
zval_ptr_dtor(&iter->value);
iter->value = NULL;
}
zend_user_it_invalidate_current(_iter TSRMLS_CC);
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_next, "next", NULL);
}
/* }}} */
@@ -239,6 +235,7 @@ static void zend_user_it_rewind(zend_object_iterator *_iter TSRMLS_DC)
zend_user_iterator *iter = (zend_user_iterator*)_iter;
zval *object = (zval*)iter->it.data;
zend_user_it_invalidate_current(_iter TSRMLS_CC);
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_rewind, "rewind", NULL);
}
/* }}} */
@@ -249,7 +246,8 @@ zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = {
zend_user_it_get_current_data,
zend_user_it_get_current_key,
zend_user_it_move_forward,
zend_user_it_rewind
zend_user_it_rewind,
zend_user_it_invalidate_current
};
/* {{{ zend_user_it_get_iterator */
-2
View File
@@ -37,8 +37,6 @@ typedef struct _zend_user_iterator {
zval *value;
} zend_user_iterator;
ZEND_API void zend_user_it_free_current(zend_object_iterator *_iter TSRMLS_DC);
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC);
#define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \
+2 -1
View File
@@ -44,7 +44,8 @@ static zend_object_handlers iterator_object_handlers = {
NULL, /* get_ce */
NULL, /* get class name */
NULL, /* compare */
NULL /* cast */
NULL, /* cast */
NULL /* count */
};
ZEND_API void zend_register_iterator_wrapper(TSRMLS_D)
+3
View File
@@ -46,6 +46,9 @@ typedef struct _zend_object_iterator_funcs {
/* rewind to start of data (optional, may be NULL) */
void (*rewind)(zend_object_iterator *iter TSRMLS_DC);
/* invalidate current value/key (optional, may be NULL) */
void (*invalidate_current)(zend_object_iterator *iter TSRMLS_DC);
} zend_object_iterator_funcs;
struct _zend_object_iterator {
+7 -2
View File
@@ -229,8 +229,13 @@ additional_catches:
;
non_empty_additional_catches:
non_empty_additional_catches T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$2, &$4, &$6, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$2 TSRMLS_CC); }
| T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
additional_catch { $$ = $1; }
| non_empty_additional_catches additional_catch { $$ = $2; }
;
additional_catch:
T_CATCH '(' fully_qualified_class_name { $$.u.opline_num = get_next_op_number(CG(active_op_array)); } T_VARIABLE ')' { zend_do_begin_catch(&$1, &$3, &$5, 0 TSRMLS_CC); } '{' inner_statement_list '}' { zend_do_end_catch(&$1 TSRMLS_CC); }
;
+6 -1
View File
@@ -24,10 +24,15 @@
#include <sys/types.h>
#include "zend.h"
#include "zend_types.h"
/* Define this to enable Zend MM */
#ifdef ZEND_WIN32
#undef ZEND_MM
#else
#define ZEND_MM
#endif
/* mm block type */
typedef struct _zend_mm_block {
+1 -1
View File
@@ -37,7 +37,7 @@ extern struct _zend_arg_info third_arg_force_ref[4];
extern struct _zend_arg_info fourth_arg_force_ref[5];
extern struct _zend_arg_info all_args_by_ref[1];
#define ZEND_MODULE_API_NO 20040316
#define ZEND_MODULE_API_NO 20040412
#ifdef ZTS
#define USING_ZTS 1
#else
+3 -2
View File
@@ -141,7 +141,7 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
zval_ptr_dtor(&value);
if (retval && zval_is_true(retval)) {
if (retval && zend_is_true(retval)) {
ret = SUCCESS;
} else {
ret = FAILURE;
@@ -671,6 +671,7 @@ static union _zend_function *zend_std_get_method(zval *object, char *method_name
zobj = Z_OBJ_P(object);
if (zend_hash_find(&zobj->ce->function_table, lc_method_name, method_len+1, (void **)&fbc) == FAILURE) {
free_alloca(lc_method_name);
if (zobj->ce->__call) {
zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function));
call_user_call->type = ZEND_INTERNAL_FUNCTION;
@@ -681,7 +682,6 @@ static union _zend_function *zend_std_get_method(zval *object, char *method_name
call_user_call->fn_flags = 0;
call_user_call->function_name = estrndup(method_name, method_len);
free_alloca(lc_method_name);
return (union _zend_function *)call_user_call;
} else {
return NULL;
@@ -972,6 +972,7 @@ ZEND_API zend_object_handlers std_object_handlers = {
zend_std_object_get_class_name, /* get_class_name */
zend_std_compare_objects, /* compare_objects */
NULL, /* cast_object */
NULL, /* count_elements */
};
/*
+4
View File
@@ -93,6 +93,9 @@ typedef int (*zend_object_get_class_name_t)(zval *object, char **class_name, zen
typedef int (*zend_object_compare_t)(zval *object1, zval *object2 TSRMLS_DC);
typedef int (*zend_object_cast_t)(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC);
/* updates *count to hold the number of elements present and returns SUCCESS.
* Returns FAILURE if the object does not have any sense of overloaded dimensions */
typedef int (*zend_object_count_elements_t)(zval *object, long *count TSRMLS_DC);
typedef struct _zend_object_handlers {
/* general object functions */
@@ -119,6 +122,7 @@ typedef struct _zend_object_handlers {
zend_object_get_class_name_t get_class_name;
zend_object_compare_t compare_objects;
zend_object_cast_t cast_object;
zend_object_count_elements_t count_elements;
} zend_object_handlers;
extern ZEND_API zend_object_handlers std_object_handlers;
+20 -3
View File
@@ -48,10 +48,12 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
if (objects->object_buckets[i].valid) {
struct _store_object *obj = &objects->object_buckets[i].bucket.obj;
if (obj->dtor && !objects->object_buckets[i].destructor_called) {
obj->dtor(obj->object, i TSRMLS_CC);
if (!objects->object_buckets[i].destructor_called) {
objects->object_buckets[i].destructor_called = 1;
if (obj->dtor) {
obj->dtor(obj->object, i TSRMLS_CC);
}
}
objects->object_buckets[i].destructor_called = 1;
}
}
}
@@ -190,6 +192,20 @@ ZEND_API void *zend_object_store_get_object(zval *zobject TSRMLS_DC)
return EG(objects_store).object_buckets[handle].bucket.obj.object;
}
/* zend_object_store_set_object:
* It is ONLY valid to call this function from within the constructor of an
* overloaded object. Its purpose is to set the object pointer for the object
* when you can't possibly know its value until you have parsed the arguments
* from the constructor function. You MUST NOT use this function for any other
* weird games, or call it at any other time after the object is constructed.
* */
ZEND_API void zend_object_store_set_object(zval *zobject, void *object TSRMLS_DC)
{
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
EG(objects_store).object_buckets[handle].bucket.obj.object = object;
}
/* Proxy objects workings */
typedef struct _zend_proxy_object {
@@ -284,6 +300,7 @@ static zend_object_handlers zend_object_proxy_handlers = {
NULL, /* get_class_name */
NULL, /* compare_objects */
NULL, /* cast_object */
NULL, /* count_elements */
};
+3 -1
View File
@@ -64,9 +64,11 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
ZEND_API void zend_objects_store_add_ref(zval *object TSRMLS_DC);
ZEND_API void zend_objects_store_del_ref(zval *object TSRMLS_DC);
ZEND_API void zend_objects_store_delete_obj(zval *object TSRMLS_DC);
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_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC);
#define ZEND_OBJECTS_STORE_HANDLERS zend_objects_store_add_ref, zend_objects_store_del_ref, zend_objects_store_clone_obj
+49 -24
View File
@@ -175,6 +175,9 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
(holder) = (*(op)); \
zval_copy_ctor(&(holder)); \
convert_to_long_base(&(holder), 10); \
if ((holder).type == IS_LONG) { \
(op) = &(holder); \
} \
break; \
} \
}
@@ -262,7 +265,6 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
if (Z_OBJ_HT_P(op)->cast_object) { \
if (Z_OBJ_HT_P(op)->cast_object(op, op, ctype, 1 TSRMLS_CC) == SUCCESS) { \
op->type = ctype; \
return; \
} \
} else { \
if(Z_OBJ_HT_P(op)->get) { \
@@ -273,7 +275,6 @@ ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC)
*op = *newop; \
FREE_ZVAL(newop); \
conv_func(op); \
return; \
} \
} \
}
@@ -322,19 +323,23 @@ ZEND_API void convert_to_long_base(zval *op, int base)
TSRMLS_FETCH();
convert_object_to_type(op, IS_LONG, convert_to_long);
if (op->type == IS_LONG) {
return;
}
if (EG(ze1_compatibility_mode)) {
HashTable *ht = Z_OBJPROP_P(op);
if (ht) {
retval = (zend_hash_num_elements(ht)?1:0);
}
zval_dtor(op);
ZVAL_LONG(op, retval);
return;
} else {
zend_error(E_NOTICE, "Object of class %s could not be converted to integer", Z_OBJCE_P(op)->name);
/* we cannot convert it to long */
return;
}
zval_dtor(op);
ZVAL_LONG(op, retval);
break;
}
default:
zend_error(E_WARNING, "Cannot convert to ordinal value");
@@ -386,6 +391,10 @@ ZEND_API void convert_to_double(zval *op)
convert_object_to_type(op, IS_DOUBLE, convert_to_double);
if (op->type == IS_DOUBLE) {
return;
}
if (EG(ze1_compatibility_mode)) {
HashTable *ht = Z_OBJPROP_P(op);
if (ht) {
@@ -470,6 +479,10 @@ ZEND_API void convert_to_boolean(zval *op)
TSRMLS_FETCH();
convert_object_to_type(op, IS_BOOL, convert_to_double);
if (op->type == IS_BOOL) {
return;
}
if (EG(ze1_compatibility_mode)) {
HashTable *ht = Z_OBJPROP_P(op);
@@ -545,6 +558,10 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
convert_object_to_type(op, IS_STRING, convert_to_string);
if (op->type == IS_STRING) {
return;
}
zend_error(E_NOTICE, "Object of class %s to string conversion", Z_OBJCE_P(op)->name);
zval_dtor(op);
op->value.str.val = estrndup_rel("Object", sizeof("Object")-1);
@@ -611,6 +628,10 @@ ZEND_API void convert_to_array(zval *op)
}
} else {
convert_object_to_type(op, IS_ARRAY, convert_to_array);
if (op->type == IS_ARRAY) {
return;
}
}
zval_dtor(op);
op->type = IS_ARRAY;
@@ -1279,6 +1300,16 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
COMPARE_RETURN_AND_FREE(SUCCESS);
}
if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) {
/* If the handlers array is not identical, fall through
* and perform get() or cast() if implemented
*/
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
zend_compare_objects(result, op1, op2 TSRMLS_CC);
COMPARE_RETURN_AND_FREE(SUCCESS);
}
}
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
@@ -1299,11 +1330,6 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
COMPARE_RETURN_AND_FREE(SUCCESS);
}
if (op1->type==IS_OBJECT && op2->type==IS_OBJECT) {
zend_compare_objects(result, op1, op2 TSRMLS_CC);
COMPARE_RETURN_AND_FREE(SUCCESS);
}
if (op1->type==IS_ARRAY) {
result->value.lval = 1;
result->type = IS_LONG;
@@ -1382,8 +1408,16 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
break;
case IS_OBJECT:
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2) && Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) {
result->value.lval = 1;
if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
if (EG(ze1_compatibility_mode)) {
zend_compare_objects(result, op1, op2 TSRMLS_CC);
/* comparison returns 0 in case of equality and
* 1 in case of ineqaulity, we need to reverse it
*/
result->value.lval = !result->value.lval;
} else {
result->value.lval = (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2));
}
} else {
result->value.lval = 0;
}
@@ -1887,15 +1921,6 @@ ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2 TSRMLS_DC)
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2 TSRMLS_DC)
{
result->type = IS_LONG;
if (Z_OBJ_HT_P(o1) != Z_OBJ_HT_P(o2)) {
result->value.lval = 1; /* Comparing objects of different types is pretty much meaningless */
return;
}
if (EG(ze1_compatibility_mode) && Z_OBJPROP_P(o1) && Z_OBJPROP_P(o2)) {
zend_compare_symbol_tables(result, Z_OBJPROP_P(o1), Z_OBJPROP_P(o2) TSRMLS_CC);
return;
}
if (Z_OBJ_HT_P(o1)->compare_objects == NULL) {
if (Z_OBJ_HANDLE_P(o1) == Z_OBJ_HANDLE_P(o2)) {
+94 -9
View File
@@ -183,7 +183,7 @@ static void reflection_free_objects_storage(zend_object *object TSRMLS_DC)
{
reflection_object *intern = (reflection_object *) object;
if (intern->free_ptr) {
if (intern->free_ptr && intern->ptr) {
efree(intern->ptr);
}
if (intern->obj) {
@@ -405,7 +405,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
} else {
string_printf(str, "\n");
}
string_printf(str, " }\n");
string_printf(str, "%s }\n", indent);
}
/* Default/Implicit properties */
@@ -482,7 +482,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
} else {
string_printf(str, "\n");
}
string_printf(str, " }\n");
string_printf(str, "%s }\n", indent);
}
string_printf(str, "%s}\n", indent);
@@ -639,6 +639,57 @@ static void _property_string(string *str, zend_property_info *prop, char *prop_n
}
/* }}} */
static int _extension_ini_string(zend_ini_entry *ini_entry, int num_args, va_list args, zend_hash_key *hash_key)
{
string *str = va_arg(args, string *);
char *indent = va_arg(args, char *);
int number = va_arg(args, int);
char *comma = "";
if (number == ini_entry->module_number) {
string_printf(str, " %sEntry [ %s <", indent, ini_entry->name);
if (ini_entry->modifiable & ZEND_INI_ALL) {
string_printf(str, "ALL");
} else {
if (ini_entry->modifiable & ZEND_INI_USER) {
string_printf(str, "USER");
comma = ",";
}
if (ini_entry->modifiable & ZEND_INI_PERDIR) {
string_printf(str, "%sPERDIR", comma);
comma = ",";
}
if (ini_entry->modifiable & ZEND_INI_SYSTEM) {
string_printf(str, "%sSYSTEM", comma);
}
}
string_printf(str, "> ]\n", indent, ini_entry->name);
string_printf(str, " %s Current = '%s'\n", indent, ini_entry->value ? ini_entry->value : "");
if (ini_entry->modified) {
string_printf(str, " %s Default = '%s'\n", indent, ini_entry->orig_value ? ini_entry->orig_value : "");
}
string_printf(str, " %s}\n", indent);
}
return ZEND_HASH_APPLY_KEEP;
}
static int _extension_class_string(zend_class_entry **pce, int num_args, va_list args, zend_hash_key *hash_key)
{
string *str = va_arg(args, string *);
char *indent = va_arg(args, char *);
struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*);
int *num_classes = va_arg(args, int*);
if ((*pce)->module && !strcasecmp((*pce)->module->name, module->name)) {
TSRMLS_FETCH();
string_printf(str, "\n");
_class_string(str, *pce, NULL, indent TSRMLS_CC);
(*num_classes)++;
}
return ZEND_HASH_APPLY_KEEP;
}
/* {{{ _extension_string */
static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC)
{
@@ -652,7 +703,20 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
string_printf(str, " extension #%d %s version %s ] {\n",
module->module_number, module->name,
(module->version == NO_VERSION_YET) ? "<no_version>" : module->version);
if (module->functions) {
{
string str_ini;
string_init(&str_ini);
zend_hash_apply_with_arguments(EG(ini_directives), (apply_func_args_t) _extension_ini_string, 3, &str_ini, indent, module->module_number);
if (str_ini.len > 1) {
string_printf(str, "\n - INI {\n");
string_append(str, &str_ini);
string_printf(str, "%s }\n", indent);
}
string_free(&str_ini);
}
if (module->functions && module->functions->fname) {
zend_function *fptr;
zend_function_entry *func = module->functions;
@@ -670,6 +734,24 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde
}
string_printf(str, "%s }\n", indent);
}
{
string str_classes;
string sub_indent;
int num_classes = 0;
string_init(&sub_indent);
string_printf(&sub_indent, "%s ", indent);
string_init(&str_classes);
zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) _extension_class_string, 4, &str_classes, sub_indent.string, module, &num_classes TSRMLS_CC);
if (num_classes) {
string_printf(str, "\n - Classes [%d] {\n", num_classes);
string_append(str, &str_classes);
string_printf(str, "%s }\n", indent);
}
string_free(&str_classes);
string_free(&sub_indent);
}
string_printf(str, "%s}\n", indent);
}
@@ -766,7 +848,7 @@ static void reflection_function_factory(zend_function *function, zval *object TS
reflection_instanciate(reflection_function_ptr, object TSRMLS_CC);
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
intern->ptr = function;
intern->free_ptr = 0;
intern->free_ptr = function != NULL;
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL);
}
/* }}} */
@@ -859,7 +941,10 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
}
}
INIT_PZVAL(&output);
/* Create object */
INIT_PZVAL(&reflector);
if (object_and_properties_init(&reflector, ce_ptr, NULL) == FAILURE) {
_DO_THROW("Could not create reflector");
}
@@ -2323,7 +2408,7 @@ ZEND_METHOD(reflection_class, isInstance)
}
/* }}} */
/* {{{ proto public stdclass Reflection_Class::newInstance(mixed* args)
/* {{{ proto public stdclass Reflection_Class::newInstance(mixed* args, ...)
Returns an instance of this class */
ZEND_METHOD(reflection_class, newInstance)
{
@@ -3036,7 +3121,7 @@ static int _addinientry(zend_ini_entry *ini_entry, int num_args, va_list args, z
add_assoc_null(retval, ini_entry->name);
}
}
return 0;
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
@@ -3076,7 +3161,7 @@ static int add_extension_class(zend_class_entry **pce, int num_args, va_list arg
}
/* }}} */
/* {{{ proto public array Reflection_Extension::getClasses()
/* {{{ proto public ReflectionClass[] Reflection_Extension::getClasses()
Returns an array containing Reflection_Class objects for all classes of this extension */
ZEND_METHOD(reflection_extension, getClasses)
{
@@ -3091,7 +3176,7 @@ ZEND_METHOD(reflection_extension, getClasses)
}
/* }}} */
/* {{{ proto public array Reflection_Extension::getClasses()
/* {{{ proto public array Reflection_Extension::getClassNames()
Returns an array containing all names of all classes of this extension */
ZEND_METHOD(reflection_extension, getClassNames)
{
+11 -7
View File
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
MAJOR_VERSION=5
MINOR_VERSION=0
RELEASE_VERSION=0
EXTRA_VERSION="RC2-dev"
EXTRA_VERSION="RC3RC2"
VERSION="$MAJOR_VERSION.$MINOR_VERSION.$RELEASE_VERSION$EXTRA_VERSION"
dnl Define where extension directories are located in the configure context
@@ -351,6 +351,7 @@ stdlib.h \
string.h \
syslog.h \
sysexits.h \
sys/ioctl.h \
sys/file.h \
sys/mman.h \
sys/mount.h \
@@ -364,6 +365,7 @@ sys/vfs.h \
sys/sysexits.h \
sys/varargs.h \
sys/wait.h \
termios.h \
unistd.h \
unix.h \
utime.h \
@@ -479,6 +481,7 @@ getservbyport \
getrusage \
gettimeofday \
gmtime_r \
grantpt \
inet_ntoa \
inet_ntop \
inet_pton \
@@ -494,6 +497,7 @@ mmap \
nl_langinfo \
perror \
poll \
ptsname \
putenv \
realpath \
random \
@@ -504,6 +508,7 @@ scandir \
setitimer \
setlocale \
localeconv \
setpgid \
setsockopt \
setvbuf \
shutdown \
@@ -524,6 +529,7 @@ strtok_r \
symlink \
tempnam \
tzset \
unlockpt \
unsetenv \
usleep \
nanosleep \
@@ -868,15 +874,15 @@ if test "$PHP_PEAR" != "no"; then
dnl
if test "$PHP_SAPI_CLI" = "no"; then
pear_error_msg="$pear_error_msg
PEAR requires CLI to be enabled. Add --enable-cli to the configure line."
PEAR requires CLI to be enabled. Add --enable-cli to the configure line. (or --disable-pear)"
fi
if test "$PHP_PCRE_REGEX" = "no"; then
pear_error_msg="$pear_error_msg
PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line."
PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line. (or --disable-pear)"
fi
if test "$PHP_XML" = "no"; then
pear_error_msg="$pear_error_msg
PEAR requires XML to be enabled. Add --enable-xml to the configure line."
PEAR requires XML to be enabled. Add --enable-xml to the configure line. (or --disable-pear)"
fi
dnl
@@ -884,7 +890,7 @@ dnl ext/xmlrpc is not really there yet to be a requirement..
dnl
dnl if test "$PHP_XMLRPC" = "no"; then
dnl pear_error_msg="$pear_error_msg
dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line."
dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line. (or --disable-pear)"
dnl fi
dnl
@@ -1055,8 +1061,6 @@ if test "$PHP_SAPI_CLI" != "no"; then
PHP_CLI_TARGET="\$(SAPI_CLI_PATH)"
PHP_INSTALL_CLI_TARGET="install-cli"
PHP_ADD_SOURCES(sapi/cli, php_cli.c getopt.c,, cli)
else
with_pear=no
fi
PHP_SUBST(PHP_CLI_TARGET)
+2
View File
@@ -100,6 +100,8 @@ PHP_MSHUTDOWN_FUNCTION(bcmath)
_bc_free_num_ex(&BCG(_one_), 1);
_bc_free_num_ex(&BCG(_two_), 1);
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
/* }}} */
+7
View File
@@ -0,0 +1,7 @@
EXPORTS
BZ2_bzCompressInit
BZ2_bzCompress
BZ2_bzCompressEnd
BZ2_bzDecompressInit
BZ2_bzDecompress
BZ2_bzDecompressEnd
-2
View File
@@ -2,8 +2,6 @@
BZ2 with files
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php // $Id$
-2
View File
@@ -2,8 +2,6 @@
BZ2 with strings
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php // $Id$
-3
View File
@@ -65,9 +65,6 @@ $word->Quit();
TODO:
- Mapping PHP arrays as SafeArray's. This is currently not done.
Probably will implement this into $a = new variant($php_array, VT_ARRAY)
or something similar.
- documentation
* dotnet support requires that you have the mscoree.h header from the .net sdk
+67
View File
@@ -281,6 +281,58 @@ PHP_FUNCTION(com_create_instance)
}
/* }}} */
/* {{{ proto object com_get_active_object(string progid [, int code_page ])
Returns a handle to an already running instance of a COM object */
PHP_FUNCTION(com_get_active_object)
{
CLSID clsid;
char *module_name;
long module_name_len;
long code_page = COMG(code_page);
IUnknown *unk = NULL;
IDispatch *obj = NULL;
HRESULT res;
OLECHAR *module = NULL;
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
&module_name, &module_name_len, &code_page)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments!" TSRMLS_CC);
return;
}
module = php_com_string_to_olestring(module_name, module_name_len, code_page TSRMLS_CC);
res = CLSIDFromString(module, &clsid);
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
} else {
res = GetActiveObject(&clsid, NULL, &unk);
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
} else {
res = IUnknown_QueryInterface(unk, &IID_IDispatch, &obj);
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
} else if (obj) {
/* we got our dispatchable object */
php_com_wrap_dispatch(return_value, obj, code_page TSRMLS_CC);
}
}
}
if (obj) {
IDispatch_Release(obj);
}
if (unk) {
IUnknown_Release(obj);
}
efree(module);
}
/* }}} */
/* Performs an Invoke on the given com object.
* returns a failure code and creates an exception if there was an error */
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
@@ -333,6 +385,17 @@ HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
spprintf(&msg, 0, "Parameter %d: %s", arg_err, desc);
LocalFree(desc);
break;
case DISP_E_BADPARAMCOUNT:
if ((disp_params->cArgs + disp_params->cNamedArgs == 0) && (flags == DISPATCH_PROPERTYGET)) {
/* if getting a property and they are missing all parameters,
* we want to create a proxy object for them; so lets not create an
* exception here */
msg = NULL;
break;
}
/* else fall through */
default:
desc = php_win_err(hr);
spprintf(&msg, 0, "Error %s", desc);
@@ -557,6 +620,10 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
efree(vargs);
}
/* a bit strange this, but... */
if (hr == DISP_E_BADPARAMCOUNT)
return hr;
return SUCCEEDED(hr) ? SUCCESS : FAILURE;
}
+18 -4
View File
@@ -70,6 +70,7 @@ function_entry com_dotnet_functions[] = {
PHP_FE(com_print_typeinfo, NULL)
PHP_FE(com_message_pump, NULL)
PHP_FE(com_load_typelib, NULL)
PHP_FE(com_get_active_object, NULL)
{ NULL, NULL, NULL }
};
@@ -187,7 +188,8 @@ PHP_MINIT_FUNCTION(com_dotnet)
ZEND_INIT_MODULE_GLOBALS(com_dotnet, php_com_dotnet_init_globals, NULL);
REGISTER_INI_ENTRIES();
php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU);
php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU);
php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
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);
@@ -202,13 +204,11 @@ PHP_MINIT_FUNCTION(com_dotnet)
INIT_CLASS_ENTRY(ce, "variant", NULL);
ce.create_object = php_com_object_new;
// ce.get_iterator = php_com_iter_get;
php_com_variant_class_entry = zend_register_internal_class(&ce TSRMLS_CC);
php_com_variant_class_entry->get_iterator = php_com_iter_get;
INIT_CLASS_ENTRY(ce, "com", NULL);
ce.create_object = php_com_object_new;
// ce.get_iterator = php_com_iter_get;
tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry, "variant" TSRMLS_CC);
tmp->get_iterator = php_com_iter_get;
@@ -217,7 +217,6 @@ PHP_MINIT_FUNCTION(com_dotnet)
#if HAVE_MSCOREE_H
INIT_CLASS_ENTRY(ce, "dotnet", NULL);
ce.create_object = php_com_object_new;
// ce.get_iterator = php_com_iter_get;
tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry, "variant" TSRMLS_CC);
tmp->get_iterator = php_com_iter_get;
#endif
@@ -231,9 +230,11 @@ PHP_MINIT_FUNCTION(com_dotnet)
COM_CONST(CLSCTX_SERVER);
COM_CONST(CLSCTX_ALL);
#if 0
COM_CONST(DISPATCH_METHOD);
COM_CONST(DISPATCH_PROPERTYGET);
COM_CONST(DISPATCH_PROPERTYPUT);
#endif
COM_CONST(VT_NULL);
COM_CONST(VT_EMPTY);
@@ -272,6 +273,19 @@ PHP_MINIT_FUNCTION(com_dotnet)
COM_CONST(VARCMP_GT);
COM_CONST(VARCMP_NULL);
COM_CONST(NORM_IGNORECASE);
COM_CONST(NORM_IGNORENONSPACE);
COM_CONST(NORM_IGNORESYMBOLS);
COM_CONST(NORM_IGNOREWIDTH);
COM_CONST(NORM_IGNOREKANATYPE);
#ifdef NORM_IGNOREKASHIDA
COM_CONST(NORM_IGNOREKASHIDA);
#endif
COM_CONST(DISP_E_DIVBYZERO);
COM_CONST(DISP_E_OVERFLOW);
COM_CONST(DISP_E_BADINDEX);
COM_CONST(MK_E_UNAVAILABLE);
return SUCCESS;
}
/* }}} */
+70 -8
View File
@@ -34,6 +34,7 @@ static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC)
zval *return_value;
php_com_dotnet_object *obj;
VARIANT v;
HRESULT res;
MAKE_STD_ZVAL(return_value);
ZVAL_NULL(return_value);
@@ -46,10 +47,15 @@ static zval *com_property_read(zval *object, zval *member, int type TSRMLS_DC)
VariantInit(&v);
convert_to_string_ex(&member);
if (SUCCESS == php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC)) {
res = php_com_do_invoke(obj, Z_STRVAL_P(member), Z_STRLEN_P(member),
DISPATCH_PROPERTYGET, &v, 0, NULL TSRMLS_CC);
if (res == SUCCESS) {
php_com_zval_from_variant(return_value, &v, obj->code_page TSRMLS_CC);
VariantClear(&v);
} else if (res == DISP_E_BADPARAMCOUNT) {
php_com_saproxy_create(object, return_value, member TSRMLS_CC);
}
} else {
php_com_throw_exception(E_INVALIDARG, "this variant has no properties" TSRMLS_CC);
@@ -137,7 +143,7 @@ static zval *com_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
VariantClear(&v);
}
} else {
php_com_saproxy_create(object, return_value, Z_LVAL_P(offset) TSRMLS_CC);
php_com_saproxy_create(object, return_value, offset TSRMLS_CC);
}
} else {
@@ -152,6 +158,7 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
php_com_dotnet_object *obj;
zval *args[2];
VARIANT v;
HRESULT res;
obj = CDNO_FETCH(object);
@@ -170,12 +177,47 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
DISPATCH_METHOD|DISPATCH_PROPERTYPUT, &v, 2, args TSRMLS_CC)) {
VariantClear(&v);
}
} else if (V_ISARRAY(&obj->v)) {
LONG indices = 0;
VARTYPE vt;
if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) {
if (FAILED(SafeArrayGetVartype(V_ARRAY(&obj->v), &vt)) || vt == VT_EMPTY) {
vt = V_VT(&obj->v) & ~VT_ARRAY;
}
convert_to_long(offset);
indices = Z_LVAL_P(offset);
VariantInit(&v);
php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC);
if (V_VT(&v) != vt) {
VariantChangeType(&v, &v, 0, vt);
}
if (vt == VT_VARIANT) {
res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v);
} else {
res = SafeArrayPutElement(V_ARRAY(&obj->v), &indices, &v.lVal);
}
VariantClear(&v);
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
} else {
php_com_throw_exception(DISP_E_BADINDEX, "this variant has multiple dimensions; you can't set a new value without specifying *all* dimensions" TSRMLS_CC);
}
} else {
/* TODO: check for safearray */
php_com_throw_exception(E_INVALIDARG, "this variant is not an array type" TSRMLS_CC);
}
}
#if 0
static void com_object_set(zval **property, zval *value TSRMLS_DC)
{
/* Not yet implemented in the engine */
@@ -186,6 +228,7 @@ static zval *com_object_get(zval *property TSRMLS_DC)
/* Not yet implemented in the engine */
return NULL;
}
#endif
static int com_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
{
@@ -505,6 +548,25 @@ static int com_object_cast(zval *readobj, zval *writeobj, int type, int should_f
return SUCCESS;
}
static int com_object_count(zval *object, long *count TSRMLS_DC)
{
php_com_dotnet_object *obj;
LONG ubound = 0, lbound = 0;
obj = CDNO_FETCH(object);
if (!V_ISARRAY(&obj->v)) {
return FAILURE;
}
SafeArrayGetLBound(V_ARRAY(&obj->v), 1, &lbound);
SafeArrayGetUBound(V_ARRAY(&obj->v), 1, &ubound);
*count = ubound - lbound + 1;
return SUCCESS;
}
zend_object_handlers php_com_object_handlers = {
ZEND_OBJECTS_STORE_HANDLERS,
com_property_read,
@@ -512,8 +574,8 @@ zend_object_handlers php_com_object_handlers = {
com_read_dimension,
com_write_dimension,
NULL,
com_object_get,
com_object_set,
NULL, //com_object_get,
NULL, //com_object_set,
com_property_exists,
com_property_delete,
com_dimension_exists,
@@ -525,7 +587,8 @@ zend_object_handlers php_com_object_handlers = {
com_class_entry_get,
com_class_name_get,
com_objects_compare,
com_object_cast
com_object_cast,
com_object_count
};
void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSRMLS_DC)
@@ -614,7 +677,6 @@ zend_object_value php_com_object_new(zend_class_entry *ce TSRMLS_DC)
obj->code_page = CP_ACP;
obj->ce = ce;
retval.handle = zend_objects_store_put(obj, NULL, php_com_object_free_storage, php_com_object_clone TSRMLS_CC);
retval.handlers = &php_com_object_handlers;
+2 -2
View File
@@ -38,7 +38,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
}
zend_throw_exception(php_com_exception_class_entry, message, (long)code TSRMLS_CC);
if (free_msg) {
efree(message);
LocalFree(message);
}
}
@@ -118,7 +118,7 @@ PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 T
/* check bounds */
if (dim1 < lbound || dim1 > ubound) {
php_com_throw_exception(E_INVALIDARG, "index out of bounds" TSRMLS_CC);
php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
return 0;
}
+789
View File
@@ -0,0 +1,789 @@
/*
+----------------------------------------------------------------------+
| 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: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
/* Infrastructure for working with persistent COM objects.
* Implements: IStream* wrapper for PHP streams.
* TODO: Magic __wakeup and __sleep handlers for serialization
* (can wait till 5.1) */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_com_dotnet.h"
#include "php_com_dotnet_internal.h"
#include "Zend/zend_exceptions.h"
/* {{{ expose php_stream as a COM IStream */
typedef struct {
CONST_VTBL struct IStreamVtbl *lpVtbl;
THREAD_T engine_thread;
LONG refcount;
php_stream *stream;
int id;
} php_istream;
static int le_istream;
static void istream_destructor(php_istream *stm);
static void istream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
php_istream *stm = (php_istream *)rsrc->ptr;
istream_destructor(stm);
}
#define FETCH_STM() \
php_istream *stm = (php_istream*)This; \
if (tsrm_thread_id() != stm->engine_thread) \
return E_UNEXPECTED;
static HRESULT STDMETHODCALLTYPE stm_queryinterface(
IStream *This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject)
{
TSRMLS_FETCH();
FETCH_STM();
if (IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IStream, riid)) {
*ppvObject = This;
InterlockedIncrement(&stm->refcount);
return S_OK;
}
*ppvObject = NULL;
return E_NOINTERFACE;
}
static ULONG STDMETHODCALLTYPE stm_addref(IStream *This)
{
TSRMLS_FETCH();
FETCH_STM();
return InterlockedIncrement(&stm->refcount);
}
static ULONG STDMETHODCALLTYPE stm_release(IStream *This)
{
ULONG ret;
TSRMLS_FETCH();
FETCH_STM();
ret = InterlockedDecrement(&stm->refcount);
if (ret == 0) {
/* destroy it */
if (stm->id)
zend_list_delete(stm->id);
}
return ret;
}
static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULONG *pcbRead)
{
int nread;
TSRMLS_FETCH();
FETCH_STM();
nread = php_stream_read(stm->stream, pv, cb);
if (pcbRead) {
*pcbRead = nread > 0 ? nread : 0;
}
if (nread > 0) {
return S_OK;
}
return S_FALSE;
}
static HRESULT STDMETHODCALLTYPE stm_write(IStream *This, void const *pv, ULONG cb, ULONG *pcbWritten)
{
int nwrote;
TSRMLS_FETCH();
FETCH_STM();
nwrote = php_stream_write(stm->stream, pv, cb);
if (pcbWritten) {
*pcbWritten = nwrote > 0 ? nwrote : 0;
}
if (nwrote > 0) {
return S_OK;
}
return S_FALSE;
}
static HRESULT STDMETHODCALLTYPE stm_seek(IStream *This, LARGE_INTEGER dlibMove,
DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
{
off_t offset;
int whence;
int ret;
TSRMLS_FETCH();
FETCH_STM();
switch (dwOrigin) {
case STREAM_SEEK_SET: whence = SEEK_SET; break;
case STREAM_SEEK_CUR: whence = SEEK_CUR; break;
case STREAM_SEEK_END: whence = SEEK_END; break;
default:
return STG_E_INVALIDFUNCTION;
}
if (dlibMove.HighPart) {
/* we don't support 64-bit offsets */
return STG_E_INVALIDFUNCTION;
}
offset = dlibMove.QuadPart;
ret = php_stream_seek(stm->stream, offset, whence);
if (plibNewPosition) {
plibNewPosition->QuadPart = (ULONGLONG)(ret >= 0 ? ret : 0);
}
return ret >= 0 ? S_OK : STG_E_INVALIDFUNCTION;
}
static HRESULT STDMETHODCALLTYPE stm_set_size(IStream *This, ULARGE_INTEGER libNewSize)
{
TSRMLS_FETCH();
FETCH_STM();
if (libNewSize.HighPart) {
return STG_E_INVALIDFUNCTION;
}
if (php_stream_truncate_supported(stm->stream)) {
int ret = php_stream_truncate_set_size(stm->stream, (size_t)libNewSize.QuadPart);
if (ret == 0) {
return S_OK;
}
}
return STG_E_INVALIDFUNCTION;
}
static HRESULT STDMETHODCALLTYPE stm_copy_to(IStream *This, IStream *pstm, ULARGE_INTEGER cb,
ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
{
TSRMLS_FETCH();
FETCH_STM();
return E_NOTIMPL;
}
static HRESULT STDMETHODCALLTYPE stm_commit(IStream *This, DWORD grfCommitFlags)
{
TSRMLS_FETCH();
FETCH_STM();
php_stream_flush(stm->stream);
return S_OK;
}
static HRESULT STDMETHODCALLTYPE stm_revert(IStream *This)
{
/* NOP */
return S_OK;
}
static HRESULT STDMETHODCALLTYPE stm_lock_region(IStream *This,
ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD lockType)
{
return STG_E_INVALIDFUNCTION;
}
static HRESULT STDMETHODCALLTYPE stm_unlock_region(IStream *This,
ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD lockType)
{
return STG_E_INVALIDFUNCTION;
}
static HRESULT STDMETHODCALLTYPE stm_stat(IStream *This,
STATSTG *pstatstg, DWORD grfStatFlag)
{
return STG_E_INVALIDFUNCTION;
}
static HRESULT STDMETHODCALLTYPE stm_clone(IStream *This, IStream **ppstm)
{
return STG_E_INVALIDFUNCTION;
}
static struct IStreamVtbl php_istream_vtbl = {
stm_queryinterface,
stm_addref,
stm_release,
stm_read,
stm_write,
stm_seek,
stm_set_size,
stm_copy_to,
stm_commit,
stm_revert,
stm_lock_region,
stm_unlock_region,
stm_stat,
stm_clone
};
static void istream_destructor(php_istream *stm)
{
TSRMLS_FETCH();
if (stm->id) {
int id = stm->id;
stm->id = 0;
zend_list_delete(id);
return;
}
if (stm->refcount > 0) {
CoDisconnectObject((IUnknown*)stm, 0);
}
zend_list_delete(stm->stream->rsrc_id);
CoTaskMemFree(stm);
}
/* }}} */
PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
{
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
if (stm == NULL)
return NULL;
memset(stm, 0, sizeof(*stm));
stm->engine_thread = tsrm_thread_id();
stm->lpVtbl = &php_istream_vtbl;
stm->refcount = 1;
stm->stream = stream;
zend_list_addref(stream->rsrc_id);
stm->id = zend_list_insert(stm, le_istream);
return (IStream*)stm;
}
#define CPH_ME(fname, arginfo) PHP_ME(com_persist, fname, arginfo, ZEND_ACC_PUBLIC)
#define CPH_SME(fname, arginfo) PHP_ME(com_persist, fname, arginfo, ZEND_ACC_ALLOW_STATIC|ZEND_ACC_PUBLIC)
#define CPH_METHOD(fname) static PHP_METHOD(com_persist, fname)
#define CPH_FETCH() php_com_persist_helper *helper = (php_com_persist_helper*)zend_object_store_get_object(getThis() TSRMLS_CC);
#define CPH_NO_OBJ() if (helper->unk == NULL) { php_com_throw_exception(E_INVALIDARG, "No COM object is associated with this helper instance" TSRMLS_CC); return; }
typedef struct {
zend_object std;
long codepage;
IUnknown *unk;
IPersistStream *ips;
IPersistStreamInit *ipsi;
IPersistFile *ipf;
} php_com_persist_helper;
static zend_object_handlers helper_handlers;
static zend_class_entry *helper_ce;
static inline HRESULT get_persist_stream(php_com_persist_helper *helper)
{
if (!helper->ips && helper->unk) {
return IUnknown_QueryInterface(helper->unk, &IID_IPersistStream, &helper->ips);
}
return helper->ips ? S_OK : E_NOTIMPL;
}
static inline HRESULT get_persist_stream_init(php_com_persist_helper *helper)
{
if (!helper->ipsi && helper->unk) {
return IUnknown_QueryInterface(helper->unk, &IID_IPersistStreamInit, &helper->ipsi);
}
return helper->ipsi ? S_OK : E_NOTIMPL;
}
static inline HRESULT get_persist_file(php_com_persist_helper *helper)
{
if (!helper->ipf && helper->unk) {
return IUnknown_QueryInterface(helper->unk, &IID_IPersistFile, &helper->ipf);
}
return helper->ipf ? S_OK : E_NOTIMPL;
}
/* {{{ proto string COMPersistHelper::GetCurFile()
Determines the filename into which an object will be saved, or false if none is set, via IPersistFile::GetCurFile */
CPH_METHOD(GetCurFileName)
{
HRESULT res;
OLECHAR *olename = NULL;
CPH_FETCH();
CPH_NO_OBJ();
res = get_persist_file(helper);
if (helper->ipf) {
res = IPersistFile_GetCurFile(helper->ipf, &olename);
if (res == S_OK) {
Z_TYPE_P(return_value) = IS_STRING;
Z_STRVAL_P(return_value) = php_com_olestring_to_string(olename,
&Z_STRLEN_P(return_value), helper->codepage TSRMLS_CC);
CoTaskMemFree(olename);
return;
} else if (res == S_FALSE) {
CoTaskMemFree(olename);
RETURN_FALSE;
}
php_com_throw_exception(res, NULL TSRMLS_CC);
} else {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
}
/* }}} */
/* {{{ proto bool COMPersistHelper::SaveToFile(string filename [, bool remember])
Persist object data to file, via IPersistFile::Save */
CPH_METHOD(SaveToFile)
{
HRESULT res;
char *filename, *fullpath = NULL;
long filename_len;
zend_bool remember = TRUE;
OLECHAR *olefilename = NULL;
CPH_FETCH();
CPH_NO_OBJ();
res = get_persist_file(helper);
if (helper->ipf) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s!|b",
&filename, &filename_len, &remember)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
}
if (filename) {
fullpath = expand_filepath(filename, NULL TSRMLS_CC);
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
RETURN_FALSE;
}
if (php_check_open_basedir(fullpath TSRMLS_CC)) {
RETURN_FALSE;
}
olefilename = php_com_string_to_olestring(filename, strlen(fullpath), helper->codepage TSRMLS_CC);
efree(fullpath);
}
res = IPersistFile_Save(helper->ipf, olefilename, remember);
if (SUCCEEDED(res)) {
if (!olefilename) {
res = IPersistFile_GetCurFile(helper->ipf, &olefilename);
if (S_OK == res) {
IPersistFile_SaveCompleted(helper->ipf, olefilename);
CoTaskMemFree(olefilename);
olefilename = NULL;
}
} else if (remember) {
IPersistFile_SaveCompleted(helper->ipf, olefilename);
}
}
if (olefilename) {
efree(olefilename);
}
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
} else {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
}
/* }}} */
/* {{{ proto bool COMPersistHelper::LoadFromFile(string filename [, int flags])
Load object data from file, via IPersistFile::Load */
CPH_METHOD(LoadFromFile)
{
HRESULT res;
char *filename, *fullpath;
long filename_len;
long flags = 0;
OLECHAR *olefilename;
CPH_FETCH();
CPH_NO_OBJ();
res = get_persist_file(helper);
if (helper->ipf) {
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
&filename, &filename_len, &flags)) {
php_com_throw_exception(E_INVALIDARG, "Invalid arguments" TSRMLS_CC);
return;
}
fullpath = expand_filepath(filename, NULL TSRMLS_CC);
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
RETURN_FALSE;
}
if (php_check_open_basedir(fullpath TSRMLS_CC)) {
RETURN_FALSE;
}
olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC);
efree(fullpath);
res = IPersistFile_Load(helper->ipf, olefilename, flags);
efree(olefilename);
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
} else {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
}
/* }}} */
/* {{{ proto int COMPersistHelper::GetMaxStreamSize()
Gets maximum stream size required to store the object data, via IPersistStream::GetSizeMax (or IPersistStreamInit::GetSizeMax) */
CPH_METHOD(GetMaxStreamSize)
{
HRESULT res;
ULARGE_INTEGER size;
CPH_FETCH();
CPH_NO_OBJ();
res = get_persist_stream_init(helper);
if (helper->ipsi) {
res = IPersistStreamInit_GetSizeMax(helper->ipsi, &size);
} else {
res = get_persist_stream(helper);
if (helper->ips) {
res = IPersistStream_GetSizeMax(helper->ips, &size);
} else {
php_com_throw_exception(res, NULL TSRMLS_CC);
return;
}
}
if (res != S_OK) {
php_com_throw_exception(res, NULL TSRMLS_CC);
} else {
/* TODO: handle 64 bit properly */
RETURN_LONG((LONG)size.QuadPart);
}
}
/* }}} */
/* {{{ proto int COMPersistHelper::InitNew()
Initializes the object to a default state, via IPersistStreamInit::InitNew */
CPH_METHOD(InitNew)
{
HRESULT res;
CPH_FETCH();
CPH_NO_OBJ();
res = get_persist_stream_init(helper);
if (helper->ipsi) {
res = IPersistStreamInit_InitNew(helper->ipsi);
if (res != S_OK) {
php_com_throw_exception(res, NULL TSRMLS_CC);
} else {
RETURN_TRUE;
}
} else {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
}
/* }}} */
/* {{{ proto mixed COMPersistHelper::LoadFromStream(resource stream)
Initializes an object from the stream where it was previously saved, via IPersistStream::Load or OleLoadFromStream */
CPH_METHOD(LoadFromStream)
{
zval *zstm;
php_stream *stream;
IStream *stm = NULL;
HRESULT res;
CPH_FETCH();
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) {
php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
return;
}
php_stream_from_zval_no_verify(stream, &zstm);
if (stream == NULL) {
php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC);
return;
}
stm = php_com_wrapper_export_stream(stream TSRMLS_CC);
if (stm == NULL) {
php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC);
return;
}
res = S_OK;
RETVAL_TRUE;
if (helper->unk == NULL) {
IDispatch *disp = NULL;
/* we need to create an object and load using OleLoadFromStream */
res = OleLoadFromStream(stm, &IID_IDispatch, &disp);
if (SUCCEEDED(res)) {
php_com_wrap_dispatch(return_value, disp, COMG(code_page) TSRMLS_CC);
}
} else {
res = get_persist_stream_init(helper);
if (helper->ipsi) {
res = IPersistStreamInit_Load(helper->ipsi, stm);
} else {
res = get_persist_stream(helper);
if (helper->ips) {
res = IPersistStreamInit_Load(helper->ipsi, stm);
}
}
}
IStream_Release(stm);
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
RETURN_NULL();
}
}
/* }}} */
/* {{{ proto int COMPersistHelper::SaveToStream(resource stream)
Saves the object to a stream, via IPersistStream::Save */
CPH_METHOD(SaveToStream)
{
zval *zstm;
php_stream *stream;
IStream *stm = NULL;
HRESULT res;
CPH_FETCH();
CPH_NO_OBJ();
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstm)) {
php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
return;
}
php_stream_from_zval_no_verify(stream, &zstm);
if (stream == NULL) {
php_com_throw_exception(E_INVALIDARG, "expected a stream" TSRMLS_CC);
return;
}
stm = php_com_wrapper_export_stream(stream TSRMLS_CC);
if (stm == NULL) {
php_com_throw_exception(E_UNEXPECTED, "failed to wrap stream" TSRMLS_CC);
return;
}
res = get_persist_stream_init(helper);
if (helper->ipsi) {
res = IPersistStreamInit_Save(helper->ipsi, stm, TRUE);
} else {
res = get_persist_stream(helper);
if (helper->ips) {
res = IPersistStream_Save(helper->ips, stm, TRUE);
}
}
IStream_Release(stm);
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
return;
}
RETURN_TRUE;
}
/* }}} */
/* {{{ proto int COMPersistHelper::__construct([object com_object])
Creates a persistence helper object, usually associated with a com_object */
CPH_METHOD(__construct)
{
php_com_dotnet_object *obj = NULL;
zval *zobj = NULL;
CPH_FETCH();
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!",
&zobj, php_com_variant_class_entry)) {
php_com_throw_exception(E_INVALIDARG, "invalid arguments" TSRMLS_CC);
return;
}
if (!zobj) {
return;
}
obj = CDNO_FETCH(zobj);
if (V_VT(&obj->v) != VT_DISPATCH || V_DISPATCH(&obj->v) == NULL) {
php_com_throw_exception(E_INVALIDARG, "parameter must represent an IDispatch COM object" TSRMLS_CC);
return;
}
/* it is always safe to cast an interface to IUnknown */
helper->unk = (IUnknown*)V_DISPATCH(&obj->v);
IUnknown_AddRef(helper->unk);
helper->codepage = obj->code_page;
}
/* }}} */
static zend_function_entry com_persist_helper_methods[] = {
CPH_ME(__construct, NULL)
CPH_ME(GetCurFileName, NULL)
CPH_ME(SaveToFile, NULL)
CPH_ME(LoadFromFile, NULL)
CPH_ME(GetMaxStreamSize, NULL)
CPH_ME(InitNew, NULL)
CPH_ME(LoadFromStream, NULL)
CPH_ME(SaveToStream, NULL)
{NULL, NULL, NULL}
};
static void helper_free_storage(void *obj TSRMLS_DC)
{
php_com_persist_helper *object = (php_com_persist_helper*)obj;
if (object->ipf) {
IPersistFile_Release(object->ipf);
}
if (object->ips) {
IPersistStream_Release(object->ips);
}
if (object->ipsi) {
IPersistStreamInit_Release(object->ipsi);
}
if (object->unk) {
IUnknown_Release(object->unk);
}
zend_hash_destroy(object->std.properties);
FREE_HASHTABLE(object->std.properties);
efree(object);
}
static void helper_clone(void *obj, void **clone_ptr TSRMLS_DC)
{
php_com_persist_helper *clone, *object = (php_com_persist_helper*)obj;
zval *tmp;
clone = emalloc(sizeof(*object));
memcpy(clone, object, sizeof(*object));
*clone_ptr = clone;
ALLOC_HASHTABLE(clone->std.properties);
zend_hash_init(clone->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
if (clone->ipf) {
IPersistFile_AddRef(clone->ipf);
}
if (clone->ips) {
IPersistStream_AddRef(clone->ips);
}
if (clone->ipsi) {
IPersistStreamInit_AddRef(clone->ipsi);
}
if (clone->unk) {
IUnknown_AddRef(clone->unk);
}
}
static zend_object_value helper_new(zend_class_entry *ce TSRMLS_DC)
{
php_com_persist_helper *helper;
zend_object_value retval;
zval *tmp;
helper = emalloc(sizeof(*helper));
memset(helper, 0, sizeof(*helper));
ALLOC_HASHTABLE(helper->std.properties);
zend_hash_init(helper->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
helper->std.ce = helper_ce;
retval.handle = zend_objects_store_put(helper, NULL, helper_free_storage, helper_clone TSRMLS_CC);
retval.handlers = &helper_handlers;
return retval;
}
int php_com_persist_minit(INIT_FUNC_ARGS)
{
zend_class_entry ce;
memcpy(&helper_handlers, zend_get_std_object_handlers(), sizeof(helper_handlers));
helper_handlers.clone_obj = NULL;
INIT_CLASS_ENTRY(ce, "COMPersistHelper", com_persist_helper_methods);
ce.create_object = helper_new;
helper_ce = zend_register_internal_class(&ce TSRMLS_CC);
helper_ce->ce_flags |= ZEND_ACC_FINAL;
le_istream = zend_register_list_destructors_ex(istream_dtor,
NULL, "com_dotnet_istream_wrapper", module_number);
return SUCCESS;
}
/*
* 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
*/
+183 -29
View File
@@ -20,7 +20,9 @@
/* This module implements a SafeArray proxy which is used internally
* by the engine when resolving multi-dimensional array accesses on
* SafeArray types
* SafeArray types.
* In addition, the proxy is now able to handle properties of COM objects
* that smell like PHP arrays.
* */
#ifdef HAVE_CONFIG_H
@@ -43,7 +45,7 @@ typedef struct {
LONG dimensions;
/* this is an array whose size_is(dimensions) */
LONG *indices;
zval **indices;
} php_com_saproxy;
@@ -58,16 +60,25 @@ typedef struct {
#define SA_FETCH(zv) (php_com_saproxy*)zend_object_store_get_object(zv TSRMLS_CC)
static zval *saproxy_property_read(zval *object, zval *member, zend_bool silent TSRMLS_DC)
static inline void clone_indices(php_com_saproxy *dest, php_com_saproxy *src, int ndims)
{
int i;
for (i = 0; i < ndims; i++) {
MAKE_STD_ZVAL(dest->indices[i]);
*dest->indices[i] = *src->indices[i];
zval_copy_ctor(dest->indices[i]);
}
}
static zval *saproxy_property_read(zval *object, zval *member, int type TSRMLS_DC)
{
zval *return_value;
MAKE_STD_ZVAL(return_value);
ZVAL_NULL(return_value);
if (!silent) {
php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC);
}
php_com_throw_exception(E_INVALIDARG, "safearray has no properties" TSRMLS_CC);
return return_value;
}
@@ -84,15 +95,50 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
UINT dims;
SAFEARRAY *sa;
LONG ubound, lbound;
int i;
HRESULT res;
MAKE_STD_ZVAL(return_value);
ZVAL_NULL(return_value);
if (!V_ISARRAY(&proxy->obj->v)) {
php_com_throw_exception(E_INVALIDARG, "proxied object is no longer a safe array!" TSRMLS_CC);
if (V_VT(&proxy->obj->v) == VT_DISPATCH) {
VARIANT v;
zval **args;
/* prop-get using first dimension as the property name,
* all subsequent dimensions and the offset as parameters */
args = safe_emalloc(proxy->dimensions + 1, sizeof(zval *), 0);
for (i = 1; i < proxy->dimensions; i++) {
args[i-1] = proxy->indices[i];
}
args[i-1] = offset;
convert_to_string(proxy->indices[0]);
VariantInit(&v);
res = php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]),
Z_STRLEN_P(proxy->indices[0]), DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v,
proxy->dimensions, args TSRMLS_CC);
if (res == SUCCESS) {
php_com_zval_from_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC);
VariantClear(&v);
} else if (res == DISP_E_BADPARAMCOUNT) {
/* return another proxy */
php_com_saproxy_create(object, return_value, offset TSRMLS_CC);
}
return return_value;
} else if (!V_ISARRAY(&proxy->obj->v)) {
php_com_throw_exception(E_INVALIDARG, "invalid read from com proxy object" TSRMLS_CC);
return return_value;
}
/* the SafeArray case */
/* offset/index must be an integer */
convert_to_long(offset);
@@ -110,7 +156,7 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
SafeArrayGetUBound(sa, proxy->dimensions, &ubound);
if (Z_LVAL_P(offset) < lbound || Z_LVAL_P(offset) > ubound) {
php_com_throw_exception(E_INVALIDARG, "index out of bounds" TSRMLS_CC);
php_com_throw_exception(DISP_E_BADINDEX, "index out of bounds" TSRMLS_CC);
return return_value;
}
@@ -125,7 +171,10 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
indices = do_alloca(dims * sizeof(LONG));
/* copy indices from proxy */
memcpy(indices, proxy->indices, (dims-1) * sizeof(LONG));
for (i = 0; i < dims; i++) {
convert_to_long(proxy->indices[i]);
indices[i] = Z_LVAL_P(proxy->indices[i]);
}
/* add user-supplied index */
indices[dims-1] = Z_LVAL_P(offset);
@@ -136,21 +185,25 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
}
if (vt == VT_VARIANT) {
SafeArrayGetElement(sa, indices, &v);
res = SafeArrayGetElement(sa, indices, &v);
} else {
V_VT(&v) = vt;
SafeArrayGetElement(sa, indices, &v.lVal);
res = SafeArrayGetElement(sa, indices, &v.lVal);
}
free_alloca(indices);
php_com_wrap_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC);
if (SUCCEEDED(res)) {
php_com_wrap_variant(return_value, &v, proxy->obj->code_page TSRMLS_CC);
} else {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
VariantClear(&v);
} else {
/* return another proxy */
php_com_saproxy_create(object, return_value, Z_LVAL_P(offset) TSRMLS_CC);
php_com_saproxy_create(object, return_value, offset TSRMLS_CC);
}
return return_value;
@@ -158,9 +211,79 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type TSRMLS_
static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRMLS_DC)
{
php_com_throw_exception(E_NOTIMPL, "writing to safearray not yet implemented" TSRMLS_CC);
php_com_saproxy *proxy = SA_FETCH(object);
UINT dims;
int i;
HRESULT res;
VARIANT v;
if (V_VT(&proxy->obj->v) == VT_DISPATCH) {
/* We do a prop-set using the first dimension as the property name,
* all subsequent dimensions and offset as parameters, with value as
* the final value */
zval **args = safe_emalloc(proxy->dimensions + 2, sizeof(zval *), 0);
for (i = 1; i < proxy->dimensions; i++) {
args[i-1] = proxy->indices[i];
}
args[i-1] = offset;
args[i] = value;
convert_to_string(proxy->indices[0]);
VariantInit(&v);
if (SUCCESS == php_com_do_invoke(proxy->obj, Z_STRVAL_P(proxy->indices[0]),
Z_STRLEN_P(proxy->indices[0]), DISPATCH_PROPERTYPUT, &v, proxy->dimensions + 1,
args TSRMLS_CC)) {
VariantClear(&v);
}
efree(args);
} else if (V_ISARRAY(&proxy->obj->v)) {
LONG *indices;
VARTYPE vt;
dims = SafeArrayGetDim(V_ARRAY(&proxy->obj->v));
indices = do_alloca(dims * sizeof(LONG));
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
convert_to_long(proxy->indices[i]);
indices[i] = Z_LVAL_P(proxy->indices[i]);
}
/* add user-supplied index */
convert_to_long(offset);
indices[dims-1] = Z_LVAL_P(offset);
if (FAILED(SafeArrayGetVartype(V_ARRAY(&proxy->obj->v), &vt)) || vt == VT_EMPTY) {
vt = V_VT(&proxy->obj->v) & ~VT_ARRAY;
}
VariantInit(&v);
php_com_variant_from_zval(&v, value, proxy->obj->code_page TSRMLS_CC);
if (V_VT(&v) != vt) {
VariantChangeType(&v, &v, 0, vt);
}
if (vt == VT_VARIANT) {
res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v);
} else {
res = SafeArrayPutElement(V_ARRAY(&proxy->obj->v), indices, &v.lVal);
}
free_alloca(indices);
VariantClear(&v);
if (FAILED(res)) {
php_com_throw_exception(res, NULL TSRMLS_CC);
}
} else {
php_com_throw_exception(E_NOTIMPL, "invalid write to com proxy object" TSRMLS_CC);
}
}
#if 0
static void saproxy_object_set(zval **property, zval *value TSRMLS_DC)
{
}
@@ -170,6 +293,7 @@ static zval *saproxy_object_get(zval *property TSRMLS_DC)
/* Not yet implemented in the engine */
return NULL;
}
#endif
static int saproxy_property_exists(zval *object, zval *member, int check_empty TSRMLS_DC)
{
@@ -212,7 +336,7 @@ static int saproxy_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
static union _zend_function *saproxy_constructor_get(zval *object TSRMLS_DC)
{
/* user cannot instanciate */
/* user cannot instantiate */
return NULL;
}
@@ -238,6 +362,23 @@ static int saproxy_object_cast(zval *readobj, zval *writeobj, int type, int shou
return FAILURE;
}
static int saproxy_count_elements(zval *object, long *count TSRMLS_DC)
{
php_com_saproxy *proxy = SA_FETCH(object);
LONG ubound, lbound;
if (!V_ISARRAY(&proxy->obj->v)) {
return FAILURE;
}
SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &lbound);
SafeArrayGetUBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &ubound);
*count = ubound - lbound + 1;
return SUCCESS;
}
zend_object_handlers php_com_saproxy_handlers = {
ZEND_OBJECTS_STORE_HANDLERS,
saproxy_property_read,
@@ -245,8 +386,8 @@ zend_object_handlers php_com_saproxy_handlers = {
saproxy_read_dimension,
saproxy_write_dimension,
NULL,
saproxy_object_get,
saproxy_object_set,
NULL, //saproxy_object_get,
NULL, //saproxy_object_set,
saproxy_property_exists,
saproxy_property_delete,
saproxy_dimension_exists,
@@ -258,12 +399,20 @@ zend_object_handlers php_com_saproxy_handlers = {
saproxy_class_entry_get,
saproxy_class_name_get,
saproxy_objects_compare,
saproxy_object_cast
saproxy_object_cast,
saproxy_count_elements
};
static void saproxy_free_storage(void *object TSRMLS_DC)
{
php_com_saproxy *proxy = (php_com_saproxy *)object;
int i;
for (i = 0; i < proxy->dimensions; i++) {
if (proxy->indices) {
FREE_ZVAL(proxy->indices[i]);
}
}
zval_ptr_dtor(&proxy->zobj);
efree(proxy->indices);
@@ -279,38 +428,39 @@ static void saproxy_clone(void *object, void **clone_ptr TSRMLS_DC)
memcpy(cloneproxy, proxy, sizeof(*cloneproxy));
ZVAL_ADDREF(cloneproxy->zobj);
cloneproxy->indices = safe_emalloc(cloneproxy->dimensions, sizeof(LONG), 0);
memcpy(cloneproxy->indices, proxy->indices, cloneproxy->dimensions * sizeof(LONG));
cloneproxy->indices = safe_emalloc(cloneproxy->dimensions, sizeof(zval *), 0);
clone_indices(cloneproxy, proxy, proxy->dimensions);
*clone_ptr = cloneproxy;
}
int php_com_saproxy_create(zval *com_object, zval *proxy_out, long index TSRMLS_DC)
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC)
{
php_com_saproxy *proxy, *rel = NULL;
php_com_dotnet_object *obj;
proxy = ecalloc(1, sizeof(*proxy));
proxy->dimensions = 1;
if (Z_OBJCE_P(com_object) == php_com_saproxy_class_entry) {
rel = SA_FETCH(com_object);
obj = rel->obj;
proxy->obj = rel->obj;
proxy->zobj = rel->zobj;
proxy->dimensions += rel->dimensions;
} else {
obj = CDNO_FETCH(com_object);
proxy->obj = CDNO_FETCH(com_object);
proxy->zobj = com_object;
}
ZVAL_ADDREF(proxy->zobj);
proxy->indices = safe_emalloc(proxy->dimensions, sizeof(LONG), 0);
proxy->indices = safe_emalloc(proxy->dimensions, sizeof(zval *), 0);
if (rel) {
memcpy(proxy->indices, rel->indices, (proxy->dimensions-1) * sizeof(LONG));
clone_indices(proxy, rel, rel->dimensions);
}
proxy->indices[proxy->dimensions-1] = index;
MAKE_STD_ZVAL(proxy->indices[proxy->dimensions-1]);
*proxy->indices[proxy->dimensions-1] = *index;
zval_copy_ctor(proxy->indices[proxy->dimensions-1]);
Z_TYPE_P(proxy_out) = IS_OBJECT;
Z_OBJ_HANDLE_P(proxy_out) = zend_objects_store_put(proxy, NULL, saproxy_free_storage, saproxy_clone TSRMLS_CC);
@@ -408,6 +558,7 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
{
php_com_saproxy *proxy = SA_FETCH(object);
php_com_saproxy_iter *I;
int i;
I = ecalloc(1, sizeof(*I));
I->iter.funcs = &saproxy_iter_funcs;
@@ -418,7 +569,10 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
ZVAL_ADDREF(I->proxy_obj);
I->indices = safe_emalloc(proxy->dimensions + 1, sizeof(LONG), 0);
memcpy(I->indices, proxy->indices, proxy->dimensions * sizeof(LONG));
for (i = 0; i < proxy->dimensions; i++) {
convert_to_long(proxy->indices[i]);
I->indices[i] = Z_LVAL_P(proxy->indices[i]);
}
SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imin);
SafeArrayGetUBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imax);
+84 -24
View File
@@ -28,6 +28,76 @@
#include "php_com_dotnet.h"
#include "php_com_dotnet_internal.h"
/* create an automation SafeArray from a PHP array.
* Only creates a single-dimensional array of variants.
* The keys of the PHP hash MUST be numeric. If the array
* is sparse, then the gaps will be filled with NULL variants */
static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
{
SAFEARRAY *sa = NULL;
SAFEARRAYBOUND bound;
HashPosition pos;
int keytype;
char *strindex;
int strindexlen;
long intindex;
long max_index = 0;
VARIANT *va;
zval **item;
/* find the largest array index, and assert that all keys are integers */
zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos);
for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) {
keytype = zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &strindexlen, &intindex, 0, &pos);
if (HASH_KEY_IS_STRING == keytype) {
goto bogus;
} else if (HASH_KEY_NON_EXISTANT == keytype) {
break;
}
if (intindex > max_index) {
max_index = intindex;
}
}
/* allocate the structure */
bound.lLbound = 0;
bound.cElements = intindex + 1;
sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
/* get a lock on the array itself */
SafeArrayAccessData(sa, &va);
va = (VARIANT*)sa->pvData;
/* now fill it in */
zend_hash_internal_pointer_reset_ex(HASH_OF(z), &pos);
for (;; zend_hash_move_forward_ex(HASH_OF(z), &pos)) {
if (FAILURE == zend_hash_get_current_data_ex(HASH_OF(z), (void**)&item, &pos)) {
break;
}
zend_hash_get_current_key_ex(HASH_OF(z), &strindex, &strindexlen, &intindex, 0, &pos);
php_com_variant_from_zval(&va[intindex], *item, codepage TSRMLS_CC);
}
/* Unlock it and stuff it into our variant */
SafeArrayUnaccessData(sa);
V_VT(v) = VT_ARRAY|VT_VARIANT;
V_ARRAY(v) = sa;
return;
bogus:
php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: converting from PHP array to VARIANT array; only arrays with numeric keys are allowed");
V_VT(v) = VT_NULL;
if (sa) {
SafeArrayUnlock(sa);
SafeArrayDestroy(sa);
}
}
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
{
OLECHAR *olestring;
@@ -66,8 +136,8 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_D
break;
case IS_ARRAY:
V_VT(v) = VT_NULL;
/* TODO: map as safe array ? */
/* map as safe array */
safe_array_from_zval(v, z, codepage TSRMLS_CC);
break;
case IS_LONG:
@@ -214,7 +284,9 @@ PHP_FUNCTION(com_variant_create_instance)
obj->code_page = codepage;
}
php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC);
if (zvalue) {
php_com_variant_from_zval(&obj->v, zvalue, obj->code_page TSRMLS_CC);
}
if (ZEND_NUM_ARGS() >= 2) {
@@ -240,7 +312,7 @@ PHP_FUNCTION(com_variant_create_instance)
/* }}} */
/* {{{ proto void variant_set(object variant, mixed value)
Assigns a new value for a variant object (like "set" in VB) */
Assigns a new value for a variant object */
PHP_FUNCTION(variant_set)
{
zval *zobj, *zvalue = NULL;
@@ -371,6 +443,8 @@ static void variant_binary_operation(enum variant_binary_opcode op, INTERNAL_FUN
if (SUCCEEDED(result)) {
php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
} else {
php_com_throw_exception(result, NULL TSRMLS_CC);
}
VariantClear(&vres);
@@ -396,7 +470,7 @@ PHP_FUNCTION(variant_cat)
/* }}} */
/* {{{ proto mixed variant_sub(mixed left, mixed right)
subjects the value of the right variant from the left variant value and returns the result */
subtracts the value of the right variant from the left variant value and returns the result */
PHP_FUNCTION(variant_sub)
{
variant_binary_operation(VOP_SUB, INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -436,7 +510,7 @@ PHP_FUNCTION(variant_eqv)
/* }}} */
/* {{{ proto mixed variant_idiv(mixed left, mixed right)
Converts variants to operands and then returns the result from dividing them */
Converts variants to integers and then returns the result from dividing them */
PHP_FUNCTION(variant_idiv)
{
variant_binary_operation(VOP_IDIV, INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -528,6 +602,8 @@ static void variant_unary_operation(enum variant_unary_opcode op, INTERNAL_FUNCT
if (SUCCEEDED(result)) {
php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
} else {
php_com_throw_exception(result, NULL TSRMLS_CC);
}
VariantClear(&vres);
@@ -544,7 +620,7 @@ PHP_FUNCTION(variant_abs)
/* }}} */
/* {{{ proto mixed variant_fix(mixed left)
Returns the ? of a variant */
Returns the integer part ? of a variant */
PHP_FUNCTION(variant_fix)
{
variant_unary_operation(VOP_FIX, INTERNAL_FUNCTION_PARAM_PASSTHRU);
@@ -754,7 +830,7 @@ PHP_FUNCTION(variant_get_type)
return;
}
obj = CDNO_FETCH(zobj);
RETURN_LONG(V_VT(&obj->v));
}
/* }}} */
@@ -830,19 +906,3 @@ PHP_FUNCTION(variant_cast)
}
/* }}} */
/* {{{ proto mixed variant_index_get(object variant, mixed index1 [, mixed index2 [, ...]])
Get the value of a multi dimensional array property */
PHP_FUNCTION(variant_index_get)
{
zval *zobj;
php_com_dotnet_object *obj;
if (FAILURE == zend_parse_parameters(1 TSRMLS_CC,
"O", &zobj, php_com_variant_class_entry)) {
return;
}
obj = CDNO_FETCH(zobj);
/* TODO: finish... */
}
/* }}} */
+6 -8
View File
@@ -314,14 +314,8 @@ static HRESULT STDMETHODCALLTYPE disp_invokeex(
/* return value */
if (retval) {
if (pvarRes) {
if (Z_TYPE_P(retval) == IS_OBJECT) {
/* export the object using a dispatch like ourselves */
VariantInit(pvarRes);
V_VT(pvarRes) = VT_DISPATCH;
V_DISPATCH(pvarRes) = php_com_wrapper_export(retval TSRMLS_CC);
} else {
php_com_variant_from_zval(pvarRes, retval, COMG(code_page) TSRMLS_CC);
}
VariantInit(pvarRes);
php_com_variant_from_zval(pvarRes, retval, COMG(code_page) TSRMLS_CC);
}
zval_ptr_dtor(&retval);
} else if (pvarRes) {
@@ -344,6 +338,8 @@ static HRESULT STDMETHODCALLTYPE disp_deletememberbyname(
FETCH_DISP("DeleteMemberByName");
/* TODO: unset */
return S_FALSE;
}
@@ -355,6 +351,8 @@ static HRESULT STDMETHODCALLTYPE disp_deletememberbydispid(
FETCH_DISP("DeleteMemberByDispID");
/* TODO: unset */
return S_FALSE;
}
+1 -1
View File
@@ -7,7 +7,7 @@ if (PHP_COM_DOTNET == "yes") {
CHECK_LIB('oleaut32.lib', 'com_dotnet');
EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \
com_handlers.c com_iterator.c com_misc.c com_olechar.c \
com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c");
com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c");
AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support');
CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET');
}
+5 -1
View File
@@ -83,7 +83,7 @@ void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable TSR
/* com_saproxy.c */
zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);
int php_com_saproxy_create(zval *com_object, zval *proxy_out, long index TSRMLS_DC);
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
/* com_olechar.c */
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
@@ -99,6 +99,7 @@ PHP_FUNCTION(com_create_guid);
PHP_FUNCTION(com_print_typeinfo);
PHP_FUNCTION(com_message_pump);
PHP_FUNCTION(com_load_typelib);
PHP_FUNCTION(com_get_active_object);
HRESULT php_com_invoke_helper(php_com_dotnet_object *obj, DISPID id_member,
WORD flags, DISPPARAMS *disp_params, VARIANT *v TSRMLS_DC);
@@ -116,6 +117,9 @@ int php_com_wrapper_minit(INIT_FUNC_ARGS);
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
/* com_persist.c */
int php_com_persist_minit(INIT_FUNC_ARGS);
/* com_variant.c */
PHP_FUNCTION(com_variant_create_instance);
PHP_FUNCTION(variant_set);
+43
View File
@@ -0,0 +1,43 @@
--TEST--
COM: mapping a safearray
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
--FILE--
<?php // $Id$
error_reporting(E_ALL);
try {
$v = new VARIANT(array("123", "456", "789"));
var_dump($v);
print $v[0] . "\n";
print $v[1] . "\n";
print $v[2] . "\n";
$v[1] = "hello";
foreach ($v as $item) {
var_dump($item);
}
try {
$v[3] = "shouldn't work";
} catch (com_exception $e) {
if ($e->getCode() != DISP_E_BADINDEX) {
throw $e;
}
echo "Got BADINDEX exception OK!\n";
}
echo "OK!";
} catch (Exception $e) {
print $e;
}
?>
--EXPECT--
object(variant)#1 (0) {
}
123
456
789
string(3) "123"
string(5) "hello"
string(3) "789"
Got BADINDEX exception OK!
OK!
+470 -94
View File
@@ -19,14 +19,22 @@ $binary_ops = array('add', 'cat', 'sub', 'mul', 'and', 'div',
foreach ($values as $t => $val) {
$v = new VARIANT($val);
if ($t != variant_get_type($v)) {
printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), (string)$v);
printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val);
print $v . "\n";
}
$results = array();
foreach ($values as $op2) {
echo "--\n";
foreach ($binary_ops as $op) {
echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n";
try {
echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n";
} catch (com_exception $e) {
echo "$op:\n";
echo "\tvariant_$op($v, $op2)\n";
echo "\texception " . $e->getMessage();
printf("\tcode %08x\n\n", $e->getCode());
}
}
}
}
@@ -63,30 +71,90 @@ or: 46
pow: 480145.116863642
xor: 46
--
add:
add:
variant_add(42, hello)
exception Type mismatch.
code 80020005
cat: 42hello
sub:
mul:
and:
div:
eqv:
idiv:
imp:
mod:
or:
pow:
xor:
sub:
variant_sub(42, hello)
exception Type mismatch.
code 80020005
mul:
variant_mul(42, hello)
exception Type mismatch.
code 80020005
and:
variant_and(42, hello)
exception Type mismatch.
code 80020005
div:
variant_div(42, hello)
exception Type mismatch.
code 80020005
eqv:
variant_eqv(42, hello)
exception Type mismatch.
code 80020005
idiv:
variant_idiv(42, hello)
exception Type mismatch.
code 80020005
imp:
variant_imp(42, hello)
exception Type mismatch.
code 80020005
mod:
variant_mod(42, hello)
exception Type mismatch.
code 80020005
or:
variant_or(42, hello)
exception Type mismatch.
code 80020005
pow:
variant_pow(42, hello)
exception Type mismatch.
code 80020005
xor:
variant_xor(42, hello)
exception Type mismatch.
code 80020005
--
add: 42
cat: 42False
sub: 42
mul: 0
and: 0
div:
div:
variant_div(42, )
exception Division by zero.
code 80020012
eqv: -43
idiv:
idiv:
variant_idiv(42, )
exception Division by zero.
code 80020012
imp: -43
mod:
mod:
variant_mod(42, )
exception Division by zero.
code 80020012
or: 42
pow: 1
xor: 42
@@ -119,89 +187,337 @@ or: 4
pow: 80.2117802289664
xor: 0
--
add:
add:
variant_add(3.5, hello)
exception Type mismatch.
code 80020005
cat: 3.5hello
sub:
mul:
and:
div:
eqv:
idiv:
imp:
mod:
or:
pow:
xor:
sub:
variant_sub(3.5, hello)
exception Type mismatch.
code 80020005
mul:
variant_mul(3.5, hello)
exception Type mismatch.
code 80020005
and:
variant_and(3.5, hello)
exception Type mismatch.
code 80020005
div:
variant_div(3.5, hello)
exception Type mismatch.
code 80020005
eqv:
variant_eqv(3.5, hello)
exception Type mismatch.
code 80020005
idiv:
variant_idiv(3.5, hello)
exception Type mismatch.
code 80020005
imp:
variant_imp(3.5, hello)
exception Type mismatch.
code 80020005
mod:
variant_mod(3.5, hello)
exception Type mismatch.
code 80020005
or:
variant_or(3.5, hello)
exception Type mismatch.
code 80020005
pow:
variant_pow(3.5, hello)
exception Type mismatch.
code 80020005
xor:
variant_xor(3.5, hello)
exception Type mismatch.
code 80020005
--
add: 3.5
cat: 3.5False
sub: 3.5
mul: 0
and: 0
div:
div:
variant_div(3.5, )
exception Division by zero.
code 80020012
eqv: -5
idiv:
idiv:
variant_idiv(3.5, )
exception Division by zero.
code 80020012
imp: -5
mod:
mod:
variant_mod(3.5, )
exception Division by zero.
code 80020012
or: 4
pow: 1
xor: 4
--
add:
add:
variant_add(hello, 42)
exception Type mismatch.
code 80020005
cat: hello42
sub:
mul:
and:
div:
eqv:
idiv:
imp:
mod:
or:
pow:
xor:
sub:
variant_sub(hello, 42)
exception Type mismatch.
code 80020005
mul:
variant_mul(hello, 42)
exception Type mismatch.
code 80020005
and:
variant_and(hello, 42)
exception Type mismatch.
code 80020005
div:
variant_div(hello, 42)
exception Type mismatch.
code 80020005
eqv:
variant_eqv(hello, 42)
exception Type mismatch.
code 80020005
idiv:
variant_idiv(hello, 42)
exception Type mismatch.
code 80020005
imp:
variant_imp(hello, 42)
exception Type mismatch.
code 80020005
mod:
variant_mod(hello, 42)
exception Type mismatch.
code 80020005
or:
variant_or(hello, 42)
exception Type mismatch.
code 80020005
pow:
variant_pow(hello, 42)
exception Type mismatch.
code 80020005
xor:
variant_xor(hello, 42)
exception Type mismatch.
code 80020005
--
add:
add:
variant_add(hello, 3.5)
exception Type mismatch.
code 80020005
cat: hello3.5
sub:
mul:
and:
div:
eqv:
idiv:
imp:
mod:
or:
pow:
xor:
sub:
variant_sub(hello, 3.5)
exception Type mismatch.
code 80020005
mul:
variant_mul(hello, 3.5)
exception Type mismatch.
code 80020005
and:
variant_and(hello, 3.5)
exception Type mismatch.
code 80020005
div:
variant_div(hello, 3.5)
exception Type mismatch.
code 80020005
eqv:
variant_eqv(hello, 3.5)
exception Type mismatch.
code 80020005
idiv:
variant_idiv(hello, 3.5)
exception Type mismatch.
code 80020005
imp:
variant_imp(hello, 3.5)
exception Type mismatch.
code 80020005
mod:
variant_mod(hello, 3.5)
exception Type mismatch.
code 80020005
or:
variant_or(hello, 3.5)
exception Type mismatch.
code 80020005
pow:
variant_pow(hello, 3.5)
exception Type mismatch.
code 80020005
xor:
variant_xor(hello, 3.5)
exception Type mismatch.
code 80020005
--
add: hellohello
cat: hellohello
sub:
mul:
and:
div:
eqv:
idiv:
imp:
mod:
or:
pow:
xor:
sub:
variant_sub(hello, hello)
exception Type mismatch.
code 80020005
mul:
variant_mul(hello, hello)
exception Type mismatch.
code 80020005
and:
variant_and(hello, hello)
exception Type mismatch.
code 80020005
div:
variant_div(hello, hello)
exception Type mismatch.
code 80020005
eqv:
variant_eqv(hello, hello)
exception Type mismatch.
code 80020005
idiv:
variant_idiv(hello, hello)
exception Type mismatch.
code 80020005
imp:
variant_imp(hello, hello)
exception Type mismatch.
code 80020005
mod:
variant_mod(hello, hello)
exception Type mismatch.
code 80020005
or:
variant_or(hello, hello)
exception Type mismatch.
code 80020005
pow:
variant_pow(hello, hello)
exception Type mismatch.
code 80020005
xor:
variant_xor(hello, hello)
exception Type mismatch.
code 80020005
--
add:
add:
variant_add(hello, )
exception Type mismatch.
code 80020005
cat: helloFalse
sub:
mul:
and:
div:
eqv:
idiv:
imp:
mod:
or:
pow:
xor:
sub:
variant_sub(hello, )
exception Type mismatch.
code 80020005
mul:
variant_mul(hello, )
exception Type mismatch.
code 80020005
and:
variant_and(hello, )
exception Type mismatch.
code 80020005
div:
variant_div(hello, )
exception Type mismatch.
code 80020005
eqv:
variant_eqv(hello, )
exception Type mismatch.
code 80020005
idiv:
variant_idiv(hello, )
exception Type mismatch.
code 80020005
imp:
variant_imp(hello, )
exception Type mismatch.
code 80020005
mod:
variant_mod(hello, )
exception Type mismatch.
code 80020005
or:
variant_or(hello, )
exception Type mismatch.
code 80020005
pow:
variant_pow(hello, )
exception Type mismatch.
code 80020005
xor:
variant_xor(hello, )
exception Type mismatch.
code 80020005
--
add: 42
cat: False42
@@ -231,30 +547,90 @@ or: 4
pow: 0
xor: 4
--
add:
add:
variant_add(0, hello)
exception Type mismatch.
code 80020005
cat: Falsehello
sub:
mul:
and:
div:
eqv:
idiv:
imp:
mod:
or:
pow:
xor:
sub:
variant_sub(0, hello)
exception Type mismatch.
code 80020005
mul:
variant_mul(0, hello)
exception Type mismatch.
code 80020005
and:
variant_and(0, hello)
exception Type mismatch.
code 80020005
div:
variant_div(0, hello)
exception Type mismatch.
code 80020005
eqv:
variant_eqv(0, hello)
exception Type mismatch.
code 80020005
idiv:
variant_idiv(0, hello)
exception Type mismatch.
code 80020005
imp:
variant_imp(0, hello)
exception Type mismatch.
code 80020005
mod:
variant_mod(0, hello)
exception Type mismatch.
code 80020005
or:
variant_or(0, hello)
exception Type mismatch.
code 80020005
pow:
variant_pow(0, hello)
exception Type mismatch.
code 80020005
xor:
variant_xor(0, hello)
exception Type mismatch.
code 80020005
--
add: 0
cat: FalseFalse
sub: 0
mul: 0
and: 0
div:
div:
variant_div(0, )
exception Out of present range.
code 8002000a
eqv: -1
idiv:
idiv:
variant_idiv(0, )
exception Division by zero.
code 80020012
imp: -1
mod:
mod:
variant_mod(0, )
exception Division by zero.
code 80020012
or: 0
pow: 1
xor: 0
+20 -6
View File
@@ -2056,16 +2056,30 @@ PHP_FUNCTION(cpdf_place_inline_image)
}
count = 3 * im->sx * im->sy;
if(NULL == (buffer = (unsigned char *) emalloc(count)))
RETURN_FALSE;
buffer = (unsigned char *) safe_emalloc(3 * im->sx, im->sy, 0);
ptr = buffer;
for(i=0; i<im->sy; i++) {
for(j=0; j<im->sx; j++) {
color = im->pixels[i][j];
*ptr++ = im->red[color];
*ptr++ = im->green[color];
*ptr++ = im->blue[color];
#if HAVE_LIBGD20
if(gdImageTrueColor(im)) {
if (im->tpixels && gdImageBoundsSafe(im, j, i)) {
color = gdImageTrueColorPixel(im, j, i);
*ptr++ = (color >> 16) & 0xFF;
*ptr++ = (color >> 8) & 0xFF;
*ptr++ = color & 0xFF;
}
} else {
#endif
if (im->pixels && gdImageBoundsSafe(im, j, i)) {
color = im->pixels[i][j];
*ptr++ = im->red[color];
*ptr++ = im->green[color];
*ptr++ = im->blue[color];
}
#if HAVE_LIBGD20
}
#endif
}
}
-2
View File
@@ -2,8 +2,6 @@
ctype on integers
--SKIPIF--
<?php if (!extension_loaded("ctype")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php
setlocale(LC_ALL,"C");
-2
View File
@@ -2,8 +2,6 @@
ctype on strings
--SKIPIF--
<?php if (!extension_loaded("ctype")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php
+19
View File
@@ -323,6 +323,25 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX);
REGISTER_CURL_CONSTANT(CURLE_OBSOLETE);
REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
REGISTER_CURL_CONSTANT(CURLE_GOT_NOTHING);
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_NOTFOUND);
REGISTER_CURL_CONSTANT(CURLE_SSL_ENGINE_SETFAILED);
REGISTER_CURL_CONSTANT(CURLE_SEND_ERROR);
REGISTER_CURL_CONSTANT(CURLE_RECV_ERROR);
REGISTER_CURL_CONSTANT(CURLE_SHARE_IN_USE);
REGISTER_CURL_CONSTANT(CURLE_SSL_CERTPROBLEM);
REGISTER_CURL_CONSTANT(CURLE_SSL_CIPHER);
REGISTER_CURL_CONSTANT(CURLE_SSL_CACERT);
REGISTER_CURL_CONSTANT(CURLE_BAD_CONTENT_ENCODING);
#ifdef CURLE_LDAP_INVALID_URL
REGISTER_CURL_CONSTANT(CURLE_LDAP_INVALID_URL);
#endif
#ifdef CURLE_FILESIZE_EXCEEDED
REGISTER_CURL_CONSTANT(CURLE_FILESIZE_EXCEEDED);
#endif
#ifdef CURLE_FTP_SSL_FAILED
REGISTER_CURL_CONSTANT(CURLE_FTP_SSL_FAILED);
#endif
REGISTER_CURL_CONSTANT(CURLPROXY_HTTP);
REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5);
+4
View File
@@ -53,6 +53,10 @@ DBA_OPEN_FUNC(db2)
struct stat check_stat;
int s = VCWD_STAT(info->path, &check_stat);
if (!s && !check_stat.st_size) {
info->mode = DBA_TRUNC; /* force truncate */
}
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
s ? DB_BTREE : DB_UNKNOWN;
+6 -2
View File
@@ -62,9 +62,13 @@ DBA_OPEN_FUNC(db3)
struct stat check_stat;
int s = VCWD_STAT(info->path, &check_stat);
type = info->mode == DBA_READER ? DB_UNKNOWN :
if (!s && !check_stat.st_size) {
info->mode = DBA_TRUNC; /* force truncate */
}
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
s? DB_BTREE : DB_UNKNOWN;
s ? DB_BTREE : DB_UNKNOWN;
gmode = info->mode == DBA_READER ? DB_RDONLY :
(info->mode == DBA_CREAT && s) ? DB_CREATE :
+6 -2
View File
@@ -63,9 +63,13 @@ DBA_OPEN_FUNC(db4)
struct stat check_stat;
int s = VCWD_STAT(info->path, &check_stat);
type = info->mode == DBA_READER ? DB_UNKNOWN :
if (!s && !check_stat.st_size) {
info->mode = DBA_TRUNC; /* force truncate */
}
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
s? DB_BTREE : DB_UNKNOWN;
s ? DB_BTREE : DB_UNKNOWN;
gmode = info->mode == DBA_READER ? DB_RDONLY :
(info->mode == DBA_CREAT && s) ? DB_CREATE :
+23 -31
View File
@@ -40,7 +40,7 @@ int dbx_oci8_connect(zval **rv, zval **host, zval **db, zval **username, zval **
arguments[0]=username;
arguments[1]=password;
arguments[2]=db;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCILogon", &returned_zval, number_of_arguments, arguments);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_connect", &returned_zval, number_of_arguments, arguments);
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
return 0;
@@ -59,7 +59,7 @@ int dbx_oci8_pconnect(zval **rv, zval **host, zval **db, zval **username, zval *
arguments[0]=username;
arguments[1]=password;
arguments[2]=db;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIPLogon", &returned_zval, number_of_arguments, arguments);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_pconnect", &returned_zval, number_of_arguments, arguments);
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
return 0;
@@ -71,14 +71,14 @@ int dbx_oci8_pconnect(zval **rv, zval **host, zval **db, zval **username, zval *
int dbx_oci8_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
{
/* returns 1 as long on success or 0 as long on failure */
/* actually, ocilogoff officially does nothing, so what should I return? */
/* actually, oci_close officially does nothing, so what should I return? */
/* I will just return NULL right now and change the test accordingly */
int number_of_arguments=1;
zval **arguments[1];
zval *returned_zval=NULL;
arguments[0]=dbx_handle;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCILogOff", &returned_zval, number_of_arguments, arguments);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_close", &returned_zval, number_of_arguments, arguments);
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
return 0;
@@ -98,16 +98,16 @@ int dbx_oci8_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_stat
arguments[0]=dbx_handle;
arguments[1]=sql_statement;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIParse", &returned_zval, number_of_arguments, arguments);
/* OCIParse returns a bool for failure, or a statement_identifier for valid sql_statements */
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_parse", &returned_zval, number_of_arguments, arguments);
/* oci_parse returns a bool for failure, or a statement_identifier for valid sql_statements */
if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
return 0;
}
number_of_arguments=1;
arguments[0]=&returned_zval;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIExecute", &execute_zval, number_of_arguments, arguments);
/* OCIExecute returns a bool for success or failure */
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_execute", &execute_zval, number_of_arguments, arguments);
/* oci_execute returns a bool for success or failure */
if (!execute_zval || Z_TYPE_P(execute_zval)!=IS_BOOL || Z_BVAL_P(execute_zval)==0) {
if (execute_zval) zval_ptr_dtor(&execute_zval);
zval_ptr_dtor(&returned_zval);
@@ -115,8 +115,8 @@ int dbx_oci8_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_stat
}
number_of_arguments=1;
arguments[0]=&returned_zval;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIStatementType", &statementtype_zval, number_of_arguments, arguments);
/* OCIStatementType returns a string. 'SELECT' means there are results */
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_statement_type", &statementtype_zval, number_of_arguments, arguments);
/* oci_statement_type returns a string. 'SELECT' means there are results */
if (!statementtype_zval || Z_TYPE_P(statementtype_zval)!=IS_STRING) {
if (statementtype_zval) zval_ptr_dtor(&statementtype_zval);
if (execute_zval) zval_ptr_dtor(&execute_zval);
@@ -148,7 +148,7 @@ int dbx_oci8_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_P
zval *returned_zval=NULL;
arguments[0]=result_handle;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCINumCols", &returned_zval, number_of_arguments, arguments);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_num_fields", &returned_zval, number_of_arguments, arguments);
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
return 0;
@@ -170,8 +170,8 @@ int dbx_oci8_getcolumnname(zval **rv, zval **result_handle, long column_index, I
ZVAL_LONG(zval_column_index, column_index+1);
arguments[0]=result_handle;
arguments[1]=&zval_column_index;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIColumnName", &returned_zval, number_of_arguments, arguments);
/* OCIColumnName returns a string */
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_field_name", &returned_zval, number_of_arguments, arguments);
/* oci_field_name returns a string */
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
FREE_ZVAL(zval_column_index);
@@ -195,8 +195,8 @@ int dbx_oci8_getcolumntype(zval **rv, zval **result_handle, long column_index, I
ZVAL_LONG(zval_column_index, column_index+1);
arguments[0]=result_handle;
arguments[1]=&zval_column_index;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIColumnType", &returned_zval, number_of_arguments, arguments);
/* OCIColumnType returns a string??? */
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_field_type", &returned_zval, number_of_arguments, arguments);
/* oci_field_type returns a string??? */
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
FREE_ZVAL(zval_column_index);
@@ -211,31 +211,23 @@ int dbx_oci8_getcolumntype(zval **rv, zval **result_handle, long column_index, I
int dbx_oci8_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS)
{
/* returns array[0..columncount-1] as strings on success or 0 as long on failure */
int number_of_arguments=3;
zval **arguments[3];
int number_of_arguments=2;
zval **arguments[2];
zval *zval_resulttype=NULL;
zval *zval_returned_array=NULL;
zval *returned_zval=NULL;
MAKE_STD_ZVAL(zval_returned_array); /* no value needed, it will be overwritten anyway */
ZVAL_EMPTY_STRING(zval_returned_array); /* there seems to be some weird mem-bug, so assigning a value anyway */
MAKE_STD_ZVAL(zval_resulttype);
ZVAL_LONG(zval_resulttype, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURN_LOBS); /* no ASSOC, dbx handles that part */
arguments[0]=result_handle;
arguments[1]=&zval_returned_array;
arguments[2]=&zval_resulttype;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIFetchInto", &returned_zval, number_of_arguments, arguments);
/* OCIFetchInto returns the number of columns as an integer on success and FALSE */
/* on failure. The actual array is passed back in arg[1] */
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG || Z_LVAL_P(returned_zval)==0) {
arguments[1]=&zval_resulttype;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_fetch_array", &returned_zval, number_of_arguments, arguments);
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
FREE_ZVAL(zval_resulttype);
FREE_ZVAL(zval_returned_array);
return 0;
}
FREE_ZVAL(zval_resulttype);
zval_ptr_dtor(&returned_zval);
MOVE_RETURNED_TO_RV(rv, zval_returned_array);
MOVE_RETURNED_TO_RV(rv, returned_zval);
return 1;
}
@@ -251,8 +243,8 @@ int dbx_oci8_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
zval *returned_message_zval=NULL;
arguments[0]=dbx_handle;
if (!dbx_handle) number_of_arguments=0;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIError", &returned_zval, number_of_arguments, arguments);
/* OCIError should returns an assoc array containing code & message, dbx needs the message */
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "oci_error", &returned_zval, number_of_arguments, arguments);
/* oci_error should returns an assoc array containing code & message, dbx needs the message */
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
return 0;
+5 -5
View File
@@ -148,7 +148,7 @@ int dbx_pgsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_sta
/* db_name is not used in this function */
args[0]=dbx_handle;
args[1]=sql_statement;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_exec", &returned_zval, nargs, args);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_query", &returned_zval, nargs, args);
/* pg_query returns a bool for success or failure,
or a result_identifier for select statements */
if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) {
@@ -167,7 +167,7 @@ int dbx_pgsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_
zval *returned_zval=NULL;
arguments[0]=result_handle;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_numfields", &returned_zval, number_of_arguments, arguments);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_num_fields", &returned_zval, number_of_arguments, arguments);
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
return 0;
@@ -188,7 +188,7 @@ int dbx_pgsql_getcolumnname(zval **rv, zval **result_handle, long column_index,
ZVAL_LONG(zval_column_index, column_index);
arguments[0]=result_handle;
arguments[1]=&zval_column_index;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fieldname", &returned_zval, number_of_arguments, arguments);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_field_name", &returned_zval, number_of_arguments, arguments);
/* pg_fieldname returns a string */
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
@@ -212,7 +212,7 @@ int dbx_pgsql_getcolumntype(zval **rv, zval **result_handle, long column_index,
ZVAL_LONG(zval_column_index, column_index);
arguments[0]=result_handle;
arguments[1]=&zval_column_index;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fieldtype", &returned_zval, number_of_arguments, arguments);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_field_type", &returned_zval, number_of_arguments, arguments);
/* pg_fieldtype returns a string */
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
@@ -252,7 +252,7 @@ int dbx_pgsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS)
arguments[0]=dbx_handle;
if (!dbx_handle) number_of_arguments=0;
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_errormessage", &returned_zval, number_of_arguments, arguments);
dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_last_error", &returned_zval, number_of_arguments, arguments);
if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) {
if (returned_zval) zval_ptr_dtor(&returned_zval);
return 0;
-2
View File
@@ -2,8 +2,6 @@
Check for dio presence
--SKIPIF--
<?php if (!extension_loaded("dio")) print "skip"; ?>
--POST--
--GET--
--FILE--
<?php
echo "dio extension is available";
+4 -12
View File
@@ -1,12 +1,4 @@
1) Change _node_list_pointer to something faster than just a linked list.
Currently there to test that unlinked node tracking works
2) Possible create new object type for documents as these are the only types which need to track nodes
- Would also require its own dtor functionality
3) Define correct behavior. When certain types of nodes are destroyed,
do we unlink children (if referenced) or just destroy them. (Element/Attribute nodes)
4) Find out where XPath goes (this extension or its own)
5) What DOM object types are really needed (i.e. not currently using DOMString)
6) Determine how to handle non speced functionality.
i.e validation (add method or implement as property for processing)
For 5.1
1) enhance XPath functionality
2) look at auto encoding support for in/output
3) What DOM object types are really needed (i.e. not currently using DOMString)
+15 -9
View File
@@ -31,7 +31,7 @@
/*
* class domattr extends domnode
* class DOMAttr extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-637646024
* Since:
@@ -43,7 +43,7 @@ zend_function_entry php_dom_attr_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomAttr::__construct(string name, [string value]); */
/* {{{ proto void DOMAttr::__construct(string name, [string value]); */
PHP_METHOD(domattr, __construct)
{
@@ -52,23 +52,29 @@ PHP_METHOD(domattr, __construct)
xmlNodePtr oldnode = NULL;
dom_object *intern;
char *name, *value = NULL;
int name_len, value_len;
int name_len, value_len, name_valid;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_attr_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
php_std_error_handling();
return;
}
php_std_error_handling();
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (name_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute name is required");
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
nodep = xmlNewProp(NULL, (xmlChar *) name, value);
if (!nodep)
if (!nodep) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
if (intern != NULL) {
oldnode = (xmlNodePtr)intern->ptr;
@@ -79,7 +85,7 @@ PHP_METHOD(domattr, __construct)
}
}
/* }}} end DomAttr::__construct */
/* }}} end DOMAttr::__construct */
/* {{{ proto name string
@@ -194,7 +200,7 @@ int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC)
/* {{{ proto ownerElement element
/* {{{ proto ownerElement DOMElement
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-ownerElement
Since: DOM Level 2
@@ -230,7 +236,7 @@ int dom_attr_owner_element_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto schemaTypeInfo typeinfo
/* {{{ proto schemaTypeInfo DOMTypeInfo
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Attr-schemaTypeInfo
Since: DOM Level 3
+9 -4
View File
@@ -29,7 +29,7 @@
/*
* class domcdatasection extends domtext
* class DOMCdataSection extends DOMText
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-667469212
* Since:
@@ -40,7 +40,7 @@ zend_function_entry php_dom_cdatasection_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomCDataSection::__construct(string value); */
/* {{{ proto void DOMCdataSection::__construct(string value); */
PHP_METHOD(domcdatasection, __construct)
{
@@ -50,14 +50,19 @@ PHP_METHOD(domcdatasection, __construct)
char *value = NULL;
int value_len;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_cdatasection_class_entry, &value, &value_len) == FAILURE) {
php_std_error_handling();
return;
}
php_std_error_handling();
nodep = xmlNewCDataBlock(NULL, (xmlChar *) value, value_len);
if (!nodep)
if (!nodep) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
@@ -68,6 +73,6 @@ PHP_METHOD(domcdatasection, __construct)
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
}
}
/* }}} end DomCDataSection::__construct */
/* }}} end DOMCdataSection::__construct */
#endif
+7 -7
View File
@@ -29,7 +29,7 @@
/*
* class domcharacterdata extends domnode
* class DOMCharacterData extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-FF21A306
* Since:
@@ -105,7 +105,7 @@ int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC)
/* }}} */
/* {{{ proto length unsigned long
/* {{{ proto length long
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7D61178C
Since:
@@ -140,7 +140,7 @@ int dom_characterdata_length_read(dom_object *obj, zval **retval TSRMLS_DC)
/* }}} */
/* {{{ proto domstring dom_characterdata_substring_data(unsigned long offset, unsigned long count);
/* {{{ proto string dom_characterdata_substring_data(long offset, long count);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6531BCCF
Since:
*/
@@ -190,7 +190,7 @@ PHP_FUNCTION(dom_characterdata_substring_data)
/* }}} end dom_characterdata_substring_data */
/* {{{ proto dom_void dom_characterdata_append_data(string arg);
/* {{{ proto void dom_characterdata_append_data(string arg);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-32791A2F
Since:
*/
@@ -215,7 +215,7 @@ PHP_FUNCTION(dom_characterdata_append_data)
/* }}} end dom_characterdata_append_data */
/* {{{ proto dom_void dom_characterdata_insert_data(unsigned long offset, string arg);
/* {{{ proto void dom_characterdata_insert_data(long offset, string arg);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3EDB695F
Since:
*/
@@ -264,7 +264,7 @@ PHP_FUNCTION(dom_characterdata_insert_data)
/* }}} end dom_characterdata_insert_data */
/* {{{ proto dom_void dom_characterdata_delete_data(unsigned long offset, unsigned long count);
/* {{{ proto void dom_characterdata_delete_data(long offset, long count);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-7C603781
Since:
*/
@@ -320,7 +320,7 @@ PHP_FUNCTION(dom_characterdata_delete_data)
/* }}} end dom_characterdata_delete_data */
/* {{{ proto dom_void dom_characterdata_replace_data(unsigned long offset, unsigned long count, string arg);
/* {{{ proto void dom_characterdata_replace_data(long offset, long count, string arg);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-E5CBA7FB
Since:
*/
+9 -4
View File
@@ -29,7 +29,7 @@
/*
* class domcomment extends domcharacterdata
* class DOMComment extends DOMCharacterData
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1728279322
* Since:
@@ -40,7 +40,7 @@ zend_function_entry php_dom_comment_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomComment::__construct([string value]); */
/* {{{ proto void DOMComment::__construct([string value]); */
PHP_METHOD(domcomment, __construct)
{
@@ -50,14 +50,19 @@ PHP_METHOD(domcomment, __construct)
char *value = NULL;
int value_len;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_comment_class_entry, &value, &value_len) == FAILURE) {
php_std_error_handling();
return;
}
php_std_error_handling();
nodep = xmlNewComment((xmlChar *) value);
if (!nodep)
if (!nodep) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
@@ -68,5 +73,5 @@ PHP_METHOD(domcomment, __construct)
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)nodep, (void *)intern TSRMLS_CC);
}
}
/* }}} end DomComment::__construct */
/* }}} end DOMComment::__construct */
#endif
+82 -68
View File
@@ -42,7 +42,7 @@ struct _idsIterator {
#define DOM_LOAD_FILE 1
/*
* class domdocument extends domnode
* class DOMDocument extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-i-Document
* Since:
@@ -88,7 +88,7 @@ zend_function_entry php_dom_document_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto doctype documenttype
/* {{{ proto docType DOMDocumentType
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-B63ED1A31
Since:
@@ -124,7 +124,7 @@ int dom_document_doctype_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto implementation domimplementation
/* {{{ proto implementation DOMImplementation
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1B793EBA
Since:
@@ -140,7 +140,7 @@ int dom_document_implementation_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto domelement document_element documentElement
/* {{{ proto documentElement DOMElement
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-87CD092
Since:
@@ -174,7 +174,7 @@ int dom_document_document_element_read(dom_object *obj, zval **retval TSRMLS_DC)
/* }}} */
/* {{{ proto actual_encoding string
/* {{{ proto actualEncoding string
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-actualEncoding
Since: DOM Level 3
@@ -399,7 +399,7 @@ int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
/* }}} */
/* {{{ proto strict_error_checking boolean
/* {{{ proto strictErrorChecking boolean
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-strictErrorChecking
Since: DOM Level 3
@@ -486,7 +486,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
}
/* }}} */
/* {{{ proto validateonParse boolean
/* {{{ proto validateOnParse boolean
readonly=no
*/
int dom_document_validate_on_parse_read(dom_object *obj, zval **retval TSRMLS_DC)
@@ -658,7 +658,7 @@ int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_D
/* }}} */
/* {{{ proto document_uri string
/* {{{ proto documentURI string
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-documentURI
Since: DOM Level 3
@@ -724,7 +724,7 @@ int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
/* {{{ proto config domconfiguration
/* {{{ proto config DOMConfiguration
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-config
Since: DOM Level 3
@@ -740,7 +740,7 @@ int dom_document_config_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto domelement dom_document_create_element(string tagName);
/* {{{ proto DOMElement dom_document_create_element(string tagName [, string value]);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-2141741547
Since:
*/
@@ -759,8 +759,8 @@ PHP_FUNCTION(dom_document_create_element)
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (name_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Element name is required");
if (xmlValidateName((xmlChar *) name, 0) != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
RETURN_FALSE;
}
@@ -774,7 +774,7 @@ PHP_FUNCTION(dom_document_create_element)
/* }}} end dom_document_create_element */
/* {{{ proto domdocumentfragment dom_document_create_document_fragment();
/* {{{ proto DOMDocumentFragment dom_document_create_document_fragment();
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-35CB04B5
Since:
*/
@@ -802,7 +802,7 @@ PHP_FUNCTION(dom_document_create_document_fragment)
/* }}} end dom_document_create_document_fragment */
/* {{{ proto domtext dom_document_create_text_node(string data);
/* {{{ proto DOMText dom_document_create_text_node(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1975348127
Since:
*/
@@ -831,7 +831,7 @@ PHP_FUNCTION(dom_document_create_text_node)
/* }}} end dom_document_create_text_node */
/* {{{ proto domcomment dom_document_create_comment(string data);
/* {{{ proto DOMComment dom_document_create_comment(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1334481328
Since:
*/
@@ -860,7 +860,7 @@ PHP_FUNCTION(dom_document_create_comment)
/* }}} end dom_document_create_comment */
/* {{{ proto domcdatasection dom_document_create_cdatasection(string data);
/* {{{ proto DOMCdataSection dom_document_create_cdatasection(string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D26C0AF8
Since:
*/
@@ -889,7 +889,7 @@ PHP_FUNCTION(dom_document_create_cdatasection)
/* }}} end dom_document_create_cdatasection */
/* {{{ proto domprocessinginstruction dom_document_create_processing_instruction(string target, string data);
/* {{{ proto DOMProcessingInstruction dom_document_create_processing_instruction(string target, string data);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-135944439
Since:
*/
@@ -908,6 +908,11 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
RETURN_FALSE;
}
node = xmlNewPI((xmlChar *) name, (xmlChar *) value);
if (!node) {
RETURN_FALSE;
@@ -920,7 +925,7 @@ PHP_FUNCTION(dom_document_create_processing_instruction)
/* }}} end dom_document_create_processing_instruction */
/* {{{ proto domattr dom_document_create_attribute(string name);
/* {{{ proto DOMAttr dom_document_create_attribute(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1084891198
Since:
*/
@@ -939,8 +944,8 @@ PHP_FUNCTION(dom_document_create_attribute)
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (name_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attribute name is required");
if (xmlValidateName((xmlChar *) name, 0) != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
RETURN_FALSE;
}
@@ -955,7 +960,7 @@ PHP_FUNCTION(dom_document_create_attribute)
/* }}} end dom_document_create_attribute */
/* {{{ proto domentityreference dom_document_create_entity_reference(string name);
/* {{{ proto DOMEntityReference dom_document_create_entity_reference(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-392B75AE
Since:
*/
@@ -974,6 +979,11 @@ PHP_FUNCTION(dom_document_create_entity_reference)
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
if (xmlValidateName((xmlChar *) name, 0) != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, dom_get_strict_error(intern->document) TSRMLS_CC);
RETURN_FALSE;
}
node = xmlNewReference(docp, name);
if (!node) {
RETURN_FALSE;
@@ -984,7 +994,7 @@ PHP_FUNCTION(dom_document_create_entity_reference)
/* }}} end dom_document_create_entity_reference */
/* {{{ proto domnodelist dom_document_get_elements_by_tag_name(string tagname);
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name(string tagname);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C9094
Since:
*/
@@ -1011,7 +1021,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name)
/* }}} end dom_document_get_elements_by_tag_name */
/* {{{ proto domnode dom_document_import_node(node importedNode, boolean deep);
/* {{{ proto DOMNode dom_document_import_node(DOMNode importedNode, boolean deep);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Core-Document-importNode
Since: DOM Level 2
*/
@@ -1053,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);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrElNS
Since: DOM Level 2
*/
@@ -1073,23 +1083,22 @@ PHP_FUNCTION(dom_document_create_element_ns)
return;
}
if (name_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Element Name is required");
RETURN_FALSE;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
if (errorcode == 0) {
nodep = xmlNewDocNode (docp, NULL, localname, NULL);
if (nodep != NULL && uri != NULL) {
nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri);
if (nsptr == NULL) {
nsptr = dom_get_ns(nodep, uri, &errorcode, prefix);
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
nodep = xmlNewDocNode (docp, NULL, localname, NULL);
if (nodep != NULL && uri != NULL) {
nsptr = xmlSearchNsByHref (nodep->doc, nodep, uri);
if (nsptr == NULL) {
nsptr = dom_get_ns(nodep, uri, &errorcode, prefix);
}
xmlSetNs(nodep, nsptr);
}
xmlSetNs(nodep, nsptr);
} else {
errorcode = INVALID_CHARACTER_ERR;
}
}
@@ -1118,7 +1127,7 @@ PHP_FUNCTION(dom_document_create_element_ns)
/* }}} end dom_document_create_element_ns */
/* {{{ proto domattr dom_document_create_attribute_ns(string namespaceURI, string qualifiedName);
/* {{{ proto DOMAttr dom_document_create_attribute_ns(string namespaceURI, string qualifiedName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-DocCrAttrNS
Since: DOM Level 2
*/
@@ -1138,24 +1147,23 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
return;
}
if (name_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Qualified Name is required");
RETURN_FALSE;
}
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
root = xmlDocGetRootElement(docp);
if (root != NULL) {
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
if (errorcode == 0) {
nodep = (xmlNodePtr) xmlNewDocProp(docp, localname, NULL);
if (nodep != NULL && uri_len > 0) {
nsptr = xmlSearchNsByHref (nodep->doc, root, uri);
if (nsptr == NULL) {
nsptr = dom_get_ns(root, uri, &errorcode, prefix);
if (xmlValidateName((xmlChar *) localname, 0) == 0) {
nodep = (xmlNodePtr) xmlNewDocProp(docp, localname, NULL);
if (nodep != NULL && uri_len > 0) {
nsptr = xmlSearchNsByHref (nodep->doc, root, uri);
if (nsptr == NULL) {
nsptr = dom_get_ns(root, uri, &errorcode, prefix);
}
xmlSetNs(nodep, nsptr);
}
xmlSetNs(nodep, nsptr);
} else {
errorcode = INVALID_CHARACTER_ERR;
}
}
} else {
@@ -1185,7 +1193,7 @@ PHP_FUNCTION(dom_document_create_attribute_ns)
/* }}} end dom_document_create_attribute_ns */
/* {{{ proto domnodelist dom_document_get_elements_by_tag_name_ns(string namespaceURI, string localName);
/* {{{ proto DOMNodeList dom_document_get_elements_by_tag_name_ns(string namespaceURI, string localName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBTNNS
Since: DOM Level 2
*/
@@ -1213,7 +1221,7 @@ PHP_FUNCTION(dom_document_get_elements_by_tag_name_ns)
/* }}} end dom_document_get_elements_by_tag_name_ns */
/* {{{ proto domelement dom_document_get_element_by_id(string elementId);
/* {{{ proto DOMElement dom_document_get_element_by_id(string elementId);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getElBId
Since: DOM Level 2
*/
@@ -1244,7 +1252,7 @@ PHP_FUNCTION(dom_document_get_element_by_id)
/* }}} end dom_document_get_element_by_id */
/* {{{ proto domnode dom_document_adopt_node(node source);
/* {{{ proto DOMNode dom_document_adopt_node(DOMNode source);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-adoptNode
Since: DOM Level 3
*/
@@ -1255,7 +1263,7 @@ PHP_FUNCTION(dom_document_adopt_node)
/* }}} end dom_document_adopt_node */
/* {{{ proto dom_void dom_document_normalize_document();
/* {{{ proto void dom_document_normalize_document();
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-normalizeDocument
Since: DOM Level 3
*/
@@ -1276,7 +1284,7 @@ PHP_FUNCTION(dom_document_normalize_document)
/* }}} end dom_document_normalize_document */
/* {{{ proto domnode dom_document_rename_node(node n, string namespaceURI, string qualifiedName);
/* {{{ proto DOMNode dom_document_rename_node(node n, string namespaceURI, string qualifiedName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Document3-renameNode
Since: DOM Level 3
*/
@@ -1286,7 +1294,7 @@ PHP_FUNCTION(dom_document_rename_node)
}
/* }}} end dom_document_rename_node */
/* {{{ proto void DomDocument::__construct([string version], [string encoding]); */
/* {{{ proto void DOMDocument::__construct([string version], [string encoding]); */
PHP_METHOD(domdocument, __construct)
{
@@ -1296,13 +1304,19 @@ PHP_METHOD(domdocument, __construct)
char *encoding, *version = NULL;
int encoding_len = 0, version_len = 0, refcount;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|ss", &id, dom_document_class_entry, &version, &version_len, &encoding, &encoding_len) == FAILURE) {
php_std_error_handling();
return;
}
php_std_error_handling();
docp = xmlNewDoc(version);
if (!docp)
if (!docp) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
if (encoding_len > 0) {
docp->encoding = (const xmlChar*)xmlStrdup(encoding);
@@ -1323,7 +1337,7 @@ PHP_METHOD(domdocument, __construct)
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC);
}
}
/* }}} end dom_document_document */
/* }}} end DOMDocument::__construct */
char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_path_len TSRMLS_DC) {
xmlURI *uri;
@@ -1530,7 +1544,7 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
}
/* }}} end dom_parser_document */
/* {{{ proto boolean domnode dom_document_load(string source);
/* {{{ proto boolean|DOMNode dom_document_load(string source);
URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-load
Since: DOM Level 3
*/
@@ -1540,7 +1554,7 @@ PHP_METHOD(domdocument, load)
}
/* }}} end dom_document_load */
/* {{{ proto boolean domnode dom_document_loadxml(string source);
/* {{{ proto boolean|DOMNode dom_document_loadxml(string source);
URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-loadXML
Since: DOM Level 3
*/
@@ -1550,7 +1564,7 @@ PHP_METHOD(domdocument, loadXML)
}
/* }}} end dom_document_loadxml */
/* {{{ proto long domnode dom_document_save(string file);
/* {{{ proto long dom_document_save(string file);
Convenience method to save to file
*/
PHP_FUNCTION(dom_document_save)
@@ -1586,7 +1600,7 @@ PHP_FUNCTION(dom_document_save)
}
/* }}} end dom_document_save */
/* {{{ proto string domnode dom_document_savexml([node n]);
/* {{{ proto string dom_document_savexml([node n]);
URL: http://www.w3.org/TR/DOM-Level-3-LS/load-save.html#LS-DocumentLS-saveXML
Since: DOM Level 3
*/
@@ -1715,7 +1729,7 @@ PHP_FUNCTION(dom_document_xinclude)
}
/* {{{ proto string domnode dom_document_validate();
/* {{{ proto boolean dom_document_validate();
Since: DOM extended
*/
PHP_FUNCTION(dom_document_validate)
@@ -1828,19 +1842,19 @@ _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
}
}
/* {{{ proto boolean domnode _dom_document_schema_validate(string filename); */
/* {{{ proto boolean dom_document_schema_validate_file(string filename); */
PHP_FUNCTION(dom_document_schema_validate_file)
{
_dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE);
}
/* }}} end _dom_document_schema_validate */
/* }}} end dom_document_schema_validate_file */
/* {{{ proto boolean domnode _dom_document_schema_validate(string source); */
/* {{{ proto boolean dom_document_schema_validate(string source); */
PHP_FUNCTION(dom_document_schema_validate_xml)
{
_dom_document_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING);
}
/* }}} end _dom_document_schema_validate */
/* }}} end dom_document_schema_validate */
static void
@@ -1918,14 +1932,14 @@ _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
}
}
/* {{{ proto boolean domnode dom_document_relaxNG_validate_file(string filename); */
/* {{{ proto boolean dom_document_relaxNG_validate_file(string filename); */
PHP_FUNCTION(dom_document_relaxNG_validate_file)
{
_dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_FILE);
}
/* }}} end dom_document_relaxNG_validate_file */
/* {{{ proto boolean domnode dom_document_relaxNG_validate_xml(string source); */
/* {{{ proto boolean dom_document_relaxNG_validate_xml(string source); */
PHP_FUNCTION(dom_document_relaxNG_validate_xml)
{
_dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, DOM_LOAD_STRING);
@@ -2008,7 +2022,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode)
}
}
/* {{{ proto boolean domnode dom_document_load_html_file(string source);
/* {{{ proto boolean|DOMNode dom_document_load_html_file(string source);
Since: DOM extended
*/
PHP_METHOD(domdocument, loadHTMLFile)
@@ -2017,7 +2031,7 @@ PHP_METHOD(domdocument, loadHTMLFile)
}
/* }}} end dom_document_load_html_file */
/* {{{ proto boolean domnode dom_document_load_html(string source);
/* {{{ proto boolean|DOMNode dom_document_load_html(string source);
Since: DOM extended
*/
PHP_METHOD(domdocument, loadHTML)
+10 -5
View File
@@ -29,7 +29,7 @@
/*
* class domdocumentfragment extends domnode
* class DOMDocumentFragment extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-B63ED1A3
* Since:
@@ -40,7 +40,7 @@ zend_function_entry php_dom_documentfragment_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomDocumentFragment::__construct(); */
/* {{{ proto void DOMDocumentFragment::__construct(); */
PHP_METHOD(domdocumentfragment, __construct)
{
@@ -48,14 +48,19 @@ PHP_METHOD(domdocumentfragment, __construct)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &id, dom_documentfragment_class_entry) == FAILURE) {
php_std_error_handling();
return;
}
php_std_error_handling();
nodep = xmlNewDocFragment(NULL);
if (!nodep)
if (!nodep) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
@@ -63,9 +68,9 @@ PHP_METHOD(domdocumentfragment, __construct)
if (oldnode != NULL) {
php_libxml_node_free_resource(oldnode TSRMLS_CC);
}
//php_dom_set_object(intern, nodep TSRMLS_CC);
/* php_dom_set_object(intern, nodep TSRMLS_CC); */
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
}
}
/* }}} end DomDocumentFragment::__construct */
/* }}} end DOMDocumentFragment::__construct */
#endif
+6 -8
View File
@@ -28,7 +28,7 @@
#include "php_dom.h"
/*
* class domdocumenttype extends domnode
* class DOMDocumentType extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-412266927
* Since:
@@ -38,8 +38,6 @@ zend_function_entry php_dom_documenttype_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ attribute protos, not implemented yet */
/* {{{ proto name string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1844763134
@@ -66,7 +64,7 @@ int dom_documenttype_name_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto entities namednodemap
/* {{{ proto entities DOMNamedNodeMap
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1788794630
Since:
@@ -99,7 +97,7 @@ int dom_documenttype_entities_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto notations namednodemap
/* {{{ proto notations DOMNamedNodeMap
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D46829EF
Since:
@@ -132,7 +130,7 @@ int dom_documenttype_notations_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto public_id string
/* {{{ proto publicId string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-publicId
Since: DOM Level 2
@@ -162,7 +160,7 @@ int dom_documenttype_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto system_id string
/* {{{ proto systemId string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-systemId
Since: DOM Level 2
@@ -191,7 +189,7 @@ int dom_documenttype_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto internal_subset string
/* {{{ proto internalSubset string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-Core-DocType-internalSubset
Since: DOM Level 2
+8 -6
View File
@@ -54,6 +54,8 @@ extern zend_function_entry php_dom_xpath_class_functions[];
/* domexception errors */
typedef enum {
/* PHP_ERR is non-spec code for PHP errors: */
PHP_ERR = 0,
INDEX_SIZE_ERR = 1,
DOMSTRING_SIZE_ERR = 2,
HIERARCHY_REQUEST_ERR = 3,
@@ -64,17 +66,17 @@ typedef enum {
NOT_FOUND_ERR = 8,
NOT_SUPPORTED_ERR = 9,
INUSE_ATTRIBUTE_ERR = 10,
// Introduced in DOM Level 2:
/* Introduced in DOM Level 2: */
INVALID_STATE_ERR = 11,
// Introduced in DOM Level 2:
/* Introduced in DOM Level 2: */
SYNTAX_ERR = 12,
// Introduced in DOM Level 2:
/* Introduced in DOM Level 2: */
INVALID_MODIFICATION_ERR = 13,
// Introduced in DOM Level 2:
/* Introduced in DOM Level 2: */
NAMESPACE_ERR = 14,
// Introduced in DOM Level 2:
/* Introduced in DOM Level 2: */
INVALID_ACCESS_ERR = 15,
// Introduced in DOM Level 3:
/* Introduced in DOM Level 3: */
VALIDATION_ERR = 16
} dom_exception_code;
+1 -1
View File
@@ -29,7 +29,7 @@
/*
* class domexception
* class DOMException
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-17189187
* Since:
+4 -7
View File
@@ -28,7 +28,7 @@
#include "php_dom.h"
/*
* class domimplementation
* class DOMImplementation
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-102161490
* Since:
@@ -42,9 +42,6 @@ zend_function_entry php_dom_domimplementation_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ attribute protos, not implemented yet */
/* {{{ proto boolean dom_domimplementation_has_feature(string feature, string version);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5CED94D7
Since:
@@ -67,7 +64,7 @@ PHP_METHOD(domimplementation, hasFeature)
/* }}} end dom_domimplementation_has_feature */
/* {{{ proto domdocumenttype dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId);
/* {{{ proto DOMDocumentType dom_domimplementation_create_document_type(string qualifiedName, string publicId, string systemId);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocType
Since: DOM Level 2
*/
@@ -121,7 +118,7 @@ PHP_METHOD(domimplementation, createDocumentType)
/* }}} end dom_domimplementation_create_document_type */
/* {{{ proto domdocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, documenttype doctype);
/* {{{ proto DOMDocument dom_domimplementation_create_document(string namespaceURI, string qualifiedName, DOMDocumentType doctype);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Level-2-Core-DOM-createDocument
Since: DOM Level 2
*/
@@ -224,7 +221,7 @@ PHP_METHOD(domimplementation, createDocument)
/* }}} end dom_domimplementation_create_document */
/* {{{ proto domnode dom_domimplementation_get_feature(string feature, string version);
/* {{{ proto DOMNode dom_domimplementation_get_feature(string feature, string version);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#DOMImplementation3-getFeature
Since: DOM Level 3
*/
+38 -24
View File
@@ -29,7 +29,7 @@
/*
* class domelement extends domnode
* class DOMElement extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-745549614
* Since:
@@ -58,7 +58,7 @@ zend_function_entry php_dom_element_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomElement::__construct(string name, [string value]); */
/* {{{ proto void DOMElement::__construct(string name, [string value], [string uri]); */
PHP_METHOD(domelement, __construct)
{
@@ -68,15 +68,19 @@ PHP_METHOD(domelement, __construct)
char *name, *value = NULL, *uri = NULL;
char *localname = NULL, *prefix = NULL;
int errorcode = 0, uri_len = 0;
int name_len, value_len = 0;
int name_len, value_len = 0, name_valid;
xmlNsPtr nsptr = NULL;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s!s", &id, dom_element_class_entry, &name, &name_len, &value, &value_len, &uri, &uri_len) == FAILURE) {
php_std_error_handling();
return;
}
if (name_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Element name is required");
php_std_error_handling();
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
@@ -98,15 +102,25 @@ PHP_METHOD(domelement, __construct)
if (nodep != NULL) {
xmlFree(nodep);
}
php_dom_throw_error(errorcode, 0 TSRMLS_CC);
php_dom_throw_error(errorcode, 1 TSRMLS_CC);
RETURN_FALSE;
}
} else {
/* If you don't pass a namespace uri, then you can't set a prefix */
localname = xmlSplitQName2(name, (xmlChar **) &prefix);
if (prefix != NULL) {
xmlFree(localname);
xmlFree(prefix);
php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
nodep = xmlNewNode(NULL, (xmlChar *) name);
}
if (!nodep)
if (!nodep) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
if (value_len > 0) {
xmlNodeSetContentLen(nodep, value, value_len);
@@ -121,7 +135,7 @@ PHP_METHOD(domelement, __construct)
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
}
}
/* }}} end DomElement::__construct */
/* }}} end DOMElement::__construct */
/* {{{ proto tagName string
readonly=yes
@@ -176,7 +190,7 @@ int dom_element_schema_type_info_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto domstring dom_element_get_attribute(string name);
/* {{{ proto string dom_element_get_attribute(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-666EE0F9
Since:
*/
@@ -205,7 +219,7 @@ PHP_FUNCTION(dom_element_get_attribute)
/* }}} end dom_element_get_attribute */
/* {{{ proto dom_void dom_element_set_attribute(string name, string value);
/* {{{ proto void dom_element_set_attribute(string name, string value);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-F68F082
Since:
*/
@@ -251,7 +265,7 @@ PHP_FUNCTION(dom_element_set_attribute)
/* }}} end dom_element_set_attribute */
/* {{{ proto dom_void dom_element_remove_attribute(string name);
/* {{{ proto void dom_element_remove_attribute(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D6AC0F9
Since:
*/
@@ -294,7 +308,7 @@ PHP_FUNCTION(dom_element_remove_attribute)
/* }}} end dom_element_remove_attribute */
/* {{{ proto domattr dom_element_get_attribute_node(string name);
/* {{{ proto DOMAttr dom_element_get_attribute_node(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-217A91B8
Since:
*/
@@ -323,7 +337,7 @@ PHP_FUNCTION(dom_element_get_attribute_node)
/* }}} end dom_element_get_attribute_node */
/* {{{ proto domattr dom_element_set_attribute_node(attr newAttr);
/* {{{ proto DOMAttr dom_element_set_attribute_node(DOMAttr newAttr);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-887236154
Since:
*/
@@ -381,7 +395,7 @@ PHP_FUNCTION(dom_element_set_attribute_node)
/* }}} end dom_element_set_attribute_node */
/* {{{ proto domattr dom_element_remove_attribute_node(attr oldAttr);
/* {{{ proto DOMAttr dom_element_remove_attribute_node(DOMAttr oldAttr);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D589198
Since:
*/
@@ -419,7 +433,7 @@ PHP_FUNCTION(dom_element_remove_attribute_node)
/* }}} end dom_element_remove_attribute_node */
/* {{{ proto domnodelist dom_element_get_elements_by_tag_name(string name);
/* {{{ proto DOMNodeList dom_element_get_elements_by_tag_name(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1938918D
Since:
*/
@@ -446,7 +460,7 @@ PHP_FUNCTION(dom_element_get_elements_by_tag_name)
/* }}} end dom_element_get_elements_by_tag_name */
/* {{{ proto domstring dom_element_get_attribute_ns(string namespaceURI, string localName);
/* {{{ proto string dom_element_get_attribute_ns(string namespaceURI, string localName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAttrNS
Since: DOM Level 2
*/
@@ -487,7 +501,7 @@ PHP_FUNCTION(dom_element_get_attribute_ns)
/* }}} end dom_element_get_attribute_ns */
/* {{{ proto dom_void dom_element_set_attribute_ns(string namespaceURI, string qualifiedName, string value);
/* {{{ proto void dom_element_set_attribute_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-ElSetAttrNS
Since: DOM Level 2
*/
@@ -585,7 +599,7 @@ PHP_FUNCTION(dom_element_set_attribute_ns)
/* }}} end dom_element_set_attribute_ns */
/* {{{ proto dom_void dom_element_remove_attribute_ns(string namespaceURI, string localName);
/* {{{ proto void dom_element_remove_attribute_ns(string namespaceURI, string localName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElRemAtNS
Since: DOM Level 2
*/
@@ -643,7 +657,7 @@ PHP_FUNCTION(dom_element_remove_attribute_ns)
/* }}} end dom_element_remove_attribute_ns */
/* {{{ proto domattr dom_element_get_attribute_node_ns(string namespaceURI, string localName);
/* {{{ proto DOMAttr dom_element_get_attribute_node_ns(string namespaceURI, string localName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElGetAtNodeNS
Since: DOM Level 2
*/
@@ -674,7 +688,7 @@ PHP_FUNCTION(dom_element_get_attribute_node_ns)
/* }}} end dom_element_get_attribute_node_ns */
/* {{{ proto domattr dom_element_set_attribute_node_ns(attr newAttr);
/* {{{ proto DOMAttr dom_element_set_attribute_node_ns(DOMAttr newAttr);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetAtNodeNS
Since: DOM Level 2
*/
@@ -740,7 +754,7 @@ PHP_FUNCTION(dom_element_set_attribute_node_ns)
/* {{{ proto domnodelist dom_element_get_elements_by_tag_name_ns(string namespaceURI, string localName);
/* {{{ proto DOMNodeList dom_element_get_elements_by_tag_name_ns(string namespaceURI, string localName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-A6C90942
Since: DOM Level 2
*/
@@ -836,7 +850,7 @@ PHP_FUNCTION(dom_element_has_attribute_ns)
/* }}} end dom_element_has_attribute_ns */
/* {{{ proto dom_void dom_element_set_id_attribute(string name, boolean isId);
/* {{{ proto void dom_element_set_id_attribute(string name, boolean isId);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttr
Since: DOM Level 3
*/
@@ -847,7 +861,7 @@ PHP_FUNCTION(dom_element_set_id_attribute)
/* }}} end dom_element_set_id_attribute */
/* {{{ proto dom_void dom_element_set_id_attribute_ns(string namespaceURI, string localName, boolean isId);
/* {{{ proto void dom_element_set_id_attribute_ns(string namespaceURI, string localName, boolean isId);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNS
Since: DOM Level 3
*/
@@ -858,7 +872,7 @@ PHP_FUNCTION(dom_element_set_id_attribute_ns)
/* }}} end dom_element_set_id_attribute_ns */
/* {{{ proto dom_void dom_element_set_id_attribute_node(attr idAttr, boolean isId);
/* {{{ proto void dom_element_set_id_attribute_node(attr idAttr, boolean isId);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-ElSetIdAttrNode
Since: DOM Level 3
*/
+5 -7
View File
@@ -29,7 +29,7 @@
/*
* class domentity extends domnode
* class DOMEntity extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-527DCFF2
* Since:
@@ -39,9 +39,7 @@ zend_function_entry php_dom_entity_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ attribute protos, not implemented yet */
/* {{{ proto public_id string
/* {{{ proto publicId string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7303025
Since:
@@ -71,7 +69,7 @@ int dom_entity_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto system_id string
/* {{{ proto systemId string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-D7C29F3E
Since:
@@ -101,7 +99,7 @@ int dom_entity_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto notation_name string
/* {{{ proto notationName string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-6ABAEB38
Since:
@@ -134,7 +132,7 @@ int dom_entity_notation_name_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto actual_encoding string
/* {{{ proto actualEncoding string
readonly=no
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Entity3-actualEncoding
Since: DOM Level 3
+14 -7
View File
@@ -29,7 +29,7 @@
/*
* class domentityreference extends domnode
* class DOMEntityReference extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-11C98490
* Since:
@@ -40,7 +40,7 @@ zend_function_entry php_dom_entityreference_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomEntityReference::__construct(string name); */
/* {{{ proto void DOMEntityReference::__construct(string name); */
PHP_METHOD(domentityreference, __construct)
{
zval *id;
@@ -48,21 +48,28 @@ PHP_METHOD(domentityreference, __construct)
xmlNodePtr oldnode = NULL;
dom_object *intern;
char *name;
int name_len;
int name_len, name_valid;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &id, dom_entityreference_class_entry, &name, &name_len) == FAILURE) {
php_std_error_handling();
return;
}
if (name_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Entity Reference name is required");
php_std_error_handling();
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
node = xmlNewReference(NULL, name);
if (!node)
if (!node) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
@@ -74,5 +81,5 @@ PHP_METHOD(domentityreference, __construct)
}
}
/* }}} end DomEntityReference::__construct */
/* }}} end DOMEntityReference::__construct */
#endif
+9 -11
View File
@@ -29,7 +29,7 @@
/*
* class domnamednodemap
* class DOMNamedNodeMap
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1780488922
* Since:
@@ -46,9 +46,7 @@ zend_function_entry php_dom_namednodemap_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ attribute protos, not implemented yet */
/* {{{ proto length unsigned long
/* {{{ proto length int
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6D0FB19E
Since:
@@ -90,7 +88,7 @@ int dom_namednodemap_length_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto domnode dom_namednodemap_get_named_item(string name);
/* {{{ proto DOMNode dom_namednodemap_get_named_item(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1074577549
Since:
*/
@@ -140,7 +138,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item)
/* }}} end dom_namednodemap_get_named_item */
/* {{{ proto domnode dom_namednodemap_set_named_item(node arg);
/* {{{ proto DOMNode dom_namednodemap_set_named_item(DOMNode arg);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1025163788
Since:
*/
@@ -151,7 +149,7 @@ PHP_FUNCTION(dom_namednodemap_set_named_item)
/* }}} end dom_namednodemap_set_named_item */
/* {{{ proto domnode dom_namednodemap_remove_named_item(string name);
/* {{{ proto DOMNode dom_namednodemap_remove_named_item(string name);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-D58B193
Since:
*/
@@ -162,7 +160,7 @@ PHP_FUNCTION(dom_namednodemap_remove_named_item)
/* }}} end dom_namednodemap_remove_named_item */
/* {{{ proto domnode dom_namednodemap_item(unsigned long index);
/* {{{ proto DOMNode dom_namednodemap_item(int index);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-349467F9
Since:
*/
@@ -217,7 +215,7 @@ PHP_FUNCTION(dom_namednodemap_item)
/* }}} end dom_namednodemap_item */
/* {{{ proto domnode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName);
/* {{{ proto DOMNode dom_namednodemap_get_named_item_ns(string namespaceURI, string localName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-getNamedItemNS
Since: DOM Level 2
*/
@@ -267,7 +265,7 @@ PHP_FUNCTION(dom_namednodemap_get_named_item_ns)
/* }}} end dom_namednodemap_get_named_item_ns */
/* {{{ proto domnode dom_namednodemap_set_named_item_ns(node arg);
/* {{{ proto DOMNode dom_namednodemap_set_named_item_ns(DOMNode arg);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-setNamedItemNS
Since: DOM Level 2
*/
@@ -278,7 +276,7 @@ PHP_FUNCTION(dom_namednodemap_set_named_item_ns)
/* }}} end dom_namednodemap_set_named_item_ns */
/* {{{ proto domnode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName);
/* {{{ proto DOMNode dom_namednodemap_remove_named_item_ns(string namespaceURI, string localName);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-removeNamedItemNS
Since: DOM Level 2
*/
+4 -6
View File
@@ -29,7 +29,7 @@
/*
* class domnamelist
* class DOMNameList
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList
* Since: DOM Level 3
@@ -41,9 +41,7 @@ zend_function_entry php_dom_namelist_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ attribute protos, not implemented yet */
/* {{{ proto length unsigned long
/* {{{ proto length int
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-length
Since:
@@ -60,7 +58,7 @@ int dom_namelist_length_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto domstring dom_namelist_get_name(unsigned long index);
/* {{{ proto string dom_namelist_get_name(int index);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getName
Since:
*/
@@ -71,7 +69,7 @@ PHP_FUNCTION(dom_namelist_get_name)
/* }}} end dom_namelist_get_name */
/* {{{ proto domstring dom_namelist_get_namespace_uri(unsigned long index);
/* {{{ proto string dom_namelist_get_namespace_uri(int index);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#NameList-getNamespaceURI
Since:
*/
+24 -25
View File
@@ -28,7 +28,7 @@
#include "php_dom.h"
/*
* class domnode
* class DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1950641247
* Since:
@@ -260,7 +260,7 @@ int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
/* {{{ proto nodeType unsigned short
/* {{{ proto nodeType int
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-111237558
Since:
@@ -292,7 +292,7 @@ int dom_node_node_type_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto parentNode node
/* {{{ proto parentNode DomNode
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1060184317
Since:
@@ -327,7 +327,7 @@ int dom_node_parent_node_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto childNodes nodelist
/* {{{ proto childNodes DomNodeList
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1451460987
Since:
@@ -361,7 +361,7 @@ int dom_node_child_nodes_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto firstChild node
/* {{{ proto firstChild DomNode
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-169727388
Since:
@@ -399,7 +399,7 @@ int dom_node_first_child_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto lastChild node
/* {{{ proto lastChild DomNode
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-61AD09FB
Since:
@@ -437,7 +437,7 @@ int dom_node_last_child_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto previousSibling node
/* {{{ proto previousSibling DomNode
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-640FB3C8
Since:
@@ -472,7 +472,7 @@ int dom_node_previous_sibling_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto nextSibling node
/* {{{ proto nextSibling DomNode
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-6AC54C2F
Since:
@@ -507,7 +507,7 @@ int dom_node_next_sibling_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto attributes namednodemap
/* {{{ proto attributes DomNamedNodeMap
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-84CF096
Since:
@@ -541,7 +541,7 @@ int dom_node_attributes_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto ownerDocument dom_document
/* {{{ proto ownerDocument DomDocument
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-node-ownerDoc
Since:
@@ -858,7 +858,7 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
/* {{{ proto domnode dom_node_insert_before(node newChild, node refChild);
/* {{{ proto domnode dom_node_insert_before(DomNode newChild, DomNode refChild);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-952280727
Since:
*/
@@ -1011,7 +1011,7 @@ PHP_FUNCTION(dom_node_insert_before)
/* }}} end dom_node_insert_before */
/* {{{ proto domnode dom_node_replace_child(node newChild, node oldChild);
/* {{{ proto DomNode dom_node_replace_child(DomNode newChild, DomNode oldChild);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-785887307
Since:
*/
@@ -1092,7 +1092,7 @@ PHP_FUNCTION(dom_node_replace_child)
/* }}} end dom_node_replace_child */
/* {{{ proto domnode dom_node_remove_child(node oldChild);
/* {{{ proto DomNode dom_node_remove_child(DomNode oldChild);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-1734834066
Since:
*/
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(dom_node_remove_child)
/* }}} end dom_node_remove_child */
/* {{{ proto domnode dom_node_append_child(node newChild);
/* {{{ proto DomNode dom_node_append_child(DomNode newChild);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-184E7107
Since:
*/
@@ -1275,7 +1275,7 @@ PHP_FUNCTION(dom_node_has_child_nodes)
/* }}} end dom_node_has_child_nodes */
/* {{{ proto domnode dom_node_clone_node(boolean deep);
/* {{{ proto DomNode dom_node_clone_node(boolean deep);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-3A0ED0A4
Since:
*/
@@ -1339,7 +1339,7 @@ PHP_FUNCTION(dom_node_clone_node)
/* {{{ proto dom_void dom_node_normalize();
/* {{{ proto void dom_node_normalize();
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-normalize
Since:
*/
@@ -1411,8 +1411,7 @@ PHP_FUNCTION(dom_node_has_attributes)
}
/* }}} end dom_node_has_attributes */
/* {{{ proto unsigned short dom_node_compare_document_position(node other);
/* {{{ proto short dom_node_compare_document_position(DomNode other);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-compareDocumentPosition
Since: DOM Level 3
*/
@@ -1423,7 +1422,7 @@ PHP_FUNCTION(dom_node_compare_document_position)
/* }}} end dom_node_compare_document_position */
/* {{{ proto boolean dom_node_is_same_node(node other);
/* {{{ proto boolean dom_node_is_same_node(DomNode other);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isSameNode
Since: DOM Level 3
*/
@@ -1450,7 +1449,7 @@ PHP_FUNCTION(dom_node_is_same_node)
/* }}} end dom_node_is_same_node */
/* {{{ proto domstring dom_node_lookup_prefix(string namespaceURI);
/* {{{ proto string dom_node_lookup_prefix(string namespaceURI);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-lookupNamespacePrefix
Since: DOM Level 3
*/
@@ -1532,7 +1531,7 @@ PHP_FUNCTION(dom_node_is_default_namespace)
/* }}} end dom_node_is_default_namespace */
/* {{{ proto domstring dom_node_lookup_namespace_uri(string prefix);
/* {{{ proto string dom_node_lookup_namespace_uri(string prefix);
URL: http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespaceURI
Since: DOM Level 3
*/
@@ -1563,7 +1562,7 @@ PHP_FUNCTION(dom_node_lookup_namespace_uri)
/* }}} end dom_node_lookup_namespace_uri */
/* {{{ proto boolean dom_node_is_equal_node(node arg);
/* {{{ proto boolean dom_node_is_equal_node(DomNode arg);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-isEqualNode
Since: DOM Level 3
*/
@@ -1574,7 +1573,7 @@ PHP_FUNCTION(dom_node_is_equal_node)
/* }}} end dom_node_is_equal_node */
/* {{{ proto domnode dom_node_get_feature(string feature, string version);
/* {{{ proto DomNode dom_node_get_feature(string feature, string version);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getFeature
Since: DOM Level 3
*/
@@ -1585,7 +1584,7 @@ PHP_FUNCTION(dom_node_get_feature)
/* }}} end dom_node_get_feature */
/* {{{ proto domuserdata dom_node_set_user_data(string key, domuserdata data, userdatahandler handler);
/* {{{ proto DomUserData dom_node_set_user_data(string key, DomUserData data, userdatahandler handler);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-setUserData
Since: DOM Level 3
*/
@@ -1596,7 +1595,7 @@ PHP_FUNCTION(dom_node_set_user_data)
/* }}} end dom_node_set_user_data */
/* {{{ proto domuserdata dom_node_get_user_data(string key);
/* {{{ proto DomUserData dom_node_get_user_data(string key);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#Node3-getUserData
Since: DOM Level 3
*/
+3 -5
View File
@@ -29,7 +29,7 @@
/*
* class domnodelist
* class DOMNodeList
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-536297177
* Since:
@@ -40,9 +40,7 @@ zend_function_entry php_dom_nodelist_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ attribute protos, not implemented yet */
/* {{{ proto length unsigned long
/* {{{ proto length int
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-203510337
Since:
@@ -95,7 +93,7 @@ int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC)
/* }}} */
/* {{{ proto domnode dom_nodelist_item(unsigned long index);
/* {{{ proto DOMNode dom_nodelist_item(int index);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-844377136
Since:
*/
+3 -3
View File
@@ -29,7 +29,7 @@
/*
* class domnotation extends domnode
* class DOMNotation extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-5431D1B9
* Since:
@@ -41,7 +41,7 @@ zend_function_entry php_dom_notation_class_functions[] = {
/* {{{ attribute protos, not implemented yet */
/* {{{ proto public_id string
/* {{{ proto publicId string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-54F2B4D0
Since:
@@ -71,7 +71,7 @@ int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
/* {{{ proto system_id string
/* {{{ proto systemId string
readonly=yes
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-E8AAB1D0
Since:
+46 -17
View File
@@ -624,7 +624,8 @@ PHP_MINIT_FUNCTION(dom)
REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_ENUMERATION", XML_ATTRIBUTE_ENUMERATION, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("XML_ATTRIBUTE_NOTATION", XML_ATTRIBUTE_NOTATION, CONST_CS | CONST_PERSISTENT);
/* domException Codes */
/* DOMException Codes */
REGISTER_LONG_CONSTANT("DOM_PHP_ERR", PHP_ERR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DOM_INDEX_SIZE_ERR", INDEX_SIZE_ERR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DOMSTRING_SIZE_ERR", DOMSTRING_SIZE_ERR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DOM_HIERARCHY_REQUEST_ERR", HIERARCHY_REQUEST_ERR, CONST_CS | CONST_PERSISTENT);
@@ -1228,34 +1229,62 @@ void dom_set_old_ns(xmlDoc *doc, xmlNs *ns) {
}
/* }}} end dom_set_old_ns */
int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) {
int errorcode = 0;
/*
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS
if (name_len > 0) {
*localname = xmlSplitQName2(qname, (xmlChar **) prefix);
if (*localname == NULL) {
*localname = xmlStrdup(qname);
if (*prefix == NULL && uri_len == 0) {
return errorcode;
}
NAMESPACE_ERR: Raised if
1. the qualifiedName is a malformed qualified name
2. the qualifiedName has a prefix and the namespaceURI is null
*/
/* {{{ int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) */
int dom_check_qname(char *qname, char **localname, char **prefix, int uri_len, int name_len) {
if (name_len == 0) {
return NAMESPACE_ERR;
}
*localname = xmlSplitQName2(qname, (xmlChar **) prefix);
if (*localname == NULL) {
*localname = xmlStrdup(qname);
if (*prefix == NULL && uri_len == 0) {
return 0;
}
if (uri_len == 0 || *localname == NULL || (xmlStrchr(*localname, (xmlChar) ':') != NULL)) {
errorcode = NAMESPACE_ERR;
}
} else {
errorcode = NAMESPACE_ERR;
}
return errorcode;
/* 1 */
if (xmlValidateQName((xmlChar *) qname, 0) != 0) {
return NAMESPACE_ERR;
}
/* 2 */
if (*prefix != NULL && uri_len == 0) {
return NAMESPACE_ERR;
}
return 0;
}
/*
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-DocCrElNS
NAMESPACE_ERR: Raised if
3. the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace" [XML Namespaces]
4. the qualifiedName or its prefix is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/"
5. the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the qualifiedName nor its prefix is "xmlns".
*/
/* {{{ xmlNsPtr dom_get_ns(xmlNodePtr nodep, char *uri, int *errorcode, char *prefix) */
xmlNsPtr dom_get_ns(xmlNodePtr nodep, char *uri, int *errorcode, char *prefix) {
xmlNsPtr nsptr = NULL;
*errorcode = 0;
if (! (prefix && !strcmp (prefix, "xml") && strcmp(uri, XML_XML_NAMESPACE))) {
if (! ((prefix && !strcmp (prefix, "xml" ) && strcmp(uri, XML_XML_NAMESPACE)) ||
(prefix && !strcmp (prefix, "xmlns") && strcmp(uri, DOM_XMLNS_NAMESPACE)) ||
(prefix && !strcmp(uri, DOM_XMLNS_NAMESPACE) && strcmp (prefix, "xmlns")))) {
nsptr = xmlNewNs(nodep, uri, prefix);
}
+14 -7
View File
@@ -29,7 +29,7 @@
/*
* class domprocessinginstruction extends domnode
* class DOMProcessingInstruction extends DOMNode
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1004215813
* Since:
@@ -40,7 +40,7 @@ zend_function_entry php_dom_processinginstruction_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomProcessingInstruction::__construct(string name, [string value]); */
/* {{{ proto void DOMProcessingInstruction::__construct(string name, [string value]); */
PHP_METHOD(domprocessinginstruction, __construct)
{
@@ -48,21 +48,28 @@ PHP_METHOD(domprocessinginstruction, __construct)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
char *name, *value = NULL;
int name_len, value_len;
int name_len, value_len, name_valid;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os|s", &id, dom_processinginstruction_class_entry, &name, &name_len, &value, &value_len) == FAILURE) {
php_std_error_handling();
return;
}
if (name_len == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PI name is required");
php_std_error_handling();
name_valid = xmlValidateName((xmlChar *) name, 0);
if (name_valid != 0) {
php_dom_throw_error(INVALID_CHARACTER_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
nodep = xmlNewPI((xmlChar *) name, (xmlChar *) value);
if (!nodep)
if (!nodep) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
@@ -73,7 +80,7 @@ PHP_METHOD(domprocessinginstruction, __construct)
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
}
}
/* }}} end DomProcessingInstruction::__construct */
/* }}} end DOMProcessingInstruction::__construct */
/* {{{ proto target string
readonly=yes
+11
View File
@@ -22,6 +22,17 @@ $rootNode->appendChild($rootNode);
--EXPECTF--
--- Catch exception with try/catch
object(DOMException)#%d (6) {
["message:protected"]=>
string(23) "Hierarchy Request Error"
["string:private"]=>
string(0) ""
["file:protected"]=>
string(%d) "%s/ext/dom/tests/dom003.php"
["line:protected"]=>
int(8)
["trace:private"]=>
array(0) {
}
["code"]=>
int(3)
}
+394
View File
@@ -0,0 +1,394 @@
--TEST--
Test 1: Creating Elements with and without Namespaces
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
print " 1 DOMDocument::createElement('valid')\n";
try {
$dom = new domDocument;
$dom->createElement('valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print " 2 DOMDocument::createElement('-invalid')\n";
try {
$dom = new domDocument;
$dom->createElement('-invalid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print " 3 DOMDocument::createElement(' ')\n";
try {
$dom = new domDocument;
$dom->createElement(' ');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print " 4 DOMDocument::createElement('prefix:valid')\n";
try {
$dom = new domDocument;
$dom->createElement('prefix:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print " 5 DOMDocument::createElementNS('http://valid.com', 'valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://valid.com', 'valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print " 6 DOMDocument::createElementNS('http://valid.com', 'prefix:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://valid.com', 'prefix:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print " 7 DOMDocument::createElementNS('http://valid.com', '-invalid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://valid.com', '-invalid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print " 8 DOMDocument::createElementNS('http://valid.com', 'prefix:-invalid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://valid.com', 'prefix:-invalid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print " 9 DOMDocument::createElementNS('', 'prefix:invalid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('', 'prefix:invalid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "10 DOMDocument::createElementNS('http://valid.com', 'prefix:valid:invalid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://valid.com', 'prefix:valid:invalid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "11 DOMDocument::createElementNS('http://valid.com', '-prefix:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://valid.com', '-prefix:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "12 DOMDocument::createElementNS('-', 'prefix:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('-', 'prefix:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "13 DOMElement::__construct('valid')\n";
try {
$element = new DomElement('valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "14 DOMElement::__construct('-invalid')\n";
try {
$element = new DomElement('-invalid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "15 DOMElement::__construct(' ')\n";
try {
$element = new DomElement(' ');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "16 DOMElement::__construct('prefix:valid')\n";
try {
$element = new DomElement('prefix:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "17 DOMElement::__construct('valid', '', 'http://valid.com')\n";
try {
$element = new DomElement('valid', '', 'http://valid.com');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "18 DOMElement::__construct('prefix:valid', '', 'http://valid.com')\n";
try {
$element = new DomElement('prefix:valid', '', 'http://valid.com');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "19 DOMElement::__construct('-invalid', '', 'http://valid.com')\n";
try {
$element = new DomElement('-invalid', '', 'http://valid.com');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "20 DOMElement::__construct('prefix:-invalid', '', 'http://valid.com')\n";
try {
$element = new DomElement('prefix:-invalid', '', 'http://valid.com');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "21 DOMElement::__construct('prefix:invalid', '', '')\n";
try {
$element = new DomElement('prefix:invalid', '', '');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "22 DOMElement::__construct('prefix:valid:invalid', '', 'http://valid.com')\n";
try {
$element = new DomElement('prefix:valid:invalid', '', 'http://valid.com');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "23 DOMElement::__construct('-prefix:valid', '', 'http://valid.com')\n";
try {
$element = new DomElement('-prefix:valid', '', 'http://valid.com');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "24 DOMElement::__construct('prefix:valid', '', '-')\n";
try {
$element = new DomElement('prefix:valid', '', '-');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
/* the qualifiedName has a prefix and the namespaceURI is null */
print "25 DOMDocument::createElementNS('', 'prefix:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('', 'prefix:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
/* the qualifiedName has a prefix that is "xml" and the namespaceURI
is different from "http://www.w3.org/XML/1998/namespace" [XML Namespaces] */
print "26 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xml:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://wrong.namespaceURI.com', 'xml:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "27 DOMElement::__construct('xml:valid', '', 'http://wrong.namespaceURI.com')\n";
try {
$element = new DomElement('xml:valid', '', 'http://wrong.namespaceURI.com');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
/* This is okay because we reuse the xml namespace from the document */
print "28 DOMDocument::createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
/* This isn't because the xml namespace isn't there and we can't create it */
print "29 DOMElement::__construct('xml:valid', '', 'http://www.w3.org/XML/1998/namespace')\n";
try {
$element = new DomElement('xml:valid', '', 'http://www.w3.org/XML/1998/namespace');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
/* the qualifiedName or its prefix is "xmlns" and the namespaceURI is
different from "http://www.w3.org/2000/xmlns/" */
print "30 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "31 DOMElement::__construct('xmlns:valid', '', 'http://wrong.namespaceURI.com')\n";
try {
$element = new DomElement('xmlns:valid', '', 'http://wrong.namespaceURI.com');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "32 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "33 DOMElement::__construct('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/')\n";
try {
$element = new DomElement('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
/* the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the
qualifiedName nor its prefix is "xmlns". */
print "34 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid')\n";
try {
$dom = new domDocument;
$dom->createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
print "35 DOMElement::__construct('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/')\n";
try {
$element = new DomElement('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/');
print "valid\n";
} catch (Exception $e) {
print $e->getMessage() . "\n";
}
?>
--EXPECT--
1 DOMDocument::createElement('valid')
valid
2 DOMDocument::createElement('-invalid')
Invalid Character Error
3 DOMDocument::createElement(' ')
Invalid Character Error
4 DOMDocument::createElement('prefix:valid')
valid
5 DOMDocument::createElementNS('http://valid.com', 'valid')
valid
6 DOMDocument::createElementNS('http://valid.com', 'prefix:valid')
valid
7 DOMDocument::createElementNS('http://valid.com', '-invalid')
Namespace Error
8 DOMDocument::createElementNS('http://valid.com', 'prefix:-invalid')
Namespace Error
9 DOMDocument::createElementNS('', 'prefix:invalid')
Namespace Error
10 DOMDocument::createElementNS('http://valid.com', 'prefix:valid:invalid')
Namespace Error
11 DOMDocument::createElementNS('http://valid.com', '-prefix:valid')
Namespace Error
12 DOMDocument::createElementNS('-', 'prefix:valid')
valid
13 DOMElement::__construct('valid')
valid
14 DOMElement::__construct('-invalid')
Invalid Character Error
15 DOMElement::__construct(' ')
Invalid Character Error
16 DOMElement::__construct('prefix:valid')
Namespace Error
17 DOMElement::__construct('valid', '', 'http://valid.com')
valid
18 DOMElement::__construct('prefix:valid', '', 'http://valid.com')
valid
19 DOMElement::__construct('-invalid', '', 'http://valid.com')
Invalid Character Error
20 DOMElement::__construct('prefix:-invalid', '', 'http://valid.com')
Namespace Error
21 DOMElement::__construct('prefix:invalid', '', '')
Namespace Error
22 DOMElement::__construct('prefix:valid:invalid', '', 'http://valid.com')
Namespace Error
23 DOMElement::__construct('-prefix:valid', '', 'http://valid.com')
Invalid Character Error
24 DOMElement::__construct('prefix:valid', '', '-')
valid
25 DOMDocument::createElementNS('', 'prefix:valid')
Namespace Error
26 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xml:valid')
Namespace Error
27 DOMElement::__construct('xml:valid', '', 'http://wrong.namespaceURI.com')
Namespace Error
28 DOMDocument::createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:valid')
valid
29 DOMElement::__construct('xml:valid', '', 'http://www.w3.org/XML/1998/namespace')
Namespace Error
30 DOMDocument::createElementNS('http://wrong.namespaceURI.com', 'xmlns:valid')
Namespace Error
31 DOMElement::__construct('xmlns:valid', '', 'http://wrong.namespaceURI.com')
Namespace Error
32 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'xmlns:valid')
valid
33 DOMElement::__construct('xmlns:valid', '', 'http://www.w3.org/2000/xmlns/')
valid
34 DOMDocument::createElementNS('http://www.w3.org/2000/xmlns/', 'wrongprefix:valid')
Namespace Error
35 DOMElement::__construct('wrongprefix:valid', '', 'http://www.w3.org/2000/xmlns/')
Namespace Error
+12 -7
View File
@@ -29,7 +29,7 @@
#include "dom_ce.h"
/*
* class domtext extends domcharacterdata
* class DOMText extends DOMCharacterData
*
* URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#ID-1312295772
* Since:
@@ -43,7 +43,7 @@ zend_function_entry php_dom_text_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomText::__construct([string value]); */
/* {{{ proto void DOMText::__construct([string value]); */
PHP_METHOD(domtext, __construct)
{
@@ -53,14 +53,19 @@ PHP_METHOD(domtext, __construct)
char *value = NULL;
int value_len;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|s", &id, dom_text_class_entry, &value, &value_len) == FAILURE) {
php_std_error_handling();
return;
}
php_std_error_handling();
nodep = xmlNewText((xmlChar *) value);
if (!nodep)
if (!nodep) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
intern = (dom_object *)zend_object_store_get_object(id TSRMLS_CC);
if (intern != NULL) {
@@ -71,7 +76,7 @@ PHP_METHOD(domtext, __construct)
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, nodep, (void *)intern TSRMLS_CC);
}
}
/* }}} end DomText::__construct */
/* }}} end DOMText::__construct */
/* {{{ proto wholeText string
readonly=yes
@@ -102,7 +107,7 @@ int dom_text_whole_text_read(dom_object *obj, zval **retval TSRMLS_DC)
/* }}} */
/* {{{ proto domtext dom_text_split_text(unsigned long offset);
/* {{{ proto DOMText dom_text_split_text(int offset);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-ID-38853C1D
Since:
*/
@@ -128,7 +133,7 @@ PHP_FUNCTION(dom_text_split_text)
RETURN_FALSE;
}
cur = xmlNodeListGetString(node->doc, node, 1);
cur = xmlNodeGetContent(node);
if (cur == NULL) {
RETURN_FALSE;
}
@@ -185,7 +190,7 @@ PHP_FUNCTION(dom_text_is_whitespace_in_element_content)
/* }}} end dom_text_is_whitespace_in_element_content */
/* {{{ proto domtext dom_text_replace_whole_text(string content);
/* {{{ proto DOMText dom_text_replace_whole_text(string content);
URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#core-Text3-replaceWholeText
Since: DOM Level 3
*/
+9 -5
View File
@@ -29,7 +29,7 @@
/*
* class domxpath
* class DOMXPath
*/
#if defined(LIBXML_XPATH_ENABLED)
@@ -41,7 +41,7 @@ zend_function_entry php_dom_xpath_class_functions[] = {
{NULL, NULL, NULL}
};
/* {{{ proto void DomXPath::__construct(domDocument doc); */
/* {{{ proto void DOMXPath::__construct(DOMDocument doc); */
PHP_METHOD(domxpath, __construct)
{
zval *id, *doc;
@@ -49,14 +49,18 @@ PHP_METHOD(domxpath, __construct)
dom_object *docobj, *intern;
xmlXPathContextPtr ctx, oldctx;
php_set_error_handling(EH_THROW, dom_domexception_class_entry TSRMLS_CC);
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &id, dom_xpath_class_entry, &doc, dom_document_class_entry) == FAILURE) {
php_std_error_handling();
return;
}
php_std_error_handling();
DOM_GET_OBJ(docp, doc, xmlDocPtr, docobj);
ctx = xmlXPathNewContext(docp);
if (ctx == NULL) {
php_dom_throw_error(INVALID_STATE_ERR, 1 TSRMLS_CC);
RETURN_FALSE;
}
@@ -72,9 +76,9 @@ PHP_METHOD(domxpath, __construct)
php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC);
}
}
/* }}} end DomXPath::__construct */
/* }}} end DOMXPath::__construct */
/* {{{ proto domdocument document document */
/* {{{ proto document DOMDocument*/
int dom_xpath_document_read(dom_object *obj, zval **retval TSRMLS_DC)
{
xmlDoc *docp = NULL;
@@ -132,7 +136,7 @@ static void dom_xpath_iter(zval *baseobj, dom_object *intern)
}
/* {{{ proto domnodelist dom_xpath_query(string expr [,domNode context]); */
/* {{{ proto DOMNodeList dom_xpath_query(string expr [,DOMNode context]); */
PHP_FUNCTION(dom_xpath_query)
{
zval *id, *retval, *context = NULL;
-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);
?>
-721
View File
@@ -1,721 +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();
}
/* }}} */
#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 tag)
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;
}
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);
}
/* }}} */
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 long enchant_dict_check(resource broker)
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 broker, 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 broker)
A list of UTF-8 encoded suggestions, or false */
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 broker, 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 broker)
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 broker, 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:
*/
-2
View File
@@ -1,7 +1,5 @@
--TEST--
RegReplace test 1
--POST--
--GET--
--FILE--
<?php $a="abc123";
echo ereg_replace("123","def",$a)?>
Loaded 100 of 634 files, more files were not shown because too many files have changed in this diff. Show more