Compare commits

...
763 Commits
Author SHA1 Message Date
SVN Migration bebb83af0f This commit was manufactured by cvs2svn to create tag 'php_4_0_0'. 2000-05-22 16:56:23 +00:00
Zeev Suraski 8090fbb686 Sigh, that should be the last one :I 2000-05-22 16:56:22 +00:00
Zeev Suraski 0302ee5992 - Remove ugly Ltd. 2000-05-22 16:55:56 +00:00
Andi Gutmans 88de714c41 - Fix LICENSE (one language error and one URL error) 2000-05-22 16:46:37 +00:00
Zeev Suraski ccc12f8801 - Make calendar compile as a dll on Windows 2000-05-22 15:49:49 +00:00
Ben Mansell d0fd31018b Fixed check for Zeus under Solaris (/bin/sh doesn't understand '!') 2000-05-22 14:39:33 +00:00
Zeev Suraski 5e0dec4a40 Notify people that .phps is now fixed 2000-05-22 13:38:13 +00:00
c2588fd0bd ChangeLog update 2000-05-22 01:09:08 +00:00
Sterling Hughes 6ceddbb1d5 fix bug 4533 2000-05-21 23:15:09 +00:00
Jouni Ahto e80b2b13fa Fix #4230. Putenv() was modifying its argument, a no-no. 2000-05-21 21:13:32 +00:00
Sam Ruby c5cf13eb29 Windows build failure 2000-05-21 19:26:50 +00:00
Andi Gutmans 7f689fc044 - Move activate_models() back to where it was. I don't want to make such
- an optimization right before 4.0.0. Who knows, maybe one of the phpinfo()
- functions depends on some information only available after RINIT.
- In any case, my fix for .phps stays in.
2000-05-21 18:05:04 +00:00
Andi Gutmans a8b0d9609c - Fix Apache php source highlighting mode. It was crashing due to the
- module shutdown functions being called when the startup functions weren't
- being called.
2000-05-21 17:41:16 +00:00
Andi Gutmans dc5cd319e5 - Fix Apache php source highlighting mode. It was crashing due to the
- module shutdown functions being called when the startup functions weren't
- being called.
2000-05-21 16:36:16 +00:00
Andi Gutmans cc590f49f2 - Get ready for release 2000-05-21 16:29:38 +00:00
Sam Ruby 767ea7a7e4 use simpler foreach instead of while 2000-05-21 11:26:26 +00:00
Sam Ruby f365665213 passing Strings as Objects 2000-05-21 11:24:49 +00:00
Andreas Karajannis 11f4909068 Turn off retrieving the whole error stack 2000-05-21 08:46:51 +00:00
2936860d24 ChangeLog update 2000-05-21 01:09:15 +00:00
Hartmut Holzgraefe eb7979ab5b patch to explode (bug id #3251) suspended till 4.0.1 2000-05-20 05:07:53 +00:00
650008eea1 ChangeLog update 2000-05-20 01:09:11 +00:00
Sterling Hughes 8580374aa1 Proto fixes.
#Harmut -- I love your web site, I was able to see that these functions
#didn't have prototypes just by checking out the SWF extension area!
2000-05-20 00:13:05 +00:00
Hartmut Holzgraefe af77bc0583 added optional 3rd parameter 'limit' to explode() as in split()
(due to feature request in bug id #3251)
2000-05-19 22:00:38 +00:00
Zeev Suraski d1f9ac5bb9 Give some more room for configurability 2000-05-19 16:17:18 +00:00
Zeev Suraski fdb5ce845f be consistent with the URLs 2000-05-19 16:14:24 +00:00
Thies C. Arntzen 92437e9db1 fix the fix (it's still a hack) 2000-05-19 10:48:05 +00:00
Thies C. Arntzen bad35f5484 make sigchild handler more robust. 2000-05-19 10:40:34 +00:00
Zeev Suraski c80906e4cc Open these up for the API 2000-05-19 09:32:33 +00:00
Thies C. Arntzen 400ca09018 added some Notice about --enable-sigchild 2000-05-19 09:19:20 +00:00
Zeev Suraski 0f82e6de23 Minor output mods 2000-05-19 08:28:53 +00:00
7114e3f9a9 ChangeLog update 2000-05-19 01:09:12 +00:00
Thies C. Arntzen 674f4bac47 added new option "--enable-sigchild" (default is off)
when using this option php will setup it's own SIGCHLD handler.
when using oracle-libraries >= 8.1 on linux you need this option
if you are connecting using the BEQ interface - elsewise you will
see <defunc> processes whenever a php-script disconnects from oracle.
2000-05-18 19:45:34 +00:00
Thies C. Arntzen 9ebc920044 22 May is my birthday! 2000-05-18 18:50:44 +00:00
Zeev Suraski 7e0a18d014 Package 4.0.0 2000-05-18 17:43:19 +00:00
Zeev Suraski e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00
Zeev Suraski 957327e8bc Do it in thread unsafe mode for now. 2000-05-18 14:51:19 +00:00
Sascha Schumann 33789f8cdf Later AOLserver releases will copy the include to the installation dir. 2000-05-18 13:10:13 +00:00
Andrei Zmievski c97760776b (PHP round) Fix proto. 2000-05-18 12:29:58 +00:00
Andrei Zmievski aa09d60d7d (PHP array_multisort) Fix the array_size test. 2000-05-18 12:29:45 +00:00
Sascha Schumann 86c03cceb0 Kill warnings 2000-05-18 12:07:15 +00:00
Sascha Schumann 1596e646fc Cosmetic change 2000-05-18 11:41:41 +00:00
Sascha Schumann f04936f8a1 Make the shared library suffix dynamic. Improve workaround for libtool's
inflexibility WRT -avoid-version to support various numbers of .0
2000-05-18 11:35:17 +00:00
Andi Gutmans a786fc4ab7 - Do this someplace else. 2000-05-18 11:25:03 +00:00
Sascha Schumann b458902704 Fix workaround for systems where libtool cannot handle -avoid-version
correctly.
2000-05-18 10:36:35 +00:00
Andi Gutmans 715ff77344 - Fix include() when used on resources (shouldn't work but shouldn't crash
either).
2000-05-18 10:21:24 +00:00
Uwe Steinmann 4099600941 - fixed bug #4076 2000-05-18 05:35:11 +00:00
Andrei Zmievski 3df1e68fe9 Update for sort functions - user can now specify sort type. 2000-05-18 01:53:41 +00:00
a5b03338f8 ChangeLog update 2000-05-18 01:09:11 +00:00
aeb3476923 NEWS update 2000-05-18 01:09:08 +00:00
Andrei Zmievski 87fbbfa692 Tough to explain in two lines. 2000-05-18 00:52:32 +00:00
Andrei Zmievski a859e83392 Update for sort functions - user can now specify sort type. 2000-05-18 00:47:57 +00:00
Sterling Hughes a8bb2a86b1 Make the SWF module compile again + 1 stylistic change. 2000-05-18 00:39:00 +00:00
Andi Gutmans 09915a1597 - Make non-threaded project build on Win32 2000-05-17 23:49:26 +00:00
Andi Gutmans a704be730c - Fix Win32 build 2000-05-17 23:42:18 +00:00
Hartmut Holzgraefe 1e438060af proto corrected 2000-05-17 19:50:22 +00:00
Egon Schmid 11acad981c Fixed the format. 2000-05-17 19:48:43 +00:00
Hartmut Holzgraefe 31c3dfdf52 proto-takeover from php3 2000-05-17 19:45:46 +00:00
Hartmut Holzgraefe d7779d8bdf proto takeover from php3 2000-05-17 19:42:08 +00:00
Hartmut Holzgraefe e5a2f0f95c proto-takeover from php3 2000-05-17 19:40:10 +00:00
Hartmut Holzgraefe 1e632ffdee typo fix 2000-05-17 19:36:51 +00:00
Hartmut Holzgraefe 5354940f93 correction 2000-05-17 19:27:08 +00:00
Andi Gutmans 3564810150 - Nuke dlist.[ch] from Win32 build. 2000-05-17 19:20:18 +00:00
Andi Gutmans f428c40ac2 - Remove dlist from build 2000-05-17 19:12:51 +00:00
Andi Gutmans 073bb3fdf8 - Remove dlist.[ch]. Should not be needed anymore 2000-05-17 19:11:43 +00:00
Sascha Schumann db3d16dca1 Add debug.log facility. If there are any obscure bugs in our build system,
this will give us enough information to find and fix it.
2000-05-17 19:08:44 +00:00
Hartmut Holzgraefe 6173835699 proto-takeover from php3 2000-05-17 18:58:27 +00:00
Andi Gutmans 0aefa3e037 - Add support for string_compare_function() and number_compare_function().
UNTESTED!
2000-05-17 18:55:22 +00:00
Egon Schmid 7dd8b901e6 Second parameter is optional. 2000-05-17 18:17:07 +00:00
Hartmut Holzgraefe 29571bf2b1 took over missing prototypes from php3 source
(copied them only, didn't check for parameter changes!)
2000-05-17 18:14:05 +00:00
Hartmut Holzgraefe 44845ea24b name in proto should be name of real function, not alias 2000-05-17 17:54:54 +00:00
Zeev Suraski 760a17729e Normalize results of compare_function() 2000-05-17 17:08:25 +00:00
Sascha Schumann 4a4d185637 Fix build against recent thttpd versions 2000-05-17 17:04:46 +00:00
Sascha Schumann f4e20147b5 . 2000-05-17 16:10:48 +00:00
Sascha Schumann f0ed744125 Fix 64-bit issue in gethostbyaddr(). 2000-05-17 16:08:42 +00:00
Zeev Suraski 5fcb963f09 Fix crash if %> is encountered in HTML while ASP-tags are disabled 2000-05-17 15:50:30 +00:00
Uwe Steinmann d20eec24ce - fixed wrong interpretation of last parameter of swf_rotate()
- add MOD_COLOR and MOD_MATRIX constants
2000-05-17 15:47:15 +00:00
Uwe Steinmann 7bde3adbd4 - test script to test creation of flash files 2000-05-17 15:45:56 +00:00
Zeev Suraski efb51322c1 Only allow loading of extensions only during .ini file parsing 2000-05-17 15:41:32 +00:00
Andi Gutmans 03c844305f Fix order 2000-05-17 15:24:49 +00:00
Andrei Zmievski e2e6363488 Let's cast it. 2000-05-17 12:51:37 +00:00
Andrei Zmievski 08ff225a46 @- Improved round() to allow specification of rounding precision.
@  (Andrei, Todd Kirby <kirbyt@yahoo.com>)
2000-05-17 12:50:04 +00:00
Zeev Suraski 6d77362190 Fix crash when server_context is not longer valid (e.g., when
coming from php_apache_request_shutdown)
2000-05-17 08:11:20 +00:00
8bff24d65b ChangeLog update 2000-05-17 01:09:09 +00:00
Sascha Schumann 8669a15755 Add missing prototype 2000-05-17 00:35:08 +00:00
Sascha Schumann 69223ccebd ANSIfy declarations/prototypes 2000-05-16 23:38:51 +00:00
Sascha Schumann c2279a0217 s/normal/SUSV2/ 2000-05-16 23:24:39 +00:00
Sascha Schumann 46e672243a Remove extra declarations of cwd_globals(_id) 2000-05-16 23:11:18 +00:00
Zeev Suraski ac0e07ecda - Small optimization. Filling up the Cache helps performance. 2000-05-16 15:42:16 +00:00
Andi Gutmans 0aa5f2ea3c - Reverse the patch until I have time to look at it. The global id should
be defined by ZEND_DECLARE_GLOBALS(cwd)
2000-05-16 14:59:30 +00:00
Andi Gutmans 4e6e741af8 - Commit Sascha's patch to the virtual_cwd code. Will test it on Windows
soon.
2000-05-16 14:47:55 +00:00
Sascha Schumann ccc2b1b8ce Fix PHP_EXTENSION argument
PR: #4458
2000-05-16 08:21:10 +00:00
Uwe Steinmann 31be486539 - fixed prototype 2000-05-16 07:54:10 +00:00
f615ec59cb ChangeLog update 2000-05-16 01:09:13 +00:00
7f008ae327 NEWS update 2000-05-16 01:09:10 +00:00
Sascha Schumann c20fb0c22d Fix pointer to FAQ entry.
PR: #4451
2000-05-15 17:13:03 +00:00
Sascha Schumann f1941064de Fix wording (not "to apxs", but "of apxs"). 2000-05-15 16:43:44 +00:00
Sascha Schumann 13e9da59ff Complain loudly and stop configuration, if we cannot run apxs. 2000-05-15 16:37:32 +00:00
Sascha Schumann 8ab33a4d13 Use "mkdir -p" instead of "test -d || mkdir" where possible 2000-05-15 16:02:43 +00:00
Sascha Schumann 521e1d218c Cosmetic changes 2000-05-15 14:40:20 +00:00
Sascha Schumann 6baa5bc2dc Complain, if write(2) failed. 2000-05-15 13:50:39 +00:00
Andrei Zmievski fe24b820be @- NULL values are now preserved in the return value of mysql_fetch_array()
@  and mysql_fetch_object(). (Andrei)
2000-05-15 13:46:37 +00:00
Ben Mansell 10503a3b92 Define PHP_SELF properly with Zeus+ISAPI 2000-05-15 12:40:12 +00:00
Thies C. Arntzen 2a6fbb620c fix .sl <-> .so recognition 2000-05-15 10:01:51 +00:00
Sascha Schumann 4a658e8b51 Drop slower strchr in favor of memchr. 2000-05-15 09:55:03 +00:00
Thies C. Arntzen c693ca137f this now works on .so and .sl (HP) systems 2000-05-15 07:24:09 +00:00
e2e7283a30 ChangeLog update 2000-05-15 01:09:45 +00:00
ae827bae28 NEWS update 2000-05-15 01:09:42 +00:00
Jouni Ahto ce42de535a # I think it's safe say so now...
@- InterBase module finally ported from PHP3 to PHP4. Full support for
@  InterBase 6. (Jouni)
2000-05-14 23:38:32 +00:00
Jouni Ahto 08838fe79a Default to the highest SQL version supported by libs.
Fixed associative array values returned by ibase_field_info.
Fixed compatibility problems with old versions of InterBase.
2000-05-14 21:55:45 +00:00
Sterling Hughes ed2933342c @-Add swf_definepoly for drawing polygons to the SWF functions. (Sterling) 2000-05-14 18:39:11 +00:00
Zeev Suraski 7fc980e1fa Please maintain consistency in these names... :) 2000-05-14 16:09:32 +00:00
Zeev Suraski fb20aee667 - Fix a crash bug in case output is generated in the Apache module while
in request_shutdown
2000-05-14 16:05:25 +00:00
Sterling Hughes 69ddfd0acb @-Port imagegammacorrect from PHP3 to PHP4. (Sterling)
#Also two little stylistic changes in gd.c
2000-05-14 15:25:13 +00:00
1dd49bd4d6 ChangeLog update 2000-05-14 01:09:19 +00:00
Sam Ruby c82eca90f4 Fix typo - thanks to Christian Wenz <christian.wenz@stud.tu-muenchen.de> 2000-05-13 15:26:28 +00:00
Sascha Schumann 654b75694a Do not use non-standard type u_int32_t.
Instead, use UINT4 for now which is platform-independent.

PR: #4262
2000-05-13 09:36:33 +00:00
Sascha Schumann dc6d46c180 "INT" configuration values must be of type long 2000-05-13 06:05:24 +00:00
602914d824 ChangeLog update 2000-05-13 01:09:14 +00:00
Sterling Hughes 7342fc7a28 Add Meself for LibSWF. 2000-05-12 20:49:26 +00:00
Jouni Ahto 7894d58ae5 # Correct spelling, adding Andrew because half the code in that module is
# his, removing myself from Informix because I don't think my influence to
# that module was big enough worth mentioning, adding myself to GD because
# I think T1lib is worth mentioning. BTW, who wrote the TTF extension? I think
# he is missing credits here.
2000-05-12 20:11:14 +00:00
Andrei Zmievski 74011b6767 Testing. 2000-05-12 13:55:51 +00:00
Andrei Zmievski dee6170da3 test 2000-05-12 12:49:20 +00:00
Andrei Zmievski ffef0d8d44 Another test. 2000-05-12 12:45:28 +00:00
Andrei Zmievski b0f87cdb5f Testing. 2000-05-12 12:44:08 +00:00
Andrei Zmievski 3f65342eb2 test 2000-05-12 12:29:59 +00:00
Sam Ruby 33ceae2809 i18n, part I 2000-05-12 09:51:16 +00:00
Sascha Schumann afedd22f19 Fix parallel makes on BSD 2000-05-12 09:05:05 +00:00
Jouni Ahto 4132ec828d Changed ibase_num_fields to use high-performance api (which fixed a *very*
obscure bug).
2000-05-12 08:37:03 +00:00
Sascha Schumann 23dfe91b60 Remove directory test when creating directories using mkdir -p 2000-05-12 07:37:42 +00:00
Sascha Schumann f3ac213120 Upgrade shtool to 1.4.9 and fix "mkdir -p" behaviour. Patch has been
sent to the author of shtool.
2000-05-12 07:33:55 +00:00
Jouni Ahto fc5daee434 Fixed all (?) remaining issues with InterBase 6 datatypes, especially
with timestamp, date and time.
Incombatible change: renamed constant IBASE_TIMESTAMP to IBASE_UNIXTIME.
Incompatible change: renamed configuration directive ibase.timeformat
to ibase.timestampformat.
Added constants IBASE_TIMESTAMP, IBASE_DATE, IBASE_TIME.
Added configuration directives ibase.dateformat and ibase.timeformat.
ibase_timefmt() now takes an optional second argument specifying which
format to change, default is IBASE_TIMESTAMP (for even a little backwards
compatibility).
2000-05-12 03:02:14 +00:00
f626eb4986 ChangeLog update 2000-05-12 01:09:10 +00:00
Jouni Ahto 59ddaefd72 SQL_INT64 binding support in prepared and executed queries.
Fixed a (probably) longtime bug with binding to DECIMAL/NUMERIC stored as
scaled integer.
# Be lazy on documentation, then nobody ever uses the features there are,
# and you never get caught for bugs...
2000-05-11 19:38:02 +00:00
Zeev Suraski 0d6a794d85 Get rid of chval - it's really not necessary and seems to be confusing people 2000-05-11 19:18:11 +00:00
Zeev Suraski 9a751419cf Refined fix 2000-05-11 18:49:45 +00:00
Zeev Suraski cb35b7e4ed Fix a memory corruption bug with by-ref function arguments 2000-05-11 18:31:21 +00:00
Andreas Karajannis 07f7b8c1e3 Prototype adapted 2000-05-11 16:25:58 +00:00
Andreas Karajannis 010f7850e0 Restoring old parameter ordering in odbc_fetch_into() 2000-05-11 16:24:03 +00:00
Andi Gutmans c88ccc49a1 - Remove unneeded object_init(return_value) from three places 2000-05-11 13:52:24 +00:00
Andrei Zmievski 3f43d41ba6 Typo. 2000-05-11 13:00:48 +00:00
Egon Schmid 7a3e2ee70a Fixed some typos. 2000-05-11 12:10:53 +00:00
Andreas Karajannis f4357f3254 Forcing passing by reference for array in odbc_fetch_into()
Added function odbc_column_scale(), new alias odbc_column_precision for odbc_column_len
Added better description in Prototypes for some functions
2000-05-11 11:46:06 +00:00
Sam Ruby c32bba9644 build error on Unix 2000-05-11 10:39:28 +00:00
3ba2d1bf88 ChangeLog update 2000-05-11 01:09:14 +00:00
Danny Heijl 7d5e93ac57 - fix for SQLLVARCHAR provided by Alan Shepherd. (Danny) 2000-05-10 18:56:42 +00:00
Andrei Zmievski fa89a5f940 Move to past RC2. 2000-05-10 13:36:57 +00:00
Chuck Hagenbuch fe22dc5ff8 fix for segfault. patch from Jade Nicoletti <nicoletti@nns.ch>. 2000-05-10 12:44:44 +00:00
Andi Gutmans 33f8ab3800 - Bump up Zend extension version number 2000-05-10 12:28:13 +00:00
Thies C. Arntzen 354272315a make waning readable 2000-05-10 09:40:46 +00:00
Sascha Schumann ee3c06a533 Fix register_argc_argv entry.
Submitted by: André Langhorst <A.Langhorst@itbnet.de>
2000-05-10 09:31:53 +00:00
Thies C. Arntzen ab6d34d8ba revert last patch - you can only specify the dl() path relative to extension_dir
again
2000-05-10 07:32:51 +00:00
72fcf1310a ChangeLog update 2000-05-10 01:09:14 +00:00
3dd91d548e NEWS update 2000-05-10 01:09:11 +00:00
Jouni Ahto b826d6a43d Support (partially) the new datatypes in InterBase 6. 2000-05-09 20:30:23 +00:00
Andrei Zmievski fdbea075fa @- Added array_rand() function. (Andrei) 2000-05-09 19:27:00 +00:00
Andi Gutmans 30da5fd8fc Thoroughly initialize IS_UNUSED for proper cleanup 2000-05-08 21:46:48 +00:00
Andi Gutmans 63b7056f9a - Change Zend Engine version number 2000-05-08 16:33:52 +00:00
Andi Gutmans a9ec11476c - Return real size allocated 2000-05-08 16:18:20 +00:00
Zeev Suraski 19de3be052 Make zend_binary_strcasecmp compile again 2000-05-08 10:24:26 +00:00
Thies C. Arntzen cd72153455 config.m4 redone - now supports building oracle extension as shared module
# i really hope i didn't break linking agains ancient oracle-versions!
2000-05-08 10:10:00 +00:00
Sascha Schumann 36c1a9a39d Make strcasecmp() act correctly WRT SUS II.
Patch by: hholzgra@php.net
PR: #3556
2000-05-08 10:05:19 +00:00
Thies C. Arntzen 9930bab2a6 oracle.c expects _ORACLE_ 2000-05-08 10:04:12 +00:00
Thies C. Arntzen 7436c0791b imporved version detection 2000-05-08 09:41:37 +00:00
Thies C. Arntzen aaaaf46846 oracle/oci8 no longer share the compile-time infos 2000-05-08 09:20:23 +00:00
Thies C. Arntzen 831459885e rewritten the configure stuff 2000-05-08 09:06:48 +00:00
Thies C. Arntzen 62d5504706 AC_ADD_LIBRARY_WITH_PATH now always prepends new libraries. 2000-05-08 08:55:45 +00:00
Thies C. Arntzen 3ee9304cd9 support empty libpath in AC_ADD_LIBRARY_WITH_PATH
make sure the link-order for shared and static builds are the same
2000-05-08 08:27:48 +00:00
Thies C. Arntzen b8f9b48098 (php_dl) treat path as absolute if it starts with '/' 2000-05-08 08:12:28 +00:00
9377ed98dd ChangeLog update 2000-05-08 01:09:15 +00:00
jim winstead 7713553d85 another minor change to test CVS mails again 2000-05-07 18:35:41 +00:00
Sascha Schumann b345acb577 Never tell link editor to libc. Some systems use thread-safe
replacements for libc in Pthreads mode.
2000-05-07 05:32:54 +00:00
Sascha Schumann 873df0ae89 Libtool creates libphp4.so.0.0 on at least AIX and FreeBSD 2.2.
This hack will catch the resulting shared library anyway.

The Right Way to approach this is to fix libtool to properly
handle -module on all platforms.
2000-05-07 04:42:04 +00:00
Sascha Schumann fa254b6267 executor_globals is always passed to MINIT functions 2000-05-07 03:20:37 +00:00
Sascha Schumann 6953135774 s/localtime_r/php_localtime_r/ 2000-05-07 02:38:05 +00:00
b81cc1daf4 ChangeLog update 2000-05-07 01:09:13 +00:00
Sascha Schumann 679bcde68b Avoid relying on non-standard tar `z' option.
Turn on best compression for creating the archive.
2000-05-07 00:18:06 +00:00
Sascha Schumann 2df8e7341e Move <syslog.h> inclusion into php_syslog.h. This will make sure that
all source files "get it."
2000-05-07 00:10:32 +00:00
Sascha Schumann ec9612aa44 This change addresses an issue on systems which cannot link against libnsl
and libsocket, resulting in segfaults. If yp_get_default_domain is
available after checking for libsocket, we assume we do not need libnsl
anymore.
2000-05-06 23:26:41 +00:00
Sascha Schumann 54fa1a77d7 On some systems, <syslog.h> defines syslog to another symbol, so that
syslog.lo does not contain the expected symbols. Including <symbol.h>
in basic_functions.c fixes the resulting linking problem.
2000-05-06 23:17:11 +00:00
Shane Caraveo df81aba99f add nsapi to workspace 2000-05-06 23:06:47 +00:00
Shane Caraveo c4e2c84fa2 news 2000-05-06 23:06:22 +00:00
Shane Caraveo fdb62f9ce7 nsapi now compiles under win32, untested 2000-05-06 23:05:29 +00:00
Andi Gutmans dc704e26fe - Make zend_eval_string() return SUCCESS/FAILURE 2000-05-06 18:49:46 +00:00
Andi Gutmans 686bd5724b - Make $obj->test = 5; work again (assigning to uninitialized objects) 2000-05-06 18:40:48 +00:00
Shane Caraveo 166c703eb7 add apache module to workspace 2000-05-06 18:23:28 +00:00
Shane Caraveo 0e67838ecf some news 2000-05-06 18:22:42 +00:00
Andrei Zmievski f78f340288 Some breaking news for RC2. 2000-05-06 18:01:45 +00:00
Andrei Zmievski 8154734529 It helps to change the comment too. 2000-05-06 17:59:58 +00:00
Shane Caraveo 5797876236 oh boy! apache-win32 works! 2000-05-06 17:59:34 +00:00
Andrei Zmievski 498ce88d67 Enable assert by default, 2000-05-06 17:59:10 +00:00
Andrei Zmievski 0060f95699 Fixes for possible failure of zend_eval_string(). 2000-05-06 17:57:34 +00:00
Sascha Schumann 4b87dccefc Fix dbase breakage related to the virtual path changes. 2000-05-06 03:15:41 +00:00
Sascha Schumann 17b84ad7e7 Planning for 4.0RC2 on Monday 2000-05-06 01:48:35 +00:00
Sascha Schumann fbfd92c775 Fix regex 2000-05-06 01:41:14 +00:00
661758348c ChangeLog update 2000-05-06 01:09:10 +00:00
Andrei Zmievski 06358248a4 Testing. 2000-05-05 14:07:52 +00:00
Sascha Schumann 788feca4ae Linking directly against libc might result in unexpected behaviour.
We check for dlopen in libdl first, and check then whether dlopen exists.
2000-05-05 12:17:41 +00:00
Sascha Schumann 86d6389db4 Assign/restore vars appropiately 2000-05-05 12:15:36 +00:00
Sascha Schumann 30f6031bfa Fix a bug introduced when the SAPI checks were moved.
INCLUDES were overwritten, so i.e. APXS builds failed.
2000-05-05 11:39:41 +00:00
Sascha Schumann f51b56cfed Move dlopen in -ldl check to configure.in. This should ensure that if libdl
exists, it will be always found. We define HAVE_LIBDL now always, if the
function dlopen is found.
2000-05-05 11:23:12 +00:00
Sascha Schumann 8570e0e3ba Put in a hack, so that users can compile PHP, even if the configure-time
checks failed to detect the capabilities of crypt().
2000-05-05 10:36:00 +00:00
Andi Gutmans 0d194ec80b - Fix problem with sapi_globals being used before it is initialized. 2000-05-05 07:21:48 +00:00
Andi Gutmans 198537b70f - Make Windows compile again. 2000-05-05 07:18:50 +00:00
5db0f958c4 ChangeLog update 2000-05-05 01:09:15 +00:00
e2dc9f3bc9 NEWS update 2000-05-05 01:09:12 +00:00
Andrei Zmievski 89d4eedaf9 testing 2000-05-05 00:16:41 +00:00
Andrei Zmievski d8f2900589 Updates for changed WDDX API. 2000-05-04 20:29:36 +00:00
Andrei Zmievski 0a09f95dd7 Got rid of infinite recursion when serializing $GLOBALS[].
@- Fixed infinite recursion when serializing $GLOBALS[] in WDDX. (Andrei)
2000-05-04 20:28:21 +00:00
Andrei Zmievski 494ed67194 Done. 2000-05-04 20:04:38 +00:00
Andrei Zmievski 2b26bb5086 . Reworked string serialization
. <, >, and & in strings are now properly escaped
. Removed a lot of unnecessary calls to strlen()

@- Made WDDX serialization properly escape <, >, and &. Also speeded up
@  the serialization in general. (Andrei)
2000-05-04 20:00:07 +00:00
Sascha Schumann cc7a71592c Generate missing files 2000-05-04 18:00:10 +00:00
Andrei Zmievski ec6c171fdd Typo. 2000-05-04 17:52:14 +00:00
Sascha Schumann 24abc76a93 `.deps' are sourced only by Makefiles created by fastgen.sh, so it makes
sense to create empty .deps there.
2000-05-04 17:50:32 +00:00
Sascha Schumann 61b88ae8ed Don't distribute ChangeLog. You can download it from lxr.php.net 2000-05-04 17:49:10 +00:00
Sascha Schumann dc91d47014 Remove trailing slash(es) from pathnames 2000-05-04 16:08:10 +00:00
Andrei Zmievski 72805c7d9b Some formatting. 2000-05-04 13:45:51 +00:00
Jouni Ahto aef06da015 Fix (?) #4314. 2000-05-04 13:43:06 +00:00
Zeev Suraski 0b33ac7627 - Add -z and -g switches to the CGI 2000-05-04 13:42:21 +00:00
Jouni Ahto 4802fbb8b8 If using a persistent connection, check if it's still there and reopen if
needed.
2000-05-04 12:28:00 +00:00
Sascha Schumann a88946c70d Install extensions in different directories, so that users can have
various PHP installations with different parameters.
2000-05-04 11:57:59 +00:00
Sascha Schumann e905fabe0d s/strtok_r/php_strtok_r/ 2000-05-04 11:36:33 +00:00
Sascha Schumann f2a236ff83 Missed localtime_r/ctime_r. Prefix them with php 2000-05-04 11:31:58 +00:00
Sascha Schumann 6c4d6ba5e3 Don't automatically assign pthreads_cflags/pthreads_libs to env
variables. That allows us to check for the availability of POSIX threads
before actually using it.
2000-05-04 10:49:36 +00:00
Sascha Schumann d0f3764ee2 Change reentrancy API to always use the php prefix.
Check for the declaration of reentrant functions, so that we can use
them in non-ZTS mode on all platforms.
2000-05-04 10:38:17 +00:00
Sascha Schumann b6e4841ec7 Determine first whether we will use ZTS mode or not.
This is important, because the system checks will yield different
results depending on whether POSIX threads are enabled or not.

We also use PTHREADS_CFLAGS only in ZTS mode now. Using these flags
in non-ZTS mode causes complete build failures on some platforms
(i.e. FreeBSD 2.2.x). This will cause harmless warnings on some
platforms (i.e. Solaris 2).
2000-05-04 09:42:27 +00:00
Shane Caraveo cad04f5579 more apachewin32 work. much better now, but still crashing in zend_execute. At least it's getting the file open now though. 2000-05-04 03:28:34 +00:00
a85e57ebc3 ChangeLog update 2000-05-04 01:09:13 +00:00
948edc9caf NEWS update 2000-05-04 01:09:09 +00:00
Thies C. Arntzen dedc130786 . 2000-05-04 01:01:38 +00:00
Thies C. Arntzen da7a5fc29d have to work now - maybe iÄll do it tonight 2000-05-04 00:53:39 +00:00
Andi Gutmans 69eb908f06 - Change fetch_type to be zend_uint 2000-05-03 18:01:35 +00:00
Andi Gutmans f2471fd50a - Change the place CAST uses for the op_type 2000-05-03 17:56:44 +00:00
Andrei Zmievski 599813d73a Let's enable assert by default since it's so useful. 2000-05-03 14:24:14 +00:00
Joey Smith 884a614e67 Add fact that every entry in NEWS has to have a name after it 2000-05-03 13:33:48 +00:00
Joey Smith 5df40a8a1d Sascha pointed me in the right direction. 2000-05-03 13:28:57 +00:00
Andrei Zmievski 8d0c626fe6 We want to have name at the very end. 2000-05-03 11:58:54 +00:00
Sam Ruby 6fb3301416 Correct build breakage - win32 2000-05-03 11:26:29 +00:00
Joey Smith 80d6eccf6e Moving README-BCMATH to README.BCMATH 2000-05-03 04:57:11 +00:00
Joey Smith 0022a2f81a I am going to move README-BCMATH to README.BCMATH for consistency. 2000-05-03 04:55:19 +00:00
Joey Smith 69a894a2f0 Changed install-local to install-sapi for clarity.
@ Moved install-local to install-sapi for clarity. (Joey)
2000-05-03 04:51:11 +00:00
Joey Smith 5ad95a203c Shut up CVS and make cvsclean wipe this file out... 2000-05-03 04:48:01 +00:00
eefc66419c ChangeLog update 2000-05-03 01:09:10 +00:00
Sascha Schumann 9f6976d6d5 Complain loudly, if we were not able to install everything. 2000-05-02 22:28:12 +00:00
Sterling Hughes 515b7e74df adda dir.. 2000-05-02 22:10:41 +00:00
Sascha Schumann bf58db4bc2 Verbose "give the reader a quick success" tutorial 2000-05-02 21:51:48 +00:00
Sascha Schumann 79a89ef8fe Make bcmath buildable as shared module 2000-05-02 21:35:08 +00:00
Sascha Schumann 281a8aebda . 2000-05-02 21:26:50 +00:00
Sascha Schumann 3b9bcd7443 Set abs_srcdir. Last example in README.S-C-EXTENSIONS works now. 2000-05-02 21:20:56 +00:00
Sascha Schumann 6bc1bf4c93 Make MySQL independent of build location 2000-05-02 21:18:59 +00:00
Sterling Hughes df3d78cbac Add a ; for Sybase 2000-05-02 21:00:09 +00:00
Sascha Schumann dd497bdc1a First try at explaining how to create a self-contained extension 2000-05-02 20:59:46 +00:00
Sascha Schumann cae3b7dff5 Pear Changes:
Store EXTENSION_DIR in php-config

  Ignore errors during header installation

  Automatically enable modules in self-contained mode

  Create empty .deps in builddir
2000-05-02 20:56:03 +00:00
Sascha Schumann 5989ae5dc1 Fix building external extensions. 2000-05-02 20:10:46 +00:00
Sascha Schumann 733d94909f Move install-modules target into top-level Makefile template 2000-05-02 20:08:54 +00:00
Andi Gutmans 52288d4f05 - Shouldn't be needed. The configuration mechanism makes sure this is
- up-to-date
2000-05-02 18:46:19 +00:00
Zeev Suraski 8ca13c97c2 Change zend_hash_get_current_key_ex() to also return the string length 2000-05-02 17:52:31 +00:00
Andrei Zmievski f5520fd465 Fix attribution. 2000-05-02 15:27:04 +00:00
Sascha Schumann fca9539d63 Preset extension_dir to the installation directory of PHP modules.
This effectively means that dl() will work without having an installed
configuration file.
2000-05-02 14:46:20 +00:00
Sascha Schumann 8eb698a847 Make php_dl() respect the configured extension_dir setting. 2000-05-02 14:44:08 +00:00
Hartmut Holzgraefe 19ea1a0bc9 calling a function that is not supported in the current build due to a
missing library or unsupported feature (especially GIF-Output)
will now give a slightly more usefull error message than eg.
" Call to undefined function:  imagegif()"
(this seemed to confuse a lot of users ....)
2000-05-02 14:10:51 +00:00
Ben Mansell ce86302f8a Updated build advice for different platforms 2000-05-02 08:25:24 +00:00
Sascha Schumann 99e2820bed Fix segfault occuring when a temporary module was unloaded and if this
module did not have a request shutdown function.
2000-05-02 07:04:59 +00:00
Sascha Schumann a931caf2b2 Protect everything which requires <libpq-fe.h> with PHP_PGSQL_PRIVATE 2000-05-02 05:27:35 +00:00
Sascha Schumann f6a7542f73 Include php_virtual_cwd.h for V_OPEN 2000-05-02 05:16:20 +00:00
Sascha Schumann 6767b4df68 Make filepro compilable as shared module 2000-05-02 04:32:50 +00:00
Sascha Schumann b2e90b4e8b Make dbase compilable as shared module 2000-05-02 04:32:33 +00:00
Sascha Schumann 645b2736a3 Make sybase compilable as shared module 2000-05-02 04:27:03 +00:00
Sascha Schumann 92c87b1ba9 Make readline compilable as shared module 2000-05-02 04:26:48 +00:00
Sascha Schumann dca0d3f454 Make interbase compilable as shared module 2000-05-02 04:26:22 +00:00
Sascha Schumann 82c5c690c9 Use the new AC_ADD_LIBRARY_WITH_PATH option shared-libadd 2000-05-02 04:01:15 +00:00
Sascha Schumann f1dfd1f5f7 Make mcal buildable as shared module 2000-05-02 04:00:47 +00:00
Sascha Schumann 0b516602fd Add shared-libadd option to AC_ADD_LIBRARY_WITH_PATH.
This lets you replace

  if test "$ext_shared" = "yes"; then
    FOO_SHARED_LIBADD="-R$LIBDIR -L$LIBDIR -l$LIB"
  else
    AC_ADD_LIBRARY_WITH_PATH($LIB, $LIBDIR)
  fi

with

  AC_ADD_LIBRARY_WITH_PATH($LIB, $LIBDIR, FOO_SHARED_LIBADD)
2000-05-02 04:00:14 +00:00
Sascha Schumann c3d4066b48 Make dba compilable as shared module 2000-05-02 03:38:26 +00:00
Sascha Schumann cf4863788e Make mhash builable as shared module 2000-05-02 03:29:45 +00:00
Sascha Schumann 3e80436fb8 Make mcrypt buildable as shared module 2000-05-02 03:29:28 +00:00
Sascha Schumann dbf959d04d Make ftp buildable as shared module 2000-05-02 02:02:18 +00:00
Sascha Schumann 4f5717d0a0 Make calendar buildable as shared module 2000-05-02 02:02:05 +00:00
Sascha Schumann 095e13632c Make icap buildable as shared module 2000-05-02 02:01:13 +00:00
Sascha Schumann a4d401a67d Make sysvshm buildable as shared module 2000-05-02 02:00:51 +00:00
Sascha Schumann 8d2d181e69 Make sysvsem buildable as shared module 2000-05-02 02:00:36 +00:00
Sascha Schumann 0b6d923bae Add ZEND_GET_MODULE(name). This is a short-cut for the common
get_module function.
2000-05-02 01:33:18 +00:00
Sascha Schumann f8f7dcf0cf Make yp buildable as shared module 2000-05-02 01:21:28 +00:00
Sascha Schumann d4def2d2a3 Make zlib buildable as shared module 2000-05-02 01:15:10 +00:00
b45ee4b1ed ChangeLog update 2000-05-02 01:09:22 +00:00
ec70bc274f NEWS update 2000-05-02 01:09:19 +00:00
Sascha Schumann fe50664d4d #if COMPILE_DL
becomes

    #if defined(COMPILE_DL) || defined(COMPILE_DL_EXTENSION_NAME)
2000-05-02 00:44:35 +00:00
Sascha Schumann 0d383d9373 Replace the various get_module() functions with a uniform
ZEND_GET_MODULE(name) macro.
2000-05-02 00:30:36 +00:00
Sterling Hughes 95310ad5e0 Make swf_nextid() return a value. 2000-05-02 00:24:18 +00:00
Sascha Schumann 7613e064f8 Remove trailing empty lines 2000-05-01 22:38:42 +00:00
Sascha Schumann 7a2d83acdc Source file does not end with a newline. Some old compilers don't like that. 2000-05-01 22:36:10 +00:00
Rasmus Lerdorf 0628b33278 Never mind on the error check 2000-05-01 22:14:54 +00:00
Sascha Schumann 0d36199cf9 Large test commit IV 2000-05-01 22:04:52 +00:00
Sascha Schumann de2cea47c0 Large commit test III 2000-05-01 22:00:09 +00:00
Sascha Schumann a493cdc92c Large test commit II 2000-05-01 21:57:01 +00:00
Sascha Schumann fc4b7bac9c Large test commit I 2000-05-01 21:55:45 +00:00
Sascha Schumann 358bdc8832 Make posix module buildable as shared module 2000-05-01 21:36:52 +00:00
Sascha Schumann 1e3d94b70b Revamp config stuff 2000-05-01 21:32:26 +00:00
Sascha Schumann 15c8fa99fb . 2000-05-01 21:10:08 +00:00
Rasmus Lerdorf 83f567abf3 Dynamically allocate points for ImagePolygon (Marc Pohl)
@Dynamically allocate points for ImagePolygon (Marc Pohl)
2000-05-01 18:56:58 +00:00
Sascha Schumann 113b87736b Use GCC's --print-libgcc-file-name flag to find libgcc's path.
Obtained from: mod_ssl
2000-05-01 18:32:09 +00:00
Andrei Zmievski 5da6bf51a4 It's nice to keep them alphabetized. 2000-05-01 17:58:39 +00:00
Andrei Zmievski 0825ae458d Nother entry. 2000-05-01 16:39:05 +00:00
Andrei Zmievski 164e4e50b9 Added a way to get all declared classes. 2000-05-01 16:22:00 +00:00
Andrei Zmievski e20cdc315e New function. 2000-05-01 15:19:17 +00:00
Andrei Zmievski 660fcd93e0 Fix attribution. 2000-05-01 12:15:29 +00:00
Sascha Schumann 1743bb0346 Fix dependency 2000-05-01 05:46:02 +00:00
Frank M. Kromann b19376c6f5 oops wrong settings commited in project. 2000-05-01 05:42:33 +00:00
Frank M. Kromann dd537aaaa6 adding calendar project 2000-05-01 05:41:38 +00:00
Joey Smith 564f9795f8 Small fix: Description still referred to package as PHP3. 2000-05-01 04:49:49 +00:00
Sascha Schumann 632b054aba Remove white-space, breaks UnixWare make 2000-05-01 04:41:16 +00:00
Joey Smith b2266104b1 Forgot to mention: Added configure time checking for bcmath package. (Thanks, Sascha!)
@ Added configure time checking for bcmath package
2000-05-01 04:02:43 +00:00
Joey Smith c07dcd1b8d There was already a perfectly good README-BCMATH, I just found the different naming confusing. 2000-05-01 03:59:55 +00:00
Joey Smith b64e872e84 Shut up CVS 2000-05-01 03:44:24 +00:00
Sascha Schumann c801cfb879 php_reentrancy.h is needed for strtok_r 2000-05-01 03:43:07 +00:00
Sascha Schumann ea90eab146 Ignore standard files 2000-05-01 03:27:11 +00:00
Sascha Schumann 9595fb76f3 Rebuild xml, if libexpat changed. 2000-05-01 03:10:01 +00:00
Sascha Schumann 52b1e3482d Link expat into static and shared module. 2000-05-01 02:58:26 +00:00
Sascha Schumann 1d4e698aca Copy dynlib.mk to the build directory. 2000-05-01 02:57:50 +00:00
Sascha Schumann e2905f1b5c Get rid of old cruft. Broke build on Irix. 2000-05-01 02:57:24 +00:00
Sascha Schumann a481fddfb3 Improved in-tree shared libraries build system
The following new/revived shared modules are available now:

  ... MySQL (*)
  ... PCRE (*)
  ... Session
  ... SWF

  (*) capable of using bundled library or external library

All changes:

  The m4 macro PHP_EXTENSION was revamped. Uses LIB_BUILD now.
  This effectively means that all extensions have to use dynlib.

  ext/mysql/config.m4 was revamped.
  Uses LIB_BUILD for building bundled library.

  ext/pcre/config.m4 was revamped.
  Uses LIB_BUILD for building bundled library.

  ext/ext_skel was changed to reflect that more modules should be
  compileable as shared module.

  ext/Makefile.in has been simplified enormously.

  Dependencies are now stored in the build tree.

  Empty dependencies are not generated by buildconf anymore. They
  are now dynamically created during the build process.

  Implicit rules for .S were removed.

  The NO_RECURSION feature was removed.

  "libs.mk" has been added to all cvsignore files in ext.
2000-05-01 02:42:55 +00:00
ce38236221 ChangeLog update 2000-05-01 01:09:14 +00:00
b05bd34af5 NEWS update 2000-05-01 01:09:11 +00:00
Sterling Hughes 5c8abc75af Added info about the swf module
# Is this how should the entry should be?
2000-05-01 00:58:19 +00:00
Sterling Hughes 1191f6bf7c Allow the SWF module to compile as a dl. 2000-04-30 23:57:20 +00:00
Sterling Hughes b93e5ecbe0 Proto's and the such. 2000-04-30 23:42:33 +00:00
Sascha Schumann ca4147055a Ignore standard files 2000-04-30 20:03:26 +00:00
Andi Gutmans 5d5b09e1a7 - Change some open's to V_OPEN()'s 2000-04-30 19:01:17 +00:00
Sterling Hughes 1f64d98753 Add LibSWF support to PHP, will be sending an e-mail on the files and
uses shortly.
2000-04-30 19:00:05 +00:00
Rasmus Lerdorf a3c17cf766 Add initial NSAPI module from Jayakumar Muthukumarasamy
@Add initial NSAPI module from Jayakumar Muthukumarasamy
2000-04-30 17:28:24 +00:00
Andi Gutmans e13285ded7 - Take Sascha's advice and create on V_OPEN() which replaces open().
- Unlike the other macros its argument has to have braces around it, for
- example, open(filename, flags) becomse V_OPEN((filename, flags))
- Made small conversion to new Zend macros. The ugly (*foo)->value.str.val
- now becomes Z_STRVAL_PP(foo). PP means pointer pointer, there also exist
- single P's for example foo->value.str.val becomes Z_STRVAL_P(foo).
2000-04-30 16:32:36 +00:00
Jouni Ahto 8e7a5098dd Debian 2.2 puts rfc822.h in /usr/include/c-client, check that place too. 2000-04-30 16:10:29 +00:00
Jouni Ahto 06e6094a53 # Changes modules current status 2000-04-30 05:48:40 +00:00
Jouni Ahto 430bfdd878 Moving module to the high-performance API & fixing it for PHP4. 2000-04-30 05:46:04 +00:00
Shane Caraveo 0fc8ff61b2 zeroing the variables fixes one crash...now crashes on memory allocation during zend_compile_files 2000-04-30 04:56:48 +00:00
Sascha Schumann b87df8f210 Add UnixWare/OpenServer flags 2000-04-30 04:50:03 +00:00
Shane Caraveo c7e2d8ef35 sorry, do comments right 2000-04-30 04:21:52 +00:00
Shane Caraveo 8d3ce80f48 apache module now compiles under win32, apache loads, but crashes on line 1167 main.c on page request 2000-04-30 04:15:26 +00:00
Sascha Schumann 953fe189da Overall UNIX build system improvements:
* Makefile header is now completely dynamic
* Absolute paths in (top_)?(src|build)dir and VPATH
  (fixes Tru64 support)
* VPATH does not contain variables anymore
  (fixes UnixWare support)
2000-04-30 03:20:09 +00:00
Sascha Schumann 952f58b66d (The first part of this commit died with a SIGPIPE from the CVS server.)
Overall UNIX build system improvements:

* Makefile header is now completely dynamic
* Absolute paths in (top_)?(src|build)dir and VPATH
  (fixes Tru64 support)
* VPATH does not contain variables anymore
  (fixes UnixWare support)
2000-04-30 03:12:38 +00:00
Sascha Schumann 8d19edc495 Overall UNIX build system improvements:
* Makefile header is now completely dynamic
* Absolute paths in (top_)?(src|build)dir and VPATH
  (fixes Tru64 support)
* VPATH does not contain variables anymore
  (fixes UnixWare support)
2000-04-30 03:10:34 +00:00
Sascha Schumann be00d130e6 Fix virtual_open() by adding ellipse 2000-04-30 03:06:00 +00:00
ace102eb00 ChangeLog update 2000-04-30 01:09:09 +00:00
9fa7428cf5 NEWS update 2000-04-30 01:09:06 +00:00
Andi Gutmans f1d5167ae3 - Implement V_OPEN() V_OPEN_CREAT() and V_CREAT().
Next step is to substitute all open()'s and creat()'s in the PHP tree
2000-04-29 19:01:58 +00:00
Andrei Zmievski 9e9ba7d974 @ Updated natural comparison/sorting algorithm by Martin Pool
@ <mbp@humbug.org.au>. (Andrei)

Martin Pool updated the natural comparison/sort algorithm so that fractions
compare more "naturally", e.g. 1.002 < 1.1.
2000-04-29 18:57:06 +00:00
Zeev Suraski 1a8683f976 - Never mind. Seems like we're still missing the open() functionality 2000-04-29 17:57:47 +00:00
Zeev Suraski aecae7c3af - Give VIRTUAL_DIR another try after testing it extensively on our web site 2000-04-29 17:51:28 +00:00
Rasmus Lerdorf e404a471e7 Oops, wrong path 2000-04-29 16:16:31 +00:00
Rasmus Lerdorf e3dd0a28ce An empty .deps was not getting generated here 2000-04-29 16:14:17 +00:00
Zeev Suraski 5ef03c4ff8 Pass the op_array to the ctor/dtor, instead of just the resource 2000-04-29 11:55:20 +00:00
Zeev Suraski 96c648c9f7 crash fix 2000-04-29 10:34:03 +00:00
Zeev Suraski 8aac6e7d3d - Add zend_llist_apply_with_arguments()
- Add a message handler to the extensions
2000-04-29 10:20:40 +00:00
Thies C. Arntzen 0118f62195 . 2000-04-29 09:21:57 +00:00
Zeev Suraski 42d15298d7 Fix possible bug with extension dtors being called without the ctors being called first 2000-04-29 02:56:44 +00:00
Zeev Suraski e0a48fe623 Beautify 2000-04-29 01:30:17 +00:00
32ffe0ba6f ChangeLog update 2000-04-29 01:09:15 +00:00
1152b4c29e NEWS update 2000-04-29 01:09:12 +00:00
Sascha Schumann 58eaa24a90 Improve imap-lib check 2000-04-28 17:13:50 +00:00
Hartmut Holzgraefe 5c5ccc9844 no more broken scripts by erroneously terminating header()'s argument
with a CR-LF
2000-04-28 16:47:19 +00:00
Zeev Suraski ddbcbb666d Fix a bug in the resource dispencer 2000-04-28 15:52:02 +00:00
Ted Rolle Jr b7f2d80a28 Removed bug that prevented it to work on longer strings.
Changed commenting to c-style commenting.
2000-04-28 14:24:38 +00:00
Andrei Zmievski 105be1513d Fix an empty arrays condition and optimize a bit.
@ Fixed a crash in array_multisort() that happened when empty arrays
@ were passed to it. (Andrei)
2000-04-28 14:01:08 +00:00
Zeev Suraski ddc36fb776 Make convert_to_string() allocations traceable 2000-04-28 13:31:51 +00:00
Zeev Suraski 3220bb570e - Fix an invalid trick (it was valid when header() was using
zend_get_parameters(), but it became invalid when someone switched it
  to zend_get_parameters_ex(), and I decided to remove it anyway).
- Remove a redundant function call
2000-04-28 13:03:13 +00:00
Andrei Zmievski 5369a7b7b4 Fix up. 2000-04-28 12:40:42 +00:00
Thies C. Arntzen b9387791a8 (php_module_startup) is now doing setlocale(LC_ALL, "") instead of just setlocale(LC_CTYPE, ""). suggested by Jon Forsberg <zzed@cyberdude.com>
# this change simply seems "right" as setlocale(LC_ALL, "") also happens in RSHUTDOWN(basic)
2000-04-28 11:09:57 +00:00
Thies C. Arntzen 563c97cf82 . 2000-04-28 11:04:35 +00:00
Thies C. Arntzen ea9be8b88b compile fix 2000-04-28 10:37:17 +00:00
Thies C. Arntzen 83ce0793a7 no longer needed 2000-04-28 10:10:57 +00:00
cdb7471c36 ChangeLog update 2000-04-28 01:09:12 +00:00
Zeev Suraski 974671eced *** empty log message *** 2000-04-27 21:48:47 +00:00
Zeev Suraski 4b6594c5e9 Change to using the #define's 2000-04-27 21:26:17 +00:00
Zeev Suraski dc8980bab2 Change to using macros 2000-04-27 20:22:40 +00:00
Zeev Suraski b80b8381d4 More error handling work (still completely disabled) 2000-04-27 19:38:11 +00:00
Zeev Suraski 39aa59bdec More error handling work (still completely disabled) 2000-04-27 18:37:02 +00:00
Joey Smith 095f1d91b1 Please, no more bug reports about bcmath 2000-04-27 16:08:36 +00:00
Andrei Zmievski 3b77fd37a9 TODO update and fix for C++ comments. 2000-04-27 14:41:18 +00:00
Thies C. Arntzen 0c46488147 using vi to update DevStudio Files, yeah! 2000-04-27 14:33:53 +00:00
Thies C. Arntzen 6f08c178b9 . 2000-04-27 14:32:58 +00:00
Thies C. Arntzen 6ccea93d6b allow oci8 to be build as loadable module. 2000-04-27 14:29:11 +00:00
d8b6163f96 ChangeLog update 2000-04-27 01:09:15 +00:00
59ec1bdefb NEWS update 2000-04-27 01:09:12 +00:00
Zeev Suraski fa7c418b79 Fix - forgot to split away if refcount>1 2000-04-26 22:10:06 +00:00
Sterling Hughes 68e54e9922 Small proto fix. 2000-04-26 01:16:57 +00:00
Andrei Zmievski 5c5ec88292 @Added substr_count() from Peter Kovacs. (Andrei)
# also some todo stuff
2000-04-26 00:29:59 +00:00
Zeev Suraski 94a724f686 Fix bug 2000-04-25 14:20:52 +00:00
Zeev Suraski a20e90abb3 We'll need two... 2000-04-25 10:44:50 +00:00
Zeev Suraski 0a14a32c78 Add useful macros 2000-04-25 10:10:44 +00:00
Andi Gutmans 382653aebc - Fix persistence of llist 2000-04-25 09:45:58 +00:00
bc220aa000 ChangeLog update 2000-04-25 01:09:12 +00:00
Andrew Skalski fc0813f11a * typecast fs_give parameter to void**
* removed wide-character treatment from imap_utf7_encode
* suggestion to #include "linkage.c" rather than link in auth/mail drivers
  manually
2000-04-24 22:21:34 +00:00
Zeev Suraski e16c38b3f5 - Forgot to keep the ':' in the class_name 2000-04-24 22:13:08 +00:00
Zeev Suraski b992f02935 - Get rid of newly introduced warning 2000-04-24 17:35:27 +00:00
Thies C. Arntzen 232bcff77e . 2000-04-24 16:46:56 +00:00
Zeev Suraski 9d2738cf1d - Fix crash bug in localtime_r. If locatime() returns NULL then also return
NULL
2000-04-24 16:16:45 +00:00
Zeev Suraski dc93a62cbb Correct fix 2000-04-24 16:04:13 +00:00
Thies C. Arntzen 9786e4450a MODULE_TEMPORARY should get a call to RSHUTDOWN as well! 2000-04-24 15:49:23 +00:00
Thies C. Arntzen 2a17453e42 RINIT was called twice for modules loaded vi php.ini 2000-04-24 15:40:07 +00:00
Andrei Zmievski ec997d5c5b Exterminate warnings. 2000-04-24 14:19:21 +00:00
Andrei Zmievski 071c01a019 The third argument to fseek() is now one of the standard SEEK_* constants.
# The previous change to support seekfrom stuff was incorrect.
2000-04-24 14:18:11 +00:00
Thies C. Arntzen f4c9d96f2e fixed shutdown crash if MSHUTDOWN tries to php_error() something. 2000-04-24 12:47:07 +00:00
Thies C. Arntzen b73919eb50 enabel PDB 2000-04-24 12:36:01 +00:00
Thies C. Arntzen 57c20bf836 fix warning 2000-04-24 12:35:30 +00:00
a6face98c8 ChangeLog update 2000-04-24 01:09:16 +00:00
8cf5a64885 NEWS update 2000-04-24 01:09:13 +00:00
Sterling Hughes e5df341868 TODO:
Just did that.
PEAR:
  Fix typo
2000-04-23 19:19:56 +00:00
Sterling Hughes 21416083b1 @-Add an optional third argument to fseek to indicate were to seek from. (Sterling) 2000-04-23 19:16:24 +00:00
Frank M. Kromann e297737cb1 Moving output files to common folder 2000-04-23 10:59:20 +00:00
Frank M. Kromann 7c9435e741 Removing invalid readme file 2000-04-23 10:54:44 +00:00
Frank M. Kromann 662280560f moving pointers to header and library files to match php_build structure 2000-04-23 10:52:49 +00:00
Frank M. Kromann ed699b4263 adding project file for mcrypt module 2000-04-23 08:08:40 +00:00
Sterling Hughes 645156918c Add a new directory for File (it was supposed to be there
in the first place).
2000-04-23 04:47:45 +00:00
5a7c8f46c9 ChangeLog update 2000-04-23 01:09:13 +00:00
Chuck Hagenbuch 4b78e0aca6 back off from high-performance api in imap_rfc822_parse_adrlist. if you
called it twice on the same string, there were _strange_ side effects. This
may be slower, but it works.
2000-04-22 20:54:07 +00:00
Andi Gutmans 5da62dd57e - In Windows RAND_MAX is defined in stdlib.h
- Get rid of comment which is confusing.
2000-04-22 15:44:35 +00:00
Andi Gutmans 44908999a8 - Hopefully fix mt_rand() functions under Windows. This patch will effect
all platforms so I hope it's OK.
2000-04-22 15:40:23 +00:00
f9cdcc583c ChangeLog update 2000-04-22 01:09:13 +00:00
df96f5f8d5 NEWS update 2000-04-22 01:09:10 +00:00
Thies C. Arntzen 1651fbff64 add VDIR info 2000-04-21 16:20:11 +00:00
Thies C. Arntzen 75a00321c3 add oracle and oci8 2000-04-21 15:10:01 +00:00
Thies C. Arntzen 4f5f93efa1 . 2000-04-21 15:04:55 +00:00
Thies C. Arntzen 5132321c3e oracle compiles now on win32 - untested! 2000-04-21 15:04:41 +00:00
Thies C. Arntzen 0e2ac7d992 *** empty log message *** 2000-04-21 14:54:44 +00:00
Zeev Suraski 972ef3f31b - Missed second argument 2000-04-21 14:50:09 +00:00
Andi Gutmans dd05651046 - Fix last fix for Windows 2000-04-21 14:46:24 +00:00
Thies C. Arntzen eb786dc055 make it compile on Win32 2000-04-21 14:45:27 +00:00
Thies C. Arntzen 80486c95be export zval_add-ref and zvale_del_ref 2000-04-21 14:45:10 +00:00
Andi Gutmans 36faff14b1 - Small fix to virtual_Chdir_file() to include the trailing slash when
the file is in the root directory.
2000-04-21 14:42:20 +00:00
Frank M. Kromann 12e319b091 Moving output modules 2000-04-21 12:26:42 +00:00
Frank M. Kromann 91f1f7d3c3 Adding a short WIN32_HOWTO and moving library and header files to php_build 2000-04-21 12:21:47 +00:00
Thies C. Arntzen b27718ff00 @- OCIBindByName() will no longer complain about bindlength beeing zero. (Thies) 2000-04-21 09:54:15 +00:00
Rasmus Lerdorf 4789127d27 createfrom* fixes 2000-04-21 02:23:16 +00:00
5c366e4e52 ChangeLog update 2000-04-21 01:09:08 +00:00
Zeev Suraski ca10d9b2de Compile fixes 2000-04-20 23:35:28 +00:00
Zeev Suraski 389eca0c1b Add .txt files to .dsp's 2000-04-20 23:26:06 +00:00
Zeev Suraski 18c44ad873 Another consistency fix 2000-04-20 23:23:36 +00:00
Zeev Suraski a2984a5d50 Consistency fix 2000-04-20 23:23:02 +00:00
Zeev Suraski 0b8369196b A few .dsp fixes 2000-04-20 22:52:37 +00:00
Andi Gutmans 4928f63821 - Change a getcwd() 2000-04-20 21:07:39 +00:00
Frank M. Kromann 94d46c4fbc Adding Java project to modules workspace 2000-04-20 18:40:17 +00:00
Frank M. Kromann a1c480154a Adding ftp project to modules workspace 2000-04-20 18:31:50 +00:00
Andi Gutmans c0919bbd41 - virtual_lstat() doesn't exist on Windows. 2000-04-20 17:58:25 +00:00
Frank M. Kromann 46a7a05d57 Adding project file for ftp module on Win32 2000-04-20 17:49:26 +00:00
Zeev Suraski 50a93b5678 Remove strlcpy from the zlib project 2000-04-20 17:49:04 +00:00
Zeev Suraski 64c974e8b6 - Add the zlib project to the php_modules workspace, and fix it's C-runtime definitions
- Move IMAP to the high performance API
2000-04-20 17:48:22 +00:00
Frank M. Kromann 5f8e4c0474 Adding strlcpy to makefile 2000-04-20 17:41:18 +00:00
Andi Gutmans 503bb3bedb - Export strlcat()/strcpy() for Frank.
- Windows doesn't have lstat().
2000-04-20 17:40:03 +00:00
Zeev Suraski 883bd2b1de - Fix virtual cwd bug
- Add more V_STAT() V_LSTAT() changes
2000-04-20 17:24:01 +00:00
Frank M. Kromann 7412bd5c84 Making zlib compile under Win32 and fixing a typo 2000-04-20 16:59:55 +00:00
Andi Gutmans e40268d07c - Add missing V_STAT() 2000-04-20 16:38:08 +00:00
Frank M. Kromann ba37ae2c0b Fixing init problem for Zval's in mssql_query 2000-04-20 15:49:56 +00:00
Sascha Schumann dec71471df New style 2000-04-20 15:13:29 +00:00
Sascha Schumann e223693d0c Do not enable GD, if --without-gd was used 2000-04-20 14:59:59 +00:00
Zeev Suraski 9e10ac5b1d - Change macro names from Z to Z_ 2000-04-20 14:55:16 +00:00
Zeev Suraski 149c7f2a8a - CHange macro names from Z to Z_ 2000-04-20 14:52:54 +00:00
Zeev Suraski 9022a4bdbd Add some macros for nicer zval handling 2000-04-20 14:32:39 +00:00
Zeev Suraski a918842f30 Fix, beautify and convert the IMAP module to the high performance API 2000-04-20 14:23:35 +00:00
Andrei Zmievski bbe0df125e Do proper ieeefp.h check. 2000-04-20 13:49:07 +00:00
Andrei Zmievski 70b2013f9e Check for ieeefp.h. 2000-04-20 13:47:15 +00:00
Andi Gutmans 9aba6a94d3 - Another PHP_WIN32 patch 2000-04-20 13:43:48 +00:00
Andi Gutmans f9e9cab7ac - Change to PHP_WIN32 2000-04-20 13:23:19 +00:00
Thies C. Arntzen 0540bbe5af improve fix 2000-04-20 07:35:22 +00:00
Thies C. Arntzen c1c8422dbf compile before commit! compile before commit! compile before commit! 2000-04-20 07:24:56 +00:00
Thies C. Arntzen 2b3a575ab3 revert andrei's path (i can't compile anymore on linux)
we're always using #ifndef HAVE_BLA instead of if !HAVE_BLA and if we need ieeefp.h for some weird platform (which one is that?) we need an autoconf check for it.
2000-04-20 07:23:55 +00:00
a9755246c3 ChangeLog update 2000-04-20 01:09:15 +00:00
46d61dd857 NEWS update 2000-04-20 01:09:12 +00:00
Zeev Suraski ac8e7b96f4 Fix Win32 compilation. Hillarious April 1st joke! 2000-04-19 23:46:26 +00:00
Colin Viebrock 7ecf70047b *** empty log message *** 2000-04-19 23:18:15 +00:00
Colin Viebrock 900aae165e A little easter egg for April 1st ... :) 2000-04-19 23:17:02 +00:00
Andrei Zmievski eea8ae4fd1 Modified entry. 2000-04-19 18:38:01 +00:00
Andrei Zmievski a15b08a709 Just a type cast is sufficient. 2000-04-19 18:36:50 +00:00
Frank M. Kromann 429cf808e6 SIGPIPE is unknown on WIN32 platforms 2000-04-19 17:28:23 +00:00
Andrei Zmievski fe1147b01a Include proper files for finite. 2000-04-19 15:55:52 +00:00
Andrei Zmievski 284b0ae24e Make ext/calendar optional. 2000-04-19 15:53:09 +00:00
Thies C. Arntzen 19a9577901 ignore SIGPIPE in standalone-mode so that one can actually use fsockopen() *and* have the remote side close the socket whithout PHP dying! 2000-04-19 15:37:43 +00:00
Zeev Suraski a81e6bc04e author fixes 2000-04-19 15:21:22 +00:00
Zeev Suraski 708811184d Improve performance of the PHP_SELF registration under ISAPI 2000-04-19 15:15:33 +00:00
Zeev Suraski 9cbcade6c9 Support E_USER_* error types 2000-04-19 15:10:14 +00:00
Zeev Suraski 67f6974373 Initial support for trapping errors (not complete and disabled; will be enabled only
post-PHP 4.0.0)
2000-04-19 15:08:06 +00:00
Andrei Zmievski fae56aee27 Some fixes. 2000-04-19 14:59:02 +00:00
Andrei Zmievski 6f88327a12 Fix attribution 2000-04-19 14:50:19 +00:00
Zeev Suraski c31f6fbd90 Kill warning 2000-04-19 13:18:01 +00:00
Zeev Suraski 963d31198a Fix a couple of _ex()'s 2000-04-19 13:15:57 +00:00
Zeev Suraski a51d3058f7 - Renamed get_used_files() to get_required_files() for consistency
- Documented some functions
- Added user-level warning messages
- Added user_error()
2000-04-19 13:15:13 +00:00
Rasmus Lerdorf 03b562c93e fgetcsv() patch from Nick Talbott
@ The fgetcsv() function now handles embedded end-of-line in a quoted field
@ (Nick Talbott)
2000-04-19 13:03:47 +00:00
Zeev Suraski a81a1c7a1a phpcredits() update. 2000-04-19 12:43:54 +00:00
Andi Gutmans 207167c54b - Export pass_include() for Windows 2000-04-19 08:17:34 +00:00
61792f9cc5 ChangeLog update 2000-04-19 01:09:09 +00:00
2ad8fc6281 NEWS update 2000-04-19 01:09:06 +00:00
Evan Klinger d6c66f3b7c @- Fixed long2ip() to return the correct IP address. (Evan)
# ip2long() is still broken.
2000-04-18 22:50:24 +00:00
Zeev Suraski d191777b3f Add convert_to_writable_*_ex() macros (unused at this time) 2000-04-18 22:23:28 +00:00
Zeev Suraski 02f7ee57f7 - Fix many memory leaks in the IMAP module
- Begin migrating to the high performance API
2000-04-18 22:22:48 +00:00
Egon Schmid f1c268d79a Corrected some protos. 2000-04-18 20:00:21 +00:00
Zeev Suraski 43e04d5a77 indent/beautify 2000-04-18 19:42:22 +00:00
Zeev Suraski c007a7232d Document the ob_*() functions 2000-04-18 19:18:47 +00:00
Jouni Ahto 39b4163bfb # Document module status 2000-04-18 02:58:25 +00:00
Jouni Ahto 1dc32c2d52 # Reaching alpha status with this module... 2000-04-18 02:52:45 +00:00
ae6b0ea03f ChangeLog update 2000-04-18 01:09:12 +00:00
Frank M. Kromann d5bfb21f2f minor optimization 2000-04-17 19:54:50 +00:00
Andrew Skalski 0a3482f213 fixed imap quota/relogin compilation errors 2000-04-17 19:28:58 +00:00
Egon Schmid 830715a6d7 Have forgotten myself. 2000-04-17 18:57:40 +00:00
Andi Gutmans 4f15966d1b - Fix order of JMPZNZ arguments 2000-04-17 17:16:47 +00:00
Thies C. Arntzen 44e0d27685 ups, finite is already a macro on Win32 2000-04-17 13:25:16 +00:00
Thies C. Arntzen 297ca5c08a shut up CVS! 2000-04-17 11:51:26 +00:00
Stig Bakken df77365d29 ignore stuff 2000-04-17 11:23:18 +00:00
Thies C. Arntzen 8367275477 HPUX11 only has isfinite() 2000-04-17 10:39:13 +00:00
Hartmut Holzgraefe 0b91e2fcd3 initial checkin 2000-04-17 09:44:49 +00:00
2b36f579f1 ChangeLog update 2000-04-17 01:09:12 +00:00
Andrei Zmievski 544b65493e This doesn't belong in NEWS. 2000-04-16 19:34:10 +00:00
Sascha Schumann 93135c8b32 Undefine HAVE_*_R, so that we get our replacements 2000-04-16 16:32:51 +00:00
Nick Gorham 1b7bfe5bbf Removed unnecessary FAR's (I am assuming we don't need to work under
16 bit windows). They break several ODBC builds.
2000-04-16 16:16:59 +00:00
Egon Schmid d39724c536 The comma is also optional. 2000-04-16 16:02:31 +00:00
Rasmus Lerdorf 8b1b39b5b5 Move this check to the main configure.in file. Fixes #3979 2000-04-16 15:44:04 +00:00
Sascha Schumann e519d9ca6c Updates 2000-04-16 13:44:38 +00:00
Hartmut Holzgraefe 0866fef791 added unixtojd() and jdtounix() to convert from unix time_t to
Julian Days and vice versa
2000-04-16 11:40:19 +00:00
4e1f9412cf ChangeLog update 2000-04-16 01:09:15 +00:00
58e1d9ddd6 NEWS update 2000-04-16 01:09:12 +00:00
Hartmut Holzgraefe 3bc8debefe made calendar a real extension instead of a dl one only 2000-04-15 20:35:09 +00:00
Frank M. Kromann 3ee4f3ea7e Adding mssql to modules 2000-04-15 19:42:27 +00:00
Frank M. Kromann 9e601aaea7 Fixing compilation errors in MSSQL module 2000-04-15 19:30:45 +00:00
Frank M. Kromann 2e2642cfb3 Adding $PHP_SELF variable for compatibility with other platforms 2000-04-15 19:20:43 +00:00
Sascha Schumann d748c0827d SECTION is not defined in info.h anymore 2000-04-15 17:41:25 +00:00
Sascha Schumann 5d72b491c3 Support install directories other than srcdir/root 2000-04-15 17:41:02 +00:00
Sascha Schumann b128f39837 Add documentation on how to install PHP in AOLserver 2000-04-15 17:40:39 +00:00
Thies C. Arntzen 38c2b8ec63 hpux needs _REENTRANT 2000-04-15 17:06:21 +00:00
Andi Gutmans 5097f64256 - Fix leak in require_once() 2000-04-15 17:02:42 +00:00
Thies C. Arntzen a1608562ae fixes compile on platforms without dl() support.
#i think zend_register_extension should be declared static
2000-04-15 15:32:32 +00:00
Andi Gutmans b8fd674453 - PHP_FOPEN -> V_FOPEN 2000-04-15 14:37:28 +00:00
Zeev Suraski f0c7e0275f Remove unnecessary argument 2000-04-15 14:30:18 +00:00
Andi Gutmans c9911a151e - Change PHP_ to V_ (directory & file functions) 2000-04-15 14:28:48 +00:00
Andi Gutmans 1665cba750 - Change PHP_ to V_ (directory & file functions) 2000-04-15 14:20:01 +00:00
Zeev Suraski 603d5ff5d8 Fix ZTS 2000-04-15 14:17:18 +00:00
Andi Gutmans 938598b8d2 @ "use" is not yet supported; instead use include_once() or require_once()
@  for the time being (Andi, Zend library)
2000-04-15 13:56:09 +00:00
Andi Gutmans f2ff9eeef5 @ Fix bug in number_format (Jon Forsberg) 2000-04-15 13:53:32 +00:00
Zeev Suraski 81138a641a Forgot to commit the php4 fixes 2000-04-15 13:53:20 +00:00
Zeev Suraski 4cb9a483d2 - Clean up resource lists namespace
- Prepare extended resource list destructor APIs (currently unused)
2000-04-15 13:02:22 +00:00
Danny Heijl 53263049d2 - fix Win32 Release_TS build of Informix driver (danny). 2000-04-15 12:54:07 +00:00
689094634e ChangeLog update 2000-04-15 01:09:12 +00:00
a92fde9736 NEWS update 2000-04-15 01:09:09 +00:00
Egon Schmid 7b77b063a6 Small corrections. 2000-04-14 21:12:21 +00:00
3dae749f6f ChangeLog update 2000-04-14 20:53:21 +00:00
a5bb1466a3 NEWS update 2000-04-14 20:53:17 +00:00
Zeev Suraski b6b79a8d90 Add the documentation team to the credits page 2000-04-14 18:22:43 +00:00
Rasmus Lerdorf 6727342b7a Make error_prepend_string and error_append_string work
@Make error_prepend_string and error_append_string work
2000-04-14 14:00:32 +00:00
Rasmus Lerdorf 32a3c3987e Undo bogus commit 2000-04-14 13:40:27 +00:00
Rasmus Lerdorf 2acd0ad1fe I don't see why this should be gcc dependant and this fixes bugs 4140
and 4143
2000-04-14 13:14:30 +00:00
Andrei Zmievski 2206a9f7dd fseek() idea. 2000-04-13 19:43:56 +00:00
Sam Ruby a4016620bf Oops - remove debug statement 2000-04-13 19:05:01 +00:00
Sam Ruby 5424369f3a match changes to Tomcat example 2000-04-13 19:02:40 +00:00
Andrei Zmievski 9ffd5b5595 @- array_walk() now automatically resets the array. (Andrei) 2000-04-13 18:57:37 +00:00
Zeev Suraski aa6769dde2 - Make Windows builds build again
- Make non-gcc based platforms compile again
2000-04-13 16:08:49 +00:00
Zeev Suraski c6c261e922 Fix a memory leak when using assign-op bitwise operators on strings 2000-04-13 15:56:02 +00:00
Thies C. Arntzen 9f598b187c the asset call caused an undefined __eprintf here! 2000-04-13 13:04:02 +00:00
Martin Kraemer 06e504d32a Test for EBCDIC platform 2000-04-13 12:24:28 +00:00
Rasmus Lerdorf efabab1a34 Fix for bug #4125 2000-04-13 03:35:02 +00:00
David Hedbor 5f883ac86d - Fixed a couple of POST problems.
- Use virtual path functionality when available, to set the cwd of the
script to it's own directory prior to starting it.
- Fixed a bug in php_roxen_sapi_header_handler.
2000-04-12 22:59:46 +00:00
Andrei Zmievski bba955fd4f Claim some stuff. 2000-04-12 21:50:17 +00:00
Andrei Zmievski 25b95d2a97 Already done. 2000-04-12 20:41:52 +00:00
Andrei Zmievski c7100c4a1a Added natural comparison/sorting routines using code from Martin Pool.
@- Added natural comparison/sorting routines strnatcmp(), strnatcasecmp(),
@  natsort(), and natcasesort(). These are useful for comparing and sorting
@  strings that contain numbers. Based on the code from Martin Pool
@  <mbp@humbug.org.au>. See http://www.linuxcare.com.au/projects/natsort/
@  for more info on natural sorting. (Andrei)
2000-04-12 19:39:02 +00:00
Sam Ruby 5684953d59 make it compile on Win32 2000-04-12 18:18:49 +00:00
Thies C. Arntzen d337cbaae8 something with the @ commit stuff *is* broken. 2000-04-12 15:51:23 +00:00
Ben Mansell 67f867311b @- Zeus Webserver support (version 3.3.6+) for ISAPI 2000-04-12 09:48:26 +00:00
Zeev Suraski 021631d5eb *** empty log message *** 2000-04-12 00:50:21 +00:00
Andrei Zmievski da1cca03ae Re-add. 2000-04-11 18:40:47 +00:00
Andi Gutmans 804861c5ac - Fix memory leak 2000-04-11 18:16:58 +00:00
Andrei Zmievski c8e1057d1f One off the list. 2000-04-11 17:38:48 +00:00
Zeev Suraski d17e3d6b18 Fix warnings 2000-04-11 17:38:19 +00:00
Andrei Zmievski e39d70fff6 Added PCRE 3.01. 2000-04-11 17:36:06 +00:00
Andrei Zmievski beb6916cfc *** empty log message *** 2000-04-11 17:35:42 +00:00
Zeev Suraski 97c9603b02 Fix fd leak in include_once() 2000-04-11 17:30:37 +00:00
Andi Gutmans 7f54318897 - Turn off VIRTUAL_DIR by default 2000-04-11 17:00:21 +00:00
Andrei Zmievski a66283c7b9 another option 2000-04-11 15:16:49 +00:00
Sam Ruby 93f9fc77ad Eliminate warning if virtual cwd is specified 2000-04-11 00:30:33 +00:00
Zeev Suraski 8ec20a16ed Fix another missing opened_path assignment 2000-04-10 22:50:32 +00:00
Zeev Suraski 09ac924559 - Added support for reading properties that require arguments in the COM
module - writing to them will only be supported in PHP 4.1 (Zeev)
2000-04-10 21:54:15 +00:00
Zeev Suraski 578726ca2f indent 2000-04-10 21:32:19 +00:00
Zeev Suraski 38e458b86d *** empty log message *** 2000-04-10 21:25:09 +00:00
Andi Gutmans 73c6fbff7e - 2000-04-10 21:12:33 +00:00
Zeev Suraski e663d856b3 Fix object overloading support 2000-04-10 20:21:13 +00:00
Zeev Suraski 64f91d80fa Object overloading API changed slightly (llist is now a pointer) 2000-04-10 20:21:02 +00:00
Andi Gutmans c5d5c69bfe - Add warnings 2000-04-10 19:54:45 +00:00
Andi Gutmans cc0d6ac19c - Two more places needed changing 2000-04-10 18:24:38 +00:00
Zeev Suraski 232b90454f Clean up last/size definitions 2000-04-10 18:02:40 +00:00
Andi Gutmans 897b413c2d - Try and resolve the problem with current working directories not being
set to the script directory
2000-04-10 17:39:11 +00:00
Andi Gutmans c981be0bca - Don't need to extern functions
- Use virtual_file_ex() in expand_filepath()
2000-04-09 19:54:50 +00:00
Zeev Suraski 4cdcf638ce *** empty log message *** 2000-04-09 16:08:10 +00:00
Kristian Köhntopp 5b8c5bedac fixed unterminated string constant introduces by foreign patch. 2000-04-09 15:36:59 +00:00
Hartmut Holzgraefe 744fe82e0a added the other usefull constants besides M_PI from math.h
as PHP constants
2000-04-08 23:53:19 +00:00
Andi Gutmans 95f45d6c50 - Make all CVS users use the new virtual dir support.
Will probably disable this for the release.
2000-04-08 15:01:11 +00:00
Zeev Suraski 85e9d69f23 @- Fixed several problems with the PATH_TRANSLATED and PHP_SELF under Apache
@  (Paul Gregg & Zeev)
2000-04-08 11:16:19 +00:00
Sterling Hughes cd3305a2d1 @-Added ldap_get_values_len function from PHP3 to PHP4. (Sterling) 2000-04-07 23:20:22 +00:00
Zeev Suraski a0ba444959 Add a missing expand_filepath() 2000-04-07 22:10:04 +00:00
Zeev Suraski 1cf5c33627 Thoroughly fix include_once() 2000-04-07 22:03:46 +00:00
Zeev Suraski ed6e734047 Fix include_once() 2000-04-07 21:16:19 +00:00
Zeev Suraski 12aae5ab66 - Fix const declaratirs in virtual cwd
@- Fixed a problem in include_once() with non constant arguments (Andi & Zeev,
@  Zend Engine)
2000-04-07 21:16:08 +00:00
Zeev Suraski 83252f57b6 *** empty log message *** 2000-04-07 19:55:05 +00:00
Colin Viebrock 34ba0394cb recommended changes 2000-04-07 18:50:08 +00:00
Colin Viebrock adc5bbc925 last one ... promise 2000-04-07 17:09:18 +00:00
Colin Viebrock d02a351061 typo 2000-04-07 17:04:57 +00:00
Colin Viebrock 02c3eb2bd5 typo 2000-04-07 17:02:01 +00:00
Colin Viebrock 9130f05d08 prettying 2000-04-07 16:50:55 +00:00
Colin Viebrock 86cff779c3 *** empty log message *** 2000-04-07 16:46:59 +00:00
Colin Viebrock 5628b3f0ab more prettiness 2000-04-07 16:41:19 +00:00
Zeev Suraski 436ffa8a18 Unify 2000-04-07 15:30:47 +00:00
Ted Rolle Jr b251a4778d Removed some compiler warnings. 2000-04-07 15:07:56 +00:00
Zeev Suraski 982f4b525c @- Added php.ini-optimized (Zeev) 2000-04-07 14:55:53 +00:00
Andi Gutmans f118d94783 - This slipped in. Enable VIRTUAL_DIR when we're in ZTS. Eventually it
should always be enabled.
2000-04-07 10:26:28 +00:00
Andi Gutmans 89f99967b8 - Add wddx support to the default build 2000-04-07 10:21:17 +00:00
Chuck Hagenbuch 0fc483fed6 cleaning up some small off-by-one errors and argcount follies. Can someone
take a look at the errors imap_mime_header_decode() generates when
compiling? I took a quick look, but don't have time to puzzle through that
code.
2000-04-07 04:43:26 +00:00
Andi Gutmans 5c6bf64509 - ZEND_DEBUG is always defined 2000-04-06 22:54:33 +00:00
Colin Viebrock e4409a8556 phpinfo() pretying
That should be everything.
2000-04-06 21:17:50 +00:00
Colin Viebrock a7c8bfb9fb phpinfo() prettying 2000-04-06 21:07:44 +00:00
Andi Gutmans 56fc855afd *** empty log message *** 2000-04-06 17:39:52 +00:00
Colin Viebrock 4bd1af056e *** empty log message *** 2000-04-06 17:05:33 +00:00
Colin Viebrock 2cb6745cf0 a better way, i've been told (thanks) 2000-04-06 17:01:41 +00:00
Colin Viebrock 5115342c6e More phpinfo() prettying.
Can someone check my code for the interbase
support, and I need someone else to decode the LDAP stuff ... it's beyond
me.
2000-04-06 16:57:33 +00:00
Andi Gutmans a9159c2eec Initial preparation for OO overloading patch 2000-04-06 16:34:55 +00:00
Sterling Hughes 4766abb0e5 @- Added ldap_errno, ldap_err2str and ldap_error from PHP3 to PHP4. (Sterling) 2000-04-06 12:36:47 +00:00
Jakub Skopal ad0f9dbccb Corrected compilation error with wrong number of arguments to
php_info_print_box_start()
2000-04-06 12:26:16 +00:00
Colin Viebrock f133141bfb typo 2000-04-05 22:31:40 +00:00
Colin Viebrock 731404c0ba phpinfo() prettying
I will get to the rest of the functions later tonight or tomorrow
(i.e. from hyperwave to snmp)
2000-04-05 22:30:19 +00:00
Colin Viebrock 0c2b366ce1 phpinfo() prettying 2000-04-05 21:43:03 +00:00
Zeev Suraski 3ba4105fde Update the PHP logo 2000-04-05 21:41:38 +00:00
Andi Gutmans 4ee5cad9f9 - Bump up version number 2000-04-05 21:06:50 +00:00
Colin Viebrock f57d8a2c25 finally (thanks Andreas) 2000-04-05 21:03:30 +00:00
Colin Viebrock 1e344cf010 still cant get this 2000-04-05 21:00:35 +00:00
Andi Gutmans da3db3d864 - FIx JMPZNZ 2000-04-05 20:55:51 +00:00
Andi Gutmans 49a34c6811 - Not needed anymore 2000-04-05 20:50:57 +00:00
Andi Gutmans d7dc66bdbd - More fixes 2000-04-05 20:49:51 +00:00
Colin Viebrock 875ac538fb phpinfo() prettying 2000-04-05 20:48:46 +00:00
Andi Gutmans e3bbb4bc6c - Fix 2000-04-05 20:45:49 +00:00
Colin Viebrock fddd1201b4 phpinfo() prettying 2000-04-05 20:42:59 +00:00
Colin Viebrock 5e296bfe97 fixed the segfault problem (probably not the prettiest way, but) 2000-04-05 20:29:20 +00:00
Colin Viebrock 6882044a46 phpinfo() prettying 2000-04-05 20:18:58 +00:00
Colin Viebrock 1ddc9ff852 Prettying up the output of phpinfo(). Someone has to tell me how
to get a new .gif logo in there, and why the ZEND_DEBUG output is
causing seg faults.

I also need to go through all the modules and fix up the output they
create.
2000-04-05 20:17:02 +00:00
Zeev Suraski 794f312176 Fix a problem with the virtual directory mechanism (corruption of the filenames to open) 2000-04-05 19:02:28 +00:00
Zeev Suraski 7c70003d22 The ISAPI module was incompatible with the CGI fix, which ruined POST's 2000-04-05 18:06:13 +00:00
Sam Ruby 8372b2baf1 fix typo: wrong variable name 2000-04-05 12:15:57 +00:00
Sam Ruby c56888da7c look for Tomcat binaries too 2000-04-05 09:47:34 +00:00
Sam Ruby eb70d8361b Make it clear that the jawt example is only intented to be run as a CGI 2000-04-05 09:21:19 +00:00
Sam Ruby 5c40dfa374 Define PHP_SELF in sapi/servlet.
Reported by Lim Swee Tat <limst@ncscom.sg>
2000-04-05 09:06:05 +00:00
Sam Ruby f55b70e764 Windows build: xmltok is needed by wddx 2000-04-04 22:42:47 +00:00
Sam Ruby 7a6dddcc0b Make MySLS_FETCH use the same globals ID as ZEND_INIT_MODULE_GLOBALS 2000-04-04 20:10:11 +00:00
Andi Gutmans 2a15b85ca1 - One more fopen -> PHP_FOPEN patch 2000-04-04 20:06:45 +00:00
Chuck Hagenbuch 44e178e089 return false after determining that a message number is bad, instead of
going on to crash.
2000-04-04 18:10:24 +00:00
Andrei Zmievski ebce1ad787 Additional check for IS_OBJECT. 2000-04-04 16:41:13 +00:00
Uwe Steinmann db160e8164 - should fix a problem with ifdef 2000-04-04 16:03:39 +00:00
Thies C. Arntzen b491796a4c @- WDDX now defaults to ISO-8859-1. (Thies)
# andrei, plz have a look at my changes - seems to work for me!
2000-04-04 15:47:11 +00:00
Thies C. Arntzen 1fc8733dbf export xml_utf8_decode for wddx module 2000-04-04 15:42:05 +00:00
Thies C. Arntzen 6e2bf336f6 (var_dump) cleaned up some weird & buggy stuff 2000-04-04 15:14:23 +00:00
Uwe Steinmann 14e457d374 - all functions returning a list of object record should be faster now
and require less accesses on the server
2000-04-04 13:35:07 +00:00
Thies C. Arntzen 32aa845957 forgot @ thingie 2000-04-04 11:52:03 +00:00
Thies C. Arntzen 38cb3de2bc buffer was short by one 2000-04-04 11:35:01 +00:00
Egon Schmid 3e2a1034cb Return type was missing. 2000-04-04 08:52:57 +00:00
Chuck Hagenbuch d437ba9071 tweaks to prototypes 2000-04-04 02:56:42 +00:00
Chuck Hagenbuch 8153dc5772 update function protos. should all be there now 2000-04-04 00:51:38 +00:00
Chuck Hagenbuch da1bfb4211 adding mcal and gettext to MODULES_STATUS 2000-04-04 00:40:48 +00:00
Andi Gutmans d3dd529c23 - Fix build bug 2000-04-03 22:00:18 +00:00
Zeev Suraski c43fe80d6f @- Fix crash resulting from IMAP's error handling (Stanislav) 2000-04-03 19:00:34 +00:00
Zeev Suraski d0395d6f5b *** empty log message *** 2000-04-03 18:50:50 +00:00
Andi Gutmans 991f9ef9f4 - fopen and ZTS fixes 2000-04-03 17:40:44 +00:00
Andi Gutmans 2f41e1b979 - Fix typo 2000-04-03 17:00:01 +00:00
Sam Ruby 617e1b054c test -e doesn't exist on Solaris - substituting test -d 2000-04-03 15:29:39 +00:00
Zeev Suraski 074af16d34 *** empty log message *** 2000-04-03 05:35:56 +00:00
Zeev Suraski 538464f34d *** empty log message *** 2000-04-03 05:31:26 +00:00
Zeev Suraski f44afc6e99 Fix the problem with dl()'d modules not freeing their resources properly 2000-04-03 05:26:41 +00:00
Zeev Suraski 69ff396312 *** empty log message *** 2000-04-02 22:15:14 +00:00
Zeev Suraski 18e0850ba1 @- Add $HTTP_POST_FILES[filename][tmp_name] - it was previously impossible to
@  retrieve the temporary name of an uploaded file using $HTTP_POST_FILES[] (Zeev)
- Changed IMAP Win32 definitions
2000-04-02 21:27:32 +00:00
Andi Gutmans de0d354736 - Create dtor function 2000-04-02 20:26:06 +00:00
Andi Gutmans d8e64d623e - This version of chdir_file should be compatible with the Apache one. 2000-04-02 19:45:02 +00:00
Andi Gutmans ce283e2326 - A bit more cleanups.
- Need to implement virtual_chdir_file() to replace chdir_file() in
  sapi/apache so that we can start testing apache and debug it.
2000-04-02 19:28:25 +00:00
Andi Gutmans 6a2da70f94 - Virtual cwd compiles now (need to uncomment #define in php.h for it to
be enbaled right now).
  It seems to work very basic stuff
2000-04-02 19:04:59 +00:00
Zeev Suraski eefbe904b2 *** empty log message *** 2000-04-01 22:31:20 +00:00
Andi Gutmans 997e63993b - Move to new Zend macros 2000-04-01 20:11:01 +00:00
Andi Gutmans 301f8feab4 - PHP_WIN32 is not defined here use ZEND_WIN32 2000-04-01 18:22:46 +00:00
Andi Gutmans 57b398af1f - More virtual_cwd work 2000-04-01 18:21:03 +00:00
Andi Gutmans a73ba4b238 - Make php_virtual_cwd compile 2000-04-01 18:11:08 +00:00
Sam Ruby 34933225f6 Accomodate back level (JSDK 2.0) implementations 2000-04-01 17:57:42 +00:00
Andi Gutmans effa5bb024 - Need zend.h for ZTS 2000-04-01 17:20:29 +00:00
Andi Gutmans daf81344af - 2000-04-01 17:08:03 +00:00
Andi Gutmans 8a4805c831 - Intermediate commit 2000-04-01 17:02:32 +00:00
Zeev Suraski fc8c923bb2 Oh yeah, committing these would be a good idea:) 2000-04-01 16:49:39 +00:00
Zeev Suraski 06dab5e7e5 Several fixes 2000-04-01 16:48:08 +00:00
Zeev Suraski 491a315c11 @- Made the IMAP and LDAP modules compilable under Windows and thread-safe (Zeev) 2000-04-01 16:23:39 +00:00
Zeev Suraski 131d9cb2dc *** empty log message *** 2000-04-01 16:23:13 +00:00
Sam Ruby 47442c4c85 Don't try to install php_java.jar if --with-servlet was specified
(Fix to PHP 4.0 Bug #4001 submitted by sashi@easy.com.au)
2000-04-01 16:21:55 +00:00
Sascha Schumann 179672a980 Fix the HPUX 10.20 check for non-standard reentrant time functions 2000-04-01 16:00:34 +00:00
Sascha Schumann 007c325cc1 . 2000-04-01 15:51:34 +00:00
Zeev Suraski 983cc700a9 Have a standard way of exporting symbols 2000-04-01 15:16:11 +00:00
Sascha Schumann 77688ff3b5 Up version number to 4.0RC2-dev. (4.0-dev looks too general for now.) 2000-04-01 14:39:14 +00:00
Zeev Suraski 9e2fb7bb41 Use int 2000-04-01 14:36:41 +00:00
Zeev Suraski 0d21940d54 Generalize some common thread-safety stuff 2000-04-01 14:15:20 +00:00
Zeev Suraski ef426d467c Have a standard entry for the globals id 2000-04-01 13:20:51 +00:00
Zeev Suraski 53586378b0 @- Fix a problem when dealing with large POST blocks in CGI mode 2000-04-01 01:11:39 +00:00
Sterling Hughes eb224c7850 Added some things that I forgot to add when I did them. 2000-03-31 23:28:38 +00:00
Andi Gutmans 1bab18a00c - This shouldn't do any harm and might fix a problem with Win32 2000-03-31 22:48:59 +00:00
Andrei Zmievski cc6ca27dcb Would be good. 2000-03-31 21:57:09 +00:00
Zeev Suraski 0769927e01 That should be it 2000-03-31 19:55:33 +00:00
Zeev Suraski 5ed7a47a79 Remove more files 2000-03-31 19:54:44 +00:00
Zeev Suraski cf534695d2 Remove bindlib_w32 2000-03-31 19:46:49 +00:00
Zeev Suraski a82b3034b1 Several fixes, plus remove bindlib_w32 (it's more trouble than it's worth) 2000-03-31 19:46:35 +00:00
Zeev Suraski 708109e950 *** empty log message *** 2000-03-31 15:46:16 +00:00
Zeev Suraski 523f3cce5f The previous fix ended up being broken, this one should do it 2000-03-31 15:17:43 +00:00
Andi Gutmans 37282c9043 - One more update 2000-03-31 13:19:20 +00:00
Andi Gutmans fdc53674c8 - Add bindlib to the Win32 build 2000-03-31 13:08:58 +00:00
Andi Gutmans 38a4ccddb6 - Add bindlib_w32 to the PHP tree 2000-03-31 09:29:28 +00:00
Sam Ruby 8a64f51101 Use C style comments, per the CODING_STANDARDS 2000-03-31 00:53:45 +00:00
Andi Gutmans 24302e89e5 - Fix bug 2000-03-31 00:05:41 +00:00
Sascha Schumann 7dfcbd13c2 Remove trailing slash 2000-03-30 23:50:15 +00:00
Sam Ruby 57b4e1a3ee fix indentation (this project has tabstop=4!) 2000-03-30 23:35:55 +00:00
Sascha Schumann 2b1daf73eb * Include <stddef.h> for NULL
* Check for pthread_mutexattr_init() for improved SGI support
2000-03-30 23:35:26 +00:00
Sam Ruby 8a94c8d598 eliminate chdir if it is already virtual 2000-03-30 23:23:29 +00:00
Andi Gutmans 9c3d6304dd - Hopefully got most of them. We also need a chdir_file function like
for Apache.
2000-03-30 22:56:34 +00:00
Andi Gutmans 9df7df3293 - Baby steps... Use PHP_FOPEN() 2000-03-30 22:41:13 +00:00
Andi Gutmans 72b57c66f0 - Use PHP_CHDIR() 2000-03-30 22:39:29 +00:00
Andi Gutmans f9547241d5 - Fix another bug in session.c
- Start using the new PHP_GETCWD() and co. macros
2000-03-30 22:38:50 +00:00
Andi Gutmans 69a16e9693 - Fix compile bug in session_get_cookie_params() 2000-03-30 22:21:23 +00:00
Sterling Hughes ec9aae474a #Stylistic changes. 2000-03-30 20:02:21 +00:00
Sascha Schumann 27b736a192 Non-functional changes 2000-03-30 19:03:15 +00:00
Sascha Schumann 0a52ef6439 Build the bundled mysqlclient library thread-safe in thread-safe mode. 2000-03-30 19:02:52 +00:00
Sterling Hughes 149e6181e5 @-added session_get_cookie_params (sterling) 2000-03-30 18:50:09 +00:00
Zeev Suraski 5f6ad55543 Fix zend_register_extension() 2000-03-30 18:06:41 +00:00
Sascha Schumann f72bcaa648 kill warning 2000-03-30 17:55:50 +00:00
Sascha Schumann 1e31b7755c * Add --enable-libgcc which explicitly links against libgcc.
* Some cleanup and increased use of PHP_ARG_[ENABLE|WITH]
2000-03-30 15:00:30 +00:00
Sascha Schumann c97314257c Fix libpng and libz order and stuff the libjpeg into its own macro. 2000-03-30 14:59:23 +00:00
Andrei Zmievski 5cd7bf59b3 @- Fixed return of stristr() to no longer always be lowercased. (Andrei) 2000-03-30 14:34:46 +00:00
Sascha Schumann e282cefe20 . 2000-03-30 14:28:35 +00:00
Sascha Schumann fe92fef608 Allocate enough memory for additional /.
Also remove the extra check for the trailing /. Unix will automatically
apply s#/+#/#

Partly suggested by: drew@elysium.ltd.uk
PR: #3956
2000-03-30 12:55:59 +00:00
Andi Gutmans 0ccbd9d9ec - Bump up API number after Lars' change 2000-03-30 05:04:39 +00:00
Sascha Schumann 41eef61c69 Give another hint to BSD makes 2000-03-30 04:11:31 +00:00
Sascha Schumann 4179e85693 Propagate pthread_cflags to CXXFLAGS and INLINE_CFLAGS 2000-03-30 04:09:56 +00:00
Jim Jagielski 1469f420d6 Fix the problem with dbmopen() not being defined. Patch by
Geoff (geoff@mcrent.com) and The Red Fox
2000-03-30 02:42:28 +00:00
Sascha Schumann 3642282b07 Some OS prepend _ to symbol names while their dynamic linker
does not do that automatically. Thus we check manually for
_get_module.
2000-03-30 01:21:03 +00:00
Sascha Schumann c7040b71bc Specifically mention $(srcdir), so that OpenBSD's make gets it 2000-03-30 00:59:47 +00:00
Sascha Schumann 5e18db46c3 Specifically mention $(srcdir), so that OpenBSD's make gets it 2000-03-30 00:43:09 +00:00
Sterling Hughes 76a32c0ce8 fix bug 3971, SNMP now compiles on FreeBSD. 2000-03-30 00:19:24 +00:00
Zeev Suraski b7cd2bfa8e - Make the argument order for the stack applies more consistent with other Zend
data structures
- Fix a possible corruption problem due to switch() C-level optimization
2000-03-29 22:28:04 +00:00
Torben Wilson b543f9959c Missed Andrei's @ note... 2000-03-29 22:18:41 +00:00
Torben Wilson 521c8af6a4 Added !== (is not identical) operator. 2000-03-29 22:05:19 +00:00
Sascha Schumann f50de70308 GC now prints out how many session objects were removed 2000-03-29 20:37:29 +00:00
Sascha Schumann af9a852bf1 Improved error messages 2000-03-29 20:37:12 +00:00
Zeev Suraski 88041c4fc7 @- Changed the Windows version of PHP so that a php.ini file is no
@  longer mandatory (Zeev)
2000-03-29 19:45:15 +00:00
Zeev Suraski ee16ee2a38 *** empty log message *** 2000-03-29 19:44:44 +00:00
Zeev Suraski fcf0afce17 *** empty log message *** 2000-03-29 19:26:34 +00:00
Sascha Schumann 6c8f9bf3b4 Do not add dl function, if libdl is not present.
PR: #3947

Declare user_shutdown_function_name() as static to kill warning.
2000-03-29 17:33:44 +00:00
Andi Gutmans e9d126a7d3 - Make sure zend_API.h has Zend'ish versions of the ZEND macros so that
Zend'ish modules don't need to mix PHP & Zend notation.
2000-03-29 17:13:16 +00:00
Sterling Hughes 68d4298e71 #yikes stripes, didn't see that one
#its time to go to bed
Re-fixed return value of min and max
2000-03-29 12:43:13 +00:00
Sterling Hughes 2c975a2b06 single, sorta proto. 2000-03-29 11:38:47 +00:00
Sterling Hughes cc2c9d8f0f 1. Holy protos Batman.
2.  Converted some functions from using "return" to RETURN_FALSE
2000-03-29 11:19:01 +00:00
Thies C. Arntzen a692f15568 @- session_start() is now more verbose if headers cannot be send. (Thies) 2000-03-29 09:36:27 +00:00
Sterling Hughes 6db2262102 Tis protoriffic. 2000-03-29 01:39:04 +00:00
Egon Schmid 1a8dfac59d Sterling, only one line for the short descritption, even it is massiv. 2000-03-28 20:47:47 +00:00
Sterling Hughes 74d30dff7b *** empty log message *** 2000-03-28 20:26:02 +00:00
Sterling Hughes f76e0a4077 *** empty log message *** 2000-03-28 18:16:41 +00:00
Zeev Suraski a65971221f The checks for func_num_args() and friends were broken - fixed 2000-03-28 17:34:21 +00:00
Egon Schmid 27e5c89b21 Description differs between version 3 and 4. 2000-03-28 17:03:32 +00:00
Uwe Steinmann cdb7254384 - added pdf_open_image_file() to read jpeg, tiff, gif and png images 2000-03-28 16:45:05 +00:00
Sterling Hughes a4de43fe87 Couple of thangs:
1.  We've got protos!
  2.  The second half of the script is now most Zendiferous.
2000-03-28 01:38:50 +00:00
Sascha Schumann a97eccaba3 Use PHP_ARG_WITH 2000-03-27 23:43:00 +00:00
Sascha Schumann 1f822b98ce Welcome PHP_ARG_ENABLE and PHP_ARG_WITH. They are there to replace the common
AC_MSG_CHECKING, AC_ARG_[ENABLE,WITH], AC_MSG_RESULT trio.
2000-03-27 23:33:38 +00:00
Sascha Schumann 0cc5c94b37 Generate better skeleton config.m4 2000-03-27 22:52:48 +00:00
Sascha Schumann 31803785fd These should not be exported 2000-03-27 22:40:49 +00:00
Sascha Schumann 2cb0e69b51 * Check the default location of Berkeley DB 3.0
* Check additionally for libdb-3
2000-03-27 22:40:27 +00:00
481 changed files with 24577 additions and 9036 deletions

No files matched your search

+3603
View File
File diff suppressed because it is too large. Load diff
+5 -3
View File
@@ -11,6 +11,8 @@ install both.
If you want both PHP 3 and 4 modules in the same Apache server, check the
bottom of this file for instructions.
INSTALLATION WITH THE ZEUS WEB SERVER:
--Please see the 'README.Zeus' file included in this distribution
QUICK INSTALL (DSO)
@@ -295,10 +297,10 @@ Installing PHP can be done in four simple steps:
and you need to remove the # for that line to take effect.
USING PHP3 AND PHP4 AS CONCURRENT APACHE MODULES
USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES
Recent operating systems provide the ability to perform versioning and
scoping. This features make it possible to let PHP3 and PHP4 run as
scoping. This features make it possible to let PHP 3 and PHP 4 run as
concurrent modules in one Apache server.
This feature is known to work on the following platforms:
@@ -307,7 +309,7 @@ USING PHP3 AND PHP4 AS CONCURRENT APACHE MODULES
- Solaris 2.5 or better
- FreeBSD (3.2, 4.0 tested)
To enable it, configure PHP3 and PHP4 to use APXS (--with-apxs) and the
To enable it, configure PHP 3 and PHP 4 to use APXS (--with-apxs) and the
necessary link extensions (--enable-versioning). Otherwise, all standard
installations instructions apply. For example:
+12 -7
View File
@@ -1,5 +1,5 @@
--------------------------------------------------------------------
The PHP License, version 2.01
The PHP License, version 2.02
Copyright (c) 1999, 2000 The PHP Group. All rights reserved.
--------------------------------------------------------------------
@@ -37,12 +37,17 @@ are met:
"This product includes PHP, freely available from
http://www.php.net/".
6. Permission to freely distribute and use Zend as an integrated
part of PHP is granted, under the conditions of version 0.92
of the Zend License.
The license is bundled with the Zend engine, and is available
at http://www.zend.com/license/0_92.txt, or by contacting
license@zend.com.
6. The software incorporates the Zend Engine, a product of Zend
Technologies, Ltd. ("Zend"). The Zend Engine is licensed to the
PHP Association (pursuant to a grant from Zend that can be
found at http://www.php.net/license/ZendGrant/) for
distribution to you under this license agreement, only as a
part of PHP. In the event that you separate the Zend Engine
(or any portion thereof) from the rest of the software, or
modify the Zend Engine, or any portion thereof, your use of the
separated or modified Zend Engine software shall not be governed
by this license, and instead shall be governed by the license
set forth at http://www.zend.com/license/ZendLicense/.
+4
View File
@@ -42,6 +42,10 @@ EXTENSION: informix
PRIMARY MAINTAINER: Danny Heijl <Danny.Heijl@cevi.be>
STATUS: Maintained
--------------------------------------------------------------------------------
EXTENSION: interbase
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
STATUS: Odd Fixes
--------------------------------------------------------------------------------
EXTENSION: java
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
STATUS: Maintained
+3
View File
@@ -20,3 +20,6 @@ sysvshm Working
odbc Working (except for persistent connections)
MS SQL Working (tested on phpts and isapi versions)
snmp Working
gettext Working
mcal Working
interbase Working
+27 -14
View File
@@ -1,9 +1,4 @@
DEPTH = .
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
ZEND_DIR = $(srcdir)/Zend
SUBDIRS = Zend ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR)
@@ -13,8 +8,8 @@ LTLIBRARY_SOURCES = \
main.c internal_functions.c snprintf.c php_sprintf.c \
configuration-parser.c configuration-scanner.c \
safe_mode.c fopen-wrappers.c php_realpath.c alloca.c \
php_ini.c SAPI.c rfc1867.c dlist.c php_content_types.c strlcpy.c \
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c php_virtual_cwd.c
LTLIBRARY_DEPENDENCIES = \
Zend/libZend.la \
@@ -34,21 +29,39 @@ PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
targets = $(LTLIBRARY_NAME) $(PROGRAM_NAME)
install_targets = install-local install-modules
install_targets = install-sapi install-modules
include $(topsrcdir)/build/rules.mk
include $(topsrcdir)/build/library.mk
include $(topsrcdir)/build/program.mk
include $(top_srcdir)/build/rules.mk
include $(top_srcdir)/build/library.mk
include $(top_srcdir)/build/program.mk
install-local:
install-sapi:
@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
-@$(mkinstalldirs) $(bindir)
-@if ! test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
for i in 0.0.0 0.0 0; do \
if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \
$(LN_S) $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); \
break; \
fi; \
done; \
fi
$(INSTALL_IT)
configuration-parser.h configuration-parser.c: configuration-parser.y
install-modules:
@test -d modules && \
$(mkinstalldirs) $(moduledir) && \
echo "installing shared modules into $(moduledir)" && \
rm -f modules/*.la && \
cp modules/* $(moduledir) || true
install-su: install-modules
(cd pear && $(MAKE) install)
configuration-parser.h configuration-parser.c: $(srcdir)/configuration-parser.y
$(YACC) -p cfg -v -d $< -o configuration-parser.c
configuration-scanner.c: configuration-scanner.l
configuration-scanner.c: $(srcdir)/configuration-scanner.l
$(LEX) -Pcfg -o$@ -i $<
internal_functions.c: internal_functions.c.in config.status
+166 -45
View File
@@ -1,22 +1,137 @@
PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 May 2000, Version 4.0.0 Release
- Fixed a crash bug in .phps syntax-highlighted files (Andi)
- Improved round() to allow specification of rounding precision.
(Andrei, Todd Kirby <kirbyt@yahoo.com>)
- Added SORT_REGULAR, SORT_NUMERIC, SORT_STRING flags that can be used with
non-user sort functions for precise sorting behavior. (Andrei)
- Fixed two 64-bit issues (startup crash, gethostbyaddr). (Sascha)
- NULL values are now preserved in the return value of mysql_fetch_array()
and mysql_fetch_object(). (Andrei)
- Ported InterBase module finally from PHP 3 to PHP 4. Full support for
InterBase 6. (Jouni)
- Added swf_definepoly for drawing polygons to the SWF functions. (Sterling)
- Ported imagegammacorrect from PHP3 to PHP4. (Sterling)
- Added array_rand() function. (Andrei)
8 May 2000, Version 4.0 Release Candidate 2
- NSAPI WIN32 Module compilable, untested (Shane)
- Apache WIN32 Module compilable and lightly tested. (Shane)
- Enabled assert() by default in php.ini-dist. (Andrei)
- Put in safeguards in case dynamic code evaluation in assert() and
preg_replace() with /e modifier fails. (Andrei)
- Fixed infinite recursion when serializing $GLOBALS[] in WDDX. (Andrei)
- Made WDDX serialization properly escape <, >, and &. Also speeded up
the serialization in general. (Andrei)
- Moved install-local to install-sapi for clarity. (Joey)
- Improved extension build framework. Refer to README.SELF-CONTAINED-EXTENSIONS
for an introduction. (Sascha)
- ImagePolygon() is no longer limited by a maximum number of polygons.
(Marc Pohl)
- Added configure time checking for bcmath package. (Joey, Sascha)
- Added get_declared_classes(). (Andrei, Zend library)
- Add initial NSAPI module from Jayakumar Muthukumarasamy. (Rasmus)
- Added the SWF module which allows you to create Macromedia Flash files via
libswf. (Sterling)
- Improved UNIX build system to support more vendor make tools (Sascha)
- Updated natural comparison/sorting algorithm by Martin Pool
<mbp@humbug.org.au>. (Andrei)
- Fixed a crash in array_multisort() that happened when empty arrays
were passed to it. (Andrei)
- Added substr_count() from Peter Kovacs. (Andrei)
- Add an optional third argument to fseek to indicate where to seek from.
(Andrei)
- OCIBindByName() will no longer complain about bindlength beeing zero. (Thies)
- Converted the IMAP module to the high performance API (Zeev)
- The fgetcsv() function now handles embedded end-of-line in a quoted field
(Nick Talbott)
- Added user_error(), to allow explicitly generate error messages from scripts
(Zeev, Zend Engine)
- Fixed a problem in long2ip() that occasionally returned incorrect IP address.
(Evan, Andrei)
- Fixed many memory leaks in the IMAP module (Stas, Andi, Zeev)
- Fixed bug in number_format (Jon Forsberg)
- Make error_prepend_string and error_append_string work (Rasmus)
- array_walk() now automatically resets the array. (Andrei)
- Added natural comparison/sorting routines strnatcmp(), strnatcasecmp(),
natsort(), and natcasesort(). These are useful for comparing and sorting
strings that contain numbers. Based on the code from Martin Pool
<mbp@humbug.org.au>. See http://www.linuxcare.com.au/projects/natsort/
for more info on natural sorting. (Andrei)
- Zeus Webserver support (version 3.3.6+) for ISAPI (Ben Mansell)
- Fixed several problems with the PATH_TRANSLATED and PHP_SELF under Apache
(Paul Gregg & Zeev)
- Ported ldap_get_values_len() function from PHP3 to PHP4. (Sterling)
- Fixed a problem in include_once() with non constant arguments (Andi & Zeev,
Zend Engine)
- Added php.ini-optimized (Zeev)
- Ported ldap_errno(), ldap_err2str() and ldap_error() from PHP3 to PHP4.
(Sterling)
- WDDX now defaults to ISO-8859-1. (Thies)
- Fixed crash resulting from IMAP's error handling (Stas)
- Added $HTTP_POST_FILES[filename][tmp_name] - it was previously impossible to
retrieve the temporary name of an uploaded file using $HTTP_POST_FILES[]
(Zeev)
- Made the IMAP and LDAP modules compilable under Windows and thread-safe
(Zeev)
- Fixed a problem when dealing with large POST blocks in CGI mode (Zeev)
- Added session_get_cookie_params() function. (Sterling)
- Fixed return of stristr() to no longer always be lowercased. (Andrei)
- Changed the Windows version of PHP so that a php.ini file is no
longer mandatory (Zeev)
- session_start() is now more verbose if headers cannot be send. (Thies)
- Fixed a memory leak when using assign-op bitwise operators on strings (Zeev,
Zend Engine)
- Added support for reading properties that require arguments in the COM
module - writing to them will only be supported in PHP 4.1 (Zeev)
- Fixed a very old legacy memory leak in the COM module (Zeev)
- Fixed problems with object-overloading support - noteably, COM and Java
(Zeev, Zend Engine)
- Fixed an overrun in WDDX. (Thies)
- Fixed a crash bug with modules loaded through dl() not properly freeing their
resources (Zeev, Zend Engine)
- Added localtime() function. (Sterling)
- Added the 'I' format option for the date function, this option will return
true or false depending on whether or not daylight savings time is in effect.
(Sterling)
- Added gmstrftime() function. (Sterling)
- snmp_walkoid is now an alias for snmp_realwalk. (Sterling)
- Fixed a bug that could cause a crash when using 'global' inside large include
files (Stas, Zend Engine)
- Added --enable-libgcc switch to force linking against libgcc (Sascha)
- Fixed dynamic loading where extension_dir had no trailing slash (Sascha)
- Fixed dynamic loading on OpenBSD (Sascha)
- Improved POSIX threads check. ZTS works now on at least Linux, Solaris,
FreeBSD and OpenBSD (Sascha, TSRM)
- Added !== operator support. (Torben, Zend Engine)
27 March 2000, Version 4.0 Release Candidate 1
- Added support for UCD-SNMP 4.1.x (Sascha)
- Fixed a data corruption bug in mysql_result(), if used in table.fieldname
mode (Zeev)
- Fixed a crash problem in func_num_args(), func_get_arg() and func_get_args()
when used as function arguments (Andi)
when used as function arguments (Andi, Zend Engine)
- Added get_class_methods(string classname) function. (Andrei)
- Don't default to iso-8859-1 since this confuses some browsers (Rasmus)
- Added 'I' switch to test whether or not DST is active. (Sterling)
- Fixed a data corruption bug in mysql_result(), if used in table.fieldname
mode (Zeev)
- Modified the registry INI entry reader (Win32) to work with drive letters.
For example, if you wish to wish to specify INI entries for C:\foo\bar, you
should create HKLM\PHP\Per Directory Values\C\foo\bar in the registry, and add
string values for each directive you want to override in this directory (Zeev)
- Fixed extract() for EXTR_PREFIX_SAME and EXTR_SKIP cases. (Andrei)
- stristr() no longer modifies it's arguments. (Thies)
- Make it possible to specify both a port and a socket in
mysql_[p]connect (Rasmus)
- Don't default to iso-8859-1 since this confuses some browsers. (Rasmus)
- Make it possible to specify both a port and a socket
in mysql_[p]connect. (Rasmus)
- Added --disable-pic for disabling generating PIC for shared objects
on platforms which support it (i.e. Linux) (Sascha)
- serialize()/unserialize() now call __sleep() and __wakeup() when
working on objects. (Thies)
- renamed to_string() method to __string_value() for consistency.
(Thies, Zend library)
(Thies, Zend Engine)
- Fixed a bug in the third argument to define()
- Added is_numeric() that returns true if the argument is a number
or a numeric string. (Andrei)
@@ -26,11 +141,16 @@ PHP 4.0 NEWS
corrupted. (Thies)
- Changed $HTTP_STATE_VARS to $HTTP_SESSION_VARS. Use only the latter
version now! (Andrei)
- Add GD-JPEG Support (Rasmus)
- Added GD-JPEG Support (Rasmus)
- Prevent from loading dynamic PHP modules which were compiled with different
debug and thread safety modes than PHP, which resulted in a crash (Andi)
- connection_aborted() and friends work again. (Thies)
- Added include_once() and require_once() functionality (Andi, Zend library)
- connection_aborted() and friends work again (Thies)
- Upgraded to libtool 1.3.4 (Sascha)
- UNIX configure creates config.nice in the build directory now which allows
easy reuse of configuration options (Sascha)
- Added support for embedded MySQL client library. Unless you specify a path
to --with-mysql, the bundled MySQL client library will be used (Sascha)
- Added include_once() and require_once() functionality (Andi, Zend Engine)
- Removed support for pdflib < 3.0 (Uwe)
- Added auto-registration of everything in $HTTP_SESSION_VARS[] if
register_globals is turned off. (Andrei)
@@ -44,21 +164,22 @@ PHP 4.0 NEWS
of PHP, and currently lacks section support (Zeev)
- "none" is now equivalent with "" in Apache config directives (Stig)
- OCINLogon no longer crashes. (Thies)
- Fix comparisons of (string) "nan" with (string) "nan". (Thies, Zend library)
- Fixed comparisons of (string) "nan" with (string) "nan". (Thies, Zend Engine)
- Switched back to the old $HTTP_*_VARS[] behavior - $HTTP_GET_VARS["foo"]
and $foo are no longer references to each other, but separate variables
like they were prior to PHP 4.0 Beta 4 (Zeev)
- Fixed Sybase-DB compilation (Zeev)
- Fixed a (fairly common) situation where error_reporting values would not be
properly restored after a call to error_reporting(), in between requests (Zeev)
properly restored after a call to error_reporting(), in between requests
(Zeev)
- The various $HTTP_*_VARS[] are now protected, and cannot be manipulated by
user input (Zeev)
- Added ini_set() as an alias to ini_alter() (Zeev)
- The string None is now recognized as a keyword by the php.ini processor, and
can be used to denote an empty string (Zeev)
- Added get_class_vars(string class_name) and get_object_vars(object obj)
functions. (Andrei, Zend library)
- Add pdf_set_parameter(), pdf_skew(), pdf_show_boxed() (Uwe)
functions. (Andrei, Zend Engine)
- Added pdf_set_parameter(), pdf_skew(), pdf_show_boxed() (Uwe)
- Fixed comparison of (string) "inf" with (string) "inf", which was erroneously
returning false (Zeev)
- Implemented default_charset and default_mimetype config directives (Stig)
@@ -81,8 +202,8 @@ PHP 4.0 NEWS
- Made multipart/form-data content obey to the variables_order directive (Zeev)
- Updated the browscap module to work with PHP 4.0 (Zeev)
- Recover gracefully in ISAPI after the client prematurely presses STOP (Andi)
- Fix bug in unset() on array offsets which are referenced more than once
(Andi, Zend library)
- Fixed bug in unset() on array offsets which are referenced more than once
(Andi, Zend Engine)
- Improved ISAPI module - it should no longer be necessary to set PHP as
an ISAPI filter, only as an ISAPI extension, unless you wish to perform
authentication using PHP. This didn't yet get enough testing, but it
@@ -93,7 +214,7 @@ PHP 4.0 NEWS
- Re-introduced "none" for disabling auto_prepend/append_file (Stig)
- Added DB/storage (Stig, PEAR)
- Introduced DB warnings (Stig, PEAR)
- Fix overrun in strip_tags (Stas)
- Fixed overrun in strip_tags (Stas)
- Fixed crash in strip_tags() and related functions. (Thies)
- Workaround for bogus POST-Data from IE/Mac. (Thies)
Patch by Alain Malek <alain@virtua.ch>
@@ -104,7 +225,7 @@ PHP 4.0 NEWS
- base64_decode() will decode POST data correct. (Thies)
Patch submitted by: Turadg Aleahmad <turadg@wise.berkeley.edu>
- Much more work on domxml. Build xml tree, create xml doc works (Uwe)
- Made foreach() work on objects. (Thies, Zend library)
- Made foreach() work on objects. (Thies, Zend Engine)
- Added domxml extension based on libxml, still little functionality (Uwe)
- Fixed memory corruption in fgetss(), strip_tags() and gzgetss() (Zeev)
- Updated calendar dynamic library to work with PHP 4. (Evan)
@@ -160,10 +281,10 @@ PHP 4.0 NEWS
- Implemented support for <boolean> and <null> types according
to WDDX version 1.0 (Andrei)
- Made var_dump()/serialize()/unserialize() NULL aware. (Thies)
- Added new NULL constant (Zeev, Zend library)
- Added new NULL constant (Zeev, Zend Engine)
- Fixed -c support in the standalone CGI binary (Zeev)
- Increased PHP's performance by 5-15% using a new memory cache (Andi & Zeev,
Zend library)
Zend Engine)
- Improved the php.ini reader to support constants and bitwise operators (Zeev)
- Fixed strrev() to no longer modify arg1. (Thies)
- Fixed buffer overruns in iptcembed(). (Thies)
@@ -184,16 +305,16 @@ PHP 4.0 NEWS
- Added get_loaded_extensions(), extension_loaded(), and
get_extension_funcs() functions. (Andrei)
- Added date/time stamping to PHP error log file. (Andrei, Joey)
- Added is_subclass_of() function (Andrei, Zend library)
- Added is_subclass_of() function (Andrei, Zend Engine)
- Implemented count_chars(). (Thies)
- Added class_exists() function (Andrei, Zend library)
- Added class_exists() function (Andrei, Zend Engine)
- Made strspn() and strcspn() binary-safe. (Andrei)
- Added array_multisort() function. (Andrei)
- Made pageinfo.c thread-safe (Sascha)
- Made implode() binary-safe (Andrei)
- Made strstr(), stristr(), and ucwords() binary-safe() (Andrei)
- Made strtoupper(), strtolower(), substr_replace() binary-safe. (Andrei)
- Fix a crash in the Apache syntax highlighting mode (Zeev)
- Fixed a crash in the Apache syntax highlighting mode (Zeev)
- Report all ODBC error's not just the one on the top of the stack (lurcher)
- OCI8 now returns NULL values in LONG columns correct. (Thies)
- Added support for a C-like assert() function. (Thies)
@@ -214,7 +335,7 @@ PHP 4.0 NEWS
- Make the global GET/POST/Cookie variables and their $HTTP_*_VARS[] counterparts
be references to each other (Zeev)
- Added support for the 'use' keyword - behaves like 'require', but will not
use the same file more than once (Andi & Zeev, Zend library)
use the same file more than once (Andi & Zeev, Zend Engine)
- Added check to see if a persistent connection is still valid with the
ODBC interface before reusing (nick@easysoft.com)
- Added DBMaker support (patch by Pax Tsai <paxtsai@lion.syscom.com.tw>)
@@ -223,7 +344,7 @@ PHP 4.0 NEWS
- Disable symlinks to urls (Rasmus)
- Informix driver now reflects version of ESQL/C used (Danny)
- Modified session_register() to take variable number of arguments (Andrei)
- Fixed file descriptor leak in thread safe mode (Zeev, Zend library)
- Fixed file descriptor leak in thread safe mode (Zeev, Zend Engine)
- Added select(), fd_set() and fd_isset() (Evan)
- cpdf support has been ported from php3, needs ClibPDF 2.x (Uwe)
- Fixed a leak when using automatic output buffering (Zeev)
@@ -232,7 +353,7 @@ PHP 4.0 NEWS
- Fixed inconsistencies in the implementation of here-docs (Andi & Zeev, Zend
library)
- Fixed a problem with constant class-member initializations (Andi & Zeev,
Zend library)
Zend Engine)
- Fixed float-compare in min(),max(),a[r]sort(),[r]sort() (Thies)
- Implemented get_html_translation_table() function (Thies)
- Implemented array_flip() function. Returns input-array with key, value
@@ -252,7 +373,7 @@ November 16 1999, Version 4.0 Beta 3
- Upgraded regex library to alpha3.8 (Sascha)
- Fixed selecting nested-tables in OCI8. (Thies)
- RFC-854 fix for internal FTP-Code. Commands have to end in "\r\n" (Thies)
- Fix OpenLink ODBC support (Stig)
- Fixed OpenLink ODBC support (Stig)
- min(),max(),a[r]sort(),[r]sort(),k[r]sort() now work consistent with the
language-core. (Thies)
- tempnam() now uses mkstemp() if available (Stig)
@@ -263,7 +384,7 @@ November 16 1999, Version 4.0 Beta 3
Patch submitted by: neal@wanlink.com
- Added Microsoft SQL Server module for Win32 (Frank)
- Added support for forcing a variable number of internal function arguments
by reference. (Andi & Zeev, Zend library)
by reference. (Andi & Zeev, Zend Engine)
- Implemented getprotoby{name,number} (Evan)
- Added array_pad() function. (Andrei)
- Added new getservby{name,port} functions. (Evan)
@@ -279,7 +400,7 @@ November 16 1999, Version 4.0 Beta 3
- Added getcwd() function. (Thies)
- XML_Parse_Into_Struct no longer eats data. (Thies)
- Fixed parse_url('-') crash. (Thies)
- added === operator support. (Andi & Thies, Zend library)
- added === operator support. (Andi & Thies, Zend Engine)
- unserialize() now gives a notice when passed invalid data. (Thies)
- Fixed shuffle() so that it no longer breaks on Solaris. (Andrei)
- Added is_resource(), is_bool() functions. (Thies)
@@ -301,7 +422,7 @@ November 16 1999, Version 4.0 Beta 3
messages. NEWS file is now the place for public announcements. (Andrei)
- Fixed refcount problem in XML module. (Thies)
- Fixed crash in HTTP_RAW_POST_DATA handling (Thies)
- You can use resources as array-indices again (Thies, Zend library)
- You can use resources as array-indices again (Thies, Zend Engine)
- Fixed pg_fetch_array() with three arguments (Sascha)
Patch submitted by: brian@soda.berkeley.edu
- Upgraded a lot internal functions to use new Zend function API (Thies)
@@ -314,12 +435,12 @@ November 16 1999, Version 4.0 Beta 3
- Fixed header("HTTP/..."); behaviour (Sascha)
- Improved UNIX build system. Now utilizes libtool (Sascha)
- Upgrade some more internal functions to use new Zend function API. (Thies,
Zend library)
Zend Engine)
- Fixed backwards incompatibility with ereg() (Thies)
- Updated Zend garbage collection with a much more thorough method.
(Andi, Zend library)
(Andi, Zend Engine)
- Added the ability to use variable references in the array() construct.
For example, array("foo" => &$foo). (Andi, Zend library)
For example, array("foo" => &$foo). (Andi, Zend Engine)
- Added array_reverse() function (Andrei)
- Some more XML fixes/cleanups (Thies)
- Updated preg_replace() so that if any argument passed in is an array
@@ -345,8 +466,8 @@ November 16 1999, Version 4.0 Beta 3
- Updated Oracle to use the new high-performance Zend function API. (Thies)
- Improved the performance of the MySQL module significantly by using the new
high-performance Zend function API. (Zeev)
- Add support for the Easysoft ODBC-ODCB Bridge (martin@easysoft.com)
- Fix bug in odbc_setoption, getParameter call incorrect (martin@easysoft.com)
- Added support for the Easysoft ODBC-ODCB Bridge (martin@easysoft.com)
- Fixed bug in odbc_setoption, getParameter call incorrect (martin@easysoft.com)
- Ora_Fetch_Into now resets the returned array in all cases (Thies)
- Fixed NULL-Column problem in Oracle-Driver (Thies)
- Added extra metadata functions to ODBC, SQLTables etc (nick@easysoft.com)
@@ -432,15 +553,15 @@ November 16 1999, Version 4.0 Beta 3
from the command line (Zeev)
- Fixed a crash that would occur if wddx_deserialize did not receive
a valid packet (Andrei)
- Fixed a bugglet when redefining a class at run-time (Andi, Zend library)
- Fixed a bugglet when redefining a class at run-time (Andi, Zend Engine)
- Fixed sem_get() on AIX (Sascha)
- Fixed fopen() to work with URL's in Win32 (Andi & Zeev)
- Fixed include_path for Win32 (Andi, Zend library)
- Fixed include_path for Win32 (Andi, Zend Engine)
- Fixed bug in ISAPI header sending function (Charles)
- Fixed memory leak when using undefined values (Andi & Zeev, Zend library)
- Fixed memory leak when using undefined values (Andi & Zeev, Zend Engine)
- Added output_buffering directive to php.ini, to enable output buffering
for all PHP scripts - default is off (Zeev).
- Fixed some more class inheritance issues (Zeev, Zend library)
- Fixed some more class inheritance issues (Zeev, Zend Engine)
- Fixed Apache build wrt to shared modules on FreeBSD/Linux (Sascha)
- Added session.extern_referer_chk which checks whether session ids were
referred to by an external site and eliminates them (Sascha)
@@ -493,25 +614,25 @@ August 9 1999, Version 4.0 Beta 2
- Fixed a bug in implode() that caused it to corrupt its arguments (Zeev)
- Added get_class($obj), get_parent_class($obj) and method_exists($obj,"name")
(Andi & Zeev)
- Fixed various inheritance problems (Andi & Zeev, Zend library)
- Fixed various inheritance problems (Andi & Zeev, Zend Engine)
- Children now inherit their parent's constructor, if they do not supply a
constructor of their own.
- Fixed runtime inheritance of classes (parent methods/properties were
overriding their children) (Zeev, Zend library)
- Fixed backwards incompatibility with the "new" operator (Andi, Zend library)
overriding their children) (Zeev, Zend Engine)
- Fixed backwards incompatibility with the "new" operator (Andi, Zend Engine)
- Fixed bugs in uksort() and ksort() sort ordering (Andrei)
- Fixed a memory leak when using assignment-op operators with lvalue of type
string (Zeev, Zend library)
string (Zeev, Zend Engine)
- Fixed a problem in inheritance from classes that are defined in include()d
files (Zeev, Zend library)
files (Zeev, Zend Engine)
- Fixed a problem with the PHP error handler that could result in a crash
on certain operating systems (Zeev)
- Apache php_flag values only recognized 'On' (case sensitive) - changed
to case insensitive (Zeev)
- Fixed a memory leak with switch statement containing return statements
(Andi & Zeev, Zend library)
(Andi & Zeev, Zend Engine)
- Fixed a crash problem in switch statements that had a string offset
as a conditional (Andi & Zeev, Zend library)
as a conditional (Andi & Zeev, Zend Engine)
- Imported PHP 3.0 fixes for rand() and mt_rand() (Rasmus)
- Added function entries for strip_tags() and similar_text() (Andrei)
- Fixed a bug in WDDX that would cause a crash if a number was passed in
@@ -534,7 +655,7 @@ August 9 1999, Version 4.0 Beta 2
- Added session id detection within REQUEST_URI (Sascha)
- Merged in HP-UX/ANSI compatibility switch from PHP 3.0 (Sascha)
- Fixed rpath handling for utilitites built during Apache build (Sascha)
- Added missing E_ error level constants (Zeev, Zend library)
- Added missing E_ error level constants (Zeev, Zend Engine)
- Fixed a bug in sending multiple HTTP Cookies under Apache (Zeev)
- Fixed implicit connect on the MySQL, mSQL, PostgreSQL and Sybase
modules (Zeev)
View File
File renamed without changes.
+3 -1
View File
@@ -62,7 +62,9 @@ in the ChangeLog. If the line begins with @, it will be redirected to the
NEWS file. Everything else goes into the ChangeLog.
It is important to note that if your comment or news logline spans multiple
lines, you have to put # or @ at the beginning of _every_ such line.
lines, you have to put # or @ at the beginning of _every_ such line. Every
entry in NEWS has to have a name after it, so if you did it with someone's
help, put both your names there.
Example. Say you modified two files, datetime.c and string.c. In datetime.c
you added a new format option for date() function, and in string.c you fixed
+129
View File
@@ -0,0 +1,129 @@
$Id$
=============================================================================
HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
A self-contained extension can be distributed independently of
the PHP source. To create such an extension, three things are
required:
- Makefile template (Makefile.in)
- Configuration file (config.m4)
- Source code for your module
We will describe now how to create these and how to put things
together.
CONVERTING AN EXISTING EXTENSION
Just to show you how easy it is to create a self-contained
extension, we will convert an embedded extension into a
self-contained one. Install PHP and execute the following
commands.
$ mkdir /tmp/newext
$ cd /tmp/newext
You now have an empty directory. We will copy the files from
the mysql extension:
$ cp -rp php-4.0.X/ext/mysql/* .
It is time to finish the module. Run:
$ phpize
You can now ship the contents of the directory - the extension
can live completely on its own.
The user instructions boil down to
$ ./configure \
[--with-php-config=/path/to/php-config] \
[--with-mysql=MYSQL-DIR]
$ make install
The MySQL module will either use the embedded MySQL client
library or the MySQL installation in MYSQL-DIR.
DEFINING THE NEW EXTENSION
Our demo extension is called "foobar".
It consists of two source files "foo.c" and "bar.c"
(and any arbitrary amount of header files, but that is not
important here).
The demo extension does not reference any external
libraries (that is important, because the user does not
need to specify anything).
CREATING THE MAKEFILE TEMPLATE
The Makefile Template (Makefile.in) contains three lines:
------------------------------------------------------------------------------
LTLIBRARY_SHARED_NAME = foobar.la
LTLIBRARY_SOURCES = foo.c bar.c
include $(top_srcdir)/build/rules.mk
------------------------------------------------------------------------------
LTLIBRARY_SHARED_NAME specifies the name of the extension.
It must be of the form `ext-name.la'.
LTLIBRARY_SOURCES specifies the names of the sources files. You can
name an arbitrary number of source files here.
The final include directive includes the build rules (you usually
don't need to care about what happens there). rules.mk and other
files are installed by phpize which we will cover later.
CREATING THE M4 CONFIGURATION FILE
The m4 configuration can perform additional checks. For a
self-contained extension, you do not need more than a few
macro calls.
------------------------------------------------------------------------------
PHP_ARG_ENABLE(foobar,whether to enable foobar,
[ --enable-foobar Enable foobar])
PHP_EXTENSION(foobar, $ext_shared)
------------------------------------------------------------------------------
PHP_ARG_ENABLE will automatically set the correct variables, so
that the extension will be enabled by PHP_EXTENSION in shared mode.
CREATING SOURCE FILES
[You are currently alone here. There are a lot of existing modules,
use a simply module as a starting point and add your own code.]
CREATING THE SELF-CONTAINED EXTENSION
Put Makefile.in, config.m4 and the source files into one directory.
Then run phpize (this is installed during make install by PHP 4.0).
For example, if you configured PHP with --prefix=/php, you would run
$ /php/bin/phpize
This will automatically copy the necessary build files and create
configure from your config.m4.
And that's it. You now have a self-contained extension.
INSTALLING A SELF-CONTAINED EXTENSION
An extension can be installed by running:
$ ./configure \
[--with-php-config=/path/to/php-config]
$ make install
+87
View File
@@ -0,0 +1,87 @@
Using PHP4 with the Zeus Web Server
-----------------------------------
Zeus fully supports running PHP in combination with our webserver. A
significant improvement in PHP 4 is that you can now run PHP as an
ISAPI module, giving great performance benefits over traditional CGI
code.
Note that you will need to be running at least version 3.3.6 of the
webserver. If you are running an earlier version, please see our
website (http://www.zeus.com) for upgrade instructions.
To build the ISAPI version of PHP, start the configuration with:
./configure --with-zeus=/usr/local/zeus
Obviously, replace /usr/local/zeus with the location of where you have
installed Zeus on your machine. For PHP to build successfully, you
need to have 3.3.6 already installed, because the code relies on the
presence of header files provided with the latest version.
You may have to adjust the environment variable LDFLAGS and EXTRA_LIBS
in order to link in extra libraries. This depends on the platform on
which you are building and also on the compiler used (see below). A
standard GNU/Linux install with GCC should build fine with no changes.
Configuring the webserver
-------------------------
After running 'make' and 'make install', you will have a 'libphp4.so'
file. Copy this file into a directory reserved for ISAPI
binaries. Now, perform the following steps for each virtual server
that you wish to run PHP on:
1) On the Admin server, go to 'edit server->path mapping'
2) Add an alias to the directory with libphp4.so in it, mapped to
/isapi/ (or a location of your choice). Make sure you set the alias
type to ISAPI.
3) Click 'update'
4) Add a handler for file extension 'php' to be run by /isapi/libphp4.so
5) Click 'update', then go back to the previous page.
6) Click on the 'module configuration' button, ensure that ISAPI
support is ticked.
7) Click on the ISAPI link. At the bottom of the page, click the
checkbox for running ISAPI extensions 'out of process'.
8) Click 'update'. Then restart the virtual server. Done!
Troubleshooting
---------------
*) Why does my PHP library fail to load?
After configuring Zeus, if you get a '502 Bad Gatway' error when
accessing a PHP page, there are problems loading the PHP
library. Check the error log ($ZEUSHOME/web/log/errors) for errors.
Failing to load the PHP ISAPI module is likely to be due to unresolved
symbols in the module. A way to check for this is to visit our support
page at http://support.zeus.com/faq/entries/isapi_error.html and run
the program there on your libphp4.so. It will list any unresolved
symbols.
*) My libphp4.so has unresolved symbols. How do I fix this?
You must ensure that the PHP build process links in the appropriate
libraries that contain these symbols! The libraries required will
depend on the platform you are running PHP on.
You may need to set one or two environment variables before running
the 'configure' program to set up PHP; LDFLAGS and EXTRA_LIBS. Make
sure that you also export these variables to the build process.
(Type 'export LDFLAGS EXTRA_LIBS' in the shell to do this.)
Specific examples:
Solaris + gcc:
Ensure you run ./configure with the `--enable-libgcc' parameter. You
may need to set LDFLAGS to '-L/usr/local/egcs/lib' (path depends on
your gcc installation)
For more information and help with Zeus, please visit our website:
http://www.zeus.com
+46 -41
View File
@@ -3,18 +3,17 @@ parenthesis means that person has taken on this project.
Zend
----
* allow foreach ($array as $k => &$val) syntax. right now we can not
* allow foreach ($array as $k => &$val) syntax. right now we cannot
traverse an array without copying each element.
* look al replacing c-lib call tolower().
* look at replacing c-lib call tolower().
global
------
* always build the standalone executable as well as the chosen SAPI
target.
* make sure all source files have the "right" copyright.
* the following modules still use PHP3_TLS_*() macros (and thereby don't
work in ZTS mode): ext/dav/dav.c, ext/db/db.c, ext/gd/gd.c, ext/ldap/ldap.c
* let every module (source-file) have it's own module & function_entry
block. Right now the math functions are in math.c but the corresponding
function-entries are in basic_functions.
* make sure that all ZTS globals get destructed. Most ts_allocate_id()
calls should have a dtor entry.
* activate all extensions by default that don't rely on external
@@ -22,65 +21,58 @@ global
* --enable-all in configure. (--enable-shared=max ...)
* make configure print out a summary when it's done (like XEmacs)
* replace standard functions which work on static data with
reentrant-save functions
* there is only one current directory per process; to make
chdir() etc. thread-safe, we must introduce a per-thread
current directory
* on some platforms unimplemented function will just do nothing (eg symlink)
they should print a warning or be not even defined!
* banish the legacy of php3_ prefixes
* implement javadoc based function docs template system
* use thread-safe resolver functions (either require BIND 8 or adns)
* check for incorrect *_r (time related) on HPSUX
* provide optional IPv6 support
reentrancy-safe functions.
* on some platforms unimplemented function will just do nothing (e.g. symlink)
they should print a warning or not even be defined!
* implement javadoc based function docs template system.
* use thread-safe resolver functions (either require BIND 8 or adns).
* provide optional IPv6 support.
* make SAPI conform to CGI/1.1. Currently, all SAPI modules
define REMOTE_ADDR etc. themselves and reach only various level
of compliance.
* find a better way to implement script timeouts. SIGVTALRM is used
by some POSIX threads implementations (i.e. OpenBSD) and is not
available in ZTS mode.
* add aliases to functions to conform to new naming conventions, e.g.
str_to_upper().
documentation
-------------
* add remarks in the documentation which functions are not implemented on win32.
* add remarks in the documentation which functions are not binary-safe.
ext/pcre
--------
* use/support latest pcre v3.1.
ext/wddx
--------
* See if we can support the remaining datatypes:
dateTime
binary
recordset
http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm
* implement wddx_packet_as_javascript(). (Andrei)
ext/dav
--------
* rewrite
* rewrite.
ext/mcrypt
----------
* port to mcrypt-2.6 or later
ext/oci8
--------
* all OCIFetch*() functions should return 0 for no more data and false on error.
* have a flag that trims trailing spaces from CHAR fields on retrieval.
ext/snmp
ext/pcre
--------
* port to latest UCD-SNMP 4.1 (even doesn't compile)
* have a non-greedy option for preg_replace().
* have an option for preg_grep() to return keys as well.
* update the online docs from version 3.1 man page
ext/standard
------------
* add a version number to data serialized via serialize().
* array_add(), array_rand() (Andrei)
* implement pathinfo()
* array_add(), array_uniq(). (Andrei)
* implement pathinfo() (what the heck is it?)
* possibly modify parsing of GPC data to automatically create arrays if
variable name is seen more than once.
* implement regex-cache for url-functions.
* strpad() (Andrei)
* stri_replace() (Andrei)
* comparing arrays semantically (like Python) (Andrei)
* move socket related functions to fsock.c
* strpad(). (Andrei)
* strcase_replace(). (Andrei)
* comparing arrays semantically (like Python). (Andrei)
* move socket related functions to fsock.c.
* get_defined_funcs(), get_defined_vars().
* NOT binary safe:
strtok()
basename()
@@ -89,6 +81,19 @@ ext/standard
strrchr()
strip_tags()
ext/wddx
--------
* implement __sleep() and __wakeup() the way serialize()/unserialize() do.
* See if we can support the remaining datatypes:
dateTime
binary
recordset
http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm
(Andrei)
* implement wddx_packet_as_javascript(). (Andrei)
other cool stuff
----------------
* PVM extension
-75
View File
@@ -1,75 +0,0 @@
This is the ChangeLog from PHP3 as of Apr 12 1999.
Entries should be removed from this file, if you transfer changes
over to PHP4.
============================================================================
?? 1999, Version 3.0.8
- added Oracle-OCI8 persistent connections
- fixed OCIDefineByName crash.
- fixed some NULL-column related problems in OCI8-module.
- Some Informix driver improvements.
- PUT method support (mlemos@acm.org)
- Fix parameter count problem in odbc_setoption()
- Really fix implode() this time. The fix in 3.0.7 was bogus
- Make fgetss() slightly smarter
- Add strip_tags() which uses the fgetss state-machine but acts on a string
March 1 1999, Version 3.0.7
- Added pdf_put_image and pdf_execute_image
- Initial work on an ImageMagick module - doesn't do anything yet
- Make configure script detect Netscape's LDAP SDK automagically
- Fixed Oracle-OCI8 module for windows.
- Add OCIRowCount function. (Number of affected rows for update-statements)
- Add OCIDefineByName function.
- Change the behaviour of open_basedir. It's now possible to supply more
than one directory. open_basedir paths from parent directories are now
automatically inherited.
- fix rand() and mt_rand() to make the ranges work correctly
- htmlspecialchars() and htmlentities() are now binary safe.
- Add extract() function.
- Oracle-OCI8 driver now supports BLOBS/CLOBS and IN/OUT binding of local php
variables.
- Clean up apxs build
- Add INSTALL.REDHAT file to walk RedHat users through the install
- Add function_exists() function.
- Add another version of WDDX module
(we need to pick a single implementation here)
- Fixed includes for iODBC to support both the old and the new LGPL version
- Fix implode() bug - When imploding an array that contained unset() elements
it wasn't correctly skipping past these
- Add connection_status() function. This returns the raw bitfield which
indicates whether the script terminated due to a user abort, a timeout
or normally. Note that if ignore_user_abort is enabled, then both the
timeout state and the user abort state can be active
- Add connection_timeout() function. This one can be called in a shutdown
function to tell you if you got there because of a timeout
- Add ignore_user_abort() function and .ini/.conf directive of same name
- Fix connection abort detection code - It should now work reliably with
Apache. Also added a user-level connection_aborted() function designed to
let people check whether the user aborted the connection in a user-level
shutdown function.
- Add pfsockopen() function
- Improvements in FreeType support: Macintosh fonts work, and non-antialiased
output is considerably cleaner <mka@satama.com>
- Fixed checkdate() function, range of valid years is now 0 to 32767
- hw_insertdocument() returns object id now
- Add pdf_open() warning in configure and documentation
- Add diskfreespace() function
- Added aspell support
- Iptcparse would sometimes find a wrong tag.
- Force var_dump() to output headers
- Add optional 3th parameter to ora_fetchinto.
- Serialize and var_dump no longer show array elements that
have been unset.
- Add IptcEmbed() function (can replace an APP13-Marker in a JPEG file)
- Add OCI8 module for Windows
- Fix bug in pdf_close() function
- Add WDDX support (see http://www.wddx.org for more info)
- Add similar_text() function
- Introduce simple regex compilation cache
+29 -12
View File
@@ -45,12 +45,17 @@ AC_DEFUN(PTHREADS_FLAGS,[
PTHREAD_FLAGS="-D_THREAD_SAFE";;
*irix*)
PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";;
*hpux*)
PTHREAD_FLAGS="-D_REENTRANT";;
*sco*)
PTHREAD_FLAGS="-D_REENTRANT";;
dnl Solves sigwait() problem, creates problems with u_long etc.
dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";;
esac
if test -n "$PTHREAD_FLAGS"; then
CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS"
fi
])dnl
dnl
dnl PTHREADS_CHECK_COMPILE
@@ -60,6 +65,7 @@ dnl
AC_DEFUN(PTHREADS_CHECK_COMPILE, [
AC_TRY_RUN( [
#include <pthread.h>
#include <stddef.h>
void *thread_routine(void *data) {
return data;
@@ -67,7 +73,9 @@ void *thread_routine(void *data) {
int main() {
pthread_t thd;
pthread_mutexattr_t mattr;
int data = 1;
pthread_mutexattr_init(&mattr);
return pthread_create(&thd, NULL, thread_routine, &data);
} ], [
pthreads_working="yes"
@@ -80,28 +88,26 @@ dnl
dnl Try to find a way to enable POSIX threads
dnl
AC_DEFUN(PTHREADS_CHECK,[
if test -n "$ac_cv_pthreads_lib"; then
LIBS="$LIBS -l$ac_cv_pthreads_lib"
fi
if test -n "$ac_cv_pthreads_cflags"; then
CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
fi
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
PTHREADS_ASSIGN_VARS
PTHREADS_CHECK_COMPILE
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
ac_cv_pthreads_cflags=""
if test "$pthreads_working" != "yes"; then
for flag in -pthreads -pthread -mthreads; do
for flag in -pthreads -pthread -mthreads -Kthread; do
ac_save="$CFLAGS"
CFLAGS="$CFLAGS $flag"
PTHREADS_CHECK_COMPILE
PTHREADS_CHECK_COMPILE
CFLAGS="$ac_save"
if test "$pthreads_working" = "yes"; then
ac_cv_pthreads_cflags="$flag"
break
fi
CFLAGS="$ac_save"
done
fi
])
@@ -113,11 +119,11 @@ if test "$pthreads_working" != "yes"; then
ac_save="$LIBS"
LIBS="$LIBS -l$lib"
PTHREADS_CHECK_COMPILE
LIBS="$ac_save"
if test "$pthreads_working" = "yes"; then
ac_cv_pthreads_lib="$lib"
break
fi
LIBS="$ac_save"
done
fi
])
@@ -128,3 +134,14 @@ else
threads_result="POSIX Threads not found"
fi
])dnl
dnl
dnl
AC_DEFUN(PTHREADS_ASSIGN_VARS,[
if test -n "$ac_cv_pthreads_lib"; then
LIBS="$LIBS -l$ac_cv_pthreads_lib"
fi
if test -n "$ac_cv_pthreads_cflags"; then
CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
fi
])dnl
+4 -4
View File
@@ -23,16 +23,16 @@ libZend_la_DEPENDENCIES = $(ZEND_SCANNER)
# automake isn't too clever about "non-standard" use of lex and yacc
zend-scanner.l: zend-parser.h
$(libZend_la_OBJECTS) zend-scanner.lo zend-scanner-cc.lo: zend-parser.h
zend-scanner.c: zend-scanner.l
zend-scanner.c: $(srcdir)/zend-scanner.l
$(LEX) -Pzend -o$@ -i $(srcdir)/zend-scanner.l
zend-scanner-cc.cc: zend-scanner.l
zend-scanner-cc.cc: $(srcdir)/zend-scanner.l
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -o$@ $(srcdir)/zend-scanner.l
zend-parser.h: zend-parser.c
zend-parser.c: zend-parser.y
zend-parser.c: $(srcdir)/zend-parser.y
$(YACC) -p zend -v -d $(srcdir)/zend-parser.y -o zend-parser.c
depend:
+3 -8
View File
@@ -50,13 +50,8 @@ dlfcn.h)
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_CHECK_LIB(c, dlopen, [
# fake it
AC_DEFINE(HAVE_LIBDL) ], [
AC_CHECK_LIB(dl, dlopen, [
LIBS="-ldl $LIBS"
AC_DEFINE(HAVE_LIBDL) ], []) ])
AC_CHECK_LIB(dl, dlopen, [LIBS="-ldl $LIBS"])
AC_CHECK_FUNC(dlopen,[AC_DEFINE(HAVE_LIBDL, 1,[ ])])
dnl This is required for QNX and may be some BSD derived systems
AC_CHECK_TYPE( uint, unsigned int )
@@ -67,7 +62,7 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MEMCMP
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol)
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite)
AC_ZEND_BROKEN_SPRINTF
AC_SUBST(ZEND_SCANNER)
+1
View File
@@ -1,4 +1,5 @@
#define ZEND_API
#define ZEND_DLEXPORT
@TOP@
+13 -12
View File
@@ -60,7 +60,7 @@
%left '|'
%left '^'
%left '&'
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
%left T_SL T_SR
%left '+' '-' '.'
@@ -268,9 +268,9 @@ switch_case_list:
case_list:
/* empty */ { $$.u.opline_num = -1; }
| case_list T_CASE expr case_separator { do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); }
| case_list T_DEFAULT case_separator { do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); }
/* empty */ { $$.op_type = IS_UNUSED; }
| case_list T_CASE expr case_separator { do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
| case_list T_DEFAULT case_separator { do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
;
@@ -454,6 +454,7 @@ expr_without_variable:
| '!' expr { do_unary_op(ZEND_BOOL_NOT, &$$, &$2 CLS_CC); }
| '~' expr { do_unary_op(ZEND_BW_NOT, &$$, &$2 CLS_CC); }
| expr T_IS_IDENTICAL expr { do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
| expr T_IS_NOT_IDENTICAL expr { do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
| expr T_IS_EQUAL expr { do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
| expr T_IS_NOT_EQUAL expr { do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
| expr '<' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 CLS_CC); }
@@ -496,8 +497,8 @@ function_call:
exit_expr:
/* empty */ { $$.op_type = IS_UNUSED; }
| '(' ')' { $$.op_type = IS_UNUSED; }
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
| '(' expr ')' { $$ = $2; }
;
@@ -680,11 +681,11 @@ encaps_list:
| encaps_list T_ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_BAD_CHARACTER { do_add_string(&$$, &$1, &$2 CLS_CC); }
| encaps_list '[' { $2.u.constant.value.chval = '['; do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list ']' { $2.u.constant.value.chval = ']'; do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list '{' { $2.u.constant.value.chval = '{'; do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list '}' { $2.u.constant.value.chval = '}'; do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.chval = '-'; do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.chval = '>'; do_add_char(&$$, &tmp, &$2 CLS_CC); }
| encaps_list '[' { $2.u.constant.value.lval = (long) '['; do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list ']' { $2.u.constant.value.lval = (long) ']'; do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list '{' { $2.u.constant.value.lval = (long) '{'; do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list '}' { $2.u.constant.value.lval = (long) '}'; do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.lval = (long) '-'; do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.lval = (long) '>'; do_add_char(&$$, &tmp, &$2 CLS_CC); }
| /* empty */ { do_init_string(&$$ CLS_CC); }
;
@@ -711,7 +712,7 @@ encaps_var_offset:
internal_functions_in_yacc:
T_ISSET '(' cvar ')' { do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); }
| T_EMPTY '(' cvar ')' { do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); }
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
| T_INCLUDE_ONCE expr { do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
| T_EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
;
+36 -29
View File
@@ -316,19 +316,19 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
END_EXTERN_C()
ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ...)
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...)
{
va_list files;
zend_op_array *op_array;
va_start(files, file_count);
op_array = v_compile_files(mark_as_ref CLS_CC, file_count, files);
op_array = zend_v_compile_files(type CLS_CC, file_count, files);
va_end(files);
return op_array;
}
ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count, va_list files)
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files)
{
zend_lex_state original_lex_state;
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
@@ -348,7 +348,7 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
retval_znode.u.constant.is_ref = 0;
retval_znode.u.constant.refcount = 1;
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
save_lexical_state(&original_lex_state CLS_CC);
retval = op_array; /* success oriented */
@@ -389,9 +389,6 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
if (compiled_files>0) {
CG(active_op_array) = original_active_op_array;
pass_two(op_array);
if (mark_as_ref) {
pass_include_eval(op_array);
}
} else {
CG(active_op_array) = original_active_op_array;
destroy_op_array(op_array);
@@ -404,7 +401,7 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
}
zend_op_array *compile_filename(int mode, zval *filename CLS_DC ELS_DC)
zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
{
zend_file_handle file_handle;
zval tmp;
@@ -423,16 +420,16 @@ zend_op_array *compile_filename(int mode, zval *filename CLS_DC ELS_DC)
file_handle.opened_path = NULL;
if (mode==ZEND_REQUIRE) {
if (type==ZEND_REQUIRE) {
/* We don't want to hear about inclusion failures; If we fail,
* we'll generate a require failure
*/
error_reporting = EG(error_reporting);
EG(error_reporting) = 0;
}
retval = zend_compile_files(1 CLS_CC, 1, &file_handle);
retval = zend_compile_files(type CLS_CC, 1, &file_handle);
if (mode==ZEND_REQUIRE) {
if (type==ZEND_REQUIRE) {
EG(error_reporting) = error_reporting;
if (!retval) {
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, filename->value.str.val);
@@ -489,8 +486,7 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
convert_to_string(&tmp);
source_string = &tmp;
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
op_array->type = ZEND_EVAL_CODE;
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE);
save_lexical_state(&original_lex_state CLS_CC);
if (prepare_string_for_scanning(source_string CLS_CC)==FAILURE) {
destroy_op_array(op_array);
@@ -542,6 +538,10 @@ int require_filename(char *filename, zend_bool unique CLS_DC)
int use_filename(char *filename, uint filename_length CLS_DC)
{
zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()");
return FAILURE;
#if 0
zend_file_handle file_handle;
file_handle.filename = (char *) emalloc(filename_length + zend_uv.import_use_extension_length);
@@ -557,6 +557,7 @@ int use_filename(char *filename, uint filename_length CLS_DC)
return FAILURE; /* will never get here */
}
return SUCCESS;
#endif
}
@@ -583,6 +584,7 @@ int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC)
pfh->type = ZEND_HANDLE_FILENAME;
if (pfh->filename) {
pfh->filename = estrdup(pfh->filename);
pfh->free_filename = 1;
}
if (pfh->opened_path) {
pfh->opened_path = strdup(pfh->opened_path);
@@ -989,6 +991,10 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
return T_IS_IDENTICAL;
}
<ST_IN_SCRIPTING>"!==" {
return T_IS_NOT_IDENTICAL;
}
<ST_IN_SCRIPTING>"==" {
return T_IS_EQUAL;
}
@@ -1310,14 +1316,15 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
<ST_IN_SCRIPTING>"%>"([\n]|"\r\n")? {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext,yyleng);
if (CG(asp_tags)) {
BEGIN(INITIAL);
zendlval->value.str.val = yytext; /* no copying - intentional */
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
} else {
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
return T_INLINE_HTML;
}
}
@@ -1550,7 +1557,7 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"$"[^a-zA-Z_\x7f-\xff{] {
zendlval->value.chval = yytext[0];
zendlval->value.lval = (long) yytext[0];
if (yyleng == 2) {
yyless(1);
/*unput(yytext[1]);
@@ -1562,12 +1569,12 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>{ENCAPSED_TOKENS} {
zendlval->value.chval = yytext[0];
zendlval->value.lval = (long) yytext[0];
return yytext[0];
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
zendlval->value.chval = yytext[0];
zendlval->value.lval = (long) yytext[0];
yy_push_state(ST_IN_SCRIPTING);
/*unput('$');*/
yyless(1);
@@ -1576,54 +1583,54 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
<ST_SINGLE_QUOTE>"\\'" {
zendlval->value.chval='\'';
zendlval->value.lval = (long) '\'';
return T_CHARACTER;
}
<ST_SINGLE_QUOTE>"\\\\" {
zendlval->value.chval='\\';
zendlval->value.lval = (long)'\\';
return T_CHARACTER;
}
<ST_DOUBLE_QUOTES>"\\\"" {
zendlval->value.chval='"';
zendlval->value.lval = (long) '"';
return T_CHARACTER;
}
<ST_BACKQUOTE>"\\`" {
zendlval->value.chval='`';
zendlval->value.lval = (long) '`';
return T_CHARACTER;
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\"[0-7]{1,3} {
zendlval->value.chval = (char) strtol (yytext+1, NULL, 8);
zendlval->value.lval = strtol(yytext+1, NULL, 8);
return T_CHARACTER;
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\x"[0-9A-Fa-f]{1,2} {
zendlval->value.chval = (char) strtol (yytext+2, NULL, 16);
zendlval->value.lval = strtol (yytext+2, NULL, 16);
return T_CHARACTER;
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\". {
switch (yytext[1]) {
case 'n':
zendlval->value.chval='\n';
zendlval->value.lval = (long) '\n';
break;
case 't':
zendlval->value.chval='\t';
zendlval->value.lval = (long) '\t';
break;
case 'r':
zendlval->value.chval='\r';
zendlval->value.lval = (long) '\r';
break;
case '\\':
zendlval->value.chval='\\';
zendlval->value.lval = (long) '\\';
break;
case '$':
zendlval->value.chval=yytext[1];
zendlval->value.lval = (long) yytext[1];
break;
case '{':
zendlval->value.chval=yytext[1];
zendlval->value.lval = (long) yytext[1];
break;
default:
zendlval->value.str.val = estrndup(yytext,yyleng);
+127 -12
View File
@@ -40,7 +40,6 @@
ZEND_API zend_class_entry zend_standard_class_def;
ZEND_API int (*zend_printf)(const char *format, ...);
ZEND_API zend_write_func_t zend_write;
ZEND_API void (*zend_error)(int type, const char *format, ...);
ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
ZEND_API void (*zend_block_interruptions)(void);
ZEND_API void (*zend_unblock_interruptions)(void);
@@ -48,6 +47,12 @@ ZEND_API void (*zend_ticks_function)(int ticks);
static void (*zend_message_dispatcher_p)(long message, void *data);
static int (*zend_get_ini_entry_p)(char *name, uint name_length, zval *contents);
#if ZEND_NEW_ERROR_HANDLING
static void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
#else
ZEND_API void (*zend_error_cb)(int type, const char *format, ...);
#endif
#ifdef ZTS
ZEND_API int compiler_globals_id;
ZEND_API int executor_globals_id;
@@ -64,7 +69,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */
/* version information */
static char *zend_version_info;
static uint zend_version_info_length;
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2000 Zend Technologies Ltd.\n"
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2000 Zend Technologies\n"
#define PRINT_ZVAL_INDENT 4
@@ -275,14 +280,14 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals)
zend_startup_constants(ELS_C);
zend_copy_constants(executor_globals->zend_constants, global_constants_table);
}
init_resource_plist(ELS_C);
zend_init_rsrc_plist(ELS_C);
}
static void executor_globals_dtor(zend_executor_globals *executor_globals)
{
zend_shutdown_constants(ELS_C);
destroy_resource_plist(ELS_C);
zend_destroy_rsrc_plist(ELS_C);
}
@@ -306,7 +311,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
#endif
/* Set up utility functions and values */
zend_error = utility_functions->error_function;
zend_error_cb = utility_functions->error_function;
zend_printf = utility_functions->printf_function;
zend_write = (zend_write_func_t) utility_functions->write_function;
zend_fopen = utility_functions->fopen_function;
@@ -319,10 +324,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_get_ini_entry_p = utility_functions->get_ini_entry;
zend_ticks_function = utility_functions->ticks_function;
zend_compile_files = compile_files;
zend_v_compile_files = v_compile_files;
zend_execute = execute;
zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1);
zend_startup_extensions();
/* set up version */
zend_version_info = strdup(ZEND_CORE_VERSION_INFO);
@@ -334,7 +339,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_hash_init(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1);
register_standard_class();
zend_hash_init(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1);
zend_hash_init(&list_destructors, 50, NULL, NULL, 1);
zend_init_rsrc_list_dtors();
/* This zval can be used to initialize allocate zval's to an uninit'ed value */
zval_used_for_init.is_ref = 0;
@@ -358,7 +363,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_register_standard_constants(ELS_C);
#ifndef ZTS
init_resource_plist(ELS_C);
zend_init_rsrc_plist(ELS_C);
#endif
if (start_builtin_functions) {
@@ -372,9 +377,9 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
void zend_shutdown()
{
#ifndef ZTS
destroy_resource_plist();
zend_destroy_rsrc_plist();
#endif
zend_hash_destroy(&list_destructors);
zend_destroy_rsrc_list_dtors();
zend_hash_destroy(&module_registry);
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
free(GLOBAL_FUNCTION_TABLE);
@@ -455,10 +460,18 @@ void zend_activate_modules()
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_request_startup);
}
void zend_deactivate_modules()
{
ELS_FETCH();
EG(opline_ptr) = NULL; /* we're no longer executing anything */
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_cleanup);
}
void zend_deactivate(CLS_D ELS_DC)
{
zend_hash_apply(&module_registry, (int (*)(void *)) module_registry_cleanup);
EG(opline_ptr) = NULL; /* we're no longer executing anything */
shutdown_scanner(CLS_C);
shutdown_executor(ELS_C);
shutdown_compiler(CLS_C);
@@ -483,3 +496,105 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents)
return FAILURE;
}
}
#if ZEND_NEW_ERROR_HANDLING
#define ZEND_ERROR_BUFFER_SIZE 1024
ZEND_API void zend_error(int type, const char *format, ...)
{
va_list args;
zval **params;
zval retval;
zval error_type, error_message;
char *error_filename;
uint error_lineno;
ELS_FETCH();
CLS_FETCH();
/* Obtain relevant filename and lineno */
switch (type) {
case E_CORE_ERROR:
case E_CORE_WARNING:
error_filename = NULL;
error_lineno = 0;
break;
case E_PARSE:
case E_COMPILE_ERROR:
case E_COMPILE_WARNING:
case E_ERROR:
case E_NOTICE:
case E_WARNING:
case E_USER_ERROR:
case E_USER_WARNING:
case E_USER_NOTICE:
if (zend_is_compiling()) {
error_filename = zend_get_compiled_filename(CLS_C);
error_lineno = zend_get_compiled_lineno(CLS_C);
} else if (zend_is_executing()) {
error_filename = zend_get_executed_filename(ELS_C);
error_lineno = zend_get_executed_lineno(ELS_C);
} else {
error_filename = NULL;
error_lineno = 0;
}
break;
default:
error_filename = NULL;
error_lineno = 0;
break;
}
if (!error_filename) {
error_filename = "Unknown";
}
va_start(args, format);
/* if we don't have a user defined error handler */
if (!EG(user_error_handler)) {
zend_error_cb(type, error_filename, error_lineno, format, args);
} else switch (type) {
case E_ERROR:
case E_PARSE:
case E_CORE_ERROR:
case E_CORE_WARNING:
case E_COMPILE_ERROR:
case E_COMPILE_WARNING:
/* The error may not be safe to handle in user-space */
zend_error_cb(type, error_filename, error_lineno, format, args);
break;
default:
/* Handle the error in user space */
INIT_PZVAL(&error_message);
INIT_PZVAL(&error_type);
error_message.value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
/* error_message.value.str.len = vsnprintf(error_message->value.str.val, error_message->value.str.len-1, format, args); */
error_message.value.str.len = vsprintf(error_message.value.str.val, format, args);
error_message.type = IS_STRING;
error_type.value.lval = type;
error_type.type = IS_LONG;
params = (zval **) emalloc(sizeof(zval *)*2);
params[0] = &error_type;
params[1] = &error_message;
if (call_user_function(CG(function_table), NULL, EG(user_error_handler), &retval, 2, params)==SUCCESS) {
zval_dtor(&retval);
} else {
/* The user error handler failed, use built-in error handler */
zend_error_cb(type, error_filename, error_lineno, format, args);
}
efree(params);
efree(error_message.value.str.val);
break;
}
va_end(args);
}
#endif
+18 -6
View File
@@ -21,7 +21,9 @@
#ifndef _ZEND_H
#define _ZEND_H
#define ZEND_VERSION "0.92"
#define ZEND_VERSION "1.00"
#define ZEND_NEW_ERROR_HANDLING 0
#ifdef __cplusplus
#define BEGIN_EXTERN_C() extern "C" {
@@ -157,7 +159,6 @@ typedef union _zvalue_value {
char *val;
int len;
} str;
char chval; /* char value */
HashTable *ht; /* hash table value */
struct {
zend_class_entry *ce;
@@ -186,7 +187,7 @@ typedef struct _zend_function_entry {
typedef struct _zend_property_reference {
int type; /* read, write or r/w */
zval *object;
zend_llist elements_list;
zend_llist *elements_list;
} zend_property_reference;
@@ -220,7 +221,11 @@ struct _zend_class_entry {
typedef struct _zend_utility_functions {
#if ZEND_NEW_ERROR_HANDLING
void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
#else
void (*error_function)(int type, const char *format, ...);
#endif
int (*printf_function)(const char *format, ...);
int (*write_function)(const char *str, uint str_length);
FILE *(*fopen_function)(const char *filename, char **opened_path);
@@ -315,12 +320,19 @@ ZEND_API extern char *empty_string;
BEGIN_EXTERN_C()
extern ZEND_API int (*zend_printf)(const char *format, ...);
extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API void (*zend_error)(int type, const char *format, ...);
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path);
extern ZEND_API void (*zend_block_interruptions)(void);
extern ZEND_API void (*zend_unblock_interruptions)(void);
extern ZEND_API void (*zend_ticks_function)(int ticks);
#if ZEND_NEW_ERROR_HANDLING
ZEND_API void zend_error(int type, const char *format, ...);
#else
#define zend_error zend_error_cb
ZEND_API void (*zend_error_cb)(int type, const char *format, ...);
#endif
void zenderror(char *error);
extern ZEND_API zend_class_entry zend_standard_class_def;
@@ -397,7 +409,7 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
} \
INIT_PZVAL(&(zv));
#define ZEND_MAX_RESERVED_RESOURCES 1
#define ZEND_MAX_RESERVED_RESOURCES 2
#ifdef ZEND_WIN32
/* Only use this macro if you know for sure that all of the switches values
+4 -22
View File
@@ -30,7 +30,7 @@
/* these variables are true statics/globals, and have to be mutex'ed on every access */
static int module_count=0;
HashTable list_destructors, module_registry;
HashTable module_registry;
/* this function doesn't check for too many parameters */
ZEND_API int zend_get_parameters(int ht, int param_count, ...)
@@ -707,26 +707,6 @@ ZEND_API int zend_startup_module(zend_module_entry *module)
}
ZEND_API int _register_list_destructors(void (*list_destructor)(void *), void (*plist_destructor)(void *), int module_number)
{
list_destructors_entry ld;
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
ld.list_destructor=(void (*)(void *)) list_destructor;
ld.plist_destructor=(void (*)(void *)) plist_destructor;
ld.module_number = module_number;
ld.resource_id = list_destructors.nNextFreeElement;
if (zend_hash_next_index_insert(&list_destructors,(void *) &ld,sizeof(list_destructors_entry),NULL)==FAILURE) {
return FAILURE;
}
return list_destructors.nNextFreeElement-1;
}
/* registers all functions in *library_functions in the function hash */
int zend_register_functions(zend_function_entry *functions, HashTable *function_table)
{
@@ -815,8 +795,10 @@ ZEND_API int zend_register_module(zend_module_entry *module)
void module_destructor(zend_module_entry *module)
{
if (module->type == MODULE_TEMPORARY) {
zend_hash_apply_with_argument(&list_destructors, (int (*)(void *,void *)) clean_module_resource_destructors, (void *) &(module->module_number));
zend_clean_module_rsrc_dtors(module->module_number);
clean_module_constants(module->module_number);
if (module->request_shutdown_func)
module->request_shutdown_func(module->type, module->module_number);
}
if (module->module_started && module->module_shutdown_func) {
+50 -6
View File
@@ -27,12 +27,54 @@
#include "zend_operators.h"
#include "zend_variables.h"
#define ZEND_FN(name) zend_if_##name
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(zend_if_##name)
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
#define ZEND_NAMED_FE(zend_name, name, arg_types) { #zend_name, name, arg_types },
#define ZEND_FE(name, arg_types) ZEND_NAMED_FE(name, ZEND_FN(name), arg_types)
#define ZEND_FALIAS(name, alias, arg_types) ZEND_NAMED_FE(name, ZEND_FN(alias), arg_types)
#define ZEND_MINIT(module) zend_minit_##module
#define ZEND_MSHUTDOWN(module) zend_mshutdown_##module
#define ZEND_RINIT(module) zend_rinit_##module
#define ZEND_RSHUTDOWN(module) zend_rshutdown_##module
#define ZEND_MINFO(module) zend_info_##module
#define ZEND_GINIT(module) zend_ginit_##module
#define ZEND_GSHUTDOWN(module) zend_gshutdown_##module
#define ZEND_MINIT_FUNCTION(module) int ZEND_MINIT(module)(INIT_FUNC_ARGS)
#define ZEND_MSHUTDOWN_FUNCTION(module) int ZEND_MSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS)
#define ZEND_RINIT_FUNCTION(module) int ZEND_RINIT(module)(INIT_FUNC_ARGS)
#define ZEND_RSHUTDOWN_FUNCTION(module) int ZEND_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS)
#define ZEND_MINFO_FUNCTION(module) void ZEND_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS)
#define ZEND_GINIT_FUNCTION(module) int ZEND_GINIT(module)(GINIT_FUNC_ARGS)
#define ZEND_GSHUTDOWN_FUNCTION(module) int ZEND_GSHUTDOWN(module)(void)
#define ZEND_GET_MODULE(name) \
ZEND_DLEXPORT zend_module_entry *get_module(void) { return &name##_module_entry; }
#define ZEND_BEGIN_MODULE_GLOBALS(module_name) \
typedef struct _zend_##module_name##_globals {
#define ZEND_END_MODULE_GLOBALS(module_name) \
} zend_##module_name##_globals;
#ifdef ZTS
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
static ts_rsrc_id module_name##_globals_id;
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
module_name##_globals_id = ts_allocate_id(sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
#else
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
static zend_##module_name##_globals module_name##_globals;
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
globals_ctor(&module_name##_globals);
#endif
#define ZEND_NAMED_FE(runtime_name, name, arg_types) { #runtime_name, name, arg_types },
#define ZEND_FE(name, arg_types) ZEND_NAMED_FE(name, zend_if_##name, arg_types)
#define INIT_CLASS_ENTRY(class_container, class_name, functions) \
@@ -76,10 +118,12 @@ ZEND_API void wrong_param_count(void);
#define getThis() (this_ptr)
#define WRONG_PARAM_COUNT { wrong_param_count(); return; }
#define WRONG_PARAM_COUNT_WITH_RETVAL(ret) { wrong_param_count(); return ret; }
#define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT()
#define WRONG_PARAM_COUNT_WITH_RETVAL(ret) ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)
#define ARG_COUNT(dummy) (ht)
#define ZEND_NUM_ARGS() (ht)
#define ZEND_WRONG_PARAM_COUNT() { wrong_param_count(); return; }
#define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret) { wrong_param_count(); return ret; }
#ifndef ZEND_WIN32
#define DLEXPORT
+23 -1
View File
@@ -319,6 +319,11 @@ ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
ZEND_API void start_memory_manager(ALS_D)
{
#ifndef ZTS
int i, j;
void *cached_entries[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
#endif
AG(phead) = AG(head) = NULL;
#if MEMORY_LIMIT
@@ -334,6 +339,23 @@ ZEND_API void start_memory_manager(ALS_D)
memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head)));
memset(AG(cache_count),0,MAX_CACHED_MEMORY*sizeof(unsigned char));
#ifndef ZTS
/* Initialize cache, to prevent fragmentation */
/* We can't do this in ZTS mode, because calling emalloc() from within start_memory_manager()
* will yield an endless recursion calling to alloc_globals_ctor()
*/
for (i=1; i<MAX_CACHED_MEMORY; i++) {
for (j=0; j<MAX_CACHED_ENTRIES; j++) {
cached_entries[i][j] = emalloc(i);
}
}
for (i=1; i<MAX_CACHED_MEMORY; i++) {
for (j=0; j<MAX_CACHED_ENTRIES; j++) {
efree(cached_entries[i][j]);
}
}
#endif
}
@@ -611,7 +633,7 @@ ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
/* add the block to the persistent list */
ADD_POINTER_TO_LIST(p);
HANDLE_UNBLOCK_INTERRUPTIONS();
return p->size;
return p->size+sizeof(zend_mem_header)+PLATFORM_PADDING;
}
+120 -22
View File
@@ -46,12 +46,15 @@ static ZEND_FUNCTION(leak);
#ifdef ZEND_TEST_EXCEPTIONS
static ZEND_FUNCTION(crash);
#endif
static ZEND_FUNCTION(get_used_files);
static ZEND_FUNCTION(get_required_files);
static ZEND_FUNCTION(get_included_files);
static ZEND_FUNCTION(is_subclass_of);
static ZEND_FUNCTION(get_class_vars);
static ZEND_FUNCTION(get_object_vars);
static ZEND_FUNCTION(get_class_methods);
static ZEND_FUNCTION(user_error);
static ZEND_FUNCTION(set_user_error_handler);
static ZEND_FUNCTION(get_declared_classes);
unsigned char first_arg_force_ref[] = { 1, BYREF_FORCE };
unsigned char first_arg_allow_ref[] = { 1, BYREF_ALLOW };
@@ -80,12 +83,15 @@ static zend_function_entry builtin_functions[] = {
#ifdef ZEND_TEST_EXCEPTIONS
ZEND_FE(crash, NULL)
#endif
ZEND_FE(get_used_files, NULL)
ZEND_FE(get_required_files, NULL)
ZEND_FE(get_included_files, NULL)
ZEND_FE(is_subclass_of, NULL)
ZEND_FE(get_class_vars, NULL)
ZEND_FE(get_object_vars, NULL)
ZEND_FE(get_class_methods, NULL)
ZEND_FE(user_error, NULL)
ZEND_FE(set_user_error_handler, NULL)
ZEND_FE(get_declared_classes, NULL)
{ NULL, NULL, NULL }
};
@@ -107,14 +113,13 @@ ZEND_FUNCTION(func_num_args)
void **p;
int arg_count;
p = EG(argument_stack).top_element-1;
if (p) {
p = EG(argument_stack).top_element-1-1;
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
p -= 1+arg_count;
if (*p) {
zend_error(E_ERROR, "func_num_args(): Can't be used as a function parameter");
}
--p;
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
p = EG(argument_stack).top_element-1-arg_count-2;
if (p>=EG(argument_stack).elements) {
RETURN_LONG((ulong) *p);
} else {
@@ -138,14 +143,13 @@ ZEND_FUNCTION(func_get_arg)
convert_to_long_ex(z_requested_offset);
requested_offset = (*z_requested_offset)->value.lval;
p = EG(argument_stack).top_element-1;
if (p) {
p = EG(argument_stack).top_element-1-1;
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_arg(); */
p -= 1+arg_count;
if (*p) {
zend_error(E_ERROR, "func_get_arg(): Can't be used as a function parameter");
}
--p;
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
p = EG(argument_stack).top_element-1-arg_count-2;
--p;
if (p<EG(argument_stack).elements) {
zend_error(E_WARNING, "func_get_arg(): Called from the global scope - no function context");
RETURN_FALSE;
@@ -169,15 +173,14 @@ ZEND_FUNCTION(func_get_args)
int arg_count;
int i;
p = EG(argument_stack).top_element-1;
if (p) {
p = EG(argument_stack).top_element-1-1;
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_args(); */
p -= 1+arg_count;
if (*p) {
zend_error(E_ERROR, "func_get_args(): Can't be used as a function parameter");
}
--p;
arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */
--p;
p = EG(argument_stack).top_element-1-arg_count-2;
if (p<EG(argument_stack).elements) {
zend_error(E_WARNING, "func_get_args(): Called from the global scope - no function context");
RETURN_FALSE;
@@ -675,17 +678,112 @@ static int copy_import_use_file(zend_file_handle *fh, zval *array)
}
ZEND_FUNCTION(get_used_files)
/* {{{ proto array get_required_files(void)
Returns an array with the file names that were require_once()'d */
ZEND_FUNCTION(get_required_files)
{
CLS_FETCH();
if (ZEND_NUM_ARGS() != 0) {
WRONG_PARAM_COUNT;
}
array_init(return_value);
zend_hash_apply_with_argument(&CG(used_files), (int (*)(void *, void *)) copy_import_use_file, return_value);
zend_hash_apply_with_argument(&CG(used_files), (apply_func_arg_t) copy_import_use_file, return_value);
}
/* }}} */
/* {{{ proto array get_included_files(void)
Returns an array with the file names that were include_once()'d */
ZEND_FUNCTION(get_included_files)
{
if (ZEND_NUM_ARGS() != 0) {
WRONG_PARAM_COUNT;
}
array_init(return_value);
zend_hash_apply_with_argument(&EG(included_files), (int (*)(void *, void *)) copy_import_use_file, return_value);
zend_hash_apply_with_argument(&EG(included_files), (apply_func_arg_t) copy_import_use_file, return_value);
}
/* }}} */
/* {{{ proto void user_error(string messsage [, int error_type])
Generates a user-level error/warning/notice message */
ZEND_FUNCTION(user_error)
{
int error_type = E_USER_NOTICE;
zval **z_error_type, **z_error_message;
switch(ZEND_NUM_ARGS()) {
case 1:
if (zend_get_parameters_ex(1, &z_error_message)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
break;
case 2:
if (zend_get_parameters_ex(2, &z_error_message, &z_error_type)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
convert_to_long_ex(z_error_type);
error_type = (*z_error_type)->value.lval;
switch (error_type) {
case E_USER_ERROR:
case E_USER_WARNING:
case E_USER_NOTICE:
break;
default:
zend_error(E_WARNING, "Invalid error type specified");
RETURN_FALSE;
break;
}
break;
}
convert_to_string_ex(z_error_message);
zend_error(error_type, (*z_error_message)->value.str.val);
RETURN_TRUE;
}
/* }}} */
ZEND_FUNCTION(set_user_error_handler)
{
zval **error_handler;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &error_handler)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
convert_to_string_ex(error_handler);
if (EG(user_error_handler)) {
zval_dtor(EG(user_error_handler));
} else {
ALLOC_ZVAL(EG(user_error_handler));
}
*EG(user_error_handler) = **error_handler;
zval_copy_ctor(EG(user_error_handler));
RETURN_TRUE;
}
static int copy_class_name(zend_class_entry *ce, zval *array)
{
add_next_index_stringl(array, ce->name, ce->name_length, 1);
return 0;
}
/* {{{ proto array get_declared_classes(void)
Returns an array of all declared classes. */
ZEND_FUNCTION(get_declared_classes)
{
CLS_FETCH();
if (ZEND_NUM_ARGS() != 0) {
WRONG_PARAM_COUNT;
}
array_init(return_value);
zend_hash_apply_with_argument(CG(class_table), (apply_func_arg_t)copy_class_name, return_value);
}
/* }}} */
+43 -34
View File
@@ -26,7 +26,7 @@
#include "zend_fast_cache.h"
ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
#ifndef ZTS
@@ -107,7 +107,7 @@ void init_compiler(CLS_D ELS_DC)
CG(allow_call_time_pass_reference) = ZEND_UV(allow_call_time_pass_reference);
CG(handle_op_arrays) = 1;
CG(in_compilation) = 0;
init_resource_list(ELS_C);
zend_init_rsrc_list(ELS_C);
CG(unclean_shutdown) = 0;
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_open_file_dtor, 0);
zend_hash_init(&CG(used_files), 5, NULL, (void (*)(void *)) zend_open_file_dtor_wrapper, 0);
@@ -412,9 +412,8 @@ void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC)
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
opline->opcode = ZEND_JMPZNZ;
opline->result = *expr; /* the conditional expression */
opline->op1 = *expr; /* the conditional expression */
second_semicolon_token->u.opline_num = for_cond_op_number;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
}
@@ -425,7 +424,7 @@ void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CL
opline->opcode = ZEND_JMP;
opline->op1.u.opline_num = cond_start->u.opline_num;
CG(active_op_array)->opcodes[second_semicolon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
CG(active_op_array)->opcodes[second_semicolon_token->u.opline_num].extended_value = get_next_op_number(CG(active_op_array));
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
@@ -716,7 +715,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
function_token->u.op_array = CG(active_op_array);
zend_str_tolower(name, name_len);
init_op_array(&op_array, INITIAL_OP_ARRAY_SIZE);
init_op_array(&op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
op_array.function_name = name;
op_array.arg_types = NULL;
@@ -787,19 +786,21 @@ void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, un
} else {
SET_UNUSED(opline->op2);
}
if (pass_type==BYREF_FORCE && !CG(active_op_array)->arg_types) {
int i;
if (!CG(active_op_array)->arg_types) {
if (pass_type==BYREF_FORCE) {
int i;
CG(active_op_array)->arg_types = (unsigned char *) emalloc(sizeof(unsigned char)*(offset->u.constant.value.lval+1));
for (i=1; i<offset->u.constant.value.lval; i++) {
CG(active_op_array)->arg_types[i] = BYREF_NONE;
CG(active_op_array)->arg_types = (unsigned char *) emalloc(sizeof(unsigned char)*(offset->u.constant.value.lval+1));
for (i=1; i<offset->u.constant.value.lval; i++) {
CG(active_op_array)->arg_types[i] = BYREF_NONE;
}
CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval;
CG(active_op_array)->arg_types[offset->u.constant.value.lval] = pass_type;
}
CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval;
}
if (CG(active_op_array)->arg_types) {
} else {
CG(active_op_array)->arg_types = (unsigned char *) erealloc(CG(active_op_array)->arg_types, sizeof(unsigned char)*(offset->u.constant.value.lval+1));
CG(active_op_array)->arg_types[0]=(unsigned char) offset->u.constant.value.lval;
CG(active_op_array)->arg_types[offset->u.constant.value.lval] = pass_type;
CG(active_op_array)->arg_types[0]++;
}
}
@@ -906,9 +907,9 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
zend_error(E_COMPILE_WARNING,
"Call-time pass-by-reference has been deprecated - argument passed by value; "
"If you would like to pass it by reference, modify the declaration of %s(). "
"If you would like to enable call-time pass-by-reference, you can set"
"If you would like to enable call-time pass-by-reference, you can set "
"allow_call_time_pass_reference to true in your INI file. "
"However, future versions may not support this any longer.",
"However, future versions may not support this any longer. ",
(function_ptr?function_ptr->common.function_name:"[runtime function name]"),
offset+1);
}
@@ -976,7 +977,7 @@ static int generate_free_switch_expr(zend_switch_entry *switch_entry CLS_DC)
{
zend_op *opline;
if (switch_entry->cond.op_type == IS_UNUSED) {
if (switch_entry->cond.op_type!=IS_VAR && switch_entry->cond.op_type!=IS_TMP_VAR) {
return 1;
}
@@ -993,7 +994,7 @@ static int generate_free_foreach_copy(znode *foreach_copy CLS_DC)
{
zend_op *opline;
if (foreach_copy->op_type == IS_UNUSED) {
if (foreach_copy->op_type!=IS_VAR && foreach_copy->op_type!=IS_TMP_VAR) {
return 1;
}
@@ -1018,11 +1019,11 @@ void do_return(znode *expr, int do_end_vparse CLS_DC)
}
}
#ifdef ZTS
zend_stack_apply_with_argument(&CG(switch_cond_stack), (int (*)(void *element, void *)) generate_free_switch_expr, ZEND_STACK_APPLY_TOPDOWN CLS_CC);
zend_stack_apply_with_argument(&CG(foreach_copy_stack), (int (*)(void *element, void *)) generate_free_foreach_copy, ZEND_STACK_APPLY_TOPDOWN CLS_CC);
zend_stack_apply_with_argument(&CG(switch_cond_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_switch_expr CLS_CC);
zend_stack_apply_with_argument(&CG(foreach_copy_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element, void *)) generate_free_foreach_copy CLS_CC);
#else
zend_stack_apply(&CG(switch_cond_stack), (int (*)(void *element)) generate_free_switch_expr, ZEND_STACK_APPLY_TOPDOWN);
zend_stack_apply(&CG(foreach_copy_stack), (int (*)(void *element)) generate_free_foreach_copy, ZEND_STACK_APPLY_TOPDOWN);
zend_stack_apply(&CG(switch_cond_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element)) generate_free_switch_expr);
zend_stack_apply(&CG(foreach_copy_stack), ZEND_STACK_APPLY_TOPDOWN, (int (*)(void *element)) generate_free_foreach_copy);
#endif
opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1140,6 +1141,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
ce->parent = parent_ce;
do_inherit_parent_constructor(ce);
/* Register the derived class */
if (zend_hash_add(class_table, class_name, strlen(class_name)+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
if (!compile_time) {
@@ -1148,8 +1150,10 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
(*ce->refcount)--;
zend_hash_destroy(&ce->function_table);
zend_hash_destroy(&ce->default_properties);
*(class_name-1) = ':';
return FAILURE;
}
*(class_name-1) = ':';
return SUCCESS;
}
break;
@@ -1181,6 +1185,8 @@ void do_early_binding(CLS_D)
zval_dtor(&opline->op1.u.constant);
zval_dtor(&opline->op2.u.constant);
opline->opcode = ZEND_NOP;
memset(&opline->op1, 0, sizeof(znode));
memset(&opline->op2, 0, sizeof(znode));
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
}
@@ -1319,7 +1325,7 @@ void do_switch_end(znode *case_list CLS_DC)
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
if (case_list->u.opline_num != -1) { /* empty switch */
if (case_list->op_type != IS_UNUSED) { /* non-empty switch */
int next_op_number = get_next_op_number(CG(active_op_array));
CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
@@ -1340,11 +1346,13 @@ void do_switch_end(znode *case_list CLS_DC)
CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].cont = CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].brk = get_next_op_number(CG(active_op_array));
CG(active_op_array)->current_brk_cont = CG(active_op_array)->brk_cont_array[CG(active_op_array)->current_brk_cont].parent;
/* emit free for the switch condition*/
opline = get_next_op(CG(active_op_array) CLS_CC);
opline->opcode = ZEND_SWITCH_FREE;
opline->op1 = switch_entry_ptr->cond;
SET_UNUSED(opline->op2);
if (switch_entry_ptr->cond.op_type==IS_VAR || switch_entry_ptr->cond.op_type==IS_TMP_VAR) {
/* emit free for the switch condition*/
opline = get_next_op(CG(active_op_array) CLS_CC);
opline->opcode = ZEND_SWITCH_FREE;
opline->op1 = switch_entry_ptr->cond;
SET_UNUSED(opline->op2);
}
if (switch_entry_ptr->cond.op_type == IS_CONST) {
zval_dtor(&switch_entry_ptr->cond.u.constant);
}
@@ -1384,7 +1392,7 @@ void do_case_before_statement(znode *case_list, znode *case_token, znode *case_e
SET_UNUSED(opline->op2);
case_token->u.opline_num = next_op_number;
if (case_list->u.opline_num==-1) {
if (case_list->op_type==IS_UNUSED) {
return;
}
next_op_number = get_next_op_number(CG(active_op_array));
@@ -1443,7 +1451,7 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
switch_entry_ptr->default_case = next_op_number;
next_op_number = get_next_op_number(CG(active_op_array));
if (case_list->u.opline_num==-1) {
if (case_list->op_type==IS_UNUSED) {
return;
}
CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
@@ -1844,6 +1852,7 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
znode lval;
znode result;
if (fetch_type==ZEND_FETCH_STATIC && static_assignment) {
zval *tmp;
@@ -1866,14 +1875,14 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
opline->op1 = *varname;
SET_UNUSED(opline->op2);
opline->op2.u.fetch_type = fetch_type;
result = opline->result;
if (varname->op_type == IS_CONST) {
zval_copy_ctor(&varname->u.constant);
}
fetch_simple_variable(&lval, varname, 0 CLS_CC); /* Relies on the fact that the default fetch is BP_VAR_W */
do_assign_ref(NULL, &lval, &opline->result CLS_CC);
do_assign_ref(NULL, &lval, &result CLS_CC);
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
}
@@ -1887,7 +1896,7 @@ void do_cast(znode *result, znode *expr, int type CLS_DC)
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *expr;
SET_UNUSED(opline->op2);
opline->op2.u.constant.type = type;
opline->extended_value = type;
*result = opline->result;
}
+112 -98
View File
@@ -59,8 +59,8 @@ typedef struct _znode {
zval constant;
zend_uint var;
int opline_num; /* Needs to be signed */
zend_uchar fetch_type;
zend_uint opline_num; /* Needs to be signed */
zend_uint fetch_type;
zend_op_array *op_array;
struct {
zend_uint var; /* dummy */
@@ -115,6 +115,7 @@ struct _zend_op_array {
int backpatch_count;
#endif
zend_bool return_reference;
zend_bool done_pass_two;
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
};
@@ -130,6 +131,16 @@ typedef struct _zend_internal_function {
} zend_internal_function;
typedef struct _zend_overloaded_function {
zend_uchar type; /* MUST be the first element of this struct! */
zend_uchar *arg_types; /* MUST be the second element of this struct */
char *function_name; /* MUST be the third element of this struct */
zend_uint var;
} zend_overloaded_function;
typedef union _zend_function {
zend_uchar type; /* MUST be the first element of this struct! */
struct {
@@ -140,6 +151,7 @@ typedef union _zend_function {
zend_op_array op_array;
zend_internal_function internal_function;
zend_overloaded_function overloaded_function;
} zend_function;
@@ -194,11 +206,12 @@ BEGIN_EXTERN_C()
void init_compiler(CLS_D ELS_DC);
void shutdown_compiler(CLS_D);
extern ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
extern ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
void zend_activate(CLS_D ELS_DC);
void zend_deactivate(CLS_D ELS_DC);
void zend_activate_modules(void);
void zend_deactivate_modules(void);
int lex_scan(zval *zendlval CLS_DC);
@@ -357,12 +370,12 @@ void do_ticks(CLS_D);
ZEND_API int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC);
ZEND_API int require_filename(char *filename, zend_bool unique CLS_DC);
ZEND_API int use_filename(char *filename, uint filename_length CLS_DC);
ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ...);
ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count, va_list files);
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...);
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files);
ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
ZEND_API zend_op_array *compile_filename(int mode, zval *filename CLS_DC ELS_DC);
ZEND_API zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC);
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
ZEND_API void init_op_array(zend_op_array *op_array, int initial_ops_size);
ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size);
ZEND_API void destroy_op_array(zend_op_array *op_array);
ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC);
ZEND_API void zend_open_file_dtor(zend_file_handle *fh);
@@ -380,7 +393,7 @@ int get_next_op_number(zend_op_array *op_array);
int print_class(zend_class_entry *class_entry);
void print_op_array(zend_op_array *op_array, int optimizations);
int pass_two(zend_op_array *op_array);
void pass_include_eval(zend_op_array *op_array);
ZEND_API void pass_include_eval(zend_op_array *op_array);
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
ZEND_API zend_bool zend_is_compiling(void);
@@ -403,120 +416,121 @@ int zendlex(znode *zendlval CLS_DC);
#define ZEND_BOOL_NOT 13
#define ZEND_BOOL_XOR 14
#define ZEND_IS_IDENTICAL 15
#define ZEND_IS_EQUAL 16
#define ZEND_IS_NOT_EQUAL 17
#define ZEND_IS_SMALLER 18
#define ZEND_IS_SMALLER_OR_EQUAL 19
#define ZEND_CAST 20
#define ZEND_QM_ASSIGN 21
#define ZEND_IS_NOT_IDENTICAL 16
#define ZEND_IS_EQUAL 17
#define ZEND_IS_NOT_EQUAL 18
#define ZEND_IS_SMALLER 19
#define ZEND_IS_SMALLER_OR_EQUAL 20
#define ZEND_CAST 21
#define ZEND_QM_ASSIGN 22
#define ZEND_ASSIGN_ADD 22
#define ZEND_ASSIGN_SUB 23
#define ZEND_ASSIGN_MUL 24
#define ZEND_ASSIGN_DIV 25
#define ZEND_ASSIGN_MOD 26
#define ZEND_ASSIGN_SL 27
#define ZEND_ASSIGN_SR 28
#define ZEND_ASSIGN_CONCAT 29
#define ZEND_ASSIGN_BW_OR 30
#define ZEND_ASSIGN_BW_AND 31
#define ZEND_ASSIGN_BW_XOR 32
#define ZEND_ASSIGN_ADD 23
#define ZEND_ASSIGN_SUB 24
#define ZEND_ASSIGN_MUL 25
#define ZEND_ASSIGN_DIV 26
#define ZEND_ASSIGN_MOD 27
#define ZEND_ASSIGN_SL 28
#define ZEND_ASSIGN_SR 29
#define ZEND_ASSIGN_CONCAT 30
#define ZEND_ASSIGN_BW_OR 31
#define ZEND_ASSIGN_BW_AND 32
#define ZEND_ASSIGN_BW_XOR 33
#define ZEND_PRE_INC 33
#define ZEND_PRE_DEC 34
#define ZEND_POST_INC 35
#define ZEND_POST_DEC 36
#define ZEND_ASSIGN 37
#define ZEND_ASSIGN_REF 38
#define ZEND_PRE_INC 34
#define ZEND_PRE_DEC 35
#define ZEND_POST_INC 36
#define ZEND_POST_DEC 37
#define ZEND_ASSIGN 38
#define ZEND_ASSIGN_REF 39
#define ZEND_ECHO 39
#define ZEND_PRINT 40
#define ZEND_ECHO 40
#define ZEND_PRINT 41
#define ZEND_JMP 41
#define ZEND_JMPZ 42
#define ZEND_JMPNZ 43
#define ZEND_JMPZNZ 44
#define ZEND_JMPZ_EX 45
#define ZEND_JMPNZ_EX 46
#define ZEND_CASE 47
#define ZEND_SWITCH_FREE 48
#define ZEND_BRK 49
#define ZEND_CONT 50
#define ZEND_BOOL 51
#define ZEND_JMP 42
#define ZEND_JMPZ 43
#define ZEND_JMPNZ 44
#define ZEND_JMPZNZ 45
#define ZEND_JMPZ_EX 46
#define ZEND_JMPNZ_EX 47
#define ZEND_CASE 48
#define ZEND_SWITCH_FREE 49
#define ZEND_BRK 50
#define ZEND_CONT 51
#define ZEND_BOOL 52
#define ZEND_INIT_STRING 52
#define ZEND_ADD_CHAR 53
#define ZEND_ADD_STRING 54
#define ZEND_ADD_VAR 55
#define ZEND_INIT_STRING 53
#define ZEND_ADD_CHAR 54
#define ZEND_ADD_STRING 55
#define ZEND_ADD_VAR 56
#define ZEND_BEGIN_SILENCE 56
#define ZEND_END_SILENCE 57
#define ZEND_BEGIN_SILENCE 57
#define ZEND_END_SILENCE 58
#define ZEND_INIT_FCALL_BY_NAME 58
#define ZEND_DO_FCALL 59
#define ZEND_DO_FCALL_BY_NAME 60
#define ZEND_RETURN 61
#define ZEND_INIT_FCALL_BY_NAME 59
#define ZEND_DO_FCALL 60
#define ZEND_DO_FCALL_BY_NAME 61
#define ZEND_RETURN 62
#define ZEND_RECV 62
#define ZEND_RECV_INIT 63
#define ZEND_RECV 63
#define ZEND_RECV_INIT 64
#define ZEND_SEND_VAL 64
#define ZEND_SEND_VAR 65
#define ZEND_SEND_REF 66
#define ZEND_SEND_VAL 65
#define ZEND_SEND_VAR 66
#define ZEND_SEND_REF 67
#define ZEND_NEW 67
#define ZEND_JMP_NO_CTOR 68
#define ZEND_FREE 69
#define ZEND_NEW 68
#define ZEND_JMP_NO_CTOR 69
#define ZEND_FREE 70
#define ZEND_INIT_ARRAY 70
#define ZEND_ADD_ARRAY_ELEMENT 71
#define ZEND_INIT_ARRAY 71
#define ZEND_ADD_ARRAY_ELEMENT 72
#define ZEND_INCLUDE_OR_EVAL 72
#define ZEND_INCLUDE_OR_EVAL 73
#define ZEND_UNSET_VAR 73
#define ZEND_UNSET_DIM_OBJ 74
#define ZEND_ISSET_ISEMPTY 75
#define ZEND_UNSET_VAR 74
#define ZEND_UNSET_DIM_OBJ 75
#define ZEND_ISSET_ISEMPTY 76
#define ZEND_FE_RESET 76
#define ZEND_FE_FETCH 77
#define ZEND_FE_RESET 77
#define ZEND_FE_FETCH 78
#define ZEND_EXIT 78
#define ZEND_EXIT 79
/* the following 18 opcodes are 6 groups of 3 opcodes each, and must
* remain in that order!
*/
#define ZEND_FETCH_R 79
#define ZEND_FETCH_DIM_R 80
#define ZEND_FETCH_OBJ_R 81
#define ZEND_FETCH_W 82
#define ZEND_FETCH_DIM_W 83
#define ZEND_FETCH_OBJ_W 84
#define ZEND_FETCH_RW 85
#define ZEND_FETCH_DIM_RW 86
#define ZEND_FETCH_OBJ_RW 87
#define ZEND_FETCH_IS 88
#define ZEND_FETCH_DIM_IS 89
#define ZEND_FETCH_OBJ_IS 90
#define ZEND_FETCH_FUNC_ARG 91
#define ZEND_FETCH_DIM_FUNC_ARG 92
#define ZEND_FETCH_OBJ_FUNC_ARG 93
#define ZEND_FETCH_UNSET 94
#define ZEND_FETCH_DIM_UNSET 95
#define ZEND_FETCH_OBJ_UNSET 96
#define ZEND_FETCH_R 80
#define ZEND_FETCH_DIM_R 81
#define ZEND_FETCH_OBJ_R 82
#define ZEND_FETCH_W 83
#define ZEND_FETCH_DIM_W 84
#define ZEND_FETCH_OBJ_W 85
#define ZEND_FETCH_RW 86
#define ZEND_FETCH_DIM_RW 87
#define ZEND_FETCH_OBJ_RW 88
#define ZEND_FETCH_IS 89
#define ZEND_FETCH_DIM_IS 90
#define ZEND_FETCH_OBJ_IS 91
#define ZEND_FETCH_FUNC_ARG 92
#define ZEND_FETCH_DIM_FUNC_ARG 93
#define ZEND_FETCH_OBJ_FUNC_ARG 94
#define ZEND_FETCH_UNSET 95
#define ZEND_FETCH_DIM_UNSET 96
#define ZEND_FETCH_OBJ_UNSET 97
#define ZEND_FETCH_DIM_TMP_VAR 97
#define ZEND_FETCH_CONSTANT 98
#define ZEND_FETCH_DIM_TMP_VAR 98
#define ZEND_FETCH_CONSTANT 99
#define ZEND_DECLARE_FUNCTION_OR_CLASS 99
#define ZEND_DECLARE_FUNCTION_OR_CLASS 100
#define ZEND_EXT_STMT 100
#define ZEND_EXT_FCALL_BEGIN 101
#define ZEND_EXT_FCALL_END 102
#define ZEND_EXT_NOP 103
#define ZEND_EXT_STMT 101
#define ZEND_EXT_FCALL_BEGIN 102
#define ZEND_EXT_FCALL_END 103
#define ZEND_EXT_NOP 104
#define ZEND_TICKS 104
#define ZEND_TICKS 105
/* end of block */
+2
View File
@@ -66,4 +66,6 @@ typedef unsigned int uint;
# define ZEND_API __declspec(dllimport)
#endif
#define ZEND_DLEXPORT __declspec(dllexport)
#endif /* _ZEND_CONFIG_W32_H */
+3
View File
@@ -108,6 +108,9 @@ void zend_register_standard_constants(ELS_D)
REGISTER_MAIN_LONG_CONSTANT("E_CORE_WARNING", E_CORE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_ERROR", E_COMPILE_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_COMPILE_WARNING", E_COMPILE_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_USER_ERROR", E_USER_ERROR, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_USER_WARNING", E_USER_WARNING, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_USER_NOTICE", E_USER_NOTICE, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_LONG_CONSTANT("E_ALL", E_ALL, CONST_PERSISTENT | CONST_CS);
+4 -1
View File
@@ -29,8 +29,11 @@
#define E_CORE_WARNING (1<<5L)
#define E_COMPILE_ERROR (1<<6L)
#define E_COMPILE_WARNING (1<<7L)
#define E_USER_ERROR (1<<8L)
#define E_USER_WARNING (1<<9L)
#define E_USER_NOTICE (1<<10L)
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING)
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
#endif /* _ZEND_ERRORS_H */
+112 -95
View File
@@ -54,9 +54,9 @@
/* Prototypes */
static zval get_overloaded_property(ELS_D);
static void set_overloaded_property(zval *value ELS_DC);
static void call_overloaded_function(int arg_count, zval *return_value ELS_DC);
static zval get_overloaded_property(temp_variable *T ELS_DC);
static void set_overloaded_property(temp_variable *T, zval *value ELS_DC);
static void call_overloaded_function(temp_variable *T, int arg_count, zval *return_value ELS_DC);
static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type ELS_DC);
static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type ELS_DC);
static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type ELS_DC);
@@ -96,21 +96,21 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
switch (Ts[node->u.var].EA.type) {
case IS_OVERLOADED_OBJECT:
Ts[node->u.var].tmp_var = get_overloaded_property(ELS_C);
Ts[node->u.var].tmp_var = get_overloaded_property(&Ts[node->u.var] ELS_CC);
Ts[node->u.var].tmp_var.refcount=1;
Ts[node->u.var].tmp_var.is_ref=1;
return &Ts[node->u.var].tmp_var;
break;
case IS_STRING_OFFSET: {
temp_variable *T = &Ts[node->u.var];
zval *str = T->EA.str;
zval *str = T->EA.data.str_offset.str;
if (T->EA.str->type != IS_STRING
|| (T->EA.str->value.str.len <= T->EA.offset)) {
if (T->EA.data.str_offset.str->type != IS_STRING
|| (T->EA.data.str_offset.str->value.str.len <= T->EA.data.str_offset.offset)) {
T->tmp_var.value.str.val = empty_string;
T->tmp_var.value.str.len = 0;
} else {
char c = str->value.str.val[T->EA.offset];
char c = str->value.str.val[T->EA.data.str_offset.offset];
T->tmp_var.value.str.val = estrndup(&c, 1);
T->tmp_var.value.str.len = 1;
@@ -148,7 +148,7 @@ static inline zval *_get_object_zval_ptr(znode *node, temp_variable *Ts, int *sh
return Ts[node->u.var].var.ptr;
} else {
if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) {
PZVAL_UNLOCK(Ts[node->u.var].EA.str);
PZVAL_UNLOCK(Ts[node->u.var].EA.data.str_offset.str);
}
*should_free = 1;
return NULL;
@@ -169,7 +169,7 @@ static inline zval **_get_zval_ptr_ptr(znode *node, temp_variable *Ts ELS_DC)
if (Ts[node->u.var].var.ptr_ptr) {
PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr);
} else if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) {
PZVAL_UNLOCK(Ts[node->u.var].EA.str);
PZVAL_UNLOCK(Ts[node->u.var].EA.data.str_offset.str);
}
return Ts[node->u.var].var.ptr_ptr;
} else {
@@ -262,7 +262,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (!variable_ptr_ptr) {
switch (Ts[op1->u.var].EA.type) {
case IS_OVERLOADED_OBJECT:
set_overloaded_property(value ELS_CC);
set_overloaded_property(&Ts[op1->u.var], value ELS_CC);
if (type == IS_TMP_VAR) {
zval_dtor(value);
}
@@ -270,8 +270,8 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
case IS_STRING_OFFSET: {
temp_variable *T = &Ts[op1->u.var];
if (T->EA.str->type == IS_STRING
&& (T->EA.offset < T->EA.str->value.str.len)) {
if (T->EA.data.str_offset.str->type == IS_STRING
&& (T->EA.data.str_offset.offset < T->EA.data.str_offset.str->value.str.len)) {
zval tmp;
zval *final_value = value;
@@ -284,7 +284,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
final_value = &tmp;
}
T->EA.str->value.str.val[T->EA.offset] = final_value->value.str.val[0];
T->EA.data.str_offset.str->value.str.val[T->EA.data.str_offset.offset] = final_value->value.str.val[0];
if (op2
&& op2->op_type == IS_VAR
&& value==&Ts[op2->u.var].tmp_var) {
@@ -295,10 +295,10 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
}
/*
* the value of an assignment to a string offset is undefined
Ts[result->u.var].var = &T->EA.str;
Ts[result->u.var].var = &T->EA.data.str_offset.str;
*/
}
/* zval_ptr_dtor(&T->EA.str); Nuke this line if it doesn't cause a leak */
/* zval_ptr_dtor(&T->EA.data.str_offset.str); Nuke this line if it doesn't cause a leak */
T->tmp_var.type = IS_STRING;
}
break;
@@ -623,7 +623,6 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
if (container_ptr == NULL) {
zend_property_reference *property_reference;
zend_overloaded_element overloaded_element;
if (Ts[op1->u.var].EA.type == IS_STRING_OFFSET) {
@@ -649,9 +648,8 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
zval_copy_ctor(&overloaded_element.element);
}
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
zend_llist_add_element(&property_reference->elements_list, &overloaded_element);
Ts[result->u.var].EA = Ts[op1->u.var].EA;
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
*retval = NULL;
@@ -712,6 +710,9 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
*retval = &EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(**retval, result);
FREE_OP(op2, free_op2);
if (type==BP_VAR_W || type==BP_VAR_RW) {
zend_error(E_WARNING, "Cannot use a NULL value as an array");
}
break;
case IS_STRING: {
zval *offset;
@@ -733,9 +734,9 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
}
container = *container_ptr;
Ts[result->u.var].EA.str = container;
Ts[result->u.var].EA.data.str_offset.str = container;
PZVAL_LOCK(container);
Ts[result->u.var].EA.offset = offset->value.lval;
Ts[result->u.var].EA.data.str_offset.offset = offset->value.lval;
Ts[result->u.var].EA.type = IS_STRING_OFFSET;
FREE_OP(op2, free_op2);
*retval = NULL;
@@ -753,6 +754,9 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
}
FREE_OP(op2, free_op2);
SELECTIVE_PZVAL_LOCK(**retval, result);
if (type==BP_VAR_W || type==BP_VAR_RW) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
}
break;
}
@@ -784,11 +788,10 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
if (container_ptr == NULL) {
zend_property_reference *property_reference;
zend_overloaded_element overloaded_element;
if (Ts[op1->u.var].EA.type == IS_STRING_OFFSET) {
zval_ptr_dtor(&Ts[op1->u.var].EA.str);
zval_ptr_dtor(&Ts[op1->u.var].EA.data.str_offset.str);
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
@@ -810,9 +813,8 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
zval_copy_ctor(&overloaded_element.element);
}
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
zend_llist_add_element(&property_reference->elements_list, &overloaded_element);
Ts[result->u.var].EA = Ts[op1->u.var].EA;
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
*retval = NULL;
@@ -828,27 +830,27 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
if (container->type == IS_OBJECT
&& container->value.obj.ce->handle_property_get) {
zend_property_reference property_reference;
zend_overloaded_element overloaded_element;
property_reference.object = container;
property_reference.type = type;
zend_llist_init(&property_reference.elements_list, sizeof(zend_overloaded_element), NULL, 0);
Ts[result->u.var].EA.data.overloaded_element.object = container;
Ts[result->u.var].EA.data.overloaded_element.type = type;
Ts[result->u.var].EA.data.overloaded_element.elements_list = (zend_llist *) emalloc(sizeof(zend_llist));
zend_llist_init(Ts[result->u.var].EA.data.overloaded_element.elements_list, sizeof(zend_overloaded_element), NULL, 0);
overloaded_element.element = *get_zval_ptr(op2, Ts, &free_op2, type);
overloaded_element.type = OE_IS_OBJECT;
if (!free_op2) {
zval_copy_ctor(&overloaded_element.element);
}
zend_llist_add_element(&property_reference.elements_list, &overloaded_element);
zend_stack_push(&EG(overloaded_objects_stack), &property_reference, sizeof(zend_property_reference));
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
*retval = NULL;
return;
}
if (container->type == IS_STRING && container->value.str.len==0) {
if (container->type==IS_NULL
|| (container->type==IS_BOOL && container->value.lval==0)
|| (container->type==IS_STRING && container->value.str.len==0)) {
switch (type) {
case BP_VAR_RW:
case BP_VAR_W:
@@ -895,43 +897,31 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
}
static zval get_overloaded_property(ELS_D)
static zval get_overloaded_property(temp_variable *T ELS_DC)
{
zend_property_reference *property_reference;
zval result;
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
result = (property_reference->object)->value.obj.ce->handle_property_get(property_reference);
result = (T->EA.data.overloaded_element.object)->value.obj.ce->handle_property_get(&T->EA.data.overloaded_element);
zend_llist_destroy(&property_reference->elements_list);
zend_stack_del_top(&EG(overloaded_objects_stack));
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
return result;
}
static void set_overloaded_property(zval *value ELS_DC)
static void set_overloaded_property(temp_variable *T, zval *value ELS_DC)
{
zend_property_reference *property_reference;
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
(property_reference->object)->value.obj.ce->handle_property_set(property_reference, value);
zend_llist_destroy(&property_reference->elements_list);
zend_stack_del_top(&EG(overloaded_objects_stack));
(T->EA.data.overloaded_element.object)->value.obj.ce->handle_property_set(&T->EA.data.overloaded_element, value);
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
}
static void call_overloaded_function(int arg_count, zval *return_value ELS_DC)
static void call_overloaded_function(temp_variable *T, int arg_count, zval *return_value ELS_DC)
{
zend_property_reference *property_reference;
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
(property_reference->object)->value.obj.ce->handle_function_call(arg_count, return_value, property_reference->object, 1 ELS_CC, property_reference);
zend_llist_destroy(&property_reference->elements_list);
zend_stack_del_top(&EG(overloaded_objects_stack));
(T->EA.data.overloaded_element.object)->value.obj.ce->handle_function_call(arg_count, return_value, T->EA.data.overloaded_element.object, 1 ELS_CC, &T->EA.data.overloaded_element);
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
}
@@ -1051,6 +1041,9 @@ void execute(zend_op_array *op_array ELS_DC)
case ZEND_IS_IDENTICAL:
EG(binary_op) = is_identical_function;
goto binary_op_addr;
case ZEND_IS_NOT_IDENTICAL:
EG(binary_op) = is_not_identical_function;
goto binary_op_addr;
case ZEND_IS_EQUAL:
EG(binary_op) = is_equal_function;
goto binary_op_addr;
@@ -1367,18 +1360,18 @@ binary_assign_op_addr: {
}
NEXT_OPCODE();
case ZEND_JMPZNZ: {
znode *res = &opline->result;
znode *res = &opline->op1;
if (!zend_is_true(get_zval_ptr(res, Ts, &EG(free_op1), BP_VAR_R))) {
if (zend_is_true(get_zval_ptr(res, Ts, &EG(free_op1), BP_VAR_R))) {
#if DEBUG_ZEND>=2
printf("Conditional jmp on true to %d\n", opline->extended_value);
#endif
opline = &op_array->opcodes[opline->extended_value];
} else {
#if DEBUG_ZEND>=2
printf("Conditional jmp on false to %d\n", opline->op2.u.opline_num);
#endif
opline = &op_array->opcodes[opline->op2.u.opline_num];
} else {
#if DEBUG_ZEND>=2
printf("Conditional jmp on true to %d\n", opline->op1.u.opline_num);
#endif
opline = &op_array->opcodes[opline->op1.u.opline_num];
}
FREE_OP(res, EG(free_op1));
}
@@ -1515,31 +1508,28 @@ binary_assign_op_addr: {
if ((!object.ptr && Ts[opline->op1.u.var].EA.type==IS_OVERLOADED_OBJECT)
|| ((object.ptr && object.ptr->type==IS_OBJECT) && (object.ptr->value.obj.ce->handle_function_call))) { /* overloaded function call */
zend_overloaded_element overloaded_element;
zend_property_reference *property_reference;
overloaded_element.element = *function_name;
overloaded_element.type = OE_IS_METHOD;
if (object.ptr) {
zend_property_reference property_reference;
property_reference.object = object.ptr;
property_reference.type = BP_VAR_NA;
zend_llist_init(&property_reference.elements_list, sizeof(zend_overloaded_element), NULL, 0);
zend_stack_push(&EG(overloaded_objects_stack), &property_reference, sizeof(zend_property_reference));
Ts[opline->op1.u.var].EA.data.overloaded_element.object = object.ptr;
Ts[opline->op1.u.var].EA.data.overloaded_element.type = BP_VAR_NA;
Ts[opline->op1.u.var].EA.data.overloaded_element.elements_list = (zend_llist *) emalloc(sizeof(zend_llist));
zend_llist_init(Ts[opline->op1.u.var].EA.data.overloaded_element.elements_list, sizeof(zend_overloaded_element), NULL, 0);
}
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
zend_llist_add_element(&property_reference->elements_list, &overloaded_element);
zend_llist_add_element(Ts[opline->op1.u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
fbc = (zend_function *) emalloc(sizeof(zend_function));
fbc->type = ZEND_OVERLOADED_FUNCTION;
fbc->common.arg_types = NULL;
fbc->overloaded_function.var = opline->op1.u.var;
goto overloaded_function_call_cont;
}
if (!object.ptr || object.ptr->type != IS_OBJECT) {
zend_error(E_ERROR, "Call to a member function on a non-object");
}
object.ptr->refcount++; /* For this pointer */
object.ptr->refcount++; /* For $this pointer */
active_function_table = &(object.ptr->value.obj.ce->function_table);
}
} else { /* function pointer */
@@ -1643,7 +1633,7 @@ do_fcall_common:
} else { /* ZEND_OVERLOADED_FUNCTION */
ALLOC_ZVAL(Ts[opline->result.u.var].var.ptr);
INIT_ZVAL(*(Ts[opline->result.u.var].var.ptr));
call_overloaded_function(opline->extended_value, Ts[opline->result.u.var].var.ptr ELS_CC);
call_overloaded_function(&Ts[fbc->overloaded_function.var], opline->extended_value, Ts[opline->result.u.var].var.ptr ELS_CC);
efree(fbc);
if (!return_value_used) {
zval_ptr_dtor(&Ts[opline->result.u.var].var.ptr);
@@ -1884,7 +1874,7 @@ send_by_ref:
} else {
switch_expr_is_overloaded = 1;
if (Ts[opline->op1.u.var].EA.type==IS_STRING_OFFSET) {
Ts[opline->op1.u.var].EA.str->refcount++;
Ts[opline->op1.u.var].EA.data.str_offset.str->refcount++;
}
}
}
@@ -2012,7 +2002,7 @@ send_by_ref:
if (!EG(free_op1)) {
zendi_zval_copy_ctor(*result);
}
switch (opline->op2.u.constant.type) {
switch (opline->extended_value) {
case IS_NULL:
convert_to_null(result);
break;
@@ -2041,38 +2031,65 @@ send_by_ref:
zend_op_array *new_op_array=NULL;
zval **original_return_value = EG(return_value_ptr_ptr);
int return_value_used;
zval *inc_filename = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
zval tmp_inc_filename;
CLS_FETCH();
if (inc_filename->type!=IS_STRING) {
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
convert_to_string(&tmp_inc_filename);
inc_filename = &tmp_inc_filename;
}
return_value_used = RETURN_VALUE_USED(opline);
switch (opline->op2.u.constant.value.lval) {
case ZEND_INCLUDE_ONCE:
{
FILE *inc_file;
case ZEND_INCLUDE_ONCE: {
char *opened_path;
int dummy = 0;
int dummy = 1;
zend_file_handle file_handle;
inc_file = zend_fopen(opline->op1.u.constant.value.str.val, &opened_path);
file_handle.handle.fp = zend_fopen(inc_filename->value.str.val, &opened_path);
file_handle.type = ZEND_HANDLE_FP;
file_handle.filename = inc_filename->value.str.val;
file_handle.free_filename = 0;
if (inc_file && opened_path) {
if (zend_hash_add(&EG(included_files), opened_path, strlen(opened_path)+1, (void *)&dummy, sizeof(int), NULL)==FAILURE) {
fclose(inc_file);
if (file_handle.handle.fp) {
if (!opened_path || zend_hash_add(&EG(included_files), opened_path, strlen(opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) {
new_op_array = zend_compile_files(ZEND_INCLUDE CLS_CC, 1, &file_handle);
if (new_op_array) {
pass_include_eval(new_op_array);
} else {
fclose(file_handle.handle.fp);
}
} else {
fclose(file_handle.handle.fp);
}
if (opened_path) {
free(opened_path);
break;
}
fclose(inc_file);
free(opened_path);
}
break;
}
break;
case ZEND_INCLUDE:
case ZEND_REQUIRE:
new_op_array = compile_filename(opline->op2.u.constant.value.lval, get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R) CLS_CC ELS_CC);
{
new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename CLS_CC ELS_CC);
if (new_op_array) {
pass_include_eval(new_op_array);
}
break;
}
case ZEND_EVAL:
new_op_array = compile_string(get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R) CLS_CC);
new_op_array = compile_string(inc_filename CLS_CC);
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
FREE_OP(&opline->op1, EG(free_op1));
Ts[opline->result.u.var].var.ptr = NULL;
Ts[opline->result.u.var].var.ptr_ptr = &Ts[opline->result.u.var].var.ptr;
@@ -2255,8 +2272,8 @@ send_by_ref:
if (!var) {
if (Ts[opline->op1.u.var].EA.type==IS_STRING_OFFSET) {
if (Ts[opline->op1.u.var].EA.offset>=0
&& Ts[opline->op1.u.var].EA.offset<Ts[opline->op1.u.var].EA.str->value.str.len) {
if (Ts[opline->op1.u.var].EA.data.str_offset.offset>=0
&& Ts[opline->op1.u.var].EA.data.str_offset.offset<Ts[opline->op1.u.var].EA.data.str_offset.str->value.str.len) {
isset = 1;
} else {
isset = 0;
@@ -2278,7 +2295,7 @@ send_by_ref:
case ZEND_ISEMPTY:
if (!var) {
if (!isset
|| Ts[opline->op1.u.var].EA.str->value.str.val[Ts[opline->op1.u.var].EA.offset]=='0') {
|| Ts[opline->op1.u.var].EA.data.str_offset.str->value.str.val[Ts[opline->op1.u.var].EA.data.str_offset.offset]=='0') {
Ts[opline->result.u.var].tmp_var.value.lval = 1;
} else {
Ts[opline->result.u.var].tmp_var.value.lval = 0;
+9 -3
View File
@@ -33,8 +33,14 @@ typedef union _temp_variable {
struct {
zval tmp_var; /* a dummy */
zval *str;
int offset;
union {
struct {
zval *str;
int offset;
} str_offset;
zend_property_reference overloaded_element;
} data;
unsigned char type;
} EA;
} temp_variable;
@@ -47,7 +53,7 @@ void shutdown_executor(ELS_D);
void execute(zend_op_array *op_array ELS_DC);
ZEND_API int zend_is_true(zval *op);
ZEND_API inline void safe_free_zval_ptr(zval *p);
ZEND_API void zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC);
ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC);
ZEND_API inline int i_zend_is_true(zval *op);
ZEND_API int zval_update_constant(zval **pp);
ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC);
+26 -8
View File
@@ -85,7 +85,6 @@ void init_executor(CLS_D ELS_DC)
EG(uninitialized_zval_ptr)=&EG(uninitialized_zval);
EG(error_zval_ptr)=&EG(error_zval);
zend_ptr_stack_init(&EG(arg_types_stack));
zend_stack_init(&EG(overloaded_objects_stack));
/* destroys stack frame, therefore makes core dumps worthless */
#if 0&&ZEND_DEBUG
original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv);
@@ -116,14 +115,19 @@ void init_executor(CLS_D ELS_DC)
zend_hash_init(&EG(included_files), 5, NULL, NULL, 0);
EG(ticks_count) = 0;
EG(user_error_handler) = NULL;
}
void shutdown_executor(ELS_D)
{
zval_dtor(&EG(global_return_value));
if (EG(global_return_value_ptr) == &EG(global_return_value)) {
zval_dtor(&EG(global_return_value));
} else {
zval_ptr_dtor(EG(return_value_ptr_ptr));
}
zend_ptr_stack_destroy(&EG(arg_types_stack));
zend_stack_destroy(&EG(overloaded_objects_stack));
while (EG(symtable_cache_ptr)>=EG(symtable_cache)) {
zend_hash_destroy(*EG(symtable_cache_ptr));
@@ -140,7 +144,7 @@ void shutdown_executor(ELS_D)
}
}
destroy_resource_list(ELS_C); /* must be destroyed after the main symbol table is destroyed */
zend_destroy_rsrc_list(ELS_C); /* must be destroyed after the main symbol table is destroyed */
zend_ptr_stack_destroy(&EG(argument_stack));
if (EG(main_op_array)) {
@@ -152,8 +156,12 @@ void shutdown_executor(ELS_D)
signal(SIGSEGV, original_sigsegv_handler);
#endif
zend_hash_destroy(&EG(included_files));
if (EG(user_error_handler)) {
zval_dtor(EG(user_error_handler));
FREE_ZVAL(EG(user_error_handler));
}
}
@@ -284,7 +292,12 @@ ZEND_API int zval_update_constant(zval **pp)
if (p->type == IS_CONSTANT) {
zval c;
int refcount = p->refcount;
int refcount;
SEPARATE_ZVAL(pp);
p = *pp;
refcount = p->refcount;
if (!zend_get_constant(p->value.str.val, p->value.str.len, &c)) {
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'",
@@ -298,6 +311,8 @@ ZEND_API int zval_update_constant(zval **pp)
INIT_PZVAL(p);
p->refcount = refcount;
} else if (p->type == IS_ARRAY) {
SEPARATE_ZVAL(pp);
p = *pp;
zend_hash_apply(p->value.ht, (int (*)(void *)) zval_update_constant);
}
return 0;
@@ -423,13 +438,14 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
}
ZEND_API void zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC)
ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC)
{
zval pv;
zend_op_array *new_op_array;
zend_op_array *original_active_op_array = EG(active_op_array);
zend_function_state *original_function_state_ptr = EG(function_state_ptr);
int original_handle_op_arrays;
int retval;
if (retval_ptr) {
pv.value.str.len = strlen(str)+sizeof("return ;")-1;
@@ -480,10 +496,12 @@ ZEND_API void zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC)
destroy_op_array(new_op_array);
efree(new_op_array);
EG(return_value_ptr_ptr) = original_return_value_ptr_ptr;
retval = SUCCESS;
} else {
printf("Failed executing:\n%s\n", str);
retval = FAILURE;
}
zval_dtor(&pv);
return retval;
}
+54 -10
View File
@@ -44,7 +44,7 @@ int zend_load_extension(char *path)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_HANDLE handle;
zend_extension extension, *new_extension;
zend_extension *new_extension;
zend_extension_version_info *extension_version_info;
handle = DL_LOAD(path);
@@ -100,27 +100,41 @@ int zend_load_extension(char *path)
return FAILURE;
}
return zend_register_extension(new_extension, handle);
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
return FAILURE;
#endif
}
int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
{
#if ZEND_EXTENSIONS_SUPPORT
zend_extension extension;
if (new_extension->startup) {
if (new_extension->startup(new_extension)!=SUCCESS) {
DL_UNLOAD(handle);
return FAILURE;
}
}
extension = *new_extension;
extension.handle = handle;
zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
zend_llist_add_element(&zend_extensions, &extension);
/*fprintf(stderr, "Loaded %s, version %s\n", extension.name, extension.version);*/
zend_append_version_info(&extension);
return SUCCESS;
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
return FAILURE;
/*fprintf(stderr, "Loaded %s, version %s\n", extension.name, extension.version);*/
#endif
return SUCCESS;
}
static void zend_extension_shutdown(zend_extension *extension)
{
#if ZEND_EXTENSIONS_SUPPORT
@@ -131,6 +145,14 @@ static void zend_extension_shutdown(zend_extension *extension)
}
int zend_startup_extensions()
{
zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1);
last_resource_number = 0;
return SUCCESS;
}
void zend_shutdown_extensions()
{
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_shutdown);
@@ -141,16 +163,38 @@ void zend_shutdown_extensions()
void zend_extension_dtor(zend_extension *extension)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_UNLOAD(extension->handle);
if (extension->handle) {
DL_UNLOAD(extension->handle);
}
#endif
}
static void zend_extension_message_dispatcher(zend_extension *extension, int num_args, va_list args)
{
int message;
void *arg;
if (!extension->message_handler || num_args!=2) {
return;
}
message = va_arg(args, int);
arg = va_arg(args, void *);
extension->message_handler(message, arg);
}
ZEND_API void zend_extension_dispatch_message(int message, void *arg)
{
zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher, 2, message, arg);
}
ZEND_API int zend_get_resource_handle(zend_extension *extension)
{
if (last_resource_number<4) {
if (last_resource_number<ZEND_MAX_RESERVED_RESOURCES) {
extension->resource_number = last_resource_number;
return last_resource_number;
return last_resource_number++;
} else {
return -1;
}
+12 -5
View File
@@ -23,7 +23,7 @@
#include "zend_compile.h"
#define ZEND_EXTENSION_API_NO 20000306
#define ZEND_EXTENSION_API_NO 20000521
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -47,14 +47,16 @@ struct _zend_extension {
void (*activate)();
void (*deactivate)();
void (*message_handler)(int message, void *arg);
void (*op_array_handler)(zend_op_array *op_array);
void (*statement_handler)(zend_op_array *op_array);
void (*fcall_begin_handler)(zend_op_array *op_array);
void (*fcall_end_handler)(zend_op_array *op_array);
void (*op_array_ctor)(void **resource);
void (*op_array_dtor)(void **resource);
void (*op_array_ctor)(zend_op_array *op_array);
void (*op_array_dtor)(zend_op_array *op_array);
void *reserved1;
void *reserved2;
@@ -71,6 +73,9 @@ struct _zend_extension {
ZEND_API int zend_get_resource_handle(zend_extension *extension);
ZEND_API void zend_extension_dispatch_message(int message, void *arg);
#define ZEND_EXTMSG_NEW_EXTENSION 1
#ifdef ZTS
#define ZTS_V 1
@@ -88,9 +93,11 @@ ZEND_API int zend_get_resource_handle(zend_extension *extension);
ZEND_API extern zend_llist zend_extensions;
void zend_extension_dtor(zend_extension *extension);
int zend_load_extension(char *path);
int zend_load_extensions(char **extension_paths);
ZEND_API int zend_load_extension(char *path);
ZEND_API int zend_load_extensions(char **extension_paths);
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
void zend_append_version_info(zend_extension *extension);
int zend_startup_extensions(void);
void zend_shutdown_extensions(void);
#endif /* _ZEND_EXTENSIONS_H */
+2 -1
View File
@@ -131,7 +131,6 @@ struct _zend_executor_globals {
zend_function_state *function_state_ptr;
zend_ptr_stack arg_types_stack;
zend_stack overloaded_objects_stack;
/* for global return() support */
zval *global_return_value_ptr;
@@ -180,6 +179,8 @@ struct _zend_executor_globals {
zval *garbage[4];
int garbage_ptr;
zval *user_error_handler;
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
#if SUPPORT_INTERACTIVE
int interactive;
+4 -1
View File
@@ -946,7 +946,7 @@ ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
/* This function should be made binary safe */
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *num_index, HashPosition *pos)
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *str_length, ulong *num_index, HashPosition *pos)
{
Bucket *p;
@@ -958,6 +958,9 @@ ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong
if (p->nKeyLength) {
*str_index = (char *) pemalloc(p->nKeyLength, ht->persistent);
memcpy(*str_index, p->arKey, p->nKeyLength);
if (str_length) {
*str_length = p->nKeyLength;
}
return HASH_KEY_IS_STRING;
} else {
*num_index = p->h;
+9 -2
View File
@@ -141,7 +141,7 @@ ZEND_API ulong zend_hash_next_free_element(HashTable *ht);
/* traversing */
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *num_index, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *str_length, ulong *num_index, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos);
@@ -152,7 +152,7 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos
#define zend_hash_move_backwards(ht) \
zend_hash_move_backwards_ex(ht, NULL)
#define zend_hash_get_current_key(ht, str_index, num_index) \
zend_hash_get_current_key_ex(ht, str_index, num_index, NULL)
zend_hash_get_current_key_ex(ht, str_index, NULL, num_index, NULL)
#define zend_hash_get_current_key_type(ht) \
zend_hash_get_current_key_type_ex(ht, NULL)
#define zend_hash_get_current_data(ht, pData) \
@@ -182,4 +182,11 @@ void zend_hash_display(HashTable *ht);
END_EXTERN_C()
#define ZEND_INIT_SYMTABLE(ht) \
ZEND_INIT_SYMTABLE_EX(ht, 2, 0)
#define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \
zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent)
#endif /* _HASH_ */
+6 -6
View File
@@ -33,7 +33,7 @@ extern int zendleng;
#define zendleng zend_get_zendleng(CLS_C)
#endif
static void html_putc(char c)
ZEND_API void zend_html_putc(char c)
{
switch (c) {
case '\n':
@@ -61,12 +61,12 @@ static void html_putc(char c)
}
static void html_puts(char *s, uint len)
ZEND_API void zend_html_puts(char *s, uint len)
{
register char *ptr=s, *end=s+len;
while (ptr<end) {
html_putc(*ptr++);
zend_html_putc(*ptr++);
}
}
@@ -108,7 +108,7 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
in_string = !in_string;
break;
case T_WHITESPACE:
html_puts(zendtext, zendleng); /* no color needed */
zend_html_puts(zendtext, zendleng); /* no color needed */
token.type = 0;
continue;
break;
@@ -136,10 +136,10 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
}
switch (token_type) {
case T_END_HEREDOC:
html_puts(token.value.str.val, token.value.str.len);
zend_html_puts(token.value.str.val, token.value.str.len);
break;
default:
html_puts(zendtext, zendleng);
zend_html_puts(zendtext, zendleng);
break;
}
+2
View File
@@ -42,6 +42,8 @@ BEGIN_EXTERN_C()
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini);
ZEND_API void zend_html_putc(char c);
ZEND_API void zend_html_puts(char *s, uint len);
END_EXTERN_C()
extern zend_syntax_highlighter_ini syntax_highlighter_ini;
+133 -24
View File
@@ -27,10 +27,14 @@
ZEND_API int le_index_ptr;
static inline int zend_list_do_insert(HashTable *list,void *ptr, int type)
/* true global */
static HashTable list_destructors;
static inline int zend_list_do_insert(HashTable *list, void *ptr, int type, zend_bool valid)
{
int index;
list_entry le;
zend_rsrc_list_entry le;
index = zend_hash_next_free_element(list);
@@ -39,13 +43,14 @@ static inline int zend_list_do_insert(HashTable *list,void *ptr, int type)
le.ptr=ptr;
le.type=type;
le.refcount=1;
zend_hash_index_update(list, index, (void *) &le, sizeof(list_entry), NULL);
le.valid = valid;
zend_hash_index_update(list, index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL);
return index;
}
static inline int zend_list_do_delete(HashTable *list,int id)
{
list_entry *le;
zend_rsrc_list_entry *le;
ELS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
@@ -63,7 +68,7 @@ static inline int zend_list_do_delete(HashTable *list,int id)
static inline void *zend_list_do_find(HashTable *list,int id, int *type)
{
list_entry *le;
zend_rsrc_list_entry *le;
if (zend_hash_index_find(list, id, (void **) &le)==SUCCESS) {
*type = le->type;
@@ -79,7 +84,7 @@ ZEND_API int zend_list_insert(void *ptr, int type)
{
ELS_FETCH();
return zend_list_do_insert(&EG(regular_list), ptr, type);
return zend_list_do_insert(&EG(regular_list), ptr, type, 1);
}
@@ -87,13 +92,13 @@ ZEND_API int zend_plist_insert(void *ptr, int type)
{
ELS_FETCH();
return zend_list_do_insert(&EG(persistent_list), ptr, type);
return zend_list_do_insert(&EG(persistent_list), ptr, type, 1);
}
ZEND_API int zend_list_addref(int id)
{
list_entry *le;
zend_rsrc_list_entry *le;
ELS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
@@ -122,6 +127,20 @@ ZEND_API int zend_plist_delete(int id)
}
ZEND_API int zend_list_convert_to_number(int id)
{
zend_rsrc_list_entry *le;
ELS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS
&& le->valid) {
return id;
}
return 0;
}
ZEND_API void *zend_list_find(int id, int *type)
{
ELS_FETCH();
@@ -153,6 +172,22 @@ ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int r
}
ZEND_API int zend_register_false_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
{
int rsrc_id;
ELS_FETCH();
rsrc_id = zend_list_do_insert(&EG(regular_list), rsrc_pointer, rsrc_type, 0);
if (rsrc_result) {
rsrc_result->value.lval = rsrc_id;
rsrc_result->type = IS_RESOURCE;
}
return rsrc_id;
}
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
{
int id;
@@ -206,12 +241,22 @@ ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resou
void list_entry_destructor(void *ptr)
{
list_entry *le = (list_entry *) ptr;
list_destructors_entry *ld;
zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr;
zend_rsrc_list_dtors_entry *ld;
if (zend_hash_index_find(&list_destructors,le->type,(void **) &ld)==SUCCESS) {
if (ld->list_destructor) {
(ld->list_destructor)(le->ptr);
if (zend_hash_index_find(&list_destructors, le->type,(void **) &ld)==SUCCESS) {
switch (ld->type) {
case ZEND_RESOURCE_LIST_TYPE_STD:
if (ld->list_dtor) {
(ld->list_dtor)(le->ptr);
}
break;
case ZEND_RESOURCE_LIST_TYPE_EX:
if (ld->list_dtor_ex) {
ld->list_dtor_ex(le);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
} else {
zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)",le->type);
@@ -221,12 +266,12 @@ void list_entry_destructor(void *ptr)
void plist_entry_destructor(void *ptr)
{
list_entry *le = (list_entry *) ptr;
list_destructors_entry *ld;
zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr;
zend_rsrc_list_dtors_entry *ld;
if (zend_hash_index_find(&list_destructors,le->type,(void **) &ld)==SUCCESS) {
if (ld->plist_destructor) {
(ld->plist_destructor)(le->ptr);
if (zend_hash_index_find(&list_destructors, le->type,(void **) &ld)==SUCCESS) {
if (ld->plist_dtor) {
(ld->plist_dtor)(le->ptr);
}
} else {
zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)",le->type);
@@ -234,31 +279,31 @@ void plist_entry_destructor(void *ptr)
}
int init_resource_list(ELS_D)
int zend_init_rsrc_list(ELS_D)
{
return zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0);
}
int init_resource_plist(ELS_D)
int zend_init_rsrc_plist(ELS_D)
{
return zend_hash_init(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1);
}
void destroy_resource_list(ELS_D)
void zend_destroy_rsrc_list(ELS_D)
{
zend_hash_graceful_destroy(&EG(regular_list));
}
void destroy_resource_plist(ELS_D)
void zend_destroy_rsrc_plist(ELS_D)
{
zend_hash_graceful_destroy(&EG(persistent_list));
}
static int clean_module_resource(list_entry *le, int *resource_id)
static int clean_module_resource(zend_rsrc_list_entry *le, int *resource_id)
{
if (le->type == *resource_id) {
return 1;
@@ -268,11 +313,12 @@ static int clean_module_resource(list_entry *le, int *resource_id)
}
int clean_module_resource_destructors(list_destructors_entry *ld, int *module_number)
static int zend_clean_module_rsrc_dtors_cb(zend_rsrc_list_dtors_entry *ld, int *module_number)
{
if (ld->module_number == *module_number) {
ELS_FETCH();
zend_hash_apply_with_argument(&EG(regular_list), (int (*)(void *,void *)) clean_module_resource, (void *) &(ld->resource_id));
zend_hash_apply_with_argument(&EG(persistent_list), (int (*)(void *,void *)) clean_module_resource, (void *) &(ld->resource_id));
return 1;
} else {
@@ -281,6 +327,69 @@ int clean_module_resource_destructors(list_destructors_entry *ld, int *module_nu
}
void zend_clean_module_rsrc_dtors(int module_number)
{
zend_hash_apply_with_argument(&list_destructors, (int (*)(void *,void *)) zend_clean_module_rsrc_dtors_cb, (void *) &module_number);
}
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number)
{
zend_rsrc_list_dtors_entry lde;
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
lde.list_dtor=(void (*)(void *)) ld;
lde.plist_dtor=(void (*)(void *)) pld;
lde.list_dtor_ex = lde.plist_dtor_ex = NULL;
lde.module_number = module_number;
lde.resource_id = list_destructors.nNextFreeElement;
lde.type = ZEND_RESOURCE_LIST_TYPE_STD;
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
return FAILURE;
}
return list_destructors.nNextFreeElement-1;
}
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, int module_number)
{
zend_rsrc_list_dtors_entry lde;
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
lde.list_dtor = NULL;
lde.plist_dtor = NULL;
lde.list_dtor_ex = ld;
lde.plist_dtor_ex = pld;
lde.module_number = module_number;
lde.resource_id = list_destructors.nNextFreeElement;
lde.type = ZEND_RESOURCE_LIST_TYPE_EX;
if (zend_hash_next_index_insert(&list_destructors,(void *) &lde, sizeof(zend_rsrc_list_dtors_entry),NULL)==FAILURE) {
return FAILURE;
}
return list_destructors.nNextFreeElement-1;
}
int zend_init_rsrc_list_dtors()
{
return zend_hash_init(&list_destructors, 50, NULL, NULL, 1);
}
void zend_destroy_rsrc_list_dtors()
{
zend_hash_destroy(&list_destructors);
}
/*
* Local variables:
* tab-width: 4
+31 -14
View File
@@ -24,23 +24,37 @@
#include "zend_hash.h"
#include "zend_globals.h"
extern HashTable list_destructors;
typedef struct _list_entry {
#define ZEND_RESOURCE_LIST_TYPE_STD 1
#define ZEND_RESOURCE_LIST_TYPE_EX 2
typedef struct _zend_rsrc_list_entry {
void *ptr;
int type;
int refcount;
} list_entry;
zend_bool valid;
} zend_rsrc_list_entry;
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *le);
typedef struct _zend_rsrc_list_dtors_entry {
/* old style destructors */
void (*list_dtor)(void *);
void (*plist_dtor)(void *);
/* new style destructors */
rsrc_dtor_func_t list_dtor_ex;
rsrc_dtor_func_t plist_dtor_ex;
typedef struct _list_destructors_entry {
void (*list_destructor)(void *);
void (*plist_destructor)(void *);
int module_number;
int resource_id;
} list_destructors_entry;
unsigned char type;
} zend_rsrc_list_dtors_entry;
#define register_list_destructors(ld,pld) _register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number);
ZEND_API int _register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number);
#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number);
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number);
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, int module_number);
enum list_entry_type {
LE_DB=1000
@@ -49,17 +63,20 @@ enum list_entry_type {
void list_entry_destructor(void *ptr);
void plist_entry_destructor(void *ptr);
int clean_module_resource_destructors(list_destructors_entry *ld, int *module_number);
int init_resource_list(ELS_D);
int init_resource_plist(ELS_D);
void destroy_resource_list(ELS_D);
void destroy_resource_plist(ELS_D);
void zend_clean_module_rsrc_dtors(int module_number);
int zend_init_rsrc_list(ELS_D);
int zend_init_rsrc_plist(ELS_D);
void zend_destroy_rsrc_list(ELS_D);
void zend_destroy_rsrc_plist(ELS_D);
int zend_init_rsrc_list_dtors();
void zend_destroy_rsrc_list_dtors();
ZEND_API int zend_list_insert(void *ptr, int type);
ZEND_API int zend_plist_insert(void *ptr, int type);
ZEND_API int zend_list_addref(int id);
ZEND_API int zend_list_delete(int id);
ZEND_API int zend_plist_delete(int id);
ZEND_API int zend_list_convert_to_number(int id);
ZEND_API void *zend_list_find(int id, int *type);
ZEND_API void *zend_plist_find(int id, int *type);
+15 -2
View File
@@ -81,7 +81,7 @@ ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare
}
if (l->dtor) {
l->dtor(current->data);
efree(current);
pefree(current, l->persistent);
}
break;
}
@@ -121,7 +121,7 @@ ZEND_API void zend_llist_remove_tail(zend_llist *l)
l->tail->prev->next = NULL;
}
l->tail = l->tail->prev;
efree(old_tail);
pefree(old_tail, l->persistent);
}
}
@@ -196,6 +196,19 @@ ZEND_API void zend_llist_apply_with_argument(zend_llist *l, void (*func)(void *d
}
ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...)
{
zend_llist_element *element;
va_list args;
va_start(args, num_args);
for (element=l->head; element; element=element->next) {
func(element->data, num_args, args);
}
va_end(args);
}
ZEND_API int zend_llist_count(zend_llist *l)
{
zend_llist_element *element;
+5 -1
View File
@@ -38,7 +38,10 @@ typedef struct _zend_llist {
zend_llist_element *traverse_ptr;
} zend_llist;
typedef int (*llist_compare_func_t) (const zend_llist_element *, const zend_llist_element *);
typedef int (*llist_compare_func_t)(const zend_llist_element *, const zend_llist_element *);
typedef void(*llist_apply_with_arg_func_t)(void *data, void *arg);
typedef void(*llist_apply_with_args_func_t)(void *data, int num_args, va_list args);
typedef zend_llist_element* zend_llist_position;
BEGIN_EXTERN_C()
@@ -52,6 +55,7 @@ ZEND_API void zend_llist_remove_tail(zend_llist *l);
ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src);
ZEND_API void zend_llist_apply(zend_llist *l, void (*func)(void *data));
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, void (*func)(void *data, void *arg), void *arg);
ZEND_API void zend_llist_apply_with_arguments(zend_llist *l, llist_apply_with_args_func_t func, int num_args, ...);
ZEND_API int zend_llist_count(zend_llist *l);
ZEND_API void zend_llist_sort(zend_llist *l, llist_compare_func_t comp_func);
+3 -2
View File
@@ -37,7 +37,7 @@ extern unsigned char second_arg_allow_ref[];
#include "zend.h"
#define ZEND_MODULE_API_NO 20000313
#define ZEND_MODULE_API_NO 20000401
#ifdef ZTS
#define USING_ZTS 1
@@ -45,7 +45,7 @@ extern unsigned char second_arg_allow_ref[];
#define USING_ZTS 0
#endif
#define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0, ZEND_DEBUG, USING_ZTS, ZEND_MODULE_API_NO
#define STANDARD_MODULE_PROPERTIES_EX 0, 0, 0, NULL, 0, ZEND_DEBUG, USING_ZTS, ZEND_MODULE_API_NO
#define STANDARD_MODULE_PROPERTIES \
NULL, NULL, STANDARD_MODULE_PROPERTIES_EX
@@ -65,6 +65,7 @@ struct _zend_module_entry {
void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
int (*global_startup_func)(void);
int (*global_shutdown_func)(void);
int globals_id;
int module_started;
unsigned char type;
void *handle;
+16 -20
View File
@@ -30,11 +30,7 @@
static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend_op_array *op_array)
{
if (extension->op_array_ctor) {
if (extension->resource_number>=0) {
extension->op_array_ctor(&op_array->reserved[extension->resource_number]);
} else {
extension->op_array_ctor(NULL);
}
extension->op_array_ctor(op_array);
}
}
@@ -42,11 +38,7 @@ static void zend_extension_op_array_ctor_handler(zend_extension *extension, zend
static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend_op_array *op_array)
{
if (extension->op_array_dtor) {
if (extension->resource_number>=0) {
extension->op_array_dtor(&op_array->reserved[extension->resource_number]);
} else {
extension->op_array_dtor(NULL);
}
extension->op_array_dtor(op_array);
}
}
@@ -58,9 +50,9 @@ static void op_array_alloc_ops(zend_op_array *op_array)
void init_op_array(zend_op_array *op_array, int initial_ops_size)
void init_op_array(zend_op_array *op_array, int type, int initial_ops_size)
{
op_array->type = ZEND_USER_FUNCTION;
op_array->type = type;
#if SUPPORT_INTERACTIVE
{
ELS_FETCH();
@@ -98,6 +90,7 @@ void init_op_array(zend_op_array *op_array, int initial_ops_size)
op_array->uses_globals = 0;
op_array->return_reference = 0;
op_array->done_pass_two = 0;
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_ctor_handler, op_array);
}
@@ -185,22 +178,21 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
if (op_array->brk_cont_array) {
efree(op_array->brk_cont_array);
}
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array);
if (op_array->done_pass_two) {
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_dtor_handler, op_array);
}
}
void init_op(zend_op *op CLS_DC)
{
memset(&op->result, 0, sizeof(znode));
op->lineno = CG(zend_lineno);
op->filename = zend_get_compiled_filename(CLS_C);
op->result.op_type = IS_UNUSED;
op->extended_value = 0;
op->op1.u.EA.var = 0;
op->op1.u.EA.type = 0;
op->op2.u.EA.var = 0;
op->op2.u.EA.type = 0;
op->result.u.EA.var = 0;
op->result.u.EA.type = 0;
memset(&op->op1, 0, sizeof(znode));
memset(&op->op2, 0, sizeof(znode));
}
zend_op *get_next_op(zend_op_array *op_array CLS_DC)
@@ -300,11 +292,12 @@ int pass_two(zend_op_array *op_array)
if (CG(handle_op_arrays)) {
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array);
}
op_array->done_pass_two = 1;
return 0;
}
void pass_include_eval(zend_op_array *op_array)
ZEND_API void pass_include_eval(zend_op_array *op_array)
{
zend_op *opline=op_array->opcodes, *end=opline+op_array->last;
@@ -384,6 +377,9 @@ ZEND_API void *get_binary_op(int opcode)
case ZEND_IS_IDENTICAL:
return (void *) is_identical_function;
break;
case ZEND_IS_NOT_IDENTICAL:
return (void *) is_not_identical_function;
break;
case ZEND_IS_EQUAL:
return (void *) is_equal_function;
break;
+132 -32
View File
@@ -32,6 +32,18 @@
#include "zend_list.h"
#include "zend_fast_cache.h"
#ifndef HAVE_FINITE
#ifndef finite /* in case it's already a macro */
#define finite(a) isfinite(a) /* HPUX 11 only has isfinite() */
#endif
#else
#if HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#endif
#define NORMALIZE_BOOL(n) \
((n) ? (((n)>0) ? 1 : -1) : 0)
#if WITH_BCMATH
#include "ext/bcmath/number.h"
@@ -313,7 +325,7 @@ ZEND_API void convert_to_boolean(zval *op)
}
ZEND_API void convert_to_string(zval *op)
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
{
long lval;
double dval;
@@ -328,34 +340,40 @@ ZEND_API void convert_to_string(zval *op)
break;
case IS_BOOL:
if (op->value.lval) {
op->value.str.val = estrndup("1", 1);
op->value.str.val = estrndup_rel("1", 1);
op->value.str.len = 1;
} else {
op->value.str.val = empty_string;
op->value.str.len = 0;
}
break;
case IS_RESOURCE: {
long tmp = op->value.lval;
op->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG);
op->value.str.len = sprintf(op->value.str.val, "Resource id #%ld", tmp);
break;
}
case IS_LONG:
lval = op->value.lval;
op->value.str.val = (char *) emalloc(MAX_LENGTH_OF_LONG + 1);
op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_LONG + 1);
op->value.str.len = zend_sprintf(op->value.str.val, "%ld", lval); /* SAFE */
break;
case IS_DOUBLE: {
dval = op->value.dval;
op->value.str.val = (char *) emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
op->value.str.val = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
op->value.str.len = zend_sprintf(op->value.str.val, "%.*G", (int) EG(precision), dval); /* SAFE */
/* %G already handles removing trailing zeros from the fractional part, yay */
break;
}
case IS_ARRAY:
zval_dtor(op);
op->value.str.val = estrndup("Array",sizeof("Array")-1);
op->value.str.val = estrndup_rel("Array",sizeof("Array")-1);
op->value.str.len = sizeof("Array")-1;
break;
case IS_OBJECT:
zval_dtor(op);
op->value.str.val = estrndup("Object",sizeof("Object")-1);
op->value.str.val = estrndup_rel("Object",sizeof("Object")-1);
op->value.str.len = sizeof("Object")-1;
break;
default:
@@ -727,7 +745,8 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2)
if (op1->type == IS_STRING && op2->type == IS_STRING) {
zval *longer, *shorter;
int i;
char *result_str;
int i, result_len;
if (op1->value.str.len >= op2->value.str.len) {
longer = op1;
@@ -738,11 +757,16 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2)
}
result->type = IS_STRING;
result->value.str.len = longer->value.str.len;
result->value.str.val = estrndup(longer->value.str.val, longer->value.str.len);
result_len = longer->value.str.len;
result_str = estrndup(longer->value.str.val, longer->value.str.len);
for (i = 0; i < shorter->value.str.len; i++) {
result->value.str.val[i] |= shorter->value.str.val[i];
result_str[i] |= shorter->value.str.val[i];
}
if (result==op1) {
efree(result->value.str.val);
}
result->value.str.val = result_str;
result->value.str.len = result_len;
return SUCCESS;
}
zendi_convert_to_long(op1, op1_copy, result);
@@ -760,7 +784,8 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2)
if (op1->type == IS_STRING && op2->type == IS_STRING) {
zval *longer, *shorter;
int i;
char *result_str;
int i, result_len;
if (op1->value.str.len >= op2->value.str.len) {
longer = op1;
@@ -771,11 +796,16 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2)
}
result->type = IS_STRING;
result->value.str.len = shorter->value.str.len;
result->value.str.val = estrndup(shorter->value.str.val, shorter->value.str.len);
result_len = shorter->value.str.len;
result_str = estrndup(shorter->value.str.val, shorter->value.str.len);
for (i = 0; i < shorter->value.str.len; i++) {
result->value.str.val[i] &= longer->value.str.val[i];
result_str[i] &= longer->value.str.val[i];
}
if (result==op1) {
efree(result->value.str.val);
}
result->value.str.val = result_str;
result->value.str.len = result_len;
return SUCCESS;
}
@@ -795,7 +825,8 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2)
if (op1->type == IS_STRING && op2->type == IS_STRING) {
zval *longer, *shorter;
int i;
char *result_str;
int i, result_len;
if (op1->value.str.len >= op2->value.str.len) {
longer = op1;
@@ -806,11 +837,16 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2)
}
result->type = IS_STRING;
result->value.str.len = shorter->value.str.len;
result->value.str.val = estrndup(shorter->value.str.val, shorter->value.str.len);
result_len = shorter->value.str.len;
result_str = estrndup(shorter->value.str.val, shorter->value.str.len);
for (i = 0; i < shorter->value.str.len; i++) {
result->value.str.val[i] ^= longer->value.str.val[i];
result_str[i] ^= longer->value.str.val[i];
}
if (result==op1) {
efree(result->value.str.val);
}
result->value.str.val = result_str;
result->value.str.len = result_len;
return SUCCESS;
}
@@ -853,7 +889,7 @@ ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2)
{
result->value.str.len = op1->value.str.len + 1;
result->value.str.val = (char *) erealloc(op1->value.str.val, result->value.str.len+1);
result->value.str.val[result->value.str.len - 1] = op2->value.chval;
result->value.str.val[result->value.str.len - 1] = (char) op2->value.lval;
result->value.str.val[result->value.str.len] = 0;
result->type = IS_STRING;
return SUCCESS;
@@ -918,6 +954,52 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2)
}
ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2)
{
zval op1_copy, op2_copy;
int use_copy1, use_copy2;
zend_make_printable_zval(op1, &op1_copy, &use_copy1);
zend_make_printable_zval(op2, &op2_copy, &use_copy2);
if (use_copy1) {
op1 = &op1_copy;
}
if (use_copy2) {
op2 = &op2_copy;
}
result->value.lval = zend_binary_zval_strcmp(op1, op2);
result->type = IS_LONG;
if (use_copy1) {
zval_dtor(op1);
}
if (use_copy2) {
zval_dtor(op2);
}
return SUCCESS;
}
ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2)
{
zval op1_copy, op2_copy;
op1_copy = *op1;
zval_copy_ctor(&op1_copy);
op2_copy = *op2;
zval_copy_ctor(&op2_copy);
convert_to_double(&op1_copy);
convert_to_double(&op2_copy);
result->value.lval = NORMALIZE_BOOL(op1_copy.value.dval-op2_copy.value.dval);
result->type = IS_LONG;
return SUCCESS;
}
ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
{
zval op1_copy, op2_copy;
@@ -932,7 +1014,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
zendi_convert_to_boolean(op1, op1_copy, result);
zendi_convert_to_boolean(op2, op2_copy, result);
result->type = IS_LONG;
result->value.lval = op1->value.lval - op2->value.lval;
result->value.lval = NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
return SUCCESS;
}
@@ -941,13 +1023,14 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
if (op1->type == IS_LONG && op2->type == IS_LONG) {
result->type = IS_LONG;
result->value.lval = op1->value.lval - op2->value.lval;
result->value.lval = NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
return SUCCESS;
}
if ((op1->type == IS_DOUBLE || op1->type == IS_LONG)
&& (op2->type == IS_DOUBLE || op2->type == IS_LONG)) {
result->value.dval = (op1->type == IS_LONG ? (double) op1->value.lval : op1->value.dval) - (op2->type == IS_LONG ? (double) op2->value.lval : op2->value.dval);
result->type = IS_DOUBLE;
result->value.lval = NORMALIZE_BOOL(result->value.dval);
result->type = IS_LONG;
return SUCCESS;
}
if ((op1->type==IS_ARRAY || op1->type==IS_OBJECT)
@@ -999,6 +1082,18 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
return FAILURE;
}
ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2)
{
result->type = IS_BOOL;
if ( is_identical_function( result, op1, op2 ) == FAILURE ) {
return FAILURE;
}
result->value.lval = !result->value.lval;
return SUCCESS;
}
ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2)
{
if (compare_function(result, op1, op2) == FAILURE) {
@@ -1035,6 +1130,7 @@ ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2)
return FAILURE;
}
if (result->type == IS_LONG) {
result->type = IS_BOOL;
if (result->value.lval < 0) {
result->value.lval = 1;
} else {
@@ -1043,7 +1139,7 @@ ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2)
return SUCCESS;
}
if (result->type == IS_DOUBLE) {
result->type = IS_LONG;
result->type = IS_BOOL;
if (result->value.dval < 0) {
result->value.lval = 1;
} else {
@@ -1062,6 +1158,7 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)
return FAILURE;
}
if (result->type == IS_LONG) {
result->type = IS_BOOL;
if (result->value.lval <= 0) {
result->value.lval = 1;
} else {
@@ -1070,7 +1167,7 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2)
return SUCCESS;
}
if (result->type == IS_DOUBLE) {
result->type = IS_LONG;
result->type = IS_BOOL;
if (result->value.dval <= 0) {
result->value.lval = 1;
} else {
@@ -1258,21 +1355,20 @@ ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint
ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2)
{
unsigned char c1 = 0, c2 = 0;
int len;
int c1,c2;
if (len1 != len2 || !len1) {
return len1 - len2;
}
len = MIN(len1, len2);
while (len1--) {
while (len--) {
c1 = tolower(*s1++);
c2 = tolower(*s2++);
if (c1 != c2) {
break;
return c1 - c2;
}
}
return c1 - c2;
return len1 - len2;
}
@@ -1311,6 +1407,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
str2num(&first,s1->value.str.val,100); /* this scale should do */
str2num(&second,s2->value.str.val,100); /* ditto */
result->value.lval = bc_compare(first,second);
result->value.lval = NORMALIZE_BOOL(result->value.lval);
result->type = IS_LONG;
free_num(&first);
free_num(&second);
@@ -1323,13 +1420,16 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
dval2 = strtod(s2->value.str.val, NULL);
}
result->value.dval = dval1 - dval2;
result->type = IS_DOUBLE;
result->value.lval = NORMALIZE_BOOL(result->value.dval);
result->type = IS_LONG;
} else { /* they both have to be long's */
result->value.lval = lval1 - lval2;
result->value.lval = NORMALIZE_BOOL(result->value.lval);
result->type = IS_LONG;
}
} else {
result->value.lval = zend_binary_zval_strcmp(s1, s2);
result->value.lval = NORMALIZE_BOOL(result->value.lval);
result->type = IS_LONG;
}
return;
+46 -1
View File
@@ -43,6 +43,7 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_not_identical_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2);
@@ -53,7 +54,7 @@ ZEND_API int decrement_function(zval *op2);
BEGIN_EXTERN_C()
ZEND_API void convert_scalar_to_number(zval *op);
ZEND_API void convert_to_string(zval *op);
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
ZEND_API void convert_to_long(zval *op);
ZEND_API void convert_to_double(zval *op);
ZEND_API void convert_to_long_base(zval *op, int base);
@@ -63,16 +64,20 @@ ZEND_API void convert_to_array(zval *op);
ZEND_API void convert_to_object(zval *op);
ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2);
ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2);
#define convert_to_string(op) _convert_to_string((op) ZEND_FILE_LINE_CC)
END_EXTERN_C()
ZEND_API int zval_is_true(zval *op);
ZEND_API int compare_function(zval *result, zval *op1, zval *op2);
ZEND_API int numeric_compare_function(zval *result, zval *op1, zval *op2);
ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2);
ZEND_API void zend_str_tolower(char *str, unsigned int length);
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2);
ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3);
ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2);
ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2);
ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length);
ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2);
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
@@ -85,6 +90,13 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
convert_to_##lower_type(*ppzv); \
}
#define convert_to_writable_ex_master(ppzv, lower_type, upper_type) \
if ((*ppzv)->type!=IS_##upper_type) { \
SEPARATE_ZVAL(ppzv); \
convert_to_##lower_type(*ppzv); \
}
#define convert_to_boolean_ex(ppzv) convert_to_ex_master(ppzv, boolean, BOOL)
#define convert_to_long_ex(ppzv) convert_to_ex_master(ppzv, long, LONG)
#define convert_to_double_ex(ppzv) convert_to_ex_master(ppzv, double, DOUBLE)
@@ -93,6 +105,15 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_object_ex(ppzv) convert_to_ex_master(ppzv, object, OBJECT)
#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL)
#define convert_to_writable_boolean_ex(ppzv) convert_to_writable_ex_master(ppzv, boolean, BOOL)
#define convert_to_writable_long_ex(ppzv) convert_to_writable_ex_master(ppzv, long, LONG)
#define convert_to_writable_double_ex(ppzv) convert_to_writable_ex_master(ppzv, double, DOUBLE)
#define convert_to_writable_string_ex(ppzv) convert_to_writable_ex_master(ppzv, string, STRING)
#define convert_to_writable_array_ex(ppzv) convert_to_writable_ex_master(ppzv, array, ARRAY)
#define convert_to_writable_object_ex(ppzv) convert_to_writable_ex_master(ppzv, object, OBJECT)
#define convert_to_writable_null_ex(ppzv) convert_to_writable_ex_master(ppzv, null, NULL)
#define convert_scalar_to_number_ex(ppzv) \
if ((*ppzv)->type!=IS_LONG && (*ppzv)->type!=IS_DOUBLE) { \
if (!(*ppzv)->is_ref) { \
@@ -101,4 +122,28 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
convert_scalar_to_number(*ppzv); \
}
#define Z_LVAL(zval) (zval).value.lval
#define Z_DVAL(zval) (zval).value.dval
#define Z_STRVAL(zval) (zval).value.str.val
#define Z_STRLEN(zval) (zval).value.str.len
#define Z_ARRVAL(zval) (zval).value.ht
#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p)
#define Z_DVAL_P(zval_p) Z_DVAL(*zval_p)
#define Z_STRVAL_P(zval_p) Z_STRVAL(*zval_p)
#define Z_STRLEN_P(zval_p) Z_STRLEN(*zval_p)
#define Z_ARRVAL_P(zval_p) Z_ARRVAL(*zval_p)
#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp)
#define Z_DVAL_PP(zval_pp) Z_DVAL(**zval_pp)
#define Z_STRVAL_PP(zval_pp) Z_STRVAL(**zval_pp)
#define Z_STRLEN_PP(zval_pp) Z_STRLEN(**zval_pp)
#define Z_ARRVAL_PP(zval_pp) Z_ARRVAL(**zval_pp)
#define Z_TYPE(zval) (zval).type
#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p)
#define Z_TYPE_PP(zval_pp) Z_TYPE(**zval_pp)
#endif
+2 -2
View File
@@ -118,7 +118,7 @@ ZEND_API int zend_stack_count(zend_stack *stack)
}
ZEND_API void zend_stack_apply(zend_stack *stack, int (*apply_function)(void *element), int type)
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element))
{
int i;
@@ -141,7 +141,7 @@ ZEND_API void zend_stack_apply(zend_stack *stack, int (*apply_function)(void *el
}
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int (*apply_function)(void *element, void *arg), int type, void *arg)
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg)
{
int i;
+2 -2
View File
@@ -38,8 +38,8 @@ ZEND_API int zend_stack_is_empty(zend_stack *stack);
ZEND_API int zend_stack_destroy(zend_stack *stack);
ZEND_API void **zend_stack_base(zend_stack *stack);
ZEND_API int zend_stack_count(zend_stack *stack);
ZEND_API void zend_stack_apply(zend_stack *stack, int (*apply_function)(void *element), int type);
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int (*apply_function)(void *element, void *arg), int type, void *arg);
ZEND_API void zend_stack_apply(zend_stack *stack, int type, int (*apply_function)(void *element));
ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*apply_function)(void *element, void *arg), void *arg);
#define ZEND_STACK_APPLY_TOPDOWN 1
#define ZEND_STACK_APPLY_BOTTOMUP 2
+3 -2
View File
@@ -89,7 +89,7 @@ ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
}
void zval_del_ref(zval **p)
ZEND_API void zval_del_ref(zval **p)
{
(*p)->refcount--;
if ((*p)->refcount==0) {
@@ -99,7 +99,7 @@ void zval_del_ref(zval **p)
}
void zval_add_ref(zval **p)
ZEND_API void zval_add_ref(zval **p)
{
(*p)->refcount++;
}
@@ -115,6 +115,7 @@ ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
case IS_LONG:
case IS_NULL:
break;
case IS_CONSTANT:
case IS_STRING:
if (zvalue->value.str.val) {
if (zvalue->value.str.len==0) {
+2 -2
View File
@@ -48,8 +48,8 @@ ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr);
END_EXTERN_C()
void zval_add_ref(zval **p);
void zval_del_ref(zval **p);
ZEND_API void zval_add_ref(zval **p);
ZEND_API void zval_del_ref(zval **p);
#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper
#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper
+3
View File
@@ -50,6 +50,9 @@
/* Set to the path to the dir containing safe mode executables */
#define PHP_SAFE_MODE_EXEC_DIR /usr/local/php/bin
/* Define if PHP to setup it's own SIGCHLD handler */
#define PHP_SIGCHILD 0
/* Define if you want POST/GET/Cookie track variables by default */
#define PHP_TRACK_VARS 0
+228 -32
View File
@@ -2,6 +2,147 @@ dnl $Id$
dnl
dnl This file contains local autoconf functions.
sinclude(dynlib.m4)
AC_DEFUN(PHP_SHLIB_SUFFIX_NAME,[
PHP_SUBST(SHLIB_SUFFIX_NAME)
SHLIB_SUFFIX_NAME=so
case "$host_alias" in
*hpux*)
SHLIB_SUFFIX_NAME=sl
;;
esac
])
AC_DEFUN(PHP_DEBUG_MACRO,[
DEBUG_LOG="$1"
cat >$1 <<X
CONFIGURE: $CONFIGURE_COMMAND
CC: $CC
CFLAGS: $CFLAGS
CPPFLAGS: $CPPFLAGS
CXX: $CXX
CXXFLAGS: $CXXFLAGS
INCLUDES: $INCLUDES
LDFLAGS: $LDFLAGS
LIBS: $LIBS
DLIBS: $DLIBS
SAPI: $PHP_SAPI
PHP_RPATHS: $PHP_RPATHS
uname -a: `uname -a`
X
cat >conftest.$ac_ext <<X
main()
{
exit(0);
}
X
(eval echo \"$ac_link\"; eval $ac_link && ./conftest) >>$1 2>&1
rm -fr conftest*
])
AC_DEFUN(PHP_MISSING_TIME_R_DECL,[
AC_MSG_CHECKING(for missing declarations of reentrant functions)
AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[
:
],[
AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
])
AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[
:
],[
AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
])
AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[
:
],[
AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
])
AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[
:
],[
AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
])
AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[
:
],[
AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
])
AC_MSG_RESULT(done)
])
dnl
dnl PHP_LIBGCC_LIBPATH(gcc)
dnl Stores the location of libgcc in libgcc_libpath
dnl
AC_DEFUN(PHP_LIBGCC_LIBPATH,[
changequote({,})
libgcc_libpath="`$1 --print-libgcc-file-name|sed 's%/*[^/][^/]*$%%'`"
changequote([,])
])
AC_DEFUN(PHP_ARG_ANALYZE,[
case "[$]$1" in
shared,*)
ext_output="yes, shared"
ext_shared=yes
$1=`echo $ac_n "[$]$1$ac_c"|sed s/^shared,//`
;;
shared)
ext_output="yes, shared"
ext_shared=yes
$1=yes
;;
no)
ext_output="no"
ext_shared=no
;;
*)
ext_output="yes"
ext_shared=no
;;
esac
if test "$php_always_shared"; then
ext_output="yes, shared"
ext_shared=yes
test "[$]$1" = "no" && $1=yes
fi
AC_MSG_RESULT($ext_output)
])
dnl
dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val])
dnl Sets PHP_ARG_NAME either to the user value or to the default value.
dnl default-val defaults to no.
dnl
AC_DEFUN(PHP_ARG_WITH,[
PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
])
AC_DEFUN(PHP_REAL_ARG_WITH,[
AC_MSG_CHECKING($2)
AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4))
PHP_ARG_ANALYZE($5)
])
dnl
dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val])
dnl Sets PHP_ARG_NAME either to the user value or to the default value.
dnl default-val defaults to no.
dnl
AC_DEFUN(PHP_ARG_ENABLE,[
PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
])
AC_DEFUN(PHP_REAL_ARG_ENABLE,[
AC_MSG_CHECKING($2)
AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4))
PHP_ARG_ANALYZE($5)
])
AC_DEFUN(PHP_MODULE_PTR,[
EXTRA_MODULE_PTRS="$EXTRA_MODULE_PTRS $1,"
])
@@ -23,27 +164,28 @@ EOF
])
AC_DEFUN(PHP_TIME_R_TYPE,[
AC_CACHE_CHECK(for time_r type, ac_cv_time_r_type,[
AC_CACHE_CHECK(for *time_r type, ac_cv_time_r_type,[
AC_TRY_RUN([
#include <time.h>
#include <stdlib.h>
main() {
char buf[27];
struct tm t;
time_t old = 0;
int r;
int r, s;
gmtime_r(&old, &t);
s = gmtime_r(&old, &t);
r = (int) asctime_r(&t, buf, 26);
if (r == -1 || (r > 0 && r <= 26)) exit(0);
if (r == s && s == 0) exit(0);
exit(1);
}
],[
ac_cv_time_r_type=hpux
],[
ac_cv_time_r_type=normal
ac_cv_time_r_type=SUSV2
],[
ac_cv_time_r_type=normal
ac_cv_time_r_type=SUSV2
])
])
if test "$ac_cv_time_r_type" = "hpux"; then
@@ -186,6 +328,9 @@ dnl PHP_BUILD_THREAD_SAFE
dnl
AC_DEFUN(PHP_BUILD_THREAD_SAFE,[
enable_experimental_zts=yes
if test "$pthreads_working" != "yes"; then
AC_MSG_ERROR(ZTS currently requires working POSIX threads. Your system does not support this.)
fi
])
dnl
@@ -232,7 +377,9 @@ AC_DEFUN(AC_EXPAND_PATH,[
if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
$2="$1"
else
ep_dir="`dirname \"$1\"`"
changequote({,})
ep_dir="`echo $1|sed 's%/*[^/][^/]*$%%'`"
changequote([,])
ep_realdir="`(cd \"$ep_dir\" && pwd)`"
$2="$ep_realdir/`basename \"$1\"`"
fi
@@ -260,14 +407,14 @@ dnl
dnl builds RPATH from PHP_RPATHS
dnl
AC_DEFUN(AC_BUILD_RPATH,[
if test "$enable_rpath" = "yes" && test -n "$PHP_RPATHS"; then
if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then
OLD_RPATHS="$PHP_RPATHS"
PHP_RPATHS=""
for i in $OLD_RPATHS; do
PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
PHP_RPATHS="$PHP_RPATHS -R $i"
NATIVE_RPATHS="$NATIVE_RPATHS ${ld_runpath_switch}$i"
done
PHP_RPATHS=""
for i in $OLD_RPATHS; do
PHP_LDFLAGS="$PHP_LDFLAGS -L$i"
PHP_RPATHS="$PHP_RPATHS -R $i"
NATIVE_RPATHS="$NATIVE_RPATHS ${ld_runpath_switch}$i"
done
fi
])
@@ -292,7 +439,9 @@ dnl add a library to the link line
dnl
AC_DEFUN(AC_ADD_LIBRARY,[
AC_PHP_ONCE(LIBRARY, $1, [
ifelse($#, 1, LIBS="-l$1 $LIBS", LIBS="$LIBS -l$1")
if test "$1" != "c"; then
ifelse($#, 1, LIBS="-l$1 $LIBS", LIBS="$LIBS -l$1")
fi
])
])
@@ -307,13 +456,32 @@ AC_DEFUN(AC_ADD_LIBRARY_DEFER,[
])
dnl
dnl AC_ADD_LIBRARY_WITH_PATH(library, path)
dnl AC_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])
dnl
dnl add a library to the link line and path to linkpath/runpath
dnl add a library to the link line and path to linkpath/runpath.
dnl if shared-libadd is not empty and $ext_shared is yes,
dnl shared-libadd will be assigned the library information
dnl
AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH,[
AC_ADD_LIBPATH($2)
ifelse($3,,[
if test -n "$2"; then
AC_ADD_LIBPATH($2)
fi
AC_ADD_LIBRARY($1)
],[
if test "$ext_shared" = "yes"; then
if test -n "$2"; then
$3="-R$2 -L$2 -l$1 [$]$3"
else
$3="-l$1 [$]$3"
fi
else
if test -n "$2"; then
AC_ADD_LIBPATH($2)
fi
AC_ADD_LIBRARY($1)
fi
])
])
dnl
@@ -418,21 +586,30 @@ dnl "shared" can be set to "shared" or "yes" to build the extension as
dnl a dynamically loadable library.
dnl
AC_DEFUN(PHP_EXTENSION,[
if test -d "$abs_srcdir/ext/$1" ; then
ext_src_base="$abs_srcdir/ext/$1/"
ext_base="ext/$1/"
EXT_SUBDIRS="$EXT_SUBDIRS $1"
if test "$2" != "shared" && test "$2" != "yes" && test -z "$php_always_shared"; then
_extlib="lib$1.a"
EXT_LTLIBS="$EXT_LTLIBS ext/$1/lib$1.la"
EXT_LIBS="$EXT_LIBS $1/$_extlib"
EXT_STATIC="$EXT_STATIC $1"
else
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
EXT_SHARED="$EXT_SHARED $1"
fi
PHP_FAST_OUTPUT(ext/$1/Makefile)
EXT_SUBDIRS="$EXT_SUBDIRS $1"
if test -d "$abs_srcdir/ext/$1"; then
dnl ---------------------------------------------- Internal Module
ext_builddir="ext/$1"
ext_srcdir="$abs_srcdir/ext/$1"
else
dnl ---------------------------------------------- External Module
ext_builddir="."
ext_srcdir="$abs_srcdir"
fi
if test "$2" != "shared" && test "$2" != "yes"; then
dnl ---------------------------------------------- Static module
LIB_BUILD($ext_builddir)
EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/lib$1.la"
EXT_STATIC="$EXT_STATIC $1"
else
dnl ---------------------------------------------- Shared module
LIB_BUILD($ext_builddir,yes)
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
fi
PHP_FAST_OUTPUT($ext_builddir/Makefile)
])
PHP_SUBST(EXT_SUBDIRS)
@@ -572,3 +749,22 @@ AC_DEFUN(PHP_DECLARED_TIMEZONE,[
AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone])
fi
])
AC_DEFUN(PHP_EBCDIC,[
AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[
AC_TRY_RUN( [
int main(void) {
return (unsigned char)'A' != (unsigned char)0xC1;
}
],[
ac_cv_ebcdic="yes"
],[
ac_cv_ebcdic="no"
],[
ac_cv_ebcdic="no"
])])
if test "$ac_cv_ebcdic" = "yes"; then
AC_DEFINE(CHARSET_EBCDIC,, [Define if system uses EBCDIC])
fi
])
+7 -7
View File
@@ -62,13 +62,12 @@
#define PHP_ODBC_INCLUDE "@ODBC_INCLUDE@"
#define PHP_ODBC_LFLAGS "@ODBC_LFLAGS@"
#define PHP_ODBC_LIBS "@ODBC_LIBS@"
#define PHP_ORACLE_HOME ""
#define PHP_ORACLE_INCLUDE ""
#define PHP_ORACLE_LFLAGS ""
#define PHP_ORACLE_LIBS ""
#define PHP_ORACLE_SHLIBS ""
#define PHP_ORACLE_STLIBS ""
#define PHP_ORACLE_VERSION ""
#define PHP_OCI8_SHARED_LIBADD "@OCI8_SHARED_LIBADD@"
#define PHP_OCI8_DIR "@OCI8_DIR@"
#define PHP_OCI8_VERSION "@OCI8_VERSION@"
#define PHP_ORACLE_SHARED_LIBADD "@ORACLE_SHARED_LIBADD@"
#define PHP_ORACLE_DIR "@ORACLE_DIR@"
#define PHP_ORACLE_VERSION "@ORACLE_VERSION@"
#define PHP_PGSQL_INCLUDE ""
#define PHP_PGSQL_LFLAGS ""
#define PHP_PGSQL_LIBS ""
@@ -88,3 +87,4 @@
#define PHP_LDAP_LIBS ""
#define PHP_VELOCIS_INCLUDE ""
#define PHP_VELOCIS_LIBS ""
#define PHP_EXTENSION_DIR "@EXTENSION_DIR@"
+3 -10
View File
@@ -39,14 +39,7 @@ acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
targets = $(TOUCH_FILES) $(makefile_in_files) configure $(config_h_in)
all: .deps Zend/Makefile.am TSRM/Makefile.am $(targets)
.deps:
@echo creating empty dependencies
for i in `find ext sapi regex -type d \! -name \*CVS`; do \
list="$$list $$i/.deps"; \
done; \
touch $$list pear/.deps $@
all: Zend/Makefile.am TSRM/Makefile.am $(targets)
Zend/Makefile.am:
test -d Zend || (test -d ../Zend && ln -s ../Zend Zend)
@@ -59,7 +52,7 @@ acconfig.h: $(acconfig_h_SOURCES)
cat $(acconfig_h_SOURCES) > $@
$(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_files)
@echo rebuilding Makefile.in\'s
@echo rebuilding Makefile templates
@for i in $(LT_TARGETS); do \
if test -f "$$i"; then \
mv $$i $$i.bak; \
@@ -71,7 +64,7 @@ $(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_f
|| true >&2
@for i in $(LT_TARGETS); do mv $$i.bak $$i; done
aclocal.m4: configure.in acinclude.m4
aclocal.m4: configure.in acinclude.m4 dynlib.m4
aclocal
$(config_h_in): configure acconfig.h
+5
View File
@@ -0,0 +1,5 @@
all: all-recursive
include $(builddir)/libs.mk
include $(top_srcdir)/build/rules.mk
+22 -12
View File
@@ -23,29 +23,39 @@
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
##############################################################################
# $Id: fastgen.sh,v 1.2 2000-01-01 20:48:42 sas Exp $
# $Id: fastgen.sh,v 1.6 2000-05-12 07:37:42 sas Exp $
#
srcdir=$1
shift
topsrcdir=`(cd $srcdir; pwd)`
mkdir_p=$1
shift
top_srcdir=`(cd $srcdir; pwd)`
top_builddir=`pwd`
if test "$mkdir_p" = "yes"; then
mkdir_p="mkdir -p"
else
mkdir_p="$topsrcdir/build/shtool mkdir -f -p"
mkdir_p="$top_srcdir/helpers/mkdir.sh"
fi
for i in $@ ; do
echo "creating $i"
dir=`dirname $i`
$mkdir_p $dir
sed \
-e s#@topsrcdir@#$topsrcdir# \
-e s#@srcdir@#$topsrcdir/$dir# \
< $topsrcdir/$i.in > $i
for makefile in $@; do
echo "creating $makefile"
# portable dirname
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
$mkdir_p "$dir/"
(cat <<EOF
top_srcdir = $top_srcdir
top_builddir = $top_builddir
srcdir = $top_srcdir/$dir
builddir = $top_builddir/$dir
VPATH = $top_srcdir/$dir
EOF
)| cat - $top_srcdir/$makefile.in > $makefile
test -z "$dir" || touch $dir/.deps
done
-15
View File
@@ -28,18 +28,3 @@ LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo)
$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
$(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)
$(LTLIBRARY_SHARED_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
@test -d $(phplibdir) || $(mkinstalldirs) $(phplibdir)
$(LINK) -avoid-version -module -rpath $(phplibdir) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_SHARED_LIBADD)
$(SHLIBTOOL) --mode=install cp $@ $(phplibdir)
shared:
@if test -z '$(LTLIBRARY_SHARED_NAME)'; then \
echo "LTLIBRARY_SHARED_NAME is empty. Double check your Makefile.in"; \
fi
@if test '$(SHLIBTOOL)' != '$(LIBTOOL)'; then \
$(MAKE) 'LIBTOOL=$(SHLIBTOOL)' $(LTLIBRARY_SHARED_NAME); \
else \
$(MAKE) $(LTLIBRARY_SHARED_NAME); \
fi; \
+2 -2
View File
@@ -26,6 +26,6 @@
targets = $(LTLIBRARY_NAME)
include $(topsrcdir)/build/rules.mk
include $(topsrcdir)/build/library.mk
include $(top_srcdir)/build/rules.mk
include $(top_srcdir)/build/library.mk
+22 -39
View File
@@ -24,24 +24,22 @@
# $Id$
#
include $(DEPTH)/config_vars.mk
include $(top_builddir)/config_vars.mk
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -f -p
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir)
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(DEPTH)
moduledir = $(libdir)/php/modules
top_srcdir = $(topsrcdir)
top_builddir = $(DEPTH)
moduledir = $(EXTENSION_DIR)
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .s .y .l
.SUFFIXES: .slo .c .lo .o .s .y .l
.c.o:
$(COMPILE) -c $<
@@ -49,17 +47,14 @@ top_builddir = $(DEPTH)
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
.c.lo:
$(PHP_COMPILE)
.s.lo:
$(PHP_COMPILE)
.S.lo:
$(PHP_COMPILE)
.c.slo:
$(SHARED_COMPILE)
.y.c:
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
@@ -76,48 +71,36 @@ install: install-recursive
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
@otarget=`echo $@|sed s/-recursive//`; \
if test '$(NO_RECURSION)' != "$$otarget"; then \
list='$(SUBDIRS)'; for i in $$list; do \
target="$$otarget"; \
echo "Making $$target in $$i"; \
if test "$$i" = "."; then \
ok=yes; \
target="$$target-p"; \
fi; \
(cd $$i && $(MAKE) $$target) || exit 1; \
done; \
if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi; \
fi; \
if test -n '$(make_shared)'; then \
$(MAKE) shared || exit 1; \
fi;
list='$(SUBDIRS)'; for i in $$list; do \
target="$$otarget"; \
echo "Making $$target in $$i"; \
if test "$$i" = "."; then \
ok=yes; \
target="$$target-p"; \
fi; \
(cd $$i && $(MAKE) $$target) || exit 1; \
done; \
if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
all-p: $(targets)
install-p: $(targets) $(install_targets)
distclean-p depend-p clean-p:
depend: depend-recursive
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > .deps
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
clean: clean-recursive clean-x
clean-x:
rm -f $(targets) *.lo *.la *.o $(CLEANFILES)
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
rm -rf .libs
distclean: distclean-recursive clean-x
rm -f config.cache config.log config.status config_vars.mk libtool \
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
install-modules:
@test -d modules && \
$(mkinstalldirs) $(moduledir) && \
echo "installing shared modules into $(moduledir)" && \
rm -f modules/*.la && \
cp modules/* $(moduledir) || true
include $(srcdir)/.deps
include $(builddir)/.deps
.PHONY: all-recursive clean-recursive install-recursive \
$(install_targets) install all clean depend depend-recursive shared \
+23 -36
View File
@@ -24,7 +24,7 @@
# $Id$
#
include $(DEPTH)/config_vars.mk
include $(top_builddir)/config_vars.mk
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
@@ -33,15 +33,13 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -f -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir)
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(DEPTH)
moduledir = $(libdir)/php/modules
top_srcdir = $(topsrcdir)
top_builddir = $(DEPTH)
moduledir = $(EXTENSION_DIR)
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .s .y .l
.SUFFIXES: .slo .c .lo .o .s .y .l
.c.o:
$(COMPILE) -c $<
@@ -49,17 +47,14 @@ top_builddir = $(DEPTH)
.s.o:
$(COMPILE) -c $<
.S.o:
$(COMPILE) -c $<
.c.lo:
$(PHP_COMPILE)
.s.lo:
$(PHP_COMPILE)
.S.lo:
$(PHP_COMPILE)
.c.slo:
$(SHARED_COMPILE)
.y.c:
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
@@ -70,44 +65,36 @@ top_builddir = $(DEPTH)
.l.c:
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
#################################
# Simplified Makefile
install_targets = install-modules
all: shared
install: shared install-modules
#################################
#all: all-recursive
all: all-recursive
install: install-recursive
distclean-recursive depend-recursive clean-recursive all-recursive install-recursive:
@otarget=`echo $@|sed s/-recursive//`; \
if test '$(NO_RECURSION)' != "$$otarget"; then \
list='$(SUBDIRS)'; for i in $$list; do \
target="$$otarget"; \
echo "Making $$target in $$i"; \
if test "$$i" = "."; then \
ok=yes; \
target="$$target-p"; \
fi; \
(cd $$i && $(MAKE) $$target) || exit 1; \
done; \
test "$otarget" = "all" && test -z '$(targets)' && ok=yes; \
test "$ok" = "yes" || $(MAKE) "$$otarget-p" || exit 1; \
fi;
list='$(SUBDIRS)'; for i in $$list; do \
target="$$otarget"; \
echo "Making $$target in $$i"; \
if test "$$i" = "."; then \
ok=yes; \
target="$$target-p"; \
fi; \
(cd $$i && $(MAKE) $$target) || exit 1; \
done; \
if test "$$otarget" = "all" && test -z '$(targets)'; then ok=yes; fi; \
if test "$$ok" != "yes"; then $(MAKE) "$$otarget-p" || exit 1; fi
all-p: $(targets)
install-p: $(targets) $(install_targets)
distclean-p depend-p clean-p:
depend: depend-recursive
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > .deps
test "`echo *.c`" = '*.c' || perl $(top_srcdir)/build/mkdep.perl $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) *.c > $(builddir)/.deps
clean: clean-recursive clean-x
clean-x:
rm -f $(targets) *.lo *.la *.o $(CLEANFILES)
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
rm -rf .libs
distclean: distclean-recursive clean-x
@@ -121,7 +108,7 @@ install-modules:
rm -f modules/*.la && \
cp modules/* $(moduledir) || true
include $(srcdir)/.deps
include $(builddir)/.deps
.PHONY: all-recursive clean-recursive install-recursive \
$(install_targets) install all clean depend depend-recursive shared \
+85 -76
View File
@@ -1,12 +1,12 @@
#!/bin/sh
##
## GNU shtool -- The GNU Portable Shell Tool
## Copyright (c) 1994-1999 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>
##
## See http://www.gnu.org/software/shtool/ for more information.
## See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
##
## Version 1.4.7 (24-Dec-1999)
## Version 1.4.9 (16-Apr-2000)
## Ingredients: 3/17 available modules
##
@@ -44,14 +44,14 @@
##
## Not available commands (because module was not built-in):
## mdate Pretty-print modification time of a file or dir
## table Pretty print a field-separated list as a table
## table Pretty-print a field-separated list as a table
## prop Display progress with a running propeller
## move Move files with simultan substitution
## move Move files with simultaneous substitution
## mkln Make link with calculation of relative paths
## mkshadow Make a shadow tree
## mkshadow Make a shadow tree through symbolic links
## fixperm Fix file permissions inside a source tree
## tarball Roll distribution tarballs
## guessos Simple OS/platform guesser
## guessos Simple operating system guesser
## arx Extended archive command
## slo Separate linker options by library class
## scpp Sharing C Pre-Processor
@@ -65,8 +65,8 @@ if [ $# -eq 0 ]; then
exit 1
fi
if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo "This is GNU shtool, version 1.4.7 (24-Dec-1999)"
echo "Copyright (c) 1994-1999 Ralf S. Engelschall <rse@engelschall.com>"
echo "This is GNU shtool, version 1.4.9 (16-Apr-2000)"
echo "Copyright (c) 1994-2000 Ralf S. Engelschall <rse@engelschall.com>"
echo "Report bugs to <bug-shtool@gnu.org>"
echo ''
echo "Usage: shtool [<options>] [<cmd-name> [<cmd-options>] [<cmd-args>]]"
@@ -94,9 +94,9 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
echo ' <user>] [-g <group>] [-e <pattern>] <path> [<path> ...]'
echo ' guessos '
echo ' arx [-t] [-C<cmd>] <op> <archive> [<file> ...]'
echo ' slo -- -L<dir> -l<lib> [ -L<dir> -l<lib> ... ]'
echo ' scpp [-v] [-p] [-o<ofile>] [-t<tfile>] [-M<mark>] [-D<dname>]'
echo ' [-C<cname>] <file> [<file> ...]'
echo ' slo [-p<str>] -- -L<dir> -l<lib> [-L<dir> -l<lib> ...]'
echo ' scpp [-v] [-p] [-f<filter>] [-o<ofile>] [-t<tfile>] [-M<mark>]'
echo ' [-D<dname>] [-C<cname>] <file> [<file> ...]'
echo ' version [-l<lang>] [-n<name>] [-p<prefix>] [-s<version>] [-i<knob>]'
echo ' [-d<type>] <file>'
echo ' path [-s] [-r] [-d] [-b] [-m] [-p<path>] <str> [<str> ...]'
@@ -104,7 +104,7 @@ if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then
exit 0
fi
if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then
echo "GNU shtool 1.4.7 (24-Dec-1999)"
echo "GNU shtool 1.4.9 (16-Apr-2000)"
exit 0
fi
if [ ".$1" = ".-d" -o ".$1" = ."--debug" ]; then
@@ -136,13 +136,20 @@ case $tool in
str_tool="echo"
str_usage="[-n] [-e] [<str> ...]"
arg_spec="0+"
opt_spec="ne"
opt_spec="n.e."
opt_n=no
opt_e=no
;;
install )
str_tool="install"
str_usage="[-v] [-t] [-c] [-C] [-s] [-m<mode>] [-o<owner>] [-g<group>] [-e<ext>] <file> <path>"
arg_spec="2"
opt_spec="vtcCsm:o:g:e:"
arg_spec="2="
opt_spec="v.t.c.C.s.m:o:g:e:"
opt_v=no
opt_t=no
opt_c=no
opt_C=no
opt_s=no
opt_m=""
opt_o=""
opt_g=""
@@ -152,9 +159,17 @@ case $tool in
str_tool="mkdir"
str_usage="[-t] [-f] [-p] [-m<mode>] <dir> [<dir> ...]"
arg_spec="1+"
opt_spec="tfpm:"
opt_spec="t.f.p.m:"
opt_t=no
opt_f=no
opt_p=no
opt_m=""
;;
-* )
echo "$0:Error: unknown option \`$tool'" 2>&1
echo "$0:Hint: run \`$0 -h' for usage" 2>&1
exit 1
;;
* )
echo "$0:Error: unknown command \`$tool'" 2>&1
echo "$0:Hint: run \`$0 -h' for usage" 2>&1
@@ -168,30 +183,24 @@ esac
# determine name of tool
if [ ".$tool" != . ]; then
# inside shtool
# used inside shtool script
toolcmd="$0 $tool"
toolcmdhelp="shtool $tool"
msgprefix="shtool:$tool"
else
# standalone
# used as standalone script
toolcmd="$0"
toolcmdhelp="sh.$tool"
toolcmdhelp="sh $0"
msgprefix="$str_tool"
fi
# parse argument specification string
eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'`
test ".$arg_MODE" = . && arg_MODE="="
eval `echo $arg_spec |\
sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
# parse option specification string
for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][:+]*\)/\1 /g'`; do
opt_MODE="."
eval `echo $opt |\
sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \
-e 's/";\([:+]\)/"; opt_MODE="\1";/'`
eval "opt_MODE_${opt_THIS}=${opt_MODE}"
test "$opt_MODE" = . && eval "opt_${opt_THIS}=no"
done
eval `echo h.$opt_spec |\
sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
# interate over argument line
opt_PREV=''
@@ -209,7 +218,7 @@ while [ $# -gt 0 ]; do
opt_OPT="$opt_PREV"
opt_ARG="$1"
opt_ARG_OK=yes
opt_PREV=""
opt_PREV=''
else
# split argument into option and argument
case "$1" in
@@ -219,8 +228,7 @@ while [ $# -gt 0 ]; do
-e 's/";\(.*\)$/"; opt_ARG="\1"/'`
;;
-[a-zA-Z0-9])
opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \
"OPT=$1" </dev/null"`
opt_OPT=`echo "x$1" | cut -c3-`
opt_ARG=''
;;
*)
@@ -243,15 +251,15 @@ while [ $# -gt 0 ]; do
# process option
case $opt_MODE in
"." )
'.' )
# boolean option
eval "opt_${opt_OPT}=yes"
;;
":" )
':' )
# option with argument (multiple occurances override)
eval "opt_${opt_OPT}=\"\$opt_ARG\""
;;
"+" )
'+' )
# option with argument (multiple occurances append)
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT} \$opt_ARG\""
;;
@@ -276,14 +284,14 @@ fi
# complain about incorrect number of arguments
case $arg_MODE in
"=" )
'=' )
if [ $# -ne $arg_NUMS ]; then
echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
exit 1
fi
;;
"+" )
'+' )
if [ $# -lt $arg_NUMS ]; then
echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2
echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2
@@ -294,13 +302,12 @@ esac
# establish a temporary file on request
if [ ".$gen_tmpfile" = .yes ]; then
tmpdir="/tmp"
if [ ".$TMPDIR" != . ]; then
tmpdir="$TMPDIR"
elif [ ".$TEMPDIR" != . ]; then
tmpdir="$TEMPDIR"
else
if [ ".$TEMPDIR" != . ]; then
tmpdir="$TEMPDIR"
fi
tmpdir="/tmp"
fi
tmpfile="$tmpdir/.shtool.$$"
rm -f $tmpfile >/dev/null 2>&1
@@ -316,7 +323,7 @@ case $tool in
echo )
##
## echo -- Print string with optional construct expansion
## Copyright (c) 1998-1999 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1998-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for WML as buildinfo
##
@@ -343,8 +350,8 @@ echo )
term_bold=''
term_norm=''
if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then
# the most important terminals we directly know
case $TERM in
# for the most important terminal types we directly know the sequences
xterm|xterm*|vt220|vt220*)
term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' </dev/null 2>/dev/null`
term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' </dev/null 2>/dev/null`
@@ -353,35 +360,37 @@ echo )
term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' </dev/null 2>/dev/null`
term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' </dev/null 2>/dev/null`
;;
esac
# then try a possibly existing "tput" or "tcout" utility
paths=`echo $PATH | sed -e 's/:/ /g'`
for tool in tput tcout; do
for dir in $paths; do
if [ -r "$dir/$tool" ]; then
for seq in bold md smso; do # smso is last
bold="`$dir/$tool $seq 2>/dev/null`"
if [ ".$bold" != . ]; then
term_bold="$bold"
# for all others, we try to use a possibly existing `tput' or `tcout' utility
* )
paths=`echo $PATH | sed -e 's/:/ /g'`
for tool in tput tcout; do
for dir in $paths; do
if [ -r "$dir/$tool" ]; then
for seq in bold md smso; do # 'smso' is last
bold="`$dir/$tool $seq 2>/dev/null`"
if [ ".$bold" != . ]; then
term_bold="$bold"
break
fi
done
if [ ".$term_bold" != . ]; then
for seq in sgr0 me rmso reset; do # 'reset' is last
norm="`$dir/$tool $seq 2>/dev/null`"
if [ ".$norm" != . ]; then
term_norm="$norm"
break
fi
done
fi
break
fi
done
if [ ".$term_bold" != . ]; then
for seq in sgr0 me rmso reset; do # 'reset' is last
norm="`$dir/$tool $seq 2>/dev/null`"
if [ ".$norm" != . ]; then
term_norm="$norm"
break
fi
done
if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
break;
fi
break
fi
done
if [ ".$term_bold" != . -a ".$term_norm" != . ]; then
break;
fi
done
done
;;
esac
if [ ".$term_bold" = . -o ".$term_norm" = . ]; then
echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2
fi
@@ -525,7 +534,7 @@ echo )
echo $seo "$text"
else
# the harder part: echo -n is best, because
# awk complains about some \xx sequences.
# awk may complain about some \xx sequences.
if [ ".$minusn" != . ]; then
echo $seo $minusn "$text"
else
@@ -537,7 +546,7 @@ echo )
install )
##
## install -- Install a program, script or datafile
## Copyright (c) 1997-1999 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1997-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for shtool
##
@@ -644,24 +653,24 @@ install )
mkdir )
##
## mkdir -- Make one or more directories
## Copyright (c) 1996-1999 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 1996-2000 Ralf S. Engelschall <rse@engelschall.com>
## Originally written for public domain by Noah Friedman <friedman@prep.ai.mit.edu>
## Cleaned up and enhanced for shtool
##
errstatus=0
for p in ${1+"$@"}; do
# when the directory already exists...
# if the directory already exists...
if [ -d "$p" ]; then
if [ ".$opt_f" = .no ]; then
echo "$msgprefix:Error: file exists: $p" 1>&2
if [ ".$opt_f" = .no ] && [ ".$opt_p" = .no ]; then
echo "$msgprefix:Error: directory already exists: $p" 1>&2
errstatus=1
break
else
continue
fi
fi
# when the directory has to be created
# if the directory has to be created...
if [ ".$opt_p" = .no ]; then
if [ ".$opt_t" = .yes ]; then
echo "mkdir $p" 1>&2
@@ -675,7 +684,7 @@ mkdir )
-e 's/\// /g' \
-e 's/^%/\//'`
shift
pathcomp=
pathcomp=''
for d in ${1+"$@"}; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
+190 -148
View File
@@ -7,12 +7,6 @@ AC_INIT(main.c)
PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile)
dnl Because ``make install'' is often performed by the superuser,
dnl we create the libs subdirectory as the user who configures PHP.
dnl Otherwise, the current user will not be able to delete libs
dnl or the contents of libs.
test -d libs || mkdir libs
if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
AC_MSG_ERROR(--with-shared-apache is not supported. Please refer to the documentation for using APXS)
fi
@@ -33,6 +27,14 @@ php_shtool="$srcdir/build/shtool"
T_MD=`$php_shtool echo -n -e %B`
T_ME=`$php_shtool echo -n -e %b`
dnl Because ``make install'' is often performed by the superuser,
dnl we create the libs subdirectory as the user who configures PHP.
dnl Otherwise, the current user will not be able to delete libs
dnl or the contents of libs.
$php_shtool mkdir -p libs
rm -f libs/*
dnl ## Diversion 2 is the initial checking of OS features, programs,
dnl ## libraries and so on.
@@ -48,12 +50,8 @@ dnl ## All of these are normally in the extension directories.
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
divert(2)
PHP_CONFIGURE_PART(Running system checks)
dnl ## This is where the version number is changed from now on!
AM_INIT_AUTOMAKE(php, 4.0RC1)
AM_INIT_AUTOMAKE(php, 4.0.0)
PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
@@ -74,12 +72,6 @@ AC_CANONICAL_HOST
dnl We want this one before the checks, so the checks can modify CFLAGS.
test -z "$CFLAGS" && auto_cflags=1
dnl ## If we're using cc on HP-UX, add -Ae -D_HPUX_SOURCE [obsolete]
dnl ## if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"
dnl ## then
dnl ## test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE"
dnl ## fi
dnl Checks for programs.
AC_PROG_YACC
if test "$YACC" != "bison -y"; then
@@ -95,11 +87,8 @@ else
AC_MSG_RESULT($1.$2 (ok))
fi
dnl ## there has to be a better way...
dnl ## OLDLIBS=$LIBS; LIBS=""
AC_PROG_CC
AC_AIX
dnl ## LIBS=$OLDLIBS
AM_PROG_CC_STDC
@@ -121,6 +110,37 @@ sinclude(Zend/acinclude.m4)
sinclude(Zend/Zend.m4)
sinclude(TSRM/tsrm.m4)
divert(2)
PTHREADS_CHECK
PHP_SHLIB_SUFFIX_NAME
PHP_SAPI=cgi
PHP_BUILD_PROGRAM
dnl paths to the targets relative to the build directory
SAPI_PROGRAM=php
SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME
SAPI_STATIC=libs/libphp4.a
PHP_CONFIGURE_PART(Configuring SAPI modules)
esyscmd(./scripts/config-stubs sapi)
AC_MSG_CHECKING(for chosen SAPI module)
AC_MSG_RESULT($PHP_SAPI)
if test "$enable_experimental_zts" = "yes"; then
PTHREADS_ASSIGN_VARS
PTHREADS_FLAGS
fi
divert(3)
PHP_CONFIGURE_PART(Running system checks)
PHP_MISSING_TIME_R_DECL
dnl check for -R, etc. switch
AC_MSG_CHECKING(whether compiler supports -R)
AC_CACHE_VAL(php_cv_cc_dashr,[
@@ -153,20 +173,20 @@ if test -n "$PROG_SENDMAIL"; then
AC_DEFINE(HAVE_SENDMAIL)
fi
dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset
PHP_EBCDIC
dnl
dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
dnl and source packages. This should be harmless on other OSs.
dnl
if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
CFLAGS="$CFLAGS -I/usr/pkg/include"
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
fi
INCLUDES="-I\$(top_builddir)/Zend -I\$(top_srcdir)"
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend -I\$(top_srcdir)"
AC_CHECK_LIB(nsl, gethostname, [
AC_ADD_LIBRARY(nsl)
AC_DEFINE(HAVE_LIBNSL) ], [])
AC_CHECK_LIB(socket, socket, [
AC_ADD_LIBRARY(socket)
@@ -175,14 +195,33 @@ AC_CHECK_LIB(socket, socket, [
AC_ADD_LIBRARY(socket)
])])
AC_CHECK_LIB(nsl, gethostbyaddr, [
dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try
dnl to avoid -lnsl checks, if we already have the functions which
dnl are usually in libnsl
unset ac_cv_func_yp_get_default_domain
AC_CHECK_FUNC(yp_get_default_domain,
[php_no_nsl_checks=yes],[ ])
unset ac_cv_func_yp_get_default_domain
if test "$php_no_nsl_checks" != "yes"; then
AC_CHECK_LIB(nsl, gethostname, [
AC_ADD_LIBRARY(nsl)
AC_DEFINE(HAVE_LIBNSL) ], [])
AC_DEFINE(HAVE_LIBNSL) ],[
AC_CHECK_LIB(nsl, gethostbyaddr, [
AC_ADD_LIBRARY(nsl)
AC_DEFINE(HAVE_LIBNSL) ], [])
])
fi
AC_CHECK_LIB(crypt, crypt, [
AC_ADD_LIBRARY(crypt)
AC_DEFINE(HAVE_LIBCRYPT,1,[ ]) ], [])
AC_CHECK_LIB(dl, dlopen,[AC_ADD_LIBRARY(dl)])
dnl The sin may be in a library which need not be specifed
dnl as well as res_search resides in libsocket
AC_CHECK_LIB(m, sin)
@@ -227,6 +266,7 @@ crypt.h \
dlfcn.h \
fcntl.h \
grp.h \
ieeefp.h \
limits.h \
locale.h \
memory.h \
@@ -246,6 +286,7 @@ sys/time.h \
sys/types.h \
sys/varargs.h \
sys/wait.h \
sys/resource.h \
syslog.h \
unistd.h \
unix.h \
@@ -306,7 +347,6 @@ putenv \
random \
rand_r \
regcomp \
rint \
setitimer \
setlocale \
setsockopt \
@@ -360,50 +400,32 @@ if test $ac_cv_type_in_addr_t = no; then
AC_DEFINE(in_addr_t, u_int)
fi
divert(3)
divert(4)
abs_srcdir=`(cd $srcdir; pwd)`
abs_builddir=`pwd`
AC_MSG_CHECKING(whether to use a configuration file)
AC_ARG_WITH(config-file-path,
PHP_ARG_WITH(config-file-path,whether to use a configuration file,
[ --with-config-file-path=PATH
Sets the path in which to look for php.ini.
defaults to /usr/local/lib],
[
if test "$withval" = "yes"; then
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "/usr/local/lib")
AC_DEFINE(USE_CONFIG_FILE, 1)
AC_MSG_RESULT(yes)
else
if test "$withval" != "no"; then
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "$withval")
AC_DEFINE(USE_CONFIG_FILE, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(CONFIGURATION_FILE_PATH, 0)
AC_DEFINE(USE_CONFIG_FILE, 0)
AC_MSG_RESULT(no)
fi
fi
],[
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "/usr/local/lib")
defaults to /usr/local/lib], yes)
if test "$PHP_CONFIG_FILE_PATH" = "yes"; then
PHP_CONFIG_FILE_PATH="/usr/local/lib"
fi
if test "$PHP_CONFIG_FILE_PATH" != "no"; then
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "$PHP_CONFIG_FILE_PATH")
AC_DEFINE(USE_CONFIG_FILE, 1)
AC_MSG_RESULT(yes)
])
else
AC_DEFINE(CONFIGURATION_FILE_PATH, 0)
AC_DEFINE(USE_CONFIG_FILE, 0)
fi
AC_ARG_ENABLE(debug,
[ --disable-debug Compile without debugging symbols], [
PHP_DEBUG=$enableval
],[
PHP_DEBUG=yes
])
AC_MSG_CHECKING(whether to include debugging symbols)
AC_MSG_RESULT($PHP_DEBUG)
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
[ --disable-debug Compile without debugging symbols.], yes)
if test "$PHP_DEBUG" = "yes"; then
PHP_DEBUG=1
@@ -416,23 +438,14 @@ fi
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
PHP_ARG_ENABLE(safe-mode, whether to enable safe mode by default,
[ --enable-safe-mode Enable safe mode by default.])
AC_MSG_CHECKING(whether to enable safe mode by default)
AC_ARG_ENABLE(safe-mode,
[ --enable-safe-mode Enable safe mode by default.],
[
if test "$enableval" = "yes"; then
AC_DEFINE(PHP_SAFE_MODE, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(PHP_SAFE_MODE, 0)
AC_MSG_RESULT(no)
fi
],[
AC_DEFINE(PHP_SAFE_MODE, 0)
AC_MSG_RESULT(no)
])
if test "$PHP_SAFE_MODE" = "yes"; then
AC_DEFINE(PHP_SAFE_MODE, 1)
else
AC_DEFINE(PHP_SAFE_MODE, 0)
fi
AC_MSG_CHECKING(for safe mode exec dir)
AC_ARG_WITH(exec-dir,
@@ -456,55 +469,48 @@ AC_ARG_WITH(exec-dir,
AC_MSG_RESULT(/usr/local/php/bin)
])
PHP_ARG_ENABLE(sigchild,whether to enable PHP's own SIGCHLD handler,
[ --enable-sigchild Enable PHP's own SIGCHLD handler.],no)
AC_MSG_CHECKING(whether to enable track_vars variables by default)
AC_ARG_ENABLE(track-vars,
[ --enable-track-vars Enable GET/POST/Cookie track variables by default.],
[
if test "$enableval" = "yes"; then
AC_DEFINE(PHP_TRACK_VARS, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(PHP_TRACK_VARS, 0)
AC_MSG_RESULT(no)
fi
],[
AC_DEFINE(PHP_TRACK_VARS, 0)
AC_MSG_RESULT(no)
])
if test "$PHP_SIGCHILD" = "yes"; then
AC_DEFINE(PHP_SIGCHILD, 1)
else
AC_DEFINE(PHP_SIGCHILD, 0)
fi
PHP_ARG_ENABLE(track-vars,whether to enable track_vars variables by default,
[ --enable-track-vars Enable GET/POST/Cookie track variables by default.],yes)
AC_MSG_CHECKING(whether to enable magic quotes by default)
AC_ARG_ENABLE(magic-quotes,
[ --enable-magic-quotes Enable magic quotes by default.],
[
if test "$enableval" = "yes"; then
AC_DEFINE(MAGIC_QUOTES, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(MAGIC_QUOTES, 0)
AC_MSG_RESULT(no)
fi
],[
AC_DEFINE(MAGIC_QUOTES, 0)
AC_MSG_RESULT(no)
])
if test "$PHP_TRACK_VARS" = "yes"; then
AC_DEFINE(PHP_TRACK_VARS, 1)
else
AC_DEFINE(PHP_TRACK_VARS, 0)
fi
PHP_ARG_ENABLE(magic-quotes,whether to enable magic quotes by default,
[ --enable-magic-quotes Enable magic quotes by default.])
AC_MSG_CHECKING(whether to enable runpaths)
AC_ARG_ENABLE(rpath,
if test "$PHP_MAGIC_QUOTES" = "yes"; then
AC_DEFINE(MAGIC_QUOTES, 1)
else
AC_DEFINE(MAGIC_QUOTES, 0)
fi
PHP_ARG_ENABLE(rpath, whether to enable runpaths,
[ --disable-rpath Disable passing additional runtime library
search paths],
[
if test "$enableval" = "no"; then
enable_rpath=no
else
enable_rpath=yes
search paths], yes)
PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc,
[ --enable-libgcc Enable explicitly linking against libgcc])
if test "$PHP_LIBGCC" = "yes"; then
PHP_LIBGCC_LIBPATH(gcc)
if test -z "$libgcc_libpath"; then
AC_MSG_ERROR(Cannot locate libgcc. Make sure that gcc is in your path)
fi
],[
enable_rpath=yes
])
AC_MSG_RESULT($enable_rpath)
AC_ADD_LIBPATH($libgcc_libpath)
AC_ADD_LIBRARY(gcc, yes)
fi
AC_MSG_CHECKING(whether to enable short tags by default)
AC_ARG_ENABLE(short-tags,
@@ -577,23 +583,8 @@ if test "$PHP_PEAR" = "yes"; then
PEAR_DIR=pear
fi
PHP_SAPI=cgi
PHP_BUILD_PROGRAM
dnl paths to the targets relative to the build directory
SAPI_PROGRAM=php
dnl on HP-UX, the extension is .sl. Need to improve this
SAPI_SHARED=libs/libphp4.so
SAPI_STATIC=libs/libphp4.a
PHP_CONFIGURE_PART(Configuring SAPI modules)
esyscmd(./scripts/config-stubs sapi)
AC_MSG_CHECKING(for chosen SAPI module)
AC_MSG_RESULT($PHP_SAPI)
divert(4)
divert(5)
PHP_CONFIGURE_PART(Configuring extensions)
@@ -619,7 +610,7 @@ if test "$PHP_VERSIONING" = "yes"; then
fi
fi
divert(5)
divert(6)
enable_shared=yes
enable_static=yes
@@ -643,8 +634,6 @@ fi
PHP_REGEX
PTHREADS_FLAGS
PHP_CONFIGURE_PART(Configuring Zend)
LIBZEND_BASIC_CHECKS
LIBZEND_OTHER_CHECKS
@@ -682,12 +671,34 @@ fi
phplibdir="`pwd`/modules"
$php_shtool mkdir -p $phplibdir
phptempdir="`pwd`/libs"
test "$prefix" = "NONE" && prefix="/usr/local"
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
dnl Build extension directory path
if test "$PHP_DEBUG" = "1"; then
PART1=debug
else
PART1=no-debug
fi
if test "$enable_experimental_zts" = "yes"; then
PART2=zts
else
PART2=non-zts
fi
ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' $srcdir/Zend/modules.h|sed 's/#define ZEND_MODULE_API_NO //'`
EXTENSION_DIR="$prefix/lib/php/extensions/$PART1-$PART2-$ZEND_MODULE_API_NO"
AC_BUILD_RPATH
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE")
PHP_UNAME=`uname -a`
@@ -715,6 +726,7 @@ PHP_SUBST(CPPFLAGS)
PHP_SUBST(CXX)
PHP_SUBST(DEBUG_CFLAGS)
PHP_SUBST(DEFS)
PHP_SUBST(EXTENSION_DIR)
PHP_SUBST(EXTRA_LDFLAGS)
PHP_SUBST(EXTRA_LIBS)
PHP_SUBST(INCLUDES)
@@ -723,6 +735,7 @@ PHP_SUBST(LEX)
PHP_SUBST(LEX_OUTPUT_ROOT)
PHP_SUBST(LFLAGS)
PHP_SUBST(LIBTOOL)
PHP_SUBST(LN_S)
PHP_SUBST(NATIVE_RPATHS)
PHP_SUBST(PEAR_DIR)
PHP_SUBST(PHP_BUILD_DATE)
@@ -735,7 +748,7 @@ PHP_SUBST(PHP_SAPI)
PHP_SUBST(PHP_VERSION)
PHP_SUBST(PROG_SENDMAIL)
PHP_SUBST(SHELL)
PHP_SUBST(SHLIBTOOL)
PHP_SUBST(SHARED_LIBTOOL)
PHP_SUBST(TSRM_DIR)
PHP_SUBST(TSRM_LIB)
PHP_SUBST(WARNING_LEVEL)
@@ -746,6 +759,8 @@ PHP_CONFIGURE_PART(Configuring libtool)
old_CC="$CC"
if test "$PHP_THREAD_SAFETY" = "yes" && test -n "$ac_cv_pthreads_cflags"; then
CXXFLAGS="$CXXFLAGS $ac_cv_pthreads_cflags"
INLINE_CFLAGS="$INLINE_CFLAGS $ac_cv_pthreads_cflags"
cat >meta_ccld<<EOF
#! /bin/sh
exec $CC $ac_cv_pthreads_cflags \$@
@@ -754,6 +769,12 @@ EOF
chmod +x meta_ccld
fi
dnl This will go away, if we have a facility to run per-extension code
dnl after the thread_safety decision was done
if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
CPPFLAGS="$CPPFLAGS -DTHREAD=1"
fi
AM_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
AM_SET_LIBTOOL_VARIABLE([--silent])
@@ -762,12 +783,12 @@ fi
PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
if test "$enable_shared" = "yes"; then
SHLIBTOOL='$(LIBTOOL)'
SHARED_LIBTOOL='$(LIBTOOL)'
else
if test -n "$EXT_SHARED"; then
if test "$lib_build_shared" = "yes"; then
PHP_CONFIGURE_PART(Configuring shared libtool)
$SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
SHLIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
SHARED_LIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
else
PHP_COMPILE='$(COMPILE) -c $< && touch $@'
fi
@@ -787,12 +808,10 @@ EOF
fi
changequote([,])
test "$prefix" = "NONE" && prefix="/usr/local"
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
PHP_CONFIGURE_PART(Generating files)
PHP_FAST_GENERATE
touch .deps
#libphp4.module
AC_OUTPUT([php4.spec Zend/Makefile
@@ -841,7 +860,7 @@ if true; then
echo "+--------------------------------------------------------------------+"
echo "| WARNING: Your $APXS script is most likely broken."
echo "| |"
echo "| Please go read http://www.php.net/FAQ.php3#4.11 and make the |"
echo "| Please go read http://www.php.net/FAQ.php3#6.11 and make the |"
echo "| changes described there and try again. |"
fi
@@ -860,6 +879,23 @@ if true; then
fi
fi
if test -n "$DEBUG_LOG"; then
rm -f config.cache
cat <<X
+--------------------------------------------------------------------+
| ATTENTION! |
| Something is likely to be screwed up here, because the configure |
| script was not able to detect a simple feature on your platform. |
| This is often caused by incorrect configuration parameters. Please |
| see the file debug.log for error messages. |
| |
| If you are unable to fix this, send the file debug.log to the |
| php-install@lists.php.net mailing list and include appropiate |
| information about your setup. |
X
fi
echo "+--------------------------------------------------------------------+"
echo "| License: |"
echo "| This software is subject to the PHP License, available in this |"
@@ -869,6 +905,12 @@ if true; then
echo "| the installation process at this point. |"
echo "+--------------------------------------------------------------------+"
cat<<X
Thank you for using PHP.
X
fi
])
-424
View File
@@ -1,424 +0,0 @@
/****************************************************************************
*
* Copyright (C) 1991 Kendall Bennett.
* All rights reserved.
*
* Filename: $RCSfile$
* Version: $Revision$
*
* Language: ANSI C
* Environment: any
*
* Description: Module to implement doubly linked lists. Includes a routine
* to peform a mergesort on the doubly linked list.
*
* $Id$
*
* Revision History:
* -----------------
*
* $Log$
* Revision 1.2 1999/08/23 19:43:01 sas
* malloc.h is deprecated, use stdlib.h instead
*
* Revision 1.1 1999/07/19 18:58:44 andrey
* Moving dlist stuff into core.
*
* Revision 1.2 1999/05/11 00:01:42 zeev
* * Get Apache to work. POST doesn't work yet.
* * There are now -I directives for the absolute path of php4, php4/Zend and the builddir for
* the Apache module, so we can #include any php/Zend header.
* * Rename config.h to php_config.h
*
* Revision 1.1 1999/04/21 23:11:20 ssb
* moved apache, com and hyperwave into ext/
*
* Revision 1.1.1.1 1999/04/07 21:03:31 zeev
* PHP 4.0
*
* Revision 1.1.1.1 1999/03/17 04:29:11 andi
* PHP4
*
* Revision 1.1.1.1 1998/12/21 07:56:22 andi
* Trying to start the zend CVS tree
*
* Revision 1.1 1998/08/12 09:29:16 steinm
* First version of Hyperwave module.
*
* Revision 1.5 91/12/31 19:39:49 kjb
* Modified include file directories.
*
* Revision 1.4 91/10/28 03:16:39 kjb
* Ported to the Iris.
*
* Revision 1.3 91/09/27 03:09:18 kjb
* Cosmetic change.
*
* Revision 1.2 91/09/03 18:27:42 ROOT_DOS
* Ported to UNIX.
*
* Revision 1.1 91/09/01 18:35:23 ROOT_DOS
* Initial revision
*
****************************************************************************/
#ifndef MSVC5
#include "php_config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include "dlist.h"
#define PUBLIC
#define PRIVATE static
PUBLIC void *dlst_newnode(int size)
/****************************************************************************
*
* Function: dlst_newnode
* Parameters: size - Amount of memory to allocate for node
* Returns: Pointer to the allocated node's user space.
*
* Description: Allocates the memory required for a node, adding a small
* header at the start of the node. We return a reference to
* the user space of the node, as if it had been allocated via
* malloc().
*
****************************************************************************/
{
PHP_DLST_BUCKET *node;
if ( !(node = (PHP_DLST_BUCKET*)malloc(size + sizeof(PHP_DLST_BUCKET))) ) {
fprintf(stderr,"Not enough memory to allocate list node.\n");
/* raise(SIGABRT);*/
return NULL;
}
return PHP_DLST_USERSPACE(node); /* Return pointer to user space */
}
PUBLIC void dlst_freenode(void *node)
/****************************************************************************
*
* Function: dlst_freenode
* Parameters: node - Node to free.
*
* Description: Frees a node previously allocated with lst_newnode().
*
****************************************************************************/
{
free(PHP_DLST_HEADER(node));
}
PUBLIC DLIST *dlst_init(void)
/****************************************************************************
*
* Function: dlst_init
* Returns: Pointer to a newly created list.
*
* Description: Initialises a list and returns a pointer to it.
*
****************************************************************************/
{
DLIST *l;
if ((l = (DLIST*)malloc(sizeof(DLIST))) != NULL) {
l->count = 0;
l->head = &(l->hz[0]);
l->z = &(l->hz[1]);
l->head->next = l->z->next = l->z;
l->z->prev = l->head->prev = l->head;
}
else {
fprintf(stderr,"Insufficient memory to allocate list\n");
/*raise(SIGABRT);*/
return NULL;
}
return l;
}
PUBLIC void dlst_kill(DLIST *l,void (*freeNode)(void *node))
/****************************************************************************
*
* Function: dlst_kill
* Parameters: l - List to kill
* freeNode - Pointer to user routine to free a node
*
* Description: Kills the list l, by deleting all of the elements contained
* within the list one by one and then deleting the list
* itself. Note that we call the user supplied routine
* (*freeNode)() to free each list node. This allows the user
* program to perform any extra processing needed to kill each
* node (if each node contains pointers to other items on the
* heap for example). If no extra processing is required, just
* pass the address of dlst_freenode(), ie:
*
* dlst_kill(myList,dlst_freenode);
*
****************************************************************************/
{
PHP_DLST_BUCKET *n,*p;
n = l->head->next;
while (n != l->z) { /* Free all nodes in list */
p = n;
n = n->next;
(*freeNode)(PHP_DLST_USERSPACE(p));
}
free(l); /* Free the list itself */
}
PUBLIC void dlst_insertafter(DLIST *l,void *node,void *after)
/****************************************************************************
*
* Function: lst_insertafter
* Parameters: l - List to insert node into
* node - Pointer to user space of node to insert
* after - Pointer to user space of node to insert node after
*
* Description: Inserts a new node into the list after the node 'after'. To
* insert a new node at the beginning of the list, user the
* macro PHP_DLST_HEAD in place of 'after'. ie:
*
* dlst_insertafter(mylist,node,PHP_DLST_HEAD(mylist));
*
****************************************************************************/
{
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(node),*a = PHP_DLST_HEADER(after);
n->next = a->next;
a->next = n;
n->prev = a;
n->next->prev = n;
l->count++;
}
PUBLIC void *dlst_deletenext(DLIST *l,void *node)
/****************************************************************************
*
* Function: lst_deletenext
* Parameters: l - List to delete node from.
* node - Node to delete the next node from
* Returns: Pointer to the deleted node's userspace.
*
* Description: Removes the node AFTER 'node' from the list l.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(node);
node = PHP_DLST_USERSPACE(n->next);
n->next->next->prev = n;
n->next = n->next->next;
l->count--;
return node;
}
PUBLIC void *dlst_first(DLIST *l)
/****************************************************************************
*
* Function: dlst_first
* Parameters: l - List to obtain first node from
* Returns: Pointer to first node in list, NULL if list is empty.
*
* Description: Returns a pointer to the user space of the first node in
* the list. If the list is empty, we return NULL.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n;
n = l->head->next;
return (n == l->z ? NULL : PHP_DLST_USERSPACE(n));
}
PUBLIC void *dlst_last(DLIST *l)
/****************************************************************************
*
* Function: dlst_last
* Parameters: l - List to obtain last node from
* Returns: Pointer to last node in list, NULL if list is empty.
*
* Description: Returns a pointer to the user space of the last node in
* the list. If the list is empty, we return NULL.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n;
n = l->z->prev;
return (n == l->head ? NULL : PHP_DLST_USERSPACE(n));
}
PUBLIC void *dlst_next(void *prev)
/****************************************************************************
*
* Function: dlst_next
* Parameters: prev - Previous node in list to obtain next node from
* Returns: Pointer to the next node in the list, NULL at end of list.
*
* Description: Returns a pointer to the user space of the next node in the
* list given a pointer to the user space of the previous node.
* If we have reached the end of the list, we return NULL. The
* end of the list is detected when the next pointer of a node
* points back to itself, as does the dummy last node's next
* pointer. This enables us to detect the end of the list
* without needed access to the list data structure itself.
*
* NOTE: We do no checking to ensure that 'prev' is NOT a
* NULL pointer.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(prev);
n = n->next;
return (n == n->next ? NULL : PHP_DLST_USERSPACE(n));
}
PUBLIC void *dlst_prev(void *next)
/****************************************************************************
*
* Function: dlst_prev
* Parameters: next - Next node in list to obtain previous node from
* Returns: Pointer to the previous node in the list, NULL at start list.
*
* Description: Returns a pointer to the user space of the prev node in the
* list given a pointer to the user space of the next node.
* If we have reached the start of the list, we return NULL. The
* start of the list is detected when the prev pointer of a node
* points back to itself, as does the dummy head node's prev
* pointer. This enables us to detect the start of the list
* without needed access to the list data structure itself.
*
* NOTE: We do no checking to ensure that 'next' is NOT a
* NULL pointer.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(next);
n = n->prev;
return (n == n->prev ? NULL : PHP_DLST_USERSPACE(n));
}
/* Static globals required by merge() */
static PHP_DLST_BUCKET *z;
static int (*cmp)(void*,void*);
PRIVATE PHP_DLST_BUCKET *merge(PHP_DLST_BUCKET *a,PHP_DLST_BUCKET *b,PHP_DLST_BUCKET **end)
/****************************************************************************
*
* Function: merge
* Parameters: a,b - Sublist's to merge
* Returns: Pointer to the merged sublists.
*
* Description: Merges two sorted lists of nodes together into a single
* sorted list.
*
****************************************************************************/
{
PHP_DLST_BUCKET *c;
/* Go through the lists, merging them together in sorted order */
c = z;
while (a != z && b != z) {
if ((*cmp)(PHP_DLST_USERSPACE(a),PHP_DLST_USERSPACE(b)) <= 0) {
c->next = a; c = a; a = a->next;
}
else {
c->next = b; c = b; b = b->next;
}
};
/* If one of the lists is not exhausted, then re-attach it to the end
* of the newly merged list
*/
if (a != z) c->next = a;
if (b != z) c->next = b;
/* Set *end to point to the end of the newly merged list */
while (c->next != z) c = c->next;
*end = c;
/* Determine the start of the merged lists, and reset z to point to
* itself
*/
c = z->next; z->next = z;
return c;
}
PUBLIC void dlst_mergesort(DLIST *l,int (*cmp_func)(void*,void*))
/****************************************************************************
*
* Function: dlst_mergesort
* Parameters: l - List to merge sort
* cmp_func - Function to compare two user spaces
*
* Description: Mergesort's all the nodes in the list. 'cmp' must point to
* a comparison function that can compare the user spaces of
* two different nodes. 'cmp' should work the same as
* strcmp(), in terms of the values it returns. Rather than
* waste processing time keeping the previous pointers up to
* date while performing the mergesort, we simply run through
* the list at the end of the sort to fix the previous pointers.
*
****************************************************************************/
{
int i,N;
PHP_DLST_BUCKET *a,*b; /* Pointers to sublists to merge */
PHP_DLST_BUCKET *c; /* Pointer to end of sorted sublists */
PHP_DLST_BUCKET *head; /* Pointer to dummy head node for list */
PHP_DLST_BUCKET *todo; /* Pointer to sublists yet to be sorted */
PHP_DLST_BUCKET *t; /* Temporary */
/* Set up globals required by merge() and pointer to head */
z = l->z; cmp = cmp_func; head = l->head;
for (N = 1,a = z; a != head->next; N = N + N) {
todo = head->next; c = head;
while (todo != z) {
/* Build first sublist to be merged, and splice from main list
*/
a = t = todo;
for (i = 1; i < N; i++) t = t->next;
b = t->next; t->next = z; t = b;
/* Build second sublist to be merged and splice from main list
*/
for (i = 1; i < N; i++) t = t->next;
todo = t->next; t->next = z;
/* Merge the two sublists created, and set 'c' to point to the
* end of the newly merged sublists.
*/
c->next = merge(a,b,&t); c = t;
}
}
/* Fix the previous pointers for the list */
a = b = l->head;
b = b->next;
while (1) {
b->prev = a;
if (b == z)
break;
a = a->next;
b = b->next;
}
}
-137
View File
@@ -1,137 +0,0 @@
/****************************************************************************
*
* Copyright (C) 1991 Kendall Bennett.
* All rights reserved.
*
* Filename: $RCSfile$
* Version: $Revision$
*
* Language: ANSI C
* Environment: any
*
* Description: Header file for doubly linked list routines.
*
* $Id$
*
* Revision History:
* -----------------
*
* $Log$
* Revision 1.1 1999/04/21 23:11:20 ssb
* moved apache, com and hyperwave into ext/
*
* Revision 1.1.1.1 1999/04/07 21:03:20 zeev
* PHP 4.0
*
* Revision 1.1.1.1 1999/03/17 04:29:11 andi
* PHP4
*
* Revision 1.1.1.1 1998/12/21 07:56:22 andi
* Trying to start the zend CVS tree
*
* Revision 1.2 1998/08/14 15:51:12 shane
* Some work on getting hyperwave to work on windows. hg_comm needs a lot of work.
*
* Mainly, signals, fnctl, bzero, bcopy, etc are not portable functions. Most of this
* will have to be rewriten for windows.
*
* Revision 1.1 1998/08/12 09:29:16 steinm
* First version of Hyperwave module.
*
* Revision 1.5 91/12/31 19:40:54 kjb
*
* Modified include files directories.
*
* Revision 1.4 91/09/27 03:10:41 kjb
* Added compatibility with C++.
*
* Revision 1.3 91/09/26 10:07:16 kjb
* Took out extern references
*
* Revision 1.2 91/09/01 19:37:20 ROOT_DOS
* Changed DLST_TAIL macro so that it returns a pointer to the REAL last
* node of the list, not the dummy last node (l->z).
*
* Revision 1.1 91/09/01 18:38:23 ROOT_DOS
* Initial revision
*
****************************************************************************/
#ifndef __DLIST_H
#define __DLIST_H
#ifndef __DEBUG_H
/*#include "debug.h"*/
#endif
/*---------------------- Macros and type definitions ----------------------*/
typedef struct PHP_DLST_BUCKET {
struct PHP_DLST_BUCKET *next;
struct PHP_DLST_BUCKET *prev;
} PHP_DLST_BUCKET;
/* necessary for AIX 4.2.x */
#ifdef hz
#undef hz
#endif
typedef struct {
int count; /* Number of elements currently in list */
PHP_DLST_BUCKET *head; /* Pointer to head element of list */
PHP_DLST_BUCKET *z; /* Pointer to last node of list */
PHP_DLST_BUCKET hz[2]; /* Space for head and z nodes */
} DLIST;
/* Return a pointer to the user space given the address of the header of
* a node.
*/
#define PHP_DLST_USERSPACE(h) ((void*)((PHP_DLST_BUCKET*)(h) + 1))
/* Return a pointer to the header of a node, given the address of the
* user space.
*/
#define PHP_DLST_HEADER(n) ((PHP_DLST_BUCKET*)(n) - 1)
/* Return a pointer to the user space of the list's head node. This user
* space does not actually exist, but it is useful to be able to address
* it to enable insertion at the start of the list.
*/
#define PHP_DLST_HEAD(l) PHP_DLST_USERSPACE((l)->head)
/* Return a pointer to the user space of the last node in list. */
#define PHP_DLST_TAIL(l) PHP_DLST_USERSPACE((l)->z->prev)
/* Determine if a list is empty
*/
#define PHP_DLST_EMPTY(l) ((l)->count == 0)
/*-------------------------- Function Prototypes --------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
void *dlst_newnode(int size);
void dlst_freenode(void *node);
DLIST *dlst_init(void);
void dlst_kill(DLIST *l,void (*freeNode)(void *node));
void dlst_insertafter(DLIST *l,void *node,void *after);
void *dlst_deletenext(DLIST *l,void *node);
void *dlst_first(DLIST *l);
void *dlst_last(DLIST *l);
void *dlst_next(void *prev);
void *dlst_prev(void *next);
void dlst_mergesort(DLIST *l,int (*cmp_func)(void*,void*));
#ifdef __cplusplus
}
#endif
#endif
+64
View File
@@ -0,0 +1,64 @@
AC_DEFUN(LIB_SHARED_CONVENIENCE,[
lib_target="\$(LTLIBRARY_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
EOF
])
AC_DEFUN(LIB_SHARED_MODULE,[
lib_target="\$(LTLIBRARY_SHARED_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
\$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
EOF
])
AC_DEFUN(LIB_STATIC_CONVENIENCE,[
lib_target="\$(LTLIBRARY_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)
EOF
])
dnl LIB_BUILD(path, shared, convenience)
dnl sets up path to build a shared/static convenience/module
AC_DEFUN(LIB_BUILD,[
lib_makefile="$1/libs.mk"
lib_target=""
$php_shtool mkdir -p $1
cat >$lib_makefile<<EOF
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF
if test "$2" = "shared" || test "$2" = "yes"; then
lib_build_shared=yes
if test -n "$3"; then
dnl ---------------------------------------- Shared Convenience
LIB_SHARED_CONVENIENCE($lib_makefile)
else
dnl ---------------------------------------- Shared Module
LIB_SHARED_MODULE($lib_makefile)
fi
else
dnl ---------------------------------------- Static Convenience = Static Module
LIB_STATIC_CONVENIENCE($lib_makefile)
fi
dnl ---------------------------------------- Generate build targets
if test -n "$lib_target"; then
cat >>$lib_makefile<<EOF
targets = $lib_target
EOF
fi
])
+2 -19
View File
@@ -1,21 +1,4 @@
DEPTH = ..
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
SUBDIRS = $(EXT_SUBDIRS)
SUBDIRS = $(EXT_STATIC) $(EXT_SHARED)
all:
@list='$(EXT_STATIC)'; for i in $$list; do \
echo "Making all in $$i"; \
(cd $$i && $(MAKE) all) || exit 1; \
done
@list='$(EXT_SHARED)'; for i in $$list; do \
echo "Making shared in $$i"; \
(cd $$i && $(MAKE) shared) || exit 1; \
done
NO_RECURSION = all
include $(topsrcdir)/build/rules.mk
include $(top_srcdir)/build/rules.mk
+1 -6
View File
@@ -1,10 +1,5 @@
DEPTH = ../..
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
LTLIBRARY_NAME = libaspell.la
LTLIBRARY_SOURCES = aspell.c
include $(topsrcdir)/build/ltlib.mk
include $(top_srcdir)/build/dynlib.mk
+10 -7
View File
@@ -4,10 +4,10 @@
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.01 of the PHP license, |
| This source file is subject to version 2.02 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/2_01.txt. |
| http://www.php.net/license/2_02.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. |
@@ -19,7 +19,8 @@
/* $Id$ */
#include "php.h"
#if defined(COMPILE_DL)
#if defined(COMPILE_DL) || defined(COMPILE_DL_ASPELL)
#include "phpdl.h"
#endif
#include <stdlib.h>
@@ -30,6 +31,7 @@
#include "php_aspell.h"
#include <aspell-c.h>
#include "ext/standard/info.h"
function_entry aspell_functions[] = {
PHP_FE(aspell_new, NULL)
@@ -46,8 +48,8 @@ zend_module_entry aspell_module_entry = {
};
#if COMPILE_DL
DLEXPORT zend_module_entry *get_module(void) { return &aspell_module_entry; }
#if defined(COMPILE_DL) || defined(COMPILE_DL_ASPELL)
ZEND_GET_MODULE(aspell)
#endif
static void php_aspell_close(aspell *sc)
@@ -194,8 +196,9 @@ PHP_FUNCTION(aspell_check_raw)
PHP_MINFO_FUNCTION(aspell)
{
php_printf("ASpell support enabled");
php_info_print_table_start();
php_info_print_table_row(2, "ASpell Support", "enabled");
php_info_print_table_end();
}
#endif
+2 -7
View File
@@ -1,11 +1,6 @@
DEPTH = ../..
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
LTLIBRARY_NAME = libbcmath.la
LTLIBRARY_SOURCES = bcmath.c number.c
LTLIBRARY_SHARED_NAME = bcmath.la
include $(topsrcdir)/build/ltlib.mk
include $(top_srcdir)/build/dynlib.mk
+4 -4
View File
@@ -4,10 +4,10 @@
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.01 of the PHP license, |
| This source file is subject to version 2.02 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/2_01.txt. |
| http://www.php.net/license/2_02.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. |
@@ -40,8 +40,8 @@ zend_module_entry bcmath_module_entry = {
"bcmath", bcmath_functions, NULL, NULL, PHP_RINIT(bcmath), PHP_RSHUTDOWN(bcmath), NULL, STANDARD_MODULE_PROPERTIES
};
#if COMPILE_DL
zend_module_entry *get_module() { return &bcmath_module_entry; };
#if defined(COMPILE_DL) || defined(COMPILE_DL_BCMATH)
ZEND_GET_MODULE(bcmath)
#endif
#ifndef THREAD_SAFE
+13 -15
View File
@@ -1,20 +1,18 @@
dnl $Id$
AC_MSG_CHECKING(whether to enable bc style precision math functions)
AC_ARG_ENABLE(bcmath,
PHP_ARG_ENABLE(bcmath,whether to enable bc style precision math functions,
[ --enable-bcmath Compile with bc style precision math functions.
Read README-BCMATH for instructions on how to
get this module installed. ],
[
if test "$enableval" = "yes"; then
AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
AC_MSG_RESULT(yes)
PHP_EXTENSION(bcmath)
else
AC_DEFINE(WITH_BCMATH, 0,[ ])
AC_MSG_RESULT(no)
get this module installed. ])
if test "$PHP_BCMATH" != "no"; then
AC_DEFINE(WITH_BCMATH, 1, [Whether you have bcmath])
PHP_EXTENSION(bcmath, $ext_shared)
if test ! -f $ext_srcdir/number.c || grep "Dummy File" $ext_srcdir/number.c >/dev/null; then
AC_MSG_ERROR(You do not have the bcmath package. Please read the README.BCMATH file.)
fi
],[
AC_DEFINE(WITH_BCMATH, 0,[ ])
AC_MSG_RESULT(no)
])
fi
dnl ## Local Variables:
dnl ## tab-width: 4
dnl ## End:
+6
View File
@@ -0,0 +1,6 @@
LTLIBRARY_NAME = libcalendar.la
LTLIBRARY_SOURCES = calendar.c dow.c french.c gregor.c jewish.c julian.c easter.c cal_unix.c
LTLIBRARY_SHARED_NAME = calendar.la
include $(top_srcdir)/build/dynlib.mk
+76
View File
@@ -0,0 +1,76 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 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/2_02.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. |
+----------------------------------------------------------------------+
| Authors: Shane Caraveo <shane@caraveo.com> |
| Colin Viebrock <cmv@easydns.com> |
| Hartmut Holzgraefe <hartmut@six.de> |
+----------------------------------------------------------------------+
*/
/* $Id: */
#include "php.h"
#include "php_calendar.h"
#include "sdncal.h"
#include <time.h>
/* {{{ proto int unixtojd([int timestamp])
Convert UNIX timestamp to Julian Day */
PHP_FUNCTION(unixtojd)
{
pval *timestamp;
long jdate;
time_t t;
struct tm *ta, tmbuf;
int myargc=ARG_COUNT(ht);
if ((myargc > 1) || (zend_get_parameters(ht,myargc, &timestamp) != SUCCESS)) {
WRONG_PARAM_COUNT;
}
if(myargc==1) {
convert_to_long(timestamp);
t = timestamp->value.lval;
} else {
t = time(NULL);
}
ta = php_localtime_r(&t, &tmbuf);
jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1,ta->tm_mday);
RETURN_LONG(jdate);
}
/* }}} */
/* {{{ proto int jdtounix(int jday)
Convert Julian Day to UNIX timestamp */
PHP_FUNCTION(jdtounix)
{
pval *jday;
long uday;
if ((ARG_COUNT(ht)!= 1) || (zend_get_parameters(ht,1, &jday) != SUCCESS)) {
WRONG_PARAM_COUNT;
}
convert_to_long(jday);
uday = jday->value.lval - 2440588 /* J.D. of 1.1.1970 */;
if(uday<0) RETURN_FALSE; /* before beginning of unix epoch */
if(uday>24755) RETURN_FALSE; /* behind end of unix epoch */
RETURN_LONG(uday*24*3600);
}
/* }}} */
+334
View File
@@ -0,0 +1,334 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 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/2_02.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. |
+----------------------------------------------------------------------+
| Authors: Shane Caraveo <shane@caraveo.com> |
| Colin Viebrock <cmv@easydns.com> |
| Hartmut Holzgraefe <hartmut@six.de> |
+----------------------------------------------------------------------+
*/
/* $Id: */
#include "php.h"
#include "php_calendar.h"
#include "sdncal.h"
function_entry calendar_functions[] = {
PHP_FE(jdtogregorian, NULL)
PHP_FE(gregoriantojd, NULL)
PHP_FE(jdtojulian, NULL)
PHP_FE(juliantojd, NULL)
PHP_FE(jdtojewish, NULL)
PHP_FE(jewishtojd, NULL)
PHP_FE(jdtofrench, NULL)
PHP_FE(frenchtojd, NULL)
PHP_FE(jddayofweek, NULL)
PHP_FE(jdmonthname, NULL)
PHP_FE(easter_date, NULL)
PHP_FE(easter_days, NULL)
PHP_FE(unixtojd, NULL)
PHP_FE(jdtounix, NULL)
{NULL, NULL, NULL}
};
zend_module_entry calendar_module_entry = {
"Calendar",
calendar_functions,
NULL, /*PHP_MINIT(calendar),*/
NULL,
NULL,
NULL,
PHP_MINFO(calendar),
STANDARD_MODULE_PROPERTIES,
};
#if COMPILE_DL
ZEND_GET_MODULE(calendar)
#endif
PHP_MINIT_FUNCTION(calendar)
{
/*
REGISTER_INT_CONSTANT("CAL_EASTER_TO_xxx",0, CONST_CS | CONST_PERSISTENT);
*/
return SUCCESS;
}
PHP_MINFO_FUNCTION(calendar)
{
php_printf("Calendar support enabled");
}
/* {{{ proto string jdtogregorian(int juliandaycount)
Convert a julian day count to a gregorian calendar date */
PHP_FUNCTION(jdtogregorian)
{
pval **julday;
int year, month, day;
char date[10];
if (zend_get_parameters_ex(1, &julday) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(julday);
SdnToGregorian((*julday)->value.lval, &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date,1);
}
/* }}} */
/* {{{ proto int gregoriantojd(int month, int day, int year)
Convert a gregorian calendar date to julian day count */
PHP_FUNCTION(gregoriantojd)
{
pval **year, **month, **day;
int jdate;
if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(month);
convert_to_long_ex(day);
convert_to_long_ex(year);
jdate = GregorianToSdn((*year)->value.lval, (*month)->value.lval,(*day)->value.lval);
RETURN_LONG(jdate);
}
/* }}} */
/* {{{ proto string jdtojulian(int juliandaycount)
Convert a julian day count to a julian calendar date */
PHP_FUNCTION(jdtojulian)
{
pval **julday;
int year, month, day;
char date[10];
if (zend_get_parameters_ex(1, &julday) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(julday);
SdnToJulian((*julday)->value.lval, &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date,1);
}
/* }}} */
/* {{{ proto int juliantojd(int month, int day, int year)
Convert a julian calendar date to julian day count */
PHP_FUNCTION(juliantojd)
{
pval **year, **month, **day;
int jdate;
if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(month);
convert_to_long_ex(day);
convert_to_long_ex(year);
jdate = JulianToSdn((*year)->value.lval,(*month)->value.lval, (*day)->value.lval);
RETURN_LONG(jdate);
}
/* }}} */
/* {{{ proto string jdtojewish(int juliandaycount)
Convert a julian day count to a jewish calendar date */
PHP_FUNCTION(jdtojewish)
{
pval **julday;
int year, month, day;
char date[10];
if (zend_get_parameters_ex(1, &julday) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(julday);
SdnToJewish((*julday)->value.lval, &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date,1);
}
/* }}} */
/* {{{ proto int jewishtojd(int month, int day, int year)
Convert a jewish calendar date to a julian day count */
PHP_FUNCTION(jewishtojd)
{
pval **year, **month, **day;
int jdate;
if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(month);
convert_to_long_ex(day);
convert_to_long_ex(year);
jdate = JewishToSdn((*year)->value.lval,(*month)->value.lval, (*day)->value.lval);
RETURN_LONG(jdate);
}
/* }}} */
/* {{{ proto string jdtofrench(int juliandaycount)
Convert a julian day count to a french republic calendar date */
PHP_FUNCTION(jdtofrench)
{
pval **julday;
int year, month, day;
char date[10];
if (zend_get_parameters_ex(1, &julday) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(julday);
SdnToFrench((*julday)->value.lval, &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date,1);
}
/* }}} */
/* {{{ proto int frenchtojd(int month, int day, int year)
Convert a french republic calendar date to julian day count */
PHP_FUNCTION(frenchtojd)
{
pval **year, **month, **day;
int jdate;
if (zend_get_parameters_ex(3, &month, &day, &year) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(month);
convert_to_long_ex(day);
convert_to_long_ex(year);
jdate = FrenchToSdn((*year)->value.lval,(*month)->value.lval,(*day)->value.lval);
RETURN_LONG(jdate);
}
/* }}} */
/* {{{ proto mixed jddayofweek(int juliandaycount [, int mode])
Returns name or number of day of week from julian day count */
PHP_FUNCTION(jddayofweek)
{
pval *julday, *mode;
int day;
char *daynamel, *daynames;
int myargc=ARG_COUNT(ht),mymode=0;
if ((myargc < 1) || (myargc > 2) || (zend_get_parameters(ht,myargc, &julday, &mode) != SUCCESS)) {
WRONG_PARAM_COUNT;
}
convert_to_long(julday);
if(myargc==2) {
convert_to_long(mode);
mymode = mode->value.lval;
}
day = DayOfWeek(julday->value.lval);
daynamel = DayNameLong[day];
daynames = DayNameShort[day];
switch (mymode) {
case 0L:
RETURN_LONG(day);
break;
case 1L:
RETURN_STRING(daynamel,1);
break;
case 2L:
RETURN_STRING(daynames,1);
break;
default:
RETURN_LONG(day);
break;
}
}
/* }}} */
/* {{{ proto string jdmonthname(int juliandaycount, int mode)
Returns name of month for julian day count */
PHP_FUNCTION(jdmonthname)
{
pval **julday, **mode;
char *monthname = NULL;
int month, day, year;
if (zend_get_parameters_ex(2, &julday, &mode) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_long_ex(julday);
convert_to_long_ex(mode);
switch((*mode)->value.lval) {
case 0L: /* gregorian or julian month */
SdnToGregorian((*julday)->value.lval,&year, &month, &day);
monthname = MonthNameShort[month];
break;
case 1L: /* gregorian or julian month */
SdnToGregorian((*julday)->value.lval,&year, &month, &day);
monthname = MonthNameLong[month];
break;
case 2L: /* gregorian or julian month */
SdnToJulian((*julday)->value.lval, &year,&month, &day);
monthname = MonthNameShort[month];
break;
case 3L: /* gregorian or julian month */
SdnToJulian((*julday)->value.lval, &year,&month, &day);
monthname = MonthNameLong[month];
break;
case 4L: /* jewish month */
SdnToJewish((*julday)->value.lval, &year,&month, &day);
monthname = JewishMonthName[month];
break;
case 5L: /* french month */
SdnToFrench((*julday)->value.lval, &year,&month, &day);
monthname = FrenchMonthName[month];
break;
default: /* default gregorian */
/* FIXME - need to set monthname to something here ?? */
break;
}
RETURN_STRING(monthname,1);
}
/* }}} */
+145
View File
@@ -0,0 +1,145 @@
# Microsoft Developer Studio Project File - Name="calendar" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=calendar - Win32 Release_TS
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "calendar.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "calendar.mak" CFG="calendar - Win32 Release_TS"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "calendar - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "calendar - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "calendar - Win32 Release_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release_TS"
# PROP BASE Intermediate_Dir "Release_TS"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release_TS"
# PROP Intermediate_Dir "Release_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CALENDAR_EXPORTS" /D "COMPILE_DL" /D ZTS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D ZEND_DEBUG=0 /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
# ADD RSC /l 0x406 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_calendar.dll" /libpath:"..\..\Release_TS"
!ELSEIF "$(CFG)" == "calendar - Win32 Debug_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Debug_TS"
# PROP BASE Intermediate_Dir "Debug_TS"
# PROP BASE Ignore_Export_Lib 0
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Debug_TS"
# PROP Intermediate_Dir "Debug_TS"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL" /D "DBNTWIN32" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CALENDAR_EXPORTS" /D "COMPILE_DL" /D ZTS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D ZEND_DEBUG=1 /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
# ADD RSC /l 0x406 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"mssql-70"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_calendar.dll" /libpath:"..\..\Debug_TS"
!ENDIF
# Begin Target
# Name "calendar - Win32 Release_TS"
# Name "calendar - Win32 Debug_TS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\cal_unix.c
# End Source File
# Begin Source File
SOURCE=.\calendar.c
# End Source File
# Begin Source File
SOURCE=.\dow.c
# End Source File
# Begin Source File
SOURCE=.\easter.c
# End Source File
# Begin Source File
SOURCE=.\french.c
# End Source File
# Begin Source File
SOURCE=.\gregor.c
# End Source File
# Begin Source File
SOURCE=.\jewish.c
# End Source File
# Begin Source File
SOURCE=.\julian.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\calendar.h
# End Source File
# Begin Source File
SOURCE=.\sdncal.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
+9
View File
@@ -0,0 +1,9 @@
dnl $Id$
PHP_ARG_ENABLE(calendar,whether to enable calendar conversion support,
[ --enable-calendar Enable support for calendar conversion])
if test "$PHP_CALENDAR" = "yes"; then
AC_DEFINE(HAVE_CALENDAR,1,[ ])
PHP_EXTENSION(calendar, $ext_shared)
fi
+67
View File
@@ -0,0 +1,67 @@
/* $selId: dow.c,v 2.0 1995/10/24 01:13:06 lees Exp $
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
* Permission granted to use, copy, modify, distribute and sell so long as
* the above copyright and this permission statement are retained in all
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
*/
/**************************************************************************
*
* These are the externally visible components of this file:
*
* int
* DayOfWeek(
* long int sdn);
*
* Convert a SDN to a day-of-week number (0 to 6). Where 0 stands for
* Sunday, 1 for Monday, etc. and 6 stands for Saturday.
*
* char *DayNameShort[7];
*
* Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to
* the abbreviated (three character) name of the day.
*
* char *DayNameLong[7];
*
* Convert a day-of-week number (0 to 6), as returned from DayOfWeek(), to
* the name of the day.
*
**************************************************************************/
#include "sdncal.h"
int DayOfWeek(
long int sdn)
{
int dow;
dow = (sdn + 1) % 7;
if (dow >= 0) {
return (dow);
} else {
return (dow + 7);
}
}
char *DayNameShort[7] =
{
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
};
char *DayNameLong[7] =
{
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
};
+142
View File
@@ -0,0 +1,142 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 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/2_02.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. |
+----------------------------------------------------------------------+
| Authors: Shane Caraveo <shane@caraveo.com> |
| Colin Viebrock <cmv@easydns.com> |
| Hartmut Holzgraefe <hartmut@six.de> |
+----------------------------------------------------------------------+
*/
/* $Id: */
#include "php.h"
#include "php_calendar.h"
#include "sdncal.h"
#include <time.h>
static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
{
/* based on code by Simon Kershaw, <webmaster@ely.anglican.org> */
pval *year_arg;
struct tm *ta, te;
time_t the_time;
long year, golden, solar, lunar, pfm, dom, tmp, easter;
switch(ARG_COUNT(ht)) {
case 0:
the_time = time(NULL);
ta = localtime(&the_time);
year = ta->tm_year + 1900;
break;
case 1:
if (getParameters(ht, 1, &year_arg) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(year_arg);
year = year_arg->value.lval;
break;
default:
WRONG_PARAM_COUNT;
}
if (gm && (year<1970 || year>2037)) { /* out of range for timestamps */
php3_error(E_WARNING, "easter_date() is only valid for years between 1970 and 2037 inclusive");
RETURN_FALSE;
}
golden = (year % 19) + 1; /* the Golden number */
if ( year <= 1752 ) { /* JULIAN CALENDAR */
dom = (year + (year/4) + 5) % 7; /* the "Dominical number" - finding a Sunday */
if (dom < 0) {
dom += 7;
}
pfm = (3 - (11*golden) - 7) % 30; /* uncorrected date of the Paschal full moon */
if (pfm < 0) {
pfm += 30;
}
} else { /* GREGORIAN CALENDAR */
dom = (year + (year/4) - (year/100) + (year/400)) % 7; /* the "Domincal number" */
if (dom < 0) {
dom += 7;
}
solar = (year-1600)/100 - (year-1600)/400; /* the solar and lunar corrections */
lunar = (((year-1400) / 100) * 8) / 25;
pfm = (3 - (11*golden) + solar - lunar) % 30; /* uncorrected date of the Paschal full moon */
if (pfm < 0) {
pfm += 30;
}
}
if ((pfm == 29) || (pfm == 28 && golden > 11)) { /* corrected date of the Paschal full moon */
pfm--; /* - days after 21st March */
}
tmp = (4-pfm-dom) % 7;
if (tmp < 0) {
tmp += 7;
}
easter = pfm + tmp + 1; /* Easter as the number of days after 21st March */
if (gm) { /* return a timestamp */
te.tm_isdst = -1;
te.tm_year = year-1900;
te.tm_sec = 0;
te.tm_min = 0;
te.tm_hour = 0;
if (easter < 11) {
te.tm_mon = 2; /* March */
te.tm_mday = easter+21;
} else {
te.tm_mon = 3; /* April */
te.tm_mday = easter-10;
}
return_value->value.lval = mktime(&te);
} else { /* return the days after March 21 */
return_value->value.lval = easter;
}
return_value->type = IS_LONG;
}
/* {{{ proto int easter_date([int year])
Return the timestamp of midnight on Easter of a given year (defaults to current year) */
PHP_FUNCTION(easter_date)
{
_cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ proto int easter_days([int year])
Return the number of days after March 21 that Easter falls on for a given year (defaults to current year) */
PHP_FUNCTION(easter_days)
{
_cal_easter(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
+150
View File
@@ -0,0 +1,150 @@
/* $selId: french.c,v 2.0 1995/10/24 01:13:06 lees Exp $
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
* Permission granted to use, copy, modify, distribute and sell so long as
* the above copyright and this permission statement are retained in all
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
*/
/**************************************************************************
*
* These are the externally visible components of this file:
*
* void
* SdnToFrench(
* long int sdn,
* int *pYear,
* int *pMonth,
* int *pDay);
*
* Convert a SDN to a French republican calendar date. If the input SDN is
* before the first day of year 1 or after the last day of year 14, the
* three output values will all be set to zero, otherwise *pYear will be in
* the range 1 to 14 inclusive; *pMonth will be in the range 1 to 13
* inclusive; *pDay will be in the range 1 to 30 inclusive. If *pMonth is
* 13, the SDN represents one of the holidays at the end of the year and
* *pDay will be in the range 1 to 6 inclusive.
*
* long int
* FrenchToSdn(
* int year,
* int month,
* int day);
*
* Convert a French republican calendar date to a SDN. Zero is returned
* when the input date is detected as invalid or out of the supported
* range. The return value will be > 0 for all valid, supported dates, but
* there are some invalid dates that will return a positive value. To
* verify that a date is valid, convert it to SDN and then back and compare
* with the original.
*
* char *FrenchMonthName[14];
*
* Convert a French republican month number (1 to 13) to the name of the
* French republican month (null terminated). An index of 13 (for the
* "extra" days at the end of the year) will return the string "Extra". An
* index of zero will return a zero length string.
*
* VALID RANGE
*
* These routines only convert dates in years 1 through 14 (Gregorian
* dates 22 September 1792 through 22 September 1806). This more than
* covers the period when the calendar was in use.
*
* I would support a wider range of dates, but I have not been able to
* find an authoritative definition of when leap years were to have
* occurred. There are suggestions that it was to skip a leap year ever
* 100 years like the Gregorian calendar.
*
* CALENDAR OVERVIEW
*
* The French republican calendar was adopted in October 1793 during
* the French Revolution and was abandoned in January 1806. The intent
* was to create a new calendar system that was based on scientific
* principals, not religious traditions.
*
* The year is divided into 12 months of 30 days each. The remaining 5
* to 6 days in the year are grouped at the end and are holidays. Each
* month is divided into three decades (instead of weeks) of 10 days
* each.
*
* The epoch (first day of the first year) is 22 September 1792 in the
* Gregorian calendar. Leap years are every fourth year (year 3, 7,
* 11, etc.)
*
* TESTING
*
* This algorithm has been tested from the year 1 to 14. The source
* code of the verification program is included in this package.
*
* REFERENCES
*
* I have found no detailed, authoritative reference on this calendar.
* The algorithms are based on a preponderance of less authoritative
* sources.
*
**************************************************************************/
#include "sdncal.h"
#define SDN_OFFSET 2375474
#define DAYS_PER_4_YEARS 1461
#define DAYS_PER_MONTH 30
#define FIRST_VALID 2375840
#define LAST_VALID 2380952
void SdnToFrench(
long int sdn,
int *pYear,
int *pMonth,
int *pDay)
{
long int temp;
int dayOfYear;
if (sdn < FIRST_VALID || sdn > LAST_VALID) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
return;
}
temp = (sdn - SDN_OFFSET) * 4 - 1;
*pYear = temp / DAYS_PER_4_YEARS;
dayOfYear = (temp % DAYS_PER_4_YEARS) / 4;
*pMonth = dayOfYear / DAYS_PER_MONTH + 1;
*pDay = dayOfYear % DAYS_PER_MONTH + 1;
}
long int FrenchToSdn(
int year,
int month,
int day)
{
/* check for invalid dates */
if (year < 1 || year > 14 ||
month < 1 || month > 13 ||
day < 1 || day > 30) {
return (0);
}
return ((year * DAYS_PER_4_YEARS) / 4
+ (month - 1) * DAYS_PER_MONTH
+ day
+ SDN_OFFSET);
}
char *FrenchMonthName[14] =
{
"",
"Vendemiaire",
"Brumaire",
"Frimaire",
"Nivose",
"Pluviose",
"Ventose",
"Germinal",
"Floreal",
"Prairial",
"Messidor",
"Thermidor",
"Fructidor",
"Extra"
};
+265
View File
@@ -0,0 +1,265 @@
/* $selId: gregor.c,v 2.0 1995/10/24 01:13:06 lees Exp $
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
* Permission granted to use, copy, modify, distribute and sell so long as
* the above copyright and this permission statement are retained in all
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
*/
/**************************************************************************
*
* These are the externally visible components of this file:
*
* void
* SdnToGregorian(
* long int sdn,
* int *pYear,
* int *pMonth,
* int *pDay);
*
* Convert a SDN to a Gregorian calendar date. If the input SDN is less
* than 1, the three output values will all be set to zero, otherwise
* *pYear will be >= -4714 and != 0; *pMonth will be in the range 1 to 12
* inclusive; *pDay will be in the range 1 to 31 inclusive.
*
* long int
* GregorianToSdn(
* int inputYear,
* int inputMonth,
* int inputDay);
*
* Convert a Gregorian calendar date to a SDN. Zero is returned when the
* input date is detected as invalid or out of the supported range. The
* return value will be > 0 for all valid, supported dates, but there are
* some invalid dates that will return a positive value. To verify that a
* date is valid, convert it to SDN and then back and compare with the
* original.
*
* char *MonthNameShort[13];
*
* Convert a Gregorian month number (1 to 12) to the abbreviated (three
* character) name of the Gregorian month (null terminated). An index of
* zero will return a zero length string.
*
* char *MonthNameLong[13];
*
* Convert a Gregorian month number (1 to 12) to the name of the Gregorian
* month (null terminated). An index of zero will return a zero length
* string.
*
* VALID RANGE
*
* 4714 B.C. to at least 10000 A.D.
*
* Although this software can handle dates all the way back to 4714
* B.C., such use may not be meaningful. The Gregorian calendar was
* not instituted until October 15, 1582 (or October 5, 1582 in the
* Julian calendar). Some countries did not accept it until much
* later. For example, Britain converted in 1752, The USSR in 1918 and
* Greece in 1923. Most European countries used the Julian calendar
* prior to the Gregorian.
*
* CALENDAR OVERVIEW
*
* The Gregorian calendar is a modified version of the Julian calendar.
* The only difference being the specification of leap years. The
* Julian calendar specifies that every year that is a multiple of 4
* will be a leap year. This leads to a year that is 365.25 days long,
* but the current accepted value for the tropical year is 365.242199
* days.
*
* To correct this error in the length of the year and to bring the
* vernal equinox back to March 21, Pope Gregory XIII issued a papal
* bull declaring that Thursday October 4, 1582 would be followed by
* Friday October 15, 1582 and that centennial years would only be a
* leap year if they were a multiple of 400. This shortened the year
* by 3 days per 400 years, giving a year of 365.2425 days.
*
* Another recently proposed change in the leap year rule is to make
* years that are multiples of 4000 not a leap year, but this has never
* been officially accepted and this rule is not implemented in these
* algorithms.
*
* ALGORITHMS
*
* The calculations are based on three different cycles: a 400 year
* cycle of leap years, a 4 year cycle of leap years and a 5 month
* cycle of month lengths.
*
* The 5 month cycle is used to account for the varying lengths of
* months. You will notice that the lengths alternate between 30
* and 31 days, except for three anomalies: both July and August
* have 31 days, both December and January have 31, and February
* is less than 30. Starting with March, the lengths are in a
* cycle of 5 months (31, 30, 31, 30, 31):
*
* Mar 31 days \
* Apr 30 days |
* May 31 days > First cycle
* Jun 30 days |
* Jul 31 days /
*
* Aug 31 days \
* Sep 30 days |
* Oct 31 days > Second cycle
* Nov 30 days |
* Dec 31 days /
*
* Jan 31 days \
* Feb 28/9 days |
* > Third cycle (incomplete)
*
* For this reason the calculations (internally) assume that the
* year starts with March 1.
*
* TESTING
*
* This algorithm has been tested from the year 4714 B.C. to 10000
* A.D. The source code of the verification program is included in
* this package.
*
* REFERENCES
*
* Conversions Between Calendar Date and Julian Day Number by Robert J.
* Tantzen, Communications of the Association for Computing Machinery
* August 1963. (Also published in Collected Algorithms from CACM,
* algorithm number 199).
*
**************************************************************************/
#include "sdncal.h"
#define SDN_OFFSET 32045
#define DAYS_PER_5_MONTHS 153
#define DAYS_PER_4_YEARS 1461
#define DAYS_PER_400_YEARS 146097
void SdnToGregorian(
long int sdn,
int *pYear,
int *pMonth,
int *pDay)
{
int century;
int year;
int month;
int day;
long int temp;
int dayOfYear;
if (sdn <= 0) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
return;
}
temp = (sdn + SDN_OFFSET) * 4 - 1;
/* Calculate the century (year/100). */
century = temp / DAYS_PER_400_YEARS;
/* Calculate the year and day of year (1 <= dayOfYear <= 366). */
temp = ((temp % DAYS_PER_400_YEARS) / 4) * 4 + 3;
year = (century * 100) + (temp / DAYS_PER_4_YEARS);
dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1;
/* Calculate the month and day of month. */
temp = dayOfYear * 5 - 3;
month = temp / DAYS_PER_5_MONTHS;
day = (temp % DAYS_PER_5_MONTHS) / 5 + 1;
/* Convert to the normal beginning of the year. */
if (month < 10) {
month += 3;
} else {
year += 1;
month -= 9;
}
/* Adjust to the B.C./A.D. type numbering. */
year -= 4800;
if (year <= 0)
year--;
*pYear = year;
*pMonth = month;
*pDay = day;
}
long int GregorianToSdn(
int inputYear,
int inputMonth,
int inputDay)
{
int year;
int month;
/* check for invalid dates */
if (inputYear == 0 || inputYear < -4714 ||
inputMonth <= 0 || inputMonth > 12 ||
inputDay <= 0 || inputDay > 31) {
return (0);
}
/* check for dates before SDN 1 (Nov 25, 4714 B.C.) */
if (inputYear == -4714) {
if (inputMonth < 11) {
return (0);
}
if (inputMonth == 11 && inputDay < 25) {
return (0);
}
}
/* Make year always a positive number. */
if (inputYear < 0) {
year = inputYear + 4801;
} else {
year = inputYear + 4800;
}
/* Adjust the start of the year. */
if (inputMonth > 2) {
month = inputMonth - 3;
} else {
month = inputMonth + 9;
year--;
}
return (((year / 100) * DAYS_PER_400_YEARS) / 4
+ ((year % 100) * DAYS_PER_4_YEARS) / 4
+ (month * DAYS_PER_5_MONTHS + 2) / 5
+ inputDay
- SDN_OFFSET);
}
char *MonthNameShort[13] =
{
"",
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
};
char *MonthNameLong[13] =
{
"",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
+732
View File
@@ -0,0 +1,732 @@
/* $selId: jewish.c,v 2.0 1995/10/24 01:13:06 lees Exp $
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
* Permission granted to use, copy, modify, distribute and sell so long as
* the above copyright and this permission statement are retained in all
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
*/
/**************************************************************************
*
* These are the externally visible components of this file:
*
* void
* SdnToJewish(
* long int sdn,
* int *pYear,
* int *pMonth,
* int *pDay);
*
* Convert a SDN to a Jewish calendar date. If the input SDN is before the
* first day of year 1, the three output values will all be set to zero,
* otherwise *pYear will be > 0; *pMonth will be in the range 1 to 13
* inclusive; *pDay will be in the range 1 to 30 inclusive. Note that Adar
* II is assigned the month number 7 and Elul is always 13.
*
* long int
* JewishToSdn(
* int year,
* int month,
* int day);
*
* Convert a Jewish calendar date to a SDN. Zero is returned when the
* input date is detected as invalid or out of the supported range. The
* return value will be > 0 for all valid, supported dates, but there are
* some invalid dates that will return a positive value. To verify that a
* date is valid, convert it to SDN and then back and compare with the
* original.
*
* char *JewishMonthName[14];
*
* Convert a Jewish month number (1 to 13) to the name of the Jewish month
* (null terminated). An index of zero will return a zero length string.
*
* VALID RANGE
*
* Although this software can handle dates all the way back to the year
* 1 (3761 B.C.), such use may not be meaningful.
*
* The Jewish calendar has been in use for several thousand years, but
* in the early days there was no formula to determine the start of a
* month. A new month was started when the new moon was first
* observed.
*
* It is not clear when the current rule based calendar replaced the
* observation based calendar. According to the book "Jewish Calendar
* Mystery Dispelled" by George Zinberg, the patriarch Hillel II
* published these rules in 358 A.D. But, according to The
* Encyclopedia Judaica, Hillel II may have only published the 19 year
* rule for determining the occurrence of leap years.
*
* I have yet to find a specific date when the current set of rules
* were known to be in use.
*
* CALENDAR OVERVIEW
*
* The Jewish calendar is based on lunar as well as solar cycles. A
* month always starts on or near a new moon and has either 29 or 30
* days (a lunar cycle is about 29 1/2 days). Twelve of these
* alternating 29-30 day months gives a year of 354 days, which is
* about 11 1/4 days short of a solar year.
*
* Since a month is defined to be a lunar cycle (new moon to new moon),
* this 11 1/4 day difference cannot be overcome by adding days to a
* month as with the Gregorian calendar, so an entire month is
* periodically added to the year, making some years 13 months long.
*
* For astronomical as well as ceremonial reasons, the start of a new
* year may be delayed until a day or two after the new moon causing
* years to vary in length. Leap years can be from 383 to 385 days and
* common years can be from 353 to 355 days. These are the months of
* the year and their possible lengths:
*
* COMMON YEAR LEAP YEAR
* 1 Tishri 30 30 30 30 30 30
* 2 Heshvan 29 29 30 29 29 30 (variable)
* 3 Kislev 29 30 30 29 30 30 (variable)
* 4 Tevet 29 29 29 29 29 29
* 5 Shevat 30 30 30 30 30 30
* 6 Adar I 29 29 29 30 30 30 (variable)
* 7 Adar II -- -- -- 29 29 29 (optional)
* 8 Nisan 30 30 30 30 30 30
* 9 Iyyar 29 29 29 29 29 29
* 10 Sivan 30 30 30 30 30 30
* 11 Tammuz 29 29 29 29 29 29
* 12 Av 30 30 30 30 30 30
* 13 Elul 29 29 29 29 29 29
* --- --- --- --- --- ---
* 353 354 355 383 384 385
*
* Note that the month names and other words that appear in this file
* have multiple possible spellings in the Roman character set. I have
* chosen to use the spellings found in the Encyclopedia Judaica.
*
* Adar II, the month added for leap years, is sometimes referred to as
* the 13th month, but I have chosen to assign it the number 7 to keep
* the months in chronological order. This may not be consistent with
* other numbering schemes.
*
* Leap years occur in a fixed pattern of 19 years called the metonic
* cycle. The 3rd, 6th, 8th, 11th, 14th, 17th and 19th years of this
* cycle are leap years. The first metonic cycle starts with Jewish
* year 1, or 3761/60 B.C. This is believed to be the year of
* creation.
*
* To construct the calendar for a year, you must first find the length
* of the year by determining the first day of the year (Tishri 1, or
* Rosh Ha-Shanah) and the first day of the following year. This
* selects one of the six possible month length configurations listed
* above.
*
* Finding the first day of the year is the most difficult part.
* Finding the date and time of the new moon (or molad) is the first
* step. For this purpose, the lunar cycle is assumed to be 29 days 12
* hours and 793 halakim. A halakim is 1/1080th of an hour or 3 1/3
* seconds. (This assumed value is only about 1/2 second less than the
* value used by modern astronomers -- not bad for a number that was
* determined so long ago.) The first molad of year 1 occurred on
* Sunday at 11:20:11 P.M. This would actually be Monday, because the
* Jewish day is considered to begin at sunset.
*
* Since sunset varies, the day is assumed to begin at 6:00 P.M. for
* calendar calculation purposes. So, the first molad was 5 hours 793
* halakim after the start of Tishri 1, 0001 (which was Monday
* September 7, 4761 B.C. by the Gregorian calendar). All subsequent
* molads can be calculated from this starting point by adding the
* length of a lunar cycle.
*
* Once the molad that starts a year is determined the actual start of
* the year (Tishri 1) can be determined. Tishri 1 will be the day of
* the molad unless it is delayed by one of the following four rules
* (called dehiyyot). Each rule can delay the start of the year by one
* day, and since rule #1 can combine with one of the other rules, it
* can be delayed as much as two days.
*
* 1. Tishri 1 must never be Sunday, Wednesday or Friday. (This
* is largely to prevent certain holidays from occurring on the
* day before or after the Sabbath.)
*
* 2. If the molad occurs on or after noon, Tishri 1 must be
* delayed.
*
* 3. If it is a common (not leap) year and the molad occurs on
* Tuesday at or after 3:11:20 A.M., Tishri 1 must be delayed.
*
* 4. If it is the year following a leap year and the molad occurs
* on Monday at or after 9:32:43 and 1/3 sec, Tishri 1 must be
* delayed.
*
* GLOSSARY
*
* dehiyyot The set of 4 rules that determine when the new year
* starts relative to the molad.
*
* halakim 1/1080th of an hour or 3 1/3 seconds.
*
* lunar cycle The period of time between mean conjunctions of the
* sun and moon (new moon to new moon). This is
* assumed to be 29 days 12 hours and 793 halakim for
* calendar purposes.
*
* metonic cycle A 19 year cycle which determines which years are
* leap years and which are common years. The 3rd,
* 6th, 8th, 11th, 14th, 17th and 19th years of this
* cycle are leap years.
*
* molad The date and time of the mean conjunction of the
* sun and moon (new moon). This is the approximate
* beginning of a month.
*
* Rosh Ha-Shanah The first day of the Jewish year (Tishri 1).
*
* Tishri The first month of the Jewish year.
*
* ALGORITHMS
*
* SERIAL DAY NUMBER TO JEWISH DATE
*
* The simplest approach would be to use the rules stated above to find
* the molad of Tishri before and after the given day number. Then use
* the molads to find Tishri 1 of the current and following years.
* From this the length of the year can be determined and thus the
* length of each month. But this method is used as a last resort.
*
* The first 59 days of the year are the same regardless of the length
* of the year. As a result, only the day number of the start of the
* year is required.
*
* Similarly, the last 6 months do not change from year to year. And
* since it can be determined whether the year is a leap year by simple
* division, the lengths of Adar I and II can be easily calculated. In
* fact, all dates after the 3rd month are consistent from year to year
* (once it is known whether it is a leap year).
*
* This means that if the given day number falls in the 3rd month or on
* the 30th day of the 2nd month the length of the year must be found,
* but in no other case.
*
* So, the approach used is to take the given day number and round it
* to the closest molad of Tishri (first new moon of the year). The
* rounding is not really to the *closest* molad, but is such that if
* the day number is before the middle of the 3rd month the molad at
* the start of the year is found, otherwise the molad at the end of
* the year is found.
*
* Only if the day number is actually found to be in the ambiguous
* period of 29 to 31 days is the other molad calculated.
*
* JEWISH DATE TO SERIAL DAY NUMBER
*
* The year number is used to find which 19 year metonic cycle contains
* the date and which year within the cycle (this is a division and
* modulus). This also determines whether it is a leap year.
*
* If the month is 1 or 2, the calculation is simple addition to the
* first of the year.
*
* If the month is 8 (Nisan) or greater, the calculation is simple
* subtraction from beginning of the following year.
*
* If the month is 4 to 7, it is considered whether it is a leap year
* and then simple subtraction from the beginning of the following year
* is used.
*
* Only if it is the 3rd month is both the start and end of the year
* required.
*
* TESTING
*
* This algorithm has been tested in two ways. First, 510 dates from a
* table in "Jewish Calendar Mystery Dispelled" were calculated and
* compared to the table. Second, the calculation algorithm described
* in "Jewish Calendar Mystery Dispelled" was coded and used to verify
* all dates from the year 1 (3761 B.C.) to the year 13760 (10000
* A.D.).
*
* The source code of the verification program is included in this
* package.
*
* REFERENCES
*
* The Encyclopedia Judaica, the entry for "Calendar"
*
* The Jewish Encyclopedia
*
* Jewish Calendar Mystery Dispelled by George Zinberg, Vantage Press,
* 1963
*
* The Comprehensive Hebrew Calendar by Arthur Spier, Behrman House
*
* The Book of Calendars [note that this work contains many typos]
*
**************************************************************************/
#include "sdncal.h"
#define HALAKIM_PER_HOUR 1080
#define HALAKIM_PER_DAY 25920
#define HALAKIM_PER_LUNAR_CYCLE ((29 * HALAKIM_PER_DAY) + 13753)
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
#define SDN_OFFSET 347997
#define NEW_MOON_OF_CREATION 31524
#define SUNDAY 0
#define MONDAY 1
#define TUESDAY 2
#define WEDNESDAY 3
#define THURSDAY 4
#define FRIDAY 5
#define SATURDAY 6
#define NOON (18 * HALAKIM_PER_HOUR)
#define AM3_11_20 ((9 * HALAKIM_PER_HOUR) + 204)
#define AM9_32_43 ((15 * HALAKIM_PER_HOUR) + 589)
static int monthsPerYear[19] =
{
12, 12, 13, 12, 12, 13, 12, 13, 12, 12, 13, 12, 12, 13, 12, 12, 13, 12, 13
};
static int yearOffset[19] =
{
0, 12, 24, 37, 49, 61, 74, 86, 99, 111, 123,
136, 148, 160, 173, 185, 197, 210, 222
};
char *JewishMonthName[14] =
{
"",
"Tishri",
"Heshvan",
"Kislev",
"Tevet",
"Shevat",
"AdarI",
"AdarII",
"Nisan",
"Iyyar",
"Sivan",
"Tammuz",
"Av",
"Elul"
};
/************************************************************************
* Given the year within the 19 year metonic cycle and the time of a molad
* (new moon) which starts that year, this routine will calculate what day
* will be the actual start of the year (Tishri 1 or Rosh Ha-Shanah). This
* first day of the year will be the day of the molad unless one of 4 rules
* (called dehiyyot) delays it. These 4 rules can delay the start of the
* year by as much as 2 days.
*/
static long int Tishri1(
int metonicYear,
long int moladDay,
long int moladHalakim)
{
long int tishri1;
int dow;
int leapYear;
int lastWasLeapYear;
tishri1 = moladDay;
dow = tishri1 % 7;
leapYear = metonicYear == 2 || metonicYear == 5 || metonicYear == 7
|| metonicYear == 10 || metonicYear == 13 || metonicYear == 16
|| metonicYear == 18;
lastWasLeapYear = metonicYear == 3 || metonicYear == 6
|| metonicYear == 8 || metonicYear == 11 || metonicYear == 14
|| metonicYear == 17 || metonicYear == 0;
/* Apply rules 2, 3 and 4. */
if ((moladHalakim >= NOON) ||
((!leapYear) && dow == TUESDAY && moladHalakim >= AM3_11_20) ||
(lastWasLeapYear && dow == MONDAY && moladHalakim >= AM9_32_43)) {
tishri1++;
dow++;
if (dow == 7) {
dow = 0;
}
}
/* Apply rule 1 after the others because it can cause an additional
* delay of one day. */
if (dow == WEDNESDAY || dow == FRIDAY || dow == SUNDAY) {
tishri1++;
}
return (tishri1);
}
/************************************************************************
* Given a metonic cycle number, calculate the date and time of the molad
* (new moon) that starts that cycle. Since the length of a metonic cycle
* is a constant, this is a simple calculation, except that it requires an
* intermediate value which is bigger that 32 bits. Because this
* intermediate value only needs 36 to 37 bits and the other numbers are
* constants, the process has been reduced to just a few steps.
*/
static void MoladOfMetonicCycle(
int metonicCycle,
long int *pMoladDay,
long int *pMoladHalakim)
{
register unsigned long int r1, r2, d1, d2;
/* Start with the time of the first molad after creation. */
r1 = NEW_MOON_OF_CREATION;
/* Calculate metonicCycle * HALAKIM_PER_METONIC_CYCLE. The upper 32
* bits of the result will be in r2 and the lower 16 bits will be
* in r1. */
r1 += metonicCycle * (HALAKIM_PER_METONIC_CYCLE & 0xFFFF);
r2 = r1 >> 16;
r2 += metonicCycle * ((HALAKIM_PER_METONIC_CYCLE >> 16) & 0xFFFF);
/* Calculate r2r1 / HALAKIM_PER_DAY. The remainder will be in r1, the
* upper 16 bits of the quotient will be in d2 and the lower 16 bits
* will be in d1. */
d2 = r2 / HALAKIM_PER_DAY;
r2 -= d2 * HALAKIM_PER_DAY;
r1 = (r2 << 16) | (r1 & 0xFFFF);
d1 = r1 / HALAKIM_PER_DAY;
r1 -= d1 * HALAKIM_PER_DAY;
*pMoladDay = (d2 << 16) | d1;
*pMoladHalakim = r1;
}
/************************************************************************
* Given a day number, find the molad of Tishri (the new moon at the start
* of a year) which is closest to that day number. It's not really the
* *closest* molad that we want here. If the input day is in the first two
* months, we want the molad at the start of the year. If the input day is
* in the fourth to last months, we want the molad at the end of the year.
* If the input day is in the third month, it doesn't matter which molad is
* returned, because both will be required. This type of "rounding" allows
* us to avoid calculating the length of the year in most cases.
*/
static void FindTishriMolad(
long int inputDay,
int *pMetonicCycle,
int *pMetonicYear,
long int *pMoladDay,
long int *pMoladHalakim)
{
long int moladDay;
long int moladHalakim;
int metonicCycle;
int metonicYear;
/* Estimate the metonic cycle number. Note that this may be an under
* estimate because there are 6939.6896 days in a metonic cycle not
* 6940, but it will never be an over estimate. The loop below will
* correct for any error in this estimate. */
metonicCycle = (inputDay + 310) / 6940;
/* Calculate the time of the starting molad for this metonic cycle. */
MoladOfMetonicCycle(metonicCycle, &moladDay, &moladHalakim);
/* If the above was an under estimate, increment the cycle number until
* the correct one is found. For modern dates this loop is about 98.6%
* likely to not execute, even once, because the above estimate is
* really quite close. */
while (moladDay < inputDay - 6940 + 310) {
metonicCycle++;
moladHalakim += HALAKIM_PER_METONIC_CYCLE;
moladDay += moladHalakim / HALAKIM_PER_DAY;
moladHalakim = moladHalakim % HALAKIM_PER_DAY;
}
/* Find the molad of Tishri closest to this date. */
for (metonicYear = 0; metonicYear < 18; metonicYear++) {
if (moladDay > inputDay - 74) {
break;
}
moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear];
moladDay += moladHalakim / HALAKIM_PER_DAY;
moladHalakim = moladHalakim % HALAKIM_PER_DAY;
}
*pMetonicCycle = metonicCycle;
*pMetonicYear = metonicYear;
*pMoladDay = moladDay;
*pMoladHalakim = moladHalakim;
}
/************************************************************************
* Given a year, find the number of the first day of that year and the date
* and time of the starting molad.
*/
static void FindStartOfYear(
int year,
int *pMetonicCycle,
int *pMetonicYear,
long int *pMoladDay,
long int *pMoladHalakim,
int *pTishri1)
{
*pMetonicCycle = (year - 1) / 19;
*pMetonicYear = (year - 1) % 19;
MoladOfMetonicCycle(*pMetonicCycle, pMoladDay, pMoladHalakim);
*pMoladHalakim += HALAKIM_PER_LUNAR_CYCLE * yearOffset[*pMetonicYear];
*pMoladDay += *pMoladHalakim / HALAKIM_PER_DAY;
*pMoladHalakim = *pMoladHalakim % HALAKIM_PER_DAY;
*pTishri1 = Tishri1(*pMetonicYear, *pMoladDay, *pMoladHalakim);
}
/************************************************************************
* Given a serial day number (SDN), find the corresponding year, month and
* day in the Jewish calendar. The three output values will always be
* modified. If the input SDN is before the first day of year 1, they will
* all be set to zero, otherwise *pYear will be > 0; *pMonth will be in the
* range 1 to 13 inclusive; *pDay will be in the range 1 to 30 inclusive.
*/
void SdnToJewish(
long int sdn,
int *pYear,
int *pMonth,
int *pDay)
{
long int inputDay;
long int day;
long int halakim;
int metonicCycle;
int metonicYear;
int tishri1;
int tishri1After;
int yearLength;
if (sdn <= SDN_OFFSET) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
return;
}
inputDay = sdn - SDN_OFFSET;
FindTishriMolad(inputDay, &metonicCycle, &metonicYear, &day, &halakim);
tishri1 = Tishri1(metonicYear, day, halakim);
if (inputDay >= tishri1) {
/* It found Tishri 1 at the start of the year. */
*pYear = metonicCycle * 19 + metonicYear + 1;
if (inputDay < tishri1 + 59) {
if (inputDay < tishri1 + 30) {
*pMonth = 1;
*pDay = inputDay - tishri1 + 1;
} else {
*pMonth = 2;
*pDay = inputDay - tishri1 - 29;
}
return;
}
/* We need the length of the year to figure this out, so find
* Tishri 1 of the next year. */
halakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear];
day += halakim / HALAKIM_PER_DAY;
halakim = halakim % HALAKIM_PER_DAY;
tishri1After = Tishri1((metonicYear + 1) % 19, day, halakim);
} else {
/* It found Tishri 1 at the end of the year. */
*pYear = metonicCycle * 19 + metonicYear;
if (inputDay >= tishri1 - 177) {
/* It is one of the last 6 months of the year. */
if (inputDay > tishri1 - 30) {
*pMonth = 13;
*pDay = inputDay - tishri1 + 30;
} else if (inputDay > tishri1 - 60) {
*pMonth = 12;
*pDay = inputDay - tishri1 + 60;
} else if (inputDay > tishri1 - 89) {
*pMonth = 11;
*pDay = inputDay - tishri1 + 89;
} else if (inputDay > tishri1 - 119) {
*pMonth = 10;
*pDay = inputDay - tishri1 + 119;
} else if (inputDay > tishri1 - 148) {
*pMonth = 9;
*pDay = inputDay - tishri1 + 148;
} else {
*pMonth = 8;
*pDay = inputDay - tishri1 + 178;
}
return;
} else {
if (monthsPerYear[(*pYear - 1) % 19] == 13) {
*pMonth = 7;
*pDay = inputDay - tishri1 + 207;
if (*pDay > 0)
return;
(*pMonth)--;
(*pDay) += 30;
if (*pDay > 0)
return;
(*pMonth)--;
(*pDay) += 30;
} else {
*pMonth = 6;
*pDay = inputDay - tishri1 + 207;
if (*pDay > 0)
return;
(*pMonth)--;
(*pDay) += 30;
}
if (*pDay > 0)
return;
(*pMonth)--;
(*pDay) += 29;
if (*pDay > 0)
return;
/* We need the length of the year to figure this out, so find
* Tishri 1 of this year. */
tishri1After = tishri1;
FindTishriMolad(day - 365,
&metonicCycle, &metonicYear, &day, &halakim);
tishri1 = Tishri1(metonicYear, day, halakim);
}
}
yearLength = tishri1After - tishri1;
day = inputDay - tishri1 - 29;
if (yearLength == 355 || yearLength == 385) {
/* Heshvan has 30 days */
if (day <= 30) {
*pMonth = 2;
*pDay = day;
return;
}
day -= 30;
} else {
/* Heshvan has 29 days */
if (day <= 29) {
*pMonth = 2;
*pDay = day;
return;
}
day -= 29;
}
/* It has to be Kislev. */
*pMonth = 3;
*pDay = day;
}
/************************************************************************
* Given a year, month and day in the Jewish calendar, find the
* corresponding serial day number (SDN). Zero is returned when the input
* date is detected as invalid. The return value will be > 0 for all valid
* dates, but there are some invalid dates that will return a positive
* value. To verify that a date is valid, convert it to SDN and then back
* and compare with the original.
*/
long int JewishToSdn(
int year,
int month,
int day)
{
long int sdn;
int metonicCycle;
int metonicYear;
int tishri1;
int tishri1After;
long int moladDay;
long int moladHalakim;
int yearLength;
int lengthOfAdarIAndII;
if (year <= 0 || day <= 0 || day > 30) {
return (0);
}
switch (month) {
case 1:
case 2:
/* It is Tishri or Heshvan - don't need the year length. */
FindStartOfYear(year, &metonicCycle, &metonicYear,
&moladDay, &moladHalakim, &tishri1);
if (month == 1) {
sdn = tishri1 + day - 1;
} else {
sdn = tishri1 + day + 29;
}
break;
case 3:
/* It is Kislev - must find the year length. */
/* Find the start of the year. */
FindStartOfYear(year, &metonicCycle, &metonicYear,
&moladDay, &moladHalakim, &tishri1);
/* Find the end of the year. */
moladHalakim += HALAKIM_PER_LUNAR_CYCLE * monthsPerYear[metonicYear];
moladDay += moladHalakim / HALAKIM_PER_DAY;
moladHalakim = moladHalakim % HALAKIM_PER_DAY;
tishri1After = Tishri1((metonicYear + 1) % 19, moladDay, moladHalakim);
yearLength = tishri1After - tishri1;
if (yearLength == 355 || yearLength == 385) {
sdn = tishri1 + day + 59;
} else {
sdn = tishri1 + day + 58;
}
break;
case 4:
case 5:
case 6:
/* It is Tevet, Shevat or Adar I - don't need the year length. */
FindStartOfYear(year + 1, &metonicCycle, &metonicYear,
&moladDay, &moladHalakim, &tishri1After);
if (monthsPerYear[(year - 1) % 19] == 12) {
lengthOfAdarIAndII = 29;
} else {
lengthOfAdarIAndII = 59;
}
if (month == 4) {
sdn = tishri1After + day - lengthOfAdarIAndII - 237;
} else if (month == 5) {
sdn = tishri1After + day - lengthOfAdarIAndII - 208;
} else {
sdn = tishri1After + day - lengthOfAdarIAndII - 178;
}
break;
default:
/* It is Adar II or later - don't need the year length. */
FindStartOfYear(year + 1, &metonicCycle, &metonicYear,
&moladDay, &moladHalakim, &tishri1After);
switch (month) {
case 7:
sdn = tishri1After + day - 207;
break;
case 8:
sdn = tishri1After + day - 178;
break;
case 9:
sdn = tishri1After + day - 148;
break;
case 10:
sdn = tishri1After + day - 119;
break;
case 11:
sdn = tishri1After + day - 89;
break;
case 12:
sdn = tishri1After + day - 60;
break;
case 13:
sdn = tishri1After + day - 30;
break;
default:
return (0);
}
}
return (sdn + SDN_OFFSET);
}
+240
View File
@@ -0,0 +1,240 @@
/* $selId: julian.c,v 2.0 1995/10/24 01:13:06 lees Exp $
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
* Permission granted to use, copy, modify, distribute and sell so long as
* the above copyright and this permission statement are retained in all
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
*/
/**************************************************************************
*
* These are the externally visible components of this file:
*
* void
* SdnToJulian(
* long int sdn,
* int *pYear,
* int *pMonth,
* int *pDay);
*
* Convert a SDN to a Julian calendar date. If the input SDN is less than
* 1, the three output values will all be set to zero, otherwise *pYear
* will be >= -4713 and != 0; *pMonth will be in the range 1 to 12
* inclusive; *pDay will be in the range 1 to 31 inclusive.
*
* long int
* JulianToSdn(
* int inputYear,
* int inputMonth,
* int inputDay);
*
* Convert a Julian calendar date to a SDN. Zero is returned when the
* input date is detected as invalid or out of the supported range. The
* return value will be > 0 for all valid, supported dates, but there are
* some invalid dates that will return a positive value. To verify that a
* date is valid, convert it to SDN and then back and compare with the
* original.
*
* VALID RANGE
*
* 4713 B.C. to at least 10000 A.D.
*
* Although this software can handle dates all the way back to 4713
* B.C., such use may not be meaningful. The calendar was created in
* 46 B.C., but the details did not stabilize until at least 8 A.D.,
* and perhaps as late at the 4th century. Also, the beginning of a
* year varied from one culture to another - not all accepted January
* as the first month.
*
* CALENDAR OVERVIEW
*
* Julias Ceasar created the calendar in 46 B.C. as a modified form of
* the old Roman republican calendar which was based on lunar cycles.
* The new Julian calendar set fixed lengths for the months, abandoning
* the lunar cycle. It also specified that there would be exactly 12
* months per year and 365.25 days per year with every 4th year being a
* leap year.
*
* Note that the current accepted value for the tropical year is
* 365.242199 days, not 365.25. This lead to an 11 day shift in the
* calendar with respect to the seasons by the 16th century when the
* Gregorian calendar was created to replace the Julian calendar.
*
* The difference between the Julian and today's Gregorian calendar is
* that the Gregorian does not make centennial years leap years unless
* they are a multiple of 400, which leads to a year of 365.2425 days.
* In other words, in the Gregorian calendar, 1700, 1800 and 1900 are
* not leap years, but 2000 is. All centennial years are leap years in
* the Julian calendar.
*
* The details are unknown, but the lengths of the months were adjusted
* until they finally stablized in 8 A.D. with their current lengths:
*
* January 31
* February 28/29
* March 31
* April 30
* May 31
* June 30
* Quintilis/July 31
* Sextilis/August 31
* September 30
* October 31
* November 30
* December 31
*
* In the early days of the calendar, the days of the month were not
* numbered as we do today. The numbers ran backwards (decreasing) and
* were counted from the Ides (15th of the month - which in the old
* Roman republican lunar calendar would have been the full moon) or
* from the Nonae (9th day before the Ides) or from the beginning of
* the next month.
*
* In the early years, the beginning of the year varied, sometimes
* based on the ascension of rulers. It was not always the first of
* January.
*
* Also, today's epoch, 1 A.D. or the birth of Jesus Christ, did not
* come into use until several centuries later when Christianity became
* a dominant religion.
*
* ALGORITHMS
*
* The calculations are based on two different cycles: a 4 year cycle
* of leap years and a 5 month cycle of month lengths.
*
* The 5 month cycle is used to account for the varying lengths of
* months. You will notice that the lengths alternate between 30 and
* 31 days, except for three anomalies: both July and August have 31
* days, both December and January have 31, and February is less than
* 30. Starting with March, the lengths are in a cycle of 5 months
* (31, 30, 31, 30, 31):
*
* Mar 31 days \
* Apr 30 days |
* May 31 days > First cycle
* Jun 30 days |
* Jul 31 days /
*
* Aug 31 days \
* Sep 30 days |
* Oct 31 days > Second cycle
* Nov 30 days |
* Dec 31 days /
*
* Jan 31 days \
* Feb 28/9 days |
* > Third cycle (incomplete)
*
* For this reason the calculations (internally) assume that the year
* starts with March 1.
*
* TESTING
*
* This algorithm has been tested from the year 4713 B.C. to 10000 A.D.
* The source code of the verification program is included in this
* package.
*
* REFERENCES
*
* Conversions Between Calendar Date and Julian Day Number by Robert J.
* Tantzen, Communications of the Association for Computing Machinery
* August 1963. (Also published in Collected Algorithms from CACM,
* algorithm number 199). [Note: the published algorithm is for the
* Gregorian calendar, but was adjusted to use the Julian calendar's
* simpler leap year rule.]
*
**************************************************************************/
#include "sdncal.h"
#define SDN_OFFSET 32083
#define DAYS_PER_5_MONTHS 153
#define DAYS_PER_4_YEARS 1461
void SdnToJulian(
long int sdn,
int *pYear,
int *pMonth,
int *pDay)
{
int year;
int month;
int day;
long int temp;
int dayOfYear;
if (sdn <= 0) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
return;
}
temp = (sdn + SDN_OFFSET) * 4 - 1;
/* Calculate the year and day of year (1 <= dayOfYear <= 366). */
year = temp / DAYS_PER_4_YEARS;
dayOfYear = (temp % DAYS_PER_4_YEARS) / 4 + 1;
/* Calculate the month and day of month. */
temp = dayOfYear * 5 - 3;
month = temp / DAYS_PER_5_MONTHS;
day = (temp % DAYS_PER_5_MONTHS) / 5 + 1;
/* Convert to the normal beginning of the year. */
if (month < 10) {
month += 3;
} else {
year += 1;
month -= 9;
}
/* Adjust to the B.C./A.D. type numbering. */
year -= 4800;
if (year <= 0)
year--;
*pYear = year;
*pMonth = month;
*pDay = day;
}
long int JulianToSdn(
int inputYear,
int inputMonth,
int inputDay)
{
int year;
int month;
/* check for invalid dates */
if (inputYear == 0 || inputYear < -4713 ||
inputMonth <= 0 || inputMonth > 12 ||
inputDay <= 0 || inputDay > 31) {
return (0);
}
/* check for dates before SDN 1 (Jan 2, 4713 B.C.) */
if (inputYear == -4713) {
if (inputMonth == 1 && inputDay == 1) {
return (0);
}
}
/* Make year always a positive number. */
if (inputYear < 0) {
year = inputYear + 4801;
} else {
year = inputYear + 4800;
}
/* Adjust the start of the year. */
if (inputMonth > 2) {
month = inputMonth - 3;
} else {
month = inputMonth + 9;
year--;
}
return ((year * DAYS_PER_4_YEARS) / 4
+ (month * DAYS_PER_5_MONTHS + 2) / 5
+ inputDay
- SDN_OFFSET);
}
+36
View File
@@ -0,0 +1,36 @@
#ifndef _INCLUDED_CALENDAR_H
#define _INCLUDED_CALENDAR_H
extern zend_module_entry calendar_module_entry;
#define calendar_module_ptr & calendar_module_entry
/* Functions */
PHP_MINIT_FUNCTION(calendar);
PHP_RINIT_FUNCTION(calendar);
PHP_RSHUTDOWN_FUNCTION(calendar);
PHP_MINFO_FUNCTION(calendar);
PHP_FUNCTION(jdtogregorian);
PHP_FUNCTION(gregoriantojd);
PHP_FUNCTION(jdtojulian);
PHP_FUNCTION(juliantojd);
PHP_FUNCTION(jdtojewish);
PHP_FUNCTION(jewishtojd);
PHP_FUNCTION(jdtofrench);
PHP_FUNCTION(frenchtojd);
PHP_FUNCTION(jddayofweek);
PHP_FUNCTION(jdmonthname);
PHP_FUNCTION(easter_days);
PHP_FUNCTION(easter_date);
PHP_FUNCTION(unixtojd);
PHP_FUNCTION(jdtounix);
#define phpext_calendar_ptr calendar_module_ptr
#endif
+96
View File
@@ -0,0 +1,96 @@
#ifndef _INCLUDED_SDNCAL_H
#define _INCLUDED_SDNCAL_H
/*
* This code has been modified for use with PHP
* by Shane Caraveo shane@caraveo.com
* see below for more details
*
*/
/* $selId: sdncal.h,v 2.0 1995/10/24 01:13:06 lees Exp $
* Copyright 1993-1995, Scott E. Lee, all rights reserved.
* Permission granted to use, copy, modify, distribute and sell so long as
* the above copyright and this permission statement are retained in all
* copies. THERE IS NO WARRANTY - USE AT YOUR OWN RISK.
*/
/**************************************************************************
*
* This package defines a set of routines that convert calendar dates to
* and from a serial day number (SDN). The SDN is a serial numbering of
* days where SDN 1 is November 25, 4714 BC in the Gregorian calendar and
* SDN 2447893 is January 1, 1990. This system of day numbering is
* sometimes referred to as Julian days, but to avoid confusion with the
* Julian calendar, it is referred to as serial day numbers here. The term
* Julian days is also used to mean the number of days since the beginning
* of the current year.
*
* The SDN can be used as an intermediate step in converting from one
* calendar system to another (such as Gregorian to Jewish). It can also
* be used for date computations such as easily comparing two dates,
* determining the day of the week, finding the date of yesterday or
* calculating the number of days between two dates.
*
* When using this software on 16 bit systems, be careful to store SDNs in
* a long int, because it will not fit in the 16 bits that some systems
* allocate to an int.
*
* For each calendar, there are two routines provided. One converts dates
* in that calendar to SDN and the other converts SDN to calendar dates.
* The routines are named SdnTo<CALENDAR>() and <CALENDAR>ToSdn(), where
* <CALENDAR> is the name of the calendar system.
*
* SDN values less than one are not supported. If a conversion routine
* returns an SDN of zero, this means that the date given is either invalid
* or is outside the supported range for that calendar.
*
* At least some validity checks are performed on input dates. For
* example, a negative month number will result in the return of zero for
* the SDN. A returned SDN greater than one does not necessarily mean that
* the input date was valid. To determine if the date is valid, convert it
* to SDN, and if the SDN is greater than zero, convert it back to a date
* and compare to the original. For example:
*
* int y1, m1, d1;
* int y2, m2, d2;
* long int sdn;
* ...
* sdn = GregorianToSdn(y1, m1, d1);
* if (sdn > 0) {
* SdnToGregorian(sdn, &y2, &m2, &d2);
* if (y1 == y2 && m1 == m2 && d1 == d2) {
* ... date is valid ...
* }
* }
*
**************************************************************************/
/* Gregorian calendar conversions. */
void SdnToGregorian(long int sdn, int *pYear, int *pMonth, int *pDay);
long int GregorianToSdn(int year, int month, int day);
extern char *MonthNameShort[13];
extern char *MonthNameLong[13];
/* Julian calendar conversions. */
void SdnToJulian(long int sdn, int *pYear, int *pMonth, int *pDay);
long int JulianToSdn(int year, int month, int day);
/* Jewish calendar conversions. */
void SdnToJewish(long int sdn, int *pYear, int *pMonth, int *pDay);
long int JewishToSdn(int year, int month, int day);
extern char *JewishMonthName[14];
/* French republic calendar conversions. */
void SdnToFrench(long int sdn, int *pYear, int *pMonth, int *pDay);
long int FrenchToSdn(int inputYear, int inputMonth, int inputDay);
extern char *FrenchMonthName[14];
/* Islamic calendar conversions. */
/* Not implemented yet. */
/* Day of week conversion. 0=Sunday, 6=Saturday */
int DayOfWeek(long int sdn);
extern char *DayNameShort[7];
extern char *DayNameLong[7];
#endif /* _INCLUDED_SDNCAL_H */
+1 -6
View File
@@ -1,10 +1,5 @@
DEPTH = ../..
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
LTLIBRARY_NAME = libcpdf.la
LTLIBRARY_SOURCES = cpdf.c
include $(topsrcdir)/build/ltlib.mk
include $(top_srcdir)/build/dynlib.mk
+1 -1
View File
@@ -11,7 +11,7 @@ AC_ARG_WITH(cpdflib,
AC_MSG_RESULT(no) ;;
yes)
AC_MSG_RESULT(yes)
PHP_EXTENSION(cpdflib)
PHP_EXTENSION(cpdf)
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
[AC_MSG_ERROR(Cpdf module requires cpdflib >= 2.)])
AC_ADD_LIBRARY(cpdf)
+8 -4
View File
@@ -42,7 +42,6 @@
#include "php_globals.h"
#include "ext/standard/php_standard.h"
#include "ext/standard/head.h"
#include "ext/standard/info.h"
#include <math.h>
#if HAVE_LIBGD13
#include <gd.h>
@@ -58,6 +57,7 @@
#if HAVE_CPDFLIB
#include "php_cpdf.h"
#include "ext/standard/info.h"
#ifdef THREAD_SAFE
DWORD CPDFlibTls;
@@ -158,9 +158,9 @@ zend_module_entry cpdf_module_entry = {
"cpdf", cpdf_functions, PHP_MINIT(cpdf), PHP_MSHUTDOWN(cpdf), PHP_RINIT(cpdf), NULL, PHP_MINFO(cpdf), STANDARD_MODULE_PROPERTIES
};
#if COMPILE_DL
#if defined(COMPILE_DL) || defined(COMPILE_DL_CPDF)
#include "dl/phpdl.h"
DLEXPORT zend_module_entry *get_module(void) { return &cpdf_module_entry; }
ZEND_GET_MODULE(cpdf)
#endif
static void _free_outline(CPDFoutlineEntry *outline)
@@ -187,7 +187,11 @@ PHP_RINIT_FUNCTION(cpdf)
PHP_MINFO_FUNCTION(cpdf) {
/* need to use a PHPAPI function here because it is external module in windows */
php_printf("Version %s", cpdf_version());
/* (don't knwo if that still applies (cmv) */
php_info_print_table_start();
php_info_print_table_row(2, "CPDF Support", "enabled");
php_info_print_table_row(2, "Version", cpdf_version() );
php_info_print_table_end();
}
PHP_MSHUTDOWN_FUNCTION(cpdf){
+1 -6
View File
@@ -1,10 +1,5 @@
DEPTH = ../..
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
LTLIBRARY_NAME = libcybercash.la
LTLIBRARY_SOURCES = cybercash.c
include $(topsrcdir)/build/ltlib.mk
include $(top_srcdir)/build/dynlib.mk
+1 -6
View File
@@ -1,10 +1,5 @@
DEPTH = ../..
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
LTLIBRARY_NAME = libdav.la
LTLIBRARY_SOURCES = dav.c
include $(topsrcdir)/build/ltlib.mk
include $(top_srcdir)/build/dynlib.mk
+9 -5
View File
@@ -4,10 +4,10 @@
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.01 of the PHP license, |
| This source file is subject to version 2.02 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/2_01.txt. |
| http://www.php.net/license/2_02.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. |
@@ -19,7 +19,7 @@
/* $Id$ */
#define IS_EXT_MODULE
#if COMPILE_DL
#if defined(COMPILE_DL) || defined(COMPILE_DL_DAV)
# if PHP_31
# include "../phpdl.h"
# else
@@ -36,6 +36,7 @@
#if HAVE_MOD_DAV
# include "mod_dav.h"
#include "ext/standard/info.h"
/* {{{ thread safety stuff */
@@ -67,8 +68,8 @@ phpdav_module php_dav_module;
/* }}} */
/* {{{ dynamically loadable module stuff */
# if COMPILE_DL
DLEXPORT zend_module_entry *get_module() { return &phpdav_module_entry; };
#if defined(COMPILE_DL) || defined(COMPILE_DL_DAV)
ZEND_GET_MODULE(phpdav)
# endif /* COMPILE_DL */
/* }}} */
@@ -158,6 +159,9 @@ PHP_RSHUTDOWN_FUNCTION(phpdav)
PHP_MINFO_FUNCTION(phpdav);
{
php_info_print_table_start();
php_info_print_table_row(2, "DAV Support", "enabled");
php_info_print_table_end();
}
/* {{{ extension-internal functions */
+1 -6
View File
@@ -1,10 +1,5 @@
DEPTH = ../..
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
LTLIBRARY_NAME = libdb.la
LTLIBRARY_SOURCES = db.c
include $(topsrcdir)/build/ltlib.mk
include $(top_srcdir)/build/dynlib.mk
+2 -2
View File
@@ -2,7 +2,7 @@ dnl $Id$
dnl config.m4 for extension db
dnl don't forget to call PHP_EXTENSION(db)
divert(2)dnl
divert(3)dnl
AC_CHECK_HEADERS(db1/ndbm.h)
@@ -27,7 +27,7 @@ AC_DEFUN(AC_PREFERRED_DB_LIB,[
AC_PREFERRED_DB_LIB
divert(4)dnl
divert(5)dnl
if test "$DBM_LIB" = "-lgdbm"; then
AC_CHECK_HEADER(gdbm.h, [ GDBM_INCLUDE="" ], [
+48 -12
View File
@@ -4,10 +4,10 @@
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.01 of the PHP license, |
| This source file is subject to version 2.02 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/2_01.txt. |
| http://www.php.net/license/2_02.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. |
@@ -19,7 +19,7 @@
/* $Id$ */
#define IS_EXT_MODULE
#if COMPILE_DL
#if defined(COMPILE_DL) || defined(COMPILE_DL_DB)
# include "dl/phpdl.h"
#endif
@@ -30,6 +30,7 @@
#include "safe_mode.h"
#include "fopen-wrappers.h"
#include "ext/standard/flock_compat.h"
#include "ext/standard/info.h"
#include <stdlib.h>
#include <string.h>
@@ -122,7 +123,7 @@ static int php_dbm_key_exists(DBM *dbf, datum key_datum) {
#define DBM_CREATE_MODE "a+b"
#define DBM_NEW_MODE "w+b"
#define DBM_DEFAULT_MODE "r"
#define DBM_OPEN(filename, mode) fopen(filename, mode)
#define DBM_OPEN(filename, mode) V_FOPEN(filename, mode)
#define DBM_CLOSE(dbf) fclose(dbf)
#define DBM_STORE(dbf, key, value, mode) flatfile_store(dbf, key, value, mode)
#define DBM_FETCH(dbf, key) flatfile_fetch(dbf, key)
@@ -230,16 +231,23 @@ static char *php_get_info_db(void)
PHP_MINFO_FUNCTION(db)
{
/* this isn't pretty ... should break out the info a bit more (cmv) */
php_info_print_box_start(0);
php_printf(php_get_info_db());
php_info_print_box_end();
}
/* {{{ proto string dblist(void)
Describes the dbm-compatible library being used */
PHP_FUNCTION(dblist)
{
char *str = php_get_info_db();
RETURN_STRING(str,1);
}
/* }}} */
/* {{{ proto int dbmopen(string filename, string mode)
Opens a dbm database */
PHP_FUNCTION(dbmopen) {
pval *filename, *mode;
dbm_info *info=NULL;
@@ -260,6 +268,8 @@ PHP_FUNCTION(dbmopen) {
RETURN_FALSE;
}
}
/* }}} */
dbm_info *php_dbm_open(char *filename, char *mode) {
dbm_info *info;
@@ -315,7 +325,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
strcat(lockfn, ".lck");
#if NFS_HACK
while((last_try = stat(lockfn,&sb))==0) {
while((last_try = V_STAT(lockfn,&sb))==0) {
retries++;
php_sleep(1);
if (retries>30) break;
@@ -329,7 +339,7 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
}
#else /* NFS_HACK */
lockfd = open(lockfn,O_RDWR|O_CREAT,0644);
lockfd = V_OPEN((lockfn,O_RDWR|O_CREAT,0644));
if (lockfd) {
flock(lockfd,LOCK_EX);
@@ -398,6 +408,8 @@ dbm_info *php_dbm_open(char *filename, char *mode) {
return NULL;
}
/* {{{ proto bool dbmclose(int dbm_identifier)
Closes a dbm database */
PHP_FUNCTION(dbmclose) {
pval *id;
@@ -412,6 +424,7 @@ PHP_FUNCTION(dbmclose) {
RETURN_FALSE;
}
}
/* }}} */
int php_dbm_close(dbm_info *info) {
int ret = 0;
@@ -424,7 +437,7 @@ int php_dbm_close(dbm_info *info) {
unlink(info->lockfn);
#else
if (info->lockfn) {
lockfd = open(info->lockfn,O_RDWR,0644);
lockfd = V_OPEN((info->lockfn,O_RDWR,0644));
flock(lockfd,LOCK_UN);
close(lockfd);
}
@@ -446,6 +459,8 @@ int php_dbm_close(dbm_info *info) {
* ret = 0 success
* ret = 1 key already exists - nothing done
*/
/* {{{ proto int dbminsert(int dbm_identifier, string key, string value)
Inserts a value for a key in a dbm database */
PHP_FUNCTION(dbminsert)
{
pval *id, *key, *value;
@@ -467,6 +482,9 @@ PHP_FUNCTION(dbminsert)
ret = php_dbm_insert(info, key->value.str.val, value->value.str.val);
RETURN_LONG(ret);
}
/* }}} */
int php_dbm_insert(dbm_info *info, char *key, char *value) {
datum key_datum, value_datum;
@@ -499,6 +517,8 @@ int php_dbm_insert(dbm_info *info, char *key, char *value) {
return(ret);
}
/* {{{ proto int dbmreplace(int dbm_identifier, string key, string value)
Replaces the value for a key in a dbm database */
PHP_FUNCTION(dbmreplace)
{
pval *id, *key, *value;
@@ -520,6 +540,7 @@ PHP_FUNCTION(dbmreplace)
ret = php_dbm_replace(info, key->value.str.val, value->value.str.val);
RETURN_LONG(ret);
}
/* }}} */
int php_dbm_replace(dbm_info *info, char *key, char *value) {
DBM_TYPE dbf;
@@ -555,6 +576,8 @@ int php_dbm_replace(dbm_info *info, char *key, char *value) {
return(ret);
}
/* {{{ proto string dbmfetch(int dbm_identifier, string key)
Fetches a value for a key from a dbm database */
PHP_FUNCTION(dbmfetch)
{
pval *id, *key;
@@ -579,6 +602,7 @@ PHP_FUNCTION(dbmfetch)
RETURN_FALSE;
}
}
/* }}} */
char *php_dbm_fetch(dbm_info *info, char *key) {
datum key_datum, value_datum;
@@ -625,7 +649,8 @@ char *php_dbm_fetch(dbm_info *info, char *key) {
return(ret);
}
/* {{{ proto int dbmexists(int dbm_identifier, string key)
Tells if a value exists for a key in a dbm database */
PHP_FUNCTION(dbmexists)
{
pval *id, *key;
@@ -646,6 +671,7 @@ PHP_FUNCTION(dbmexists)
ret = php_dbm_exists(info, key->value.str.val);
RETURN_LONG(ret);
}
/* }}} */
int php_dbm_exists(dbm_info *info, char *key) {
datum key_datum;
@@ -668,7 +694,9 @@ int php_dbm_exists(dbm_info *info, char *key) {
return(ret);
}
/* {{{ proto int dbmdelete(int dbm_identifier, string key)
Deletes the value for a key from a dbm database */
PHP_FUNCTION(dbmdelete)
{
pval *id, *key;
@@ -689,6 +717,7 @@ PHP_FUNCTION(dbmdelete)
ret = php_dbm_delete(info, key->value.str.val);
RETURN_LONG(ret);
}
/* }}} */
int php_dbm_delete(dbm_info *info, char *key) {
datum key_datum;
@@ -711,6 +740,8 @@ int php_dbm_delete(dbm_info *info, char *key) {
return(ret);
}
/* {{{ string dbmfirstkey(int dbm_identifier)
Retrieves the first key from a dbm database */
PHP_FUNCTION(dbmfirstkey)
{
pval *id;
@@ -736,6 +767,7 @@ PHP_FUNCTION(dbmfirstkey)
return_value->type = IS_STRING;
}
}
/* }}} */
char *php_dbm_first_key(dbm_info *info) {
datum ret_datum;
@@ -768,6 +800,8 @@ char *php_dbm_first_key(dbm_info *info) {
return (ret);
}
/* {{{ proto string dbmnextkey(int dbm_identifier, string key)
Retrieves the next key from a dbm database */
PHP_FUNCTION(dbmnextkey)
{
pval *id, *key;
@@ -794,6 +828,8 @@ PHP_FUNCTION(dbmnextkey)
return_value->type = IS_STRING;
}
}
/* }}} */
char *php_dbm_nextkey(dbm_info *info, char *key) {
datum key_datum, ret_datum;
@@ -1136,8 +1172,8 @@ zend_module_entry dbm_module_entry = {
"db", dbm_functions, PHP_MINIT(db), PHP_MSHUTDOWN(db), PHP_RINIT(db), NULL, PHP_MINFO(db), STANDARD_MODULE_PROPERTIES
};
#if COMPILE_DL
DLEXPORT zend_module_entry *get_module(void) { return &dbm_module_entry; }
#if defined(COMPILE_DL) || defined(COMPILE_DL_DB)
ZEND_GET_MODULE(dbm)
#endif
#endif
-3
View File
@@ -89,7 +89,4 @@ PHP_FUNCTION(dbmdelete);
PHP_FUNCTION(dbmfirstkey);
PHP_FUNCTION(dbmnextkey);
#undef phpext_db_ptr
#define phpext_db_ptr NULL
#endif /* _PHP_DB_H */
+3 -6
View File
@@ -1,11 +1,8 @@
DEPTH = ../..
topsrcdir = @topsrcdir@
srcdir = @srcdir@
VPATH = @srcdir@
LTLIBRARY_NAME = libdba.la
LTLIBRARY_SOURCES = dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \
dba_ndbm.c dba_db3.c
LTLIBRARY_SHARED_NAME = dba.la
LTLIBRARY_SHARED_LIBADD = $(DBA_SHARED_LIBADD)
include $(topsrcdir)/build/ltlib.mk
include $(top_srcdir)/build/dynlib.mk
+8 -6
View File
@@ -33,7 +33,7 @@ AC_DEFUN(AC_DBA_STD_CHECK,[
dnl Attach THIS_x to DBA_x
AC_DEFUN(AC_DBA_STD_ATTACH,[
AC_ADD_INCLUDE($THIS_INCLUDE)
AC_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS)
AC_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS, DBA_SHARED_LIBADD)
THIS_INCLUDE=""
THIS_LIBS=""
@@ -52,7 +52,8 @@ AC_DEFUN(AC_DBA_STD_RESULT,[
THIS_RESULT=""
])
PHP_ARG_ENABLE(dba,whether to enable DBA,
[ --enable-dba=shared Build DBA as a shared module])
AC_ARG_WITH(gdbm,
[ --with-gdbm[=DIR] Include GDBM support],[
@@ -155,18 +156,18 @@ AC_DBA_STD_RESULT
AC_ARG_WITH(db3,
[ --with-db3[=DIR] Include Berkeley DB3 support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
for i in /usr/local /usr /usr/local/BerkeleyDB.3.0 $withval; do
if test -f "$i/include/db.h" ; then
THIS_PREFIX="$i"
DB3_EXTRA="db.h"
fi
done
done
if test -n "$DB3_EXTRA"; then
AC_DEFINE_UNQUOTED(DB3_INCLUDE_FILE, "$DB3_EXTRA", [ ])
fi
for LIB in db; do
for LIB in db db-3; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, db_create, [AC_DEFINE(DBA_DB3,1,[ ]) THIS_LIBS="$LIB"])
])
@@ -230,7 +231,8 @@ AC_MSG_CHECKING(whether to enable DBA interface)
if test "$HAVE_DBA" = "1"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBA, 1, [ ])
PHP_EXTENSION(dba)
PHP_EXTENSION(dba,$ext_shared)
PHP_SUBST(DBA_SHARED_LIBADD)
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_DBA, 0, [ ])
+8
View File
@@ -34,6 +34,7 @@
#if HAVE_DBA
#include "php_dba.h"
#include "ext/standard/info.h"
#include "php_gdbm.h"
#include "php_ndbm.h"
@@ -71,6 +72,10 @@ zend_module_entry dba_module_entry = {
STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_DBA
ZEND_GET_MODULE(dba)
#endif
typedef struct dba_handler {
char *name;
int (*open)(dba_info *);
@@ -197,13 +202,16 @@ static PHP_MSHUTDOWN_FUNCTION(dba)
static PHP_MINFO_FUNCTION(dba)
{
/* could be prettier (cmv) */
dba_handler *hptr;
php_info_print_box_start(0);
PUTS("V1 ($Id$)");
for(hptr = handler; hptr->name; hptr++) {
PUTS(" ");
PUTS(hptr->name);
}
php_info_print_box_end();
}
static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
+1 -1
View File
@@ -71,7 +71,7 @@ DBA_OPEN_FUNC(cdb)
cdb = malloc(sizeof *cdb);
memset(cdb, 0, sizeof *cdb);
cdb->fd = open(info->path, gmode);
cdb->fd = V_OPEN((info->path, gmode));
if(cdb->fd < 0) {
free(cdb);
return FAILURE;
Loaded 100 of 481 files, more files were not shown because too many files have changed in this diff. Show more