Compare commits

...
Author SHA1 Message Date
SVN Migration ea1e37dddd This commit was manufactured by cvs2svn to create tag 'ZEND_OPTIMIZER_B1'. 1999-11-21 18:19:09 +00:00
Andi Gutmans f3ca328b34 That slipped away 1999-11-21 18:19:08 +00:00
Zeev Suraski 6358c6631b - Optimize class instanciation
- Fix constant instanciation for array elements inside objects
1999-11-21 18:11:10 +00:00
Thies C. Arntzen 5cc10ecec2 @- Fixed float-compare in min(),max(),a[r]sort(),[r]sort(). (Thies)
convert_to_long() after compare_function() destroys float-compares!
1999-11-21 17:13:39 +00:00
Egon Schmid 0929985414 Maybe later on today. Must buy some beer first. 1999-11-21 14:06:30 +00:00
Thies C. Arntzen f24db304ee @- Implemented get_html_translation_table() function. (Thies)
(PHP get_html_translation_table) new function.
1999-11-21 13:25:04 +00:00
Thies C. Arntzen 2451ff5368 @- Implemented array_flip() function. Returns input-array with key, value
@  flipped. (Thies)
(PHP array_flip) new function. no clash detection, only works for IS_STRING and IS_LONG datatypes in src-array.
1999-11-21 12:37:53 +00:00
Thies C. Arntzen ee1380e6b0 -renamed some macros
-return_value_used now used in a few more functions
1999-11-21 12:13:44 +00:00
Thies C. Arntzen 9788129e0e (PHP strtr) little smarter 1999-11-21 12:05:39 +00:00
Stefan Roehrich afcd361117 Java module now works with Linux jdk 1.2pre2. 1999-11-21 10:45:01 +00:00
Rasmus Lerdorf 1831279f0c # Fix ColorResolve bogosity
Fix gd problems
1999-11-21 04:07:56 +00:00
64eac40e77 ChangeLog update 1999-11-21 02:08:45 +00:00
450bd9c164 NEWS update 1999-11-21 02:08:42 +00:00
Sascha Schumann 9a047652cc add Berkeley DB3 support
@- Added Berkeley DB3 support in DBA (Sascha)
1999-11-20 22:50:42 +00:00
Andrei Zmievski 90ecf41b19 (PHP substr_replace) Changed the order of the arguments. 1999-11-20 22:09:27 +00:00
Sascha Schumann 51c83e9f4b --enable-versioning can now be used with CGI/AOLserver as well. Note that
we do not use versioning per se anymore, but export only the required
symbols.
1999-11-20 19:00:17 +00:00
Andi Gutmans e4e8c3539f - Changed path to MySQL library in Win32 project 1999-11-20 16:56:41 +00:00
Thies C. Arntzen 2013026c14 @- Implemented 2-Arg version of strtr($str,$translation_array). This can be used
@  to revert what htmlspecialchars() did. (Thies)
(PHP strtr) new 2-Arg version.
1999-11-20 15:53:18 +00:00
Thies C. Arntzen 111c24b5b1 *** empty log message *** 1999-11-20 10:11:36 +00:00
Andi Gutmans 9e26d8a3c9 - Fixed a typo in the name of the project file. It links now 1999-11-20 09:17:30 +00:00
22aeaedc0e ChangeLog update 1999-11-20 02:08:40 +00:00
f4767f385a NEWS update 1999-11-20 02:08:37 +00:00
Andi Gutmans b89689f2ef - More PGSQL thread-safe updates. It still doesn't work though. Crashes for
some reason at .dll load time
1999-11-20 01:14:36 +00:00
Andi Gutmans 0c65c8a23c - Should pretty much work now 1999-11-20 01:04:45 +00:00
Andi Gutmans 770ef718c5 - Add project file 1999-11-20 00:45:44 +00:00
Andi Gutmans cc3d636f66 - Start PostgreSQL support for Win32. Just added preliminary ZTS support.
Still need to make minit ZTS.
1999-11-20 00:30:08 +00:00
Andrei Zmievski 3ae0f5fdc4 (PHP preg_replace) Fixed a bug that cause backreferences to lose
their value after the first occurrence.
1999-11-19 22:59:12 +00:00
Andrei Zmievski 71a8c018cb Fixed a bug that would replace only the first occurrence and result in
a parse error for the rest when using /e modifier.
1999-11-19 22:28:06 +00:00
Thies C. Arntzen 3e59135a5c <sys/time.h> is needed on linux 1999-11-19 18:33:21 +00:00
Andi Gutmans 1f11e07fc6 - Moved var_uninit() for return_value to the beginning of DO_FCALL.
We forgot to do it for overloaded methods
1999-11-19 17:04:54 +00:00
Andi Gutmans 817a11e7ed - Functions whose return values aren't used have them freed in DO_FCALL
and don't need a special ZEND_FREE opcode following them anymore
1999-11-19 16:55:25 +00:00
Andi Gutmans 0094b765eb - Make it consistent with the rest of the stuff there. 1999-11-19 16:42:19 +00:00
Andi Gutmans 3bffcbef5b - Add array.c to the Win32 project 1999-11-19 15:06:57 +00:00
Thies C. Arntzen b712c9360d @- Fixed mem-overwrite in XML_Parse_Into_Struct. (Thies)
(PHP xml_parse_into_struct) buffer was sometimes short by 1.
1999-11-19 14:11:15 +00:00
Zeev Suraski 1f41ddfe7f Optimize a bit 1999-11-19 13:06:12 +00:00
Zeev Suraski 049b74b88f Fix a bug in sybase_fetch_hash() 1999-11-19 13:00:57 +00:00
8e34f69c09 ChangeLog update 1999-11-19 02:08:42 +00:00
Andrew Skalski 0cb70ef9bb Removed stdio wrapper from sockets; added timeouts to socket ops. 1999-11-18 20:29:32 +00:00
Sascha Schumann 111cedbbea Moving apMakefile.{libdir,tmpl} to sapi/apache directory. 1999-11-18 14:21:50 +00:00
Sam Ruby 560c0c4308 arg! alphabetize correctly! 1999-11-18 03:03:24 +00:00
Sam Ruby fd41750d87 add Java module to credit info 1999-11-18 02:40:52 +00:00
cee88d3852 ChangeLog update 1999-11-18 02:09:04 +00:00
Sascha Schumann 4bb5e353d5 Add post request startup handlers. These are called at the end of the
request startup function, and can use the initialized structures like
the symbol table.
1999-11-17 23:01:27 +00:00
Sascha Schumann abe0176840 (php_rinit_session): use post request startups to reenable session.auto_start 1999-11-17 22:59:27 +00:00
Sascha Schumann b416e57770 Remove --enable-thread-safety. There is no reason people should be able
to set this manually; most likely, they will burn themselves by using it.
1999-11-17 21:06:32 +00:00
Andi Gutmans 52045afb08 - If a function's return value is unused then don't create a ZEND_FREE
opcode but free it after the function call in zend_execute.
1999-11-17 17:21:15 +00:00
Stig Bakken 3150bd63e9 Bump version to 4.0b4-dev. 1999-11-17 13:25:44 +00:00
Thies C. Arntzen 927260bf57 b3 is already tagged in CVS 1999-11-17 09:38:21 +00:00
Andi Gutmans 800e00727a - Forgot this 1999-11-17 04:38:38 +00:00
51d018d292 ChangeLog update 1999-11-17 02:08:50 +00:00
407a1fbe66 NEWS update 1999-11-17 02:08:46 +00:00
Andrei Zmievski e46198bf7b (PHP substr_replace) New function.
@- Added substr_replace() function. (Andrei)
1999-11-16 22:44:13 +00:00
Andi Gutmans 3cd140cdef - Weird that this compiled for me. 1999-11-16 20:31:29 +00:00
Andrei Zmievski 61142e4341 Just some rearranging. 1999-11-16 20:14:55 +00:00
Andi Gutmans 247d3d3345 - CHange used_return_value -> return_value_used 1999-11-16 19:12:46 +00:00
Andi Gutmans 9e14736315 - Change used_return_value to return_value_used 1999-11-16 19:12:29 +00:00
Andi Gutmans 7239aad9c4 - Initial support for Thies' idea of passing functions a flag telling them
they don't need to return a value. Adjusted reset() to work with this.
  It is a bit problematic because if internal functions don't look at the
  flag and still return a value orginally this leaked. So I free the value
  in any case, which kind of makes the speed gain a bit smaller
1999-11-16 18:47:47 +00:00
Andi Gutmans b7b614d0b5 - In any case create the free opcode. Need to allow the functions to
create a hint.
1999-11-16 18:46:32 +00:00
Andi Gutmans dbb67ab9dc - Add support for used_return_value passed to internal functions. 1999-11-16 18:30:06 +00:00
Stig Bakken 87d6372a14 final news update before 4.0b3 1999-11-16 15:58:38 +00:00
Stig Bakken bb6dacfb69 final changelog update before 4.0b3 1999-11-16 15:52:32 +00:00
Stig Bakken 65557ffe88 4.0b3 coming up 1999-11-16 15:37:31 +00:00
dca71900c1 ChangeLog update 1999-11-16 02:08:50 +00:00
Andrei Zmievski c1e3f5cb17 cleaning up 1999-11-15 14:35:08 +00:00
6c51d44141 ChangeLog update 1999-11-15 02:08:54 +00:00
30cfeece94 NEWS update 1999-11-15 02:08:51 +00:00
Sascha Schumann 897127d44a (php_minit_mcrypt): Also allow never versions of mcrypt 1999-11-15 00:27:47 +00:00
Sascha Schumann d019ed533f (php_minit_mhash): Don't use REGISTER_LONG_CONSTANT macro, because we
don't have a fixed size array of chars (this used to work nevertheless).
1999-11-15 00:26:35 +00:00
Sascha Schumann b85f2cba43 (PHP mhash): don't segfault, if mhash_end() returns NULL 1999-11-14 23:11:31 +00:00
Sascha Schumann 13582b4fe2 Check for db1/ndbm.h and use it in db. Fixes #2647 1999-11-14 23:03:45 +00:00
Andi Gutmans 25c56d15cd - Fixing warnings in regex 1999-11-14 20:13:54 +00:00
Thies C. Arntzen 2b08dfec28 (PHP k[r]sort) now use compare_function from libzend to be consistent with the language-core. 1999-11-14 19:59:52 +00:00
Andi Gutmans f3bcc012c6 - Remove ISAPI project from main dir as it's been copied to sapi/isapi 1999-11-14 19:46:31 +00:00
Thies C. Arntzen 6755a85a38 clearify 1999-11-14 19:44:29 +00:00
Thies C. Arntzen 4127b34a0a @- ucfirst()/ucwords() no longer modify arg1. (Thies)
(PHP ucfirst,ucwords) no longer modify arg1
1999-11-14 17:20:56 +00:00
Thies C. Arntzen f2b0c70512 @- Fixed strtr() not to modify arg1. (Thies)
(PHP strtr) no longer modifies arg1.
1999-11-14 15:34:50 +00:00
Danny Heijl 2327b6b954 (ext/informix) Added WIN32 build files for informix driver
and make it compile with ZTS
@ -Added Win32 build files for Informix driver
@  and make it compile with ZTS (danny)
1999-11-14 12:55:36 +00:00
Stig Bakken 5f8f410e51 @Added tmpfile() function (Stig)
Removed the mkstemp stuff and added tmpfile() function instead.
1999-11-14 11:05:37 +00:00
Andi Gutmans 4ebf7b85ad - Fix comment as to Joey's findings 1999-11-14 10:30:39 +00:00
db59169015 ChangeLog update 1999-11-14 02:08:53 +00:00
Andrei Zmievski c898d87aad These are inserted automatically now. 1999-11-13 20:47:33 +00:00
Andrei Zmievski 62eeb9278c It's in array.c now. 1999-11-13 20:32:49 +00:00
Andrei Zmievski 438addf331 Split array functions into separate module. 1999-11-13 20:31:54 +00:00
Sascha Schumann afc9e1257b Suck in prototypes correctly with applied aliases
(otherwise php_reg* would not be prototyped)
1999-11-13 18:33:28 +00:00
Andi Gutmans d35ea24fc0 - Fix crash with string offset assignments. 1999-11-13 18:11:34 +00:00
Andi Gutmans 3c1b362235 - Make Win32 compile again 1999-11-13 18:03:07 +00:00
Sascha Schumann 677bf03f07 Allow --with-apxs and --with-regex=apache 1999-11-13 17:29:43 +00:00
Sascha Schumann bcb2214e99 Improve regex library selection. It lets user specify whether they want
system, apache, or php's regex library by using the --with-regex option.
"php" is the default; if you use --with-apache in combination with
Apache 1.3.x, the default is "apache".
1999-11-13 16:51:33 +00:00
Sascha Schumann c166a6fb83 Remove libtool targets 1999-11-13 16:04:56 +00:00
Sascha Schumann 117ebf3ca6 - remove extra CPPFLAGS from top-level Makefile
- HSREGEX defaults to what the user wants, but can be changed now internally
1999-11-13 13:27:49 +00:00
Sascha Schumann 942c0b3521 Export CPPFLAGS to propagate additional flags 1999-11-13 12:55:47 +00:00
Sascha Schumann 194d75c3a8 Fix typo (escape sign was one off) 1999-11-13 12:51:25 +00:00
Sascha Schumann c810659379 preparing 4.0b3-RC5 1999-11-13 12:48:57 +00:00
Sascha Schumann 3dc7757a99 Remove the extra INCLUDES line from most automake Mafiles. This is not
necessary, because we can change the value of INCLUDES globally in one
place (configure.in).

Also add two defines in thread-safe mode
(_REENTRANT and POSIX_PTHREAD_SEMANTICS)
1999-11-13 12:41:09 +00:00
Sascha Schumann 7dd7f38003 (AC_EXPAND_PATH) Expand relative paths completely 1999-11-13 12:38:23 +00:00
e82ad7e9c3 ChangeLog update 1999-11-13 02:08:56 +00:00
64070d9474 NEWS update 1999-11-13 02:08:53 +00:00
Sascha Schumann ceae3847b8 Enable selective regex library compilation. 1999-11-12 20:56:30 +00:00
Sascha Schumann 6f57224890 upgrade regex library to alpha3.8
@- Upgraded regex library to alpha3.8 (Sascha)
1999-11-12 20:27:52 +00:00
Thies C. Arntzen e20e9786b3 added missing function-alias 1999-11-12 17:05:57 +00:00
Thies C. Arntzen d64e09a322 oops, didn't mean to activate this! 1999-11-12 14:34:50 +00:00
Thies C. Arntzen e61fea3029 @- Fixed selecting nested-tables in OCI8. (Thies)
fixed mested-tables again (broke it when resourcified the driver)
1999-11-12 14:31:01 +00:00
d8d8b30972 ChangeLog update 1999-11-12 02:08:57 +00:00
ea3d47b804 NEWS update 1999-11-12 02:08:54 +00:00
Rasmus Lerdorf 4a22643375 # Add some ext's here 1999-11-11 21:45:59 +00:00
Thies C. Arntzen 639354357f @- RFC-854 fix for internal FTP-Code. Commands have to end in "\r\n" (Thies)
(PHP fopen) commands send to a FTP-server need to end in "\r\n" (RFC 854)
1999-11-11 13:49:42 +00:00
78e6e79a65 ChangeLog update 1999-11-11 02:08:57 +00:00
Frank M. Kromann 3581f0d037 Fixing the use of mssql.textsize in pconnect() 1999-11-10 19:58:07 +00:00
Rasmus Lerdorf 7a4e1a9b0f # Improve the GD lib detection when GD is on the ld_path and it is
# configure using just --with-gd
1999-11-10 19:22:35 +00:00
Rasmus Lerdorf 2de9baf655 This arg is optional 1999-11-10 18:57:19 +00:00
Stig Bakken 6e4114daf0 "import" libtool file preservation code from build.mk 1999-11-10 15:26:39 +00:00
Stig Bakken 044789447c Shut up warning from automake. 1999-11-10 13:12:30 +00:00
Rasmus Lerdorf 392659fabe # Fix comments 1999-11-10 05:50:20 +00:00
Andrei Zmievski f3fb441979 Remove duplicates. 1999-11-10 05:04:56 +00:00
3f1a9fd706 ChangeLog update 1999-11-10 02:08:58 +00:00
ab5c4e2230 NEWS update 1999-11-10 02:08:55 +00:00
Sam Ruby 2cc9f1d377 add Java and MSDev outputs 1999-11-10 00:48:53 +00:00
Frank M. Kromann cc5304a9d9 Adding default mssql ini-setings 1999-11-09 20:58:43 +00:00
Stig Bakken 45c254d89c #if -> #ifdef changes for the ODBC extension (for consistency) 1999-11-09 19:53:38 +00:00
Thies C. Arntzen f6f74737d3 IRIX ld likes this order better 1999-11-09 19:48:56 +00:00
Sascha Schumann 5bb017f6d4 Move only, if the file exists. 1999-11-09 18:18:16 +00:00
Sascha Schumann 16ea76a880 automake overwrites libtool's files, if
- --add-missing was used
- *_LTLIBRARIES targets are used

Thus, we preserve our customized files while automake runs
1999-11-09 18:06:58 +00:00
Sascha Schumann e07220a006 Add libtool helper files 1999-11-09 18:04:17 +00:00
Sam Ruby 5a7943c9ed add mergesort into build 1999-11-09 17:37:35 +00:00
Stig Bakken a5317327c7 - substitute JAVA_LFLAGS (not set, but used in libphp_java_la_LIBADD)
- add .cvsignore file
1999-11-09 17:32:05 +00:00
Stig Bakken ef941dd700 4.0b3-RC4 1999-11-09 17:03:46 +00:00
Stig Bakken 2204607b10 Preserve the CVS versions of ltconfig/ltmain.sh during makedist.
#This is a temporary fix!
1999-11-09 16:57:26 +00:00
Rasmus Lerdorf 5c28619f51 Better lib detection for ucd-snmp 1999-11-09 16:01:31 +00:00
Sam Ruby 751e5d15f9 location of output.c moved. 1999-11-09 16:01:30 +00:00
Rasmus Lerdorf 20c9a79432 Find ucd-snmp include files more intelligently 1999-11-09 15:55:37 +00:00
Stig Bakken fd056d0c01 Clean up ODBC HAVE_XXX symbols, compile fixes for OpenLink and Solid.
#The Solid support still does not link, though (looks like a side-effect of
#the way the Solid libs are named and our stubborn friend libtool).
#This can wait until after 4.0b3.
1999-11-09 14:28:59 +00:00
Sascha Schumann a4ff16dd68 - set default path for cookie to the root directory ("/")
- complete session documentation in php.ini-dist
1999-11-09 14:27:56 +00:00
Sam Ruby eb231bb180 add java 1999-11-09 14:21:18 +00:00
Sascha Schumann 0c2e3e4e7d Include proper header files (replacement functions were not used). 1999-11-09 13:57:11 +00:00
Stig Bakken a14d96ef72 Fix OpenLink ODBC support
@Fix OpenLink ODBC support (Stig)
1999-11-09 13:31:16 +00:00
Stig Bakken 9e1cfb4f6e Bump version to 4.0b3-RC3.
# We release RC2 just minutes before Sam Ruby commits his Java extension.
# What timing!
1999-11-09 12:20:34 +00:00
Sam Ruby d17a12319f @ Added Zend OO syntax overloading support for Java components
#
# My lawyer made me do this:
#
Users of PHP are hereby granted a non-exclusive, irrevocable, world-wide,
royalty-free, non-transferable license to use, execute, prepare derivative
works of, and distribute (internally and externally, and including derivative
works) the code accompanying this license as part of, and integrated into PHP.
WARRANTY OF ANY KIND EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
AND ANY WARRANTY OF NON-INFRINGEMENT.  THE ENTIRE RISK ARISING OUT OF THE USE
OR PERFORMANCE OF THIS CODE REMAINS WITH USERS OF PHP.  The owner of this code
represents and warrants that it is legally entitled to grant the above license.
1999-11-09 12:02:22 +00:00
Stig Bakken 60766eff5a Makedist can now be run from outside the CVS tree. 1999-11-09 11:56:27 +00:00
Stig Bakken fdc6d630db @Fix min/max behaviour (Thies)
#Andrei: I left the convert_to_long() in there, it doesn't really make
#much of a difference.
1999-11-09 07:59:50 +00:00
86418fde5b ChangeLog update 1999-11-09 02:09:01 +00:00
e95fe291d4 NEWS update 1999-11-09 02:08:58 +00:00
Jakub Skopal ce8e31be71 "sybase" is definitelly six characters long :-) 1999-11-08 20:57:59 +00:00
Stig Bakken ecf83739f4 Cleaned up makedist a bit more.
# Also changed 4.0B3-RC2 to 4.0b3-RC2.  I don't see why we should start
# using capital letters in 4.0.
1999-11-08 16:17:53 +00:00
Stig Bakken 9542dbaf54 ignore distribution files 1999-11-08 14:41:57 +00:00
Sascha Schumann 7bc251058a Add libtool files to CVS. Advantages:
- PHP-specific changes are easier to maintain
- it removes one dependency for users (i.e. GNU vs. FreeBSD ports)

I have not removed the libtool check in buildconf, since libzend/TSRM still
depend on a local version of libtool.
1999-11-08 11:04:14 +00:00
Sascha Schumann b87228e491 Remove prototype. The prototype was not necessary for UCD SNMP 3.5.3, and
broke the build for UCD SNMP 4.0.1.
1999-11-08 10:33:06 +00:00
Stig Bakken 63d47b7735 (PHP tempnam) now uses mkstemp() if available
@- tempnam() now uses mkstemp() if available (Stig)
1999-11-08 09:18:57 +00:00
d1ecda53b7 ChangeLog update 1999-11-08 02:09:00 +00:00
Sascha Schumann e5983e9ef5 (php_ns_request_ctor) enable HTTP Access Authentication
(php_ns_hash_environment) supply PATH_TRANSLATED to scripts
1999-11-07 13:16:14 +00:00
880d7666ab ChangeLog update 1999-11-07 02:09:04 +00:00
c2e062c843 NEWS update 1999-11-07 02:09:00 +00:00
Sascha Schumann 14a870e940 - limit find to PHP's automake Makefiles
- check whether patches were applied correctly
1999-11-06 13:05:14 +00:00
Sascha Schumann 9738fdff44 Disable auto_start until we find a way to access the necessary data fields. 1999-11-06 10:14:36 +00:00
Zeev Suraski 512f4519c6 Version update 1999-11-06 10:06:37 +00:00
Zeev Suraski 0700ad3417 - Win32 fixes
- COM module improvements from Boris Wedl
1999-11-06 10:01:55 +00:00
Thies C. Arntzen c6b05b2e6b (PHP var_dump, serialize) now use php.ini's precision size when displying/serializing doubles
@- serialize() and var_dump() now honor the precision as set in php.ini
@  for doubles. (Thies)
1999-11-06 08:16:25 +00:00
b1f13fcc35 ChangeLog update 1999-11-06 02:09:09 +00:00
abac416be7 NEWS update 1999-11-06 02:09:06 +00:00
Rasmus Lerdorf 84f8583426 We need to use mysql_field_count() instead of mysql_num_fields() if
we are using MySQL 3.22.24 or newer when we want to check a mysql struct
instead of a result struct.  The reference is here:
 http://www.mysql.com/Manual_chapter/manual_Clients.html#mysql_num_fields
1999-11-05 21:43:53 +00:00
Sam Ruby d5233c482b configuration failures trap server 1999-11-05 17:52:00 +00:00
Rasmus Lerdorf f8d111d153 # Fix group email address 1999-11-05 15:37:34 +00:00
Thies C. Arntzen ce4f149734 (php3_sybase_get_column_content) initialize buffer before call to dbconvert()
@- Fixed garbage returned at the end of certain Sybase-Columns (Thies)
@  Patch submitted by: neal@wanlink.com
1999-11-05 08:48:09 +00:00
1890a59cd6 ChangeLog update 1999-11-05 02:09:27 +00:00
Andrei Zmievski 602cb959fc (PHP multisort) More work, not yet done though. 1999-11-04 21:55:47 +00:00
Andrei Zmievski 3964c92f8b Made zend_hash_rehash() callable from outside. 1999-11-04 21:02:35 +00:00
Rasmus Lerdorf 0d5a9358f0 Try to avoid IBM/Berkeley DB2 confusion 1999-11-04 20:47:19 +00:00
Stig Bakken aa3123e87b # Updated to work with the new build system. 1999-11-04 09:52:44 +00:00
Stig Bakken f2099fccfb # First shot at 4.0b3. 1999-11-04 09:40:44 +00:00
Stig Bakken a4c8d7dddc # Workaround needed to run automake in makedist. 1999-11-04 09:34:35 +00:00
Andi Gutmans 170db8b580 - Add include path. Used relative include path assuming php4 and bindlib_w32
are in the same directory.
1999-11-04 04:48:32 +00:00
35e82edf47 ChangeLog update 1999-11-04 02:09:55 +00:00
Andrei Zmievski 2fb2c11c09 *** empty log message *** 1999-11-03 20:48:42 +00:00
Frank M. Kromann 1746a30108 Added MS SQL server module 1999-11-03 20:41:24 +00:00
Frank M. Kromann d400f52ca4 Changed directory names to match project 1999-11-03 20:37:51 +00:00
Frank M. Kromann e5ca107a3d Adding MS SQL Server module for Win32 1999-11-03 20:35:58 +00:00
Andi Gutmans a79bdcc28f #- Added support for forcing a variable number of internal function arguments
#    by reference.
#-  This is done by using BYREF_FORCE_REST as the last arg_types value.
1999-11-03 20:15:50 +00:00
Andi Gutmans 6d988ec694 - Add support for BYREF_FORCE_REST 1999-11-03 19:21:56 +00:00
Evan Klinger b1c4f8978d #I hope this is the correct way to 'fix' this.
Fix compile warning
1999-11-03 02:53:52 +00:00
af07e331ac ChangeLog update 1999-11-03 02:09:28 +00:00
1e0bc24992 NEWS update 1999-11-03 02:09:21 +00:00
Sascha Schumann 358af8b9eb Add <FORM ACTION=...> tag 1999-11-02 18:35:59 +00:00
Sascha Schumann 11287bba4d Additional check for concurrent use of --with-{apache,apxs} 1999-11-02 18:27:38 +00:00
Andrei Zmievski f31c9d7d2a Remove extraneous comment.
# Pay no attention to multisort() at the moment.
1999-11-02 14:39:12 +00:00
Evan Klinger 229a26a497 (PHP getprotoby{name,number}) New Functions
@- Implemented getprotoby{name,number} (Evan)
1999-11-02 03:47:09 +00:00
3ab5606732 ChangeLog update 1999-11-02 02:09:28 +00:00
81c24791e1 NEWS update 1999-11-02 02:09:23 +00:00
Andrei Zmievski 1fe76945f7 *** empty log message *** 1999-11-01 20:58:50 +00:00
Andrei Zmievski 92f6a8b20e Added array_pad() function.
# Ignore multisort() for now.
@- Added array_pad() function. (Andrei)
1999-11-01 20:51:04 +00:00
Chuck Hagenbuch fa09e56a43 Trying to clean up the last of the body->id/body->description confusion. 1999-11-01 16:44:36 +00:00
Andrei Zmievski 1fd576485f Added new session configuration directives.
# Sascha, please document them here.
1999-11-01 16:13:41 +00:00
Sascha Schumann fb52cb2d30 Fix for #2631 1999-11-01 11:48:31 +00:00
27b22a7ee3 ChangeLog update 1999-11-01 02:09:20 +00:00
ce63a5b611 NEWS update 1999-11-01 02:09:11 +00:00
Evan Klinger f7440c020d (PHP getservby{name,port}) New functions.
@- Added new getservby{name,port} functions. (Evan)
1999-11-01 01:07:51 +00:00
Sascha Schumann 093aaaa23e Add missing initialization entry 1999-10-31 13:29:00 +00:00
Sascha Schumann 82798e99c8 Support current mcrypt. Tested with libmcrypt-2.2.4 1999-10-31 13:27:35 +00:00
Sascha Schumann 6a30ec5343 Change session.lifetime to session.cookie_lifetime. And:
@ - Added session.cookie_path and session.cookie_domain (Sascha)
1999-10-31 13:26:40 +00:00
Sam Ruby 242631c4bb @Continue processing PHP_INI_SYSTEM knownDirectives after extension=
#
# Never saw a response to PHP-DEV post of 25-OCT
#
# Given the existence of knownDirectives, I figured that option 2
# was closest to the original design intent.
1999-10-31 11:56:22 +00:00
91f068e4c5 ChangeLog update 1999-10-31 01:09:17 +00:00
Rasmus Lerdorf 5a391e843a typing in the dark 1999-10-30 14:26:42 +00:00
Rasmus Lerdorf 3bfc215091 Damn, can't see underscores correctly on this silly terminal I am on 1999-10-30 14:24:36 +00:00
Rasmus Lerdorf cf0868fec8 Clean up regex header file mess. php.h now explicitly includes php_regex.h
and php_regex.h figures out which regex header files to include and
defines symbols that prevents other stuff from including the wrong versions
of regex header files.
1999-10-30 14:22:10 +00:00
bbb1a4f8eb ChangeLog update 1999-10-30 01:09:07 +00:00
Rasmus Lerdorf 5175c71cc0 Fix typo found by hholzgra@media-engineering.de 1999-10-29 21:00:43 +00:00
Rasmus Lerdorf f160ee8782 Kill the regex header file warnings 1999-10-29 17:33:19 +00:00
Rasmus Lerdorf a3a7413be8 Looked like this was done by RedHat the way I wrote it. 1999-10-29 17:08:46 +00:00
88ca873f3a ChangeLog update 1999-10-29 01:09:23 +00:00
5d291c8ea5 NEWS update 1999-10-29 01:09:20 +00:00
Rasmus Lerdorf 990d5d72ea (IBM DB2 Support) Fix stuff to allow IBM DB2 to work with PHP 4.
Tested against DB2 6.1 UDB on Linux (RH-6.0)
@- Enable IBM DB2 support - Tested against DB2 6.1 UDB on Linux (RH-6.0)
1999-10-28 20:33:43 +00:00
Sascha Schumann 9704cd4873 Remove set-if-not-set colon, since CPPFLAGS is never set by automake. 1999-10-28 17:33:36 +00:00
Andrei Zmievski e921d0feab Fix bug #2623. 1999-10-28 16:41:17 +00:00
Andi Gutmans 83c79bb154 - Fix for Thies' leak and Andrei's crash 1999-10-28 15:53:31 +00:00
Andrei Zmievski 10fa640f5c New function. 1999-10-28 01:40:14 +00:00
8fd99b071d ChangeLog update 1999-10-28 01:09:21 +00:00
e8bccbdca9 NEWS update 1999-10-28 01:09:18 +00:00
Sam Ruby 329de3041b look for output.c in its new location in the windows build 1999-10-28 00:18:51 +00:00
Andrei Zmievski b8ecfa18c1 (PHP str_repeat) New function. 1999-10-27 22:06:05 +00:00
Thies C. Arntzen ea880d2b86 moved output.c into ext/standart and made it thread-safe.
moved output-buffering related functions from basic_functions to output.c
Win32 project need to be updated to reflect new position.
# i'm not really happy with this solution, but it seemed the easiest one!
# the whole output code is a bit hard to understand...
@- Output-Buffering system is now Thread-Safe. (Thies)
1999-10-27 18:30:41 +00:00
Thies C. Arntzen c171eecd7a @- implemented OCI8 $lob->WriteToFile() function - very useful for streaming
@  large amounts of LOB-Data without to need of a huge buffer. (Thies)
1999-10-27 17:51:22 +00:00
Andrei Zmievski 1a2f656816 Forgot to remove function entry. 1999-10-27 02:19:53 +00:00
c885fc1f53 ChangeLog update 1999-10-27 01:09:20 +00:00
Thies C. Arntzen 6b69ebf2b8 eliminated warinigs 1999-10-26 20:09:59 +00:00
Andrei Zmievski 138d5e0f79 No tabs please. 1999-10-26 19:57:27 +00:00
Andrei Zmievski 21ce8b7c64 (PHP array_map) Away with it. 1999-10-26 19:57:10 +00:00
Andrei Zmievski 377ed94b2f Some todo things. 1999-10-26 19:49:36 +00:00
ad922a272d ChangeLog update 1999-10-26 01:09:27 +00:00
Zeev Suraski 7f35cfda71 *** empty log message *** 1999-10-25 16:07:14 +00:00
Thies C. Arntzen 5d70df50ba added some more options 1999-10-25 08:23:54 +00:00
d5b0e6d820 ChangeLog update 1999-10-25 01:09:29 +00:00
Thies C. Arntzen 31b1a8fc7f kill warning 1999-10-24 18:16:16 +00:00
Thies C. Arntzen 6581d11cea folding fix (xemacs 21 loads the file again;-) 1999-10-24 18:15:42 +00:00
Sascha Schumann 387f15d895 Define USE_BCOPY, if memmove is not found (i.e. SunOS 4). Fix for #2480 1999-10-24 16:41:07 +00:00
Sam Ruby a29baa30c8 Allow CYGWIN directory to be specified as via environment variable 1999-10-24 16:32:46 +00:00
Sascha Schumann 51ea5cc70a (PHP session_register, session_unregister) always return true 1999-10-24 16:17:45 +00:00
7305cb156c ChangeLog update 1999-10-24 01:09:36 +00:00
Sam Ruby 6576719dcb Allow CYGWIN directory to be specified as via environment variable 1999-10-23 19:27:24 +00:00
Thies C. Arntzen a9dcde33e2 one can now use callbacks for custom completion functions (still work-in-progress) 1999-10-23 17:36:45 +00:00
dfbf2ea001 ChangeLog update 1999-10-23 01:09:32 +00:00
Andi Gutmans 9b83d1ca5d - Fix isset() with string offsets. 1999-10-22 22:35:16 +00:00
Sascha Schumann 23882d31c4 Add session.use_cookies option 1999-10-22 08:10:08 +00:00
Thies C. Arntzen 3e307aacc4 unserialize no longer complaints about unserializing empty-strings (started that just a few days ago) 1999-10-22 06:59:05 +00:00
280f379186 ChangeLog update 1999-10-22 01:09:30 +00:00
Sascha Schumann e9fc8bb300 Add <AREA HREF=... 1999-10-21 20:22:12 +00:00
Sascha Schumann 31f38edf35 (_ps_files_valid_key): small logic fix 1999-10-21 18:51:57 +00:00
Uwe Steinmann 01400c0c15 Added hw_mapid(), read comment in hg_comm.c 1999-10-21 15:15:27 +00:00
Sascha Schumann 4703eb404d (_ps_files_open): evaluate key (session id) before path creation 1999-10-21 12:28:36 +00:00
230556b646 ChangeLog update 1999-10-21 01:09:59 +00:00
1747a5e505 NEWS update 1999-10-21 01:09:52 +00:00
Sascha Schumann d5bde1d658 (php_ns_hash_environment): provide more CGI/1.1 variables to scripts.
Added REQUEST_METHOD, QUERY_STRING, REMOTE_ADDR
1999-10-20 19:30:37 +00:00
Andi Gutmans 8a3e0ced12 - Make COM compile again 1999-10-20 19:16:17 +00:00
Andi Gutmans 5212b2fe5b - Make CVS compile on Win32.
- Rename php3_COM.h -> php_COM.h
1999-10-20 18:09:44 +00:00
Thies C. Arntzen 33ebd52387 (PHP getcwd()) added, needs to porting to Win32
@- added getcwd() function. (Thies)
# as we do have chdir() now we have getcwd() - i think we *should* restore the
# working directory in RSHUTDOWN!
1999-10-20 16:17:30 +00:00
Sascha Schumann df6d06def4 (_display_module_info): Add anchor for module names 1999-10-20 16:16:58 +00:00
Sascha Schumann 90087382e4 (php_info_aolserver): add more information from the server context 1999-10-20 15:53:23 +00:00
Thies C. Arntzen 604c14ab00 (PHP xml_parse_into_struct) sometimes the value was truncated
@- XML_Parse_Into_Struct no longer eats data. (Thies)
1999-10-20 14:58:03 +00:00
Thies C. Arntzen 41b87a238e (PHP var_dump, serialize) fixed mem_leak. 1999-10-20 14:34:16 +00:00
Andrei Zmievski af8f84a27c Ignore shared modules directory. 1999-10-20 14:23:19 +00:00
Andrei Zmievski 1dd908b102 Ignore generated libs. 1999-10-20 14:11:59 +00:00
Thies C. Arntzen c799969a81 (PHP xml_parse_into_struct): fixed mem-leak when encountering invalid XML. 1999-10-20 14:02:32 +00:00
Sascha Schumann b31ef32c1d (php_ns_hash_environment) add SERVER_SOFTWARE, SERVER_BOOTTIME, SERVER_BUILDDATE, SERVER_PROTOCOL 1999-10-20 13:49:19 +00:00
c4d21e7632 ChangeLog update 1999-10-20 01:09:25 +00:00
1e2bf3960b NEWS update 1999-10-20 01:09:19 +00:00
Andrei Zmievski 26c019eaa1 Revert my patches to error functions. 1999-10-19 19:11:02 +00:00
Thies C. Arntzen 65b152948e added === operator support (type *and* value match) . samples:
(1 == "1") is true
(1 === "1") is false (integer != string)
(0 == false) is true
(0 === false) is false (integer != boolean)
1999-10-19 16:00:57 +00:00
Thies C. Arntzen 816627b16c fixed is_identicat_function() 1999-10-19 15:48:25 +00:00
Andrei Zmievski ee6c1ea743 (PHP extract): Fixed bug that would mess up global and referenced
variables in certain cases.
1999-10-19 14:43:48 +00:00
Andrei Zmievski f3127955ba (PHP ldap_get_entries): Fix string function name. 1999-10-19 14:42:54 +00:00
Andi Gutmans 98f025430e - Move IS_IDENTICAL next to IS_EQUAL 1999-10-19 14:19:42 +00:00
Andi Gutmans 70b41809f2 - Fix is_identical function 1999-10-19 14:11:39 +00:00
Uwe Steinmann 24d2325ecb - some tiny changes to possible improve link extraction/insertion of HTML-docs 1999-10-19 13:54:45 +00:00
Andi Gutmans 7a205f6087 - Preliminary submit of Thie's patch. Will fix the rest on Windows
as this was added on UNIX with patch. Changed IS_SAME -> IS_IDENTICAL
1999-10-19 13:33:17 +00:00
Thies C. Arntzen 578c6035c8 (parse_url) fix for #2569: parse_url('-') crashes
@- Fixed parse_url('-') crash. (Thies)
1999-10-19 11:02:05 +00:00
b69656177b ChangeLog update 1999-10-19 01:09:32 +00:00
a3f5afb1c0 NEWS update 1999-10-19 01:09:26 +00:00
Egon Schmid 4fe14a780c More forgotten prototypes. 1999-10-18 20:00:42 +00:00
Stefan Roehrich 20a7232d95 Added zlib module to list of maintained extensions. (Stefan). 1999-10-18 19:27:56 +00:00
Thies C. Arntzen 4f013f8e2d @- unserialize() now gives a notice when passed invalid data. (Thies) 1999-10-18 17:46:33 +00:00
Thies C. Arntzen cf1134787a (PHP unserialize) - fixed mem-leak. 1999-10-18 15:03:29 +00:00
Andrei Zmievski 52a30fd21b Be safe, use (). 1999-10-18 14:17:36 +00:00
670654ea87 ChangeLog update 1999-10-18 13:42:43 +00:00
1d66fd7a94 NEWS update 1999-10-18 13:42:35 +00:00
Sascha Schumann 51b1d2af6a Add PNG support. Tested with gd 1.7.3. 1999-10-17 14:57:49 +00:00
Egon Schmid 515206ec4e Looks better, but isn't wrong 1999-10-17 08:07:50 +00:00
Egon Schmid 6025dd0bda One typo corrected. 1999-10-17 07:38:35 +00:00
Andrei Zmievski d8868ab205 Fix bug #2548. 1999-10-17 00:20:17 +00:00
Andrei Zmievski 9e0017536d _php3/_php3i -> php rename 1999-10-16 16:35:20 +00:00
Andi Gutmans 133c95cf8c - It's OK if we link dynamically. 1999-10-16 11:57:52 +00:00
Andi Gutmans ad84f02efb - Get windows version to compile again. No biggy if array_map is not #if 0'd
out even if it doesn't work.
1999-10-16 10:14:47 +00:00
Andrei Zmievski e74d81f2ed *** empty log message *** 1999-10-15 22:04:59 +00:00
Andrei Zmievski 0a829ab104 (PHP array_map) Temporarily #if 0 this. 1999-10-15 21:24:15 +00:00
Andrei Zmievski db69449d9f Update mergesort() proto. 1999-10-15 21:23:37 +00:00
Andrei Zmievski c279668168 unstatic'fy is_numeric_string() 1999-10-15 20:42:26 +00:00
Andrei Zmievski e956a266e2 *** empty log message *** 1999-10-15 20:37:53 +00:00
Andrei Zmievski ce1f3a7d83 Make string copying a little more efficient. 1999-10-15 20:36:10 +00:00
Andrei Zmievski e906d4548a Small tweak in the error format. 1999-10-15 20:32:47 +00:00
Andrei Zmievski b625bbd14a (php3_log_err): Don't output error message to stderr when
running as CGI binary.
1999-10-15 20:27:38 +00:00
Andrei Zmievski 22fb5f281a Renamed a couple of functions to have proper php_ prefix. 1999-10-15 20:04:31 +00:00
Andrei Zmievski 3ee9dbea0c (php_error): finally get rid of those annoying html tags
when running as CGI binary
1999-10-15 19:55:18 +00:00
Andrei Zmievski c671332b29 Massive change of zend_error() to php_error(). 1999-10-15 19:37:44 +00:00
Andrei Zmievski 738c36932a @- Fixed shuffle() so that it no longer breaks on Solaris. (Andrei) 1999-10-15 19:25:27 +00:00
Andrei Zmievski c5149f12b6 Add mergesort.c to compilation list. 1999-10-15 19:25:04 +00:00
Andrei Zmievski 86e031d9e8 Added mergesort.c from FreeBSD. 1999-10-15 19:23:04 +00:00
Thies C. Arntzen ac997bb6c2 (is_resource, is_bool) new functions
@- Added is_resource(), is_bool() functions. (Thies)
1999-10-15 18:15:02 +00:00
Andrei Zmievski d3a39771c1 (_php_replace_in_subject)
(PHP preg_replace):
Fixed a bug that happened when regex was an array and replacement was a
single non-string value. Also changed conversions to use
convert_to_string_ex().

(PHP preg_grep): use convert_to_string_ex() for proper conversion
1999-10-15 16:57:54 +00:00
Thies C. Arntzen b5c3c7bfc9 files are now resources, file.c is thread-safe, the le_ vars are no longer shared,
but they are accessible thru "php_file_le_socket(), php_file_le_uploads()..."
i also updated the ftp, pdf and file-upload stuff to match the new requirements.
@- Cleaned up File-Module (Thies)
1999-10-15 15:22:25 +00:00
Andrei Zmievski d69d118cbd (PHP implode): Properly separate zval for another case. 1999-10-15 14:53:56 +00:00
Zeev Suraski 231fe2e1aa That should do the trick - fix implode() not to modify its arguments 1999-10-15 14:45:54 +00:00
Andrei Zmievski 62c1407a4d *** empty log message *** 1999-10-15 13:45:28 +00:00
Zeev Suraski 9295bd2577 Make ODBC work under Win32 1999-10-15 12:28:20 +00:00
Andi Gutmans 4a8cac0878 - Converted math.c to use new convert_to_number_ex() macro. 1999-10-15 06:31:40 +00:00
Andi Gutmans 4d7c162d16 - Add convert_to_number_ex() 1999-10-15 06:25:42 +00:00
Sascha Schumann e77485a8f7 Add "--disable-inline" for low-memory machines (be it limited
RAM or virtual memory). It's also useful for Digital C where
the C++ compiler thinks "inline" is an invalid specifier.
1999-10-14 22:17:22 +00:00
Sascha Schumann d58e6f2b00 Use sources from $(srcdir) 1999-10-14 17:20:25 +00:00
Thies C. Arntzen 185d90fe22 configure works for me (RH 6.1)
@- Added readline support. Works *only* in standalone mode! (Thies)
1999-10-14 16:53:51 +00:00
Thies C. Arntzen ead9008644 forgot 1999-10-14 15:20:56 +00:00
Thies C. Arntzen 1d9584c087 interface to GNU-Readline! (not yet active, autoconf needs to be done)
very neat - but only usable in standalone (command-promt) mode!
1999-10-14 15:20:40 +00:00
Sascha Schumann a4e9a5ca8f Add dba and mcrypt extensions to list. 1999-10-13 21:01:37 +00:00
Thies C. Arntzen e2d66a6d28 new api fo dl() - renamed php3_dl to php_dl (added compat header) 1999-10-13 19:55:25 +00:00
Thies C. Arntzen f5fa29184c (PHP: htmlspecialchars, htmlentities): new zend-api for html-function (not worth mentioning in NEWS) 1999-10-13 19:51:11 +00:00
Thies C. Arntzen 8bafcd3aa7 @- Upgraded math-funtions to use new Zend function API (Thies) 1999-10-13 19:43:36 +00:00
Andrei Zmievski dea3d7527a Add mhash module. 1999-10-13 18:03:38 +00:00
Sascha Schumann 2170fa6dea Do not use $< for anything but implicit rules. 1999-10-13 16:16:09 +00:00
Thies C. Arntzen e6ffafa264 (shell_exec) use pclose for FILE* that has been opened via popen!
@- Fixed zombie problem in shell_exec() and $a = `some_command`
@  constructs. (Thies)
1999-10-13 14:01:47 +00:00
Thies C. Arntzen 6e07d060fc (zend_fetch_resource) added warinig if resource is of wrong type 1999-10-13 12:59:48 +00:00
489a49d2fe ChangeLog update 1999-10-13 01:07:57 +00:00
8819b58a65 NEWS update 1999-10-13 01:07:54 +00:00
Sascha Schumann 8cc4fc6111 Disable ZEND_EXTENSIONS_SUPPORT, if RTLD_NOW is not defined.
Note that this part could be made platform independent by using
libltdl (for Solaris, Linux, *BSD, HP-UX, Win16/32, BeOS).
1999-10-13 00:17:01 +00:00
Thies C. Arntzen 0cc1641447 starting to clean-up/new API'ize and resourcify the file-stuff - nothing happened yet - just renaming things around. 1999-10-12 18:50:05 +00:00
Danny Heijl 4fe8a2c1bd (Informix driver) Thies introduced ZEND_FETCH_RESOURCE2 (Danny).
@- Thies introduced ZEND_FETCH_RESOURCE2 (Danny).
1999-10-12 17:38:19 +00:00
Thies C. Arntzen 4a39d66973 made nice 1999-10-12 15:32:40 +00:00
Thies C. Arntzen 837596dc21 add myself 1999-10-12 15:30:38 +00:00
Thies C. Arntzen a02ac0c1fc (wddx_add_vars) adjusted to new resource-API 1999-10-12 15:23:59 +00:00
Thies C. Arntzen 7dfbf440ef (php sybase_close) fixed obvious bug. 1999-10-12 15:00:10 +00:00
Thies C. Arntzen 86bb3fa0c0 new improved resource-API (i hope everything still compiles) 1999-10-12 14:53:15 +00:00
Thies C. Arntzen 6d7c18c1f5 new improved resource-API 1999-10-12 14:51:17 +00:00
Sascha Schumann fc48083437 Use DL_LAZY for OpenBSD. This seems to be a compatibility flag which
should be used for the 2nd parameter to dlopen.

http://www.openbsd.org/cgi-bin/cvsweb/src/share/man/man3/dlfcn.3?rev=1.8
1999-10-12 14:48:32 +00:00
Andrei Zmievski d6feb3c1d2 Just some formatting. 1999-10-12 13:22:30 +00:00
Andi Gutmans faa1891782 - object.ptr was made NULL in DO_FCALL but wasn't restored. Right now I
push it in DO_FCALL and at the end of do_fcall_common it always gets
  popped. We might be able to optimize it out.
1999-10-12 11:41:17 +00:00
Danny Heijl 290db7ace3 Added Informix driver to list of maintained extensions. (Danny).
@- Added Informix driver to list of maintained extensions. (Danny).
1999-10-12 06:49:34 +00:00
ff4a3a6a94 *** empty log message *** 1999-10-12 04:14:04 +00:00
79977b7fcf ChangeLog update 1999-10-12 01:08:06 +00:00
d070e7e557 NEWS update 1999-10-12 01:08:03 +00:00
Andrei Zmievski 9e773dfde2 Modified sorting functions to use updated zend_hash() prototype. 1999-10-11 21:42:42 +00:00
Andrei Zmievski 531bc520c1 *** empty log message *** 1999-10-11 21:38:18 +00:00
Andrei Zmievski 8864313c48 Modified zend_hash() to accept a pointer to sort function. 1999-10-11 21:30:23 +00:00
Andrei Zmievski 4d52ee2bc6 Added notice about LXR and Bonsai. 1999-10-11 20:45:03 +00:00
Andi Gutmans 81aa9a36b6 - No idea why this bug didn't exist before. But I'm too tired to think of it.
During a regular do_fcall we need to set object.ptr to NULL and, thus,
  push it in the beginning and pop it in the end.
  I hope this fix more or less cuts it. I just want to sleep :)
1999-10-11 20:29:55 +00:00
Andrei Zmievski cab346f50c First revision. 1999-10-11 19:36:13 +00:00
Danny Heijl e1b77165c9 *** empty log message *** 1999-10-11 16:54:41 +00:00
Danny Heijl c72b97bf5b (ext/informix) Changed ifx.ec to use the new high-performance
ZEND API now that it compiles with libtool. (Danny)
@- Informix driver : Changed ifx.ec to use the new high-performance
@  ZEND API. (Danny)
1999-10-11 15:56:01 +00:00
Danny Heijl f2939ffadd (configure) Allow IFX_LIBDIR environment variable to specify the
Informix library path to allow linking with the static
            libraries (libtool related). (Danny).
@- IXF_LIBDIR environment variable specifies alternate Informix library
   path for configure (Danny).
1999-10-11 11:53:09 +00:00
4f4e2bd506 ChangeLog update 1999-10-11 01:08:08 +00:00
Andi Gutmans 3a88d5a68e - Didn't lower refcount when doing an internal function call linked to a regular object. 1999-10-10 18:31:42 +00:00
Thies C. Arntzen 283dd53bf5 added some more autoconf/libtool stuff to be ignored 1999-10-10 18:12:41 +00:00
Sascha Schumann c42142bc03 automake scans aclocal.m4 as well 1999-10-10 18:08:31 +00:00
Thies C. Arntzen f961f0e976 (build.mk) fix suggested by sascha. 1999-10-10 17:34:13 +00:00
Thies C. Arntzen 93f294b76f (build.mk) make cvsclean now also deletes the libzend & TSRM symlinks. 1999-10-10 17:24:26 +00:00
Sascha Schumann ee06ab4069 Add stub.c for helper library. 1999-10-10 17:15:19 +00:00
Thies C. Arntzen 8a23f7e215 (build.mk) added target cvsclean: removed all files listed in all .cvsignore files found in the current tree. 1999-10-10 17:14:29 +00:00
Sascha Schumann 7573b236ea Workaround for Informix set of libraries. One library depends on
another "library" (an object file). We build a standard library
out of this object here, so that we can link it in at the right place
later.
1999-10-10 17:12:23 +00:00
Zeev Suraski 40cc9d9d7a This should fix the deadlock 1999-10-10 13:30:03 +00:00
Sascha Schumann 00bcd72637 Remove -DPIC preprocessor macros. This is defined by libtool
automatically, if a shared library is built. This would lead
to multiple definitions of get_module(). If you want to build
modules, add -DCOMPILE_DL to your CFLAGS.
1999-10-10 12:41:56 +00:00
Sascha Schumann 594f61521b Link in IFX_LIBS properly. 1999-10-10 12:10:41 +00:00
Andi Gutmans 274ce69429 - Clean up a bit. Separate before the locking so that we can use SEPARATE_ZVAL
macro.
1999-10-10 04:38:51 +00:00
Sascha Schumann ea567a73f1 Add clean target which removes standard targets 1999-10-10 02:02:13 +00:00
Sascha Schumann f2608c3fdb build.mk can be used to generate build tools. It is usually
faster than buildconf, since it rebuilds only components, if
it is necessary. To use it, run

    $ make -f build.mk
1999-10-10 01:23:15 +00:00
f331865e3b ChangeLog update 1999-10-10 01:08:21 +00:00
Sascha Schumann c2d127b3ed Clean up and add 'clean' target which removes standard targets recursively 1999-10-10 01:04:39 +00:00
Sascha Schumann aab49be24a build.mk can be used to generate build tools. It is usually
faster than buildconf, since it rebuilds only components, if
it is necessary. To use it, run

    $ make -f build.mk
1999-10-10 00:22:05 +00:00
Andi Gutmans ec04c922aa - Shouldn't be needed 1999-10-09 20:37:08 +00:00
Andi Gutmans 37159e7863 - God damn this sucked. I hopefully fixed the problems with classes although
we might need to clean stuff up a bit.
1999-10-09 20:29:36 +00:00
Sascha Schumann 1df149ec1a Define RTLD_NOW to DL_NOW, if RTLD_NOW is not defined (for OpenBSD). 1999-10-09 18:03:23 +00:00
Sascha Schumann 4c920d1da6 Remove redundant library declaration. All libtool libraries
are referenced through DEPENDENCIES now.
1999-10-09 16:50:14 +00:00
Sascha Schumann 92a10866a9 Only link with bundled regex, if the user wants it. 1999-10-09 16:45:12 +00:00
Sascha Schumann 8090041fbb POSIX_MISTAKE is enabled by default. 1999-10-09 16:44:39 +00:00
Thies C. Arntzen a19f5933d5 fix suggested by sascha for xml-build in apxs mode 1999-10-09 13:43:27 +00:00
afdb73e62f ChangeLog update 1999-10-09 05:41:53 +00:00
200052b51c NEWS update 1999-10-09 05:41:39 +00:00
Andreas Karajannis 05ed227dde Forgot to remove workaround for SQLANY_BUG which is no longer needed 1999-10-08 19:43:27 +00:00
Andreas Karajannis 2051682665 Moved Environment handle to connection struct for thread safety 1999-10-08 19:35:50 +00:00
Andrei Zmievski 405934a483 Mention php-cvs-daily list. 1999-10-08 18:05:59 +00:00
Sascha Schumann 965c9c2187 Use correct data type for mutex. 1999-10-08 16:29:33 +00:00
Sascha Schumann 9c995e93d7 Implement temporary workaround for thread-safety issues. This
serializes all request accesses. To disable, define NO_GLOBAL_LOCK
1999-10-08 16:24:31 +00:00
Andrei Zmievski 3f6108b646 More emphasis on ChangeLog and NEWS daily updates. 1999-10-08 16:09:52 +00:00
442628d935 mailing list test 1999-10-08 16:00:10 +00:00
9e870afa39 testing 1999-10-08 15:29:13 +00:00
0bbe641a91 test 1999-10-08 15:23:58 +00:00
Andrei Zmievski 85575e9a2c More information on how to use the special prefixes and the frequency
of NEWS and ChangeLog updates.
1999-10-08 13:59:27 +00:00
Sascha Schumann 3909ab4195 (php_info_aolserver): Show information about the SAPI module
(php_ns_module_main): Return early, if request startup failed
1999-10-08 13:06:28 +00:00
Jouni Ahto cfd2a241da Added the files for t1lib support. No porting from PHP3 done yet. 1999-10-08 07:56:43 +00:00
d6fd672624 ChangeLog update 1999-10-08 03:51:25 +00:00
Jouni Ahto 379889339f (PHP gmmktime) Should now give right values. Note that there was never need for
the acrobacy adjusting the time for GMT. mktime() fills
	       tm_gmtoff with just the right offset to add.
@- Fixed gmmktime() so that the following should always be true:
   gmmktime([args]) == mktime([args]) + date('Z', mktime([args])) (Jouni)
# Heh, conforming to the rules anyway...
1999-10-08 03:08:44 +00:00
Jouni Ahto 9109d8dcdd (PHP setlocale) Locale settings are now correctly restored to the values
set in environment at request shutdown.
@- setlocale doesn't anymore screw up things if you forgot to change it back
   to the original settings. (Jouni)
# Trying to conform to the rules set up by Andrei. Let's hope this works.
1999-10-08 02:10:57 +00:00
Sascha Schumann 5a6fe43d58 Apparently, we did too much cleanup. The server survives now much longer. 1999-10-07 21:47:39 +00:00
Andrei Zmievski 02795f9961 NEWS update 1999-10-07 21:41:37 +00:00
Andrei Zmievski 3652bc01ab New files.
Please read README.CVS-RULES!
1999-10-07 21:38:22 +00:00
Sascha Schumann 02553b5e7c POST works now and does not block anymore. 1999-10-07 21:23:55 +00:00
Sascha Schumann 3f1c010615 Remove SAPI_TARGET and use PHP_SAPI completely.
The target filename is now available as SAPI_PROGRAM, SAPI_SHARED, and
SAPI_STATIC.
1999-10-07 21:04:26 +00:00
Sascha Schumann 93b12f5fbd (ns_globals_struct): remove content_type member
(php_ns_request_dtor): remove content_type destructor, re-add path_translated destructor
1999-10-07 20:21:55 +00:00
Sascha Schumann 483a4642f0 Add comments to the source code and fix POST-read-data bug. 1999-10-07 20:15:26 +00:00
Andrei Zmievski cfec25f3b2 Some ChangeLog surgery. 1999-10-07 19:53:33 +00:00
Sascha Schumann 36ff78d232 Add help to get people started. 1999-10-07 19:53:20 +00:00
Andreas Karajannis 6cd07c5165 Made henv a real global var. Seems to work basically when multithreaded 1999-10-07 18:49:41 +00:00
Sascha Schumann 2a6d170dc0 nsapi => aolserver changes 1999-10-07 18:46:40 +00:00
Sascha Schumann 743b3851b1 nsapi => aolserver
"NSAPI" suggests Netscape too often.
1999-10-07 18:45:30 +00:00
Andrei Zmievski 017aff4f6d Renaming ChangeLog to NEWS. All future entries intended for public should
go into NEWS.
1999-10-07 16:56:42 +00:00
Sascha Schumann 9b654728ef PHP_SHOW_LD_LIBRARY_PATH leaked out of my test environment. 1999-10-07 16:47:53 +00:00
Uwe Steinmann 60b2d65b2b - new functions pdf_get_font, pdf_get_fontsize, pdf_get_fontname 1999-10-07 16:00:48 +00:00
Andrei Zmievski ca6cf936b8 Test commit again.
# add white space
1999-10-07 14:32:07 +00:00
Andrei Zmievski 91dffe9126 Testing commit.
@ Removed white space.
1999-10-07 14:24:18 +00:00
Andrei Zmievski 3562eb2999 Ignore generated files. 1999-10-07 14:05:08 +00:00
Andrei Zmievski ac4a798570 Put PLS_FETCH() in the correct place. 1999-10-07 14:00:18 +00:00
Andrei Zmievski 718351f882 Ignore generated files. 1999-10-07 13:53:35 +00:00
Andrei Zmievski 0d89395481 Fix for #2457. 1999-10-07 13:23:33 +00:00
Thies C. Arntzen 2148fe61a0 fix ZTS compile 1999-10-07 12:49:25 +00:00
Thies C. Arntzen b311342faf fixed hopefully last XML problem. that one was hard! 1999-10-07 12:27:40 +00:00
Thies C. Arntzen f352444541 added zval_del_ref() function 1999-10-07 12:20:40 +00:00
Sascha Schumann d480d23e97 (php_ns_request_handler): call ts_free_thread() to clean up 1999-10-07 12:00:32 +00:00
Thies C. Arntzen b6a90547f6 compiles again - and gets compiled 1999-10-07 10:56:04 +00:00
Sascha Schumann 712105cd5d Pass -avoid-version when building a shared library to avoid problems
with "installing" symbolic links. We need to do this conditional, since
    some libtool versions imply --disable-static with this option.
1999-10-07 10:03:24 +00:00
Thies C. Arntzen 601b837c56 SET_VAR_STR* expect a emalloc'ed copy of the string! 1999-10-07 09:13:39 +00:00
Andi Gutmans 5fed1466ef - Reverse my patch 1999-10-07 04:38:03 +00:00
Sascha Schumann 966b87e814 Enable hardcoding runpaths for more platforms and allow Solaris' patch to run
buildconf.
1999-10-06 23:26:36 +00:00
Sascha Schumann 1606365a12 Ignore already applied patches.
If somebody could make this work on Solaris, I'd appreciate it.
1999-10-06 19:34:36 +00:00
Sascha Schumann b2edf87b39 Allow *.a and *.o as libtool objects, and hardcode runpaths into
shared libraries.

    (Both taken from FreeBSD's libtool port.)
1999-10-06 18:58:14 +00:00
Andi Gutmans e3d0c91dbb - Fixed memory leak with this pointer. It was somtimes initialized with refcount
of 2 instead of 1.
- Also fixed a place where object.ptr_ptr is set to pointing to a zval* instead
  of zval**. I don't think this is ever used so we might be able to remove it
  altogether.
1999-10-06 17:45:15 +00:00
Andrei Zmievski 8959144837 Move random functions related defines into its own header file. 1999-10-06 16:34:36 +00:00
Thies C. Arntzen 781a53b807 *** empty log message *** 1999-10-06 15:09:44 +00:00
Thies C. Arntzen c6b91f789d fix for using resources as array indices 1999-10-06 15:09:26 +00:00
Sascha Schumann bf61827518 Fix "make clean". automake does not define an extra target for clean. 1999-10-06 14:41:36 +00:00
Sascha Schumann 4fee036f43 unidiff isn't widely recognized, change to context format. 1999-10-06 13:18:12 +00:00
Sascha Schumann bd62c63c3b Fixed pg_fetch_array() with three arguments.
Submitted by: brian@soda.berkeley.edu
1999-10-06 13:15:23 +00:00
Thies C. Arntzen 657edcd50e - replaced most getParamters against getParamtersEx calls
- removed ParamterPassedByReference where appropiate
1999-10-06 12:54:45 +00:00
Sascha Schumann 4b212d1ce6 * --copy always, since we need to change ltmain.sh
* make patch on some obscure UNIX happy
1999-10-06 12:06:48 +00:00
Uwe Steinmann 3ec401ec84 - fixed some memory leaks 1999-10-06 05:31:24 +00:00
Uwe Steinmann 0817d2a8db - as always forgot the Changelog entry 1999-10-06 05:29:18 +00:00
Uwe Steinmann 8c473e1f47 - support for mimetype application/vnd.fdf needed by fdf module
(only active if fdf support is compiled in)
1999-10-06 05:26:25 +00:00
Uwe Steinmann 6f4cca9cff - fix to work with new version of FdfTk 1999-10-06 05:23:28 +00:00
Sascha Schumann 6dea22808e FreeBSD's libtool port seems to contain a bug which is triggered by
-avoid-version. Removing it, since we don't absolutely need this option.
1999-10-05 20:59:21 +00:00
Sascha Schumann dff6e711ce Apply patch automatically at buildconf time 1999-10-05 17:43:45 +00:00
Sascha Schumann d71eb7bbe6 Fix typo (xml_globals => dir_globals) 1999-10-05 16:18:40 +00:00
Thies C. Arntzen 7fe8812d3e use reference counting for emulating child<->parent (cursor<->connection) relationships. 1999-10-05 16:06:54 +00:00
Sascha Schumann f48a4916ea Explicit casts to ulong. Some compiler don't like pointers in % 1999-10-05 15:15:01 +00:00
Sascha Schumann b510a6d11f More portability stuff 1999-10-05 15:13:22 +00:00
Thies C. Arntzen 35e7bcbb9d dir modules is now resourcified & thread-safe! 1999-10-05 14:36:00 +00:00
Sascha Schumann 693207a845 Generate files for distribution (also adds parsedate.c) 1999-10-05 14:12:43 +00:00
Sascha Schumann 2dd9f01a69 Fix typo. 1999-10-05 13:55:23 +00:00
Sascha Schumann 2785fbce1e OSF/1 V4.0 wants -lcxx 1999-10-05 13:50:13 +00:00
Sascha Schumann 60d87e1914 Add $automake_flags, to allow propagation of --copy 1999-10-05 13:47:16 +00:00
Sascha Schumann 7976bcbd28 Get rid of *_SHLIB variables. Our config scripts don't need Perl,
unfortunately the "apxs" utility does. Someone slap the creator of apxs.
1999-10-05 13:46:52 +00:00
Andrei Zmievski f71789ee71 Remove _A. 1999-10-05 13:33:57 +00:00
Sascha Schumann 84df96ef37 Fix automake dependencies 1999-10-05 13:27:37 +00:00
Thies C. Arntzen e0fe7b9c03 *** empty log message *** 1999-10-05 12:11:26 +00:00
Thies C. Arntzen 7b8ee930f4 fixed ora_close again 1999-10-05 12:10:52 +00:00
Thies C. Arntzen 5a605ae6f4 fix some warnings 1999-10-05 12:09:08 +00:00
Sascha Schumann c36bff57ca Fix logic. 1999-10-05 12:06:35 +00:00
Sascha Schumann e0d561a35b Use libtool 1999-10-05 11:48:05 +00:00
Sascha Schumann 1a4f22e4ed automake does not find all subdirectories automatically. 1999-10-05 11:33:00 +00:00
Sascha Schumann 1877b0779c This causes link problems with anything higher than -O0. 1999-10-05 11:17:04 +00:00
Sascha Schumann c27bbc4086 * Get rid of libphp_util.la
* Don't build CGI from convenience library
    * Add additional checks to regex.h (Apache build broke)
1999-10-05 11:00:48 +00:00
Sascha Schumann e74b985432 100% speedup in buildconf.
We have a top-level Makefile.am, so find becomes superflicious
1999-10-05 10:23:48 +00:00
Sascha Schumann 2e32234461 Build program static. 1999-10-05 09:51:25 +00:00
Marko Karppinen 537aefdb26 Fix a typo? (compile bustage on Solaris 2.6) 1999-10-05 07:00:10 +00:00
Andrei Zmievski cb78ebc0de Taken from PHP3 source. 1999-10-04 21:10:26 +00:00
Andrei Zmievski cec7e90996 *** empty log message *** 1999-10-04 20:35:28 +00:00
Andrei Zmievski 95c970030b test 1999-10-04 20:34:46 +00:00
Andrei Zmievski 6b2003dd2a test 1999-10-04 20:28:44 +00:00
Andrei Zmievski cbddc54b6f test 1999-10-04 19:55:16 +00:00
Sascha Schumann 337541636b -module is already set in Makefile.am 1999-10-04 19:31:36 +00:00
Andrew Skalski f1f8b8a9a2 Added delete and rename functions. 1999-10-04 18:30:37 +00:00
Sascha Schumann 7aed3d51fc * Fix header("HTTP/..") behaviour
* Fix leak WRT http_status_line
    * Update sapi/README
    * Remove %PHP_OUTPUT_FILES sort
1999-10-04 18:07:46 +00:00
Sascha Schumann cfaf694afa Move %(EXTRA_LIBS). 1999-10-04 17:18:17 +00:00
Sascha Schumann afc51baaa3 The .sym format isn't that complex. 1999-10-04 15:42:32 +00:00
Sascha Schumann 590f9c1dee Add necessary rule. 1999-10-04 15:35:16 +00:00
Sascha Schumann f18254e433 Forgot these.. 1999-10-04 15:22:18 +00:00
Sascha Schumann e67005e748 Use libtool. 1999-10-04 15:21:39 +00:00
Sascha Schumann 8ae3f4b027 Use libtool to build. 1999-10-04 15:20:12 +00:00
Sascha Schumann 232afa4816 * archive-based convenience libraries completely replaced
with libtool components

        * SAPI targets can enable thread-safe mode and define
          shared/static/program build target

        * all configure scripts use the same config.cache

        * phplibdir is $(top_builddir)/modules to avoid
          permission problems

        * sapi/*/Makefile.inc are gone

        * runpath handling cleaned up

        * top-level Makefile.in obsoleted through Makefile.am

        * --enable-versioning uses libtool's cleaner and more
          portable -export-symbols feature
1999-10-04 15:18:26 +00:00
Sascha Schumann ec01d01400 Whoops, OSF/1 has -lpthread and -lpthreads, but defines most
pthread_* as __pthread*. According to pthread(3), -lpthread is the
    correct choice.
1999-10-04 15:00:38 +00:00
Sascha Schumann 3e202d75ff Polish this. 1999-10-04 14:29:18 +00:00
Thies C. Arntzen 95d49b10b4 upgraded the former basic_functions.c code to use new API. 1999-10-04 13:31:36 +00:00
Thies C. Arntzen ca1d1f832a use getParametersEx for all builtin functions 1999-10-04 13:27:12 +00:00
Thies C. Arntzen 008810dc29 ereg now returns a continious array 0..9 again - empty values are returned as false.
i think this is *more* compatible with PHP3 - unless anybody really dislikes it i'd prefer it like this.
1999-10-04 13:04:32 +00:00
Sascha Schumann 8266f8a515 -lpthreads is needed on OSF/1 aka Digital Unix aka Tru64 1999-10-04 12:34:04 +00:00
Thies C. Arntzen 6847fefad9 added add_*_resource() and add_*_bool() functions 1999-10-04 11:42:46 +00:00
Thies C. Arntzen b357d0eaf8 i swear, i compiled (at least) before i committed! 1999-10-04 10:39:32 +00:00
Sascha Schumann 3f1465a66e Object files are usually not found in the srcdir. 1999-10-04 09:57:00 +00:00
Thies C. Arntzen 0dbabb9871 "cc -32" on IRIX 6.4 does not like (PHP_TRACK_VARS?"1":"0") - at least not if PHP_TRACK_VARS is 0. 1999-10-04 09:56:52 +00:00
Sascha Schumann 0fe632bcee Fix typo. This caused strange errors when using --with-apxs. 1999-10-04 09:51:46 +00:00
Andi Gutmans 1c0f136405 - Hooray. This might actually work. (I hope) 1999-10-03 20:06:21 +00:00
Andi Gutmans f114050fc8 - Update changelog 1999-10-03 19:05:25 +00:00
Sascha Schumann 8617cc60ad Make config executable 1999-10-03 16:10:15 +00:00
Sascha Schumann a0296da876 Make it executable. 1999-10-03 15:49:27 +00:00
Sascha Schumann 27fb752fce *_config are executable, thus we don't need %(SHELL) 1999-10-03 15:07:41 +00:00
Sascha Schumann 079d9711ac Fix Apache-module build 1999-10-03 14:06:06 +00:00
Sascha Schumann 9e4b5f7c3a Test commit II. 1999-10-02 21:16:34 +00:00
Sascha Schumann 9009c4481b Test commit. 1999-10-02 21:16:04 +00:00
Sascha Schumann 55218a98f2 Reactivate autoheader 1999-10-02 21:14:23 +00:00
Andrei Zmievski 68d423b3ee test commit 1999-10-02 21:13:06 +00:00
Andrei Zmievski e721e560e5 test commit 1999-10-02 21:06:30 +00:00
Andi Gutmans b7e248dd06 *** empty log message *** 1999-10-02 20:50:20 +00:00
Andrei Zmievski 56af2d063e test commit 1999-10-02 20:46:41 +00:00
Andrei Zmievski bbc72d6eb6 test commit 1999-10-02 20:38:09 +00:00
Andrei Zmievski 26b5ef7435 test commit 1999-10-02 20:26:17 +00:00
Andrei Zmievski debf741e82 commit test 1999-10-02 20:22:29 +00:00
Andrei Zmievski 9387719dac test 1999-10-02 20:10:35 +00:00
Andrei Zmievski 62f0dbb0c4 test commit 1999-10-02 20:07:07 +00:00
Andrei Zmievski 34e4269172 test commit 1 1999-10-02 20:03:07 +00:00
Andrei Zmievski 32604578de test commit 1999-10-02 19:22:47 +00:00
Andi Gutmans 56834ff66a - Another locking fix. 1999-10-02 18:02:10 +00:00
Andi Gutmans e40667440d - Fixed locking problem when fetching string offsets 1999-10-02 16:40:25 +00:00
Zeev Suraski 77ddd3a35b Fix the leak reported on the PHP 3 list (isset() on string offsets) 1999-10-02 15:56:49 +00:00
Sascha Schumann be2668c027 Use the already compiled `mod_php4.o'. This avoids the trouble
apxs has with VPATH builds (assumes source dir = build dir).
1999-10-02 12:11:52 +00:00
Andi Gutmans 86357a9c27 - Move is_ref back to being an unsigned char and not a bit field. 1999-10-01 23:31:39 +00:00
Andi Gutmans 4dd47ffbc1 - Remove locking support completely 1999-10-01 23:26:00 +00:00
Andi Gutmans f67a65543d - I forgot this 1999-10-01 19:53:27 +00:00
Andrei Zmievski 23e8d1762d Added array_reverse() function. 1999-10-01 17:36:54 +00:00
Andrei Zmievski a92fb5fe3d rename. 1999-10-01 14:54:55 +00:00
Thies C. Arntzen 7e75bf8f88 one zval fix - cleanups 1999-10-01 13:44:07 +00:00
Andi Gutmans 03d354dcf9 - For Andrei. Implement references in array() initializations 1999-10-01 10:00:05 +00:00
Andrei Zmievski 6f34f1a68d test commit 1999-09-30 23:00:39 +00:00
Andrei Zmievski 7258842c29 preg_replace() now makes copies of array entries if arrays are passed in,
so that convert_to_string() preserves the originals. Is this the correct way to do it?
1999-09-30 21:59:46 +00:00
Sascha Schumann 7ed678f819 Fix typo--GD_* is for shared build mode. 1999-09-30 20:04:52 +00:00
Andrei Zmievski 97f105e450 Fix nl2br crash. 1999-09-30 20:03:32 +00:00
Sascha Schumann d926d95066 Test commit II. 1999-09-30 19:19:19 +00:00
Andrei Zmievski 7982d27528 No need for this anymore. 1999-09-30 18:56:46 +00:00
Sascha Schumann 33ba4ec2a9 Test commit. 1999-09-30 18:54:10 +00:00
Sascha Schumann 5320c897f5 Automatically add the SAPI target's Makefile to the list. This
frees us from doing this in each config.m4.
1999-09-30 12:56:24 +00:00
Thies C. Arntzen 16e1cbee07 major rework here - the refcount stuff gets better and better! 1999-09-30 08:41:45 +00:00
Sascha Schumann cf4afd61f0 * create Makefiles for ext, pcrelib, sapi/*
* copy files for Apache from $(srcdir)
1999-09-29 22:18:43 +00:00
Sascha Schumann 4db370ab9c * VPATH work
* add "--local" switch to buildconf which only recrates the local
      autoconf scripts.
1999-09-29 21:49:32 +00:00
Zeev Suraski dbccd75b06 *** empty log message *** 1999-09-29 21:46:37 +00:00
Chuck Hagenbuch 9221981fa3 cjh: closing bug #2407. 1999-09-29 21:18:35 +00:00
Thies C. Arntzen 02c0ab8d0c fix the order.. (thanx, andi) 1999-09-29 19:13:08 +00:00
Sascha Schumann 174c79dcba Fix a VPATH issue. 1999-09-29 18:35:45 +00:00
Andi Gutmans 202d7dd216 Fix leak in += with arrays 1999-09-29 17:45:44 +00:00
Andi Gutmans 06d04d15a8 - Fix SEND_VAR problem after fetch'ing a variable and not knowing the fetch type 1999-09-29 17:18:36 +00:00
Thies C. Arntzen 446e5d0fff added add_property_resource 1999-09-29 15:25:06 +00:00
Stig Bakken 16ff84429a *** empty log message *** 1999-09-29 15:17:29 +00:00
Stig Bakken 1cb0d88186 Decent configure speedup. Makefiles are now generated only for the
extensions you are including.  Got rid of configure.in.in.
Moved the last Apache-specific files into sapi/apache and made both
static and DSO build work again (it still doesn't run properly).
1999-09-29 15:17:02 +00:00
Stig Bakken db4820447f The $shared variable should normally never be used outside of a call to
AC_ARG_(ENABLE|WITH).  If it is necessary anyway, make sure it is set to
"no" before starting.
1999-09-29 15:13:25 +00:00
Andrey Hristov 2fa5e6dd6a Fix for my fix. 1999-09-29 14:25:40 +00:00
Thies C. Arntzen 284bc523d6 fixed crash in connection shutdown! 1999-09-29 14:20:27 +00:00
Thies C. Arntzen 73c8429282 just some renaming. 1999-09-29 13:35:12 +00:00
Andi Gutmans 59d5462a6a - Stop using the locking mechanism and start using refcount.
Now we know when we need to free but we still need to support it
1999-09-28 17:37:14 +00:00
Andi Gutmans cf6c92949c - Get rid of warning 1999-09-28 17:37:06 +00:00
Andi Gutmans b56fd4602f - First part of the patch which makes reads use ptr and not ptr_ptr. 1999-09-28 16:03:09 +00:00
Stig Bakken f83ff3eb73 disable --with-zeus for now. 1999-09-28 12:55:49 +00:00
Stig Bakken 4c4c8555eb Started working on the Zeus support. Zeus's ISAPI obviously differs from
Windows's, does someone have docs for the Windows API?
1999-09-28 12:08:34 +00:00
684 changed files with 822 additions and 160912 deletions

No files matched your search

-149
View File
@@ -1,149 +0,0 @@
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.
Code Implementation
-------------------
[1] Functions that are given pointers to resources should not free them
For instance, function int mail(char *to, char *from) should NOT free
to and/or from.
Exceptions:
- The function's designated behavior is freeing that resource. E.g. efree()
- The function is given a boolean argument, that controls whether or not
the function may free its arguments (if true - the function must free its
arguments, if false - it must not)
- Low-level parser routines, that are tightly integrated with the token
cache and the bison code for minimum memory copying overhead.
[2] Functions that are tightly integrated with other functions within the
same module, and rely on each other non-trivial behavior, should be
documented as such and declared 'static'. They should be avoided if
possible.
[3] Use definitions and macros whenever possible, so that constants have
meaningful names and can be easily manipulated. The only exceptions
to this rule are 0 and 1, when used as false and true (respectively).
Any other use of a numeric constant to specify different behavior
or actions should be done through a #define.
[4] When writing functions that deal with strings, be sure to remember
that PHP holds the length property of each string, and that it
shouldn't be calculated with strlen(). Write your functions in a such
a way so that they'll take advantage of the length property, both
for efficiency and in order for them to be binary-safe.
Functions that change strings and obtain their new lengths while
doing so, should return that new length, so it doesn't have to be
recalculated with strlen() (e.g. _php3_addslashes())
[5] Use php3_error() to report any errors/warnings during code execution.
Use descriptive error messages, and try to avoid using identical
error strings for different stages of an error. For example,
if in order to obtain a URL you have to parse the URL, connect,
and retreive the text, assuming something can go wrong at each
of these stages, don't report an error "Unable to get URL"
on all of them, but instead, write something like "Unable
to parse URL", "Unable to connect to URL server" and "Unable
to fetch URL text", respectively.
[6] NEVER USE strncat(). If you're absolutely sure you know what you're doing,
check its man page again, and only then, consider using it, and even then,
try avoiding it.
Naming Conventions
------------------
[1] Function names for user functions implementation should be prefixed with
"php3_", and followed by a word or an underscore-delimited list of words,
in lowercase letters, that describes the function.
[2] Function names used by user functions implementations should be prefixed
with "_php3_", and followed by a word or an underscore-delimited list of
words, in lowercase letters, that describes the function. If applicable,
they should be declared 'static'.
[3] Variable names must be meaningful. One letter variable names must be
avoided, except for places where the variable has no real meaning or
a trivial meaning (e.g. for (i=0; i<100; i++) ...).
[4] Variable names should be in lowercase; Use underscores to seperate
between words.
Syntax and indentation
----------------------
[1] Never use C++ style comments (i.e. // comment). Always use C-style
comments instead. PHP is written in C, and is aimed at compiling
under any ANSI-C compliant compiler. Even though many compilers
accept C++-style comments in C code, you have to ensure that your
code would compile with other compilers as well.
The only exception to this rule is code that is Win32-specific,
because the Win32 port is MS-Visual C++ specific, and this compiler
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
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) {
bar;
}
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.
Documentation and Folding Hooks
-------------------------------
In order to make sure that the online documentation stays in line with
the code, each user-level function should have its user-level function
prototype before it along with a brief one-line description of what the
function does. It would look like this:
/* {{{ proto int abs(int number)
Return the absolute value of the number */
void php3_abs(INTERNAL_FUNCTION_PARAMETERS) {
...
}
/* }}} */
The {{{ symbols are the default folding symbols for the folding mode in
Emacs. vim will soon have support for folding as well. Folding is very
useful when dealing with large files because you can scroll through the
file quickly and just unfold the function you wish to work on. The }}}
at the end of each function marks the end of the fold, and should be on
a separate line.
The "proto" keyword there is just a helper for the doc/genfuncsummary script
which generates a full function summary. Having this keyword in front of the
function prototypes allows us to put folds elsewhere in the code without
messing up the function summary.
Optional arguments are written like this:
/* {{{ proto object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])
And yes, please keep everything on a single line, even if that line is massive.
-3
View File
@@ -1,3 +0,0 @@
For the list of people who've put work into PHP 4.0, please see
http://www.php.net/version4/credits.php
-218
View File
@@ -1,218 +0,0 @@
PHP 4.0 CHANGE LOG ChangeLog
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ?? 1999, Version 4.0 Beta 3
- Generalized server-API build procedure on UNIX (Stig)
- Added '--disable-rpath' option (Sascha)
- Added AOLserver SAPI module (Sascha)
- Fixed XML Callbacks. (Thies)
- Updated ODBC to use the new high-performance Zend function API (kara)
- Updated zlib to use the new high-performance Zend function API. (Stefan)
- Updated preg_split() to allow returning only non-empty pieces (Andrei)
- Updated PCRE to use the new high-performance Zend function API (Andrei)
- Updated session, dba, mhash, mcrypt, sysvshm, sysvsem, gettext modules to use
the new high-performance Zend function API (Sascha)
- Extended var_dump to handle resource type somewhat (Andrei)
- Updated WDDX to use the new high-performance Zend function API (Andrei)
- Updated XML to use the new high-performance Zend function API. (Thies)
- Updated Oracle to use the new high-performance Zend function API. (Thies)
- Improved the performance of the MySQL module significantly by using the new
high-performance Zend function API. (Zeev)
- Add support for the Easysoft ODBC-ODCB Bridge (martin@easysoft.com)
- Fix bug in odbc_setoption, getParameter call incorrect (martin@easysoft.com)
- Ora_Fetch_Into now resets the returned array in all cases (Thies)
- Fixed NULL-Column problem in Oracle-Driver (Thies)
- Added extra metadata functions to ODBC, SQLTables etc (nick@easysoft.com)
- Fixed SEGV in mcal make_event_object() and
typo in mcal_list_alarms() (Andrew Skalski)
- Fixed Ora_PLogon (Thies)
- Resourcified Oracle (Thies)
- Implemented object serialization/deserialization in WDDX (Andrei)
- Added krsort() function (Thies)
- Added func_num_args(), func_get_arg() and func_get_args() for standard
access to variable number of arguments functions (Zeev)
- Added FTP support (Andrew Skalski)
- Added optional allowable_tags arguments to strip_tags(), gzgetss() and
fgetss() to allow you to specify a string of tags that are not to be
stripped (Rasmus)
- Upgraded var_dump() to take multiple arguments (Andrei)
- Resourcified XML (Thies)
- Fixed a memory leak in the Apache per-directory directives handler (Zeev)
- Added array_count_values() function. (Thies)
- snmp, pgsql, mysql and gd modules can be built as dynamically loaded
modules (Greg)
- OCI8 fix for fetching empty LOBs (Thies)
- Added user-level callbacks for session module (Sascha)
- Added support for unknown POST content types (Zeev)
- Added "wddx" serialization handler for session module (Sascha)
(automatically enabled, if you compile with --with-wddx)
- Fixed unserializing objects (Thies)
- PHP 4.0 now serializes Objects as 'O' (not understood by PHP 3.0), but
unserializes PHP 3.0 serialized objects as expected. (Thies)
- Made serialize/unserialize work on classes. If the class is known at
unserialize() time, you'll get back a fully working object! (Thies)
- Reworked preg_* functions according to the new PCRE API, which also made
them behave much more like Perl ones (Andrei)
- Made it possible to specify external location of PCRE library (Andrei)
- Updated bundled PCRE library to version 2.08 (Andrei)
- count()/is_array/is_object... speedups. (Thies)
- OCI8 supports appending and positioning when saving LOBs (Thies)
- Added metaphone support (Thies)
- OCI8 doesn't use define callbacks any longer. (Thies)
- OCI8 Driver now supports LOBs like PHP 3.0. (Thies)
- var_dump now dumps the properties of an object (Thies)
- Rewrote the GET/POST/Cookie data reader to support multi-dimensional
arrays! (Zeev)
- Renamed allow_builtin_links to expose_php (defaults to On). This directive
tells PHP whether it may expose its existence to the outside world, e.g.
by adding itself to the Web server header (Zeev)
- Added support for transparent session id propagation (Sascha)
- Made WDDX serialize object properties properly (Andrei)
- Fixed WDDX mem leak when undefined variable is passed in
for serialization (Andrei)
- Added session_unset() function (Andrei)
- Fixed double session globals shutdown crash (Andrei)
- Fixed crash related to ignore_user_abort ini entry (Andrei)
- Added support for external entropy sources for session id creation
(on Unices /dev/random and /dev/urandom) (Sascha)
- Added gpc_globals variable directive to php.ini. By default it is On, but
if it is set to Off, GET, POST and Cookie variables will not be inserted
to the global scope. Mostly makes sense when coupled with track_vars (Zeev)
- Added versioning support for shared library (Sascha)
This allows concurrent use of PHP 3.0 and PHP 4.0 as Apache modules. See
the end of the INSTALL file for more information.
- Added second parameter to array_keys which specifies search value
for which the key should be returned (Andrei)
- Resourcified Informix driver (Danny)
- New resource handling for odbc, renamed to php_odbc.[ch]
- Make set_time_limit() work on Unix (Rasmus)
- Added connection handling support (Rasmus)
- Improved the Sybase-CT module to make use of resources (Zeev)
- Improved the mSQL module to make use of resources (Zeev)
- Changed mysql_query() and mysql_db_query() to return false in case of saving
the result set data fails (Zeev)
- Improved the resource mechanism - resources were not getting freed as soon
as they could (Zeev)
- Added shared memory module for session data storage (Sascha)
- Fixed session.auto_start (Sascha)
- Fixed several problems with output buffering and HEAD requests (Zeev)
- Fixed HTTP Status code issue with ISAPI module (Zeev)
- Fixed a problem that prevented $GLOBALS from working properly (Zeev, Zend
library)
- Ported newest GetImageSize (Thies)
- Added session compile support in Win32 (Andi)
- Added -d switch to the CGI binary that allows overriding php.ini values
from the command line (Zeev)
- Fixed a crash that would occur if wddx_deserialize did not receive
a valid packet (Andrei)
- Fixed a bugglet when redefining a class at run-time (Andi, Zend library)
- Fixed sem_get() on AIX (Sascha)
- Fixed fopen() to work with URL's in Win32 (Andi & Zeev)
- Fixed include_path for Win32 (Andi, Zend library)
- Fixed bug in ISAPI header sending function (Charles)
- Fixed memory leak when using undefined values (Andi & Zeev, Zend library)
- Added output_buffering directive to php.ini, to enable output buffering
for all PHP scripts - default is off (Zeev).
- Fixed some more class inheritance issues (Zeev, Zend library)
- Fixed Apache build wrt to shared modules on FreeBSD/Linux (Sascha)
- Added session.extern_referer_chk which checks whether session ids were
referred to by an external site and eliminates them (Sascha)
- Improved session id generation (Sascha)
- Improved speed of uniqid() by using the combined LCG and removing
the extra usleep() (Sascha)
- Introduced general combined linear congruential generator (Sascha)
- Made ldap_close back into an alias for ldap_unbind (Andrei)
- OciFetchInto now resets the returned array in all cases (Thies)
- Fixed mysql_errno() to work with recent versions of MySQL (Zeev)
- Fixed a problem with define() and boolean values (Zeev)
- Fixed inclusion of gd/freetype functions (Sascha)
- Fixed persistency of MHASH_* constants (Sascha)
- Oracle is now ZTS-Safe (Thies)
- Fixed flushing of cached information to disk in DBA's DB2 module (Sascha)
- OCI8 is now ZTS-Safe (Thies)
- Fixed is_writeable/is_writable problem; they are both defined now (Andrei)
- Imported PHP 3.0 diskfreespace() function (Thies)
- Fixed thread-safety issues in the MySQL module (Zeev)
- Fixed thread-safe support for dynamic modules (Zeev)
- Fixed Sybase CT build process (Zeev)
August 9 1999, Version 4.0 Beta 2
- Fixed a problem when sending HTTP/1.x header lines using header() (Zeev)
- Win32 builds now include the ODBC module built-in (Zeev)
- Fixed SYSV-SHM interface (Thies).
- Updated hyperwave module, made it thread safe
- Updated pdflib module, version 0.6 of pdflib no longer supported
- Updated fdf module
- Built-in phpinfo() links are now turned off by default. They can be turned
on using the allow_builtin_links INI directive (Zeev)
- Changed phpinfo() to list modules that have no info function (Zeev)
- Modified array_walk() function so that the userland callback is passed
a key and possible user data in addition to the value (Andrei)
- Fixed ldap_search(), ldap_read() and ldap_list() (Zeev)
- Fixed Apache information in phpinfo() (sam@breakfree.com)
- Improved register_shutdown_function() - you may now supply arguments that
will be passed to the shutdown function (Zeev)
- Improved call_user_func() and call_user_method() - they now support passing
arguments by reference (Zeev)
- Fixed usort() and uksort() (Zeev)
- Fixed md5() in the Apache module (Thies)
- Introduced build process for dynamic modules (Stig)
- Improved ISAPI module to supprt large server variables (Zeev)
- Imported PHP 3.0 fixes for problem with PHP as a dynamic module and Redhat
libc2.1 in zlib module (Stefan)
- Fixed sybase_fetch_object() (Zeev)
- Made the IMAP module work with PHP 4.0 (Zeev)
- Fixed a problem with include()/require() of URLs (Sascha, Zeev)
- Fixed a bug in implode() that caused it to corrupt its arguments (Zeev)
- Added get_class($obj), get_parent_class($obj) and method_exists($obj,"name")
(Andi & Zeev)
- Fixed various inheritance problems (Andi & Zeev, Zend library)
- Children now inherit their parent's constructor, if they do not supply a
constructor of their own.
- Fixed runtime inheritance of classes (parent methods/properties were
overriding their children) (Zeev, Zend library)
- Fixed backwards incompatibility with the "new" operator (Andi, Zend library)
- Fixed bugs in uksort() and ksort() sort ordering (Andrei)
- Fixed a memory leak when using assignment-op operators with lvalue of type
string (Zeev, Zend library)
- Fixed a problem in inheritance from classes that are defined in include()d
files (Zeev, Zend library)
- Fixed a problem with the PHP error handler that could result in a crash
on certain operating systems (Zeev)
- Apache php_flag values only recognized 'On' (case sensitive) - changed
to case insensitive (Zeev)
- Fixed a memory leak with switch statement containing return statements
(Andi & Zeev, Zend library)
- Fixed a crash problem in switch statements that had a string offset
as a conditional (Andi & Zeev, Zend library)
- Imported PHP 3.0 fixes for rand() and mt_rand() (Rasmus)
- Added function entries for strip_tags() and similar_text() (Andrei)
- Fixed a bug in WDDX that would cause a crash if a number was passed in
instead of a variable name (Andrei)
- Ported strtotime() function from PHP 3.0 (Andrei)
- Merged in gdttf stuff from PHP 3.0 (Sascha)
- buildconf now checks your installation (Stig)
- XML module now built dynamically with --with-xml=shared (Stig)
- Added a check for freetype.h - fixed build on RedHat 6.0 (Zeev)
- Fixed array_walk() to work in PHP 4.0 (Andrei)
- Ported all remaining date() format options from PHP 3.0 (Andrei)
- $php_errormsg now works (Andrei)
- Added locale support for Perl Compatible Regexp functions (Andrei)
- Informix module ported (Danny)
- Removed --with-shared-apache (Sascha)
- Added patch for reverse lookup table in base64_decode (Sascha)
Submitted by bfranklin@dct.com
- Merged in PHP 3.0 version of str_replace (Sascha)
- Added DBA module (Sascha)
- Added session id detection within REQUEST_URI (Sascha)
- Merged in HP-UX/ANSI compatibility switch from PHP 3.0 (Sascha)
- Fixed rpath handling for utilitites built during Apache build (Sascha)
- Added missing E_ error level constants (Zeev, Zend library)
- Fixed a bug in sending multiple HTTP Cookies under Apache (Zeev)
- Fixed implicit connect on the MySQL, mSQL, PostgreSQL and Sybase
modules (Zeev)
- Gave PHP 4.0's SNMP extension all the functionality of PHP 3.0.12 (SteveL)
July 19 1999, Version 4.0 Beta 1
- First public beta of PHP 4.0
-860
View File
@@ -1,860 +0,0 @@
PHP 3.0 CHANGE LOG ChangeLog
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
December 24 1998, Version 3.0.6
- Fix GetImageSize() to work with non-standard jpg images
- Add Mersenne Twister functions (mt_rand, mt_srand, etc)
- Add str_replace() function
- Add chunk_split() function
- Fixed a bug in the memory limit code, in cases where $php_errormsg was
also used.
- Add iptcparse() function
- Adobe FDF supported
- getallheaders() NULL string fix <michale@utko.fee.vutbr.cz>
- Add all configuration directives to phpinfo() page
- Functions pack() and unpack() rewritten to be binary and buffer overrun
safe and behave like the Perl functions for all implemented format codes.
- Ensured that msql_error() will not return error messages generated by
previously-run scripts.
- Add base_convert() function
- Make sprintf() and printf() output binary safe
- Made gzgetc binary safe
- Add convert_cyr_string() and quoted_printable_decode() functions
- Fix ldap_free_result() core dump bug
- Add support for current OpenLDAP-2.0-devel library
- Add php3_asp_tags directive so it can be set from Apache config files
- Added UTF-8 support in the XML extension
- Make rand(min,max) safer on older platforms where the low-order bits have
short cycles.
- Added new pdf (Portable Document Format) module
- Added an XML parsing extension using James Clark's "expat" library
- Optimized parts of the token cache code.
- Terminate on out-of-memory errors. Until now, PHP could crash in out of
memory situations (clean-up, no real effect).
- Unterminated comments in include files were being reported with the wrong line
number. Fixed.
- Added ImageCopy() and ImageColorDeallocate(). ImageCopy() is about
20% faster than ImageCopyResized(). ImageColorDeallocate() marks
palette entries free for reuse (by <mka@satama.com>).
- In the CGI version, it was impossible to access resources (e.g. SQL links,
images) from user-defined shutdown functions. Fixed.
- Added optional third parameter to strpos() to specify the offset to
start searching from.
- Fixed a crash bug in unset() when unsetting illegal variables (rare).
- Made ImageInterlace and ImageTransparentColor parameters optional, and made
them return the current/new settings.
- Optimized GetImageSize() <thies@digicol.de>.
- Made odbc_autocommit() without args return status
- Added connect workaround for OpenLink ODBC
- Added minimal InterBase support. Tested only on 4.0 & Linux.
- Fixed some memory leaks and bogus error messages in the URL handler of
the various file open functions. Should only affect error handling
in bad URLs.
October 5 1998 Version 3.0.5
- mysql_field_flags now reports all MySQL flags and the result is suitable
for automatic parsing. Compatibility warning: The result format has
changed. If you have scripts parsing the result of this function, you
may need to adapt them.
- Made nl2br() binary safe (not that it's of much use).
- Fixed a bug in the API function getThis(). It affected mostly the dir
functions, if nested within objects.
- Fixed a problem in require() in conjunction with switch(), and in some other
cases. Also fixed an identical problem with the call_user_function() API
function.
- Removed -lpthread when compiling with MySQL support. It caused various
serious problems when compiled into Apache.
- Add serialize() and unserialize() functions from jkl@njet.net
- Fix in_addr_t check for systems with in_addr_t in netinet/in.h
- Add atan2() function
September 22 1998 Version 3.0.4
- Added uksort() - array key sort using a user defined comparison function.
- Added 'j' support to date() - generates the day of the month, without
possible leading zeros.
- Added support for multiple crypt() encryptions if the system supports it
- Added optional support for ASP-style <% %> and <%= tags
- Fixed data loss problems with very large numeric array indices on 64-bit
platforms (e.g. DEC UNIX).
- 2 cursor_type parameters for ifx_query() and ifx_prepare changed
to 1 (bitmask). Added a few constants for use in Informix module.
- Added php3.ini option ifx.charasvarchar. If set, trailing blanks
are stripped from fixed-length char columns. (Makes life easier
for people using Informix SE.)
- Static SNMP module which compiles with ucd-snmp 3.5.2
- fixed imap_header & header_info from crashing when a header line
is > 1024 characters.
- Added patch for rfc822_parse_adr to return an array of objects instead
of a single object.
- Informix Online 7.x & SE 7.x support now fairly complete and stable
- Add dbase_get_record_with_names() function
- Added a special case for open_basedir. When open_basedir is set to "."
the directory in which the script is stored will be used as basedir.
- Include alloca.c in the distribution for platforms without alloca().
- Improved stripping of URL passwords from error messages - the length of the
username/password isn't obvious now, and all protocols are handled properly
(most importantly, http).
- Copying objects that had member functions with static variables produced
undetermined results. Fixed.
- Added function lstat() and cleaned up the status functions,
added tests for file status functions (this may break on some plattforms)
- Fixed is_link() - it was returning always false.
- Fixed apache_note() - it was corrupting memory.
- New Function. void get_meta_tags(string filename); Parses filename until
closing head tag and turns all meta tags into variables prefixed with 'meta_'.
The below meta tag would produce $meta_test="some string here"
<meta name="test" content="some string here">
- Generalized some internal functions in order to better support calling
user-level functions from C code. Fixes a few sporadic problems related
to constructors inside eval() and more.
- Fixed an endless loop in explode(), strstr() and strpos() in case of an
invalid empty delimiter.
- rand() now accepts two optional arguments, which denote the requested range
of the generated number. E.g., rand(3,7) would generate a random number
between 3 and 7.
- Added M_PI constant.
- Added deg2rad() and rad2deg() for converting radians<->degrees.
- ImageArc() misbehaved when given negative angles, fixed.
- Fixed a bug in ereg() that may have caused buglets under some circumstances.
- Added imap_status
- Shutdown functions, registered via register_shutdown_function(), could never
generate output in the Apache module version. Fixed.
- Brought IMAP docs into sync with acutal imap code
- imap_fetchstructure now takes in optional flags
- Fix potential core dumps in imap_append and imap_fetchtext_full
- Fix problem in SetCookie() function related to long cookies
- Add uasort() function to go along with usort (like sort() and asort())
- Add port number to Host header as per section 14.23 of the HTTP 1.1 RFC
- Fix imap_reopen to only take 2 arguments with an optional 3rd flags arg
- Add optional 2nd argument to imap_close
- Add CL_EXPUNGE flag to imap_open() flags
- Fix 4th arg on imap_append(). It was getting converted to a long by mistake.
- Fix shutdown warning in the LDAP module
- *COMPATIBILITY WARNING* imap_fetchstructure() "parametres" object and property
name changed to "parameters" to match the documentation and to be consistent
with the rest of the API.
- Delete uploaded temporary files automatically at the end of a request
- Add upload_max_filesize and correponsing php3_upload_max_filesize directive
to control the maximum size of an uploaded file. Setting this to 0 would
completely eliminate file uploads.
- Force $PHP_SELF to PATH_INFO value when running in CGI FORCE_CGI_REDIRECT mode
- Add apache_lookup_uri() function which does an internal sub-request lookup
and returns an object containing the request_rec fields for the URI. (Yes,
you have to be a bit of a gearhead to figure this one out)
- Fix a few signed char problems causing functions like ucfirst() not to work
correctly with non-English charsets
- md5() function not binary safe - fixed
August 15 1998 Version 3.0.3
- Changed the name of fopen_basedir to open_basedir, to be a little more
accurate about what it does.
- Added Hyperwave module
- Added config-option (php3_)enable_dl <on/off>. This enables/disables the
dl() function. In safe-mode dl() is always disabled.
- Auto-prepended files were crashing under some circumstances - fixed.
- Win32 mail fixes provided by walton@nordicdms.com
- Comparing between arrays and/or objects now generates a warning (it always
returns false, as it used to; no comparison is made)
- Fixed a bug in the syntax highlighting code, that made ending-double-quotes
appear twice under certain circumstances.
- Fix bug in filetype() function related to symlinks
- Started integrating Informix SE support to PHP configure/makefile setup.
- gdttf roundoff fixes from ellson@lucent.com
- Added initial Informix SE support files from Danny Heijl - This code still
needs to be integrated into the PHP configure/makefile setup and the code
itself needs more work.
- return in the global scope now terminates the execution of the current file.
- Added the ability to register shutdown function(s), via
register_shutdown_function($function_name).
- Clean up const warnings
- Add write support to ftp fopen wrappers
- Add strspn() and strcspn() functions
- On systems without strerror use Apache version if compiling as Apache module
- The PHP start tag was being ignored under some circumstances - fixed.
- The db, dbase and filepro functions are now Safe-Mode aware.
- Added config-option (php3_)fopen_basedir <path>. This limits the directory-
tree scripts can open files in to <path>.
- Fixed pg_loreadall that didn't always return all the contents in a PostgreSQL
large object. Also, doesn't pass through anything if method is HEAD.
- configure fix to create target Apache module dir
- Fix core dump in imageTTFtext() function
- Added static IMAP support
- Syntax highlighting was generating additional whitespace - fixed.
- Added ucwords. Works like ucfirst, but works on all words within a string.
- Added array_walk() - apply user function to every element of an array
- Added usort() - array sort that accepts a user defined comparison function!
- Added the ability to call user-level functions and object methods on demand
from the C source using a completely generalized, slick API function.
Miracles do happen every once in a while.
- Added constructors. Don't even squeek about destructors! :) (we mean that)
- Make pg_lowrite() binary safe
- Fixed mod_charset option in ./setup
- Fixed rewinddir() and dir()::rewind() under Win32 (they didn't work before).
- Add Win32 COM support! By-name referencing is supported using the IDispatch
interface (automation). Available functions - COM_Load(), COM_Invoke(),
COM_PropGet() and COM_PropSet().
July 20 1998 Version 3.0.2a
- Fix a quirk in the configuration file parser, the endless fountain of joy
and fun.
- Fix a bug in the API function add_method() that made dir() crash.
July 18 1998 Version 3.0.2
- Compile cleanups for *BSD
- Add support for the OpenLink ODBC Drivers
- Add PHP_SELF, PHP_AUTH_* and HTTP_*_VARS PHP variables to phpinfo() output
- Add workaround for broken makes
- Add Apache 1.3.1 support (some Apache header files were moved around)
- Added apache_note() function.
- Fix order of system libraries and detect libresolv correctly
- Fixed a bug in the Sybase-DB module. Several numeric field types were
getting truncated when having large values.
- Added testpages for unified odbc
- Fix php -s seg fault when filename was missing
- Made getdate() without args default to current time
- Added ImageColorResolve() and some fixes to the freetype support.
- Added strcasecmp()
- Added error_prepend_string and error_append_string .ini and .conf directives
to make it possible to configure the look of error messages displayed by PHP
to some extent
- Added E_ERROR, E_WARNING, E_NOTICE, E_PARSE and E_ALL constants, that can be
used in conjunction with error_reporting()
(e.g. error_reporting(E_ERROR|E_WARNING|E_NOTICE);
- Fixed a crash problem with classes that contained function(s) with default
values.
- Fixed a problem in the browscap module. Browscap files weren't being read
properly.
- Fix -L path in libphp4.module to make ApacheSSL compile without errors
- Fix StripSlashes so it correctly decodes a \0 to a NUL
July 04 1998 Version 3.0.1
- echo/print of empty strings don't trigger sending the header anymore.
- Implemented shift left and shift right operators (<< and >>)
- Compile fix for cc on HP-UX.
- Look for beta-version Solid libraries as well.
- Make GD module show more info in phpinfo().
- Compile fix for NextStep 3.0.
- Fix for Oracle extension on OSF/1.
- Fix gd 1.3 bug in ImageColorAt().
- pg_loread() hopefully handles binary data now.
- Turned off some warnings in dns.c
- Added ImageTTFBBox() and made ImageTTFText() return bounding box.
- Added constants for Ora_Bind()'s modes.
- Renamed all hash_*() routines to _php3_hash_*() to avoid clashes with other
libraries.
- Changed uodbc default LONG behaviour: longreadlen 4096 bytes, binmode 1.
The module now actually uses the php.ini settings.
- New PostgreSQL functions: pg_fetch_row(), pg_fetch_array()
and pg_fetch_object()
- Fix a segmentation fault when calling invalid functions in certain
circumstances
- Fix bug that caused link-related functions to not pay attention to
run-time safe mode setting (it was using whatever was set at compile time).
- Fix bug in exec() function when used in safe mode
June 6 1998 Version 3.0
- Add checkdnsrr function (check availability DNS records)
- Add getmxrr function (get MX hostnames and weights)
- Fixed bug in nl2br() function
- Fix for an RC5 related problem in the Sybase module, when dealing
with very long data types.
- Speed up string concatenation by roughly a factor of 2
- Add escape-handling to date function
- Make base64 functions binary safe
- Add strrpos function to complement strpos function added in RC5
- Add ltrim function (strips only at the start of string)
- Add rtrim as an alias to chop() for completeness sake
- Add trim function (similar to chop, except it strips at the start as well)
- Added 2 optional args to fsockopen function - errno and errstr
- Fixed bug in split() function related to leading matches
- Fixed problem in error_log() function (thanks to Jan Legenhausen)
- empty("0") was returning true - fixed
- Removed the old sybsql module. Use the new sybase_*() functions instead.
- Several fixes to the configuration file parser
- LDAP fixes - fixed return values on several functions
May 23 1998 Version 3.0RC5
- The BC math library functions now compile in by default.
- Fixed a bug in virtual() and other types of SSI's (e.g. <!--#exec). Under
certain circumstances, this used to result in random problems.
- Fixed a bug in virtual(). It was misbehaving if it was called before any
other output.
- Added mysql.default_port, mysql.default_host, mysql.default_user and
mysql.default_password ini-file directives.
- Improved handling of the MySQL default port. It now honors /etc/services
and $MYSQL_TCP_PORT.
- Fixed a crash in opening of broken ftp:// URLs, and improved error reporting
in opening of URLs.
- Fixed several non-critical scanner issues with syntax highlighting mode and
the <script language=php> tag.
- Fixed fseek on windows. (windows only): fseek will not return proper results
on files opened as text mode. PHP uses binary mode as the default for file
operations, but this can be overiden by fopen. Do not open files in text
mode and use fseek on them!
- Add strpos() function
- Added zlib module, requires zlib >= 1.0.9
- Improved the module API implementation. Dynamic modules may now register
persistent resources (not that it makes much sense, but at least PHP
won't crash). The API itself remains unchanged.
- bcmod() wasn't always behaving like modulus should behave (it was behaving
exactly like GNU bc's % operator). Fixed.
- Changed the Sybase-DB module to always return strings, instead of auto-typing
result sets. This was done for consistency with the other database modules,
and in order to avoid overflows due to the platform-dependant limitations
of the numeric data types of PHP. You can turn compatability mode on using
the sybase.compatability_mode directive in the php3.ini file.
- Fixed problems with the TINYINT field in the Sybase-CT module.
- Applied some small speed optimizations to the Sybase-DB module querying code.
- Added 'numeric' and 'type' properties to the object returned by
sybase_fetch_field().
- The 'new' operator doesn't accept all expressions anymore. Instead, it
accepts a class name, or a variable reference (scalar, array element, etc).
- Add ora_numcols() function
- Add ora_do() and ora_fetch_into() functions to Oracle driver
- Add persistent connection support to Oracle driver
- Make Oracle driver clean up open connections and open cursors automatically
- Added fread() and fwrite() that properly handle binary data.
- Add Ora_ColumnSize() to Oracle code
- The string "0" means FALSE again. This was done in order to maintain type
conversion consistency.
- Added solid_fetch_prev() for fetching the previous result row from Solid.
- Huge integers are now automatically converted to floating point numbers
(that have a wider range).
- Floating point numbers are now displayed using scientific notation when
they're extremely big or extremely small. The 'precision' php3.ini directive
no longer designates the number of decimal digits, but rather, the maximum
number of significant digits required.
- Added support for scientific notation for floating point numbers (e.g. 1E7)
throughout the entire language.
- Fixed a potential/probable memory corruption problem with HEAD request
handling.
- Using un-encapsulated strings now generates a NOTICE-level warning
(e.g. $a = foo; instead of $a = "foo";)
- Added defined("name") function to check if a certain constant is defined
or not.
- Support new Apache mechanism for setting SERVER_SUBVERSION
- Added PHP_OS and PHP_VERSION constants
- Added the ability to define constants in runtime! Constants are script-wide,
(there's no scope, once the constant is defined, it's valid everywhere).
Syntax is define("name", $value [, $case_insensitive]). 'name' can be any name
that is a valid variable name, *without* the $ prefix. 'value' can be
any *scalar* value. If the optional 'case_insensitive' parameter is 1,
then the constant is created case-insensitive (the default is case
sensitive). Note: define() is currently *NOT* supported in preprocessed
scripts.
- Added general support for constants. The Syslog constants (e.g.
LOG_ERR, LOG_CRIT, etc.) should be accessed as constants from now on (that
is, without a $ prefix). You can still set define_syslog_variables to On
in the php3.ini file if you want to define the various $ variables. The
default for this directive in the php3.ini-dist file has been changed to
Off.
- The configuration file path variable now expands . and .. into their
respective directories. You can obtain the path of the php3.ini file
that was used by printing get_cfg_var("cfg_file_path").
- Fixed a crash-recovery parser crash ($a=7; $a[3]+=5;)
- Add gmmktime() function
- Fixed a crash with implode() and empty arrays.
- Fixed a bug that, under fairly rare circumstances, caused PHP not to
recognize if(), require() and other statements as statements, and
to complain about them as being unsupported functions.
- Beautified php3.ini-dist and added more comments to it. Also changed
the behavior of the configuration file parser to be brighter about
the various constants (TRUE/FALSE/ON/OFF etc).
- Fixed a bug in openlog() - the specified device name was being mangled.
- Memory leaks were sometimes reported erroneously - fixed.
- Improved the convertor to handle some quirks of the PHP/FI 2 parser with
comments.
- Fixed number_format() to properly handle negative numbers, and optimized it
a bit.
- Fixed static variables inside class member functions. Note that using such
static variables inside member functions usually defeats the purpose of
objects, so it is not recommended.
- Fixed a bug in fpassthru() (the file was being closed twice).
- Added strftime().
- Add set_socket_blocking() function to control blocking on socket fd's
- The sendmail_path in php3.ini was being ignored - fixed.
- Fixed a bug with file upload, with files that contained the MIME boundary
inside them.
- Fixed a bug with form variables of type array, with spaces in their
index (e.g. name="foo[bar bar]").
- gd-1.3 autodetect and support
- Year 2000 compliance is now togglable from the php3.ini file. Setting PHP
to be y2k compliant effects the way it creates cookies, and means it'll
NOT work with many browsers out there that are not y2k compliant! For
that reason, the default for this option is off.
- safe mode / fix from monti@vesatec.com
- Integrated the FreeType support in the GD extension.
- Added --with-gd=DIR and --without-gd options to configure
April 18 1998 Version 3.0 Release Candidate 4
- Auto-prepended and auto-appended files were reporting the wrong filename
in errors and in __FILE__ - fixed.
- Fix GPC problem related to mixed scalar and array vars with the same name
- Made putenv() Apache-safe. Environment variables may no longer leak in
between requests.
- The trailing semicolon is no longer required in class declarations.
- Fixed a memory leak in the (array) and (object) operators under certain
conditions.
- <script> tags weren't working unless short tags were enabled - Fixed.
- Fixed a bug in certain array indices that weren't treated as numbers
even though they looked like numbers (e.g. "10", "20").
- Changes to support renamed API functions in Apache-1.3
- Fixed the -p and -e command line switches
- Fix a segfault when calling command line version without parameters
- Fix for feof() when used on a socket
- Fix off-by-one error in fgets() when used on a socket
- Fix bug in ImageSetPixel() (Thanks to ecain@Phosphor.net)
March 31 1998 Version 3.0 Release Candidate 3
- Tiny bugfix for magic_quotes_sybase
- Fix Apache build problems introduced in RC2
- $a["0"]==$a[0] fix
- Apache-1.3 build changes to support 100% automatic builds and shared library
module builds. See INSTALL file.
March 30 1998 Version 3.0 Release Candidate 2
- Changed the socket implementation under UNIX to not use FILE pointers, in
order to work around the buggy Solaris libc (and possibly buggy libc's
in other platforms).
- Fixed a bug in min() and max() with certain arrays.
- *WARNING* Move Apache 1.3 php3 file install to src/modules/php4 instead of
src/modules/extra. Make sure you change your AddModule line correctly
in your Apache Configuration file. This change is to take advantage of
new Apache-1.3 configuration mechanism which makes it easier to build an
Apache server with PHP automatically enabled. It will also help building
a shared library module version of PHP soon.
- Fixed a crash bug with auto-appended files.
- Made --enable-discard-path work on all Unix servers #!/path/php CGI scripts
should now work everywhere. I have tested on Apache, WN and Netscape 2.0
- Made $a["123"] and $a[123] be identical. $a["0123"] is still different,
though.
- Added 'precision' ini directive, to set the number of decimal digits
displayed for floating point numbers (default - 6).
- Made integer/integer divisions evaluate to floating point numbers when
applicable (e.g., 5/2==2.5(float), but 4/2==2(int))
- Get rid of reliance on tied streams and move all socket reads and writes
to recv/send calls
- Cleaned up head.c a bit and fixed CGI SetCookie order problem
- Changed default variable parsing order to Get-Cookie-Post (GPC)
- Fixed setup so it has all configure options and defaults.
- Added optional decimal point and thousands seperator to number_format()
e.g., number_format(1500,2,',','.') == 1.500,00
- Fixed cgi bug in windows that prevented files from being parsed on many
systems and servers.
March 23 1998 Version 3.0 Release Candidate
- Added support for the Raima database (ALPHA)
- Fixed a bug in persistent PostgreSQL links and the connection-string method.
- Added EXTENSION_STATUS file, that specifies the stability and status of
every module in the distribution.
- Added optional parameters to user functions with default values, variables
that are forced to be passed by reference and variables that can be
optionally passed by reference. The ini file directive
'ignore_missing_userfunc_args' is no longer supported.
- Added fhttpd support (by Alex Belits)
- Improved performance by approximately 20-30%.
- Added mysql_error(), mysql_errno() (if available) and msql_error().
Errors coming back from the database backend no longer issue warnings.
Instead, use these functions to retreive the error.
- Patched count(), each(), prev(), next(), reset() and end() to work around
the implementation side effects of unset(). As far as the users are
concerned, this should be transparent now (even though it's slower now,
until it's thoroughly fixed in 3.1).
- Added number_format(). number_format(2499,2)=='2,499.00'.
- error_reporting() now sets the error reporting level to the supplied
argument, without any interpretations.
- Fixed a lookahead parser bug that occured under rare circumstances.
- Change the comparison operators to compare numeric strings as numbers. If
you want to compare them as strings, you can use the new C-like strcmp()
- Fixed Ora_GetColumn() bug when fetching strings
- Added Ora_ColumnName() and Ora_ColumnType()
- Preliminary LONG and LONG RAW support in Oracle extension
- Add \123 and \xAB style octal and hex escapes to "" and `` strings
- Add "-c" command line flag for specifying path to php3.ini file
- Improved list() so that elements can be skipped, for example:
list($name,,,$realname) = explode(":",fgets($passwd_file));
- Fixed a tiny bug in the hash initialization which caused excessive use of
memory. Report and fix by short@k332.feld.cvut.cz
- Fixed strtolower() and strtoupper() to work with 8-bit chars
- Fixed to compile and run on SunOS 4.1
- Fixed a crash in soundex() of an empty string
- Fixed parse_str() - it wasn't always defining the right variables,
and didn't work with arrays.
- Made [m,My]SQL create/drop database functions return success status
- Fixed some memory leak/crash problems in the Adabas module
- Added each() in order to allow for easy and correct array traversing.
- Make Apache module version respect LOCALE setting
- Add support for Apache 1.3b6+ ap_config.h file
- Fixed a nasty corruption bug in eval() and show_source() that resulted in
script termination (e.g. eval("exit();").
- Fixed a syntax highlighting problem with keywords used as variable
names.
- Fixed a possible crash and/or file descriptor leak
- Fixed line number being off by one in #! shell style execution
- Made it possible to disable auto_prepend/append with "none" filename
- Allow safe CGI calling through #!php style scripts
March 2 1998 Version 3.0b6
- Made [s]printf handle %ld
- Changed CGI version to only open regular files as input script
- Added ignore_missing_userfunc_args directive to suppress warnings messages
about missing arguments to user-defined functions
- Added Postgres function - pg_cmdtuples(), by Vladimir Litovka
- Disabled command line options if used as CGI
- Changed CGI version to use PATH_TRANSLATED as the script file name
- Link with solid shared library instead of static one
- Fixed a crash with functions that aren't being called correctly
- Fixed file descriptor leak in auto-prepend/append
- Imap module is usable. See README in dl/imap.
February 24 1998 Version 3.0b5
- Made the URL aware file functions be enabled by default
- Fixed an unlikely crash bug in the parser, with uninitialized array elements
which are refered to as objects.
- Fixed several fields that were being incorrectly read in Sybase CT.
- Fix Apache-1.3 related SIGHUP problem which was preventing php3.ini from
getting re-read on a SIGHUP
- *** WARNING *** Downwards incompatible change: The plus operator (+) is not
longer overloaded as concatenation for strings. Instead, it converts its
arguments to numbers and performs numeric addition.
- Add Stig and Tin's bdf2gdfont script to extra/gd directory
- Added join() as an alias to implode()
- Made implode() accept arguments in the order used by explode() as well
- Made $php_errormsg local in function calls
- Fixed Apache configuration directive bugs
- Added a number of .ini directives to Apache .conf directive list
- Fixed a 'memory leak' with strtok()
- echo/print now handle binary data correctly.
- NEW now accepts any expression for the class name argument.
- Add ImageDashedLine() GD function
- Add arg_separator .ini directive so the '&' GET method separator can be
changed to ';' for example. Corresponding php3_arg_separator Apache .conf
directive works as well.
- Walked around an implementation side effect of switch(). <? switch(expr) { ?>
now works.
- Added memory caching, resulting in a significant performance boost
- Added support for for(): .. endfor; loops
- Added a new predicate - empty($var). Returns true if $var is not set,
or is FALSE. Returns false otherwise.
- Added is_integer() (same as is_long()) and is_real() (same as is_double()).
- Added sizeof() as an alias to the count() function
- Added --enable-force-cgi-redirect, to prevent the CGI from working if
someone directly accesses PHP not through Apache's CGI redirect
(off by default).
- Fixed marking of deleted dBase records. Noticed by Simon Gornall
<simon@oyster.co.uk>.
- Fixed fixed "%%" bug in [s]printf
- Fixed a UMR (initialized memory read) in the Oracle code
- Potential fix for mysql-related SIGPIPE problem which caused httpd to spin
- Made PHP responsive to the Apache link status (stop executing if the link
dies).
- Fixed a crash bug with StrongHold and secure pages
- Fixed StrongHold installation
- Optimized the function call sequence a bit.
- Fixed Sybase/CT date/datetime/money fields work to correctly.
- Fixed Apache module startup problems - php3_module_startup should only be
called once.
- Fixed ord() with characters >127
- Fixed bug in file_exists() function
- Fixed stripslashes() to remove the escaping quote (instead of backslash)
in case magic_quotes_sybase is true.
- Also make echo and print automatically remove trailing decimal zeros.
- Added htmlentities(), currently handling only ISO-8859-1 entities
- "0" is no longer considered false, the only string which is false is the
empty string "".
- Added 'true' and 'false' keywords
- Added 'xor' (logical exclusive or)
- Automatic conversion from double to string removes decimal trailing zeros.
- Added arsort() and rsort() to sort in descending order.
- Turned on "XLATOPT_NOCNV" by default for uODBC/Solid.
- Added support for a port number in the mysql_(p)connect() functions
- Fixed a file descriptor leak in the configuration parser.
- Fixed a few buglets with syntax highlighting with certain language keywords
- Added functions to control minimum severity level of Sybase messages to
display.
- Added highlight_string() - behaves like highlight_file(), only instead
of highlighting a file, it syntax highlights the contents of its
argument.
- Renamed show_source() to highlight_file(). show_source() is still
supported for downwards compatability.
- Fixed a bug in class inheritence - member functions with upper case
letters in their names couldn't be redefined.
- Made chown(), chgrp() and chmod() return TRUE/FALSE instead of 0/-1.
February 02 1998 Version 3.0b4
- Fixed a segfault bug in one of the unified ODBC error messages.
- Set default file modes to binary on Win32 (solved a lot of bs)
- Fixed file copy on Win32
- MIME file uploads fixed on Win32
- Added contributed icons by Colin Viebrock (undex extra/icons)
- Fixed the debugger enough to call it "beta code".
- Fixed some leaks in the Oracle module, tidied up the code a bit.
- Added __FILE__ and __LINE__ which evaluate to the currently parsed file
and currently parsed line respectively.
- Added ImageColorAt(), ImageColorSet(), ImageColorsForIndex(), and
ImageColorsTotal() to allow manipulating the palette of GIF images.
- Rename '--enable-url-includes' option to '--enable-url-fopen-wrapper' to
better describe what it does, and pay attention to the setting.
- Added optional parameter to the file(), readfile() and fopen() functions
to look for files located in the include path.
- Fixed bug that allowed the file() and readfile() to open files in the
include path inadvertantly.
- Fixed a (documented) bug in printf()/sprintf() with hard limited strings
and alignment (e.g. %-.20s).
- Optimized several quoted string routines.
- Added error_log ini directive to select where errors get logged when
log_errors is turned on or the error_log() function is used.
- Added the ability to direct errors to log files instead of or in addition
to the script output. Use the new display_errors and log_errors
php3.ini directives.
- Made environment variables uneraseable by POST/GET/Cookie variables.
- Fixed a bug in the elseif() construct. The expression was being evaluated
even if a previous if/elseif already evaluated to true and got executed.
- Fixed a bug in the exit code parameter of system()
- Tighten up all exec() related functions in safe mode
- Added error_log() function to log messages to the server error log, or
stderr for the CGI version.
- Added support for a general memory limit of scripts.
- Fixed a segfault bug that occured under certain circumstances with shell
escapes ($foo = `...`)
- Made keywords be valid property names of objects.
- Fixed a segfault bug when creating new objects of an unknown class.
- Fixed a problem with the maximum execution time limit, that may have
prevented this feature from working on certain platforms.
- PHP would now warn you with E_NOTICE about unknown escape characters,
e.g. "\f". It would still be considered as a backslash followed by f,
but the proper way of writing this is "\\f" or '\f'.
- Added support for ${...} inside encapsulated strings. Supported: ${foo},
${foo[bar]}, ${foo[0]}, ${$foo[$bar]}, ${$foo->bar} and ${$foo}
- Fixed a bug in automatic persistent link reconnect of the Sybase/DB module.
Thanks to Steve Willer for finding that 'stealth' bug!
- Fixed a crash bug in the GET/POST/Cookie parser in case of regular
and array variables with the same name.
- Added round() function.
- Can't use encapsed strings as variable names anymore, ie. $"blah blah".
- Fixed bug in gethostby*() functions that resulted in a core dump.
(Noticed by torben@coastnet.com.)
- Fixed bug in dbase_get_record that prevented number and date fields
from being properly decoded. (Thanks again to colins@infofind.com.)
- Make dbase_get_record include a 'deleted' field that indicates whether
that record had been marked for deletion.
- Fixed bug in dbase library that stomped on the deleted flag of the first
record in the file if it was set. (Thanks to colins@infofind.com.)
- Fixed putenv() to not report a memory leak and possibly prevent a bug
from that memory being freed.
- Added setlocale()
- Added pg_fieldisnull() (by Stephan Duehr)
- Changed pg_exec() to always return a result identifier on succees
- Solid linking fixes (tries to find the right library)
- Fixed a but with date() and the 'w' element.
- Tried to eliminate unimportant memory leak notifications.
- Made min() and max() backwards compatible and able to handle doubles.
- Add fgetc() function
- Fixed bug in getmyuid(), getmyinode() and getlastmod(). Thanks to
khim@sch57.msk.ru for pointing this out.
- Fixed http:// URL includes with no path specified send request for /.
- Added GetAllHeaders() (Apache-only)
- Added workaround that made the Image text functions 8-bit clean
- Made snmp internally compilable for Win32 (not the unix one though),
only adds 2k to binary size, so no reason not to have it there.
- Fixed ldap loading on Win32
- Fixed MySQL Info function on Win32 platform
- Fixed compilation of syntax highlighting mode
January 17 1998 Version 3.0b3
- Added mysql support under windows ;) happy happy joy joy
- Fixed dbase.dll for Win32 to actualy load now.
- Enhanced the convertor to recognize ?> as a php-close-block as well.
- Fixed potential SetCookie() core dumps
- Changed print to be an expression instead of a statement. That means you can
now do stuff like foobar() or print("Unable to foobar!"). echo has NOT been
changed.
- Removed the flex optimization flags to reduce the size of the scanner
- Added memory leak logging into apache log files (apache module only)
- Fixed a nasty bug in one of the internal stacks. This may have caused
random crashes in several occassions.
- Fixed bug in ImageGif() making it hang sometimes
- Added ImageLoadFont(), ImageFontWidth() and ImageFontHeight()
- error_reporting() now returns the old error reporting level
- Fixed url includes/opens not working under Win32
- Fixed errorneous handling of multipart/form-data input
- Added rawurlencode(), rawurldecode() and changed urlencode() and urldecode()
a bit too.
- Fixed a bug in [s]printf, sign was forgotten for doubles.
- Fixed a segfault bug in pg_fieldprtlen(), and made it accept field names
in addition to field offsets.
- Made the setup script a little more user-friendly.
- Added is_long(), is_double(), is_string(), is_array() and is_object()
- Fixed a bug in freeing of mSQL results.
- Improved pg_exec() to properly return true or false with queries that don't
return rows (i.e. insert, update, create, etc)
- Added get_cfg_var() to enable checking cfg file directives from within
a script.
- Fixed a bug with urlencode() and characters 0x80-0xff
- Changed the behaviour of ereg_replace to more intuitive. The
backslashes other than valid existing back references in the second
argument are no more evaluated as escape sequences.
- Fixed a bug in the configuration file loader and safe mode.
- Fixed a bug with configuration variables taken from the environment.
- Added <script language=php> </script> as PHP open/close tags, to allow
the use of editors such as Microsoft Frontpage.
- Fixed a bug in the default php3.ini directory - it wasn't defaulting to
/usr/local/lib properly.
- Added support for \r\n line endings
- Fixed a bug that may have prevented POST method variables from working
with certain scripts when using the CGI version.
- Convertor: Added support for single-quoted strings
- Fixed segfault bug in the Adabas module, with queries that don't return
rows (update, insert, etc).
December 22 1997 Version 3.0b2
- Changed variable type conversions that do not specify base to always use
base 10. "010" is no more 8, it is 10. Use intval ($x, 0) to get C-style
octal and hex numbers recognized.
- Fixed a possible segfault bug in several functions, when using the concat
operator and possibly other operators/functions.
- # is no longer accepted as a comment in php3.ini. Use ; instead.
- Added browscap support
- Configuration file directives are now case-sensitive
- Fixed msql_tablename() and msql_dbname()
- Added a PHP/FI 2.0 -> PHP 3.0 convertor
- Added support for shell/perl-style single quotes
- Added support for execution of external programs using backquotes ($a=`ls -l`)
- fixed mail() on windows, also fixed memory leaks in mail on windows
- added sendmail_from to handle return route on windows
- Changed the way the config file is searched. The file name is now
php3.ini (hardcoded), and it'll be looked for in: local directory, $PHPRC
and builtin path designated by ./configure under UNIX or Windows directory
under Windows.
- Fixed ereg_replace replacing empty matches and a one off buffer overflow
- Fixed File upload on windows platform
- Fixed a bug that caused 'HTTP/1.1 100 Continue' messages with
Internet Explorer 4.0 and certain scripts that receive POST variables
- Get/POST/Cookie data variables are from now *ALWAYS* strings. If you want
to use them in integer/real context, you must explicitly change their types.
This was done in order to avoid possible loss of data when doing these
conversions automatically.
- Variables named as keywords are now allowed (e.g. $function, $class, etc)
- Fixed a problem with msql() and mysql() with NULL fields
- Fixed a segfault bug with class declarations
- Fixed bugs with FOR loops and include() from within eval()
- Changed include() to be executed conditionally. PHP-3.0 efficient
unconditional include is now require()
December 08 1997 Version 3.0b1
- Switched to public beta test phase
- Generalized unset() and isset() to work on any type of variables, including
specific array indices or object properties (e.g., unset($a[4]) now works).
- Added support for object references inside encapsulated strings
(for example, 'echo "Username: $user->name"' now works)
- Added arbitary precision math support (basic operations with
unlimited range numbers, and support for unlimited decimal digits)
- Apache module can now handle preprocessed scripts (by using:
AddType application/x-httpd-php3-preprocessed .php3p
in the Apache configuration)
- Made settype() pass its first parameter by value. Improved it to be able
to convert to arrays and objects (originally by Steve Willer)
- Implemented CPU time limit on scripts when setitimer() is available
- Computed field names in the Sybase/CT and Sybase/DB modules are now named
computed, computed1, computed2, ...
- Added Sybase/CT client/server message handlers and updated the Sybase/DB ones
- Made the regexp function automatically take arguments by reference
when necessary
- Added builtin support for auto append and prepend in the parser level
- Improved the Sybase/CT sybase_query(). Should be more stable now, and
hopefully work with a wider range of queries. It's difficult to work
without docs, though, so it may still not be 100% right...
- Changed error messages to show error type, file and line with bold
- Added support for autoprepend and autoprepend
- Added some more warning flags if gcc is used
December 03 1997 Version 3.0a4
- Improved the internal functions API - no need to explicitly pass
parameters by reference to internal functions that specifically
require them, e.g. sort(), ksort(), reset(), count(), etc.
This is *STILL* downwards compatible with the previous alphas,
in the sense that you can explicitly pass the arguments by reference
if you want to.
- use srandom/random instead of srand/rand if available
- Added [m,My]sql_listfields() for downwards compatability
- -p now replaces .php3 extension with .php3p (otherwise it adds .php3p)
- Added C++ style comments (// comment)
- Fixed # commenting to terminate at a close PHP tag
- Added \0 back reference for full string match to *reg*_replace and
added backslash escaping to replace string
- Fixed a few bugs in the Sybase DB-library module.
- Added Sybase CT-library support. It should be considered experimental.
Syntax is identical to the one of the DB-library. Allows people to
connect to MS-SQL servers from Linux without having to pay for a
library!
- Beautified phpinfo()
- Add ImageColorClosest() and ImageColorExact() GD functions
- Make all .ini directives work as Apache .conf directives as well
- Added PHP2-like File() function with PHP3 URL support
- Upgraded the Sybase interface. It's practically MySQL compatible now!
Among other things, added sybase_fetch_array() and sybase_fetch_object().
- Fixed problem in multi dimensional array handling and self modifying
operators (+=, -=, etc).
- Safe Mode file open implementation
- SVR3 portability problem fix
November 23 1997 Version 3.0a3
- Made the global statement behave like PHP 2 with undefined variables
- Added msql_fetch_object() and msql_fetch_array()
- Switched between the 1st and 2nd parameters to explode(), so that it acts
like split()
- Fixed passthru(), exec() and system() functions
- Implemented second optional parameter to intval() to specify conversion base
(The default is to assume you want to do a base 10 conversion.)
- Implemented SQL safe mode for MySQL
- Read UploadTmpDir from php3.ini instead of apache conf files
- Added mysql_fetch_object() and mysql_fetch_array()
- Changed function->old_function. function is now an alias to cfunction.
- Split the magic_quotes directive to get/post/data and other
- Added generic copy() function
- Added a $GLOBALS[] array, which contains all global variables
- Fix broken getimagesize() function
- Made mysql_fetch_field() and msql_fetch_field() optionally accept a 2nd argument
- Fixed mysql_data_seek() and msql_data_seek()
- Changed list assignment to list(...) and array init to array(...)
- Made <?php_track_vars?> work
- cgi when not in debug mode uses regular malloc(), free() functions now
- Added preliminary support for perl-style list assignments
- Fixed a bug in mysql_result() and msql_result() when specifying table
- renamed internal error-handling function and levels
- Added basename and dirname functions similar to sh counterparts
- Added base64_encode() and base64_decode()
- Support Basic authorization for http url includes
- Added parse_url() function to extract url components
- Made it possible to use anonymous ftp on URL includes
- Fixed url includes to handle different URLs better
- Fixed mysql_field*() functions
- Made mysql_connect() smarter, after a mysql_close() (applies to msql and pgsql too)
November 6 1997 Version 3.0a2
- Fixed a segfault bug caused by non-persistent connect in [m,My,Postgres]SQL modules
- Fix command line argument handling
- Made empty array list assignments work ($a=({});)
- Made '$' escaping optional when a variable name parsing isn't possible
- Added support for mysql_[p]connect(host) and mysql_[p]connect(host,user)
- New layout in phpinfo()
- Update Oracle extension to use php3_list functions
- Add includepath support
- Add #!php shell script escape support
- Change name of CGI/command line version from php3.cgi to php
- Add SNMP extension
- show_source() support
- Parsing of command-line args for CGI version
- Support for backreferences in ereg_replace
- Support for hexadecimal numbers directly at the scanner level
- Support octal numbers directly at the scanner level
- Fixed problem with huge html files (with little or no php code)
- Fix eval() empty string argument core dump
- renamed 'install' to 'setup' to be more accurate and avoid name conflict
- Fixed Oracle compilation
- Fixed mSQL 1.0 compilation
- Fixed a problem in the mSQL, MySQL and PostgresSQL drivers and NULL fields.
- Fixed the GLOBAL statement to be able to declare an array.
October 29 1997 Version 3.0a1
- Start with excellent new parser from Andi and Zeev
-75
View File
@@ -1,75 +0,0 @@
This is the ChangeLog from PHP3 as of Apr 12 1999.
Entries should be removed from this file, if you transfer changes
over to PHP4.
============================================================================
?? 1999, Version 3.0.8
- added Oracle-OCI8 persistent connections
- fixed OCIDefineByName crash.
- fixed some NULL-column related problems in OCI8-module.
- Some Informix driver improvements.
- PUT method support (mlemos@acm.org)
- Fix parameter count problem in odbc_setoption()
- Really fix implode() this time. The fix in 3.0.7 was bogus
- Make fgetss() slightly smarter
- Add strip_tags() which uses the fgetss state-machine but acts on a string
March 1 1999, Version 3.0.7
- Added pdf_put_image and pdf_execute_image
- Initial work on an ImageMagick module - doesn't do anything yet
- Make configure script detect Netscape's LDAP SDK automagically
- Fixed Oracle-OCI8 module for windows.
- Add OCIRowCount function. (Number of affected rows for update-statements)
- Add OCIDefineByName function.
- Change the behaviour of open_basedir. It's now possible to supply more
than one directory. open_basedir paths from parent directories are now
automatically inherited.
- fix rand() and mt_rand() to make the ranges work correctly
- htmlspecialchars() and htmlentities() are now binary safe.
- Add extract() function.
- Oracle-OCI8 driver now supports BLOBS/CLOBS and IN/OUT binding of local php
variables.
- Clean up apxs build
- Add INSTALL.REDHAT file to walk RedHat users through the install
- Add function_exists() function.
- Add another version of WDDX module
(we need to pick a single implementation here)
- Fixed includes for iODBC to support both the old and the new LGPL version
- Fix implode() bug - When imploding an array that contained unset() elements
it wasn't correctly skipping past these
- Add connection_status() function. This returns the raw bitfield which
indicates whether the script terminated due to a user abort, a timeout
or normally. Note that if ignore_user_abort is enabled, then both the
timeout state and the user abort state can be active
- Add connection_timeout() function. This one can be called in a shutdown
function to tell you if you got there because of a timeout
- Add ignore_user_abort() function and .ini/.conf directive of same name
- Fix connection abort detection code - It should now work reliably with
Apache. Also added a user-level connection_aborted() function designed to
let people check whether the user aborted the connection in a user-level
shutdown function.
- Add pfsockopen() function
- Improvements in FreeType support: Macintosh fonts work, and non-antialiased
output is considerably cleaner <mka@satama.com>
- Fixed checkdate() function, range of valid years is now 0 to 32767
- hw_insertdocument() returns object id now
- Add pdf_open() warning in configure and documentation
- Add diskfreespace() function
- Added aspell support
- Iptcparse would sometimes find a wrong tag.
- Force var_dump() to output headers
- Add optional 3th parameter to ora_fetchinto.
- Serialize and var_dump no longer show array elements that
have been unset.
- Add IptcEmbed() function (can replace an APP13-Marker in a JPEG file)
- Add OCI8 module for Windows
- Fix bug in pdf_close() function
- Add WDDX support (see http://www.wddx.org for more info)
- Add similar_text() function
- Introduce simple regex compilation cache
-538
View File
@@ -1,538 +0,0 @@
Functions:
Functions marked with 'u' do not work, or may not work correctly under windows.
basic_functions
include
_include
isset
intval
doubleval
strval
short_tags
sleep
u usleep
ksort
asort
sort
count
chr
ord
flush
end
prev
next
reset
current
key
gettype
settype
min
max
addslashes
chop
pos
fsockopen
getimagesize
htmlspecialchars
md5
parse_url
parse_str
phpinfo
phpversion
strlen
strtok
strtoupper
strtolower
strchr
basename
dirname
stripslashes
strstr
strrchr
substr
quotemeta
urlencode
urldecode
ucfirst
strtr
sprintf
printf
exec
system
escapeshellcmd
passthru
soundex
rand
srand
getrandmax
gethostbyaddr
gethostbyname
explode
implode
error_reporting
clearstatcache
get_current_user
getmyuid
getmypid
u getmyinode
getlastmod
base64_decode
base64_encode
abs
ceil
floor
sin
cos
tan
asin
acos
atan
pi
pow
exp
log
log10
sqrt
bindec
hexdec
octdec
decbin
decoct
dechex
getenv
putenv
time
mktime
date
gmdate
getdate
checkdate
microtime
uniqid
u linkinfo
u readlink
u symlink
u link
u unlink
bcmath_functions
bcadd
bcsub
bcmul
bcdiv
bcmod
bcpow
bcsqrt
bcscale
bccomp
dir_functions
opendir
closedir
chdir
rewinddir
readdir
dir
dl_functions
dl(string module_name); dynamicly load a module
dns_functions
gethostbyaddr
gethostbyname
file_functions
pclose
popen
readfile
rewind
rmdir
umask
fclose
feof
fgets
fgetss
fopen
fpassthru
fseek
ftell
fputs
mkdir
rename
copy
tempnam
file
filestat_functions
fileatime
filectime
u filegroup
u fileinode
filemtime
u fileowner
fileperms
filesize
filetype
stat
u chown
u chgrp
u chmod
touch
file_exists
is_executable
is_dir
is_readable
is_writeable
u is_link
header_functions
setcookie
header
mail_functions
mail
reg_functions
ereg
ereg_replace
eregi
eregi_replace
split
sql_regcase
syslog_functions (writes to event log on win NT)
openlog
syslog
closelog
The following are optional modules and may or may not be compiled into php, or may be compiled as a loadable module.
odbc_functions (obsolete, use uodbc below)
sqlconnect
sqldisconnect
sqlfetch
sqlexecdirect
sqlgetdata
sqlfree
sqlrowcount
uodbc_functions
(int) odbc_autocommit($connection_id, $OnOff)
(void) odbc_close($connection_id)
(void) odbc_close_all(void)
(int) odbc_commit($connection_id)
(int) odbc_connect($dsn, $user, $password)
(int) odbc_pconnect($dsn, $user, $password)
(string) odbc_cursor($result_id)
(int) odbc_do($connection_id, $query_string)
(int) odbc_exec($connection_id, $query_string)
(int) odbc_prepare($connection_id, $query_string)
(int) odbc_execute($result_id, $array)
(int) odbc_fetch_row($result_id, $row_number)
(int) odbc_fetch_into($result_id, $row_number, $array_ptr)
(int) odbc_field_len($result_id, $field_number)
(string) odbc_field_name($result_id, $field_number)
(string) odbc_field_type($result_id, $field)
(int) odbc_free_result($result_id)
(int) odbc_num_fields($result_id)
(int) odbc_num_rows($result_id)
(string) odbc_result($result_id, $field)
(int) odbc_result_all($result_id, $format)
(int) odbc_rollback($connection_id)
msql_functions
msql_connect
msql_pconnect
msql_close
msql_select_db
msql_create_db
msql_drop_db
msql_query
msql
msql_list_dbs
msql_list_tables
msql_list_fields
msql_result
msql_num_rows
msql_num_fields
msql_fetch_row
msql_fetch_array
msql_fetch_object
msql_data_seek
msql_fetch_field
msql_field_seek
msql_free_result
msql_fieldname
msql_fieldtable
msql_fieldlen
msql_fieldtype
msql_fieldflags
msql_regcase
/* for downwards compatability */
msql_selectdb
msql_createdb
msql_dropdb
msql_freeresult
msql_numfields
msql_numrows
msql_listdbs
msql_listtables
msql_listfields
msql_dbname
msql_tablename
ldap_functions
ldap_connect
ldap_bind
ldap_unbind
ldap_read
ldap_list
ldap_search
ldap_free_result
ldap_count_entries
ldap_first_entry
ldap_next_entry
ldap_get_entries
ldap_free_entry
ldap_first_attribute
ldap_next_attribute
ldap_get_attributes
ldap_get_values
ldap_get_dn
ldap_dn2ufn
ldap_add
ldap_delete
ldap_modify
gd_functions
imagearc
imagechar
imagecharup
imagecolorallocate
imagecolorclosest
imagecolorexact
imagecolortransparent
imagecopyresized
imagecreate
imagecreatefromgif
imagedestroy
imagefill
imagefilledpolygon
imagefilledrectangle
imagefilltoborder
imagegif
imageinterlace
imageline
imagepolygon
imagerectangle
imagesetpixel
imagestring
imagestringup
imagesx
imagesy
filepro_functions
filepro
filepro_rowcount
filepro_fieldname
filepro_fieldtype
filepro_fieldwidth
filepro_fieldcount
filepro_retrieve
dbm_functions
dblist
dbmopen
dbmclose
dbminsert
dbmfetch
dbmreplace
dbmexists
dbmdelete
dbmfirstkey
dbmnextkey
dbase_functions
dbase_open
dbase_create
dbase_close
dbase_numrecords
dbase_numfields
dbase_add_record
dbase_get_record
dbase_delete_record
dbase_pack
calendar_functions
jdtogregorian
gregoriantojd
jdtojulian
juliantojd
jdtojewish
jewishtojd
jdtofrench
frenchtojd
jddayofweek
jdmonthname
adabas_functions
(int) ada_afetch($result_id, $rownumber, $result array)
(int) ada_autocommit($connection_id, $OnOff)
(void) ada_close($connection_id)
ada_closeall
(int) ada_commit($connection_id)
(int) ada_connect($dsn, $user, $password)
(int) ada_exec($connection_id, $query_string)
(int) ada_fetchrow($result_id, $row?number)
ada_fieldlen
(string) ada_fieldname($result_id, $field_number)
(string) ada_fieldtype($result_id, $field)
(int) ada_freeresult($result_id)
(int) ada_numfields($result_id)
(int) ada_numrows($result_id)
(string) ada_result($result_id, $field)
(int) ada_resultall($result_id, $format)
(int) ada_rollback($connection_id)
***(int) ada_fieldnum($result_id, $field_name) (this function is not in adabase.c
crypt_functions
crypt
mysql_functions
mysql_connect
mysql_pconnect
mysql_close
mysql_select_db
mysql_create_db
mysql_drop_db
mysql_query
mysql
mysql_list_dbs
mysql_list_tables
mysql_list_fields
mysql_affected_rows
mysql_insert_id
mysql_result
mysql_num_rows
mysql_num_fields
mysql_fetch_row
mysql_fetch_array
mysql_fetch_object
mysql_data_seek
mysql_fetch_lengths
mysql_fetch_field
mysql_field_seek
mysql_free_result
mysql_fieldname
mysql_fieldtable
mysql_fieldlen
mysql_fieldtype
mysql_fieldflags
/* for downwards compatability */
mysql_selectdb
mysql_createdb
mysql_dropdb
mysql_freeresult
mysql_numfields
mysql_numrows
mysql_listdbs
mysql_listtables
mysql_listfields
mysql_dbname
mysql_tablename
oracle_functions
ora_close
ora_commit
ora_commitoff
ora_commiton
ora_error
ora_errorcode
ora_exec
ora_fetch
ora_getcolumn
ora_logoff
ora_logon
ora_open
ora_parse
ora_rollback
pgsql_functions
pg_connect
pg_pconnect
pg_close
pg_dbname
pg_errormessage
pg_options
pg_port
pg_tty
pg_host
pg_exec
pg_numrows
pg_numfields
pg_fieldname
pg_fieldsize
pg_fieldtype
pg_fieldnum
pg_result
pg_fieldprtlen
pg_getlastoid
pg_freeresult
pg_locreate
pg_lounlink
pg_loopen
pg_loclose
pg_loread
pg_lowrite
pg_loreadall
sybase_functions
sybase_connect
sybase_pconnect
sybase_close
sybase_select_db
sybase_query
sybase_free_result
sybase_get_last_message
sybase_num_rows
sybase_num_fields
sybase_fetch_row
sybase_fetch_array
sybase_fetch_object
sybase_data_seek
sybase_fetch_field
sybase_field_seek
sybase_result
sybase_old_functions
sybsql_seek
sybsql_exit
sybsql_dbuse
sybsql_query
sybsql_isrow
sybsql_result
sybsql_connect
sybsql_nextrow
sybsql_numrows
sybsql_getfield
sybsql_numfields
sybsql_fieldname
sybsql_result_all
sybsql_checkconnect
-186
View File
@@ -1,186 +0,0 @@
Installation Instructions for PHP 4.0
-------------------------------------
For the impatient here is a quick set of steps that will build PHP as
an Apache module for Apache 1.3.x with MySQL support. A more verbose
explanation follows.
QUICK INSTALL
$ gunzip -c apache_1.3.x.tar.gz | tar xf -
$ cd apache_1.3.x
$ ./configure
$ cd ..
$ gunzip -c php-4.0.x.tar.gz | tar xf -
$ cd php-4.0.x
$ ./configure --with-mysql --with-apache=../apache_1.3.x --enable-track-vars
$ make
$ make install
$ cd ../apache_1.3.x
$ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
(The above line is correct! Yes, we know libphp4.a does not exist at this
stage. It isn't supposed to. It will be created.)
make
(you should now have an httpd binary which you can copy to your Apache bin dir)
cd ../php-4.0.x
cp php.ini-dist /usr/local/lib/php.ini
You can edit /usr/local/lib/php.ini file to set PHP options.
Edit your httpd.conf or srm.conf file and add:
AddType application/x-httpd-php .php
VERBOSE INSTALL
Installing PHP can be done in four simple steps:
1. Unpack your distribution file.
You will have downloaded a file named something like php4xn.tar.gz.
Unzip this file with a command like: gunzip php4xn.tar.gz
Next you have to untar it with: tar -xvf php4xn.tar
This will create a php-4.0.x directory. cd into this new directory.
2. Configure PHP.
You now have to choose the options you would like. There are quite
a few of them. To see a list, type: ./configure --help
You can also use the supplied 'setup' script, which will ask you
a series of questions and automatically run the configure script
for you.
The only options that you are likely to want to use are the ones in
the last section entitled, "--enable and --with options recognized:"
A popular choice is to build the Apache module version. You need
to know where the source code directory for your Apache server is
located. Then use an option like: --with-apache=/usr/local/src/apache
if that is your Apache source code directory. If you only specify
--with-apache, then it will default to look for your Apache source
in /usr/local/etc/httpd.
NOTE: The directory you specify should be the top-level of the
unpacked Apache (or Stronghold) distribution. The configure program
will automatically look for httpd.h in different directories under that
location depending on which version of Apache, including Stronghold,
you are running.
For MySQL support, since newer versions of MySQL installs its various
components under /usr/local, this is the default. If you have
changed the location you can specify it with: --with-mysql=/opt/local
for example. Otherwise just use: --with-mysql
*NOTE* If you are using Apache 1.3b6 or later, you should run the
Apache Configure script at least once before compiling PHP. It
doesn't matter how you have Apache configured at this point.
3. Compile and install the files. Simply type: make install
For the Apache module version this will copy the appropriate files
to the src/modules/php4 directory in your Apache distribution if
you are using Apache 1.3.x. If you are still running Apache 1.2.x
these files will be copied directly to the main src directory.
For Apache 1.3b6 and later, you can use the new APACI configuration
mechanism. To automatically build Apache with PHP support, use:
cd apache_1.3.x
./configure --prefix=/<path>/apache \
--activate-module=src/modules/php4/libphp4.a
make
make install
If you do not wish to use this new configuration tool, the old
install procedure (src/Configure) will work fine.
If you are using the old Apache ./Configure script, you will have to
edit the Apache src/Configuration file manually. If you do not have
this file, copy Configuration.tmpl to Configuration.
For Apache 1.3.x add:
AddModule modules/php4/libphp4.a
For Apache 1.3.x don't do anything else. Just add this line and then
run "./Configure" followed by "make".
For Apache 1.2.x add:
Module php4_module mod_php4.o
For Apache 1.2.x you will also have to look in the libphp4.module file,
which was copied to the src directory. The EXTRA_LIBS line in the Apache
Configuration file needs to be set to use the same libs as specified on
the LIBS line in libphp4.module. You also need to make sure to add
"-L." to the beginning of the EXTRA_LIBS line.
So, as an example, your EXTRA_LIBS line might look like:
EXTRA_LIBS=-L. -lphp4 -lgdbm -ldb -L/usr/local/mysql/lib -lmysqlclient
NOTE: You should not enclose the EXTRA_LIBS line in double-quotes, as it
is in the libphp4.module file.
Also, look at the RULE_WANTHSREGEX setting in the libphp4.module file
and set the WANTHSREGEX directive accordingly in your Configuration file.
This last step applies to versions of Apache prior to 1.3b3.
This is a bit of a hassle, but should serve as incentive to move to
Apache 1.3.x where this step has been eliminated.
Once you are satisfied with your Configuration settings, type: ./Configure
If you get errors, chances are that you forgot a library or made a typo
somewhere. Re-edit Configuration and try again. If it goes well,
type: make
4. Setting up the server.
You should now have a new httpd binary. Shut down your existing server,
if you have one, and copy this new binary overtop of it. Perhaps make
a backup of your previous one first. Then edit your conf/srm.conf file
and add the line:
AddType application/x-httpd-php .php
There is also an interesting feature which can be quite instructive and
helpful while debugging. That is the option of having colour syntax
highlighting. To enable this, add the following line:
AddType application/x-httpd-php-source .phps
Any file ending in .phps will now be displayed with full colour syntax
highlighting instead of being executed.
When you are finished making changes to your srm.conf file, you can
start up your server.
USING PHP3 AND PHP4 AS CONCURRENT APACHE MODULES
Recent operating systems provide the ability to perform versioning and
scoping. This features make it possible to let PHP3 and PHP4 run as
concurrent modules in one Apache server.
This feature is known to work on the following platforms:
- Linux with recent binutils (binutils 2.9.1.0.25 tested)
- Solaris 2.5 or better
- FreeBSD (3.2, 4.0 tested)
To enable it, configure PHP3 and PHP4 to use APXS (--with-apxs) and the
necessary link extensions (--enable-versioning). Otherwise, all standard
installations instructions apply. For example:
$ ./configure \
--with-apxs=/apache/bin/apxs \
--enable-versioning \
--with-mysql \
--enable-track-vars
If this also works on your platform or if you know a way to do it, please
report it to our bug database at http://bugs.php.net
-70
View File
@@ -1,70 +0,0 @@
--------------------------------------------------------------------
The PHP License, version 2.01
Copyright (c) 1999 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
3. The name "PHP" must not be used to endorse or promote products
derived from this software without prior permission from the
PHP Group. This does not apply to add-on libraries or tools
that work in conjunction with PHP. In such a case the PHP
name may be used to indicate that the product supports PHP.
4. The PHP Group may publish revised and/or new versions of the
license from time to time. Each version will be given a
distinguishing version number.
Once covered code has been published under a particular version
of the license, you may always continue to use it under the
terms of that version. You may also choose to use such covered
code under the terms of any subsequent version of the license
published by the PHP Group. No one other than the PHP Group has
the right to modify the terms applicable to covered code created
under this License.
5. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes PHP, freely available from
http://www.php.net/".
6. Permission to freely distribute and use Zend as an integrated
part of PHP is granted, under the conditions of version 0.91
of the Zend License.
The license is bundled with the Zend engine, and is available
at http://www.zend.com/license/0_91.txt, or by contacting
license@zend.com.
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------
This software consists of voluntary contributions made by many
individuals on behalf of the PHP Group.
The PHP Group can be contacted via Email at php-group@php.net.
For more information on the PHP Group and the PHP project,
please see <http://www.php.net>.
-20
View File
@@ -1,20 +0,0 @@
Module Status
------ ------
MySQL Working
COM Working
WDDX Working
PCRE Working
DBA Working
mcrypt Working
mhash Working
dbase Working
aspell Working
imap Working
ldap Working
oci8 Working (but no blob-support yet)
oracle Working
iptc Working
informix Working
zlib Working
sysvshm Working
odbc Working (except for persistent connections)
-220
View File
@@ -1,220 +0,0 @@
# +----------------------------------------------------------------------+
# | PHP HTML Embedded Scripting Language Version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
# +----------------------------------------------------------------------+
# | This program is free software; you can redistribute it and/or modify |
# | it under the terms of one of the following licenses: |
# | |
# | A) the GNU General Public License as published by the Free Software |
# | Foundation; either version 2 of the License, or (at your option) |
# | any later version. |
# | |
# | B) the PHP License as published by the PHP Development Team and |
# | included in the distribution in the file: LICENSE |
# | |
# | 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 both licenses referred to here. |
# | If you did not, or have any questions about PHP licensing, please |
# | contact core@php.net. |
# +----------------------------------------------------------------------+
#
# $Id$
#
prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
VPATH = @srcdir@
bindir = @bindir@
top_builddir = .
ZEND_DIR = $(srcdir)/libzend
TSRM_DIR = @TSRM_DIR@
SUBDIRS=libzend ext $(TSRM_DIR) sapi
PACKAGE = @PACKAGE@
VERSION = @VERSION@
LN_S = @LN_S@
CC = @CC@
AR = ar rc
PHP_SAPI = @PHP_SAPI@
SAPI_TARGET = @SAPI_TARGET@
INSTALL_IT = @INSTALL_IT@
EXTRA_LIBS = @EXTRA_LIBS@
EXT_LIBS = @EXT_LIBS@
INCLUDES = @INCLUDES@
INCLUDE = -I$(srcdir) -I. -I$(ZEND_DIR) -I$(srcdir)/TSRM $(INCLUDES)
PROF_CFLAGS =
CFLAGS_SHLIB = @CFLAGS_SHLIB@
LDFLAGS_SHLIB = @LDFLAGS_SHLIB@
LDFLAGS_SHLIB_EXPORT = @LDFLAGS_SHLIB_EXPORT@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
VERSION_SCRIPT = @VERSION_SCRIPT@
RPATHS = @RPATHS@
CFLAGS = @CFLAGS@ @DEBUG_CFLAGS@ $(PROF_CFLAGS)
COMPILE = $(CC) $(CFLAGS) $(CFLAGS_SHLIB) $(CPPFLAGS) $(INCLUDE) $(DEFS) @STRONGHOLD@
LDFLAGS = $(VERSION_SCRIPT) $(RPATHS) @LDFLAGS@ $(LDFLAGS_SHLIB) $(LDFLAGS_SHLIB_EXPORT) -L$(ZEND_DIR)
REGCFLAGS = $(CFLAGS)
RANLIB = @RANLIB@
YACC = @YACC@
MAINT = @MAINT@
APXS = @APXS@
APXS_LDFLAGS = $(EXTRA_LIBS) $(LIBS)
APXS_EXP = @APXS_EXP@
WARNING_LEVEL = @WARNING_LEVEL@
LEX_CFLAGS = -w$(WARNING_LEVEL) @LEX_CFLAGS@
EXT_SHARED = @EXT_SHARED@
LIBOBJS=@LIBOBJS@
REGEX_LIB=@REGEX_LIB@
FHTTPD_LIB=@FHTTPD_LIB@
TSRM_LIB=@TSRM_LIB@
SOURCE = main.c internal_functions.c snprintf.c php3_sprintf.c \
configuration-parser.c configuration-scanner.c request_info.c \
safe_mode.c fopen-wrappers.c php3_realpath.c alloca.c output.c \
php_ini.c SAPI.c rfc1867.c dlist.c php_content_types.c
OBJS = $(SOURCE:.c=.o) $(LIBOBJS)
PHPLIBS = -Llibzend -lzend -Lext -lphpext
LIBS = $(PHPLIBS) $(EXTRA_LIBS) @LIBS@
all: $(SAPI_TARGET)
all-recursive clean-recursive distclean-recursive \
maintainer-clean-depend-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
for subdir in $(SUBDIRS); do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) || fail=yes; \
done && test -z "$$fail"
include $(srcdir)/sapi/$(PHP_SAPI)/Makefile.inc
regex/libregex.a:
(cd regex; $(MAKE) lib)
configuration-parser.h configuration-parser.c: $(srcdir)/configuration-parser.y
bison -p cfg -v -d $(srcdir)/configuration-parser.y -o configuration-parser.c
configuration-scanner.o: configuration-scanner.c
$(COMPILE) $(LEX_CFLAGS) -c configuration-scanner.c
configuration-scanner.c: $(srcdir)/configuration-scanner.l
flex -Pcfg -oconfiguration-scanner.c -i $(srcdir)/configuration-scanner.l
clean: clean-recursive
-rm -f libphp4.a libmodphp4.a libphp4.so php *.o
-rm -f test/php.desc test/php.in test/php.out test/php.test
-rm -f test/a.tmp test/b.tmp test/test.dbm*
distclean: clean distclean-recursive
-rm -f *-parser.[ch] *-scanner.c *.output
-rm -f config.status config.cache config.log
-rm -f Makefile Makefile.depend php_config.h build-defs.h
-rm -f libphp4.module stamp-h buildconf.stamp
-rm -f regex/*.o regex/*.a regex/*.ih
-rm -f doc/checkdoc doc/funcparse doc/version.ent
-rm -f do-conf test/test.log
-rm -f doc/Makefile regex/Makefile
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
dist: distdir
-chmod -R a+r $(distdir)
tar chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir:
-rm -rf $(distdir)
files=`echo *` ;\
mkdir $(distdir) ;\
for file in $$files ; do \
d=$(srcdir); \
if test -d $$d/$$file ; then \
cp -pr $$d/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
(cd $(distdir) ; $(MAKE) distclean)
cd $(distdir)/libzend ;\
flex -Pzend -ozend-scanner.c -i zend-scanner.l ;\
bison -p zend -v -d zend-parser.y -o zend-parser.c
cd $(distdir) ;\
flex -Pcfg -oconfiguration-scanner.c -i configuration-scanner.l ;\
bison -p cfg -v -d configuration-parser.y -o configuration-parser.c
find $(distdir) -name CVS -o -name .cvsignore | xargs rm -rf
maintainer-clean-depend: maintainer-clean-depend-recursive
bench: php
./php -c. tests/bench.phtml
# can't use a single rule for this because 'test' is a directory
test: regression
regression check: php
cd test && ./testall
config.status: configure
./config.status --recheck
build-defs.h php_config.h: stamp-h
stamp-h: php_config.h.in config.status
CONFIG_FILES='build-defs.h stamp-h' ./config.status
Makefile: Makefile.in config.status
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
#
# You must use '--enable-maintainer-mode' with configure to enable
# these rules, which requires autoconf be installed.
#
configure: @MAINT@ configure.in aclocal.m4
cd $(srcdir) && autoconf
php_config.h.in: @MAINT@ stamp-h.in
stamp-h.in: configure.in aclocal.m4 acconfig.h
cd ${srcdir} && autoheader && touch ${srcdir}/stamp-h.in
install: install-recursive $(SAPI_TARGET)
$(INSTALL_IT)
install-recursive:
if test "$(EXT_SHARED)" != ""; then \
for dir in X $(EXT_SHARED); do \
test -d ext/$$dir && (cd ext/$$dir; $(MAKE) install); \
done; \
fi
indent: clean
indent -v -kr -cli4 -ts4 \
-T pval -T HashTable -T Bucket -T Token -T TokenCache -T TokenCacheManager \
-T switch_expr -T internal_function -T control_structure_data \
-T MemoryHashTable -T MemoryBucket \
-T pvalue_value -T Stack *.c *.h
rm -f *~
.c.o:
$(COMPILE) -c $<
parser-scanner: configuration-parser.c configuration-scanner.c
depend: parser-scanner
$(CC) $(CFLAGS) -MM $(SOURCE) | perl -pe 's|regex/regex.h||;' > Makefile.depend
$(CC) $(CFLAGS) -MM $(FUNCTIONS_SOURCE) | perl -pe 's|^(.+\.o)|functions/$$1|; s|regex/regex.h||;' >> Makefile.depend
# Local Variables:
# tab-width: 4
# End:
-17
View File
@@ -1,17 +0,0 @@
How to install PHP with the BCMath arbitrary precision math library?
--------------------------------------------------------------------
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
-57
View File
@@ -1,57 +0,0 @@
QNX4 Installation Notes
-----------------------
NOTE: General installation instructions are in the INSTALL file
1. To compile and test PHP3 you have to grab, compile and install:
- GNU dbm library or another db library;
- GNU bison (1.25 or later; 1.25 tested);
- GNU flex (any version supporting -o and -P options; 2.5.4 tested);
- GNU diffutils (any version supporting -w option; 2.7 tested);
2. To use CVS version you may need also:
- GNU CVS (1.9 tested);
- GNU autoconf (2.12 tested);
- GNU m4 (1.3 or later preferable; 1.4 tested);
3. To run configure define -lunix in command line:
LDFLAGS=-lunix ./configure
4. To use Sybase SQL Anywhere define ODBC_QNX and CUSTOM_ODBC_LIBS in
command line and run configure with --with-custom-odbc:
CFLAGS=-DODBC_QNX LDFLAGS=-lunix CUSTOM_ODBC_LIBS="-ldblib -lodbc" ./configure --with-custom-odbc=/usr/lib/sqlany50
If you have SQL Anywhere version 5.5.00, then you have to add
CFLAGS=-DSQLANY_BUG
to workaround its SQLFreeEnv() bug. Other versions has not been tested,
so try without this flag first.
5. To build the Apache module, you may have to hardcode an include path for
alloc.h in your Apache base directory:
- APACHE_DIRECTORY/src/httpd.h:
change #include "alloc.h"
to #include "APACHE_DIRECTORY/src/alloc.h"
Unless you want to use system regex library, you have to hardcode also
a path to regex.h:
- APACHE_DIRECTORY/src/conf.h:
change #include <regex.h>
to #include "APACHE_DIRECTORY/src/regex/regex.h"
I don't know so far why this required for QNX, may be it is Watcom
compiler problem.
If you building Apache module with SQL Anywhere support, you'll get
symbol conflict with BOOL. It is defined in Apache (httpd.h) and in
SQL Anywhere (odbc.h). This has nothing to do with PHP, so you have to
fix it yourself someway.
6. With above precautions, it should compile as is and pass regression
tests completely:
make
make check
make install
Don't bother me unless you really sure you made that all but it
still doesn't work.
June 28, 1998
Igor Kovalenko -- owl@infomarket.ru
-4
View File
@@ -1,4 +0,0 @@
## process this file with automake to produce Makefile.am
AUTOMAKE_OPTIONS=foreign
lib_LIBRARIES=libtsrm.a
libtsrm_a_SOURCES = TSRM.c
-428
View File
@@ -1,428 +0,0 @@
/*
+----------------------------------------------------------------------+
| Thread Safe Resource Manager |
+----------------------------------------------------------------------+
| Copyright (c) 1998, 1999 Zeev Suraski |
+----------------------------------------------------------------------+
| This source file is subject to the Zend license, that is bundled |
| with this package in the file LICENSE. If you did not receive a |
| copy of the Zend license, please mail us at zend@zend.com so we can |
| send you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
#include "TSRM.h"
#include <stdio.h>
#include <stdlib.h>
#if HAVE_STDARG_H
#include <stdarg.h>
#endif
typedef struct _tsrm_tls_entry tsrm_tls_entry;
struct _tsrm_tls_entry {
void **storage;
int count;
THREAD_T thread_id;
tsrm_tls_entry *next;
};
typedef struct {
size_t size;
void (*ctor)(void *resource);
void (*dtor)(void *resource);
} tsrm_resource_type;
/* The memory manager table */
static tsrm_tls_entry **tsrm_tls_table;
static int tsrm_tls_table_size;
static ts_rsrc_id id_count;
/* The resource sizes table */
static tsrm_resource_type *resource_types_table;
static int resource_types_table_size;
static MUTEX_T tsmm_mutex; /* thread-safe memory manager mutex */
/* New thread handlers */
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;
/* Startup TSRM (call once for the entire process) */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_status)
{
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) {
return 0;
}
id_count=0;
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) {
free(tsrm_tls_table);
return 0;
}
tsmm_mutex = tsrm_mutex_alloc();
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);
return 1;
}
/* Shutdown TSRM (call once for the entire process) */
TSRM_API void tsrm_shutdown()
{
int i;
if (tsrm_tls_table) {
for (i=0; i<tsrm_tls_table_size; i++) {
tsrm_tls_entry *p = tsrm_tls_table[i], *next_p;
while (p) {
int j;
next_p = p->next;
for (j=0; j<id_count; j++) {
free(p->storage[j]);
}
free(p->storage);
free(p);
p = next_p;
}
}
free(tsrm_tls_table);
}
if (resource_types_table) {
free(resource_types_table);
}
tsrm_mutex_free(tsmm_mutex);
tsrm_debug("Shutdown TSRM\n");
}
/* allocates a new thread-safe-resource id */
TSRM_API ts_rsrc_id ts_allocate_id(size_t size, void (*ctor)(void *resource), void (*dtor)(void *resource))
{
ts_rsrc_id new_id;
int i;
tsrm_debug("Obtaining a new resource id, %d bytes\n", size);
tsrm_mutex_lock(tsmm_mutex);
/* obtain a resource id */
new_id = id_count++;
tsrm_debug("Obtained resource id %d\n", 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;
}
resource_types_table_size = id_count;
}
resource_types_table[new_id].size = size;
resource_types_table[new_id].ctor = ctor;
resource_types_table[new_id].dtor = dtor;
/* enlarge the arrays for the already active threads */
for (i=0; i<tsrm_tls_table_size; i++) {
tsrm_tls_entry *p = tsrm_tls_table[i];
while (p) {
if (p->count < id_count) {
int j;
p->storage = (void *) realloc(p->storage, sizeof(void *)*id_count);
for (j=p->count; j<id_count; j++) {
p->storage[j] = (void *) malloc(resource_types_table[j].size);
if (resource_types_table[j].ctor) {
resource_types_table[j].ctor(p->storage[j]);
}
}
p->count = id_count;
}
p = p->next;
}
}
tsrm_mutex_unlock(tsmm_mutex);
tsrm_debug("Successfully allocated new resource id %d\n", new_id);
return new_id;
}
static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_T thread_id)
{
int i;
if (tsrm_new_thread_begin_handler) {
tsrm_new_thread_begin_handler(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;
(*thread_resources_ptr)->thread_id = thread_id;
(*thread_resources_ptr)->next = NULL;
for (i=0; i<id_count; i++) {
(*thread_resources_ptr)->storage[i] = (void *) malloc(resource_types_table[i].size);
if (resource_types_table[i].ctor) {
resource_types_table[i].ctor((*thread_resources_ptr)->storage[i]);
}
}
if (tsrm_new_thread_end_handler) {
tsrm_new_thread_end_handler(thread_id);
}
}
/* fetches the requested resource for the current thread */
void *ts_resource(ts_rsrc_id id)
{
THREAD_T thread_id = tsrm_thread_id();
int hash_value;
tsrm_tls_entry *thread_resources;
void *resource;
tsrm_debug("Fetching resource id %d for thread %ld\n", id, (long) thread_id);
tsrm_mutex_lock(tsmm_mutex);
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
thread_resources = tsrm_tls_table[hash_value];
if (!thread_resources) {
allocate_new_resource(&tsrm_tls_table[hash_value], thread_id);
thread_resources = tsrm_tls_table[hash_value];
} else {
do {
if (thread_resources->thread_id == thread_id) {
break;
}
if (thread_resources->next) {
thread_resources = thread_resources->next;
} else {
allocate_new_resource(&thread_resources->next, thread_id);
thread_resources = thread_resources->next;
break;
}
} while (thread_resources);
}
resource = thread_resources->storage[id];
tsrm_mutex_unlock(tsmm_mutex);
tsrm_debug("Successfully fetched resource id %d for thread id %ld - %x\n", id, (long) thread_id, (long) resource);
return resource;
}
/* frees all resources allocated for the current thread */
void ts_free_thread()
{
THREAD_T thread_id = tsrm_thread_id();
int hash_value;
tsrm_tls_entry *thread_resources;
tsrm_tls_entry *last=NULL;
tsrm_mutex_lock(tsmm_mutex);
hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size);
thread_resources = tsrm_tls_table[hash_value];
while (thread_resources) {
if (thread_resources->thread_id == thread_id) {
int i;
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
resource_types_table[i].dtor(thread_resources->storage[i]);
}
free(thread_resources->storage[i]);
}
free(thread_resources->storage);
if (last) {
last->next = thread_resources->next;
} else {
tsrm_tls_table[hash_value]=NULL;
}
free(thread_resources);
break;
}
if (thread_resources->next) {
last = thread_resources;
}
thread_resources = thread_resources->next;
}
tsrm_mutex_unlock(tsmm_mutex);
}
/* deallocates all occurrences of a given id */
void ts_free_id(ts_rsrc_id id)
{
}
/*
* Utility Functions
*/
/* Obtain the current thread id */
TSRM_API THREAD_T tsrm_thread_id(void)
{
#ifdef WIN32
return GetCurrentThreadId();
#elif defined(PTHREADS)
return pthread_self();
#elif defined(NSAPI)
return systhread_current();
#elif defined(PI3WEB)
return PIThread_getCurrent();
#endif
}
/* Allocate a mutex */
TSRM_API MUTEX_T tsrm_mutex_alloc( void )
{
MUTEX_T mutexp;
#ifdef WIN32
mutexp = CreateMutex(NULL,FALSE,NULL);
#elif defined(PTHREADS)
mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
pthread_mutex_init(mutexp,NULL);
#elif defined(NSAPI)
mutexp = crit_init();
#elif defined(PI3WEB)
mutexp = PIPlatform_allocLocalMutex();
#endif
#ifdef THR_DEBUG
printf("Mutex created thread: %d\n",mythreadid());
#endif
return( mutexp );
}
/* Free a mutex */
TSRM_API void tsrm_mutex_free( MUTEX_T mutexp )
{
if (mutexp) {
#ifdef WIN32
CloseHandle(mutexp);
#elif defined(PTHREADS)
free(mutexp);
#elif defined(NSAPI)
crit_terminate(mutexp);
#elif defined(PI3WEB)
PISync_delete(mutexp)
#endif
}
#ifdef THR_DEBUG
printf("Mutex freed thread: %d\n",mythreadid());
#endif
}
/* Lock a mutex */
TSRM_API int tsrm_mutex_lock( MUTEX_T mutexp )
{
#if 0
tsrm_debug("Mutex locked thread: %ld\n",tsrm_thread_id());
#endif
#ifdef WIN32
return WaitForSingleObject(mutexp,1000);
#elif defined(PTHREADS)
return pthread_mutex_lock(mutexp);
#elif defined(NSAPI)
return crit_enter(mutexp);
#elif defined(PI3WEB)
return PISync_lock(mutexp);
#endif
}
/* Unlock a mutex */
TSRM_API int tsrm_mutex_unlock( MUTEX_T mutexp )
{
#if 0
tsrm_debug("Mutex unlocked thread: %ld\n",tsrm_thread_id());
#endif
#ifdef WIN32
return ReleaseMutex(mutexp);
#elif defined(PTHREADS)
return pthread_mutex_unlock(mutexp);
#elif defined(NSAPI)
return crit_exit(mutexp);
#elif defined(PI3WEB)
return PISync_unlock(mutexp);
#endif
}
TSRM_API void *tsrm_set_new_thread_begin_handler(void (*new_thread_begin_handler)(THREAD_T thread_id))
{
void *retval = (void *) tsrm_new_thread_begin_handler;
tsrm_new_thread_begin_handler = new_thread_begin_handler;
return retval;
}
TSRM_API void *tsrm_set_new_thread_end_handler(void (*new_thread_end_handler)(THREAD_T thread_id))
{
void *retval = (void *) tsrm_new_thread_end_handler;
tsrm_new_thread_end_handler = new_thread_end_handler;
return retval;
}
/*
* Debug support
*/
static int tsrm_debug(const char *format, ...)
{
if (tsrm_debug_status) {
va_list args;
int size;
va_start(args, format);
size = vprintf(format, args);
va_end(args);
return size;
} else {
return 0;
}
}
void tsrm_debug_set(int status)
{
tsrm_debug_status = status;
}
-100
View File
@@ -1,100 +0,0 @@
# Microsoft Developer Studio Project File - Name="TSRM" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=TSRM - Win32 Debug_TS
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "TSRM.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "TSRM.mak" CFG="TSRM - Win32 Debug_TS"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "TSRM - Win32 Debug_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "TSRM___Win32_Debug_TS"
# PROP BASE Intermediate_Dir "TSRM___Win32_Debug_TS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug_TS"
# 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 "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x40d /d "_DEBUG"
# ADD RSC /l 0x40d /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TS"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "TSRM___Win32_Release_TS"
# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TS"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release_TS"
# 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 "WIN32" /D "_MBCS" /D "_LIB" /D "TSRM_EXPORTS" /YX /FD /c
# ADD BASE RSC /l 0x40d /d "NDEBUG"
# ADD RSC /l 0x40d /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "TSRM - Win32 Debug_TS"
# Name "TSRM - Win32 Release_TS"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\TSRM.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\TSRM.h
# End Source File
# End Group
# End Target
# End Project
-103
View File
@@ -1,103 +0,0 @@
/*
+----------------------------------------------------------------------+
| Thread Safe Resource Manager |
+----------------------------------------------------------------------+
| Copyright (c) 1998, 1999 Zeev Suraski |
+----------------------------------------------------------------------+
| This source file is subject to the Zend license, that is bundled |
| with this package in the file LICENSE. If you did not receive a |
| copy of the Zend license, please mail us at zend@zend.com so we can |
| send you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
#ifndef _TSRM_H
#define _TSRM_H
#ifdef HAVE_CONFIG_H
# undef PACKAGE
# undef VERSION
# include "tsrm_config.h"
# undef PACKAGE
# undef VERSION
#endif
#if WIN32||WINNT
# include <windows.h>
#elif defined(PTHREADS)
# include <pthread.h>
#endif
typedef int ts_rsrc_id;
#if WIN32||WINNT
# ifdef TSRM_EXPORTS
# define TSRM_API __declspec(dllexport)
# else
# define TSRM_API __declspec(dllimport)
# endif
#else
# define TSRM_API
#endif
/* Define THREAD_T and MUTEX_T */
#if defined(WIN32)
# define THREAD_T DWORD
# define MUTEX_T void *
#elif defined(PTHREADS)
# define THREAD_T pthread_t
# define MUTEX_T pthread_mutex_t *
#elif defined(NSAPI)
# define THREAD_T SYS_THREAD
# define MUTEX_T CRITICAL
#elif defined(PI3WEB)
# define THREAD_T PIThread *
# define MUTEX_T PISync *
#endif
#define THREAD_HASH_OF(thr,ts) thr%ts
#ifdef __cplusplus
extern "C" {
#endif
/* startup/shutdown */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_status);
TSRM_API void tsrm_shutdown();
/* allocates a new thread-safe-resource id */
TSRM_API ts_rsrc_id ts_allocate_id(size_t size, void (*ctor)(void *resource), void (*dtor)(void *resource));
/* fetches the requested resource for the current thread */
TSRM_API void *ts_resource(ts_rsrc_id id);
/* frees all resources allocated for the current thread */
TSRM_API void ts_free_thread();
/* deallocates all occurrences of a given id */
TSRM_API void ts_free_id(ts_rsrc_id id);
/* Debug support */
TSRM_API void tsrm_debug_set(int status);
/* utility functions */
TSRM_API THREAD_T tsrm_thread_id(void);
TSRM_API MUTEX_T tsrm_mutex_alloc(void);
TSRM_API void tsrm_mutex_free(MUTEX_T mutexp);
TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp);
TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp);
TSRM_API void *tsrm_set_new_thread_begin_handler(void (*new_thread_begin_handler)(THREAD_T thread_id));
TSRM_API void *tsrm_set_new_thread_end_handler(void (*new_thread_end_handler)(THREAD_T thread_id));
#ifdef __cplusplus
}
#endif
#endif /* _TSRM_H */
-1
View File
@@ -1 +0,0 @@
#undef PTHREADS
-24
View File
@@ -1,24 +0,0 @@
#!/bin/sh
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
echo "buildconf: keeping ${1}aclocal.m4"
mv aclocal.m4.old aclocal.m4
else
echo "buildconf: created or modified ${1}aclocal.m4"
fi
#autoheader
automake --add-missing --include-deps
mv configure configure.old 2>/dev/null
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping ${1}configure"
mv configure.old configure
else
echo "buildconf: created or modified ${1}configure"
fi
-30
View File
@@ -1,30 +0,0 @@
dnl $Id$
dnl
dnl Minimalistic configure.in for TSRM.
dnl
AC_INIT(TSRM.c)
AM_INIT_AUTOMAKE(TSRM, 1.0)
AM_CONFIG_HEADER(tsrm_config.h)
AC_PROG_CC
AM_PROG_CC_STDC
AC_PROG_CC_C_O
AC_PROG_RANLIB
AC_CHECK_LIB(c_r, pthread_create)
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_FUNCS(pthread_create)
if test "$ac_cv_func_pthread_create" != "yes"; then
AC_MSG_ERROR(You need pthreads to build TSRM.)
fi
AC_DEFINE(PTHREADS)
AC_CHECK_HEADERS(stdarg.h)
AC_OUTPUT(Makefile tsrm_config)
chmod +x tsrm_config
-25
View File
@@ -1,25 +0,0 @@
/* tsrm_config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
#undef PTHREADS
/* Define if you have the pthread_create function. */
#undef HAVE_PTHREAD_CREATE
/* Define if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define if you have the c_r library (-lc_r). */
#undef HAVE_LIBC_R
/* Define if you have the pthread library (-lpthread). */
#undef HAVE_LIBPTHREAD
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION
-43
View File
@@ -1,43 +0,0 @@
#! /bin/sh
#
# $Id$
#
# Written by Sascha Schumann <sascha@schumann.cx>
# taken from autoconf
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
ac_n= ac_c='
' ac_t=' '
else
ac_n=-n ac_c= ac_t=
fi
else
ac_n= ac_c='\c' ac_t=
fi
flags_libs="@LIBS@"
flags_ldflags="@LDFLAGS@"
flags_cflags="@CPPFLAGS@ @CFLAGS@"
case "$1" in
--ldflags)
echo $ac_n "$flags_ldflags$ac_c"
;;
--cflags)
echo $ac_n "$flags_cflags$ac_c"
;;
--libs)
echo $ac_n "$flags_libs$ac_c"
;;
*)
echo "$0 [--libs|--cflags|--ldflags]"
exit 1
;;
esac
exit 0
+17 -12
View File
@@ -2,30 +2,35 @@
#CLEANFILES = zend-parser.c zend-parser.h zend-scanner.c zend-parser.output
ZEND_SCANNER = @ZEND_SCANNER@
AUTOMAKE_OPTIONS=foreign
noinst_LIBRARIES=libzend.a
libzend_a_SOURCES=\
zend-parser.y zend-scanner.l \
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_la_SOURCES=\
zend-parser.y \
zend_alloc.c zend_compile.c zend_constants.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
# taken from automake 1.4
CXXFLAGS= @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
libzend_la_LIBADD = $(ZEND_SCANNER)
libzend_la_LDFLAGS = @EXTRA_LIBS@
# automake isn't too clever about "non-standard" use of lex and yacc
zend-scanner.o: @ZEND_SCANNER_SRC@
@ZEND_SCANNER_COMPILE@
zend-scanner.l: zend-parser.h
zend-scanner.c: zend-scanner.l
$(LEX) -Pzend -ozend-scanner.c -i $(srcdir)/zend-scanner.l
$(LEX) -Pzend -o$@ -i $(srcdir)/zend-scanner.l
zend-scanner.cc: zend-scanner.l
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -ozend-scanner.cc $(srcdir)/zend-scanner.l
zend-scanner-cc.cc: zend-scanner.l
$(LEX) -+ -B -i -S$(srcdir)/flex.skl -Pzend -o$@ $(srcdir)/zend-scanner.l
zend-parser.h: zend-parser.c
zend-parser.c: zend-parser.y
+5 -8
View File
@@ -60,10 +60,11 @@
/* Define if you have stdiostream.h */
#undef HAVE_STDIOSTREAM_H
#ifdef HAVE_LIBDL
# ifdef HAVE_DLFCN_H
# include <dlfcn.h>
# endif
#ifdef HAVE_DLFCN_H
# include <dlfcn.h>
#endif
#if defined(HAVE_LIBDL) && defined(RTLD_NOW)
# define DL_LOAD(libname) dlopen(libname, RTLD_NOW)
# define DL_UNLOAD dlclose
# define DL_FETCH_SYMBOL dlsym
@@ -80,10 +81,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
# define zend_sprintf sprintf
#endif
#if ZEND_DEBUG
# define inline
#endif
/*
* Local variables:
* tab-width: 4
+5
View File
@@ -18,3 +18,8 @@ AC_DEFUN(AC_ZEND_BROKEN_SPRINTF,[
AC_MSG_RESULT(cannot check, guessing ok)
])
])
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
])
+43
View File
@@ -0,0 +1,43 @@
# Makefile to generate build tools
#
# Standard usage:
# make -f build.mk
#
# Written by Sascha Schumann
#
# $Id$
LT_TARGETS = ltmain.sh ltconfig
config_h_in = zend_config.h.in
makefile_am_files = Makefile.am
makefile_in_files = $(makefile_am_files:.am=.in)
makefile_files = $(makefile_am_files:e.am=e)
targets = $(makefile_in_files) $(LT_TARGETS) configure $(config_h_in)
all: $(targets)
clean:
rm -f $(targets)
$(LT_TARGETS):
rm -f $(LT_TARGETS)
libtoolize --automake $(AMFLAGS) -f
$(makefile_in_files): $(makefile_am_files)
automake -a -i $(AMFLAGS) $(makefile_files)
aclocal.m4: configure.in acinclude.m4
aclocal
$(config_h_in): configure.in acconfig.h
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
@rm -f $@
autoheader
configure: aclocal.m4 configure.in
autoconf
+10 -1
View File
@@ -1,5 +1,14 @@
#!/bin/sh
case "$1" in
--copy)
automake_flags=--copy
shift
;;
esac
libtoolize --force --automake $automake_flags
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
@@ -11,7 +20,7 @@ fi
autoheader
automake --add-missing --include-deps
automake --add-missing --include-deps $automake_flags
mv configure configure.old 2>/dev/null
autoconf
+32 -17
View File
@@ -27,10 +27,13 @@ AC_PROG_CC
if test "$enable_thread_safety" = "yes" ; then
AC_PROG_CXX
fi
AC_PROG_RANLIB
AC_PROG_CC_C_O
AM_PROG_LEX
AM_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
AM_SET_LIBTOOL_VARIABLE([--silent])
fi
AM_PROG_CC_STDC
AC_C_INLINE
@@ -114,6 +117,23 @@ AC_ARG_ENABLE(debug,
AC_SUBST(DEBUG_CFLAGS)
CFLAGS="$CFLAGS $DEBUG_CFLAGS"
RESULT=yes
AC_MSG_CHECKING(whether to enable inline)
AC_ARG_ENABLE(inline,
[ --disable-inline Disable the inline specifier],
[
if test "$enableval" = "no"; then
RESULT=no
fi
])
AC_MSG_RESULT($RESULT)
if test "$RESULT" = "yes"; then
AC_C_INLINE
else
AC_DEFINE(inline, [])
fi
AC_MSG_CHECKING(whether to enable a memory limit)
AC_ARG_ENABLE(memory-limit,
[ --enable-memory-limit Compile with memory limit support. ],
@@ -131,35 +151,34 @@ AC_ARG_ENABLE(memory-limit,
])
ZEND_SCANNER_TYPE=c
dnl Sigh. This will probably break automake's automatic dependencies..
AC_MSG_CHECKING(whether to build Zend thread-safe)
AC_ARG_ENABLE(thread-safety,
[ --enable-thread-safety Whether to build Zend thread-safe.],[
if test "$enableval" = "yes"; then
AC_DEFINE(ZTS)
ZEND_SCANNER_SRC=zend-scanner.cc
ZEND_SCANNER_COMPILE='$(CXXCOMPILE) -c $< -o $@'
ZEND_SCANNER_TYPE=cc
CPPFLAGS="$CPPFLAGS -I../TSRM"
AC_MSG_RESULT(yes)
else
ZEND_SCANNER_SRC=zend-scanner.c
ZEND_SCANNER_COMPILE='$(COMPILE) -c $<'
AC_MSG_RESULT(no)
fi
],[
ZEND_SCANNER_SRC=zend-scanner.c
ZEND_SCANNER_COMPILE='$(COMPILE) -c $<'
AC_MSG_RESULT(no)
])
AC_SUBST(TSRM_DIR)
AC_SUBST(TSRM_LIB)
AC_SUBST(ZEND_SCANNER_SRC)
AC_SUBST(ZEND_SCANNER_COMPILE)
ZEND_SCANNER="libzend_${ZEND_SCANNER_TYPE}.la"
AC_SUBST(ZEND_SCANNER)
if test "$enable_thread_safety" = "yes" ; then
AC_CHECK_LIB(C, cin)
AC_CHECK_LIB(g++, cin)
AC_CHECK_LIB(stdc++, cin)
dnl Digital Unix 4.0
AC_CHECK_LIB(cxx, cin)
AC_CHECK_LIB(cxxstd, __array_delete)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
@@ -181,14 +200,10 @@ AC_LANG_RESTORE
fi
AC_SUBST(CXXFLAGS)
AC_SUBST(CFLAGS_SHLIB)
AC_SUBST(LDFLAGS_SHLIB)
AC_SUBST(LDFLAGS_SHLIB_EXPORT)
AC_OUTPUT(Makefile zend_config)
EXTRA_LIBS="$LIBS"
LIBS=""
AC_SUBST(EXTRA_LIBS)
AC_OUTPUT(Makefile)
# Local Variables:
# tab-width: 4
+4 -2
View File
@@ -283,7 +283,8 @@ InputDir=.
InputPath=".\zend-parser.y"
BuildCmds= \
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-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
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
@@ -299,7 +300,8 @@ InputDir=.
InputPath=".\zend-parser.y"
BuildCmds= \
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-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
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
+4 -2
View File
@@ -287,7 +287,8 @@ InputDir=.
InputPath=".\zend-parser.y"
BuildCmds= \
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-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
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
@@ -303,7 +304,8 @@ InputDir=.
InputPath=".\zend-parser.y"
BuildCmds= \
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-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
"$(InputDir)\zend-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
+29 -25
View File
@@ -56,7 +56,7 @@
%left '|'
%left '^'
%left '&'
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL
%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL
%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL
%left T_SL T_SR
%left '+' '-' '.'
@@ -368,20 +368,20 @@ non_empty_for_expr:
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 CLS_CC); do_assign(&$$, &$1, &$3 CLS_CC); }
| cvar '=' '&' w_cvar { do_end_variable_parse(BP_VAR_W CLS_CC); do_assign_ref(&$$, &$1, &$4 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); }
| 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 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 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 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 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 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 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 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 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_BW_OR, &$$, &$1, &$3 CLS_CC); }
| cvar XT_OR_EQUAL expr { do_end_variable_parse(BP_VAR_RW 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 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 CLS_CC); do_binary_assign_op(ZEND_ASSIGN_SR, &$$, &$1, &$3 CLS_CC); }
| 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 XT_OR_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); }
@@ -406,6 +406,7 @@ expr_without_variable:
| '-' 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_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); }
@@ -510,17 +511,17 @@ expr:
r_cvar:
cvar { do_end_variable_parse(BP_VAR_R CLS_CC); $$ = $1; }
cvar { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
;
w_cvar:
cvar { do_end_variable_parse(BP_VAR_W CLS_CC); $$ = $1; }
cvar { do_end_variable_parse(BP_VAR_W, 0 CLS_CC); $$ = $1; }
;
rw_cvar:
cvar { do_end_variable_parse(BP_VAR_RW CLS_CC); $$ = $1; }
cvar { do_end_variable_parse(BP_VAR_RW, 0 CLS_CC); $$ = $1; }
;
@@ -573,7 +574,7 @@ object_property:
scalar_object_property:
T_STRING { $$ = $1; }
| '{' expr '}' { $$ = $2; }
| cvar_without_objects { do_end_variable_parse(BP_VAR_R CLS_CC); $$ = $1; }
| cvar_without_objects { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
;
@@ -602,20 +603,23 @@ assignment_list_element:
array_pair_list:
/* empty */ { do_init_array(&$$, NULL, NULL CLS_CC); }
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
| non_empty_array_pair_list { $$ = $1; }
;
non_empty_array_pair_list:
non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { do_add_array_element(&$$, &$5, &$3 CLS_CC); }
| non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL CLS_CC); }
| expr T_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1 CLS_CC); }
| expr { do_init_array(&$$, &$1, NULL CLS_CC); }
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 CLS_CC); do_add_variable(&$$, &$1, &$2 CLS_CC); }
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); }
+4
View File
@@ -823,6 +823,10 @@ ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
return T_DEC;
}
<ST_IN_SCRIPTING>"===" {
return T_IS_IDENTICAL;
}
<ST_IN_SCRIPTING>"==" {
return T_IS_EQUAL;
}
+8 -10
View File
@@ -96,8 +96,8 @@ typedef unsigned char zend_bool;
#include "zend_hash.h"
#include "zend_llist.h"
#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, HashTable *list, HashTable *plist, zval *this_ptr
#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, list, plist, this_ptr
#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, HashTable *list, HashTable *plist, zval *this_ptr, int return_value_used
#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, list, plist, this_ptr, return_value_used
/*
* zval
@@ -125,10 +125,7 @@ struct _zval_struct {
/* Variable information */
zvalue_value value; /* value */
unsigned char type; /* active type */
struct {
unsigned int locks:7;
unsigned int is_ref:1;
} EA;
unsigned char is_ref;
short refcount;
};
@@ -154,6 +151,8 @@ typedef struct _zend_overloaded_element {
zval element;
} zend_overloaded_element;
/* excpt.h on Digital Unix 4.0 defines function_table */
#undef function_table
struct _zend_class_entry {
char type;
@@ -161,6 +160,7 @@ struct _zend_class_entry {
uint name_length;
struct _zend_class_entry *parent;
int *refcount;
zend_bool constants_updated;
HashTable function_table;
HashTable default_properties;
@@ -268,8 +268,7 @@ extern zend_utility_values zend_uv;
#define INIT_PZVAL(z) \
(z)->refcount = 1; \
(z)->EA.is_ref = 0; \
(z)->EA.locks = 0;
(z)->is_ref = 0;
#define MAKE_STD_ZVAL(zv) \
zv = (zval *) emalloc(sizeof(zval)); \
@@ -285,8 +284,7 @@ extern zend_utility_values zend_uv;
**(ppzv) = *orig_ptr; \
zval_copy_ctor(*(ppzv)); \
(*(ppzv))->refcount=1; \
(*(ppzv))->EA.is_ref = 0; \
(*(ppzv))->EA.locks = 0; \
(*(ppzv))->is_ref = 0; \
} \
}
+88 -16
View File
@@ -199,21 +199,17 @@ ZEND_API inline int array_init(zval *arg)
}
static void zval_update_const_and_ref(zval **p)
{
zval_update_constant(*p);
zval_add_ref(p);
}
ZEND_API inline int object_init_ex(zval *arg, zend_class_entry *class_type)
{
zval *tmp;
if (!class_type->constants_updated) {
zend_hash_apply(&class_type->default_properties, (int (*)(void *)) zval_update_constant);
class_type->constants_updated = 1;
}
arg->value.obj.properties = (HashTable *) emalloc(sizeof(HashTable));
zend_hash_init(arg->value.obj.properties, 0, NULL, PVAL_PTR_DTOR, 0);
zend_hash_copy(arg->value.obj.properties, &class_type->default_properties, (void (*)(void *)) zval_update_const_and_ref, (void *) &tmp, sizeof(zval *));
zend_hash_copy(arg->value.obj.properties, &class_type->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *));
arg->type = IS_OBJECT;
arg->value.obj.ce = class_type;
return SUCCESS;
@@ -226,6 +222,13 @@ ZEND_API inline int object_init(zval *arg)
}
ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
{
zend_error(E_WARNING, "add_assoc_function() is no longer supported");
return FAILURE;
}
ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
@@ -237,6 +240,28 @@ ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
}
ZEND_API inline int add_assoc_bool(zval *arg, char *key, int b)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
tmp->type = IS_BOOL;
tmp->value.lval = b;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_resource(zval *arg, char *key, int r)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
@@ -280,13 +305,6 @@ ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint leng
}
ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS))
{
zend_error(E_WARNING, "add_assoc_function() is no longer supported");
return FAILURE;
}
ZEND_API inline int add_index_long(zval *arg, uint index, long n)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
@@ -298,6 +316,28 @@ ZEND_API inline int add_index_long(zval *arg, uint index, long n)
}
ZEND_API inline int add_index_bool(zval *arg, uint index, int b)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
tmp->type = IS_BOOL;
tmp->value.lval = b;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}
ZEND_API inline int add_index_resource(zval *arg, uint index, int r)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}
ZEND_API inline int add_index_double(zval *arg, uint index, double d)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
@@ -352,6 +392,28 @@ ZEND_API inline int add_next_index_long(zval *arg, long n)
}
ZEND_API inline int add_next_index_bool(zval *arg, int b)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
tmp->type = IS_BOOL;
tmp->value.lval = b;
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_next_index_resource(zval *arg, int r)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_next_index_double(zval *arg, double d)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
@@ -491,6 +553,16 @@ ZEND_API inline int add_property_long(zval *arg, char *key, long n)
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_resource(zval *arg, char *key, long n)
{
zval *tmp = (zval *) emalloc(sizeof(zval));
tmp->type = IS_RESOURCE;
tmp->value.lval = n;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_double(zval *arg, char *key, double d)
{
+21 -10
View File
@@ -80,6 +80,7 @@ ZEND_API void wrong_param_count(void);
#define BYREF_NONE 0
#define BYREF_FORCE 1
#define BYREF_ALLOW 2
#define BYREF_FORCE_REST 3
#if !(WIN32||WINNT)
#define DLEXPORT
@@ -90,32 +91,43 @@ int zend_startup_module(zend_module_entry *module);
ZEND_API int array_init(zval *arg);
ZEND_API int object_init(zval *arg);
ZEND_API int object_init_ex(zval *arg, zend_class_entry *ce);
/* no longer supported */
ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
ZEND_API int add_assoc_long(zval *arg, char *key, long n);
ZEND_API int add_assoc_bool(zval *arg, char *key, int b);
ZEND_API int add_assoc_resource(zval *arg, char *key, int r);
ZEND_API int add_assoc_double(zval *arg, char *key, double d);
ZEND_API int add_assoc_string(zval *arg, char *key, char *str, int duplicate);
ZEND_API int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
ZEND_API int add_index_long(zval *arg, uint idx, long n);
ZEND_API int add_index_bool(zval *arg, uint idx, int b);
ZEND_API int add_index_resource(zval *arg, uint idx, int r);
ZEND_API int add_index_double(zval *arg, uint idx, double d);
ZEND_API int add_index_string(zval *arg, uint idx, char *str, int duplicate);
ZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int duplicate);
ZEND_API int add_next_index_long(zval *arg, long n);
ZEND_API int add_next_index_bool(zval *arg, int b);
ZEND_API int add_next_index_resource(zval *arg, int r);
ZEND_API int add_next_index_double(zval *arg, double d);
ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate);
ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate);
ZEND_API int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate);
ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate);
ZEND_API int add_get_index_long(zval *arg, uint idx, long l, void **dest);
ZEND_API int add_get_index_double(zval *arg, uint idx, double d, void **dest);
ZEND_API int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate);
ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate);
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, int param_count, zval *params[]);
ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval, int param_count, zval **params[], int no_separation);
ZEND_API int add_property_long(zval *arg, char *key, long l);
ZEND_API int add_property_resource(zval *arg, char *key, long r);
ZEND_API int add_property_double(zval *arg, char *key, double d);
ZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate);
ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
@@ -241,16 +253,15 @@ ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length,
\
if (zend_hash_find(symtable, (name), (name_length), (void **) &orig_var)==SUCCESS \
&& PZVAL_IS_REF(*orig_var)) { \
var->refcount = (*orig_var)->refcount; \
var->EA.locks = (*orig_var)->EA.locks; \
var->EA.is_ref = 1; \
(var)->refcount = (*orig_var)->refcount; \
(var)->is_ref = 1; \
\
zval_dtor(*orig_var); \
**orig_var = *var; \
**orig_var = *(var); \
efree(var); \
} else { \
INIT_PZVAL(var); \
zend_hash_update(symtable, (name), (name_length), &var, sizeof(zval *), NULL); \
INIT_PZVAL((var)); \
zend_hash_update(symtable, (name), (name_length), &(var), sizeof(zval *), NULL); \
} \
}
+50 -51
View File
@@ -179,14 +179,14 @@ ZEND_FUNCTION(strlen)
Binary safe string comparison */
ZEND_FUNCTION(strcmp)
{
zval *s1,*s2;
zval **s1, **s2;
if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &s1, &s2) == FAILURE) {
if (ARG_COUNT(ht) != 2 || getParametersEx(2, &s1, &s2) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string(s1);
convert_to_string(s2);
RETURN_LONG(zend_binary_strcmp(s1,s2));
convert_to_string_ex(s1);
convert_to_string_ex(s2);
RETURN_LONG(zend_binary_strcmp(*s1,*s2));
}
/* }}} */
@@ -194,29 +194,29 @@ ZEND_FUNCTION(strcmp)
Binary safe case-insensitive string comparison */
ZEND_FUNCTION(strcasecmp)
{
zval *s1,*s2;
zval **s1, **s2;
if (ARG_COUNT(ht)!=2 || getParameters(ht, 2, &s1, &s2) == FAILURE) {
if (ARG_COUNT(ht)!=2 || getParametersEx(2, &s1, &s2) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string(s1);
convert_to_string(s2);
RETURN_LONG(zend_binary_strcasecmp(s1, s2));
convert_to_string_ex(s1);
convert_to_string_ex(s2);
RETURN_LONG(zend_binary_strcasecmp(*s1, *s2));
}
/* }}} */
ZEND_FUNCTION(each)
{
zval *array,*entry,**entry_ptr, *tmp;
zval **array,*entry,**entry_ptr, *tmp;
char *string_key;
ulong num_key;
zval **inserted_pointer;
HashTable *target_hash;
if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &array) == FAILURE) {
if (ARG_COUNT(ht) != 1 || getParametersEx(1, &array) == FAILURE) {
WRONG_PARAM_COUNT;
}
target_hash = HASH_OF(array);
target_hash = HASH_OF(*array);
if (!target_hash) {
zend_error(E_WARNING,"Variable passed to each() is not an array or object");
return;
@@ -228,12 +228,11 @@ ZEND_FUNCTION(each)
entry = *entry_ptr;
/* add value elements */
if (entry->EA.is_ref) {
if (entry->is_ref) {
tmp = (zval *)emalloc(sizeof(zval));
*tmp = *entry;
zval_copy_ctor(tmp);
tmp->EA.is_ref=0;
tmp->EA.locks = 0;
tmp->is_ref=0;
tmp->refcount=0;
entry=tmp;
}
@@ -258,7 +257,7 @@ ZEND_FUNCTION(each)
ZEND_FUNCTION(error_reporting)
{
zval *arg;
zval **arg;
int old_error_reporting;
ELS_FETCH();
@@ -267,11 +266,11 @@ ZEND_FUNCTION(error_reporting)
case 0:
break;
case 1:
if (getParameters(ht,1,&arg) == FAILURE) {
if (getParametersEx(1,&arg) == FAILURE) {
RETURN_FALSE;
}
convert_to_long(arg);
EG(error_reporting)=arg->value.lval;
convert_to_long_ex(arg);
EG(error_reporting)=(*arg)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -283,24 +282,24 @@ ZEND_FUNCTION(error_reporting)
ZEND_FUNCTION(define)
{
zval *var, *val, *non_cs;
zval **var, **val, **non_cs;
int case_sensitive;
zend_constant c;
ELS_FETCH();
switch(ARG_COUNT(ht)) {
case 2:
if (getParameters(ht, 2, &var, &val)==FAILURE) {
if (getParametersEx(2, &var, &val)==FAILURE) {
RETURN_FALSE;
}
case_sensitive = CONST_CS;
break;
case 3:
if (getParameters(ht, 3, &var, &val, &non_cs)==FAILURE) {
if (getParametersEx(3, &var, &val, &non_cs)==FAILURE) {
RETURN_FALSE;
}
convert_to_long(non_cs);
if (non_cs->value.lval) {
convert_to_long_ex(non_cs);
if ((*non_cs)->value.lval) {
case_sensitive = 0;
} else {
case_sensitive = CONST_CS;
@@ -310,7 +309,7 @@ ZEND_FUNCTION(define)
WRONG_PARAM_COUNT;
break;
}
switch(val->type) {
switch((*val)->type) {
case IS_LONG:
case IS_DOUBLE:
case IS_STRING:
@@ -322,13 +321,13 @@ ZEND_FUNCTION(define)
RETURN_FALSE;
break;
}
convert_to_string(var);
convert_to_string_ex(var);
c.value = *val;
c.value = **val;
zval_copy_ctor(&c.value);
c.flags = case_sensitive | ~CONST_PERSISTENT; /* non persistent */
c.name = zend_strndup(var->value.str.val, var->value.str.len);
c.name_len = var->value.str.len+1;
c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
c.name_len = (*var)->value.str.len+1;
zend_register_constant(&c ELS_CC);
RETURN_TRUE;
}
@@ -336,15 +335,15 @@ ZEND_FUNCTION(define)
ZEND_FUNCTION(defined)
{
zval *var;
zval **var;
zval c;
if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &var)==FAILURE) {
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &var)==FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string(var);
if (zend_get_constant(var->value.str.val, var->value.str.len, &c)) {
convert_to_string_ex(var);
if (zend_get_constant((*var)->value.str.val, (*var)->value.str.len, &c)) {
zval_dtor(&c);
RETURN_LONG(1);
} else {
@@ -357,15 +356,15 @@ ZEND_FUNCTION(defined)
*/
ZEND_FUNCTION(get_class)
{
zval *arg;
zval **arg;
if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &arg)==FAILURE) {
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &arg)==FAILURE) {
RETURN_FALSE;
}
if (arg->type != IS_OBJECT) {
if ((*arg)->type != IS_OBJECT) {
RETURN_FALSE;
}
RETURN_STRINGL(arg->value.obj.ce->name, arg->value.obj.ce->name_length, 1);
RETURN_STRINGL((*arg)->value.obj.ce->name, (*arg)->value.obj.ce->name_length, 1);
}
/* }}} */
@@ -374,15 +373,15 @@ ZEND_FUNCTION(get_class)
*/
ZEND_FUNCTION(get_parent_class)
{
zval *arg;
zval **arg;
if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &arg)==FAILURE) {
if (ARG_COUNT(ht)!=1 || getParametersEx(1, &arg)==FAILURE) {
RETURN_FALSE;
}
if ((arg->type != IS_OBJECT) || !arg->value.obj.ce->parent) {
if (((*arg)->type != IS_OBJECT) || !(*arg)->value.obj.ce->parent) {
RETURN_FALSE;
}
RETURN_STRINGL(arg->value.obj.ce->parent->name, arg->value.obj.ce->parent->name_length, 1);
RETURN_STRINGL((*arg)->value.obj.ce->parent->name, (*arg)->value.obj.ce->parent->name_length, 1);
}
/* }}} */
@@ -391,16 +390,16 @@ ZEND_FUNCTION(get_parent_class)
*/
ZEND_FUNCTION(method_exists)
{
zval *arg1, *arg2;
zval **arg1, **arg2;
if (ARG_COUNT(ht)!=2 || getParameters(ht, 2, &arg1, &arg2)==FAILURE) {
if (ARG_COUNT(ht)!=2 || getParametersEx(2, &arg1, &arg2)==FAILURE) {
RETURN_FALSE;
}
if (arg1->type != IS_OBJECT) {
if ((*arg1)->type != IS_OBJECT) {
RETURN_FALSE;
}
convert_to_string(arg2);
if(zend_hash_exists(&arg1->value.obj.ce->function_table, arg2->value.str.val, arg2->value.str.len+1)) {
convert_to_string_ex(arg2);
if(zend_hash_exists(&(*arg1)->value.obj.ce->function_table, (*arg2)->value.str.val, (*arg2)->value.str.len+1)) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -411,12 +410,12 @@ ZEND_FUNCTION(method_exists)
ZEND_FUNCTION(leak)
{
int leakbytes=3;
zval *leak;
zval **leak;
if (ARG_COUNT(ht)>=1) {
if (getParameters(ht, 1, &leak)==SUCCESS) {
convert_to_long(leak);
leakbytes = leak->value.lval;
if (getParametersEx(1, &leak)==SUCCESS) {
convert_to_long_ex(leak);
leakbytes = (*leak)->value.lval;
}
}
+30 -15
View File
@@ -503,12 +503,11 @@ void do_begin_variable_parse(CLS_D)
}
void do_end_variable_parse(int type CLS_DC)
void do_end_variable_parse(int type, int arg_offset CLS_DC)
{
zend_llist *fetch_list_ptr;
zend_llist_element *le;
zend_op *opline, *opline_ptr;
int last_temp_var=-1;
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
@@ -532,6 +531,11 @@ void do_end_variable_parse(int type CLS_DC)
break;
case BP_VAR_IS:
opline->opcode += 6; /* 3+3 */
break;
case BP_VAR_FUNC_ARG:
opline->opcode += 9; /* 3+3+3 */
opline->extended_value = arg_offset;
break;
}
le = le->next;
}
@@ -618,11 +622,17 @@ void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC)
void 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);
zend_op *last_opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
opline->opcode = ZEND_FREE;
opline->op1 = *op1;
SET_UNUSED(opline->op2);
if ((last_opline->opcode == ZEND_DO_FCALL) || (last_opline->opcode == ZEND_DO_FCALL_BY_NAME)) {
last_opline->result.u.EA.type |= EXT_TYPE_UNUSED;
} else {
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
opline->opcode = ZEND_FREE;
opline->op1 = *op1;
SET_UNUSED(opline->op2);
}
} else if (op1->op_type==IS_VAR) {
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
@@ -855,8 +865,9 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
break;
}
}
if (arg_types && offset<=arg_types[0]
&& arg_types[offset]==BYREF_FORCE) {
if (ARG_SHOULD_BE_SENT_BY_REF(offset, 1, arg_types)) {
/* change to passing by reference */
switch (param->op_type) {
case IS_VAR:
@@ -872,13 +883,13 @@ void do_pass_param(znode *param, int op, int offset CLS_DC)
switch(op) {
case ZEND_SEND_VAR:
if (function_ptr) {
do_end_variable_parse(BP_VAR_R CLS_CC);
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
} else {
do_end_variable_parse(BP_VAR_W CLS_CC);
do_end_variable_parse(BP_VAR_FUNC_ARG, offset CLS_CC);
}
break;
case ZEND_SEND_REF:
do_end_variable_parse(BP_VAR_W CLS_CC);
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
break;
}
}
@@ -1373,6 +1384,7 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
CG(class_entry).name_length = class_name->u.constant.value.str.len;
CG(class_entry).refcount = (int *) emalloc(sizeof(int));
*CG(class_entry).refcount = 1;
CG(class_entry).constants_updated = 0;
zend_str_tolower(CG(class_entry).name, CG(class_entry).name_length);
@@ -1597,7 +1609,7 @@ void do_shell_exec(znode *result, znode *cmd CLS_DC)
void do_init_array(znode *result, znode *expr, znode *offset CLS_DC)
void 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);
@@ -1616,10 +1628,11 @@ void do_init_array(znode *result, znode *expr, znode *offset CLS_DC)
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
}
opline->extended_value = is_ref;
}
void do_add_array_element(znode *result, znode *expr, znode *offset CLS_DC)
void 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);
@@ -1631,6 +1644,7 @@ void do_add_array_element(znode *result, znode *expr, znode *offset CLS_DC)
} else {
SET_UNUSED(opline->op2);
}
opline->extended_value = is_ref;
}
@@ -1820,7 +1834,7 @@ void do_indirect_references(znode *result, znode *num_references, znode *variabl
{
int i;
do_end_variable_parse(BP_VAR_R CLS_CC);
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;
@@ -1853,7 +1867,7 @@ void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
{
zend_op *opline;
do_end_variable_parse(BP_VAR_IS CLS_CC);
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;
@@ -1951,6 +1965,7 @@ void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC)
opline->opcode = ZEND_JMP;
opline->op1.u.opline_num = foreach_token->u.opline_num;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
CG(active_op_array)->opcodes[foreach_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
+143 -98
View File
@@ -94,6 +94,7 @@ struct _zend_op_array {
int type; /* MUST be the first element of this struct! */
unsigned char *arg_types; /* MUST be the second element of this struct! */
char *function_name; /* MUST be the third element of this struct! */
int *refcount;
@@ -102,7 +103,6 @@ struct _zend_op_array {
int T;
char *function_name;
zend_brk_cont_element *brk_cont_array;
int last_brk_cont;
@@ -126,9 +126,9 @@ typedef struct _zend_internal_function {
int type; /* MUST be the first element of this struct! */
unsigned char *arg_types; /* MUST be the second element of this struct */
char *function_name; /* MUST be the third element of this struct */
void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
char *function_name;
} zend_internal_function;
@@ -137,6 +137,7 @@ typedef union _zend_function {
struct {
int type; /* never used */
unsigned char *arg_types;
char *function_name;
} common;
zend_op_array op_array;
@@ -250,7 +251,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 do_begin_variable_parse(CLS_D);
void do_end_variable_parse(int type CLS_DC);
void do_end_variable_parse(int type, int arg_offset CLS_DC);
void do_free(znode *op1 CLS_DC);
@@ -304,8 +305,8 @@ void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
void do_shell_exec(znode *result, znode *cmd CLS_DC);
void do_init_array(znode *result, znode *expr, znode *offset CLS_DC);
void do_add_array_element(znode *result, znode *expr, znode *offset 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();
void do_list_end(znode *result, znode *expr CLS_DC);
@@ -349,7 +350,7 @@ ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ..
ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count, va_list files);
ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
ZEND_API zend_op_array *compile_filename(zval *filename CLS_DC);
ZEND_API inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
ZEND_API void init_op_array(zend_op_array *op_array, int initial_ops_size);
ZEND_API void destroy_op_array(zend_op_array *op_array);
ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC);
@@ -394,112 +395,116 @@ int zendlex(znode *zendlval CLS_DC);
#define ZEND_BW_NOT 12
#define ZEND_BOOL_NOT 13
#define ZEND_BOOL_XOR 14
#define ZEND_IS_EQUAL 15
#define ZEND_IS_NOT_EQUAL 16
#define ZEND_IS_SMALLER 17
#define ZEND_IS_SMALLER_OR_EQUAL 18
#define ZEND_CAST 19
#define ZEND_QM_ASSIGN 20
#define ZEND_IS_IDENTICAL 15
#define ZEND_IS_EQUAL 16
#define ZEND_IS_NOT_EQUAL 17
#define ZEND_IS_SMALLER 18
#define ZEND_IS_SMALLER_OR_EQUAL 19
#define ZEND_CAST 20
#define ZEND_QM_ASSIGN 21
#define ZEND_ASSIGN_ADD 21
#define ZEND_ASSIGN_SUB 22
#define ZEND_ASSIGN_MUL 23
#define ZEND_ASSIGN_DIV 24
#define ZEND_ASSIGN_MOD 25
#define ZEND_ASSIGN_SL 26
#define ZEND_ASSIGN_SR 27
#define ZEND_ASSIGN_CONCAT 28
#define ZEND_ASSIGN_BW_OR 29
#define ZEND_ASSIGN_BW_AND 30
#define ZEND_ASSIGN_BW_XOR 31
#define ZEND_ASSIGN_ADD 22
#define ZEND_ASSIGN_SUB 23
#define ZEND_ASSIGN_MUL 24
#define ZEND_ASSIGN_DIV 25
#define ZEND_ASSIGN_MOD 26
#define ZEND_ASSIGN_SL 27
#define ZEND_ASSIGN_SR 28
#define ZEND_ASSIGN_CONCAT 29
#define ZEND_ASSIGN_BW_OR 30
#define ZEND_ASSIGN_BW_AND 31
#define ZEND_ASSIGN_BW_XOR 32
#define ZEND_PRE_INC 32
#define ZEND_PRE_DEC 33
#define ZEND_POST_INC 34
#define ZEND_POST_DEC 35
#define ZEND_PRE_INC 33
#define ZEND_PRE_DEC 34
#define ZEND_POST_INC 35
#define ZEND_POST_DEC 36
#define ZEND_ASSIGN 36
#define ZEND_ASSIGN_REF 37
#define ZEND_ASSIGN 37
#define ZEND_ASSIGN_REF 38
#define ZEND_ECHO 38
#define ZEND_PRINT 39
#define ZEND_ECHO 39
#define ZEND_PRINT 40
#define ZEND_JMP 40
#define ZEND_JMPZ 41
#define ZEND_JMPNZ 42
#define ZEND_JMPZNZ 43
#define ZEND_JMPZ_EX 44
#define ZEND_JMPNZ_EX 45
#define ZEND_CASE 46
#define ZEND_SWITCH_FREE 47
#define ZEND_BRK 48
#define ZEND_CONT 49
#define ZEND_BOOL 50
#define ZEND_JMP 41
#define ZEND_JMPZ 42
#define ZEND_JMPNZ 43
#define ZEND_JMPZNZ 44
#define ZEND_JMPZ_EX 45
#define ZEND_JMPNZ_EX 46
#define ZEND_CASE 47
#define ZEND_SWITCH_FREE 48
#define ZEND_BRK 49
#define ZEND_CONT 50
#define ZEND_BOOL 51
#define ZEND_INIT_STRING 51
#define ZEND_ADD_CHAR 52
#define ZEND_ADD_STRING 53
#define ZEND_ADD_VAR 54
#define ZEND_INIT_STRING 52
#define ZEND_ADD_CHAR 53
#define ZEND_ADD_STRING 54
#define ZEND_ADD_VAR 55
#define ZEND_BEGIN_SILENCE 55
#define ZEND_END_SILENCE 56
#define ZEND_BEGIN_SILENCE 56
#define ZEND_END_SILENCE 57
#define ZEND_INIT_FCALL_BY_NAME 57
#define ZEND_DO_FCALL 58
#define ZEND_DO_FCALL_BY_NAME 59
#define ZEND_RETURN 60
#define ZEND_INIT_FCALL_BY_NAME 58
#define ZEND_DO_FCALL 59
#define ZEND_DO_FCALL_BY_NAME 60
#define ZEND_RETURN 61
#define ZEND_RECV 61
#define ZEND_RECV_INIT 62
#define ZEND_RECV 62
#define ZEND_RECV_INIT 63
#define ZEND_SEND_VAL 63
#define ZEND_SEND_VAR 64
#define ZEND_SEND_REF 65
#define ZEND_SEND_VAL 64
#define ZEND_SEND_VAR 65
#define ZEND_SEND_REF 66
#define ZEND_NEW 66
#define ZEND_JMP_NO_CTOR 67
#define ZEND_FREE 68
#define ZEND_NEW 67
#define ZEND_JMP_NO_CTOR 68
#define ZEND_FREE 69
#define ZEND_INIT_ARRAY 69
#define ZEND_ADD_ARRAY_ELEMENT 70
#define ZEND_INIT_ARRAY 70
#define ZEND_ADD_ARRAY_ELEMENT 71
#define ZEND_INCLUDE_OR_EVAL 71
#define ZEND_INCLUDE_OR_EVAL 72
#define ZEND_UNSET_VAR 72
#define ZEND_UNSET_DIM_OBJ 73
#define ZEND_ISSET_ISEMPTY 74
#define ZEND_UNSET_VAR 73
#define ZEND_UNSET_DIM_OBJ 74
#define ZEND_ISSET_ISEMPTY 75
#define ZEND_FE_RESET 75
#define ZEND_FE_FETCH 76
#define ZEND_FE_RESET 76
#define ZEND_FE_FETCH 77
#define ZEND_EXIT 77
#define ZEND_EXIT 78
/* the following 12 opcodes are 4 groups of 3 opcodes each, and must
/* the following 15 opcodes are 5 groups of 3 opcodes each, and must
* remain in that order!
*/
#define ZEND_FETCH_R 78
#define ZEND_FETCH_DIM_R 79
#define ZEND_FETCH_OBJ_R 80
#define ZEND_FETCH_W 81
#define ZEND_FETCH_DIM_W 82
#define ZEND_FETCH_OBJ_W 83
#define ZEND_FETCH_RW 84
#define ZEND_FETCH_DIM_RW 85
#define ZEND_FETCH_OBJ_RW 86
#define ZEND_FETCH_IS 87
#define ZEND_FETCH_DIM_IS 88
#define ZEND_FETCH_OBJ_IS 89
#define ZEND_FETCH_R 79
#define ZEND_FETCH_DIM_R 80
#define ZEND_FETCH_OBJ_R 81
#define ZEND_FETCH_W 82
#define ZEND_FETCH_DIM_W 83
#define ZEND_FETCH_OBJ_W 84
#define ZEND_FETCH_RW 85
#define ZEND_FETCH_DIM_RW 86
#define ZEND_FETCH_OBJ_RW 87
#define ZEND_FETCH_IS 88
#define ZEND_FETCH_DIM_IS 89
#define ZEND_FETCH_OBJ_IS 90
#define ZEND_FETCH_FUNC_ARG 91
#define ZEND_FETCH_DIM_FUNC_ARG 92
#define ZEND_FETCH_OBJ_FUNC_ARG 93
#define ZEND_FETCH_DIM_TMP_VAR 90
#define ZEND_FETCH_CONSTANT 91
#define ZEND_FETCH_DIM_TMP_VAR 94
#define ZEND_FETCH_CONSTANT 95
#define ZEND_DECLARE_FUNCTION_OR_CLASS 92
#define ZEND_DECLARE_FUNCTION_OR_CLASS 96
#define ZEND_EXT_STMT 93
#define ZEND_EXT_FCALL_BEGIN 94
#define ZEND_EXT_FCALL_END 95
#define ZEND_EXT_NOP 96
#define ZEND_EXT_STMT 97
#define ZEND_EXT_FCALL_BEGIN 98
#define ZEND_EXT_FCALL_END 99
#define ZEND_EXT_NOP 100
/* end of block */
@@ -512,11 +517,12 @@ int zendlex(znode *zendlval CLS_DC);
#define ZEND_FETCH_STATIC 2
/* var status for backpatching */
#define BP_VAR_R 0
#define BP_VAR_W 1
#define BP_VAR_RW 2
#define BP_VAR_IS 3
#define BP_VAR_NA 4 /* if not applicable */
#define BP_VAR_R 0
#define BP_VAR_W 1
#define BP_VAR_RW 2
#define BP_VAR_IS 3
#define BP_VAR_NA 4 /* if not applicable */
#define BP_VAR_FUNC_ARG 5
#define ZEND_INTERNAL_FUNCTION 1
@@ -553,12 +559,51 @@ int zendlex(znode *zendlval CLS_DC);
#define ZEND_CTOR_CALL 1<<1
#define PZVAL_IS_REF(z) ((z)->EA.is_ref)
#define PZVAL_IS_LOCKED(z) ((z)->EA.locks>0)
#define AI_USE_PTR(ai) \
if ((ai).ptr_ptr) { \
(ai).ptr = *((ai).ptr_ptr); \
(ai).ptr_ptr = &((ai).ptr); \
} else { \
(ai).ptr = NULL; \
}
#define PZVAL_IS_REF(z) ((z)->is_ref)
#define PZVAL_LOCK(z) ((z)->refcount++)
#define PZVAL_UNLOCK(z) { ((z)->refcount--); \
if (!(z)->refcount) { \
EG(garbage)[EG(garbage_ptr)++] = (z); \
if (EG(garbage_ptr) == 4) { \
zval_dtor(EG(garbage)[0]); \
efree(EG(garbage)[0]); \
zval_dtor(EG(garbage)[1]); \
efree(EG(garbage)[1]); \
EG(garbage)[0] = EG(garbage)[2]; \
EG(garbage)[1] = EG(garbage)[3]; \
EG(garbage_ptr) -= 2; \
} \
} \
}
#define PZVAL_LOCK(z) (z)->EA.locks++
#define PZVAL_UNLOCK(z) (z)->EA.locks--
#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
/* Lost In Stupid Parentheses */
#define ARG_SHOULD_BE_SENT_BY_REF(offset, conduct_check, arg_types) \
( \
conduct_check \
&& arg_types \
&& \
( \
( \
offset<=arg_types[0] \
&& arg_types[offset]==BYREF_FORCE \
) \
|| ( \
offset>=arg_types[0] \
&& arg_types[arg_types[0]]==BYREF_FORCE_REST \
) \
) \
)
#endif /* _COMPILE_H */
-43
View File
@@ -1,43 +0,0 @@
#! /bin/sh
#
# $Id$
#
# Written by Sascha Schumann <sascha@schumann.cx>
# taken from autoconf
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
ac_n= ac_c='
' ac_t=' '
else
ac_n=-n ac_c= ac_t=
fi
else
ac_n= ac_c='\c' ac_t=
fi
flags_libs="@LIBS@"
flags_ldflags="@LDFLAGS@"
flags_cflags="@CPPFLAGS@ @CFLAGS@"
case "$1" in
--ldflags)
echo $ac_n "$flags_ldflags$ac_c"
;;
--cflags)
echo $ac_n "$flags_cflags$ac_c"
;;
--libs)
echo $ac_n "$flags_libs$ac_c"
;;
*)
echo "$0 [--libs|--cflags|--ldflags]"
exit 1
;;
esac
exit 0
+1
View File
@@ -39,6 +39,7 @@ typedef unsigned int uint;
#define HAVE_STRDUP 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIOSTR_H 1
#define HAVE_CLASS_ISTDIOSTREAM
#define istdiostream stdiostream
#ifdef inline
+186 -155
View File
@@ -69,6 +69,13 @@ static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_o
static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array);
#define SEPARATE_ON_READ_OBJECT(obj, _type) \
if ((obj) && ((_type) == BP_VAR_R) && ((*(obj))->type == IS_OBJECT) && (!(*(obj))->is_ref)) { \
SEPARATE_ZVAL((obj)); \
(*(obj))->is_ref = 1; \
}
static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_free ELS_DC)
{
switch(node->op_type) {
@@ -81,10 +88,10 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
return &Ts[node->u.var].tmp_var;
break;
case IS_VAR:
if (Ts[node->u.var].var.ptr_ptr) {
PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr);
if (Ts[node->u.var].var.ptr) {
PZVAL_UNLOCK(Ts[node->u.var].var.ptr);
*should_free = 0;
return *Ts[node->u.var].var.ptr_ptr;
return Ts[node->u.var].var.ptr;
} else {
*should_free = 1;
@@ -92,8 +99,7 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
case IS_OVERLOADED_OBJECT:
Ts[node->u.var].tmp_var = get_overloaded_property(ELS_C);
Ts[node->u.var].tmp_var.refcount=1;
Ts[node->u.var].tmp_var.EA.is_ref=1;
Ts[node->u.var].tmp_var.EA.locks=0;
Ts[node->u.var].tmp_var.is_ref=1;
return &Ts[node->u.var].tmp_var;
break;
case IS_STRING_OFFSET: {
@@ -110,10 +116,9 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
T->tmp_var.value.str.val = estrndup(&c, 1);
T->tmp_var.value.str.len = 1;
}
zval_ptr_dtor(&str);
PZVAL_UNLOCK(str);
T->tmp_var.refcount=1;
T->tmp_var.EA.is_ref=1;
T->tmp_var.EA.locks=0;
T->tmp_var.is_ref=1;
T->tmp_var.type = IS_STRING;
return &T->tmp_var;
}
@@ -134,44 +139,27 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
return NULL;
}
static inline zval **_get_zval_ptr_ptr(znode *node, temp_variable *Ts ELS_DC)
{
switch(node->op_type) {
case IS_VAR:
if (Ts[node->u.var].var.ptr_ptr) {
PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr);
}
return Ts[node->u.var].var.ptr_ptr;
break;
default:
return NULL;
break;
}
}
static inline zval *_get_object_zval_ptr(znode *node, temp_variable *Ts, int *should_free, zval ***object_ptr_ptr ELS_DC)
static inline zval *_get_object_zval_ptr(znode *node, temp_variable *Ts, int *should_free ELS_DC)
{
switch(node->op_type) {
case IS_TMP_VAR:
*should_free = 1;
*object_ptr_ptr = NULL;
return &Ts[node->u.var].tmp_var;
break;
case IS_VAR:
if (Ts[node->u.var].var.ptr_ptr) {
PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr);
if (Ts[node->u.var].var.ptr) {
PZVAL_UNLOCK(Ts[node->u.var].var.ptr);
*should_free = 0;
*object_ptr_ptr = Ts[node->u.var].var.ptr_ptr;
return **object_ptr_ptr;
return Ts[node->u.var].var.ptr;
} else {
if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) {
PZVAL_UNLOCK(Ts[node->u.var].EA.str);
}
*should_free = 1;
*object_ptr_ptr = NULL;
return NULL;
}
break;
case IS_UNUSED:
*object_ptr_ptr = NULL;
return NULL;
break;
#if DEBUG_ZEND
@@ -184,6 +172,23 @@ static inline zval *_get_object_zval_ptr(znode *node, temp_variable *Ts, int *sh
}
static inline zval **_get_zval_ptr_ptr(znode *node, temp_variable *Ts ELS_DC)
{
switch(node->op_type) {
case IS_VAR:
if (Ts[node->u.var].var.ptr_ptr) {
PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr);
} else if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) {
PZVAL_UNLOCK(Ts[node->u.var].EA.str);
}
return Ts[node->u.var].var.ptr_ptr;
break;
default:
return NULL;
break;
}
}
static inline zval **zend_fetch_property_address_inner(HashTable *ht, znode *op2, temp_variable *Ts, int type ELS_DC)
{
int free_op2;
@@ -240,8 +245,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
{
zval **variable_ptr_ptr = get_zval_ptr_ptr(op1, Ts, BP_VAR_W);
zval *variable_ptr;
int previous_lock_count;
if (!variable_ptr_ptr) {
switch (Ts[op1->u.var].EA.type) {
case IS_OVERLOADED_OBJECT:
@@ -281,13 +285,14 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
Ts[result->u.var].var = &T->EA.str;
*/
}
zval_ptr_dtor(&T->EA.str);
/* zval_ptr_dtor(&T->EA.str); Nuke this line if it doesn't cause a leak */
T->tmp_var.type = IS_STRING;
}
break;
}
Ts[result->u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*Ts[result->u.var].var.ptr_ptr, result);
AI_USE_PTR(Ts[result->u.var].var);
return;
}
@@ -297,6 +302,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (result) {
Ts[result->u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*Ts[result->u.var].var.ptr_ptr, result);
AI_USE_PTR(Ts[result->u.var].var);
}
return;
}
@@ -305,15 +311,13 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (variable_ptr!=value) {
short refcount=variable_ptr->refcount;
previous_lock_count = variable_ptr->EA.locks;
if (type!=IS_TMP_VAR) {
value->refcount++;
}
zendi_zval_dtor(*variable_ptr);
*variable_ptr = *value;
variable_ptr->refcount = refcount;
variable_ptr->EA.is_ref = 1;
variable_ptr->EA.locks = previous_lock_count;
variable_ptr->is_ref = 1;
if (type!=IS_TMP_VAR) {
zendi_zval_copy_ctor(*variable_ptr);
zval_ptr_dtor(&value);
@@ -324,15 +328,16 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (variable_ptr->refcount==0) {
switch (type) {
case IS_VAR:
/*
if (PZVAL_IS_LOCKED(value)) {
zval *orig_value = value;
value = (zval *) emalloc(sizeof(zval));
*value = *orig_value;
value->refcount=0;
value->EA.locks = 0;
zval_copy_ctor(value);
}
*/
/* break missing intentionally */
case IS_CONST:
if (variable_ptr==value) {
@@ -340,11 +345,9 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
} else if (PZVAL_IS_REF(value)) {
zval tmp = *value;
previous_lock_count = variable_ptr->EA.locks;
tmp = *value;
zval_copy_ctor(&tmp);
tmp.refcount=1;
tmp.EA.locks = previous_lock_count;
zendi_zval_dtor(*variable_ptr);
*variable_ptr = tmp;
} else {
@@ -357,23 +360,22 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
case IS_TMP_VAR:
zendi_zval_dtor(*variable_ptr);
value->refcount=1;
previous_lock_count = variable_ptr->EA.locks;
*variable_ptr = *value;
variable_ptr->EA.locks = previous_lock_count;
break;
}
} else { /* we need to split */
switch (type) {
case IS_VAR:
/*
if (PZVAL_IS_LOCKED(value)) {
zval *orig_value = value;
value = (zval *) emalloc(sizeof(zval));
*value = *orig_value;
value->refcount=0;
value->EA.locks = 0;
zval_copy_ctor(value);
}
*/
/* break missing intentionally */
case IS_CONST:
if (PZVAL_IS_REF(value)) {
@@ -381,7 +383,6 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
*variable_ptr = *value;
zval_copy_ctor(variable_ptr);
variable_ptr->refcount=1;
variable_ptr->EA.locks = 0;
break;
}
*variable_ptr_ptr = value;
@@ -390,16 +391,16 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
case IS_TMP_VAR:
(*variable_ptr_ptr) = (zval *) emalloc(sizeof(zval));
value->refcount=1;
value->EA.locks = 0;
**variable_ptr_ptr = *value;
break;
}
}
(*variable_ptr_ptr)->EA.is_ref=0;
(*variable_ptr_ptr)->is_ref=0;
}
if (result) {
Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
AI_USE_PTR(Ts[result->u.var].var);
}
}
@@ -492,13 +493,14 @@ static inline void zend_fetch_var_address(znode *result, znode *op1, znode *op2,
if (op2->u.fetch_type == ZEND_FETCH_LOCAL) {
FREE_OP(op1, free_op1);
} else if (op2->u.fetch_type == ZEND_FETCH_STATIC) {
zval_update_constant(*retval);
zval_update_constant(retval);
}
if (varname == &tmp_varname) {
zval_dtor(varname);
}
Ts[result->u.var].var.ptr_ptr = retval;
Ts[result->u.var].var.ptr_ptr = retval;
SEPARATE_ON_READ_OBJECT(retval, type);
SELECTIVE_PZVAL_LOCK(*retval, result);
}
@@ -534,10 +536,11 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, znode *op
}
break;
case IS_DOUBLE:
case IS_RESOURCE:
case IS_LONG: {
long index;
if(dim->type == IS_LONG) {
if (dim->type == IS_LONG || dim->type == IS_RESOURCE) {
index = dim->value.lval;
} else {
index = (long)dim->value.dval;
@@ -596,12 +599,14 @@ static inline void zend_fetch_dimension_address(znode *result, znode *op1, znode
case BP_VAR_R:
case BP_VAR_IS:
*retval = &EG(uninitialized_zval_ptr);
return;
break;
case BP_VAR_W:
case BP_VAR_RW:
*retval = &EG(error_zval_ptr);
return;
break;
}
SELECTIVE_PZVAL_LOCK(**retval, result);
return;
}
/* prepare the new element */
@@ -635,8 +640,7 @@ static inline void zend_fetch_dimension_address(znode *result, znode *op1, znode
container->refcount--;
if (container->refcount>0) {
container = *container_ptr = (zval *) emalloc(sizeof(zval));
container->EA.is_ref=0;
container->EA.locks = 0;
container->is_ref=0;
}
container->refcount=1;
}
@@ -663,6 +667,7 @@ static inline void zend_fetch_dimension_address(znode *result, znode *op1, znode
} else {
*retval = zend_fetch_dimension_address_inner(container->value.ht, op2, Ts, type ELS_CC);
}
SEPARATE_ON_READ_OBJECT(*retval, type);
SELECTIVE_PZVAL_LOCK(**retval, result);
break;
case IS_STRING: {
@@ -684,7 +689,7 @@ static inline void zend_fetch_dimension_address(znode *result, znode *op1, znode
offset = &tmp;
}
Ts[result->u.var].EA.str = container;
container->refcount++;
PZVAL_LOCK(container);
Ts[result->u.var].EA.offset = offset->value.lval;
Ts[result->u.var].EA.type = IS_STRING_OFFSET;
FREE_OP(op2, free_op2);
@@ -744,12 +749,14 @@ static inline void zend_fetch_property_address(znode *result, znode *op1, znode
case BP_VAR_R:
case BP_VAR_IS:
*retval = &EG(uninitialized_zval_ptr);
return;
break;
case BP_VAR_W:
case BP_VAR_RW:
*retval = &EG(error_zval_ptr);
return;
break;
}
SELECTIVE_PZVAL_LOCK(**retval, result);
return;
}
overloaded_element.element = *get_zval_ptr(op2, Ts, &free_op2, type);
@@ -804,8 +811,7 @@ static inline void zend_fetch_property_address(znode *result, znode *op1, znode
container->refcount--;
if (container->refcount>0) {
container = *container_ptr = (zval *) emalloc(sizeof(zval));
container->EA.is_ref=0;
container->EA.locks = 0;
container->is_ref=0;
}
container->refcount=1;
}
@@ -821,13 +827,11 @@ static inline void zend_fetch_property_address(znode *result, znode *op1, znode
FREE_OP(op2, free_op2);
if (type==BP_VAR_R || type==BP_VAR_IS) {
*retval = &EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(**retval, result);
return;
} else {
*retval = &EG(error_zval_ptr);
SELECTIVE_PZVAL_LOCK(**retval, result);
return;
}
SELECTIVE_PZVAL_LOCK(**retval, result);
return;
}
@@ -840,6 +844,7 @@ static inline void zend_fetch_property_address(znode *result, znode *op1, znode
zendi_zval_copy_ctor(*container);
}
*retval = zend_fetch_property_address_inner(container->value.obj.properties, op2, Ts, type ELS_CC);
SEPARATE_ON_READ_OBJECT(*retval, type);
SELECTIVE_PZVAL_LOCK(**retval, result);
}
@@ -877,7 +882,7 @@ static void call_overloaded_function(int arg_count, zval *return_value, HashTabl
zend_property_reference *property_reference;
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
(property_reference->object)->value.obj.ce->handle_function_call(arg_count, return_value, list, plist, property_reference->object, property_reference);
(property_reference->object)->value.obj.ce->handle_function_call(arg_count, return_value, list, plist, property_reference->object, 1, property_reference);
zend_llist_destroy(&property_reference->elements_list);
zend_stack_del_top(&EG(overloaded_objects_stack));
@@ -894,7 +899,6 @@ static void call_overloaded_function(int arg_count, zval *return_value, HashTabl
typedef struct _object_info {
zval *ptr;
zval **ptr_ptr;
} object_info;
void execute(zend_op_array *op_array ELS_DC)
@@ -902,8 +906,8 @@ void execute(zend_op_array *op_array ELS_DC)
zend_op *opline = op_array->opcodes;
zend_op *end = op_array->opcodes + op_array->last;
zend_function_state function_state;
zend_function *function_being_called=NULL;
object_info object = {NULL, NULL};
zend_function *fbc=NULL; /* Function Being Called */
object_info object = {NULL};
#if !defined (__GNUC__) || __GNUC__ < 2
temp_variable *Ts = (temp_variable *) do_alloca(sizeof(temp_variable)*op_array->T);
#else
@@ -932,8 +936,7 @@ void execute(zend_op_array *op_array ELS_DC)
zval *globals = (zval *) emalloc(sizeof(zval));
globals->refcount=1;
globals->EA.is_ref=1;
globals->EA.locks = 0;
globals->is_ref=1;
globals->type = IS_ARRAY;
globals->value.ht = &EG(symbol_table);
if (zend_hash_add(EG(active_symbol_table), "GLOBALS", sizeof("GLOBALS"), &globals, sizeof(zval *), NULL)==FAILURE) {
@@ -967,6 +970,9 @@ void execute(zend_op_array *op_array ELS_DC)
case ZEND_CONCAT:
EG(binary_op) = concat_function;
goto binary_op_addr;
case ZEND_IS_IDENTICAL:
EG(binary_op) = is_identical_function;
goto binary_op_addr;
case ZEND_IS_EQUAL:
EG(binary_op) = is_equal_function;
goto binary_op_addr;
@@ -1041,7 +1047,6 @@ binary_op_addr:
/* Fall through */
binary_assign_op_addr: {
zval **var_ptr = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_RW);
int previous_lock_count;
if (!var_ptr) {
zend_error(E_ERROR, "Cannot use assign-op operators with overloaded objects nor string offsets");
@@ -1049,6 +1054,7 @@ binary_assign_op_addr: {
if (*var_ptr == EG(error_zval_ptr)) {
Ts[opline->result.u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*Ts[opline->result.u.var].var.ptr_ptr, &opline->result);
AI_USE_PTR(Ts[opline->result.u.var].var);
opline++;
continue;
}
@@ -1061,15 +1067,13 @@ binary_assign_op_addr: {
**var_ptr = *orig_var;
zendi_zval_copy_ctor(**var_ptr);
(*var_ptr)->refcount=1;
(*var_ptr)->EA.locks = 0;
}
}
previous_lock_count = (*var_ptr)->EA.locks;
EG(binary_op)(*var_ptr, *var_ptr, get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R));
(*var_ptr)->EA.locks = previous_lock_count;
Ts[opline->result.u.var].var.ptr_ptr = var_ptr;
SELECTIVE_PZVAL_LOCK(*var_ptr, &opline->result);
FREE_OP(&opline->op2, EG(free_op2));
AI_USE_PTR(Ts[opline->result.u.var].var);
}
break;
case ZEND_PRE_INC:
@@ -1085,6 +1089,7 @@ binary_assign_op_addr: {
if (*var_ptr == EG(error_zval_ptr)) {
Ts[opline->result.u.var].var.ptr_ptr = &EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(*Ts[opline->result.u.var].var.ptr_ptr, &opline->result);
AI_USE_PTR(Ts[opline->result.u.var].var);
opline++;
continue;
}
@@ -1107,7 +1112,6 @@ binary_assign_op_addr: {
**var_ptr = *orig_var;
zendi_zval_copy_ctor(**var_ptr);
(*var_ptr)->refcount=1;
(*var_ptr)->EA.locks = 0;
}
}
incdec_op(*var_ptr);
@@ -1116,6 +1120,7 @@ binary_assign_op_addr: {
case ZEND_PRE_DEC:
Ts[opline->result.u.var].var.ptr_ptr = var_ptr;
SELECTIVE_PZVAL_LOCK(*var_ptr, &opline->result);
AI_USE_PTR(Ts[opline->result.u.var].var);
break;
}
}
@@ -1132,6 +1137,7 @@ binary_assign_op_addr: {
break;
case ZEND_FETCH_R:
zend_fetch_var_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_R ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
break;
case ZEND_FETCH_W:
zend_fetch_var_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_W ELS_CC);
@@ -1139,14 +1145,26 @@ binary_assign_op_addr: {
case ZEND_FETCH_RW:
zend_fetch_var_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_RW ELS_CC);
break;
case ZEND_FETCH_FUNC_ARG:
if (ARG_SHOULD_BE_SENT_BY_REF(opline->extended_value, fbc, fbc->common.arg_types)) {
/* Behave like FETCH_W */
zend_fetch_var_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_W ELS_CC);
} else {
/* Behave like FETCH_R */
zend_fetch_var_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_R ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
}
break;
case ZEND_FETCH_IS:
zend_fetch_var_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_IS ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
break;
case ZEND_FETCH_DIM_R:
if (opline->extended_value == ZEND_FETCH_ADD_LOCK) {
PZVAL_LOCK(*Ts[opline->op1.u.var].var.ptr_ptr);
}
zend_fetch_dimension_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_R ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
break;
case ZEND_FETCH_DIM_W:
zend_fetch_dimension_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_W ELS_CC);
@@ -1156,9 +1174,21 @@ binary_assign_op_addr: {
break;
case ZEND_FETCH_DIM_IS:
zend_fetch_dimension_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_IS ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
break;
case ZEND_FETCH_DIM_FUNC_ARG:
if (ARG_SHOULD_BE_SENT_BY_REF(opline->extended_value, fbc, fbc->common.arg_types)) {
/* Behave like FETCH_DIM_W */
zend_fetch_dimension_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_W ELS_CC);
} else {
/* Behave like FETCH_DIM_R, except for locking used for list() */
zend_fetch_dimension_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_R ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
}
break;
case ZEND_FETCH_OBJ_R:
zend_fetch_property_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_R ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
break;
case ZEND_FETCH_OBJ_W:
zend_fetch_property_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_W ELS_CC);
@@ -1168,9 +1198,20 @@ binary_assign_op_addr: {
break;
case ZEND_FETCH_OBJ_IS:
zend_fetch_property_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_IS ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
break;
case ZEND_FETCH_OBJ_FUNC_ARG:
if (ARG_SHOULD_BE_SENT_BY_REF(opline->extended_value, fbc, fbc->common.arg_types)) {
/* Behave like FETCH_OBJ_W */
zend_fetch_property_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_W ELS_CC);
} else {
zend_fetch_property_address(&opline->result, &opline->op1, &opline->op2, Ts, BP_VAR_R ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
}
break;
case ZEND_FETCH_DIM_TMP_VAR:
zend_fetch_dimension_address_from_tmp_var(&opline->result, &opline->op1, &opline->op2, Ts ELS_CC);
AI_USE_PTR(Ts[opline->result.u.var].var);
break;
case ZEND_ASSIGN: {
zval *value = get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R);
@@ -1324,12 +1365,7 @@ binary_assign_op_addr: {
HashTable *active_function_table;
zval tmp;
zend_ptr_stack_n_push(&EG(arg_types_stack), 3, function_being_called, object.ptr, object.ptr_ptr);
/*
zend_ptr_stack_push(&EG(arg_types_stack), function_being_called);
zend_ptr_stack_push(&EG(arg_types_stack), object.ptr);
zend_ptr_stack_push(&EG(arg_types_stack), object.ptr_ptr);
*/
zend_ptr_stack_n_push(&EG(arg_types_stack), 2, fbc, object.ptr);
if (opline->extended_value & ZEND_CTOR_CALL) {
/* constructor call */
@@ -1360,14 +1396,16 @@ binary_assign_op_addr: {
if (zend_hash_find(EG(active_symbol_table), "this", sizeof("this"), (void **) &object_ptr_ptr)==FAILURE) {
object.ptr=NULL;
} else {
/* We assume that "this" is already is_ref and pointing to the object.
If it isn't then tough */
object.ptr = *object_ptr_ptr;
object.ptr_ptr = object_ptr_ptr;
object.ptr->refcount++; /* For this pointer */
}
} else { /* used for member function calls */
object.ptr = _get_object_zval_ptr(&opline->op1, Ts, &EG(free_op1), &object.ptr_ptr ELS_CC);
if (!object.ptr
|| ((object.ptr->type==IS_OBJECT) && (object.ptr->value.obj.ce->handle_function_call))) { /* overloaded function call */
object.ptr = _get_object_zval_ptr(&opline->op1, Ts, &EG(free_op1) ELS_CC);
if ((!object.ptr && Ts[opline->op1.u.var].EA.type==IS_OVERLOADED_OBJECT)
|| ((object.ptr && object.ptr->type==IS_OBJECT) && (object.ptr->value.obj.ce->handle_function_call))) { /* overloaded function call */
zend_overloaded_element overloaded_element;
zend_property_reference *property_reference;
@@ -1384,15 +1422,16 @@ binary_assign_op_addr: {
}
zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference);
zend_llist_add_element(&property_reference->elements_list, &overloaded_element);
function_being_called = (zend_function *) emalloc(sizeof(zend_function));
function_being_called->type = ZEND_OVERLOADED_FUNCTION;
function_being_called->common.arg_types = NULL;
fbc = (zend_function *) emalloc(sizeof(zend_function));
fbc->type = ZEND_OVERLOADED_FUNCTION;
fbc->common.arg_types = NULL;
goto overloaded_function_call_cont;
}
if (object.ptr->type != IS_OBJECT) {
if (!object.ptr || object.ptr->type != IS_OBJECT) {
zend_error(E_ERROR, "Call to a member function on a non-object");
}
object.ptr->refcount++; /* For this pointer */
active_function_table = &(object.ptr->value.obj.ce->function_table);
}
} else { /* function pointer */
@@ -1403,13 +1442,13 @@ binary_assign_op_addr: {
zend_error(E_ERROR, "Call to undefined function: %s()", function_name->value.str.val);
}
zval_dtor(&tmp);
function_being_called = function;
fbc = function;
overloaded_function_call_cont:
FREE_OP(&opline->op2, EG(free_op2));
}
break;
case ZEND_DO_FCALL_BY_NAME:
function_state.function = function_being_called;
function_state.function = fbc;
goto do_fcall_common;
case ZEND_DO_FCALL: {
zval *fname = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
@@ -1418,16 +1457,22 @@ overloaded_function_call_cont:
zend_error(E_ERROR, "Unknown function: %s()\n", fname->value.str.val);
}
FREE_OP(&opline->op1, EG(free_op1));
zend_ptr_stack_push(&EG(arg_types_stack), object.ptr);
object.ptr = NULL;
goto do_fcall_common;
}
do_fcall_common:
{
zval *original_return_value;
int return_value_not_used = (opline->result.u.EA.type & EXT_TYPE_UNUSED);
zend_ptr_stack_push(&EG(argument_stack), (void *) opline->extended_value);
var_uninit(&Ts[opline->result.u.var].tmp_var);
if (function_state.function->type==ZEND_INTERNAL_FUNCTION) {
var_uninit(&Ts[opline->result.u.var].tmp_var);
((zend_internal_function *) function_state.function)->handler(opline->extended_value, &Ts[opline->result.u.var].tmp_var, &EG(regular_list), &EG(persistent_list), (object.ptr?object.ptr:NULL));
((zend_internal_function *) function_state.function)->handler(opline->extended_value, &Ts[opline->result.u.var].tmp_var, &EG(regular_list), &EG(persistent_list), object.ptr, !return_value_not_used);
if (object.ptr) {
object.ptr->refcount--;
}
} else if (function_state.function->type==ZEND_USER_FUNCTION) {
HashTable *calling_symbol_table;
@@ -1443,38 +1488,23 @@ do_fcall_common:
EG(active_symbol_table) = function_state.function_symbol_table;
if (opline->opcode==ZEND_DO_FCALL_BY_NAME
&& object.ptr
&& function_being_called->type!=ZEND_OVERLOADED_FUNCTION) {
&& fbc->type!=ZEND_OVERLOADED_FUNCTION) {
zval **this_ptr;
zval *tmp;
zend_hash_update_ptr(function_state.function_symbol_table, "this", sizeof("this"), NULL, sizeof(zval *), (void **) &this_ptr);
if (!PZVAL_IS_REF(object.ptr)) {
/* break it away */
object.ptr->refcount--;
if (object.ptr->refcount>0) {
tmp = (zval *) emalloc(sizeof(zval));
*tmp = *object.ptr;
zendi_zval_copy_ctor(*tmp);
object.ptr = tmp;
*object.ptr_ptr = tmp;
}
object.ptr->refcount = 1;
object.ptr->EA.is_ref = 1;
object.ptr->EA.locks = 0;
zend_error(E_WARNING,"Problem with method call. Report this bug\n");
}
*this_ptr = object.ptr;
object.ptr->refcount++;
object.ptr = NULL;
}
original_return_value = EG(return_value);
EG(return_value) = &Ts[opline->result.u.var].tmp_var;
var_uninit(EG(return_value));
EG(active_op_array) = (zend_op_array *) function_state.function;
zend_execute(EG(active_op_array) ELS_CC);
EG(opline_ptr) = &opline;
EG(active_op_array) = op_array;
EG(return_value)=original_return_value;
EG(destroying_function_symbol_table) = 1;
if (EG(symtable_cache_ptr)>=EG(symtable_cache_limit)) {
zend_hash_destroy(function_state.function_symbol_table);
efree(function_state.function_symbol_table);
@@ -1482,19 +1512,17 @@ do_fcall_common:
*(++EG(symtable_cache_ptr)) = function_state.function_symbol_table;
zend_hash_clean(*EG(symtable_cache_ptr));
}
EG(destroying_function_symbol_table) = 0;
EG(active_symbol_table) = calling_symbol_table;
} else { /* ZEND_OVERLOADED_FUNCTION */
call_overloaded_function(opline->extended_value, &Ts[opline->result.u.var].tmp_var, &EG(regular_list), &EG(persistent_list) ELS_CC);
efree(function_being_called);
efree(fbc);
}
if (return_value_not_used) {
zendi_zval_dtor(Ts[opline->result.u.var].tmp_var);
}
object.ptr = zend_ptr_stack_pop(&EG(arg_types_stack));
if (opline->opcode == ZEND_DO_FCALL_BY_NAME) {
zend_ptr_stack_n_pop(&EG(arg_types_stack), 3, &object.ptr_ptr, &object.ptr, &function_being_called);
/*
object.ptr_ptr = zend_ptr_stack_pop(&EG(arg_types_stack));
object.ptr = zend_ptr_stack_pop(&EG(arg_types_stack));
function_being_called = zend_ptr_stack_pop(&EG(arg_types_stack));
*/
fbc = zend_ptr_stack_pop(&EG(arg_types_stack));
}
function_state.function = (zend_function *) op_array;
EG(function_state_ptr) = &function_state;
@@ -1517,10 +1545,7 @@ do_fcall_common:
break;
case ZEND_SEND_VAL:
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
&& function_being_called
&& function_being_called->common.arg_types
&& opline->op2.u.opline_num<=function_being_called->common.arg_types[0]
&& function_being_called->common.arg_types[opline->op2.u.opline_num]==BYREF_FORCE) {
&& ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
zend_error(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.u.opline_num);
}
{
@@ -1533,10 +1558,7 @@ do_fcall_common:
break;
case ZEND_SEND_VAR:
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
&& function_being_called
&& function_being_called->common.arg_types
&& opline->op2.u.opline_num<=function_being_called->common.arg_types[0]
&& function_being_called->common.arg_types[opline->op2.u.opline_num]==BYREF_FORCE) {
&& ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
goto send_by_ref;
}
{
@@ -1546,15 +1568,13 @@ do_fcall_common:
varptr = (zval *) emalloc(sizeof(zval));
var_uninit(varptr);
varptr->refcount=0;
varptr->EA.is_ref=0;
varptr->EA.locks = 0;
varptr->is_ref=0;
} else if (PZVAL_IS_REF(varptr)) {
zval *original_var = varptr;
varptr = (zval *) emalloc(sizeof(zval));
*varptr = *original_var;
varptr->EA.is_ref = 0;
varptr->EA.locks = 0;
varptr->is_ref = 0;
varptr->refcount = 0;
zval_copy_ctor(varptr);
}
@@ -1578,8 +1598,7 @@ send_by_ref:
varptr->refcount = 1;
zval_copy_ctor(varptr);
}
varptr->EA.is_ref = 1;
varptr->EA.locks = 0;
varptr->is_ref = 1;
/* at the end of this code refcount is always 1 */
}
varptr->refcount++;
@@ -1623,8 +1642,7 @@ send_by_ref:
*default_value = tmp;
}
default_value->refcount=0;
default_value->EA.is_ref=0;
default_value->EA.locks = 0;
default_value->is_ref=0;
param = &default_value;
assignment_value = default_value;
} else {
@@ -1708,6 +1726,7 @@ send_by_ref:
*/
FREE_OP(&opline->op1, EG(free_op1));
Ts[opline->op1.u.var].var.ptr_ptr = NULL;
AI_USE_PTR(Ts[opline->op1.u.var].var);
}
}
break;
@@ -1739,9 +1758,7 @@ send_by_ref:
}
object_init_ex(&Ts[opline->result.u.var].tmp_var, ce);
Ts[opline->result.u.var].tmp_var.refcount=1;
Ts[opline->result.u.var].tmp_var.EA.is_ref=1;
Ts[opline->result.u.var].tmp_var.EA.locks=0;
Ts[opline->result.u.var].tmp_var.is_ref=1;
zval_dtor(&class_name);
FREE_OP(&opline->op1, EG(free_op1));
}
@@ -1758,43 +1775,57 @@ send_by_ref:
case ZEND_INIT_ARRAY:
case ZEND_ADD_ARRAY_ELEMENT: {
zval *array_ptr = &Ts[opline->result.u.var].tmp_var;
zval *expr=get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
zval *expr_ptr, **expr_ptr_ptr;
zval *offset=get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R);
if (opline->extended_value) {
expr_ptr_ptr=get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_R);
expr_ptr = *expr_ptr_ptr;
} else {
expr_ptr=get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
}
if (opline->opcode==ZEND_INIT_ARRAY) {
array_init(array_ptr);
if (!expr) {
if (!expr_ptr) {
break;
}
}
if (EG(free_op1)) { /* temporary variable */
if (opline->op1.op_type == IS_TMP_VAR) { /* temporary variable */
zval *new_expr = (zval *) emalloc(sizeof(zval));
*new_expr = *expr;
expr = new_expr;
INIT_PZVAL(expr);
*new_expr = *expr_ptr;
expr_ptr = new_expr;
INIT_PZVAL(expr_ptr);
} else {
if (PZVAL_IS_REF(expr)) {
if (opline->extended_value) {
if (!PZVAL_IS_REF(expr_ptr)) {
SEPARATE_ZVAL(expr_ptr_ptr);
expr_ptr = *expr_ptr_ptr;
expr_ptr->is_ref = 1;
}
expr_ptr->refcount++;
} else if (PZVAL_IS_REF(expr_ptr)) {
zval *new_expr = (zval *) emalloc(sizeof(zval));
*new_expr = *expr;
expr = new_expr;
zendi_zval_copy_ctor(*expr);
INIT_PZVAL(expr);
*new_expr = *expr_ptr;
expr_ptr = new_expr;
zendi_zval_copy_ctor(*expr_ptr);
INIT_PZVAL(expr_ptr);
} else {
expr->refcount++;
expr_ptr->refcount++;
}
}
if (offset) {
switch(offset->type) {
case IS_DOUBLE:
zend_hash_index_update(array_ptr->value.ht, (long) offset->value.lval, &expr, sizeof(zval *), NULL);
zend_hash_index_update(array_ptr->value.ht, (long) offset->value.lval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_LONG:
zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr, sizeof(zval *), NULL);
zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_STRING:
zend_hash_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr, sizeof(zval *), NULL);
zend_hash_update(array_ptr->value.ht, offset->value.str.val, offset->value.str.len+1, &expr_ptr, sizeof(zval *), NULL);
break;
default:
/* do nothing */
@@ -1802,7 +1833,7 @@ send_by_ref:
}
FREE_OP(&opline->op2, EG(free_op2));
} else {
zend_hash_next_index_insert(array_ptr->value.ht, &expr, sizeof(zval *), NULL);
zend_hash_next_index_insert(array_ptr->value.ht, &expr_ptr, sizeof(zval *), NULL);
}
}
break;
@@ -2004,7 +2035,7 @@ send_by_ref:
} else {
isset = 1;
}
} else if (var==&EG(uninitialized_zval_ptr)
} else if (*var==EG(uninitialized_zval_ptr)
|| ((*var)->type == IS_STRING && (*var)->value.str.val == undefined_variable_string)) {
isset = 0;
} else {
@@ -2023,7 +2054,7 @@ send_by_ref:
} else {
Ts[opline->result.u.var].tmp_var.value.lval = 0;
}
} else if (!isset || !zend_is_true(*var)) {
} else if (!isset || !zend_is_true((*var))) {
Ts[opline->result.u.var].tmp_var.value.lval = 1;
} else {
Ts[opline->result.u.var].tmp_var.value.lval = 0;
+2 -1
View File
@@ -28,6 +28,7 @@ typedef union _temp_variable {
zval tmp_var;
struct {
zval **ptr_ptr;
zval *ptr;
} var;
struct {
zval tmp_var; /* a dummy */
@@ -48,7 +49,7 @@ ZEND_API int zend_is_true(zval *op);
ZEND_API inline void safe_free_zval_ptr(zval *p);
ZEND_API void zend_eval_string(char *str, zval *retval CLS_DC ELS_DC);
ZEND_API inline int i_zend_is_true(zval *op);
ZEND_API void zval_update_constant(zval *p);
ZEND_API int zval_update_constant(zval **pp);
ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC);
/* dedicated Zend executor functions - do not use! */
+18 -24
View File
@@ -84,14 +84,11 @@ void init_executor(CLS_D ELS_DC)
var_uninit(&EG(uninitialized_zval));
var_uninit(&EG(error_zval));
EG(uninitialized_zval).refcount = 1;
EG(uninitialized_zval).EA.is_ref=0;
EG(uninitialized_zval).EA.locks = 0;
EG(uninitialized_zval).is_ref=0;
EG(uninitialized_zval_ptr)=&EG(uninitialized_zval);
EG(error_zval).refcount = 1;
EG(error_zval).EA.is_ref=0;
EG(error_zval).EA.locks = 0;
EG(error_zval).is_ref=0;
EG(error_zval_ptr)=&EG(error_zval);
EG(destroying_function_symbol_table) = 0;
zend_ptr_stack_init(&EG(arg_types_stack));
zend_stack_init(&EG(overloaded_objects_stack));
/* destroys stack frame, therefore makes core dumps worthless */
@@ -117,6 +114,7 @@ void init_executor(CLS_D ELS_DC)
zend_llist_apply(&zend_extensions, (void (*)(void *)) zend_extension_activator);
EG(opline_ptr) = NULL;
EG(garbage_ptr) = 0;
}
@@ -146,6 +144,10 @@ void shutdown_executor(ELS_D)
#if ZEND_DEBUG
signal(SIGSEGV, original_sigsegv_handler);
#endif
while (EG(garbage_ptr)--) {
zval_dtor(EG(garbage)[EG(garbage_ptr)]);
efree(EG(garbage)[EG(garbage_ptr)]);
}
}
@@ -205,8 +207,6 @@ ZEND_API inline void safe_free_zval_ptr(zval *p)
ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
{
int locked = (*zval_ptr)->EA.locks;
#if DEBUG_ZEND>=2
printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1);
#endif
@@ -215,17 +215,7 @@ ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
zval_dtor(*zval_ptr);
safe_free_zval_ptr(*zval_ptr);
}
if (locked) {
ELS_FETCH();
if (EG(destroying_function_symbol_table)) {
return 1;
} else {
return 0; /* don't kill the container bucket */
}
} else {
return 1;
}
return 1;
}
@@ -270,8 +260,10 @@ ZEND_API int zend_is_true(zval *op)
}
ZEND_API void zval_update_constant(zval *p)
ZEND_API int zval_update_constant(zval **pp)
{
zval *p = *pp;
if (p->type == IS_CONSTANT) {
zval c;
int refcount = p->refcount;
@@ -287,7 +279,10 @@ ZEND_API void zval_update_constant(zval *p)
}
INIT_PZVAL(p);
p->refcount = refcount;
} else if (p->type == IS_ARRAY) {
zend_hash_apply(p->value.ht, (int (*)(void *)) zval_update_constant);
}
return 0;
}
@@ -347,12 +342,11 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
*new_zval = **params[i];
zval_copy_ctor(new_zval);
new_zval->refcount = 1;
new_zval->EA.locks = 0;
(*params[i])->refcount--;
*params[i] = new_zval;
}
(*params[i])->refcount++;
(*params[i])->EA.is_ref = 1;
(*params[i])->is_ref = 1;
param = *params[i];
} else if (*params[i] != &EG(uninitialized_zval)) {
(*params[i])->refcount++;
@@ -393,7 +387,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio
EG(return_value)=original_return_value;
EG(opline_ptr) = original_opline_ptr;
} else {
((zend_internal_function *) function_state.function)->handler(param_count, retval, &EG(regular_list), &EG(persistent_list), object);
((zend_internal_function *) function_state.function)->handler(param_count, retval, &EG(regular_list), &EG(persistent_list), object, 1);
}
zend_ptr_stack_clear_multiple(ELS_C);
EG(function_state_ptr) = original_function_state_ptr;
@@ -488,8 +482,7 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
zendi_zval_copy_ctor(*value_ptr);
}
value_ptr->refcount = 1;
value_ptr->EA.is_ref = 1;
value_ptr->EA.locks = 0;
value_ptr->is_ref = 1;
}
*variable_ptr_ptr = value_ptr;
@@ -501,6 +494,7 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
if (result && (result->op_type != IS_UNUSED)) {
Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
AI_USE_PTR(Ts[result->u.var].var);
}
}
+6 -1
View File
@@ -55,6 +55,9 @@ END_EXTERN_C()
#include "zend_compile.h"
#include "zend_execute.h"
/* excpt.h on Digital Unix 4.0 defines function_table */
#undef function_table
struct _zend_compiler_globals {
zend_stack bp_stack;
zend_stack switch_cond_stack;
@@ -138,7 +141,6 @@ struct _zend_executor_globals {
HashTable *zend_constants; /* constants table */
long precision;
zend_bool destroying_function_symbol_table;
/* for extended information support */
zend_bool no_extensions;
@@ -151,6 +153,9 @@ struct _zend_executor_globals {
int (*unary_op)(zval *result, zval *op1);
int (*binary_op)(zval *result, zval *op1, zval *op2);
zval *garbage[4];
int garbage_ptr;
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
#if SUPPORT_INTERACTIVE
int interactive;
+4 -4
View File
@@ -60,7 +60,6 @@ static uint PrimeNumbers[] =
{5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793, 2097397, 4194103, 8388857, 16777447, 33554201, 67108961, 134217487, 268435697, 536870683, 1073741621, 2147483399};
static int if_full_do_resize(HashTable *ht);
static int zend_hash_rehash(HashTable *ht);
static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(ulong);
@@ -655,7 +654,7 @@ static int if_full_do_resize(HashTable *ht)
return SUCCESS;
}
static int zend_hash_rehash(HashTable *ht)
ZEND_API int zend_hash_rehash(HashTable *ht)
{
Bucket *p;
uint nIndex;
@@ -1098,7 +1097,8 @@ ZEND_API int zend_hash_get_current_data(HashTable *ht, void **pData)
}
ZEND_API int zend_hash_sort(HashTable *ht, int (*compar) (const void *, const void *), int renumber)
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
compare_func_t compar, int renumber)
{
Bucket **arTmp;
Bucket *p;
@@ -1119,7 +1119,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, int (*compar) (const void *, const vo
i++;
}
qsort((void *) arTmp, i, sizeof(Bucket *), compar);
(*sort_func)((void *) arTmp, i, sizeof(Bucket *), compar);
HANDLE_BLOCK_INTERRUPTIONS();
ht->pListHead = arTmp[0];
+4 -1
View File
@@ -62,6 +62,8 @@ typedef struct hashtable {
unsigned char persistent;
} HashTable;
typedef int (*compare_func_t) (const void *, const void *);
typedef void (*sort_func_t) (void *, size_t, register size_t, compare_func_t);
BEGIN_EXTERN_C()
@@ -154,11 +156,12 @@ ZEND_API void zend_hash_internal_pointer_end(HashTable *ht);
/* Copying, merging and sorting */
ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, void (*pCopyConstructor) (void *pData), void *tmp, uint size);
ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, void (*pCopyConstructor) (void *pData), void *tmp, uint size, int overwrite);
ZEND_API int zend_hash_sort(HashTable *ht, int (*compar) (const void *, const void *), int renumber);
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_minmax(HashTable *ht, int (*compar) (const void *, const void *), int flag, void **pData);
ZEND_API int zend_hash_num_elements(HashTable *ht);
ZEND_API int zend_hash_rehash(HashTable *ht);
ZEND_API ulong hashpjw(char *arKey, uint nKeyLength);
+20 -4
View File
@@ -138,13 +138,22 @@ ZEND_API void *zend_plist_find(int id, int *type)
}
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int resource_type)
{
return zend_fetch_resource_ex(passed_id, default_id, resource_type_name, 1, resource_type);
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
{
int rsrc_id;
rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type);
if (rsrc_result) {
rsrc_result->value.lval = rsrc_id;
rsrc_result->type = IS_RESOURCE;
}
return rsrc_id;
}
ZEND_API void *zend_fetch_resource_ex(zval **passed_id, int default_id, char *resource_type_name, int num_resource_types, ...)
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
{
int id;
int actual_resource_type;
@@ -180,10 +189,17 @@ ZEND_API void *zend_fetch_resource_ex(zval **passed_id, int default_id, char *re
for (i=0; i<num_resource_types; i++) {
if (actual_resource_type == va_arg(resource_types, int)) {
va_end(resource_types);
if (found_resource_type) {
*found_resource_type = actual_resource_type;
}
return resource;
}
}
va_end(resource_types);
if (resource_type_name)
zend_error(E_WARNING, "Supplied resource is not a valid %s resource", resource_type_name);
return NULL;
}
+9 -7
View File
@@ -62,8 +62,9 @@ ZEND_API int zend_list_delete(int id);
ZEND_API int zend_plist_delete(int id);
ZEND_API void *zend_list_find(int id, int *type);
ZEND_API void *zend_plist_find(int id, int *type);
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int resource_type);
ZEND_API void *zend_fetch_resource_ex(zval **passed_id, int default_id, char *resource_type_name, int num_resource_types, ...);
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type);
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
@@ -72,14 +73,15 @@ extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
RETURN_FALSE; \
}
#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \
rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, resource_type); \
rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 1, resource_type); \
ZEND_VERIFY_RESOURCE(rsrc);
#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1,resource_type2) \
rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \
ZEND_VERIFY_RESOURCE(rsrc);
#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \
rsrc_result->value.lval = zend_list_insert(rsrc_pointer, rsrc_type); \
rsrc_result->type = IS_RESOURCE
#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \
zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type);
#endif
+5 -2
View File
@@ -311,10 +311,10 @@ void pass_include_eval(zend_op_array *op_array)
while (opline<end) {
if (opline->op1.op_type==IS_CONST) {
opline->op1.u.constant.EA.is_ref = 1;
opline->op1.u.constant.is_ref = 1;
}
if (opline->op2.op_type==IS_CONST) {
opline->op2.u.constant.EA.is_ref = 1;
opline->op2.u.constant.is_ref = 1;
}
opline++;
}
@@ -380,6 +380,9 @@ ZEND_API void *get_binary_op(int opcode)
case ZEND_ASSIGN_CONCAT:
return (void *) concat_function;
break;
case ZEND_IS_IDENTICAL:
return (void *) is_identical_function;
break;
case ZEND_IS_EQUAL:
return (void *) is_equal_function;
break;
+47 -6
View File
@@ -34,8 +34,6 @@
#include "functions/number.h"
#endif
static inline int is_numeric_string(char *str, int length, long *lval, double *dval);
ZEND_API void convert_scalar_to_number(zval *op)
{
char *strval;
@@ -407,9 +405,16 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2)
if (op1->type == IS_ARRAY && op2->type == IS_ARRAY) {
zval *tmp;
*result = *op1;
zval_copy_ctor(result);
if ((result == op1) && (result == op2)) {
/* $a += $a */
return SUCCESS;
}
if (result != op1) {
/* $a += $b */
*result = *op1;
zval_copy_ctor(result);
}
zend_hash_merge(result->value.ht, op2->value.ht, (void (*)(void *pData)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0);
return SUCCESS;
}
@@ -909,6 +914,42 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
}
ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2)
{
result->type = IS_BOOL;
if (op1->type != op2->type) {
result->value.lval = 0;
return SUCCESS;
}
switch (op1->type) {
case IS_BOOL:
case IS_LONG:
case IS_RESOURCE:
result->value.lval = (op1->value.lval == op2->value.lval);
return SUCCESS;
break;
case IS_DOUBLE:
result->value.lval = (op1->value.dval == op2->value.dval);
return SUCCESS;
break;
case IS_STRING:
if ((op1->value.str.len == op2->value.str.len)
&& (!memcmp(op1->value.str.val, op2->value.str.val, op1->value.str.len))) {
result->value.lval = 1;
} else {
result->value.lval = 0;
}
return SUCCESS;
break;
case IS_ARRAY:
case IS_OBJECT:
zend_error(E_WARNING,"Cannot compare arrays or objects");
break;
}
var_reset(result);
return FAILURE;
}
ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2)
{
if (compare_function(result, op1, op2) == FAILURE) {
@@ -1230,7 +1271,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
*/
#if 1
static inline int is_numeric_string(char *str, int length, long *lval, double *dval)
ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double *dval)
{
long local_lval;
double local_dval;
+16 -6
View File
@@ -42,9 +42,11 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2);
ZEND_API int concat_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_equal_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_not_equal_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_smaller_function(zval *result, zval *op1, zval *op2);
ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2);
ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double *dval);
ZEND_API int increment_function(zval *op1);
ZEND_API int decrement_function(zval *op2);
@@ -72,7 +74,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_long_ex(ppzv) \
if ((*ppzv)->type!=IS_LONG) { \
if (!(*ppzv)->EA.is_ref) { \
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_long(*ppzv); \
@@ -80,7 +82,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_double_ex(ppzv) \
if ((*ppzv)->type!=IS_DOUBLE) { \
if (!(*ppzv)->EA.is_ref) { \
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_double(*ppzv); \
@@ -88,7 +90,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_string_ex(ppzv) \
if ((*ppzv)->type!=IS_STRING) { \
if (!(*ppzv)->EA.is_ref) { \
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_string(*ppzv); \
@@ -96,7 +98,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_array_ex(ppzv) \
if ((*ppzv)->type!=IS_ARRAY) { \
if (!(*ppzv)->EA.is_ref) { \
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_array(*ppzv); \
@@ -104,7 +106,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_object_ex(ppzv) \
if ((*ppzv)->type!=IS_OBJECT) { \
if (!(*ppzv)->EA.is_ref) { \
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_object(*ppzv); \
@@ -112,10 +114,18 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
#define convert_to_boolean_ex(ppzv) \
if ((*ppzv)->type!=IS_BOOL) { \
if (!(*ppzv)->EA.is_ref) { \
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_to_boolean(*ppzv); \
}
#define convert_scalar_to_number_ex(ppzv) \
if ((*ppzv)->type!=IS_LONG && (*ppzv)->type!=IS_DOUBLE) { \
if (!(*ppzv)->is_ref) { \
SEPARATE_ZVAL(ppzv); \
} \
convert_scalar_to_number(*ppzv); \
}
#endif
+10 -2
View File
@@ -89,14 +89,22 @@ ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
}
void zval_del_ref(zval **p)
{
(*p)->refcount--;
if ((*p)->refcount==0) {
zval_dtor(*p);
efree(*p);
}
}
void zval_add_ref(zval **p)
{
(*p)->refcount++;
}
ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
{
switch (zvalue->type) {
+1
View File
@@ -49,6 +49,7 @@ END_EXTERN_C()
void zval_add_ref(zval **p);
void zval_del_ref(zval **p);
#define PVAL_DESTRUCTOR (int (*)(void *)) zval_dtor_wrapper
#define PVAL_PTR_DTOR (int (*)(void *)) zval_ptr_dtor_wrapper
-120
View File
@@ -1,120 +0,0 @@
/* This is the default configuration file to read -*- C -*- */
/* these are defined by automake */
#undef PACKAGE
#undef VERSION
#undef HAVE_AOLSERVER
#undef HAVE_STRUCT_FLOCK
#undef HAVE_TM_GMTOFF
#define CONFIGURATION_FILE_PATH "php.ini"
#define USE_CONFIG_FILE 1
#undef HAVE_DMALLOC
/* Some global constants defined by conigure */
#undef PHP_BUILD_DATE
#undef PHP_OS
#undef PHP_UNAME
/* define uint by configure if it is missed (QNX and BSD derived) */
#undef uint
/* define ulong by configure if it is missed (most probably is) */
#undef ulong
/* type check for in_addr_t */
#undef in_addr_t
/* Define if you have dirent.h but opendir() resides in libc rather than in libdir */
/* This will cause HAVE_DIRENT_H defined twice sometimes, but it should be problem */
#undef HAVE_DIRENT_H
/* Define if you have the resolv library (-lresolv). */
#undef HAVE_LIBRESOLV
/* Define if you have the pam library (-lpam). */
#define HAVE_LIBPAM 0
/* Define if you have the bind library (-lbind). */
#define HAVE_LIBBIND 0
/* Define if you have Netscape LDAP instead of umich ldap or openldap*/
#define HAVE_NSLDAP 0
/* Define if you want safe mode enabled by default. */
#define PHP_SAFE_MODE 0
/* Set to the path to the dir containing safe mode executables */
#define PHP_SAFE_MODE_EXEC_DIR /usr/local/php/bin
/* Define if you want POST/GET/Cookie track variables by default */
#define PHP_TRACK_VARS 0
/* Undefine if you want stricter XML/SGML compliance by default */
/* (this disables "<?expression?>" by default) */
#define DEFAULT_SHORT_OPEN_TAG 1
/* Undefine if you do not want PHP by default to escape "'" */
/* in GET/POST/Cookie data */
#define MAGIC_QUOTES 1
/* Define both of these if you want the bundled REGEX library */
#define REGEX 0
#define HSREGEX 0
/* Define if you have and want to use libnsl */
#undef HAVE_LIBNSL
/* Define if you have and want to use libsocket */
#undef HAVE_LIBSOCKET
/* Define if you have the sendmail program available */
#define HAVE_SENDMAIL 0
/* Define if you are compiling PHP as an Apache module */
#define APACHE 0
/* Define if you are compiling PHP as an Apache module with mod_charset patch applied (aka Russian Apache)*/
#define USE_TRANSFER_TABLES 0
/* Define if you are compiling PHP as an fhttpd module */
#define FHTTPD 0
/* Define if your Apache creates an ap_config.h header file (only 1.3b6 and later) */
#define HAVE_AP_CONFIG_H 0
/* Define if your Apache has src/include/compat.h */
#define HAVE_OLD_COMPAT_H 0
/* Define if your Apache has src/include/ap_compat.h */
#define HAVE_AP_COMPAT_H 0
#ifndef DEBUG /* should be set to ZEND_DEBUG */
#define DEBUG 0
#endif
/* Define if you want to enable PHP RPC (experimental) */
#define PHP_RPC 0
/* Define if you want to prevent the CGI from working unless REDIRECT_STATUS is defined in the environment */
#define FORCE_CGI_REDIRECT 0
/* Define if you want to prevent the CGI from using path_info and path_translated */
#define DISCARD_PATH 0
/* Define if you want include() and other functions to be able to open
* http and ftp URLs as files.
*/
#define PHP3_URL_FOPEN 0
/* Define if you have broken header files like SunOS 4 */
#define MISSING_FCLOSE_DECL 0
/* Define if you have broken sprintf function like SunOS 4 */
#define BROKEN_SPRINTF 0
/* Define to compile PHP/Zend thread safe */
#undef ZTS
-279
View File
@@ -1,279 +0,0 @@
dnl $Id$
dnl
dnl This file contains local autoconf functions.
dnl
dnl AC_PHP_ONCE(namespace, variable, code)
dnl
dnl execute code, if variable is not set in namespace
dnl
AC_DEFUN(AC_PHP_ONCE,[
unique=`echo $ac_n "$2$ac_c" | tr -c -d a-zA-Z0-9`
cmd="echo $ac_n \"\$$1$unique$ac_c\""
if test -n "$unique" && test "`eval $cmd`" = "" ; then
eval "$1$unique=set"
$3
fi
])
dnl
dnl AC_EXPAND_PATH(path, variable)
dnl
dnl expands path to an absolute path and assigns it to variable
dnl
AC_DEFUN(AC_EXPAND_PATH,[
if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
$2="$1"
else
$2="`pwd`/$1"
fi
])
dnl
dnl AC_ADD_LIBPATH(path)
dnl
dnl add a library to linkpath/runpath
dnl
AC_DEFUN(AC_ADD_LIBPATH,[
if test "$1" != "/usr/lib"; then
AC_EXPAND_PATH($1, ai_p)
AC_PHP_ONCE(LIBPATH, $ai_p, [
EXTRA_LIBS="$EXTRA_LIBS -L$ai_p"
PHP_RPATHS="$PHP_RPATHS $ai_p"
])
fi
])
dnl
dnl AC_BUILD_RPATH()
dnl
dnl builds RPATH from PHP_RPATHS
dnl
AC_DEFUN(AC_BUILD_RPATH,[
if test "$enable_rpath" = "yes" && test -n "$PHP_RPATHS"; then
if test -n "$AXPS"; then
for i in $PHP_RPATHS; do
RPATHS="$RPATHS ${apxs_runpath_switch}$i'"
done
else
for i in $PHP_RPATHS; do
RPATHS="$RPATHS ${ld_runpath_switch}$i"
done
fi
fi
])
dnl
dnl AC_ADD_INCLUDE(path)
dnl
dnl add a include path
dnl
AC_DEFUN(AC_ADD_INCLUDE,[
if test "$1" != "/usr/include"; then
AC_EXPAND_PATH($1, ai_p)
AC_PHP_ONCE(INCLUDEPATH, $ai_p, [
INCLUDES="$INCLUDES -I$ai_p"
])
fi
])
dnl
dnl AC_ADD_LIBRARY(library)
dnl
dnl add a library to the link line
dnl
AC_DEFUN(AC_ADD_LIBRARY,[
AC_PHP_ONCE(LIBRARY, $1, [
EXTRA_LIBS="$EXTRA_LIBS -l$1"
])
])
dnl
dnl AC_ADD_LIBRARY_WITH_PATH(library, path)
dnl
dnl add a library to the link line and path to linkpath/runpath
dnl
AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH,[
AC_ADD_LIBPATH($2)
AC_ADD_LIBRARY($1)
])
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
])
dnl
dnl Check for cc option
dnl
AC_DEFUN(AC_CHECK_CC_OPTION,[
echo "main(){return 0;}" > conftest.$ac_ext
opt="$1"
var=`echo $ac_n "$opt$ac_c"|tr -c a-zA-Z0-9 _`
AC_MSG_CHECKING([if compiler supports -$1 really])
ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1"
if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then
eval php_cc_$var=no
AC_MSG_RESULT(no)
else
if eval ./conftest 2>/dev/null ; then
eval php_cc_$var=yes
AC_MSG_RESULT(yes)
else
eval php_cc_$var=no
AC_MSG_RESULT(no)
fi
fi
])
dnl
dnl See if we have broken header files like SunOS has.
dnl
AC_DEFUN(AC_MISSING_FCLOSE_DECL,[
AC_MSG_CHECKING([for fclose declaration])
AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[
AC_DEFINE(MISSING_FCLOSE_DECL,0)
AC_MSG_RESULT(ok)
],[
AC_DEFINE(MISSING_FCLOSE_DECL,1)
AC_MSG_RESULT(missing)
])
])
dnl
dnl Check for broken sprintf()
dnl
AC_DEFUN(AC_BROKEN_SPRINTF,[
AC_MSG_CHECKING([for broken sprintf])
AC_TRY_RUN([main() { char buf[20]; exit (sprintf(buf,"testing 123")!=11); }],[
AC_DEFINE(BROKEN_SPRINTF,0)
AC_MSG_RESULT(ok)
],[
AC_DEFINE(BROKEN_SPRINTF,1)
AC_MSG_RESULT(broken)
],[
AC_DEFINE(BROKEN_SPRINTF,0)
AC_MSG_RESULT(cannot check, guessing ok)
])
])
dnl
dnl Stuff to do when setting up a new extension.
dnl XXX have to change the hardcoding of ".a" when we want to be able
dnl to make dynamic libraries as well.
dnl
AC_DEFUN(PHP_EXTENSION,[
if test -d "$cwd/$srcdir/ext/$1" ; then
EXT_SUBDIRS="$EXT_SUBDIRS $1"
if test "$2" != "shared" -a "$2" != "yes"; then
_extlib="libphpext_$1.a"
EXT_LIBS="$EXT_LIBS $1/$_extlib"
EXTINFO_DEPS="$EXTINFO_DEPS ../ext/$1/extinfo.c.stub"
EXT_STATIC="$EXT_STATIC $1"
else
EXT_SHARED="$EXT_SHARED $1"
fi
dnl EXT_INCLUDE_CODE="\#include \"ext/$1/php3_$1.h\"\\n$EXT_INCLUDE_CODE"
dnl EXT_MODULE_PTRS="phpext_$1_ptr, $EXT_MODULE_PTRS"
dnl "
fi
])
AC_SUBST(EXT_SUBDIRS)
AC_SUBST(EXT_STATIC)
AC_SUBST(EXT_SHARED)
AC_SUBST(EXT_LIBS)
AC_SUBST(EXTINFO_DEPS)
dnl AC_SUBST(EXT_INCLUDE_CODE)
dnl AC_SUBST(EXT_MODULES_PTRS)
dnl
dnl Solaris requires main code to be position independent in order
dnl to let shared objects find symbols. Weird. Ugly.
dnl
dnl Must be run after all --with-NN options that let the user
dnl choose dynamic extensions, and after the gcc test.
dnl
AC_DEFUN(PHP_SOLARIS_PIC_WEIRDNESS,[
AC_MSG_CHECKING(whether -fPIC is required)
if test "$EXT_SHARED" != ""; then
os=`uname -sr 2>/dev/null`
case "$os" in
"SunOS 5.6"|"SunOS 5.7")
case "$CC" in
gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";;
*) CFLAGS="$CFLAGS -fpic";;
esac
AC_MSG_RESULT(yes);;
*)
AC_MSG_RESULT(no);;
esac
else
AC_MSG_RESULT(no)
fi
])
dnl
dnl Checks whether $withval is "shared" or starts with "shared,XXX"
dnl and sets $shared to "yes" or "no", and removes "shared,?" stuff
dnl from $withval.
dnl
AC_DEFUN(PHP_WITH_SHARED,[
case $withval in
shared)
shared=yes
withval=yes
;;
shared,*)
shared=yes
withval=`echo $withval | sed -e 's/^shared,//'`
;;
*)
shared=no
;;
esac
])
dnl The problem is that the default compilation flags in Solaris 2.6 won't
dnl let programs access large files; you need to tell the compiler that
dnl you actually want your programs to work on large files. For more
dnl details about this brain damage please see:
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
dnl Written by Paul Eggert <eggert@twinsun.com>.
AC_DEFUN(AC_SYS_LFS,
[dnl
# If available, prefer support for large files unless the user specified
# one of the CPPFLAGS, LDFLAGS, or LIBS variables.
AC_MSG_CHECKING(whether large file support needs explicit enabling)
ac_getconfs=''
ac_result=yes
ac_set=''
ac_shellvars='CPPFLAGS LDFLAGS LIBS'
for ac_shellvar in $ac_shellvars; do
case $ac_shellvar in
CPPFLAGS) ac_lfsvar=LFS_CFLAGS ;;
*) ac_lfsvar=LFS_$ac_shellvar ;;
esac
eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar
(getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; }
ac_getconf=`getconf $ac_lfsvar`
ac_getconfs=$ac_getconfs$ac_getconf
eval ac_test_$ac_shellvar=\$ac_getconf
done
case "$ac_result$ac_getconfs" in
yes) ac_result=no ;;
esac
case "$ac_result$ac_set" in
yes?*) ac_result="yes, but $ac_set is already set, so use its settings"
esac
AC_MSG_RESULT($ac_result)
case $ac_result in
yes)
for ac_shellvar in $ac_shellvars; do
eval $ac_shellvar=\$ac_test_$ac_shellvar
done ;;
esac
])
-4
View File
@@ -1,4 +0,0 @@
This is a place-holder which indicates to Configure that it shouldn't
provide the default targets when building the Makefile in this directory.
Instead it'll just prepend all the important variable definitions, and
copy the Makefile.tmpl onto the end.
-77
View File
@@ -1,77 +0,0 @@
##
## Apache 1.3 Makefile template for PHP 4.0 Module
## [src/modules/php4/Makefile.tmpl]
##
# the parametrized target
LIB=libphp4.$(LIBEXT)
# objects for building the static library
OBJS=mod_php4.o
OBJS_LIB=libmodphp4.a
# objects for building the shared object library
SHLIB_OBJS=mod_php4.so-o
SHLIB_OBJS_LIB=libmodphp4-so.a
# the general targets
all: lib
lib: $(LIB)
# build the static library by merging the object files
libphp4.a: $(OBJS) $(OBJS_LIB)
cp $(OBJS_LIB) $@
ar r $@ $(OBJS)
$(RANLIB) $@
# ugly hack to support older Apache-1.3 betas that don't set $LIBEXT
libphp4.: $(OBJS) $(OBJS_LIB)
cp $(OBJS_LIB) $@
ar r $@ $(OBJS)
$(RANLIB) $@
cp libphp4. libphp4.a
# build the shared object library by linking the object files
libphp4.so: $(SHLIB_OBJS) $(SHLIB_OBJS_LIB)
rm -f $@
$(LD_SHLIB) $(LDFLAGS_SHLIB) -o $@ $(SHLIB_OBJS) $(SHLIB_OBJS_LIB) $(LIBS)
# 1. extension .o for shared objects cannot be used here because
# first these files aren't still shared objects and second we
# have to use a different name to trigger the different
# implicit Make rule
# 2. extension -so.o (as used elsewhere) cannot be used because
# the suffix feature of Make really wants just .x, so we use
# extension .so-o
.SUFFIXES: .o .so-o
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $<
.c.so-o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(CFLAGS_SHLIB) $(SPACER) $< && mv $*.o $*.so-o
# cleanup
clean:
-rm -f $(OBJS) $(SHLIB_OBJS) $(LIB)
# We really don't expect end users to use this rule. It works only with
# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after
# using it.
depend:
cp Makefile.tmpl Makefile.tmpl.bak \
&& sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
&& gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \
&& sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \
> Makefile.tmpl \
&& rm Makefile.new
#Dependencies
$(OBJS): Makefile
# DO NOT REMOVE
mod_php4.o: mod_php4.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \
$(INCDIR)/alloc.h $(INCDIR)/buff.h \
$(INCDIR)/http_config.h \
$(INCDIR)/http_core.h $(INCDIR)/http_main.h \
$(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \
$(INCDIR)/http_log.h $(INCDIR)/util_script.h mod_php4.h
-276
View File
@@ -1,276 +0,0 @@
Following is a merge of two letters I sent to php4beta@lists.php.net,
describing the changes in API between PHP 3.0 and PHP 4.0 (Zend).
This file is by no means thorough documentation of the PHP API,
and is intended for developers who are familiar with the PHP 3.0 API,
and want to port their code to PHP 4.0, or take advantage of its new
features. For highlights about the PHP 3.0 API, consult apidoc.txt.
Zeev
--------------------------------------------------------------------------
I'm going to try to list the important changes in API and programming
techniques that are involved in developing modules for PHP4/Zend, as
opposed to PHP3. Listing the whole PHP4 API is way beyond my scope here,
it's mostly a 'diff' from the apidoc.txt, which you're all pretty familiar
with.
An important note that I neglected to mention yesterday - the php4 tree is
based on the php 3.0.5 tree, plus all 3.0.6 patches hand-patched into it.
Notably, it does NOT include any 3.0.7 patches. All of those have to be
reapplied, with extreme care - modules should be safe to patch (mostly),
but anything that touches the core or main.c will almost definitely require
changes in order to work properly.
[1] Symbol Tables
One of the major changes in Zend involves changing the way symbols tables
work. Zend enforces reference counting on all values and resources. This
required changes in the semantics of the hash tables that implement symbol
tables. Instead of storing pval in the hashes, we now store pval *. All
of the API functions in Zend were changed in a way that this change is
completely transparent. However, if you've used 'low level' hash functions
to access or update elements in symbol tables, your code will require
changes. Following are two simple examples, one demonstrates the
difference between PHP3 and Zend when reading a symbol's value, and the
other demonstrates the difference when writing a value.
php3_read()
{
pval *foo;
_php3_hash_find(ht, "foo", sizeof("foo"), &foo);
/* foo->type is the type and foo->value is the value */
}
php4_read()
{
pval **foo;
_php3_hash_find(ht, "foo", sizeof("foo"), &foo);
/* (*foo)->type is the type and (*foo)->value is the value */
}
---
php3_write()
{
pval newval;
newval.type = ...;
newval.value = ...;
_php3_hash_update(ht, "bar", sizeof("bar"), &newval, sizeof(pval), NULL);
}
php4_write()
{
pval *newval = (pval *) emalloc(sizeof(pval));
newval->refcount=1;
newval->is_ref=0;
newval->type = ...;
newval->value = ...;
_php3_hash_update(ht, "bar", sizeof("bar"), &newval, sizeof(pval *), NULL);
}
[2] Resources
One of the 'cute' things about the reference counting support is that it
completely eliminates the problem of resource leaking. A simple loop that
included '$result = mysql_query(...)' in PHP leaked unless the user
remembered to run mysql_free($result) at the end of the loop body, and
nobody really did. In order to take advantage of the automatic resource
deallocation upon destruction, there's virtually one small change you need
to conduct. Change the result type of a resource that you want to destroy
itself as soon as its no longer referenced (just about any resource I can
think of) as IS_RESOURCE, instead of as IS_LONG. The rest is magic.
A special treatment is required for SQL modules that follow MySQL's
approach for having the link handle as an optional argument. Modules that
follow the MySQL module model, store the last opened link in a global
variable, that they use in case the user neglects to explicitly specify a
link handle. Due to the way referenec counting works, this global
reference is just like any other reference, and must increase that SQL link
resource's reference count (otherwise, it will be closed prematurely).
Simply, when you set the default link to a certain link, increase that
link's reference count by calling zend_list_addref().
As always, the MySQL module is the one used to demonstrate 'new
technology'. You can look around it and look for IS_RESOURCE, as well as
zend_list_addref(), to see a clear example of how the new API should be used.
[3] Thread safety issues
I'm not going to say that Zend was designed with thread safety in mind, but
from some point, we've decided upon several guidelines that would make the
move to thread safety much, much easier. Generally, we've followed the PHP
3.1 approach of moving global variables to a structure, and encapsulating
all global variable references within macros. There are three main
differences:
1. We grouped related globals in a single structure, instead of grouping
all globals in one structure.
2. We've used much, much shorter macro names to increase the readability
of the source code.
3. Regardless of whether we're compiling in thread safe mode or not, all
global variables are *always* stored in a structure. For example, you
would never have a global variable 'foo', instead, it'll be a property of a
global structure, for example, compiler_globals.foo. That makes
development much, much easier, since your code will simply not compile
unless you remember to put the necessary macro around foo.
To write code that'll be thread safe in the future (when we release our
thread safe memory manager and work on integrating it), you can take a look
at zend_globals.h. Essentially, two sets of macros are defined, one for
thread safe mode, and one for thread unsafe mode. All global references
are encapsulated within ???G(varname), where ??? is the appropriate prefix
for your structure (for example, so far we have CG(), EG() and AG(), which
stand for the compiler, executor and memory allocator, respectively).
When compiling with thread safety enabled, each function that makes use of
a ???G() macro, must obtain the pointer to its copy of the structure. It
can do so in one of two forms:
1. It can receive it as an argument.
2. It can fetch it.
Obviously, the first method is preferable since it's much quicker.
However, it's not always possible to send the structure all the way to a
particular function, or it may simply bloat the code too much in some
cases. Functions that receive the globals as an argument, should look like
this:
rettype functioname(???LS_D) <-- a function with no arguments
rettype functioname(type arg1, ..., type argn ???LS_DC) <-- a funciton with
arguments
Calls to such functions should look like this:
functionname(???LS_C) <-- a function with no arguments
functionname(arg1, ..., argn ???LS_CC) <-- a function with arguments
LS stands for 'Local Storage', _C stands for Call and _CC stands for Call
Comma, _D stands for Declaration and _DC stands for Declaration Comma.
Note that there's NO comma between the last argument and ???LS_DC or ???LS_CC.
In general, every module that makes use of globals should use this approach
if it plans to be thread safe.
[4] Generalized INI support
The code comes to solve several issues:
a. The ugly long block of code in main.c that reads values from the
cfg_hash into php3_ini.
b. Get rid of php3_ini. The performance penalty of copying it around all
the time in the Apache module probably wasn't too high, but
psychologically, it annoyed me :)
c. Get rid of the ugly code in mod_php4.c, that also reads values from
Apache directives and puts them into the php3_ini structure.
d. Generalize all the code so that you only have to add an entry in one
single place and get it automatically supported in php3.ini, Apache, Win32
registry, runtime function ini_get() and ini_alter() and any future method
we might have.
e. Allow users to easily override *ANY* php3.ini value, except for ones
they're not supposed to, of course.
I'm happy to say that I think I pretty much reached all goals. php_ini.c
implements a mechanism that lets you add your INI entry in a single place,
with a default value in case there's no php3.ini value. What you get by
using this mechanism:
1. Automatic initialization from php3.ini if available, or from the
default value if not.
2. Automatic support in ini_alter(). That means a user can change the
value for this INI entry at runtime, without you having to add in a single
line of code, and definitely no additional function (for example, in PHP3,
we had to add in special dedicated functions, like
set_magic_quotes_runtime() or the likes - no need for that anymore).
3. Automatic support in Apache .conf files.
4. No need for a global php3_ini-like variable that'll store all that
info. You can directly access each INI entry by name, in runtime. 'Sure,
that's not revolutionary, it's just slow' is probably what some of you
think - which is true, but, you can also register a callback function that
is called each time your INI entry is changed, if you wish to store it in a
cached location for intensive use.
5. Ability to access the current active value for a given INI entry, and
the 'master' value.
Of course, (2) and (3) are only applicable in some cases. Some entries
shouldn't be overriden by users in runtime or through Apache .conf files -
you can, of course, mark them as such.
So, enough hype, how does it work.
Essentially:
static PHP_INI_MH(OnChangeBar); /* declare a message handler for a change
in "bar" */
PHP_INI_BEGIN()
PHP_INI_ENTRY("foo", "1", PHP_INI_ALL, NULL, NULL)
PHP_INI_ENTRY("bar", "bah", PHP_INI_SYSTEM, OnChangeBar, NULL)
PHP_INI_END()
static PHP_INI_MH(OnChangeBar)
{
a_global_var_for_bar = new_value;
return SUCCESS;
}
int whatever_minit(INIT_FUNC_ARGS)
{
...
REGISTER_INI_ENTRIES();
...
}
int whatever_mshutdown(SHUTDOWN_FUNC_ARGS)
{
...
UNREGISTER_INI_ENTRIES();
...
}
and that's it. Here's what it does. As you can probably guess, this code
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
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
macros INI_INT("foo"), INI_FLT("foo") or INI_STR("foo"), which return a
long, double or char * respectively (strings that are returned aren't
duplicated - if they're manipulated, you must duplicate them first). You
can also access the original value (the 'master' value, in case one of them
was overriden by a user) using another pair of macros:
INI_ORIG_INT("foo"), INI_ORIG_FLT("foo") and INI_ORIG_STR("foo").
When "bar" changes, a special message handler is called, OnBarChange().
Always declare those message handlers using PHP_INI_MH(), as they might
change in the future. Message handlers are called as soon as an ini entry
initializes or changes, and allow you to cache a certain INI value in a
quick C structure. In this example, whenever "bar" changes, the new value
is stored in a_global_var_for_bar, which is a global char * pointer,
quickly accessible from other functions. Things get a bit more complicated
when you want to implement a thread-safe module, but it's doable as well.
Message handlers may return SUCCESS to acknowledge the new value, or
FAILURE to reject it. That enables you to reject invalid values for some
INI entries if you want. Finally, you can have a pointer passed to your
message handler - that's the fifth argument to PHP_INI_ENTRY(). It is
passed as mh_arg to the message handler.
Remember that for certain values, there's really no reason to mess with a
callback function. A perfect example for this are the syntax highlight
colors, which no longer have a dedicated global C slot that stores them,
but instead, are fetched from the php_ini hash on demand.
"As always", for a perfect working example of this mechanism, consult
functions/mysql.c. This module uses the new INI entry mechanism, and was
also converted to be thread safe in general, and in its php_ini support in
particular. Converting your modules to look like this for thread safety
isn't a bad idea (not necessarily now, but in the long run).
-492
View File
@@ -1,492 +0,0 @@
PHP Version 3.0 API Documentation
Table of Contents
-----------------
1. Function Prototype
2. Function Arguments
3. Variable number of function arguments
4. Using the function arguments
5. Memory management in functions
6. Setting variables in the symbol table
7. Returning values from functions
8. Returning 'complex' values from functions (arrays or objects)
9. Using the resource list
10. Using the persistent resource table
11. Adding runtime configuration directives
-----------------
1. Function Prototype
All functions look like this:
PHP_FUNCTION(foo) {
}
Even if your function doesn't take any arguments, this is how it is
called.
-----------------
2. Function Arguments
Arguments are always of type pval. This type contains a union which
has the actual type of the argument. So, if your function takes two
arguments, you would do something like the following at the top of your
function:
pval *arg1, *arg2;
if (ARG_COUNT(ht) != 2 || getParameters(ht,2,&arg1,&arg2)==FAILURE) {
WRONG_PARAM_COUNT;
}
NOTE: Arguments can be passed either by value or by reference. In both
cases you will need to pass &(pval *) to getParameters. If you want to
check if the n'th parameter was sent to you by reference or not, you can
use the function, ParameterPassedByReference(ht,n). It will return either
1 or 0.
When you change any of the passed parameters, whether they are sent by
reference or by value, you can either start over with the parameter by
calling pval_destructor on it, or if it's an ARRAY you want to add to,
you can use functions similar to the ones in internal_functions.h which
manipulate return_value as an ARRAY.
Also if you change a parameter to IS_STRING make sure you first assign
the new estrdup'ed string and the string length, and only later change the
type to IS_STRING. If you change the string of a parameter which already
IS_STRING or IS_ARRAY you should run pval_destructor on it first.
-----------------
3. Variable number of function arguments
A function can take a variable number of arguments. If your function can
take either 2 or 3 arguments, use the following:
pval *arg1, *arg2, *arg3;
int arg_count = ARG_COUNT(ht);
if (arg_count<2 || arg_count>3 ||
getParameters(ht,arg_count,&arg1,&arg2,&arg3)==FAILURE) {
WRONG_PARAM_COUNT;
}
------------------
4. Using the function arguments
The type of each argument is stored in the pval type field:
This type can be any of the following:
IS_STRING String
IS_DOUBLE Double-precision floating point
IS_LONG Long
IS_ARRAY Array
IS_EMPTY ??
IS_USER_FUNCTION ??
IS_INTERNAL_FUNCTION ?? (if some of these cannot be passed to a
function - delete)
IS_CLASS ??
IS_OBJECT ??
If you get an argument of one type and would like to use it as another,
or if you just want to force the argument to be of a certain type, you
can use one of the following conversion functions:
convert_to_long(arg1);
convert_to_double(arg1);
convert_to_string(arg1);
convert_to_boolean_long(arg1); If the string is "" or "0" it
becomes 0, 1 otherwise
convert_string_to_number(arg1); Converts string to either LONG or
DOUBLE depending on string
These function all do in-place conversion. They do not return anything.
The actual argument is stored in a union.
For type IS_STRING, use arg1->value.str.val
IS_LONG arg1->value.lval
IS_DOUBLE arg1->value.dval
-------------------
5. Memory management in functions
Any memory needed by a function should be allocated with either emalloc()
or estrdup(). These are memory handling abstraction functions that look
and smell like the normal malloc() and strdup() functions. Memory should
be freed with efree().
There are two kinds of memory in this program. Memory which is returned
to the parser in a variable and memory which you need for temporary
storage in your internal function. When you assign a string to a
variable which is returned to the parser you need to make sure you first
allocate the memory with either emalloc or estrdup. This memory
should NEVER be freed by you, unless you later, in the same function
overwrite your original assignment (this kind of programming practice is
not good though).
For any temporary/permanent memory you need in your functions/library you
should use the three emalloc(), estrdup(), and efree() functions. They
behave EXACTLY like their counterpart functions. Anything you emalloc()
or estrdup() you have to efree() at some point or another, unless it's
supposed to stick around until the end of the program, otherwise there
will be a memory leak. The meaning of "the functions behave exactly like
their counterparts" is if you efree() something which was not
emalloc()'ed nor estrdup()'ed you might get a segmentation fault. So
please take care and free all of your wasted memory. One of the biggest
improvements in PHP 3.0 will hopefully be the memory management.
If you compile with "-DDEBUG", PHP3 will print out a list of all
memory that was allocated using emalloc() and estrdup() but never
freed with efree() when it is done running the specified script.
-------------------
6. Setting variables in the symbol table
A number of macros are available which make it easier to set a variable
in the symbol table:
SET_VAR_STRING(name,value) **
SET_VAR_DOUBLE(name,value)
SET_VAR_LONG(name,value)
** Be careful here. The value part must be malloc'ed manually because
the memory management code will try to free this pointer later. Do
not pass statically allocated memory into a SET_VAR_STRING
Symbol tables in PHP 3.0 are implemented as hash tables. At any given time,
&symbol_table is a pointer to the 'main' symbol table, and active_symbol_table
points to the currently active symbol table (these may be identical like in
startup, or different, if you're inside a function).
The following examples use 'active_symbol_table'. You should replace it with
&symbol_table if you specifically want to work with the 'main' symbol table.
Also, the same funcions may be applied to arrays, as explained below.
* To check whether a variable named $foo already exists in a symbol table:
if (hash_exists(active_symbol_table,"foo",sizeof("foo"))) { exists... }
else { doesn't exist }
* If you also need to get the type of the variable, you can use:
hash_find(active_symbol_table,"foo",sizeof("foo"),&pvalue);
check(pvalue.type);
Arrays in PHP 3.0 are implemented using the same hashtables as symbol tables.
This means the two above functions can also be used to check variables
inside arrays.
If you want to define a new array in a symbol table, you should do this:
1. Possibly check it exists and abort, using hash_exists()
or hash_find().
2. Code:
pval arr;
if (array_init(&arr) == FAILURE) { failed... };
hash_update(active_symbol_table,"foo",sizeof("foo"),&arr,sizeof(pval),NULL);
This code declares a new array, named $foo, in the active symbol table.
This array is empty.
Here's how to add new entries to it:
pval entry;
entry.type = IS_LONG;
entry.value.lval = 5;
hash_update(arr.value.ht,"bar",sizeof("bar"),&entry,sizeof(pval),NULL); /* defines $foo["bar"] = 5 */
hash_index_update(arr.value.ht,7,&entry,sizeof(pval),NULL); /* defines $foo[7] = 5 */
hash_next_index_insert(arr.value.ht,&entry,sizeof(pval),NULL); /* defines the next free place in $foo[],
* $foo[8], to be 5 (works like php2)
*/
If you'd like to modify a value that you inserted to a hash, you must first retreive it from the hash. To
prevent that overhead, you can supply a pval ** to the hash add function, and it'll be updated with the
pval * address of the inserted element inside the hash. If that value is NULL (like in all of the
above examples) - that parameter is ignored.
hash_next_index_insert() works more or less using the same logic
"$foo[] = bar;" works in PHP 2.0.
If you are building an array to return from a function, you can initialize
the array just like above by doing:
if (array_init(return_value) == FAILURE) { failed...; }
and then adding values with the helper functions:
add_next_index_long(return_value,long_value);
add_next_index_double(return_value,double_value);
add_next_index_string(return_value,estrdup(string_value));
Of course, if the adding isn't done right after the array
initialization, you'd probably have to look for the array first:
pval *arr;
if (hash_find(active_symbol_table,"foo",sizeof("foo"),(void **)&arr)==FAILURE) { can't find... }
else { use arr->value.ht... }
Note that hash_find receives a pointer to a pval pointer, and
not a pval pointer.
Just about any hash function returns SUCCESS or FAILURE (except for
hash_exists() that returns a boolean truth value).
-------------------
7. Returning 'simple' values from functions (integers, floats or strings)
A number of macros are available to make it easier to return things from
functions:
These set the return value and return from the function:
RETURN_FALSE
RETURN_TRUE
RETURN_LONG(l)
RETURN_STRING(s,dup) If dup is true, duplicates the string
RETURN_STRINGL(s,l,dup) Return string (s) specifying length (l).
RETURN_DOUBLE(d)
These only set the return value:
RETVAL_FALSE
RETVAL_TRUE
RETVAL_LONG(l)
RETVAL_STRING(s,dup) If dup is true, duplicates the string
RETVAL_STRINGL(s,l,dup) Return string (s) specifying length (l).
RETVAL_DOUBLE(d)
The string macros above will all estrdup() the passed 's' argument,
so you can safely free the argument after calling the macro, or
alternatively use statically allocated memory.
If your function returns boolean success/error responses, always use
RETURN_TRUE and RETURN_FALSE respectively.
-------------------
8. Returning 'complex' values from functions (arrays or objects)
Your function can also return a complex data type such as an object
or an array.
Returning an object:
1. Call object_init(return_value).
2. Fill it up with values:
add_property_long(return_value,property_name,l) Add a property named 'property_name', of type long, equals to 'l'
add_property_double(return_value,property_name,d) Same, only a double
add_property_string(return_value,property_name,str) Same, only a string
add_property_stringl(return_value,property_name,str,l) Add a property named 'property_name', of type string, string is 'str' with length 'l'
3. Possibly, register functions for this object. In order to
obtain values from the object, the function would have to fetch
"this" from the active_symbol_table. Its type should be IS_OBJECT,
and it's basically a regular hash table (i.e., you can use regular
hash functions on .value.ht). The actual registration of the
function can be done using:
add_method(return_value,function_name,function_ptr)
Returning an array:
1. Call array_init(return_value).
2. Fill it up with values:
add_assoc_long(return_value,key,l) add associative entry with key 'key' and long value 'l'
add_assoc_double(return_value,key,d)
add_assoc_string(return_value,key,str)
add_assoc_stringl(return_value,key,str,length) specify the string length
add_index_long(return_value,index,l) add entry in index 'index' with long value 'l'
add_index_double(return_value,index,d)
add_index_string(return_value,index,str)
add_index_stringl(return_value,index,str,length) specify the string length
add_next_index_long(return_value,l) add an array entry in the next free offset with long value 'l'
add_next_index_double(return_value,d)
add_next_index_string(return_value,str)
add_next_index_stringl(return_value,str,length) specify the string length
-------------------
9. Using the resource list
PHP 3.0 has a standard way of dealing with various types of resources,
that replaces all of the local linked lists in PHP 2.0.
Available functions:
php3_list_insert(ptr, type) returns the 'id' of the newly inserted resource
php3_list_delete(id) delete the resource with the specified id
php3_list_find(id,*type) returns the pointer of the resource with the specified id, updates 'type' to the resource's type
Typically, these functions are used for SQL drivers but they can be
used for anything else, and are used, for instance, for maintaining
file descriptors.
Typical list code would look like this:
Adding a new resource:
RESOURCE *resource;
...allocate memory for resource and acquire resource...
/* add a new resource to the list */
return_value->value.lval = php3_list_insert((void *) resource, LE_RESOURCE_TYPE);
return_value->type = IS_LONG;
Using an existing resource:
pval *resource_id;
RESOURCE *resource;
int type;
convert_to_long(resource_id);
resource = php3_list_find(resource_id->value.lval, &type);
if (type != LE_RESOURCE_TYPE) {
php3_error(E_WARNING,"resource index %d has the wrong type",resource_id->value.lval);
RETURN_FALSE;
}
...use resource...
Deleting an existing resource:
pval *resource_id;
RESOURCE *resource;
int type;
convert_to_long(resource_id);
php3_list_delete(resource_id->value.lval);
The resource types should be registered in php3_list.h, in enum
list_entry_type. In addition, one should add shutdown code for any
new resource type defined, in list.c's list_entry_destructor() (even if
you don't have anything to do on shutdown, you must add an empty case).
-------------------
10. Using the persistent resource table
PHP 3.0 has a standard way of storing persistent resources (i.e.,
resources that are kept in between hits). The first module to use
this feature was the MySQL module, and mSQL followed it, so one can
get the general impression of how a persistent resource should be
used by reading mysql.c. The functions you should look at are:
php3_mysql_do_connect()
php3_mysql_connect()
php3_mysql_pconnect()
The general idea of persistence modules is this:
1. Code all of your module to work with the regular resource list
mentioned in section (9).
2. Code extra connect functions that check if the resource already
exists in the persistent resource list. If it does, register it
as in the regular resource list as a pointer to the persistent
resource list (because of 1., the rest of the code
should work immediately). If it doesn't, then create it, add it
to the persistent resource list AND add a pointer to it from the
regular resource list, so all of the code would work since it's
in the regular resource list, but on the next connect, the
resource would be found in the persistent resource list and be
used without having to recreate it.
You should register these resources with a different type (e.g.
LE_MYSQL_LINK for non-persistent link and LE_MYSQL_PLINK for
a persistent link).
If you read mysql.c, you'll notice that except for the more complex
connect function, nothing in the rest of the module has to be changed.
The very same interface exists for the regular resource list and the
persistent resource list, only 'list' is replaced with 'plist':
php3_plist_insert(ptr, type) returns the 'id' of the newly inserted resource
php3_plist_delete(id) delete the resource with the specified id
php3_plist_find(id,*type) returns the pointer of the resource with the specified id, updates 'type' to the resource's type
However, it's more than likely that these functions would prove
to be useless for you when trying to implement a persistent module.
Typically, one would want to use the fact that the persistent resource
list is really a hash table. For instance, in the MySQL/mSQL modules,
when there's a pconnect() call (persistent connect), the function
builds a string out of the host/user/passwd that were passed to the
function, and hashes the SQL link with this string as a key. The next
time someone calls a pconnect() with the same host/user/passwd, the
same key would be generated, and the function would find the SQL link
in the persistent list.
Until further documented, you should look at mysql.c or msql.c to
see how one should use the plist's hash table abilities.
One important thing to note: resources going into the persistent
resource list must *NOT* be allocated with PHP's memory manager, i.e.,
they should NOT be created with emalloc(), estrdup(), etc. Rather,
one should use the regular malloc(), strdup(), etc. The reason for
this is simple - at the end of the request (end of the hit), every
memory chunk that was allocated using PHP's memory manager is deleted.
Since the persistent list isn't supposed to be erased at the end
of a request, one mustn't use PHP's memory manager for allocating
resources that go to it.
Shutting down persistent resources:
When you register resource that's going to be in the persistent list,
you should add destructors to it both in the non-persistent list
and in the persistent list.
The destructor in the non-persistent list destructor shouldn't do anything.
The one in the persistent list destructor should properly free any
resources obtained by that type (e.g. memory, SQL links, etc). Just like
with the non-persistent resources, you *MUST* add destructors for every
resource, even it requires no destructotion and the destructor would
be empty.
Remember, since emalloc() and friends aren't to be used in conjunction
with the persistent list, you mustn't use efree() here either.
-------------------
11. Adding runtime configuration directives
Many of the features of PHP3 can be configured at runtime. These
configuration directives can appear in either the designated php3.ini
file, or in the case of the Apache module version in the Apache .conf
files. The advantage of having them in the Apache .conf files is that
they can be configured on a per-directory basis. This means that one
directory may have a certain safemodeexecdir for example, while another
directory may have another. This configuration granularity is especially
handy when a server supports multiple virtual hosts.
The steps required to add a new directive:
1. Add directive to php3_ini_structure struct in mod_php4.h.
2. In main.c, edit the php3_module_startup function and add the
appropriate cfg_get_string() or cfg_get_long() call.
3. Add the directive, restrictions and a comment to the php3_commands
structure in mod_php4.c. Note the restrictions part. RSRC_CONF are
directives that can only be present in the actual Apache .conf files.
Any OR_OPTIONS directives can be present anywhere, include normal
.htaccess files.
4. In either php3take1handler() or php3flaghandler() add the appropriate
entry for your directive.
5. In the configuration section of the _php3_info() function in
functions/info.c you need to add your new directive.
6. And last, you of course have to use your new directive somewhere.
It will be addressable as php3_ini.directive
-90
View File
@@ -1,90 +0,0 @@
/* -*- C -*-
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| 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 both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
+----------------------------------------------------------------------+
*/
#define PHP_ADA_INCLUDE ""
#define PHP_ADA_LFLAGS ""
#define PHP_ADA_LIBS ""
#define PHP_APACHE_INCLUDE ""
#define PHP_APACHE_TARGET ""
#define PHP_FHTTPD_INCLUDE ""
#define PHP_FHTTPD_LIB ""
#define PHP_FHTTPD_TARGET ""
#define PHP_BINNAME "@BINNAME@"
#define PHP_CFLAGS "@CFLAGS@"
#define PHP_DBASE_LIB ""
#define PHP_DEBUG "@DEBUG_CFLAGS@"
#define PHP_GDBM_INCLUDE ""
#define PHP_HSREGEX ""
#define PHP_IBASE_INCLUDE ""
#define PHP_IBASE_LFLAGS ""
#define PHP_IBASE_LIBS ""
#define PHP_IFX_INCLUDE ""
#define PHP_IFX_LFLAGS ""
#define PHP_IFX_LIBS ""
#define PHP_INSTALL_IT "@INSTALL_IT@"
#define PHP_IODBC_INCLUDE ""
#define PHP_IODBC_LFLAGS ""
#define PHP_IODBC_LIBS ""
#define PHP_MSQL_INCLUDE ""
#define PHP_MSQL_LFLAGS ""
#define PHP_MSQL_LIBS ""
#define PHP_MYSQL_INCLUDE ""
#define PHP_MYSQL_LFLAGS ""
#define PHP_MYSQL_LIBS ""
#define PHP_ODBC_TYPE "@ODBC_TYPE@"
#define PHP_ODBC_INCLUDE "@ODBC_INCLUDE@"
#define PHP_ODBC_LFLAGS "@ODBC_LFLAGS@"
#define PHP_ODBC_LIBS "@ODBC_LIBS@"
#define PHP_ORACLE_HOME ""
#define PHP_ORACLE_INCLUDE ""
#define PHP_ORACLE_LFLAGS ""
#define PHP_ORACLE_LIBS ""
#define PHP_ORACLE_SHLIBS ""
#define PHP_ORACLE_STLIBS ""
#define PHP_ORACLE_VERSION ""
#define PHP_PGSQL_INCLUDE ""
#define PHP_PGSQL_LFLAGS ""
#define PHP_PGSQL_LIBS ""
#define PHP_PROG_SENDMAIL "@PROG_SENDMAIL@"
#define PHP_REGEX_LIB ""
#define PHP_SOLID_INCLUDE ""
#define PHP_SOLID_LIBS ""
#define PHP_EMPRESS_INCLUDE ""
#define PHP_EMPRESS_LIBS ""
#define PHP_SYBASE_INCLUDE ""
#define PHP_SYBASE_LFLAGS ""
#define PHP_SYBASE_LIBS ""
#define PHP_DBM_TYPE ""
#define PHP_DBM_LIB ""
#define PHP_LDAP_LFLAGS ""
#define PHP_LDAP_INCLUDE ""
#define PHP_LDAP_LIBS ""
#define PHP_VELOCIS_INCLUDE ""
#define PHP_VELOCIS_LIBS ""
-151
View File
@@ -1,151 +0,0 @@
#!/bin/sh
supplied_flag=$1
# do some version checking for the tools we use
if test "$1" = "--force"; then
shift
# this is a posix correct "test -nt"
elif test "`ls -t buildconf buildconf.stamp 2>/dev/null |head -1`" != "buildconf"; then
:
else
echo "buildconf: checking installation..."
# autoconf 2.13 or newer
ac_version=`autoconf --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
if test "$ac_version" = ""; then
echo "buildconf: autoconf not found."
echo " You need autoconf version 2.13 or newer installed"
echo " to build PHP from CVS."
exit 1
fi
IFS=.; set $ac_version; IFS=' '
if test "$1" = "2" -a "$2" -lt "13" || test "$1" -lt "2"; then
echo "buildconf: autoconf version $ac_version found."
echo " You need autoconf version 2.13 or newer installed"
echo " to build PHP from CVS."
exit 1
else
echo "buildconf: autoconf version $ac_version (ok)"
fi
# automake 1.4 or newer
am_version=`automake --version 2>/dev/null|head -1|sed -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
if test "$am_version" = ""; then
echo "buildconf: automake not found."
echo " You need automake version 1.4 or newer installed"
echo " to build PHP from CVS."
exit 1
fi
IFS=.; set $am_version; IFS=' '
if test "$1" = "1" -a "$2" -lt "4" || test "$1" -lt "1"; then
echo "buildconf: automake version $am_version found."
echo " You need automake version 1.4 or newer installed"
echo " to build PHP from CVS."
exit 1
else
echo "buildconf: automake version $am_version (ok)"
fi
# libtool 1.3.3 or newer
lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
if test "$lt_pversion" = ""; then
echo "buildconf: libtool not found."
echo " You need libtool version 1.3 or newer installed"
echo " to build PHP from CVS."
exit 1
fi
lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
IFS=.; set $lt_version; IFS=' '
if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" -a "$3" -ge "3"
then
echo "buildconf: libtool version $lt_pversion (ok)"
else
echo "buildconf: libtool version $lt_pversion found."
echo " You need libtool version 1.3.3 or newer installed"
echo " to build PHP from CVS."
exit 1
fi
touch buildconf.stamp
fi
am_prefix=`which automake | sed -e 's#/[^/]*/[^/]*$##'`
lt_prefix=`which libtool | sed -e 's#/[^/]*/[^/]*$##'`
if test "$am_prefix" != "$lt_prefix"; then
echo "buildconf: WARNING: automake and libtool are installed in different"
echo " directories. This may cause aclocal to fail."
echo "buildconf: continuing anyway"
fi
if test "$supplied_flag" = "--copy"; then
automake_flags=--copy
fi
if test ! -d libzend; then
if test -d ../libzend; then
echo "buildconf: linking ../libzend to ./libzend"
ln -s ../libzend .
else
echo "buildconf: can not find libzend"
echo " libzend should be installed in . or .., how to fetch:"
echo ""
echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository login"
echo " (password \"zend\")"
echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository co libzend"
echo ""
exit 1
fi
fi
if test ! -d TSRM; then
if test -d ../TSRM; then
echo "buildconf: linking ../TSRM to ./TSRM"
ln -s ../TSRM .
else
echo "buildconf: can not find TSRM"
echo " TSRM should be installed in . or .., how to fetch:"
echo ""
echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository login"
echo " (password \"zend\")"
echo " cvs -d :pserver:cvsread@cvs.zend.com:/repository co TSRM"
echo ""
exit 1
fi
fi
./scripts/preconfig
libtoolize --automake $automake_flags --force
mv aclocal.m4 aclocal.m4.old 2>/dev/null
aclocal
if test "$?" != "0" -a "$am_prefix" != "$lt_prefix"; then
echo "buildconf: ERROR: aclocal failed, probably because automake and"
echo " libtool are installed with different prefixes;"
echo " automake is installed in $am_prefix, but libtool in $lt_prefix."
echo " Please re-install automake and/or libtool with a common prefix"
echo " and try again."
exit 1
fi
if cmp aclocal.m4.old aclocal.m4 > /dev/null 2>&1; then
echo "buildconf: keeping aclocal.m4"
mv aclocal.m4.old aclocal.m4
else
echo "buildconf: created or modified aclocal.m4"
fi
autoheader
automake --add-missing --include-deps $automake_flags
mv configure configure.old 2>/dev/null
autoconf
if cmp configure.old configure > /dev/null 2>&1; then
echo "buildconf: keeping configure"
mv configure.old configure
else
echo "buildconf: created or modified configure"
fi
(cd libzend; ./buildconf libzend/)
(cd TSRM; ./buildconf TSRM/)
-244
View File
@@ -1,244 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on calendar.dsp
!IF "$(CFG)" == ""
CFG=calendar - Win32 Debug
!MESSAGE No configuration specified. Defaulting to calendar - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "calendar - Win32 Release" && "$(CFG)" != "calendar - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "calendar.mak" CFG="calendar - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "calendar - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "calendar - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "calendar - Win32 Release"
OUTDIR=.\module_release
INTDIR=.\module_release
# Begin Custom Macros
OutDir=.\module_release
# End Custom Macros
ALL : "$(OUTDIR)\php3_calendar.dll"
CLEAN :
-@erase "$(INTDIR)\calendar.obj"
-@erase "$(INTDIR)\dow.obj"
-@erase "$(INTDIR)\french.obj"
-@erase "$(INTDIR)\gregor.obj"
-@erase "$(INTDIR)\jewish.obj"
-@erase "$(INTDIR)\julian.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\php3_calendar.dll"
-@erase "$(OUTDIR)\php3_calendar.exp"
-@erase "$(OUTDIR)\php3_calendar.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "./" /I "../" /D "NDEBUG" /D "COMPILE_DL" /D "MSVC5" /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\calendar.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
RSC=rc.exe
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\calendar.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=php.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:1 /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\php3_calendar.pdb" /machine:I386 /out:"$(OUTDIR)\php3_calendar.dll" /implib:"$(OUTDIR)\php3_calendar.lib" /libpath:"cgi_release"
LINK32_OBJS= \
"$(INTDIR)\calendar.obj" \
"$(INTDIR)\dow.obj" \
"$(INTDIR)\french.obj" \
"$(INTDIR)\gregor.obj" \
"$(INTDIR)\jewish.obj" \
"$(INTDIR)\julian.obj"
"$(OUTDIR)\php3_calendar.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "calendar - Win32 Debug"
OUTDIR=.\module_debug
INTDIR=.\module_debug
# Begin Custom Macros
OutDir=.\module_debug
# End Custom Macros
ALL : "$(OUTDIR)\php3_calendar.dll"
CLEAN :
-@erase "$(INTDIR)\calendar.obj"
-@erase "$(INTDIR)\dow.obj"
-@erase "$(INTDIR)\french.obj"
-@erase "$(INTDIR)\gregor.obj"
-@erase "$(INTDIR)\jewish.obj"
-@erase "$(INTDIR)\julian.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\php3_calendar.dll"
-@erase "$(OUTDIR)\php3_calendar.exp"
-@erase "$(OUTDIR)\php3_calendar.ilk"
-@erase "$(OUTDIR)\php3_calendar.lib"
-@erase "$(OUTDIR)\php3_calendar.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "./" /I "../" /D "DEBUG" /D "_DEBUG" /D "COMPILE_DL" /D "MSVC5" /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\calendar.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
RSC=rc.exe
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\calendar.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=php.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:1 /subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)\php3_calendar.pdb" /debug /machine:I386 /out:"$(OUTDIR)\php3_calendar.dll" /implib:"$(OUTDIR)\php3_calendar.lib" /pdbtype:sept /libpath:"cgi_debug"
LINK32_OBJS= \
"$(INTDIR)\calendar.obj" \
"$(INTDIR)\dow.obj" \
"$(INTDIR)\french.obj" \
"$(INTDIR)\gregor.obj" \
"$(INTDIR)\jewish.obj" \
"$(INTDIR)\julian.obj"
"$(OUTDIR)\php3_calendar.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("calendar.dep")
!INCLUDE "calendar.dep"
!ELSE
!MESSAGE Warning: cannot find "calendar.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "calendar - Win32 Release" || "$(CFG)" == "calendar - Win32 Debug"
SOURCE=.\dl\calendar\calendar.c
"$(INTDIR)\calendar.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dl\calendar\dow.c
"$(INTDIR)\dow.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dl\calendar\french.c
"$(INTDIR)\french.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dl\calendar\gregor.c
"$(INTDIR)\gregor.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dl\calendar\jewish.c
"$(INTDIR)\jewish.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dl\calendar\julian.c
"$(INTDIR)\julian.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ENDIF
-798
View File
@@ -1,798 +0,0 @@
dnl ## $Id$ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(0)
AC_INIT(main.c)
if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
echo ""
echo "ERROR: --with-shared-apache is not supported."
echo " Please read INSTALL.DSO for instructions on using APXS."
exit 1
fi
if test "$no_recursion" != "yes"; then
cwd=`pwd`
cachefile=$cwd/config.cache
(set -x; test -d libzend || mkdir libzend; cd libzend; $cwd/$srcdir/libzend/configure --cache-file=$cachefile $@) || exit 1
if test "$enable_thread_safety" = "yes"; then
(set -x; test -d TSRM || mkdir TSRM; cd TSRM && $cwd/$srcdir/TSRM/configure --cache-file=$cachefile $@) || exit 1
fi
(set -x; cd $srcdir; sh ltconfig --disable-static --enable-dlopen --cache-file=$cachefile ltmain.sh)
fi
dnl ## Diversion 1 is the initial checking of OS features, programs,
dnl ## libraries and so on.
dnl ## In diversion 2 we check for compile-time options to the PHP
dnl ## core and how to deal with different system dependencies. This
dnl ## includes what regex library is used and whether debugging or short
dnl ## tags are enabled, and the default behaviour of php.ini options.
dnl ## This is also where an SAPI interface is selected (choosing between
dnl ## Apache module, CGI etc.)
dnl ## In diversion 3 we check which extensions should be compiled.
dnl ## All of these are normally in the extension directories.
dnl ## Diversion 4 is the last one. Here we generate files and clean up.
divert(1)
dnl ## This is where the version number is changed from now on!
AM_INIT_AUTOMAKE(php, 4.0B3-dev)
PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
echo "/* edit configure.in.in to change version number */" >> php_version.h.new
echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
cmp php_version.h.new php_version.h >/dev/null 2>&1
if test $? -ne 0 ; then
rm -f php_version.h && mv php_version.h.new php_version.h && \
echo 'Updated php_version.h'
else
rm -f php_version.h.new
fi
AC_SUBST(PHP_VERSION)
AM_CONFIG_HEADER(php_config.h)
AM_MAINTAINER_MODE
phplibdir=$libdir/php
AC_SUBST(phplibdir)
dnl We want this one before the checks, so the checks can modify CFLAGS.
test -z "$CFLAGS" && auto_cflags=1
dnl If we're using cc on HP-UX, add -Ae -D_HPUX_SOURCE [obsolete]
dnl if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"; then
dnl test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE"
dnl fi
dnl Checks for programs.
AM_PROG_LIBTOOL
AM_SET_LIBTOOL_VARIABLE([--silent])
AC_PROG_YACC
if test "$YACC" != "bison -y"; then
AC_MSG_WARN(You will need bison if you want to regenerate the PHP parsers.)
else
AC_MSG_CHECKING(bison version)
oldIFS=$IFS; IFS=.
set `bison -V | sed -e 's/^GNU Bison version //'`
IFS=$oldIFS
if test "$1" = "1" -a "$2" -lt "25"; then
AC_MSG_WARN(Bison 1.25 or newer needed to regenerate parsers (found $1.$2).)
fi
AC_MSG_RESULT($1.$2 (ok))
fi
dnl ## there has to be a better way...
dnl## OLDLIBS=$LIBS; LIBS=""
AC_PROG_CC
dnl## LIBS=$OLDLIBS
AM_PROG_CC_STDC
AC_PROG_RANLIB
AC_PROG_CC_C_O
AC_PROG_LN_S
AC_PATH_PROG(PERL_PATH, perl)
dnl Make flex scanners use const if they can, even if __STDC__ is not
dnl true, for compilers like Sun's that only set __STDC__ true in
dnl "limit-to-ANSI-standard" mode, not in "ANSI-compatible" mode
AC_C_CONST
if test "$ac_cv_c_const" = "yes" ; then
LEX_CFLAGS="-DYY_USE_CONST"
fi
AC_SUBST(LEX_CFLAGS)
dnl Hack to work around a Mac OS X cpp problem
dnl Known versions needing this workaround are 5.3 and 5.4
if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
CPPFLAGS="$CPPFLAGS -traditional-cpp"
fi
dnl Ugly hack to get around a problem with gcc on AIX.
if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
"`uname -sv`" = "AIX 4"; then
CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
fi
dnl check for -R, etc. switch
AC_MSG_CHECKING(if compiler supports -R)
AC_CACHE_VAL(php_cv_cc_dashr,[
SAVE_LIBS="${LIBS}"
LIBS="-R /usr/lib ${LIBS}"
AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
LIBS="${SAVE_LIBS}"])
AC_MSG_RESULT($php_cv_cc_dashr)
if test $php_cv_cc_dashr = "yes"; then
ld_runpath_switch="-R"
apxs_runpath_switch="-Wl,-R'"
else
AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
AC_CACHE_VAL(php_cv_cc_rpath,[
SAVE_LIBS="${LIBS}"
LIBS="-Wl,-rpath,/usr/lib ${LIBS}"
AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
LIBS="${SAVE_LIBS}"])
AC_MSG_RESULT($php_cv_cc_rpath)
if test $php_cv_cc_rpath = "yes"; then
ld_runpath_switch="-Wl,-rpath,"
apxs_runpath_switch="-Wl,'-rpath "
else
dnl something innocuous
ld_runpath_switch="-L"
apxs_runpath_switch="-L'"
fi
fi
AC_MSG_CHECKING([if compiler supports -Wl,--version-script])
AC_CACHE_VAL(php_cv_cc_vscript,[
SLIBS=$LIBS
LIBS="-Wl,--version-script=$srcdir/php.map $LIBS"
AC_TRY_LINK([],[],php_cv_cc_vscript=yes,php_cv_cc_vscript=no)
LIBS=$SLIBS ])
AC_MSG_RESULT($php_cv_cc_vscript)
dnl Check compiler support for -rdynamic
AC_MSG_CHECKING(if compiler supports -rdynamic)
AC_CACHE_VAL(php_cc_rdynamic,[
SAVE_LIBS="${LIBS}"
LIBS="-rdynamic ${LIBS}"
AC_TRY_LINK([], [], php_cc_rdynamic=yes, php_cc_rdynamic=no)
LIBS="${SAVE_LIBS}"])
AC_MSG_RESULT($php_cc_rdynamic)
if test $php_cc_rdynamic = "yes"; then
AC_CHECK_CC_OPTION(rdynamic)
fi
if test $php_cc_rdynamic = "yes"; then
LDFLAGS="${LDFLAGS} -rdynamic"
RDYNAMIC_LFLAGS="-rdynamic"
else
RDYNAMIC_LFLAGS=""
fi
AC_SUBST(RDYNAMIC_LFLAGS)
dnl AC_PROG_INSTALL
AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH /usr/bin /usr/sbin /usr/etc /etc /usr/ucblib)
if test -n "$PROG_SENDMAIL"; then
AC_DEFINE(HAVE_SENDMAIL)
fi
dnl
dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
dnl and source packages. This should be harmless on other OSs.
dnl
if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
CFLAGS="$CFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
fi
INCLUDES="-I\$(top_builddir)/libzend -I\$(top_builddir)/TSRM"
EXTRA_LIBS="$EXTRA_LIBS \`\$(SHELL) ./libzend/zend_config --libs\`"
AC_SUBST(INCLUDES)
AC_CHECK_LIB(nsl, gethostname, [
AC_ADD_LIBRARY(nsl)
AC_DEFINE(HAVE_LIBNSL) ], [])
AC_CHECK_LIB(socket, socket, [
AC_ADD_LIBRARY(socket)
AC_DEFINE(HAVE_LIBSOCKET) ], [])
AC_CHECK_LIB(nsl, gethostbyaddr, [
AC_ADD_LIBRARY(nsl)
AC_DEFINE(HAVE_LIBNSL) ], [])
AC_CHECK_LIB(crypt, crypt, [
AC_ADD_LIBRARY(crypt)
AC_DEFINE(HAVE_LIBCRYPT) ], [])
dnl The sin may be in a library which need not be specifed
dnl as well as res_search resides in libsocket
AC_CHECK_LIB(m, sin)
dnl The res_search may be in libsocket as well, and if it is
dnl make sure to check for dn_skipname in libresolv, or if res_search
dnl is in neither of these libs, still check for dn_skipname in libresolv
AC_CHECK_LIB(socket, res_search, [
AC_CHECK_LIB(resolv, dn_skipname)
AC_CHECK_LIB(resolv, __dn_skipname)
LIBS="$LIBS -lsocket"
AC_DEFINE(HAVE_LIBSOCKET) ], [
AC_CHECK_LIB(resolv, res_search, [
LIBS="$LIBS -lresolv"
AC_DEFINE(HAVE_LIBRESOLV)
], [
AC_CHECK_LIB(resolv, dn_skipname)
AC_CHECK_LIB(resolv, __dn_skipname)
])
])
dnl Checks for header files.
AC_HEADER_STDC
dnl In QNX opendir resides in libc but dirent.h is still required
if test "`uname -s 2>/dev/null`" != "QNX"; then
AC_HEADER_DIRENT
else
AC_CHECK_HEADERS(dirent.h)
fi
AC_MISSING_FCLOSE_DECL
dnl QNX requires unix.h to allow functions in libunix to work properly
AC_CHECK_HEADERS(
arpa/inet.h \
crypt.h \
dlfcn.h \
fcntl.h \
grp.h \
limits.h \
locale.h \
memory.h \
netinet/in.h \
pwd.h \
signal.h \
stdarg.h \
stdlib.h \
string.h \
sys/file.h \
sys/mman.h \
sys/select.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
sys/time.h \
sys/types.h \
sys/varargs.h \
sys/wait.h \
syslog.h \
unistd.h \
unix.h \
)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;],
ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])
if test "$ac_cv_struct_tm_gmtoff" = yes; then
AC_DEFINE(HAVE_TM_GMTOFF)
fi
AC_CACHE_CHECK(for struct flock,php_struct_flock,
AC_TRY_COMPILE([
#include <unistd.h>
#include <fcntl.h>
],
[struct flock x;],
[
php_struct_flock=yes
],[
php_struct_flock=no
])
)
if test "$php_struct_flock" = "yes" ; then
AC_DEFINE(HAVE_STRUCT_FLOCK, 1)
else
AC_DEFINE(HAVE_STRUCT_FLOCK, 0)
fi
AC_CHECK_SIZEOF(long, 8)
AC_CHECK_SIZEOF(int, 4)
dnl Check for members of the stat structure
AC_STRUCT_ST_BLKSIZE
dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists
dnl The WARNING_LEVEL required because cc in QNX hates -w option without an argument
if test "`uname -s 2>/dev/null`" != "QNX"; then
AC_STRUCT_ST_BLOCKS
else
AC_MSG_WARN(warnings level for cc set to 0)
WARNING_LEVEL=0
AC_SUBST(WARNING_LEVEL)
fi
AC_STRUCT_ST_RDEV
dnl Checks for types
AC_TYPE_SIZE_T
AC_TYPE_UID_T
dnl This is required for QNX and may be some BSD derived systems
AC_CHECK_TYPE( uint, unsigned int )
AC_CHECK_TYPE( ulong, unsigned long )
dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(
crypt \
cuserid \
flock \
gcvt \
getlogin \
gethostbyaddr \
gettimeofday \
inet_aton \
link \
lockf \
lrand48 \
memcpy \
memmove \
mmap \
putenv \
random \
regcomp \
rint \
setitimer \
setlocale \
setsockopt \
setvbuf \
shutdown \
sin \
snprintf \
srand48 \
srandom \
statfs \
statvfs \
strcasecmp \
strdup \
strerror \
strftime \
strstr \
symlink \
tempnam \
tzset \
unsetenv \
usleep \
utime \
vsnprintf \
)
AC_REPLACE_FUNCS(strlcat strlcpy)
AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
dnl## OLDLIBS=$LIBS; LIBS=""
dnl This is also defined/used in libzend. To avoid a redefinition
dnl we use that version
dnl AC_BROKEN_SPRINTF
dnl## LIBS=$OLDLIBS
AC_REPLACE_FUNCS(getopt)
dnl AIX keeps in_addr_t in /usr/include/netinet/in.h
dnl AC_MSG_CHECKING(for in_addr_t)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
<<in_addr_t[^a-zA-Z_0-9]>>dnl
changequote([,]), [#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl
dnl AC_MSG_RESULT($ac_cv_type_in_addr_t)
if test $ac_cv_type_in_addr_t = no; then
AC_DEFINE(in_addr_t, u_int)
fi
divert(2)
abs_srcdir=`(cd $srcdir; pwd)`
abs_builddir=`pwd`
AC_SUBST(abs_srcdir)
AC_SUBST(abs_builddir)
versioning="no"
AC_MSG_CHECKING(whether to enable versioning)
AC_ARG_ENABLE(versioning,
[ --enable-versioning Take advantage of versioning and scoping.
See INSTALL for more information],
[
if test "$enableval" = "yes" ; then
case "`uname -sr`" in
"SunOS 5"*)
VERSION_SCRIPT="-Wl,'-M $abs_srcdir/php.map'"
;;
*)
if test "$php_cv_cc_vscript" = "yes" ; then
VERSION_SCRIPT="-Wl,--version-script=$abs_srcdir/php.map"
else
AC_MSG_ERROR(versioning is not supported on your OS)
fi
;;
esac
versioning="yes"
fi
])
AC_MSG_RESULT($versioning)
AC_SUBST(VERSION_SCRIPT)
AC_MSG_CHECKING(whether to use bundled regex library)
AC_ARG_WITH(system-regex,
[ --with-system-regex Do not use the bundled regex library],
[
if test -n "$APXS"; then
if test -n "`$APXS -q CFLAGS | grep USE_HSREGEX`"; then
HSREGEX=yes
else
HSREGEX=no
fi
else
if test "$withval" = "no"; then
HSREGEX=yes
else
HSREGEX=no
fi
fi
],[
if test -n "$APXS"; then
if test -n "`$APXS -q CFLAGS | grep USE_HSREGEX`"; then
HSREGEX=yes
else
HSREGEX=no
fi
else
HSREGEX=yes
fi
])
AC_MSG_RESULT($HSREGEX)
if test "$HSREGEX" = "yes"; then
REGEX_LIB=regex/libregex.a
EXTRA_LIBS="-L$abs_builddir/regex -lregex $EXTRA_LIBS"
AC_DEFINE(HSREGEX)
AC_DEFINE(REGEX,1)
else
REGEX_LIB=
AC_DEFINE(REGEX,0)
fi
AC_SUBST(REGEX_LIB)
AC_SUBST(HSREGEX)
AC_MSG_CHECKING(whether to use a configuration file)
AC_ARG_WITH(config-file-path,
[ --with-config-file-path=PATH
Sets the path in which to look for php.ini.
defaults to /usr/local/lib],
[
if test "$withval" = "yes"; then
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "/usr/local/lib")
AC_DEFINE(USE_CONFIG_FILE, 1)
AC_MSG_RESULT(yes)
else
if test "$withval" != "no"; then
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "$withval")
AC_DEFINE(USE_CONFIG_FILE, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(CONFIGURATION_FILE_PATH, 0)
AC_DEFINE(USE_CONFIG_FILE, 0)
AC_MSG_RESULT(no)
fi
fi
],[
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "/usr/local/lib")
AC_DEFINE(USE_CONFIG_FILE, 1)
AC_MSG_RESULT(yes)
])
AC_MSG_CHECKING(whether to include debugging symbols)
AC_ARG_ENABLE(debug,
[ --disable-debug Compile without debugging symbols],
[
if test "$enableval" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(DEBUG,1)
PHP_DEBUG=1
DEBUG_CFLAGS="-g"
test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
else
AC_MSG_RESULT(no)
AC_DEFINE(DEBUG,0)
PHP_DEBUG=0
DEBUG_CFLAGS=""
fi
],[
AC_MSG_RESULT(yes)
AC_DEFINE(DEBUG,1)
PHP_DEBUG=1
DEBUG_CFLAGS="-g"
])
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(PHP_DEBUG)
CFLAGS="$CFLAGS $DEBUG_CFLAGS"
AC_MSG_CHECKING(whether to enable safe mode by default)
AC_ARG_ENABLE(safe-mode,
[ --enable-safe-mode Enable safe mode by default.],
[
if test "$enableval" = "yes"; then
AC_DEFINE(PHP_SAFE_MODE, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(PHP_SAFE_MODE, 0)
AC_MSG_RESULT(no)
fi
],[
AC_DEFINE(PHP_SAFE_MODE, 0)
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for safe mode exec dir)
AC_ARG_WITH(exec-dir,
[ --with-exec-dir[=DIR] Only allow executables in DIR when in safe mode
defaults to /usr/local/php/bin],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin")
AC_MSG_RESULT(/usr/local/php/bin)
else
AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR,"$withval")
AC_MSG_RESULT($withval)
fi
else
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin")
AC_MSG_RESULT(/usr/local/php/bin)
fi
],[
AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin")
AC_MSG_RESULT(/usr/local/php/bin)
])
AC_MSG_CHECKING(whether to enable track_vars variables by default)
AC_ARG_ENABLE(track-vars,
[ --enable-track-vars Enable GET/POST/Cookie track variables by default.],
[
if test "$enableval" = "yes"; then
AC_DEFINE(PHP_TRACK_VARS, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(PHP_TRACK_VARS, 0)
AC_MSG_RESULT(no)
fi
],[
AC_DEFINE(PHP_TRACK_VARS, 0)
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(whether to enable magic quotes by default)
AC_ARG_ENABLE(magic-quotes,
[ --enable-magic-quotes Enable magic quotes by default.],
[
if test "$enableval" = "yes"; then
AC_DEFINE(MAGIC_QUOTES, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(MAGIC_QUOTES, 0)
AC_MSG_RESULT(no)
fi
],[
AC_DEFINE(MAGIC_QUOTES, 0)
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(whether to build PHP thread-safe)
AC_ARG_ENABLE(thread-safety,
[ --enable-thread-safety Whether to build PHP thread-safe.],[
TSRM_LIB='TSRM/libtsrm.a'
TSRM_DIR=TSRM
EXTRA_LIBS="$EXTRA_LIBS \$(TSRM_DIR)/libtsrm.a \`\$(SHELL) \$(TSRM_DIR)/tsrm_config --libs\`"
AC_DEFINE(ZTS)
],[
TSRM_DIR=""
])
AC_SUBST(TSRM_DIR)
AC_SUBST(TSRM_LIB)
AC_MSG_CHECKING(whether to enable runpaths)
AC_ARG_ENABLE(rpath,
[ --disable-rpath Disable passing additional runtime library
search paths],
[
if test "$enableval" = "no"; then
enable_rpath=no
else
enable_rpath=yes
fi
],[
enable_rpath=yes
])
AC_MSG_RESULT($enable_rpath)
AC_MSG_CHECKING(whether to enable short tags by default)
AC_ARG_ENABLE(short-tags,
[ --disable-short-tags Disable the short-form <? start tag by default.],
[
if test "$enableval" = "no"; then
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, 0)
AC_MSG_RESULT(no)
else
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, 1)
AC_MSG_RESULT(yes)
fi
],[
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, 1)
AC_MSG_RESULT(yes)
])
AC_MSG_CHECKING(whether to enable the URL-aware fopen wrapper)
AC_ARG_ENABLE(url-fopen-wrapper,
[ --disable-url-fopen-wrapper
Disable the URL-aware fopen wrapper that allows
accessing files via http or ftp.],
[
if test "$enableval" = "yes"; then
AC_DEFINE(PHP3_URL_FOPEN, 1)
AC_MSG_RESULT(yes)
else
AC_DEFINE(PHP3_URL_FOPEN, 0)
AC_MSG_RESULT(no)
fi
],[
AC_DEFINE(PHP3_URL_FOPEN, 1)
AC_MSG_RESULT(yes)
])
DMALLOC_RESULT=no
AC_MSG_CHECKING(whether to enable dmalloc)
AC_ARG_ENABLE(dmalloc,
[ --enable-dmalloc Enable dmalloc],
[
if test "$enableval" = "yes" ; then
AC_DEFINE(HAVE_DMALLOC, 1)
AC_ADD_LIBRARY(dmalloc)
CFLAGS="$CFLAGS -DDMALLOC_FUNC_CHECK"
DMALLOC_RESULT=yes
fi
])
AC_MSG_RESULT($DMALLOC_RESULT)
dnl ## This is the default server API.
PHP_SAPI=cgi
SAPI_TARGET=php
esyscmd(./scripts/config-stubs sapi)
divert(3)
AC_SUBST(EXTRA_LIBS)
# reading config stubs
esyscmd(./scripts/config-stubs ext)
divert(4)
dnl If we are using gcc and the user has not specified CFLAGS, add -O2.
test -n "$auto_cflags" && test -n "$GCC" && CFLAGS="$CFLAGS -O2"
dnl *** Commented out - generates slow code and consumes a lot of
dnl *** resources during compilation - we need to figure out how
dnl *** to supply it only when absolutely necessary
dnl If we are using gcc add -fpic to make dl() work on some platforms
dnl test -n "$GCC" && CFLAGS="$CFLAGS -fpic"
dnl add -fPIC option on Solaris if we are building dynamic extensions
PHP_SOLARIS_PIC_WEIRDNESS
AC_BUILD_RPATH
AC_SUBST(CFLAGS)
AC_SUBST(PROG_SENDMAIL)
AC_SUBST(CFLAGS_SHLIB)
AC_SUBST(LDFLAGS_SHLIB)
AC_SUBST(LDFLAGS_SHLIB_EXPORT)
AC_SUBST(RPATHS)
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
AC_SUBST(PHP_BUILD_DATE)
AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE")
PHP_UNAME=`uname -a`
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME")
PHP_OS=`uname`
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS")
AC_SUBST(PHP_LIBS)
AC_SUBST(PHP_SAPI)
AC_SUBST(SAPI_TARGET)
AC_OUTPUT(Makefile libphp4.module php4.spec
scripts/mkextlib regex/Makefile
@@EXT_MAKEFILES@@ build-defs.h, [
], [
if test ! -f $srcdir/ext/bcmath/number.c; then
echo "creating number.c"
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.c
echo "creating number.h"
echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h
fi
if test "" = ""; then
chmod +x scripts/mkextlib
# Hacking while airborne considered harmful.
#
echo "creating internal_functions.c"
extensions=\`grep '^s.@EXT_STATIC@' \$0|sed -e 's/^.*@% *//' -e 's/%.*$//'\`
mv -f internal_functions.c internal_functions.c.old 2>/dev/null
sh $srcdir/genif.sh $srcdir/internal_functions.c.in $srcdir \$extensions > internal_functions.c
if cmp internal_functions.c.old internal_functions.c > /dev/null 2>&1; then
echo "internal_functions.c is unchanged"
mv internal_functions.c.old internal_functions.c
else
rm -f internal_functions.c.old
fi
# Warn about CGI version with no extra security options.
if test "$SAPI_TARGET" = "php"; then
if test "$REDIRECT" = "0"; then
if test "$DISCARD_PATH" = "0"; then
echo "+--------------------------------------------------------------------+"
echo "| Warning: |"
echo "| You will be compiling the CGI version of PHP without any |"
echo "| redirection checking. By putting this cgi binary somewhere in |"
echo "| your web space, users may be able to circumvent existing .htaccess |"
echo "| security by loading files directly through the parser. See |"
echo "| http://www.php.net/manual/config-security.php3 for more details. |"
fi
fi
fi
echo "+--------------------------------------------------------------------+"
echo "| License: |"
echo "| This software is subject to the PHP License, available in this |"
echo "| distribution in the file LICENSE. By continuing this installation |"
echo "| process, you are bound by the terms of this license agreement. |"
echo "| If you do not agree with the terms of this license, you must abort |"
echo "| the installation process at this point. |"
echo "+--------------------------------------------------------------------+"
fi
])
divert
# Local Variables:
# tab-width: 4
# End:
-204
View File
@@ -1,204 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on crypt.dsp
!IF "$(CFG)" == ""
CFG=crypt - Win32 Debug
!MESSAGE No configuration specified. Defaulting to crypt - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "crypt - Win32 Release" && "$(CFG)" != "crypt - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "crypt.mak" CFG="crypt - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "crypt - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "crypt - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "crypt - Win32 Release"
OUTDIR=.\module_Release
INTDIR=.\module_Release
# Begin Custom Macros
OutDir=.\module_Release
# End Custom Macros
ALL : "$(OUTDIR)\php3_crypt.dll"
CLEAN :
-@erase "$(INTDIR)\crypt.obj"
-@erase "$(INTDIR)\sflcryp.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\php3_crypt.dll"
-@erase "$(OUTDIR)\php3_crypt.exp"
-@erase "$(OUTDIR)\php3_crypt.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "./" /I "../" /D HAVE_SFLCRYPT=1 /D "COMPILE_DL" /D "MSVC5" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\crypt.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
RSC=rc.exe
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\crypt.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=php.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\php3_crypt.pdb" /machine:I386 /out:"$(OUTDIR)\php3_crypt.dll" /implib:"$(OUTDIR)\php3_crypt.lib" /libpath:"cgi_release"
LINK32_OBJS= \
"$(INTDIR)\crypt.obj" \
"$(INTDIR)\sflcryp.obj"
"$(OUTDIR)\php3_crypt.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "crypt - Win32 Debug"
OUTDIR=.\module_debug
INTDIR=.\module_debug
# Begin Custom Macros
OutDir=.\module_debug
# End Custom Macros
ALL : "$(OUTDIR)\php3_crypt.dll"
CLEAN :
-@erase "$(INTDIR)\crypt.obj"
-@erase "$(INTDIR)\sflcryp.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\php3_crypt.dll"
-@erase "$(OUTDIR)\php3_crypt.exp"
-@erase "$(OUTDIR)\php3_crypt.ilk"
-@erase "$(OUTDIR)\php3_crypt.lib"
-@erase "$(OUTDIR)\php3_crypt.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "./" /I "../" /I "../../" /D HAVE_SFLCRYPT=1 /D "DEBUG" /D "COMPILE_DL" /D "MSVC5" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\crypt.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
RSC=rc.exe
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\crypt.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=php.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)\php3_crypt.pdb" /debug /machine:I386 /out:"$(OUTDIR)\php3_crypt.dll" /implib:"$(OUTDIR)\php3_crypt.lib" /pdbtype:sept /libpath:"cgi_debug"
LINK32_OBJS= \
"$(INTDIR)\crypt.obj" \
"$(INTDIR)\sflcryp.obj"
"$(OUTDIR)\php3_crypt.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("crypt.dep")
!INCLUDE "crypt.dep"
!ELSE
!MESSAGE Warning: cannot find "crypt.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "crypt - Win32 Release" || "$(CFG)" == "crypt - Win32 Debug"
SOURCE=.\dl\crypt\crypt.c
"$(INTDIR)\crypt.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dl\crypt\sflcryp.c
"$(INTDIR)\sflcryp.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ENDIF
-234
View File
@@ -1,234 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on dbase.dsp
!IF "$(CFG)" == ""
CFG=dbase - Win32 Debug
!MESSAGE No configuration specified. Defaulting to dbase - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "dbase - Win32 Release" && "$(CFG)" != "dbase - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "dbase.mak" CFG="dbase - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "dbase - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "dbase - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "dbase - Win32 Release"
OUTDIR=.\module_release
INTDIR=.\module_release
# Begin Custom Macros
OutDir=.\module_release
# End Custom Macros
ALL : "$(OUTDIR)\php3_dbase.dll"
CLEAN :
-@erase "$(INTDIR)\dbase.obj"
-@erase "$(INTDIR)\dbf_head.obj"
-@erase "$(INTDIR)\dbf_misc.obj"
-@erase "$(INTDIR)\dbf_ndx.obj"
-@erase "$(INTDIR)\dbf_rec.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\php3_dbase.dll"
-@erase "$(OUTDIR)\php3_dbase.exp"
-@erase "$(OUTDIR)\php3_dbase.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "dbase\\" /I "./" /I "../" /D DBASE=1 /D "NDEBUG" /D "THREAD_SAFE" /D "COMPILE_DL" /D "MSVC5" /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\dbase.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
RSC=rc.exe
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dbase.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=php.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3 /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\php3_dbase.pdb" /machine:I386 /out:"$(OUTDIR)\php3_dbase.dll" /implib:"$(OUTDIR)\php3_dbase.lib" /libpath:"cgi_release"
LINK32_OBJS= \
"$(INTDIR)\dbase.obj" \
"$(INTDIR)\dbf_head.obj" \
"$(INTDIR)\dbf_misc.obj" \
"$(INTDIR)\dbf_ndx.obj" \
"$(INTDIR)\dbf_rec.obj"
"$(OUTDIR)\php3_dbase.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "dbase - Win32 Debug"
OUTDIR=.\module_debug
INTDIR=.\module_debug
# Begin Custom Macros
OutDir=.\module_debug
# End Custom Macros
ALL : "$(OUTDIR)\php3_dbase.dll"
CLEAN :
-@erase "$(INTDIR)\dbase.obj"
-@erase "$(INTDIR)\dbf_head.obj"
-@erase "$(INTDIR)\dbf_misc.obj"
-@erase "$(INTDIR)\dbf_ndx.obj"
-@erase "$(INTDIR)\dbf_rec.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\php3_dbase.dll"
-@erase "$(OUTDIR)\php3_dbase.exp"
-@erase "$(OUTDIR)\php3_dbase.ilk"
-@erase "$(OUTDIR)\php3_dbase.lib"
-@erase "$(OUTDIR)\php3_dbase.pdb"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "dbase\\" /I "./" /I "../" /D DBASE=1 /D "DEBUG" /D "_DEBUG" /D "THREAD_SAFE" /D "COMPILE_DL" /D "MSVC5" /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\dbase.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
RSC=rc.exe
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dbase.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=php.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:3 /subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)\php3_dbase.pdb" /debug /machine:I386 /out:"$(OUTDIR)\php3_dbase.dll" /implib:"$(OUTDIR)\php3_dbase.lib" /pdbtype:sept /libpath:"cgi_debug"
LINK32_OBJS= \
"$(INTDIR)\dbase.obj" \
"$(INTDIR)\dbf_head.obj" \
"$(INTDIR)\dbf_misc.obj" \
"$(INTDIR)\dbf_ndx.obj" \
"$(INTDIR)\dbf_rec.obj"
"$(OUTDIR)\php3_dbase.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("dbase.dep")
!INCLUDE "dbase.dep"
!ELSE
!MESSAGE Warning: cannot find "dbase.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "dbase - Win32 Release" || "$(CFG)" == "dbase - Win32 Debug"
SOURCE=.\functions\dbase.c
"$(INTDIR)\dbase.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dbase\dbf_head.c
"$(INTDIR)\dbf_head.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dbase\dbf_misc.c
"$(INTDIR)\dbf_misc.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dbase\dbf_ndx.c
"$(INTDIR)\dbf_ndx.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\dbase\dbf_rec.c
"$(INTDIR)\dbf_rec.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ENDIF
-201
View File
@@ -1,201 +0,0 @@
# Microsoft Developer Studio Generated NMAKE File, Based on dbm.dsp
!IF "$(CFG)" == ""
CFG=dbm - Win32 Debug
!MESSAGE No configuration specified. Defaulting to dbm - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "dbm - Win32 Release" && "$(CFG)" != "dbm - Win32 Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "dbm.mak" CFG="dbm - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "dbm - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "dbm - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
!IF "$(CFG)" == "dbm - Win32 Release"
OUTDIR=.\module_release
INTDIR=.\module_release
# Begin Custom Macros
OutDir=.\module_release
# End Custom Macros
ALL : "$(OUTDIR)\php3_dbm.dll"
CLEAN :
-@erase "$(INTDIR)\db.obj"
-@erase "$(INTDIR)\flock.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(OUTDIR)\php3_dbm.dll"
-@erase "$(OUTDIR)\php3_dbm.exp"
-@erase "$(OUTDIR)\php3_dbm.lib"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "./" /I "../" /I "../../include" /D NDBM=1 /D GDBM=0 /D BSD2=1 /D "NDEBUG" /D "COMPILE_DL" /D "MSVC5" /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\dbm.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
RSC=rc.exe
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dbm.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=php.lib libdb.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:2 /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\php3_dbm.pdb" /machine:I386 /out:"$(OUTDIR)\php3_dbm.dll" /implib:"$(OUTDIR)\php3_dbm.lib" /libpath:"..\..\lib" /libpath:"cgi_release"
LINK32_OBJS= \
"$(INTDIR)\db.obj" \
"$(INTDIR)\flock.obj"
"$(OUTDIR)\php3_dbm.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ELSEIF "$(CFG)" == "dbm - Win32 Debug"
OUTDIR=.\module_debug
INTDIR=.\module_debug
ALL : "c:\php3\php3_dbm.dll"
CLEAN :
-@erase "$(INTDIR)\db.obj"
-@erase "$(INTDIR)\flock.obj"
-@erase "$(INTDIR)\vc60.idb"
-@erase "$(INTDIR)\vc60.pdb"
-@erase "$(OUTDIR)\php3_dbm.exp"
-@erase "$(OUTDIR)\php3_dbm.lib"
-@erase "$(OUTDIR)\php3_dbm.pdb"
-@erase "c:\php3\php3_dbm.dll"
-@erase "c:\php3\php3_dbm.ilk"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP=cl.exe
CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "./" /I "../" /I "../../include" /D NDBM=1 /D GDBM=0 /D BSD2=1 /D "DEBUG" /D "_DEBUG" /D COMPILE_DL=1 /D "MSVC5" /D "WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\dbm.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
.c{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(INTDIR)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
MTL=midl.exe
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
RSC=rc.exe
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dbm.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=php.lib libdb.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /version:2 /subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)\php3_dbm.pdb" /debug /machine:I386 /out:"c:\php3/php3_dbm.dll" /implib:"$(OUTDIR)\php3_dbm.lib" /pdbtype:sept /libpath:"..\..\lib" /libpath:"cgi_debug"
LINK32_OBJS= \
"$(INTDIR)\db.obj" \
"$(INTDIR)\flock.obj"
"c:\php3\php3_dbm.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
!ENDIF
!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("dbm.dep")
!INCLUDE "dbm.dep"
!ELSE
!MESSAGE Warning: cannot find "dbm.dep"
!ENDIF
!ENDIF
!IF "$(CFG)" == "dbm - Win32 Release" || "$(CFG)" == "dbm - Win32 Debug"
SOURCE=.\functions\db.c
"$(INTDIR)\db.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
SOURCE=.\win32\flock.c
"$(INTDIR)\flock.obj" : $(SOURCE) "$(INTDIR)"
$(CPP) $(CPP_PROJ) $(SOURCE)
!ENDIF
-421
View File
@@ -1,421 +0,0 @@
/****************************************************************************
*
* Copyright (C) 1991 Kendall Bennett.
* All rights reserved.
*
* Filename: $RCSfile$
* Version: $Revision$
*
* Language: ANSI C
* Environment: any
*
* Description: Module to implement doubly linked lists. Includes a routine
* to peform a mergesort on the doubly linked list.
*
* $Id$
*
* Revision History:
* -----------------
*
* $Log$
* Revision 1.1 1999/07/19 18:58:44 andrey
* Moving dlist stuff into core.
*
* Revision 1.2 1999/05/11 00:01:42 zeev
* * Get Apache to work. POST doesn't work yet.
* * There are now -I directives for the absolute path of php4, php4/libzend and the builddir for
* the Apache module, so we can #include any php/Zend header.
* * Rename config.h to php_config.h
*
* Revision 1.1 1999/04/21 23:11:20 ssb
* moved apache, com and hyperwave into ext/
*
* Revision 1.1.1.1 1999/04/07 21:03:31 zeev
* PHP 4.0
*
* Revision 1.1.1.1 1999/03/17 04:29:11 andi
* PHP4
*
* Revision 1.1.1.1 1998/12/21 07:56:22 andi
* Trying to start the zend CVS tree
*
* Revision 1.1 1998/08/12 09:29:16 steinm
* First version of Hyperwave module.
*
* Revision 1.5 91/12/31 19:39:49 kjb
* Modified include file directories.
*
* Revision 1.4 91/10/28 03:16:39 kjb
* Ported to the Iris.
*
* Revision 1.3 91/09/27 03:09:18 kjb
* Cosmetic change.
*
* Revision 1.2 91/09/03 18:27:42 ROOT_DOS
* Ported to UNIX.
*
* Revision 1.1 91/09/01 18:35:23 ROOT_DOS
* Initial revision
*
****************************************************************************/
#ifndef MSVC5
#include "php_config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include "dlist.h"
#define PUBLIC
#define PRIVATE static
PUBLIC void *dlst_newnode(int size)
/****************************************************************************
*
* Function: dlst_newnode
* Parameters: size - Amount of memory to allocate for node
* Returns: Pointer to the allocated node's user space.
*
* Description: Allocates the memory required for a node, adding a small
* header at the start of the node. We return a reference to
* the user space of the node, as if it had been allocated via
* malloc().
*
****************************************************************************/
{
PHP_DLST_BUCKET *node;
if ( !(node = (PHP_DLST_BUCKET*)malloc(size + sizeof(PHP_DLST_BUCKET))) ) {
fprintf(stderr,"Not enough memory to allocate list node.\n");
/* raise(SIGABRT);*/
return NULL;
}
return PHP_DLST_USERSPACE(node); /* Return pointer to user space */
}
PUBLIC void dlst_freenode(void *node)
/****************************************************************************
*
* Function: dlst_freenode
* Parameters: node - Node to free.
*
* Description: Frees a node previously allocated with lst_newnode().
*
****************************************************************************/
{
free(PHP_DLST_HEADER(node));
}
PUBLIC DLIST *dlst_init(void)
/****************************************************************************
*
* Function: dlst_init
* Returns: Pointer to a newly created list.
*
* Description: Initialises a list and returns a pointer to it.
*
****************************************************************************/
{
DLIST *l;
if ((l = (DLIST*)malloc(sizeof(DLIST))) != NULL) {
l->count = 0;
l->head = &(l->hz[0]);
l->z = &(l->hz[1]);
l->head->next = l->z->next = l->z;
l->z->prev = l->head->prev = l->head;
}
else {
fprintf(stderr,"Insufficient memory to allocate list\n");
/*raise(SIGABRT);*/
return NULL;
}
return l;
}
PUBLIC void dlst_kill(DLIST *l,void (*freeNode)(void *node))
/****************************************************************************
*
* Function: dlst_kill
* Parameters: l - List to kill
* freeNode - Pointer to user routine to free a node
*
* Description: Kills the list l, by deleting all of the elements contained
* within the list one by one and then deleting the list
* itself. Note that we call the user supplied routine
* (*freeNode)() to free each list node. This allows the user
* program to perform any extra processing needed to kill each
* node (if each node contains pointers to other items on the
* heap for example). If no extra processing is required, just
* pass the address of dlst_freenode(), ie:
*
* dlst_kill(myList,dlst_freenode);
*
****************************************************************************/
{
PHP_DLST_BUCKET *n,*p;
n = l->head->next;
while (n != l->z) { /* Free all nodes in list */
p = n;
n = n->next;
(*freeNode)(PHP_DLST_USERSPACE(p));
}
free(l); /* Free the list itself */
}
PUBLIC void dlst_insertafter(DLIST *l,void *node,void *after)
/****************************************************************************
*
* Function: lst_insertafter
* Parameters: l - List to insert node into
* node - Pointer to user space of node to insert
* after - Pointer to user space of node to insert node after
*
* Description: Inserts a new node into the list after the node 'after'. To
* insert a new node at the beginning of the list, user the
* macro PHP_DLST_HEAD in place of 'after'. ie:
*
* dlst_insertafter(mylist,node,PHP_DLST_HEAD(mylist));
*
****************************************************************************/
{
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(node),*a = PHP_DLST_HEADER(after);
n->next = a->next;
a->next = n;
n->prev = a;
n->next->prev = n;
l->count++;
}
PUBLIC void *dlst_deletenext(DLIST *l,void *node)
/****************************************************************************
*
* Function: lst_deletenext
* Parameters: l - List to delete node from.
* node - Node to delete the next node from
* Returns: Pointer to the deleted node's userspace.
*
* Description: Removes the node AFTER 'node' from the list l.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(node);
node = PHP_DLST_USERSPACE(n->next);
n->next->next->prev = n;
n->next = n->next->next;
l->count--;
return node;
}
PUBLIC void *dlst_first(DLIST *l)
/****************************************************************************
*
* Function: dlst_first
* Parameters: l - List to obtain first node from
* Returns: Pointer to first node in list, NULL if list is empty.
*
* Description: Returns a pointer to the user space of the first node in
* the list. If the list is empty, we return NULL.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n;
n = l->head->next;
return (n == l->z ? NULL : PHP_DLST_USERSPACE(n));
}
PUBLIC void *dlst_last(DLIST *l)
/****************************************************************************
*
* Function: dlst_last
* Parameters: l - List to obtain last node from
* Returns: Pointer to last node in list, NULL if list is empty.
*
* Description: Returns a pointer to the user space of the last node in
* the list. If the list is empty, we return NULL.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n;
n = l->z->prev;
return (n == l->head ? NULL : PHP_DLST_USERSPACE(n));
}
PUBLIC void *dlst_next(void *prev)
/****************************************************************************
*
* Function: dlst_next
* Parameters: prev - Previous node in list to obtain next node from
* Returns: Pointer to the next node in the list, NULL at end of list.
*
* Description: Returns a pointer to the user space of the next node in the
* list given a pointer to the user space of the previous node.
* If we have reached the end of the list, we return NULL. The
* end of the list is detected when the next pointer of a node
* points back to itself, as does the dummy last node's next
* pointer. This enables us to detect the end of the list
* without needed access to the list data structure itself.
*
* NOTE: We do no checking to ensure that 'prev' is NOT a
* NULL pointer.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(prev);
n = n->next;
return (n == n->next ? NULL : PHP_DLST_USERSPACE(n));
}
PUBLIC void *dlst_prev(void *next)
/****************************************************************************
*
* Function: dlst_prev
* Parameters: next - Next node in list to obtain previous node from
* Returns: Pointer to the previous node in the list, NULL at start list.
*
* Description: Returns a pointer to the user space of the prev node in the
* list given a pointer to the user space of the next node.
* If we have reached the start of the list, we return NULL. The
* start of the list is detected when the prev pointer of a node
* points back to itself, as does the dummy head node's prev
* pointer. This enables us to detect the start of the list
* without needed access to the list data structure itself.
*
* NOTE: We do no checking to ensure that 'next' is NOT a
* NULL pointer.
*
****************************************************************************/
{
PHP_DLST_BUCKET *n = PHP_DLST_HEADER(next);
n = n->prev;
return (n == n->prev ? NULL : PHP_DLST_USERSPACE(n));
}
/* Static globals required by merge() */
static PHP_DLST_BUCKET *z;
static int (*cmp)(void*,void*);
PRIVATE PHP_DLST_BUCKET *merge(PHP_DLST_BUCKET *a,PHP_DLST_BUCKET *b,PHP_DLST_BUCKET **end)
/****************************************************************************
*
* Function: merge
* Parameters: a,b - Sublist's to merge
* Returns: Pointer to the merged sublists.
*
* Description: Merges two sorted lists of nodes together into a single
* sorted list.
*
****************************************************************************/
{
PHP_DLST_BUCKET *c;
/* Go through the lists, merging them together in sorted order */
c = z;
while (a != z && b != z) {
if ((*cmp)(PHP_DLST_USERSPACE(a),PHP_DLST_USERSPACE(b)) <= 0) {
c->next = a; c = a; a = a->next;
}
else {
c->next = b; c = b; b = b->next;
}
};
/* If one of the lists is not exhausted, then re-attach it to the end
* of the newly merged list
*/
if (a != z) c->next = a;
if (b != z) c->next = b;
/* Set *end to point to the end of the newly merged list */
while (c->next != z) c = c->next;
*end = c;
/* Determine the start of the merged lists, and reset z to point to
* itself
*/
c = z->next; z->next = z;
return c;
}
PUBLIC void dlst_mergesort(DLIST *l,int (*cmp_func)(void*,void*))
/****************************************************************************
*
* Function: dlst_mergesort
* Parameters: l - List to merge sort
* cmp_func - Function to compare two user spaces
*
* Description: Mergesort's all the nodes in the list. 'cmp' must point to
* a comparison function that can compare the user spaces of
* two different nodes. 'cmp' should work the same as
* strcmp(), in terms of the values it returns. Rather than
* waste processing time keeping the previous pointers up to
* date while performing the mergesort, we simply run through
* the list at the end of the sort to fix the previous pointers.
*
****************************************************************************/
{
int i,N;
PHP_DLST_BUCKET *a,*b; /* Pointers to sublists to merge */
PHP_DLST_BUCKET *c; /* Pointer to end of sorted sublists */
PHP_DLST_BUCKET *head; /* Pointer to dummy head node for list */
PHP_DLST_BUCKET *todo; /* Pointer to sublists yet to be sorted */
PHP_DLST_BUCKET *t; /* Temporary */
/* Set up globals required by merge() and pointer to head */
z = l->z; cmp = cmp_func; head = l->head;
for (N = 1,a = z; a != head->next; N = N + N) {
todo = head->next; c = head;
while (todo != z) {
/* Build first sublist to be merged, and splice from main list
*/
a = t = todo;
for (i = 1; i < N; i++) t = t->next;
b = t->next; t->next = z; t = b;
/* Build second sublist to be merged and splice from main list
*/
for (i = 1; i < N; i++) t = t->next;
todo = t->next; t->next = z;
/* Merge the two sublists created, and set 'c' to point to the
* end of the newly merged sublists.
*/
c->next = merge(a,b,&t); c = t;
}
}
/* Fix the previous pointers for the list */
a = b = l->head;
b = b->next;
while (1) {
b->prev = a;
if (b == z)
break;
a = a->next;
b = b->next;
}
}
-137
View File
@@ -1,137 +0,0 @@
/****************************************************************************
*
* Copyright (C) 1991 Kendall Bennett.
* All rights reserved.
*
* Filename: $RCSfile$
* Version: $Revision$
*
* Language: ANSI C
* Environment: any
*
* Description: Header file for doubly linked list routines.
*
* $Id$
*
* Revision History:
* -----------------
*
* $Log$
* Revision 1.1 1999/04/21 23:11:20 ssb
* moved apache, com and hyperwave into ext/
*
* Revision 1.1.1.1 1999/04/07 21:03:20 zeev
* PHP 4.0
*
* Revision 1.1.1.1 1999/03/17 04:29:11 andi
* PHP4
*
* Revision 1.1.1.1 1998/12/21 07:56:22 andi
* Trying to start the zend CVS tree
*
* Revision 1.2 1998/08/14 15:51:12 shane
* Some work on getting hyperwave to work on windows. hg_comm needs a lot of work.
*
* Mainly, signals, fnctl, bzero, bcopy, etc are not portable functions. Most of this
* will have to be rewriten for windows.
*
* Revision 1.1 1998/08/12 09:29:16 steinm
* First version of Hyperwave module.
*
* Revision 1.5 91/12/31 19:40:54 kjb
*
* Modified include files directories.
*
* Revision 1.4 91/09/27 03:10:41 kjb
* Added compatibility with C++.
*
* Revision 1.3 91/09/26 10:07:16 kjb
* Took out extern references
*
* Revision 1.2 91/09/01 19:37:20 ROOT_DOS
* Changed DLST_TAIL macro so that it returns a pointer to the REAL last
* node of the list, not the dummy last node (l->z).
*
* Revision 1.1 91/09/01 18:38:23 ROOT_DOS
* Initial revision
*
****************************************************************************/
#ifndef __DLIST_H
#define __DLIST_H
#ifndef __DEBUG_H
/*#include "debug.h"*/
#endif
/*---------------------- Macros and type definitions ----------------------*/
typedef struct PHP_DLST_BUCKET {
struct PHP_DLST_BUCKET *next;
struct PHP_DLST_BUCKET *prev;
} PHP_DLST_BUCKET;
/* necessary for AIX 4.2.x */
#ifdef hz
#undef hz
#endif
typedef struct {
int count; /* Number of elements currently in list */
PHP_DLST_BUCKET *head; /* Pointer to head element of list */
PHP_DLST_BUCKET *z; /* Pointer to last node of list */
PHP_DLST_BUCKET hz[2]; /* Space for head and z nodes */
} DLIST;
/* Return a pointer to the user space given the address of the header of
* a node.
*/
#define PHP_DLST_USERSPACE(h) ((void*)((PHP_DLST_BUCKET*)(h) + 1))
/* Return a pointer to the header of a node, given the address of the
* user space.
*/
#define PHP_DLST_HEADER(n) ((PHP_DLST_BUCKET*)(n) - 1)
/* Return a pointer to the user space of the list's head node. This user
* space does not actually exist, but it is useful to be able to address
* it to enable insertion at the start of the list.
*/
#define PHP_DLST_HEAD(l) PHP_DLST_USERSPACE((l)->head)
/* Return a pointer to the user space of the last node in list. */
#define PHP_DLST_TAIL(l) PHP_DLST_USERSPACE((l)->z->prev)
/* Determine if a list is empty
*/
#define PHP_DLST_EMPTY(l) ((l)->count == 0)
/*-------------------------- Function Prototypes --------------------------*/
#ifdef __cplusplus
extern "C" {
#endif
void *dlst_newnode(int size);
void dlst_freenode(void *node);
DLIST *dlst_init(void);
void dlst_kill(DLIST *l,void (*freeNode)(void *node));
void dlst_insertafter(DLIST *l,void *node,void *after);
void *dlst_deletenext(DLIST *l,void *node);
void *dlst_first(DLIST *l);
void *dlst_last(DLIST *l);
void *dlst_next(void *prev);
void *dlst_prev(void *next);
void dlst_mergesort(DLIST *l,int (*cmp_func)(void*,void*));
#ifdef __cplusplus
}
#endif
#endif
-10
View File
@@ -1,10 +0,0 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = @EXT_SUBDIRS@
EXT_STATIC = @EXT_STATIC@
noinst_LIBRARIES=libphpext.a
libphpext.a: @EXT_LIBS@
top_srcdir=$(top_srcdir) $(top_builddir)/scripts/mkextlib $@ $(EXT_STATIC)
@test "`uname -s`" = "Rhapsody" && $(RANLIB) $@ || exit 0
-6
View File
@@ -1,6 +0,0 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_apache.a
libphpext_apache_a_SOURCES=apache.c
-449
View File
@@ -1,449 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
| Stig Sæther Bakken <ssb@guardian.no> |
| David Sklar <sklar@student.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#include "ext/standard/head.h"
#include "php_globals.h"
#include "php_ini.h"
#include "SAPI.h"
#include "sapi/apache/mod_php4.h"
#include "ext/standard/info.h"
#include <stdlib.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <errno.h>
#include <ctype.h>
#if APACHE
#include "http_request.h"
#include "build-defs.h"
#define SECTION(name) PUTS("<hr><h2>" name "</h2>\n")
extern module *top_module;
PHP_FUNCTION(virtual);
PHP_FUNCTION(getallheaders);
PHP_FUNCTION(apachelog);
PHP_FUNCTION(apache_note);
PHP_FUNCTION(apache_lookup_uri);
PHP_MINFO_FUNCTION(apache);
function_entry apache_functions[] = {
PHP_FE(virtual, NULL)
PHP_FE(getallheaders, NULL)
PHP_FE(apache_note, NULL)
PHP_FE(apache_lookup_uri, NULL)
{NULL, NULL, NULL}
};
static PHP_INI_MH(OnChangeApacheInt)
{
long *p;
char *base = (char *) &php_apache_info;
p = (long *) (base+(size_t) mh_arg1);
if (new_value) {
*p = atoi(new_value);
return SUCCESS;
} else {
return FAILURE;
}
}
static PHP_INI_MH(OnChangeApacheString)
{
char **p;
char *base = (char *) &php_apache_info;
p = (char **) (base+(size_t) mh_arg1);
if (new_value) {
*p = new_value;
return SUCCESS;
} else {
return FAILURE;
}
}
PHP_INI_BEGIN()
PHP_INI_ENTRY1("xbithack", "0", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, xbithack))
PHP_INI_ENTRY1("engine", "1", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, engine))
PHP_INI_ENTRY1("last_modified", "0", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, last_modified))
PHP_INI_ENTRY1("dav_script", NULL, PHP_INI_ALL, OnChangeApacheString, (void *) XtOffsetOf(php_apache_info_struct, dav_script))
PHP_INI_END()
static PHP_MINIT_FUNCTION(apache)
{
REGISTER_INI_ENTRIES();
return SUCCESS;
}
static PHP_MSHUTDOWN_FUNCTION(apache)
{
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
php3_module_entry apache_module_entry = {
"Apache", apache_functions, PHP_MINIT(apache), PHP_MSHUTDOWN(apache), NULL, NULL, PHP_MINFO(apache), STANDARD_MODULE_PROPERTIES
};
/* {{{ proto string apache_note(string note_name [, string note_value])
Get and set Apache request notes */
PHP_FUNCTION(apache_note)
{
pval *arg_name,*arg_val;
char *note_val;
int arg_count = ARG_COUNT(ht);
SLS_FETCH();
if (arg_count<1 || arg_count>2 ||
getParameters(ht,arg_count,&arg_name,&arg_val) == FAILURE ) {
WRONG_PARAM_COUNT;
}
convert_to_string(arg_name);
note_val = (char *) table_get(((request_rec *) SG(server_context))->notes,arg_name->value.str.val);
if (arg_count == 2) {
convert_to_string(arg_val);
table_set(((request_rec *) SG(server_context))->notes,arg_name->value.str.val,arg_val->value.str.val);
}
if (note_val) {
RETURN_STRING(note_val,1);
} else {
RETURN_FALSE;
}
}
/* }}} */
PHP_MINFO_FUNCTION(apache)
{
module *modp = NULL;
char output_buf[128];
#if !defined(WIN32) && !defined(WINNT)
char name[64];
char *p;
#endif
server_rec *serv;
extern char server_root[MAX_STRING_LEN];
extern uid_t user_id;
extern char *user_name;
extern gid_t group_id;
extern int max_requests_per_child;
SLS_FETCH();
serv = ((request_rec *) SG(server_context))->server;
PUTS("<table border=5 width=\"600\">\n");
php_info_print_table_header(2, "Entry", "Value");
#if WIN32|WINNT
PUTS("Apache for Windows 95/NT<br>");
#else
php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE);
php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET);
#endif
php_info_print_table_row(2, "Apache Version", SERVER_VERSION);
#ifdef APACHE_RELEASE
sprintf(output_buf, "%d", APACHE_RELEASE);
php_info_print_table_row(2, "Apache Release", output_buf);
#endif
sprintf(output_buf, "%d", MODULE_MAGIC_NUMBER);
php_info_print_table_row(2, "Apache API Version", output_buf);
sprintf(output_buf, "%s:%u", serv->server_hostname,serv->port);
php_info_print_table_row(2, "Hostname/Port", output_buf);
#if !defined(WIN32) && !defined(WINNT)
sprintf(output_buf, "%s(%d)/%d", user_name,(int)user_id,(int)group_id);
php_info_print_table_row(2, "User/Group", output_buf);
sprintf(output_buf, "per child: %d<br>keep alive: %s<br>max per connection: %d",max_requests_per_child,serv->keep_alive ? "on":"off", serv->keep_alive_max);
php_info_print_table_row(2, "Max Requests", output_buf);
#endif
sprintf(output_buf, "connection: %d<br>keep-alive: %d",serv->timeout,serv->keep_alive_timeout);
php_info_print_table_row(2, "Timeouts", output_buf);
#if !defined(WIN32) && !defined(WINNT)
php_info_print_table_row(2, "Server Root", server_root);
PUTS("<tr><td valign=\"top\" bgcolor=\"" PHP_ENTRY_NAME_COLOR "\">Loaded modules</td><td bgcolor=\"" PHP_CONTENTS_COLOR "\">");
for(modp = top_module; modp; modp = modp->next) {
strlcpy(name, modp->name, sizeof(name));
if ((p = strrchr(name, '.'))) {
*p='\0'; /* Cut off ugly .c extensions on module names */
}
PUTS(name);
if (modp->next) {
PUTS(", ");
}
}
#endif
PUTS("</td></tr>\n");
PUTS("</table>\n");
{
register int i;
array_header *arr;
table_entry *elts;
request_rec *r;
SLS_FETCH();
r = ((request_rec *) SG(server_context));
arr = table_elts(r->subprocess_env);
elts = (table_entry *)arr->elts;
SECTION("Apache Environment");
PUTS("<table border=5 width=\"600\">\n");
php_info_print_table_header(2, "Variable", "Value");
for (i=0; i < arr->nelts; i++) {
php_info_print_table_row(2, elts[i].key, elts[i].val);
}
PUTS("</table>\n");
}
{
array_header *env_arr;
table_entry *env;
int i;
request_rec *r;
SLS_FETCH();
r = ((request_rec *) SG(server_context));
SECTION("HTTP Headers Information");
PUTS("<table border=5 width=\"600\">\n");
PUTS(" <tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">HTTP Request Headers</th></tr>\n");
php_info_print_table_row(2, "HTTP Request", r->the_request);
env_arr = table_elts(r->headers_in);
env = (table_entry *)env_arr->elts;
for (i = 0; i < env_arr->nelts; ++i) {
if (env[i].key) {
php_info_print_table_row(2, env[i].key, env[i].val);
}
}
PUTS(" <tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">HTTP Response Headers</th></tr>\n");
env_arr = table_elts(r->headers_out);
env = (table_entry *)env_arr->elts;
for(i = 0; i < env_arr->nelts; ++i) {
if (env[i].key) {
php_info_print_table_row(2, env[i].key, env[i].val);
}
}
PUTS("</table>\n\n");
}
}
/* This function is equivalent to <!--#include virtual...-->
* in mod_include. It does an Apache sub-request. It is useful
* for including CGI scripts or .shtml files, or anything else
* that you'd parse through Apache (for .phtml files, you'd probably
* want to use <?Include>. This only works when PHP is compiled
* as an Apache module, since it uses the Apache API for doing
* sub requests.
*/
/* {{{ proto int virtual(string filename)
Perform an Apache sub-request */
PHP_FUNCTION(virtual)
{
pval *filename;
request_rec *rr = NULL;
SLS_FETCH();
if (ARG_COUNT(ht) != 1 || getParameters(ht,1,&filename) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string(filename);
if (!(rr = sub_req_lookup_uri (filename->value.str.val, ((request_rec *) SG(server_context))))) {
php_error(E_WARNING, "Unable to include '%s' - URI lookup failed", filename->value.str.val);
if (rr) destroy_sub_req (rr);
RETURN_FALSE;
}
if (rr->status != 200) {
php_error(E_WARNING, "Unable to include '%s' - error finding URI", filename->value.str.val);
if (rr) destroy_sub_req (rr);
RETURN_FALSE;
}
/* Cannot include another PHP file because of global conflicts */
if (rr->content_type &&
!strcmp(rr->content_type, PHP3_MIME_TYPE)) {
php_error(E_WARNING, "Cannot include a PHP file "
"(use <code>&lt;?include \"%s\"&gt;</code> instead)", filename->value.str.val);
if (rr) destroy_sub_req (rr);
RETURN_FALSE;
}
if (run_sub_req(rr)) {
php_error(E_WARNING, "Unable to include '%s' - request execution failed", filename->value.str.val);
if (rr) destroy_sub_req (rr);
RETURN_FALSE;
} else {
if (rr) destroy_sub_req (rr);
RETURN_TRUE;
}
}
/* }}} */
/* {{{ proto array getallheaders(void)
Fetch all HTTP request headers */
PHP_FUNCTION(getallheaders)
{
array_header *env_arr;
table_entry *tenv;
int i;
SLS_FETCH();
PLS_FETCH();
if (array_init(return_value) == FAILURE) {
RETURN_FALSE;
}
env_arr = table_elts(((request_rec *) SG(server_context))->headers_in);
tenv = (table_entry *)env_arr->elts;
for (i = 0; i < env_arr->nelts; ++i) {
if (!tenv[i].key ||
(PG(safe_mode) &&
!strncasecmp(tenv[i].key, "authorization", 13))) {
continue;
}
if (add_assoc_string(return_value, tenv[i].key,(tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
RETURN_FALSE;
}
}
}
/* }}} */
/* {{{ proto class apache_lookup_uri(string URI)
Perform a partial request of the given URI to obtain information about it */
PHP_FUNCTION(apache_lookup_uri)
{
pval *filename;
request_rec *rr=NULL;
SLS_FETCH();
if (ARG_COUNT(ht) != 1 || getParameters(ht,1,&filename) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string(filename);
if(!(rr = sub_req_lookup_uri(filename->value.str.val, ((request_rec *) SG(server_context))))) {
php_error(E_WARNING, "URI lookup failed", filename->value.str.val);
RETURN_FALSE;
}
object_init(return_value);
add_property_long(return_value,"status",rr->status);
if (rr->the_request) {
add_property_string(return_value,"the_request",rr->the_request,1);
}
if (rr->status_line) {
add_property_string(return_value,"status_line",(char *)rr->status_line,1);
}
if (rr->method) {
add_property_string(return_value,"method",(char *)rr->method,1);
}
if (rr->content_type) {
add_property_string(return_value,"content_type",(char *)rr->content_type,1);
}
if (rr->handler) {
add_property_string(return_value,"handler",(char *)rr->handler,1);
}
if (rr->uri) {
add_property_string(return_value,"uri",rr->uri,1);
}
if (rr->filename) {
add_property_string(return_value,"filename",rr->filename,1);
}
if (rr->path_info) {
add_property_string(return_value,"path_info",rr->path_info,1);
}
if (rr->args) {
add_property_string(return_value,"args",rr->args,1);
}
if (rr->boundary) {
add_property_string(return_value,"boundary",rr->boundary,1);
}
add_property_long(return_value,"no_cache",rr->no_cache);
add_property_long(return_value,"no_local_copy",rr->no_local_copy);
add_property_long(return_value,"allowed",rr->allowed);
add_property_long(return_value,"sent_bodyct",rr->sent_bodyct);
add_property_long(return_value,"bytes_sent",rr->bytes_sent);
add_property_long(return_value,"byterange",rr->byterange);
add_property_long(return_value,"clength",rr->clength);
#if MODULE_MAGIC_NUMBER >= 19980324
if (rr->unparsed_uri) {
add_property_string(return_value,"unparsed_uri",rr->unparsed_uri,1);
}
if(rr->mtime) {
add_property_long(return_value,"mtime",rr->mtime);
}
#endif
if(rr->request_time) {
add_property_long(return_value,"request_time",rr->request_time);
}
destroy_sub_req(rr);
}
/* }}} */
#if 0
This function is most likely a bad idea. Just playing with it for now.
PHP_FUNCTION(apache_exec_uri)
{
pval *filename;
request_rec *rr=NULL;
SLS_FETCH();
if (ARG_COUNT(ht) != 1 || getParameters(ht,1,&filename) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string(filename);
if(!(rr = ap_sub_req_lookup_uri(filename->value.str.val, ((request_rec *) SG(server_context))))) {
php_error(E_WARNING, "URI lookup failed", filename->value.str.val);
RETURN_FALSE;
}
RETVAL_LONG(ap_run_sub_req(rr));
ap_destroy_sub_req(rr);
}
#endif
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
-5
View File
@@ -1,5 +0,0 @@
dnl $Id$
if test -n "$APACHE_INCLUDE"; then
PHP_EXTENSION(apache)
fi
-6
View File
@@ -1,6 +0,0 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_aspell.a
libphpext_aspell_a_SOURCES=aspell.c
-204
View File
@@ -1,204 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if defined(COMPILE_DL)
#include "phpdl.h"
#endif
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#if HAVE_ASPELL
#include "php3_aspell.h"
#if APACHE
# ifndef DEBUG
# undef palloc
# endif
#endif
#include <aspell-c.h>
function_entry aspell_functions[] = {
PHP_FE(aspell_new, NULL)
PHP_FE(aspell_check, NULL)
PHP_FE(aspell_check_raw, NULL)
PHP_FE(aspell_suggest, NULL)
{NULL, NULL, NULL}
};
static int le_aspell;
php3_module_entry aspell_module_entry = {
"Aspell", aspell_functions, PHP_MINIT(aspell), NULL, NULL, NULL, PHP_MINFO(aspell), STANDARD_MODULE_PROPERTIES
};
#if COMPILE_DL
DLEXPORT php3_module_entry *get_module(void) { return &aspell_module_entry; }
#endif
PHP_MINIT_FUNCTION(aspell)
{
le_aspell = register_list_destructors(php3_aspell_close,NULL);
return SUCCESS;
}
void php3_aspell_close(aspell *sc)
{
aspell_free(sc);
}
/* {{{ proto int aspell_new(string master[, string personal])
Load a dictionary */
PHP_FUNCTION(aspell_new)
{
pval *master, *personal;
int argc;
aspell *sc;
int ind;
argc = ARG_COUNT(ht);
if (argc < 1 || argc > 2 || getParameters(ht, argc, &master,&personal) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string(master);
if(argc==2)
{
convert_to_string(personal) ;
sc=aspell_new(master->value.str.val,personal->value.str.val);
}
else
sc=aspell_new(master->value.str.val,"");
ind = php3_list_insert(sc, le_aspell);
RETURN_LONG(ind);
}
/* }}} */
/* {{{ proto array aspell_suggest(aspell int,string word)
Return array of Suggestions */
PHP_FUNCTION(aspell_suggest)
{
pval *scin, *word;
int argc;
aspell *sc;
int ind,type;
aspellSuggestions *sug;
size_t i;
argc = ARG_COUNT(ht);
if (argc != 2 || getParameters(ht, argc, &scin,&word) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scin);
convert_to_string(word);
sc= (aspell *) php3_list_find(scin->value.lval, &type);
if(!sc)
{
php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
RETURN_FALSE;
}
if (array_init(return_value) == FAILURE) {
RETURN_FALSE;
}
sug = aspell_suggest(sc, word->value.str.val);
for (i = 0; i != sug->size; ++i) {
add_next_index_string(return_value,(char *)sug->data[i],1);
}
aspell_free_suggestions(sug);
}
/* }}} */
/* {{{ proto int aspell_check(aspell int,string word)
Return if word is valid */
PHP_FUNCTION(aspell_check)
{
int type;
pval *scin,*word;
aspell *sc;
int argc;
argc = ARG_COUNT(ht);
if (argc != 2 || getParameters(ht, argc, &scin,&word) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scin);
convert_to_string(word);
sc= (aspell *) php3_list_find(scin->value.lval, &type);
if(!sc)
{
php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
RETURN_FALSE;
}
if (aspell_check(sc, word->value.str.val))
{
RETURN_TRUE;
}
else
{
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto int aspell_check_raw(aspell int,string word)
Return if word is valid, ignoring case or trying to trim it in any way*/
PHP_FUNCTION(aspell_check_raw)
{
pval *scin,*word;
int type;
int argc;
aspell *sc;
argc = ARG_COUNT(ht);
if (argc != 2 || getParameters(ht, argc, &scin,&word) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scin);
convert_to_string(word);
sc= (aspell *) php3_list_find(scin->value.lval, &type);
if(!sc)
{
php_error(E_WARNING, "%d is not a ASPELL result index", scin->value.lval);
RETURN_FALSE;
}
if (aspell_check_raw(sc, word->value.str.val))
{
RETURN_TRUE;
}
else
{
RETURN_FALSE;
}
}
/* }}} */
PHP_MINFO_FUNCTION(aspell)
{
php_printf("ASpell support enabled");
}
#endif
-4
View File
@@ -1,4 +0,0 @@
/* Define if you want the ASPELL interface */
#ifndef HAVE_ASPELL
#define HAVE_ASPELL 0
#endif
-28
View File
@@ -1,28 +0,0 @@
dnl $Id$
AC_MSG_CHECKING(for ASPELL support)
AC_ARG_WITH(aspell,
[ --with-aspell[=DIR] Include ASPELL support.],
[
if test "$withval" != "no"; then
if test "$withval" = "yes"; then
ASPELL_DIR=/usr/local
else
ASPELL_DIR=$withval
fi
AC_ADD_INCLUDE($ASPELL_DIR/include)
AC_ADD_LIBRARY_WITH_PATH(aspell, $ASPELL_DIR/lib)
if test ! -f "$ASPELL_DIR/include/aspell-c.h"; then
AC_MSG_ERROR(Could not find aspell-c.h in $ASPELL_DIR/include - please copy it manually from the aspell sources to $ASPELL_DIR/include)
fi
AC_DEFINE(HAVE_ASPELL)
AC_MSG_RESULT(yes)
PHP_EXTENSION(aspell)
else
AC_MSG_ERROR(no)
fi
],[
AC_MSG_RESULT(no)
])
-54
View File
@@ -1,54 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| 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 both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef _ASPELL_H
#define _ASPELL_H
#if HAVE_ASPELL
extern php3_module_entry aspell_module_entry;
#define aspell_module_ptr &aspell_module_entry
extern PHP_MINIT_FUNCTION(aspell);
extern PHP_MINFO_FUNCTION(aspell);
extern void php3_aspell_close();
PHP_FUNCTION(aspell_new);
PHP_FUNCTION(aspell_check);
PHP_FUNCTION(aspell_check_raw);
PHP_FUNCTION(aspell_suggest);
#else
#define aspell_module_ptr NULL
#endif
#define phpext_aspell_ptr aspell_module_ptr
#endif /* _ASPELL_H */
-5
View File
@@ -1,5 +0,0 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_bcmath.a
libphpext_bcmath_a_SOURCES=bcmath.c number.c
-434
View File
@@ -1,434 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
+----------------------------------------------------------------------+
*/
#include "php.h"
#if WITH_BCMATH
#include "number.h"
#include "php3_bcmath.h"
function_entry bcmath_functions[] = {
PHP_FE(bcadd, NULL)
PHP_FE(bcsub, NULL)
PHP_FE(bcmul, NULL)
PHP_FE(bcdiv, NULL)
PHP_FE(bcmod, NULL)
PHP_FE(bcpow, NULL)
PHP_FE(bcsqrt, NULL)
PHP_FE(bcscale, NULL)
PHP_FE(bccomp, NULL)
{NULL, NULL, NULL}
};
php3_module_entry bcmath_module_entry = {
"bcmath", bcmath_functions, NULL, NULL, PHP_RINIT(bcmath), PHP_RSHUTDOWN(bcmath), NULL, STANDARD_MODULE_PROPERTIES
};
#if COMPILE_DL
php3_module_entry *get_module() { return &bcmath_module_entry; };
#endif
#ifndef THREAD_SAFE
static long bc_precision;
#endif
PHP_RINIT_FUNCTION(bcmath)
{
init_numbers();
if (cfg_get_long("bcmath.scale",&bc_precision)==FAILURE) {
bc_precision=0;
}
return SUCCESS;
}
PHP_RSHUTDOWN_FUNCTION(bcmath)
{
destruct_numbers();
return SUCCESS;
}
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
Returns the sum of two arbitrary precision numbers */
PHP_FUNCTION(bcadd)
{
pval *left, *right,*scale_param;
bc_num first, second, result;
int scale=bc_precision;
switch (ARG_COUNT(ht)) {
case 2:
if (getParameters(ht, 2, &left, &right) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 3:
if (getParameters(ht, 3, &left, &right, &scale_param) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scale_param);
scale = (int) scale_param->value.lval;
break;
default:
WRONG_PARAM_COUNT;
break;
}
convert_to_string(left);
convert_to_string(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_add (first,second,&result, scale);
return_value->value.str.val = 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);
return;
}
/* }}} */
/* {{{ proto string bcsub(string left_operand, string right_operand [, int scale])
Returns the difference between two arbitrary precision numbers (subtration) */
PHP_FUNCTION(bcsub)
{
pval *left, *right,*scale_param;
bc_num first, second, result;
int scale=bc_precision;
switch (ARG_COUNT(ht)) {
case 2:
if (getParameters(ht, 2, &left, &right) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 3:
if (getParameters(ht, 3, &left, &right, &scale_param) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scale_param);
scale = (int) scale_param->value.lval;
break;
default:
WRONG_PARAM_COUNT;
break;
}
convert_to_string(left);
convert_to_string(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_sub (first,second,&result, scale);
return_value->value.str.val = 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);
return;
}
/* }}} */
/* {{{ proto string bcmul(string left_operand, string right_operand [, int scale])
Returns the multiplication of two arbitrary precision numbers */
PHP_FUNCTION(bcmul)
{
pval *left, *right,*scale_param;
bc_num first, second, result;
int scale=bc_precision;
switch (ARG_COUNT(ht)) {
case 2:
if (getParameters(ht, 2, &left, &right) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 3:
if (getParameters(ht, 3, &left, &right, &scale_param) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scale_param);
scale = (int) scale_param->value.lval;
break;
default:
WRONG_PARAM_COUNT;
break;
}
convert_to_string(left);
convert_to_string(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_multiply (first,second,&result, scale);
return_value->value.str.val = 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);
return;
}
/* }}} */
/* {{{ proto string bcdiv(string left_operand, string right_operand [, int scale])
Returns the quotient of two arbitrary precision numbers (division) */
PHP_FUNCTION(bcdiv)
{
pval *left, *right,*scale_param;
bc_num first, second, result;
int scale=bc_precision;
switch (ARG_COUNT(ht)) {
case 2:
if (getParameters(ht, 2, &left, &right) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 3:
if (getParameters(ht, 3, &left, &right, &scale_param) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scale_param);
scale = (int) scale_param->value.lval;
break;
default:
WRONG_PARAM_COUNT;
break;
}
convert_to_string(left);
convert_to_string(right);
init_num(&first);
init_num(&second);
init_num(&result);
str2num(&first,left->value.str.val,scale);
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.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
break;
case -1: /* division by zero */
php_error(E_WARNING,"Division by zero");
break;
}
free_num(&first);
free_num(&second);
free_num(&result);
return;
}
/* }}} */
/* {{{ proto string bcmod(string left_operand, string right_operand)
Returns the modulus of the two arbitrary precision operands */
PHP_FUNCTION(bcmod)
{
pval *left, *right;
bc_num first, second, result;
switch (ARG_COUNT(ht)) {
case 2:
if (getParameters(ht, 2, &left, &right) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
default:
WRONG_PARAM_COUNT;
break;
}
convert_to_string(left);
convert_to_string(right);
init_num(&first);
init_num(&second);
init_num(&result);
str2num(&first,left->value.str.val,0);
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.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
break;
case -1:
php_error(E_WARNING,"Division by zero");
break;
}
free_num(&first);
free_num(&second);
free_num(&result);
return;
}
/* }}} */
/* {{{ proto string bcpow(string x, string y [, int scale])
Returns the value of an arbitrary precision number raised to the power of another */
PHP_FUNCTION(bcpow)
{
pval *left, *right,*scale_param;
bc_num first, second, result;
int scale=bc_precision;
switch (ARG_COUNT(ht)) {
case 2:
if (getParameters(ht, 2, &left, &right) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 3:
if (getParameters(ht, 3, &left, &right, &scale_param) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scale_param);
scale = (int) scale_param->value.lval;
break;
default:
WRONG_PARAM_COUNT;
break;
}
convert_to_string(left);
convert_to_string(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_raise (first,second,&result, scale);
return_value->value.str.val = 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);
return;
}
/* }}} */
/* {{{ proto string bcsqrt(string operand [, int scale])
Returns the square root of an arbitray precision number */
PHP_FUNCTION(bcsqrt)
{
pval *left,*scale_param;
bc_num result;
int scale=bc_precision;
switch (ARG_COUNT(ht)) {
case 1:
if (getParameters(ht, 1, &left) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 2:
if (getParameters(ht, 2, &left, &scale_param) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scale_param);
scale = (int) scale_param->value.lval;
break;
default:
WRONG_PARAM_COUNT;
break;
}
convert_to_string(left);
init_num(&result);
str2num(&result,left->value.str.val,scale);
if (bc_sqrt (&result, scale) != 0) {
return_value->value.str.val = 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);
return;
}
/* }}} */
/* {{{ proto string bccomp(string left_operand, string right_operand [, int scale])
Compares two arbitrary precision numbers */
PHP_FUNCTION(bccomp)
{
pval *left, *right, *scale_param;
bc_num first, second;
int scale=bc_precision;
switch (ARG_COUNT(ht)) {
case 2:
if (getParameters(ht, 2, &left, &right) == FAILURE) {
WRONG_PARAM_COUNT;
}
break;
case 3:
if (getParameters(ht, 3, &left, &right, &scale_param) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(scale_param);
scale = (int) scale_param->value.lval;
break;
default:
WRONG_PARAM_COUNT;
break;
}
convert_to_string(left);
convert_to_string(right);
init_num(&first);
init_num(&second);
str2num(&first,left->value.str.val,scale);
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);
return;
}
/* }}} */
/* {{{ proto string bcscale(int scale)
Sets default scale parameter for all bc math functions */
PHP_FUNCTION(bcscale)
{
pval *new_scale;
if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &new_scale)==FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_long(new_scale);
bc_precision = new_scale->value.lval;
RETURN_TRUE;
}
/* }}} */
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
-2
View File
@@ -1,2 +0,0 @@
/* Define if you want to enable bc style precision math support */
#define WITH_BCMATH 0
-20
View File
@@ -1,20 +0,0 @@
dnl $Id$
AC_MSG_CHECKING(whether to enable bc style precision math functions)
AC_ARG_ENABLE(bcmath,
[ --enable-bcmath Compile with bc style precision math functions.
Read README-BCMATH for instructions on how to
get this module installed. ],
[
if test "$enableval" = "yes"; then
AC_DEFINE(WITH_BCMATH, 1)
AC_MSG_RESULT(yes)
PHP_EXTENSION(bcmath)
else
AC_DEFINE(WITH_BCMATH, 0)
AC_MSG_RESULT(no)
fi
],[
AC_DEFINE(WITH_BCMATH, 0)
AC_MSG_RESULT(no)
])
-64
View File
@@ -1,64 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| 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 both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Andi Gutmans <andi@zend.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef _PHP3_BCMATH_H
#define _PHP3_BCMATH_H
#if COMPILE_DL
#undef WITH_BCMATH
#define WITH_BCMATH 1
#endif
#if WITH_BCMATH
extern php3_module_entry bcmath_module_entry;
#define phpext_bcmath_ptr &bcmath_module_entry
extern PHP_RINIT_FUNCTION(bcmath);
extern PHP_RSHUTDOWN_FUNCTION(bcmath);
PHP_FUNCTION(bcadd);
PHP_FUNCTION(bcsub);
PHP_FUNCTION(bcmul);
PHP_FUNCTION(bcdiv);
PHP_FUNCTION(bcmod);
PHP_FUNCTION(bcpow);
PHP_FUNCTION(bcsqrt);
PHP_FUNCTION(bccomp);
PHP_FUNCTION(bcscale);
#else
#define phpext_bcmath_ptr NULL
#endif
#endif /* _PHP3_BCMATH_H */
-6
View File
@@ -1,6 +0,0 @@
# $Source$
# $Id$
define_option enable-bcmath 'Enable bc style precision math functions' yesno \
yes \
' Enables bc style arbitrary precision math functions.'
-24
View File
@@ -1,24 +0,0 @@
#ifndef _PHP3_COM_H
#define _PHP3_COM_H
#if WIN32|WINNT
extern PHP_MINIT_FUNCTION(COM);
extern PHP_MSHUTDOWN_FUNCTION(COM);
PHP_FUNCTION(COM_load);
PHP_FUNCTION(COM_invoke);
PHP_FUNCTION(com_propget);
PHP_FUNCTION(com_propput);
extern php3_module_entry COM_module_entry;
#define COM_module_ptr &COM_module_entry
#else
#define COM_module_ptr NULL
#endif /* Win32|WINNT */
#define phpext_COM_ptr COM_module_ptr
#endif /* _PHP3_COM_H */
-6
View File
@@ -1,6 +0,0 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_dav.a
libphpext_dav_a_SOURCES=dav.c
-2
View File
@@ -1,2 +0,0 @@
/* Define to compile with mod_dav support */
#define HAVE_MOD_DAV 0
-29
View File
@@ -1,29 +0,0 @@
dnl $Id$
dnl config.m4 for extension dav
dnl don't forget to call PHP_EXTENSION(dav)
AC_MSG_CHECKING(whether to enable DAV support through mod_dav)
AC_ARG_WITH(mod-dav,
[ --with-mod-dav=DIR Include DAV support through Apache's mod_dav,
DIR is mod_dav's installation directory (Apache
module version only!)],
[
if test "$withval" = "yes"; then
AC_MSG_ERROR(Must give parameter to --with-mod-dav!)
else
if test "$withval" != "no"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MOD_DAV, 1)
CFLAGS="$CFLAGS -DHAVE_MOD_DAV -I$withval"
INCLUDES="$INCLUDES -I$withval"
PHP_EXTENSION(dav)
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_MOD_DAV, 0)
fi
fi
],[
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_MOD_DAV, 0)
])
-289
View File
@@ -1,289 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.0 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_0.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#define IS_EXT_MODULE
#if COMPILE_DL
# if PHP_31
# include "../phpdl.h"
# else
# include "dl/phpdl.h"
# endif
#endif
#include "php.h"
#include "php3_dav.h"
#if defined(THREAD_SAFE) && !PHP_31
# undef THREAD_SAFE
#endif
#if HAVE_MOD_DAV
# include "mod_dav.h"
# include "phpdav.h"
# include "variables.h"
/* {{{ thread safety stuff */
# ifdef THREAD_SAFE
# define DAV_GLOBAL(a) phpdav_globals->a
# define DAV_TLS_VARS phpdav_global_struct *phpdav_globals = TlsGetValue(PHPDAVTls);
void *phpdav_mutex;
DWORD PHPDAVTls;
static int numthreads=0;
typedef struct phpdav_global_struct {
phpdav_module php3_dav_module;
} phpdav_global_struct;
# else /* !defined(THREAD_SAFE) */
# define DAV_GLOBAL(a) a
# define DAV_TLS_VARS
phpdav_module php3_dav_module;
# endif /* defined(THREAD_SAFE) */
# define DAV_HANDLER(a) DAV_GLOBAL(php3_dav_module).a##_handler
# define DAV_SET_HANDLER(a,b) \
dav_set_handler(&DAV_GLOBAL(php3_dav_module).a##_handler,(b))
/* }}} */
/* {{{ dynamically loadable module stuff */
# if COMPILE_DL
DLEXPORT php3_module_entry *get_module() { return &phpdav_module_entry; };
# endif /* COMPILE_DL */
/* }}} */
/* {{{ function prototypes */
int php3_minit_phpdav(INIT_FUNC_ARGS);
int php3_rinit_phpdav(INIT_FUNC_ARGS);
int php3_mshutdown_phpdav(SHUTDOWN_FUNC_ARGS);
int php3_rshutdown_phpdav(SHUTDOWN_FUNC_ARGS);
void php3_info_phpdav(ZEND_MODULE_INFO_FUNC_ARGS);
/* }}} */
/* {{{ extension definition structures */
function_entry phpdav_functions[] = {
PHP_FE(dav_set_mkcol_handlers, NULL)
{NULL, NULL, NULL}
};
php3_module_entry phpdav_module_entry = {
"DAV", /* extension name */
phpdav_functions, /* extension function list */
php3_minit_phpdav, /* extension-wide startup function */
php3_mshutdown_phpdav, /* extension-wide shutdown function */
php3_rinit_phpdav, /* per-request startup function */
php3_rshutdown_phpdav, /* per-request shutdown function */
php3_info_phpdav, /* information function */
STANDARD_MODULE_PROPERTIES
};
/* }}} */
/* {{{ startup, shutdown and info functions */
/* {{{ php3_minit_phpdav */
int php3_minit_phpdav(INIT_FUNC_ARGS)
{
#if defined(THREAD_SAFE)
phpdav_global_struct *phpdav_globals;
PHP3_MUTEX_ALLOC(phpdav_mutex);
PHP3_MUTEX_LOCK(phpdav_mutex);
numthreads++;
if (numthreads==1){
if (!PHP3_TLS_PROC_STARTUP(PHPDAVTls)){
PHP3_MUTEX_UNLOCK(phpdav_mutex);
PHP3_MUTEX_FREE(phpdav_mutex);
return FAILURE;
}
}
PHP3_MUTEX_UNLOCK(phdpav_mutex);
if(!PHP3_TLS_THREAD_INIT(PHPDAVTls,phpdav_globals,phpdav_global_struct)){
PHP3_MUTEX_FREE(phpdav_mutex);
return FAILURE;
}
#endif
return SUCCESS;
}
/* }}} */
/* {{{ php3_rinit_phpdav */
int php3_rinit_phpdav(INIT_FUNC_ARGS)
{
return SUCCESS;
}
/* }}} */
/* {{{ php3_mshutdown_phpdav() */
int php3_mshutdown_phpdav(SHUTDOWN_FUNC_ARGS)
{
DAV_TLS_VARS;
#ifdef THREAD_SAFE
PHP3_TLS_THREAD_FREE(phpdav_globals);
PHP3_MUTEX_LOCK(phpdav_mutex);
numthreads--;
if (numthreads < 1) {
PHP3_TLS_PROC_SHUTDOWN(PHPDAVTls);
PHP3_MUTEX_UNLOCK(phpdav_mutex);
PHP3_MUTEX_FREE(phpdav_mutex);
return SUCCESS;
}
PHP3_MUTEX_UNLOCK(phpdav_mutex);
#endif
return SUCCESS;
}
/* }}} */
/* {{{ php3_rshutdown_phpdav() */
int php3_rshutdown_phpdav(SHUTDOWN_FUNC_ARGS)
{
if (DAV_HANDLER(mkcol_test)) {
efree(DAV_HANDLER(mkcol_test));
}
if (DAV_HANDLER(mkcol_create)) {
efree(DAV_HANDLER(mkcol_create));
}
return SUCCESS;
}
/* }}} */
/* {{{ php3_info_phpdav() */
void php3_info_phpdav(ZEND_MODULE_INFO_FUNC_ARGS)
{
}
/* }}} */
/* }}} */
/* {{{ extension-internal functions */
/* {{{ dav_set_handler() */
static void
dav_set_handler(char **nameBufp, pval *data)
{
if (data->value.str.len > 0) {
if (*nameBufp != NULL) {
efree(*nameBufp);
}
*nameBufp = php3i_pval_strdup(data);
} else {
if (*nameBufp != NULL) {
efree(*nameBufp);
}
*nameBufp = NULL;
}
}
/* }}} */
/* {{{ dav_call_handler() */
static int
dav_call_handler(char *funcName, int argc, pval **argv)
{
if (funcName) {
pval *retval, *func;
int i, ret;
HashTable *function_table;
func = php3i_string_pval(funcName);
retval = emalloc(sizeof(pval));
function_table = php3i_get_function_table();
if (call_user_function(function_table, NULL, func, retval, argc, argv) == FAILURE) {
php3tls_pval_destructor(retval);
efree(retval);
return HTTP_INTERNAL_SERVER_ERROR;
}
php3tls_pval_destructor(func);
efree(func);
for (i = 0; i < argc; i++) {
php3tls_pval_destructor(argv[i]);
efree(argv[i]);
}
convert_to_long(retval);
ret = retval->value.lval;
efree(retval);
return ret;
}
return DECLINED;
}
/* }}} */
int phpdav_mkcol_test_handler(request_rec *r)
{
pval *arg;
if (DAV_HANDLER(mkcol_test) == NULL) {
return DECLINED;
}
arg = php3i_string_pval(r->filename);
return dav_call_handler(DAV_HANDLER(mkcol_test), 1, &arg);
}
int phpdav_mkcol_create_handler(request_rec *r)
{
pval *arg;
if (DAV_HANDLER(mkcol_create) == NULL) {
return DECLINED;
}
arg = php3i_string_pval(r->filename);
return dav_call_handler(DAV_HANDLER(mkcol_create), 1, &arg);
}
/* }}} */
/************************* EXTENSION FUNCTIONS *************************/
/* {{{ proto void dav_set_mkcol_handlers(string test, string create)
Sets the function to test whether a DAV collection exists for MKCOL */
PHP_FUNCTION(dav_set_mkcol_handlers)
{
pval *test, *create;
DAV_TLS_VARS;
if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &test, &create) == FAILURE) {
WRONG_PARAM_COUNT;
}
DAV_SET_HANDLER(mkcol_test, test);
DAV_SET_HANDLER(mkcol_create, create);
RETVAL_TRUE;
}
/* }}} */
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
-66
View File
@@ -1,66 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| 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 both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
+----------------------------------------------------------------------+
*/
/* $Id */
#ifndef _PHP_DAV_H
# define _PHP_DAV_H
# if HAVE_MOD_DAV
typedef struct {
int foo;
char *mkcol_test_handler;
char *mkcol_create_handler;
} phpdav_module;
extern php3_module_entry phpdav_module_entry;
# define phpdav_module_ptr &phpdav_module_entry
int phpdav_mkcol_test_handler(request_rec *);
PHP_FUNCTION(dav_set_mkcol_handlers);
# else /* !HAVE_MOD_DAV */
# define phpdav_module_ptr NULL
# endif /* HAVE_MOD_DAV */
#define phpext_dav_ptr phpdav_module_ptr
#endif /* _PHP_DAV_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/
-2
View File
@@ -1,2 +0,0 @@
# $Id$
# This extension is still very much under construction.
-6
View File
@@ -1,6 +0,0 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_db.a
libphpext_db_a_SOURCES=db.c
-5
View File
@@ -1,5 +0,0 @@
/* Define if you have an ndbm compatible library (-ldbm). */
#define NDBM 0
/* Define if you have the gdbm library (-lgdbm). */
#define GDBM 0
-53
View File
@@ -1,53 +0,0 @@
dnl $Id$
dnl config.m4 for extension db
dnl don't forget to call PHP_EXTENSION(db)
divert(1)
# Checks for libraries.
# Prefer gdbm, Berkeley DB and ndbm/dbm, in that order
AC_DEFUN(AC_PREFERRED_DB_LIB,[
AC_CHECK_LIB(gdbm, gdbm_open,[AC_DEFINE(GDBM) DBM_TYPE=gdbm; DBM_LIB=-lgdbm],
[AC_CHECK_LIB(db, dbm_open,[AC_DEFINE(NDBM) DBM_TYPE=ndbm; DBM_LIB=-ldb],
[AC_CHECK_LIB(c, dbm_open,[AC_DEFINE(NDBM) DBM_TYPE=ndbm; DBM_LIB=],
[AC_CHECK_LIB(dbm, dbm_open,[AC_DEFINE(NDBM) DBM_TYPE=ndbm; DBM_LIB=-ldbm],
[DBM_TYPE=""])])])])
AC_MSG_CHECKING([preferred dbm library])
if test "a$DBM_TYPE" = a; then
AC_MSG_RESULT(none found)
AC_MSG_WARN(No dbm library found - using built-in flatfile support)
else
AC_MSG_RESULT($DBM_TYPE chosen)
fi
AC_SUBST(DBM_LIB)
AC_SUBST(DBM_TYPE)
])
AC_PREFERRED_DB_LIB
divert(3)
if test "$DBM_LIB" = "-lgdbm"; then
AC_CHECK_HEADER(gdbm.h, [ GDBM_INCLUDE="" ], [
AC_MSG_RESULT("Try /usr/local/include/gdbm.h");
AC_CHECK_HEADER(/usr/local/include/gdbm.h, [ GDBM_INCLUDE="-I/usr/local/include" ],[
AC_MSG_RESULT("Try /opt/local/include/gdbm.h");
AC_CHECK_HEADER(/opt/local/include/gdbm.h, [ GDBM_INCLUDE="-I/opt/local/include" ],[
dnl if in /usr/pkg/include, do not add anything. See above.
AC_MSG_RESULT("Try /usr/pkg/include/gdbm.h");
AC_CHECK_HEADER(/usr/pkg/include/gdbm.h, [ GDBM_INCLUDE="" ],[
AC_MSG_RESULT("Giving up - You need to install gdbm.h somewhere");
exit
])
])
])
])
fi
if test -n "$DBM_LIB"; then
INCLUDES="$INCLUDES $GDBM_INCLUDE"
EXTRA_LIBS="$EXTRA_LIBS $DBM_LIB"
fi
PHP_EXTENSION(db)
-1163
View File
File diff suppressed because it is too large. Load diff
-95
View File
@@ -1,95 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| 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 both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#ifndef _PHP3_DB_H
#define _PHP3_DB_H
#ifndef DLEXPORT
#define DLEXPORT
#endif
extern php3_module_entry dbm_module_entry;
#define phpext_db_ptr &dbm_module_entry
typedef struct dbm_info {
char *filename;
char *lockfn;
int lockfd;
void *dbf;
} dbm_info;
/*
we're not going to bother with flatfile on win32
because the dbm module will be external, and we
do not want flatfile compiled staticly
*/
#if defined(MSVC5) && !defined(COMPILE_DL)
#undef phpext_db_ptr
#define phpext_db_ptr NULL
#endif
dbm_info *_php3_finddbm(pval *id,HashTable *list);
int _php3_dbmclose(dbm_info *info);
dbm_info *_php3_dbmopen(char *filename, char *mode);
int _php3_dbminsert(dbm_info *info, char *key, char *value);
char *_php3_dbmfetch(dbm_info *info, char *key);
int _php3_dbmreplace(dbm_info *info, char *key, char *value);
int _php3_dbmexists(dbm_info *info, char *key);
int _php3_dbmdelete(dbm_info *info, char *key);
char *_php3_dbmfirstkey(dbm_info *info);
char *_php3_dbmnextkey(dbm_info *info, char *key);
/* db file functions */
PHP_MINIT_FUNCTION(db);
PHP_RINIT_FUNCTION(db);
PHP_MINFO_FUNCTION(db);
PHP_FUNCTION(dblist);
PHP_FUNCTION(dbmopen);
PHP_FUNCTION(dbmclose);
PHP_FUNCTION(dbminsert);
PHP_FUNCTION(dbmfetch);
PHP_FUNCTION(dbmreplace);
PHP_FUNCTION(dbmexists);
PHP_FUNCTION(dbmdelete);
PHP_FUNCTION(dbmfirstkey);
PHP_FUNCTION(dbmnextkey);
#undef phpext_db_ptr
#define phpext_db_ptr NULL
#endif /* _PHP3_DB_H */
-7
View File
@@ -1,7 +0,0 @@
# $Id$
INCLUDES=@INCLUDES@ -I@top_srcdir@ -I@top_srcdir@/libzend
noinst_LIBRARIES=libphpext_dba.a
libphpext_dba_a_SOURCES=dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c \
dba_ndbm.c
-17
View File
@@ -1,17 +0,0 @@
/* define if you want to use the dba extension */
#define NDBM_DB1_NDBM_H 0
#define NDBM_NDBM_H 0
#define DB2_DB2_DB_H 0
#define DB2_DB_DB2_H 0
#define DB2_DB_H 0
#define DB2_DB2_H 0
#define HAVE_DBA 0
#define DBA_GDBM 0
#define DBA_NDBM 0
#define DBA_DBOPEN 0
#define DBA_DB2 0
#define DBA_DBM 0
#define DBA_CDB 0
-210
View File
@@ -1,210 +0,0 @@
dnl $Id$
dnl config.m4 for extension dba
dnl don't forget to call PHP_EXTENSION(dba)
AC_DEFUN(AC_TEMP_LDFLAGS,[
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$1 $LDFLAGS"
$2
LDFLAGS="$old_LDFLAGS"
])
dnl Assign INCLUDE/LFLAGS from PREFIX
AC_DEFUN(AC_DBA_STD_ASSIGN,[
if test "$THIS_PREFIX" != "" -a "$THIS_PREFIX" != "/usr"; then
THIS_INCLUDE="$THIS_PREFIX/include"
THIS_LFLAGS="$THIS_PREFIX/lib"
fi
])
dnl Standard check
AC_DEFUN(AC_DBA_STD_CHECK,[
THIS_RESULT="yes"
if test "$THIS_PREFIX" != "/usr"; then
if test "$THIS_INCLUDE" = "" ; then
AC_MSG_ERROR(cannot find necessary header file(s))
elif test "$THIS_LIBS" = "" ; then
AC_MSG_ERROR(cannot find necessary library)
fi
fi
])
dnl Attach THIS_x to DBA_x
AC_DEFUN(AC_DBA_STD_ATTACH,[
AC_ADD_INCLUDE($THIS_INCLUDE)
AC_ADD_LIBRARY_WITH_PATH($THIS_LIBS, $THIS_LFLAGS)
THIS_INCLUDE=""
THIS_LIBS=""
THIS_LFLAGS=""
THIS_PREFIX=""
])
dnl Print the result message
AC_DEFUN(AC_DBA_STD_RESULT,[
if test "$THIS_RESULT" = "yes"; then
HAVE_DBA=1
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
THIS_RESULT=""
])
AC_ARG_WITH(gdbm,
[ --with-gdbm[=DIR] Include GDBM support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
if test -f "$i/include/gdbm.h"; then
THIS_PREFIX="$i"
fi
done
unset ac_cv_lib_gdbm_gdbm_open
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB(gdbm, gdbm_open, [AC_DEFINE(DBA_GDBM, 1) THIS_LIBS="gdbm"])
])
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for GDBM support)
AC_DBA_STD_RESULT
AC_ARG_WITH(ndbm,
[ --with-ndbm[=DIR] Include NDBM support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
if test -f "$i/include/db1/ndbm.h" ; then
THIS_PREFIX="$i"
NDBM_EXTRA="NDBM_DB1_NDBM_H"
elif test -f "$i/include/ndbm.h" ; then
THIS_PREFIX="$i"
NDBM_EXTRA="NDBM_NDBM_H"
fi
done
if test "$NDBM_EXTRA" != ""; then
eval "AC_DEFINE($NDBM_EXTRA, 1)"
fi
for LIB in db1 ndbm c; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, dbm_open, [AC_DEFINE(DBA_NDBM,1) THIS_LIBS="$LIB"])
])
done
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for NDBM support)
AC_DBA_STD_RESULT
AC_ARG_WITH(db2,
[ --with-db2[=DIR] Include DB2 support],[
if test "$withval" != "no"; then
for i in /usr/local /usr /usr/BerkeleyDB $withval; do
if test -f "$i/db2/db.h"; then
THIS_PREFIX="$i"
DB2_EXTRA="db2"
elif test -f "$i/include/db2/db.h"; then
THIS_PREFIX="$i"
DB2_EXTRA="DB2_DB2_DB_H"
elif test -f "$i/include/db/db2.h"; then
THIS_PREFIX="$i"
DB2_EXTRA="DB2_DB_DB2_H"
elif test -f "$i/include/db2.h"; then
THIS_PREFIX="$i"
DB2_EXTRA="DB2_DB2_H"
elif test -f "$i/include/db.h" ; then
THIS_PREFIX="$i"
DB2_EXTRA="DB2_DB_H"
fi
done
if test "$DB2_EXTRA" = "db2" ; then
DBA_INCLUDE="$DBA_INCLUDE -I$THIS_PREFIX/db2"
DB2_EXTRA="DB2_DB_H"
fi
if test "$DB2_EXTRA" != ""; then
eval "AC_DEFINE($DB2_EXTRA, 1)"
fi
for LIB in db db2 c; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, db_appinit, [AC_DEFINE(DBA_DB2,1) THIS_LIBS="$LIB"])
])
done
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for DB2 support)
AC_DBA_STD_RESULT
AC_ARG_WITH(dbm,
[ --with-dbm[=DIR] Include DBM support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
if test -f "$i/include/dbm.h" ; then
THIS_PREFIX="$i"
fi
done
for LIB in db1 dbm c; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, dbminit, [AC_DEFINE(DBA_DBM,1) THIS_LIBS="$LIB"])
])
done
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for DBM support)
AC_DBA_STD_RESULT
AC_ARG_WITH(cdb,
[ --with-cdb[=DIR] Include CDB support],[
if test "$withval" != "no"; then
for i in /usr/local /usr $withval; do
if test -f "$i/include/cdb.h" ; then
THIS_PREFIX="$i"
fi
done
for LIB in cdb c; do
AC_TEMP_LDFLAGS(-L$THIS_PREFIX/lib,[
AC_CHECK_LIB($LIB, cdb_bread, [AC_DEFINE(DBA_CDB,1) THIS_LIBS="$LIB"])
])
done
AC_DBA_STD_ASSIGN
AC_DBA_STD_CHECK
AC_DBA_STD_ATTACH
fi
])
AC_MSG_CHECKING(for CDB support)
AC_DBA_STD_RESULT
AC_MSG_CHECKING(whether to enable DBA interface)
if test "$HAVE_DBA" = "1"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DBA, 1)
PHP_EXTENSION(dba)
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_DBA, 0)
fi
-479
View File
@@ -1,479 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| 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 both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if HAVE_DBA
#include "php3_dba.h"
#include "php3_gdbm.h"
#include "php3_ndbm.h"
#include "php3_dbm.h"
#include "php3_cdb.h"
#include "php3_db2.h"
function_entry dba_functions[] = {
PHP_FE(dba_open, NULL)
PHP_FE(dba_popen, NULL)
PHP_FE(dba_close, NULL)
PHP_FE(dba_delete, NULL)
PHP_FE(dba_exists, NULL)
PHP_FE(dba_fetch, NULL)
PHP_FE(dba_insert, NULL)
PHP_FE(dba_replace, NULL)
PHP_FE(dba_firstkey, NULL)
PHP_FE(dba_nextkey, NULL)
PHP_FE(dba_optimize, NULL)
PHP_FE(dba_sync, NULL)
{NULL,NULL,NULL}
};
static PHP_MINIT_FUNCTION(dba);
static PHP_MSHUTDOWN_FUNCTION(dba);
static PHP_MINFO_FUNCTION(dba);
php3_module_entry dba_module_entry = {
"DataBase API", dba_functions,
PHP_MINIT(dba),
PHP_MSHUTDOWN(dba),
NULL, NULL,
PHP_MINFO(dba),
STANDARD_MODULE_PROPERTIES
};
typedef struct dba_handler {
char *name;
int (*open)(dba_info *);
void (*close)(dba_info *);
char* (*fetch)(dba_info *, char *, int, int *);
int (*update)(dba_info *, char *, int, char *, int, int);
int (*exists)(dba_info *, char *, int);
int (*delete)(dba_info *, char *, int);
char* (*firstkey)(dba_info *, int *);
char* (*nextkey)(dba_info *, int *);
int (*optimize)(dba_info *);
int (*sync)(dba_info *);
} dba_handler;
/* {{{ macromania */
#define DBA_ID_PARS \
pval **id; \
dba_info *info = NULL; \
int type, ac = ARG_COUNT(ht)
/* these are used to get the standard arguments */
#define DBA_GET1 \
if(ac != 1 || getParametersEx(ac, &id) != SUCCESS) { \
WRONG_PARAM_COUNT; \
}
#define DBA_GET2 \
pval **key; \
if(ac != 2 || getParametersEx(ac, &key, &id) != SUCCESS) { \
WRONG_PARAM_COUNT; \
} \
convert_to_string_ex(key)
#define DBA_IF_NOT_CORRECT_TYPE(link_id) \
info = php3_list_find(link_id, &type); \
if(!info || (type != GLOBAL(le_db) && type != GLOBAL(le_pdb)))
#define DBA_ID_GET \
convert_to_long_ex(id); \
DBA_IF_NOT_CORRECT_TYPE((*id)->value.lval) { \
php_error(E_WARNING, "Unable to find DBA identifier %d", \
(*id)->value.lval); \
RETURN_FALSE; \
}
#define DBA_ID_GET1 DBA_ID_PARS; DBA_GET1; DBA_ID_GET
#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_ID_GET
/* a DBA handler must have specific routines */
#define DBA_HND(x) \
{\
#x, dba_open_##x, dba_close_##x, dba_fetch_##x, dba_update_##x, \
dba_exists_##x, dba_delete_##x, dba_firstkey_##x, dba_nextkey_##x, \
dba_optimize_##x, dba_sync_##x \
},
/* check whether the user has write access */
#define DBA_WRITE_CHECK \
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
php_error(E_WARNING, "you cannot perform a modification to a database without proper access"); \
RETURN_FALSE; \
}
#define GLOBAL(a) a
/* }}} */
/* {{{ globals */
static dba_handler handler[] = {
#if DBA_GDBM
DBA_HND(gdbm)
#endif
#if DBA_DBM
DBA_HND(dbm)
#endif
#if DBA_NDBM
DBA_HND(ndbm)
#endif
#if DBA_CDB
DBA_HND(cdb)
#endif
#if DBA_DB2
DBA_HND(db2)
#endif
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
static int le_db;
static int le_pdb;
static HashTable ht_keys;
/* }}} */
/* {{{ helper routines */
/* {{{ dba_close */
static void dba_close(dba_info *info)
{
if(info->hnd) info->hnd->close(info);
if(info->path) free(info->path);
free(info);
}
/* }}} */
/* {{{ php3_minit_dba */
static PHP_MINIT_FUNCTION(dba)
{
zend_hash_init(&ht_keys, 0, NULL, NULL, 1);
GLOBAL(le_db) = register_list_destructors(dba_close, NULL);
GLOBAL(le_pdb) = register_list_destructors(NULL, dba_close);
return SUCCESS;
}
/* }}} */
/* {{{ php3_mshutdown_dba */
static PHP_MSHUTDOWN_FUNCTION(dba)
{
zend_hash_destroy(&ht_keys);
return SUCCESS;
}
/* }}} */
/* {{{ php3_info_dba */
static PHP_MINFO_FUNCTION(dba)
{
dba_handler *hptr;
PUTS("V1 ($Id$)");
for(hptr = handler; hptr->name; hptr++) {
PUTS(" ");
PUTS(hptr->name);
}
}
/* }}} */
/* {{{ _php3_dba_update */
static void _php3_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
DBA_ID_PARS;
pval **val, **key;
if(ac != 3 || getParametersEx(ac, &key, &val, &id) != SUCCESS) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(key);
convert_to_string_ex(val);
DBA_ID_GET;
DBA_WRITE_CHECK;
if(info->hnd->update(info, VALLEN(key), VALLEN(val), mode) == SUCCESS)
RETURN_TRUE;
RETURN_FALSE;
}
/* }}} */
/* {{{ _php3_dba_open */
#define FREENOW if(args) efree(args); if(key) efree(key)
static void _php3_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
pval ***args = (pval ***) NULL;
int ac = ARG_COUNT(ht);
dba_mode_t modenr;
dba_info *info;
dba_handler *hptr;
char *key = NULL;
int keylen = 0;
int listid;
int i;
if(ac < 3) {
WRONG_PARAM_COUNT;
}
/* we pass additional args to the respective handler */
args = emalloc(ac * sizeof(pval *));
if(getParametersArrayEx(ac, args) != SUCCESS) {
FREENOW;
WRONG_PARAM_COUNT;
}
/* we only take string arguments */
for(i = 0; i < ac; i++) {
convert_to_string_ex(args[i]);
keylen += (*args[i])->value.str.len;
}
if(persistent) {
/* calculate hash */
key = emalloc(keylen);
keylen = 0;
for(i = 0; i < ac; i++) {
memcpy(key+keylen,(*args[i])->value.str.val,(*args[i])->value.str.len);
keylen += (*args[i])->value.str.len;
}
if(zend_hash_find(&ht_keys, key, keylen, (void **) &info) == SUCCESS) {
FREENOW;
RETURN_LONG(php3_list_insert(info, GLOBAL(le_pdb)));
}
}
for(hptr = handler; hptr->name &&
strcasecmp(hptr->name, (*args[2])->value.str.val); hptr++);
if(!hptr->name) {
php_error(E_WARNING, "no such handler: %s", (*args[2])->value.str.val);
FREENOW;
RETURN_FALSE;
}
switch((*args[1])->value.str.val[0]) {
case 'c':
modenr = DBA_CREAT;
break;
case 'w':
modenr = DBA_WRITER;
break;
case 'r':
modenr = DBA_READER;
break;
case 'n':
modenr = DBA_TRUNC;
break;
default:
php_error(E_WARNING,"illegal DBA mode: %s",(*args[1])->value.str.val);
FREENOW;
RETURN_FALSE;
}
info = malloc(sizeof(*info));
memset(info, 0, sizeof(info));
info->path = strdup((*args[0])->value.str.val);
info->mode = modenr;
info->argc = ac - 3;
info->argv = args + 3;
info->hnd = NULL;
if(hptr->open(info) != SUCCESS) {
dba_close(info);
php_error(E_WARNING, "driver initialization failed");
FREENOW;
RETURN_FALSE;
}
info->hnd = hptr;
info->argc = 0;
info->argv = NULL;
listid = php3_list_insert(info, persistent?GLOBAL(le_pdb):GLOBAL(le_db));
if(persistent) {
zend_hash_update(&ht_keys, key, keylen, info, sizeof(*info), NULL);
}
FREENOW;
RETURN_LONG(listid);
}
#undef FREENOW
/* }}} */
/* }}} */
/* {{{ proto int dba_popen(string path, string mode, string handlername[, ...])
opens path using the specified handler in mode persistently */
PHP_FUNCTION(dba_popen)
{
_php3_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ proto int dba_open(string path, string mode, string handlername[, ...])
opens path using the specified handler in mode*/
PHP_FUNCTION(dba_open)
{
_php3_dba_open(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto void dba_close(int handle)
closes database */
PHP_FUNCTION(dba_close)
{
DBA_ID_GET1;
php3_list_delete((*id)->value.lval);
}
/* }}} */
/* {{{ proto bool dba_exists(string key, int handle)
checks, if the specified key exists */
PHP_FUNCTION(dba_exists)
{
DBA_ID_GET2;
if(info->hnd->exists(info, VALLEN(key)) == SUCCESS) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto string dba_fetch(string key, int handle)
fetches the data associated with key */
PHP_FUNCTION(dba_fetch)
{
char *val;
int len = 0;
DBA_ID_GET2;
if((val = info->hnd->fetch(info, VALLEN(key), &len)) != NULL) {
RETURN_STRINGL(val, len, 0);
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto string dba_firstkey(int handle)
resets the internal key pointer and returns the first key */
PHP_FUNCTION(dba_firstkey)
{
char *fkey;
int len;
DBA_ID_GET1;
fkey = info->hnd->firstkey(info, &len);
if(fkey)
RETURN_STRINGL(fkey, len, 0);
RETURN_FALSE;
}
/* }}} */
/* {{{ proto string dba_nextkey(int handle)
returns the next key */
PHP_FUNCTION(dba_nextkey)
{
char *nkey;
int len;
DBA_ID_GET1;
nkey = info->hnd->nextkey(info, &len);
if(nkey)
RETURN_STRINGL(nkey, len, 0);
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool dba_delete(string key, int handle)
deletes the entry associated with key */
PHP_FUNCTION(dba_delete)
{
DBA_ID_GET2;
DBA_WRITE_CHECK;
if(info->hnd->delete(info, VALLEN(key)) == SUCCESS)
RETURN_TRUE;
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool dba_insert(string key, string value, int handle)
inserts value as key, returns false, if key exists already */
PHP_FUNCTION(dba_insert)
{
_php3_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ proto bool dba_replace(string key, string value, int handle)
inserts value as key, replaces key, if key exists already */
PHP_FUNCTION(dba_replace)
{
_php3_dba_update(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
/* }}} */
/* {{{ proto bool dba_optimize(int handle)
optimizes (e.g. clean up, vacuum) database */
PHP_FUNCTION(dba_optimize)
{
DBA_ID_GET1;
DBA_WRITE_CHECK;
if(info->hnd->optimize(info) == SUCCESS) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool dba_sync(int handle)
synchronizes database */
PHP_FUNCTION(dba_sync)
{
DBA_ID_GET1;
if(info->hnd->sync(info) == SUCCESS) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
#endif
-220
View File
@@ -1,220 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| 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 both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if DBA_CDB
#include "php3_cdb.h"
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <cdb.h>
#include <cdbmake.h>
#define CDB_INFO \
dba_cdb *cdb = (dba_cdb *) info->dbf
typedef struct {
int fd;
uint32 eod; /* size of constant database */
uint32 pos; /* current position for traversing */
} dba_cdb;
DBA_OPEN_FUNC(cdb)
{
int gmode = 0;
dba_cdb *cdb;
dba_info *pinfo = (dba_info *) info;
switch(info->mode) {
case DBA_READER:
gmode = O_RDONLY; break;
/* currently not supported: */
#if 0
case DBA_WRITER:
gmode = O_RDWR; break;
#endif
default:
return FAILURE;
}
cdb = malloc(sizeof *cdb);
memset(cdb, 0, sizeof *cdb);
cdb->fd = open(info->path, gmode);
if(cdb->fd < 0) {
free(cdb);
return FAILURE;
}
pinfo->dbf = cdb;
return SUCCESS;
}
DBA_CLOSE_FUNC(cdb)
{
CDB_INFO;
close(cdb->fd);
free(cdb);
}
DBA_FETCH_FUNC(cdb)
{
CDB_INFO;
int len;
char *new = NULL;
if(cdb_seek(cdb->fd, key, keylen, &len) == 1) {
new = emalloc(len);
read(cdb->fd, new, len);
if(newlen) *newlen = len;
}
return new;
}
DBA_UPDATE_FUNC(cdb)
{
/* if anyone figures out cdbmake.c, let me know */
return FAILURE;
}
DBA_EXISTS_FUNC(cdb)
{
CDB_INFO;
int len;
if(cdb_seek(cdb->fd, key, keylen, &len) == 1)
return SUCCESS;
return FAILURE;
}
DBA_DELETE_FUNC(cdb)
{
return FAILURE;
}
#define CREAD(n) if(read(cdb->fd, buf, n) < n) return NULL
#define CSEEK(n) \
if(n >= cdb->eod) return NULL; \
if(lseek(cdb->fd, (off_t)n, SEEK_SET) != (off_t) n) return NULL
DBA_FIRSTKEY_FUNC(cdb)
{
CDB_INFO;
uint32 len;
char buf[8];
char *key;
cdb->eod = -1;
CSEEK(0);
CREAD(4);
cdb->eod = cdb_unpack(buf);
CSEEK(2048);
CREAD(8);
len = cdb_unpack(buf);
key = emalloc(len + 1);
if(read(cdb->fd, key, len) < len) {
efree(key);
key = NULL;
} else
key[len] = '\0';
/* header + klenlen + dlenlen + klen + dlen */
cdb->pos = 2048 + 4 + 4 + len + cdb_unpack(buf + 4);
return key;
}
DBA_NEXTKEY_FUNC(cdb)
{
CDB_INFO;
uint32 len;
char buf[8];
char *nkey;
CSEEK(cdb->pos);
CREAD(8);
len = cdb_unpack(buf);
nkey = emalloc(len + 1);
if(read(cdb->fd, nkey, len) < len) {
efree(nkey);
return NULL;
}
nkey[len] = '\0';
if(newlen) *newlen = len;
cdb->pos += 8 + len + cdb_unpack(buf + 4);
return nkey;
#if 0
/* this code cdb_seeks and is thus slower than directly seeking
in the file */
CDB_INFO;
char *nkey = NULL;
uint32 len;
char buf[8];
if(cdb_seek(cdb->fd, key, keylen, &len) == 1) {
if(lseek(cdb->fd, (off_t) len, SEEK_CUR) >= (off_t) cdb->eod)
return NULL;
CREAD(8);
len = cdb_unpack(buf);
nkey = emalloc(len + 1);
if(read(cdb->fd, nkey, len) < len) {
efree(nkey);
nkey = NULL;
} else
nkey[len] = '\0';
}
return nkey;
#endif
}
DBA_OPTIMIZE_FUNC(cdb)
{
return SUCCESS;
}
DBA_SYNC_FUNC(cdb)
{
/* this is read-only */
return SUCCESS;
}
#endif
-207
View File
@@ -1,207 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP HTML Embedded Scripting Language Version 3.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
| |
| A) the GNU General Public License as published by the Free Software |
| Foundation; either version 2 of the License, or (at your option) |
| any later version. |
| |
| B) the PHP License as published by the PHP Development Team and |
| included in the distribution in the file: LICENSE |
| |
| 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 both licenses referred to here. |
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
| Authors: Sascha Schumann <sas@schell.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include "php.h"
#if DBA_DB2
#include "php3_db2.h"
#include <sys/stat.h>
#include <string.h>
#if DB2_DB2_DB_H
#include <db2/db.h>
#elif DB2_DB_DB2_H
#include <db/db2.h>
#elif DB2_DB2_H
#include <db2.h>
#elif DB2_DB_H
#include <db.h>
#endif
#define DB2_DATA dba_db2_data *dba = info->dbf
#define DB2_GKEY \
DBT gkey; \
memset(&gkey, 0, sizeof(gkey)); \
gkey.data = (char *) key; gkey.size = keylen
typedef struct {
DB *dbp;
DBC *cursor;
} dba_db2_data;
DBA_OPEN_FUNC(db2)
{
DB *dbp;
DBTYPE type;
int gmode = 0;
int filemode = 0644;
struct stat check_stat;
type = info->mode == DBA_READER ? DB_UNKNOWN :
info->mode == DBA_TRUNC ? DB_BTREE :
stat(info->path, &check_stat) ? DB_BTREE : DB_UNKNOWN;
gmode = info->mode == DBA_READER ? DB_RDONLY :
info->mode == DBA_CREAT ? DB_CREATE :
info->mode == DBA_WRITER ? 0 :
info->mode == DBA_TRUNC ? DB_CREATE | DB_TRUNCATE : -1;
if(gmode == -1)
return FAILURE;
if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
}
if(!db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) {
info->dbf = malloc(sizeof(dba_db2_data));
memset(info->dbf, 0, sizeof(dba_db2_data));
((dba_db2_data *) info->dbf)->dbp = dbp;
return SUCCESS;
}
return FAILURE;
}
DBA_CLOSE_FUNC(db2)
{
DB2_DATA;
if(dba->cursor) dba->cursor->c_close(dba->cursor);
dba->dbp->close(dba->dbp, 0);
free(dba);
}
DBA_FETCH_FUNC(db2)
{
DBT gval;
char *new = NULL;
DB2_DATA;
DB2_GKEY;
memset(&gval, 0, sizeof(gval));
if(!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
if(newlen) *newlen = gval.size;
new = estrndup(gval.data, gval.size);
}
return new;
}
DBA_UPDATE_FUNC(db2)
{
DBT gval;
DB2_DATA;
DB2_GKEY;
memset(&gval, 0, sizeof(gval));
gval.data = (char *) val;
gval.size = vallen;
if(!dba->dbp->put(dba->dbp, NULL, &gkey, &gval,
mode == 1 ? DB_NOOVERWRITE : 0)) {
return SUCCESS;
}
return FAILURE;
}
DBA_EXISTS_FUNC(db2)
{
DBT gval;
DB2_DATA;
DB2_GKEY;
memset(&gval, 0, sizeof(gval));
if(!dba->dbp->get(dba->dbp, NULL, &gkey, &gval, 0)) {
return SUCCESS;
}
return FAILURE;
}
DBA_DELETE_FUNC(db2)
{
DB2_DATA;
DB2_GKEY;
return dba->dbp->del(dba->dbp, NULL, &gkey, 0) ? FAILURE : SUCCESS;
}
DBA_FIRSTKEY_FUNC(db2)
{
DB2_DATA;
if(dba->cursor) {
dba->cursor->c_close(dba->cursor);
}
dba->cursor = NULL;
#if (DB_VERSION_MAJOR > 2) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR > 6) || (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 6 && DB_VERSION_PATCH >= 4)
if(dba->dbp->cursor(dba->dbp, NULL, &dba->cursor, 0)) {
#else
if(dba->dbp->cursor(dba->dbp, NULL, &dba->cursor)) {
#endif
return NULL;
}
/* we should introduce something like PARAM_PASSTHRU... */
return dba_nextkey_db2(info, newlen);
}
DBA_NEXTKEY_FUNC(db2)
{
DB2_DATA;
DBT gkey, gval;
char *nkey = NULL;
memset(&gkey, 0, sizeof(gkey));
memset(&gval, 0, sizeof(gval));
if(!dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT)) {
if(gkey.data) {
nkey = estrndup(gkey.data, gkey.size);
if(newlen) *newlen = gkey.size;
}
}
return nkey;
}
DBA_OPTIMIZE_FUNC(db2)
{
return SUCCESS;
}
DBA_SYNC_FUNC(db2)
{
DB2_DATA;
return dba->dbp->sync(dba->dbp, 0) ? FAILURE : SUCCESS;
}
#endif
Loaded 100 of 684 files, more files were not shown because too many files have changed in this diff. Show more