Compare commits

..
Author SHA1 Message Date
SVN Migration fc982e5248 This commit was manufactured by cvs2svn to create tag 'php_4_0_7RC3'. 2001-10-01 12:51:13 +00:00
Hartmut Holzgraefe 41b3015125 MFH 2001-10-01 12:51:12 +00:00
Rasmus Lerdorf 42b7601378 MFH 2001-09-30 04:43:19 +00:00
Jon Parise 86c32174be Build pear/scripts/phptar in the configure run. 2001-09-29 17:57:37 +00:00
Rasmus Lerdorf c5bf17f0a5 MFH 2001-09-27 07:39:24 +00:00
Zeev Suraski 730359dc4d MFH the list of 4.0.7 changes 2001-09-26 21:56:23 +00:00
Zeev Suraski 4053948470 MFH 2001-09-26 21:47:18 +00:00
Harald Radi 333ce2d050 changed flags 2001-09-25 16:29:45 +00:00
Andi Gutmans a84618a3de - MFH. File uploads need to be tested thoroughly in RC3! 2001-09-24 17:48:22 +00:00
Wez Furlong eff475de14 MFH 2001-09-20 15:05:37 +00:00
Joey Smith 7114dae40d MFH, Close bug #13322 2001-09-19 02:35:49 +00:00
Daniel Beulshausen ec9bda9e5c MFH 2001-09-17 13:43:15 +00:00
Daniel Beulshausen 74dbaf655b MFH 2001-09-17 13:21:58 +00:00
Daniel Beulshausen 137b57c5ba MFH 2001-09-17 12:23:43 +00:00
Thies C. Arntzen 6d00133ce2 fixed memory_peak reporting 2001-09-16 15:49:55 +00:00
Sascha Schumann 087fd4c609 this is not pure rc2 anymore 2001-09-13 21:52:40 +00:00
Sascha Schumann 1b740da6d4 MFH.. necessary fix 2001-09-13 21:41:30 +00:00
Jason Greene 0d3ce62b63 Merge recent socket fixes 2001-09-11 16:08:28 +00:00
Sascha Schumann d90cd52b89 MFH 2001-09-10 11:24:18 +00:00
Harald Radi 973dbce2b9 MFH 2001-09-10 09:28:55 +00:00
Sascha Schumann f51c000bac MFH 2001-09-09 14:53:38 +00:00
Sterling Hughes 39812d33f7 ws fix 2001-09-09 09:48:16 +00:00
Sterling Hughes 2e9991865e MFH 2001-09-09 09:45:10 +00:00
Harald Radi 016ac5d400 MFH 2001-09-08 21:02:35 +00:00
Sterling Hughes bf344046b3 add proto 2001-09-07 11:35:44 +00:00
Sterling Hughes 26a5bb3fc7 MFH 2001-09-07 10:47:44 +00:00
Derick Rethans c117b30950 - MFH (Fix for bug 13052) 2001-09-07 07:51:06 +00:00
Rasmus Lerdorf b7a1b19734 MFH 2001-09-07 06:44:21 +00:00
foobar 3ba574871c MFH 2001-09-07 00:28:28 +00:00
Zeev Suraski 6122d87789 Go with RC2 2001-09-06 23:17:05 +00:00
Rasmus Lerdorf 8dffa18aec Interbase fixes 2001-09-05 15:41:45 +00:00
Stanislav Malyshev f51e3d044a MFH 2001-09-04 14:12:11 +00:00
Rasmus Lerdorf 6cc67717b1 MFH 2001-09-03 19:08:49 +00:00
Zeev Suraski 30812e3707 MFH 2001-09-01 14:57:32 +00:00
Zeev Suraski 0550e954e0 MFH 2001-09-01 01:45:51 +00:00
Zeev Suraski 73941736ca Fix TSRM.dsp's line endings (was causing trouble if used with tools that
didn't have auto-conversion of line endings)
2001-08-30 18:08:29 +00:00
foobar 80754851bd MFH 2001-08-30 16:30:14 +00:00
Joey Smith 2ae1766c1c MFH 2001-08-29 22:26:53 +00:00
Wez Furlong 96462f90a0 MFH 2001-08-29 11:33:06 +00:00
Wez Furlong c4cc49f487 MFH 2001-08-28 22:19:52 +00:00
Rasmus Lerdorf 07b4a21631 MFH 2001-08-28 21:52:38 +00:00
Stig Bakken 9c30514661 * MFH: Archive_Tar is no longer experimental 2001-08-28 12:27:27 +00:00
Stig Bakken a9d8aa7e08 * MFH: Log/Observer.php rename fix 2001-08-28 12:12:24 +00:00
Stig Bakken 28caf732a7 * MFH PEAR stuff
* copied in Archive_Tar class from pear/Archive_Tar
2001-08-28 11:41:13 +00:00
Andrei Zmievski 513874acc7 MFH 2001-08-27 16:52:49 +00:00
Stig Bakken d2363cdd19 * be smarter when trying to locate PHP binary 2001-08-27 16:34:30 +00:00
Joey Smith 30cd11ced1 MFH: Fix 1st case reported in #9893. 2nd case was fixed in previous commit. 2001-08-26 11:56:41 +00:00
Rasmus Lerdorf 8bed40bc2f MFH 2001-08-26 01:12:07 +00:00
foobar 4c6c14ac5e MFH 2001-08-24 20:07:07 +00:00
Christian Stocker a85d4245a3 Merge From 1.84 (XML/RPC stuff has gone to /pear) 2001-08-24 09:06:26 +00:00
Christian Stocker afe0765c0a changed the URL from my testing server to pear.php.net 2001-08-24 07:46:33 +00:00
foobar 0e57f1324b MFH 2001-08-22 10:26:56 +00:00
Joey Smith 938b31d395 MFH: Make stat() act like stat, not filesize(). 2001-08-21 23:59:21 +00:00
Joey Smith f3ffe2d258 MFH
Some changes to help out previous users of domxml...
node::tagname == node::name.
Add property "type" to textnode types.
2001-08-21 21:51:22 +00:00
Zeev Suraski 1563fa9a67 MFH 2001-08-21 18:14:38 +00:00
Sascha Schumann a4cf06cecd MFH 2001-08-20 15:30:33 +00:00
Stanislav Malyshev bd5d7bba59 MFH 2001-08-20 15:28:53 +00:00
foobar b404501183 MFH 2001-08-20 14:08:04 +00:00
Harald Radi b3655b0e12 MFH 2001-08-20 08:56:14 +00:00
foobar e8f9edd7a7 MFH 2001-08-19 06:39:58 +00:00
SVN Migration 95061e9ad2 This commit was manufactured by cvs2svn to create branch 'PHP_4_0_7'. 2001-08-19 00:34:09 +00:00
foobar 0f5dea39ad MFH 2001-08-18 21:09:41 +00:00
foobar 8ca2454ce2 Fixed the NEWS. 2001-08-18 20:23:13 +00:00
foobar e455e7cbca MFH 2001-08-18 18:15:22 +00:00
Zeev Suraski b33f9a00d2 MFH 2001-08-18 17:00:30 +00:00
Zeev Suraski e017ca8b72 MFH 2001-08-17 16:54:16 +00:00
foobar 6e75cfbd8c MFH 2001-08-17 16:43:00 +00:00
Harald Radi a1c9bd2bfb MFH 2001-08-17 08:19:28 +00:00
foobar 70a7172018 MFH 2001-08-17 06:55:38 +00:00
foobar 0dcfb7341f MFH 2001-08-17 00:48:33 +00:00
Zeev Suraski 91bd1d25e1 MFH 2001-08-16 23:59:35 +00:00
Zeev Suraski 766eaa4078 MFH 2001-08-16 23:35:09 +00:00
Zeev Suraski 8248d8cf2c MFH 2001-08-16 21:09:10 +00:00
Rasmus Lerdorf 0fd9dcc4bc MFH 2001-08-16 20:35:33 +00:00
Chuck Hagenbuch b381ad0f9d MFH 2001-08-16 20:21:31 +00:00
Thies C. Arntzen e53366609d MFH: move php_shutdown_config further down 2001-08-16 09:41:25 +00:00
Zeev Suraski bace148543 MFH 2001-08-15 23:21:05 +00:00
foobar 6549c08dfe MFH 2001-08-15 21:41:01 +00:00
Jeroen van Wolffelaar 1910df096c MFH 2001-08-15 19:11:39 +00:00
Jeroen van Wolffelaar dda54f4271 It was agreed that log2, exp2 and exp10 shouldn't be added to PHP. log10
already existed.

# Forgot to do this yesterday :(
2001-08-15 18:59:20 +00:00
Harald Radi 37f511a835 com entry was missing 2001-08-15 17:49:14 +00:00
Thies C. Arntzen 00bb550264 MFH the recursion-hack 2001-08-15 16:12:00 +00:00
Zeev Suraski eb6428126b Reroll 4.0.7RC1 2001-08-15 15:18:25 +00:00
SVN Migration 896bbc92e5 This commit was manufactured by cvs2svn to create branch 'PHP_4_0_7'. 2001-08-15 10:40:00 +00:00
1088 changed files with 63283 additions and 105258 deletions

No files matched your search

+8 -13
View File
@@ -60,9 +60,6 @@ Exceptions:
check its man page again, and only then, consider using it, and even then,
try avoiding it.
[7] Use ZEND_* macro instead of PHP_* macro. Use of PHP_* macros are
not recommended. Since most of PHP_* macros are ZEND_* macro alias, use of
PHP_* macro makes browsing source with tag search harder.
Naming Conventions
------------------
@@ -114,7 +111,7 @@ Naming Conventions
avoided, except for places where the variable has no real meaning or
a trivial meaning (e.g. for (i=0; i<100; i++) ...).
[5] Variable names should be in lowercase. Use underscores to separate
[5] Variable names should be in lowercase; Use underscores to seperate
between words.
@@ -135,10 +132,8 @@ Syntax and indentation
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 declaration
indentation and comment styles and up to function decleration
syntax.
(see also http://www.tuxedo.org/~esr/jargon/html/entry/indent-style.html)
[3] Be generous with whitespace and braces. Always prefer:
@@ -150,7 +145,7 @@ Syntax and indentation
if(foo)bar;
Keep one empty line between the variable declaration section and
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.
@@ -168,7 +163,7 @@ 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)
Returns the absolute value of the number */
Return the absolute value of the number */
PHP_FUNCTION(abs)
{
...
@@ -189,7 +184,7 @@ 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]]])
Returns a header object with the defined parameters */
Returns a header object with the defined parameters. */
And yes, please keep the prototype on a single line, even if that line
is massive.
@@ -204,14 +199,14 @@ standard prefixing conventions during their initial implementation.
The file labelled 'EXPERIMENTAL' should include the following
information:
Any authoring information (known bugs, future directions of the module).
Any authoring infomration (known bugs, future directions of the module).
Ongoing status notes which may not be appropriate for CVS comments.
Aliases & Legacy Documentation
-----------------------------------
You may also have some deprecated aliases with close to duplicate
names, for example, somedb_select_result and somedb_selectresult. For
documentation purposes, these will only be documented by the most
documentation puposes, these will only be documented by the most
current name, with the aliases listed in the documentation for
the parent function. For ease of reference, user-functions with
completely different names, that alias to the same function (such as
@@ -220,4 +215,4 @@ proto should still be included, describing which function is aliased.
Backwards compatible functions and names should be maintained as long
as the code can be reasonably be kept as part of the codebase. See
/phpdoc/README for more information on documentation.
/phpdoc/README for me information on documentation.
+17165 -3058
View File
File diff suppressed because it is too large. Load diff
BIN
View File
Binary file not shown.
+18 -55
View File
@@ -73,11 +73,6 @@ EXTENSION: thttpd
MAINTENANCE: Unknown
STATUS: Unknown
-------------------------------------------------------------------------------
EXTENSION: webjames
PRIMARY MAINTAINER: Alex Waugh <alex@alexwaugh.com>
MAINTENANCE: Maintained
STATUS: Experimental
-------------------------------------------------------------------------------
== Database extensions ==
@@ -93,13 +88,6 @@ PRIMARY MAINTAINER: Jim Winstead <jimw@php.net>
MAINTENANCE: Odd Fixes
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: dbx
PRIMARY MAINTAINER: Marc Boeren <M.Boeren@guidance.nl>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.6
COMMENT: DB abstraction for odbc, mysql, pgsql, mssql, fbsql and more, see documentation
-------------------------------------------------------------------------------
EXTENSION: filepro
MAINTENANCE: Unknown
STATUS: Unknown
@@ -129,12 +117,6 @@ EXTENSION: msql
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: msession
PRIMARY MAINTAINER Mark L. Woodward mlwmohawk@mohawksoft.com
MAINTENANCE: Maintained
STATUS: Working/Experimental
COMMENT: Tested on Linux, should work on other UNIX platforms. Backend server code can compile under Windows.
-------------------------------------------------------------------------------
EXTENSION: mssql
PRIMARY MAINTAINER: Frank M. Kromann <fmk@swwwing.com>
MAINTENANCE: Maintained
@@ -146,10 +128,9 @@ MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: pgsql
PRIMARY MAINTAINER: Yasuo Ohgaki <yohgaki@php.net>
MAINTENANCE: Maintained
PRIMARY MAINTAINER: Jouni Ahto <jouni.ahto@exdec.fi>
MAINTENANCE: Odd fixes
STATUS: Working
COMMENT: Use PostgreSQL 7.0.x or later. PostgreSQL 6.5.3 or less have fatal bug.
-------------------------------------------------------------------------------
EXTENSION: sybase
MAINTENANCE: Unknown
@@ -165,7 +146,7 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: odbc
PRIMARY MAINTAINER: Daniel R. Kalowsky <kalowsky@php.net>
PRIMARY MAINTAINER: Andreas Karajannis <Karajannis@gmd.de>
MAINTENANCE: Maintained
STATUS: Working
COMMENT: Working except for persistent connections
@@ -197,14 +178,12 @@ STATUS: Working
SINCE: 4.0.3
-------------------------------------------------------------------------------
EXTENSION: calendar
PRIMARY MAINTAINER: Hartmut Holzgraefe <hartmut@six.de>
MAINTENANCE: Odd Fixes
STATUS: Working
MAINTENANCE: Unknown
STATUS: Unknown
-------------------------------------------------------------------------------
EXTENSION: com
PRIMARY MAINTAINER: Harald Radi <h.radi@nme.at>
MAINTENANCE: Maintained
STATUS: Working
MAINTENANCE: Unknown
STATUS: Unknown
-------------------------------------------------------------------------------
EXTENSION: cpdf
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
@@ -238,10 +217,9 @@ MAINTENANCE: Maintained
STATUS: Experimental
-------------------------------------------------------------------------------
EXTENSION: exif
PRIMARY MAINTAINER: Marcus Boerger <helly@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.2
MAINTENANCE: Unknown
STATUS: Unknown
SINCE: 4.0.1
-------------------------------------------------------------------------------
EXTENSION: fdf
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
@@ -281,13 +259,8 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: ldap
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: mbstring
PRIMARY MAINTAINER: Rui Hirokawa <hirokawa@php.net>
MAINTENANCE: Maintained
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
MAINTENANCE: Odd Fixes
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: mcal
@@ -296,7 +269,7 @@ MAINTENANCE: Odd Fixes
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: mcrypt
PRIMARY MAINTAINER: Derick Rethans <d.rethans@jdimedia.nl>
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -318,13 +291,8 @@ MAINTENANCE: Maintained
STATUS: Experimental
SINCE: 4.0.4
-------------------------------------------------------------------------------
EXTENSION: overload
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
-------------------------------------------------------------------------------
EXTENSION: pcre
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -373,7 +341,7 @@ STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: sablot
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
MAINTENANCE: Obsolete
MAINTENANCE: Maintained
STATUS: Experimental
SINCE: 4.0.3
-------------------------------------------------------------------------------
@@ -389,8 +357,8 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: shmop
PRIMARY MAINTAINER: Ilia Alshanetsky <iliaa@php.net>
MAINTENANCE: Maintained
PRIMARY MAINTAINER: Unknown
MAINTENANCE: Unknown
STATUS: Experimental
SINCE: 4.0.3
-------------------------------------------------------------------------------
@@ -425,7 +393,7 @@ STATUS: Experimental
SINCE: 4.0.5
-------------------------------------------------------------------------------
EXTENSION: wddx
PRIMARY MAINTAINER: Andrei Zmievski <andrei@php.net>
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
@@ -434,11 +402,6 @@ PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: xslt
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
MAINTENANC: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: yaz
PRIMARY MAINTAINER: Adam Dickmeiss <adam@indexdata.dk>
MAINTENANCE: Maintained
+39 -44
View File
@@ -1,17 +1,9 @@
Installation Instructions for PHP 4
-----------------------------------
Installation Instructions for PHP 4.0
-------------------------------------
STOP!
Before going any further, please remember you are going to find more
up to date instructions in the online manual, located here:
http://www.php.net/manual/en/install.apache.php
It is strongly recommended that you read the manual page before going
further. However, for the impatient, here is a quick set of steps that
will build PHP as (first) a dynamic Apache module (DSO) for Apache 1.3.x
with MySQL support and then a static module. A more verbose explanation follows.
For the impatient here is a quick set of steps that will build PHP as
first a dynamic Apache module (DSO) for Apache 1.3.x with MySQL support
and then a static module. A more verbose explanation follows.
For installing PHP on other web servers, refer to one of the following
files:
@@ -22,26 +14,24 @@ files:
sapi/thttpd/README
README.Zeus
Some notes:
Note! Only install either the static module or the dynamic one. Do not
install both.
1: Only install either the static module or the dynamic one. Do not
install both.
Note 2! If you are recompiling PHP to add new extensions or upgrading
something like GD, remove the config.cache file before you re-run
configure.
2: If you are recompiling PHP to add new extensions or upgrading
something like GD, remove the config.cache file before you re-run
configure.
Note 3! If you are on Linux and have installed shared libraries, make
sure the location of these shared libraries are listed in your
/etc/ld.so.conf file. For example, if you have:
3: If you are on Linux and have installed shared libraries, make
sure the location of these shared libraries are listed in your
/etc/ld.so.conf file. For example, if you have:
/usr/local/lib/mysql/libmysqlclient.so
/usr/local/lib/mysql/libmysqlclient.so
Make sure /etc/ld.so.conf contains:
Make sure /etc/ld.so.conf contains:
/usr/local/lib/mysql
/usr/local/lib/mysql
Then run ldconfig.
Then run ldconfig.
If you want both PHP 3 and 4 modules in the same Apache server, check the
bottom of this file for instructions.
@@ -62,8 +52,8 @@ Compiled-in modules:
Chances are you will see a lot more modules than these two. That's ok,
as long as mod_so.c shows up you can proceed with the following steps:
$ gunzip -c php-4.x.y.tar.gz | tar xf -
$ cd php-4.x.y
$ gunzip -c php-4.0.x.tar.gz | tar xf -
$ cd php-4.0.x
$ ./configure --with-mysql --with-apxs
$ make
$ make install
@@ -93,9 +83,9 @@ $ cd apache_1.3.x
$ ./configure
$ cd ..
$ gunzip -c php-4.x.y.tar.gz | tar xf -
$ cd php-4.x.y
$ ./configure --with-mysql --with-apache=../apache_1.3.x
$ 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
@@ -106,7 +96,7 @@ $ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
$ make
(you should now have an httpd binary which you can copy to your Apache bin dir if
is is your first install then you need to "make install" as well)
$ cd ../php-4.x.y
$ 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:
@@ -125,12 +115,12 @@ Installing PHP can be done in four simple steps:
1. Unpack your distribution file.
You will have downloaded a file named something like php-4.x.y.tar.gz.
Unzip this file with a command like: gunzip php-4.x.y.tar.gz
You will have downloaded a file named something like php-4.0.x.tar.gz.
Unzip this file with a command like: gunzip php-4.0.x.tar.gz
Next you have to untar it with: tar -xvf php-4.x.y.tar
Next you have to untar it with: tar -xvf php-4.0.x.tar
This will create a php-4.x.y directory. cd into this new directory.
This will create a php-4.0.x directory. cd into this new directory.
2a. Configure PHP (Dynamic Module) - Skip to 2b if you wish to build
a static module
@@ -390,11 +380,16 @@ WHY DISABLING -fPIC WORKS ON LINUX
USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES
With some (newer) installations of Apache, it's possible to compile both
PHP 3 and PHP 4, and run them concurrently.
Recent operating systems provide the ability to perform versioning and
scoping. This features make it possible to let PHP 3 and PHP 4 run as
concurrent modules in one Apache server.
This feature is known to work on the following platforms:
Note, it's only really wise to do this if you need to use the PHP 3 engine
to maintain backwards compatibility.
- Linux with recent binutils (binutils 2.9.1.0.25 tested)
- Solaris 2.5 or better
- FreeBSD (3.2, 4.0 tested)
- IRIX64 6.5
To enable it, configure PHP 3 and PHP 4 to use APXS (--with-apxs) and the
necessary link extensions (--enable-versioning). Otherwise, all standard
@@ -404,8 +399,8 @@ USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES
--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
+32 -25
View File
@@ -1,6 +1,6 @@
--------------------------------------------------------------------
The PHP License, version 3.0
Copyright (c) 1999 - 2002 The PHP Group. All rights reserved.
The PHP License, version 2.02
Copyright (c) 1999, 2000 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -8,38 +8,48 @@ 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.
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.
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 written permission. For
written permission, please contact group@php.net.
4. Products derived from this software may not be called "PHP", nor
may "PHP" appear in their name, without prior written permission
from group@php.net. You may indicate that your software works in
conjunction with PHP by saying "Foo for PHP" instead of calling
it "PHP Foo" or "phpfoo"
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.
5. The PHP Group may publish revised and/or new versions of the
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
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.
6. Redistributions of any form whatsoever must retain the following
5. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes PHP, freely available from
<http://www.php.net/>".
http://www.php.net/".
6. The software incorporates the Zend Engine, a product of Zend
Technologies, Ltd. ("Zend"). The Zend Engine is licensed to the
PHP Association (pursuant to a grant from Zend that can be
found at http://www.php.net/license/ZendGrant/) for
distribution to you under this license agreement, only as a
part of PHP. In the event that you separate the Zend Engine
(or any portion thereof) from the rest of the software, or
modify the Zend Engine, or any portion thereof, your use of the
separated or modified Zend Engine software shall not be governed
by this license, and instead shall be governed by the license
set forth at http://www.zend.com/license/ZendLicense/.
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
@@ -63,6 +73,3 @@ The PHP Group can be contacted via Email at group@php.net.
For more information on the PHP Group and the PHP project,
please see <http://www.php.net>.
This product includes the Zend Engine, freely available at
<http://www.zend.com>.
+4 -8
View File
@@ -1,6 +1,6 @@
ZEND_DIR = $(srcdir)/Zend
SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) $(CLI_DIR) . $(PEAR_DIR)
SUBDIRS = Zend main ext sapi $(TSRM_DIR) $(REGEX_DIR) . $(PEAR_DIR)
LTLIBRARY_NAME = libphp4.la
LTLIBRARY_SOURCES = stub.c
@@ -14,7 +14,7 @@ LTLIBRARY_DEPENDENCIES = \
$(TSRM_LIB)
LTLIBRARY_LDFLAGS = -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS)
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS)
LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS)
PROGRAM_NAME = php
PROGRAM_SOURCES = stub.c
@@ -51,16 +51,12 @@ install-modules:
cp modules/* $(INSTALL_ROOT)$(moduledir) >/dev/null 2>&1 || true
install-tester:
@echo "Installing regression tester"
@$(mkinstalldirs) $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
@$(INSTALL) -m 755 $(srcdir)/run-tests.php $(INSTALL_ROOT)$(PEAR_INSTALLDIR)
-$(mkinstalldirs) $(datadir)
$(INSTALL) -m 755 $(srcdir)/run-tests.php $(INSTALL_ROOT)$(datadir)
install-pear: install-modules
(cd pear && $(MAKE) install)
install-su: install-pear install-tester
clean-modules:
rm -f modules/*
.NOEXPORT:
+16 -345
View File
@@ -1,362 +1,33 @@
PHP 4 NEWS
PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2002, Version 4.2.3
- Fixed possible ASCII control char injection in mail(). (Stefan Esser)
- Fixed a potential crash bug in import_request_variables() (Zeev)
- Fixed several problems with directory functions on Windows. (Steph)
- Fixed xbithack bug in Apache module. (Rasmus)
- Fixed a bug that prevented touch() from working on various platforms. (Steph)
- Fixed ob_gzhandler()'s handling of requests that do have the Accept-Encoding
header, but do not allow compression. (Zeev)
- Fixed several bugs in the multithreaded version that could cause random parse
errors, especially on machines with multiple CPUs. (Zeev, Zend Engine)
- Fixed a build problem in bcmath. (Alan)
- Fixed several bzip2 issues. (Andrei, kalowsky)
- Fixed several COM issues. (Harald)
- Various exif fixes. (Marcus)
- Fixed domxml_xslt_process() and domxml_get_element_by_id() and several
other issues in DOMXML. (Christian)
- Fixed DOMXML crash on removing previously created attributes. (Christian)
- Fixed crash when converting $GLOBALS to an object. (Zeev, Zend Engine)
- Fixed ImageCreateFromGD2Part() (Jani)
- Fixed a build issue in the IMAP extension under IRIX. (kalowsky)
- Fixed a bug in imap_last_error() (Jani)
- Various mbstring fixes. (Yasuo, Rui)
- Fixed a build problem in the mcal extension. (Jani)
- Made MySQL rollback open transactions when the request ends. (Georg)
- Fixed a crash in the shutdown order of the ODBC module. (kalowsky)
- Fixed PCRE build problems. (troels@arvin.dk)
- Fixed a crash in pg_lo_write() (Yasuo)
- Fixed posix_isatty() and posix_ttyname(). (Markus)
- Fixed accidental pg_lo_import() API change. (Yasuo)
- Fixed ereg_replace() crash when the backreference number was greater than the
number of captured subpatterns. (oliver@billix.franken.de)
- Fixed array_rand() on thread-safe platforms such as Windows. (Edin)
- Report the right exit code after a call to exit(). (Edin)
22 Jul 2002, Version 4.2.2
- Fixed serious security vulnerability. (Stefan Esser)
13 May 2002, Version 4.2.1
- Added safe-mode checks to show_source(), parse_ini_file() and rmdir(). Also
fixed security problems with safe_mode_include_dir directive. (Rasmus)
- Changed HTTP upload code to accept 0 byte file uploads. (Zeev)
- Major update of domxml. New functions, better DOM compliance and bug fixes:
* Changed the old $node->append_child() to $node->append_sibling() since
the new append_child() behaves correctly (= W3C standard).
* Added domxml functions:
. domxml_elem_get_elements_by_tagname()
. domxml_doc_get_elements_by_tagname()
. domxml_doc_get_element_by_id()
. domxml_elem_remove_attribute()
. domxml_elem_get_attribute_node()
* Fixed a segfault in domxml_unlink().
* Added formatting option to domxml_dump_mem().
(Uwe, jtate, Chregu)
- Fixed a bug in socket_select() that could cause unexpected behavior when
using a statement like $w = $e = array($sock); This change unfortunately
prevents the use of constant values (e.g. NULL) for the socket array
paramaters. Instead, use a temporary variable or an expression with the
leftmost member being a temporary variable. ex.:
socket_select($w, $r, $e = NULL, 10); (Jason)
- Fixed crashes in the session serializer. (Stas)
- Fixed malformed atime/mtime with touch(). (Yasuo)
- Fixed a couple of bugs in array_sum() and array_merge(). (Andrei)
- Fixed SJIS directory name handling under Windows. (Rui)
- Fixed empty mb_output_handler() output when Content-Type is specified.
(Yasuo)
- Fixed the false logic in ext/session which made SID constant not to be
defined when cookies are disabled. (Sascha)
- Fixed possible crash bug in HTTP uploads. (Patch: Lucas Schroeder)
- Fixed possible NULL-pointer dereferencing in the COM extension which
caused 'Error in php_OLECHAR_to_char()' warnings on various places.
Also modified the API to consistently return NULL in case of an error.
(Alan, Harald)
- Fixed a bug in the COM extension that caused outproc servers to 'hang'
because of a missing Release() call. (Alan, Harald)
22 Apr 2002, Version 4.2.0
- ATTENTION!! register_globals defaults to 'off' now !!!
- Note: Apache2 support is EXPERIMENTAL.
- PostgreSQL functions are renamed, but all old function names are available.
Old function names will be available long enough. User can safely use old
function names. (Yasuo)
- Moved ext/mailparse to PECL. See http://thebrainroom.com/opensource/php/
for more information and to download the extension. (Wez/Jim)
- Fixed pg_last_notice() crash. (Yasuo)
- Modified the mysql extension to disable 'LOAD LOCAL' when safe mode is
enabled. (Jason)
- Fixed HTTP file upload support to handle big files better. (Jani)
- Major modifications to the Sockets Extension and its API (Jason):
. Fixed numerous bugs.
. Added automatic host lookup capability to all functions that take addr's.
example: socket_connect($sock, 'www.yahoo.com', 80);
. Corrected and standardized host lookup errors
. Modified socket_recv() behavior. [$r=socket_recv($sock, $buf, $len, $flags)]
. Added socket_set_block() which changes a socket into blocking IO mode
. Modified socket_last_error() to not clear the last error
. Added socket_clear_error() which clears the last error on a socket
. Removed all code pertaining to fd_sets (socket_fd_*)
. Modified/Improved socket_select() to accept array of resources instead of
fd_sets. example:
<?php
$wfds=$rfds=array($sock1, $sock2, $sock3, $sock7);
$r=socket_select($rfds, $wfds, NULL, 1);
print "Ready to read:\n"; var_dump($rfds);
?>
- Fixed segfault in ibase_close() if user does not free the resultset.
Bugs #15419, #15992. (daniela)
- Added optional 3rd parameter "int encoding_mode" to gzencode() and fixed
parameters to conform documentation. (Stefan)
- Changed read_exif_data() to be an alias of exif_read_data(). (Marcus)
- Added exif_tagname() function which returns the names of tags and
exif_thumbnail() function to extract embedded thumbnails. (Marcus)
- Fixed iconv support with FreeBSD. (kalowsky)
- Cleaned up the posix extension: (Markus)
. Removed unwanted warning messages
. Added posix_errno() and posix_strerror() for fetching error messages
. Changed the way posix_getgrnam() and posix_getgrgid() return their values
(breaks BC but makes more sense)
. Does not include functions in symbol table which aren't supported on host
system.
- Added TIFF support for getimagesize() and read_exif_data(). (Marcus)
- Changed the Velocis extension namespace to Birdstep to reflect new product
name. Added aliases for BC. (James)
- Added safe_mode checks for opendir(). (jflemer)
- Changed the 2nd parameter in pgsql_fetch_*() functions to support NULL if
all 3 parameters are supplied, but you do not want to provide a row number.
(Derick)
- Improved iconv() when using libc's iconv. (Yasuo)
- Added PHP_SAPI constant which contains the name of running SAPI. (Edin)
- Added ob_get_status() which returns an array of buffers with their status.
(Yasuo)
- Fixed a crash bug in ob_end_*() functions. ob_end_*() will not delete
buffers that may not be deleted. (Yasuo)
- Added 3rd parameter "bool erase" to ob_start(). If FALSE, the buffer may not
be deleted until script finishes. (Yasuo)
- Changed ob_*() functions to return TRUE for success, FALSE for failure.
(Yasuo)
- Added sybase_ct support to dbx module. (Marc)
- Fixed error message handling with PostgreSQL 7.2. (Rui)
- Added object aggregation capability, see aggregation_*() functions. (Andrei)
- Added debug_zval_dump() which works similarly to var_dump, but displays
extra internal information such as refcounts and true type names. (Jason)
- Added Andrei's tokenizer extension. (Stig)
- Fixed a bug in the COM extension which caused php to crash in
php_COM_get_ids_of_names(). (Paul, Harald)
- Removed ext/satellite. It is now part of PEAR. (eriksson)
- Changed php.ini directive 'safe_mode_include_dir' to accept a (semi)colon
separated path (like 'include_path') rather than a single directory.
(jflemer)
- Added is_a() function that can be used to test whether object is of a certain
class or is derived from it. (Andrei, Zend Engine)
- Added optional parameter to highlight_string() and highlight_file() which
makes these functions to return a highlighted string instead of dumping
it to standard output. (Derick)
- Added EXTR_IF_EXISTS and EXTR_PREFIX_IF_EXISTS flags to extract(). (Rasmus)
- Fixed a segfault in pg_pconnect(). If PostgreSQL server is restarted, broken
connection is detected and reconnected. (Yasuo)
- Fixed --enable-safe-mode configure option. (Yasuo)
- Added function domxml_dump_node($doc,$node). Dumps a node plus all children
into a string. (chregu)
- Added function domxml_node_get_content(). (chregu)
- Added function domxml_dump_file($filename,[$compression]). Dumps XML to
a file and uses compression, if specified. (chregu)
- Added exslt integration to domxml extension (http://exslt.org for details).
Configure with --with-dom-exslt[=DIR] (and --with-dom-xslt).
(chregu,jaroslaw)
- Fixed session_unset() to not touch any globals if register_globals is off.
(Thies)
- Added 3 new optional parameters to OCIFetchStatement(). They control
the number of rows to skip at the beginning of the cursor, the
maximun numer of rows that should be fetched and the format of the
returned array. (Thies)
- Updated the XSLT extension to support Sablotron 0.8. (Petr Cimprich)
- Fixed a bug in preg_match() and preg_match_all() when matching strings
contain null bytes. (Andrei)
- Added xpath_register_ns() function. This makes it possible to issue XPath
queries with namespaces like for example: "//namespace:sampletag".
(Chris Jarecki)
- Added multi-byte enabled regular expression functions. (Rui)
- Added optional second parameter to count() which can be used to specify
either normal or recursive counting. (patch by Vlad Bosinceanu <glipy@fx.ro>)
- Added mb_get_info() to get internal settings of mbstring. (Rui)
- Added async query functions to PostgreSQL module. (Yasuo)
- Added pg_copy_to()/pg_copy_from() for PostgreSQL module. (Youichi, Yasuo)
- Added IPv6 support for FTP extension. (Stig Venaas)
- Improved the speed of wordwrap() significantly. (Jim)
- Fixed pow()'s incorrect behaviour when dealing with powers of 0. (Jim)
- Added is_finite(), is_infinite() and is_nan(). (Jim)
- Fixed segfault in wordwrap() when wrapping to zero width and using
multi-character break or trying to force cut (bug #12768). (Jim)
- Fixed several bugs in dbase extension (dbase_pack() truncate file to right
size, fix 6852 #1 and 6852 #2). (Vlad)
- Fixed bug in krsort() where an extra character was being compared. (Andi)
- Fixed bug that made pspell include pspell.h from a wrong location. (Vlad)
- Added function overload in mbstring to add multibyte support for
string and mail functions. (Rui)
- Added flags parameter to preg_grep(). The only flag currently is
PREG_GREP_INVERT that will make the function return entries that
did not match. (Andrei)
- Fixed several crash bugs in the xslt extension. (Markus, Derick)
- Fixed problem with dbase not returning very large (larger than long)
integers properly. (Vlad)
- Added concepts to IRCG: bailout-on-trivial issue, write output to
files, fetch a resource upon connection end. (Sascha)
- Fixed POST-related bugs in thttpd, added QUERY_STRING, HTTP_HOST,
HTTP_ACCEPT_LANGUAGE to the script environment, improved patch
to send correct MIME types, and added support for /nocache/. (Sascha)
- Fixed several bugs and memleaks in the domxml extension. (Markus)
- Added var_export() which outputs a representation of a variable as reusable
PHP code. (Derick)
- Added -w option to the CGI-version to strip all comments and whitespace
from the script. (Thies)
- Added support for SO_RCVTIMEO and SO_SNDTIMEO to ext/sockets. (Jason)
- Added ob_get_level() which returns the nesting level of the output buffering
mechanism. (Yasuo, Derick)
- Added ob_flush() and ob_clean() functions which flush and clean an output
buffer without destroying the buffer. (Derick)
- Added new optional parameter to mysql_connect() which forces a new database
link to be created. (Markus, Derick)
- Added ldap_sort() function. (Stig Venaas)
- Added md5_file() function which calculates the MD5 sum of a file.
Patch by Alessandro Astarita <aleast@capri.it> (Derick)
- Added support for parsing recordsets contained in WDDX packets. (Andrei)
- Renamed key_exists() to array_key_exists(). (Derick)
- Fixed ImageColorsForIndex() and ImageColorAt() to work for TrueColor
images. (Rasmus)
- Added support for bind_textdomain_codeset(). (rudib@email.si)
- Added generic Win 32 API extension. (jmoore)
- Removed warning message about NONEXISTENT character set from mysql_connect()
when the server's default character set != latin1. (Mysql Team)
- Added Direct I/O extension for lowlevel access to the POSIX layer. (Sterling)
- Added SAPI module for the WebJames server on RISC OS. (Alex Waugh)
- Fixed ldap_add() and ldap_modify() functions to throw a warning with illegal
value arrays. Previously segfaulted or added wrong value. (Stig Venaas)
- Added udm_check_charset() function into mnoGoSearch extension. (gluke)
- Fixed mnoGoSearch extension to support mnogosearch-3.2.x. (gluke)
- Made fbsql_num_rows() to return the correct value on all select statements.
(Frank)
- Added array_chunk() function which splits an array into chunks of specified
size. (Andrei)
- Fixed $HTTP_RAW_POST_DATA to be populated on a missing content-type when
always_populate_raw_post_data is on. (Rasmus)
- Added session_cache_expire() function. (patch by anuradha@gnu.org) (Andrei)
- Added array_fill() function. (Rasmus)
- Made Authorization header to be hidden from phpinfo() output in safe_mode.
(Rasmus)
- Re-instated safe-mode realm mangling. (Rasmus)
- Fixed a bug in preg_replace() that would change the type of the replacement
array entries to string. (Andrei)
- Added user-space object overloading extension. (Andrei)
- Added ldap_start_tls() function. (Stig Venaas, patch by kuenne@rentec.com)
- Changed rand() and mt_rand() to be seed automatically if srand() or
mt_srand() has not been called. (Sterling)
- Changed the seed options to srand() and mt_srand() to be optional. If the
seed is not specified the most random seed possible is generated. (Sterling)
- Added array_change_key_case() function which returns an array with all
string keys lowercased or uppercased. (Edin)
- Added parameter to ircg_pconnect to suppress treating non-fatal errors
as fatal, and added conversion of Windows quotes to &quot;. (Sascha)
- Added pcntl_exec() function which behaves similar to the system execve.
(Jason)
- Fixed segfault and check for truecolor image in ImageColorAt(). (Rasmus)
- Fixed nl2br() to handle all styles of line-endings in one string.
(Boian, Derick)
- Added mcrypt_generic_deinit() to replace mcrypt_generic_end(). (Derick)
- Added apache_setenv() function for injecting variables into Apache's
subprocess_env table. (Rasmus)
- Added support for 'int', 'bool', 'float' and 'null' in settype(). (Jeroen)
- Added IPv6 support to gethostbyaddr().
(Patch by Matthias Wimmer <matthias@charente.de> and venaas)
- Fixed LONG_VARCHAR type crashing in ODBC extension. Patch by Walter Franzini.
(kalowsky)
- Changed in_array() and search_array() to allow the needle to be an array
in itself. (Andrei)
- Added ini_get_all() function which returns all registered ini entries
or entries for the specified extension. (Jani)
- Added support for chinese encodings in htmlentities() and htmlspecialchars().
(Patch by Alan Knowles <alan_k@hklc.com> and Wez)
- Improved support for autoconf-2.50+/libtool 1.4b+. (Jan Kneschke, Sascha)
27 Feb 2002, Version 4.1.2
- Fixed start up failure when mm save handler is used and there are multiple
SAPIs working at the same time. (Yasuo)
- Fixed the Roxen SAPI. (Yasuo)
- Fixed a buffer overflow in the RFC-1867 file upload code. (Stefan)
- Fixed a crash bug in the session module. (Yasuo)
- Fixed a crash bug in the pspell module. (Yasuo)
- Changed the default output encoding of mbstring 'pass' to fix
initialization problem. (Rui)
26 Dec 2001, Version 4.1.1
- Fixed incompatibility with Windows .NET / IIS 6 - may improve stability
under other versions of IIS. (Zeev)
- Fixed bug that caused crashes or error notices on shutdown on threaded
platforms. (Zeev)
- Fixed several crash bugs in the xslt extension. (Markus, Derick)
- Fixed problem with dbase not returning very large (larger than long)
integers properly. (Vlad)
- Fixed several bugs and memleaks in the domxml extension. (Markus)
- Fixed bug in gmmktime() which was one hour off during standard time -
bug #9878. Patch by bfoddy@mediaone.net. (jmoore)
- Fixed bug in gmdate() timezone handling on Windows - bug #13885. (jmoore)
- Fixed several crash bugs in the mcrypt extension. (Derick)
- Made the mcrypt extension compile with the libmcrypt 2.2 series again.
(Sterling)
- Fixed a bug where the is_file() family of functions would in-correctly give
an error when they were given filenames that didn't exist. (Sterling)
- Fixed a bug in the strtotime() function where it was incorrectly recognizing
GMT +0100 and GMT -0100. (Derick)
10 Dec 2001, Version 4.1.0
- Worked around a bug in the MySQL client library that could cause PHP to hang
when using unbuffered queries. (Zeev)
- Fixed a bug which caused set_time_limit() to affect all subsequent requests
to running Apache child process. (Zeev)
- Removed the sablotron extension in favor of the new XSLT extension.
(Sterling)
- Fixed a bug in WDDX deserialization that would sometimes corrupt the root
element if it was a scalar one. (Andrei)
- Make ImageColorAt() and ImageColorsForIndex() work with TrueColor images.
(Rasmus)
- Fixed a bug in preg_match_all() that would return results under improper
indices in certain cases. (Andrei)
- Fixed a crash in str_replace() that would happen if search parameter was an
array and one of the replacements resulted in subject string being empty.
(Andrei)
- Fixed MySQL extension to work with MySQL 4.0. (Jani)
- Fixed a crash bug within Cobalt systems. Patch by tomc@tripac.com. (Jani)
- Bundled Dan Libby's xmlrpc-epi extension.
- Introduced extension version numbers. (Stig)
- Added version_compare() function. (Stig)
- Fixed pg_last_notice() (could cause random crashes in PostgreSQL
applications, even if they didn't use pg_last_notice()). (Zeev)
- Fixed DOM-XML's error reporting, so E_WARNING errors are given instead of
?? ??? 200?, Version 4.0.7-dev
- Fixed pg_last_notice() (could cause random crashes in PostgreSQL applications,
even if they didn't use pg_last_notice()) (Zeev)
- Fixed DOM-XML's error reporting, so E_WARNING errors are given instead of
E_ERROR error's, this allows you to trap errors thrown by DOMXML functions.
(Sterling)
- Fixed a bug in the mcrypt extension, where list destructors were not
properly being allocated. (Sterling)
- Better Interbase blob, null and error handling. (Patch by Jeremy Bettis)
- Better Interbase blob, null and error handling (Patch by Jeremy Bettis)
- Fixed a crash bug in array_map() if the input arrays had string or
non-sequential keys. Also modified it so that if a single array is passed,
its keys are preserved in the resulting array. (Andrei)
- Fixed a crash in dbase_replace_record. (Patch by robin.marlow@dps-int.com)
- Fixed a crash in msql_result(). (Zeev)
- Fixed a crash in dbase_replace_record (Patch by robin.marlow@dps-int.com)
- Fixed a crash in msql_result() (Zeev)
- Added support for single dimensional SafeArrays and Enumerations.
Added com_isenum() function to check if a component implements an
Added an is_enum() function to check if a component implements an
enumeration. (Alan, Harald)
- Fixed a bug in dbase_get_record() and dbase_get_record_with_names().
boolean fields are now returned correctly.
Patch by Lawrence E. Widman <widman@cardiothink.com> (Jani)
- Added --version option to php-config. (Stig)
- Added --version option to php-config (Stig)
- Improved support for thttpd-2.21b by incorporating patches for all known
bugs. (Sascha)
bugs (Sascha)
- Added ircg_get_username, a roomkey argument to ircg_join, error fetching
infrastructure, a tokenizer to speed up message processing, and fixed
a lot of bugs in the IRCG extension. (Sascha)
- Improved speed of the serializer/deserializer. (Thies, Sascha)
- Floating point numbers are better detected when converting from strings.
a lot of bugs in the IRCG extension (Sascha)
- Improved speed of the serializer/deserializer (Thies, Sascha)
- Floating point numbers are better detected when converting from strings
(Zeev, Zend Engine)
- Replaced php.ini-optimized with php.ini-recommended. As the name implies,
it's warmly recommended to use this file as the basis for your PHP
@@ -384,7 +55,7 @@ PHP 4 NEWS
string to the gmp-number. (Troels)
- Added the Cyrus-IMAP extension, which allows a direct interface to Cyrus'
more advanced capabilities. (Sterling)
- Enhanced read_exif_data() to support multiple comment tags. (Rasmus)
- Enhance read_exif_data() to support multiple comment tags (Rasmus)
- Fixed a crash bug in array_map() when NULL callback was passed in. (Andrei)
- Change from E_ERROR to E_WARNING in the exif extension (Rasmus)
- New pow() implementation, which returns an integer when possible,
@@ -603,7 +274,7 @@ PHP 4 NEWS
All ini settings are now prefixed by 'com.'.
Now you need not provide a path to the file containing the typelib, you can
also provide the GUID of the TypeLib - entry or an IID for preloading
type - information. (Harald)
type - information. (phanto)
- Rewrite of domxml. It's now mostly DOM Level 2 conform. (Uwe)
- Added array_map() function that applies a callback to the elements
of given arrays and returns the result. It can also be used with a
+1 -11
View File
@@ -1,7 +1,6 @@
This is the first file you should be reading after you get your CVS account.
We'll assume you're basically familiar with CVS, but feel free to post
your questions on the mailing list. Please have a look at
http://cvsbook.red-bean.com/ for more detailed information on CVS.
your questions on the mailing list.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and CVS lets us do this. Thus, following
@@ -90,15 +89,6 @@ The lines above marked with @ will go into NEWS file automagically, and the
# lines will be omitted from the ChangeLog. Alternatively, you might want
to modify NEWS file directly and not use the @ lines.
If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
bug report when developers are browsing CVS via. LXR or Bonsai.
Example:
Fixed pgsql notice handler double free crash bug. Bug #14016
@ Fixed pgsql notice handler double free crash bug. Bug #14016
If you don't see your messages in ChangeLog and NEWS right away, don't worry!
These files are updated once a day, so your stuff will not show up until
somewhat later. Don't go adding stuff to NEWS by hand if you already put @
-39
View File
@@ -1,39 +0,0 @@
Between PHP 4.0.6 and 4.1.0, the Zend module struct changed in a way
that broke both source and binary compatibility. If you are
maintaining a third party extension, here's how to update it:
If this was your old module entry:
zend_module_entry foo_module_entry = {
"foo", /* extension name */
foo_functions, /* extension function list */
NULL, /* extension-wide startup function */
NULL, /* extension-wide shutdown function */
PHP_RINIT(foo), /* per-request startup function */
PHP_RSHUTDOWN(foo), /* per-request shutdown function */
PHP_MINFO(foo), /* information function */
STANDARD_MODULE_PROPERTIES
};
Here's how it should look if you want your code to build with PHP
4.1.0 and up:
zend_module_entry foo_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"foo", /* extension name */
foo_functions, /* extension function list */
NULL, /* extension-wide startup function */
NULL, /* extension-wide shutdown function */
PHP_RINIT(foo), /* per-request startup function */
PHP_RSHUTDOWN(foo), /* per-request shutdown function */
PHP_MINFO(foo), /* information function */
#if ZEND_MODULE_API_NO >= 20010901
FOO_VERSION, /* extension version number (string) */
#endif
STANDARD_MODULE_PROPERTIES
};
If you don't care about source compatibility with earlier PHP releases
than 4.1.0, you can drop the #if/#endif lines.
-118
View File
@@ -1,118 +0,0 @@
New parameter parsing functions
===============================
It should be easier to parse input parameters to an extension function.
Hence, borrowing from Python's example, there are now a set of functions
that given the string of type specifiers, can parse the input parameters
and store the results in the user specified variables. This avoids most
of the IS_* checks and convert_to_* conversions. The functions also
check for the appropriate number of parameters, and try to output
meaningful error messages.
Prototypes
----------
/* Implemented. */
int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...);
int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *type_spec, ...);
The zend_parse_parameters() function takes the number of parameters
passed to the extension function, the type specifier string, and the
list of pointers to variables to store the results in. The _ex() version
also takes 'flags' argument -- current only ZEND_PARSE_PARAMS_QUIET can
be used as 'flags' to specify that the function should operate quietly
and not output any error messages.
Both functions return SUCCESS or FAILURE depending on the result.
The auto-conversions are performed as necessary. Arrays, objects, and
resources cannot be autoconverted.
Type specifiers
---------------
l - long
d - double
s - string (with possible null bytes) and its length
b - boolean, stored in zend_bool
r - resource (stored in zval)
a - array
o - object (of any type)
O - object (of specific type, specified by class entry)
z - the actual zval
The following characters also have a meaning in the specifier string:
| - indicates that the remaining parameters are optional, they
should be initialized to default values by the extension since they
will not be touched by the parsing function if they are not
passed to it.
/ - use SEPARATE_ZVAL_IF_NOT_REF() on the parameter it follows
! - the parameter it follows can be of specified type or NULL (only applies
to 'a', 'o', 'O', 'r', and 'z'). If NULL is passed, the results
pointer is set to NULL as well.
Examples
--------
/* Gets a long, a string and its length, and a zval */
long l;
char *s;
int s_len;
zval *param;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsz",
&l, &s, &s_len, &param) == FAILURE) {
return;
}
/* Gets an object of class specified by my_ce, and an optional double. */
zval *obj;
double d = 0.5;
zend_class_entry my_ce;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|d",
&obj, my_ce, &d) == FAILURE) {
return;
}
/* Gets an object or null, and an array.
If null is passed for object, obj will be set to NULL. */
zval *obj;
zval *arr;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o!a",
&obj, &arr) == FAILURE) {
return;
}
/* Gets a separated array which can also be null. */
zval *arr;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/!",
&arr) == FAILURE) {
return;
}
/* Get only the first three parameters (useful for varargs functions). */
zval *z;
zend_bool b;
zval *r;
if (zend_parse_parameters(3 TSRMLS_CC, "zbr!",
&z, &b, &r) == FAILURE) {
return;
}
/* Get either a set of 3 longs or a string. */
long l1, l2, l3;
char *s;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"lll", &l1, &l2, &l3) == SUCCESS) {
/* manipulate longs */
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC,
"s", &s) == SUCCESS) {
/* manipulate string */
} else {
/* output error */
return;
}
+64 -92
View File
@@ -3,129 +3,99 @@ parenthesis means that person has taken on this project.
Zend
----
For PHP 4.3.0:
* Allow foreach ($array as $k => &$val) syntax. right now we cannot
* allow foreach ($array as $k => &$val) syntax. right now we cannot
traverse an array without copying each element.
* Allow foreach ($array as $k => list($a, $b)) syntax for multi
* allow foreach ($array as $k => list($a, $b)) syntax for multi
dimensional arrays.
* Look at replacing c-lib call tolower().
* Make hash API functions work with HASH_OF() to save time.
* Allow to set a default value for call-by-reference-parameters.
eg: function hello (&$pallo = NULL) {}
* Disallow function(method) redefinition in class.
* Add configure test to determine if dlsym() requires underscore and set
DLSYM_NEEDS_UNDERSCORE accordingly. Perl and zsh have it in configure,
for example. (DONE?)
For PHP 5.0.0:
* Native large number support (probably with GNU GMP)
* look at replacing c-lib call tolower().
* make hash API functions work with HASH_OF() to save time.
* native large number support (probably with GNU GMP)
* Const'ify APIs. Right now, many functions leave parameters untouched,
but don't declare those as const. This makes interaction with other
interfaces difficult which pass const parameters to us.
* Add try..catch/throw exception handling.
* Fix Zend shallow copy issues with objects and arrays.
interfaces difficult which pass const parameters to us.
* add try..catch/throw exception handling
global
------
For PHP 4.3.0:
* Add aliases to functions to conform to new naming conventions, e.g.
str_to_upper().
* Make all extensions thread-safe.
* Make everything on the language-level independent of your locale
settings.
* Change PHP error messages, so that they point to pages or sections
in the PHP Manual.
* Make sure that all ZTS globals get destructed. Most ts_allocate_id()
* when used in standalone (skell-script like) mode don't urldecode
arguments passed to php. right now it's not possible to say
/usr/local/bin/php somescript.php dog+cat.txt
as "dog+cat.txt" will arrive in php as "dog cat.txt".
* make everything on the language-level independent of your locale setings.
* always build the standalone executable as well as the chosen SAPI
target.
* make sure all source files have the "right" copyright.
* the following modules still use PHP3_TLS_*() macros (and thereby don't
work in ZTS mode): ext/db/db.c, ext/gd/gd.c
* make sure that all ZTS globals get destructed. Most ts_allocate_id()
calls should have a dtor entry.
* Activate all extensions by default that don't rely on external
dependencies. (eg ftp) (DONE?)
* on some platforms unimplemented function will just do nothing
(e.g. symlink) they should print a warning or not even be defined!
(DONE ?)
* Finish PHP streams abstraction, nuke all that issock stuff, implement SSL
socket support. (wez)
- ext/ftp/ -> all FILEs to streams
- ext/bz2/ -> convert to stream impl.
* Use arg_separator.input to implode args in the CGI sapi extension
and arg_separator.input to explode in php_build_argv(). (DONE?)
* Change the odbc_fetch_into() function to require ALWAYS the first two
parameters ($conn_id and $array), and make the third (row) be optional.
* Remove --with-openlink configure option (--with-iodbc replaces it).
* Implement flush feature suitable for nested output buffers.
For PHP 5.0.0
* bundle and use curl lib for fopen wrapper.
* activate all extensions by default that don't rely on external
dependices. (eg ftp)
* --enable-all in configure. (--enable-shared=max ...)
* make configure print out a summary when it's done (like XEmacs)
* replace standard functions which work on static data with
reentrancy-safe functions (DONE?).
* on some platforms unimplemented function will just do nothing (e.g. symlink)
they should print a warning or not even be defined!
* implement javadoc based function docs template system.
* use thread-safe resolver functions (either require BIND 8 or adns).
* provide optional IPv6 support.
* make SAPI conform to CGI/1.1. Currently, all SAPI modules
define REMOTE_ADDR etc. themselves and reach only various level
of compliance.
* see what functions might need to be changed to use HashPosition, so
that the internal array pointer is not affected.
* Move most extensions and PEAR packages out of the PHP CVS tree,
include them again during release packaging.
Other
* use thread-safe resolver functions (either require BIND 8 or adns).
* implement javadoc based function docs template system.
* provide optional IPv6 support.
* find a better way to implement script timeouts. SIGVTALRM is used
by some POSIX threads implementations (i.e. OpenBSD) and is not
available in ZTS mode.
* add aliases to functions to conform to new naming conventions, e.g.
str_to_upper().
* see what functions might need to be changed to use HashPosition, so
that the internal array pointer is not affected.
documentation
-------------
* Add remarks in the documentation which functions are not implemented
on win32.
* Add remarks in the documentation which functions are not binary-safe.
* Update curl documentation (DONE?)
* Add developer documentation.
* Add detailed documentation for Java extension.
* add remarks in the documentation which functions are not implemented on win32.
* add remarks in the documentation which functions are not binary-safe.
* improve documentation for the sablotron extension
* update curl documentation
* write documentation for the bzip2 extension
* write documentation for the zziplib extension
ext/curl
--------
* Use the cURL write handler to save data for use when returning data or
outputting data.
* Use the cURL write handler to save data for use when returning data or outputting
data.
* Have a warning scheme for when people use unsupported features.
ext/dav
--------
* rewrite.
ext/oci8
--------
* All OCIFetch*() functions should return 0 for no more data and false on
error.
* Have a flag that trims trailing spaces from CHAR fields on retrieval.
* Make allow_call_time_pass_reference=Off working.
* For additional todo information, see oci8.c, in ext/oci8
* all OCIFetch*() functions should return 0 for no more data and false on error.
* have a flag that trims trailing spaces from CHAR fields on retrieval.
* make allow_call_time_pass_reference=Off working.
* for additional todo information, see oci8.c, in ext/oci8
ext/pcre
--------
* Allow user to set PCRE_NOTEMPTY, PCRE_ANCHORED at execution time, maybe
* add option to preg_grep() to return entries that _don't_ match
ext/pgsql
---------
For PHP 4.3.0:
* Add pg_metadata() with metadata cache feature.
* Add pg_convert() to check and convert array value for query.
* Add pg_insert/pg_update/pg_delete/pg_select for simple query.
ext/sablot
----------
* Re-write the error handling and reporting interface
* Cleanup the underlying code a bit
* Add proper support for the message handlers
ext/session
-----------
For PHP 4.3.0:
* session_abort() to abort session. ie: Do not save session data.
* Allow unset($_SESSION) or unset($HTTP_SESSION_VARS) to unset
session vars regardless of register_globals setting.
Other:
* Maybe implement finer-grained session variables that could be
* maybe implement finer-grained session variables that could be
locked individually.
* Write a network-transparent storage back-end with fallover
* write a network-transparent storage back-end with fallover
facilities
* Provide a callback facility which is executed upon encountering
an unknown class name during deserialization
* provide a callback facility which is executed upon encountering
an unknown classname during deserialization
ext/sockets
-----------
@@ -134,12 +104,13 @@ ext/sockets
ext/standard
------------
* Add a version number to data serialized via serialize().
* Possibly modify parsing of GPC data to automatically create arrays if
* add a version number to data serialized via serialize().
* array_add(). (Andrei)
* possibly modify parsing of GPC data to automatically create arrays if
variable name is seen more than once.
* Implement regex-cache for url-functions.
* implement regex-cache for url-functions.
* stri_replace(). (Andrei)
* Move socket related functions to fsock.c.
* move socket related functions to fsock.c.
* NOT binary safe:
strtok()
basename()
@@ -147,18 +118,19 @@ ext/standard
strrpos()
strrchr()
strip_tags()
* Rewrite win32 SMTP code to be usable for *ix to, maybe as a (default)
* rewrite win32 SMTP code to be useable for *ix to, maybe as a (default)
module of its own (Hartmut)
ext/zziplib
------------
* More fully support the zziplib API
* more fully support the zziplib api
ext/wddx
--------
* See if we can support the remaining data types:
* See if we can support the remaining datatypes:
dateTime
binary
recordset
http://www.wddx.org/WDDX_SDK_10a/7__References/WDDX_DTD.htm
(Andrei)
+35
View File
@@ -0,0 +1,35 @@
* Change the odbc_fetch_into() function to require ALWAYS the first two
parameters ($conn_id and $array), and make the third (row) be optional.
* Remove --with-openlink configure option (--with-iodbc replaces it).
* Always build CGI (--disable-cgi option to disable).
* Move most extensions and PEAR packages out of the PHP CVS tree,
include them again during release packaging.
* Renaming functions, so that they all are conform to one standard form.
* Allow foreach($array as $key => &$value).
* Allow foreach($array as list($var1, $var2)).
* Clean up "$instance = &new object" syntax (default to the =& behaviour?).
* Allow to set a default value for call-by-reference-parameters. eg:
function hallo (&$pallo = NULL) {}
* Change PHP error messages, so that they point to pages or sections in the
PHP Manual.
* Fix Zend shallow copy issues with objects and arrays.
* Make all extensions thread-safe.
* Finish PHP streams abstraction, nuke all that issock stuff, implement SSL
socket support. (wez)
- ext/ftp/ -> all FILEs to streams
- ext/bz2/ -> convert to stream impl.
* Using arg_separator.input to implode args in the CGI sapi extension
and arg_separator.input to explode in php_build_argv().
+24 -27
View File
@@ -31,27 +31,24 @@ dnl
dnl Set some magic defines to achieve POSIX threads conformance
dnl
AC_DEFUN(PTHREADS_FLAGS,[
if test -z "$host_alias" && test -n "$host"; then
host_alias=$host
fi
if test -z "$host_alias"; then
AC_MSG_ERROR(host_alias is not set. Make sure to run config.guess)
fi
case $host_alias in
case "$host_alias" in
*solaris*)
PTHREAD_FLAGS="-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT";;
*freebsd*)
PTHREAD_FLAGS="-D_REENTRANT -D_THREAD_SAFE";;
*linux*)
PTHREAD_FLAGS=-D_REENTRANT;;
PTHREAD_FLAGS="-D_REENTRANT";;
*aix*)
PTHREAD_FLAGS=-D_THREAD_SAFE;;
PTHREAD_FLAGS="-D_THREAD_SAFE";;
*irix*)
PTHREAD_FLAGS=-D_POSIX_THREAD_SAFE_FUNCTIONS;;
PTHREAD_FLAGS="-D_POSIX_THREAD_SAFE_FUNCTIONS";;
*hpux*)
PTHREAD_FLAGS=-D_REENTRANT;;
PTHREAD_FLAGS="-D_REENTRANT";;
*sco*)
PTHREAD_FLAGS=-D_REENTRANT;;
PTHREAD_FLAGS="-D_REENTRANT";;
dnl Solves sigwait() problem, creates problems with u_long etc.
dnl PTHREAD_FLAGS="-D_REENTRANT -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506 -D_XOPEN_SOURCE_EXTENDED=1";;
esac
@@ -80,11 +77,11 @@ int main() {
int data = 1;
pthread_mutexattr_init(&mattr);
return pthread_create(&thd, NULL, thread_routine, &data);
} ], [
pthreads_working=yes
} ], [
pthreads_working="yes"
], [
pthreads_working=no
], pthreads_working=no ) ] )dnl
pthreads_working="no"
], pthreads_working="no" ) ] )dnl
dnl
dnl PTHREADS_CHECK()
dnl
@@ -102,23 +99,23 @@ dnl -threads gcc (HP-UX)
dnl
AC_DEFUN(PTHREADS_CHECK,[
save_CFLAGS=$CFLAGS
save_LIBS=$LIBS
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
PTHREADS_ASSIGN_VARS
PTHREADS_CHECK_COMPILE
LIBS=$save_LIBS
CFLAGS=$save_CFLAGS
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
ac_cv_pthreads_cflags=
ac_cv_pthreads_cflags=""
if test "$pthreads_working" != "yes"; then
for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
ac_save=$CFLAGS
ac_save="$CFLAGS"
CFLAGS="$CFLAGS $flag"
PTHREADS_CHECK_COMPILE
CFLAGS=$ac_save
CFLAGS="$ac_save"
if test "$pthreads_working" = "yes"; then
ac_cv_pthreads_cflags=$flag
ac_cv_pthreads_cflags="$flag"
break
fi
done
@@ -126,15 +123,15 @@ fi
])
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
ac_cv_pthreads_lib=
ac_cv_pthreads_lib=""
if test "$pthreads_working" != "yes"; then
for lib in pthread pthreads c_r; do
ac_save=$LIBS
ac_save="$LIBS"
LIBS="$LIBS -l$lib"
PTHREADS_CHECK_COMPILE
LIBS=$ac_save
LIBS="$ac_save"
if test "$pthreads_working" = "yes"; then
ac_cv_pthreads_lib=$lib
ac_cv_pthreads_lib="$lib"
break
fi
done
@@ -142,9 +139,9 @@ fi
])
if test "$pthreads_working" = "yes"; then
threads_result="POSIX-Threads found"
threads_result="POSIX Threads found"
else
threads_result="POSIX-Threads not found"
threads_result="POSIX Threads not found"
fi
])dnl
dnl
+1 -1
View File
@@ -58,7 +58,7 @@ AC_DEFUN(TSRM_CHECK_ST,[
CPPFLAGS="$CPPFLAGS -I$1"
LDFLAGS="$LDFLAGS -L$1"
fi
AC_CHECK_HEADERS(st.h,[],[
AC_CHECK_HEADERS(st.h,[ ],[
AC_MSG_ERROR([Sorry[,] I was unable to locate the State Threads header file. Please specify the prefix using --with-tsrm-st=/prefix])
])
LIBS="$LIBS -lst"
+2 -13
View File
@@ -16,19 +16,8 @@
#include <malloc.h>
#endif
/* AIX requires this to be the first thing in the file. */
#ifndef __GNUC__
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
# else
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
# endif
# endif
# endif
#if HAVE_ALLOCA_H
#include <alloca.h>
#endif
#if HAVE_UNISTD_H
+5 -7
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -68,8 +68,7 @@ cwd_state main_cwd_state; /* True global */
#endif
#ifdef TSRM_WIN32
#include <tchar.h>
#define tsrm_strtok_r(a,b,c) _tcstok((a),(b))
#define tsrm_strtok_r(a,b,c) strtok((a),(b))
#define TOKENIZER_STRING "/\\"
static int php_check_dots(const char *element, int n)
@@ -364,8 +363,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
#ifdef TSRM_WIN32
/* Windows 9x will consider C:\\Foo as a network path. Avoid it. */
if ((state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') ||
IsDBCSLeadByte(state->cwd[state->cwd_length-2])) {
if (state->cwd[state->cwd_length-1]!='\\' && state->cwd[state->cwd_length-1]!='/') {
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#else
@@ -555,7 +553,7 @@ CWD_API int virtual_open(const char *path TSRMLS_DC, int flags, ...)
va_list arg;
va_start(arg, flags);
mode = (mode_t) va_arg(arg, int);
mode = va_arg(arg, mode_t);
va_end(arg);
f = open(new_state.cwd, flags, mode);
+3 -12
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -50,8 +50,6 @@ typedef unsigned short mode_t;
#define DEFAULT_SLASH '\\'
#define DEFAULT_DIR_SEPARATOR ';'
#define IS_SLASH(c) ((c) == '/' || (c) == '\\')
#define IS_SLASH_P(c) (*(c) == '/' || \
(*(c) == '\\' && !IsDBCSLeadByte(*(c-1))))
#define COPY_WHEN_ABSOLUTE 2
#define IS_ABSOLUTE_PATH(path, len) \
(len >= 2 && isalpha(path[0]) && path[1] == ':')
@@ -64,15 +62,8 @@ typedef unsigned short mode_t;
#endif
#define DEFAULT_SLASH '/'
#ifdef __riscos__
#define DEFAULT_DIR_SEPARATOR ';'
#else
#define DEFAULT_DIR_SEPARATOR ':'
#endif
#define DEFAULT_DIR_SEPARATOR ':'
#define IS_SLASH(c) ((c) == '/')
#define IS_SLASH_P(c) (*(c) == '/')
#endif
+2 -2
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+2 -2
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+48 -201
View File
@@ -4,22 +4,6 @@ dnl This file contains local autoconf functions.
sinclude(dynlib.m4)
dnl
dnl Disable building CLI
dnl
AC_DEFUN(PHP_DISABLE_CLI,[
disable_cli=1
])
dnl
dnl Separator into the configure --help display.
dnl
AC_DEFUN(PHP_HELP_SEPARATOR,[
AC_ARG_ENABLE([],[
$1
],[])
])
dnl
dnl PHP_TARGET_RDYNAMIC
dnl
@@ -50,7 +34,7 @@ AC_DEFUN(PHP_REMOVE_USR_LIB,[
done
$1=[$]ac_new_flags
])
AC_DEFUN(PHP_SETUP_OPENSSL,[
if test "$PHP_OPENSSL" = "no"; then
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
@@ -64,21 +48,21 @@ AC_DEFUN(PHP_SETUP_OPENSSL,[
done
if test -z "$OPENSSL_DIR"; then
AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
AC_MSG_ERROR(Cannot find OpenSSL's <evp.h>)
fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$OPENSSL_INC
AC_MSG_CHECKING([for OpenSSL version])
AC_MSG_CHECKING(for OpenSSL version)
AC_EGREP_CPP(yes,[
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090500fL
yes
#endif
],[
AC_MSG_RESULT([>= 0.9.5])
AC_MSG_RESULT(>= 0.9.5)
],[
AC_MSG_ERROR([OpenSSL version 0.9.5 or greater required.])
AC_MSG_ERROR(OpenSSL version 0.9.5 or greater required.)
])
CPPFLAGS=$old_CPPFLAGS
@@ -87,13 +71,13 @@ AC_DEFUN(PHP_SETUP_OPENSSL,[
AC_CHECK_LIB(crypto, CRYPTO_free, [
PHP_ADD_LIBRARY(crypto)
],[
AC_MSG_ERROR([libcrypto not found!])
AC_MSG_ERROR(libcrypto not found!)
])
AC_CHECK_LIB(ssl, SSL_CTX_set_ssl_version, [
PHP_ADD_LIBRARY(ssl)
],[
AC_MSG_ERROR([libssl not found!])
AC_MSG_ERROR(libssl not found!)
])
PHP_ADD_INCLUDE($OPENSSL_INC)
])
@@ -109,7 +93,7 @@ AC_DEFUN(PHP_EVAL_LIBLINE,[
case $ac_i in
-l*)
ac_ii=`echo $ac_i|cut -c 3-`
PHP_ADD_LIBRARY($ac_ii,1,$2)
PHP_ADD_LIBRARY($ac_ii,,$2)
;;
-L*)
ac_ii=`echo $ac_i|cut -c 3-`
@@ -194,9 +178,6 @@ AC_DEFUN(PHP_SHLIB_SUFFIX_NAME,[
*hpux*)
SHLIB_SUFFIX_NAME=sl
;;
*darwin*)
SHLIB_SUFFIX_NAME=dylib
;;
esac
])
@@ -255,8 +236,6 @@ AC_DEFUN(PHP_MISSING_PREAD_DECL,[
],[
ac_cv_pread=no
])
],[
ac_cv_pread=no
])
])
])
@@ -291,8 +270,6 @@ AC_DEFUN(PHP_MISSING_PWRITE_DECL,[
],[
ac_cv_pwrite=no
])
],[
ac_cv_pwrite=no
])
])
])
@@ -303,7 +280,7 @@ AC_DEFUN(PHP_MISSING_PWRITE_DECL,[
])
AC_DEFUN(PHP_MISSING_TIME_R_DECL,[
AC_MSG_CHECKING([for missing declarations of reentrant functions])
AC_MSG_CHECKING(for missing declarations of reentrant functions)
AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[
:
],[
@@ -329,7 +306,7 @@ AC_DEFUN(PHP_MISSING_TIME_R_DECL,[
],[
AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
])
AC_MSG_RESULT([done])
AC_MSG_RESULT(done)
])
dnl
@@ -370,9 +347,7 @@ if test "$php_always_shared" = "yes"; then
test "[$]$1" = "no" && $1=yes
fi
if test -n "$2"; then
AC_MSG_RESULT([$ext_output])
fi
AC_MSG_RESULT($ext_output)
])
dnl
@@ -386,11 +361,9 @@ PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_))
])
AC_DEFUN(PHP_REAL_ARG_WITH,[
if test -n "$2"; then
AC_MSG_CHECKING([$2])
fi
AC_MSG_CHECKING($2)
AC_ARG_WITH($1,[$3],$5=[$]withval,$5=ifelse($4,,no,$4))
PHP_ARG_ANALYZE($5,[$2])
PHP_ARG_ANALYZE($5)
])
dnl
@@ -404,11 +377,9 @@ PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
])
AC_DEFUN(PHP_REAL_ARG_ENABLE,[
if test -n "$2"; then
AC_MSG_CHECKING([$2])
fi
AC_MSG_CHECKING($2)
AC_ARG_ENABLE($1,[$3],$5=[$]enableval,$5=ifelse($4,,no,$4))
PHP_ARG_ANALYZE($5,[$2])
PHP_ARG_ANALYZE($5)
])
AC_DEFUN(PHP_MODULE_PTR,[
@@ -517,7 +488,7 @@ AC_DEFUN(PHP_GEN_CONFIG_VARS,[
echo creating config_vars.mk
> config_vars.mk
for i in $PHP_VAR_SUBST; do
eval echo "$i = \$$i" | sed 's%#%\\#%g' >> config_vars.mk
eval echo "$i = \$$i" >> config_vars.mk
done
])
@@ -540,7 +511,7 @@ dnl PHP_CONFIGURE_PART(MESSAGE)
dnl Idea borrowed from mm
AC_DEFUN(PHP_CONFIGURE_PART,[
AC_MSG_RESULT()
AC_MSG_RESULT([${T_MD}$1${T_ME}])
AC_MSG_RESULT(${T_MD}$1${T_ME})
])
AC_DEFUN(PHP_PROG_SENDMAIL,[
@@ -552,13 +523,13 @@ fi
AC_DEFUN(PHP_RUNPATH_SWITCH,[
dnl check for -R, etc. switch
AC_MSG_CHECKING([if compiler supports -R])
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])
AC_MSG_RESULT($php_cv_cc_dashr)
if test $php_cv_cc_dashr = "yes"; then
ld_runpath_switch=-R
else
@@ -568,7 +539,7 @@ else
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])
AC_MSG_RESULT($php_cv_cc_rpath)
if test $php_cv_cc_rpath = "yes"; then
ld_runpath_switch=-Wl,-rpath,
else
@@ -629,7 +600,7 @@ dnl
AC_DEFUN(PHP_BUILD_THREAD_SAFE,[
enable_experimental_zts=yes
if test "$pthreads_working" != "yes"; then
AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.])
AC_MSG_ERROR(ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.)
fi
])
@@ -855,14 +826,14 @@ AC_DEFUN(PHP_CHECK_CC_OPTION,[
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])
AC_MSG_RESULT(no)
else
if eval ./conftest 2>/dev/null ; then
eval php_cc_$var=yes
AC_MSG_RESULT([yes])
AC_MSG_RESULT(yes)
else
eval php_cc_$var=no
AC_MSG_RESULT([no])
AC_MSG_RESULT(no)
fi
fi
])
@@ -879,8 +850,8 @@ elif test "$REGEX_TYPE" = "system"; then
AC_DEFINE(REGEX,0,[ ])
fi
AC_MSG_CHECKING([which regex library to use])
AC_MSG_RESULT([$REGEX_TYPE])
AC_MSG_CHECKING(which regex library to use)
AC_MSG_RESULT($REGEX_TYPE)
PHP_SUBST(REGEX_DIR)
PHP_SUBST(REGEX_LIB)
@@ -894,10 +865,10 @@ AC_DEFUN(PHP_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_MSG_RESULT(ok)
],[
AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ])
AC_MSG_RESULT([missing])
AC_MSG_RESULT(missing)
])
])
@@ -922,16 +893,13 @@ AC_DEFUN(PHP_AC_BROKEN_SPRINTF,[
])
dnl
dnl PHP_EXTENSION(extname [, shared [,sapi_class]])
dnl PHP_EXTENSION(extname [, shared])
dnl
dnl Includes an extension in the build.
dnl
dnl "extname" is the name of the ext/ subdir where the extension resides
dnl "shared" can be set to "shared" or "yes" to build the extension as
dnl a dynamically loadable library. Optional parameter "sapi_class" can
dnl be set to "cli" to mark extension build only with CLI or CGI sapi's.
dnl If "nocli" is passed the extension will be built only with a non-cli
dnl sapi.
dnl a dynamically loadable library.
dnl
AC_DEFUN(PHP_EXTENSION,[
EXT_SUBDIRS="$EXT_SUBDIRS $1"
@@ -946,37 +914,26 @@ dnl ---------------------------------------------- External Module
ext_srcdir=$abs_srcdir
fi
if test "$2" != "shared" && test "$2" != "yes" && test "$3" != "cli"; then
if test "$2" != "shared" && test "$2" != "yes"; then
dnl ---------------------------------------------- Static module
LIB_BUILD($ext_builddir)
EXT_LTLIBS="$EXT_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_LTLIBS="$EXT_LTLIBS $ext_builddir/lib$1.la"
EXT_STATIC="$EXT_STATIC $1"
if test "$3" != "nocli"; then
EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
fi
else
if test "$2" = "shared" || test "$2" = "yes"; then
else
dnl ---------------------------------------------- Shared module
LIB_BUILD($ext_builddir,yes)
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
fi
fi
if test "$2" != "shared" && test "$2" != "yes" && test "$3" = "cli"; then
dnl ---------------------------------------------- CLI only static module
LIB_BUILD($ext_builddir)
if test "$PHP_SAPI" = "cgi"; then
EXT_LTLIBS="$EXT_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_STATIC="$EXT_STATIC $1"
fi
EXT_CLI_LTLIBS="$EXT_CLI_LTLIBS $abs_builddir/$ext_builddir/lib$1.la"
EXT_CLI_STATIC="$EXT_CLI_STATIC $1"
LIB_BUILD($ext_builddir,yes)
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z-,A-Z_), 1, Whether to build $1 as dynamic module)
fi
PHP_FAST_OUTPUT($ext_builddir/Makefile)
])
PHP_SUBST(EXT_SUBDIRS)
PHP_SUBST(EXT_STATIC)
PHP_SUBST(EXT_SHARED)
PHP_SUBST(EXT_LIBS)
PHP_SUBST(EXT_LTLIBS)
dnl
dnl Solaris requires main code to be position independent in order
dnl to let shared objects find symbols. Weird. Ugly.
@@ -985,7 +942,7 @@ 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])
AC_MSG_CHECKING(whether -fPIC is required)
if test -n "$EXT_SHARED"; then
os=`uname -sr 2>/dev/null`
case $os in
@@ -994,12 +951,12 @@ AC_DEFUN(PHP_SOLARIS_PIC_WEIRDNESS,[
gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";;
*) CFLAGS="$CFLAGS -fpic";;
esac
AC_MSG_RESULT([yes]);;
AC_MSG_RESULT(yes);;
*)
AC_MSG_RESULT([no]);;
AC_MSG_RESULT(no);;
esac
else
AC_MSG_RESULT([no])
AC_MSG_RESULT(no)
fi
])
@@ -1039,7 +996,7 @@ AC_DEFUN(PHP_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_MSG_CHECKING(whether large file support needs explicit enabling)
ac_getconfs=''
ac_result=yes
ac_set=''
@@ -1061,7 +1018,7 @@ AC_DEFUN(PHP_SYS_LFS,
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])
AC_MSG_RESULT($ac_result)
case $ac_result in
yes)
for ac_shellvar in $ac_shellvars; do
@@ -1144,7 +1101,7 @@ AC_DEFUN(PHP_FOPENCOOKIE,[
],
[ cookie_io_functions_t cookie; ],
[ have_cookie_io_functions_t=yes ],
[] )
[ ] )
if test "$have_cookie_io_functions_t" = "yes" ; then
cookie_io_functions_t=cookie_io_functions_t
@@ -1171,113 +1128,3 @@ AC_DEFUN(PHP_FOPENCOOKIE,[
fi
])
dnl
dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]])
dnl
dnl Wrapper for AC_CHECK_LIB
dnl
AC_DEFUN(PHP_CHECK_LIBRARY, [
save_old_LDFLAGS=$LDFLAGS
LDFLAGS="$5 $LDFLAGS"
AC_CHECK_LIB([$1],[$2],[
LDFLAGS=$save_old_LDFLAGS
$3
],[
LDFLAGS=$save_old_LDFLAGS
$4
])dnl
])
dnl
dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])
dnl
dnl Common setup macro for iconv
dnl
AC_DEFUN(PHP_SETUP_ICONV, [
found_iconv=no
unset ICONV_DIR
dnl
dnl Check libc first if no path is provided in --with-iconv
dnl
if test "$PHP_ICONV" = "yes"; then
AC_CHECK_FUNC(iconv, [
found_iconv=yes
],[
AC_CHECK_FUNC(libiconv,[
AC_DEFINE(HAVE_LIBICONV, 1, [ ])
found_iconv=yes
])
])
fi
dnl
dnl Check external libs for iconv funcs
dnl
if test "$found_iconv" = "no"; then
for i in $PHP_ICONV /usr/local /usr; do
if test -r $i/include/giconv.h; then
AC_DEFINE(HAVE_GICONV_H, 1, [ ])
ICONV_DIR=$i
iconv_lib_name=giconv
break
elif test -r $i/include/iconv.h; then
ICONV_DIR=$i
iconv_lib_name=iconv
break
fi
done
if test -z "$ICONV_DIR"; then
AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=<DIR>])
fi
if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a ||
test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
found_iconv=yes
AC_DEFINE(HAVE_LIBICONV, 1, [ ])
], [
PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [
found_iconv=yes
], [], [
-L$ICONV_DIR/lib
])
], [
-L$ICONV_DIR/lib
])
fi
fi
if test "$found_iconv" = "yes"; then
AC_DEFINE(HAVE_ICONV, 1, [ ])
if test -n "$ICONV_DIR"; then
PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, $1)
PHP_ADD_INCLUDE($ICONV_DIR/include)
fi
$2
ifelse([$3],[],,[else $3])
fi
])
dnl
dnl PHP_AP_EXTRACT_VERSION(/path/httpd)
dnl This macro is used to get a comparable
dnl version for apache1/2.
dnl
AC_DEFUN(PHP_AP_EXTRACT_VERSION,[
ac_output=`$1 -v 2>&1`
ac_IFS=$IFS
IFS="- /.
"
set $ac_output
IFS=$ac_IFS
APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6`
])
-4
View File
@@ -150,10 +150,6 @@ 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.
If you do not pass the structure as an argument you can always fetch it by
using the appropriate ???LS_FETCH() macros within a functions variable
declarations.
In general, every module that makes use of globals should use this approach
if it plans to be thread safe.
+3 -3
View File
@@ -1,8 +1,8 @@
#! /bin/sh
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+4 -4
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
@@ -33,7 +33,7 @@ generated_lists:
@echo makefile_am_files = Zend/Makefile.am \
TSRM/Makefile.am > $@
@echo config_h_files = Zend/acconfig.h TSRM/acconfig.h >> $@
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 TSRM/threads.m4 \
@echo config_m4_files = Zend/Zend.m4 TSRM/tsrm.m4 \
Zend/acinclude.m4 ext/*/config*.m4 sapi/*/config.m4 >> $@
$(STAMP): build/buildcheck.sh
+4 -4
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
@@ -60,7 +60,7 @@ $(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_f
aclocal.m4: configure.in acinclude.m4 dynlib.m4
aclocal 2>&1 | $(SUPPRESS_WARNINGS)
SUPPRESS_WARNINGS = (egrep -v '(AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|.*AM_PROG_LEX.*|defined in acinclude.m4 but never used|AC_PROG_LEX invoked multiple times|AC_PROG_CPP was called before)'||true)
SUPPRESS_WARNINGS = (egrep -v '(warning: AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|.*AM_PROG_LEX.*|defined in acinclude.m4 but never used)'||true)
$(config_h_in): configure acconfig.h
# explicitly remove target since autoheader does not seem to work
+4 -5
View File
@@ -1,8 +1,8 @@
#! /bin/sh
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
# | Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: buildcheck.sh,v 1.16 2002-03-04 08:28:57 sas Exp $
# $Id: buildcheck.sh,v 1.12 2001-06-20 18:21:03 david Exp $
#
echo "buildconf: checking installation..."
@@ -39,7 +39,6 @@ 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]* *$//'`
am_version_clean=`echo $am_version|sed -e 's/-p[0-9]*$//'`
@@ -62,7 +61,7 @@ fi
# libtool 1.4 or newer
libtool=`which libtool`
if test ! -f "$libtool"; then libtool=`which glibtool`; fi
lt_pversion=`$libtool --version 2>/dev/null|sed -n -e 's/^[^0-9]*//' -e 1's/[- ].*//p'`
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.4 or newer installed"
+3 -3
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+6 -10
View File
@@ -1,9 +1,9 @@
#! /bin/sh
#
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -13,16 +13,12 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: fastgen.sh,v 1.14 2002-02-28 08:25:33 sebastian Exp $
# $Id: fastgen.sh,v 1.10 2001-05-20 22:04:23 sas Exp $
#
if test "$#" = "0"; then
echo "Usage: fastgen.sh <srcdir> <mkdir_p> <bsdmakefile_p> <file>"
fi
srcdir=$1
shift
@@ -45,7 +41,7 @@ if test "$bsd_makefile" = "yes"; then
(cd $top_srcdir; ./build/bsd_makefile)
for makefile in $@; do
echo "fastgen.sh: creating $makefile"
echo "creating $makefile"
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
$mkdir_p "$dir/"
@@ -62,7 +58,7 @@ EOF
done
else
for makefile in $@; do
echo "fastgen.sh: creating $makefile"
echo "creating $makefile"
dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
$mkdir_p "$dir/"
+3 -3
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+3 -3
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+2 -2
View File
@@ -1,5 +1,5 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 2000 The PHP Group |
# +----------------------------------------------------------------------+
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+3 -3
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+8 -10
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
@@ -43,23 +43,21 @@ distclean-p depend-p clean-p:
depend: depend-recursive
@echo $(top_srcdir) $(top_builddir) $(srcdir) $(CPP) $(INCLUDES) $(EXTRA_INCLUDES) $(DEFS) $(CPPFLAGS) $(srcdir)/*.c *.c | $(AWK) -f $(top_srcdir)/build/mkdep.awk > $(builddir)/.deps || true
clean: clean-modules clean-recursive clean-x
clean-modules:
clean: clean-recursive clean-x
clean-x:
rm -f $(targets) *.lo *.slo *.la *.o $(CLEANFILES)
rm -rf .libs libs/*
rm -rf .libs
distclean: distclean-recursive clean-x
rm -f config.cache config.log config.status config_vars.mk libtool \
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
test: $(top_builddir)/sapi/cli/php
test: $(top_builddir)/php
@if test "$(TESTS)" = ""; then \
TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/sapi/cli/php -c $(top_srcdir)/php.ini-dist $(top_srcdir)/run-tests.php $(srcdir); \
TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(srcdir); \
else \
TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/sapi/cli/php -c $(top_srcdir)/php.ini-dist $(top_srcdir)/run-tests.php $(TESTS); \
TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(TESTS); \
fi
include $(builddir)/.deps
+3 -3
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+3 -3
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+3 -3
View File
@@ -1,8 +1,8 @@
#! /bin/sh
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
+205 -142
View File
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
timestamp='2001-11-08'
timestamp='2001-04-20'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -24,9 +24,8 @@ timestamp='2001-11-08'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
# Written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -53,7 +52,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
@@ -96,25 +95,25 @@ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int dummy(){}" > $dummy.c ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int dummy(){}" > $dummy.c
for c in cc gcc c89 ; do
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
if test $? = 0 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
rm -f $dummy.c $dummy.o $dummy.rel ;
CC_FOR_BUILD="$c"; break
fi
done
rm -f $dummy.c $dummy.o $dummy.rel
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac'
esac
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
@@ -128,7 +127,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# Netbsd (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
@@ -145,14 +144,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
macppc) machine=powerpc-apple ;;
hp3[0-9][05]) machine=m68k-hp ;;
ibmrt|romp-ibm) machine=romp-ibm ;;
sparc*) machine=`uname -p`-unknown ;;
*) machine=${UNAME_MACHINE}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE}" in
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
@@ -174,45 +171,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
macppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mipseb-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -246,7 +204,6 @@ main:
jsr \$26,exit
.end main
EOF
eval $set_cc_for_build
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
@@ -268,9 +225,6 @@ EOF
2-307)
UNAME_MACHINE="alphaev67"
;;
2-1307)
UNAME_MACHINE="alphaev68"
;;
esac
fi
rm -f $dummy.s $dummy
@@ -288,9 +242,30 @@ EOF
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit 0;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
arc64:OpenBSD:*:*)
echo mips64el-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hkmips:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
@@ -353,6 +328,9 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -379,6 +357,18 @@ EOF
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
sun3*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
@@ -395,7 +385,6 @@ EOF
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@@ -486,7 +475,6 @@ EOF
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
@@ -548,8 +536,10 @@ EOF
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
case "${HPUX_REV}" in
11.[0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
@@ -558,13 +548,12 @@ EOF
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
fi ;;
esac
if [ "${HP_ARCH}" = "" ]; then
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
@@ -597,10 +586,10 @@ EOF
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy
fi ;;
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy
fi ;;
esac
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
@@ -609,7 +598,6 @@ EOF
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
@@ -645,7 +633,7 @@ EOF
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
*9??*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
@@ -664,6 +652,9 @@ EOF
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
hppa*:OpenBSD:*:*)
echo hppa-unknown-openbsd
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
@@ -686,13 +677,12 @@ EOF
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
echo ymp-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
@@ -715,6 +705,9 @@ EOF
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
@@ -727,6 +720,9 @@ EOF
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
@@ -767,29 +763,97 @@ EOF
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
mips:Linux:*:*)
case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
big) echo mips-unknown-linux-gnu && exit 0 ;;
little) echo mipsel-unknown-linux-gnu && exit 0 ;;
esac
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit 0 ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
extern char __libc_release[];
#endif
main(argc, argv)
int argc;
char *argv[];
{
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unknown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then LIBC="libc1" ; fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0 ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0) UNAME_MACHINE="alpha" ;;
1-0) UNAME_MACHINE="alphaev5" ;;
1-1) UNAME_MACHINE="alphaev56" ;;
1-101) UNAME_MACHINE="alphapca56" ;;
2-303) UNAME_MACHINE="alphaev6" ;;
2-307) UNAME_MACHINE="alphaev67" ;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
@@ -819,30 +883,40 @@ EOF
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_supported_targets=`cd /; ld --help 2>&1 \
| sed -ne '/supported targets:/!d
ld_supported_emulations=`cd /; ld --help 2>&1 \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_targets" in
elf32-i386)
case "$ld_supported_emulations" in
i*86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
elf_i*86)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0 ;;
coff-i386)
i*86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit 0 ;;
exit 0
;;
esac
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i*86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
@@ -854,15 +928,15 @@ EOF
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
printf ("%s-pc-linux-gnu\n", argv[1]);
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
# else
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
# else
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
#else
printf ("%s-pc-linux-gnuaout\n", argv[1]);
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
@@ -871,10 +945,9 @@ EOF
rm -f $dummy.c $dummy
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit 0 ;;
i*86:UNIX_SV:4.2MP:2.*)
@@ -893,13 +966,14 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
i*86:*:5:[78]*)
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
i*86:*:5:7*)
# Fixed at (any) Pentium or better
UNAME_MACHINE=i586
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
@@ -947,7 +1021,7 @@ EOF
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -993,8 +1067,8 @@ EOF
echo ns32k-sni-sysv
fi
exit 0 ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
@@ -1006,10 +1080,6 @@ EOF
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
@@ -1102,18 +1172,11 @@ EOF
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
Vendored
+54 -109
View File
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
timestamp='2001-11-08'
timestamp='2001-04-20'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -29,8 +29,7 @@ timestamp='2001-11-08'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -118,7 +117,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -158,14 +157,6 @@ case $os in
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
@@ -224,35 +215,26 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \
| d10v | d30v | dsp16xx \
| fr30 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| m32r | m68000 | m68k | m88k | mcore \
| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
| mipsisa32 \
| mn10200 | mn10300 \
| ns16k | ns32k \
| openrisc \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[34] | sh[34]eb | shbe | shle \
| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
| v850 \
| we32k \
| x86 | xscale | xstormy16 \
| z8k)
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
| pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| hppa64 \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | sh[34] \
| powerpc | powerpcle \
| 1750a | dsp16xx | pdp10 | pdp11 \
| mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
| v850 | c4x \
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
| pj | pjl | h8500)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
@@ -260,7 +242,7 @@ case $basic_machine in
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
;;
# We use `pc' rather than `unknown'
@@ -275,43 +257,31 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alphapca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armv*-* \
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \
| clipper-* | cray2-* | cydra-* \
| d10v-* | d30v-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| m32r-* \
| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
| mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \
| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
| v850-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \
| ymp-* \
| z8k-*)
# FIXME: clean up the formatting here.
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| hppa2.0n-* | hppa64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
| alphaev6[78]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
| mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
| [cjt]90-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -724,7 +694,7 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
pentium | p5 | k5 | k6 | nexgen)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon)
@@ -733,7 +703,7 @@ case $basic_machine in
pentiumii | pentium2)
basic_machine=i686-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
@@ -757,16 +727,6 @@ case $basic_machine in
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
@@ -784,12 +744,6 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
@@ -801,7 +755,7 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sparclite-wrs | simso-wrs)
sparclite-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
@@ -927,10 +881,6 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
windows32)
basic_machine=i386-pc
os=-windows32-msvcrt
;;
xmp)
basic_machine=xmp-cray
os=-unicos
@@ -984,7 +934,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
sh3 | sh4 | sh3eb | sh4eb)
sh3 | sh4)
basic_machine=sh-unknown
;;
sparc | sparcv9 | sparcv9b)
@@ -1068,13 +1018,11 @@ case $os in
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux*)
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1398,9 +1346,6 @@ case $basic_machine in
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
+141 -338
View File
@@ -3,9 +3,37 @@ dnl ## Process this file with autoconf to produce a configure script.
divert(1)
dnl ## Diversion 1 is the autoconf + automake setup phase. We also
dnl ## set the PHP version, deal with platform-specific compile
dnl ## options and check for the basic compile tools.
AC_INIT(README.CVS-RULES)
PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile)
if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
AC_MSG_ERROR(--with-shared-apache is not supported. Please refer to the documentation for using APXS)
fi
if test -n "$with_apache" && test -n "$with_apxs"; then
AC_MSG_ERROR(--with-apache and --with-apxs cannot be used together)
fi
cwd=`pwd`
PHP_CONFIG_NICE(config.nice)
for arg in $0 "$@"; do
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
done
php_shtool=$srcdir/build/shtool
T_MD=`$php_shtool echo -n -e %B`
T_ME=`$php_shtool echo -n -e %b`
dnl Because ``make install'' is often performed by the superuser,
dnl we create the libs subdirectory as the user who configures PHP.
dnl Otherwise, the current user will not be able to delete libs
dnl or the contents of libs.
$php_shtool mkdir -p libs
rm -f libs/*
dnl ## Diversion 2 is the initial checking of OS features, programs,
dnl ## libraries and so on.
@@ -17,33 +45,13 @@ 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 4 we check user-configurable general settings.
dnl ## In diversion 5 we check which extensions should be compiled.
dnl ## In diversion 4 we check which extensions should be compiled.
dnl ## All of these are normally in the extension directories.
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
dnl Basic autoconf + automake initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
AC_INIT(README.CVS-RULES)
PHP_CONFIG_NICE(config.nice)
for arg in $0 "$@"; do
CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
done
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(php, 4.2.3RC2, nodefine)
AM_CONFIG_HEADER(main/php_config.h)
AM_MAINTAINER_MODE
dnl Setting up the PHP version based on the information above.
dnl -------------------------------------------------------------------------
dnl ## This is where the version number is changed from now on!
AM_INIT_AUTOMAKE(php, 4.0.7RC3, nodefine)
PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
@@ -57,28 +65,31 @@ else
rm -f php_version.h.new
fi
AM_CONFIG_HEADER(main/php_config.h)
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
dnl We want this one before the checks, so the checks can modify CFLAGS.
test -z "$CFLAGS" && auto_cflags=1
dnl Catch common errors here to save a few seconds of our users' time
dnl -------------------------------------------------------------------------
if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
AC_MSG_ERROR([--with-shared-apache is not supported. Please refer to the documentation for using APXS])
dnl Checks for programs.
AC_PROG_AWK
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
if test -n "$with_apache" && test -n "$with_apxs"; then
AC_MSG_ERROR([--with-apache and --with-apxs cannot be used together])
fi
dnl Platform-specific compile settings.
dnl -------------------------------------------------------------------------
dnl if host_alias is empty, ac_cv_host_alias may still have the info
if test -z "$host_alias"; then
host_alias=$ac_cv_host_alias
fi
AC_PROG_CC
AC_AIX
BSD_MAKEFILE=no
@@ -96,96 +107,23 @@ case $host_alias in
*bsdi*)
BSD_MAKEFILE=yes;;
*beos*)
beos_threads=1
LIBS="$LIBS -lbe -lroot";;
beos_threads=1
LIBS="$LIBS -lbe -lroot";;
*mips*)
CPPFLAGS="$CPPFLAGS -D_XPG_IV";;
CPPFLAGS="$CPPFLAGS -D_XPG_IV";;
esac
dnl Settings we want to make before the checks.
dnl -------------------------------------------------------------------------
cwd=`pwd`
php_shtool=$srcdir/build/shtool
T_MD=`$php_shtool echo -n -e %B`
T_ME=`$php_shtool echo -n -e %b`
dnl We want this one before the checks, so the checks can modify CFLAGS.
test -z "$CFLAGS" && auto_cflags=1
abs_srcdir=`(cd $srcdir; pwd)`
abs_builddir=`pwd`
dnl Because ``make install'' is often performed by the superuser,
dnl we create the libs subdirectory as the user who configures PHP.
dnl Otherwise, the current user will not be able to delete libs
dnl or the contents of libs.
$php_shtool mkdir -p libs
rm -f libs/*
PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile main/Makefile sapi/cli/Makefile)
dnl Checks for programs.
dnl -------------------------------------------------------------------------
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_CPP
AC_AIX
dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf
AM_PROG_CC_STDC
dnl AC_PROG_CXX
dnl AC_PROG_CXXCPP
dnl check for -R, etc. switch
AC_MSG_CHECKING([whether 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
else
AC_MSG_CHECKING([whether 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,
else
dnl something innocuous
ld_runpath_switch=-L
fi
fi
AC_PROG_RANLIB
AC_PROG_CC_C_O
AC_PROG_LN_S
AC_PROG_AWK
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])
set `bison --version| grep 'GNU Bison' | cut -d ' ' -f 4 | sed -e 's/\./ /'`
if test "${1}" = "1" -a "${2}" -lt "28"; then
AC_MSG_WARN(You will need bison 1.28 if you want to regenerate the Zend parser (found ${1}.${2}).)
fi
AC_MSG_RESULT(${1}.${2} (ok))
fi
AC_PROG_LEX
if test -n "$LEX"; then
AC_DECL_YYTEXT
:
fi
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
@@ -194,39 +132,21 @@ if test "$ac_cv_c_const" = "yes" ; then
LEX_CFLAGS="-DYY_USE_CONST"
fi
dnl Include Zend and TSRM configurations.
dnl -------------------------------------------------------------------------
abs_srcdir=`(cd $srcdir; pwd)`
abs_builddir=`pwd`
sinclude(Zend/acinclude.m4)
sinclude(Zend/Zend.m4)
sinclude(TSRM/tsrm.m4)
divert(2)
dnl ## Diversion 2 is where we set PHP-specific options and come up
dnl ## with reasonable default values for them. We check for pthreads here
dnl ## because the information is needed by the SAPI configuration.
dnl ## This is also where an SAPI interface is selected (choosing between
dnl ## Apache module, CGI etc.)
dnl .
dnl -------------------------------------------------------------------------
PTHREADS_CHECK
PHP_HELP_SEPARATOR([SAPI modules:])
PHP_SHLIB_SUFFIX_NAME
PHP_SAPI=cgi
PHP_BUILD_PROGRAM
dnl SAPI configuration.
dnl -------------------------------------------------------------------------
dnl paths to the targets are relative to the build directory
SAPI_PROGRAM=php
SAPI_SHARED=libs/libphp4.$SHLIB_SUFFIX_NAME
@@ -237,47 +157,63 @@ PHP_CONFIGURE_PART(Configuring SAPI modules)
esyscmd(./scripts/config-stubs sapi)
AC_MSG_CHECKING([for chosen SAPI module])
AC_MSG_RESULT([$PHP_SAPI])
AC_MSG_CHECKING(for chosen SAPI module)
AC_MSG_RESULT($PHP_SAPI)
if test "$enable_experimental_zts" = "yes"; then
PTHREADS_ASSIGN_VARS
PTHREADS_FLAGS
fi
divert(3)
dnl ## In diversion 3 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 Starting system checks.
dnl -------------------------------------------------------------------------
PHP_CONFIGURE_PART(Running system checks)
PHP_MISSING_TIME_R_DECL
dnl check for -R, etc. switch
AC_MSG_CHECKING(whether compiler supports -R)
AC_CACHE_VAL(php_cv_cc_dashr,[
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
else
AC_MSG_CHECKING([whether 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,
else
dnl something innocuous
ld_runpath_switch=-L
fi
fi
PHP_PROG_SENDMAIL
dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset
PHP_EBCDIC
dnl
dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
dnl and source packages. This should be harmless on other OSs.
dnl
if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
fi
INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
dnl First, library checks.
dnl -------------------------------------------------------------------------
AC_CHECK_LIB(socket, socket, [
PHP_ADD_LIBRARY(socket)
AC_DEFINE(HAVE_LIBSOCKET,1,[ ]) ], [
@@ -291,7 +227,7 @@ dnl are usually in libnsl
unset ac_cv_func_yp_get_default_domain
AC_CHECK_FUNC(yp_get_default_domain,
[php_no_nsl_checks=yes],[])
[php_no_nsl_checks=yes],[ ])
unset ac_cv_func_yp_get_default_domain
if test "$php_no_nsl_checks" != "yes"; then
@@ -337,11 +273,6 @@ AC_CHECK_LIB(socket, res_search, [
])
])
dnl Then headers.
dnl -------------------------------------------------------------------------
dnl Checks for header files.
AC_HEADER_STDC
@@ -354,7 +285,6 @@ fi
PHP_MISSING_FCLOSE_DECL
dnl QNX requires unix.h to allow functions in libunix to work properly
AC_CHECK_HEADERS(
ApplicationServices/ApplicationServices.h \
alloca.h \
arpa/inet.h \
arpa/nameser.h \
@@ -393,11 +323,7 @@ unix.h \
utime.h \
)
dnl Checks for typedefs, structures, and compiler characteristics.
dnl -------------------------------------------------------------------------
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
@@ -408,6 +334,8 @@ PHP_SOCKLEN_T
AC_CHECK_SIZEOF(long, 8)
AC_CHECK_SIZEOF(int, 4)
test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
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
@@ -415,7 +343,7 @@ dnl The WARNING_LEVEL required because cc in QNX hates -w option without an argu
if test "`uname -s 2>/dev/null`" != "QNX"; then
AC_STRUCT_ST_BLOCKS
else
AC_MSG_WARN([warnings level for cc set to 0])
AC_MSG_WARN(warnings level for cc set to 0)
WARNING_LEVEL=0
fi
AC_STRUCT_ST_RDEV
@@ -424,30 +352,17 @@ dnl Checks for types
AC_TYPE_SIZE_T
AC_TYPE_UID_T
dnl Check for struct sockaddr_storage
AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_sockaddr_storage,
[AC_TRY_COMPILE([ #include <sys/types.h>
#include <sys/socket.h>], [struct sockaddr_storage s; s],
ac_cv_sockaddr_storage=yes, ac_cv_sockaddr_storage=no)])
if test "$ac_cv_sockaddr_storage" = yes; then
AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[Whether you have struct sockaddr_storage])
fi
dnl Check for IPv6 support
AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
[AC_TRY_LINK([ #include <sys/types.h>
[AC_TRY_COMPILE([ #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>], [struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;],
[ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
#include <netinet/in.h>], [struct sockaddr_in6 s; int i=AF_INET6; s],
ac_cv_ipv6_support=yes, ac_cv_ipv6_support=no)])
if test "$ac_cv_ipv6_support" = yes; then
AC_DEFINE(HAVE_IPV6,1,[Whether you have IPv6 support])
fi
dnl Checks for library functions.
dnl -------------------------------------------------------------------------
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(
asctime_r \
@@ -479,7 +394,6 @@ mkstemp \
mmap \
nl_langinfo \
putenv \
realpath \
random \
rand_r \
regcomp \
@@ -531,7 +445,7 @@ PHP_TIME_R_TYPE
PHP_READDIR_R_TYPE
dnl AIX keeps in_addr_t in /usr/include/netinet/in.h
dnl AC_MSG_CHECKING([for in_addr_t])
dnl AC_MSG_CHECKING(for in_addr_t)
AC_CACHE_VAL(ac_cv_type_$1,
[AC_EGREP_CPP(dnl
changequote(<<,>>)dnl
@@ -545,23 +459,13 @@ changequote([,]), [#include <sys/types.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])
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(4)
dnl ## In diversion 4 we check user-configurable general settings.
dnl General settings.
dnl -------------------------------------------------------------------------
PHP_HELP_SEPARATOR([General settings:])
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
[ --enable-debug Compile with debugging symbols.], no)
@@ -577,15 +481,6 @@ PHP_ARG_WITH(layout,[layout of installed files],
[ --with-layout=TYPE Sets how installed files will be laid out. Type is
one of "PHP" (default) or "GNU"], PHP)
case $PHP_LAYOUT in
GNU)
oldstyleextdir=no
;;
*)
oldstyleextdir=yes
;;
esac
PHP_ARG_WITH(config-file-path,[path to configuration file],
[ --with-config-file-path=PATH
Sets the path in which to look for php.ini,
@@ -595,10 +490,10 @@ if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
case $PHP_LAYOUT in
GNU)
PHP_CONFIG_FILE_PATH=$sysconfdir
;;
oldstyleextdir=no;;
*)
PHP_CONFIG_FILE_PATH=$libdir
;;
oldstyleextdir=yes;;
esac
fi
@@ -634,7 +529,7 @@ else
AC_DEFINE(PHP_SAFE_MODE,0,[ ])
fi
AC_MSG_CHECKING([for safe mode exec dir])
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],
@@ -642,18 +537,18 @@ AC_ARG_WITH(exec-dir,
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])
AC_MSG_RESULT(/usr/local/php/bin)
else
AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR,"$withval", [ ])
AC_MSG_RESULT([$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])
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_RESULT(/usr/local/php/bin)
])
PHP_ARG_WITH(openssl,for OpenSSL support,
@@ -694,7 +589,7 @@ PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc,
if test "$PHP_LIBGCC" = "yes"; then
PHP_LIBGCC_LIBPATH(gcc)
if test -z "$libgcc_libpath"; then
AC_MSG_ERROR([Cannot locate libgcc. Make sure that gcc is in your path])
AC_MSG_ERROR(Cannot locate libgcc. Make sure that gcc is in your path)
fi
PHP_ADD_LIBPATH($libgcc_libpath)
PHP_ADD_LIBRARY(gcc, yes)
@@ -720,40 +615,27 @@ if test "$PHP_DMALLOC" = "yes"; then
AC_DEFINE(HAVE_DMALLOC,1,[Whether you have dmalloc])
CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK"
], [
AC_MSG_ERROR([Problem with enabling dmalloc. Please check config.log for details.])
AC_MSG_ERROR(Problem with enabling dmalloc. Please check config.log for details.)
])
fi
# temporary until streams are better integrated
PHP_ARG_ENABLE(php-streams,whether to enable php streams,
[ --enable-php-streams Include experimental php streams.
Do not use unless you are testing the code!])
if test "$PHP_PHP_STREAMS" = "yes"; then
AC_DEFINE(HAVE_PHP_STREAM, 1, [Whether to use php streams])
fi
AC_CHECK_LIB(crypt, crypt, [
PHP_ADD_LIBRARY(crypt)
PHP_ADD_LIBRARY(crypt, 1)
AC_DEFINE(HAVE_CRYPT,1,[ ])
])
divert(5)
dnl ## In diversion 5 we check which extensions should be compiled.
dnl ## All of these are normally in the extension directories.
dnl Extension configuration.
dnl -------------------------------------------------------------------------
PHP_HELP_SEPARATOR([Extensions:
--with-EXTENSION=[shared[,PATH]]
NOTE: Not all extensions can be build as 'shared'.
Example: --with-foobar=shared,/usr/local/foobar/
o Builds the foobar extension as shared extension.
o foobar package install prefix is /usr/local/foobar/
])
PHP_CONFIGURE_PART(Configuring extensions)
# reading config stubs
@@ -761,14 +643,7 @@ esyscmd(./scripts/config-stubs ext)
PHP_FAST_OUTPUT(sapi/$PHP_SAPI/Makefile)
dnl Other settings.
dnl -------------------------------------------------------------------------
PHP_HELP_SEPARATOR([Other settings:])
AC_MSG_CHECKING([whether to enable versioning])
AC_MSG_CHECKING(whether to enable versioning)
AC_ARG_ENABLE(versioning,
[ --enable-versioning Export only required symbols.
See INSTALL for more information],[
@@ -776,7 +651,7 @@ AC_ARG_ENABLE(versioning,
],[
PHP_VERSIONING=no
])
AC_MSG_RESULT([$PHP_VERSIONING])
AC_MSG_RESULT($PHP_VERSIONING)
if test "$PHP_VERSIONING" = "yes"; then
test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym"
@@ -785,6 +660,8 @@ if test "$PHP_VERSIONING" = "yes"; then
fi
fi
divert(6)
enable_shared=yes
enable_static=yes
unset with_pic
@@ -816,12 +693,6 @@ fi
PHP_REGEX
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
unset LIBS LDFLAGS
dnl Configuring Zend and TSRM.
dnl -------------------------------------------------------------------------
PHP_CONFIGURE_PART(Configuring Zend)
LIBZEND_BASIC_CHECKS
LIBZEND_OTHER_CHECKS
@@ -842,7 +713,7 @@ if test "$abs_srcdir" != "$abs_builddir"; then
INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM"
fi
ZEND_EXTRA_LIBS="$LIBS"
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
unset LIBS LDFLAGS
PHP_CONFIGURE_PART(Configuring TSRM)
@@ -950,20 +821,6 @@ AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
PHP_OS=`uname`
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
if test "$disable_cli" = "1"; then
CLI_DIR=
else
CLI_DIR=sapi/cli
fi
PHP_SUBST(CLI_DIR)
PHP_SUBST(EXT_SUBDIRS)
PHP_SUBST(EXT_STATIC)
PHP_SUBST(EXT_SHARED)
PHP_SUBST(EXT_LIBS)
PHP_SUBST(EXT_LTLIBS)
PHP_SUBST(EXT_CLI_LTLIBS)
PHP_SUBST_OLD(abs_builddir)
PHP_SUBST_OLD(abs_srcdir)
@@ -994,7 +851,6 @@ PHP_SUBST(DEFS)
PHP_SUBST_OLD(EXTENSION_DIR)
PHP_SUBST(EXTRA_LDFLAGS)
PHP_SUBST_OLD(EXTRA_LIBS)
PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
PHP_SUBST(INCLUDES)
PHP_SUBST_OLD(INCLUDE_PATH)
PHP_SUBST_OLD(INSTALL_IT)
@@ -1022,6 +878,8 @@ PHP_SUBST(TSRM_LIB)
PHP_SUBST(WARNING_LEVEL)
PHP_SUBST_OLD(YACC)
PHP_CONFIGURE_PART(Configuring libtool)
old_CC=$CC
if test "$PHP_THREAD_SAFETY" = "yes" && test -n "$ac_cv_pthreads_cflags"; then
@@ -1066,12 +924,11 @@ PHP_GEN_CONFIG_VARS
$php_shtool mkdir -p pear/scripts
ALL_OUTPUT_FILES="php4.spec Zend/Makefile main/build-defs.h \
pear/scripts/pear pear/scripts/phpize pear/scripts/php-config \
pear/scripts/pearize pear/scripts/phptar \
TSRM/Makefile $PHP_OUTPUT_FILES"
pear/scripts/pearize pear/scripts/phptar TSRM/Makefile $PHP_OUTPUT_FILES"
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES"; then
REDO_ALL=yes
fi
@@ -1090,10 +947,9 @@ fi
# Create configuration headers
#
test -d TSRM || mkdir TSRM
echo '#include "../main/php_config.h"' > TSRM/tsrm_config.h
test -d Zend || mkdir Zend
if test -d TSRM; then
echo '#include "../main/php_config.h"' > TSRM/tsrm_config.h
fi
cat >Zend/zend_config.h <<FEO
#include "../main/php_config.h"
@@ -1110,11 +966,6 @@ if test -n "\$REDO_ALL"; then
extensions="$EXT_STATIC"
dnl mv -f main/internal_functions.c main/internal_functions.c.old 2>/dev/null
sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$extensions > main/internal_functions.c
echo "creating main/internal_functions_cli.c"
cli_extensions="$EXT_CLI_STATIC"
sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$cli_extensions > main/internal_functions_cli.c
dnl if cmp main/internal_functions.c.old main/internal_functions.c > /dev/null 2>&1; then
dnl echo "main/internal_functions.c is unchanged"
dnl mv main/internal_functions.c.old main/internal_functions.c
@@ -1122,47 +973,11 @@ dnl else
dnl rm -f main/internal_functions.c.old
dnl fi
# experimental things
if test $PHP_SAPI = "apache2filter" ; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
echo "| |"
echo "| Apache 2 Support is EXPERIMENTAL and should NOT be used in |"
echo "| production environment. Before submitting bug reports, try the |"
echo "| latest CVS snapshot from http://snaps.php.net |"
fi
if test "$PHP_OVERLOAD" != "no"; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
echo "| |"
echo "| The overload extension is highly EXPERIMENTAL and will most |"
echo "| certainly change in newer versions. You have been warned! |"
fi
if test "$PHP_AGGREGATE" != "no"; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
echo "| |"
echo "| The aggregate functions are highly EXPERIMENTAL and will most |"
echo "| certainly change in newer versions. You have been warned! |"
fi
if test $UNAME = "FreeBSD" && test $PHP_SAPI = "apache2filter" && test $TSRM_PTH != "pth-config" ; then
echo "+--------------------------------------------------------------------+"
echo "| *** WARNING *** |"
echo "| |"
echo "| In order to build PHP as a Apache2 module on FreeBSD, you have to |"
echo "| add --with-tsrm-pth to your ./configure line. Therefore you need |"
echo "| to install gnu-pth from /usr/ports/devel/pth. |"
fi
if test -n "$PHP_APXS_BROKEN"; then
echo "+--------------------------------------------------------------------+"
echo "| WARNING: Your $APXS script is most likely broken."
echo "| |"
echo "| Please go read http://www.php.net/faq.build#faq.build.apxs |"
echo "| Please go read http://www.php.net/manual/en/faq.build.php#AEN61338 |"
echo "| and make the changes described there and try again. |"
fi
@@ -1249,18 +1064,6 @@ cat<<X
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+
| *** NOTE *** |
| The default for register_globals is now OFF! |
| |
| If your application relies on register_globals being ON, you |
| should explicitly set it to on in your php.ini file. |
| Note that you are strongly encouraged to read |
| http://www.php.net/manual/en/security.registerglobals.php |
| about the implications of having register_globals set to on, and |
| avoid using it if possible. |
+--------------------------------------------------------------------+
Thank you for using PHP.
+4 -4
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP Version 4 |
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2002 The PHP Group |
# | Copyright (c) 1997-2001 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
@@ -11,7 +11,7 @@
# | obtain it through the world-wide-web, please send a note to |
# | license@php.net so we can mail you a copy immediately. |
# +----------------------------------------------------------------------+
# | Author: Sascha Schumann <sascha@schumann.cx> |
# | Authors: Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id$
@@ -32,7 +32,7 @@ AC_DEFUN(LIB_SHARED_MODULE,[
lib_target="\$(LTLIBRARY_SHARED_NAME)"
cat >>$1<<EOF
\$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
\$(SHARED_LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
\$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
EOF
+17 -18
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Rasmus Lerdorf <rasmus@php.net> |
| Authors: |
+----------------------------------------------------------------------+
*/
@@ -51,8 +51,7 @@ function_entry aspell_functions[] = {
static int le_aspell;
zend_module_entry aspell_module_entry = {
STANDARD_MODULE_HEADER,
"aspell", aspell_functions, PHP_MINIT(aspell), NULL, NULL, NULL, PHP_MINFO(aspell), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES
"aspell", aspell_functions, PHP_MINIT(aspell), NULL, NULL, NULL, PHP_MINFO(aspell), STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_ASPELL
@@ -95,10 +94,10 @@ PHP_FUNCTION(aspell_new)
if(argc==2)
{
convert_to_string_ex(personal) ;
sc=aspell_new(Z_STRVAL_PP(master), Z_STRVAL_PP(personal));
sc=aspell_new((*master)->value.str.val, (*personal)->value.str.val);
}
else
sc=aspell_new(Z_STRVAL_PP(master), "");
sc=aspell_new((*master)->value.str.val, "");
ind = zend_list_insert(sc, le_aspell);
RETURN_LONG(ind);
@@ -123,10 +122,10 @@ PHP_FUNCTION(aspell_suggest)
}
convert_to_long_ex(scin);
convert_to_string_ex(word);
sc = (aspell *)zend_list_find(Z_LVAL_PP(scin), &type);
sc = (aspell *)zend_list_find((*scin)->value.lval, &type);
if(!sc)
{
php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin));
php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval);
RETURN_FALSE;
}
@@ -134,7 +133,7 @@ PHP_FUNCTION(aspell_suggest)
RETURN_FALSE;
}
sug = aspell_suggest(sc, Z_STRVAL_PP(word));
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);
}
@@ -157,13 +156,13 @@ PHP_FUNCTION(aspell_check)
}
convert_to_long_ex(scin);
convert_to_string_ex(word);
sc= (aspell *) zend_list_find(Z_LVAL_PP(scin), &type);
sc= (aspell *) zend_list_find((*scin)->value.lval, &type);
if(!sc)
{
php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin));
php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval);
RETURN_FALSE;
}
if (aspell_check(sc, Z_STRVAL_PP(word)))
if (aspell_check(sc, (*word)->value.str.val))
{
RETURN_TRUE;
}
@@ -189,13 +188,13 @@ PHP_FUNCTION(aspell_check_raw)
}
convert_to_long_ex(scin);
convert_to_string_ex(word);
sc = (aspell *)zend_list_find(Z_LVAL_PP(scin), &type);
sc = (aspell *)zend_list_find((*scin)->value.lval, &type);
if(!sc)
{
php_error(E_WARNING, "%d is not an ASPELL result index", Z_LVAL_PP(scin));
php_error(E_WARNING, "%d is not an ASPELL result index", (*scin)->value.lval);
RETURN_FALSE;
}
if (aspell_check_raw(sc, Z_STRVAL_PP(word)))
if (aspell_check_raw(sc, (*word)->value.str.val))
{
RETURN_TRUE;
}
@@ -223,6 +222,6 @@ PHP_MINFO_FUNCTION(aspell)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
-2
View File
@@ -1,6 +1,4 @@
dnl
dnl $Id$
dnl
AC_MSG_CHECKING(for ASPELL support)
AC_ARG_WITH(aspell,
+3 -3
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Rasmus Lerdorf <rasmus@php.net> |
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
+53 -55
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Andi Gutmans <andi@zend.com> |
| Authors: Andi Gutmans <andi@zend.com> |
+----------------------------------------------------------------------+
*/
@@ -28,7 +28,7 @@
#include "ext/standard/info.h"
#include "php_bcmath.h"
#include "libbcmath/src/bcmath.h"
#include "ext/bcmath/libbcmath/src/bcmath.h"
function_entry bcmath_functions[] = {
PHP_FE(bcadd, NULL)
@@ -44,15 +44,13 @@ function_entry bcmath_functions[] = {
};
zend_module_entry bcmath_module_entry = {
STANDARD_MODULE_HEADER,
"bcmath",
bcmath_functions,
bcmath_functions,
PHP_MINIT(bcmath),
PHP_MSHUTDOWN(bcmath),
PHP_RINIT(bcmath),
NULL,
PHP_MINFO(bcmath),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
@@ -152,7 +150,7 @@ PHP_FUNCTION(bcadd)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
scale = (int) Z_LVAL_PP(scale_param);
scale = (int) (*scale_param)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -163,12 +161,12 @@ PHP_FUNCTION(bcadd)
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first, Z_STRVAL_PP(left), scale);
bc_str2num(&second, Z_STRVAL_PP(right), scale);
bc_str2num(&first, (*left)->value.str.val, scale);
bc_str2num(&second, (*right)->value.str.val, scale);
bc_add (first, second, &result, scale);
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
@@ -195,7 +193,7 @@ PHP_FUNCTION(bcsub)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
scale = (int) Z_LVAL_PP(scale_param);
scale = (int) (*scale_param)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -206,12 +204,12 @@ PHP_FUNCTION(bcsub)
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first, Z_STRVAL_PP(left), scale);
bc_str2num(&second, Z_STRVAL_PP(right), scale);
bc_str2num(&first, (*left)->value.str.val, scale);
bc_str2num(&second, (*right)->value.str.val, scale);
bc_sub (first, second, &result, scale);
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
@@ -238,7 +236,7 @@ PHP_FUNCTION(bcmul)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
scale = (int) Z_LVAL_PP(scale_param);
scale = (int) (*scale_param)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -249,12 +247,12 @@ PHP_FUNCTION(bcmul)
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first, Z_STRVAL_PP(left), scale);
bc_str2num(&second, Z_STRVAL_PP(right), scale);
bc_str2num(&first, (*left)->value.str.val, scale);
bc_str2num(&second, (*right)->value.str.val, scale);
bc_multiply (first, second, &result, scale);
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
@@ -281,7 +279,7 @@ PHP_FUNCTION(bcdiv)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
scale = (int) Z_LVAL_PP(scale_param);
scale = (int) (*scale_param)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -292,13 +290,13 @@ PHP_FUNCTION(bcdiv)
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first, Z_STRVAL_PP(left), scale);
bc_str2num(&second, Z_STRVAL_PP(right), scale);
bc_str2num(&first, (*left)->value.str.val, scale);
bc_str2num(&second, (*right)->value.str.val, scale);
switch (bc_divide (first, second, &result, scale)) {
case 0: /* OK */
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
break;
case -1: /* division by zero */
php_error(E_WARNING, "Division by zero");
@@ -333,13 +331,13 @@ PHP_FUNCTION(bcmod)
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first, Z_STRVAL_PP(left), 0);
bc_str2num(&second, Z_STRVAL_PP(right), 0);
bc_str2num(&first, (*left)->value.str.val, 0);
bc_str2num(&second, (*right)->value.str.val, 0);
switch (bc_modulo(first, second, &result, 0)) {
case 0:
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
break;
case -1:
php_error(E_WARNING, "Division by zero");
@@ -371,7 +369,7 @@ PHP_FUNCTION(bcpow)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
scale = (int) Z_LVAL_PP(scale_param);
scale = (int) (*scale_param)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -382,12 +380,12 @@ PHP_FUNCTION(bcpow)
bc_init_num(&first);
bc_init_num(&second);
bc_init_num(&result);
bc_str2num(&first, Z_STRVAL_PP(left), scale);
bc_str2num(&second, Z_STRVAL_PP(right), scale);
bc_str2num(&first, (*left)->value.str.val, scale);
bc_str2num(&second, (*right)->value.str.val, scale);
bc_raise (first, second, &result, scale);
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
@@ -414,7 +412,7 @@ PHP_FUNCTION(bcsqrt)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
scale = (int) Z_LVAL_PP(scale_param);
scale = (int) (*scale_param)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -422,11 +420,11 @@ PHP_FUNCTION(bcsqrt)
}
convert_to_string_ex(left);
bc_init_num(&result);
bc_str2num(&result, Z_STRVAL_PP(left), scale);
bc_str2num(&result, (*left)->value.str.val, scale);
if (bc_sqrt (&result, scale) != 0) {
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
return_value->value.str.val = bc_num2str(result);
return_value->value.str.len = strlen(return_value->value.str.val);
return_value->type = IS_STRING;
} else {
php_error(E_WARNING, "Square root of negative number");
}
@@ -454,7 +452,7 @@ PHP_FUNCTION(bccomp)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(scale_param);
scale = (int) Z_LVAL_PP(scale_param);
scale = (int) (*scale_param)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -466,10 +464,10 @@ PHP_FUNCTION(bccomp)
bc_init_num(&first);
bc_init_num(&second);
bc_str2num(&first, Z_STRVAL_PP(left), scale);
bc_str2num(&second, Z_STRVAL_PP(right), scale);
Z_LVAL_P(return_value) = bc_compare(first, second);
Z_TYPE_P(return_value) = IS_LONG;
bc_str2num(&first, (*left)->value.str.val, scale);
bc_str2num(&second, (*right)->value.str.val, scale);
return_value->value.lval = bc_compare(first, second);
return_value->type = IS_LONG;
bc_free_num(&first);
bc_free_num(&second);
@@ -488,7 +486,7 @@ PHP_FUNCTION(bcscale)
}
convert_to_long_ex(new_scale);
bc_precision = Z_LVAL_PP(new_scale);
bc_precision = (*new_scale)->value.lval;
RETURN_TRUE;
}
/* }}} */
@@ -501,6 +499,6 @@ PHP_FUNCTION(bcscale)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+5 -3
View File
@@ -1,8 +1,6 @@
dnl
dnl $Id$
dnl
PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions,
PHP_ARG_ENABLE(bcmath, for bc style precision math functions,
[ --enable-bcmath Enable bc style precision math functions.])
if test "$PHP_BCMATH" != "no"; then
@@ -12,3 +10,7 @@ if test "$PHP_BCMATH" != "no"; then
LIB_BUILD($ext_builddir/libbcmath,$ext_shared,yes)
LIB_BUILD($ext_builddir/libbcmath/src,$ext_shared,yes)
fi
dnl ## Local Variables:
dnl ## tab-width: 4
dnl ## End:
+3 -3
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Andi Gutmans <andi@zend.com> |
| Authors: Andi Gutmans <andi@zend.com> |
+----------------------------------------------------------------------+
*/
+6 -6
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -40,7 +40,7 @@ PHP_FUNCTION(unixtojd)
if(myargc==1) {
convert_to_long(timestamp);
t = Z_LVAL_P(timestamp);
t = timestamp->value.lval;
} else {
t = time(NULL);
}
@@ -69,7 +69,7 @@ PHP_FUNCTION(jdtounix)
convert_to_long(jday);
uday = Z_LVAL_P(jday) - 2440588 /* J.D. of 1.1.1970 */;
uday = jday->value.lval - 2440588 /* J.D. of 1.1.1970 */;
if(uday<0) RETURN_FALSE; /* before beginning of unix epoch */
if(uday>24755) RETURN_FALSE; /* behind end of unix epoch */
@@ -83,6 +83,6 @@ PHP_FUNCTION(jdtounix)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+32 -34
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -57,7 +57,6 @@ function_entry calendar_functions[] = {
zend_module_entry calendar_module_entry = {
STANDARD_MODULE_HEADER,
"calendar",
calendar_functions,
PHP_MINIT(calendar),
@@ -65,7 +64,6 @@ zend_module_entry calendar_module_entry = {
NULL,
NULL,
PHP_MINFO(calendar),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES,
};
@@ -139,7 +137,7 @@ PHP_MINFO_FUNCTION(calendar)
}
/* {{{ proto array cal_info(int calendar)
Returns information about a particular calendar */
* Return information about a particular calendar */
PHP_FUNCTION(cal_info)
{
zval ** cal;
@@ -178,7 +176,7 @@ PHP_FUNCTION(cal_info)
/* }}} */
/* {{{ proto int cal_days_in_month(int calendar, int month, int year)
Returns the number of days in a month for a given year and calendar */
* Returns the number of days in a month for a given year and calendar */
PHP_FUNCTION(cal_days_in_month)
{
zval ** cal, **month, **year;
@@ -214,7 +212,7 @@ PHP_FUNCTION(cal_days_in_month)
/* }}} */
/* {{{ proto int cal_to_jd(int calendar, int month, int day, int year)
Converts from a supported calendar to Julian Day Count */
* Convert from a supported calendar to Julian Day Count */
PHP_FUNCTION(cal_to_jd)
{
zval ** cal, **month, **day, **year;
@@ -241,7 +239,7 @@ PHP_FUNCTION(cal_to_jd)
/* }}} */
/* {{{ proto array cal_from_jd(int jd, int calendar)
Converts from Julian Day Count to a supported calendar and return extended information */
* Convert from Julian Day Count to a supported calendar and return extended information */
PHP_FUNCTION(cal_from_jd)
{
zval ** jd, ** cal;
@@ -286,7 +284,7 @@ PHP_FUNCTION(cal_from_jd)
/* }}} */
/* {{{ proto string jdtogregorian(int juliandaycount)
Converts a julian day count to a gregorian calendar date */
Convert a julian day count to a gregorian calendar date */
PHP_FUNCTION(jdtogregorian)
{
pval **julday;
@@ -298,7 +296,7 @@ PHP_FUNCTION(jdtogregorian)
}
convert_to_long_ex(julday);
SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day);
SdnToGregorian((*julday)->value.lval, &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
@@ -306,7 +304,7 @@ PHP_FUNCTION(jdtogregorian)
/* }}} */
/* {{{ proto int gregoriantojd(int month, int day, int year)
Converts a gregorian calendar date to julian day count */
Convert a gregorian calendar date to julian day count */
PHP_FUNCTION(gregoriantojd)
{
pval **year, **month, **day;
@@ -320,7 +318,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(day);
convert_to_long_ex(year);
jdate = GregorianToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day));
jdate = GregorianToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval);
RETURN_LONG(jdate);
}
@@ -339,7 +337,7 @@ PHP_FUNCTION(jdtogregorian)
}
convert_to_long_ex(julday);
SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day);
SdnToJulian((*julday)->value.lval, &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
@@ -347,7 +345,7 @@ PHP_FUNCTION(jdtogregorian)
/* }}} */
/* {{{ proto int juliantojd(int month, int day, int year)
Converts a julian calendar date to julian day count */
Convert a julian calendar date to julian day count */
PHP_FUNCTION(juliantojd)
{
pval **year, **month, **day;
@@ -361,14 +359,14 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(day);
convert_to_long_ex(year);
jdate = JulianToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day));
jdate = JulianToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval);
RETURN_LONG(jdate);
}
/* }}} */
/* {{{ proto string jdtojewish(int juliandaycount)
Converts a julian day count to a jewish calendar date */
Convert a julian day count to a jewish calendar date */
PHP_FUNCTION(jdtojewish)
{
pval **julday;
@@ -381,7 +379,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(julday);
SdnToJewish(Z_LVAL_PP(julday), &year, &month, &day);
SdnToJewish((*julday)->value.lval, &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
@@ -389,7 +387,7 @@ PHP_FUNCTION(jdtogregorian)
/* }}} */
/* {{{ proto int jewishtojd(int month, int day, int year)
Converts a jewish calendar date to a julian day count */
Convert a jewish calendar date to a julian day count */
PHP_FUNCTION(jewishtojd)
{
pval **year, **month, **day;
@@ -403,14 +401,14 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(day);
convert_to_long_ex(year);
jdate = JewishToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day));
jdate = JewishToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval);
RETURN_LONG(jdate);
}
/* }}} */
/* {{{ proto string jdtofrench(int juliandaycount)
Converts a julian day count to a french republic calendar date */
Convert a julian day count to a french republic calendar date */
PHP_FUNCTION(jdtofrench)
{
pval **julday;
@@ -423,7 +421,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(julday);
SdnToFrench(Z_LVAL_PP(julday), &year, &month, &day);
SdnToFrench((*julday)->value.lval, &year, &month, &day);
sprintf(date, "%i/%i/%i", month, day, year);
RETURN_STRING(date, 1);
@@ -431,7 +429,7 @@ PHP_FUNCTION(jdtogregorian)
/* }}} */
/* {{{ proto int frenchtojd(int month, int day, int year)
Converts a french republic calendar date to julian day count */
Convert a french republic calendar date to julian day count */
PHP_FUNCTION(frenchtojd)
{
pval **year, **month, **day;
@@ -445,7 +443,7 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(day);
convert_to_long_ex(year);
jdate = FrenchToSdn(Z_LVAL_PP(year), Z_LVAL_PP(month), Z_LVAL_PP(day));
jdate = FrenchToSdn((*year)->value.lval, (*month)->value.lval, (*day)->value.lval);
RETURN_LONG(jdate);
}
@@ -467,10 +465,10 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long(julday);
if(myargc==2) {
convert_to_long(mode);
mymode = Z_LVAL_P(mode);
mymode = mode->value.lval;
}
day = DayOfWeek(Z_LVAL_P(julday));
day = DayOfWeek(julday->value.lval);
daynamel = DayNameLong[day];
daynames = DayNameShort[day];
@@ -504,30 +502,30 @@ PHP_FUNCTION(jdtogregorian)
convert_to_long_ex(julday);
convert_to_long_ex(mode);
switch(Z_LVAL_PP(mode)) {
switch((*mode)->value.lval) {
case CAL_MONTH_GREGORIAN_LONG: /* gregorian or julian month */
SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day);
SdnToGregorian((*julday)->value.lval, &year, &month, &day);
monthname = MonthNameLong[month];
break;
case CAL_MONTH_JULIAN_SHORT: /* gregorian or julian month */
SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day);
SdnToJulian((*julday)->value.lval, &year, &month, &day);
monthname = MonthNameShort[month];
break;
case CAL_MONTH_JULIAN_LONG: /* gregorian or julian month */
SdnToJulian(Z_LVAL_PP(julday), &year, &month, &day);
SdnToJulian((*julday)->value.lval, &year, &month, &day);
monthname = MonthNameLong[month];
break;
case CAL_MONTH_JEWISH: /* jewish month */
SdnToJewish(Z_LVAL_PP(julday), &year, &month, &day);
SdnToJewish((*julday)->value.lval, &year, &month, &day);
monthname = JewishMonthName[month];
break;
case CAL_MONTH_FRENCH: /* french month */
SdnToFrench(Z_LVAL_PP(julday), &year, &month, &day);
SdnToFrench((*julday)->value.lval, &year, &month, &day);
monthname = FrenchMonthName[month];
break;
default: /* default gregorian */
case CAL_MONTH_GREGORIAN_SHORT: /* gregorian or julian month */
SdnToGregorian(Z_LVAL_PP(julday), &year, &month, &day);
SdnToGregorian((*julday)->value.lval, &year, &month, &day);
monthname = MonthNameShort[month];
break;
}
@@ -541,6 +539,6 @@ PHP_FUNCTION(jdtogregorian)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
-2
View File
@@ -1,6 +1,4 @@
dnl
dnl $Id$
dnl
PHP_ARG_ENABLE(calendar,whether to enable calendar conversion support,
[ --enable-calendar Enable support for calendar conversion])
+2 -2
View File
@@ -71,6 +71,6 @@ char *DayNameLong[7] =
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+6 -6
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -45,7 +45,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
WRONG_PARAM_COUNT;
}
convert_to_long(year_arg);
year = Z_LVAL_P(year_arg);
year = year_arg->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -109,12 +109,12 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, int gm)
te.tm_mday = easter-10;
}
Z_LVAL_P(return_value) = mktime(&te);
return_value->value.lval = mktime(&te);
} else { /* return the days after March 21 */
Z_LVAL_P(return_value) = easter;
return_value->value.lval = easter;
}
Z_TYPE_P(return_value) = IS_LONG;
return_value->type = IS_LONG;
}
+5 -5
View File
@@ -86,7 +86,7 @@
#include "sdncal.h"
#define FRENCH_SDN_OFFSET 2375474
#define SDN_OFFSET 2375474
#define DAYS_PER_4_YEARS 1461
#define DAYS_PER_MONTH 30
#define FIRST_VALID 2375840
@@ -107,7 +107,7 @@ void SdnToFrench(
*pDay = 0;
return;
}
temp = (sdn - FRENCH_SDN_OFFSET) * 4 - 1;
temp = (sdn - SDN_OFFSET) * 4 - 1;
*pYear = temp / DAYS_PER_4_YEARS;
dayOfYear = (temp % DAYS_PER_4_YEARS) / 4;
*pMonth = dayOfYear / DAYS_PER_MONTH + 1;
@@ -128,7 +128,7 @@ long int FrenchToSdn(
return ((year * DAYS_PER_4_YEARS) / 4
+ (month - 1) * DAYS_PER_MONTH
+ day
+ FRENCH_SDN_OFFSET);
+ SDN_OFFSET);
}
char *FrenchMonthName[14] =
@@ -155,6 +155,6 @@ char *FrenchMonthName[14] =
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+3 -3
View File
@@ -128,7 +128,7 @@
#include "sdncal.h"
#define GREGOR_SDN_OFFSET 32045
#define SDN_OFFSET 32045
#define DAYS_PER_5_MONTHS 153
#define DAYS_PER_4_YEARS 1461
#define DAYS_PER_400_YEARS 146097
@@ -152,7 +152,7 @@ void SdnToGregorian(
*pDay = 0;
return;
}
temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1;
temp = (sdn + SDN_OFFSET) * 4 - 1;
/* Calculate the century (year/100). */
century = temp / DAYS_PER_400_YEARS;
@@ -227,7 +227,7 @@ long int GregorianToSdn(
+ ((year % 100) * DAYS_PER_4_YEARS) / 4
+ (month * DAYS_PER_5_MONTHS + 2) / 5
+ inputDay
- GREGOR_SDN_OFFSET);
- SDN_OFFSET);
}
char *MonthNameShort[13] =
+6 -6
View File
@@ -267,7 +267,7 @@
#define HALAKIM_PER_LUNAR_CYCLE ((29 * HALAKIM_PER_DAY) + 13753)
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
#define JEWISH_SDN_OFFSET 347997
#define SDN_OFFSET 347997
#define NEW_MOON_OF_CREATION 31524
#define SUNDAY 0
@@ -497,13 +497,13 @@ void SdnToJewish(
int tishri1After;
int yearLength;
if (sdn <= JEWISH_SDN_OFFSET) {
if (sdn <= SDN_OFFSET) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
return;
}
inputDay = sdn - JEWISH_SDN_OFFSET;
inputDay = sdn - SDN_OFFSET;
FindTishriMolad(inputDay, &metonicCycle, &metonicYear, &day, &halakim);
tishri1 = Tishri1(metonicYear, day, halakim);
@@ -728,7 +728,7 @@ long int JewishToSdn(
return (0);
}
}
return (sdn + JEWISH_SDN_OFFSET);
return (sdn + SDN_OFFSET);
}
/*
@@ -736,6 +736,6 @@ long int JewishToSdn(
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+5 -5
View File
@@ -147,7 +147,7 @@
#include "sdncal.h"
#define JULIAN_SDN_OFFSET 32083
#define SDN_OFFSET 32083
#define DAYS_PER_5_MONTHS 153
#define DAYS_PER_4_YEARS 1461
@@ -169,7 +169,7 @@ void SdnToJulian(
*pDay = 0;
return;
}
temp = (sdn + JULIAN_SDN_OFFSET) * 4 - 1;
temp = (sdn + SDN_OFFSET) * 4 - 1;
/* Calculate the year and day of year (1 <= dayOfYear <= 366). */
year = temp / DAYS_PER_4_YEARS;
@@ -236,7 +236,7 @@ long int JulianToSdn(
return ((year * DAYS_PER_4_YEARS) / 4
+ (month * DAYS_PER_5_MONTHS + 2) / 5
+ inputDay
- JULIAN_SDN_OFFSET);
- SDN_OFFSET);
}
/*
@@ -244,6 +244,6 @@ long int JulianToSdn(
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+58 -60
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Brendan W. McAdams <bmcadams@php.net> |
| Doug DeJulio <ddj@redhat.com> |
| Authors: Brendan W. McAdams <bmcadams@php.net> |
| Doug DeJulio <ddj@redhat.com> |
+----------------------------------------------------------------------+
*/
/*
@@ -97,23 +97,21 @@ static char const cvsid[] = "$Id$";
/* Declare our module to the Zend engine */
zend_module_entry ccvs_module_entry = {
STANDARD_MODULE_HEADER,
"CCVS",
ccvs_functions,
NULL, NULL, NULL, NULL,
PHP_MINFO(ccvs),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_CCVS
ZEND_GET_MODULE(ccvs)
#ifdef COMPILE_DL_LDAP
ZEND_GET_MODULE(ldap)
#endif
/* Full Functions (The actual CCVS functions and any internal php hooked functions such as MINFO) */
/* {{{ proto string ccvs_init(string name)
Initialize CCVS for use */
??? */
PHP_FUNCTION(ccvs_init) /* cv_init() */
{
zval **name;
@@ -128,7 +126,7 @@ PHP_FUNCTION(ccvs_init) /* cv_init() */
convert_to_string_ex(name);
vsess = cv_init(Z_STRVAL_PP(name));
vsess = cv_init((*name)->value.str.val);
/*
* -- In the case that we don't run error checking on the return value... --
@@ -161,7 +159,7 @@ PHP_FUNCTION(ccvs_init) /* cv_init() */
/* }}} */
/* {{{ proto string ccvs_done(string sess)
Terminate CCVS engine and do cleanup work */
??? */
PHP_FUNCTION(ccvs_done) /* cv_done() */
{
zval **sess;
@@ -175,7 +173,7 @@ PHP_FUNCTION(ccvs_done) /* cv_done() */
convert_to_string_ex(sess);
/* Convert from the string representation back to a (void*) */
vsess = hks_ptr_stringtoptr(Z_STRVAL_PP(sess));
vsess = hks_ptr_stringtoptr((*sess)->value.str.val);
cv_done(vsess);
RETURN_STRING("OK", 1);
@@ -183,7 +181,7 @@ PHP_FUNCTION(ccvs_done) /* cv_done() */
/* }}} */
/* {{{ proto string ccvs_new(string session, string invoice)
Create a new, blank transaction */
??? */
PHP_FUNCTION(ccvs_new) /* cv_new() */
{
zval **psess;
@@ -203,10 +201,10 @@ PHP_FUNCTION(ccvs_new) /* cv_new() */
RETURN_FALSE;
}
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
convert_to_string_ex(pinvoice);
invoice = Z_STRVAL_PP(pinvoice);
invoice = (*pinvoice)->value.str.val;
r = cv_new(sess, invoice);
@@ -215,7 +213,7 @@ PHP_FUNCTION(ccvs_new) /* cv_new() */
/* }}} */
/* {{{ proto string ccvs_add(string session, string invoice, string argtype, string argval)
Add data to a transaction */
??? */
PHP_FUNCTION(ccvs_add) /* cv_add() */
{
zval **psess;
@@ -238,10 +236,10 @@ PHP_FUNCTION(ccvs_add) /* cv_add() */
convert_to_string_ex(pinvoice);
convert_to_string_ex(pargtype);
convert_to_string_ex(pargval);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
invoice = Z_STRVAL_PP(pinvoice);
argtype = cv_str2arg(Z_STRVAL_PP(pargtype));
argval = Z_STRVAL_PP(pargval);
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
invoice = (*pinvoice)->value.str.val;
argtype = cv_str2arg((*pargtype)->value.str.val);
argval = (*pargval)->value.str.val;
r = cv_add(sess, invoice, argtype, argval);
@@ -260,7 +258,7 @@ PHP_FUNCTION(ccvs_add) /* cv_add() */
*/
/* {{{ proto string ccvs_delete(string session, string invoice)
Delete a transaction */
??? */
PHP_FUNCTION(ccvs_delete) /* cv_delete() */
{
zval **psess;
@@ -276,8 +274,8 @@ PHP_FUNCTION(ccvs_delete) /* cv_delete() */
convert_to_string_ex(psess);
convert_to_string_ex(pinvoice);
invoice = Z_STRVAL_PP(pinvoice);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
invoice = (*pinvoice)->value.str.val;
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
r = cv_delete(sess, invoice);
@@ -286,7 +284,7 @@ PHP_FUNCTION(ccvs_delete) /* cv_delete() */
/* }}} */
/* {{{ proto string ccvs_auth(string session, string invoice)
Perform credit authorization test on a transaction */
??? */
PHP_FUNCTION(ccvs_auth) /* cv_auth() */
{
zval **psess;
@@ -302,8 +300,8 @@ PHP_FUNCTION(ccvs_auth) /* cv_auth() */
convert_to_string_ex(psess);
convert_to_string_ex(pinvoice);
invoice = Z_STRVAL_PP(pinvoice);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
invoice = (*pinvoice)->value.str.val;
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
r = cv_auth(sess, invoice);
@@ -312,7 +310,7 @@ PHP_FUNCTION(ccvs_auth) /* cv_auth() */
/* }}} */
/* {{{ proto string ccvs_return(string session, string invoice)
Transfer funds from the merchant to the credit card holder */
??? */
PHP_FUNCTION(ccvs_return) /* cv_return() */
{
zval **psess;
@@ -328,8 +326,8 @@ PHP_FUNCTION(ccvs_return) /* cv_return() */
convert_to_string_ex(psess);
convert_to_string_ex(pinvoice);
invoice = Z_STRVAL_PP(pinvoice);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
invoice = (*pinvoice)->value.str.val;
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
r = cv_return(sess, invoice);
@@ -338,7 +336,7 @@ PHP_FUNCTION(ccvs_return) /* cv_return() */
/* }}} */
/* {{{ proto string ccvs_reverse(string session, string invoice)
Perform a full reversal on an already-processed authorization */
??? */
PHP_FUNCTION(ccvs_reverse) /* cv_reverse() */
{
zval **psess;
@@ -354,8 +352,8 @@ PHP_FUNCTION(ccvs_reverse) /* cv_reverse() */
convert_to_string_ex(psess);
convert_to_string_ex(pinvoice);
invoice = Z_STRVAL_PP(pinvoice);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
invoice = (*pinvoice)->value.str.val;
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
r = cv_reverse(sess, invoice);
@@ -364,7 +362,7 @@ PHP_FUNCTION(ccvs_reverse) /* cv_reverse() */
/* }}} */
/* {{{ proto string ccvs_sale(string session, string invoice)
Transfer funds from the credit card holder to the merchant */
??? */
PHP_FUNCTION(ccvs_sale) /* cv_sale() */
{
zval **psess;
@@ -380,8 +378,8 @@ PHP_FUNCTION(ccvs_sale) /* cv_sale() */
convert_to_string_ex(psess);
convert_to_string_ex(pinvoice);
invoice = Z_STRVAL_PP(pinvoice);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
invoice = (*pinvoice)->value.str.val;
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
r = cv_sale(sess, invoice);
@@ -390,7 +388,7 @@ PHP_FUNCTION(ccvs_sale) /* cv_sale() */
/* }}} */
/* {{{ proto string ccvs_void(string session, string invoice)
Perform a full reversal on a completed transaction */
??? */
PHP_FUNCTION(ccvs_void) /* cv_void() */
{
zval **psess;
@@ -406,8 +404,8 @@ PHP_FUNCTION(ccvs_void) /* cv_void() */
convert_to_string_ex(psess);
convert_to_string_ex(pinvoice);
invoice = Z_STRVAL_PP(pinvoice);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
invoice = (*pinvoice)->value.str.val;
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
r = cv_void(sess, invoice);
@@ -416,7 +414,7 @@ PHP_FUNCTION(ccvs_void) /* cv_void() */
/* }}} */
/* {{{ proto string ccvs_status(string session, string invoice)
Check the status of an invoice */
??? */
PHP_FUNCTION(ccvs_status) /* cv_status() */
{
zval **psess;
@@ -432,8 +430,8 @@ PHP_FUNCTION(ccvs_status) /* cv_status() */
convert_to_string_ex(psess);
convert_to_string_ex(pinvoice);
invoice = Z_STRVAL_PP(pinvoice);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
invoice = (*pinvoice)->value.str.val;
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
r = cv_status(sess, invoice);
@@ -442,7 +440,7 @@ PHP_FUNCTION(ccvs_status) /* cv_status() */
/* }}} */
/* {{{ proto int ccvs_count(string session, string type)
Find out how many transactions of a given type are stored in the system */
??? */
PHP_FUNCTION(ccvs_count) /* cv_count() */
{
zval **psess;
@@ -458,8 +456,8 @@ PHP_FUNCTION(ccvs_count) /* cv_count() */
convert_to_string_ex(psess);
convert_to_string_ex(ptype);
type = cv_str2stat(Z_STRVAL_PP(ptype));
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
type = cv_str2stat((*ptype)->value.str.val);
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
r = cv_count(sess, type);
@@ -468,7 +466,7 @@ PHP_FUNCTION(ccvs_count) /* cv_count() */
/* }}} */
/* {{{ proto string ccvs_lookup(string session, string invoice, int inum)
Look up an item of a particular type in the database */
??? */
PHP_FUNCTION(ccvs_lookup) /* cv_lookup() */
{
zval **psess;
@@ -485,11 +483,11 @@ PHP_FUNCTION(ccvs_lookup) /* cv_lookup() */
}
convert_to_string_ex(psess);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
convert_to_string_ex(ptype);
type = cv_str2stat(Z_STRVAL_PP(ptype));
type = cv_str2stat((*ptype)->value.str.val);
convert_to_long_ex(pinum);
inum = Z_LVAL_PP(pinum);
inum = (*pinum)->value.lval;
r = cv_lookup(sess, type, inum);
@@ -498,7 +496,7 @@ PHP_FUNCTION(ccvs_lookup) /* cv_lookup() */
/* }}} */
/* {{{ proto string ccvs_report(string session, string type)
Return the status of the background communication process */
??? */
PHP_FUNCTION(ccvs_report) /* cv_report() */
{
zval **psess;
@@ -514,9 +512,9 @@ PHP_FUNCTION(ccvs_report) /* cv_report() */
}
convert_to_string_ex(psess);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
convert_to_string_ex(ptype);
type = cv_str2rep(Z_STRVAL_PP(ptype));
type = cv_str2rep((*ptype)->value.str.val);
r = cv_report(sess, type);
@@ -525,7 +523,7 @@ PHP_FUNCTION(ccvs_report) /* cv_report() */
/* }}} */
/* {{{ proto string ccvs_command(string session, string type, string argval)
Performs a command which is peculiar to a single protocol, and thus is not available in the general CCVS API */
??? */
PHP_FUNCTION(ccvs_command) /* cv_command() */
{
zval **psess;
@@ -542,11 +540,11 @@ PHP_FUNCTION(ccvs_command) /* cv_command() */
}
convert_to_string_ex(psess);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
convert_to_string_ex(ptype);
type = cv_str2cmd(Z_STRVAL_PP(ptype));
type = cv_str2cmd((*ptype)->value.str.val);
convert_to_string_ex(pargval);
argval = Z_STRVAL_PP(pargval);
argval = (*pargval)->value.str.val;
r = cv_command(sess, type, argval);
@@ -555,7 +553,7 @@ PHP_FUNCTION(ccvs_command) /* cv_command() */
/* }}} */
/* {{{ proto string ccvs_textvalue(string session)
Get text return value for previous function call */
??? */
PHP_FUNCTION(ccvs_textvalue) /* cv_textvalue() */
{
zval **psess;
@@ -567,7 +565,7 @@ PHP_FUNCTION(ccvs_textvalue) /* cv_textvalue() */
}
convert_to_string_ex(psess);
sess = hks_ptr_stringtoptr(Z_STRVAL_PP(psess));
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
RETURN_STRING(cv_textvalue(sess), 1);
}
@@ -582,7 +580,7 @@ PHP_MINFO_FUNCTION(ccvs)
{
php_info_print_table_start();
php_info_print_table_header(2, "RedHat CCVS support", "enabled");
php_info_print_table_row(2, "CCVS Support by", "Brendan W. McAdams &lt;bmcadams@php.net&gt;<br />&amp; Doug DeJulio &lt;ddj@redhat.com&gt;");
php_info_print_table_row(2, "CCVS Support by", "Brendan W. McAdams &lt;bmcadams@php.net&gt;<br>&amp; Doug DeJulio &lt;ddj@redhat.com&gt;");
php_info_print_table_row(2, "Release ID", cvsid);
php_info_print_table_row(2, "This Release Certified For CCVS Versions", "3.0 and greater");
php_info_print_table_end();
@@ -602,6 +600,6 @@ PHP_MINFO_FUNCTION(ccvs)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+4 -4
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,8 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Brendan W. McAdams <bmcadams@php.net> |
| Doug DeJulio <ddj@redhat.com> |
| Authors: Brendan W. McAdams <bmcadams@php.net> |
| Doug DeJulio <ddj@redhat.com> |
+----------------------------------------------------------------------+
*/
+1 -2
View File
@@ -1,6 +1,5 @@
dnl
dnl $Id$
dnl
dnl config.m4 for PHP4 CCVS Extension
PHP_ARG_WITH(ccvs, for CCVS support,
[ --with-ccvs[=DIR] Include CCVS support])
+109 -762
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,2 +1,2 @@
Win32 COM
Alan Brown, Wez Furlong, Harald Radi, Zeev Suraski
Zeev Suraski, Harald Radi, Alan Brown
-27
View File
@@ -1,27 +0,0 @@
1) Multi-dimenstional array support
-- done 2) IErrorInfo
-- done 13) export VARIANT through the COM module
14) trap exceptions and errors
3) WithEvents
4) Documentation (internal and user) and howtos
5) IEnumVariant::All() which would be like IEnumVariant::Next(IDispatch::Count)
6) Look for memory leaks and AdRef/Release problems - I KNOW there are some...
7) Test component (goes with the docs)
8) Test suite (Needs test component)
9) reduce the need for VARIANT()
10) lets try if we are able to call non IDispatch - only Typelib components
-- done 11) IEnumVariant::Next() without parameter should only return an object, not an array with one element
-- done 12) VARIANT->value as lvalue
ad 6.) check vbsample.php (new VARIANT(*, *|VT_BYREF)) GPs
ad 4.) faq (i've collected a few questions from various lists)
variant attributes !!
to be discussed:
- dcom inporc issue
- mts support (getcontext)
- adsi support (ads* functions)
- winapi interface
- try serialisation support (if component implements IPersist)
+75 -54
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -45,7 +45,25 @@ static int codepage;
static zend_class_entry VARIANT_class_entry;
void php_VARIANT_init(int module_number TSRMLS_DC)
function_entry VARIANT_functions[] = {
{NULL, NULL, NULL}
};
static PHP_MINFO_FUNCTION(VARIANT)
{
php_info_print_table_start();
php_info_print_table_row(2, "VARIANT support", "enabled");
php_info_print_table_end();
}
zend_module_entry VARIANT_module_entry = {
"variant", VARIANT_functions, PHP_MINIT(VARIANT), PHP_MSHUTDOWN(VARIANT), NULL, NULL, PHP_MINFO(VARIANT), STANDARD_MODULE_PROPERTIES
};
PHP_MINIT_FUNCTION(VARIANT)
{
le_variant = zend_register_list_destructors_ex(php_VARIANT_destructor, NULL, "VARIANT", module_number);
@@ -60,7 +78,7 @@ void php_VARIANT_init(int module_number TSRMLS_DC)
REGISTER_LONG_CONSTANT("VT_BOOL", VT_BOOL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("VT_ERROR", VT_ERROR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("VT_CY", VT_CY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("VT_DATE", VT_DATE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("VT_DATE", VT_CY, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("VT_BSTR", VT_BSTR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("VT_DECIMAL", VT_DECIMAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("VT_UNKNOWN", VT_UNKNOWN, CONST_CS | CONST_PERSISTENT);
@@ -80,7 +98,6 @@ void php_VARIANT_init(int module_number TSRMLS_DC)
REGISTER_LONG_CONSTANT("CP_OEMCP", CP_OEMCP, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CP_UTF7", CP_UTF7, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CP_UTF8", CP_UTF8, CONST_CS | CONST_PERSISTENT);
#ifdef CP_SYMBOL
REGISTER_LONG_CONSTANT("CP_SYMBOL", CP_SYMBOL, CONST_CS | CONST_PERSISTENT);
#else
@@ -93,6 +110,13 @@ void php_VARIANT_init(int module_number TSRMLS_DC)
#endif
php_register_VARIANT_class(TSRMLS_C);
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(VARIANT)
{
return SUCCESS;
}
@@ -133,7 +157,7 @@ static void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend
zend_get_parameters(ht, 3, &data, &type, &code_page);
php_pval_to_variant_ex(data, pVar, type, codepage TSRMLS_CC);
convert_to_long(code_page);
codepage = Z_LVAL_P(code_page);
codepage = code_page->value.lval;
break;
default:
ZEND_WRONG_PARAM_COUNT();
@@ -174,14 +198,13 @@ static pval php_VARIANT_get_property_handler(zend_property_reference *property_r
ZVAL_FALSE(&result);
} else {
overloaded_property = (zend_overloaded_element *) property_reference->elements_list->head->data;
switch (Z_TYPE_P(overloaded_property)) {
switch (overloaded_property->type) {
case OE_IS_ARRAY:
ZVAL_FALSE(&result);
break;
case OE_IS_OBJECT:
if (!strcmp(Z_STRVAL(overloaded_property->element), "value")) {
// var_arg can't be an idispatch, so we don't care for the implicit AddRef() call here
if (!strcmp(overloaded_property->element.value.str.val, "value")) {
php_variant_to_pval(var_arg, &result, codepage TSRMLS_CC);
} else if (!strcmp(Z_STRVAL(overloaded_property->element), "type")) {
ZVAL_LONG(&result, V_VT(var_arg))
@@ -229,96 +252,94 @@ static int php_VARIANT_set_property_handler(zend_property_reference *property_re
static int do_VARIANT_propset(VARIANT *var_arg, pval *arg_property, pval *value TSRMLS_DC)
{
int type;
pval type;
if (!strcmp(Z_STRVAL_P(arg_property), "value")) {
php_pval_to_variant(value, var_arg, codepage TSRMLS_CC);
Z_TYPE(type) = IS_STRING;
return SUCCESS;
} else if (!strcmp(Z_STRVAL_P(arg_property), "bVal")) {
type = VT_UI1;
if (!strcmp(Z_STRVAL_P(arg_property), "bVal")) {
Z_LVAL(type) = VT_UI1;
} else if (!strcmp(Z_STRVAL_P(arg_property), "iVal")) {
type = VT_I2;
Z_LVAL(type) = VT_I2;
} else if (!strcmp(Z_STRVAL_P(arg_property), "lVal")) {
type = VT_I4;
Z_LVAL(type) = VT_I4;
} else if (!strcmp(Z_STRVAL_P(arg_property), "fltVal")) {
type = VT_R4;
Z_LVAL(type) = VT_R4;
} else if (!strcmp(Z_STRVAL_P(arg_property), "dblVal")) {
type = VT_R8;
Z_LVAL(type) = VT_R8;
} else if (!strcmp(Z_STRVAL_P(arg_property), "boolVal")) {
type = VT_BOOL;
Z_LVAL(type) = VT_BOOL;
} else if (!strcmp(Z_STRVAL_P(arg_property), "scode")) {
type = VT_ERROR;
Z_LVAL(type) = VT_ERROR;
} else if (!strcmp(Z_STRVAL_P(arg_property), "cyVal")) {
type = VT_CY;
Z_LVAL(type) = VT_CY;
} else if (!strcmp(Z_STRVAL_P(arg_property), "date")) {
type = VT_DATE;
Z_LVAL(type) = VT_DATE;
} else if (!strcmp(Z_STRVAL_P(arg_property), "bstrVal")) {
type = VT_BSTR;
Z_LVAL(type) = VT_BSTR;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pdecVal")) {
type = VT_DECIMAL|VT_BYREF;
Z_LVAL(type) = VT_DECIMAL|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "punkVal")) {
type = VT_UNKNOWN;
Z_LVAL(type) = VT_UNKNOWN;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pdispVal")) {
type = VT_DISPATCH;
Z_LVAL(type) = VT_DISPATCH;
} else if (!strcmp(Z_STRVAL_P(arg_property), "parray")) {
type = VT_ARRAY;
Z_LVAL(type) = VT_ARRAY;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pbVal")) {
type = VT_UI1|VT_BYREF;
Z_LVAL(type) = VT_UI1|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "piVal")) {
type = VT_I2|VT_BYREF;
Z_LVAL(type) = VT_I2|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "plVal")) {
type = VT_I4|VT_BYREF;
Z_LVAL(type) = VT_I4|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pfltVal")) {
type = VT_R4|VT_BYREF;
Z_LVAL(type) = VT_R4|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pdblVal")) {
type = VT_R8|VT_BYREF;
Z_LVAL(type) = VT_R8|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pboolVal")) {
type = VT_BOOL|VT_BYREF;
Z_LVAL(type) = VT_BOOL|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pscode")) {
type = VT_ERROR|VT_BYREF;
Z_LVAL(type) = VT_ERROR|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pcyVal")) {
type = VT_CY|VT_BYREF;
Z_LVAL(type) = VT_CY|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pdate")) {
type = VT_DATE|VT_BYREF;
Z_LVAL(type) = VT_DATE|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pbstrVal")) {
type = VT_BSTR|VT_BYREF;
Z_LVAL(type) = VT_BSTR|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "ppunkVal")) {
type = VT_UNKNOWN|VT_BYREF;
Z_LVAL(type) = VT_UNKNOWN|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "ppdispVal")) {
type = VT_DISPATCH|VT_BYREF;
Z_LVAL(type) = VT_DISPATCH|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pparray")) {
type = VT_ARRAY|VT_BYREF;
Z_LVAL(type) = VT_ARRAY|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pvarVal")) {
type = VT_VARIANT|VT_BYREF;
Z_LVAL(type) = VT_VARIANT|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "byref")) {
type = VT_BYREF;
Z_LVAL(type) = VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "cVal")) {
type = VT_I1;
Z_LVAL(type) = VT_I1;
} else if (!strcmp(Z_STRVAL_P(arg_property), "uiVal")) {
type = VT_UI2;
Z_LVAL(type) = VT_UI2;
} else if (!strcmp(Z_STRVAL_P(arg_property), "ulVal")) {
type = VT_UI4;
Z_LVAL(type) = VT_UI4;
} else if (!strcmp(Z_STRVAL_P(arg_property), "intVal")) {
type = VT_INT;
Z_LVAL(type) = VT_INT;
} else if (!strcmp(Z_STRVAL_P(arg_property), "uintVal")) {
type = VT_UINT|VT_BYREF;
Z_LVAL(type) = VT_UINT|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pcVal")) {
type = VT_I1|VT_BYREF;
Z_LVAL(type) = VT_I1|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "puiVal")) {
type = VT_UI2|VT_BYREF;
Z_LVAL(type) = VT_UI2|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pulVal")) {
type = VT_UI4|VT_BYREF;
Z_LVAL(type) = VT_UI4|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "pintVal")) {
type = VT_INT|VT_BYREF;
Z_LVAL(type) = VT_INT|VT_BYREF;
} else if (!strcmp(Z_STRVAL_P(arg_property), "puintVal")) {
type = VT_UINT|VT_BYREF;
Z_LVAL(type) = VT_UINT|VT_BYREF;
} else {
php_error(E_WARNING, "Unknown member.");
return FAILURE;
}
php_pval_to_variant_ex2(value, var_arg, type, codepage TSRMLS_CC);
php_pval_to_variant_ex(value, var_arg, &type, codepage TSRMLS_CC);
return SUCCESS;
}
+6 -14
View File
@@ -19,28 +19,20 @@ typedef struct comval_ {
ITypeInfo *typeinfo;
IEnumVARIANT *enumvariant;
} i;
IDispatch *sinkdispatch;
GUID sinkid;
DWORD sinkcookie;
} comval;
END_EXTERN_C()
#define ZVAL_COM(z,o) { \
zval *handle = NULL; \
ZVAL_COM_EX(z,o,handle) \
}
#define ZVAL_COM_EX(z,o,handle) { \
zval *handle; \
HashTable *properties; \
\
ALLOC_HASHTABLE(properties); \
zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \
\
if (handle == NULL) { \
MAKE_STD_ZVAL(handle); \
} \
ZVAL_RESOURCE(handle, zend_list_insert((o), IS_COM)); \
ALLOC_ZVAL(handle); \
INIT_PZVAL(handle); \
ZVAL_LONG(handle, zend_list_insert((o), IS_COM)); \
\
zval_copy_ctor(handle); \
zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \
@@ -51,10 +43,10 @@ END_EXTERN_C()
#define RETURN_COM(o) RETVAL_COM(o) \
return;
#define ALLOC_COM(z) (z) = (comval *) ecalloc(1, sizeof(comval)); \
#define ALLOC_COM(z) (z) = (comval *) emalloc(sizeof(comval)); \
C_REFCOUNT(z) = 0;
#define FREE_COM(z) php_COM_destruct(z TSRMLS_CC);
#define FREE_COM(z) efree(z);
#define IS_COM php_COM_get_le_comval()
+52 -115
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -37,6 +37,7 @@
/* prototypes */
static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int codepage TSRMLS_DC);
static void comval_to_variant(pval *pval_arg, VARIANT *var_arg TSRMLS_DC);
/* implementations */
@@ -56,7 +57,7 @@ PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage T
case IS_OBJECT:
if (!strcmp(Z_OBJCE_P(pval_arg)->name, "VARIANT")) {
type = VT_VARIANT|VT_BYREF;
} else {
} else if (!strcmp(Z_OBJCE_P(pval_arg)->name, "COM")) {
type = VT_DISPATCH;
}
break;
@@ -84,17 +85,21 @@ PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage T
break;
}
php_pval_to_variant_ex2(pval_arg, var_arg, type, codepage TSRMLS_CC);
if (pval_arg->is_ref) { /* deprecated, implemented for downwards compatiblity */
// type |= VT_BYREF;
}
pval_to_variant_ex(pval_arg, var_arg, type, codepage TSRMLS_CC);
}
PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type, int codepage TSRMLS_DC)
{
php_pval_to_variant_ex2(pval_arg, var_arg, Z_LVAL_P(pval_type), codepage TSRMLS_CC);
pval_to_variant_ex(pval_arg, var_arg, Z_LVAL_P(pval_type), codepage TSRMLS_CC);
}
PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type, int codepage TSRMLS_DC)
static void pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, int type, int codepage TSRMLS_DC)
{
OLECHAR *unicode_str;
@@ -138,7 +143,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
/* Add another value to the safe array */
if (SUCCEEDED(SafeArrayPtrOfIndex( safeArray, &i, &v))) { /* Pointer to output element entry retrieved successfully */
if (type) { /* explicit type */
php_pval_to_variant_ex2(*entry, v, type, codepage TSRMLS_CC); /* Do the required conversion */
pval_to_variant_ex(*entry, v, type, codepage TSRMLS_CC); /* Do the required conversion */
} else {
php_pval_to_variant(*entry, v, codepage TSRMLS_CC); /* Do the required conversion */
}
@@ -155,20 +160,14 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
}
} else {
switch (V_VT(var_arg)) {
case VT_NULL:
case VT_VOID:
ZVAL_NULL(pval_arg);
break;
case VT_UI1:
convert_to_long_ex(&pval_arg);
V_UI1(var_arg) = (unsigned char) Z_LVAL_P(pval_arg);
V_UI1(var_arg) = (unsigned char)Z_LVAL_P(pval_arg);
break;
case VT_I2:
convert_to_long_ex(&pval_arg);
V_I2(var_arg) = (short) Z_LVAL_P(pval_arg);
V_I2(var_arg) = (short)Z_LVAL_P(pval_arg);
break;
case VT_I4:
@@ -178,7 +177,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
case VT_R4:
convert_to_double_ex(&pval_arg);
V_R4(var_arg) = (float) Z_DVAL_P(pval_arg);
V_R4(var_arg) = (float)Z_DVAL_P(pval_arg);
break;
case VT_R8:
@@ -188,11 +187,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
case VT_BOOL:
convert_to_boolean_ex(&pval_arg);
if (Z_LVAL_P(pval_arg)) {
V_BOOL(var_arg) = VT_TRUE;
} else {
V_BOOL(var_arg) = VT_FALSE;
}
V_BOOL(var_arg) = (short)Z_LVAL_P(pval_arg);
break;
case VT_ERROR:
@@ -209,40 +204,24 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
SYSTEMTIME wintime;
struct tm *phptime;
switch (Z_TYPE_P(pval_arg)) {
case IS_DOUBLE:
/* already a VariantTime value */
V_DATE(var_arg) = Z_DVAL_P(pval_arg);
break;
phptime = gmtime(&(pval_arg->value.lval));
memset(&wintime, 0, sizeof(wintime));
/** @todo
case IS_STRING:
*/
/* string representation of a time value */
wintime.wYear = phptime->tm_year + 1900;
wintime.wMonth = phptime->tm_mon + 1;
wintime.wDay = phptime->tm_mday;
wintime.wHour = phptime->tm_hour;
wintime.wMinute = phptime->tm_min;
wintime.wSecond = phptime->tm_sec;
default:
/* a PHP time value ? */
convert_to_long_ex(&pval_arg);
phptime = gmtime(&(Z_LVAL_P(pval_arg)));
memset(&wintime, 0, sizeof(wintime));
wintime.wYear = phptime->tm_year + 1900;
wintime.wMonth = phptime->tm_mon + 1;
wintime.wDay = phptime->tm_mday;
wintime.wHour = phptime->tm_hour;
wintime.wMinute = phptime->tm_min;
wintime.wSecond = phptime->tm_sec;
SystemTimeToVariantTime(&wintime, &V_DATE(var_arg));
break;
}
SystemTimeToVariantTime(&wintime, &V_DATE(var_arg));
}
break;
case VT_BSTR:
convert_to_string_ex(&pval_arg);
unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC);
V_BSTR(var_arg) = SysAllocStringByteLen((char *) unicode_str, Z_STRLEN_P(pval_arg) * sizeof(OLECHAR));
V_BSTR(var_arg) = SysAllocString(unicode_str);
efree(unicode_str);
break;
@@ -269,14 +248,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
break;
case VT_DISPATCH:
if (!strcmp(Z_OBJCE_P(pval_arg)->name, "COM")) {
comval_to_variant(pval_arg, var_arg TSRMLS_CC);
} else {
V_DISPATCH(var_arg) = php_COM_export_object(pval_arg TSRMLS_CC);
if (V_DISPATCH(var_arg)) {
V_VT(var_arg) = VT_DISPATCH;
}
}
comval_to_variant(pval_arg, var_arg TSRMLS_CC);
if (V_VT(var_arg) != VT_DISPATCH) {
VariantInit(var_arg);
}
@@ -309,13 +281,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
case VT_BOOL|VT_BYREF:
convert_to_boolean(pval_arg);
/* emalloc or malloc ? */
V_BOOLREF(var_arg) = (short FAR*) pemalloc(sizeof(short), 1);
if (Z_LVAL_P(pval_arg)) {
*V_BOOLREF(var_arg) = VT_TRUE;
} else {
*V_BOOLREF(var_arg) = VT_TRUE;
}
V_BOOLREF(var_arg) = (short FAR*) &Z_LVAL_P(pval_arg);
break;
case VT_ERROR|VT_BYREF:
@@ -325,14 +291,14 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
case VT_CY|VT_BYREF:
convert_to_double_ex(&pval_arg);
VarCyFromR8(Z_DVAL_P(pval_arg), var_arg->pcyVal);
VarCyFromR8(pval_arg->value.dval, var_arg->pcyVal);
break;
case VT_DATE|VT_BYREF: {
SYSTEMTIME wintime;
struct tm *phptime;
phptime = gmtime(&(Z_LVAL_P(pval_arg)));
phptime = gmtime(&(pval_arg->value.lval));
memset(&wintime, 0, sizeof(wintime));
wintime.wYear = phptime->tm_year + 1900;
@@ -394,7 +360,8 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
/*
should be, but isn't :)
if (V_VT(var_arg) != (VT_VARIANT|VT_BYREF)) {
if (V_VT(var_arg) != (VT_VARIANT|VT_BYREF))
{
VariantInit(var_arg);
}
*/
@@ -451,7 +418,7 @@ PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type,
break;
default:
php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg));
php_error(E_WARNING, "Type not supported or not yet implemented.");
}
}
}
@@ -620,17 +587,9 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TS
case VT_BOOL:
if (V_ISBYREF(var_arg)) {
if (*V_BOOLREF(var_arg)) {
ZVAL_BOOL(pval_arg, Z_TRUE);
} else {
ZVAL_BOOL(pval_arg, Z_FALSE);
}
ZVAL_BOOL(pval_arg, *V_BOOLREF(var_arg));
} else {
if (V_BOOL(var_arg)) {
ZVAL_BOOL(pval_arg, Z_TRUE);
} else {
ZVAL_BOOL(pval_arg, Z_FALSE);
}
ZVAL_BOOL(pval_arg, V_BOOL(var_arg));
}
break;
@@ -644,22 +603,14 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TS
break;
case VT_BSTR:
Z_TYPE_P(pval_arg) = IS_STRING;
if (V_ISBYREF(var_arg)) {
if (*V_BSTR(var_arg)) {
Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(*V_BSTRREF(var_arg), &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC);
} else {
ZVAL_NULL(pval_arg);
}
Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(*V_BSTRREF(var_arg), &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC);
efree(V_BSTRREF(var_arg));
} else {
if (V_BSTR(var_arg)) {
Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(V_BSTR(var_arg), &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC);
} else {
ZVAL_NULL(pval_arg);
}
Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(V_BSTR(var_arg), &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC);
}
Z_TYPE_P(pval_arg) = IS_STRING;
break;
case VT_DATE: {
@@ -700,7 +651,8 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TS
hr = V_UNKNOWN(var_arg)->lpVtbl->QueryInterface(var_arg->punkVal, &IID_IDispatch, &V_DISPATCH(var_arg));
if (FAILED(hr)) {
if (FAILED(hr))
{
char *error_message;
error_message = php_COM_error_message(hr TSRMLS_CC);
@@ -719,10 +671,9 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TS
ZVAL_NULL(pval_arg);
} else {
ALLOC_COM(obj);
php_COM_set(obj, &V_DISPATCH(var_arg), FALSE TSRMLS_CC);
php_COM_set(obj, &V_DISPATCH(var_arg), TRUE TSRMLS_CC);
ZVAL_COM(pval_arg, obj);
VariantInit(var_arg); // to protect C_DISPATCH(obj) from being freed when var_result is destructed
}
}
break;
@@ -779,40 +730,26 @@ PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TS
PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRMLS_DC)
{
BOOL error = FALSE;
OLECHAR *unicode_str;
if (strlen == -1) {
/* request needed buffersize */
strlen = MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, -1, NULL, 0);
} else {
/* \0 terminator */
strlen++;
}
/* request needed buffersize */
uint reqSize = MultiByteToWideChar(codepage, MB_PRECOMPOSED | MB_ERR_INVALID_CHARS, C_str, -1, NULL, 0);
if (strlen >= 0) {
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR) * strlen);
if (reqSize) {
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR) * reqSize);
/* convert string */
error = !MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, strlen, unicode_str, strlen);
MultiByteToWideChar(codepage, MB_PRECOMPOSED | MB_ERR_INVALID_CHARS, C_str, -1, unicode_str, reqSize);
} else {
/* return a zero-length string */
unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR));
*unicode_str = 0;
error = TRUE;
}
if (error) {
switch (GetLastError()) {
case ERROR_NO_UNICODE_TRANSLATION:
php_error(E_WARNING, "No unicode translation available for the specified string");
break;
case ERROR_INSUFFICIENT_BUFFER:
php_error(E_WARNING, "Internal Error: Insufficient Buffer");
php_error(E_WARNING,"No unicode translation available for the specified string");
break;
default:
php_error(E_WARNING, "Unknown error in php_char_to_OLECHAR()");
php_error(E_WARNING,"Error in php_char_to_OLECHAR()");
}
}
@@ -826,13 +763,13 @@ PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int cod
uint length = 0;
/* request needed buffersize */
uint reqSize = WideCharToMultiByte(codepage, codepage == CP_UTF8 ? 0 : WC_COMPOSITECHECK, unicode_str, -1, NULL, 0, NULL, NULL);
uint reqSize = WideCharToMultiByte(codepage, WC_COMPOSITECHECK, unicode_str, -1, NULL, 0, NULL, NULL);
if (reqSize) {
C_str = (char *) emalloc(sizeof(char) * reqSize);
/* convert string */
length = WideCharToMultiByte(codepage, codepage == CP_UTF8 ? 0 : WC_COMPOSITECHECK, unicode_str, -1, C_str, reqSize, NULL, NULL) - 1;
length = WideCharToMultiByte(codepage, WC_COMPOSITECHECK, unicode_str, -1, C_str, reqSize, NULL, NULL) - 1;
} else {
C_str = (char *) emalloc(sizeof(char));
*C_str = 0;
@@ -865,4 +802,4 @@ static void comval_to_variant(pval *pval_arg, VARIANT *var_arg TSRMLS_DC)
}
}
#endif /* PHP_WIN32 */
#endif /* PHP_WIN32 */
-9
View File
@@ -1,19 +1,10 @@
#ifndef CONVERSION_H
#define CONVERSION_H
/* isn't this defined somewhere else ? */
#define Z_TRUE 1
#define Z_FALSE 0
#define VT_TRUE -1
#define VT_FALSE 0
BEGIN_EXTERN_C()
PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage TSRMLS_DC);
PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type, int codepage TSRMLS_DC);
PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, int type, int codepage TSRMLS_DC);
PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TSRMLS_DC);
PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRMLS_DC);
PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int codepage TSRMLS_DC);
-627
View File
@@ -1,627 +0,0 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
/*
* This module is used to export PHP objects to COM and DOTNET by exposing
* them as objects implementing IDispatch.
* */
#include "php.h"
#include "php_COM.h"
#include "php_VARIANT.h"
#include "conversion.h"
#include "variant.h"
#define COBJMACROS
#include <unknwn.h> /* IDispatch */
#include <dispex.h> /* IDispatchEx */
typedef struct {
/* This first part MUST match the declaration
* of interface IDispatchEx */
CONST_VTBL struct IDispatchExVtbl *lpVtbl;
/* now the PHP stuff */
THREAD_T engine_thread; /* for sanity checking */
zval *object; /* the object exported */
LONG refcount; /* COM reference count */
HashTable *dispid_to_name; /* keep track of dispid -> name mappings */
HashTable *name_to_dispid; /* keep track of name -> dispid mappings */
GUID sinkid; /* iid that we "implement" for event sinking */
int id;
} php_dispatchex;
static void disp_destructor(php_dispatchex *disp);
static void dispatch_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
php_dispatchex *disp = (php_dispatchex *)rsrc->ptr;
disp_destructor(disp);
}
static int le_dispatch;
int php_COM_dispatch_init(int module_number TSRMLS_DC)
{
le_dispatch = zend_register_list_destructors_ex(dispatch_dtor, NULL, "COM:Dispatch", module_number);
return le_dispatch;
}
/* {{{ trace */
static inline void trace(char *fmt, ...)
{
va_list ap;
char buf[4096];
sprintf(buf, "T=%08x ", tsrm_thread_id());
OutputDebugString(buf);
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
OutputDebugString(buf);
va_end(ap);
}
/* }}} */
#define FETCH_DISP(methname) \
php_dispatchex *disp = (php_dispatchex*)This; \
trace(" PHP:%s %s\n", Z_OBJCE_P(disp->object)->name, methname); \
if (tsrm_thread_id() != disp->engine_thread) \
return E_UNEXPECTED;
static HRESULT STDMETHODCALLTYPE disp_queryinterface(
IDispatchEx *This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject)
{
FETCH_DISP("QueryInterface");
if (IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IDispatch, riid) ||
IsEqualGUID(&IID_IDispatchEx, riid) ||
IsEqualGUID(&disp->sinkid, riid)) {
*ppvObject = This;
InterlockedIncrement(&disp->refcount);
return S_OK;
}
*ppvObject = NULL;
return E_NOINTERFACE;
}
static ULONG STDMETHODCALLTYPE disp_addref(IDispatchEx *This)
{
FETCH_DISP("AddRef");
return InterlockedIncrement(&disp->refcount);
}
static ULONG STDMETHODCALLTYPE disp_release(IDispatchEx *This)
{
ULONG ret;
TSRMLS_FETCH();
FETCH_DISP("Release");
ret = InterlockedDecrement(&disp->refcount);
trace("-- refcount now %d\n", ret);
if (ret == 0) {
/* destroy it */
if (disp->id)
zend_list_delete(disp->id);
}
return ret;
}
static HRESULT STDMETHODCALLTYPE disp_gettypeinfocount(
IDispatchEx *This,
/* [out] */ UINT *pctinfo)
{
FETCH_DISP("GetTypeInfoCount");
*pctinfo = 0;
return S_OK;
}
static HRESULT STDMETHODCALLTYPE disp_gettypeinfo(
IDispatchEx *This,
/* [in] */ UINT iTInfo,
/* [in] */ LCID lcid,
/* [out] */ ITypeInfo **ppTInfo)
{
FETCH_DISP("GetTypeInfo");
*ppTInfo = NULL;
return DISP_E_BADINDEX;
}
static HRESULT STDMETHODCALLTYPE disp_getidsofnames(
IDispatchEx *This,
/* [in] */ REFIID riid,
/* [size_is][in] */ LPOLESTR *rgszNames,
/* [in] */ UINT cNames,
/* [in] */ LCID lcid,
/* [size_is][out] */ DISPID *rgDispId)
{
UINT i;
HRESULT ret = S_OK;
TSRMLS_FETCH();
FETCH_DISP("GetIDsOfNames");
for (i = 0; i < cNames; i++) {
char *name;
unsigned int namelen;
zval **tmp;
name = php_OLECHAR_to_char(rgszNames[i], &namelen, CP_ACP TSRMLS_CC);
/* Lookup the name in the hash */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == FAILURE) {
ret = DISP_E_UNKNOWNNAME;
rgDispId[i] = 0;
} else {
rgDispId[i] = Z_LVAL_PP(tmp);
}
efree(name);
}
return ret;
}
static HRESULT STDMETHODCALLTYPE disp_invoke(
IDispatchEx *This,
/* [in] */ DISPID dispIdMember,
/* [in] */ REFIID riid,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [out][in] */ DISPPARAMS *pDispParams,
/* [out] */ VARIANT *pVarResult,
/* [out] */ EXCEPINFO *pExcepInfo,
/* [out] */ UINT *puArgErr)
{
return This->lpVtbl->InvokeEx(This, dispIdMember,
lcid, wFlags, pDispParams,
pVarResult, pExcepInfo, NULL);
}
static HRESULT STDMETHODCALLTYPE disp_getdispid(
IDispatchEx *This,
/* [in] */ BSTR bstrName,
/* [in] */ DWORD grfdex,
/* [out] */ DISPID *pid)
{
HRESULT ret = DISP_E_UNKNOWNNAME;
char *name;
unsigned int namelen;
zval **tmp;
TSRMLS_FETCH();
FETCH_DISP("GetDispID");
name = php_OLECHAR_to_char(bstrName, &namelen, CP_ACP TSRMLS_CC);
/* Lookup the name in the hash */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) {
*pid = Z_LVAL_PP(tmp);
ret = S_OK;
}
efree(name);
return ret;
}
static HRESULT STDMETHODCALLTYPE disp_invokeex(
IDispatchEx *This,
/* [in] */ DISPID id,
/* [in] */ LCID lcid,
/* [in] */ WORD wFlags,
/* [in] */ DISPPARAMS *pdp,
/* [out] */ VARIANT *pvarRes,
/* [out] */ EXCEPINFO *pei,
/* [unique][in] */ IServiceProvider *pspCaller)
{
zval **name;
UINT i;
int codepage = CP_ACP;
zval *retval = NULL;
zval ***params = NULL;
HRESULT ret = DISP_E_MEMBERNOTFOUND;
TSRMLS_FETCH();
FETCH_DISP("InvokeEx");
if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) {
/* TODO: add support for overloaded objects */
trace("-- Invoke: %d %20s flags=%08x args=%d\n", id, Z_STRVAL_PP(name), wFlags, pdp->cArgs);
/* convert args into zvals.
* Args are in reverse order */
params = (zval ***)emalloc(sizeof(zval **) * pdp->cArgs);
for (i = 0; i < pdp->cArgs; i++) {
VARIANT *arg;
zval *zarg;
arg = &pdp->rgvarg[ pdp->cArgs - 1 - i];
trace("alloc zval for arg %d VT=%08x\n", i, V_VT(arg));
ALLOC_INIT_ZVAL(zarg);
if (V_VT(arg) == VT_DISPATCH) {
trace("arg %d is dispatchable\n", i);
if (NULL == php_COM_object_from_dispatch(V_DISPATCH(arg), zarg TSRMLS_CC)) {
trace("failed to convert arg %d to zval\n", i);
ZVAL_NULL(zarg);
}
} else {
// arg can't be an idispatch, so we don't care for the implicit AddRef() call here
if (FAILURE == php_variant_to_pval(arg, zarg, codepage TSRMLS_CC)) {
trace("failed to convert arg %d to zval\n", i);
ZVAL_NULL(zarg);
}
}
params[i] = &zarg;
}
trace("arguments processed, prepare to do some work\n");
if (wFlags & DISPATCH_PROPERTYGET) {
trace("trying to get a property\n");
zend_hash_find(Z_OBJPROP_P(disp->object), Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, (void**)&retval);
} else if (wFlags & DISPATCH_PROPERTYPUT) {
trace("trying to set a property\n");
add_property_zval(disp->object, Z_STRVAL_PP(name), *params[0]);
} else if (wFlags & DISPATCH_METHOD) {
trace("Trying to call user function\n");
if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name,
&retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) {
ret = S_OK;
} else {
ret = DISP_E_EXCEPTION;
}
} else {
trace("Don't know how to handle this invocation %08x\n", wFlags);
}
/* release arguments */
for (i = 0; i < pdp->cArgs; i++)
zval_ptr_dtor(params[i]);
efree(params);
/* return value */
if (retval) {
if (pvarRes) {
if (Z_TYPE_P(retval) == IS_OBJECT) {
/* export the object using a dispatch like ourselves */
VariantInit(pvarRes);
V_VT(pvarRes) = VT_DISPATCH;
V_DISPATCH(pvarRes) = php_COM_export_object(retval TSRMLS_CC);
} else {
php_pval_to_variant(retval, pvarRes, codepage TSRMLS_CC);
}
}
zval_ptr_dtor(&retval);
} else if (pvarRes) {
VariantInit(pvarRes);
}
} else {
trace("InvokeEx: I don't support DISPID=%d\n", id);
}
return ret;
}
static HRESULT STDMETHODCALLTYPE disp_deletememberbyname(
IDispatchEx *This,
/* [in] */ BSTR bstrName,
/* [in] */ DWORD grfdex)
{
FETCH_DISP("DeleteMemberByName");
return S_FALSE;
}
static HRESULT STDMETHODCALLTYPE disp_deletememberbydispid(
IDispatchEx *This,
/* [in] */ DISPID id)
{
FETCH_DISP("DeleteMemberByDispID");
return S_FALSE;
}
static HRESULT STDMETHODCALLTYPE disp_getmemberproperties(
IDispatchEx *This,
/* [in] */ DISPID id,
/* [in] */ DWORD grfdexFetch,
/* [out] */ DWORD *pgrfdex)
{
FETCH_DISP("GetMemberProperties");
return DISP_E_UNKNOWNNAME;
}
static HRESULT STDMETHODCALLTYPE disp_getmembername(
IDispatchEx *This,
/* [in] */ DISPID id,
/* [out] */ BSTR *pbstrName)
{
zval *name;
TSRMLS_FETCH();
FETCH_DISP("GetMemberName");
if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) {
OLECHAR *olestr = php_char_to_OLECHAR(Z_STRVAL_P(name), Z_STRLEN_P(name), CP_ACP TSRMLS_CC);
*pbstrName = SysAllocString(olestr);
efree(olestr);
return S_OK;
} else {
return DISP_E_UNKNOWNNAME;
}
}
static HRESULT STDMETHODCALLTYPE disp_getnextdispid(
IDispatchEx *This,
/* [in] */ DWORD grfdex,
/* [in] */ DISPID id,
/* [out] */ DISPID *pid)
{
ulong next = id+1;
FETCH_DISP("GetNextDispID");
while(!zend_hash_index_exists(disp->dispid_to_name, next))
next++;
if (zend_hash_index_exists(disp->dispid_to_name, next)) {
*pid = next;
return S_OK;
}
return S_FALSE;
}
static HRESULT STDMETHODCALLTYPE disp_getnamespaceparent(
IDispatchEx *This,
/* [out] */ IUnknown **ppunk)
{
FETCH_DISP("GetNameSpaceParent");
*ppunk = NULL;
return E_NOTIMPL;
}
static struct IDispatchExVtbl php_dispatch_vtbl = {
disp_queryinterface,
disp_addref,
disp_release,
disp_gettypeinfocount,
disp_gettypeinfo,
disp_getidsofnames,
disp_invoke,
disp_getdispid,
disp_invokeex,
disp_deletememberbyname,
disp_deletememberbydispid,
disp_getmemberproperties,
disp_getmembername,
disp_getnextdispid,
disp_getnamespaceparent
};
/* enumerate functions and properties of the object and assign
* dispatch ids */
static void generate_dispids(php_dispatchex *disp TSRMLS_DC)
{
HashPosition pos;
char *name = NULL;
zval *tmp;
int namelen;
int keytype;
ulong pid;
if (disp->dispid_to_name == NULL) {
ALLOC_HASHTABLE(disp->dispid_to_name);
ALLOC_HASHTABLE(disp->name_to_dispid);
zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_init(disp->dispid_to_name, 0, NULL, ZVAL_PTR_DTOR, 0);
}
/* properties */
zend_hash_internal_pointer_reset_ex(Z_OBJPROP_PP(&disp->object), &pos);
while (HASH_KEY_NON_EXISTANT != (keytype =
zend_hash_get_current_key_ex(Z_OBJPROP_PP(&disp->object), &name, &namelen, &pid, 0, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
sprintf(namebuf, "%d", pid);
name = namebuf;
namelen = strlen(namebuf);
}
zend_hash_move_forward_ex(Z_OBJPROP_PP(&disp->object), &pos);
/* Find the existing id */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS)
continue;
/* add the mappings */
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, name, namelen, 1);
zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
zend_hash_update(disp->name_to_dispid, name, namelen+1, (void*)&tmp, sizeof(zval *), NULL);
}
/* functions */
zend_hash_internal_pointer_reset_ex(&Z_OBJCE_PP(&disp->object)->function_table, &pos);
while (HASH_KEY_NON_EXISTANT != (keytype =
zend_hash_get_current_key_ex(&Z_OBJCE_PP(&disp->object)->function_table, &name, &namelen, &pid, 0, &pos))) {
char namebuf[32];
if (keytype == HASH_KEY_IS_LONG) {
sprintf(namebuf, "%d", pid);
name = namebuf;
namelen = strlen(namebuf);
}
zend_hash_move_forward_ex(Z_OBJPROP_PP(&disp->object), &pos);
/* Find the existing id */
if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS)
continue;
/* add the mappings */
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, name, namelen, 1);
zend_hash_index_update(disp->dispid_to_name, pid, (void*)&tmp, sizeof(zval *), NULL);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
zend_hash_update(disp->name_to_dispid, name, namelen+1, (void*)&tmp, sizeof(zval *), NULL);
}
}
static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
{
php_dispatchex *disp = (php_dispatchex*)CoTaskMemAlloc(sizeof(php_dispatchex));
trace("constructing a COM proxy\n");
if (disp == NULL)
return NULL;
memset(disp, 0, sizeof(php_dispatchex));
disp->engine_thread = tsrm_thread_id();
disp->lpVtbl = &php_dispatch_vtbl;
disp->refcount = 1;
if (object)
ZVAL_ADDREF(object);
disp->object = object;
disp->id = zend_list_insert(disp, le_dispatch);
return disp;
}
static void disp_destructor(php_dispatchex *disp)
{
TSRMLS_FETCH();
trace("destroying COM wrapper for PHP object %s\n", Z_OBJCE_P(disp->object)->name);
disp->id = 0;
if (disp->refcount > 0)
CoDisconnectObject((IUnknown*)disp, 0);
zend_hash_destroy(disp->dispid_to_name);
zend_hash_destroy(disp->name_to_dispid);
FREE_HASHTABLE(disp->dispid_to_name);
FREE_HASHTABLE(disp->name_to_dispid);
if (disp->object)
zval_ptr_dtor(&disp->object);
CoTaskMemFree(disp);
}
PHPAPI IDispatch *php_COM_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC)
{
php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
HashPosition pos;
char *name = NULL;
zval *tmp, **ntmp;
int namelen;
int keytype;
ulong pid;
disp->dispid_to_name = id_to_name;
memcpy(&disp->sinkid, sinkid, sizeof(disp->sinkid));
/* build up the reverse mapping */
ALLOC_HASHTABLE(disp->name_to_dispid);
zend_hash_init(disp->name_to_dispid, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_internal_pointer_reset_ex(id_to_name, &pos);
while (HASH_KEY_NON_EXISTANT != (keytype =
zend_hash_get_current_key_ex(id_to_name, &name, &namelen, &pid, 0, &pos))) {
if (keytype == HASH_KEY_IS_LONG) {
zend_hash_get_current_data_ex(id_to_name, (void**)&ntmp, &pos);
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, pid);
zend_hash_update(disp->name_to_dispid, Z_STRVAL_PP(ntmp), Z_STRLEN_PP(ntmp)+1, (void*)&tmp, sizeof(zval *), NULL);
}
zend_hash_move_forward_ex(id_to_name, &pos);
}
return (IDispatch*)disp;
}
PHPAPI IDispatch *php_COM_export_object(zval *val TSRMLS_DC)
{
php_dispatchex *disp = NULL;
if (Z_TYPE_P(val) != IS_OBJECT)
return NULL;
if (Z_OBJCE_P(val) == &COM_class_entry || !strcmp(Z_OBJCE_P(val)->name, "COM")) {
/* pass back it's IDispatch directly */
zval **tmp;
comval *obj;
int type;
zend_hash_index_find(Z_OBJPROP_P(val), 0, (void**)&tmp);
obj = (comval *)zend_list_find(Z_LVAL_PP(tmp), &type);
if (type != IS_COM)
return NULL;
C_DISPATCH(obj)->lpVtbl->AddRef(C_DISPATCH(obj));
return C_DISPATCH(obj);
}
disp = disp_constructor(val TSRMLS_CC);
generate_dispids(disp TSRMLS_CC);
return (IDispatch*)disp;
}
+2 -24
View File
@@ -18,9 +18,6 @@ PHP_FUNCTION(com_propget);
PHP_FUNCTION(com_propput);
PHP_FUNCTION(com_load_typelib);
PHP_FUNCTION(com_isenum);
PHP_FUNCTION(com_event_sink);
PHP_FUNCTION(com_message_pump);
PHP_FUNCTION(com_print_typeinfo);
PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, char **ErrString TSRMLS_DC);
PHPAPI HRESULT php_COM_get_ids_of_names(comval *obj, OLECHAR FAR* FAR* rgszNames, DISPID FAR* rgDispId TSRMLS_DC);
@@ -34,13 +31,6 @@ PHPAPI int php_COM_get_le_comval();
PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value);
PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_reference);
PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
PHPAPI zval *php_COM_object_from_dispatch(IDispatch *disp, zval *val TSRMLS_DC);
PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC);
/* dispatch.c */
PHPAPI IDispatch *php_COM_export_object(zval *val TSRMLS_DC);
PHPAPI IDispatch *php_COM_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
int php_COM_dispatch_init(int module_number TSRMLS_DC);
zend_module_entry COM_module_entry;
zend_class_entry COM_class_entry;
@@ -51,23 +41,11 @@ zend_class_entry COM_class_entry;
END_EXTERN_C()
#define phpext_com_ptr &COM_module_entry
#define COM_module_ptr &COM_module_entry
ZEND_BEGIN_MODULE_GLOBALS(com)
int nothing;
ZEND_END_MODULE_GLOBALS(com)
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(com);
#ifdef ZTS
#define COMG(v) TSRMG(com_globals_id, zend_com_globals *, v)
#else
#define COMG(v) (com_globals.v)
#endif
#else
#define phpext_com_ptr NULL
#define COM_module_ptr NULL
#endif /* PHP_WIN32 */
+12 -1
View File
@@ -8,12 +8,23 @@ BEGIN_EXTERN_C()
#include "conversion.h"
#include "variant.h"
void php_VARIANT_init(int module_number TSRMLS_DC);
PHP_MINIT_FUNCTION(VARIANT);
PHP_MSHUTDOWN_FUNCTION(VARIANT);
PHPAPI int php_VARIANT_get_le_variant();
zend_module_entry VARIANT_module_entry;
END_EXTERN_C()
#define VARIANT_module_ptr &VARIANT_module_entry
#else
#define VARIANT_module_ptr NULL
#endif /* PHP_WIN32 */
#define phpext_VARIANT_ptr VARIANT_module_ptr
#endif /* PHP_TYPEDEF_VARIANT_H */
+1 -1
View File
@@ -16,7 +16,7 @@
comval *obj; \
ALLOC_COM(obj); \
php_COM_set(obj, &V_DISPATCH(v), TRUE TSRMLS_CC); \
ZVAL_RESOURCE((z), zend_list_insert(obj, IS_COM)); \
ZVAL_LONG((z), zend_list_insert(obj, IS_COM)); \
} else { \
php_variant_to_pval((v), (z), codepage TSRMLS_CC); \
FREE_VARIANT(v); \
+6 -4
View File
@@ -1,8 +1,10 @@
dnl $Id$
AC_MSG_CHECKING(for cpdflib support)
AC_MSG_CHECKING(whether to include cpdflib support)
AC_ARG_WITH(cpdflib,
[ --with-cpdflib[=DIR] Include cpdflib support (requires cpdflib >= 2).],
[ --with-cpdflib[=DIR] Include cpdflib support (requires cpdflib >= 2).
DIR is the cpdfllib install directory,
defaults to /usr.],
[
case $withval in
no)
@@ -11,7 +13,7 @@ AC_ARG_WITH(cpdflib,
AC_MSG_RESULT(yes)
PHP_EXTENSION(cpdf)
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
[AC_MSG_ERROR([Cpdf module requires cpdflib >= 2.])])
[AC_MSG_ERROR(Cpdf module requires cpdflib >= 2.)])
PHP_ADD_LIBRARY(cpdf)
PHP_ADD_LIBRARY(tiff)
PHP_ADD_LIBRARY(jpeg)
@@ -57,7 +59,7 @@ AC_ARG_WITH(cpdflib,
LIBS="$LIBS -L$withval/lib"
AC_CHECK_LIB(cpdf, cpdf_open, [AC_DEFINE(HAVE_CPDFLIB,1,[Whether you have cpdflib])],
[AC_MSG_ERROR([Cpdflib module requires cpdflib >= 2.])])
[AC_MSG_ERROR(Cpdflib module requires cpdflib >= 2.)])
LIBS=$old_LIBS
PHP_ADD_LIBRARY_WITH_PATH(cpdf, $withval/lib)
PHP_ADD_INCLUDE($CPDFLIB_INCLUDE)
+326 -335
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Uwe Steinmann <Uwe.Steinmann@fernuni-hagen.de> |
| Authors: Uwe Steinmann |
+----------------------------------------------------------------------+
*/
/* $Id$ */
+11 -11
View File
@@ -1,24 +1,23 @@
dnl
dnl $Id$
dnl
PHP_ARG_WITH(crack, for CRACKlib support,
PHP_ARG_WITH(crack, whether to include crack support,
[ --with-crack[=DIR] Include crack support.])
if test "$PHP_CRACK" != "no"; then
for i in /usr/local/lib /usr/lib $PHP_CRACK/lib $PHP_CRACK/cracklib; do
test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i
for i in /usr/local/lib /usr/lib $PHP_CRACK $PHP_CRACK/cracklib; do
if test -f $i/libcrack.a; then
CRACK_LIBDIR=$i
fi
done
for i in /usr/local/include /usr/include $PHP_CRACK/include $PHP_CRACK/cracklib; do
test -f $i/packer.h && CRACK_INCLUDEDIR=$i
for i in /usr/local/include /usr/include $PHP_CRACK $PHP_CRACK/cracklib; do
if test -f $i/packer.h; then
CRACK_INCLUDEDIR=$i
fi
done
if test -z "$CRACK_LIBDIR"; then
AC_MSG_ERROR(Cannot find the cracklib library file)
fi
if test -z "$CRACK_INCLUDEDIR"; then
AC_MSG_ERROR(Cannot find a cracklib header file)
fi
@@ -27,7 +26,8 @@ if test "$PHP_CRACK" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(crack, $CRACK_LIBDIR, CRACK_SHARED_LIBADD)
PHP_EXTENSION(crack, $ext_shared)
PHP_SUBST(CRACK_SHARED_LIBADD)
AC_DEFINE(HAVE_CRACK, 1, [ ])
fi
PHP_SUBST(CRACK_SHARED_LIBADD)
+10 -19
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Alexander Feldman |
| Authors: |
+----------------------------------------------------------------------+
*/
/* $Id$ */
@@ -43,7 +43,6 @@ function_entry crack_functions[] = {
};
zend_module_entry crack_module_entry = {
STANDARD_MODULE_HEADER,
"crack",
crack_functions,
ZEND_MODULE_STARTUP_N(crack),
@@ -51,7 +50,6 @@ zend_module_entry crack_module_entry = {
ZEND_MODULE_ACTIVATE_N(crack),
ZEND_MODULE_DEACTIVATE_N(crack),
ZEND_MODULE_INFO_N(crack),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
@@ -95,13 +93,6 @@ void _close_crack_dict(PWDICT *pwdict)
ZEND_MODULE_STARTUP_D(crack)
{
#ifdef ZTS
zend_crack_globals *crack_globals;
ts_allocate_id(&crack_globals_id, sizeof(zend_crack_globals), NULL, NULL);
crack_globals = ts_resource(crack_globals_id);
#endif
REGISTER_INI_ENTRIES();
le_crack = register_list_destructors(_close_crack_dict, NULL);
@@ -162,7 +153,7 @@ ZEND_FUNCTION(crack_opendict)
/* }}} */
/* {{{ proto string crack_closedict([int link_identifier])
Closes an open cracklib dictionary */
Closes an open cracklib dictionary. */
ZEND_FUNCTION(crack_closedict)
{
PWDICT *pwdict;
@@ -177,7 +168,7 @@ ZEND_FUNCTION(crack_closedict)
if (zend_get_parameters_ex(1, &dictionary) == FAILURE) {
WRONG_PARAM_COUNT;
}
id = Z_LVAL_PP(dictionary);
id = (*dictionary)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
@@ -194,7 +185,7 @@ ZEND_FUNCTION(crack_closedict)
}
/* }}} */
/* {{{ proto string crack_check([int dictionary,] string password)
/* {{{ proto string crack_check([int dictionary, ] string password)
Performs an obscure check with the given password */
ZEND_FUNCTION(crack_check)
{
@@ -247,8 +238,8 @@ ZEND_FUNCTION(crack_check)
}
/* }}} */
/* {{{ proto string crack_getlastmessage(void)
Returns the message from the last obscure check */
/* {{{ proto string crack_getlastmessage()
Returns the message from the last obscure check. */
ZEND_FUNCTION(crack_getlastmessage)
{
if (ZEND_NUM_ARGS() != 0) {
@@ -272,6 +263,6 @@ ZEND_FUNCTION(crack_getlastmessage)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+2 -2
View File
@@ -1,6 +1,6 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
+----------------------------------------------------------------------+
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Alexander Feldman |
| Authors: |
+----------------------------------------------------------------------+
*/
File renamed without changes.
+20 -4
View File
@@ -1,11 +1,27 @@
dnl
dnl $Id$
dnl
dnl config.m4 for extension ctype
dnl don't forget to call PHP_EXTENSION(ctype)
PHP_ARG_ENABLE(ctype, whether to enable ctype functions,
[ --disable-ctype Disable ctype functions], yes)
dnl Comments in this file start with the string 'dnl'.
dnl Remove where necessary. This file will not work
dnl without editing.
dnl If your extension references something external, use with:
dnl PHP_ARG_WITH(ctype, for ctype support,
dnl Make sure that the comment is aligned:
dnl [ --with-ctype Include ctype support])
dnl Otherwise use enable:
PHP_ARG_ENABLE(ctype, whether to enable ctype support,
[ --enable-ctype Enable ctype support])
if test "$PHP_CTYPE" != "no"; then
dnl If you will not be testing anything external, like existence of
dnl headers, libraries or functions in them, just uncomment the
dnl following line and you are ready to go.
AC_DEFINE(HAVE_CTYPE, 1, [ ])
dnl Write more examples of tests here...
PHP_EXTENSION(ctype, $ext_shared)
fi
+175 -64
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Hartmut Holzgraefe <hartmut@six.de> |
| Authors: Hartmut Holzgraefe <hartmut@six.de> |
+----------------------------------------------------------------------+
*/
@@ -38,7 +38,7 @@ ZEND_DECLARE_MODULE_GLOBALS(ctype)
*/
/* True global resources - no need for thread safety here */
/* static int le_ctype; */
static int le_ctype;
/* {{{ ctype_functions[]
* Every user visible function must have an entry in ctype_functions[].
@@ -62,7 +62,6 @@ function_entry ctype_functions[] = {
/* {{{ ctype_mpodule_entry
*/
zend_module_entry ctype_module_entry = {
STANDARD_MODULE_HEADER,
"ctype",
ctype_functions,
NULL,
@@ -70,7 +69,6 @@ zend_module_entry ctype_module_entry = {
NULL,
NULL,
PHP_MINFO(ctype),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
/* }}} */
@@ -79,6 +77,10 @@ zend_module_entry ctype_module_entry = {
ZEND_GET_MODULE(ctype)
#endif
#ifndef PHP_EXPERIMENTAL
#define PHP_EXPERIMENTAL(x, y)
#endif
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(ctype)
@@ -91,116 +93,225 @@ PHP_MINFO_FUNCTION(ctype)
/* {{{ ctype
*/
#define CTYPE(iswhat) \
zval *c; \
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == FAILURE) \
return; \
switch (Z_TYPE_P(c)) { \
case IS_LONG: \
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
case IS_STRING: \
{ \
char *p; \
int n, len; \
p=Z_STRVAL_P(c); \
len = Z_STRLEN_P(c); \
for(n=0;n<len;n++) { \
if(!iswhat(*p++)) RETURN_FALSE; \
} \
RETURN_TRUE; \
} \
default: \
break; \
} \
RETURN_FALSE;
static int ctype(int (*iswhat)(int), zval **c)
{
switch ((*c)->type) {
case IS_LONG:
return iswhat((*c)->value.lval);
case IS_STRING:
{
char *p;
int n, len;
convert_to_string_ex(c);
p=(*c)->value.str.val;
len = (*c)->value.str.len;
for(n=0;n<len;n++) {
if(!iswhat(*p++)) return 0;
}
return 1;
}
default:
break;
}
return 0;
}
/* }}} */
/* {{{ proto bool ctype_alnum(mixed c)
Checks for alphanumeric character(s) */
/* {{{ proto bool isalnum(mixed c)
Check for alphanumeric character(s) */
PHP_FUNCTION(ctype_alnum)
{
CTYPE(isalnum);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(isalnum, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_alpha(mixed c)
Checks for alphabetic character(s) */
/* {{{ proto bool isalpha(mixed c)
Check for alphabetic character(s) */
PHP_FUNCTION(ctype_alpha)
{
CTYPE(isalpha);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(isalpha, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_cntrl(mixed c)
Checks for control character(s) */
/* {{{ proto bool iscntrl(mixed c)
Check for control character(s) */
PHP_FUNCTION(ctype_cntrl)
{
CTYPE(iscntrl);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(iscntrl, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_digit(mixed c)
Checks for numeric character(s) */
/* {{{ proto bool isdigit(mixed c)
Check for numeric character(s) */
PHP_FUNCTION(ctype_digit)
{
CTYPE(isdigit);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(isdigit, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_lower(mixed c)
Checks for lowercase character(s) */
/* {{{ proto bool islower(mixed c)
Check for lowercase character(s) */
PHP_FUNCTION(ctype_lower)
{
CTYPE(islower);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(islower, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_graph(mixed c)
Checks for any printable character(s) except space */
/* {{{ proto bool isgraph(mixed c)
Check for any printable character(s) except space */
PHP_FUNCTION(ctype_graph)
{
CTYPE(isgraph);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(isgraph, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_print(mixed c)
Checks for printable character(s) */
/* {{{ proto bool isprint(mixed c)
Check for printable character(s) */
PHP_FUNCTION(ctype_print)
{
CTYPE(isprint);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(isprint, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_punct(mixed c)
Checks for any printable character which is not whitespace or an alphanumeric character */
/* {{{ proto bool ispunct(mixed c)
Check for any printable character which is not whitespace or an alphanumeric character */
PHP_FUNCTION(ctype_punct)
{
CTYPE(ispunct);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(ispunct, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_space(mixed c)
Checks for whitespace character(s)*/
/* {{{ proto bool isspace(mixed c)
Check for whitespace character(s)*/
PHP_FUNCTION(ctype_space)
{
CTYPE(isspace);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(isspace, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_upper(mixed c)
Checks for uppercase character(s) */
/* {{{ proto bool isupper(mixed c)
Check for uppercase character(s) */
PHP_FUNCTION(ctype_upper)
{
CTYPE(isupper);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(isupper, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
/* {{{ proto bool ctype_xdigit(mixed c)
Checks for character(s) representing a hexadecimal digit */
/* {{{ proto bool isxdigit(mixed c)
Check for character(s) representing a hexadecimal digit */
PHP_FUNCTION(ctype_xdigit)
{
CTYPE(isxdigit);
PHP_EXPERIMENTAL("4.0.4dev", NULL)
zval **c;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &c) == FAILURE){
WRONG_PARAM_COUNT;
}
if(ctype(isxdigit, c)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
/* }}} */
@@ -211,6 +322,6 @@ PHP_FUNCTION(ctype_xdigit)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+4 -3
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Hartmut Holzgraefe <hartmut@six.de> |
| Authors: |
| |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -6,7 +6,7 @@ ctype on integers
--GET--
--FILE--
<?php
setlocale(LC_ALL,"C");
setlocale("LC_ALL","C");
function ctype_test_001($function) {
$n=0;
+1 -1
View File
@@ -6,7 +6,7 @@ ctype on strings
--GET--
--FILE--
<?php
setlocale(LC_ALL,"C");
setlocale("LC_ALL","C");
function ctype_test_002($function) {
$n=0; $m=0;
+5 -10
View File
@@ -1,6 +1,5 @@
dnl
dnl $Id$
dnl
dnl config.m4 for extension CURL
PHP_ARG_WITH(curl, for CURL support,
[ --with-curl[=DIR] Include CURL support])
@@ -25,30 +24,26 @@ if test "$PHP_CURL" != "no"; then
fi
CURL_CONFIG="curl-config"
AC_MSG_CHECKING(for cURL 7.9 or greater)
AC_MSG_CHECKING(for cURL greater than 7.7.3)
if ${CURL_DIR}/bin/curl-config --libs print > /dev/null 2>&1; then
CURL_CONFIG=${CURL_DIR}/bin/curl-config
else
if ${CURL_DIR}/curl-config --libs print > /dev/null 2>&1; then
CURL_CONFIG=${CURL_DIR}/curl-config
fi
fi
curl_version_full=`$CURL_CONFIG --version`
curl_version=`echo ${curl_version_full} | sed -e 's/libcurl //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test "$curl_version" -ge 7009000; then
if test "$curl_version" -ge 7007003; then
AC_MSG_RESULT($curl_version_full)
CURL_LIBS=`$CURL_CONFIG --libs`
else
AC_MSG_ERROR(cURL version 7.9 or later is required to compile php with cURL support)
AC_MSG_ERROR(cURL version 7.7.3 or later is required to compile php with cURL support)
fi
PHP_ADD_INCLUDE($CURL_DIR/include)
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, CURL_SHARED_LIBADD)
PHP_CHECK_LIBRARY(curl,curl_easy_perform,
AC_CHECK_LIB(curl,curl_easy_perform,
[
AC_DEFINE(HAVE_CURL,1,[ ])
],[
+202 -250
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -69,15 +69,13 @@ function_entry curl_functions[] = {
/* {{{ curl_module_entry
*/
zend_module_entry curl_module_entry = {
STANDARD_MODULE_HEADER,
"curl",
curl_functions,
PHP_MINIT(curl),
PHP_MSHUTDOWN(curl),
NULL,
NULL,
NULL,
PHP_MINFO(curl),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
/* }}} */
@@ -97,7 +95,7 @@ PHP_MINFO_FUNCTION(curl)
}
/* }}} */
#define REGISTER_CURL_CONSTANT(__c) REGISTER_LONG_CONSTANT(#__c, __c, CONST_CS | CONST_PERSISTENT)
#define REGISTER_CURL_CONSTANT(name, value) REGISTER_LONG_CONSTANT(name, value, CONST_CS | CONST_PERSISTENT)
/* {{{ PHP_MINIT_FUNCTION
*/
@@ -106,167 +104,143 @@ PHP_MINIT_FUNCTION(curl)
le_curl = zend_register_list_destructors_ex(_php_curl_close, NULL, "curl", module_number);
/* Constants for curl_setopt() */
REGISTER_CURL_CONSTANT(CURLOPT_PORT);
REGISTER_CURL_CONSTANT(CURLOPT_FILE);
REGISTER_CURL_CONSTANT(CURLOPT_INFILE);
REGISTER_CURL_CONSTANT(CURLOPT_INFILESIZE);
REGISTER_CURL_CONSTANT(CURLOPT_URL);
REGISTER_CURL_CONSTANT(CURLOPT_PROXY);
REGISTER_CURL_CONSTANT(CURLOPT_VERBOSE);
REGISTER_CURL_CONSTANT(CURLOPT_HEADER);
REGISTER_CURL_CONSTANT(CURLOPT_HTTPHEADER);
REGISTER_CURL_CONSTANT(CURLOPT_NOPROGRESS);
REGISTER_CURL_CONSTANT(CURLOPT_NOBODY);
REGISTER_CURL_CONSTANT(CURLOPT_FAILONERROR);
REGISTER_CURL_CONSTANT(CURLOPT_UPLOAD);
REGISTER_CURL_CONSTANT(CURLOPT_POST);
REGISTER_CURL_CONSTANT(CURLOPT_FTPLISTONLY);
REGISTER_CURL_CONSTANT(CURLOPT_FTPAPPEND);
REGISTER_CURL_CONSTANT(CURLOPT_NETRC);
REGISTER_CURL_CONSTANT(CURLOPT_FOLLOWLOCATION);
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
REGISTER_CURL_CONSTANT(CURLOPT_PUT);
REGISTER_CURL_CONSTANT(CURLOPT_MUTE);
REGISTER_CURL_CONSTANT(CURLOPT_USERPWD);
REGISTER_CURL_CONSTANT(CURLOPT_PROXYUSERPWD);
REGISTER_CURL_CONSTANT(CURLOPT_RANGE);
REGISTER_CURL_CONSTANT(CURLOPT_TIMEOUT);
REGISTER_CURL_CONSTANT(CURLOPT_POSTFIELDS);
REGISTER_CURL_CONSTANT(CURLOPT_REFERER);
REGISTER_CURL_CONSTANT(CURLOPT_USERAGENT);
REGISTER_CURL_CONSTANT(CURLOPT_FTPPORT);
REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_LIMIT);
REGISTER_CURL_CONSTANT(CURLOPT_LOW_SPEED_TIME);
REGISTER_CURL_CONSTANT(CURLOPT_RESUME_FROM);
REGISTER_CURL_CONSTANT(CURLOPT_COOKIE);
REGISTER_CURL_CONSTANT(CURLOPT_SSLCERT);
REGISTER_CURL_CONSTANT(CURLOPT_SSLCERTPASSWD);
REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYHOST);
REGISTER_CURL_CONSTANT(CURLOPT_COOKIEFILE);
REGISTER_CURL_CONSTANT(CURLOPT_SSLVERSION);
REGISTER_CURL_CONSTANT(CURLOPT_TIMECONDITION);
REGISTER_CURL_CONSTANT(CURLOPT_TIMEVALUE);
REGISTER_CURL_CONSTANT(CURLOPT_CUSTOMREQUEST);
REGISTER_CURL_CONSTANT(CURLOPT_STDERR);
REGISTER_CURL_CONSTANT(CURLOPT_TRANSFERTEXT);
REGISTER_CURL_CONSTANT(CURLOPT_RETURNTRANSFER);
REGISTER_CURL_CONSTANT(CURLOPT_QUOTE);
REGISTER_CURL_CONSTANT(CURLOPT_POSTQUOTE);
REGISTER_CURL_CONSTANT(CURLOPT_INTERFACE);
REGISTER_CURL_CONSTANT(CURLOPT_KRB4LEVEL);
REGISTER_CURL_CONSTANT(CURLOPT_HTTPPROXYTUNNEL);
REGISTER_CURL_CONSTANT(CURLOPT_FILETIME);
REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION);
REGISTER_CURL_CONSTANT(CURLOPT_READFUNCTION);
REGISTER_CURL_CONSTANT(CURLOPT_PASSWDFUNCTION);
REGISTER_CURL_CONSTANT(CURLOPT_HEADERFUNCTION);
REGISTER_CURL_CONSTANT(CURLOPT_MAXREDIRS);
REGISTER_CURL_CONSTANT(CURLOPT_MAXCONNECTS);
REGISTER_CURL_CONSTANT(CURLOPT_CLOSEPOLICY);
REGISTER_CURL_CONSTANT(CURLOPT_FRESH_CONNECT);
REGISTER_CURL_CONSTANT(CURLOPT_FORBID_REUSE);
REGISTER_CURL_CONSTANT(CURLOPT_RANDOM_FILE);
REGISTER_CURL_CONSTANT(CURLOPT_EGDSOCKET);
REGISTER_CURL_CONSTANT(CURLOPT_CONNECTTIMEOUT);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYPEER);
REGISTER_CURL_CONSTANT(CURLOPT_CAINFO);
REGISTER_CURL_CONSTANT(CURLOPT_COOKIEJAR);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_CIPHER_LIST);
REGISTER_CURL_CONSTANT(CURLOPT_BINARYTRANSFER);
REGISTER_CURL_CONSTANT("CURLOPT_PORT", CURLOPT_PORT);
REGISTER_CURL_CONSTANT("CURLOPT_FILE", CURLOPT_FILE);
REGISTER_CURL_CONSTANT("CURLOPT_INFILE", CURLOPT_INFILE);
REGISTER_CURL_CONSTANT("CURLOPT_INFILESIZE", CURLOPT_INFILESIZE);
REGISTER_CURL_CONSTANT("CURLOPT_URL", CURLOPT_URL);
REGISTER_CURL_CONSTANT("CURLOPT_PROXY", CURLOPT_PROXY);
REGISTER_CURL_CONSTANT("CURLOPT_VERBOSE", CURLOPT_VERBOSE);
REGISTER_CURL_CONSTANT("CURLOPT_HEADER", CURLOPT_HEADER);
REGISTER_CURL_CONSTANT("CURLOPT_HTTPHEADER", CURLOPT_HTTPHEADER);
REGISTER_CURL_CONSTANT("CURLOPT_NOPROGRESS", CURLOPT_NOPROGRESS);
REGISTER_CURL_CONSTANT("CURLOPT_NOBODY", CURLOPT_NOBODY);
REGISTER_CURL_CONSTANT("CURLOPT_FAILONERROR", CURLOPT_FAILONERROR);
REGISTER_CURL_CONSTANT("CURLOPT_UPLOAD", CURLOPT_UPLOAD);
REGISTER_CURL_CONSTANT("CURLOPT_POST", CURLOPT_POST);
REGISTER_CURL_CONSTANT("CURLOPT_FTPLISTONLY", CURLOPT_FTPLISTONLY);
REGISTER_CURL_CONSTANT("CURLOPT_FTPAPPEND", CURLOPT_FTPAPPEND);
REGISTER_CURL_CONSTANT("CURLOPT_NETRC", CURLOPT_NETRC);
REGISTER_CURL_CONSTANT("CURLOPT_FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION);
REGISTER_CURL_CONSTANT("CURLOPT_FTPASCII", CURLOPT_FTPASCII);
REGISTER_CURL_CONSTANT("CURLOPT_PUT", CURLOPT_PUT);
REGISTER_CURL_CONSTANT("CURLOPT_MUTE", CURLOPT_MUTE);
REGISTER_CURL_CONSTANT("CURLOPT_USERPWD", CURLOPT_USERPWD);
REGISTER_CURL_CONSTANT("CURLOPT_PROXYUSERPWD", CURLOPT_PROXYUSERPWD);
REGISTER_CURL_CONSTANT("CURLOPT_RANGE", CURLOPT_RANGE);
REGISTER_CURL_CONSTANT("CURLOPT_TIMEOUT", CURLOPT_TIMEOUT);
REGISTER_CURL_CONSTANT("CURLOPT_POSTFIELDS", CURLOPT_POSTFIELDS);
REGISTER_CURL_CONSTANT("CURLOPT_REFERER", CURLOPT_REFERER);
REGISTER_CURL_CONSTANT("CURLOPT_USERAGENT", CURLOPT_USERAGENT);
REGISTER_CURL_CONSTANT("CURLOPT_FTPPORT", CURLOPT_FTPPORT);
REGISTER_CURL_CONSTANT("CURLOPT_LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT);
REGISTER_CURL_CONSTANT("CURLOPT_LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME);
REGISTER_CURL_CONSTANT("CURLOPT_RESUME_FROM", CURLOPT_RESUME_FROM);
REGISTER_CURL_CONSTANT("CURLOPT_COOKIE", CURLOPT_COOKIE);
REGISTER_CURL_CONSTANT("CURLOPT_SSLCERT", CURLOPT_SSLCERT);
REGISTER_CURL_CONSTANT("CURLOPT_SSLCERTPASSWD", CURLOPT_SSLCERTPASSWD);
REGISTER_CURL_CONSTANT("CURLOPT_WRITEHEADER", CURLOPT_WRITEHEADER);
REGISTER_CURL_CONSTANT("CURLOPT_COOKIEFILE", CURLOPT_COOKIEFILE);
REGISTER_CURL_CONSTANT("CURLOPT_SSLVERSION", CURLOPT_SSLVERSION);
REGISTER_CURL_CONSTANT("CURLOPT_TIMECONDITION", CURLOPT_TIMECONDITION);
REGISTER_CURL_CONSTANT("CURLOPT_TIMEVALUE", CURLOPT_TIMEVALUE);
REGISTER_CURL_CONSTANT("CURLOPT_CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST);
REGISTER_CURL_CONSTANT("CURLOPT_STDERR", CURLOPT_STDERR);
REGISTER_CURL_CONSTANT("CURLOPT_TRANSFERTEXT", CURLOPT_TRANSFERTEXT);
REGISTER_CURL_CONSTANT("CURLOPT_RETURNTRANSFER", CURLOPT_RETURNTRANSFER);
REGISTER_CURL_CONSTANT("CURLOPT_QUOTE", CURLOPT_QUOTE);
REGISTER_CURL_CONSTANT("CURLOPT_POSTQUOTE", CURLOPT_POSTQUOTE);
REGISTER_CURL_CONSTANT("CURLOPT_INTERFACE", CURLOPT_INTERFACE);
REGISTER_CURL_CONSTANT("CURLOPT_KRB4LEVEL", CURLOPT_KRB4LEVEL);
REGISTER_CURL_CONSTANT("CURLOPT_HTTPPROXYTUNNEL", CURLOPT_HTTPPROXYTUNNEL);
REGISTER_CURL_CONSTANT("CURLOPT_FILETIME", CURLOPT_FILETIME);
REGISTER_CURL_CONSTANT("CURLOPT_WRITEFUNCTION", CURLOPT_WRITEFUNCTION);
REGISTER_CURL_CONSTANT("CURLOPT_READFUNCTION", CURLOPT_READFUNCTION);
REGISTER_CURL_CONSTANT("CURLOPT_PASSWDFUNCTION", CURLOPT_PASSWDFUNCTION);
REGISTER_CURL_CONSTANT("CURLOPT_HEADERFUNCTION", CURLOPT_HEADERFUNCTION);
REGISTER_CURL_CONSTANT("CURLOPT_MAXREDIRS", CURLOPT_MAXREDIRS);
REGISTER_CURL_CONSTANT("CURLOPT_MAXCONNECTS", CURLOPT_MAXCONNECTS);
REGISTER_CURL_CONSTANT("CURLOPT_CLOSEPOLICY", CURLOPT_CLOSEPOLICY);
REGISTER_CURL_CONSTANT("CURLOPT_FRESH_CONNECT", CURLOPT_FRESH_CONNECT);
REGISTER_CURL_CONSTANT("CURLOPT_FORBID_REUSE", CURLOPT_FORBID_REUSE);
REGISTER_CURL_CONSTANT("CURLOPT_RANDOM_FILE", CURLOPT_RANDOM_FILE);
REGISTER_CURL_CONSTANT("CURLOPT_EGDSOCKET", CURLOPT_EGDSOCKET);
REGISTER_CURL_CONSTANT("CURLOPT_CONNECTTIMEOUT", CURLOPT_CONNECTTIMEOUT);
REGISTER_CURL_CONSTANT("CURLOPT_SSL_VERIFYPEER", CURLOPT_SSL_VERIFYPEER);
REGISTER_CURL_CONSTANT("CURLOPT_CAINFO", CURLOPT_CAINFO);
REGISTER_CURL_CONSTANT("CURLOPT_BINARYTRANSFER", CURLOPT_BINARYTRANSFER);
/* Constants effecting the way CURLOPT_CLOSEPOLICY works */
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_SLOWEST);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_CALLBACK);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_OLDEST);
REGISTER_CURL_CONSTANT("CURLCLOSEPOLICY_LEAST_RECENTLY_USED", CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
REGISTER_CURL_CONSTANT("CURLCLOSEPOLICY_OLDEST", CURLCLOSEPOLICY_OLDEST);
/* Info constants */
REGISTER_CURL_CONSTANT(CURLINFO_EFFECTIVE_URL);
REGISTER_CURL_CONSTANT(CURLINFO_HTTP_CODE);
REGISTER_CURL_CONSTANT(CURLINFO_HEADER_SIZE);
REGISTER_CURL_CONSTANT(CURLINFO_REQUEST_SIZE);
REGISTER_CURL_CONSTANT(CURLINFO_TOTAL_TIME);
REGISTER_CURL_CONSTANT(CURLINFO_NAMELOOKUP_TIME);
REGISTER_CURL_CONSTANT(CURLINFO_CONNECT_TIME);
REGISTER_CURL_CONSTANT(CURLINFO_PRETRANSFER_TIME);
REGISTER_CURL_CONSTANT(CURLINFO_SIZE_UPLOAD);
REGISTER_CURL_CONSTANT(CURLINFO_SIZE_DOWNLOAD);
REGISTER_CURL_CONSTANT(CURLINFO_SPEED_DOWNLOAD);
REGISTER_CURL_CONSTANT(CURLINFO_SPEED_UPLOAD);
REGISTER_CURL_CONSTANT(CURLINFO_FILETIME);
REGISTER_CURL_CONSTANT(CURLINFO_SSL_VERIFYRESULT);
REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_LENGTH_DOWNLOAD);
REGISTER_CURL_CONSTANT(CURLINFO_CONTENT_LENGTH_UPLOAD);
REGISTER_CURL_CONSTANT("CURLINFO_EFFECTIVE_URL", CURLINFO_EFFECTIVE_URL);
REGISTER_CURL_CONSTANT("CURLINFO_HTTP_CODE", CURLINFO_HTTP_CODE);
REGISTER_CURL_CONSTANT("CURLINFO_HEADER_SIZE", CURLINFO_HEADER_SIZE);
REGISTER_CURL_CONSTANT("CURLINFO_REQUEST_SIZE", CURLINFO_REQUEST_SIZE);
REGISTER_CURL_CONSTANT("CURLINFO_TOTAL_TIME", CURLINFO_TOTAL_TIME);
REGISTER_CURL_CONSTANT("CURLINFO_NAMELOOKUP_TIME", CURLINFO_NAMELOOKUP_TIME);
REGISTER_CURL_CONSTANT("CURLINFO_CONNECT_TIME", CURLINFO_CONNECT_TIME);
REGISTER_CURL_CONSTANT("CURLINFO_PRETRANSFER_TIME", CURLINFO_PRETRANSFER_TIME);
REGISTER_CURL_CONSTANT("CURLINFO_SIZE_UPLOAD", CURLINFO_SIZE_UPLOAD);
REGISTER_CURL_CONSTANT("CURLINFO_SIZE_DOWNLOAD", CURLINFO_SIZE_DOWNLOAD);
REGISTER_CURL_CONSTANT("CURLINFO_SPEED_DOWNLOAD", CURLINFO_SPEED_DOWNLOAD);
REGISTER_CURL_CONSTANT("CURLINFO_SPEED_UPLOAD", CURLINFO_SPEED_UPLOAD);
REGISTER_CURL_CONSTANT("CURLINFO_FILETIME", CURLINFO_FILETIME);
/* Error Constants */
REGISTER_CURL_CONSTANT(CURLE_OK);
REGISTER_CURL_CONSTANT(CURLE_UNSUPPORTED_PROTOCOL);
REGISTER_CURL_CONSTANT(CURLE_FAILED_INIT);
REGISTER_CURL_CONSTANT(CURLE_URL_MALFORMAT);
REGISTER_CURL_CONSTANT(CURLE_URL_MALFORMAT_USER);
REGISTER_CURL_CONSTANT(CURLE_COULDNT_RESOLVE_PROXY);
REGISTER_CURL_CONSTANT(CURLE_COULDNT_RESOLVE_HOST);
REGISTER_CURL_CONSTANT(CURLE_COULDNT_CONNECT);
REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_SERVER_REPLY);
REGISTER_CURL_CONSTANT(CURLE_FTP_ACCESS_DENIED);
REGISTER_CURL_CONSTANT(CURLE_FTP_USER_PASSWORD_INCORRECT);
REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_PASS_REPLY);
REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_USER_REPLY);
REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_PASV_REPLY);
REGISTER_CURL_CONSTANT(CURLE_FTP_WEIRD_227_FORMAT);
REGISTER_CURL_CONSTANT(CURLE_FTP_CANT_GET_HOST);
REGISTER_CURL_CONSTANT(CURLE_FTP_CANT_RECONNECT);
REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_SET_BINARY);
REGISTER_CURL_CONSTANT(CURLE_PARTIAL_FILE);
REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_RETR_FILE);
REGISTER_CURL_CONSTANT(CURLE_FTP_WRITE_ERROR);
REGISTER_CURL_CONSTANT(CURLE_FTP_QUOTE_ERROR);
REGISTER_CURL_CONSTANT(CURLE_HTTP_NOT_FOUND);
REGISTER_CURL_CONSTANT(CURLE_WRITE_ERROR);
REGISTER_CURL_CONSTANT(CURLE_MALFORMAT_USER);
REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_STOR_FILE);
REGISTER_CURL_CONSTANT(CURLE_READ_ERROR);
REGISTER_CURL_CONSTANT(CURLE_OUT_OF_MEMORY);
REGISTER_CURL_CONSTANT(CURLE_OPERATION_TIMEOUTED);
REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_SET_ASCII);
REGISTER_CURL_CONSTANT(CURLE_FTP_PORT_FAILED);
REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_USE_REST);
REGISTER_CURL_CONSTANT(CURLE_FTP_COULDNT_GET_SIZE);
REGISTER_CURL_CONSTANT(CURLE_HTTP_RANGE_ERROR);
REGISTER_CURL_CONSTANT(CURLE_HTTP_POST_ERROR);
REGISTER_CURL_CONSTANT(CURLE_SSL_CONNECT_ERROR);
REGISTER_CURL_CONSTANT(CURLE_FTP_BAD_DOWNLOAD_RESUME);
REGISTER_CURL_CONSTANT(CURLE_FILE_COULDNT_READ_FILE);
REGISTER_CURL_CONSTANT(CURLE_LDAP_CANNOT_BIND);
REGISTER_CURL_CONSTANT(CURLE_LDAP_SEARCH_FAILED);
REGISTER_CURL_CONSTANT(CURLE_LIBRARY_NOT_FOUND);
REGISTER_CURL_CONSTANT(CURLE_FUNCTION_NOT_FOUND);
REGISTER_CURL_CONSTANT(CURLE_ABORTED_BY_CALLBACK);
REGISTER_CURL_CONSTANT(CURLE_BAD_FUNCTION_ARGUMENT);
REGISTER_CURL_CONSTANT(CURLE_BAD_CALLING_ORDER);
REGISTER_CURL_CONSTANT(CURLE_HTTP_PORT_FAILED);
REGISTER_CURL_CONSTANT(CURLE_BAD_PASSWORD_ENTERED);
REGISTER_CURL_CONSTANT(CURLE_TOO_MANY_REDIRECTS);
REGISTER_CURL_CONSTANT(CURLE_UNKNOWN_TELNET_OPTION);
REGISTER_CURL_CONSTANT(CURLE_TELNET_OPTION_SYNTAX);
REGISTER_CURL_CONSTANT(CURLE_OBSOLETE);
REGISTER_CURL_CONSTANT(CURLE_SSL_PEER_CERTIFICATE);
if (curl_global_init(CURL_GLOBAL_SSL) != CURLE_OK) {
return FAILURE;
}
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(curl)
{
curl_global_cleanup();
REGISTER_CURL_CONSTANT("CURLE_OK", CURLE_OK);
REGISTER_CURL_CONSTANT("CURLE_UNSUPPORTED_PROTOCOL", CURLE_UNSUPPORTED_PROTOCOL);
REGISTER_CURL_CONSTANT("CURLE_FAILED_INIT", CURLE_FAILED_INIT);
REGISTER_CURL_CONSTANT("CURLE_URL_MALFORMAT", CURLE_URL_MALFORMAT);
REGISTER_CURL_CONSTANT("CURLE_URL_MALFORMAT_USER", CURLE_URL_MALFORMAT_USER);
REGISTER_CURL_CONSTANT("CURLE_COULDNT_RESOLVE_PROXY", CURLE_COULDNT_RESOLVE_PROXY);
REGISTER_CURL_CONSTANT("CURLE_COULDNT_RESOLVE_HOST", CURLE_COULDNT_RESOLVE_HOST);
REGISTER_CURL_CONSTANT("CURLE_COULDNT_CONNECT", CURLE_COULDNT_CONNECT);
REGISTER_CURL_CONSTANT("CURLE_FTP_WEIRD_SERVER_REPLY", CURLE_FTP_WEIRD_SERVER_REPLY);
REGISTER_CURL_CONSTANT("CURLE_FTP_ACCESS_DENIED", CURLE_FTP_ACCESS_DENIED);
REGISTER_CURL_CONSTANT("CURLE_FTP_USER_PASSWORD_INCORRECT", CURLE_FTP_USER_PASSWORD_INCORRECT);
REGISTER_CURL_CONSTANT("CURLE_FTP_WEIRD_PASS_REPLY", CURLE_FTP_WEIRD_PASS_REPLY);
REGISTER_CURL_CONSTANT("CURLE_FTP_WEIRD_USER_REPLY", CURLE_FTP_WEIRD_USER_REPLY);
REGISTER_CURL_CONSTANT("CURLE_FTP_WEIRD_PASV_REPLY", CURLE_FTP_WEIRD_PASV_REPLY);
REGISTER_CURL_CONSTANT("CURLE_FTP_WEIRD_227_FORMAT", CURLE_FTP_WEIRD_227_FORMAT);
REGISTER_CURL_CONSTANT("CURLE_FTP_CANT_GET_HOST", CURLE_FTP_CANT_GET_HOST);
REGISTER_CURL_CONSTANT("CURLE_FTP_CANT_RECONNECT", CURLE_FTP_CANT_RECONNECT);
REGISTER_CURL_CONSTANT("CURLE_FTP_COULDNT_SET_BINARY", CURLE_FTP_COULDNT_SET_BINARY);
REGISTER_CURL_CONSTANT("CURLE_PARTIAL_FILE", CURLE_PARTIAL_FILE);
REGISTER_CURL_CONSTANT("CURLE_FTP_COULDNT_RETR_FILE", CURLE_FTP_COULDNT_RETR_FILE);
REGISTER_CURL_CONSTANT("CURLE_FTP_WRITE_ERROR", CURLE_FTP_WRITE_ERROR);
REGISTER_CURL_CONSTANT("CURLE_FTP_QUOTE_ERROR", CURLE_FTP_QUOTE_ERROR);
REGISTER_CURL_CONSTANT("CURLE_HTTP_NOT_FOUND", CURLE_HTTP_NOT_FOUND);
REGISTER_CURL_CONSTANT("CURLE_WRITE_ERROR", CURLE_WRITE_ERROR);
REGISTER_CURL_CONSTANT("CURLE_MALFORMAT_USER", CURLE_MALFORMAT_USER);
REGISTER_CURL_CONSTANT("CURLE_FTP_COULDNT_STOR_FILE", CURLE_FTP_COULDNT_STOR_FILE);
REGISTER_CURL_CONSTANT("CURLE_READ_ERROR", CURLE_READ_ERROR);
REGISTER_CURL_CONSTANT("CURLE_OUT_OF_MEMORY", CURLE_OUT_OF_MEMORY);
REGISTER_CURL_CONSTANT("CURLE_OPERATION_TIMEOUTED", CURLE_OPERATION_TIMEOUTED);
REGISTER_CURL_CONSTANT("CURLE_FTP_COULDNT_SET_ASCII", CURLE_FTP_COULDNT_SET_ASCII);
REGISTER_CURL_CONSTANT("CURLE_FTP_PORT_FAILED", CURLE_FTP_PORT_FAILED);
REGISTER_CURL_CONSTANT("CURLE_FTP_COULDNT_USE_REST", CURLE_FTP_COULDNT_USE_REST);
REGISTER_CURL_CONSTANT("CURLE_FTP_COULDNT_GET_SIZE", CURLE_FTP_COULDNT_GET_SIZE);
REGISTER_CURL_CONSTANT("CURLE_HTTP_RANGE_ERROR", CURLE_HTTP_RANGE_ERROR);
REGISTER_CURL_CONSTANT("CURLE_HTTP_POST_ERROR", CURLE_HTTP_POST_ERROR);
REGISTER_CURL_CONSTANT("CURLE_SSL_CONNECT_ERROR", CURLE_SSL_CONNECT_ERROR);
REGISTER_CURL_CONSTANT("CURLE_FTP_BAD_DOWNLOAD_RESUME", CURLE_FTP_BAD_DOWNLOAD_RESUME);
REGISTER_CURL_CONSTANT("CURLE_FILE_COULDNT_READ_FILE", CURLE_FILE_COULDNT_READ_FILE);
REGISTER_CURL_CONSTANT("CURLE_LDAP_CANNOT_BIND", CURLE_LDAP_CANNOT_BIND);
REGISTER_CURL_CONSTANT("CURLE_LDAP_SEARCH_FAILED", CURLE_LDAP_SEARCH_FAILED);
REGISTER_CURL_CONSTANT("CURLE_LIBRARY_NOT_FOUND", CURLE_LIBRARY_NOT_FOUND);
REGISTER_CURL_CONSTANT("CURLE_FUNCTION_NOT_FOUND", CURLE_FUNCTION_NOT_FOUND);
REGISTER_CURL_CONSTANT("CURLE_ABORTED_BY_CALLBACK", CURLE_ABORTED_BY_CALLBACK);
REGISTER_CURL_CONSTANT("CURLE_BAD_FUNCTION_ARGUMENT", CURLE_BAD_FUNCTION_ARGUMENT);
REGISTER_CURL_CONSTANT("CURLE_BAD_CALLING_ORDER", CURLE_BAD_CALLING_ORDER);
REGISTER_CURL_CONSTANT("CURLE_HTTP_PORT_FAILED", CURLE_HTTP_PORT_FAILED);
REGISTER_CURL_CONSTANT("CURLE_BAD_PASSWORD_ENTERED", CURLE_BAD_PASSWORD_ENTERED);
REGISTER_CURL_CONSTANT("CURLE_TOO_MANY_REDIRECTS", CURLE_TOO_MANY_REDIRECTS);
REGISTER_CURL_CONSTANT("CURLE_UNKOWN_TELNET_OPTION", CURLE_UNKNOWN_TELNET_OPTION);
REGISTER_CURL_CONSTANT("CURLE_TELNET_OPTION_SYNTAX", CURLE_TELNET_OPTION_SYNTAX);
REGISTER_CURL_CONSTANT("CURLE_ALREADY_COMPLETE", CURLE_ALREADY_COMPLETE);
return SUCCESS;
}
@@ -303,7 +277,6 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
zval *argv[2];
zval *retval;
int error;
TSRMLS_FETCH();
MAKE_STD_ZVAL(argv[0]);
MAKE_STD_ZVAL(argv[1]);
@@ -311,14 +284,14 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
ZVAL_RESOURCE(argv[0], ch->id);
zend_list_addref(ch->id);
ZVAL_STRINGL(argv[1], data, length, 1);
ZVAL_STRINGL(argv[1], data, (int) length, 1);
error = call_user_function(EG(function_table),
NULL,
t->func,
retval, 2, argv TSRMLS_CC);
if (error == FAILURE) {
php_error(E_WARNING, "Couldn't call the CURLOPT_WRITEFUNCTION");
php_error(E_WARNING, "Cannot call the CURLOPT_WRITEFUNCTION");
length = -1;
}
else {
@@ -344,6 +317,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
php_curl *ch = (php_curl *) ctx;
php_curl_read *t = ch->handlers->read;
int length = -1;
TSRMLS_FETCH();
switch (t->method) {
case PHP_CURL_DIRECT:
@@ -354,7 +328,6 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
zval *retval;
int length;
int error;
TSRMLS_FETCH();
MAKE_STD_ZVAL(argv[0]);
MAKE_STD_ZVAL(argv[1]);
@@ -365,7 +338,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
zend_list_addref(ch->id);
ZVAL_RESOURCE(argv[1], t->fd);
zend_list_addref(t->fd);
ZVAL_LONG(argv[2], (int) size * nmemb);
ZVAL_LONG(argv[2], size * nmemb);
error = call_user_function(EG(function_table),
NULL,
@@ -398,7 +371,8 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
{
php_curl *ch = (php_curl *) ctx;
php_curl_write *t = ch->handlers->write_header;
size_t length = size * nmemb;
int error;
int length;
TSRMLS_FETCH();
switch (t->method) {
@@ -406,30 +380,32 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
/* Handle special case write when we're returning the entire transfer
*/
if (ch->handlers->write->method == PHP_CURL_RETURN)
smart_str_appendl(&ch->handlers->write->buf, data, (int) length);
smart_str_appendl(&ch->handlers->write->buf, data, size * nmemb);
else
PUTS(data);
length = size * nmemb;
break;
case PHP_CURL_FILE:
return fwrite(data, size, nmemb, t->fp);
length = fwrite(data, size, nmemb, t->fp);
break;
case PHP_CURL_USER: {
zval *argv[2];
zval *retval;
int error;
TSRMLS_FETCH();
MAKE_STD_ZVAL(argv[0]);
MAKE_STD_ZVAL(argv[1]);
MAKE_STD_ZVAL(retval);
ZVAL_RESOURCE(argv[0], ch->id);
zend_list_addref(ch->id);
ZVAL_STRINGL(argv[1], data, length, 1);
ZVAL_STRINGL(argv[0], data, size * nmemb, 1);
error = call_user_function(EG(function_table),
NULL,
error = call_user_function(EG(function_table),
NULL,
t->func,
retval, 2, argv TSRMLS_CC);
retval, 2, argv TSRMLS_CC);
if (error == FAILURE) {
php_error(E_WARNING, "Couldn't call the CURLOPT_HEADERFUNCTION");
length = -1;
@@ -437,14 +413,17 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
else {
length = Z_LVAL_P(retval);
}
zval_ptr_dtor(&argv[0]);
zval_ptr_dtor(&argv[1]);
zval_ptr_dtor(&retval);
break;
}
case PHP_CURL_IGNORE:
return length;
}
length = size * nmemb;
break;
}
return length;
}
/* }}} */
@@ -456,7 +435,7 @@ static size_t curl_passwd(void *ctx, char *prompt, char *buf, int buflen)
php_curl *ch = (php_curl *) ctx;
zval *func = ch->handlers->passwd;
zval *argv[3];
zval *retval = NULL;
zval *retval;
int error;
int ret = 0;
TSRMLS_FETCH();
@@ -652,7 +631,6 @@ PHP_FUNCTION(curl_setopt)
case CURLOPT_FRESH_CONNECT:
case CURLOPT_FORBID_REUSE:
case CURLOPT_CONNECTTIMEOUT:
case CURLOPT_SSL_VERIFYHOST:
case CURLOPT_SSL_VERIFYPEER:
convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue));
@@ -674,9 +652,7 @@ PHP_FUNCTION(curl_setopt)
case CURLOPT_KRB4LEVEL:
case CURLOPT_RANDOM_FILE:
case CURLOPT_EGDSOCKET:
case CURLOPT_CAINFO:
case CURLOPT_COOKIEJAR:
case CURLOPT_SSL_CIPHER_LIST: {
case CURLOPT_CAINFO: {
char *copystr = NULL;
convert_to_string_ex(zvalue);
@@ -691,12 +667,9 @@ PHP_FUNCTION(curl_setopt)
case CURLOPT_INFILE:
case CURLOPT_WRITEHEADER:
case CURLOPT_STDERR: {
FILE *fp = NULL;
FILE *fp;
ZEND_FETCH_RESOURCE(fp, FILE *, zvalue, -1, "File-Handle", php_file_le_fopen());
if (!fp) {
RETURN_FALSE;
}
error = CURLE_OK;
switch (option) {
case CURLOPT_FILE:
@@ -757,11 +730,7 @@ PHP_FUNCTION(curl_setopt)
HashTable *postfields;
struct HttpPost *first = NULL;
struct HttpPost *last = NULL;
char *postval;
char *string_key = NULL;
ulong num_key;
uint string_key_len;
postfields = HASH_OF(*zvalue);
if (! postfields) {
php_error(E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
@@ -771,27 +740,23 @@ PHP_FUNCTION(curl_setopt)
for (zend_hash_internal_pointer_reset(postfields);
zend_hash_get_current_data(postfields, (void **) &current) == SUCCESS;
zend_hash_move_forward(postfields)) {
char *string_key = NULL;
char *postval = NULL;
ulong num_key;
SEPARATE_ZVAL(current);
convert_to_string_ex(current);
zend_hash_get_current_key_ex(postfields, &string_key, &string_key_len, &num_key, 0, NULL);
postval = Z_STRVAL_PP(current);
if (*postval == '@') {
error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key,
CURLFORM_FILE, ++postval, CURLFORM_END);
}
else {
error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key,
CURLFORM_PTRCONTENTS, postval,
CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current),
CURLFORM_END);
}
zend_hash_get_current_key(postfields, &string_key, &num_key, 0);
postval = emalloc(strlen(string_key) + Z_STRLEN_PP(current) + 1);
sprintf(postval, "%s=%s", string_key, Z_STRVAL_PP(current));
error = curl_formparse(postval, &first, &last);
}
SAVE_CURL_ERROR(ch, error);
if (error != CURLE_OK) {
SAVE_CURL_ERROR(ch, error);
RETURN_FALSE;
}
@@ -814,26 +779,26 @@ PHP_FUNCTION(curl_setopt)
case CURLOPT_QUOTE:
case CURLOPT_POSTQUOTE: {
zval **current;
HashTable *ph;
HashTable *hash;
struct curl_slist *slist = NULL;
ph = HASH_OF(*zvalue);
if (! ph) {
hash = HASH_OF(*zvalue);
if (! hash) {
php_error(E_WARNING,
"You must pass either an object or an array with the CURLOPT_HTTPHEADER,"
"CURLOPT_QUOTE and CURLOPT_POSTQUOTE arguments");
"You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE and CURLOPT_POSTQUOTE arguments");
RETURN_FALSE;
}
for (zend_hash_internal_pointer_reset(ph);
zend_hash_get_current_data(ph, (void **) &current) == SUCCESS;
zend_hash_move_forward(ph)) {
for (zend_hash_internal_pointer_reset(hash);
zend_hash_get_current_data(hash, (void **) &current) == SUCCESS;
zend_hash_move_forward(hash)) {
char *indiv = NULL;
SEPARATE_ZVAL(current);
convert_to_string_ex(current);
indiv = estrndup(Z_STRVAL_PP(current), Z_STRLEN_PP(current) + 1);
indiv[Z_STRLEN_PP(current)] = '\0';
slist = curl_slist_append(slist, indiv);
if (! slist) {
efree(indiv);
@@ -849,9 +814,9 @@ PHP_FUNCTION(curl_setopt)
break;
}
}
SAVE_CURL_ERROR(ch, error);
if (error != CURLE_OK) {
SAVE_CURL_ERROR(ch, error);
RETURN_FALSE;
} else {
RETURN_TRUE;
@@ -874,14 +839,14 @@ PHP_FUNCTION(curl_exec)
ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl);
error = curl_easy_perform(ch->cp);
SAVE_CURL_ERROR(ch, error);
if (error != CURLE_OK) {
if (ch->handlers->write->buf.len > 0)
if (ch->handlers->write->buf.c)
smart_str_free(&ch->handlers->write->buf);
SAVE_CURL_ERROR(ch, error);
RETURN_FALSE;
}
if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) {
if (ch->handlers->write->method == PHP_CURL_RETURN) {
if (ch->handlers->write->type != PHP_CURL_BINARY)
smart_str_0(&ch->handlers->write->buf);
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 0);
@@ -891,10 +856,6 @@ PHP_FUNCTION(curl_exec)
}
/* }}} */
#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s), v);
#define CAAD(s, v) add_assoc_double_ex(return_value, s, sizeof(s), v);
#define CAAS(s, v) add_assoc_string_ex(return_value, s, sizeof(s), v, 1);
/* {{{ proto string curl_getinfo(int ch, int opt)
Get information regarding a specific transfer */
PHP_FUNCTION(curl_getinfo)
@@ -919,37 +880,31 @@ PHP_FUNCTION(curl_getinfo)
array_init(return_value);
curl_easy_getinfo(ch->cp, CURLINFO_EFFECTIVE_URL, &url);
CAAS("url", url);
add_assoc_string(return_value, "url", url, 1);
curl_easy_getinfo(ch->cp, CURLINFO_HTTP_CODE, &l_code);
CAAL("http_code", l_code);
add_assoc_long(return_value, "http_code", l_code);
curl_easy_getinfo(ch->cp, CURLINFO_HEADER_SIZE, &l_code);
CAAL("header_size", l_code);
add_assoc_long(return_value, "header_size", l_code);
curl_easy_getinfo(ch->cp, CURLINFO_REQUEST_SIZE, &l_code);
CAAL("request_size", l_code);
add_assoc_long(return_value, "request_size", l_code);
curl_easy_getinfo(ch->cp, CURLINFO_FILETIME, &l_code);
CAAL("filetime", l_code);
curl_easy_getinfo(ch->cp, CURLINFO_SSL_VERIFYRESULT, &l_code);
CAAL("ssl_verify_result", l_code);
add_assoc_long(return_value, "filetime", l_code);
curl_easy_getinfo(ch->cp, CURLINFO_TOTAL_TIME, &d_code);
CAAD("total_time", d_code);
add_assoc_double(return_value, "total_time", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_NAMELOOKUP_TIME, &d_code);
CAAD("namelookup_time", d_code);
add_assoc_double(return_value, "namelookup_time", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_CONNECT_TIME, &d_code);
CAAD("connect_time", d_code);
add_assoc_double(return_value, "connect_time", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_PRETRANSFER_TIME, &d_code);
CAAD("pretransfer_time", d_code);
add_assoc_double(return_value, "pretransfer_time", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_SIZE_UPLOAD, &d_code);
CAAD("size_upload", d_code);
add_assoc_double(return_value, "size_upload", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_SIZE_DOWNLOAD, &d_code);
CAAD("size_download", d_code);
add_assoc_double(return_value, "size_download", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_SPEED_DOWNLOAD, &d_code);
CAAD("speed_download", d_code);
add_assoc_double(return_value, "speed_download", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_SPEED_UPLOAD, &d_code);
CAAD("speed_upload", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d_code);
CAAD("download_content_length", d_code);
curl_easy_getinfo(ch->cp, CURLINFO_CONTENT_LENGTH_UPLOAD, &d_code);
CAAD("upload_content_length", d_code);
add_assoc_double(return_value, "speed_upload", d_code);
} else {
option = Z_LVAL_PP(zoption);
switch (option) {
@@ -964,8 +919,7 @@ PHP_FUNCTION(curl_getinfo)
case CURLINFO_HTTP_CODE:
case CURLINFO_HEADER_SIZE:
case CURLINFO_REQUEST_SIZE:
case CURLINFO_FILETIME:
case CURLINFO_SSL_VERIFYRESULT: {
case CURLINFO_FILETIME: {
long code;
curl_easy_getinfo(ch->cp, option, &code);
@@ -980,9 +934,7 @@ PHP_FUNCTION(curl_getinfo)
case CURLINFO_SIZE_UPLOAD:
case CURLINFO_SIZE_DOWNLOAD:
case CURLINFO_SPEED_DOWNLOAD:
case CURLINFO_SPEED_UPLOAD:
case CURLINFO_CONTENT_LENGTH_DOWNLOAD:
case CURLINFO_CONTENT_LENGTH_UPLOAD: {
case CURLINFO_SPEED_UPLOAD: {
double code;
curl_easy_getinfo(ch->cp, option, &code);
@@ -1078,6 +1030,6 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+8 -8
View File
@@ -46,7 +46,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
# ADD LINK32 php4ts.lib libcurl.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 wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
# ADD LINK32 php4ts.lib libcurl.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 wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS"
@@ -74,7 +74,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
@@ -84,7 +84,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
# ADD LINK32 php4ts_debug.lib libcurl.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 wsock32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
# ADD LINK32 php4ts_debug.lib libcurl.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 wsock32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS"
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS_SSL"
@@ -102,7 +102,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
@@ -113,7 +113,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 php4ts_debug.lib libcurl.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 /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS"
# SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 php4ts_debug.lib libcurl.lib ssleay32.lib libeay32.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 wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
# ADD LINK32 php4ts_debug.lib libcurl.lib ssleay32.lib libeay32.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 wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS"
# SUBTRACT LINK32 /pdb:none /nodefaultlib
!ELSEIF "$(CFG)" == "curl - Win32 Release_TS_SSL"
@@ -131,7 +131,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x406 /d "NDEBUG"
@@ -142,7 +142,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 php4ts.lib libcurl.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 /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
# SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 php4ts.lib libcurl.lib ssleay32.lib libeay32.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 wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
# ADD LINK32 php4ts.lib libcurl.lib ssleay32.lib libeay32.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 wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
# SUBTRACT LINK32 /pdb:none
!ENDIF
+2 -3
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -41,7 +41,6 @@ extern zend_module_entry curl_module_entry;
#define CURLOPT_BINARYTRANSFER 19914
PHP_MINIT_FUNCTION(curl);
PHP_MSHUTDOWN_FUNCTION(curl);
PHP_MINFO_FUNCTION(curl);
PHP_FUNCTION(curl_version);
PHP_FUNCTION(curl_init);
+2 -3
View File
@@ -1,6 +1,5 @@
dnl
dnl $Id$
dnl
dnl config.m4 for extension CyberCash
dnl don't forget to call PHP_EXTENSION(cybercash)
AC_MSG_CHECKING(for CyberCash support)
AC_ARG_WITH(cybercash,
+5 -7
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -45,7 +45,6 @@ function_entry cybercash_functions[] = {
/* {{{ cybercash_module_entry
*/
zend_module_entry cybercash_module_entry = {
STANDARD_MODULE_HEADER,
"cybercash",
cybercash_functions,
NULL,
@@ -53,7 +52,6 @@ zend_module_entry cybercash_module_entry = {
NULL,
NULL,
PHP_MINFO(cybercash),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES,
};
/* }}} */
@@ -72,7 +70,7 @@ PHP_MINFO_FUNCTION(cybercash)
}
/* }}} */
/* {{{ proto array cybercash_encr(string wmk, string sk, string data)
/* {{{ proto cybercash_encr(string wmk, string sk, string data)
Cybercash encrypt */
PHP_FUNCTION(cybercash_encr)
{
@@ -225,6 +223,6 @@ PHP_FUNCTION(cybercash_base64_decode)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+3 -3
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Evan Klinger <evan715@sirius.com> |
| Authors: Evan Klinger <evan715@sirius.com> |
+----------------------------------------------------------------------+
*/
+1 -1
View File
@@ -36,7 +36,7 @@
$more=list($key,$val)=each($CCNVList);
while(!$done)
{
$pairs.=rtrim($key)."=".urlencode(rtrim($val));
$pairs.=chop($key)."=".urlencode(chop($val));
$more=list($key,$val)=each($CCNVList);
if($more)
+3 -2
View File
@@ -1,10 +1,11 @@
dnl
dnl $Id$
dnl
dnl config.m4 for extension cybermut
PHP_ARG_WITH(cybermut, for cybermut support,
[ --with-cybermut[=DIR] Include CyberMut (french Credit Mutuel telepaiement)])
if test "$PHP_CYBERMUT" != "no"; then
for i in /usr/local /usr $PHP_CYBERMUT; do
if test -r $i/cm-mac.h; then
+15 -10
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Sylvain PAGES <spages@free.fr> |
| Authors: Sylvain PAGES <spages@free.fr> |
+----------------------------------------------------------------------+
*/
@@ -48,7 +48,6 @@ function_entry cybermut_functions[] = {
/* {{{ cybermut_module_entry
*/
zend_module_entry cybermut_module_entry = {
STANDARD_MODULE_HEADER,
"cybermut",
cybermut_functions,
PHP_MINIT(cybermut),
@@ -56,7 +55,6 @@ zend_module_entry cybermut_module_entry = {
NULL,
NULL,
PHP_MINFO(cybermut),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
/* }}} */
@@ -86,7 +84,9 @@ PHP_MINFO_FUNCTION(cybermut)
/* }}} */
/* {{{ proto string cybermut_creerformulairecm(string url_CM, string version, string TPE, string montant, string ref_commande, string texte_libre, string url_retour, string url_retour_ok, string url_retour_err, string langue, string code_societe, string texte_bouton)
Returns a string containing source HTML of the form of request for payment. This result corresponds to the last parameter "formulaire" of the original function which was removed */
Return a string containing source HTML of the form of request for payment.
This result corresponds to the last parameter "formulaire" of the original function
which was removed */
PHP_FUNCTION(cybermut_creerformulairecm)
{
zval **url_CM, **version, **TPE, **montant, **ref_commande, **texte_libre, **url_retour, **url_retour_ok, **url_retour_err, **langue, **code_societe, **texte_bouton;
@@ -119,7 +119,9 @@ PHP_FUNCTION(cybermut_creerformulairecm)
/* }}} */
/* {{{ proto bool cybermut_testmac(string code_MAC, string version, string TPE, string cdate, string montant, string ref_commande, string texte_libre, string code_retour)
Returns a boolean attesting that the authentification proceeded well. TRUE if the received message is authenticated and FALSE if not */
Return a boolean attesting that the authentification proceeded well
true : the received message is authenticated
false: if not */
PHP_FUNCTION(cybermut_testmac)
{
zval **code_MAC, **version, **TPE, **cdate, **montant, **ref_commande, **texte_libre, **code_retour;
@@ -150,7 +152,10 @@ PHP_FUNCTION(cybermut_testmac)
/* }}} */
/* {{{ proto string cybermut_creerreponsecm(string phrase)
Returns a string containing the message of acknowledgement of delivery (headers and body of the message). This result corresponds to the last parameter "reponse" of the original function which was removed */
Return a string containing the message of acknowledgement of delivery
(headers and body of the message).
This result corresponds to the last parameter "reponse" of the original function
which was removed. */
PHP_FUNCTION(cybermut_creerreponsecm)
{
zval **phrase;
@@ -173,6 +178,6 @@ PHP_FUNCTION(cybermut_creerreponsecm)
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+4 -3
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,8 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Sylvain PAGES <spages@free.fr> |
| Authors: Sylvain PAGES <spages@free.fr> |
| |
+----------------------------------------------------------------------+
*/
+2 -4
View File
@@ -1,9 +1,7 @@
dnl
dnl $Id$
dnl
dnl config.m4 for extension cyrus
PHP_ARG_WITH(cyrus, for cyrus imap support,
[ --with-cyrus Include cyrus imap support])
[ --with-cyrus Include cyrus imap support])
if test "$PHP_CYRUS" != "no"; then
found_cyrus=no
+18 -37
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Sterling Hughes <sterling@php.net> |
| Authors: Sterling Hughes <sterling@php.net> |
+----------------------------------------------------------------------+
*/
@@ -48,7 +48,6 @@ function_entry cyrus_functions[] = {
};
zend_module_entry cyrus_module_entry = {
STANDARD_MODULE_HEADER,
"cyrus",
cyrus_functions,
PHP_MINIT(cyrus),
@@ -56,7 +55,6 @@ zend_module_entry cyrus_module_entry = {
NULL,
NULL,
PHP_MINFO(cyrus),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
@@ -85,9 +83,9 @@ PHP_MINIT_FUNCTION(cyrus)
le_cyrus = zend_register_list_destructors_ex(cyrus_free, NULL,
le_cyrus_name, module_number);
REGISTER_LONG_CONSTANT("CYRUS_CONN_NONSYNCLITERAL",
IMCLIENT_CONN_NONSYNCLITERAL,
CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CYRUS_CONN_NOSYNCLITERAL",
IMCLIENT_CONN_NOSYNCLITERAL,
CONST_CS_ | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("CYRUS_CONN_INITIALRESPONSE",
IMCLIENT_CONN_INITIALRESPONSE,
CONST_CS | CONST_PERSISTENT);
@@ -111,8 +109,6 @@ extern void fatal(char *s, int exit)
php_error(E_ERROR, s);
}
/* {{{ proto resource cyrus_connect([ string host [, string port [, int flags]]])
Connect to a Cyrus IMAP server */
PHP_FUNCTION(cyrus_connect)
{
zval **z_host;
@@ -178,8 +174,6 @@ PHP_FUNCTION(cyrus_connect)
ZEND_REGISTER_RESOURCE(return_value, conn, le_cyrus);
conn->id = Z_LVAL_P(return_value);
}
/* }}} */
static void cyrus_capable_callback(struct imclient *client, void *rock,
struct imclient_reply *reply)
@@ -201,9 +195,6 @@ static void cyrus_capable_callback(struct imclient *client, void *rock,
}
}
/* {{{ proto bool cyrus_authenticate( resource connection [, string mechlist [, string service [, string user [, int minssf [, int maxssf]]]]])
Authenticate agaings a Cyrus IMAP server */
PHP_FUNCTION(cyrus_authenticate)
{
zval **z_conn;
@@ -275,13 +266,13 @@ PHP_FUNCTION(cyrus_authenticate)
}
else {
/* XXX: UGLY, but works, determines the username to use */
user = (char *) sapi_getenv("USER", 4);
user = sapi_getenv("USER", 4);
if (! user) {
user = (char *) getenv("USER");
user = getenv("USER");
if (! user) {
user = (char *) sapi_getenv("LOGNAME", 7);
user = sapi_getenv("LOGNAME", 7);
if (! user) {
user = (char *) getenv("LOGNAME");
user = getenv("LOGNAME");
if (! user) {
struct passwd *pwd = getpwuid(getuid());
if (! pwd) {
@@ -321,8 +312,6 @@ PHP_FUNCTION(cyrus_authenticate)
efree(service);
efree(user);
}
/* }}} */
static void cyrus_generic_callback(struct imclient *client,
void *rock,
@@ -357,7 +346,7 @@ static void cyrus_generic_callback(struct imclient *client,
argv[3] = &msgno;
if (call_user_function_ex(EG(function_table), NULL, callback->function,
&retval, 4, argv, 0, NULL TSRMLS_CC) == FAILURE) {
&retval, 4, argv, 0, NULL) == FAILURE) {
php_error(E_WARNING, "Couldn't call the %s handler",
callback->trigger);
}
@@ -375,8 +364,7 @@ static void cyrus_generic_callback(struct imclient *client,
}
/* {{{ proto bool cyrus_bind( resource connection, array callbacks)
Bind callbacks to a Cyrus IMAP connection */
PHP_FUNCTION(cyrus_bind)
{
zval **z_conn;
@@ -388,8 +376,8 @@ PHP_FUNCTION(cyrus_bind)
char *string_key;
ulong num_key;
if (ZEND_NUM_ARGS() != 2 ||
zend_get_parameters_ex(2, &z_conn, &z_callback) == FAILURE) {
if (ZEND_NUM_ARGS() != 3 ||
zend_get_parameters_ex(3, &z_conn, &z_callback) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -441,10 +429,7 @@ PHP_FUNCTION(cyrus_bind)
RETURN_TRUE;
}
/* }}} */
/* {{{ proto bool cyrus_unbind( resource connection, string trigger_name)
Unbind ... */
PHP_FUNCTION(cyrus_unbind)
{
zval **z_conn;
@@ -463,10 +448,7 @@ PHP_FUNCTION(cyrus_unbind)
RETURN_TRUE;
}
/* }}} */
/* {{{ proto bool cyrus_query( resource connection, string query)
Send a query to a Cyrus IMAP server */
PHP_FUNCTION(cyrus_query)
{
zval **z_conn;
@@ -480,14 +462,13 @@ PHP_FUNCTION(cyrus_query)
ZEND_FETCH_RESOURCE(conn, php_cyrus *, z_conn, -1, le_cyrus_name, le_cyrus);
convert_to_string_ex(query);
imclient_send(conn->client, NULL, NULL, Z_STRVAL_PP(query));
if (imclient_send(conn->client, NULL, NULL, Z_STRVAL_PP(query)) != 0)
RETURN_FALSE;
RETURN_TRUE;
}
/* }}} */
/* {{{ proto bool cyrus_close( resource connection)
Close connection to a cyrus server */
PHP_FUNCTION(cyrus_close)
{
zval **z_conn;
@@ -503,7 +484,7 @@ PHP_FUNCTION(cyrus_close)
RETURN_TRUE;
}
/* }}} */
#endif
+3 -3
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Sterling Hughes <sterling@php.net> |
| Authors: Sterling Hughes <sterling@php.net> |
+----------------------------------------------------------------------+
*/
+4 -3
View File
@@ -1,6 +1,7 @@
dnl
dnl $Id$
dnl
dnl config.m4 for extension db
dnl don't forget to call PHP_EXTENSION(db)
# Checks for libraries.
# Prefer gdbm, Berkeley DB and ndbm/dbm, in that order
@@ -25,7 +26,7 @@ AC_DEFUN(AC_PREFERRED_DB_LIB,[
])
PHP_ARG_WITH(db, for xDBM support,
PHP_ARG_WITH(db, whether to include old xDBM support,
[ --with-db Include old xDBM support (deprecated)])
if test "$PHP_DB" != "no"; then
+104 -32
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| 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@php.net> |
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
@@ -20,6 +20,8 @@
/* $Id$ */
#define IS_EXT_MODULE
#if 1
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -156,6 +158,14 @@ datum flatfile_nextkey(FILE *dbf);
static int le_db;
#if THREAD_SAFE
DWORD DbmTls;
static int numthreads=0;
#endif
/*needed for blocking calls in windows*/
void *dbm_mutex;
/* {{{ php_find_dbm
*/
dbm_info *php_find_dbm(pval *id TSRMLS_DC)
@@ -437,8 +447,9 @@ PHP_FUNCTION(dbmclose)
/* {{{ php_dbm_close
*/
void php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC)
int php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC)
{
int ret = 0;
dbm_info *info = (dbm_info *)rsrc->ptr;
DBM_TYPE dbf;
int lockfd;
@@ -462,6 +473,8 @@ void php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC)
if (info->filename) efree(info->filename);
if (info->lockfn) efree(info->lockfn);
efree(info);
return(ret);
}
/* }}} */
@@ -490,12 +503,46 @@ PHP_FUNCTION(dbminsert)
RETURN_FALSE;
}
ret = php_dbm_insert_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value), 0 TSRMLS_CC);
ret = php_dbm_insert(info, Z_STRVAL_P(key), Z_STRVAL_P(value) TSRMLS_CC);
RETURN_LONG(ret);
}
/* }}} */
/* {{{ php_dbm_insert
*/
int php_dbm_insert(dbm_info *info, char *key, char *value TSRMLS_DC) {
datum key_datum, value_datum;
int ret;
DBM_TYPE dbf;
php_stripslashes(key, NULL TSRMLS_CC);
php_stripslashes(value, NULL TSRMLS_CC);
value_datum.dptr = estrdup(value);
value_datum.dsize = strlen(value);
key_datum.dptr = estrdup(key);
key_datum.dsize = strlen(key);
#if GDBM_FIX
key_datum.dsize++;
#endif
dbf = info->dbf;
if (!dbf) {
php_error(E_WARNING, "Unable to locate dbm file");
return 1;
}
ret = DBM_STORE(dbf, key_datum, value_datum, DBM_INSERT);
/* free the memory */
efree(key_datum.dptr); efree(value_datum.dptr);
return(ret);
}
/* }}} */
/* {{{ proto int dbmreplace(int dbm_identifier, string key, string value)
Replaces the value for a key in a dbm database */
PHP_FUNCTION(dbmreplace)
@@ -516,31 +563,28 @@ PHP_FUNCTION(dbmreplace)
RETURN_FALSE;
}
ret = php_dbm_insert_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value), 1 TSRMLS_CC);
ret = php_dbm_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value) TSRMLS_CC);
RETURN_LONG(ret);
}
/* }}} */
/* {{{ php_dbm_replace
*/
int php_dbm_insert_replace(dbm_info *info, char *key, char *value, int replace_mode TSRMLS_DC)
int php_dbm_replace(dbm_info *info, char *key, char *value TSRMLS_DC)
{
DBM_TYPE dbf;
int ret;
datum key_datum, value_datum;
key = estrdup(key);
value = estrdup(value);
if (PG(magic_quotes_runtime)) {
php_stripslashes(key, NULL TSRMLS_CC);
php_stripslashes(value, NULL TSRMLS_CC);
}
value_datum.dptr = value;
value_datum.dptr = estrdup(value);
value_datum.dsize = strlen(value);
key_datum.dptr = key;
key_datum.dptr = estrdup(key);
key_datum.dsize = strlen(key);
#if GDBM_FIX
key_datum.dsize++;
@@ -548,16 +592,12 @@ int php_dbm_insert_replace(dbm_info *info, char *key, char *value, int replace_m
dbf = info->dbf;
if (!dbf) {
php_error(E_WARNING, "%s(): Unable to locate dbm file", get_active_function_name(TSRMLS_C));
ret = 1;
} else {
if (!replace_mode) {
ret = DBM_STORE(dbf, key_datum, value_datum, DBM_INSERT);
} else {
ret = DBM_STORE(dbf, key_datum, value_datum, DBM_REPLACE);
}
php_error(E_WARNING, "Unable to locate dbm file");
return 1;
}
ret = DBM_STORE(dbf, key_datum, value_datum, DBM_REPLACE);
/* free the memory */
efree(key_datum.dptr); efree(value_datum.dptr);
@@ -1121,11 +1161,50 @@ datum flatfile_nextkey(FILE *dbf) {
*/
PHP_MINIT_FUNCTION(db)
{
#if defined(THREAD_SAFE)
dbm_global_struct *dbm_globals;
PHP_MUTEX_ALLOC(dbm_mutex);
PHP_MUTEX_LOCK(dbm_mutex);
numthreads++;
if (numthreads==1){
if (!PHP3_TLS_PROC_STARTUP(DbmTls)){
PHP_MUTEX_UNLOCK(dbm_mutex);
PHP_MUTEX_FREE(dbm_mutex);
return FAILURE;
}
}
PHP_MUTEX_UNLOCK(dbm_mutex);
if(!PHP3_TLS_THREAD_INIT(DbmTls, dbm_globals, dbm_global_struct)){
PHP_MUTEX_FREE(dbm_mutex);
return FAILURE;
}
#endif
le_db = zend_register_list_destructors_ex(php_dbm_close, NULL, "dbm", module_number);
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
static PHP_MSHUTDOWN_FUNCTION(db)
{
#ifdef THREAD_SAFE
PHP3_TLS_THREAD_FREE(dbm_globals);
PHP_MUTEX_LOCK(dbm_mutex);
numthreads--;
if (numthreads<1) {
PHP3_TLS_PROC_SHUTDOWN(DbmTls);
PHP_MUTEX_UNLOCK(dbm_mutex);
PHP_MUTEX_FREE(dbm_mutex);
return SUCCESS;
}
PHP_MUTEX_UNLOCK(dbm_mutex);
#endif
return SUCCESS;
}
/* }}} */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(db)
@@ -1155,27 +1234,20 @@ function_entry dbm_functions[] = {
/* }}} */
zend_module_entry dbm_module_entry = {
STANDARD_MODULE_HEADER,
"db",
dbm_functions,
PHP_MINIT(db),
NULL,
PHP_RINIT(db),
NULL,
PHP_MINFO(db),
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
"db", dbm_functions, PHP_MINIT(db), PHP_MSHUTDOWN(db), PHP_RINIT(db), NULL, PHP_MINFO(db), STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_DB
ZEND_GET_MODULE(dbm)
#endif
#endif
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
* vim600: sw=4 ts=4 tw=78 fdm=marker
* vim<600: sw=4 ts=4 tw=78
*/
+1 -1
View File
@@ -82,7 +82,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib /nologo /dll /machine:I386
# ADD LINK32 php4ts_debug.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 /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_db.dll" /libpath:"..\..\Debug_TS"
# ADD LINK32 libdb31s.lib php4ts_debug.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 /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_db.dll" /libpath:"..\..\Debug_TS"
!ENDIF
+6 -5
View File
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2002 The PHP Group |
| Copyright (c) 1997-2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -12,7 +12,7 @@
| 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@php.net> |
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
@@ -52,10 +52,11 @@ typedef struct dbm_info {
#endif
dbm_info *php_find_dbm(pval *id TSRMLS_DC);
void php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
int php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC);
int php_dbm_insert(dbm_info *info, char *key, char *value TSRMLS_DC);
char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC);
int php_dbm_insert_replace(dbm_info *info, char *key, char *value, int insert_mode TSRMLS_DC);
int php_dbm_replace(dbm_info *info, char *key, char *value TSRMLS_DC);
int php_dbm_exists(dbm_info *info, char *key);
int php_dbm_delete(dbm_info *info, char *key);
char *php_dbm_first_key(dbm_info *info);
+3 -2
View File
@@ -1,6 +1,6 @@
dnl
dnl $Id$
dnl
dnl config.m4 for extension dba
dnl don't forget to call PHP_EXTENSION(dba)
AC_DEFUN(PHP_TEMP_LDFLAGS,[
old_LDFLAGS=$LDFLAGS
@@ -230,5 +230,6 @@ if test "$HAVE_DBA" = "1"; then
PHP_SUBST(DBA_SHARED_LIBADD)
else
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_DBA, 0, [ ])
fi
Loaded 100 of 1088 files, more files were not shown because too many files have changed in this diff. Show more