Compare commits

...
Author SHA1 Message Date
SVN Migration aeb4ed5004 This commit was manufactured by cvs2svn to create tag 'php_4_0_4pl1'. 2001-01-11 18:18:20 +00:00
Zeev Suraski ddcfc93126 Prepare to roll pl1
PR:
Submitted by:
Reviewed by:
Obtained from:
2001-01-11 18:18:19 +00:00
Zeev Suraski 0b043e92a7 Merge Daniel's PDF fixes
PR:
Submitted by:
Reviewed by:
Obtained from:
2001-01-09 21:00:05 +00:00
Thies C. Arntzen 7ea53ff229 Merged from rev 1.105 2001-01-07 11:55:38 +00:00
Sascha Schumann 5872ffcead MFH session_unset() fix 2001-01-04 17:18:03 +00:00
Sascha Schumann d7d480949f MFH with version 1.2 2001-01-04 17:13:43 +00:00
Zeev Suraski a2ea3caa69 Fix Zend version while we're at it 2001-01-03 23:52:36 +00:00
Zeev Suraski da59c92901 Prepare 4.0.4pl1-RC1
PR:
Submitted by:
Reviewed by:
Obtained from:
2001-01-03 23:51:16 +00:00
Zeev Suraski 0157bf243d Merge call_user_function_ex() fixes 2001-01-03 23:04:52 +00:00
Zeev Suraski 8282d12be1 Merge line number corruption bug fix 2001-01-03 23:02:11 +00:00
Zeev Suraski 6b1c31661b Merge Apache module fixes - engine = off propogating to other vhosts
and possible INI entries corruption
PR:
Submitted by:
Reviewed by:
Obtained from:
2001-01-03 22:07:59 +00:00
Dan Kalowsky c278eab916 These changes are to reflect those in the 4.0.5 development branch. Mainly adding in compile capability for the OPENLINK system (changed a SQLINTEGER to an SDWORD to allow compile), and re-added in a #define for SOLID 3.0 systems... both are needed for proper functionality.
PR:
Submitted by:
Reviewed by:
Obtained from:
2001-01-03 15:04:50 +00:00
Sascha Schumann d87135436b Add session tests 2000-12-24 16:38:49 +00:00
Sascha Schumann 35792a8986 MFH s/efree/FREE_ZVAL/ change 2000-12-24 16:36:04 +00:00
SVN Migration cba764c504 This commit was manufactured by cvs2svn to create branch 'php_4_0_4'. 2000-12-24 16:33:28 +00:00
Sascha Schumann ac7be8892b Merge test-related changes 2000-12-24 14:31:56 +00:00
Sascha Schumann b6b6b14ae9 merge in function name changes 2000-12-20 07:42:52 +00:00
Sascha Schumann 12f8f00fb8 Preparing 4.0.4 2000-12-19 04:32:10 +00:00
Sascha Schumann e3c79b33f8 Fix OpenBSD behaviour WRT building shared libraries. Also add OpenBSD 2.8
support.
2000-12-14 16:17:31 +00:00
Hartmut Holzgraefe e9c5c6ea7a revert my last patch 2000-12-14 16:16:04 +00:00
Sascha Schumann 0493e78c8d MFH strtr fix 2000-12-14 16:00:31 +00:00
Hartmut Holzgraefe 432a0a8d18 levenshtein() fixes and regression test 2000-12-14 14:48:54 +00:00
Hartmut Holzgraefe 3844c9cfb6 fgetcsv() will now work correct with empty fields in tab delimited files
# fix for bug #8258 and regression test
2000-12-14 14:34:51 +00:00
SVN Migration f825493be1 This commit was manufactured by cvs2svn to create branch 'php_4_0_4'. 2000-12-14 14:18:37 +00:00
Sascha Schumann 236b0d0861 Preparing RC6 2000-12-14 00:07:15 +00:00
Sascha Schumann 1b32827801 MFH fix for #8225 2000-12-14 00:03:21 +00:00
Zeev Suraski 59b1db6bfc Rollback bogus patch 2000-12-13 23:42:12 +00:00
Zeev Suraski 3efc767433 MFH - call_user_function() object fix 2000-12-13 23:02:10 +00:00
Stanislav Malyshev 0eea6e7a8f MFH 2000-12-13 10:23:11 +00:00
foobar 43357775fa Added a missing note. 2000-12-13 09:18:55 +00:00
Sterling Hughes ec94654316 MFH 2000-12-12 19:24:59 +00:00
Stanislav Malyshev 03e748888b MFH 2000-12-12 17:09:40 +00:00
Sascha Schumann 3dca869c7b Preparing 4.0.4RC5 2000-12-12 17:05:39 +00:00
Stanislav Malyshev 480a2ea1b7 MFH 2000-12-12 11:13:26 +00:00
foobar bf80795cad MFH 2000-12-11 16:32:08 +00:00
Stanislav Malyshev 881e6b69c4 Fix serializer bug (merge with HEAD) 2000-12-11 15:21:37 +00:00
Sterling Hughes 888e41a834 Merge with HEAD 2000-12-11 14:49:49 +00:00
Thies C. Arntzen 02e8c41b24 fix #6348 2000-12-11 12:55:17 +00:00
Andi Gutmans bd3b413dc9 - Merge message about assinging new MyClass() expressions by reference. 2000-12-10 20:27:47 +00:00
Sascha Schumann 83a354b69a Enabled improved shared library handling on HP-UX 11. 2000-12-09 11:37:27 +00:00
Sascha Schumann 3de6716235 MFH fix for #8181 2000-12-09 10:36:13 +00:00
Sascha Schumann 288d437b3e MFH off-by-one fix 2000-12-08 16:21:47 +00:00
Sascha Schumann 40cd0d8909 MFH memory leak fix 2000-12-08 16:20:20 +00:00
foobar ac6d2d4fe9 Merge changes from HEAD. 2000-12-08 13:13:04 +00:00
Sterling Hughes ebc2ff7c07 Correct merge. 2000-12-08 12:57:42 +00:00
Sascha Schumann a8b9717374 MFH on Sterling's request. 2000-12-08 12:43:26 +00:00
Sascha Schumann de138d3468 MFH namespace protecting changes 2000-12-08 11:38:02 +00:00
Sascha Schumann a5ce3491ef MFH LFS-related changes 2000-12-07 19:15:03 +00:00
Sascha Schumann d07f47f59e MFH --enable-libgcc change 2000-12-07 19:07:40 +00:00
foobar c3670534df Merge changes from HEAD. 2000-12-07 11:07:40 +00:00
foobar b583e753b5 merge from HEAD. 2000-12-07 10:46:18 +00:00
Sascha Schumann f81e218f15 Merge from HEAD 2000-12-07 10:03:56 +00:00
foobar 71fa3102fc merge from HEAD. 2000-12-07 00:31:36 +00:00
Sascha Schumann ded8918b9e Merge HEAD changes 2000-12-06 17:41:53 +00:00
Andi Gutmans a574e24080 - Update 4.0.4 branches NEWS file 2000-12-05 17:12:30 +00:00
Sascha Schumann d812632083 Merge from HEAD 2000-12-05 11:07:11 +00:00
Sascha Schumann ad39ef1462 Merge entries manually 2000-12-04 18:00:25 +00:00
foobar c0446845b9 Merge changes from head branch. 2000-12-04 17:26:11 +00:00
Sascha Schumann 326dcb9e79 Merged with HEAD, 1.21 2000-12-04 16:15:39 +00:00
Sascha Schumann 26a0663044 Merged with HEAD, 1.8 2000-12-04 16:15:26 +00:00
Sascha Schumann 9b4e521b9c Merged with HEAD, 1.35 2000-12-04 16:14:09 +00:00
Sascha Schumann 449ddbccb1 Merge from HEAD 2000-12-04 12:27:47 +00:00
Sascha Schumann fa077c7be9 Merge changes from HEAD. 2000-12-04 10:24:06 +00:00
Zeev Suraski 786eacfd45 Import the MySQL updates from the main branch 2000-12-03 21:25:28 +00:00
Hartmut Holzgraefe 46cdd040e2 changed run-tests.php to use 'php -q' instead of 'php -f' 2000-12-03 10:45:57 +00:00
Zeev Suraski 6f164ad7dc Fix the bug with -f not filling in the $argv[] arguments.
I'm not sure what used to be the behavior - but the new code puts the -f
argument as $argv[0], which is the Right Thing to do IMHO...  Comments
welcome
2000-12-03 01:09:13 +00:00
Zeev Suraski 58f0cbd534 Don't mislead people... 2000-12-03 00:39:56 +00:00
Zeev Suraski 594b7989cc Commit the fix to the 4.0.4 branch 2000-12-03 00:26:35 +00:00
Sascha Schumann 44294ada47 Merge changes from HEAD 2000-12-02 13:46:08 +00:00
Sascha Schumann c277e3f98d 4.0.4RC3 is coming. 2000-12-02 08:14:57 +00:00
SVN Migration cd14d04924 This commit was manufactured by cvs2svn to create branch 'php_4_0_4'. 2000-12-02 02:09:18 +00:00
d4b4ed3505 ChangeLog update 2000-12-02 02:09:17 +00:00
David Hedbor 1731fb0c67 Minor cosmetic changes. 2000-12-01 23:34:01 +00:00
David Hedbor bb1d16c122 More config.m4 fixes. 2000-12-01 23:10:49 +00:00
David Hedbor 8d48566c6f Updated config test to also work with debian pike 7 cvs etc. 2000-12-01 22:23:37 +00:00
Egon Schmid 10c685112a Fixed some protos. 2000-12-01 15:25:22 +00:00
Egon Schmid 91436356b8 Fixed some protos. 2000-12-01 15:03:25 +00:00
Sascha Schumann 8e3abe8946 Get rid of HAVE_EXTNAME. This dates back to PHP 3 where source files
were unconditionally compiled. It is not necessary in PHP 4.
2000-12-01 14:56:30 +00:00
Egon Schmid b3b277f32a Fixed some protos. 2000-12-01 14:32:14 +00:00
Sascha Schumann 4f4cac9611 Add newline. Recent GCC snapshots segfault, if the input file is completely
empty. Should I report this? This appears to be quite lame.
2000-12-01 13:57:24 +00:00
Sascha Schumann 8476f5b29e Please avoid potential buffer overflows in new code. If you deal
with strings, consider storing the string length along with the string
data. That will make your life easier.
2000-12-01 12:29:29 +00:00
Sascha Schumann a1510f90b0 Remove *.o 2000-12-01 12:14:30 +00:00
Andi Gutmans ae7c036e41 - Fix swf build issues from bug #7612
- Not tested! Someone please compile it.
2000-12-01 09:50:01 +00:00
727e89ab1b ChangeLog update 2000-12-01 02:09:19 +00:00
Frank M. Kromann f9e226fe4a Fixing bug 8061. Position counter starts a 0 but was compared with length.
oops. the fix should be made twice.
2000-12-01 01:55:31 +00:00
Frank M. Kromann 518ab3c62f Fixing bug 8061. Position counter starts a 0 but was compared with length. 2000-12-01 01:26:42 +00:00
foobar 744f1a34ef Beautifying of phpinfo(). 2000-12-01 01:25:36 +00:00
Frank M. Kromann 6cdc90bae3 Changed presentation of default values for textsize and textlimit in phpinfo().
the value -1 means "Server default"
2000-11-30 22:24:00 +00:00
David Eriksson c2f1139738 updated documentation and configuration 2000-11-30 22:03:18 +00:00
David Eriksson 1888009e26 changed variable names to *_class_functions 2000-11-30 22:01:58 +00:00
Sterling Hughes 4daab7c982 fix configure --help option name... 2000-11-30 15:20:40 +00:00
42fc96aaaf ChangeLog update 2000-11-30 02:09:11 +00:00
66e3243ddd NEWS update 2000-11-30 02:09:08 +00:00
Frank M. Kromann ad17d8f0a4 The ODBC extension looks for settings named odbc. and not uodbc. 2000-11-29 22:10:46 +00:00
Frank M. Kromann 20490db03f Removed old version 6.5 code. Clinet Libraries for SQL Server 7.0 can be used with version 6,5.
Minor changes to use som Zend macros to define globals.
2000-11-29 22:06:47 +00:00
Frank M. Kromann 5cb6b6c667 Fixing wring resource handle returned from mssql_query().
The error was introduced when adding mssql_fetch_batch().
2000-11-29 17:08:22 +00:00
Stanislav Malyshev f7650fe8ae Add .cvsignore 2000-11-29 15:50:18 +00:00
Stanislav Malyshev ebffa649c3 Add more GMP functions, fix a couple of bugs 2000-11-29 15:49:18 +00:00
Sterling Hughes 2cc8e2f8c7 @ Added the is_null() function that will return true if a variable is of
@ type null. (Sterling)
2000-11-29 15:37:38 +00:00
Daniel Beulshausen 93b2587876 made gd working correct under win32
# fixes the issues when running php threadsafe
2000-11-29 15:25:42 +00:00
0bc55d8c81 ChangeLog update 2000-11-29 02:09:13 +00:00
69e30c20c1 NEWS update 2000-11-29 02:09:10 +00:00
Jason Greene d8bc7084ee Added the capability to specify a different HTTP Redirection response code
before the Location Header.

Ex. header("HTTP/1.1 307 Temporary Redirect");
    header("Location: URL");
2000-11-29 01:22:49 +00:00
Zeev Suraski 2672602e30 Output buffering was being enabled all the time - fixed 2000-11-29 01:02:27 +00:00
foobar 2fef94cc11 One file missing. 2000-11-28 15:48:21 +00:00
foobar bb69296ddd Added missing .cvsignore files. 2000-11-28 15:43:06 +00:00
foobar 3a930785ec Fixed typo. bug #8001 2000-11-28 09:39:01 +00:00
foobar e5a997ff59 @- Fixed a bug which made readdir() unusable in some systems. (Jani)
# Bug report: #7390
2000-11-28 09:13:22 +00:00
foobar 5c16c9fa1a AC_CHECK_LIB prints out yes/no itself. 2000-11-28 08:06:30 +00:00
Sascha Schumann dcd971e6bf A field of mines
Submitted by: jon@csh.rit.edu
2000-11-28 06:54:16 +00:00
4e1b1fa929 ChangeLog update 2000-11-28 02:09:09 +00:00
Sascha Schumann 6e7a9e2705 Add note about an old change 2000-11-28 01:38:51 +00:00
Sascha Schumann 84f8310e9a Always add top_srcdir to the header file search path. 2000-11-28 01:20:21 +00:00
Andi Gutmans 8d9082563a - Allow passing references which are returned from functions and new
- statements to be passed by reference.
2000-11-27 18:46:23 +00:00
Daniel Beulshausen aa11144649 fix path operations, under win32 2000-11-27 18:21:48 +00:00
Andrei Zmievski 81814c8ddc Update class constants before trying to get default properties. 2000-11-27 17:00:54 +00:00
Sascha Schumann 3b195720e0 Add a note about what a missing const specifier does mean in the context
of the request_info structure.
2000-11-27 13:33:33 +00:00
Sascha Schumann 949b0893dc The result of conv_z_macros and some manual conversion of
"return_value.*=.*IS_STRING" constructs to RETVAL_STRINGL.
2000-11-27 13:31:21 +00:00
Sascha Schumann 1626ba7ee9 Oh man, gcc's logic is really flawed 2000-11-27 13:28:26 +00:00
Sascha Schumann 0644641616 Move build-defs.h(.in) and php_config.h to main 2000-11-27 13:27:51 +00:00
Sascha Schumann aa6a62d96d Kill a warning (code is correct) 2000-11-27 13:13:25 +00:00
Daniel Beulshausen d5af60ca2f update win32 extension section 2000-11-27 11:57:30 +00:00
19bca1a309 ChangeLog update 2000-11-27 02:09:11 +00:00
Jon Parise 45807e6dd9 Added a brief section documenting the preference of tabs over spaces.
There are a few touch-ups in this commit, too.
2000-11-26 21:45:44 +00:00
Stanislav Malyshev dca467faf3 GNU GMP - arbitrary precision nubers library 2000-11-26 18:36:16 +00:00
Zeev Suraski d4fc424554 Fix windows build 2000-11-26 14:25:31 +00:00
Zeev Suraski 8a03f3062f - Add bcmath to the standard UNIX build
- Change a couple of malloc()'s and free()'s to emalloc()'s and efree()'s
2000-11-26 09:34:01 +00:00
203d67ea6b ChangeLog update 2000-11-26 02:09:18 +00:00
Sterling Hughes 939a8b31e7 Add get_defined_functions() and get_defined_vars(). Clean up constant() entry a bit.
# Are we not ready for a release yet?
2000-11-25 16:37:26 +00:00
960cc62e59 ChangeLog update 2000-11-25 02:09:09 +00:00
a33a3925f9 NEWS update 2000-11-25 02:09:06 +00:00
Sterling Hughes 0d1bcd480c @ Added the call_user_func_array() function which gives you the ability to
@ call a user function by passing an array of parameters as the second
@ argument.

@ Added the constant() function which returns the value of a constant given
@ the constant's name.
2000-11-24 21:05:25 +00:00
Sterling Hughes 917cfd14e9 Declaring variables is generally a good thing 2000-11-24 16:26:35 +00:00
Andre Langhorst 96b95bd286 fixed bug 7961 2000-11-24 16:17:58 +00:00
Sterling Hughes fe25ebdd11 Fix segfault when non-array in params or arguments is given to
xslt_transform() or xslt_run().

Update xslt_output_begintransform() to new output buffering syntax (torben@php.net)
2000-11-24 15:07:01 +00:00
ea536c5808 ChangeLog update 2000-11-24 02:09:12 +00:00
b762691d4d NEWS update 2000-11-24 02:09:09 +00:00
Andrei Zmievski def5059f44 Fix the arg array size. 2000-11-24 00:12:19 +00:00
Stig Venaas db0d2c9bd6 Added README on usage, and added myself to CREDITS 2000-11-23 19:30:47 +00:00
Zeev Suraski 888f376e4c Very initial work on chunked output buffering. It's really unoptimized at
this time, and it can crash under some circumstances, but that's the
concept...
2000-11-23 18:43:18 +00:00
Andrei Zmievski 0af5c36d94 This submission introduces two features.
The first one is support for Perl-style matching regexp delimiters, i.e.
using <[{( and )}]> to delimit the regular expressions.

The second one is a new 'F' modifier that allows you to specify a function name
in the replacement argument to preg_replace(). This function will be called
when the replacement needs to be made. It is passed an array of full matched
pattern and captured subpatterns and it is expected to return a string that
will be used for replacement. 'e' and 'F' modifiers cannot be used together.

@- Implemented support for Perl-style matching regexp delimiters in PCRE.
@  You can use <{[( and )]}> to delimit your expressions now. (Andrei)

@- Introduced new 'F' modifier in PCRE that lets you specify a function
@  name in the replacement argument to preg_replace() that will be called
@  at run-time to provide the replacement string. It is passed an array of
@  matched pattern and subpatterns. (Andrei)
2000-11-23 17:25:13 +00:00
foobar f03b949134 Revert bad commit.
# And now I'm ready to sleep..
2000-11-23 16:31:58 +00:00
Daniel Beulshausen 23c3b190c2 oops, libcrypt shouln't be in the linker libs
by default
2000-11-23 16:29:49 +00:00
foobar 78ed6e831f Fixed some compile warnings. 2000-11-23 15:57:24 +00:00
foobar a216a9ad7e Fixed Bug #7939 + some cleaning. 2000-11-23 14:56:09 +00:00
Uwe Steinmann 4a60447800 - optional argument for hw_pipedocument() to specify link prefix 2000-11-23 14:44:10 +00:00
Zeev Suraski 5ebbef16f2 I forgot to commit the .dsp update... 2000-11-23 14:34:09 +00:00
Daniel Beulshausen 819f11c9d2 make ctype ext compile under windows 2000-11-23 14:14:40 +00:00
Sebastian Bergmann ccb857ba81 Fixed typo. 2000-11-23 14:06:50 +00:00
Daniel Beulshausen e6d07d6fa3 added missing SABLOTLS_FETCH() 2000-11-23 14:02:41 +00:00
Hartmut Holzgraefe df7c2eeabc make genfunclist in phpdoc happy 2000-11-23 12:16:35 +00:00
Uwe Steinmann 4bb015938e - The name of the extension has to be fdf and not fdftk 2000-11-23 10:55:51 +00:00
Daniel Beulshausen cabfc674c2 fix libbcmath compile, updated dependencies & add
libbcmath to linker options
2000-11-23 10:17:37 +00:00
Uwe Steinmann fb35b3996c - fixed copy and paste error 2000-11-23 09:56:18 +00:00
Hartmut Holzgraefe c534109bce filename wildcards in a c comment were a bad idea 2000-11-23 06:58:14 +00:00
Frank M. Kromann ee3353e8d3 Adding Win32 project for libbcmath 2000-11-23 05:08:19 +00:00
7ace1a3e8d ChangeLog update 2000-11-23 02:09:11 +00:00
a9f8aa69c9 NEWS update 2000-11-23 02:09:08 +00:00
Frank M. Kromann b24c82e82a changed comment to allow compilation under win32 2000-11-23 01:47:39 +00:00
Hartmut Holzgraefe e3dae1013d added a "DO NOT EDIT!" header and regenerated the credits_*h files 2000-11-22 23:20:35 +00:00
Hartmut Holzgraefe 929197cf83 merged ext/apache/CREDITS and sapi/apache/CREDITS 2000-11-22 23:04:33 +00:00
Hartmut Holzgraefe e7101eb193 this little scripts will collect the CREDITS files from
all the ext/ and sapi/ subdirectories and put them all
together into ext/standard/credit_[ext|sapi].h
2000-11-22 22:53:33 +00:00
Sascha Schumann 3cacf33572 Run through conv_z_macros 2000-11-22 22:05:02 +00:00
Sascha Schumann c1dff68b34 Run through conv_z_macros and make use of RETVAL_STRING where useful 2000-11-22 22:00:39 +00:00
Sascha Schumann 53e3452649 Avoid estrdup and a couple of other minor cleanups 2000-11-22 21:52:53 +00:00
Sascha Schumann e937eeb2e5 Run through conv_z_macros 2000-11-22 21:47:15 +00:00
Sascha Schumann 2f6fe425a4 There is no Apache extension per se. Please leave this directory empty.
I'll remove it from the repository in one week.
2000-11-22 21:43:52 +00:00
Sascha Schumann 781cf450f8 Run through conv_z_macros 2000-11-22 21:40:15 +00:00
Sascha Schumann 2c95d6268c Add ircg 2000-11-22 20:46:40 +00:00
Zeev Suraski c476bce2f1 At long last, import the bcmath library, by Phil Nelson 2000-11-22 20:20:02 +00:00
Andi Gutmans be6ab20415 - Remove code which has been commented out for ages. 2000-11-22 19:53:17 +00:00
Stanislav Malyshev b36afe2957 Fix memory leaks in cURL.
cURL doesn't free strings we pass to him, so let PHP do it.
2000-11-22 15:46:13 +00:00
Dan Kalowsky e7aff0b676 @ Put an end to BUG#4615 (kalowsky & Eric Veldhuyzen)
This should remove the BUG#4615, thanks to Eric Veldhuyzen
(eric@terra.telemediair.nl) for the assistance on this (aka elegence vs
my hack).

This does not fix BUG#7922 though, which is currently being looked into
2000-11-22 15:31:04 +00:00
Sterling Hughes a56c9f8e68 Hmmm, that wasn't good. 2000-11-22 15:19:59 +00:00
Daniel Beulshausen 2fefaba7b6 tsrm realpath implementation is fixed
@ Fixed realpath() in Virtual Directory mode (Daniel)
2000-11-22 10:08:25 +00:00
Andi Gutmans afccae85d9 - Thanks to "Daniel Beulshausen" <daniel@php4win.de> 2000-11-22 04:59:32 +00:00
Sascha Schumann 2ef6b689e8 Pass on the exit status 2000-11-22 04:24:35 +00:00
Sascha Schumann 6c1af20310 Set the exit status from the return value of php_execute_script() 2000-11-22 04:24:04 +00:00
Sascha Schumann 0222f92358 Return the exit status from php_execute_script() 2000-11-22 04:23:26 +00:00
Sascha Schumann 939b72c771 removing '{' was certainly not intended 2000-11-22 04:16:25 +00:00
Sascha Schumann 886fbabb0b Don't access opt, if opt was not set. 2000-11-22 04:15:27 +00:00
Sascha Schumann 5347ef1728 Whitespace fix and initialize ret properly 2000-11-22 04:10:04 +00:00
efa026c86b ChangeLog update 2000-11-22 02:09:10 +00:00
231d1a12d1 NEWS update 2000-11-22 02:09:07 +00:00
Hartmut Holzgraefe 0b981df1b2 some more info on the ctype extension 2000-11-22 01:35:58 +00:00
Hartmut Holzgraefe 9d468a33c4 an experimental extension providing the C ctype function family 2000-11-22 01:00:44 +00:00
Zeev Suraski f8dabac6d5 Fix build 2000-11-21 22:41:49 +00:00
Andi Gutmans 12077112b4 - The baby patch wasn't that innocent :) 2000-11-21 16:14:02 +00:00
Andrei Zmievski 9ca1038535 Sterling's patch to make get_defined_vars() simpler and better. 2000-11-21 15:29:02 +00:00
Sterling Hughes 0a1f0ea22e Major rework of the basic api which provides:
- All Sablotron errors are now caught meaning nothing is
          ever outputted directly to the screen allowing you to
          catch all errors.
        - A mechanism is provided for you to have an error function
          which recieves all sablotron errors.
        - All of the basic functions re-use a single processor increasing
          performance (especially with high loads).
        - Added a bunch of comments, more to come (this way other people
          can easily modify my source).

@ Added the xslt_set_error_handler() function to the Sablotron extension.
@ (Sterling)

@ Improved Sablotron's error handling system allowing you to catch all
@ errors before they are outputted to the screen. (Sterling)
2000-11-21 12:12:19 +00:00
foobar 358731195f Fix bug #7034 2000-11-21 11:07:50 +00:00
Hartmut Holzgraefe f5bf3c10fd make HAVE_FOPENCOOKIE available for other extensions besides zlib 2000-11-21 08:38:20 +00:00
Hartmut Holzgraefe cea34b9dbe added .cvsignore files for tests directories 2000-11-21 08:00:21 +00:00
Daniel Beulshausen fda42b034f fix PDF image open under Win32 2000-11-21 07:08:01 +00:00
Frank M. Kromann 67f66b32c0 Adding php.ini value to set default batch size for mssql extension 2000-11-21 03:11:33 +00:00
Frank M. Kromann 649c59b731 Adding new functions, mssql_affected_rows and mssql_fetch_batch.
Added optional paramter to mssql_query, batchsize used minimize the memery usage during select of large datasats.
2000-11-21 03:09:16 +00:00
7743f5a59d ChangeLog update 2000-11-21 02:09:15 +00:00
Hartmut Holzgraefe 4a8d9df816 # a minor change, but still important :) 2000-11-21 00:43:25 +00:00
Hartmut Holzgraefe cedb39ee56 all the _GNU_SOURCE dependant stuff is now in zlib_fopen_wrapper.c
so all the #define/#include workarounds in zlib.c are no longer needed
2000-11-21 00:40:13 +00:00
Frank M. Kromann ee23c53108 Adding credits.c to project to allow compilation. 2000-11-20 22:32:02 +00:00
Frank M. Kromann 19555e57a8 removing compiler warning by including credits.h 2000-11-20 22:31:38 +00:00
Hartmut Holzgraefe 67bb9d1ae2 fixed a compile problem with glibc<=2.1.1 (#7327, #7892)
# zlib.c still produces a warning, perhaps i should move
# the fopen wrapper to a seperate file to get things right
# but i think i will wait for the autoconf book to arrive
2000-11-20 21:36:38 +00:00
Andi Gutmans b2c957d4b1 - NEVER copy and paste :) 2000-11-20 20:54:10 +00:00
Andi Gutmans b5d5b3a703 - Baby patch towards making the damn pass-by-ref work. 2000-11-20 20:49:42 +00:00
foobar dc70b6172b Fixed typo. #6933 2000-11-20 17:32:46 +00:00
Sterling Hughes b853cd5dc8 Revert. 2000-11-20 17:27:50 +00:00
Zeev Suraski d161e9d1c1 Update API number 2000-11-20 12:59:56 +00:00
Stanislav Malyshev 119ee485c6 Move "replace value" logic to Zend 2000-11-20 12:39:14 +00:00
Stanislav Malyshev 35f4826fea Add macro to replace value of zval with another value while preserving
referencing structure
2000-11-20 12:35:08 +00:00
Hartmut Holzgraefe 1f6878e912 2nd step towards auto-credits 2000-11-20 10:33:33 +00:00
Hartmut Holzgraefe df81663614 first step towards auto-generated credits 2000-11-20 10:05:57 +00:00
Andi Gutmans 6d2a433ec5 - This patch is broken and needs more thorough fixing. 2000-11-20 05:09:21 +00:00
620cda3987 ChangeLog update 2000-11-20 02:09:08 +00:00
Andi Gutmans ce87ae4159 - Try and fix the problem when sending references returned from a function by reference. 2000-11-19 19:49:58 +00:00
Hartmut Holzgraefe c8a56ea11d typo fix (copy/paste bug?) 2000-11-19 19:18:12 +00:00
Sterling Hughes 3b1a3a3f8c *** empty log message *** 2000-11-19 16:54:54 +00:00
Sterling Hughes 3c8cc8ab36 *** empty log message *** 2000-11-19 13:51:48 +00:00
Stanislav Malyshev 92dd81ba7f Fix #3261 - variables declared as "global" in function do not get the right
value after session_start.
2000-11-19 13:13:36 +00:00
Zeev Suraski 769cde2f9f Fix Zend build for non ZTS 2000-11-19 12:28:28 +00:00
David Hedbor 49014ed560 Patch to find module dir 2000-11-19 09:10:16 +00:00
Chuck Hagenbuch 965bb6d211 include checks for cal_misc.h and icalroutines.h 2000-11-19 02:42:06 +00:00
1cf5973ab4 ChangeLog update 2000-11-19 02:09:08 +00:00
Adam Dickmeiss 0ee7fbe41a Added .cvsignore file. 2000-11-18 18:56:47 +00:00
James Moore 2116cfedf3 Stopping Compile Warnings when using old GD 2000-11-18 18:09:42 +00:00
Zeev Suraski 82952f8830 Persist these numbers so that they stay for the duration of the entire process 2000-11-18 12:48:31 +00:00
Zeev Suraski 42b0e1cb1f Forgot to commit the non-debug build fix yesterday... 2000-11-18 11:43:08 +00:00
Zeev Suraski 66c667c974 Fix thread-safety bug in bcmath 2000-11-18 02:59:31 +00:00
Zeev Suraski 030b707296 Update SAPI modules to interface with the new TSRM.
Enable thread-safety memory debugging in ISAPI when in debug mode
2000-11-18 02:44:04 +00:00
Zeev Suraski 9a0b61a619 Add thread-safety debugging information (idea - Dmitri Dmitrienko) 2000-11-18 02:43:23 +00:00
Zeev Suraski 1ebdb6fa14 Beef up debugging support 2000-11-18 02:41:14 +00:00
5b59b51e50 ChangeLog update 2000-11-18 02:09:11 +00:00
3c48053ca8 NEWS update 2000-11-18 02:09:08 +00:00
Zeev Suraski d5a09981d6 Import debug-level improvements to TSRM, by Dmitri Dmitrienko 2000-11-17 23:31:15 +00:00
Stig Venaas 5739ee8799 Added openssl extension info 2000-11-17 19:57:19 +00:00
Stig Venaas b81828864f Added optional passphrase argument to openssl_get_privatekey()
@- Added OpenSSL extension (Stig Venaas)
2000-11-17 19:49:13 +00:00
Stig Venaas 8b500cdcdf Renamed openssl_read_privatekey openssl_get_privatekey, and some minor
fixes including init and shutdown functions
2000-11-17 19:17:07 +00:00
Sascha Schumann 5767ab3f75 Reset the state, if there is garbage in an HTML tag.
PR: #7854
2000-11-17 16:27:37 +00:00
Chuck Hagenbuch eb437a5870 close bug 7851 2000-11-17 16:10:43 +00:00
Sascha Schumann 66d8f798ad PHP does not care about inline at all, so get rid of this block. 2000-11-17 16:02:08 +00:00
Dan Kalowsky b52648efd5 Missed one section that required the addition of a new HAVE_SOLID_30
This should be correct now.
2000-11-17 15:48:09 +00:00
Jason Greene ac5e01e567 Decided not to clutter NEWS file with build fix, It is big enough already. 2000-11-17 15:41:02 +00:00
Dan Kalowsky 3e2ddd1edf Corrected the spelling of verion to version, and cleaned the configuration
code up a bit.  Also added in much better (read: tested) support for
Solid 3.0.   Credit for almost all of the patch goes to Eric Veldhuyzen,
minor modifications done (by me) to make it non-linux specific.

This commit also creates the HAVE_SOLID_30 define

@ Fixed/created support for Solid 3.0 databases (kalowsky)
@ Fixed support for Solid 2.3 databases (kalowsky)
2000-11-17 15:09:46 +00:00
Andrei Zmievski 7059daa7ef Fix. 2000-11-17 14:21:31 +00:00
Kirill Maximov 023a95ae1c @ quoted_printable_decode() function is made RFC-2045 compliant. (Kir)
This hopefully closes bugs #5321, #7138, #7855.
  Test script for the function is added.
2000-11-17 10:55:37 +00:00
86f0184c33 ChangeLog update 2000-11-17 02:09:12 +00:00
280461e06b NEWS update 2000-11-17 02:09:09 +00:00
Jason Greene 9f1eb35d6f Added ext/java fix line - I should learn to use '@' correctly : ) 2000-11-16 23:58:39 +00:00
Jason Greene 608ee593a4 SUN CC does not like like left side casting - see bug #6759
@Fixed ext/java so that it will compile with SUN CC
2000-11-16 22:19:48 +00:00
Thies C. Arntzen 6f79fc7d46 fix ora_fetch_into to allow_call_time_pass_reference = Off; (#7838) 2000-11-16 12:37:35 +00:00
foobar 6a81095313 extname -> openssl 2000-11-16 11:16:25 +00:00
Thies C. Arntzen 31f63bee93 don't use TLS in MINIT function. 2000-11-16 10:16:22 +00:00
ca05afa7fc ChangeLog update 2000-11-16 02:09:07 +00:00
Sascha Schumann 4bb564ad2b Clear idle_read_timer 2000-11-15 23:37:50 +00:00
Jan Borsodi d1cecd1dd2 Removed an unneccesary #warning which was used for testing purposes only. 2000-11-15 19:09:44 +00:00
Jan Borsodi 51011a6672 Initial import, PHP program for testing if the qtdom extension is available. 2000-11-15 19:02:14 +00:00
Jan Borsodi bde531da79 Initial import, since PHP cannot be compiled with a C++ compiler all C++ specific calls had to be moved to a separate file without any php includes.
It has several C functions which are used for initiating a QDomDocument and traversing it.
2000-11-15 19:01:44 +00:00
Jan Borsodi 2fea5bb19c Initial import, contains PHP specific extensions, takes care of converting C++ QDom objects to PHP objects.
This version has only one function: qdom_tree() which returns a tree of a string containing an XML document.
2000-11-15 18:59:59 +00:00
Jan Borsodi 471bcfc8c8 Autoconf configure script for qt dom, needs some more checking in the future. 2000-11-15 18:55:00 +00:00
Jan Borsodi 14350f9aef Makefile source, has a fix for compiling C++ files. 2000-11-15 18:54:05 +00:00
Jan Borsodi d0b3314c77 Initial import, ignores standard files. 2000-11-15 18:52:55 +00:00
Uwe Steinmann 8dcb3fdf3c - fixed silly bug (did check for 5 arguments but expected only 4) 2000-11-15 17:07:56 +00:00
Stanislav Malyshev fb8be26654 Fix crash (#7802) 2000-11-15 09:36:21 +00:00
Andrei Zmievski 3625a729a7 - Modified preg_replace() to take Perl-style $1 backreferences in addition
to \\n ones.
- Modified preg_grep() to always return the results with the keys
  from the original array.
2000-11-15 05:09:55 +00:00
c960bd930d ChangeLog update 2000-11-15 02:09:09 +00:00
Sascha Schumann 008d23bb5c Fix allocation 2000-11-14 20:34:14 +00:00
Stanislav Malyshev 2d57a5b2a4 Restore compatibility with old broken way 2000-11-14 18:33:58 +00:00
Stanislav Malyshev 0b6a8d0458 Better 0x handling - not change non-0x number behaviour 2000-11-14 17:54:11 +00:00
David Eriksson d4f9f83363 # added .cvsignore file 2000-11-14 17:38:06 +00:00
Stig Venaas eca0bd0f39 Changed to use Z_LVAL_PP, Z_STRVAL_PP and Z_STRLEN_PP. 2000-11-14 17:05:39 +00:00
Stanislav Malyshev 89d5983ad9 Attempt at better handling long 0x-numbers, like 0xffffffff 2000-11-14 17:02:52 +00:00
Stig Venaas 8f0d033450 Not using automake here either 2000-11-14 16:06:38 +00:00
Onn Ben-Zvi 218149da14 initial - ONn 2000-11-14 15:51:11 +00:00
Sascha Schumann c509dc6dc7 Add persistent memory handling to smart_str API 2000-11-14 15:36:18 +00:00
Sascha Schumann dba76125e4 Automake is gone. No need to ignore a non-existing file. 2000-11-14 14:32:58 +00:00
Stig Venaas d13547fa7f *** empty log message *** 2000-11-14 14:25:23 +00:00
Stig Venaas f3a17761be Made API simpler 2000-11-14 09:54:25 +00:00
5526248e53 ChangeLog update 2000-11-14 02:09:13 +00:00
60dd569a69 NEWS update 2000-11-14 02:09:10 +00:00
Daniel Beulshausen b4a6acf697 fix link object
# maybe it's too late already...
2000-11-13 22:28:58 +00:00
Daniel Beulshausen fcdf44a1a0 forgot to add... 2000-11-13 22:24:06 +00:00
Daniel Beulshausen 0c3d96c3ba make ingres compile under win32
# no cleanup...
2000-11-13 22:23:16 +00:00
Daniel Beulshausen c1e1bc07ff added dsp for openssl win32 2000-11-13 20:24:23 +00:00
Andrei Zmievski 468068705f @- Modified preg_replace() to ignore backreferences that refer to
@  non-existing subpatterns. (Andrei)
2000-11-13 19:49:41 +00:00
Stig Venaas 86b7cd0572 OpenSSL extension. So far it implements assymetric encryption functions. 2000-11-13 19:47:20 +00:00
Stig Venaas 5d7a485cd7 OpenSSL checking didn't work well, should be better now. Removed check
for include/evp.h, are there versions around that put it there? Recent
versions have it in include/openssl.
2000-11-13 19:13:41 +00:00
Zeev Suraski 6a86b6fad5 Handle unable-to-add-new-headers error nicely 2000-11-13 19:05:25 +00:00
Zeev Suraski 0f7f5c2c0e - Import Jade Nicoletti's transparent gzip encoding support as an output
handler.  Works quite nicely!
- Fix buglets in output buffering
- Add output_handler INI directive
2000-11-13 18:54:37 +00:00
Andi Gutmans 9b42296bab - Remove unused function 2000-11-13 18:14:16 +00:00
Thies C. Arntzen db65d0e076 @- Fixed column-title buffer-overflow in OCIFetchStatement(). (Thies)
fix #7784
2000-11-13 17:30:52 +00:00
Andi Gutmans 4004ef6f25 - Use typedef's for function pointers so that we can easily define arrays
- of these function pointers.
2000-11-13 17:30:42 +00:00
Onn Ben-Zvi 34b0b1fc11 initial - ONn 2000-11-13 16:01:05 +00:00
Stanislav Malyshev 124569d167 Fix zend_llist_apply_with_del - it should remove from list,
not only call dtor
2000-11-13 14:55:28 +00:00
Sascha Schumann 39f8c9807e Update patch and add persistent connection handling 2000-11-13 13:33:12 +00:00
Uwe Steinmann eea750ebc8 - fixed serveral prototypes
- replaced C++ style comments
2000-11-13 13:27:19 +00:00
Sascha Schumann 3fbfbf1f45 Add thttpd-dependent interface for maintaining persistent connections on
an iterative web-server. This will be used by the IRCG extension.
2000-11-13 13:23:56 +00:00
Sascha Schumann 04f180b08a More verbose error message for non-working apxs case 2000-11-13 12:43:44 +00:00
Sascha Schumann 8658cace16 Add note about serialized requests and their impact 2000-11-13 12:39:15 +00:00
1f6edfc779 ChangeLog update 2000-11-13 02:09:10 +00:00
foobar dd83069fff Fixed bug: #7768. Some cleaning up too. 2000-11-13 02:02:40 +00:00
Kristian Köhntopp 89d6b5b5bd Prototype corrected. 2000-11-12 22:13:35 +00:00
Sascha Schumann 6a149caaed Fix aborted connection handling and stop modifying thttpd data 2000-11-12 21:10:09 +00:00
Zeev Suraski 20ab5c58c7 Test, ignore 2000-11-12 17:21:14 +00:00
Sascha Schumann 2325a41346 PHP_FDFTK is always != no. $PHP_FDFTK is not. 2000-11-12 12:01:05 +00:00
Rui Hirokawa 71e53f2a5f enabled shared module. 2000-11-12 05:59:34 +00:00
a2774081c9 ChangeLog update 2000-11-12 02:09:07 +00:00
foobar 40462d1d02 Fix for #7758. Plus some cleaning. 2000-11-11 19:27:46 +00:00
Sascha Schumann 4d6ecaf26b Add Apache 2.0 sapi module and sort alphabetically. 2000-11-11 18:38:26 +00:00
Sascha Schumann 86b8e890dc strdup private AOLserver data before inserting it into SAPI's request_info. 2000-11-11 18:35:15 +00:00
Sascha Schumann 802d716c0d Update README
Make Apache-related functions build

Add get_all_headers()

Fix segfault when SAPI outputs strings of length 0

Move request ctor/dtor into their own functions
2000-11-11 18:24:27 +00:00
Andi Gutmans 1ccf94066c - Move SET_UNUSED() to header 2000-11-11 17:59:47 +00:00
Andi Gutmans 86a13dd94e - Beautify by using the standard #define. 2000-11-11 17:41:28 +00:00
Chuck Hagenbuch b69dd89d34 RFC822 does specify two digit years, but practically every decent mail
client I could check is using 4-digit years these days.
2000-11-11 17:28:20 +00:00
Hartmut Holzgraefe 38569740da fix for #7756 and #6743 : fatal error on 'include("")' instead of warning
(+ some cleanup)
2000-11-11 10:15:59 +00:00
56d673217c ChangeLog update 2000-11-11 02:09:07 +00:00
Ben Mansell 4d48df3339 Further updates to README.Zeus
# Using LD_RUN_PATH to let the libphp4.so library find other libraries.
# Surely there should be a better way, using -rpath? However, libtool
# seems to swallow any extra -rpath options given to the compiler.
2000-11-10 16:14:00 +00:00
Andi Gutmans 5e33cdaef3 - Remove this damn thing once again. 2000-11-10 11:48:12 +00:00
Uwe Steinmann 52aba68aa2 - new function set_content() which is a workaround for bug #6457 2000-11-10 11:40:03 +00:00
Uwe Steinmann 7534b9857a - Note about improved domxml 2000-11-10 10:37:43 +00:00
Uwe Steinmann 7c8f9371e5 - add testing for xpath 2000-11-10 10:28:30 +00:00
Uwe Steinmann 0bbb1906bd - Fixed many problems to make xpath working
- Each function now expects an object and not a resource anymore
  I hope this makes it more straightforward for the PHP-Programmer
2000-11-10 10:27:57 +00:00
Andi Gutmans 25db8b1882 - Some more 2000-11-10 08:15:44 +00:00
Andi Gutmans 86ac33e638 - Add files to .cvsignore thanks to Jon Parise 2000-11-10 08:15:00 +00:00
Uwe Steinmann b98f580143 - Fixed several error including segm fault (but still one left :-( 2000-11-10 06:09:41 +00:00
3374176643 ChangeLog update 2000-11-10 02:09:15 +00:00
Andi Gutmans f950a3724c - Maybe it's OK now? :) 2000-11-09 23:54:18 +00:00
Andi Gutmans 113a5bb8c2 - Undo the previous commit for fixing $obj = new foo(). 2000-11-09 23:43:21 +00:00
Andi Gutmans d9d4824cd3 - Commit experimental patch to fix the problem when doing $a = new foo()
and the constructor assigns $this by reference to other symbol table
  elements. Thanks to Daniel J. Rodriguez on this one.
2000-11-09 22:11:14 +00:00
Colin Viebrock ecaf64a362 oops, forgot to document it :) 2000-11-09 21:33:16 +00:00
Colin Viebrock 2a5f8a8906 some changes, and added 'r' flag which generates an RFC822 compatible date string. 2000-11-09 21:30:03 +00:00
Danny Heijl a46f36a564 - fix crash when using blob_in_file mode (danny). 2000-11-09 19:34:31 +00:00
Uwe Steinmann eaad937f84 - Some more comments
- Initial support to just include anchors into documents
2000-11-09 13:36:54 +00:00
Uwe Steinmann d82bade81c - Started support for XPath/XPtr (completely untested) 2000-11-09 08:42:20 +00:00
foobar ffc95d6125 Beutifying the output of configure a bit.
# I promise, this is the last commit for today. =)
2000-11-09 02:59:17 +00:00
foobar 781816998c Remove duplicate check for xpm support. 2000-11-09 02:31:56 +00:00
foobar 368054d223 Fix to get jpeg/xpm support everytime. 2000-11-09 02:29:15 +00:00
foobar 1f71f1f3c0 Remove duplicates (when curl-7.4.1 is used). 2000-11-09 02:11:45 +00:00
7eb6e8d551 ChangeLog update 2000-11-09 02:09:34 +00:00
foobar 443d289380 Fixed bug: #5460 2000-11-09 00:16:28 +00:00
Marc Pohl 4eece9b1bd add gzdeflate() and gzinflate() for handling of pure gzip-datastreams 2000-11-08 21:40:34 +00:00
Mathieu Kooiman 3e2fa2781a E_WARNING into E_ERROR, Last commit (today)! I PROMISE! :-) 2000-11-08 18:41:22 +00:00
Nikos Mavroyanopoulos f6a8f905b1 Added license 2000-11-08 16:16:49 +00:00
Mathieu Kooiman 63cdbbd56e Alert user if they're trying to use
ImageCreateFromString() with GD < 1.5..
Sorry, should've added this last commit.
2000-11-08 16:08:42 +00:00
Mathieu Kooiman 5e7041615a - Made gd extension build when using gd version < 1.5 2000-11-08 14:56:09 +00:00
Zeev Suraski 41d83c5d95 Add ability to find extensions by name 2000-11-08 14:25:42 +00:00
Zeev Suraski 905e41af5c Will work on a more thorough implementation for mysql_store_result() after 4.0.4 2000-11-08 08:27:27 +00:00
foobar 1afebc69c7 Make this compile with libxml2.2.7. 2000-11-08 02:17:36 +00:00
e4c95b17e6 ChangeLog update 2000-11-08 02:09:14 +00:00
64ef92eafb NEWS update 2000-11-08 02:09:11 +00:00
foobar 95eceee413 Cleaned up a bit. 2000-11-08 01:53:51 +00:00
foobar 3f85e944ab config.m4 2000-11-08 00:18:49 +00:00
Zeev Suraski c824ee09a0 Forgot to commit it... 2000-11-07 21:32:41 +00:00
Daniel Beulshausen 87d8e44c26 win32 sapi symbol export fixes 2000-11-07 21:13:26 +00:00
Zeev Suraski 9e40204f00 @- In CGI mode, $HTTP_SERVER_VARS now includes all of the environment variables
@  as well (Zeev)
2000-11-07 18:25:29 +00:00
Zeev Suraski 50e0d9d34b cookie_data may also be modified... 2000-11-07 18:12:06 +00:00
Stanislav Malyshev ef8fb2767b Enable to use mysql_use_result in query functions.
You may need this if you use real big queries.
@- Allow user to use mysql_use_result in mysql queries (Stas)
2000-11-07 15:46:15 +00:00
Stanislav Malyshev c9e39592b5 Andi says it should be zval_ptr_dtor 2000-11-07 15:06:43 +00:00
4be1fa5ea1 ChangeLog update 2000-11-07 02:09:17 +00:00
407ac966f8 NEWS update 2000-11-07 02:09:08 +00:00
Sascha Schumann 5360d78278 Kill a misleading warning which is intended for old code
which assumes sizeof(int) == sizeof(void *).
2000-11-06 23:40:48 +00:00
Sascha Schumann ae6314468f Use socklen_t for getsockopt 2000-11-06 23:38:15 +00:00
Sascha Schumann 79fd4ad841 zend_hash_find() treats this argument as const, but fails to declare
the function properly.
2000-11-06 23:36:15 +00:00
Sascha Schumann c5e776ec2d sizeof(size_t) != sizeof(int) on 64-bit platforms.
This also makes the API more consistent.
2000-11-06 23:35:33 +00:00
Derick Rethans e2bb93c575 - Added myself to the credits... 2000-11-06 22:53:11 +00:00
Chuck Hagenbuch 65150b8512 add a Crypt_HCEMD5 class. This implements the same algorithm as the perl
Crypt::HCE_MD5 package, and should be cross-compatible with it. It provides
a secret-key based encryption algorithm possibly suitable for those who
don't have mcrypt enabled.
2000-11-06 22:33:09 +00:00
David Hedbor 6f0014982d Noted that setting of multiple headers with the same name is fixed. 2000-11-06 22:12:11 +00:00
David Hedbor 61f2088846 (php_caudium_set_header): Allow for multiple headers with the same name. 2000-11-06 22:11:10 +00:00
David Hedbor 44ecf58519 (ImageCreateFromString) Added forgotten GDLS_FETCH() needed for ZTS. 2000-11-06 22:00:07 +00:00
Andrei Zmievski 65f37060db Fix bug #7667. 2000-11-06 19:41:30 +00:00
Stanislav Malyshev cde5c779dc And now the right fix - should add it still 2000-11-06 18:19:05 +00:00
Stanislav Malyshev 7f1dc85574 Serialize as reference only if it's a true reference 2000-11-06 18:09:51 +00:00
Zeev Suraski efd8117fd4 Fixed a bug in $argv and $argc not being properly defined in command-line mode
@- Fixed a bug that prevented $argv and $argc from being defined in the command
@  line version of PHP (Stas)
2000-11-06 09:55:53 +00:00
Stanislav Malyshev 24035faa29 I guess SG(request_info).argv0 and not !SG(request_info).argv0 was an intent, otherwise it doesn't make much sense. 2000-11-06 09:31:48 +00:00
Stanislav Malyshev dec089e39c Add support to ukrainian characters (by serhiy@society.kiev.ua) 2000-11-06 08:46:12 +00:00
Sebastian Bergmann c5ff85c8bc Fixed windows build. 2000-11-06 06:31:00 +00:00
248b5a32be ChangeLog update 2000-11-06 02:09:10 +00:00
2906e61a06 NEWS update 2000-11-06 02:09:07 +00:00
Sascha Schumann e7a632e950 Add apache_sub_req() 2000-11-06 01:46:28 +00:00
Rasmus Lerdorf 16ca32d057 Make sure these are initialized to NULL 2000-11-06 01:07:53 +00:00
John Donagher ee7821ea7d Bring phpcredits() up to date 2000-11-05 23:34:49 +00:00
Rasmus Lerdorf 5a58b723ec Remove apache2 sapi module in favour of Sascha's apach2filter 2000-11-05 17:41:03 +00:00
Rasmus Lerdorf 1f3273481e We need a space after 'dnl' to comment stuff out. Why not just delete
this stuff now?
2000-11-05 17:31:17 +00:00
Rasmus Lerdorf ed218bb6b4 dnldnl won't work 2000-11-05 17:29:04 +00:00
Sterling Hughes ea9ac669da Fix the other part... 2000-11-05 17:22:05 +00:00
Sterling Hughes f25ccb0a83 This should fix the garbage. 2000-11-05 17:14:16 +00:00
Stanislav Malyshev 41a2b59977 Fix crash from #7577 (torben@php.net) 2000-11-05 16:25:26 +00:00
Sascha Schumann a6a792ecdd Outcomment everything. Since this is an exact duplicate of apache/config.m4,
it might cause conflicts.
2000-11-05 15:59:58 +00:00
Sascha Schumann d381e0702c PHP_EXTENSION_DIR is defined in build-defs.h 2000-11-05 15:10:47 +00:00
Zeev Suraski 1f9ee4857b Fix the problem Sascha reported, about extension_dir
@- Fixed a bug that prevented a changed compile-time extension_dir from
@  affecting modules that were loaded via php.ini (Zeev)
2000-11-05 15:03:41 +00:00
29086bc027 ChangeLog update 2000-11-05 02:09:09 +00:00
Mathieu Kooiman d6e7b4fefa - ImageCreateFromString(): Fixed segfault that occured if an image was tried to be
generate while there was no support for such an image type.
2000-11-04 20:43:53 +00:00
Andi Gutmans e314da896f - Fix build 2000-11-04 17:15:00 +00:00
Thies C. Arntzen b80e71fdac fix #7573
closedir() now really close the directory - used to stay open 'cause the
default-directory resource was "remembered" for arg-less calls.
2000-11-04 14:58:50 +00:00
Zeev Suraski 47654fd021 Now make it work too (thanks for noticing that Andi :) 2000-11-04 10:45:31 +00:00
Zeev Suraski ffde875f70 Fix build 2000-11-04 10:36:13 +00:00
foobar 303fe604e9 Forgot to add one note. Plus some beutifying. 2000-11-04 06:25:13 +00:00
Rasmus Lerdorf c5a87b4fa3 Should be ok to use CC here 2000-11-04 02:42:10 +00:00
41c361dcbc ChangeLog update 2000-11-04 02:09:12 +00:00
f70f0909b6 NEWS update 2000-11-04 02:09:09 +00:00
Jesus M. Castagnetto cc73072804 Updated proto for highlight_file/highlight_string 2000-11-04 01:18:10 +00:00
foobar 6f398a247d Fixed incorrect logic. And NSLDAP does not have LDAP_OPT_MATCHED_DN. 2000-11-03 22:53:49 +00:00
foobar 1f00cff3ab Fixed ftp_mkdir(). It return the dirname passed to it in case of
braindead ftp server which doesn't put the real path into reply.
PR: 7216
2000-11-03 21:53:24 +00:00
Derick Rethans 848d353880 - Fixed gd by adding a define 2000-11-03 20:44:04 +00:00
Derick Rethans 0d04945bfa - Fixing Mathieu's indentation problems
# It does not build, undefined references to getmbi and skipheader
2000-11-03 20:31:36 +00:00
Joey Smith 90f2f64ca8 Include header file for phpi_get_le_gd() 2000-11-03 20:13:46 +00:00
Joey Smith 8e9967be00 Include header file for php_file_le_fopen() 2000-11-03 20:11:38 +00:00
Mathieu Kooiman f391eb7423 - Introduced ImageCreateFromString() function,
works for GIF/JPEG/PNG and WBMP ..
  (Note: This built with the latest snapshot I grabbed
   tonight; Derick seemed to have trouble though..)
@-Introduced ImageCreateFromString(), creates an image
@ stream out of eg a MySQL blob. (Mathieu)
2000-11-03 19:53:42 +00:00
foobar 3e8ac5d7f8 Fix build.
# next time: CHECK that things WORK before committing..
2000-11-03 16:30:55 +00:00
Sascha Schumann 0feb2a21e5 Add some additional checks
Submitted by: mookid@sigent.ru (Mikhail Zabaluev)
2000-11-03 12:00:49 +00:00
Sascha Schumann b4ce4e2634 Fix implementation of hash algorithm 2000-11-03 11:59:41 +00:00
Daniel Beulshausen c0904e1c9e install instructions for more webservers 2000-11-03 11:43:45 +00:00
Daniel Beulshausen 5e48df787a use argv[1] if it's given, thanks to Bob Denny <rdenny@dc3.com> 2000-11-03 09:55:54 +00:00
Ben Mansell b00ef1eb50 Added extra help with library issues, and some performance tuning tips 2000-11-03 09:49:25 +00:00
Andi Gutmans 1f03630846 - Add trailing \n? 2000-11-03 08:39:39 +00:00
Stig Venaas a5c75761c2 Fixed memory leak in array_diff and array_intersect, was introduced with
last change.
2000-11-03 07:20:35 +00:00
Zeev Suraski 6d0749a95b Fix msql_close(), pg_close() and sybase_close() (Sybase CT) 2000-11-03 02:46:49 +00:00
Zeev Suraski 313a459af3 Fix for bug #5571 (by mookid@sigent.ru) 2000-11-03 02:45:55 +00:00
8da331e6ab ChangeLog update 2000-11-03 02:09:09 +00:00
foobar 8ea486c58f fix configure.. 2000-11-03 01:56:58 +00:00
Zeev Suraski b20f8b39b9 Fixed mysql_close() - A bit more complicated than I originally thought 2000-11-03 01:56:47 +00:00
Sterling Hughes 76accf4806 Changed as per discussion with Sablotron folks.
@ Changed the sablot configuration file so that if you use any version of
@ Sablotron below 0.44 you must use Sablotron's built-in Expat libraries.
@ (Sterling)
2000-11-03 01:10:11 +00:00
Andi Gutmans 715ce15a6f *** empty log message *** 2000-11-03 00:57:05 +00:00
Zeev Suraski a43cd1438e Fix msql_close() 2000-11-03 00:52:54 +00:00
Andi Gutmans a3a0fe3797 - Fix dependency. 2000-11-03 00:52:20 +00:00
Zeev Suraski e560ecfa47 Fix pg_close() 2000-11-03 00:51:53 +00:00
Andi Gutmans 139d5c102b - Make the random generator work again. This patch seems to work. 2000-11-03 00:45:24 +00:00
Zeev Suraski 6451d58455 Fix mysql_close() 2000-11-03 00:41:29 +00:00
Zeev Suraski 471d070c94 Fix build 2000-11-03 00:38:33 +00:00
Zeev Suraski 4d3fc68f11 Add RESVAL macros 2000-11-03 00:35:12 +00:00
David Hedbor 1497e148f4 Use V_CHDIR_FILE instead of doing the job of that function myself and
added a define to disable the use of threads for debugging purposes.
@Support for the Caudium webserver (http://caudium.net/) added. It's based
@on the Roxen SAPI module. Many bugs have been identified and fixed. (David)
2000-11-03 00:29:05 +00:00
Sascha Schumann 51ec089429 Setting no_cache causes Expires: to be send, which is not what we want.
Also disable ETag. It does not serve any purpose for dynamic pages.

Finally, disable keep-alive connections again, since we don't know
the content-length for sure.
2000-11-03 00:11:42 +00:00
Andi Gutmans 6da2eaf600 - When mode is specified the flag is a don't care 2000-11-02 23:30:48 +00:00
Andi Gutmans 1956fb48d2 - Missed one of the php_checkuid() places 2000-11-02 23:19:48 +00:00
Zeev Suraski 3c775e6446 Update NEWS 2000-11-02 23:18:08 +00:00
Zeev Suraski 6053f2a118 Fix bug #7599 2000-11-02 23:17:55 +00:00
Andi Gutmans d0ec3df288 - Use CHECKUID_* #define's instead of cryptic numbers in php_checkuid()
- I did not test for validity of the actual php_checkuid() calls and there
- might be mistakes in the previous code.
2000-11-02 23:08:07 +00:00
Zeev Suraski e17df3a7bc Update to reflect the changes in the parsers/scanners 2000-11-02 23:05:32 +00:00
Chuck Hagenbuch 24343cd5c0 spelling. bad chuck. 2000-11-02 21:40:38 +00:00
Chuck Hagenbuch e6b6213619 always prepend Receieved: headers to avoid generating mail that looks like
spam, and remove a silly comment from the sendmail backend.
2000-11-02 20:20:39 +00:00
David Hedbor 2986b89e1d Now correctly detects Pike 7.0 and use the alternative code. It also sends the
number of written bytes to the done callback function.
2000-11-02 20:05:24 +00:00
Zeev Suraski 464a561bb0 Missed those 2000-11-02 19:31:21 +00:00
Zeev Suraski f1a9920bcf Maintain consistency 2000-11-02 19:27:55 +00:00
David Hedbor b06998a7d1 Added Caudium to credit line. 2000-11-02 19:07:15 +00:00
David Hedbor a878709db3 Changed contact information. 2000-11-02 18:56:42 +00:00
David Hedbor 838264de75 Added notice about Caudium websites. 2000-11-02 18:54:21 +00:00
David Hedbor 8aa6f6d55c Initial caudium support. 2000-11-02 18:53:47 +00:00
Andi Gutmans ce501c78a8 - Replace do_exit() with zend_do_exit().
- Problem reported by David Hedbor <david@hedbor.org>
2000-11-02 18:42:54 +00:00
Stanislav Malyshev 1884518cf4 Revert the patch - people don't like it 2000-11-02 18:24:43 +00:00
Sascha Schumann d26cb379c8 Add note 2000-11-02 17:18:21 +00:00
Sascha Schumann 32dcafc669 . 2000-11-02 17:07:19 +00:00
Stanislav Malyshev d949733c70 Fix issue with Sun CC not detecting readdir_r
# This was once fixed in the code, but not in the configure
2000-11-02 16:50:40 +00:00
Zeev Suraski 816f1f7903 - Fixed a bug that caused PHP not to properly flush its output buffer, if more
than one output buffer was used
2000-11-02 16:46:30 +00:00
Sascha Schumann a44361a769 Update. Someone should really write better docs. =) 2000-11-02 16:15:03 +00:00
Sascha Schumann 43ff395b65 Const'ify part of sapi_request_info.
query_string, post_data, path_translated, request_uri, auth_user,
auth_password and argv0 are modified, so they cannot become const.
2000-11-02 15:47:02 +00:00
Sascha Schumann 9866d899e9 Namespace protect mergesort (caused conflict on Darwin). 2000-11-02 15:32:52 +00:00
Sascha Schumann 3ac8e25812 Namespace protect dir_cmds and kill some warnings 2000-11-02 15:19:54 +00:00
Sascha Schumann 1f53d0203c Restrict php_admin_value to *.conf files. 2000-11-02 15:01:25 +00:00
Zeev Suraski a023f9280a - Fix Windows build
- Changed the Apache .dsp to expect the Apache source code files under php_build
2000-11-02 14:53:10 +00:00
Sterling Hughes 0b25301bce Das war nicht gut. 2000-11-02 14:39:16 +00:00
Zeev Suraski e8e3be00d5 Fix a few warnings 2000-11-02 14:18:34 +00:00
Zeev Suraski 18d1ecaa5e update NEWS 2000-11-02 12:14:49 +00:00
Zeev Suraski 8c4852c2cb Fix a nasty bug in the shutdown sequence of PHP under Apache. 2000-11-02 12:05:54 +00:00
Zeev Suraski 3dd6c2d96f Remove unnecessary variables 2000-11-02 11:33:34 +00:00
Zeev Suraski 4462bc2e2d explicit declaration here too - sigh, way too early in the morning 2000-11-02 10:28:17 +00:00
Zeev Suraski 94042d6848 oops 2000-11-02 10:26:03 +00:00
Zeev Suraski c42564f780 explicit declaration 2000-11-02 10:24:34 +00:00
f9e5c33803 ChangeLog update 2000-11-02 02:09:09 +00:00
foobar 648c141cbc Validators are happy now. 2000-11-01 22:53:42 +00:00
Adam Dickmeiss f0c0ea97a8 Updated for ZTS mode. 2000-11-01 22:10:55 +00:00
Andi Gutmans 91622ad7cb - Beautify 2000-11-01 19:55:13 +00:00
Sascha Schumann d9ba87c84c Our context's lifetime differs from the lifetime of a filter's context,
so don't set the filter's context in the INIT_CTX macro.
2000-11-01 19:26:57 +00:00
Sascha Schumann 87e88d5a33 Use Input filters for handling POST data 2000-11-01 19:19:46 +00:00
Andi Gutmans 6139a2c8ce - Define the different possible modes for readibility and use in the rest
- of PHP
2000-11-01 18:05:27 +00:00
Andi Gutmans 8907e17bde - In function declerations the opening { should be on a new line 2000-11-01 17:31:53 +00:00
Andi Gutmans b25b80c147 - Change some estrdup()'s to estrndup()'s 2000-11-01 14:48:00 +00:00
Andi Gutmans 0330643ea2 - Revert patch which seems to have caused the STOP mechanism not to work.
- I'm not quite sure why this should have caused harm even if not completey
- the right way of doing it.
2000-11-01 11:23:52 +00:00
foobar 2ad7083005 No more segfaults. 2000-11-01 05:05:33 +00:00
foobar d6d3f5e9b6 Add line of possible XBM support to the phpinfo() 2000-11-01 04:38:28 +00:00
foobar dfcd4c18e6 Fixed some compile warnings and removed useless code. 2000-11-01 02:30:37 +00:00
f90f30df60 ChangeLog update 2000-11-01 02:09:22 +00:00
Zeev Suraski 0ee12a6488 Fix Apache build 2000-10-31 18:28:04 +00:00
Zeev Suraski 8aecb3c984 mode_t should be an unsigned_int 2000-10-31 18:05:28 +00:00
Zeev Suraski 7ab46420be mode_t fixes 2000-10-31 18:05:19 +00:00
Hartmut Holzgraefe 00b8b66132 generalization of image handling in phpinfo 2000-10-31 17:21:52 +00:00
Stanislav Malyshev 3bc3677439 Fix -d functionality 2000-10-31 16:16:57 +00:00
Zeev Suraski 92d37f688e - Fix phpinfo()
- Fix non-thread-safe build
2000-10-31 16:06:46 +00:00
Zeev Suraski dfe57b01a2 Remove unnecessary code, fix phpinfo() 2000-10-31 16:06:30 +00:00
Zeev Suraski 9e2a591ac6 Require bison 1.28 2000-10-31 14:54:16 +00:00
Zeev Suraski fc466bebd8 Fix memory_limit build problem 2000-10-31 12:46:07 +00:00
Hartmut Holzgraefe 604876542a removed some bogus code 2000-10-31 11:32:05 +00:00
Hartmut Holzgraefe c420d653ee support for short comments was added to ext_skel proto files
theese will be used in proto comments in the source
and as <refpurpose> information in the XML docs
2000-10-31 11:30:11 +00:00
Jesus M. Castagnetto f589a3b587 cosmetic changes (added some "proto"s missing in the function documentations) 2000-10-31 06:33:07 +00:00
dc3f6eaf29 ChangeLog update 2000-10-31 02:09:10 +00:00
1b34b0bd89 NEWS update 2000-10-31 02:09:07 +00:00
foobar 4c2abe7df4 Both RETR and STOR have also 250 as possible return value 2000-10-31 00:30:37 +00:00
foobar 55ccb5a35b Fix the fix. 2000-10-31 00:00:26 +00:00
Zeev Suraski 78194a47b7 - Complete the move to the new INI parser. (Side effect: at last, people
can finally have spaces and tabs in their extension statements...)
2000-10-30 23:39:14 +00:00
Zeev Suraski 4171da016c Fix non-thread-safe Windows build 2000-10-30 23:37:50 +00:00
Zeev Suraski 9596255da8 Final touches on the INI parser 2000-10-30 23:19:48 +00:00
Sascha Schumann ea6985a225 PATH is not optional (we print that message, because php-config isn't in the
PATH).
2000-10-30 18:27:46 +00:00
Derick Rethans 2f5f83f518 - Added the two constants mentioned in bug #6097
# I did not test it, because I don't have access to an Adabase RDBMS
2000-10-30 18:00:58 +00:00
Stanislav Malyshev fad7092ff8 Update to use reference-serializer too 2000-10-30 17:18:39 +00:00
Stanislav Malyshev c31faf0bd9 Add support for serializing references.
@- Add support for serializing references (Stas)
# WDDX and shared memory functions not covered yet
2000-10-30 17:10:06 +00:00
Stanislav Malyshev 4b5eb2cf2c Fix crash in sscanf in error handler (#7533) 2000-10-30 16:44:01 +00:00
Stanislav Malyshev 702b510dc6 Don't try to work with negative timestamps
# It returns the same day as for 0, which is wrong
2000-10-30 16:13:03 +00:00
Stanislav Malyshev 1f7a3b3b11 Remove empty temp file on failed upload 2000-10-30 15:30:27 +00:00
Stanislav Malyshev 76ede5ce5c Another attempt to make it build 2000-10-30 15:27:32 +00:00
Sascha Schumann 622e66b31f LTLIBRARY_DEPENDENCIES might depend on variables defined in config_vars.mk,
so we force inclusion of that file before we use LTLIBRARY_DEPENDENCIES
in a rule.
2000-10-30 14:29:51 +00:00
Stanislav Malyshev 7eed2e5b01 Make "H*" work 2000-10-30 12:26:26 +00:00
Stanislav Malyshev 47a84052e5 Fix build
# At least, it compiles now...
2000-10-30 12:14:37 +00:00
Sascha Schumann 4d0992bb22 Remove --with-aolserver-src directive.
AOLserver 3.1 and up install the include directory as per suggestion.
2000-10-30 11:44:18 +00:00
283531c4e4 ChangeLog update 2000-10-30 02:09:09 +00:00
1e00d43dd6 NEWS update 2000-10-30 02:09:06 +00:00
Chris Vandomelen 7e8074731b Removed INI entry for read() function, made changes to read() so it will
take 4th parameter specifying whether to use the read() wrapper or the
system read() function, and modified the wrapper() so that it worked (mostly)
properly once again.
2000-10-30 01:09:15 +00:00
Zeev Suraski f52a59062d parse_ini_file() supports a new optional 2nd argument that instructs it
to divide the directives to arrays according to the sections in which they
reside
2000-10-29 23:34:33 +00:00
Zeev Suraski 60c0835470 Move browscap code to the new modular INI parser 2000-10-29 23:10:22 +00:00
Zeev Suraski 3c06816532 Fix leaks 2000-10-29 23:10:04 +00:00
Zeev Suraski 668b3e89f5 Forgot the @... 2000-10-29 22:45:46 +00:00
Zeev Suraski 4af433d627 Use the new INI parser for parse_ini_str()
- parse_ini_str() is now thread-safe, and supported under Windows (Zeev)
2000-10-29 22:42:01 +00:00
Zeev Suraski ab3beffad7 The new INI parser is showing some signs of life 2000-10-29 22:40:01 +00:00
Zeev Suraski d0fbddcc2b Fix a corruption bug, when erroneously allowing to send non-variables by reference (several
bug-db reports seem to originate in this bug)
2000-10-29 19:16:29 +00:00
Zeev Suraski 366c16e561 Fix build 2000-10-29 18:30:00 +00:00
Zeev Suraski f3243082a3 Forgot this one 2000-10-29 18:26:21 +00:00
Zeev Suraski 6b4c369164 Generalization work 2000-10-29 18:23:51 +00:00
Sascha Schumann d39c2cf0f1 POSTs work fine 2000-10-29 17:48:13 +00:00
Sascha Schumann b07276c3e2 Add standard license 2000-10-29 17:43:23 +00:00
Stanislav Malyshev ca07586e1e Allow module to proclaim compatibility with any Zend version 2000-10-29 16:25:16 +00:00
Sascha Schumann 009e5df030 This is actually user-visible. 2000-10-29 16:19:09 +00:00
Sascha Schumann af87dfe204 Unify handling of aborted connections 2000-10-29 16:14:27 +00:00
Sascha Schumann bed7034f92 Unify aborted connection handling 2000-10-29 16:02:40 +00:00
Sascha Schumann 27a8480028 Add/unify aborted connection handling 2000-10-29 16:01:02 +00:00
Sascha Schumann 13183ed5c3 Add php_handle_aborted_connection()
Call this from your SAPI module to signal an aborted connection.
2000-10-29 16:00:42 +00:00
Sascha Schumann c38005a4f1 New directive AddRequestBodyFilters
Currently it requires this patch:

http://schumann.cx/request-body-filters
2000-10-29 15:13:23 +00:00
Zeev Suraski e04fd648a6 Some more work on the INI parser/scanner 2000-10-29 15:13:20 +00:00
Sascha Schumann f01e3fbe56 Handle user aborts 2000-10-29 15:10:49 +00:00
Zeev Suraski 9041d4eedd Initial step in rewriting the INI parsing mechanism 2000-10-29 14:56:16 +00:00
Sascha Schumann 86b2d4fefe Add Request Body filters. This is a much nicer concept than
ap_get_req_body, since it is much more flexible and does not
need to buffer everything in memory (PHP still does..).
2000-10-29 14:52:15 +00:00
Zeev Suraski 7b0d92dd18 Unify the names of these last 3 files... 2000-10-29 14:35:34 +00:00
Zeev Suraski 19dad410ec Fix Windows build 2000-10-29 11:56:42 +00:00
Zeev Suraski 1fd09132c2 Initial steps to move the INI mechanism to the Zend engine 2000-10-29 11:38:26 +00:00
Thies C. Arntzen 825457ae64 update my email. 2000-10-29 09:14:55 +00:00
Stig Bakken fc4b704fca Test descriptions showed up blank, fixed. 2000-10-29 07:19:35 +00:00
foobar e76bafd648 Check also that the file isn't empty. 2000-10-29 04:36:33 +00:00
foobar 4a895b6919 @- Fixed conflict with OpenLDAP and Oracle 8.1.x (Jani)
# PR: 4257,4698,5527,6112,6650,7195
2000-10-29 04:10:07 +00:00
a400c594ba ChangeLog update 2000-10-29 01:09:07 +00:00
foobar ac7e22d3c4 Fix for bug #7416. ldap_set|get_option() are also in NSLDAP SDKs. 2000-10-28 19:22:46 +00:00
Stig Venaas 273422f277 Moving --with-openssl to global configure, want OpenSSL for not just snmp 2000-10-28 18:26:45 +00:00
Stanislav Malyshev 06de8e78cf Allow to send secure cookies 2000-10-28 17:13:28 +00:00
Andi Gutmans b74d02dbe4 - Fix from Sascha. It fixes errorneous inclusion of bz2 2000-10-28 10:48:32 +00:00
Zeev Suraski 3dc7fc54a0 - URL-opened files now store the HTTP response header in $http_response_header
- Some layout updates
2000-10-28 01:31:56 +00:00
d77aede9a9 ChangeLog update 2000-10-28 01:09:11 +00:00
f302028e0e NEWS update 2000-10-28 01:09:08 +00:00
Sascha Schumann d943274af7 POST handler for my ubercool new Apache 2.0 function ap_get_req_body. 2000-10-27 23:02:20 +00:00
foobar b45d265c54 Fixed PR: 6730. And it is mentioned also in RFC 959 to be this way. 2000-10-27 20:53:04 +00:00
foobar 11af318a62 Fixes PR: 7245 2000-10-27 20:47:36 +00:00
Frank M. Kromann d313ad8bf5 Making _php_math_longtobase() and _php_math_basetolong() callable from DLL and SO modules 2000-10-27 20:26:16 +00:00
Daniel Beulshausen e252d77d5f added "printer" extension, to access printers under win32 2000-10-27 19:27:21 +00:00
Sterling Hughes 70f262d0c5 New e-mail address. 2000-10-27 19:10:23 +00:00
Frank M. Kromann 02537bd2f2 Kill compiler warning. 2000-10-27 16:16:55 +00:00
Sascha Schumann ea7534a848 use puts instead of fprintf in log handler. no need for a format string. 2000-10-27 15:40:16 +00:00
Sascha Schumann 56ccd8701d Some information about this handler 2000-10-27 15:03:53 +00:00
Andrei Zmievski f136e5cf08 Added macros for object properties and class entry. 2000-10-27 14:13:03 +00:00
Andrei Zmievski d4cf62f86f @- Fixed array_rand() to shuffle results when the number of requested
@  elements is the same as the number of elements in the array. (Andrei)
2000-10-27 14:08:33 +00:00
Sascha Schumann b522397298 Looks like transient buckets are limited to 4096 bytes, so split up writes. 2000-10-27 13:30:41 +00:00
Sascha Schumann 93683d052b Add log message sapi handler.
Reenable pipelining requests. Looks like the problems are caused by the
cache, not pipelining.
2000-10-27 13:19:23 +00:00
Sascha Schumann 50500e680b Apache 2.0 does some funky internal caching which works for static
content, but fails miserably in our context.
2000-10-27 12:52:38 +00:00
Sascha Schumann 4f97ff0096 speling 2000-10-27 12:37:05 +00:00
Hartmut Holzgraefe 6b435870de type fixes to make compilers happy 2000-10-27 10:48:07 +00:00
Sascha Schumann 703a0c1159 Add some comments 2000-10-27 10:41:24 +00:00
Sascha Schumann 6ff371d9f7 Leave initializing of auth_(user|password) to php_handle_auth_data(). 2000-10-27 10:31:10 +00:00
Sascha Schumann 3b02d88b8e Initialize auth_(user|password) to NULL, if data was not suitable. 2000-10-27 10:28:57 +00:00
Sam Ruby 33c8f50534 Allow strings to be passed to methods expecting primitive types. 2000-10-27 10:27:19 +00:00
Sascha Schumann b725c6eef3 The CGI RFC allows servers to pass Authorization data to the script,
if the server did not use the information contained therein.

See 6.1.5 and 11.2 of the proposed spec.
2000-10-27 10:26:57 +00:00
Sascha Schumann 055efb70c3 Handle cookies and make use of php_handle_auth_data. 2000-10-27 10:19:40 +00:00
Sascha Schumann e6dd64e96e Use php_handle_auth_data 2000-10-27 10:19:06 +00:00
Sascha Schumann 85b52234e4 Utility function for sapi modules (it is not in SAPI.c, because it
relies on php_base64_encode).
2000-10-27 10:16:54 +00:00
Sascha Schumann 01b4c07747 bunch of changes 2000-10-27 09:47:28 +00:00
Sascha Schumann 9b2a1110a6 Allow users to specify whether they want to replace existing header fields. 2000-10-27 09:43:06 +00:00
Uwe Steinmann e577215736 - added four functions to do fulltext query 2000-10-27 09:29:40 +00:00
Andi Gutmans 2946f87f00 - Fix new -m on Windows 2000-10-26 23:50:17 +00:00
Mathieu Kooiman 717e934a88 Added -m (Shows list of modules) to commandline.. 2000-10-26 22:31:06 +00:00
Sascha Schumann 3a263dcd99 Handle special queries.
Apache's default handler does not seem to handle flushes correctly yet.
One more project..
2000-10-26 21:23:20 +00:00
Sascha Schumann f367b3dfc8 Move some code to php_handle_special_queries(). 2000-10-26 21:16:12 +00:00
Stig Venaas b3ab7b8948 Removed a warning in getaddrinfo check, not really needed 2000-10-26 20:39:57 +00:00
Daniel Beulshausen 6f0e47f690 it won't work otherwise
# http://support.microsoft.com/support/kb/articles/Q115/8/57.asp
2000-10-26 18:51:12 +00:00
Sascha Schumann 5583203e91 Move some initialization code from php_execute_script() to
php_request_startup() where it should be. AFAICT, it does not
cause any problems, but please it test it with your favorite SAPI
module.
2000-10-26 18:32:38 +00:00
Daniel Beulshausen 4aab269181 added dba extension for win32, currently the dsp is
only configured with db3, adding other configurations
shouldn't be hard
2000-10-26 18:29:10 +00:00
Daniel Beulshausen f610c44190 update 2000-10-26 18:23:51 +00:00
Sascha Schumann 2b060b3bf3 Add sapi_add_header_ex, which lets you specify whether you want
to add or replace a header.
2000-10-26 18:18:21 +00:00
Daniel Beulshausen 52e45f514b use V_RENAME makro instead 2000-10-26 18:17:45 +00:00
Sascha Schumann 00d1d1a347 Protect us from Apache 2.0's pcre-posix stuff 2000-10-26 18:15:56 +00:00
Sascha Schumann 39387c7781 Remove second_arg_force_ref, defined in Zend
Submitted by: Bill Stoddard
2000-10-26 18:15:18 +00:00
Sascha Schumann 2517250b35 The type has changed to size_t. 2000-10-26 18:10:57 +00:00
Sascha Schumann 4f757a3af0 Add session_adapt_url(). 2000-10-26 18:10:43 +00:00
Sascha Schumann c57830c1d2 Reinstantiate single quotes properly.
Add url_adapt_single_url() API which modifies a single URL. Might be used
to modify the Location: URL.
2000-10-26 18:05:47 +00:00
Sascha Schumann 8ef0d01baf Make the API more leaner (sp?) and get rid of *copy*. 2000-10-26 18:01:51 +00:00
Sascha Schumann 5b7ff6f72a Provide name of libtool archive.
Apache 2.0's apxs prefers that.
2000-10-26 18:00:30 +00:00
Sascha Schumann 89aa77d306 Temporary fix for mac os x stuff.
It lets me build/run a DSO on darwin, but according to Fred Sanchez, the
libtool 1.3.5 way is wrong..
2000-10-26 17:58:11 +00:00
Sascha Schumann d504de0f78 An Apache 2.0 Filter for PHP, completely from scratch.
TODO:

	POST, cookies, "flushing", finalizing config framework (it works),
	http auth, PHP Hooks (apache_sub_req is there).

Note that this code depends on some other commits which are pending.
2000-10-26 17:55:05 +00:00
Andrei Zmievski 26f5fe6375 Fix dba after resources patch. 2000-10-26 17:38:01 +00:00
Andrei Zmievski 27a1c12ad8 session_unset() now cleans up $HTTP_SESSION_VARS as well. 2000-10-26 17:37:47 +00:00
Andi Gutmans fd7284a665 - Add V_RENAME() by "Daniel Beulshausen" <daniel@php4win.de>.
- It is untested and all places which use rename() in PHP should now use
- V_RENAME().
2000-10-26 05:21:52 +00:00
Nikos Mavroyanopoulos e5b0945e4c Corrected some checks for errors. 2000-10-25 18:27:55 +00:00
Nikos Mavroyanopoulos 93232c7064 Added keygen_s2k function. Function which generates keys from passwords. 2000-10-25 18:09:23 +00:00
Andrei Zmievski f1dcb32c9f Use zend_register_list_destructors_ex() instead. 2000-10-25 17:44:02 +00:00
Andrei Zmievski 84681b9c81 Remove the patch to register_list_destructors(). 2000-10-25 17:41:34 +00:00
Andrei Zmievski a35bf41670 Added array_sum() function. 2000-10-25 17:40:11 +00:00
foobar 1026416153 gdImageWBMP has some bug in it. Using the php-internal one works. 2000-10-25 17:35:29 +00:00
Chuck Hagenbuch 383a5e7d49 Install the new Mail classes. 2000-10-25 17:23:34 +00:00
Chuck Hagenbuch 167c0a0277 add Mail:: interface and supporting classes. 2000-10-25 17:16:08 +00:00
Sascha Schumann 2d7860edc7 __USE_GNU shall not be defined by application 2000-10-23 14:04:54 +00:00
Daniel Beulshausen 6911ee5b99 it's n.a. on win32 :) 2000-10-23 13:56:22 +00:00
Stanislav Malyshev 48e5d3189f Make zlib compile again 2000-10-23 13:19:07 +00:00
Andrei Zmievski e91a524490 Cleaned up. 2000-10-23 13:15:48 +00:00
Alexander Feldman 7c11cfaf03 Fixed a bug in session.c. If the user calls session_module_name with a
parameter, then the mod_data pointer is initialized to NULL and then
php_session_save_current_state did not check this value before referencing
the pointer. Added a check in php_session_save_current_state.
2000-10-23 13:10:01 +00:00
Hartmut Holzgraefe 86c0d81253 have you ever tried to run the regression tests with error_reporting=E_ALL ?
now it will run smoothly without all theese 'undefined ...' warnings
2000-10-23 07:40:05 +00:00
Hartmut Holzgraefe b17451635d added a regression test skeleton file
plus a partintro in xml documentation template
2000-10-23 07:31:31 +00:00
Andrei Zmievski fa8452bbb2 Fix bug #7397 2000-10-23 02:01:19 +00:00
4fa1a4b468 ChangeLog update 2000-10-23 01:09:12 +00:00
def5cb5332 NEWS update 2000-10-23 01:09:09 +00:00
Rasmus Lerdorf bccdaff6d1 Move server_filter to an extension-specific global 2000-10-23 00:52:11 +00:00
Frank M. Kromann 1bf216ca57 Adding textlimit and textsize parameters to MSSQL sections 2000-10-23 00:45:23 +00:00
Chris Vandomelen 0e705a5f60 Added new INI entries to default php.ini files. 2000-10-22 23:49:57 +00:00
Chris Vandomelen b57f9eb541 Added ini entry for choosing whether to use the read() wrapper or directly
calling the read() system call.
# Some people were commenting about "oddities" in the wrapper that I hadn't
# noticed before, though I've used it in many places before now..
2000-10-22 23:43:48 +00:00
Frank M. Kromann dbdfbd9e0c Adding iisfunc to modules workspace 2000-10-22 23:15:28 +00:00
Rasmus Lerdorf 32b10882e5 Need a global server filter for the Apache 2.0 module 2000-10-22 19:50:05 +00:00
Thies C. Arntzen 248d8527fd @- OCIBindByName() now does better parameter-checking. (Thies) 2000-10-22 19:33:59 +00:00
foobar 7ef3e414e2 Makes curl extension compile again plus some typo fixes. 2000-10-22 17:29:33 +00:00
Rasmus Lerdorf 3c92f6bb50 Output function now passes the data onto the next filter in the chain
Clean up some variables - bb = bucket brigade, b = bucket
2000-10-22 16:56:08 +00:00
Rasmus Lerdorf 8f494c2ad0 Code to flatten Apache 2.0 bucket brigades 2000-10-22 16:03:53 +00:00
Sascha Schumann 61cf1f34a5 We don't need to store NUL of the key which simplifies the lookup
significantly.
2000-10-22 14:42:55 +00:00
Sascha Schumann f69a4a431a Fix php://* being handled by the ftp handler 2000-10-22 14:41:02 +00:00
Rasmus Lerdorf 69d704622d Woops, get rid of some crap 2000-10-22 14:05:29 +00:00
Rasmus Lerdorf 02f599ead5 The start of an Apache 2.0 module 2000-10-22 14:01:18 +00:00
Daniel Beulshausen 667e96f2c8 added reg. files for the pws, thanks to phil 2000-10-22 13:50:42 +00:00
Daniel Beulshausen 7883ddaf51 i'll place the reg file in the win32 folder
cause it doesn't really fit in this folder
2000-10-22 13:48:43 +00:00
Stig Venaas 5741816315 Corrected prototype comments for ldap_get_option and ldap_set_option 2000-10-22 11:25:47 +00:00
Stig Venaas e8c7fd7f5f Fixed array_type_data_compare(). I want strings to always differ from
numbers, but not say 7 and 7.0 to differ.
2000-10-22 11:18:21 +00:00
Chris Vandomelen 989d471643 Hopefully made some compile fixes for Solaris ("sun" is an already defined
symbol on Solaris.. s_un isn't...), and corrected bugs with checking for a
string by checking if Z_STRVAL_PP(ptr) == NULL instead of
Z_STRLEN_PP == 0, causing segfaults when uninitialized values were passed
into certain functions.
@- Attempted to make compile fixes for Solaris in ext/sockets/sockets.c (Chris Vandomelen)
# OK, so I have a tendency to make lots and lots of bug fixes in big spurts..
2000-10-22 07:54:49 +00:00
Chris Vandomelen 4f1a8a763a Oops, forgot to remove those .. thought I had.. 2000-10-22 06:46:43 +00:00
Chris Vandomelen 0646a49386 Corrected some bugs dealing with compile failures (should now compile
on most varieties of Linux, and should hopefully fix at least 3 of the
compile errors that were discovered). Also modified read() slightly
to take an optional parameter as to whether the data was binary or
text so it wouldn't stop reading on a newline or null byte received.
@- Made read() binary-safe in sockets.c (Chris Vandomelen)
@- Attempted fixing some compile failures (Chris Vandomelen)
# Hopefully someone will attempt to compile this on other systems, I
# have no access to other platforms to compile it on ....
2000-10-22 06:45:03 +00:00
6ac8281cf4 ChangeLog update 2000-10-22 01:09:11 +00:00
6cd1273c43 NEWS update 2000-10-22 01:09:08 +00:00
Daniel Beulshausen 1d582b8829 added missing def. 2000-10-21 21:17:31 +00:00
Andi Gutmans 4d676fe9d8 - including php.h automatically includes the PHP config file. 2000-10-21 19:18:55 +00:00
Stig Venaas 4edb210028 Made array_unique use array_type_data_compare instead of array_data_compare 2000-10-21 18:12:30 +00:00
Stig Venaas 508d1993ed Added array_type_data_compare which is like array_data_compare but
compares type first. Also rewrote array_intersect and array_diff,
so that the order is not changed.
@- Made array_intersect and array_diff not alter order (Stig Venaas)
2000-10-21 17:48:11 +00:00
Daniel Beulshausen a953b5ae4d i'm sure this should be ibase_query :) 2000-10-21 17:38:08 +00:00
Daniel Beulshausen bef776742c i can find no php_config.h on win32 :) 2000-10-21 17:19:23 +00:00
Sascha Schumann c10bf6d129 Save url_scanner_ex.c and don't require re2c to be installed on
the release/snapshot machine.
2000-10-21 17:06:05 +00:00
Daniel Beulshausen 9224f8e211 made yaz compile under windows 2000-10-21 14:18:28 +00:00
Rasmus Lerdorf d12c4de6ba Fix annoying $withval interaction in GD configure stuff 2000-10-21 12:03:52 +00:00
Rasmus Lerdorf 04f0f0b12c Gremlins? 2000-10-21 12:03:09 +00:00
Andreas Karajannis 7d3b7d7cb2 Config Patch for DBMaker 2000-10-21 11:11:11 +00:00
Daniel Beulshausen 218c2fa3ae added bz2 and removed ZendTS (not really nedded here) 2000-10-21 10:43:17 +00:00
Daniel Beulshausen 6337c12473 make libmysql compile under win 2000-10-21 10:14:09 +00:00
Sebastian Bergmann 8f280b2656 Removed files from Win32 workspace that were removed in libmysql 3.23 2000-10-21 06:55:08 +00:00
Nikos Mavroyanopoulos 84bcbe7055 more news 2000-10-21 05:41:42 +00:00
15d05bbce3 ChangeLog update 2000-10-21 01:09:11 +00:00
74ce674d27 NEWS update 2000-10-21 01:09:08 +00:00
foobar c663980808 Now checks that the library really exists even if path is specified as /usr
PR: 7358
2000-10-21 00:35:10 +00:00
Sascha Schumann 456ed7ae23 test commit 2000-10-20 23:59:42 +00:00
Sascha Schumann 836df2f798 Parse quoted boundary correctly 2000-10-20 23:40:07 +00:00
Sascha Schumann 8fe7cf26fc Add explicit format string 2000-10-20 23:39:16 +00:00
MySQL Team 625fde5090 Mention the ext/mysql/libmysql upgrade in NEWS. 2000-10-20 22:53:31 +00:00
MySQL Team a2dbb10eb1 Update libmysql to 3.23 version. No major changes visible to the user - mostly
bug fixes and other maintenance-oriented changes.
2000-10-20 22:26:48 +00:00
Nikos Mavroyanopoulos ebaf484830 updated for the new sqlcli 2000-10-20 21:01:31 +00:00
Frank M. Kromann 4682a3fe95 Fixing bug #6000
Return the full content for datetime colums

Make the same fix for smalldatetime
2000-10-20 20:58:57 +00:00
Frank M. Kromann 2c874f745d Fixing bug #6000
Return the full content for datetime colums
2000-10-20 20:49:35 +00:00
Stig Venaas 094d01148a Made ldap_connect() accept URL in host parameter when using OpenLDAP 2.x.
@- Made ldap_connect() accept URL in host parameter when using OpenLDAP
@  2.x. To use SSL, use ldaps://host/ as URL. (Stig Venaas)
2000-10-20 20:22:59 +00:00
Frank M. Kromann a2cb42039f Fixing bug in mssql_fetch_object() and mssql_close() 2000-10-20 19:55:03 +00:00
Frank M. Kromann 222d004714 Changing datatype to remove compiler warning 2000-10-20 19:10:27 +00:00
Frank M. Kromann 878e348ff9 Adding type cast to remove compiler warning 2000-10-20 19:08:59 +00:00
Andrei Zmievski dadb140e2f - Fixed a bug in zend_rsrc_list_get_rsrc_type()
- Switched register_list_destructors() to use
  zend_register_list_destructors_ex() instead
2000-10-20 18:26:15 +00:00
Andrei Zmievski 7b4983c8f8 Mega-patch to get better resource information for modules.
* Fixed a bug in zend_rsrc_list_get_rsrc_type()
  * Switched register_list_destructors() to use
    zend_register_list_destructors_ex() instead
  * Updated all relevant modules to provide the resource type name
    to register_list_destructors() call
  * Updated var_dump() to output resource type name instead of number

@- Made resource type names visible, e.g. var_dump() and
@  get_resource_type() display "file" for file resources. (Andrei)
2000-10-20 18:25:16 +00:00
Monte Ohrt a0cfab65ea Changed array_avg() to array_mean() 2000-10-20 15:53:16 +00:00
Monte Ohrt 07d781be66 added array_sum() and array_avg() to TODO list 2000-10-20 15:40:26 +00:00
Andi Gutmans 6b6b6cd940 - Should lessen confusion 2000-10-20 09:21:49 +00:00
Sterling Hughes 6b8faeb1f2 Fix CURLOPT_REFERER.
@ Added the curl_getinfo() function to find out information about a CURL
transfer.  This function requires cURL 4.0 or above. (Sterling)

@ Added the CURLOPT_KRB4, CURLOPT_INTERFACE, CURLOPT_QUOTE,
CURLOPT_POSTQUOTE, CURLOPT_QUOTE and CURLOPT_HTTPPROXYTUNNELL options.
(Sterling)
2000-10-20 04:57:14 +00:00
foobar d485e7fc29 Regenerate url_scanner_ex.c (always) without '#line' directives for
releases and snapshots. PR: 7154, 7263, 7289
# Sascha: Is this allright?
2000-10-20 01:58:00 +00:00
287fc71ee2 ChangeLog update 2000-10-20 01:09:10 +00:00
2288607fc5 NEWS update 2000-10-20 01:09:07 +00:00
Derick Rethans 6cfcf6e010 - Removed the shm_* aliases
@- Removed the shm_* aliases, only the smhop_* function wiil be
@  supported (Derick)
#I'll change the NEWS file as soon as it has been rebuild
2000-10-19 23:14:51 +00:00
Derick Rethans 2c05a539e5 - Renamed the shm_ to shmop_ and created aliases for the old shm_
functions
@- Renamed the shm_* functions to shmop_* and added aliases for the
@  old functions (Derick)
2000-10-19 22:50:41 +00:00
Sascha Schumann 1d9acd8337 Hack for #7262, not fixed yet 2000-10-19 17:40:56 +00:00
Joey Smith 78493a1b03 Use sybct for INI values. 2000-10-19 17:03:25 +00:00
Joey Smith 52fc5f0cd3 Fix compiler warnings. 2000-10-19 16:10:41 +00:00
Joey Smith dc44e06eeb Fix #7338. 2000-10-19 16:09:30 +00:00
Joey Smith a57ea792c6 Close bug #7325. Patches by djm@web.us.uu.net. 2000-10-19 15:05:44 +00:00
Sascha Schumann 57dcb93324 Remove left over ext_skel comment 2000-10-19 14:34:03 +00:00
Stig Venaas 5fc85205d9 Check that AF_INET6 is defined before using IPv6 2000-10-19 12:18:02 +00:00
Rui Hirokawa e8967fdc58 fixed a mistake. should be . 2000-10-19 12:10:59 +00:00
Andi Gutmans c13cfa040d - Constant expressions which are used multiple times need to be copy_ctored 2000-10-19 09:36:53 +00:00
Chuck Hagenbuch f9606d82fa add an optional parameter to imap_sort to specify a search program that
messages must match to be included in the sorted list.
2000-10-19 01:32:50 +00:00
ed9f9b3cd7 ChangeLog update 2000-10-19 01:09:09 +00:00
Rui Hirokawa 6eb45b5964 modified the configure scripts to make shared extension. 2000-10-18 22:17:41 +00:00
Andi Gutmans a9655b77ab - Fix whitespace 2000-10-18 20:17:18 +00:00
Andi Gutmans 928da71046 - Try #2. Wasn't allowed to delete in the previous manner because we were
in the middle of an llist_apply()
2000-10-18 20:15:53 +00:00
Sascha Schumann ffc6e72604 Add explicit conversion from 'void *', otherwise ANSI C++ compilers
will break out.
2000-10-18 19:53:43 +00:00
Andi Gutmans a953f6bc5b - Fix crash 2000-10-18 19:48:17 +00:00
Sascha Schumann 9f71179ca9 Back out circular references protection patch.
This causes problems with serializing regular variables and object
properties.

We need a smarter way to tell whether we have serialized one node
already.

PR: #7291, #7294
2000-10-18 18:32:32 +00:00
Andrew Skalski 23defd97e9 fixed logic error in the get parameters stage of mcal_list_alarms 2000-10-18 14:24:20 +00:00
foobar 7a54e0b10c Fixed crash (bus error) in readdir() and session cleanup when compiled
with Sun CC.
2000-10-18 14:14:14 +00:00
Stig Venaas 33d15279ac Removed some zval_dtor calls. There were two more than needed, and I had
just added two more...
2000-10-18 13:41:42 +00:00
Stig Venaas afdf0e759f Added some missing zval_dtor calls in php_fsockopen() 2000-10-18 13:21:08 +00:00
foobar adb12b50b5 url_rewriter.tags needs to have " around the parameter to work. 2000-10-18 12:35:53 +00:00
Stig Venaas 2da9a94d38 Added destruction of return value parameter, and using ZVAL_LONG and
ZVAL_STRING to set return value in ldap_get_option.
2000-10-18 07:47:51 +00:00
Ron Chmara d47e48329b As per andi, similar names are for legacy reasons only. 2000-10-18 07:34:56 +00:00
Nikos Mavroyanopoulos 2ecce2dc35 corrected authors notice 2000-10-18 07:25:26 +00:00
Ron Chmara aa203477bc Updated naming standards as per 9/12 dev/doc discussion. 2000-10-18 03:00:07 +00:00
f85a4a7325 ChangeLog update 2000-10-18 01:09:10 +00:00
7cb8ad4ea3 NEWS update 2000-10-18 01:09:07 +00:00
Monte Ohrt 8fbf6ca7c5 update for Date_Calc install 2000-10-17 20:41:28 +00:00
Nikos Mavroyanopoulos 5386c05cd1 Added the mhash HMAC functionality. Now the mhash function can use
keyed hash by added the key as an extra parameter to the function.
2000-10-17 19:43:49 +00:00
Andi Gutmans 610edbc7de - Fix copy&paste bug 2000-10-17 18:25:10 +00:00
Zeev Suraski 9e5ef06ceb Fix warning 2000-10-17 18:13:35 +00:00
Zeev Suraski 98bbb11780 Fix a crash in CGI mode, in case no file is provided 2000-10-17 18:12:31 +00:00
Jouni Ahto 68b899ce26 (ibase_execute) - Oops, trying to free a little bit too much. Maybe fixes
#6721, #7117, #7278.

# Shouldn't have 6 versions of interbase.c lying around. Can't always
# remember which versions were tested, which ones committed and which ones
# actually in CVS... :(
2000-10-17 17:46:14 +00:00
Chuck Hagenbuch 13fa52b881 spaces to tabs. do we have a standard on this? 2000-10-17 17:31:37 +00:00
Chuck Hagenbuch e058cb0648 fix imap_fetchstructure(). msgindex is not valid if we're using FT_UID;
always use Z_LVAL_PP(msgno) in the actual c-client function call.
2000-10-17 16:11:26 +00:00
Stig Venaas ffbd2367e7 Added ldap_get_option() and ldap_set_option() functions
@- Added ldap_get_option() and ldap_set_option() functions (Stig Venaas)
2000-10-17 16:06:04 +00:00
Chuck Hagenbuch 9e693657d9 replace fixed-size buffers for username and password with dynamically
allocated strings in the MCAL extension.
2000-10-17 15:52:04 +00:00
Stig Venaas 0b59e4b821 Removed some redundant convert_to_*_ex() calls. Edited some whitespace. 2000-10-17 15:51:04 +00:00
foobar 142a32b437 cvs commit message disappeared. 2000-10-17 15:45:48 +00:00
foobar 6e09d7cb53 *** empty log message *** 2000-10-17 15:42:05 +00:00
Andreas Karajannis e8861e6d20 Added support for SAP DB 2000-10-17 15:23:18 +00:00
Sascha Schumann d95bc9b3eb Initialize tags properly.
Submitted by: Andreas Karajannis <Andreas.Karajannis@gmd.de>
2000-10-17 14:17:21 +00:00
Sascha Schumann 2d24f03033 Back out ws changes 2000-10-17 03:02:47 +00:00
Sascha Schumann c27ef11305 . 2000-10-17 02:57:26 +00:00
Sascha Schumann 7c0ba95806 fix indentation 2000-10-17 02:50:15 +00:00
8cdff379d6 ChangeLog update 2000-10-17 01:09:07 +00:00
Rasmus Lerdorf b3fb8a6e97 Aha, Sascha made a mistake! ;)
Make this thing compile again without trans-sid
2000-10-16 22:12:28 +00:00
Daniel Beulshausen 1f245a6f73 make compile again 2000-10-16 20:08:27 +00:00
Sascha Schumann 1c85ad029b Enable users to set the HTML tags to rewrite
through a configuration directive
2000-10-16 17:25:36 +00:00
Daniel Beulshausen 8f5e25598a include php.h to have VIRTUAL_DIR defined this
should fix bugs where the ttf functions won't
find the font in the actual working dir
# like under windows :)
2000-10-16 13:55:47 +00:00
Rui Hirokawa 4de105ae4a added a option to use the truetype string handling function in gd.\n it is useful for japanese because the truetype string function in gd supports some japanese encodings. 2000-10-16 13:50:30 +00:00
Daniel Beulshausen 4086197d95 fixes bug 7055 & 7235 2000-10-16 10:35:43 +00:00
9c1097c4db ChangeLog update 2000-10-16 01:09:10 +00:00
6fd1c9a929 NEWS update 2000-10-16 01:09:07 +00:00
foobar d282abf2df Changed to look also for liblber.so (sometimes there are only shared libs)
Fixes bug 6072.
2000-10-15 22:53:43 +00:00
Andi Gutmans 54754242da - Increase op_array size faster and make eralloc() it in the end to save
memory.
2000-10-15 19:52:01 +00:00
David Eriksson 5d98e49cbb Added Satellite to list of extensions
@- The Satellite CORBA client extension is ready for use (eriksson@php.net)
2000-10-15 17:30:39 +00:00
David Eriksson f6b66196e1 Updated build instructions, changed E_ERRORs to E_WARNINGs 2000-10-15 17:27:29 +00:00
Stig Bakken d004ea17c3 PEAR DB: added DB_ERROR_VALUE_COUNT_ON_ROW 2000-10-15 09:02:54 +00:00
Stig Bakken be60fcb11a PEAR DB: added DB_ERROR_NOT_LOCKED, gave DB_common::raiseError an optional
"nativecode" parameter.
2000-10-15 02:22:25 +00:00
bc422640d7 ChangeLog update 2000-10-15 01:09:17 +00:00
0892ae5b25 NEWS update 2000-10-15 01:09:08 +00:00
foobar 83b3818e67 Fix the fix as Sascha suggested. 2000-10-15 00:58:29 +00:00
Marko Karppinen cd7dae0676 We don't support FreeType 2 - let's stop pretending we do 2000-10-14 23:04:26 +00:00
foobar 61a71738ae Missed this from last commit. 2000-10-14 22:53:42 +00:00
foobar e6d03e7a3e config.m4 2000-10-14 22:48:38 +00:00
foobar 5db1090dff Fix to #7162. 2000-10-14 22:13:18 +00:00
Andi Gutmans 154052ff15 - Add another patch from Sterling. 2000-10-14 19:48:53 +00:00
Andi Gutmans 5c6593b505 - Preliminary commit of Sterlings get_defined_functions()/get_defined_vars
functions
2000-10-14 15:52:24 +00:00
Rasmus Lerdorf c3026223f7 This appears to be the correct fix to me.
@ Fix memory leak in x-httpd-source mode (Jason Greene)
2000-10-14 05:06:16 +00:00
beb42300e1 ChangeLog update 2000-10-14 01:09:18 +00:00
Andi Gutmans b8cadf21db - Only run startup() if ZEND_EXTENSIONS is defined to 1.
This fixes a link error on platforms which don't support libdl
2000-10-14 00:16:46 +00:00
Daniel Beulshausen c6e0cef254 trivial output change
# someone urged me too
2000-10-13 19:08:05 +00:00
Zeev Suraski ce51b94461 Fix php_value issue 2000-10-13 17:07:09 +00:00
Andi Gutmans d7969026b3 *** empty log message *** 2000-10-13 16:24:42 +00:00
Andi Gutmans bc37c9b1cd - Make increment of "" become "1" 2000-10-13 16:24:00 +00:00
Hartmut Holzgraefe 545ae277bc post handler registration done right
(never use emalloc in an extension MINIT function)
2000-10-13 12:13:35 +00:00
Hartmut Holzgraefe 6d5f1d97f8 now it works for me as CGI and APXS, with or without --enable-debug ... 2000-10-13 10:04:17 +00:00
Daniel Beulshausen afef79762d step to 4.0.4-dev 2000-10-13 09:29:49 +00:00
Daniel Beulshausen 6fb51171c8 compile fixes & update of win32 dsp 2000-10-13 09:13:01 +00:00
38ad62e6c7 ChangeLog update 2000-10-13 01:09:07 +00:00
Hartmut Holzgraefe cae27179ce fopen wrappers cleanup
- comfiguration is now done by an ini parameter
    instead of a compile time option
  - the implementations of the three standard wrappers
    now live in seperate files in ext/standard
  - the compiler is happy again, no more warnings
2000-10-13 00:09:31 +00:00
Sascha Schumann e07e515a1b Ignore trailing slashes 2000-10-12 23:17:21 +00:00
Andi Gutmans e91c188e85 - Fix memory leak. 2000-10-12 19:58:20 +00:00
Chuck Hagenbuch 9bd721eb10 fix make install for PEAR. (bug 7109) 2000-10-12 14:02:26 +00:00
Stanislav Malyshev d82c344869 I have a dream... 2000-10-12 09:20:29 +00:00
Hartmut Holzgraefe a57282df4b forgot this one yesterday, fdfdata.[ch] is no more ... 2000-10-12 06:32:10 +00:00
Sascha Schumann 3ee228371d Let strtr() use smart_str to reduce complexity 2000-10-12 01:26:26 +00:00
4166063897 ChangeLog update 2000-10-12 01:09:10 +00:00
8e4fe0acf9 NEWS update 2000-10-12 01:09:07 +00:00
Sascha Schumann 174253123e Rewrite php_str_to_str using the smart_str API.
This removes much complexity from the function.

Speed is improved by pre-allocating memory instead of reallocating
the buffer each time the pattern is found.
2000-10-12 00:50:28 +00:00
Sascha Schumann 82d199b639 Move structure definition into its own file, so that public header
files don't need to include the complete source code.
2000-10-12 00:48:12 +00:00
Hartmut Holzgraefe 5a48521049 added generalized SMTP code todo 2000-10-11 22:54:56 +00:00
Hartmut Holzgraefe a70ae211e1 removed fdfdata.h 2000-10-11 22:45:45 +00:00
Hartmut Holzgraefe e880e3fe0c removed fdfdata.c 2000-10-11 22:45:01 +00:00
Hartmut Holzgraefe 22e48a814a @ - POST handler for Adobe FDF format (Hartmut)
the FDF handler is now working and totaly living
in the fdf extension, no more special code in
main is needed
2000-10-11 22:44:15 +00:00
Hartmut Holzgraefe 5423a08558 @ -read and write .gz-files transparently on glibc based systems
@  using the 'zlib:' fopen wrapper (Hartmut)
2000-10-11 22:40:22 +00:00
Zeev Suraski 2b3333f53e This patch didn't make it for 4.0.3... 2000-10-11 22:38:22 +00:00
Nikos Mavroyanopoulos 3156be3fa6 fixed some includes and removed an unneeded file. 2000-10-11 20:32:04 +00:00
Nikos Mavroyanopoulos 68683825ad corrected typo 2000-10-11 20:26:09 +00:00
Sascha Schumann d2d5320ee8 Add session_write_close(). This is primarily intended to enable
script writers to release the lock associated with the session lock
before the request finishes.

You can pass arrays now to session_set_save_handler(), so that the handlers
can be located in an object for better abstraction.
2000-10-11 19:47:15 +00:00
Sascha Schumann 0fd6a7ed18 Provide basic auth info to scripts.
Protect shutdown handler from being called multiple times.
2000-10-11 19:40:56 +00:00
Alexander Feldman aee3c65a8f Fixed a problem in the configuration scanner where two extra NULL bytes
were added to each encapsulated string.
2000-10-11 19:38:16 +00:00
Andi Gutmans e9887156cf Don't use 'new' symbol 2000-10-11 19:11:48 +00:00
Zeev Suraski 0b1b5e3080 NEWS update 2000-10-11 18:52:11 +00:00
Zeev Suraski dee2d85e77 Fix -a interactive mode (no idea how the previous commit got committed) 2000-10-11 18:51:52 +00:00
Zeev Suraski 48167d2b21 *** empty log message *** 2000-10-11 18:36:02 +00:00
Zeev Suraski dea72ba6a4 Added mysql_escape_String() 2000-10-11 18:27:21 +00:00
Andi Gutmans b3d949852f *** empty log message *** 2000-10-11 18:02:45 +00:00
Zeev Suraski ac0880fd8f Remove conflict 2000-10-11 18:00:18 +00:00
Andi Gutmans f3232e99c3 - Commit Kristian's PHP 3 patch to PHP 4. Kristian I hope it's also the
same here.
2000-10-11 17:48:44 +00:00
Zeev Suraski 84f81c50ba Update version 2000-10-11 17:40:40 +00:00
Zeev Suraski 57a5bbd387 Go with 4.0.3 2000-10-11 17:31:34 +00:00
Nikos Mavroyanopoulos c834cbba59 Corrected a wrong include 2000-10-11 17:05:18 +00:00
Nikos Mavroyanopoulos 98038f8228 Added support for Ovrimos SQL Server. 2000-10-11 16:54:23 +00:00
Zeev Suraski 1abd99a443 Fixed a problem that allowed users to override admin_value's and admin_flag's 2000-10-11 16:24:35 +00:00
Zeev Suraski 9aa38aad45 Add zend_hash_merge_ex(), for selective merging 2000-10-11 16:22:40 +00:00
Sascha Schumann 23a96536fa Fix the readdir_r POSIX check 2000-10-11 14:35:45 +00:00
Hartmut Holzgraefe f2ddc10685 proto typo fixes 2000-10-11 13:51:32 +00:00
Hartmut Holzgraefe 0b7745d713 added protos 2000-10-11 13:34:42 +00:00
Zeev Suraski 9a0d7a40be avoid giving the impression that they fix the security bug by upgrading... 2000-10-11 13:32:10 +00:00
Zeev Suraski 8fc4200414 Old PostgreSQL fix I forgot to commit, and NEWS consistency update 2000-10-11 13:27:21 +00:00
Hartmut Holzgraefe 332b7125de added missing protos 2000-10-11 11:40:29 +00:00
Hartmut Holzgraefe be19c812ab added some missing protos 2000-10-11 11:25:13 +00:00
Hartmut Holzgraefe 8716039dec protos fixed 2000-10-11 10:46:53 +00:00
Daniel Beulshausen 83905d9fec added sablotron extension 2000-10-11 09:18:22 +00:00
Daniel Beulshausen 814639b2fc make windows compile 2000-10-11 09:17:10 +00:00
877855a74e ChangeLog update 2000-10-11 01:09:06 +00:00
Sterling Hughes 8759dcc0ce Fix compilation, I wonder when these were omitted?? 2000-10-10 20:51:32 +00:00
Derick Rethans a03858c40b - Reserved the patch
# Please check if it works, as I'm not be able to test it
# Blame CaPS for this one :)
2000-10-10 16:58:27 +00:00
Uwe Steinmann e9ba352023 - added optional argument pdf_show_boxed() to determine if text is
actually shown or not.
2000-10-10 07:42:55 +00:00
Andrei Zmievski ab0f48d506 Fix compiler warnings. 2000-10-09 19:18:42 +00:00
Andrei Zmievski a193c9ce3e Fix a misconfiguration error and missing return statement. 2000-10-09 19:10:39 +00:00
Derick Rethans 92b3dd06e3 - Made ora_close return values like it should (thanks to james@php.net and
mathieu@gginter.net)
2000-10-09 18:45:56 +00:00
Chuck Hagenbuch 046ecab96f revert patch. Sablot won't build anymore, at least in combination with zlib. 2000-10-09 18:32:37 +00:00
Hartmut Holzgraefe 86f2ad3017 I SHALL NOT TOUCH A RELEASE CANDIDATE!
I SHALL NOT TOUCH A RELEASE CANDIDATE!
I SHALL NOT TOUCH A RELEASE CANDIDATE!
(previous patch reverted)
2000-10-09 15:24:26 +00:00
Hartmut Holzgraefe bbc37db2f3 added support for GNU-specific domainname field in uname 2000-10-09 15:12:34 +00:00
Chuck Hagenbuch 85d125c22c No comment on this, so I'm guessing it's okay. 2000-10-09 14:51:17 +00:00
Zeev Suraski 9103cae5e5 Fix bug #6447 2000-10-09 11:48:16 +00:00
97bd1845a6 ChangeLog update 2000-10-09 01:09:07 +00:00
Chuck Hagenbuch 09f89187f4 Add File_SearchReplace class from Richard Heyes. 2000-10-08 14:55:13 +00:00
Daniel Beulshausen d667e05543 more cleanup of info code 2000-10-08 11:45:18 +00:00
Daniel Beulshausen 990a86615d only beautifying 2000-10-08 10:55:09 +00:00
f2f5f5a870 ChangeLog update 2000-10-08 01:09:09 +00:00
c99f72d5ea NEWS update 2000-10-08 01:09:06 +00:00
Sascha Schumann 683ce541c8 Move static declaration to source file. 2000-10-07 20:46:30 +00:00
Thies C. Arntzen 6b5441c30f @- Fixed returning of empty LOB fields in OCI8. (Thies) 2000-10-07 09:10:54 +00:00
b88fc00775 ChangeLog update 2000-10-07 01:09:11 +00:00
Andi Gutmans 996bd9300b - Fix Bug #7061 2000-10-06 17:34:50 +00:00
Sebastian Bergmann 8520f94796 Removed obsolete entries from php.ini. 2000-10-06 05:14:46 +00:00
472c1a099b ChangeLog update 2000-10-06 01:09:16 +00:00
Andi Gutmans a39da32bf0 - News 2000-10-06 00:03:40 +00:00
Andi Gutmans 31a5160a0a - Add calendar to default Win32 build. 2000-10-06 00:03:02 +00:00
Andi Gutmans 9ece8612b8 - Add FTP extension to default Win32 build 2000-10-05 23:25:41 +00:00
Andi Gutmans 7292abefc1 - Update link 2000-10-05 22:22:26 +00:00
Andi Gutmans 4b0db9a47b - Remove old dsw 2000-10-05 22:20:38 +00:00
Rasmus Lerdorf 348079bc3f Get ext_skel working again 2000-10-05 20:48:12 +00:00
Andi Gutmans fb2c23645b - Clean-up original code and add to NEWS. 2000-10-05 18:26:54 +00:00
Brendan W. McAdams 5ab813e1b6 Updated email address to reflect my php.net address.
I am no longer associated with Plexus InterActive (my plexmedia.com address) so
the old address is no longer any good.
2000-10-05 18:20:06 +00:00
Alexander Feldman 791cda209c Fixed posix_addlimit() when adding the string "unlimited" to the result.
Now the posix_getrlimit() function does not cause core dump.
2000-10-05 18:06:55 +00:00
Andi Gutmans d84c5a2238 - Updated included_files() also for plain include()/require(). 2000-10-05 17:58:46 +00:00
Jouni Ahto f06ee6bdba - List entry types should be true globals. 2000-10-05 12:47:39 +00:00
Joey Smith 8538f86ac1 Add more missing protos and make folding style closer to mysql module. 2000-10-05 02:40:53 +00:00
3dd574bb94 ChangeLog update 2000-10-05 01:09:07 +00:00
foobar b3450c2246 Now it really checks that libxml version is >= 2.0 2000-10-05 00:51:46 +00:00
Sascha Schumann 47dfaf232f Use ZEND_DECLARE_MODULE_GLOBALS instead of equivalent #if ZTS/#else/#endif
construct.
2000-10-04 23:11:07 +00:00
Andi Gutmans 6d92ac275d - Fix fprintf 2000-10-04 19:29:28 +00:00
Sascha Schumann 5674f1be45 Ignore close tags and use unsigned char type. 2000-10-04 18:06:20 +00:00
Stig Bakken de527c2379 * changed Andi's "testdirname" into a real regression test
# Andi, could you verify that the expected output really
# is correct?
2000-10-04 07:33:21 +00:00
5bcba1fadf ChangeLog update 2000-10-04 01:09:08 +00:00
Sascha Schumann da6c94f73b typo 2000-10-03 21:56:21 +00:00
Sascha Schumann cc415d699e #include "ext/standard/php_string.h" to get php_memnstr(). 2000-10-03 18:52:46 +00:00
652 changed files with 36561 additions and 10400 deletions

No files matched your search

+46 -8
View File
@@ -5,8 +5,9 @@ PHP Coding Standards
This file lists several standards that any programmer, adding or changing
code in PHP, should follow. Since this file was added at a very late
stage of the development of PHP v3.0, the code base does not (yet) fully
follow it, but it's going in that general direction.
This is an initial version - it'll most probably grow as time passes.
follow it, but it's going in that general direction. Since we are now
well into the version 4 releases, many sections have been recoded to use
these rules.
Code Implementation
@@ -64,7 +65,24 @@ Naming Conventions
------------------
[1] Function names for user functions should be enclosed with in
the PHP_FUNCTION() macro.
the PHP_FUNCTION() macro. They should be in lowercase, with words
underscore delimited, with care taken to minimize the letter count.
If they are part of a "parent set" of functions, that parent should
be included in the user function name.
Good:
'mcrypt_enc_self_test'
'mysql_list_fields'
Ok:
'mcrypt_module_get_algo_supported_key_sizes'
(could be 'mcrypt_mod_get_algo_sup_key_sizes'?)
'get_html_translation_table'
(could be 'html_get_trans_table'?)
Bad:
'hw_GetObjectByQueryCollObj'
'pg_setclientencoding'
[2] Function names used by user functions should be prefixed
with "_php_", and followed by a word or an underscore-delimited list of
@@ -92,25 +110,32 @@ Syntax and indentation
is known to accept C++-style comments in C code.
[2] Use K&R-style. Of course, we can't and don't want to
force anybody to use a style she's not used to, but
force anybody to use a style he or she is not used to, but,
at the very least, when you write code that goes into the core
of PHP or one of its standard modules, please maintain the K&R
style. This applies to just about everything, starting with
indentation and comment styles and up to function decleration
syntax.
[3] Be generous with whitespace and braces. Always prefer
if (foo) {
[3] Be generous with whitespace and braces. Always prefer:
if (foo) {
bar;
}
to
to:
if(foo)bar;
Keep one empty line between the variable decleration section and
the statements in a block, as well as between logical statement
groups in a block. Maintain at least one empty line between
two functions, preferably two.
[4] When indenting, use the tab character. A tab is expected to represent
four spaces. It is important to maintain consistency in indenture so
that definitions, comments, and control structures line up correctly.
Documentation and Folding Hooks
-------------------------------
@@ -145,4 +170,17 @@ Optional arguments are written like this:
And yes, please keep everything on a single line, even if that line is massive.
Aliases & Legacy Documentation
-----------------------------------
You may also have some deprecated aliases with close to duplicate
names, for example, somedb_select_result and somedb_selectresult. For
documentation puposes, these will only be documented by the most
current name, with the aliases listed in the documentation for
the parent function. For ease of reference, user-functions with
completely different names, that alias to the same function (such as
highlight_file and show_source), will be separately documented. The
proto should still be included, describing which function is aliased.
Backwards compatible functions and names should be maintained as long
as the code can be reasonably be kept as part of the codebase. See
/phpdoc/README for me information on documentation.
+1 -2
View File
@@ -1,3 +1,2 @@
For the list of people who've put work into PHP 4.0, please see
http://www.php.net/version4/credits.php
http://www.php.net/credits.php
+3442
View File
File diff suppressed because it is too large. Load diff
+14 -3
View File
@@ -141,7 +141,7 @@ MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: oci8
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -152,7 +152,7 @@ STATUS: Working
COMMENT: Working except for persistent connections
-------------------------------------------------------------------------------
EXTENSION: oracle
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
MAINTENANCE: Maintained
STATUS: Working
COMMENT: Using the new OCI8 driver is encouraged where possible.
@@ -262,6 +262,11 @@ PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: openssl
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
-------------------------------------------------------------------------------
EXTENSION: pcre
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
MAINTENANCE: Maintained
@@ -298,6 +303,12 @@ PRIMARY MAINTAINER: Kristian K
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: satellite
PRIMARY MAINTAINER: David Eriksson <eriksson@php.net>
MAINTENANCE: Odd Fixes
STATUS: Experimental
SINCE: 4.0.3
-------------------------------------------------------------------------------
EXTENSION: session
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
MAINTENANCE: Maintained
@@ -333,7 +344,7 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: xml
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
MAINTENANCE: Maintained
STATUS: Unknown
-------------------------------------------------------------------------------
+2 -1
View File
@@ -389,7 +389,8 @@ USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES
- Linux with recent binutils (binutils 2.9.1.0.25 tested)
- Solaris 2.5 or better
- FreeBSD (3.2, 4.0 tested)
- IRIX64 6.5
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:
+185 -11
View File
@@ -1,20 +1,195 @@
PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
05 Oct 2000, Version 4.0.3
11 Jan 2001, Version 4.0.4pl1
- Fixed the various pdf_open_*() functions (Daniel)
- Fixed a bug that could cause invalid INI entries to be used under certain
circumstances (Zeev)
- Fixed a bug in the Apache module that could cause invalid INI values to
propogate to different virtual hosts, if one or more of the virtual
hosts was configured with engine=Off (Zeev)
- Fixed possible crash bugs in the session module (Sascha)
- Fixed the ODBC module to build properly with Solid 3.0 and OpenLink (Dan
Kalowsky)
- Fixed possible corruption of line number information in PHP scripts (Zeev,
Zend Engine)
- Fixed a few possible crashes in functions that use user-defined callbacks
(Zeev, Zend Engine)
19 Dec 2000, Version 4.0.4
- Allow assigning a newly created object by reference. This is needed only if
your constructor makes other data structures reference the $this object (for
example, $GLOBALS["foobar"] =& $this;)
The new syntax is $obj =& new MyClass(); (Andi, Zend Engine)
- Allow for three expression types to be sent to functions which are requesting
the function argument to be passed by reference (only c. was previously
supported):
a. func(new myclass());
b. func(func2()); where func2() returns a reference, i.e. is defined as
function &func2(...)
{
...
}
c. func($var); where func() is defined as function func(&$var) {...}
You CAN'T count on any other expressions to be passable by reference.
(Andi, Zend Engine)
- Made ldap_get_entries() return an array even if there are no entries
in search result. (Jani)
- Fixed bad mod_perl interaction which caused segfaults when using LFS (Sascha)
- const CONSTNAME now gets recognized. Before the patch only @const CONSTNAME
description was recognized.
- Added the is_null() function that will return true if a variable is of
type null. (Sterling)
- Fixed a bug which made readdir() unusable in some systems. (Jani)
- Added the get_defined_functions() function which returns a list of all
currently defined functions. (Sterling)
- Added the get_defined_vars() function which returns an associative array
of all variables defined in the current scope and their subsequent values.
(Sterling)
- Added the call_user_func_array() function which gives you the ability to
call a user function by passing an array of parameters as the second
argument. (Sterling)
- Added the constant() function which returns the value of a constant given
the constant's name. (Sterling)
- Implemented support for Perl-style matching regexp delimiters in PCRE.
You can use <{[( and )]}> to delimit your expressions now. (Andrei)
- Introduced new 'F' modifier in PCRE that lets you specify a function
name in the replacement argument to preg_replace() that will be called
at run-time to provide the replacement string. It is passed an array of
matched pattern and subpatterns. (Andrei)
- Put an end to BUG#4615 (kalowsky & Eric Veldhuyzen)
- Fixed realpath() in Virtual Directory mode (Daniel)
- Integrated the Phil Nelson's bc math library routines into PHP, now that
the license allows it (Phil Nelson <phil@cs.wwu.edu>)
- Added the xslt_set_error_handler() function to the Sablotron extension.
(Sterling)
- Improved Sablotron's error handling system allowing you to catch all
errors before they are outputted to the screen. (Sterling)
- Added OpenSSL extension (Stig Venaas)
- Fixed/created support for Solid 3.0 databases (kalowsky)
- Fixed support for Solid 2.3 databases (kalowsky)
- quoted_printable_decode() function is made RFC-2045 compliant. (Kir)
- Modified preg_grep() to always return the results with keys from the original
array. (Andrei)
- Modified preg_replace() to accept Perl-style $n backreferences in addition
to \\n ones. (Andrei)
- Modified preg_replace() to ignore backreferences that refer to
non-existing subpatterns. (Andrei)
- Fixed column-title buffer-overflow in OCIFetchStatement(). (Thies)
- Added 'output_handler' INI directive (Zeev)
- Fixed some buglets in the output buffering mechanism (Zeev)
- Added transparent gzip compression support (Jade Nicoletti, Zeev)
- Major overhaul of domxml. Added basic XPath support as well (Uwe)
- Added 'r' flag to date() which generates an RFC822 formatted date, e.g.
"Thu, 9 Nov 2000 16:33:01 -0500" (Colin)
- In CGI mode, $HTTP_SERVER_VARS now includes all of the environment variables
as well (Zeev)
- Allow user to use mysql_use_result in mysql queries (Stas)
- Fixed a memory leak that would occur when restarting Apache often
(mookid@sigent.ru)
- Fixed a bug that prevented $argv and $argc from being defined in the command
line version of PHP (Stas)
- Fixed a bug that prevented a changed compile-time extension_dir from
affecting modules that were loaded via php.ini (Zeev)
- Fixed a bug in ftp_mkdir() when used on ftp server which doesn't return
the full path (Jani)
- Added ImageCreateFromString() which creates an image stream out of
e.g. a MySQL blob. (Mathieu)
- Fixed a crash bug in imagewbmp() (Jani)
- Changed the sablot configuration file so that if you use any version of
Sablotron below 0.44 you must use Sablotron's built-in Expat libraries.
(Sterling)
- Added basic authentication support to thttpd (Sascha)
- Added support for the Caudium webserver (http://caudium.net/). It's based
on the Roxen SAPI module. Many bugs have been identified and fixed. (David)
- Fixed mysql_close(), pg_close(), msql_close() and sybase_close() - they
weren't properly closing the SQL connections (Zeev)
- Fixed crypt() to supply random seed if none is given (Andi)
- Made print_r() support recursive data structures, e.g. $GLOBALS. (Zeev)
- Fixed a bug that caused PHP not to properly flush its output buffer, if more
than one output buffer was used. (Zeev)
- Fixed a bug that could draw the shutdown sequence of the PHP Apache module
into an endless loop, under certain circumstances. It could cause Apache
processes under Solaris to get stuck, especially when using output
buffering. (Zeev)
- Added support for serializing references (Stas)
- Fixed conflict with OpenLDAP and Oracle 8.1.x (Jani)
- parse_ini_file() supports a new optional 2nd argument that instructs it
to divide the directives to arrays according to the sections in which they
reside (Zeev)
- parse_ini_file() is now thread-safe, and supported under Windows (Zeev)
- Unified aborted-connection semantics of all SAPI modules (Sascha)
- URL-opened files now store the HTTP response header in $http_response_header
(Zeev)
- Fixed array_rand() to shuffle results when the number of requested
elements is the same as the number of elements in the array. (Andrei)
- Added replace parameter to header() (Sascha)
- Fixed handling of single quotes in transparent session-id mode (Sascha)
- Fixed "php://*" fopen handler (Sascha)
- Made rename work in threadsafe enviroments (Daniel)
- Made session_destroy() close files before unlinking (Daniel)
- Added array_sum() function. (Andrei)
- Fixed a bug in session.c. The php_session_save_current_state did not check
if mod_data is NULL and such situation is possible if the user calls
session_module_name with a parameter. (alex@zend.com)
- Added IIS Admin extension. (Frank)
- OCIBindByName() now does better parameter-checking. (Thies)
- Made read() binary-safe in sockets.c (Chris Vandomelen)
- Made array_intersect() and array_diff() not alter order (Stig Venaas)
- Made ldap_connect() accept URL in host parameter when using OpenLDAP
2.x. To use SSL, use ldaps://host/ as URL. (Stig Venaas)
- Made resource type names visible, e.g. var_dump() and
get_resource_type() display "file" for file resources. (Andrei)
- Added the curl_getinfo() function to find out information about a CURL
transfer. This function requires cURL 7.4.0 or above. (Sterling)
- Added the CURLOPT_KRB4, CURLOPT_INTERFACE, CURLOPT_QUOTE, CURLOPT_POSTQUOTE,
CURLOPT_QUOTE and CURLOPT_HTTPPROXYTUNNELL options. (Sterling)
- Renamed the shm_* functions to shmop_* (Derick)
- Updated ext/mysql/libmysql to version 3.23 (tim@mysql.com)
- Added ldap_get_option() and ldap_set_option() functions (Stig Venaas)
- Fixed a crash in CGI mode, in case no file was provided
(Daniel Beulshausen& Zeev)
- Fixed possible crash bug in imap_fetchstructure() (Jani)
- Fixed possible crash bug in imap_open() (Jani & Mark Musone)
- Added url_rewriter.tags configuration directive (Sascha)
- Added CORBA client extension, ready for use (eriksson@php.net)
- Fixed memory leak in x-httpd-source mode (Jason Greene)
- Changed ext/gd not to be enabled by default (Jani)
- Make increment of empty string ("") behave like in PHP 3 and result in "1"
(Andi, Zend Engine)
- Added POST handler for Adobe FDF format (Hartmut)
- Added transparent read and write .gz-files on glibc based systems
using the 'zlib:' fopen wrapper (Hartmut)
- Fixed a problem in the configuration parser (two null bytes were added
to each ENCAPSULATED TC_STRING) (alex@zend.com)
- Added HMAC support in the mhash module (nmav@altera.gr)
- Added module for Ovrimos sql server (nmav@altera.gr)
11 Oct 2000, Version 4.0.3
- Fixed a possible crash in -a interactive mode (Zeev, Zend Engine)
- Added mysql_escape_string() (Peter A. Savitch and & Brian Wang)
- Fixed many possible crash bugs with improper use of the printf() family of
functions (Andi)
- Fixed a problem that allowed users to override admin_value's and admin_flag's
(Zeev)
- Fixed PostgreSQL module to work when the link handle is omitted (Zeev)
- Fixed returning of empty LOB fields in OCI8. (Thies)
- Added Calendar module to default Win32 build (Andi)
- Added FTP module to default Win32 build (Andi)
- Fixed crash in the POSIX getrlimit() function (alex@zend.com)
- Fixed dirname() under certain conditions (Andi)
- Add --with-imap-ssl to support SSL'ized imap library in RH7 and others
- Added --with-imap-ssl to support SSL'ized imap library in RH7 and others
(Rasmus)
- Fix possible crash bug in parse_url() (Andi)
- Fixed possible crash bug in parse_url() (Andi)
- Added support for trans sid under Win32 (Daniel)
- IPv6 support in fopen (Stig Venaas)
- Added IPv6 support in fopen (Stig Venaas)
- Added the shmop extension. It allows more general ways of shared memory
access. (thanks to Ilia Alshanestky <iliaa@home.com> and Slava Poliakov
<slavapl@mailandnews.com> (Derick)
- Added the ability for CURLOPT_POSTFIELDS to accept an associative array of
HTTP POST variables and values. (Sterling)
- Added the CURLOPT_HTTPHEADER option to curl_setopt(). (Sterling)
- Add the curl_error() and curl_errno() functions. (Sterling)
- Added the curl_error() and curl_errno() functions. (Sterling)
- Changed ext/db not to be enabled by default (Jani)
- Fixed building Apache SAPI module on SCO UnixWare (Sascha)
- Fixed writing empty session sets to shared memory (tcarroll@chc-chimes.com)
@@ -39,7 +214,7 @@ PHP 4.0 NEWS
word is longer than the maximum allowed. (Derick)
- Added functions pg_put_line and pg_end_copy (Dirk Elmendorf)
- Added second parameter for parse_str to save result (John Bafford)
- Fix bug with curl places extra data in the output. (medvitz@medvitz.net)
- Fixed bug with curl places extra data in the output. (medvitz@medvitz.net)
- Added the pathinfo() function. (Sterling)
- Updated sybase_ct module and its sybase_query to use high performance API.
(Joey)
@@ -49,11 +224,10 @@ PHP 4.0 NEWS
display_startup_errors - see php.ini-dist for further information (Zeev)
- Worked around a bug in the libc5 implementation of readdir() (Stas)
- Fixed some potential OpenBSD and NetBSD crash bugs when opening files. (Andi)
- Add EscapeShellArg() function (Rasmus)
- Add a php.ini option session.use_trans_sid to enable/disable trans-sid.
- Added EscapeShellArg() function (Rasmus)
- Added a php.ini option session.use_trans_sid to enable/disable trans-sid.
(Sterling)
- Quick-fix for the file upload security alert (Rasmus)
- Add the Sablotron extension for XSL parsing. (Sterling)
- Added the Sablotron extension for XSL parsing. (Sterling)
- Fixed a bug in checkdate() which caused < 1 years to be valid (Jani)
- Added support for an optional output handler function for output
buffering. This enables transparent rendering of XML through XSL,
@@ -84,7 +258,7 @@ PHP 4.0 NEWS
syntax for the walk function. (Andrei)
- Fixed segfault with fgets(), fgetcsv(), fgetss(), and fread() when
called with negative length argument. (Torben)
- Fix by-reference parameters passing for xml_ functions and for scanf
- Fixed by-reference parameters passing for xml_ functions and for scanf
functions (Stas)
- Added experimental Oracle LDAP SDK support. 8.1.6 or later needed. Configure
with something like --with-ldap=/usr/local/oracle/product/8.1.6 (Stig Venaas)
+5 -16
View File
@@ -1,17 +1,6 @@
How to install PHP with the BCMath arbitrary precision math library?
--------------------------------------------------------------------
As of PHP 4.0.4, the BC math library routines are bundled in the
standard PHP distribution. There is no need to install any additional
files.
Due to license restrictions, the BC math library can no longer be distributed
along with PHP. The BC math library is distributed under the restrictive
GNU Public License, and PHP is no longer distributed under that license, but
under a less restrictive license, the PHP License.
If you want to enable BC math support (recommended), all you have to do is
simply download http://www.php.net/extra/number4.tar.gz, and untar it on the
top level php4 directory.
A typical way of doing this would be (assuming that you have lynx):
cd ~/php4
lynx -dump -source http://www.php.net/extra/number4.tar.gz | gzip -d | tar xvf -
The PHP Group
Thanks goes to Phil Nelson, for releasing the BC math library routines
under the LGPL.
+5 -1
View File
@@ -51,9 +51,13 @@ FORMAT OF FUNCTION DEFINITIONS FILE
']'s as there where '['s. Currently, it does not harm if you forget to do it
or there is a wrong amount of ']'s, but this may change in the future.
An additional short description may be added after the parameters.
If present it will be filled into the 'proto' header comments in the stubs
code and the <refpurpose> tag in the XML documentation.
An example:
my_function(int arg1, int arg2 [, int arg3 [, int arg4]])
my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st
Arguments arg3 and arg4 are optional.
+53 -2
View File
@@ -86,6 +86,28 @@ 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.)
If you are using 3rd party tools and libraries which are installed
in non-standard locations, you may need to set the environment
variable LD_LIBRARY_PATH to point to the library's location, prior
to running the Zeus Web Server. For example, if you have compiled
external MySQL support, and mysql is installed in /usr/local/mysql,
you should set LD_LIBRARY_PATH to '/usr/local/mysql/lib/mysql'
and then 'export LD_LIBRARY_PATH'. For convenience, you should add
this to the 'start-zeus' script provided.
Yet another method of ensuring the linked libraries are found is to
set the environment variable LD_RUN_PATH before compiling PHP. This
works in a similar way to LD_LIBRARY_PATH, but at compile-time.
Libraries produced with this envrionment variable set will have its
value 'burned' into the resultant binary, specifying a runtime
search pth to locate other required libraries such as MySQL.
On Linux, you can also tell the dynamic linker where to find the
libraries, by adding '/usr/local/mysql/lib/mysql' to the file
/etc/ld.so.conf - after editting this file, run 'ldconfig' as root,
to use the changes.
Specific examples:
Solaris + gcc:
@@ -93,10 +115,39 @@ 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)
FreeBSD 4.0:
FreeBSD 4:
Some people may find they need to run ./configure with the
'--enable-libgcc' compile option too.
Performance issues
==================
To make PHP run fast under Zeus, check the following points:
1) Run PHP as an ISAPI module, not a CGI - compile it with the --with-zeus=...
flag!
2) Tune the ISAPI runner to your required workload. There are several
tuneables that can be given. These are set by adding the appropriate
lines to the $ZEUSHOME/web/global.cfg file. Changes to this file will only
be picked up after the web server is restarted (run stop-zeus ; start-zeus)
tuning!modules!isapi!external!maxthreads xxx
- Sets the maximum number of threads that the ISAPI runner will spawn. If
further PHP page requests arrive, they will be queued until a current
page is finished. For busy websites, we suggest increasing this value
(defaults to 16). Replace the 'xxx' in the above line with the required
number of threads. Note that the threads are equally shared between
ISAPI extensions and filters, so if you want to handle 100 concurrent
PHP page requests, set this tuneable to 200.
tuning!modules!isapi!external!minthreads xxx
- Sets the minimum number of threads. Idle threads will be kept in a pool,
which avoids costly thread creation/deletion.
For more information and help with Zeus, please visit our website:
http://www.zeus.com
http://support.zeus.com
+8 -7
View File
@@ -7,6 +7,10 @@ Zend
traverse an array without copying each element.
* look at replacing c-lib call tolower().
* make hash API functions work with HASH_OF() to save time.
* native large number support (probably with GNU GMP)
* Const'ify APIs. Right now, many functions leave parameters untouched,
but don't declare those as const. This makes interaction with other
interfaces difficult which pass const parameters to us.
global
------
@@ -16,7 +20,6 @@ global
* 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
* INI system causes segfaults in ZTS mode (operates on static HashTable)
* 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
@@ -24,7 +27,7 @@ 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
reentrancy-safe functions.
reentrancy-safe functions (DONE?).
* 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.
@@ -50,10 +53,6 @@ ext/dav
--------
* 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.
@@ -62,7 +61,6 @@ ext/oci8
ext/pcre
--------
* have an option for preg_grep() to return keys as well.
* update the online docs from version 3.1 man page
ext/session
@@ -76,6 +74,7 @@ ext/session
ext/standard
------------
* array_mean()
* add a version number to data serialized via serialize().
* array_add(). (Andrei)
* possibly modify parsing of GPC data to automatically create arrays if
@@ -91,6 +90,8 @@ ext/standard
strrpos()
strrchr()
strip_tags()
* rewrite win32 SMTP code to be useable for *ix to, maybe as a (default)
module of its own (Hartmut)
ext/wddx
--------
+76 -33
View File
@@ -38,13 +38,16 @@ typedef struct {
} tsrm_resource_type;
#define TSRM_SHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)+1)
#define TSRM_UNSHUFFLE_RSRC_ID(rsrc_id) ((rsrc_id)-1)
/* The memory manager table */
static tsrm_tls_entry **tsrm_tls_table;
static tsrm_tls_entry **tsrm_tls_table=NULL;
static int tsrm_tls_table_size;
static ts_rsrc_id id_count;
/* The resource sizes table */
static tsrm_resource_type *resource_types_table;
static tsrm_resource_type *resource_types_table=NULL;
static int resource_types_table_size;
@@ -55,20 +58,31 @@ static void (*tsrm_new_thread_begin_handler)();
static void (*tsrm_new_thread_end_handler)();
/* Debug support */
static int tsrm_debug(const char *format, ...);
static int tsrm_debug_status;
int tsrm_error(int level, const char *format, ...);
static int tsrm_error_level;
static FILE *tsrm_error_file;
#if TSRM_DEBUG
#define TSRM_ERROR tsrm_error
#define TSRM_SAFE_ARRAY_OFFSET(array, offset, range) (((offset)>=0 && (offset)<(range)) ? array[offset] : NULL)
#else
#define TSRM_ERROR
#define TSRM_SAFE_ARRAY_OFFSET(array, offset, range) array[offset]
#endif
/* Startup TSRM (call once for the entire process) */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_status)
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)
{
#if defined(GNUPTH)
pth_init();
#endif
tsrm_error_file = stderr;
tsrm_error_set(debug_level, debug_filename);
tsrm_tls_table_size = expected_threads;
tsrm_tls_table = (tsrm_tls_entry **) calloc(tsrm_tls_table_size, sizeof(tsrm_tls_entry *));
if (!tsrm_tls_table) {
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Unable to allocate TLS table");
return 0;
}
id_count=0;
@@ -76,7 +90,9 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
resource_types_table_size = expected_resources;
resource_types_table = (tsrm_resource_type *) calloc(resource_types_table_size, sizeof(tsrm_resource_type));
if (!resource_types_table) {
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Unable to allocate resource types table");
free(tsrm_tls_table);
tsrm_tls_table = NULL;
return 0;
}
@@ -84,9 +100,7 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
tsrm_new_thread_begin_handler = tsrm_new_thread_end_handler = NULL;
tsrm_debug_status = debug_status;
tsrm_debug("Started up TSRM, %d expected threads, %d expected resources\n", expected_threads, expected_resources);
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Started up TSRM, %d expected threads, %d expected resources", expected_threads, expected_resources);
return 1;
}
@@ -113,12 +127,18 @@ TSRM_API void tsrm_shutdown(void)
}
}
free(tsrm_tls_table);
tsrm_tls_table = NULL;
}
if (resource_types_table) {
free(resource_types_table);
resource_types_table=NULL;
}
tsrm_mutex_free(tsmm_mutex);
tsrm_debug("Shutdown TSRM\n");
tsmm_mutex = NULL;
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Shutdown TSRM");
if (tsrm_error_file!=stderr) {
fclose(tsrm_error_file);
}
#if defined(GNUPTH)
pth_kill();
#endif
@@ -131,19 +151,21 @@ TSRM_API ts_rsrc_id ts_allocate_id(size_t size, ts_allocate_ctor ctor, ts_alloca
ts_rsrc_id new_id;
int i;
tsrm_debug("Obtaining a new resource id, %d bytes\n", size);
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Obtaining a new resource id, %d bytes", size);
tsrm_mutex_lock(tsmm_mutex);
/* obtain a resource id */
new_id = id_count++;
tsrm_debug("Obtained resource id %d\n", new_id);
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Obtained resource id %d", TSRM_SHUFFLE_RSRC_ID(new_id));
/* store the new resource type in the resource sizes table */
if (resource_types_table_size < id_count) {
resource_types_table = (tsrm_resource_type *) realloc(resource_types_table, sizeof(tsrm_resource_type)*id_count);
if (!resource_types_table) {
return -1;
tsrm_mutex_unlock(tsmm_mutex);
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Unable to allocate storage for resource");
return 0;
}
resource_types_table_size = id_count;
}
@@ -173,8 +195,8 @@ TSRM_API ts_rsrc_id ts_allocate_id(size_t size, ts_allocate_ctor ctor, ts_alloca
}
tsrm_mutex_unlock(tsmm_mutex);
tsrm_debug("Successfully allocated new resource id %d\n", new_id);
return new_id;
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Successfully allocated new resource id %d", TSRM_SHUFFLE_RSRC_ID(new_id));
return TSRM_SHUFFLE_RSRC_ID(new_id);
}
@@ -182,6 +204,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
{
int i;
TSRM_ERROR(TSRM_ERROR_LEVEL_CORE, "Creating data structures for thread %x", thread_id);
(*thread_resources_ptr) = (tsrm_tls_entry *) malloc(sizeof(tsrm_tls_entry));
(*thread_resources_ptr)->storage = (void **) malloc(sizeof(void *)*id_count);
(*thread_resources_ptr)->count = id_count;
@@ -218,7 +241,7 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
} else {
thread_id = tsrm_thread_id();
}
tsrm_debug("Fetching resource id %d for thread %ld\n", id, (long) thread_id);
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for thread %ld", id, (long) thread_id);
tsrm_mutex_lock(tsmm_mutex);
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
@@ -246,11 +269,15 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
} while (thread_resources);
}
resource = thread_resources->storage[id];
resource = TSRM_SAFE_ARRAY_OFFSET(thread_resources->storage, TSRM_UNSHUFFLE_RSRC_ID(id), thread_resources->count);
tsrm_mutex_unlock(tsmm_mutex);
tsrm_debug("Successfully fetched resource id %d for thread id %ld - %x\n", id, (long) thread_id, (long) resource);
if (resource) {
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Successfully fetched resource id %d for thread id %ld - %x", id, (long) thread_id, (long) resource);
} else {
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Resource id %d is out of range (%d..%d)", id, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1));
}
return resource;
}
@@ -325,7 +352,7 @@ TSRM_API THREAD_T tsrm_thread_id(void)
/* Allocate a mutex */
TSRM_API MUTEX_T tsrm_mutex_alloc( void )
TSRM_API MUTEX_T tsrm_mutex_alloc(void)
{
MUTEX_T mutexp;
@@ -351,7 +378,7 @@ TSRM_API MUTEX_T tsrm_mutex_alloc( void )
/* Free a mutex */
TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
{
if (mutexp) {
#ifdef TSRM_WIN32
@@ -374,11 +401,9 @@ TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
/* Lock a mutex */
TSRM_API int tsrm_mutex_lock( MUTEX_T mutexp )
TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
{
#if 0
tsrm_debug("Mutex locked thread: %ld\n",tsrm_thread_id());
#endif
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Mutex locked thread: %ld", tsrm_thread_id());
#ifdef TSRM_WIN32
EnterCriticalSection(mutexp);
return 1;
@@ -395,11 +420,9 @@ TSRM_API int tsrm_mutex_lock( MUTEX_T mutexp )
/* Unlock a mutex */
TSRM_API int tsrm_mutex_unlock( MUTEX_T mutexp )
TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
{
#if 0
tsrm_debug("Mutex unlocked thread: %ld\n",tsrm_thread_id());
#endif
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Mutex unlocked thread: %ld", tsrm_thread_id());
#ifdef TSRM_WIN32
LeaveCriticalSection(mutexp);
return 1;
@@ -438,25 +461,45 @@ TSRM_API void *tsrm_set_new_thread_end_handler(void (*new_thread_end_handler)(TH
* Debug support
*/
static int tsrm_debug(const char *format, ...)
#if TSRM_DEBUG
int tsrm_error(int level, const char *format, ...)
{
if (tsrm_debug_status) {
if (level<=tsrm_error_level) {
va_list args;
int size;
fprintf(tsrm_error_file, "TSRM: ");
va_start(args, format);
size = vprintf(format, args);
size = vfprintf(tsrm_error_file, format, args);
va_end(args);
fprintf(tsrm_error_file, "\n");
fflush(tsrm_error_file);
return size;
} else {
return 0;
}
}
#endif
void tsrm_debug_set(int status)
void tsrm_error_set(int level, char *debug_filename)
{
tsrm_debug_status = status;
tsrm_error_level = level;
#if TSRM_DEBUG
if (tsrm_error_file!=stderr) { /* close files opened earlier */
fclose(tsrm_error_file);
}
if (debug_filename) {
tsrm_error_file = fopen(debug_filename, "w");
if (!tsrm_error_file) {
tsrm_error_file = stderr;
}
} else {
tsrm_error_file = stderr;
}
#endif
}
#endif /* ZTS */
+3 -3
View File
@@ -42,7 +42,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "Debug_TS"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /I "C:\Projects\TSRM" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /D "_DEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=1 /YX /FD /GZ /c
# ADD BASE RSC /l 0x40d /d "_DEBUG"
# ADD RSC /l 0x40d /d "_DEBUG"
BSC32=bscmake.exe
@@ -65,7 +65,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Release_TS"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c
# ADD BASE RSC /l 0x40d /d "NDEBUG"
# ADD RSC /l 0x40d /d "NDEBUG"
BSC32=bscmake.exe
@@ -88,7 +88,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Release_TS_inline"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c
# ADD BASE RSC /l 0x40d /d "NDEBUG"
# ADD RSC /l 0x40d /d "NDEBUG"
BSC32=bscmake.exe
+6 -6
View File
@@ -14,11 +14,7 @@
#define TSRM_H
#ifdef HAVE_CONFIG_H
# undef PACKAGE
# undef VERSION
# include "tsrm_config.h"
# undef PACKAGE
# undef VERSION
#endif
/* Only compile multi-threading functions if we're in ZTS mode */
@@ -77,7 +73,7 @@ extern "C" {
#endif
/* startup/shutdown */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_status);
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename);
TSRM_API void tsrm_shutdown(void);
/* allocates a new thread-safe-resource id */
@@ -95,7 +91,11 @@ TSRM_API void ts_free_id(ts_rsrc_id id);
/* Debug support */
TSRM_API void tsrm_debug_set(int status);
#define TSRM_ERROR_LEVEL_ERROR 1
#define TSRM_ERROR_LEVEL_CORE 2
#define TSRM_ERROR_LEVEL_INFO 3
TSRM_API int tsrm_error(int level, const char *format, ...);
TSRM_API void tsrm_error_set(int level, char *debug_filename);
/* utility functions */
TSRM_API THREAD_T tsrm_thread_id(void);
+1 -1
View File
@@ -4,7 +4,7 @@ dnl Minimalistic configure.in for TSRM.
dnl
AC_INIT(TSRM.c)
AM_INIT_AUTOMAKE(TSRM, 1.0)
AM_INIT_AUTOMAKE(TSRM, 1.0, nodefine)
AM_CONFIG_HEADER(tsrm_config.h)
sinclude(tsrm.m4)
+32 -4
View File
@@ -199,7 +199,7 @@ CWD_API void virtual_cwd_shutdown(void)
free(main_cwd_state.cwd); /* Don't use CWD_STATE_FREE because the non global states will probably use emalloc()/efree() */
}
CWD_API char *virtual_getcwd_ex(int *length)
CWD_API char *virtual_getcwd_ex(size_t *length)
{
cwd_state *state;
CWDLS_FETCH();
@@ -442,7 +442,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path)
CWD_STATE_COPY(&new_state, &CWDG(cwd));
retval = virtual_file_ex(&new_state, path, NULL);
if(retval) {
if (!retval) {
int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
memcpy(real_path, new_state.cwd, len);
real_path[len] = '\0';
@@ -452,18 +452,24 @@ CWD_API char *virtual_realpath(const char *path, char *real_path)
return NULL;
}
CWD_API int virtual_filepath(const char *path, char **filepath)
CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path)
{
cwd_state new_state;
int retval;
CWDLS_FETCH();
CWD_STATE_COPY(&new_state, &CWDG(cwd));
retval = virtual_file_ex(&new_state, path, php_is_file_ok);
retval = virtual_file_ex(&new_state, path, verify_path);
*filepath = new_state.cwd;
return retval;
}
CWD_API int virtual_filepath(const char *path, char **filepath)
{
return virtual_filepath_ex(path, filepath, php_is_file_ok);
}
CWD_API FILE *virtual_fopen(const char *path, const char *mode)
@@ -574,6 +580,28 @@ CWD_API int virtual_creat(const char *path, mode_t mode)
return f;
}
CWD_API int virtual_rename(char *oldname, char *newname)
{
cwd_state old_state;
cwd_state new_state;
int retval;
CWDLS_FETCH();
CWD_STATE_COPY(&old_state, &CWDG(cwd));
virtual_file_ex(&old_state, oldname, NULL);
oldname = old_state.cwd;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
virtual_file_ex(&new_state, newname, NULL);
newname = new_state.cwd;
retval = rename(oldname, newname);
CWD_STATE_FREE(&old_state);
CWD_STATE_FREE(&new_state);
return retval;
}
CWD_API int virtual_stat(const char *path, struct stat *buf)
{
+6 -2
View File
@@ -44,7 +44,7 @@
#include "readdir.h"
#include <sys/utime.h>
/* mode_t isn't defined on Windows */
typedef int mode_t;
typedef unsigned short mode_t;
#define DEFAULT_SLASH '\\'
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
@@ -95,15 +95,17 @@ typedef int (*verify_path_func)(const cwd_state *);
CWD_API void virtual_cwd_startup(void);
CWD_API void virtual_cwd_shutdown(void);
CWD_API char *virtual_getcwd_ex(int *length);
CWD_API char *virtual_getcwd_ex(size_t *length);
CWD_API char *virtual_getcwd(char *buf, size_t size);
CWD_API int virtual_chdir(const char *path);
CWD_API int virtual_chdir_file(const char *path, int (*p_chdir)(const char *path));
CWD_API int virtual_filepath(const char *path, char **filepath);
CWD_API int virtual_filepath_ex(const char *path, char **filepath, verify_path_func verify_path);
CWD_API char *virtual_realpath(const char *path, char *real_path);
CWD_API FILE *virtual_fopen(const char *path, const char *mode);
CWD_API int virtual_open(const char *path, int flags, ...);
CWD_API int virtual_creat(const char *path, mode_t mode);
CWD_API int virtual_rename(char *oldname, char *newname);
CWD_API int virtual_stat(const char *path, struct stat *buf);
#ifndef TSRM_WIN32
CWD_API int virtual_lstat(const char *path, struct stat *buf);
@@ -159,6 +161,7 @@ typedef struct _virtual_cwd_globals {
#define V_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir)
#define V_GETWD(buf)
#define V_REALPATH(path,real_path) virtual_realpath(path,real_path)
#define V_RENAME(oldname,newname) virtual_rename(oldname,newname)
#define V_STAT(path, buff) virtual_stat(path, buff)
#ifdef TSRM_WIN32
#define V_LSTAT(path, buff) virtual_stat(path, buff)
@@ -184,6 +187,7 @@ typedef struct _virtual_cwd_globals {
#define V_FOPEN(path, mode) fopen(path, mode)
#define V_OPEN(open_args) open open_args
#define V_CREAT(path, mode) creat(path, mode)
#define V_RENAME(oldname,newname) rename(oldname,newname)
#define V_CHDIR(path) chdir(path)
#define V_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
#define V_GETWD(buf) getwd(buf)
+32 -13
View File
@@ -1,21 +1,23 @@
## Process this file with automake to produce Makefile.in -*- makefile -*-
#CLEANFILES = zend-parser.c zend-parser.h zend-scanner.c zend-parser.output
#CLEANFILES = zend_language_parser.c zend_language_parser.h zend_language_scanner.c zend_language_parser.output zend_ini_parser.c zend_ini_parser.h zend_ini_scanner.c zend_ini_parser.output
AUTOMAKE_OPTIONS=foreign
EXTRA_LTLIBRARIES=libZend_cc.la libZend_c.la
noinst_LTLIBRARIES=$(ZEND_SCANNER) libZend.la
libZend_cc_la_SOURCES=zend-scanner-cc.cc
libZend_c_la_SOURCES=zend-scanner.c
libZend_cc_la_SOURCES=zend_language_scanner_cc.cc zend_ini_scanner_cc.cc
libZend_c_la_SOURCES=zend_language_scanner.c zend_ini_scanner.c
libZend_la_SOURCES=\
zend-parser.y \
zend_language_parser.y \
zend_ini_parser.y \
zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \
zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \
zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
zend_ini.c
libZend_la_LIBADD = $(ZEND_SCANNER)
libZend_la_LDFLAGS = @EXTRA_LIBS@
@@ -23,19 +25,36 @@ libZend_la_DEPENDENCIES = $(ZEND_SCANNER)
# automake isn't too clever about "non-standard" use of lex and yacc
$(libZend_la_OBJECTS) zend-scanner.lo zend-scanner-cc.lo: zend-parser.h
$(libZend_la_OBJECTS) zend_language_scanner.lo zend_language_scanner_cc.lo: zend_language_parser.h
zend-scanner.c: $(srcdir)/zend-scanner.l
$(LEX) -Pzend -o$@ -i $(srcdir)/zend-scanner.l
zend_ini_scanner.lo zend_ini_scanner_cc.lo: zend_ini_parser.h
zend-scanner-cc.cc: $(srcdir)/zend-scanner.l
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -o$@ $(srcdir)/zend-scanner.l
# Language parser/scanner rules
zend-parser.h: zend-parser.c
zend-parser.c: $(srcdir)/zend-parser.y
$(YACC) -p zend -v -d $(srcdir)/zend-parser.y -o zend-parser.c
zend_language_scanner.c: $(srcdir)/zend_language_scanner.l
$(LEX) -Pzend -o$@ -i $(srcdir)/zend_language_scanner.l
zend_language_scanner_cc.cc: $(srcdir)/zend_language_scanner.l
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -o$@ $(srcdir)/zend_language_scanner.l
zend_language_parser.h: zend_language_parser.c
zend_language_parser.c: $(srcdir)/zend_language_parser.y
$(YACC) -p zend -v -d $(srcdir)/zend_language_parser.y -o zend_language_parser.c
# INI parser/scanner rules
zend_ini_parser.c: $(srcdir)/zend_ini_parser.y
$(YACC) -p ini_ -v -d $(srcdir)/zend_ini_parser.y -o zend_ini_parser.c
zend_ini_scanner.c: $(srcdir)/zend_ini_scanner.l
$(LEX) -Pini_ -o$@ -i $(srcdir)/zend_ini_scanner.l
zend_ini_scanner_cc.cc: $(srcdir)/zend_ini_scanner.l
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pini_ -o$@ $(srcdir)/zend_ini_scanner.l
zend_ini_parser.h: zend_ini_parser.c
depend:
zend_execute.lo: $(srcdir)/zend_execute.c
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(INLINE_CFLAGS) -c $(srcdir)/zend_execute.c
+1
View File
@@ -109,3 +109,4 @@ shamelessly lying about it. Here's why:
This incompatability is due to the full variable reference
within quoted strings feature added in Zend.
+108 -46
View File
@@ -107,14 +107,6 @@ LIB32=link.exe -lib
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=".\zend-parser.c"
# End Source File
# Begin Source File
SOURCE=".\zend-scanner.c"
# End Source File
# Begin Source File
SOURCE=.\zend.c
# End Source File
# Begin Source File
@@ -151,10 +143,6 @@ SOURCE=.\zend_extensions.c
# End Source File
# Begin Source File
SOURCE=.\zend_gcc_inline.c
# End Source File
# Begin Source File
SOURCE=.\zend_hash.c
# End Source File
# Begin Source File
@@ -167,6 +155,26 @@ SOURCE=.\zend_indent.c
# End Source File
# Begin Source File
SOURCE=.\zend_ini.c
# End Source File
# Begin Source File
SOURCE=.\zend_ini_parser.c
# End Source File
# Begin Source File
SOURCE=.\zend_ini_scanner.c
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.c"
# End Source File
# Begin Source File
SOURCE=".\zend_language_scanner.c"
# End Source File
# Begin Source File
SOURCE=.\zend_list.c
# End Source File
# Begin Source File
@@ -211,14 +219,6 @@ SOURCE=.\modules.h
# End Source File
# Begin Source File
SOURCE=".\zend-parser.h"
# End Source File
# Begin Source File
SOURCE=".\zend-scanner.h"
# End Source File
# Begin Source File
SOURCE=.\zend.h
# End Source File
# Begin Source File
@@ -279,6 +279,18 @@ SOURCE=.\zend_indent.h
# End Source File
# Begin Source File
SOURCE=.\zend_ini.h
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.h"
# End Source File
# Begin Source File
SOURCE=".\zend_language_scanner.h"
# End Source File
# Begin Source File
SOURCE=.\zend_list.h
# End Source File
# Begin Source File
@@ -307,23 +319,52 @@ SOURCE=.\zend_variables.h
# PROP Default_Filter "y"
# Begin Source File
SOURCE=".\zend-parser.y"
SOURCE=.\zend_ini_parser.y
!IF "$(CFG)" == "Zend - Win32 Release"
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
# Begin Custom Build
InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
!ENDIF
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.y"
!IF "$(CFG)" == "Zend - Win32 Release"
# Begin Custom Build
InputDir=.
InputPath=".\zend-parser.y"
InputPath=".\zend_language_parser.y"
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
@@ -331,17 +372,17 @@ BuildCmds= \
# Begin Custom Build
InputDir=.
InputPath=".\zend-parser.y"
InputPath=".\zend_language_parser.y"
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
@@ -349,17 +390,17 @@ BuildCmds= \
# Begin Custom Build
InputDir=.
InputPath=".\zend-parser.y"
InputPath=".\zend_language_parser.y"
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
@@ -372,35 +413,56 @@ BuildCmds= \
# PROP Default_Filter "l"
# Begin Source File
SOURCE=".\zend-scanner.l"
SOURCE=.\zend_ini_scanner.l
!IF "$(CFG)" == "Zend - Win32 Release"
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
# Begin Custom Build
InputPath=.\zend_ini_scanner.l
"zend_ini_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.c zend_ini_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
!ENDIF
# End Source File
# Begin Source File
SOURCE=".\zend_language_scanner.l"
!IF "$(CFG)" == "Zend - Win32 Release"
# Begin Custom Build
InputPath=".\zend-scanner.l"
InputPath=".\zend_language_scanner.l"
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -i -Pzend -ozend-scanner.c zend-scanner.l
"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "Zend - Win32 Debug"
# Begin Custom Build
InputPath=".\zend-scanner.l"
InputPath=".\zend_language_scanner.l"
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -i -Pzend -ozend-scanner.c zend-scanner.l
"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "Zend - Win32 Release_inline"
# Begin Custom Build
InputPath=".\zend-scanner.l"
InputPath=".\zend_language_scanner.l"
"zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -i -Pzend -ozend-scanner.c zend-scanner.l
"zend_language_scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -i -Pzend -ozend_language_scanner.c zend_language_scanner.l
# End Custom Build
+2 -2
View File
@@ -6,8 +6,8 @@ if test "$YACC" != "bison -y"; then
else
AC_MSG_CHECKING(bison version)
set `bison --version| sed -e 's/^GNU Bison version //' -e 's/\./ /'`
if test "${1}" = "1" -a "${2}" -lt "25"; then
AC_MSG_WARN(You will need bison 1.25 if you want to regenerate the Zend parser (found ${1}.${2}).)
if test "${1}" = "1" -a "${2}" -lt "28"; then
AC_MSG_WARN(You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)
fi
AC_MSG_RESULT(${1}.${2} (ok))
fi
+1 -1
View File
@@ -86,7 +86,7 @@
".\zend_llist.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend-parser.tab.h"\
".\zend_language_parser.tab.h"\
".\zend.h"\
".\zend_errors.h"\
".\zend_globals.h"\
+164 -42
View File
@@ -107,14 +107,6 @@ LIB32=link.exe -lib
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=".\zend-parser.c"
# End Source File
# Begin Source File
SOURCE=".\zend-scanner.cpp"
# End Source File
# Begin Source File
SOURCE=.\zend.c
# End Source File
# Begin Source File
@@ -167,6 +159,26 @@ SOURCE=.\zend_indent.c
# End Source File
# Begin Source File
SOURCE=.\zend_ini.c
# End Source File
# Begin Source File
SOURCE=.\zend_ini_parser.c
# End Source File
# Begin Source File
SOURCE=.\zend_ini_scanner.cpp
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.c"
# End Source File
# Begin Source File
SOURCE=".\zend_language_scanner.cpp"
# End Source File
# Begin Source File
SOURCE=.\zend_list.c
# End Source File
# Begin Source File
@@ -211,14 +223,6 @@ SOURCE=.\modules.h
# End Source File
# Begin Source File
SOURCE=".\zend-parser.h"
# End Source File
# Begin Source File
SOURCE=".\zend-scanner.h"
# End Source File
# Begin Source File
SOURCE=.\zend.h
# End Source File
# Begin Source File
@@ -291,6 +295,26 @@ SOURCE=.\zend_indent.h
# End Source File
# Begin Source File
SOURCE=.\zend_ini.h
# End Source File
# Begin Source File
SOURCE=.\zend_ini_parser.h
# End Source File
# Begin Source File
SOURCE=.\zend_ini_scanner.h
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.h"
# End Source File
# Begin Source File
SOURCE=".\zend_language_scanner.h"
# End Source File
# Begin Source File
SOURCE=.\zend_list.h
# End Source File
# Begin Source File
@@ -319,23 +343,23 @@ SOURCE=.\zend_variables.h
# PROP Default_Filter "y"
# Begin Source File
SOURCE=".\zend-parser.y"
SOURCE=.\zend_ini_parser.y
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
# Begin Custom Build
InputDir=.
InputPath=".\zend-parser.y"
InputPath=.\zend_ini_parser.y
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
@@ -343,17 +367,17 @@ BuildCmds= \
# Begin Custom Build
InputDir=.
InputPath=".\zend-parser.y"
InputPath=.\zend_ini_parser.y
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
@@ -361,17 +385,78 @@ BuildCmds= \
# Begin Custom Build
InputDir=.
InputPath=".\zend-parser.y"
InputPath=.\zend_ini_parser.y
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend-parser.y \
if "X%CYGWIN%"=="X" bison --output=zend-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.y"
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
# Begin Custom Build
InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
# Begin Custom Build
InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
# Begin Custom Build
InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
@@ -384,35 +469,72 @@ BuildCmds= \
# PROP Default_Filter "l"
# Begin Source File
SOURCE=".\zend-scanner.l"
SOURCE=.\zend_ini_scanner.l
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
# Begin Custom Build
InputPath=".\zend-scanner.l"
InputPath=.\zend_ini_scanner.l
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
# Begin Custom Build
InputPath=".\zend-scanner.l"
InputPath=.\zend_ini_scanner.l
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
# Begin Custom Build
InputPath=".\zend-scanner.l"
InputPath=.\zend_ini_scanner.l
"zend-scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pzend -ozend-scanner.cpp zend-scanner.l
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=".\zend_language_scanner.l"
!IF "$(CFG)" == "ZendTS - Win32 Release_TS"
# Begin Custom Build
InputPath=".\zend_language_scanner.l"
"zend_language_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pzend -ozend_language_scanner.cpp zend_language_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Debug_TS"
# Begin Custom Build
InputPath=".\zend_language_scanner.l"
"zend_language_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pzend -ozend_language_scanner.cpp zend_language_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TS_inline"
# Begin Custom Build
InputPath=".\zend_language_scanner.l"
"zend_language_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pzend -ozend_language_scanner.cpp zend_language_scanner.l
# End Custom Build
-4
View File
@@ -3,10 +3,6 @@
@TOP@
/* these are defined by automake */
#undef PACKAGE
#undef VERSION
#undef uint
#undef ulong
+1 -1
View File
@@ -2,7 +2,7 @@ dnl $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(zend.c)
AM_INIT_AUTOMAKE(zend, 0.80A)
AM_INIT_AUTOMAKE(zend, 0.80A, nodefine)
AM_CONFIG_HEADER(zend_config.h)
AM_SANITY_CHECK
AM_MAINTAINER_MODE
-725
View File
@@ -1,725 +0,0 @@
%{
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.zend.com/license/0_92.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/*
* LALR shift/reduce conflicts and how they are resolved:
*
* - 2 shift/reduce conflicts due to the dangeling elseif/else ambiguity. Solved by shift.
* - 1 shift/reduce conflict due to arrays within encapsulated strings. Solved by shift.
* - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift.
*
*/
#include "zend_compile.h"
#include "zend.h"
#include "zend_list.h"
#include "zend_globals.h"
#include "zend_API.h"
#define YYERROR_VERBOSE
#define YYSTYPE znode
#ifdef ZTS
# define YYPARSE_PARAM compiler_globals
# define YYLEX_PARAM compiler_globals
#endif
%}
%pure_parser
%expect 4
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
%left ','
%left T_LOGICAL_OR
%left T_LOGICAL_XOR
%left T_LOGICAL_AND
%right T_PRINT
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL
%left '?' ':'
%left T_BOOLEAN_OR
%left T_BOOLEAN_AND
%left '|'
%left '^'
%left '&'
%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 '+' '-' '.'
%left '*' '/' '%'
%right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
%right '['
%nonassoc T_NEW
%token T_EXIT
%token T_IF
%left T_ELSEIF
%left T_ELSE
%left T_ENDIF
%token T_LNUMBER
%token T_DNUMBER
%token T_STRING
%token T_STRING_VARNAME
%token T_VARIABLE
%token T_NUM_STRING
%token T_INLINE_HTML
%token T_CHARACTER
%token T_BAD_CHARACTER
%token T_ENCAPSED_AND_WHITESPACE
%token T_CONSTANT_ENCAPSED_STRING
%token T_ECHO
%token T_DO
%token T_WHILE
%token T_ENDWHILE
%token T_FOR
%token T_ENDFOR
%token T_FOREACH
%token T_ENDFOREACH
%token T_DECLARE
%token T_ENDDECLARE
%token T_AS
%token T_SWITCH
%token T_ENDSWITCH
%token T_CASE
%token T_DEFAULT
%token T_BREAK
%token T_CONTINUE
%token T_OLD_FUNCTION
%token T_FUNCTION
%token T_CONST
%token T_RETURN
%token T_USE
%token T_GLOBAL
%token T_STATIC
%token T_VAR
%token T_UNSET
%token T_ISSET
%token T_EMPTY
%token T_CLASS
%token T_EXTENDS
%token T_OBJECT_OPERATOR
%token T_DOUBLE_ARROW
%token T_LIST
%token T_ARRAY
%token T_LINE
%token T_FILE
%token T_COMMENT
%token T_ML_COMMENT
%token T_OPEN_TAG
%token T_OPEN_TAG_WITH_ECHO
%token T_CLOSE_TAG
%token T_WHITESPACE
%token T_START_HEREDOC
%token T_END_HEREDOC
%token T_DOLLAR_OPEN_CURLY_BRACES
%token T_CURLY_OPEN
%token T_PAAMAYIM_NEKUDOTAYIM
%% /* Rules */
start:
top_statement_list
;
top_statement_list:
top_statement_list { do_extended_info(CLS_C); } top_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
top_statement:
statement
| declaration_statement { do_early_binding(CLS_C); }
;
inner_statement_list:
inner_statement_list { do_extended_info(CLS_C); } inner_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
inner_statement:
statement
| declaration_statement
;
statement:
unticked_statement { do_ticks(CLS_C); }
;
unticked_statement:
'{' inner_statement_list '}'
| T_IF '(' expr ')' { do_if_cond(&$3, &$4 CLS_CC); } statement { do_if_after_statement(&$4, 1 CLS_CC); } elseif_list else_single { do_if_end(CLS_C); }
| T_IF '(' expr ')' ':' { do_if_cond(&$3, &$4 CLS_CC); } inner_statement_list { do_if_after_statement(&$4, 1 CLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { do_if_end(CLS_C); }
| T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { do_while_cond(&$4, &$5 CLS_CC); } while_statement { do_while_end(&$1, &$5 CLS_CC); }
| T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); do_do_while_begin(CLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { do_do_while_end(&$1, &$5, &$7 CLS_CC); }
| T_FOR
'('
for_expr
';' { do_free(&$3 CLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); }
for_expr
';' { do_extended_info(CLS_C); do_for_cond(&$6, &$7 CLS_CC); }
for_expr
')' { do_free(&$9 CLS_CC); do_for_before_statement(&$4, &$7 CLS_CC); }
for_statement { do_for_end(&$7 CLS_CC); }
| T_SWITCH '(' expr ')' { do_switch_cond(&$3 CLS_CC); } switch_case_list { do_switch_end(&$6 CLS_CC); }
| T_BREAK ';' { do_brk_cont(ZEND_BRK, NULL CLS_CC); }
| T_BREAK expr ';' { do_brk_cont(ZEND_BRK, &$2 CLS_CC); }
| T_CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); }
| T_CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
| T_RETURN ';' { do_return(NULL, 0 CLS_CC); }
| T_RETURN expr_without_variable ';' { do_return(&$2, 0 CLS_CC); }
| T_RETURN cvar ';' { do_return(&$2, 1 CLS_CC); }
| T_GLOBAL global_var_list ';'
| T_STATIC static_var_list ';'
| T_ECHO echo_expr_list ';'
| T_INLINE_HTML { do_echo(&$1 CLS_CC); }
| expr ';' { do_free(&$1 CLS_CC); }
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
| T_UNSET '(' unset_variables ')' ';'
| T_FOREACH '(' w_cvar T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 1 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
| T_FOREACH '(' expr_without_variable T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
| T_DECLARE { do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { do_declare_end(CLS_C); }
| ';' /* empty statement */
;
unset_variables:
unset_variable
| unset_variables ',' unset_variable
;
unset_variable:
cvar { do_end_variable_parse(BP_VAR_UNSET, 0 CLS_CC); do_unset(&$1 CLS_CC); }
;
use_filename:
T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
| '(' T_CONSTANT_ENCAPSED_STRING ')' { $$ = $2; }
;
declaration_statement:
unticked_declaration_statement { do_ticks(CLS_C); }
;
unticked_declaration_statement:
T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
'(' parameter_list ')' '{' inner_statement_list '}' { do_end_function_declaration(&$1 CLS_CC); }
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
parameter_list '(' inner_statement_list ')' ';' { do_end_function_declaration(&$1 CLS_CC); }
| T_CLASS T_STRING { do_begin_class_declaration(&$2, NULL CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); }
| T_CLASS T_STRING T_EXTENDS T_STRING { do_begin_class_declaration(&$2, &$4 CLS_CC); } '{' class_statement_list '}' { do_end_class_declaration(CLS_C); }
;
foreach_optional_arg:
/* empty */ { $$.op_type = IS_UNUSED; }
| T_DOUBLE_ARROW w_cvar { $$ = $2; }
;
for_statement:
statement
| ':' inner_statement_list T_ENDFOR ';'
;
foreach_statement:
statement
| ':' inner_statement_list T_ENDFOREACH ';'
;
declare_statement:
statement
| ':' inner_statement_list T_ENDDECLARE ';'
;
declare_list:
T_STRING '=' static_scalar { do_declare_stmt(&$1, &$3 CLS_CC); }
| declare_list ',' T_STRING '=' static_scalar { do_declare_stmt(&$3, &$5 CLS_CC); }
;
switch_case_list:
'{' case_list '}' { $$ = $2; }
| '{' ';' case_list '}' { $$ = $3; }
| ':' case_list T_ENDSWITCH ';' { $$ = $2; }
| ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; }
;
case_list:
/* empty */ { $$.op_type = IS_UNUSED; }
| case_list T_CASE expr case_separator { do_extended_info(CLS_C); 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_extended_info(CLS_C); do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
;
case_separator:
':'
| ';'
;
while_statement:
statement
| ':' inner_statement_list T_ENDWHILE ';'
;
elseif_list:
/* empty */
| elseif_list T_ELSEIF '(' expr ')' { do_if_cond(&$4, &$5 CLS_CC); } statement { do_if_after_statement(&$5, 0 CLS_CC); }
;
new_elseif_list:
/* empty */
| new_elseif_list T_ELSEIF '(' expr ')' ':' { do_if_cond(&$4, &$5 CLS_CC); } inner_statement_list { do_if_after_statement(&$5, 0 CLS_CC); }
;
else_single:
/* empty */
| T_ELSE statement
;
new_else_single:
/* empty */
| T_ELSE ':' inner_statement_list
;
parameter_list:
non_empty_parameter_list
| /* empty */
;
non_empty_parameter_list:
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); }
;
function_call_parameter_list:
non_empty_function_call_parameter_list { $$ = $1; }
| /* empty */ { $$.u.constant.value.lval = 0; }
;
non_empty_function_call_parameter_list:
expr_without_variable { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
| cvar { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
| '&' w_cvar { $$.u.constant.value.lval = 1; do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
| non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
| non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
| non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
;
global_var_list:
global_var_list ',' global_var { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
| global_var { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
;
global_var:
T_VARIABLE { $$ = $1; }
| '$' r_cvar { $$ = $2; }
| '$' '{' expr '}' { $$ = $3; }
;
static_var_list:
static_var_list ',' T_VARIABLE { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_STATIC CLS_CC); }
| static_var_list ',' T_VARIABLE '=' static_scalar { do_fetch_global_or_static_variable(&$3, &$5, ZEND_FETCH_STATIC CLS_CC); }
| T_VARIABLE { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_STATIC CLS_CC); }
| T_VARIABLE '=' static_scalar { do_fetch_global_or_static_variable(&$1, &$3, ZEND_FETCH_STATIC CLS_CC); }
;
class_statement_list:
class_statement_list class_statement
| /* empty */
;
class_statement:
T_VAR class_variable_decleration ';'
| T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); } '('
parameter_list ')' '{' inner_statement_list '}' { do_end_function_declaration(&$1 CLS_CC); }
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); }
parameter_list '(' inner_statement_list ')' ';' { do_end_function_declaration(&$1 CLS_CC); }
;
is_reference:
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
| '&' { $$.op_type = ZEND_RETURN_REF; }
class_variable_decleration:
class_variable_decleration ',' T_VARIABLE { do_declare_property(&$3, NULL CLS_CC); }
| class_variable_decleration ',' T_VARIABLE '=' static_scalar { do_declare_property(&$3, &$5 CLS_CC); }
| T_VARIABLE { do_declare_property(&$1, NULL CLS_CC); }
| T_VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); }
;
echo_expr_list:
| echo_expr_list ',' expr { do_echo(&$3 CLS_CC); }
| expr { do_echo(&$1 CLS_CC); }
;
for_expr:
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; }
| non_empty_for_expr { $$ = $1; }
;
non_empty_for_expr:
non_empty_for_expr ',' { do_free(&$1 CLS_CC); } expr { $$ = $4; }
| expr { $$ = $1; }
;
expr_without_variable:
T_LIST '(' { do_list_init(CLS_C); } assignment_list ')' '=' expr { do_list_end(&$$, &$7 CLS_CC); }
| cvar '=' expr { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); do_assign(&$$, &$1, &$3 CLS_CC); }
| cvar '=' '&' w_cvar { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); do_assign_ref(&$$, &$1, &$4 CLS_CC); }
| cvar '=' '&' function_call { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); do_assign_ref(&$$, &$1, &$4 CLS_CC); }
| T_NEW class_name { do_extended_fcall_begin(CLS_C); do_begin_new_object(&$1, &$2 CLS_CC); } ctor_arguments { do_end_new_object(&$$, &$2, &$1, &$4 CLS_CC); do_extended_fcall_end(CLS_C);}
| cvar T_PLUS_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 CLS_CC); }
| cvar T_MINUS_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 CLS_CC); }
| cvar T_MUL_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 CLS_CC); }
| cvar T_DIV_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 CLS_CC); }
| cvar T_CONCAT_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 CLS_CC); }
| cvar T_MOD_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); }
| cvar T_AND_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); }
| cvar T_OR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); }
| cvar T_XOR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
| cvar T_SL_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); }
| cvar T_SR_EQUAL expr { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); }
| rw_cvar T_INC { do_post_incdec(&$$, &$1, ZEND_POST_INC CLS_CC); }
| T_INC rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_INC CLS_CC); }
| rw_cvar T_DEC { do_post_incdec(&$$, &$1, ZEND_POST_DEC CLS_CC); }
| T_DEC rw_cvar { do_pre_incdec(&$$, &$2, ZEND_PRE_DEC CLS_CC); }
| expr T_BOOLEAN_OR { do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); }
| expr T_BOOLEAN_AND { do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); }
| expr T_LOGICAL_OR { do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); }
| expr T_LOGICAL_AND { do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); }
| expr T_LOGICAL_XOR expr { do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 CLS_CC); }
| expr '|' expr { do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 CLS_CC); }
| expr '&' expr { do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 CLS_CC); }
| expr '^' expr { do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 CLS_CC); }
| expr '.' expr { do_binary_op(ZEND_CONCAT,&$$,&$1,&$3 CLS_CC); }
| expr '+' expr { do_binary_op(ZEND_ADD,&$$,&$1,&$3 CLS_CC); }
| expr '-' expr { do_binary_op(ZEND_SUB,&$$,&$1,&$3 CLS_CC); }
| expr '*' expr { do_binary_op(ZEND_MUL,&$$,&$1,&$3 CLS_CC); }
| expr '/' expr { do_binary_op(ZEND_DIV,&$$,&$1,&$3 CLS_CC); }
| expr '%' expr { do_binary_op(ZEND_MOD,&$$,&$1,&$3 CLS_CC); }
| expr T_SL expr { do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); }
| expr T_SR expr { do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); }
| '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); do_binary_op(ZEND_ADD, &$$, &$1, &$2 CLS_CC); }
| '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); do_binary_op(ZEND_SUB, &$$, &$1, &$2 CLS_CC); }
| '!' 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); }
| expr T_IS_SMALLER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); }
| expr '>' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 CLS_CC); }
| expr T_IS_GREATER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); }
| '(' expr ')' { $$ = $2; }
| expr '?' { do_begin_qm_op(&$1, &$2 CLS_CC); }
expr ':' { do_qm_true(&$4, &$2, &$5 CLS_CC); }
expr { do_qm_false(&$$, &$7, &$2, &$5 CLS_CC); }
| function_call { $$ = $1; }
| internal_functions_in_yacc { $$ = $1; }
| T_INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); }
| T_DOUBLE_CAST expr { do_cast(&$$, &$2, IS_DOUBLE CLS_CC); }
| T_STRING_CAST expr { do_cast(&$$, &$2, IS_STRING CLS_CC); }
| T_ARRAY_CAST expr { do_cast(&$$, &$2, IS_ARRAY CLS_CC); }
| T_OBJECT_CAST expr { do_cast(&$$, &$2, IS_OBJECT CLS_CC); }
| T_BOOL_CAST expr { do_cast(&$$, &$2, IS_BOOL CLS_CC); }
| T_UNSET_CAST expr { do_cast(&$$, &$2, IS_NULL CLS_CC); }
| T_EXIT exit_expr { do_exit(&$$, &$2 CLS_CC); }
| '@' { do_begin_silence(&$1 CLS_CC); } expr { do_end_silence(&$1 CLS_CC); $$ = $3; }
| scalar { $$ = $1; }
| T_ARRAY '(' array_pair_list ')' { $$ = $3; }
| '`' encaps_list '`' { do_shell_exec(&$$, &$2 CLS_CC); }
| T_PRINT expr { do_print(&$$, &$2 CLS_CC); }
;
function_call:
T_STRING '(' { $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
function_call_parameter_list
')' { do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num CLS_CC); do_extended_fcall_end(CLS_C); }
| cvar '(' { do_begin_dynamic_function_call(&$1 CLS_CC); }
function_call_parameter_list
')' { do_end_function_call(&$1, &$$, &$4, 0, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
| T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_class_member_function_call(&$1, &$3 CLS_CC); }
function_call_parameter_list
')' { do_end_function_call(&$3, &$$, &$6, 1, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
;
exit_expr:
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
| '(' expr ')' { $$ = $2; }
;
ctor_arguments:
/* empty */ { $$.u.constant.value.lval=0; }
| '(' function_call_parameter_list ')' { $$ = $2; }
;
class_name:
T_STRING { $$ = $1; }
| r_cvar { $$ = $1; }
;
common_scalar:
T_LNUMBER { $$ = $1; }
| T_DNUMBER { $$ = $1; }
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
| T_LINE { $$ = $1; }
| T_FILE { $$ = $1; }
;
static_scalar: /* compile-time evaluated scalars */
common_scalar { $$ = $1; }
| T_STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
| '+' static_scalar { $$ = $1; }
| '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
;
scalar:
T_STRING { do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); }
| T_STRING_VARNAME { $$ = $1; }
| common_scalar { $$ = $1; }
| '"' encaps_list '"' { $$ = $2; }
| '\'' encaps_list '\'' { $$ = $2; }
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; do_end_heredoc(CLS_C); }
;
static_array_pair_list:
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
;
possible_comma:
/* empty */
| ','
;
non_empty_static_array_pair_list:
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { do_add_static_array_element(&$$, &$3, &$5); }
| non_empty_static_array_pair_list ',' static_scalar { do_add_static_array_element(&$$, NULL, &$3); }
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); }
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, NULL, &$1); }
;
expr:
r_cvar { $$ = $1; }
| expr_without_variable { $$ = $1; }
;
/*
w_expr:
w_cvar { $$ = $1; }
| expr_without_variable { $$ = $1; }
;
*/
r_cvar:
cvar { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
;
w_cvar:
cvar { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); $$ = $1; }
;
rw_cvar:
cvar { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); $$ = $1; }
;
cvar:
cvar_without_objects { $$ = $1; }
| cvar_without_objects T_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } ref_list { $$ = $4; }
;
cvar_without_objects:
reference_variable { $$ = $1; }
| simple_indirect_reference reference_variable { do_indirect_references(&$$, &$1, &$2 CLS_CC); }
;
reference_variable:
reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
;
compound_variable:
T_VARIABLE { $$ = $1; }
| '$' '{' expr '}' { $$ = $3; }
;
dim_offset:
/* empty */ { $$.op_type = IS_UNUSED; }
| expr { $$ = $1; }
;
ref_list:
object_property { $$ = $1; }
| ref_list T_OBJECT_OPERATOR { do_push_object(&$1 CLS_CC); } object_property { $$ = $4; }
;
object_property:
object_dim_list { $$ = $1; }
| cvar_without_objects { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); } { znode tmp_znode; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
;
object_dim_list:
object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
| object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
| variable_name { znode tmp_znode; do_pop_object(&tmp_znode CLS_CC); do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
;
variable_name:
T_STRING { $$ = $1; }
| '{' expr '}' { $$ = $2; }
;
simple_indirect_reference:
'$' { $$.u.constant.value.lval = 1; }
| simple_indirect_reference '$' { $$.u.constant.value.lval++; }
;
assignment_list:
assignment_list ',' assignment_list_element
| assignment_list_element
;
assignment_list_element:
cvar { do_add_list_element(&$1 CLS_CC); }
| T_LIST '(' { do_new_list_begin(CLS_C); } assignment_list ')' { do_new_list_end(CLS_C); }
| /* empty */ { do_add_list_element(NULL CLS_CC); }
;
array_pair_list:
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
| non_empty_array_pair_list possible_comma { $$ = $1; }
;
non_empty_array_pair_list:
non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { do_add_array_element(&$$, &$5, &$3, 0 CLS_CC); }
| non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL, 0 CLS_CC); }
| expr T_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1, 0 CLS_CC); }
| expr { do_init_array(&$$, &$1, NULL, 0 CLS_CC); }
| non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_cvar { do_add_array_element(&$$, &$6, &$3, 1 CLS_CC); }
| non_empty_array_pair_list ',' '&' w_cvar { do_add_array_element(&$$, &$4, NULL, 1 CLS_CC); }
| expr T_DOUBLE_ARROW '&' w_cvar { do_init_array(&$$, &$4, &$1, 1 CLS_CC); }
| '&' w_cvar { do_init_array(&$$, &$2, NULL, 1 CLS_CC); }
;
encaps_list:
encaps_list encaps_var { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); do_add_variable(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_NUM_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
| 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.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); }
;
encaps_var:
T_VARIABLE { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
| T_VARIABLE '[' { do_begin_variable_parse(CLS_C); } encaps_var_offset ']' { do_fetch_globals(&$1 CLS_CC); fetch_array_begin(&$$, &$1, &$4 CLS_CC); }
| T_VARIABLE T_OBJECT_OPERATOR T_STRING { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$2, &$1, 1 CLS_CC); do_fetch_property(&$$, &$2, &$3 CLS_CC); }
| T_DOLLAR_OPEN_CURLY_BRACES expr '}' { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$2, 1 CLS_CC); }
| T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$2, &$4 CLS_CC); }
| T_CURLY_OPEN cvar '}' { $$ = $2; }
;
encaps_var_offset:
T_STRING { $$ = $1; }
| T_NUM_STRING { $$ = $1; }
| T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
;
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_ONCE expr { do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
| T_EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
| T_REQUIRE expr { do_include_or_eval(ZEND_REQUIRE, &$$, &$2 CLS_CC); }
| T_REQUIRE_ONCE expr { do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 CLS_CC); }
;
%%
+12
View File
@@ -198,11 +198,23 @@ ZEND_API void zend_print_zval_r_ex(zend_write_func_t write_func, zval *expr, int
switch(expr->type) {
case IS_ARRAY:
ZEND_PUTS("Array\n");
if (++expr->value.ht->nApplyCount>1) {
ZEND_PUTS(" *RECURSION*");
expr->value.ht->nApplyCount=0;
return;
}
print_hash(expr->value.ht,indent);
expr->value.ht->nApplyCount--;
break;
case IS_OBJECT:
if (++expr->value.obj.properties->nApplyCount>1) {
ZEND_PUTS(" *RECURSION*");
expr->value.obj.properties->nApplyCount=0;
return;
}
zend_printf("%s Object\n", expr->value.obj.ce->name);
print_hash(expr->value.obj.properties, indent);
expr->value.obj.properties->nApplyCount--;
break;
default:
zend_print_variable(expr);
+16 -1
View File
@@ -21,7 +21,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "1.0.2"
#define ZEND_VERSION "1.0.4"
#ifdef __cplusplus
#define BEGIN_EXTERN_C() extern "C" {
@@ -421,6 +421,21 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
} \
INIT_PZVAL(&(zv));
#define REPLACE_ZVAL_VALUE(ppzv_dest,pzv_src,copy) { \
int is_ref,refcount; \
\
SEPARATE_ZVAL_IF_NOT_REF(ppzv_dest); \
is_ref = (*ppzv_dest)->is_ref; \
refcount = (*ppzv_dest)->refcount; \
zval_dtor(*ppzv_dest); \
**ppzv_dest = *pzv_src; \
if(copy) { \
zval_copy_ctor(*ppzv_dest); \
} \
(*ppzv_dest)->is_ref = is_ref; \
(*ppzv_dest)->refcount = refcount; \
}
#define ZEND_MAX_RESERVED_RESOURCES 2
#ifdef ZEND_WIN32
+2 -2
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 module_registry;
ZEND_API HashTable module_registry;
/* this function doesn't check for too many parameters */
ZEND_API int zend_get_parameters(int ht, int param_count, ...)
@@ -892,7 +892,7 @@ ZEND_API zend_class_entry *zend_register_internal_class_ex(zend_class_entry *cla
register_class = zend_register_internal_class(class_entry);
if (parent_ce) {
do_inheritance(register_class, parent_ce);
zend_do_inheritance(register_class, parent_ce);
}
return register_class;
}
+2 -2
View File
@@ -177,8 +177,8 @@ ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length,
ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, int duplicate);
ZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
ZEND_API int add_property_long(zval *arg, char *key, long l);
ZEND_API int add_property_unset(zval *arg, char *key);
+29 -1
View File
@@ -137,6 +137,9 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
p->orig_lineno = __zend_orig_lineno;
p->magic = MEM_BLOCK_START_MAGIC;
p->reported = 0;
/* Setting the thread id should not be necessary, because we fetched this block
* from this thread's cache
*/
AG(cache_stats)[CACHE_INDEX][1]++;
#endif
p->persistent = 0;
@@ -177,6 +180,9 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
p->orig_lineno = __zend_orig_lineno;
p->magic = MEM_BLOCK_START_MAGIC;
p->reported = 0;
# ifdef ZTS
p->thread_id = tsrm_thread_id();
# endif
*((long *)(((char *) p) + sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE))) = MEM_BLOCK_END_MAGIC;
#endif
#if MEMORY_LIMIT
@@ -193,6 +199,15 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
DECLARE_CACHE_VARS
ALS_FETCH();
#if defined(ZTS) && ZEND_DEBUG
if (p->thread_id != tsrm_thread_id()) {
tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at %s:(%d) on thread %x freed at %s:(%d) on thread %x, ignoring",
p->filename, p->lineno, p->thread_id,
__zend_filename, __zend_lineno, tsrm_thread_id());
return;
}
#endif
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
#if ZEND_DEBUG
if (!_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
@@ -253,6 +268,19 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
return _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
#if defined(ZTS) && ZEND_DEBUG
if (p->thread_id != tsrm_thread_id()) {
void *new_p;
tsrm_error(TSRM_ERROR_LEVEL_ERROR, "Memory block allocated at %s:(%d) on thread %x reallocated at %s:(%d) on thread %x, duplicating",
p->filename, p->lineno, p->thread_id,
__zend_filename, __zend_lineno, tsrm_thread_id());
new_p = _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
memcpy(new_p, ptr, p->size);
return new_p;
}
#endif
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
HANDLE_BLOCK_INTERRUPTIONS();
@@ -520,7 +548,7 @@ void zend_debug_alloc_output(char *format, ...)
#ifdef ZEND_WIN32
OutputDebugString(output_buf);
#else
fprintf(stderr, output_buf);
fprintf(stderr, "%s", output_buf);
#endif
}
+9 -1
View File
@@ -23,6 +23,10 @@
#include <stdio.h>
#ifdef ZTS
#include "../TSRM/TSRM.h"
#endif
#include "zend_globals_macros.h"
#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
@@ -38,6 +42,9 @@ typedef struct _zend_mem_header {
int reported;
char *orig_filename;
uint orig_lineno;
# ifdef ZTS
THREAD_T thread_id;
# endif
#endif
struct _zend_mem_header *pNext;
struct _zend_mem_header *pLast;
@@ -64,10 +71,11 @@ typedef union _align_test {
#define PLATFORM_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
ZEND_API char *zend_strndup(const char *s, unsigned int length);
BEGIN_EXTERN_C()
ZEND_API char *zend_strndup(const char *s, unsigned int length);
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
+74 -4
View File
@@ -29,7 +29,7 @@ static ZEND_FUNCTION(zend_version);
static ZEND_FUNCTION(func_num_args);
static ZEND_FUNCTION(func_get_arg);
static ZEND_FUNCTION(func_get_args);
static ZEND_FUNCTION(strlen);
static ZEND_NAMED_FUNCTION(zend_if_strlen);
static ZEND_FUNCTION(strcmp);
static ZEND_FUNCTION(strncmp);
static ZEND_FUNCTION(strcasecmp);
@@ -56,6 +56,8 @@ static ZEND_FUNCTION(trigger_error);
static ZEND_FUNCTION(set_error_handler);
static ZEND_FUNCTION(restore_error_handler);
static ZEND_FUNCTION(get_declared_classes);
static ZEND_FUNCTION(get_defined_functions);
static ZEND_FUNCTION(get_defined_vars);
static ZEND_FUNCTION(create_function);
static ZEND_FUNCTION(get_resource_type);
#if ZEND_DEBUG
@@ -72,7 +74,7 @@ static zend_function_entry builtin_functions[] = {
ZEND_FE(func_num_args, NULL)
ZEND_FE(func_get_arg, NULL)
ZEND_FE(func_get_args, NULL)
ZEND_FE(strlen, NULL)
{ "strlen", zend_if_strlen, NULL },
ZEND_FE(strcmp, NULL)
ZEND_FE(strncmp, NULL)
ZEND_FE(strcasecmp, NULL)
@@ -101,6 +103,8 @@ static zend_function_entry builtin_functions[] = {
ZEND_FE(set_error_handler, NULL)
ZEND_FE(restore_error_handler, NULL)
ZEND_FE(get_declared_classes, NULL)
ZEND_FE(get_defined_functions, NULL)
ZEND_FE(get_defined_vars, NULL)
ZEND_FE(create_function, NULL)
ZEND_FE(get_resource_type, NULL)
#if ZEND_DEBUG
@@ -217,7 +221,7 @@ ZEND_FUNCTION(func_get_args)
/* {{{ proto int strlen(string str)
Get string length */
ZEND_FUNCTION(strlen)
ZEND_NAMED_FUNCTION(zend_if_strlen)
{
zval **str;
@@ -527,6 +531,10 @@ ZEND_FUNCTION(get_class_vars)
} else {
efree(lcname);
array_init(return_value);
if (!ce->constants_updated) {
zend_hash_apply_with_argument(&ce->default_properties, (int (*)(void *,void *)) zval_update_constant, (void *) 1);
ce->constants_updated = 1;
}
zend_hash_copy(return_value->value.ht, &ce->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
}
}
@@ -584,7 +592,7 @@ ZEND_FUNCTION(get_class_methods)
while ((key_type = zend_hash_get_current_key(&ce->function_table, &string_key, &num_key)) != HASH_KEY_NON_EXISTANT) {
if (key_type == HASH_KEY_IS_STRING) {
MAKE_STD_ZVAL(method_name);
ZVAL_STRING(method_name, string_key, 1);
ZVAL_STRING(method_name, string_key, 0);
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
}
zend_hash_move_forward(&ce->function_table);
@@ -851,6 +859,68 @@ ZEND_FUNCTION(get_declared_classes)
}
/* }}} */
static int copy_function_name(zend_function *func, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *internal_ar = va_arg(args, zval *),
*user_ar = va_arg(args, zval *);
if (hash_key->nKeyLength == 0 || hash_key->arKey[0] == 0) {
return 0;
}
if (func->type == ZEND_INTERNAL_FUNCTION) {
add_next_index_stringl(internal_ar, hash_key->arKey, hash_key->nKeyLength, 1);
} else if (func->type == ZEND_USER_FUNCTION) {
add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength, 1);
}
return 0;
}
/* {{{ proto array get_defined_functions(void)
Returns an array of all defined functions */
ZEND_FUNCTION(get_defined_functions)
{
zval *internal;
zval *user;
if (ZEND_NUM_ARGS() != 0) {
ZEND_WRONG_PARAM_COUNT();
}
MAKE_STD_ZVAL(internal);
MAKE_STD_ZVAL(user);
array_init(internal);
array_init(user);
array_init(return_value);
zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t)copy_function_name, 2, internal, user);
if (zend_hash_add(return_value->value.ht, "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
zend_error(E_WARNING, "Cannot add internal functions to return value from get_defined_functions()");
RETURN_FALSE;
}
if (zend_hash_add(return_value->value.ht, "user", sizeof("user"), (void **)&user, sizeof(zval *), NULL) == FAILURE) {
zend_error(E_WARNING, "Cannot add user functions to return value from get_defined_functions()");
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto array get_defined_vars(void)
Returns an associative array of names and values of all currently defined variable names (variables in the current scope) */
ZEND_FUNCTION(get_defined_vars)
{
zval *tmp;
array_init(return_value);
zend_hash_copy(return_value->value.ht, EG(active_symbol_table),
(copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval *));
}
/* }}} */
#define LAMBDA_TEMP_FUNCNAME "__lambda_func"
+143 -140
View File
@@ -18,7 +18,7 @@
*/
#include "zend-parser.h"
#include "zend_language_parser.h"
#include "zend.h"
#include "zend_compile.h"
#include "zend_llist.h"
@@ -34,9 +34,6 @@ ZEND_API zend_compiler_globals compiler_globals;
ZEND_API zend_executor_globals executor_globals;
#endif
#define SET_UNUSED(op) (op).op_type = IS_UNUSED
static void free_filename(void *p)
{
efree(*((char **) p));
@@ -157,7 +154,7 @@ static zend_uint get_temporary_variable(zend_op_array *op_array)
}
void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
void zend_do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -170,7 +167,7 @@ void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
}
void do_unary_op(int op, znode *result, znode *op1 CLS_DC)
void zend_do_unary_op(int op, znode *result, znode *op1 CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -183,7 +180,7 @@ void do_unary_op(int op, znode *result, znode *op1 CLS_DC)
}
void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
void zend_do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -198,7 +195,7 @@ void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
void do_fetch_globals(znode *varname CLS_DC)
void zend_do_fetch_globals(znode *varname CLS_DC)
{
if (!CG(active_op_array)->uses_globals
&& varname->op_type == IS_CONST
@@ -278,7 +275,7 @@ void fetch_string_offset(znode *result, znode *parent, znode *offset CLS_DC)
}
void do_print(znode *result, znode *arg CLS_DC)
void zend_do_print(znode *result, znode *arg CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -291,7 +288,7 @@ void do_print(znode *result, znode *arg CLS_DC)
}
void do_echo(znode *arg CLS_DC)
void zend_do_echo(znode *arg CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -301,7 +298,7 @@ void do_echo(znode *arg CLS_DC)
}
void do_assign(znode *result, znode *variable, znode *value CLS_DC)
void zend_do_assign(znode *result, znode *variable, znode *value CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -315,7 +312,7 @@ void do_assign(znode *result, znode *variable, znode *value CLS_DC)
}
void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC)
void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -354,7 +351,7 @@ static inline void do_end_loop(int cont_addr CLS_DC)
}
void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC)
void zend_do_while_cond(znode *expr, znode *close_bracket_token CLS_DC)
{
int while_cond_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -369,7 +366,7 @@ void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC)
}
void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC)
void zend_do_while_end(znode *while_token, znode *close_bracket_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -388,7 +385,7 @@ void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC)
}
void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC)
void zend_do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC)
{
int for_cond_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -400,7 +397,7 @@ void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC)
}
void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC)
void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -416,7 +413,7 @@ void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CL
}
void do_for_end(znode *second_semicolon_token CLS_DC)
void zend_do_for_end(znode *second_semicolon_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -432,7 +429,7 @@ void do_for_end(znode *second_semicolon_token CLS_DC)
}
void do_pre_incdec(znode *result, znode *op1, int op CLS_DC)
void zend_do_pre_incdec(znode *result, znode *op1, int op CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -446,7 +443,7 @@ void do_pre_incdec(znode *result, znode *op1, int op CLS_DC)
}
void do_post_incdec(znode *result, znode *op1, int op CLS_DC)
void zend_do_post_incdec(znode *result, znode *op1, int op CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -459,7 +456,7 @@ void do_post_incdec(znode *result, znode *op1, int op CLS_DC)
}
void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC)
void zend_do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC)
{
int if_cond_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -472,7 +469,7 @@ void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC)
}
void do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC)
void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC)
{
int if_end_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -495,7 +492,7 @@ void do_if_after_statement(znode *closing_bracket_token, unsigned char initializ
}
void do_if_end(CLS_D)
void zend_do_if_end(CLS_D)
{
int next_op_number = get_next_op_number(CG(active_op_array));
zend_llist *jmp_list_ptr;
@@ -511,7 +508,7 @@ void do_if_end(CLS_D)
}
void do_begin_variable_parse(CLS_D)
void zend_do_begin_variable_parse(CLS_D)
{
zend_llist fetch_list;
@@ -520,7 +517,7 @@ void do_begin_variable_parse(CLS_D)
}
void do_end_variable_parse(int type, int arg_offset CLS_DC)
void zend_do_end_variable_parse(int type, int arg_offset CLS_DC)
{
zend_llist *fetch_list_ptr;
zend_llist_element *le;
@@ -585,7 +582,7 @@ static zend_bool is_method_call(CLS_D)
}
void do_init_string(znode *result CLS_DC)
void zend_do_init_string(znode *result CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -598,7 +595,7 @@ void do_init_string(znode *result CLS_DC)
}
void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC)
void zend_do_add_char(znode *result, znode *op1, znode *op2 CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -611,7 +608,7 @@ void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC)
}
void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC)
void zend_do_add_string(znode *result, znode *op1, znode *op2 CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -624,7 +621,7 @@ void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC)
}
void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
void zend_do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
{
zend_op *opline;
@@ -660,7 +657,7 @@ void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
}
void do_free(znode *op1 CLS_DC)
void zend_do_free(znode *op1 CLS_DC)
{
if (op1->op_type==IS_TMP_VAR) {
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -706,7 +703,7 @@ void do_free(znode *op1 CLS_DC)
}
void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC)
void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC)
{
zend_op_array op_array;
char *name = function_name->u.constant.value.str.val;
@@ -763,10 +760,10 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
}
void do_end_function_declaration(znode *function_token CLS_DC)
void zend_do_end_function_declaration(znode *function_token CLS_DC)
{
do_extended_info(CLS_C);
do_return(NULL, 0 CLS_CC);
zend_do_extended_info(CLS_C);
zend_do_return(NULL, 0 CLS_CC);
pass_two(CG(active_op_array));
CG(active_op_array) = function_token->u.op_array;
@@ -776,7 +773,7 @@ void do_end_function_declaration(znode *function_token CLS_DC)
}
void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC)
void zend_do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -807,7 +804,7 @@ void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, un
}
int do_begin_function_call(znode *function_name CLS_DC)
int zend_do_begin_function_call(znode *function_name CLS_DC)
{
zend_function *function;
@@ -816,7 +813,7 @@ int do_begin_function_call(znode *function_name CLS_DC)
znode tmp = *function_name;
zval_copy_ctor(&tmp.u.constant);
do_begin_dynamic_function_call(&tmp CLS_CC);
zend_do_begin_dynamic_function_call(&tmp CLS_CC);
return 1; /* Dynamic */
}
@@ -834,19 +831,19 @@ int do_begin_function_call(znode *function_name CLS_DC)
}
break;
}
do_extended_fcall_begin(CLS_C);
zend_do_extended_fcall_begin(CLS_C);
return 0;
}
void do_begin_dynamic_function_call(znode *function_name CLS_DC)
void zend_do_begin_dynamic_function_call(znode *function_name CLS_DC)
{
unsigned char *ptr = NULL;
int last_op_number;
zend_op *last_op;
if (function_name->op_type != IS_CONST && is_method_call(CLS_C)) {
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
last_op_number = get_next_op_number(CG(active_op_array))-1;
last_op = &CG(active_op_array)->opcodes[last_op_number];
last_op->opcode = ZEND_INIT_FCALL_BY_NAME;
@@ -855,7 +852,7 @@ void do_begin_dynamic_function_call(znode *function_name CLS_DC)
zend_op *opline;
if (function_name->op_type != IS_CONST) {
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
}
opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -865,11 +862,11 @@ void do_begin_dynamic_function_call(znode *function_name CLS_DC)
SET_UNUSED(opline->op1);
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
do_extended_fcall_begin(CLS_C);
zend_do_extended_fcall_begin(CLS_C);
}
void do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC)
void zend_do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC)
{
unsigned char *ptr = NULL;
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -893,7 +890,7 @@ void do_begin_class_member_function_call(znode *class_name, znode *function_name
}
void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC)
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -913,12 +910,13 @@ void do_end_function_call(znode *function_name, znode *result, znode *argument_l
}
void do_pass_param(znode *param, int op, int offset CLS_DC)
void zend_do_pass_param(znode *param, int op, int offset CLS_DC)
{
zend_op *opline;
unsigned char *arg_types;
int original_op=op;
zend_function **function_ptr_ptr, *function_ptr;
int send_by_reference;
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
@@ -942,20 +940,13 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
arg_types = NULL;
}
if (op == ZEND_SEND_VAL) {
switch (param->op_type) {
case IS_CONST: /* constants behave like variables when passed to functions,
* as far as reference counting is concerned. Treat them
* as if they were variables here.
*/
case IS_VAR:
op = ZEND_SEND_VAR;
break;
}
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)?ZEND_ARG_SEND_BY_REF:0;
if (op == ZEND_SEND_VAL && param->op_type == IS_VAR) {
op = ZEND_SEND_VAR_NO_REF;
}
if (ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)) {
if (op!=ZEND_SEND_VAR_NO_REF && send_by_reference == ZEND_ARG_SEND_BY_REF) {
/* change to passing by reference */
switch (param->op_type) {
case IS_VAR:
@@ -967,26 +958,38 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
}
}
if (original_op==ZEND_SEND_VAR) {
if (original_op == ZEND_SEND_VAR) {
switch(op) {
case ZEND_SEND_VAR_NO_REF:
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
break;
case ZEND_SEND_VAR:
if (function_ptr) {
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
} else {
do_end_variable_parse(BP_VAR_FUNC_ARG, offset CLS_CC);
zend_do_end_variable_parse(BP_VAR_FUNC_ARG, offset CLS_CC);
}
break;
case ZEND_SEND_REF:
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
break;
}
}
opline = get_next_op(CG(active_op_array) CLS_CC);
if (function_ptr) {
opline->extended_value = ZEND_DO_FCALL;
if (op == ZEND_SEND_VAR_NO_REF) {
if (function_ptr) {
opline->extended_value = ZEND_ARG_COMPILE_TIME_BOUND | send_by_reference;
} else {
opline->extended_value = 0;
}
} else {
opline->extended_value = ZEND_DO_FCALL_BY_NAME;
if (function_ptr) {
opline->extended_value = ZEND_DO_FCALL;
} else {
opline->extended_value = ZEND_DO_FCALL_BY_NAME;
}
}
opline->opcode = op;
opline->op1 = *param;
@@ -1029,15 +1032,15 @@ static int generate_free_foreach_copy(znode *foreach_copy CLS_DC)
return 0;
}
void do_return(znode *expr, int do_end_vparse CLS_DC)
void zend_do_return(znode *expr, int do_end_vparse CLS_DC)
{
zend_op *opline;
if (do_end_vparse) {
if (CG(active_op_array)->return_reference) {
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
} else {
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
}
}
#ifdef ZTS
@@ -1094,7 +1097,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce)
}
}
void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
{
zend_function tmp_zend_function;
zval *tmp;
@@ -1181,7 +1184,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
}
efree(parent_name);
do_inheritance(ce, parent_ce);
zend_do_inheritance(ce, parent_ce);
/* Register the derived class */
if (zend_hash_add(class_table, class_name, strlen(class_name)+1, ce, sizeof(zend_class_entry), NULL)==FAILURE) {
@@ -1201,7 +1204,7 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
}
void do_early_binding(CLS_D)
void zend_do_early_binding(CLS_D)
{
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
HashTable *table;
@@ -1231,7 +1234,7 @@ void do_early_binding(CLS_D)
}
void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC)
void zend_do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC)
{
int next_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1252,7 +1255,7 @@ void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC)
}
void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC)
void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1266,7 +1269,7 @@ void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_toke
}
void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC)
void zend_do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC)
{
int next_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1287,7 +1290,7 @@ void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC)
}
void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC)
void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1301,14 +1304,14 @@ void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_tok
}
void do_do_while_begin(CLS_D)
void zend_do_do_while_begin(CLS_D)
{
do_begin_loop(CLS_C);
INC_BPC(CG(active_op_array));
}
void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC)
void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1323,7 +1326,7 @@ void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_
}
void do_brk_cont(int op, znode *expr CLS_DC)
void zend_do_brk_cont(int op, znode *expr CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1341,7 +1344,7 @@ void do_brk_cont(int op, znode *expr CLS_DC)
}
void do_switch_cond(znode *cond CLS_DC)
void zend_do_switch_cond(znode *cond CLS_DC)
{
zend_switch_entry switch_entry;
zend_op *opline;
@@ -1369,7 +1372,7 @@ void do_switch_cond(znode *cond CLS_DC)
void do_switch_end(znode *case_list CLS_DC)
void zend_do_switch_end(znode *case_list CLS_DC)
{
zend_op *opline;
zend_switch_entry *switch_entry_ptr;
@@ -1414,7 +1417,7 @@ void do_switch_end(znode *case_list CLS_DC)
}
void do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC)
void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
int next_op_number;
@@ -1448,7 +1451,7 @@ void do_case_before_statement(znode *case_list, znode *case_token, znode *case_e
}
void do_case_after_statement(znode *result, znode *case_token CLS_DC)
void zend_do_case_after_statement(znode *result, znode *case_token CLS_DC)
{
int next_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1470,7 +1473,7 @@ void do_case_after_statement(znode *result, znode *case_token CLS_DC)
void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
void zend_do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
{
int next_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1503,7 +1506,7 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
}
void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC)
void zend_do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
int runtime_inheritance = 0;
@@ -1585,14 +1588,14 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
}
void do_end_class_declaration(CLS_D)
void zend_do_end_class_declaration(CLS_D)
{
do_inherit_parent_constructor(CG(active_class_entry));
CG(active_class_entry) = NULL;
}
void do_declare_property(znode *var_name, znode *value CLS_DC)
void zend_do_declare_property(znode *var_name, znode *value CLS_DC)
{
if (value) {
zval *property;
@@ -1606,7 +1609,7 @@ void do_declare_property(znode *var_name, znode *value CLS_DC)
}
void do_fetch_property(znode *result, znode *object, znode *property CLS_DC)
void zend_do_fetch_property(znode *result, znode *object, znode *property CLS_DC)
{
zend_op opline;
zend_llist *fetch_list_ptr;
@@ -1625,13 +1628,13 @@ void do_fetch_property(znode *result, znode *object, znode *property CLS_DC)
}
void do_push_object(znode *object CLS_DC)
void zend_do_push_object(znode *object CLS_DC)
{
zend_stack_push(&CG(object_stack), object, sizeof(znode));
}
void do_pop_object(znode *object CLS_DC)
void zend_do_pop_object(znode *object CLS_DC)
{
znode *tmp;
@@ -1641,7 +1644,7 @@ void do_pop_object(znode *object CLS_DC)
}
void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
void zend_do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
unsigned char *ptr = NULL;
@@ -1652,10 +1655,6 @@ void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
opline->op1 = *class_name;
SET_UNUSED(opline->op2);
/* *result = opline->result;
do_assign(result, variable, &opline->result CLS_CC); */
new_token->u.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) CLS_CC);
opline->opcode = ZEND_JMP_NO_CTOR;
@@ -1674,22 +1673,22 @@ void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
}
void do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC)
void zend_do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC)
{
znode ctor_result;
if (class_name->op_type == IS_CONST) {
zval_copy_ctor(&class_name->u.constant);
}
do_end_function_call(class_name, &ctor_result, argument_list, 1, 0 CLS_CC);
do_free(&ctor_result CLS_CC);
zend_do_end_function_call(class_name, &ctor_result, argument_list, 1, 0 CLS_CC);
zend_do_free(&ctor_result CLS_CC);
CG(active_op_array)->opcodes[new_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
*result = CG(active_op_array)->opcodes[new_token->u.opline_num].op1;
}
void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC)
void zend_do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC)
{
switch (mode) {
case ZEND_CT:
@@ -1711,7 +1710,7 @@ void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC)
}
void do_shell_exec(znode *result, znode *cmd CLS_DC)
void zend_do_shell_exec(znode *result, znode *cmd CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1744,7 +1743,7 @@ void do_shell_exec(znode *result, znode *cmd CLS_DC)
void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
void zend_do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1767,7 +1766,7 @@ void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
}
void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
void zend_do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1784,7 +1783,7 @@ void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref
void do_add_static_array_element(znode *result, znode *offset, znode *expr)
void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
{
zval *element;
@@ -1792,6 +1791,7 @@ void do_add_static_array_element(znode *result, znode *offset, znode *expr)
*element = expr->u.constant;
if (offset) {
switch (offset->u.constant.type) {
case IS_CONSTANT:
case IS_STRING:
zend_hash_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
zval_dtor(&offset->u.constant);
@@ -1806,7 +1806,7 @@ void do_add_static_array_element(znode *result, znode *offset, znode *expr)
}
void do_add_list_element(znode *element CLS_DC)
void zend_do_add_list_element(znode *element CLS_DC)
{
list_llist_element lle;
@@ -1819,29 +1819,29 @@ void do_add_list_element(znode *element CLS_DC)
}
void do_new_list_begin(CLS_D)
void zend_do_new_list_begin(CLS_D)
{
int current_dimension = 0;
zend_llist_add_element(&CG(dimension_llist), &current_dimension);
}
void do_new_list_end(CLS_D)
void zend_do_new_list_end(CLS_D)
{
zend_llist_remove_tail(&CG(dimension_llist));
(*((int *)CG(dimension_llist).tail->data))++;
}
void do_list_init(CLS_D)
void zend_do_list_init(CLS_D)
{
zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0);
do_new_list_begin(CLS_C);
zend_do_new_list_begin(CLS_C);
}
void do_list_end(znode *result, znode *expr CLS_DC)
void zend_do_list_end(znode *result, znode *expr CLS_DC)
{
zend_llist_element *le;
zend_llist_element *dimension;
@@ -1861,7 +1861,10 @@ void do_list_end(znode *result, znode *expr CLS_DC)
opline->opcode = ZEND_FETCH_DIM_R;
break;
case IS_TMP_VAR:
opline->opcode = ZEND_FETCH_DIM_TMP_VAR;
break;
case IS_CONST: /* fetch_dim_tmp_var will handle this bogus fetch */
zval_copy_ctor(&expr->u.constant);
opline->opcode = ZEND_FETCH_DIM_TMP_VAR;
break;
}
@@ -1882,8 +1885,8 @@ void do_list_end(znode *result, znode *expr CLS_DC)
}
((list_llist_element *) le->data)->value = last_container;
zend_llist_destroy(&((list_llist_element *) le->data)->dimensions);
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value CLS_CC);
zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
zend_do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value CLS_CC);
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
le = le->next;
}
@@ -1893,7 +1896,7 @@ void do_list_end(znode *result, znode *expr CLS_DC)
}
void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC)
void zend_do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
znode lval;
@@ -1927,12 +1930,12 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
}
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, &result CLS_CC);
zend_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;
}
void do_cast(znode *result, znode *expr, int type CLS_DC)
void zend_do_cast(znode *result, znode *expr, int type CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1946,9 +1949,9 @@ void do_cast(znode *result, znode *expr, int type CLS_DC)
}
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
void zend_do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
{
do_extended_fcall_begin(CLS_C);
zend_do_extended_fcall_begin(CLS_C);
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -1963,25 +1966,25 @@ void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
}
}
do_extended_fcall_end(CLS_C);
zend_do_extended_fcall_end(CLS_C);
}
void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC)
void zend_do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC)
{
int i;
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
for (i=1; i<num_references->u.constant.value.lval; i++) {
fetch_simple_variable_ex(result, variable, 0, ZEND_FETCH_R CLS_CC);
*variable = *result;
}
do_begin_variable_parse(CLS_C);
zend_do_begin_variable_parse(CLS_C);
fetch_simple_variable(result, variable, 1 CLS_CC);
}
void do_unset(znode *variable CLS_DC)
void zend_do_unset(znode *variable CLS_DC)
{
zend_op *last_op;
@@ -2000,11 +2003,11 @@ void do_unset(znode *variable CLS_DC)
}
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
void zend_do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
{
zend_op *opline;
do_end_variable_parse(BP_VAR_IS, 0 CLS_CC);
zend_do_end_variable_parse(BP_VAR_IS, 0 CLS_CC);
opline = get_next_op(CG(active_op_array) CLS_CC);
opline->opcode = ZEND_ISSET_ISEMPTY;
@@ -2017,7 +2020,7 @@ void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
}
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC)
void zend_do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -2049,7 +2052,7 @@ void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_t
}
void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC)
void zend_do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
znode result_value, result_key, dummy;
@@ -2088,20 +2091,20 @@ void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC)
result_key = opline->result;
}
do_assign(&dummy, value, &result_value CLS_CC);
zend_do_assign(&dummy, value, &result_value CLS_CC);
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
if (key->op_type != IS_UNUSED) {
do_assign(&dummy, key, &result_key CLS_CC);
zend_do_assign(&dummy, key, &result_key CLS_CC);
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
}
do_free(as_token CLS_CC);
zend_do_free(as_token CLS_CC);
do_begin_loop(CLS_C);
INC_BPC(CG(active_op_array));
}
void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
void zend_do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -2122,13 +2125,13 @@ void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
}
void do_declare_begin(CLS_D)
void zend_do_declare_begin(CLS_D)
{
zend_stack_push(&CG(declare_stack), &CG(declarables), sizeof(zend_declarables));
}
void do_declare_stmt(znode *var, znode *val CLS_DC)
void zend_do_declare_stmt(znode *var, znode *val CLS_DC)
{
convert_to_string(&var->u.constant);
@@ -2140,7 +2143,7 @@ void do_declare_stmt(znode *var, znode *val CLS_DC)
}
void do_declare_end(CLS_D)
void zend_do_declare_end(CLS_D)
{
zend_declarables *declarables;
@@ -2149,7 +2152,7 @@ void do_declare_end(CLS_D)
}
void do_end_heredoc(CLS_D)
void zend_do_end_heredoc(CLS_D)
{
int opline_num = get_next_op_number(CG(active_op_array))-1;
zend_op *opline = &CG(active_op_array)->opcodes[opline_num];
@@ -2167,7 +2170,7 @@ void do_end_heredoc(CLS_D)
}
void do_exit(znode *result, znode *message CLS_DC)
void zend_do_exit(znode *result, znode *message CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -2181,7 +2184,7 @@ void do_exit(znode *result, znode *message CLS_DC)
}
void do_begin_silence(znode *strudel_token CLS_DC)
void zend_do_begin_silence(znode *strudel_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -2194,7 +2197,7 @@ void do_begin_silence(znode *strudel_token CLS_DC)
}
void do_end_silence(znode *strudel_token CLS_DC)
void zend_do_end_silence(znode *strudel_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -2204,7 +2207,7 @@ void do_end_silence(znode *strudel_token CLS_DC)
}
void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC)
void zend_do_begin_qm_op(znode *cond, znode *qm_token CLS_DC)
{
int jmpz_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
@@ -2221,7 +2224,7 @@ void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC)
}
void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC)
void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -2243,7 +2246,7 @@ void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC)
}
void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC)
void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC)
{
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
@@ -2260,7 +2263,7 @@ void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colo
}
void do_extended_info(CLS_D)
void zend_do_extended_info(CLS_D)
{
zend_op *opline;
@@ -2276,7 +2279,7 @@ void do_extended_info(CLS_D)
}
void do_extended_fcall_begin(CLS_D)
void zend_do_extended_fcall_begin(CLS_D)
{
zend_op *opline;
@@ -2292,7 +2295,7 @@ void do_extended_fcall_begin(CLS_D)
}
void do_extended_fcall_end(CLS_D)
void zend_do_extended_fcall_end(CLS_D)
{
zend_op *opline;
@@ -2307,7 +2310,7 @@ void do_extended_fcall_end(CLS_D)
SET_UNUSED(opline->op2);
}
void do_ticks(CLS_D)
void zend_do_ticks(CLS_D)
{
if (CG(declarables).ticks.value.lval) {
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
+95 -90
View File
@@ -44,6 +44,7 @@
#define FREE_PNODE(znode) zval_dtor(&znode->u.constant);
#define FREE_OP(op, should_free) if (should_free) zval_dtor(&Ts[(op)->u.var].tmp_var);
#define SET_UNUSED(op) (op).op_type = IS_UNUSED
#if SUPPORT_INTERACTIVE
#define INC_BPC(op_array) ((op_array)->backpatch_count++)
@@ -236,145 +237,145 @@ int zend_get_zendleng(CLS_D);
/* parser-driven code generators */
void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
void do_unary_op(int op, znode *result, znode *op1 CLS_DC);
void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
void do_assign(znode *result, znode *variable, znode *value CLS_DC);
void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
void zend_do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
void zend_do_unary_op(int op, znode *result, znode *op1 CLS_DC);
void zend_do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
void zend_do_assign(znode *result, znode *variable, znode *value CLS_DC);
void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC);
void fetch_simple_variable_ex(znode *result, znode *varname, int bp, int op CLS_DC);
void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
void do_fetch_globals(znode *varname CLS_DC);
void zend_do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
void zend_do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
void zend_do_fetch_globals(znode *varname CLS_DC);
void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC);
void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC);
void fetch_string_offset(znode *result, znode *parent, znode *offset CLS_DC);
void do_print(znode *result, znode *arg CLS_DC);
void do_echo(znode *arg CLS_DC);
void zend_do_print(znode *result, znode *arg CLS_DC);
void zend_do_echo(znode *arg CLS_DC);
typedef int (*unary_op_type)(zval *, zval *);
ZEND_API unary_op_type get_unary_op(int opcode);
ZEND_API void *get_binary_op(int opcode);
void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
void do_do_while_begin(CLS_D);
void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC);
void zend_do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
void zend_do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
void zend_do_do_while_begin(CLS_D);
void zend_do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC);
void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);
void do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC);
void do_if_end(CLS_D);
void zend_do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);
void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC);
void zend_do_if_end(CLS_D);
void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC);
void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC);
void do_for_end(znode *second_semicolon_token CLS_DC);
void zend_do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC);
void zend_do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC);
void zend_do_for_end(znode *second_semicolon_token CLS_DC);
void do_pre_incdec(znode *result, znode *op1, int op CLS_DC);
void do_post_incdec(znode *result, znode *op1, int op CLS_DC);
void zend_do_pre_incdec(znode *result, znode *op1, int op CLS_DC);
void zend_do_post_incdec(znode *result, znode *op1, int op CLS_DC);
void do_begin_variable_parse(CLS_D);
void do_end_variable_parse(int type, int arg_offset CLS_DC);
void zend_do_begin_variable_parse(CLS_D);
void zend_do_end_variable_parse(int type, int arg_offset CLS_DC);
void do_free(znode *op1 CLS_DC);
void zend_do_free(znode *op1 CLS_DC);
void do_init_string(znode *result CLS_DC);
void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC);
void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC);
void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC);
void zend_do_init_string(znode *result CLS_DC);
void zend_do_add_char(znode *result, znode *op1, znode *op2 CLS_DC);
void zend_do_add_string(znode *result, znode *op1, znode *op2 CLS_DC);
void zend_do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC);
void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC);
void do_end_function_declaration(znode *function_token CLS_DC);
void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC);
int do_begin_function_call(znode *function_name CLS_DC);
void do_begin_dynamic_function_call(znode *function_name CLS_DC);
void do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC);
void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC);
void do_return(znode *expr, int do_end_vparse CLS_DC);
void zend_do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC);
void zend_do_end_function_declaration(znode *function_token CLS_DC);
void zend_do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC);
int zend_do_begin_function_call(znode *function_name CLS_DC);
void zend_do_begin_dynamic_function_call(znode *function_name CLS_DC);
void zend_do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC);
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC);
void zend_do_return(znode *expr, int do_end_vparse CLS_DC);
ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time);
void do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
void do_early_binding(CLS_D);
void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce);
void zend_do_early_binding(CLS_D);
void do_pass_param(znode *param, int op, int offset CLS_DC);
void zend_do_pass_param(znode *param, int op, int offset CLS_DC);
void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC);
void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC);
void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
void zend_do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC);
void zend_do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
void zend_do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC);
void zend_do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
void do_brk_cont(int op, znode *expr CLS_DC);
void zend_do_brk_cont(int op, znode *expr CLS_DC);
void do_switch_cond(znode *cond CLS_DC);
void do_switch_end(znode *case_list CLS_DC);
void do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC);
void do_case_after_statement(znode *result, znode *case_token CLS_DC);
void do_default_before_statement(znode *case_list, znode *default_token CLS_DC);
void zend_do_switch_cond(znode *cond CLS_DC);
void zend_do_switch_end(znode *case_list CLS_DC);
void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC);
void zend_do_case_after_statement(znode *result, znode *case_token CLS_DC);
void zend_do_default_before_statement(znode *case_list, znode *default_token CLS_DC);
void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC);
void do_end_class_declaration(CLS_D);
void do_declare_property(znode *var_name, znode *value CLS_DC);
void zend_do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC);
void zend_do_end_class_declaration(CLS_D);
void zend_do_declare_property(znode *var_name, znode *value CLS_DC);
void do_fetch_property(znode *result, znode *object, znode *property CLS_DC);
void zend_do_fetch_property(znode *result, znode *object, znode *property CLS_DC);
void do_push_object(znode *object CLS_DC);
void do_pop_object(znode *object CLS_DC);
void zend_do_push_object(znode *object CLS_DC);
void zend_do_pop_object(znode *object CLS_DC);
void do_begin_new_object(znode *new_token, znode *class_name CLS_DC);
void do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC);
void zend_do_begin_new_object(znode *new_token, znode *class_name CLS_DC);
void zend_do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC);
void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
void zend_do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
void do_shell_exec(znode *result, znode *cmd CLS_DC);
void zend_do_shell_exec(znode *result, znode *cmd CLS_DC);
void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
void do_add_static_array_element(znode *result, znode *offset, znode *expr);
void do_list_init(CLS_D);
void do_list_end(znode *result, znode *expr CLS_DC);
void do_add_list_element(znode *element CLS_DC);
void do_new_list_begin(CLS_D);
void do_new_list_end(CLS_D);
void zend_do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
void zend_do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr);
void zend_do_list_init(CLS_D);
void zend_do_list_end(znode *result, znode *expr CLS_DC);
void zend_do_add_list_element(znode *element CLS_DC);
void zend_do_new_list_begin(CLS_D);
void zend_do_new_list_end(CLS_D);
void do_cast(znode *result, znode *expr, int type CLS_DC);
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
void zend_do_cast(znode *result, znode *expr, int type CLS_DC);
void zend_do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
void do_unset(znode *variable CLS_DC);
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
void zend_do_unset(znode *variable CLS_DC);
void zend_do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC);
void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
void zend_do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC);
void zend_do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
void zend_do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
void do_declare_begin(CLS_D);
void do_declare_stmt(znode *var, znode *val CLS_DC);
void do_declare_end(CLS_D);
void zend_do_declare_begin(CLS_D);
void zend_do_declare_stmt(znode *var, znode *val CLS_DC);
void zend_do_declare_end(CLS_D);
void do_end_heredoc(CLS_D);
void zend_do_end_heredoc(CLS_D);
void do_exit(znode *result, znode *message CLS_DC);
void zend_do_exit(znode *result, znode *message CLS_DC);
void do_begin_silence(znode *strudel_token CLS_DC);
void do_end_silence(znode *strudel_token CLS_DC);
void zend_do_begin_silence(znode *strudel_token CLS_DC);
void zend_do_end_silence(znode *strudel_token CLS_DC);
void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC);
void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC);
void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC);
void zend_do_begin_qm_op(znode *cond, znode *qm_token CLS_DC);
void zend_do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC);
void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC);
void do_extended_info(CLS_D);
void do_extended_fcall_begin(CLS_D);
void do_extended_fcall_end(CLS_D);
void zend_do_extended_info(CLS_D);
void zend_do_extended_fcall_begin(CLS_D);
void zend_do_extended_fcall_end(CLS_D);
void do_ticks(CLS_D);
void zend_do_ticks(CLS_D);
ZEND_API void function_add_ref(zend_function *function);
#define INITIAL_OP_ARRAY_SIZE 64
/* helper functions in zend-scanner.l */
/* helper functions in zend_language_scanner.l */
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC);
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename CLS_DC);
ZEND_API zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC);
@@ -537,6 +538,8 @@ int zendlex(znode *zendlval CLS_DC);
#define ZEND_TICKS 105
#define ZEND_SEND_VAR_NO_REF 106
/* end of block */
@@ -594,6 +597,8 @@ int zendlex(znode *zendlval CLS_DC);
#define ZEND_MEMBER_FUNC_CALL 1<<0
#define ZEND_CTOR_CALL 1<<1
#define ZEND_ARG_SEND_BY_REF (1<<0)
#define ZEND_ARG_COMPILE_TIME_BOUND (1<<1)
#define AI_USE_PTR(ai) \
if ((ai).ptr_ptr) { \
+57 -21
View File
@@ -1643,40 +1643,68 @@ do_fcall_common:
}
{
zval *valptr;
zval *value;
value = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
ALLOC_ZVAL(valptr);
*valptr = Ts[opline->op1.u.var].tmp_var;
*valptr = *value;
if (!EG(free_op1)) {
zval_copy_ctor(valptr);
}
INIT_PZVAL(valptr);
zend_ptr_stack_push(&EG(argument_stack), valptr);
}
NEXT_OPCODE();
case ZEND_SEND_VAR:
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
&& ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
goto send_by_ref;
case ZEND_SEND_VAR_NO_REF:
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
if (!(opline->extended_value & ZEND_ARG_SEND_BY_REF)) {
goto send_by_var;
}
} else if (!ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
goto send_by_var;
}
{
zval *varptr;
varptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
if (varptr == &EG(uninitialized_zval)) {
ALLOC_ZVAL(varptr);
INIT_ZVAL(*varptr);
varptr->refcount = 0;
} else if (PZVAL_IS_REF(varptr)) {
zval *original_var = varptr;
ALLOC_ZVAL(varptr);
*varptr = *original_var;
varptr->is_ref = 0;
varptr->refcount = 0;
zval_copy_ctor(varptr);
if (varptr != &EG(uninitialized_zval) && (PZVAL_IS_REF(varptr) || varptr->refcount == 1)) {
varptr->is_ref = 1;
varptr->refcount++;
zend_ptr_stack_push(&EG(argument_stack), varptr);
NEXT_OPCODE();
}
varptr->refcount++;
zend_ptr_stack_push(&EG(argument_stack), varptr);
FREE_OP(&opline->op1, EG(free_op1)); /* for string offsets */
zend_error(E_ERROR, "Only variables can be passed by reference");
}
NEXT_OPCODE();
case ZEND_SEND_VAR:
if ((opline->extended_value == ZEND_DO_FCALL_BY_NAME)
&& ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
goto send_by_ref;
}
send_by_var:
{
zval *varptr;
varptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
if (varptr == &EG(uninitialized_zval)) {
ALLOC_ZVAL(varptr);
INIT_ZVAL(*varptr);
varptr->refcount = 0;
} else if (PZVAL_IS_REF(varptr)) {
zval *original_var = varptr;
ALLOC_ZVAL(varptr);
*varptr = *original_var;
varptr->is_ref = 0;
varptr->refcount = 0;
zval_copy_ctor(varptr);
}
varptr->refcount++;
zend_ptr_stack_push(&EG(argument_stack), varptr);
FREE_OP(&opline->op1, EG(free_op1)); /* for string offsets */
}
NEXT_OPCODE();
send_by_ref:
case ZEND_SEND_REF: {
zval **varptr_ptr;
@@ -2270,7 +2298,13 @@ send_by_ref:
NEXT_OPCODE();
case ZEND_EXIT:
if (opline->op1.op_type != IS_UNUSED) {
zend_print_variable(get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R));
zval *ptr;
ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
if (Z_TYPE_P(ptr) == IS_LONG) {
EG(exit_status) = Z_LVAL_P(ptr);
}
zend_print_variable(ptr);
FREE_OP(&opline->op1, EG(free_op1));
}
zend_bailout();
@@ -2326,7 +2360,9 @@ send_by_ref:
}
}
#if SUPPORT_INTERACTIVE
ALLOC_INIT_ZVAL(*(EG(return_value_ptr_ptr)));
op_array->last_executed_op_number = opline-op_array->opcodes;
EG(in_execution) = original_in_execution;
free_alloca(Ts);
#else
zend_error(E_ERROR,"Arrived at end of main loop which shouldn't happen");
+7 -6
View File
@@ -139,8 +139,8 @@ ZEND_API char *zend_get_executed_filename(ELS_D);
ZEND_API uint zend_get_executed_lineno(ELS_D);
ZEND_API zend_bool zend_is_executing(void);
void zend_set_timeout(long seconds);
void zend_unset_timeout(void);
ZEND_API void zend_set_timeout(long seconds);
ZEND_API void zend_unset_timeout(void);
ZEND_API void zend_timeout(int dummy);
#ifdef ZEND_WIN32
@@ -157,16 +157,17 @@ void zend_shutdown_timeout_thread();
static inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC)
{
zval *variable_ptr = *variable_ptr_ptr;
zval *variable_ptr;
zval *value_ptr;
if (!value_ptr_ptr) {
zend_error(E_ERROR, "Cannot create references to string offsets nor overloaded objects");
if (!value_ptr_ptr || !variable_ptr_ptr) {
zend_error(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
return;
}
variable_ptr = *variable_ptr_ptr;
value_ptr = *value_ptr_ptr;
if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */
+17 -14
View File
@@ -312,7 +312,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
}
int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[])
int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[])
{
zval ***params_array = (zval ***) emalloc(sizeof(zval **)*param_count);
int i;
@@ -322,7 +322,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
for (i=0; i<param_count; i++) {
params_array[i] = &params[i];
}
ex_retval = call_user_function_ex(function_table, object, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
ex_retval = call_user_function_ex(function_table, object_pp, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
if (local_retval_ptr) {
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
} else {
@@ -333,7 +333,7 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
}
int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
{
int i;
zval **original_return_value;
@@ -357,15 +357,18 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
}
function_name = *tmp_real_function_name;
SEPARATE_ZVAL_IF_NOT_REF(tmp_object_ptr);
object = *tmp_object_ptr;
object->is_ref = 1;
object_pp = tmp_object_ptr;
(*object_pp)->is_ref = 1;
}
if (object) {
if (object->type != IS_OBJECT) {
if (object_pp && !*object_pp) {
object_pp = NULL;
}
if (object_pp) {
if (Z_TYPE_PP(object_pp) != IS_OBJECT) {
return FAILURE;
}
function_table = &object->value.obj.ce->function_table;
function_table = &(*object_pp)->value.obj.ce->function_table;
}
if (function_name->type!=IS_STRING) {
@@ -422,14 +425,13 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
ALLOC_HASHTABLE(EG(active_symbol_table));
zend_hash_init(EG(active_symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
}
if (object) {
if (object_pp) {
zval *dummy, **this_ptr;
ALLOC_ZVAL(dummy);
INIT_ZVAL(*dummy);
INIT_ZVAL(*dummy);
zend_hash_update(EG(active_symbol_table), "this", sizeof("this"), &dummy, sizeof(zval *), (void **) &this_ptr);
zend_assign_to_variable_reference(NULL, this_ptr, &object, NULL ELS_CC);
zend_assign_to_variable_reference(NULL, this_ptr, object_pp, NULL ELS_CC);
}
original_return_value = EG(return_value_ptr_ptr);
original_op_array = EG(active_op_array);
@@ -447,7 +449,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
EG(opline_ptr) = original_opline_ptr;
} else {
ALLOC_INIT_ZVAL(*retval_ptr_ptr);
((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, object, 1 ELS_CC);
((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, (object_pp?*object_pp:NULL), 1 ELS_CC);
INIT_PZVAL(*retval_ptr_ptr);
}
zend_ptr_stack_clear_multiple(ELS_C);
@@ -540,6 +542,7 @@ void execute_new_code(CLS_D)
CG(active_op_array)->end_op_number = CG(active_op_array)->last;
EG(active_op_array) = CG(active_op_array);
zend_execute(CG(active_op_array) ELS_CC);
zval_ptr_dtor(EG(return_value_ptr_ptr));
CG(active_op_array)->start_op_number = CG(active_op_array)->last_executed_op_number;
}
#endif
+33 -30
View File
@@ -23,23 +23,6 @@
ZEND_API zend_llist zend_extensions;
static int last_resource_number;
int zend_load_extensions(char **extension_paths)
{
char **p = extension_paths;
if (!p) {
return SUCCESS;
}
while (*p) {
if (zend_load_extension(*p)==FAILURE) {
return FAILURE;
}
p++;
}
return SUCCESS;
}
int zend_load_extension(char *path)
{
#if ZEND_EXTENSIONS_SUPPORT
@@ -64,17 +47,19 @@ int zend_load_extension(char *path)
return FAILURE;
}
if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) {
fprintf(stderr, "%s requires Zend Engine API version %d\n"
/* allow extension to proclaim compatibility with any Zend version */
if(extension_version_info->zend_extension_api_no != ZEND_EXTENSION_API_NO &&(!new_extension->api_no_check || new_extension->api_no_check(ZEND_EXTENSION_API_NO) != SUCCESS)) {
if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) {
fprintf(stderr, "%s requires Zend Engine API version %d\n"
"The installed Zend Engine API version is %d\n\n",
new_extension->name,
extension_version_info->zend_extension_api_no,
ZEND_EXTENSION_API_NO);
DL_UNLOAD(handle);
return FAILURE;
} else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) {
/* we may be able to allow for downwards compatability in some harmless cases. */
fprintf(stderr, "%s designed to be used with the Zend Engine API %d is outdated\n"
DL_UNLOAD(handle);
return FAILURE;
} else if (extension_version_info->zend_extension_api_no < ZEND_EXTENSION_API_NO) {
fprintf(stderr, "%s designed to be used with the Zend Engine API %d is outdated\n"
"It requires a more recent version of the Zend Engine\n"
"The installed Zend Engine API version is %d\n"
"Contact %s at %s for a later version of this module.\n\n",
@@ -83,8 +68,9 @@ int zend_load_extension(char *path)
ZEND_EXTENSION_API_NO,
new_extension->author,
new_extension->URL);
DL_UNLOAD(handle);
return FAILURE;
DL_UNLOAD(handle);
return FAILURE;
}
} else if (ZTS_V!=extension_version_info->thread_safe) {
fprintf(stderr, "Cannot load %s - it %s thread safe, whereas Zend %s\n",
new_extension->name,
@@ -138,14 +124,16 @@ static void zend_extension_shutdown(zend_extension *extension)
#endif
}
static void zend_extension_startup(zend_extension *extension)
static int zend_extension_startup(zend_extension *extension)
{
#if ZEND_EXTENSIONS_SUPPORT
if (extension->startup) {
if (extension->startup(extension)!=SUCCESS) {
DL_UNLOAD(extension->handle);
return 1;
}
}
#endif
return 0;
}
@@ -160,7 +148,7 @@ int zend_startup_extensions_mechanism()
int zend_startup_extensions()
{
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_startup);
zend_llist_apply_with_del(&zend_extensions, (int (*)(void *)) zend_extension_startup);
return SUCCESS;
}
@@ -211,3 +199,18 @@ ZEND_API int zend_get_resource_handle(zend_extension *extension)
return -1;
}
}
ZEND_API zend_extension *zend_get_extension(char *extension_name)
{
zend_llist_element *element;
for (element = zend_extensions.head; element; element = element->next) {
zend_extension *extension = (zend_extension *) element->data;
if (!strcmp(extension->name, extension_name)) {
return extension;
}
}
return NULL;
}
+33 -15
View File
@@ -23,7 +23,7 @@
#include "zend_compile.h"
#define ZEND_EXTENSION_API_NO 20001002
#define ZEND_EXTENSION_API_NO 20001120
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -35,6 +35,23 @@ typedef struct _zend_extension_version_info {
typedef struct _zend_extension zend_extension;
/* Typedef's for zend_extension function pointers */
typedef int (*startup_func_t)(zend_extension *extension);
typedef void (*shutdown_func_t)(zend_extension *extension);
typedef void (*activate_func_t)();
typedef void (*deactivate_func_t)();
typedef void (*message_handler_func_t)(int message, void *arg);
typedef void (*op_array_handler_func_t)(zend_op_array *op_array);
typedef void (*statement_handler_func_t)(zend_op_array *op_array);
typedef void (*fcall_begin_handler_func_t)(zend_op_array *op_array);
typedef void (*fcall_end_handler_func_t)(zend_op_array *op_array);
typedef void (*op_array_ctor_func_t)(zend_op_array *op_array);
typedef void (*op_array_dtor_func_t)(zend_op_array *op_array);
struct _zend_extension {
char *name;
char *version;
@@ -42,23 +59,23 @@ struct _zend_extension {
char *URL;
char *copyright;
int (*startup)(zend_extension *extension);
void (*shutdown)(zend_extension *extension);
void (*activate)();
void (*deactivate)();
startup_func_t startup;
shutdown_func_t shutdown;
activate_func_t activate;
deactivate_func_t deactivate;
void (*message_handler)(int message, void *arg);
message_handler_func_t message_handler;
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);
op_array_handler_func_t op_array_handler;
void (*op_array_ctor)(zend_op_array *op_array);
void (*op_array_dtor)(zend_op_array *op_array);
statement_handler_func_t statement_handler;
fcall_begin_handler_func_t fcall_begin_handler;
fcall_end_handler_func_t fcall_end_handler;
void *reserved1;
op_array_ctor_func_t op_array_ctor;
op_array_dtor_func_t op_array_dtor;
int (*api_no_check)(int api_no);
void *reserved2;
void *reserved3;
void *reserved4;
@@ -82,17 +99,18 @@ ZEND_API void zend_extension_dispatch_message(int message, void *arg);
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, ZEND_VERSION, ZTS_V, ZEND_DEBUG }
#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
#define COMPAT_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
ZEND_API extern zend_llist zend_extensions;
void zend_extension_dtor(zend_extension *extension);
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_mechanism(void);
int zend_startup_extensions(void);
void zend_shutdown_extensions(void);
ZEND_API zend_extension *zend_get_extension(char *extension_name);
#endif /* ZEND_EXTENSIONS_H */
+1 -1
View File
@@ -74,7 +74,7 @@ typedef struct _zend_fast_cache_list_entry {
{ \
ALS_FETCH(); \
\
((zend_fast_cache_list_entry *) (p))->next = AG(fast_cache_list_head)[fc_type]; \
((zend_fast_cache_list_entry *) (p))->next = (zend_fast_cache_list_entry *) AG(fast_cache_list_head)[fc_type]; \
AG(fast_cache_list_head)[fc_type] = (zend_fast_cache_list_entry *) (p); \
}
+7 -3
View File
@@ -40,6 +40,7 @@
#ifdef __cplusplus
class ZendFlexLexer;
class ZendIniFlexLexer;
#endif
BEGIN_EXTERN_C()
@@ -106,13 +107,15 @@ struct _zend_compiler_globals {
zend_bool unclean_shutdown;
zend_bool ini_parser_unbuffered_errors;
zend_llist open_files;
#ifdef ZTS
#ifdef __cplusplus
#if defined(ZTS) && defined(__cplusplus)
ZendFlexLexer *ZFL;
ZendIniFlexLexer *ini_scanner;
#else
void *ZFL;
#endif
void *ini_parser;
#endif
};
@@ -148,6 +151,7 @@ struct _zend_executor_globals {
int error_reporting;
int orig_error_reporting;
int exit_status;
zend_op_array *active_op_array;
+34 -2
View File
@@ -155,7 +155,7 @@ ZEND_API ulong hashpjw(char *arKey, uint nKeyLength)
if (!(p)->pDataPtr) { \
pefree((p)->pData, (ht)->persistent); \
} \
(p)->pDataPtr = *(void **)pData; \
memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
(p)->pData = &(p)->pDataPtr; \
} else { \
if ((p)->pDataPtr) { \
@@ -167,7 +167,7 @@ ZEND_API ulong hashpjw(char *arKey, uint nKeyLength)
#define INIT_DATA(ht, p, pData, nDataSize); \
if (nDataSize == sizeof(void*)) { \
(p)->pDataPtr = *(void **)pData; \
memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
(p)->pData = &(p)->pDataPtr; \
} else { \
(p)->pData = (void *) pemalloc(nDataSize, (ht)->persistent); \
@@ -797,6 +797,38 @@ ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_fu
}
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new))
{
Bucket *p;
void *t;
void *pOrig;
IS_CONSISTENT(source);
IS_CONSISTENT(target);
p = source->pListHead;
while (p) {
if (p->nKeyLength>0) {
if (zend_hash_find(target, p->arKey, p->nKeyLength, &pOrig)==FAILURE
|| pReplaceOrig(pOrig, p->pData)) {
if (zend_hash_update(target, p->arKey, p->nKeyLength, p->pData, size, &t)==SUCCESS && pCopyConstructor) {
pCopyConstructor(t);
}
}
} else {
if (zend_hash_index_find(target, p->h, &pOrig)==FAILURE
|| pReplaceOrig(pOrig, p->pData)) {
if (zend_hash_index_update(target, p->h, p->pData, size, &t)==SUCCESS && pCopyConstructor) {
pCopyConstructor(t);
}
}
}
p = p->pListNext;
}
target->pInternalPointer = target->pListHead;
}
ZEND_API ulong zend_get_hash_value(HashTable *ht, char *arKey, uint nKeyLength)
{
IS_CONSISTENT(ht);
+1
View File
@@ -170,6 +170,7 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos
/* Copying, merging and sorting */
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size);
ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new));
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber);
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar)(const void *, const void *), int flag, void **pData);
+1 -1
View File
@@ -19,7 +19,7 @@
#include "zend.h"
#include "zend-parser.h"
#include "zend_language_parser.h"
#include "zend_compile.h"
#include "zend_highlight.h"
#include "zend_ptr_stack.h"
+2 -2
View File
@@ -40,8 +40,8 @@ typedef struct _zend_syntax_highlighter_ini {
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, char *str_name);
ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name);
ZEND_API void zend_html_putc(char c);
ZEND_API void zend_html_puts(char *s, uint len);
END_EXTERN_C()
+1 -1
View File
@@ -22,7 +22,7 @@
#include "zend.h"
#include "zend-parser.h"
#include "zend_language_parser.h"
#include "zend_compile.h"
#include "zend_indent.h"
+485
View File
@@ -0,0 +1,485 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.zend.com/license/0_92.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
#include <stdlib.h>
#include "zend.h"
#include "zend_API.h"
#include "zend_ini.h"
#include "zend_alloc.h"
#include "zend_operators.h"
static HashTable known_directives;
/*
* hash_apply functions
*/
static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number)
{
if (ini_entry->module_number == *module_number) {
return 1;
} else {
return 0;
}
}
static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage)
{
if (ini_entry->modified) {
if (ini_entry->on_modify) {
ini_entry->on_modify(ini_entry, ini_entry->orig_value, ini_entry->orig_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage);
}
efree(ini_entry->value);
ini_entry->value = ini_entry->orig_value;
ini_entry->value_length = ini_entry->orig_value_length;
ini_entry->modified = 0;
ini_entry->orig_value = NULL;
ini_entry->orig_value_length = 0;
}
return 0;
}
/*
* Startup / shutdown
*/
int zend_ini_mstartup()
{
if (zend_hash_init_ex(&known_directives, 100, NULL, NULL, 1, 0)==FAILURE) {
return FAILURE;
}
return SUCCESS;
}
int zend_ini_mshutdown()
{
zend_hash_destroy(&known_directives);
return SUCCESS;
}
int zend_ini_rshutdown()
{
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE);
return SUCCESS;
}
static int ini_key_compare(const void *a, const void *b)
{
Bucket *f;
Bucket *s;
f = *((Bucket **) a);
s = *((Bucket **) b);
if (f->nKeyLength==0 && s->nKeyLength==0) { /* both numeric */
return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength);
} else if (f->nKeyLength==0) { /* f is numeric, s is not */
return -1;
} else if (s->nKeyLength==0) { /* s is numeric, f is not */
return 1;
} else { /* both strings */
return zend_binary_strcasecmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength);
}
}
void zend_ini_sort_entries(void)
{
zend_hash_sort(&known_directives, qsort, ini_key_compare, 0);
}
/*
* Registration / unregistration
*/
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number)
{
zend_ini_entry *p = ini_entry;
zend_ini_entry *hashed_ini_entry;
zval *default_value;
while (p->name) {
p->module_number = module_number;
if (zend_hash_add(&known_directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
zend_unregister_ini_entries(module_number);
return FAILURE;
}
if ((default_value=cfg_get_entry(p->name, p->name_length))) {
if (!hashed_ini_entry->on_modify
|| hashed_ini_entry->on_modify(hashed_ini_entry, default_value->value.str.val, default_value->value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP)==SUCCESS) {
hashed_ini_entry->value = default_value->value.str.val;
hashed_ini_entry->value_length = default_value->value.str.len;
}
} else {
if (hashed_ini_entry->on_modify) {
hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP);
}
}
p++;
}
return SUCCESS;
}
ZEND_API void zend_unregister_ini_entries(int module_number)
{
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_remove_ini_entries, (void *) &module_number);
}
static int zend_ini_refresh_cache(zend_ini_entry *p, int stage)
{
if (p->on_modify) {
p->on_modify(p, p->value, p->value_length, p->mh_arg1, p->mh_arg2, p->mh_arg3, stage);
}
return 0;
}
ZEND_API void zend_ini_refresh_caches(int stage)
{
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_ini_refresh_cache, (void *)(long) stage);
}
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage)
{
zend_ini_entry *ini_entry;
char *duplicate;
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
return FAILURE;
}
if (!(ini_entry->modifyable & modify_type)) {
return FAILURE;
}
duplicate = estrndup(new_value, new_value_length);
if (!ini_entry->on_modify
|| ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage)==SUCCESS) {
if (!ini_entry->modified) {
ini_entry->orig_value = ini_entry->value;
ini_entry->orig_value_length = ini_entry->value_length;
} else { /* we already changed the value, free the changed value */
efree(ini_entry->value);
}
ini_entry->value = duplicate;
ini_entry->value_length = new_value_length;
ini_entry->modified = 1;
} else {
efree(duplicate);
}
return SUCCESS;
}
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage)
{
zend_ini_entry *ini_entry;
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
return FAILURE;
}
zend_restore_ini_entry_cb(ini_entry, stage);
return SUCCESS;
}
ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type))
{
zend_ini_entry *ini_entry;
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
return FAILURE;
}
ini_entry->displayer = displayer;
return SUCCESS;
}
/*
* Data retrieval
*/
ZEND_API long zend_ini_long(char *name, uint name_length, int orig)
{
zend_ini_entry *ini_entry;
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
if (orig && ini_entry->modified) {
return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0);
} else if (ini_entry->value) {
return strtol(ini_entry->value, NULL, 0);
}
}
return 0;
}
ZEND_API double zend_ini_double(char *name, uint name_length, int orig)
{
zend_ini_entry *ini_entry;
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
if (orig && ini_entry->modified) {
return (double) (ini_entry->orig_value ? strtod(ini_entry->orig_value, NULL) : 0.0);
} else if (ini_entry->value) {
return (double) strtod(ini_entry->value, NULL);
}
}
return 0.0;
}
ZEND_API char *zend_ini_string(char *name, uint name_length, int orig)
{
zend_ini_entry *ini_entry;
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
if (orig && ini_entry->modified) {
return ini_entry->orig_value;
} else {
return ini_entry->value;
}
}
return "";
}
zend_ini_entry *get_ini_entry(char *name, uint name_length)
{
zend_ini_entry *ini_entry;
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
return ini_entry;
} else {
return NULL;
}
}
static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
{
if (ini_entry->displayer) {
ini_entry->displayer(ini_entry, type);
} else {
char *display_string;
uint display_string_length;
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
if (ini_entry->orig_value) {
display_string = ini_entry->orig_value;
display_string_length = ini_entry->orig_value_length;
} else {
display_string = "<i>no value</i>";
display_string_length = sizeof("<i>no value</i>")-1;
}
} else if (ini_entry->value && ini_entry->value[0]) {
display_string = ini_entry->value;
display_string_length = ini_entry->value_length;
} else {
display_string = "<i>no value</i>";
display_string_length = sizeof("<i>no value</i>")-1;
}
ZEND_WRITE(display_string, display_string_length);
}
}
ZEND_INI_DISP(zend_ini_boolean_displayer_cb)
{
int value;
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
value = (ini_entry->orig_value ? atoi(ini_entry->orig_value) : 0);
} else if (ini_entry->value) {
value = atoi(ini_entry->value);
} else {
value = 0;
}
if (value) {
ZEND_PUTS("On");
} else {
ZEND_PUTS("Off");
}
}
ZEND_INI_DISP(zend_ini_color_displayer_cb)
{
char *value;
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value;
} else if (ini_entry->value) {
value = ini_entry->value;
} else {
value = NULL;
}
if (value) {
zend_printf("<font color=\"%s\">%s</font>", value, value);
} else {
ZEND_PUTS("<i>no value</i>;");
}
}
ZEND_INI_DISP(display_link_numbers)
{
char *value;
if (type==ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
value = ini_entry->orig_value;
} else if (ini_entry->value) {
value = ini_entry->value;
} else {
value = NULL;
}
if (value) {
if (atoi(value)==-1) {
ZEND_PUTS("Unlimited");
} else {
zend_printf("%s", value);
}
}
}
ZEND_API void zend_ini_apply_with_argument(apply_func_arg_t apply_func, void *arg)
{
zend_hash_apply_with_argument(&known_directives, apply_func, arg);
}
/* Standard message handlers */
ZEND_API ZEND_INI_MH(OnUpdateBool)
{
zend_bool *p;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
char *base;
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
p = (zend_bool *) (base+(size_t) mh_arg1);
*p = (zend_bool) atoi(new_value);
return SUCCESS;
}
ZEND_API ZEND_INI_MH(OnUpdateInt)
{
long *p;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
char *base;
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
p = (long *) (base+(size_t) mh_arg1);
*p = zend_atoi(new_value, new_value_length);
return SUCCESS;
}
ZEND_API ZEND_INI_MH(OnUpdateReal)
{
double *p;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
char *base;
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
p = (double *) (base+(size_t) mh_arg1);
*p = strtod(new_value, NULL);
return SUCCESS;
}
ZEND_API ZEND_INI_MH(OnUpdateString)
{
char **p;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
char *base;
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
p = (char **) (base+(size_t) mh_arg1);
*p = new_value;
return SUCCESS;
}
ZEND_API ZEND_INI_MH(OnUpdateStringUnempty)
{
char **p;
#ifndef ZTS
char *base = (char *) mh_arg2;
#else
char *base;
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
if (new_value && !new_value[0]) {
return FAILURE;
}
p = (char **) (base+(size_t) mh_arg1);
*p = new_value;
return SUCCESS;
}
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
+168
View File
@@ -0,0 +1,168 @@
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.zend.com/license/0_92.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
#ifndef ZEND_INI_H
#define ZEND_INI_H
#define ZEND_INI_USER (1<<0)
#define ZEND_INI_PERDIR (1<<1)
#define ZEND_INI_SYSTEM (1<<2)
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
typedef struct _zend_ini_entry zend_ini_entry;
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
#define ZEND_INI_DISP(name) void name(zend_ini_entry *ini_entry, int type)
struct _zend_ini_entry {
int module_number;
int modifyable;
char *name;
uint name_length;
ZEND_INI_MH((*on_modify));
void *mh_arg1;
void *mh_arg2;
void *mh_arg3;
char *value;
uint value_length;
char *orig_value;
uint orig_value_length;
int modified;
void (*displayer)(zend_ini_entry *ini_entry, int type);
};
int zend_ini_mstartup(void);
int zend_ini_mshutdown(void);
int zend_ini_rshutdown(void);
void zend_ini_sort_entries(void);
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number);
ZEND_API void zend_unregister_ini_entries(int module_number);
ZEND_API void zend_ini_refresh_caches(int stage);
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage);
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage);
ZEND_API void display_ini_entries(zend_module_entry *module);
ZEND_API long zend_ini_long(char *name, uint name_length, int orig);
ZEND_API double zend_ini_double(char *name, uint name_length, int orig);
ZEND_API char *zend_ini_string(char *name, uint name_length, int orig);
zend_ini_entry *get_ini_entry(char *name, uint name_length);
ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type));
ZEND_API void zend_ini_apply_with_argument(apply_func_arg_t apply_func, void *arg);
ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb);
ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb);
ZEND_API ZEND_INI_DISP(display_link_numbers);
#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = {
#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, NULL } };
#define ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, displayer) \
{ 0, modifyable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, displayer },
#define ZEND_INI_ENTRY3(name, default_value, modifyable, on_modify, arg1, arg2, arg3) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, arg3, NULL)
#define ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL, displayer)
#define ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, arg1, arg2) \
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, arg1, arg2, NULL)
#define ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, arg1, NULL, NULL, displayer)
#define ZEND_INI_ENTRY1(name, default_value, modifyable, on_modify, arg1) \
ZEND_INI_ENTRY1_EX(name, default_value, modifyable, on_modify, arg1, NULL)
#define ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, NULL, NULL, NULL, displayer)
#define ZEND_INI_ENTRY(name, default_value, modifyable, on_modify) \
ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, NULL)
#ifdef ZTS
#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id)
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, displayer)
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr##_id, NULL, zend_ini_boolean_displayer_cb)
#else
#define STD_ZEND_INI_ENTRY(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY2(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr)
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr, displayer) \
ZEND_INI_ENTRY2_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer)
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifyable, on_modify, property_name, struct_type, struct_ptr) \
ZEND_INI_ENTRY3_EX(name, default_value, modifyable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
#endif
#define INI_INT(name) zend_ini_long((name), sizeof(name), 0)
#define INI_FLT(name) zend_ini_double((name), sizeof(name), 0)
#define INI_STR(name) zend_ini_string((name), sizeof(name), 0)
#define INI_BOOL(name) ((zend_bool) INI_INT(name))
#define INI_ORIG_INT(name) zend_ini_long((name), sizeof(name), 1)
#define INI_ORIG_FLT(name) zend_ini_double((name), sizeof(name), 1)
#define INI_ORIG_STR(name) zend_ini_string((name), sizeof(name), 1)
#define INI_ORIG_BOOL(name) ((zend_bool) INI_ORIG_INT(name))
#define REGISTER_INI_ENTRIES() zend_register_ini_entries(ini_entries, module_number)
#define UNREGISTER_INI_ENTRIES() zend_unregister_ini_entries(module_number)
#define DISPLAY_INI_ENTRIES() display_ini_entries(zend_module)
#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer)
#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb)
zval *cfg_get_entry(char *name, uint name_length);
/* Standard message handlers */
ZEND_API ZEND_INI_MH(OnUpdateBool);
ZEND_API ZEND_INI_MH(OnUpdateInt);
ZEND_API ZEND_INI_MH(OnUpdateReal);
ZEND_API ZEND_INI_MH(OnUpdateString);
ZEND_API ZEND_INI_MH(OnUpdateStringUnempty);
#define ZEND_INI_DISPLAY_ORIG 1
#define ZEND_INI_DISPLAY_ACTIVE 2
#define ZEND_INI_STAGE_STARTUP (1<<0)
#define ZEND_INI_STAGE_SHUTDOWN (1<<1)
#define ZEND_INI_STAGE_ACTIVATE (1<<2)
#define ZEND_INI_STAGE_DEACTIVATE (1<<3)
#define ZEND_INI_STAGE_RUNTIME (1<<4)
/* INI parsing engine */
typedef void (*zend_ini_parser_cb_t)(zval *arg1, zval *arg2, int callback_type, void *arg);
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg);
#define ZEND_INI_PARSER_ENTRY 1
#define ZEND_INI_PARSER_SECTION 2
#endif /* ZEND_INI_H */
+231
View File
@@ -0,0 +1,231 @@
%{
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.zend.com/license/0_92.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#define DEBUG_CFG_PARSER 0
#include "zend.h"
#include "zend_API.h"
#include "zend_ini.h"
#include "zend_constants.h"
#include "zend_ini_scanner.h"
#include "zend_extensions.h"
#if WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winbase.h>
#endif
typedef struct _zend_ini_parser_param {
zend_ini_parser_cb_t ini_parser_cb;
void *arg;
} zend_ini_parser_param;
#define YYSTYPE zval
#define YYPARSE_PARAM ini_parser_param
#define ZEND_INI_PARSER_CB ((zend_ini_parser_param *) ini_parser_param)->ini_parser_cb
#define ZEND_INI_PARSER_ARG ((zend_ini_parser_param *) ini_parser_param)->arg
int ini_lex(zval *ini_lval);
int ini_parse(void *ini_parser_param);
zval yylval;
#ifndef ZTS
extern int ini_lex(zval *ini_lval);
extern FILE *ini_in;
extern int ini_lineno;
extern void init_cfg_scanner(void);
#endif
void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
{
int i_result;
int i_op1, i_op2;
char str_result[MAX_LENGTH_OF_LONG];
i_op1 = atoi(op1->value.str.val);
free(op1->value.str.val);
if (op2) {
i_op2 = atoi(op2->value.str.val);
free(op2->value.str.val);
} else {
i_op2 = 0;
}
switch (type) {
case '|':
i_result = i_op1 | i_op2;
break;
case '&':
i_result = i_op1 & i_op2;
break;
case '~':
i_result = ~i_op1;
break;
case '!':
i_result = !i_op1;
break;
default:
i_result = 0;
break;
}
result->value.str.len = zend_sprintf(str_result, "%d", i_result);
result->value.str.val = (char *) malloc(result->value.str.len+1);
memcpy(result->value.str.val, str_result, result->value.str.len);
result->value.str.val[result->value.str.len] = 0;
result->type = IS_STRING;
}
void zend_ini_get_constant(zval *result, zval *name)
{
zval z_constant;
if (zend_get_constant(name->value.str.val, name->value.str.len, &z_constant)) {
/* z_constant is emalloc()'d */
convert_to_string(&z_constant);
result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len);
result->value.str.len = z_constant.value.str.len;
result->type = z_constant.type;
zval_dtor(&z_constant);
free(name->value.str.val);
} else {
*result = *name;
}
}
static void ini_error(char *str)
{
char *error_buf;
int error_buf_len;
char *currently_parsed_filename = zend_ini_scanner_get_filename();
CLS_FETCH();
error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */
error_buf = (char *) emalloc(error_buf_len);
sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno());
if (CG(ini_parser_unbuffered_errors)) {
#ifdef PHP_WIN32
MessageBox(NULL, error_buf, "PHP Error", MB_OK|MB_TOPMOST|0x00200000L);
#else
fprintf(stderr, "PHP: %s", error_buf);
#endif
} else {
zend_error(E_CORE_WARNING, error_buf);
}
efree(error_buf);
}
int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_ini_parser_cb_t ini_parser_cb, void *arg)
{
zend_ini_parser_param ini_parser_param;
int retval;
CLS_FETCH();
ini_parser_param.ini_parser_cb = ini_parser_cb;
ini_parser_param.arg = arg;
if (zend_ini_open_file_for_scanning(fh)==FAILURE) {
return FAILURE;
}
CG(ini_parser_unbuffered_errors) = unbuffered_errors;
retval = ini_parse(&ini_parser_param);
zend_ini_close_file(fh);
if (retval==0) {
return SUCCESS;
} else {
return FAILURE;
}
}
%}
%pure_parser
%token TC_STRING
%token TC_ENCAPSULATED_STRING
%token SECTION
%token CFG_TRUE
%token CFG_FALSE
%left '|' '&'
%right '~' '!'
%%
statement_list:
statement_list statement
| /* empty */
;
statement:
TC_STRING '=' string_or_value {
#if DEBUG_CFG_PARSER
printf("'%s' = '%s'\n", $1.value.str.val, $3.value.str.val);
#endif
ZEND_INI_PARSER_CB(&$1, &$3, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG);
free($1.value.str.val);
free($3.value.str.val);
}
| TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free($1.value.str.val); }
| SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free($1.value.str.val); }
| '\n'
;
string_or_value:
expr { $$ = $1; }
| TC_ENCAPSULATED_STRING { $$ = $1; }
| CFG_TRUE { $$ = $1; }
| CFG_FALSE { $$ = $1; }
| '\n' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; }
| '\0' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; }
;
expr:
constant_string { $$ = $1; }
| expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); }
| expr '&' expr { zend_ini_do_op('&', &$$, &$1, &$3); }
| '~' expr { zend_ini_do_op('~', &$$, &$2, NULL); }
| '!' expr { zend_ini_do_op('!', &$$, &$2, NULL); }
| '(' expr ')' { $$ = $2; }
;
constant_string:
TC_STRING { zend_ini_get_constant(&$$, &$1); }
;
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
+24
View File
@@ -0,0 +1,24 @@
#ifndef _ZEND_INI_SCANNER_H
#define _ZEND_INI_SCANNER_H
#if defined(ZTS) && defined(__cplusplus)
class ZendIniFlexLexer : public yyFlexLexer
{
public:
virtual ~ZendIniFlexLexer();
int lex_scan(zval *zendlval);
void BeginState(int state);
char *filename;
};
#endif /* ZTS && __cplusplus */
BEGIN_EXTERN_C()
int zend_ini_scanner_get_lineno();
char *zend_ini_scanner_get_filename();
int zend_ini_open_file_for_scanning(zend_file_handle *fh);
void zend_ini_close_file(zend_file_handle *fh);
int ini_lex(zval *ini_lval);
END_EXTERN_C()
#endif /* _ZEND_INI_SCANNER_H */
+283
View File
@@ -0,0 +1,283 @@
%{
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.zend.com/license/0_92.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
#include "zend.h"
#include "zend_globals.h"
#include "zend_ini_parser.h"
#include "zend_ini_scanner.h"
#ifdef ZTS
# ifdef HAVE_STDIOSTR_H
# include <stdiostr.h>
# endif
# ifdef HAVE_STDIOSTREAM_H
# include <stdiostream.h>
# endif
# ifdef ZEND_WIN32
# include <strstrea.h>
# else
# include <strstream.h>
# endif
#endif
#undef YYSTYPE
#define YYSTYPE zval
#ifdef ZTS
#define YY_DECL int ZendIniFlexLexer::lex_scan(zval *ini_lval)
#else
#define YY_DECL int ini_lex(zval *ini_lval)
#endif
#ifndef ZTS
static char *ini_filename;
void init_ini_scanner()
{
ini_lineno=1;
}
int zend_ini_scanner_get_lineno()
{
return ini_lineno;
}
char *zend_ini_scanner_get_filename()
{
return ini_filename;
}
#else /* ZTS */
int zend_ini_scanner_get_lineno()
{
CLS_FETCH();
return CG(ini_scanner)->lineno();
}
char *zend_ini_scanner_get_filename()
{
CLS_FETCH();
return CG(ini_scanner)->filename;
}
int ini_lex(zval *ini_lval)
{
CLS_FETCH();
return CG(ini_scanner)->lex_scan(ini_lval);
}
ZendIniFlexLexer::~ZendIniFlexLexer()
{
if (yy_start_stack) {
yy_flex_free(yy_start_stack);
}
}
int yyFlexLexer::yylex()
{
fprintf(stderr, "Error: yyFlexLexer::yylex() called\n");
return -1;
}
#endif
int zend_ini_open_file_for_scanning(zend_file_handle *fh)
{
FILE *fp;
CLS_FETCH();
switch (fh->type) {
case ZEND_HANDLE_FP:
fp = fh->handle.fp;
break;
case ZEND_HANDLE_FILENAME:
fp = zend_fopen(fh->filename, NULL);
fh->type = ZEND_HANDLE_FP;
break;
default:
return FAILURE;
}
#ifdef ZTS
if (!fp) {
return FAILURE;
}
fh->handle.is = new istdiostream(fp);
fh->type = ZEND_HANDLE_STDIOSTREAM;
CG(ini_scanner) = new ZendIniFlexLexer;
CG(ini_scanner)->switch_streams(fh->handle.is, &cout);
CG(ini_scanner)->filename = fh->filename;
#else
init_ini_scanner();
yyin = fp;
yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
ini_filename = fh->filename;
#endif
return SUCCESS;
}
void zend_ini_close_file(zend_file_handle *fh)
{
switch (fh->type) {
case ZEND_HANDLE_FP:
fclose(fh->handle.fp);
break;
#ifdef ZTS
case ZEND_HANDLE_STDIOSTREAM: {
CLS_FETCH();
delete CG(ini_scanner);
}
break;
#endif
}
}
%}
%option noyywrap
%option yylineno
%%
<INITIAL>[ ]*("true"|"on"|"yes")[ ]* {
ini_lval->value.str.val = zend_strndup("1",1);
ini_lval->value.str.len = 1;
ini_lval->type = IS_STRING;
return CFG_TRUE;
}
<INITIAL>[ ]*("false"|"off"|"no"|"none")[ ]* {
ini_lval->value.str.val = zend_strndup("",0);
ini_lval->value.str.len = 0;
ini_lval->type = IS_STRING;
return CFG_FALSE;
}
<INITIAL>[[][^[]+[\]]([\n]?|"\r\n"?) {
/* SECTION */
/* eat trailng ] */
while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']')) {
yyleng--;
yytext[yyleng]=0;
}
/* eat leading [ */
yytext++;
yyleng--;
ini_lval->value.str.val = zend_strndup(yytext,yyleng);
ini_lval->value.str.len = yyleng;
ini_lval->type = IS_STRING;
return SECTION;
}
<INITIAL>["][^\n\r"]*["] {
/* ENCAPSULATED TC_STRING */
/* eat trailing " */
yytext[yyleng-1]=0;
/* eat leading " */
yytext++;
ini_lval->value.str.val = zend_strndup(yytext, yyleng - 2);
ini_lval->value.str.len = yyleng - 2;
ini_lval->type = IS_STRING;
return TC_ENCAPSULATED_STRING;
}
<INITIAL>[&|~()!] {
return yytext[0];
}
<INITIAL>[^=\n\r\t;|&~()!"]+ {
/* STRING */
register int i;
/* eat trailing whitespace */
for (i=yyleng-1; i>=0; i--) {
if (yytext[i]==' ' || yytext[i]=='\t') {
yytext[i]=0;
yyleng--;
} else {
break;
}
}
/* eat leading whitespace */
while (yytext[0]) {
if (yytext[0]==' ' || yytext[0]=='\t') {
yytext++;
yyleng--;
} else {
break;
}
}
if (yyleng!=0) {
ini_lval->value.str.val = zend_strndup(yytext,yyleng);
ini_lval->value.str.len = yyleng;
ini_lval->type = IS_STRING;
return TC_STRING;
} else {
/* whitespace */
}
}
<INITIAL>[=\n] {
return yytext[0];
}
<INITIAL>"\r\n" {
return '\n';
}
<INITIAL>[;][^\r\n]*[\r\n]? {
/* comment */
return '\n';
}
<INITIAL>[ \t] {
/* eat whitespace */
}
<INITIAL>. {
#if DEBUG
php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n",yylineno,yytext,yytext[0]);
#endif
}
<<EOF>> {
yy_delete_buffer(YY_CURRENT_BUFFER);
yyterminate();
}
+726
View File
@@ -0,0 +1,726 @@
%{
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.zend.com/license/0_92.txt. |
| If you did not receive a copy of the Zend license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@zend.com so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
| Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
/*
* LALR shift/reduce conflicts and how they are resolved:
*
* - 2 shift/reduce conflicts due to the dangeling elseif/else ambiguity. Solved by shift.
* - 1 shift/reduce conflict due to arrays within encapsulated strings. Solved by shift.
* - 1 shift/reduce conflict due to objects within encapsulated strings. Solved by shift.
*
*/
#include "zend_compile.h"
#include "zend.h"
#include "zend_list.h"
#include "zend_globals.h"
#include "zend_API.h"
#define YYERROR_VERBOSE
#define YYSTYPE znode
#ifdef ZTS
# define YYPARSE_PARAM compiler_globals
# define YYLEX_PARAM compiler_globals
#endif
%}
%pure_parser
%expect 4
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
%left ','
%left T_LOGICAL_OR
%left T_LOGICAL_XOR
%left T_LOGICAL_AND
%right T_PRINT
%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL
%left '?' ':'
%left T_BOOLEAN_OR
%left T_BOOLEAN_AND
%left '|'
%left '^'
%left '&'
%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 '+' '-' '.'
%left '*' '/' '%'
%right '!' '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
%right '['
%nonassoc T_NEW
%token T_EXIT
%token T_IF
%left T_ELSEIF
%left T_ELSE
%left T_ENDIF
%token T_LNUMBER
%token T_DNUMBER
%token T_STRING
%token T_STRING_VARNAME
%token T_VARIABLE
%token T_NUM_STRING
%token T_INLINE_HTML
%token T_CHARACTER
%token T_BAD_CHARACTER
%token T_ENCAPSED_AND_WHITESPACE
%token T_CONSTANT_ENCAPSED_STRING
%token T_ECHO
%token T_DO
%token T_WHILE
%token T_ENDWHILE
%token T_FOR
%token T_ENDFOR
%token T_FOREACH
%token T_ENDFOREACH
%token T_DECLARE
%token T_ENDDECLARE
%token T_AS
%token T_SWITCH
%token T_ENDSWITCH
%token T_CASE
%token T_DEFAULT
%token T_BREAK
%token T_CONTINUE
%token T_OLD_FUNCTION
%token T_FUNCTION
%token T_CONST
%token T_RETURN
%token T_USE
%token T_GLOBAL
%token T_STATIC
%token T_VAR
%token T_UNSET
%token T_ISSET
%token T_EMPTY
%token T_CLASS
%token T_EXTENDS
%token T_OBJECT_OPERATOR
%token T_DOUBLE_ARROW
%token T_LIST
%token T_ARRAY
%token T_LINE
%token T_FILE
%token T_COMMENT
%token T_ML_COMMENT
%token T_OPEN_TAG
%token T_OPEN_TAG_WITH_ECHO
%token T_CLOSE_TAG
%token T_WHITESPACE
%token T_START_HEREDOC
%token T_END_HEREDOC
%token T_DOLLAR_OPEN_CURLY_BRACES
%token T_CURLY_OPEN
%token T_PAAMAYIM_NEKUDOTAYIM
%% /* Rules */
start:
top_statement_list
;
top_statement_list:
top_statement_list { zend_do_extended_info(CLS_C); } top_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
top_statement:
statement
| declaration_statement { zend_do_early_binding(CLS_C); }
;
inner_statement_list:
inner_statement_list { zend_do_extended_info(CLS_C); } inner_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
inner_statement:
statement
| declaration_statement
;
statement:
unticked_statement { zend_do_ticks(CLS_C); }
;
unticked_statement:
'{' inner_statement_list '}'
| T_IF '(' expr ')' { zend_do_if_cond(&$3, &$4 CLS_CC); } statement { zend_do_if_after_statement(&$4, 1 CLS_CC); } elseif_list else_single { zend_do_if_end(CLS_C); }
| T_IF '(' expr ')' ':' { zend_do_if_cond(&$3, &$4 CLS_CC); } inner_statement_list { zend_do_if_after_statement(&$4, 1 CLS_CC); } new_elseif_list new_else_single T_ENDIF ';' { zend_do_if_end(CLS_C); }
| T_WHILE '(' { $1.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' { zend_do_while_cond(&$4, &$5 CLS_CC); } while_statement { zend_do_while_end(&$1, &$5 CLS_CC); }
| T_DO { $1.u.opline_num = get_next_op_number(CG(active_op_array)); zend_do_do_while_begin(CLS_C); } statement T_WHILE '(' { $5.u.opline_num = get_next_op_number(CG(active_op_array)); } expr ')' ';' { zend_do_do_while_end(&$1, &$5, &$7 CLS_CC); }
| T_FOR
'('
for_expr
';' { zend_do_free(&$3 CLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); }
for_expr
';' { zend_do_extended_info(CLS_C); zend_do_for_cond(&$6, &$7 CLS_CC); }
for_expr
')' { zend_do_free(&$9 CLS_CC); zend_do_for_before_statement(&$4, &$7 CLS_CC); }
for_statement { zend_do_for_end(&$7 CLS_CC); }
| T_SWITCH '(' expr ')' { zend_do_switch_cond(&$3 CLS_CC); } switch_case_list { zend_do_switch_end(&$6 CLS_CC); }
| T_BREAK ';' { zend_do_brk_cont(ZEND_BRK, NULL CLS_CC); }
| T_BREAK expr ';' { zend_do_brk_cont(ZEND_BRK, &$2 CLS_CC); }
| T_CONTINUE ';' { zend_do_brk_cont(ZEND_CONT, NULL CLS_CC); }
| T_CONTINUE expr ';' { zend_do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
| T_RETURN ';' { zend_do_return(NULL, 0 CLS_CC); }
| T_RETURN expr_without_variable ';' { zend_do_return(&$2, 0 CLS_CC); }
| T_RETURN cvar ';' { zend_do_return(&$2, 1 CLS_CC); }
| T_GLOBAL global_var_list ';'
| T_STATIC static_var_list ';'
| T_ECHO echo_expr_list ';'
| T_INLINE_HTML { zend_do_echo(&$1 CLS_CC); }
| expr ';' { zend_do_free(&$1 CLS_CC); }
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
| T_UNSET '(' unset_variables ')' ';'
| T_FOREACH '(' w_cvar T_AS { zend_do_foreach_begin(&$1, &$3, &$2, &$4, 1 CLS_CC); } w_cvar foreach_optional_arg ')' { zend_do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { zend_do_foreach_end(&$1, &$2 CLS_CC); }
| T_FOREACH '(' expr_without_variable T_AS { zend_do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { zend_do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { zend_do_foreach_end(&$1, &$2 CLS_CC); }
| T_DECLARE { zend_do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { zend_do_declare_end(CLS_C); }
| ';' /* empty statement */
;
unset_variables:
unset_variable
| unset_variables ',' unset_variable
;
unset_variable:
cvar { zend_do_end_variable_parse(BP_VAR_UNSET, 0 CLS_CC); zend_do_unset(&$1 CLS_CC); }
;
use_filename:
T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
| '(' T_CONSTANT_ENCAPSED_STRING ')' { $$ = $2; }
;
declaration_statement:
unticked_declaration_statement { zend_do_ticks(CLS_C); }
;
unticked_declaration_statement:
T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
'(' parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 CLS_CC); }
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 0, $3.op_type CLS_CC); }
parameter_list '(' inner_statement_list ')' ';' { zend_do_end_function_declaration(&$1 CLS_CC); }
| T_CLASS T_STRING { zend_do_begin_class_declaration(&$2, NULL CLS_CC); } '{' class_statement_list '}' { zend_do_end_class_declaration(CLS_C); }
| T_CLASS T_STRING T_EXTENDS T_STRING { zend_do_begin_class_declaration(&$2, &$4 CLS_CC); } '{' class_statement_list '}' { zend_do_end_class_declaration(CLS_C); }
;
foreach_optional_arg:
/* empty */ { $$.op_type = IS_UNUSED; }
| T_DOUBLE_ARROW w_cvar { $$ = $2; }
;
for_statement:
statement
| ':' inner_statement_list T_ENDFOR ';'
;
foreach_statement:
statement
| ':' inner_statement_list T_ENDFOREACH ';'
;
declare_statement:
statement
| ':' inner_statement_list T_ENDDECLARE ';'
;
declare_list:
T_STRING '=' static_scalar { zend_do_declare_stmt(&$1, &$3 CLS_CC); }
| declare_list ',' T_STRING '=' static_scalar { zend_do_declare_stmt(&$3, &$5 CLS_CC); }
;
switch_case_list:
'{' case_list '}' { $$ = $2; }
| '{' ';' case_list '}' { $$ = $3; }
| ':' case_list T_ENDSWITCH ';' { $$ = $2; }
| ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; }
;
case_list:
/* empty */ { $$.op_type = IS_UNUSED; }
| case_list T_CASE expr case_separator { zend_do_extended_info(CLS_C); zend_do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
| case_list T_DEFAULT case_separator { zend_do_extended_info(CLS_C); zend_do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { zend_do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
;
case_separator:
':'
| ';'
;
while_statement:
statement
| ':' inner_statement_list T_ENDWHILE ';'
;
elseif_list:
/* empty */
| elseif_list T_ELSEIF '(' expr ')' { zend_do_if_cond(&$4, &$5 CLS_CC); } statement { zend_do_if_after_statement(&$5, 0 CLS_CC); }
;
new_elseif_list:
/* empty */
| new_elseif_list T_ELSEIF '(' expr ')' ':' { zend_do_if_cond(&$4, &$5 CLS_CC); } inner_statement_list { zend_do_if_after_statement(&$5, 0 CLS_CC); }
;
else_single:
/* empty */
| T_ELSE statement
;
new_else_single:
/* empty */
| T_ELSE ':' inner_statement_list
;
parameter_list:
non_empty_parameter_list
| /* empty */
;
non_empty_parameter_list:
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
| non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; zend_do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); }
;
function_call_parameter_list:
non_empty_function_call_parameter_list { $$ = $1; }
| /* empty */ { $$.u.constant.value.lval = 0; }
;
non_empty_function_call_parameter_list:
expr_without_variable { $$.u.constant.value.lval = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
| cvar { $$.u.constant.value.lval = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
| '&' w_cvar { $$.u.constant.value.lval = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
| non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
| non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
| non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; zend_do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
;
global_var_list:
global_var_list ',' global_var { zend_do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
| global_var { zend_do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
;
global_var:
T_VARIABLE { $$ = $1; }
| '$' r_cvar { $$ = $2; }
| '$' '{' expr '}' { $$ = $3; }
;
static_var_list:
static_var_list ',' T_VARIABLE { zend_do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_STATIC CLS_CC); }
| static_var_list ',' T_VARIABLE '=' static_scalar { zend_do_fetch_global_or_static_variable(&$3, &$5, ZEND_FETCH_STATIC CLS_CC); }
| T_VARIABLE { zend_do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_STATIC CLS_CC); }
| T_VARIABLE '=' static_scalar { zend_do_fetch_global_or_static_variable(&$1, &$3, ZEND_FETCH_STATIC CLS_CC); }
;
class_statement_list:
class_statement_list class_statement
| /* empty */
;
class_statement:
T_VAR class_variable_decleration ';'
| T_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); } '('
parameter_list ')' '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 CLS_CC); }
| T_OLD_FUNCTION { $1.u.opline_num = CG(zend_lineno); } is_reference T_STRING { zend_do_begin_function_declaration(&$1, &$4, 1, $3.op_type CLS_CC); }
parameter_list '(' inner_statement_list ')' ';' { zend_do_end_function_declaration(&$1 CLS_CC); }
;
is_reference:
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
| '&' { $$.op_type = ZEND_RETURN_REF; }
class_variable_decleration:
class_variable_decleration ',' T_VARIABLE { zend_do_declare_property(&$3, NULL CLS_CC); }
| class_variable_decleration ',' T_VARIABLE '=' static_scalar { zend_do_declare_property(&$3, &$5 CLS_CC); }
| T_VARIABLE { zend_do_declare_property(&$1, NULL CLS_CC); }
| T_VARIABLE '=' static_scalar { zend_do_declare_property(&$1, &$3 CLS_CC); }
;
echo_expr_list:
| echo_expr_list ',' expr { zend_do_echo(&$3 CLS_CC); }
| expr { zend_do_echo(&$1 CLS_CC); }
;
for_expr:
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; }
| non_empty_for_expr { $$ = $1; }
;
non_empty_for_expr:
non_empty_for_expr ',' { zend_do_free(&$1 CLS_CC); } expr { $$ = $4; }
| expr { $$ = $1; }
;
expr_without_variable:
T_LIST '(' { zend_do_list_init(CLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 CLS_CC); }
| cvar '=' expr { zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); zend_do_assign(&$$, &$1, &$3 CLS_CC); }
| cvar '=' '&' w_cvar { zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); zend_do_assign_ref(&$$, &$1, &$4 CLS_CC); }
| cvar '=' '&' function_call { zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); zend_do_assign_ref(&$$, &$1, &$4 CLS_CC); }
| cvar '=' '&' T_NEW class_name { zend_do_extended_fcall_begin(CLS_C); zend_do_begin_new_object(&$4, &$5 CLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$5, &$4, &$7 CLS_CC); zend_do_extended_fcall_end(CLS_C); zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); zend_do_assign_ref(&$$, &$1, &$3 CLS_CC); }
| T_NEW class_name { zend_do_extended_fcall_begin(CLS_C); zend_do_begin_new_object(&$1, &$2 CLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$2, &$1, &$4 CLS_CC); zend_do_extended_fcall_end(CLS_C);}
| cvar T_PLUS_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 CLS_CC); }
| cvar T_MINUS_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 CLS_CC); }
| cvar T_MUL_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MUL, &$$, &$1, &$3 CLS_CC); }
| cvar T_DIV_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_DIV, &$$, &$1, &$3 CLS_CC); }
| cvar T_CONCAT_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_CONCAT, &$$, &$1, &$3 CLS_CC); }
| cvar T_MOD_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_MOD, &$$, &$1, &$3 CLS_CC); }
| cvar T_AND_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_AND, &$$, &$1, &$3 CLS_CC); }
| cvar T_OR_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); }
| cvar T_XOR_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_BW_XOR, &$$, &$1, &$3 CLS_CC); }
| cvar T_SL_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SL, &$$, &$1, &$3 CLS_CC); }
| cvar T_SR_EQUAL expr { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); }
| rw_cvar T_INC { zend_do_post_incdec(&$$, &$1, ZEND_POST_INC CLS_CC); }
| T_INC rw_cvar { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_INC CLS_CC); }
| rw_cvar T_DEC { zend_do_post_incdec(&$$, &$1, ZEND_POST_DEC CLS_CC); }
| T_DEC rw_cvar { zend_do_pre_incdec(&$$, &$2, ZEND_PRE_DEC CLS_CC); }
| expr T_BOOLEAN_OR { zend_do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); }
| expr T_BOOLEAN_AND { zend_do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); }
| expr T_LOGICAL_OR { zend_do_boolean_or_begin(&$1, &$2 CLS_CC); } expr { zend_do_boolean_or_end(&$$, &$1, &$4, &$2 CLS_CC); }
| expr T_LOGICAL_AND { zend_do_boolean_and_begin(&$1, &$2 CLS_CC); } expr { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 CLS_CC); }
| expr T_LOGICAL_XOR expr { zend_do_binary_op(ZEND_BOOL_XOR, &$$, &$1, &$3 CLS_CC); }
| expr '|' expr { zend_do_binary_op(ZEND_BW_OR, &$$, &$1, &$3 CLS_CC); }
| expr '&' expr { zend_do_binary_op(ZEND_BW_AND, &$$, &$1, &$3 CLS_CC); }
| expr '^' expr { zend_do_binary_op(ZEND_BW_XOR, &$$, &$1, &$3 CLS_CC); }
| expr '.' expr { zend_do_binary_op(ZEND_CONCAT,&$$,&$1,&$3 CLS_CC); }
| expr '+' expr { zend_do_binary_op(ZEND_ADD,&$$,&$1,&$3 CLS_CC); }
| expr '-' expr { zend_do_binary_op(ZEND_SUB,&$$,&$1,&$3 CLS_CC); }
| expr '*' expr { zend_do_binary_op(ZEND_MUL,&$$,&$1,&$3 CLS_CC); }
| expr '/' expr { zend_do_binary_op(ZEND_DIV,&$$,&$1,&$3 CLS_CC); }
| expr '%' expr { zend_do_binary_op(ZEND_MOD,&$$,&$1,&$3 CLS_CC); }
| expr T_SL expr { zend_do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); }
| expr T_SR expr { zend_do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); }
| '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_ADD, &$$, &$1, &$2 CLS_CC); }
| '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); zend_do_binary_op(ZEND_SUB, &$$, &$1, &$2 CLS_CC); }
| '!' expr { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$2 CLS_CC); }
| '~' expr { zend_do_unary_op(ZEND_BW_NOT, &$$, &$2 CLS_CC); }
| expr T_IS_IDENTICAL expr { zend_do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
| expr T_IS_NOT_IDENTICAL expr { zend_do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
| expr T_IS_EQUAL expr { zend_do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
| expr T_IS_NOT_EQUAL expr { zend_do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
| expr '<' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 CLS_CC); }
| expr T_IS_SMALLER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); }
| expr '>' expr { zend_do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 CLS_CC); }
| expr T_IS_GREATER_OR_EQUAL expr { zend_do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); }
| '(' expr ')' { $$ = $2; }
| expr '?' { zend_do_begin_qm_op(&$1, &$2 CLS_CC); }
expr ':' { zend_do_qm_true(&$4, &$2, &$5 CLS_CC); }
expr { zend_do_qm_false(&$$, &$7, &$2, &$5 CLS_CC); }
| function_call { $$ = $1; }
| internal_functions_in_yacc { $$ = $1; }
| T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_LONG CLS_CC); }
| T_DOUBLE_CAST expr { zend_do_cast(&$$, &$2, IS_DOUBLE CLS_CC); }
| T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_STRING CLS_CC); }
| T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY CLS_CC); }
| T_OBJECT_CAST expr { zend_do_cast(&$$, &$2, IS_OBJECT CLS_CC); }
| T_BOOL_CAST expr { zend_do_cast(&$$, &$2, IS_BOOL CLS_CC); }
| T_UNSET_CAST expr { zend_do_cast(&$$, &$2, IS_NULL CLS_CC); }
| T_EXIT exit_expr { zend_do_exit(&$$, &$2 CLS_CC); }
| '@' { zend_do_begin_silence(&$1 CLS_CC); } expr { zend_do_end_silence(&$1 CLS_CC); $$ = $3; }
| scalar { $$ = $1; }
| T_ARRAY '(' array_pair_list ')' { $$ = $3; }
| '`' encaps_list '`' { zend_do_shell_exec(&$$, &$2 CLS_CC); }
| T_PRINT expr { zend_do_print(&$$, &$2 CLS_CC); }
;
function_call:
T_STRING '(' { $2.u.opline_num = zend_do_begin_function_call(&$1 CLS_CC); }
function_call_parameter_list
')' { zend_do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num CLS_CC); zend_do_extended_fcall_end(CLS_C); }
| cvar '(' { zend_do_begin_dynamic_function_call(&$1 CLS_CC); }
function_call_parameter_list
')' { zend_do_end_function_call(&$1, &$$, &$4, 0, 1 CLS_CC); zend_do_extended_fcall_end(CLS_C);}
| T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { zend_do_extended_fcall_begin(CLS_C); zend_do_begin_class_member_function_call(&$1, &$3 CLS_CC); }
function_call_parameter_list
')' { zend_do_end_function_call(&$3, &$$, &$6, 1, 1 CLS_CC); zend_do_extended_fcall_end(CLS_C);}
;
exit_expr:
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
| '(' expr ')' { $$ = $2; }
;
ctor_arguments:
/* empty */ { $$.u.constant.value.lval=0; }
| '(' function_call_parameter_list ')' { $$ = $2; }
;
class_name:
T_STRING { $$ = $1; }
| r_cvar { $$ = $1; }
;
common_scalar:
T_LNUMBER { $$ = $1; }
| T_DNUMBER { $$ = $1; }
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
| T_LINE { $$ = $1; }
| T_FILE { $$ = $1; }
;
static_scalar: /* compile-time evaluated scalars */
common_scalar { $$ = $1; }
| T_STRING { zend_do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
| '+' static_scalar { $$ = $1; }
| '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
;
scalar:
T_STRING { zend_do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); }
| T_STRING_VARNAME { $$ = $1; }
| common_scalar { $$ = $1; }
| '"' encaps_list '"' { $$ = $2; }
| '\'' encaps_list '\'' { $$ = $2; }
| T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = $2; zend_do_end_heredoc(CLS_C); }
;
static_array_pair_list:
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
;
possible_comma:
/* empty */
| ','
;
non_empty_static_array_pair_list:
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); }
| non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); }
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); }
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); }
;
expr:
r_cvar { $$ = $1; }
| expr_without_variable { $$ = $1; }
;
/*
w_expr:
w_cvar { $$ = $1; }
| expr_without_variable { $$ = $1; }
;
*/
r_cvar:
cvar { zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
;
w_cvar:
cvar { zend_do_end_variable_parse(BP_VAR_W, 0 CLS_CC); $$ = $1; }
;
rw_cvar:
cvar { zend_do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); $$ = $1; }
;
cvar:
cvar_without_objects { $$ = $1; }
| cvar_without_objects T_OBJECT_OPERATOR { zend_do_push_object(&$1 CLS_CC); } ref_list { $$ = $4; }
;
cvar_without_objects:
reference_variable { $$ = $1; }
| simple_indirect_reference reference_variable { zend_do_indirect_references(&$$, &$1, &$2 CLS_CC); }
;
reference_variable:
reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
| compound_variable { zend_do_fetch_globals(&$1 CLS_CC); zend_do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
;
compound_variable:
T_VARIABLE { $$ = $1; }
| '$' '{' expr '}' { $$ = $3; }
;
dim_offset:
/* empty */ { $$.op_type = IS_UNUSED; }
| expr { $$ = $1; }
;
ref_list:
object_property { $$ = $1; }
| ref_list T_OBJECT_OPERATOR { zend_do_push_object(&$1 CLS_CC); } object_property { $$ = $4; }
;
object_property:
object_dim_list { $$ = $1; }
| cvar_without_objects { zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC); } { znode tmp_znode; zend_do_pop_object(&tmp_znode CLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
;
object_dim_list:
object_dim_list '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
| object_dim_list '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
| variable_name { znode tmp_znode; zend_do_pop_object(&tmp_znode CLS_CC); zend_do_fetch_property(&$$, &tmp_znode, &$1 CLS_CC);}
;
variable_name:
T_STRING { $$ = $1; }
| '{' expr '}' { $$ = $2; }
;
simple_indirect_reference:
'$' { $$.u.constant.value.lval = 1; }
| simple_indirect_reference '$' { $$.u.constant.value.lval++; }
;
assignment_list:
assignment_list ',' assignment_list_element
| assignment_list_element
;
assignment_list_element:
cvar { zend_do_add_list_element(&$1 CLS_CC); }
| T_LIST '(' { zend_do_new_list_begin(CLS_C); } assignment_list ')' { zend_do_new_list_end(CLS_C); }
| /* empty */ { zend_do_add_list_element(NULL CLS_CC); }
;
array_pair_list:
/* empty */ { zend_do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
| non_empty_array_pair_list possible_comma { $$ = $1; }
;
non_empty_array_pair_list:
non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { zend_do_add_array_element(&$$, &$5, &$3, 0 CLS_CC); }
| non_empty_array_pair_list ',' expr { zend_do_add_array_element(&$$, &$3, NULL, 0 CLS_CC); }
| expr T_DOUBLE_ARROW expr { zend_do_init_array(&$$, &$3, &$1, 0 CLS_CC); }
| expr { zend_do_init_array(&$$, &$1, NULL, 0 CLS_CC); }
| non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_cvar { zend_do_add_array_element(&$$, &$6, &$3, 1 CLS_CC); }
| non_empty_array_pair_list ',' '&' w_cvar { zend_do_add_array_element(&$$, &$4, NULL, 1 CLS_CC); }
| expr T_DOUBLE_ARROW '&' w_cvar { zend_do_init_array(&$$, &$4, &$1, 1 CLS_CC); }
| '&' w_cvar { zend_do_init_array(&$$, &$2, NULL, 1 CLS_CC); }
;
encaps_list:
encaps_list encaps_var { zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC); zend_do_add_variable(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_STRING { zend_do_add_string(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_NUM_STRING { zend_do_add_string(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_ENCAPSED_AND_WHITESPACE { zend_do_add_string(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_CHARACTER { zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_BAD_CHARACTER { zend_do_add_string(&$$, &$1, &$2 CLS_CC); }
| encaps_list '[' { $2.u.constant.value.lval = (long) '['; zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list ']' { $2.u.constant.value.lval = (long) ']'; zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list '{' { $2.u.constant.value.lval = (long) '{'; zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list '}' { $2.u.constant.value.lval = (long) '}'; zend_do_add_char(&$$, &$1, &$2 CLS_CC); }
| encaps_list T_OBJECT_OPERATOR { znode tmp; $2.u.constant.value.lval = (long) '-'; zend_do_add_char(&tmp, &$1, &$2 CLS_CC); $2.u.constant.value.lval = (long) '>'; zend_do_add_char(&$$, &tmp, &$2 CLS_CC); }
| /* empty */ { zend_do_init_string(&$$ CLS_CC); }
;
encaps_var:
T_VARIABLE { zend_do_fetch_globals(&$1 CLS_CC); zend_do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
| T_VARIABLE '[' { zend_do_begin_variable_parse(CLS_C); } encaps_var_offset ']' { zend_do_fetch_globals(&$1 CLS_CC); fetch_array_begin(&$$, &$1, &$4 CLS_CC); }
| T_VARIABLE T_OBJECT_OPERATOR T_STRING { zend_do_begin_variable_parse(CLS_C); fetch_simple_variable(&$2, &$1, 1 CLS_CC); zend_do_fetch_property(&$$, &$2, &$3 CLS_CC); }
| T_DOLLAR_OPEN_CURLY_BRACES expr '}' { zend_do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$2, 1 CLS_CC); }
| T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { zend_do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$2, &$4 CLS_CC); }
| T_CURLY_OPEN cvar '}' { $$ = $2; }
;
encaps_var_offset:
T_STRING { $$ = $1; }
| T_NUM_STRING { $$ = $1; }
| T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
;
internal_functions_in_yacc:
T_ISSET '(' cvar ')' { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); }
| T_EMPTY '(' cvar ')' { zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); }
| T_INCLUDE expr { zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
| T_INCLUDE_ONCE expr { zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
| T_EVAL '(' expr ')' { zend_do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
| T_REQUIRE expr { zend_do_include_or_eval(ZEND_REQUIRE, &$$, &$2 CLS_CC); }
| T_REQUIRE_ONCE expr { zend_do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 CLS_CC); }
;
%%
File renamed without changes.
@@ -38,11 +38,12 @@
#endif
#include <errno.h>
#include <limits.h>
#include "zend.h"
#include "zend_alloc.h"
#include "zend-parser.h"
#include "zend_language_parser.h"
#include "zend_compile.h"
#include "zend-scanner.h"
#include "zend_language_scanner.h"
#include "zend_highlight.h"
#include "zend_constants.h"
#include "zend_variables.h"
@@ -76,6 +77,7 @@
#else
#define YY_DECL int lex_scan(zval *zendlval CLS_DC)
#endif
#define ECHO { ZEND_WRITE( yytext, yyleng ); }
#ifdef ZTS
@@ -88,10 +90,10 @@
class istdiostream : public istream
{
private:
stdiobuf _file;
stdiobuf _file;
public:
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
stdiobuf* rdbuf()/* const */ { return &_file; }
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
stdiobuf* rdbuf()/* const */ { return &_file; }
};
#endif
@@ -359,8 +361,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS
CG(in_compilation) = 1;
CG(active_op_array) = op_array;
compiler_result = zendparse(CLS_C);
do_return(&retval_znode, 0 CLS_CC);
restore_lexical_state(&original_lex_state CLS_CC);
zend_do_return(&retval_znode, 0 CLS_CC);
CG(in_compilation) = original_in_compilation;
if (compiler_result==1) { /* parser error */
CG(unclean_shutdown) = 1;
@@ -378,6 +379,9 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS
retval = NULL;
}
}
if (compilation_successful) {
restore_lexical_state(&original_lex_state CLS_CC);
}
return retval;
}
@@ -401,6 +405,10 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
retval = zend_compile_file(&file_handle, type CLS_CC);
if (retval && file_handle.opened_path) {
int dummy = 1;
zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
}
zend_destroy_file_handle(&file_handle CLS_CC);
if (filename==&tmp) {
@@ -477,18 +485,18 @@ zend_op_array *compile_string(zval *source_string, char *filename CLS_DC)
CG(ZFL)->BeginState(ST_IN_SCRIPTING);
#endif
compiler_result = zendparse(CLS_C);
restore_lexical_state(&original_lex_state CLS_CC);
if (compiler_result==1) {
CG(active_op_array) = original_active_op_array;
CG(unclean_shutdown)=1;
retval = NULL;
} else {
do_return(NULL, 0 CLS_CC);
zend_do_return(NULL, 0 CLS_CC);
CG(active_op_array) = original_active_op_array;
pass_two(op_array);
retval = op_array;
}
restore_lexical_state(&original_lex_state CLS_CC);
}
#ifdef ZTS
delete input_stream;
@@ -995,7 +1003,7 @@ ANY_CHAR (.|[\n])
}
<ST_IN_SCRIPTING>{LNUM}|{HNUM} {
<ST_IN_SCRIPTING>{LNUM} {
errno = 0;
zendlval->value.lval = strtol(yytext, NULL, 0);
if (errno == ERANGE) { /* overflow */
@@ -1008,6 +1016,26 @@ ANY_CHAR (.|[\n])
}
}
<ST_IN_SCRIPTING>{HNUM} {
errno = 0;
zendlval->value.lval = strtoul(yytext, NULL, 16);
if (errno == ERANGE) { /* overflow */
/* not trying strtod - it returns trash on 0x-es */
zendlval->value.lval = LONG_MAX; /* maximal long */
zend_error(E_NOTICE,"Hex number is too big: %s",yytext);
} else {
if(zendlval->value.lval < 0) {
/* maintain consistency with the old way */
zendlval->value.dval = (unsigned long) zendlval->value.lval;
zendlval->type = IS_DOUBLE;
return T_DNUMBER;
}
zendlval->type = IS_LONG;
}
zendlval->type = IS_LONG;
return T_LNUMBER;
}
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>{LNUM}|{HNUM} { /* treat numbers (almost) as strings inside encapsulated strings */
zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
zendlval->value.str.len = yyleng;
+5 -1
View File
@@ -397,8 +397,12 @@ void zend_destroy_rsrc_list_dtors()
char *zend_rsrc_list_get_rsrc_type(int resource)
{
zend_rsrc_list_dtors_entry *lde;
int rsrc_type;
if (zend_hash_index_find(&list_destructors, resource, (void **) &lde)==SUCCESS) {
if (!zend_list_find(resource, &rsrc_type))
return NULL;
if (zend_hash_index_find(&list_destructors, rsrc_type, (void **) &lde)==SUCCESS) {
return lde->type_name;
} else {
return NULL;
+33 -14
View File
@@ -63,26 +63,30 @@ ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element)
}
#define DEL_LLIST_ELEMENT(current,l) \
if (current->prev) {\
current->prev->next = current->next;\
} else {\
l->head = current->next;\
}\
if (current->next) {\
current->next->prev = current->prev;\
} else {\
l->tail = current->prev;\
}\
if (l->dtor) {\
l->dtor(current->data);\
pefree(current, l->persistent);\
}
ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2))
{
zend_llist_element *current=l->head;
while (current) {
if (compare(current->data, element)) {
if (current->prev) {
current->prev->next = current->next;
} else {
l->head = current->next;
}
if (current->next) {
current->next->prev = current->prev;
} else {
l->tail = current->prev;
}
if (l->dtor) {
l->dtor(current->data);
pefree(current, l->persistent);
}
DEL_LLIST_ELEMENT(current,l);
break;
}
current = current->next;
@@ -139,6 +143,21 @@ ZEND_API void zend_llist_copy(zend_llist *dst, zend_llist *src)
}
ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data))
{
zend_llist_element *element, *next;
element=l->head;
while (element) {
next = element->next;
if (func(element->data)) {
DEL_LLIST_ELEMENT(element,l);
}
element = next;
}
}
ZEND_API void zend_llist_apply(zend_llist *l, void (*func)(void *data))
{
zend_llist_element *element;
+1
View File
@@ -55,6 +55,7 @@ ZEND_API void zend_llist_clean(zend_llist *l);
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, llist_apply_func_t);
ZEND_API void zend_llist_apply_with_del(zend_llist *l, int (*func)(void *data));
ZEND_API void zend_llist_apply_with_argument(zend_llist *l, llist_apply_with_arg_func_t, 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);
+2 -2
View File
@@ -37,7 +37,7 @@ extern unsigned char second_arg_allow_ref[];
#include "zend.h"
#define ZEND_MODULE_API_NO 20000809
#define ZEND_MODULE_API_NO 20001214
#ifdef ZTS
#define USING_ZTS 1
#else
@@ -75,7 +75,7 @@ struct _zend_module_entry {
};
extern HashTable module_registry;
extern ZEND_API HashTable module_registry;
void module_destructor(zend_module_entry *module);
int module_registry_cleanup(zend_module_entry *module);
+6 -4
View File
@@ -189,7 +189,7 @@ void init_op(zend_op *op CLS_DC)
{
memset(&op->result, 0, sizeof(znode));
op->lineno = CG(zend_lineno);
op->result.op_type = IS_UNUSED;
SET_UNUSED(op->result);
op->extended_value = 0;
memset(&op->op1, 0, sizeof(znode));
memset(&op->op2, 0, sizeof(znode));
@@ -211,7 +211,7 @@ zend_op *get_next_op(zend_op_array *op_array CLS_DC)
zend_bailout();
}
#endif
op_array->size *= 2;
op_array->size *= 4;
op_array_alloc_ops(op_array);
}
@@ -260,8 +260,8 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
}
opline = get_next_op(op_array CLS_CC);
opline->opcode = ZEND_EXT_STMT;
opline->op1.op_type = IS_UNUSED;
opline->op2.op_type = IS_UNUSED;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
if (op_array->last>0) {
opline->lineno= op_array->opcodes[op_array->last-2].lineno;
}
@@ -302,6 +302,8 @@ int pass_two(zend_op_array *op_array)
}
opline++;
}
op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last);
op_array->size = op_array->last;
op_array->done_pass_two = 1;
return 0;
}
+37 -4
View File
@@ -32,10 +32,34 @@
#include "zend_list.h"
#include "zend_fast_cache.h"
#if WITH_BCMATH
#if 0&&WITH_BCMATH
#include "ext/bcmath/number.h"
#endif
ZEND_API int zend_atoi(const char *str, int str_len)
{
int retval;
if (!str_len) {
str_len = strlen(str);
}
retval = atoi(str);
if (str_len>0) {
switch (str[str_len-1]) {
case 'k':
case 'K':
retval *= 1024;
break;
case 'm':
case 'M':
retval *= 1048576;
break;
}
}
return retval;
}
ZEND_API double zend_string_to_double(const char *number, zend_uint length)
{
double divisor = 10.0;
@@ -92,7 +116,7 @@ ZEND_API void convert_scalar_to_number(zval *op)
case IS_DOUBLE:
case IS_LONG:
break;
#if WITH_BCMATH
#if 0&&WITH_BCMATH
case FLAG_IS_BC:
op->type = IS_DOUBLE; /* may have lost significant digits */
break;
@@ -1339,6 +1363,13 @@ static void increment_string(zval *str)
int last=0; /* Shut up the compiler warning */
int ch;
if (str->value.str.len == 0) {
STR_FREE(str->value.str.val);
str->value.str.val = estrndup("1", sizeof("1")-1);
str->value.str.len = 1;
return;
}
while(pos >= 0) {
ch = s[pos];
if (ch >= 'a' && ch <= 'z') {
@@ -1532,7 +1563,7 @@ ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, u
}
}
return len1 - len2;
return MIN(length, len1) - MIN(length, len2);
}
@@ -1567,7 +1598,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
if ((ret1=is_numeric_string(s1->value.str.val, s1->value.str.len, &lval1, &dval1)) &&
(ret2=is_numeric_string(s2->value.str.val, s2->value.str.len, &lval2, &dval2))) {
#if WITH_BCMATH
#if 0&&WITH_BCMATH
if ((ret1==FLAG_IS_BC) || (ret2==FLAG_IS_BC)) {
bc_num first, second;
@@ -1717,4 +1748,6 @@ static inline int is_numeric_string(char *str, int length, long *lval, double *d
}
}
#endif
+14 -3
View File
@@ -28,8 +28,9 @@
#include <ieeefp.h>
#endif
#if WITH_BCMATH
#include "ext/bcmath/number.h"
#if 0&&WITH_BCMATH
#include "ext/bcmath/libbcmath/src/bcmath.h"
#endif
#define MAX_LENGTH_OF_LONG 18
@@ -88,7 +89,7 @@ static inline int is_numeric_string(char *str, int length, long *lval, double *d
if (dval) {
*dval = local_dval;
}
#if WITH_BCMATH
#if 0&&WITH_BCMATH
if (length>16) {
register char *ptr=str, *end=str+length;
@@ -158,6 +159,7 @@ ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable
ZEND_API void zend_compare_arrays(zval *result, zval *a1, zval *a2);
ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
ZEND_API int zend_atoi(const char *str, int str_len);
#define convert_to_ex_master(ppzv, lower_type, upper_type) \
if ((*ppzv)->type!=IS_##upper_type) { \
@@ -207,6 +209,9 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
#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_OBJPROP(zval) (zval).value.obj.properties
#define Z_OBJCE(zval) (zval).value.obj.ce
#define Z_RESVAL(zval) (zval).value.lval
#define Z_LVAL_P(zval_p) Z_LVAL(*zval_p)
#define Z_BVAL_P(zval_p) Z_BVAL(*zval_p)
@@ -214,6 +219,9 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
#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_OBJPROP_P(zval_p) Z_OBJPROP(*zval_p)
#define Z_OBJCE_P(zval_p) Z_OBJCE(*zval_p)
#define Z_RESVAL_P(zval_p) Z_RESVAL(*zval_p)
#define Z_LVAL_PP(zval_pp) Z_LVAL(**zval_pp)
#define Z_BVAL_PP(zval_pp) Z_BVAL(**zval_pp)
@@ -221,6 +229,9 @@ ZEND_API void zend_compare_objects(zval *result, zval *o1, zval *o2);
#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_OBJPROP_PP(zval_pp) Z_OBJPROP(**zval_pp)
#define Z_OBJCE_PP(zval_pp) Z_OBJCE(**zval_pp)
#define Z_RESVAL_PP(zval_pp) Z_RESVAL(**zval_pp)
#define Z_TYPE(zval) (zval).type
#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p)
+47 -4
View File
@@ -51,15 +51,19 @@ AC_DEFUN(PHP_READDIR_R_TYPE,[
#include <sys/types.h>
#include <dirent.h>
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
main() {
DIR *dir;
char entry[sizeof(struct dirent)+257];
char entry[sizeof(struct dirent)+PATH_MAX];
struct dirent *pentry = (struct dirent *) &entry;
dir = opendir("/");
if (!dir)
exit(1);
if (readdir_r(dir, &entry, &pentry) == 0)
if (readdir_r(dir, (struct dirent *) entry, &pentry) == 0)
exit(0);
exit(1);
}
@@ -204,7 +208,7 @@ 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_))
PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_))
])
AC_DEFUN(PHP_REAL_ARG_WITH,[
@@ -476,7 +480,7 @@ AC_DEFUN(AC_EXPAND_PATH,[
$2="$1"
else
changequote({,})
ep_dir="`echo $1|sed 's%/*[^/][^/]*$%%'`"
ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`"
changequote([,])
ep_realdir="`(cd \"$ep_dir\" && pwd)`"
$2="$ep_realdir/`basename \"$1\"`"
@@ -879,3 +883,42 @@ int main(void) {
fi
])
AC_DEFUN(PHP_FOPENCOOKIE,[
AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
if test "$have_glibc_fopencookie" = "yes" ; then
dnl this comes in two flavors:
dnl newer glibcs (since 2.1.2 ? )
dnl have a type called cookie_io_functions_t
AC_TRY_COMPILE([ #define _GNU_SOURCE
#include <stdio.h>
],
[ cookie_io_functions_t cookie; ],
[ have_cookie_io_functions_t=yes ],
[ ] )
if test "$have_cookie_io_functions_t" = "yes" ; then
cookie_io_functions_t=cookie_io_functions_t
have_fopen_cookie=yes
else
dnl older glibc versions (up to 2.1.2 ?)
dnl call it _IO_cookie_io_functions_t
AC_TRY_COMPILE([ #define _GNU_SOURCE
#include <stdio.h>
],
[ _IO_cookie_io_functions_t cookie; ],
[ have_IO_cookie_io_functions_t=yes ],
[] )
if test "$have_cookie_io_functions_t" = "yes" ; then
cookie_io_functions_t=_IO_cookie_io_functions_t
have_fopen_cookie=yes
fi
fi
if test "$have_fopen_cookie" = "yes" ; then
AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ])
AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ])
fi
fi
])
+1 -1
View File
@@ -238,7 +238,7 @@ registers two INI entries - "foo" and "bar". They're given defaults "1"
and "bah" respectively - note that all defaults are always given as
strings. That doesn't reduce your ability to use integer values, simply
specify them as strings. "foo" is marked so that it can be changed by
anyone at any time (PHP_INI_ALL), whereas "foo" is marked so it can be
anyone at any time (PHP_INI_ALL), whereas "bar" is marked so it can be
changed only at startup in the php3.ini only, presumably, by the system
administrator (PHP_INI_SYSTEM).
When "foo" changes, no function is called. Access to it is done using the
+1 -1
View File
@@ -26,7 +26,7 @@ LT_TARGETS = ltconfig ltmain.sh config.guess config.sub
makefile_in_files = $(makefile_am_files:.am=.in)
makefile_files = $(makefile_am_files:e.am=e)
config_h_in = php_config.h.in
config_h_in = main/php_config.h.in
acconfig_h_SOURCES = acconfig.h.in $(config_h_files)
+1 -1
View File
@@ -54,7 +54,7 @@ distclean: distclean-recursive clean-x
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
test: $(top_builddir)/php
@$(top_builddir)/php -f $(top_srcdir)/run-tests.php `pwd`
@TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -q $(top_srcdir)/run-tests.php $(srcdir)
include $(builddir)/.deps
+1 -1
View File
@@ -32,7 +32,7 @@ mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
INSTALL = $(top_srcdir)/build/shtool install -c
INSTALL_DATA = $(INSTALL) -m 644
DEFS = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
DEFS = -I. -I$(srcdir) -I$(top_builddir)/main -I$(top_srcdir)
moduledir = $(EXTENSION_DIR)
+66 -24
View File
@@ -51,7 +51,7 @@ dnl ## All of these are normally in the extension directories.
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
dnl ## This is where the version number is changed from now on!
AM_INIT_AUTOMAKE(php, 4.0.3RC2)
AM_INIT_AUTOMAKE(php, 4.0.4pl1, nodefine)
PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
@@ -65,7 +65,7 @@ else
rm -f php_version.h.new
fi
AM_CONFIG_HEADER(php_config.h)
AM_CONFIG_HEADER(main/php_config.h)
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
@@ -95,7 +95,11 @@ BSD_MAKEFILE=no
case "$host_alias" in
*solaris*)
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS";;
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
if test "${enable_libgcc+set}" != "set" && test "$GCC" = "yes"; then
enable_libgcc=yes
fi
;;
*dgux*)
CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR";;
*darwin*|*rhapsody*)
@@ -139,6 +143,7 @@ dnl paths to the targets are relative to the build directory
SAPI_PROGRAM=php
SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME
SAPI_STATIC=libs/libphp4.a
SAPI_LIBTOOL=libphp4.la
PHP_CONFIGURE_PART(Configuring SAPI modules)
@@ -198,7 +203,7 @@ if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
fi
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend -I\$(top_srcdir)"
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
AC_CHECK_LIB(socket, socket, [
@@ -333,13 +338,13 @@ dnl Checks for types
AC_TYPE_SIZE_T
AC_TYPE_UID_T
dnl Check for struct sockaddr_in6
AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_struct_sockaddr_in6,
dnl Check for IPv6 support
AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
[AC_TRY_COMPILE([#include <sys/socket.h>
#include <netinet/in.h>], [struct sockaddr_in6 s; s;],
ac_cv_struct_sockaddr_in6=yes, ac_cv_struct_sockaddr_in6=no)])
if test "$ac_cv_struct_sockaddr_in6" = yes; then
AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6,1,[Whether you have struct sockaddr_in6])
#include <netinet/in.h>], [struct sockaddr_in6 s; int i=AF_INET6; s],
ac_cv_ipv6_support=yes, ac_cv_ipv6_support=no)])
if test "$ac_cv_ipv6_support" = yes; then
AC_DEFINE(HAVE_IPV6,1,[Whether you have IPv6 support])
fi
dnl Checks for library functions.
@@ -400,7 +405,7 @@ vsnprintf \
dnl Check for getaddrinfo, should be a better way, but...
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
[AC_TRY_COMPILE([#include <netdb.h>],
[struct addrinfo h;getaddrinfo("","",&h,&h);],
[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);],
ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no)])
if test "$ac_cv_func_getaddrinfo" = yes; then
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
@@ -500,6 +505,53 @@ AC_ARG_WITH(exec-dir,
AC_MSG_RESULT(/usr/local/php/bin)
])
PHP_ARG_WITH(openssl,for OpenSSL support,
[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6) ])
if test "$PHP_OPENSSL" = "yes"; then
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
AC_DEFUN(PHP_SETUP_OPENSSL,[
if test "$PHP_OPENSSL" = "no"; then
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
for i in $PHP_OPENSSL; do
if test -r $i/include/openssl/evp.h; then
OPENSSL_DIR=$i
OPENSSL_INC=$i/include
fi
done
if test -z "$OPENSSL_DIR"; then
AC_MSG_ERROR(Cannot find OpenSSL's <evp.h>)
fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="-I$OPENSSL_INC"
AC_MSG_CHECKING(for OpenSSL version)
AC_EGREP_CPP(yes,[
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
yes
#endif
],[
AC_MSG_RESULT(>= 0.9.6)
],[
AC_MSG_ERROR(OpenSSL version 0.9.6 or greater required.)
])
CPPFLAGS=$old_CPPFLAGS
AC_ADD_LIBPATH($OPENSSL_DIR/lib)
AC_ADD_LIBRARY(ssl)
AC_ADD_LIBRARY(crypto)
AC_ADD_INCLUDE($OPENSSL_INC)
])
if test "$PHP_OPENSSL" != "no"; then
PHP_SETUP_OPENSSL
fi
PHP_ARG_ENABLE(sigchild,whether to enable PHP's own SIGCHLD handler,
[ --enable-sigchild Enable PHP's own SIGCHLD handler.],no)
@@ -543,16 +595,6 @@ else
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG,0,[ ])
fi
PHP_ARG_ENABLE(url-fopen-wrapper,whether to enable the URL-aware fopen wrapper,
[ --disable-url-fopen-wrapper
Disable the URL-aware fopen wrapper that allows
accessing files via http or ftp.], yes)
if test "$PHP_URL_FOPEN_WRAPPER" = "yes"; then
AC_DEFINE(PHP_URL_FOPEN, 1, [ ])
else
AC_DEFINE(PHP_URL_FOPEN, 0, [ ])
fi
PHP_ARG_ENABLE(pic,whether to enable PIC for shared objects,
[ --disable-pic Disable PIC for shared objects], yes)
@@ -819,7 +861,7 @@ PHP_CONFIGURE_PART(Generating files)
PHP_GEN_CONFIG_VARS
ALL_OUTPUT_FILES="php4.spec Zend/Makefile build-defs.h $PHP_OUTPUT_FILES"
ALL_OUTPUT_FILES="php4.spec Zend/Makefile main/build-defs.h $PHP_OUTPUT_FILES"
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
@@ -843,11 +885,11 @@ fi
#
if test -d TSRM; then
echo '#include "../php_config.h"' > TSRM/tsrm_config.h
echo '#include "../main/php_config.h"' > TSRM/tsrm_config.h
fi
cat >Zend/zend_config.h <<FEO
#include "../php_config.h"
#include "../main/php_config.h"
#if defined(APACHE) && defined(PHP_API_VERSION)
#undef HAVE_DLFCN_H
#endif
+6
View File
@@ -54,7 +54,13 @@ AC_DEFUN(LIB_BUILD,[
lib_target=""
$php_shtool mkdir -p $1
if test "$BSD_MAKEFILE" = "yes"; then
lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
else
lib_include_conf="include \$(top_builddir)/config_vars.mk"
fi
cat >$lib_makefile<<EOF
$lib_include_conf
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
EOF
+2
View File
@@ -0,0 +1,2 @@
aspell
Rasmus Lerdorf
+3 -2
View File
@@ -52,15 +52,16 @@ zend_module_entry aspell_module_entry = {
ZEND_GET_MODULE(aspell)
#endif
static void php_aspell_close(aspell *sc)
static void php_aspell_close(zend_rsrc_list_entry *rsrc)
{
aspell *sc = (aspell *)rsrc->ptr;
aspell_free(sc);
}
PHP_MINIT_FUNCTION(aspell)
{
le_aspell = register_list_destructors(php_aspell_close,NULL);
le_aspell = zend_register_list_destructors_ex(php_aspell_close, NULL, "aspell", module_number);
return SUCCESS;
}
+2
View File
@@ -0,0 +1,2 @@
BC Math
Andi Gutmans
+5
View File
@@ -2,5 +2,10 @@
LTLIBRARY_NAME = libbcmath.la
LTLIBRARY_SOURCES = bcmath.c number.c
LTLIBRARY_SHARED_NAME = bcmath.la
LTLIBRARY_DEPENDENCIES = libbcmath/libbcmath.la
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES)
LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
SUBDIRS = libbcmath
include $(top_srcdir)/build/dynlib.mk
+132 -70
View File
@@ -22,8 +22,9 @@
#if WITH_BCMATH
#include "number.h"
#include "ext/standard/info.h"
#include "php_bcmath.h"
#include "ext/bcmath/libbcmath/src/bcmath.h"
function_entry bcmath_functions[] = {
PHP_FE(bcadd, NULL)
@@ -39,7 +40,14 @@ function_entry bcmath_functions[] = {
};
zend_module_entry bcmath_module_entry = {
"bcmath", bcmath_functions, NULL, NULL, PHP_RINIT(bcmath), PHP_RSHUTDOWN(bcmath), NULL, STANDARD_MODULE_PROPERTIES
"bcmath",
bcmath_functions,
PHP_MINIT(bcmath),
PHP_MSHUTDOWN(bcmath),
PHP_RINIT(bcmath),
NULL,
PHP_MINFO(bcmath),
STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_BCMATH
@@ -50,19 +58,73 @@ ZEND_GET_MODULE(bcmath)
static long bc_precision;
#endif
/* Storage used for special numbers. */
bc_num _zero_;
bc_num _one_;
bc_num _two_;
/* Make a copy of a number! Just increments the reference count! */
bc_num copy_num (bc_num num)
{
num->n_refs++;
return num;
}
/* Initialize a number NUM by making it a copy of zero. */
void init_num (bc_num *num)
{
*num = copy_num (_zero_);
}
PHP_MINIT_FUNCTION(bcmath)
{
extern bc_num _zero_;
extern bc_num _one_;
extern bc_num _two_;
_zero_ = bc_new_num (1,0);
_one_ = bc_new_num (1,0);
_one_->n_value[0] = 1;
_two_ = bc_new_num (1,0);
_two_->n_value[0] = 2;
persist_alloc(_zero_);
persist_alloc(_one_);
persist_alloc(_two_);
persist_alloc(_zero_->n_ptr);
persist_alloc(_one_->n_ptr);
persist_alloc(_two_->n_ptr);
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(bcmath)
{
bc_free_num(&_zero_);
bc_free_num(&_one_);
bc_free_num(&_two_);
return SUCCESS;
}
PHP_RINIT_FUNCTION(bcmath)
{
init_numbers();
if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) {
bc_precision=0;
}
return SUCCESS;
}
PHP_RSHUTDOWN_FUNCTION(bcmath)
PHP_MINFO_FUNCTION(bcmath)
{
destruct_numbers();
return SUCCESS;
php_info_print_table_start();
php_info_print_table_row(2, "BCMath support", "enabled");
php_info_print_table_end();
}
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
@@ -92,18 +154,18 @@ PHP_FUNCTION(bcadd)
}
convert_to_string_ex(left);
convert_to_string_ex(right);
init_num(&first);
init_num(&second);
init_num(&result);
str2num(&first,(*left)->value.str.val,scale);
str2num(&second,(*right)->value.str.val,scale);
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first,(*left)->value.str.val,scale);
bc_str2num(&second,(*right)->value.str.val,scale);
bc_add (first,second,&result, scale);
return_value->value.str.val = num2str(result);
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
free_num(&first);
free_num(&second);
free_num(&result);
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
return;
}
/* }}} */
@@ -135,18 +197,18 @@ PHP_FUNCTION(bcsub)
}
convert_to_string_ex(left);
convert_to_string_ex(right);
init_num(&first);
init_num(&second);
init_num(&result);
str2num(&first,(*left)->value.str.val,scale);
str2num(&second,(*right)->value.str.val,scale);
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first,(*left)->value.str.val,scale);
bc_str2num(&second,(*right)->value.str.val,scale);
bc_sub (first,second,&result, scale);
return_value->value.str.val = num2str(result);
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
free_num(&first);
free_num(&second);
free_num(&result);
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
return;
}
/* }}} */
@@ -178,18 +240,18 @@ PHP_FUNCTION(bcmul)
}
convert_to_string_ex(left);
convert_to_string_ex(right);
init_num(&first);
init_num(&second);
init_num(&result);
str2num(&first,(*left)->value.str.val,scale);
str2num(&second,(*right)->value.str.val,scale);
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first,(*left)->value.str.val,scale);
bc_str2num(&second,(*right)->value.str.val,scale);
bc_multiply (first,second,&result, scale);
return_value->value.str.val = num2str(result);
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
free_num(&first);
free_num(&second);
free_num(&result);
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
return;
}
/* }}} */
@@ -221,14 +283,14 @@ PHP_FUNCTION(bcdiv)
}
convert_to_string_ex(left);
convert_to_string_ex(right);
init_num(&first);
init_num(&second);
init_num(&result);
str2num(&first,(*left)->value.str.val,scale);
str2num(&second,(*right)->value.str.val,scale);
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first,(*left)->value.str.val,scale);
bc_str2num(&second,(*right)->value.str.val,scale);
switch (bc_divide (first,second,&result, scale)) {
case 0: /* OK */
return_value->value.str.val = num2str(result);
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
break;
@@ -236,9 +298,9 @@ PHP_FUNCTION(bcdiv)
php_error(E_WARNING,"Division by zero");
break;
}
free_num(&first);
free_num(&second);
free_num(&result);
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
return;
}
/* }}} */
@@ -262,14 +324,14 @@ PHP_FUNCTION(bcmod)
}
convert_to_string_ex(left);
convert_to_string_ex(right);
init_num(&first);
init_num(&second);
init_num(&result);
str2num(&first,(*left)->value.str.val,0);
str2num(&second,(*right)->value.str.val,0);
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first,(*left)->value.str.val,0);
bc_str2num(&second,(*right)->value.str.val,0);
switch (bc_modulo(first,second,&result, 0)) {
case 0:
return_value->value.str.val = num2str(result);
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
break;
@@ -277,9 +339,9 @@ PHP_FUNCTION(bcmod)
php_error(E_WARNING,"Division by zero");
break;
}
free_num(&first);
free_num(&second);
free_num(&result);
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
return;
}
/* }}} */
@@ -311,18 +373,18 @@ PHP_FUNCTION(bcpow)
}
convert_to_string_ex(left);
convert_to_string_ex(right);
init_num(&first);
init_num(&second);
init_num(&result);
str2num(&first,(*left)->value.str.val,scale);
str2num(&second,(*right)->value.str.val,scale);
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first,(*left)->value.str.val,scale);
bc_str2num(&second,(*right)->value.str.val,scale);
bc_raise (first,second,&result, scale);
return_value->value.str.val = num2str(result);
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
free_num(&first);
free_num(&second);
free_num(&result);
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
return;
}
/* }}} */
@@ -353,16 +415,16 @@ PHP_FUNCTION(bcsqrt)
break;
}
convert_to_string_ex(left);
init_num(&result);
str2num(&result,(*left)->value.str.val,scale);
bc_init_num(&result);
bc_str2num(&result,(*left)->value.str.val,scale);
if (bc_sqrt (&result, scale) != 0) {
return_value->value.str.val = num2str(result);
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
} else {
php_error(E_WARNING,"Square root of negative number");
}
free_num(&result);
bc_free_num(&result);
return;
}
/* }}} */
@@ -395,16 +457,16 @@ PHP_FUNCTION(bccomp)
convert_to_string_ex(left);
convert_to_string_ex(right);
init_num(&first);
init_num(&second);
bc_init_num(&first);
bc_init_num(&second);
str2num(&first,(*left)->value.str.val,scale);
str2num(&second,(*right)->value.str.val,scale);
bc_str2num(&first,(*left)->value.str.val,scale);
bc_str2num(&second,(*right)->value.str.val,scale);
return_value->value.lval = bc_compare(first,second);
return_value->type = IS_LONG;
free_num(&first);
free_num(&second);
bc_free_num(&first);
bc_free_num(&second);
return;
}
/* }}} */
+5 -7
View File
@@ -1,16 +1,14 @@
dnl $Id$
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. ])
PHP_ARG_ENABLE(bcmath, for bc style precision math functions,
[ --enable-bcmath Enable bc style precision math functions.])
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
PHP_FAST_OUTPUT($ext_builddir/libbcmath/Makefile $ext_builddir/libbcmath/src/Makefile)
LIB_BUILD($ext_builddir/libbcmath,$ext_shared,yes)
LIB_BUILD($ext_builddir/libbcmath/src,$ext_shared,yes)
fi
dnl ## Local Variables:
+3
View File
@@ -0,0 +1,3 @@
Phil Nelson <philnelson@acm.org> wrote bcmath library.
+515
View File
@@ -0,0 +1,515 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
^L
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
^L
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
^L
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
^L
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
^L
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
^L
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
^L
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
^L
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
<one line to give the library's name and a brief idea of what it
does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper
mail.
You should also get your employer (if you work as a programmer) or
your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
+10
View File
@@ -0,0 +1,10 @@
Wed Jun 7 09:39:02 2000 Phil Nelson <phil@cs.wwu.edu>
* configure.in and many others: version number now at 0.2.
Many other changes/additions for getting a distribution
to work.
2000-05-21 Phil Nelson <phil@cs.wwu.edu>
* Initial setup of bcmath library., calling it version 0.1.
+21
View File
@@ -0,0 +1,21 @@
BCMATH FAQ:
1) Why BCMATH?
The math routines of GNU bc become more generally useful in a
library form. By separating the BCMATH library from GNU bc,
GNU bc can be under the GPL and BCMATH can be under the LGPL.
2) Why BCMATH when GMP exists?
GMP has "integers" (no digits after a decimal), "rational numbers"
(stored as 2 integers) and "floats". None of these will correctly
represent a POSIX BC number. Floats are the closest, but will not
behave correctly for many computations. For example, BC numbers have
a "scale" that represent the number of digits to represent after the
decimal point. The multiplying two of these numbers requires one to
calculate an exact number of digits after the decimal point regardless
of the number of digits in the integer part. GMP floats have a
"fixed, but arbitrary" mantissa and so multiplying two floats will end
up dropping digits BC must calculate.
+9
View File
@@ -0,0 +1,9 @@
Currently, only libbcmath.a is built. To build and install it, do
configure
make
make install
Typical configure parameters are available. (e.g. PREFIX)
Bugs and comments to philnelson@acm.org.
+12
View File
@@ -0,0 +1,12 @@
## Process this file with automake to produce Makefile.in
SUBDIRS= src doc
MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \
stamp-h.in *~
dist-hook:
cp $(srcdir)/doc/bcmath.1 $(distdir)/doc
cp $(srcdir)/src/private.h $(distdir)/src
cp $(srcdir)/FAQ $(distdir)
+9
View File
@@ -0,0 +1,9 @@
LTLIBRARY_NAME = libbcmath.la
LTLIBRARY_DEPENDENCIES = src/libbcmath.la
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES)
LTLIBRARY_SHARED_LIBADD = $(LTLIBRARY_LIBADD)
SUBDIRS = src
include $(top_srcdir)/build/dynlib.mk
+3
View File
@@ -0,0 +1,3 @@
NEWS for bcmath library:
May 2000: The library is created.
+9
View File
@@ -0,0 +1,9 @@
This is bcmath, a library of arbitrary precision math routines.
These routines, in a different form, are the routines that to
the arbitrary precision calculations for GNU bc and GNU dc.
This library is provided to make these routines useful in a
larger context with less restrictions on the use of them.
These routines do not duplicate functionality of the GNU gmp
library. gmp is similar, but the actual computation is different.
+9
View File
@@ -0,0 +1,9 @@
/* PACKAGE name */
#undef PACKAGE
/* Package VERSION number */
#undef VERSION
/* Define to `size_t' if <sys/types.h> and <stddef.h> don't define. */
#undef ptrdiff_t
+127
View File
@@ -0,0 +1,127 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "[$]*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
if test "[$]*" != "X $srcdir/configure conftestfile" \
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; do
case " <<$>>CONFIG_HEADERS " in
*" <<$>>am_file "*<<)>>
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
;;
esac
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])
+41
View File
@@ -0,0 +1,41 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to `size_t' if <sys/types.h> and <stddef.h> don't define. */
#undef ptrdiff_t
/* Define if you have the <lib.h> header file. */
#undef HAVE_LIB_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION
+1859
View File
File diff suppressed because it is too large. Load diff
+18
View File
@@ -0,0 +1,18 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(doc/bcmath.1)
AM_INIT_AUTOMAKE("bcmath", "0.2")
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_MAKE_SET
AC_CHECK_HEADERS(stdarg.h stddef.h stdlib.h string.h limits.h unistd.h lib.h)
AC_C_CONST
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ptrdiff_t, size_t)
AC_OUTPUT(Makefile src/Makefile doc/Makefile)
+3
View File
@@ -0,0 +1,3 @@
# Documentation makefile
MAINTAINERCLEANFILES= Makefile.in
+171
View File
@@ -0,0 +1,171 @@
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Documentation makefile
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
MAINTAINERCLEANFILES = Makefile.in
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+1
View File
@@ -0,0 +1 @@
./" bcmath library documentation
+238
View File
@@ -0,0 +1,238 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
tranformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
+134
View File
@@ -0,0 +1,134 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison touch file \`y.tab.c'
makeinfo touch the output file
yacc touch file \`y.tab.c'"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing - GNU libit 0.0"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. It should be needed only if
you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. It should be needed only if
you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. It should be needed only if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
touch config.h.in
;;
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. It should be needed only if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print \
| sed 's/^\(.*\).am$/touch \1.in/' \
| sh
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. It should be needed only if
your modified any \`.y' file. For being effective, your
modifications might require the \`Bison' package. Grab it from
any GNU archive site."
touch y.tab.c
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. It should be needed only if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
+36
View File
@@ -0,0 +1,36 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Last modified: 1994-03-25
# Public domain
errstatus=0
for file in ${1+"$@"} ; do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d in ${1+"$@"} ; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp" 1>&2
mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
fi
if test ! -d "$pathcomp"; then
errstatus=$lasterr
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# mkinstalldirs ends here
+21
View File
@@ -0,0 +1,21 @@
# Makefile for bcmath library
lib_LIBRARIES = libbcmath.a
include_HEADERS = bcmath.h
libbcmath_a_SOURCES= add.c compare.c debug.c div.c divmod.c doaddsub.c \
init.c int2num.c nearzero.c neg.c num2long.c num2str.c output.c \
raise.c raisemod.c recmul.c rmzero.c sqrt.c str2num.c sub.c zero.c \
outofmem.c rt.c
INCLUDES = -I$(srcdir) -I..
CFLAGS = @CFLAGS@ $(INCLUDES) -Wall
MAINTAINERCLEANFILES= Makefile.in $(libbcmath_a_SOURCES) private.h bcmath.h
all: $(bin_LIBRARIES)
clean:
rm -f $(OBJS) $(LIB) *~
+7
View File
@@ -0,0 +1,7 @@
LTLIBRARY_NAME = libbcmath.la
LTLIBRARY_SOURCES = add.c div.c init.c neg.c outofmem.c raisemod.c rt.c sub.c \
compare.c divmod.c int2num.c num2long.c output.c recmul.c \
sqrt.c zero.c debug.c doaddsub.c nearzero.c num2str.c raise.c \
rmzero.c str2num.c
include $(top_srcdir)/build/dynlib.mk
+88
View File
@@ -0,0 +1,88 @@
/* add.c: bcmath library file. */
/*
Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
Copyright (C) 2000 Philip A. Nelson
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. (COPYING.LIB)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA.
You may contact the author by:
e-mail: philnelson@acm.org
us-mail: Philip A. Nelson
Computer Science Department, 9062
Western Washington University
Bellingham, WA 98226-9062
*************************************************************************/
#include <config.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include "bcmath.h"
#include "private.h"
/* Here is the full add routine that takes care of negative numbers.
N1 is added to N2 and the result placed into RESULT. SCALE_MIN
is the minimum scale for the result. */
void
bc_add (n1, n2, result, scale_min)
bc_num n1, n2, *result;
int scale_min;
{
bc_num sum = NULL;
int cmp_res;
int res_scale;
if (n1->n_sign == n2->n_sign)
{
sum = _bc_do_add (n1, n2, scale_min);
sum->n_sign = n1->n_sign;
}
else
{
/* subtraction must be done. */
cmp_res = _bc_do_compare (n1, n2, FALSE, FALSE); /* Compare magnitudes. */
switch (cmp_res)
{
case -1:
/* n1 is less than n2, subtract n1 from n2. */
sum = _bc_do_sub (n2, n1, scale_min);
sum->n_sign = n2->n_sign;
break;
case 0:
/* They are equal! return zero with the correct scale! */
res_scale = MAX (scale_min, MAX(n1->n_scale, n2->n_scale));
sum = bc_new_num (1, res_scale);
memset (sum->n_value, 0, res_scale+1);
break;
case 1:
/* n2 is less than n1, subtract n2 from n1. */
sum = _bc_do_sub (n1, n2, scale_min);
sum->n_sign = n1->n_sign;
}
}
/* Clean up and return. */
bc_free_num (result);
*result = sum;
}
+158
View File
@@ -0,0 +1,158 @@
/* bcmath.h: bcmath library header. */
/*
Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
Copyright (C) 2000 Philip A. Nelson
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. (COPYING.LIB)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA.
You may contact the author by:
e-mail: philnelson@acm.org
us-mail: Philip A. Nelson
Computer Science Department, 9062
Western Washington University
Bellingham, WA 98226-9062
*************************************************************************/
#ifndef _BCMATH_H_
#define _BCMATH_H_
typedef enum {PLUS, MINUS} sign;
typedef struct bc_struct *bc_num;
typedef struct bc_struct
{
sign n_sign;
int n_len; /* The number of digits before the decimal point. */
int n_scale; /* The number of digits after the decimal point. */
int n_refs; /* The number of pointers to this number. */
bc_num n_next; /* Linked list for available list. */
char *n_ptr; /* The pointer to the actual storage.
If NULL, n_value points to the inside of
another number (bc_multiply...) and should
not be "freed." */
char *n_value; /* The number. Not zero char terminated.
May not point to the same place as n_ptr as
in the case of leading zeros generated. */
} bc_struct;
/* The base used in storing the numbers in n_value above.
Currently this MUST be 10. */
#define BASE 10
/* Some useful macros and constants. */
#define CH_VAL(c) (c - '0')
#define BCD_CHAR(d) (d + '0')
#ifdef MIN
#undef MIN
#undef MAX
#endif
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)>(b)?(b):(a))
#define ODD(a) ((a)&1)
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#ifndef LONG_MAX
#define LONG_MAX 0x7ffffff
#endif
/* Global numbers. */
extern bc_num _zero_;
extern bc_num _one_;
extern bc_num _two_;
/* Function Prototypes */
/* Define the _PROTOTYPE macro if it is needed. */
#ifndef _PROTOTYPE
#ifdef __STDC__
#define _PROTOTYPE(func, args) func args
#else
#define _PROTOTYPE(func, args) func()
#endif
#endif
_PROTOTYPE(void bc_init_numbers, (void));
_PROTOTYPE(bc_num bc_new_num, (int length, int scale));
_PROTOTYPE(void bc_free_num, (bc_num *num));
_PROTOTYPE(bc_num bc_copy_num, (bc_num num));
_PROTOTYPE(void bc_init_num, (bc_num *num));
_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale));
_PROTOTYPE(char *bc_num2str, (bc_num num));
_PROTOTYPE(void bc_int2num, (bc_num *num, int val));
_PROTOTYPE(long bc_num2long, (bc_num num));
_PROTOTYPE(int bc_compare, (bc_num n1, bc_num n2));
_PROTOTYPE(char bc_is_zero, (bc_num num));
_PROTOTYPE(char bc_is_near_zero, (bc_num num, int scale));
_PROTOTYPE(char bc_is_neg, (bc_num num));
_PROTOTYPE(void bc_add, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
_PROTOTYPE(void bc_sub, (bc_num n1, bc_num n2, bc_num *result, int scale_min));
_PROTOTYPE(void bc_multiply, (bc_num n1, bc_num n2, bc_num *prod, int scale));
_PROTOTYPE(int bc_divide, (bc_num n1, bc_num n2, bc_num *quot, int scale));
_PROTOTYPE(int bc_modulo, (bc_num num1, bc_num num2, bc_num *result,
int scale));
_PROTOTYPE(int bc_divmod, (bc_num num1, bc_num num2, bc_num *quot,
bc_num *rem, int scale));
_PROTOTYPE(int bc_raisemod, (bc_num base, bc_num expo, bc_num mod,
bc_num *result, int scale));
_PROTOTYPE(void bc_raise, (bc_num num1, bc_num num2, bc_num *result,
int scale));
_PROTOTYPE(int bc_sqrt, (bc_num *num, int scale));
_PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int),
int leading_zero));
/* Prototypes needed for external utility routines. */
_PROTOTYPE(void bc_rt_warn, (char *mesg ,...));
_PROTOTYPE(void bc_rt_error, (char *mesg ,...));
_PROTOTYPE(void bc_out_of_memory, (void));
#endif
+161
View File
@@ -0,0 +1,161 @@
/* compare.c: bcmath library file. */
/*
Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
Copyright (C) 2000 Philip A. Nelson
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. (COPYING.LIB)
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA.
You may contact the author by:
e-mail: philnelson@acm.org
us-mail: Philip A. Nelson
Computer Science Department, 9062
Western Washington University
Bellingham, WA 98226-9062
*************************************************************************/
#include <config.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include "bcmath.h"
#include "private.h"
/* Compare two bc numbers. Return value is 0 if equal, -1 if N1 is less
than N2 and +1 if N1 is greater than N2. If USE_SIGN is false, just
compare the magnitudes. */
int
_bc_do_compare (n1, n2, use_sign, ignore_last)
bc_num n1, n2;
int use_sign;
int ignore_last;
{
char *n1ptr, *n2ptr;
int count;
/* First, compare signs. */
if (use_sign && n1->n_sign != n2->n_sign)
{
if (n1->n_sign == PLUS)
return (1); /* Positive N1 > Negative N2 */
else
return (-1); /* Negative N1 < Positive N1 */
}
/* Now compare the magnitude. */
if (n1->n_len != n2->n_len)
{
if (n1->n_len > n2->n_len)
{
/* Magnitude of n1 > n2. */
if (!use_sign || n1->n_sign == PLUS)
return (1);
else
return (-1);
}
else
{
/* Magnitude of n1 < n2. */
if (!use_sign || n1->n_sign == PLUS)
return (-1);
else
return (1);
}
}
/* If we get here, they have the same number of integer digits.
check the integer part and the equal length part of the fraction. */
count = n1->n_len + MIN (n1->n_scale, n2->n_scale);
n1ptr = n1->n_value;
n2ptr = n2->n_value;
while ((count > 0) && (*n1ptr == *n2ptr))
{
n1ptr++;
n2ptr++;
count--;
}
if (ignore_last && count == 1 && n1->n_scale == n2->n_scale)
return (0);
if (count != 0)
{
if (*n1ptr > *n2ptr)
{
/* Magnitude of n1 > n2. */
if (!use_sign || n1->n_sign == PLUS)
return (1);
else
return (-1);
}
else
{
/* Magnitude of n1 < n2. */
if (!use_sign || n1->n_sign == PLUS)
return (-1);
else
return (1);
}
}
/* They are equal up to the last part of the equal part of the fraction. */
if (n1->n_scale != n2->n_scale)
{
if (n1->n_scale > n2->n_scale)
{
for (count = n1->n_scale-n2->n_scale; count>0; count--)
if (*n1ptr++ != 0)
{
/* Magnitude of n1 > n2. */
if (!use_sign || n1->n_sign == PLUS)
return (1);
else
return (-1);
}
}
else
{
for (count = n2->n_scale-n1->n_scale; count>0; count--)
if (*n2ptr++ != 0)
{
/* Magnitude of n1 < n2. */
if (!use_sign || n1->n_sign == PLUS)
return (-1);
else
return (1);
}
}
}
/* They must be equal! */
return (0);
}
/* This is the "user callable" routine to compare numbers N1 and N2. */
int
bc_compare (n1, n2)
bc_num n1, n2;
{
return _bc_do_compare (n1, n2, TRUE, FALSE);
}
+9
View File
@@ -0,0 +1,9 @@
#if PHP_WIN32
#include "../../../../main/config.w32.h"
#else
#include "php_config.h"
#endif
#include <string.h>
#include "zend.h"
#include "zend_alloc.h"
Loaded 100 of 652 files, more files were not shown because too many files have changed in this diff. Show more