mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-20 07:26:38 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee3f5cecea |
No files matched your search
-345
@@ -1,345 +0,0 @@
|
||||
List of PHP maintainers
|
||||
=======================
|
||||
|
||||
Maintenance legend
|
||||
------------------
|
||||
Supported: Someone is actually paid to look after this.
|
||||
Maintained: Someone actually looks after it.
|
||||
Odd Fixes: It has a maintainer but they don't have time to do
|
||||
much other than throw the odd patch in. See below.
|
||||
Orphan: No current maintainer [but maybe you could take the
|
||||
role as you write your new code].
|
||||
Obsolete: Old code. Something tagged obsolete generally means
|
||||
it has been replaced by a better system and you
|
||||
should be using that.
|
||||
Unknown: Not known at this time.
|
||||
|
||||
Status legend
|
||||
-------------
|
||||
Working: Working under both Windows and Unix.
|
||||
Windows: Working only under Windows.
|
||||
Unix: Working only under Unix.
|
||||
Experimental: Under development or initial release.
|
||||
Not Working: Not working.
|
||||
Unknown: Status unknown.
|
||||
|
||||
|
||||
== Server APIs ==
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: aolserver
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: apache
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cgi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fhttpd
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: isapi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: nsapi
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: phttpd
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pi3web
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: roxen
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: servlet
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: thttpd
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
== Database extensions ==
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dba
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: dbase
|
||||
PRIMARY MAINTAINER: Jim Winstead <jimw@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: filepro
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: hyperwave
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: informix
|
||||
PRIMARY MAINTAINER: Danny Heijl <Danny.Heijl@cevi.be>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ingres_ii
|
||||
PRIMARY MAINTAINER: David Hénot <henot@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: msql
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mssql
|
||||
PRIMARY MAINTAINER: Frank M. Kromann <fmk@swwwing.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Tested on phpts and isapi versions
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mysql
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pgsql
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
MAINTENANCE: Odd fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sybase
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Not Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sybase_ct
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: odbc
|
||||
PRIMARY MAINTAINER: Andreas Karajannis <Karajannis@gmd.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Working except for persistent connections
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: oracle
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
== Other extensions ==
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: aspell
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
COMMENT: For aspell .27 and greater, check out the pspell extension
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: bcmath
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: calendar
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: com
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cpdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: CURL
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: cybercash
|
||||
PRIMARY MAINTAINER: Evan Klinger <evan715@sirius.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: domxml
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Experimental
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: exif
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: fdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ftp
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: gettext
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: icap
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: imap
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: java
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcal
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mcrypt
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
COMMENT: Currently working only with libmcrypt 2.7.7 and earlier
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: mhash
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pcre
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pfpro
|
||||
PRIMARY MAINTAINER: David Croft <david@infotrek.co.uk>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: posix
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: pspell
|
||||
PRIMARY MAINTAINER: Vlad Krupin <phpdevel@echospace.com>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: readline
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: recode
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: snmp
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
MAINTENANCE: Odd Fixes
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sockets
|
||||
PRIMARY MAINTAINER: Chris Vandomelen <chrisv@b0rked.dhs.org>
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.2
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: swf
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unix (won't change)
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sysvsem
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: sysvshm
|
||||
MAINTENANCE: Unknown
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: wddx
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: xml
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: yaz
|
||||
PRIMARY MAINTAINER: Adam Dickmeiss <adam@indexdata.dk>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Unknown
|
||||
SINCE: 4.0.1
|
||||
-------------------------------------------------------------------------------
|
||||
EXTENSION: zlib
|
||||
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
|
||||
MAINTENANCE: Maintained
|
||||
STATUS: Working
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
# iptc?
|
||||
@@ -8,29 +8,12 @@ and then a static module. A more verbose explanation follows.
|
||||
Note! 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.
|
||||
|
||||
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:
|
||||
|
||||
/usr/local/lib/mysql/libmysqlclient.so
|
||||
|
||||
Make sure /etc/ld.so.conf contains:
|
||||
|
||||
/usr/local/lib/mysql
|
||||
|
||||
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.
|
||||
|
||||
INSTALLATION WITH THE ZEUS WEB SERVER:
|
||||
--Please see the 'README.Zeus' file included in this distribution
|
||||
|
||||
|
||||
QUICK INSTALL (DSO)
|
||||
|
||||
For this to work your Apache httpd must have mod_so enabled.
|
||||
@@ -53,9 +36,6 @@ If you get an error telling you that the apxs script could not be found,
|
||||
look for it on your system and if you find it, provide the full path to it
|
||||
as: --with-apxs=/path/to/apxs
|
||||
|
||||
Next you must copy php.ini-dist to the appropriate place (normally
|
||||
/usr/local/lib/php.ini) and edit it as necessary to set PHP options.
|
||||
|
||||
The only thing left to do is to edit your httpd.conf file and make sure the
|
||||
PHP 4 mime type is there and uncommented. You need a line that looks like
|
||||
this:
|
||||
@@ -84,10 +64,10 @@ $ cd ../apache_1.3.x
|
||||
$ ./configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
|
||||
(The above line is correct! Yes, we know libphp4.a does not exist at this
|
||||
stage. It isn't supposed to. It will be created.)
|
||||
$ make
|
||||
make
|
||||
(you should now have an httpd binary which you can copy to your Apache bin dir)
|
||||
$ cd ../php-4.0.x
|
||||
$ cp php.ini-dist /usr/local/lib/php.ini
|
||||
cd ../php-4.0.x
|
||||
cp php.ini-dist /usr/local/lib/php.ini
|
||||
You can edit /usr/local/lib/php.ini file to set PHP options.
|
||||
Edit your httpd.conf or srm.conf file and add:
|
||||
AddType application/x-httpd-php .php
|
||||
@@ -283,12 +263,14 @@ Installing PHP can be done in four simple steps:
|
||||
Note! If a line has a # at the beginning, then it is commented out
|
||||
and you need to remove the # for that line to take effect.
|
||||
|
||||
Finally you need to copy php.ini-dist to the appropriate place
|
||||
(normally /usr/local/lib/php.ini) and edit if necessary.
|
||||
|
||||
Once you have made these changes you should be ready to restart your
|
||||
server and try it out. Type: apachectl restart
|
||||
|
||||
The create a test file named test.php in your web tree somewhere and
|
||||
put some test PHP tags in it. <?phpinfo()?> is a good first test.
|
||||
This tag tells PHP to do a braindump and tells you all sorts of things
|
||||
about itself.
|
||||
|
||||
4b. Setting up the server. (Static Module)
|
||||
|
||||
You should now have a new httpd binary. Shut down your existing server,
|
||||
@@ -307,25 +289,13 @@ Installing PHP can be done in four simple steps:
|
||||
Any file ending in .phps will now be displayed with full colour syntax
|
||||
highlighting instead of being executed.
|
||||
|
||||
Note that on some older server setups, the AddType lines are in the
|
||||
conf/srm.conf file instead of conf/httpd.conf.
|
||||
When you are finished making changes to your httpd.conf file, you can
|
||||
start up your server. Note that on some older server setups, the
|
||||
AddType lines are in the conf/srm.conf file instead of conf/httpd.conf.
|
||||
|
||||
Note! If a line has a # at the beginning, then it is commented out
|
||||
and you need to remove the # for that line to take effect.
|
||||
|
||||
When you are finished making changes to your httpd.conf file, you need
|
||||
to copy php.ini-dist to the appropriate place (normally
|
||||
/usr/local/lib/php.ini) and edit if necessary. You can then
|
||||
start up your server.
|
||||
|
||||
5. Testing it all worked
|
||||
|
||||
Create a test file named test.php in your web tree somewhere and
|
||||
put some test PHP tags in it. <?phpinfo()?> is a good first test.
|
||||
This tag tells PHP to do a braindump and tells you all sorts of things
|
||||
about itself.
|
||||
|
||||
|
||||
WHY DISABLING -fPIC WORKS ON LINUX
|
||||
|
||||
From: Martin v. Loewis <martin@loewis.home.cs.tu-berlin.de>
|
||||
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
List of PHP maintainers
|
||||
=======================
|
||||
|
||||
Status legend
|
||||
-------------
|
||||
Supported: Someone is actually paid to look after this.
|
||||
Maintained: Someone actually looks after it.
|
||||
Odd Fixes: It has a maintainer but they don't have time to do
|
||||
much other than throw the odd patch in. See below..
|
||||
Orphan: No current maintainer [but maybe you could take the
|
||||
role as you write your new code].
|
||||
Obsolete: Old code. Something tagged obsolete generally means
|
||||
it has been replaced by a better system and you
|
||||
should be using that.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: apache
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: cybercash
|
||||
PRIMARY MAINTAINER: Evan Klinger <evan715@sirius.com>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: dba
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: dbase
|
||||
PRIMARY MAINTAINER: Jim Winstead <jimw@php.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: fdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: gd
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: hyperwave
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: informix
|
||||
PRIMARY MAINTAINER: Danny Heijl <Danny.Heijl@cevi.be>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: interbase
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: java
|
||||
PRIMARY MAINTAINER: Sam Ruby <rubys@us.ibm.com>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: ldap
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: mcrypt
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: mhash
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: mssql
|
||||
PRIMARY MAINTAINER: Frank M. Kromann <fmk@swwwing.com>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: oci8
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: oracle
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
STATUS: Maintained
|
||||
COMMENT: Using the new OCI8 driver is encouraged where possible.
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: pcre
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: pdf
|
||||
PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: pgsql
|
||||
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
|
||||
STATUS: Odd fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: posix
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: recode
|
||||
PRIMARY MAINTAINER: Kristian Köhntopp <kris@koehntopp.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: session
|
||||
PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: snmp
|
||||
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
|
||||
STATUS: Odd Fixes
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: swf
|
||||
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: wddx
|
||||
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: xml
|
||||
PRIMARY MAINTAINER: Thies C. Arntzen <thies@digicol.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: yaz
|
||||
PRIMARY MAINTAINER: Adam Dickmeiss <adam@indexdata.dk>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
EXTENSION: zlib
|
||||
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
|
||||
STATUS: Maintained
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -0,0 +1,27 @@
|
||||
Module Status
|
||||
------ ------
|
||||
MySQL Working
|
||||
COM Working
|
||||
WDDX Working
|
||||
PCRE Working
|
||||
DBA Working
|
||||
mcrypt Working
|
||||
mhash Working
|
||||
dbase Working
|
||||
aspell Working
|
||||
imap Working
|
||||
ldap Working
|
||||
oci8 Working
|
||||
oracle Working
|
||||
iptc Working
|
||||
informix Working
|
||||
zlib Working
|
||||
sysvshm Working
|
||||
odbc Working (except for persistent connections)
|
||||
MS SQL Working (tested on phpts and isapi versions)
|
||||
snmp Working
|
||||
gettext Working
|
||||
mcal Working
|
||||
interbase Working
|
||||
posix Working
|
||||
recode Working
|
||||
@@ -1,151 +1,6 @@
|
||||
PHP 4.0 NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
|
||||
?? ??? 2000, Version 4.0.2
|
||||
- Fix by-reference parameters passing for xml_ functions and for scanf functions (Stas)
|
||||
- Added experimental Oracle LDAP SDK support. 8.1.6 or later needed. Configure
|
||||
with something like --with-ldap=/usr/local/oracle/product/8.1.6 (Stig Venaas)
|
||||
- Fixed memory leaks in eval(); A script that used eval() extensively, could
|
||||
end up consuming very large amounts of memory during execution (Zeev, Zend
|
||||
Engine)
|
||||
- Fixed memory_limit feature, which did not work properly in previous versions
|
||||
(Zeev, Zend Engine)
|
||||
- Fixed stdout support with the swf extension. (Sterling)
|
||||
- Fixed byte order for ip2long and long2ip (Stas)
|
||||
- Fixed dbase_add_record. (Sterling)
|
||||
- Added support for libmcrypt 2.4.4 (Derick)
|
||||
- Added strncasecmp function (Andi, Zend Engine)
|
||||
- Fixed FTP module to accept multiline server replies (Jani)
|
||||
- Fixed switch which only has a single default rule. (Andi, Zend Engine)
|
||||
- Fixed problem with nested foreach()'s. (Andi, Zend Engine)
|
||||
- The CCVS module is now stable and compiling. It compiles as a CGI and into
|
||||
Apache cleanly without warnings. (Brendan W. McAdams)
|
||||
- Fixed mSQL_close(). (nick@loman.net)
|
||||
- Made return() in a require()'d file work like return() in an include()'d
|
||||
file (Andi & Zeev, Zend Engine)
|
||||
- Changed require_once() to work using the same table as include_once()
|
||||
(Andi & Zeev, Zend Engine)
|
||||
- Fixed PostgreSQL module to work when the link handle is omitted (Zeev)
|
||||
- Fixed the Sybase modules to work properly with PHP 4.0 (Zeev)
|
||||
- Fixed CLOB handling in OCI8 driver when using variable-width
|
||||
character sets. (Thies)
|
||||
- Added 4th optional parameter to sybase_[p]connect to specify the charset
|
||||
for the connection (alf@alpha.ulatina.ac.cr)
|
||||
- Fixed support for current thttpd releases. (Sascha)
|
||||
- Virtualize realpath, chmod, chown and utime (Stas)
|
||||
- Support content-encoding headers in file upload MIME parts
|
||||
(Ragnar Kjørstad)
|
||||
- Fixed warning when shutting down OCINLogon() connections. (Thies)
|
||||
- Fixed \n in session variables bug on Win32 (Stas)
|
||||
- OCIError() would sometimes not report failed connections. (Thies)
|
||||
- Fixed HEAD request bug on an Apache ErrorDocument redirect and preserve
|
||||
the status code across the redirect as well. (Rasmus)
|
||||
- Added Olympus-specific tags to read_exif_data() (Rasmus)
|
||||
- Fixed bug in imap_fetchheader() where using FT_PREFETCHTEXT didn't return
|
||||
the body. Bug #4447. (Jani)
|
||||
- Fixed exec() returning "\0" when output is empty
|
||||
- Added XML_Parser class in PEAR (Stig)
|
||||
- Added "make test" target in pear/ and added some regression tests (Stig)
|
||||
- Fixed bug in strip_tags function as per bug #5857 (Rasmus)
|
||||
- Fixed reading of IPTC via GetImageInfo() for certain JPEG files. (Thies)
|
||||
- Improved the output-buffering functions to be re-entrant (Zeev)
|
||||
- Made ldap_add(), ldap_modify(), ldap_mod_add(), ldap_mod_replace()
|
||||
binary-safe. Original patch: Terrence Miao <terrence_miao@email.com> (Jani)
|
||||
- CGI aka. command line version has now an option '-l' for syntax check
|
||||
without execution (Hartmut)
|
||||
- Fixed bug in ldap_get_values_len() which makes it NULL-safe. (Jani)
|
||||
- Bug-report and fix submitted by Michel Alexeline <alexel@dr15.cnrs.fr>
|
||||
- Make ext_skel create a Makefile.in set up to handle shared extension
|
||||
support automatically (Rasmus)
|
||||
- Fixed php_realpath not to die on non-existing files (needed for touch())
|
||||
(Stas and china@thewrittenword.com)
|
||||
- Fixed get_browser() function (Stas)
|
||||
- Fixed symbol clash which caused a DSO problem on OpenBSD (Rob Black and
|
||||
anil@recoil.org)
|
||||
- Added new function: ldap_compare(). (Jani)
|
||||
- Fixed a bug in ldap_get_entries() and ldap_get_attributes(). (Jani)
|
||||
- Ported DB to new error reporting scheme in PEAR. (Stig)
|
||||
- Added sybase and ibase DB backends in PEAR. (Sterling)
|
||||
- New PEAR package Payment_Verisign for use with the Payflow Pro
|
||||
(pfpro) extension. (David Croft)
|
||||
- Added CURL support. (Sterling)
|
||||
- Catch users trying to set "compatibility" parameter in PDF, which is not
|
||||
supported from user-land. (Joey)
|
||||
- Fixed dbase_add_record. (Sterling)
|
||||
- Added new function wordwrap() to wordwrap long strings from Chris
|
||||
Russel <russel@yorku.ca> (David Croft)
|
||||
- Added four additional arguments: attrsonly, sizelimit, timelimit, deref which
|
||||
were missing in ldap_search(), ldap_list() and ldap_read() functions (Jani)
|
||||
- Fixed a bug in ldap_search/list/read() which prevented returning the partial
|
||||
results when 'Sizelimit exceeded' error occurred. (Jani Taskinen)
|
||||
- Fixed preg_replace() to automatically escape quotes in matched
|
||||
strings when using /e modifier. (Andrei)
|
||||
- Itanium patch (Steve Robb)
|
||||
- Set default include_path so PEAR files can be reached (Stig)
|
||||
- Added "pear" executable, requires CGI version installed (Stig)
|
||||
- Added extension ii for Ingres II native support. See README in ext/ingres_ii
|
||||
directory. (David H)
|
||||
- Added Win32 project for the Interbase module (Zeev)
|
||||
- Added ability to perform calls to the parent class without explicitly
|
||||
specifying its name, using parent::func_name(...) (Zeev, Zend Engine)
|
||||
- You can now call Ora_Error() without prameters to get the reason
|
||||
for a failed connection attempt. (Kirill Maximov)
|
||||
- New extension "pfpro" for interface with Verisign Payflow Pro (David Croft)
|
||||
- Added IMG_GIF, IMG_JPG, IMG_JPEG, IMG_PNG and IMG_WBMP constants for
|
||||
imagetypes() function (Rasmus)
|
||||
- Added ImageTypes() function which returns a bitfield with the supported
|
||||
image formats. 1=gif, 2=jpeg, 4=png and 8=wbmp (Rasmus)
|
||||
- Make it possible to specify an empty string as a thousands-seperator
|
||||
in number_format() (Rasmus)
|
||||
- Shared module support for LDAP extension (Troels Arvin)
|
||||
- Fixed a bug with imap_mail where apache would segfault if the rpath
|
||||
parameter was specified.
|
||||
- Use dashes and short day name in cookies since some browsers seem picky
|
||||
about this (Rasmus)
|
||||
- Added pspell module. (Vlad)
|
||||
- Added 3 additional arguments to the user-defined error handler - the file
|
||||
name and line number in which the error occured, and the context (local
|
||||
variables) of the code in which the error occured (Zeev, Zend Engine)
|
||||
- Improved the error handling code to handle an error in a user-defined error
|
||||
handling function (Zeev, Zend Engine)
|
||||
- Fixed leak when using string offsets in the array() construct.
|
||||
(Andi, Zend Engine)
|
||||
- Fixed corruption problem when changing deeply nested values in objects.
|
||||
(Andi & Zeev, Zend Engine)
|
||||
- Improved array_multisort() to be able to specify sort type as well sort
|
||||
order. Incidentally, it can be used to sort multi-dimensional arrays
|
||||
as well. (Andrei)
|
||||
- Fixed a possible data corruption in case of a huge amount of aborted requests
|
||||
(Zeev)
|
||||
- Apache module would sometimes close a wrong file-descriptor. (Sascha)
|
||||
- Fixed use of alternative storage handlers in the session module. (Sascha)
|
||||
- Updated str_pad() to be able to pad on left/right/both sides. (Andrei)
|
||||
- Fixed crash in gzopen(). (Thies)
|
||||
- Multiple character set support in gdttf.c (Rob Goodwin)
|
||||
- When using HTTP auth from PHP, fill in the %u custom log field so the
|
||||
authenticated used id will get logged in the Apache access_log (Rasmus)
|
||||
- Support for pdflib 3.01. (Uwe)
|
||||
- FDF Data is handled properly and can be accessed by reading
|
||||
HTTP_RAW_POST_DATA. (Uwe)
|
||||
- Added new 'O' format modifier that will output the GMT offset as "[+-]HHMM"
|
||||
(eg: Pacific time is -0700). This is useful for things such as Date: mail
|
||||
headers. (Mike W)
|
||||
- Fixed crash on OCI?Logon() failure. (Thies)
|
||||
- Make the special Header("http/...") response be case insensitive like 3.0
|
||||
(Rasmus)
|
||||
- Allow cybercash to compile as a DL module. (Sterling)
|
||||
- Fixed the dbase_create function. (Sterling)
|
||||
- Fixed a problem under some versions of Windows that could cause PHP to hang
|
||||
on startup if errors occured, e.g. in the php.ini file (Zeev)
|
||||
- Fixed opendir() again. It should actually work well continuously now (Zeev)
|
||||
- Added three additional arguments to be sent to a user-defined error handler -
|
||||
the filename and line number in which the error occured, and the context
|
||||
(the local variables) of the error (Zeev, Zend Engine)
|
||||
- Improved the error handling code to handle an error in a user-defined error
|
||||
handling function (Zeev, Zend Engine)
|
||||
- Added an optional parameter to preg_replace() that can be used to
|
||||
specify how many replacements to make. (Andrei)
|
||||
|
||||
28 Jun 2000, Version 4.0.1
|
||||
- Fixed a possible crash in the LDAP modify code. (Eric Kilfoil)
|
||||
- Fixed a bug in opendir(), which prevented readdir() from working properly if
|
||||
@@ -240,7 +95,7 @@ PHP 4.0 NEWS
|
||||
- Added fflush() function. (Eric Huss)
|
||||
- Fixed a problem with static variables, default function arguments and class
|
||||
member variables, that contained array values. (Andi & Zeev, Zend Engine)
|
||||
- Fixed virtual() when used with output buffering (Marc Pohl)
|
||||
- Fix virtual() when used with output buffering (Marc Pohl)
|
||||
- Clean up constants in flock() function and add optional 3rd arg which
|
||||
is set to true on EWOULDBLOCK (Rasmus)
|
||||
- Added functions pg_loimport(), pg_loexport(). (Jouni)
|
||||
@@ -260,7 +115,7 @@ PHP 4.0 NEWS
|
||||
instead of the built-in error handling code (Zeev, Zend Engine)
|
||||
- Renamed user_error() to trigger_error(); user_error() remains
|
||||
defined for compatibility (Zeev, Zend Engine)
|
||||
- Fixed the global/static statements to require a trailing terminating
|
||||
- Fix the global/static statements to require a trailing terminating
|
||||
semi-colon ';'. (Andi, Zend Engine)
|
||||
- Cleaned up PCRE extension and made it binary-safe. (Andrei)
|
||||
- Added third argument to in_array(). If it's true, then in_array()
|
||||
@@ -335,7 +190,7 @@ PHP 4.0 NEWS
|
||||
(Marc Pohl)
|
||||
- Added configure time checking for bcmath package. (Joey, Sascha)
|
||||
- Added get_declared_classes(). (Andrei, Zend Engine)
|
||||
- Added initial NSAPI module from Jayakumar Muthukumarasamy. (Rasmus)
|
||||
- Add initial NSAPI module from Jayakumar Muthukumarasamy. (Rasmus)
|
||||
- Added the SWF module which allows you to create Macromedia Flash files via
|
||||
libswf. (Sterling)
|
||||
- Improved UNIX build system to support more vendor make tools (Sascha)
|
||||
@@ -344,7 +199,7 @@ PHP 4.0 NEWS
|
||||
- Fixed a crash in array_multisort() that happened when empty arrays
|
||||
were passed to it. (Andrei)
|
||||
- Added substr_count() from Peter Kovacs. (Andrei)
|
||||
- Added an optional third argument to fseek to indicate where to seek from.
|
||||
- Add an optional third argument to fseek to indicate where to seek from.
|
||||
(Andrei)
|
||||
- OCIBindByName() will no longer complain about bindlength beeing zero. (Thies)
|
||||
- Converted the IMAP module to the high performance API (Zeev)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ Having said that, here are the organizational rules:
|
||||
|
||||
2. Discuss any significant changes on the list before committing.
|
||||
|
||||
3. Look at EXTENSIONS file to see who is the primary maintainer of
|
||||
3. Look at MAINTANERS file to see who is the primary maintainer of
|
||||
the code you want to contribute to.
|
||||
|
||||
4. If you "strongly disagree" about something another person did, don't
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ CURRENT LIMITATIONS, BUGS AND OTHER ODDITIES
|
||||
|
||||
Don't trust too much the generated code. It tries to be useful in most of
|
||||
the situations you might encounter, but automatic code generating will never
|
||||
beat a programmer who knows the real situation at hand. ext_skel is generally
|
||||
beat a programmer who knows the real situation at hand. axt_skel is generally
|
||||
best suited for quickly generating a wrapper for c-library functions you
|
||||
might want to have available in PHP too.
|
||||
|
||||
|
||||
@@ -14,19 +14,6 @@ HOW TO CREATE A SELF-CONTAINED PHP EXTENSION
|
||||
We will describe now how to create these and how to put things
|
||||
together.
|
||||
|
||||
PREPARING YOUR SYSTEM
|
||||
|
||||
While the result will run on any system, a developer's setup needs these
|
||||
tools:
|
||||
|
||||
GNU autoconf
|
||||
GNU automake
|
||||
GNU libtool
|
||||
GNU m4
|
||||
|
||||
All of these are available from
|
||||
|
||||
ftp://ftp.gnu.org/pub/gnu/
|
||||
|
||||
CONVERTING AN EXISTING EXTENSION
|
||||
|
||||
|
||||
@@ -93,9 +93,6 @@ Ensure you run ./configure with the `--enable-libgcc' parameter. You
|
||||
may need to set LDFLAGS to '-L/usr/local/egcs/lib' (path depends on
|
||||
your gcc installation)
|
||||
|
||||
FreeBSD 4.0:
|
||||
Some people may find they need to run ./configure with the
|
||||
'--enable-libgcc' compile option too.
|
||||
|
||||
|
||||
For more information and help with Zeus, please visit our website:
|
||||
|
||||
@@ -36,8 +36,6 @@ global
|
||||
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
|
||||
-------------
|
||||
@@ -60,6 +58,7 @@ ext/oci8
|
||||
|
||||
ext/pcre
|
||||
--------
|
||||
* have a non-greedy option for preg_replace().
|
||||
* have an option for preg_grep() to return keys as well.
|
||||
* update the online docs from version 3.1 man page
|
||||
|
||||
@@ -69,8 +68,6 @@ ext/session
|
||||
the need to serialize frame-loads.
|
||||
* maybe implement finer-grained session variables that could be
|
||||
locked individually.
|
||||
* write a network-transparent storage back-end with fallover
|
||||
facilities
|
||||
|
||||
ext/standard
|
||||
------------
|
||||
@@ -105,6 +102,7 @@ ext/standard
|
||||
|
||||
ext/wddx
|
||||
--------
|
||||
* implement __sleep() and __wakeup() the way serialize()/unserialize() do.
|
||||
* See if we can support the remaining datatypes:
|
||||
dateTime
|
||||
binary
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
Copyright (c) 1999,2000, Andi Gutmans, Sascha Schumann, Zeev Suraski.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Neither name of the copyright holders nor the names of their contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
||||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+3
-3
@@ -14,8 +14,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TSRM_H
|
||||
#define TSRM_H
|
||||
#ifndef _TSRM_H
|
||||
#define _TSRM_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# undef PACKAGE
|
||||
@@ -108,4 +108,4 @@ TSRM_API void *tsrm_set_new_thread_end_handler(void (*new_thread_end_handler)(TH
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* TSRM_H */
|
||||
#endif /* _TSRM_H */
|
||||
+2
-2
@@ -41,9 +41,9 @@
|
||||
// #include <FlexLexer.h>
|
||||
// ...
|
||||
|
||||
#ifndef FLEXLEXER_H
|
||||
#ifndef __FLEX_LEXER_H
|
||||
// Never included before - need to define base class.
|
||||
#define FLEXLEXER_H
|
||||
#define __FLEX_LEXER_H
|
||||
#include <iostream.h>
|
||||
|
||||
extern "C++" {
|
||||
|
||||
+8
-23
@@ -35,33 +35,18 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
# define zend_sprintf sprintf
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifdef HAVE_ISNAN
|
||||
#define zend_isnan(a) isnan(a)
|
||||
#elif defined(NAN)
|
||||
#define zend_isnan(a) (((a)==NAN)?1:0)
|
||||
#else
|
||||
#define zend_isnan(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISINF
|
||||
#define zend_isinf(a) isinf(a)
|
||||
#elif defined(INFINITY)
|
||||
/* Might not work, but is required by ISO C99 */
|
||||
#define zend_isinf(a) (((a)==INFINITY)?1:0)
|
||||
#else
|
||||
#define zend_isinf(a) 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FINITE
|
||||
#define zend_finite(a) finite(a)
|
||||
#elif defined(HAVE_ISFINITE) || defined(isfinite)
|
||||
#elif defined(HAVE_ISFINITE)
|
||||
#define zend_finite(a) isfinite(a)
|
||||
#elif defined(fpclassify)
|
||||
#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
|
||||
#elif defined(HAVE_ISNAN) && defined(HAVE_ISINF)
|
||||
#define zend_finite(a) (isnan(a) ? 0 : isinf(a) ? 0 : 1)
|
||||
#elif defined(HAVE_ISNAN)
|
||||
#define zend_finite(a) (isnan(a) ? 0 : 1)
|
||||
#elif defined(HAVE_ISINF)
|
||||
#define zend_finite(a) (isinf(a) ? 0 : 1)
|
||||
#else
|
||||
#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
|
||||
#define zend_finite(a) (1)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+93
-89
@@ -47,7 +47,7 @@
|
||||
%pure_parser
|
||||
%expect 4
|
||||
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE
|
||||
%left T_INCLUDE T_INCLUDE_ONCE T_EVAL
|
||||
%left ','
|
||||
%left T_LOGICAL_OR
|
||||
%left T_LOGICAL_XOR
|
||||
@@ -105,6 +105,8 @@
|
||||
%token T_FUNCTION
|
||||
%token T_CONST
|
||||
%token T_RETURN
|
||||
%token T_REQUIRE
|
||||
%token T_REQUIRE_ONCE
|
||||
%token T_USE
|
||||
%token T_GLOBAL
|
||||
%token T_STATIC
|
||||
@@ -178,27 +180,28 @@ unticked_statement:
|
||||
for_expr
|
||||
';' { do_free(&$3 CLS_CC); $4.u.opline_num = get_next_op_number(CG(active_op_array)); }
|
||||
for_expr
|
||||
';' { do_extended_info(CLS_C); do_for_cond(&$6, &$7 CLS_CC); }
|
||||
';' { do_for_cond(&$6, &$7 CLS_CC); }
|
||||
for_expr
|
||||
')' { do_free(&$9 CLS_CC); do_for_before_statement(&$4, &$7 CLS_CC); }
|
||||
for_statement { do_for_end(&$7 CLS_CC); }
|
||||
| T_SWITCH '(' expr ')' { do_switch_cond(&$3 CLS_CC); } switch_case_list { do_switch_end(&$6 CLS_CC); }
|
||||
| T_BREAK ';' { do_brk_cont(ZEND_BRK, NULL CLS_CC); }
|
||||
| T_SWITCH '(' expr ')' { do_switch_cond(&$3 CLS_CC); } switch_case_list { do_switch_end(&$6 CLS_CC); }
|
||||
| T_BREAK ';' { do_brk_cont(ZEND_BRK, NULL CLS_CC); }
|
||||
| T_BREAK expr ';' { do_brk_cont(ZEND_BRK, &$2 CLS_CC); }
|
||||
| T_CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); }
|
||||
| T_CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
|
||||
| T_RETURN ';' { do_return(NULL, 0 CLS_CC); }
|
||||
| T_RETURN expr_without_variable ';' { do_return(&$2, 0 CLS_CC); }
|
||||
| T_RETURN cvar ';' { do_return(&$2, 1 CLS_CC); }
|
||||
| T_CONTINUE ';' { do_brk_cont(ZEND_CONT, NULL CLS_CC); }
|
||||
| T_CONTINUE expr ';' { do_brk_cont(ZEND_CONT, &$2 CLS_CC); }
|
||||
| T_RETURN ';' { do_return(NULL, 0 CLS_CC); }
|
||||
| T_RETURN expr_without_variable ';' { do_return(&$2, 0 CLS_CC); }
|
||||
| T_RETURN cvar ';' { do_return(&$2, 1 CLS_CC); }
|
||||
| T_GLOBAL global_var_list ';'
|
||||
| T_STATIC static_var_list ';'
|
||||
| T_ECHO echo_expr_list ';'
|
||||
| T_INLINE_HTML { do_echo(&$1 CLS_CC); }
|
||||
| expr ';' { do_free(&$1 CLS_CC); }
|
||||
| T_USE use_filename ';' { zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()"); zval_dtor(&$2.u.constant); }
|
||||
| expr ';' { do_free(&$1 CLS_CC); }
|
||||
| T_REQUIRE expr ';' { do_require(&$2, 0 CLS_CC); }
|
||||
| T_REQUIRE_ONCE use_filename ';' { do_require(&$2, 1 CLS_CC); }
|
||||
| T_USE use_filename ';' { use_filename($2.u.constant.value.str.val, $2.u.constant.value.str.len CLS_CC); zval_dtor(&$2.u.constant); }
|
||||
| T_UNSET '(' unset_variables ')' ';'
|
||||
| T_FOREACH '(' w_cvar T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 1 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_FOREACH '(' expr_without_variable T_AS { do_foreach_begin(&$1, &$3, &$2, &$4, 0 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_FOREACH '(' expr T_AS { do_foreach_begin(&$1, &$3, &$2, &$4 CLS_CC); } w_cvar foreach_optional_arg ')' { do_foreach_cont(&$6, &$7, &$4 CLS_CC); } foreach_statement { do_foreach_end(&$1, &$2 CLS_CC); }
|
||||
| T_DECLARE { do_declare_begin(CLS_C); } '(' declare_list ')' declare_statement { do_declare_end(CLS_C); }
|
||||
| ';' /* empty statement */
|
||||
;
|
||||
@@ -234,8 +237,8 @@ unticked_declaration_statement:
|
||||
|
||||
|
||||
foreach_optional_arg:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| T_DOUBLE_ARROW w_cvar { $$ = $2; }
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| T_DOUBLE_ARROW w_cvar { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
@@ -258,23 +261,23 @@ declare_statement:
|
||||
|
||||
|
||||
declare_list:
|
||||
T_STRING '=' static_scalar { do_declare_stmt(&$1, &$3 CLS_CC); }
|
||||
| declare_list ',' T_STRING '=' static_scalar { do_declare_stmt(&$3, &$5 CLS_CC); }
|
||||
T_STRING '=' static_scalar { do_declare_stmt(&$1, &$3 CLS_CC); }
|
||||
| declare_list ',' T_STRING '=' static_scalar { do_declare_stmt(&$3, &$5 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
switch_case_list:
|
||||
'{' case_list '}' { $$ = $2; }
|
||||
| '{' ';' case_list '}' { $$ = $3; }
|
||||
| ':' case_list T_ENDSWITCH ';' { $$ = $2; }
|
||||
| ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; }
|
||||
| ':' case_list T_ENDSWITCH ';' { $$ = $2; }
|
||||
| ':' ';' case_list T_ENDSWITCH ';' { $$ = $3; }
|
||||
;
|
||||
|
||||
|
||||
case_list:
|
||||
/* empty */ { $$.op_type = IS_UNUSED; }
|
||||
| case_list T_CASE expr case_separator { do_extended_info(CLS_C); do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
|
||||
| case_list T_DEFAULT case_separator { do_extended_info(CLS_C); do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
|
||||
| case_list T_CASE expr case_separator { do_case_before_statement(&$1, &$2, &$3 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST }
|
||||
| case_list T_DEFAULT case_separator { do_default_before_statement(&$1, &$2 CLS_CC); } inner_statement_list { do_case_after_statement(&$$, &$2 CLS_CC); $$.op_type = IS_CONST; }
|
||||
;
|
||||
|
||||
|
||||
@@ -315,6 +318,8 @@ new_else_single:
|
||||
;
|
||||
|
||||
|
||||
|
||||
|
||||
parameter_list:
|
||||
non_empty_parameter_list
|
||||
| /* empty */
|
||||
@@ -322,35 +327,35 @@ parameter_list:
|
||||
|
||||
|
||||
non_empty_parameter_list:
|
||||
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$2, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$1, 0 CLS_CC); $$.op_type = IS_CONST; $$.u.constant.value.lval=1; $$.u.constant.type=IS_LONG; INIT_PZVAL(&$$.u.constant); do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$3, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' '&' T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_FORCE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_CONST T_VARIABLE { znode tmp; fetch_simple_variable(&tmp, &$4, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV, &tmp, &$$, NULL, BYREF_NONE CLS_CC); }
|
||||
| non_empty_parameter_list ',' T_VARIABLE '=' static_scalar { znode tmp; fetch_simple_variable(&tmp, &$3, 0 CLS_CC); $$=$1; $$.u.constant.value.lval++; do_receive_arg(ZEND_RECV_INIT, &tmp, &$$, &$5, BYREF_NONE CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
function_call_parameter_list:
|
||||
non_empty_function_call_parameter_list { $$ = $1; }
|
||||
| /* empty */ { $$.u.constant.value.lval = 0; }
|
||||
non_empty_function_call_parameter_list { $$ = $1; }
|
||||
| /* empty */ { $$.u.constant.value.lval = 0; }
|
||||
;
|
||||
|
||||
|
||||
non_empty_function_call_parameter_list:
|
||||
expr_without_variable { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| cvar { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| '&' w_cvar { $$.u.constant.value.lval = 1; do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
expr_without_variable { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| cvar { $$.u.constant.value.lval = 1; do_pass_param(&$1, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| '&' w_cvar { $$.u.constant.value.lval = 1; do_pass_param(&$2, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' expr_without_variable { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAL, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$3, ZEND_SEND_VAR, $$.u.constant.value.lval CLS_CC); }
|
||||
| non_empty_function_call_parameter_list ',' '&' w_cvar { $$.u.constant.value.lval=$1.u.constant.value.lval+1; do_pass_param(&$4, ZEND_SEND_REF, $$.u.constant.value.lval CLS_CC); }
|
||||
;
|
||||
|
||||
global_var_list:
|
||||
global_var_list ',' global_var { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
| global_var { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
global_var_list ',' global_var { do_fetch_global_or_static_variable(&$3, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
| global_var { do_fetch_global_or_static_variable(&$1, NULL, ZEND_FETCH_GLOBAL CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -386,14 +391,14 @@ class_statement:
|
||||
;
|
||||
|
||||
is_reference:
|
||||
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
|
||||
/* empty */ { $$.op_type = ZEND_RETURN_VAL; }
|
||||
| '&' { $$.op_type = ZEND_RETURN_REF; }
|
||||
|
||||
class_variable_decleration:
|
||||
class_variable_decleration ',' T_VARIABLE { do_declare_property(&$3, NULL CLS_CC); }
|
||||
| class_variable_decleration ',' T_VARIABLE '=' static_scalar { do_declare_property(&$3, &$5 CLS_CC); }
|
||||
| T_VARIABLE { do_declare_property(&$1, NULL CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); }
|
||||
class_variable_decleration ',' T_VARIABLE { do_declare_property(&$3, NULL CLS_CC); }
|
||||
| class_variable_decleration ',' T_VARIABLE '=' static_scalar { do_declare_property(&$3, &$5 CLS_CC); }
|
||||
| T_VARIABLE { do_declare_property(&$1, NULL CLS_CC); }
|
||||
| T_VARIABLE '=' static_scalar { do_declare_property(&$1, &$3 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -405,12 +410,12 @@ echo_expr_list:
|
||||
|
||||
for_expr:
|
||||
/* empty */ { $$.op_type = IS_CONST; $$.u.constant.type = IS_BOOL; $$.u.constant.value.lval = 1; }
|
||||
| non_empty_for_expr { $$ = $1; }
|
||||
| non_empty_for_expr { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_for_expr:
|
||||
non_empty_for_expr ',' { do_free(&$1 CLS_CC); } expr { $$ = $4; }
|
||||
| expr { $$ = $1; }
|
||||
non_empty_for_expr ',' { do_free(&$1 CLS_CC); } expr { $$ = $4; }
|
||||
| expr { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
@@ -449,27 +454,27 @@ expr_without_variable:
|
||||
| expr '*' expr { do_binary_op(ZEND_MUL,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '/' expr { do_binary_op(ZEND_DIV,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr '%' expr { do_binary_op(ZEND_MOD,&$$,&$1,&$3 CLS_CC); }
|
||||
| expr T_SL expr { do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_SR expr { do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_SL expr { do_binary_op(ZEND_SL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_SR expr { do_binary_op(ZEND_SR, &$$, &$1, &$3 CLS_CC); }
|
||||
| '+' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); do_binary_op(ZEND_ADD, &$$, &$1, &$2 CLS_CC); }
|
||||
| '-' expr { $1.u.constant.value.lval=0; $1.u.constant.type=IS_LONG; $1.op_type = IS_CONST; INIT_PZVAL(&$1.u.constant); do_binary_op(ZEND_SUB, &$$, &$1, &$2 CLS_CC); }
|
||||
| '!' expr { do_unary_op(ZEND_BOOL_NOT, &$$, &$2 CLS_CC); }
|
||||
| '~' expr { do_unary_op(ZEND_BW_NOT, &$$, &$2 CLS_CC); }
|
||||
| expr T_IS_IDENTICAL expr { do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_IDENTICAL expr { do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_EQUAL expr { do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_EQUAL expr { do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_IDENTICAL expr { do_binary_op(ZEND_IS_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_IDENTICAL expr { do_binary_op(ZEND_IS_NOT_IDENTICAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_EQUAL expr { do_binary_op(ZEND_IS_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_NOT_EQUAL expr { do_binary_op(ZEND_IS_NOT_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '<' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_SMALLER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr T_IS_SMALLER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$1, &$3 CLS_CC); }
|
||||
| expr '>' expr { do_binary_op(ZEND_IS_SMALLER, &$$, &$3, &$1 CLS_CC); }
|
||||
| expr T_IS_GREATER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); }
|
||||
| expr T_IS_GREATER_OR_EQUAL expr { do_binary_op(ZEND_IS_SMALLER_OR_EQUAL, &$$, &$3, &$1 CLS_CC); }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
| expr '?' { do_begin_qm_op(&$1, &$2 CLS_CC); }
|
||||
expr ':' { do_qm_true(&$4, &$2, &$5 CLS_CC); }
|
||||
expr { do_qm_false(&$$, &$7, &$2, &$5 CLS_CC); }
|
||||
| function_call { $$ = $1; }
|
||||
| internal_functions_in_yacc { $$ = $1; }
|
||||
| T_INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); }
|
||||
| T_INT_CAST expr { do_cast(&$$, &$2, IS_LONG CLS_CC); }
|
||||
| T_DOUBLE_CAST expr { do_cast(&$$, &$2, IS_DOUBLE CLS_CC); }
|
||||
| T_STRING_CAST expr { do_cast(&$$, &$2, IS_STRING CLS_CC); }
|
||||
| T_ARRAY_CAST expr { do_cast(&$$, &$2, IS_ARRAY CLS_CC); }
|
||||
@@ -484,11 +489,12 @@ expr_without_variable:
|
||||
| T_PRINT expr { do_print(&$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
function_call:
|
||||
T_STRING '(' { $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
|
||||
T_STRING '(' { do_extended_fcall_begin(CLS_C); $2.u.opline_num = do_begin_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0, $2.u.opline_num CLS_CC); do_extended_fcall_end(CLS_C); }
|
||||
| cvar '(' { do_begin_dynamic_function_call(&$1 CLS_CC); }
|
||||
| r_cvar '(' { do_extended_fcall_begin(CLS_C); do_begin_dynamic_function_call(&$1 CLS_CC); }
|
||||
function_call_parameter_list
|
||||
')' { do_end_function_call(&$1, &$$, &$4, 0, 1 CLS_CC); do_extended_fcall_end(CLS_C);}
|
||||
| T_STRING T_PAAMAYIM_NEKUDOTAYIM T_STRING '(' { do_extended_fcall_begin(CLS_C); do_begin_class_member_function_call(&$1, &$3 CLS_CC); }
|
||||
@@ -498,37 +504,37 @@ function_call:
|
||||
|
||||
|
||||
exit_expr:
|
||||
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
/* empty */ { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' ')' { memset(&$$, 0, sizeof(znode)); $$.op_type = IS_UNUSED; }
|
||||
| '(' expr ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
ctor_arguments:
|
||||
/* empty */ { $$.u.constant.value.lval=0; }
|
||||
| '(' function_call_parameter_list ')' { $$ = $2; }
|
||||
/* empty */ { $$.u.constant.value.lval=0; }
|
||||
| '(' function_call_parameter_list ')' { $$ = $2; }
|
||||
;
|
||||
|
||||
|
||||
class_name:
|
||||
T_STRING { $$ = $1; }
|
||||
| r_cvar { $$ = $1; }
|
||||
| r_cvar { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
|
||||
common_scalar:
|
||||
T_LNUMBER { $$ = $1; }
|
||||
| T_DNUMBER { $$ = $1; }
|
||||
T_LNUMBER { $$=$1; }
|
||||
| T_DNUMBER { $$=$1; }
|
||||
| T_CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
| T_LINE { $$ = $1; }
|
||||
| T_FILE { $$ = $1; }
|
||||
| T_LINE { $$ = $1; }
|
||||
| T_FILE { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
static_scalar: /* compile-time evaluated scalars */
|
||||
common_scalar { $$ = $1; }
|
||||
| T_STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
|
||||
| T_STRING { do_fetch_constant(&$$, &$1, ZEND_CT CLS_CC); }
|
||||
| '+' static_scalar { $$ = $1; }
|
||||
| '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
|
||||
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
|
||||
@@ -536,8 +542,8 @@ static_scalar: /* compile-time evaluated scalars */
|
||||
|
||||
|
||||
scalar:
|
||||
T_STRING { do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); }
|
||||
| T_STRING_VARNAME { $$ = $1; }
|
||||
T_STRING { do_fetch_constant(&$$, &$1, ZEND_RT CLS_CC); }
|
||||
| T_STRING_VARNAME { $$ = $1; }
|
||||
| common_scalar { $$ = $1; }
|
||||
| '"' encaps_list '"' { $$ = $2; }
|
||||
| '\'' encaps_list '\'' { $$ = $2; }
|
||||
@@ -546,7 +552,7 @@ scalar:
|
||||
|
||||
|
||||
static_array_pair_list:
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
|
||||
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
|
||||
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
@@ -557,9 +563,9 @@ possible_comma:
|
||||
|
||||
non_empty_static_array_pair_list:
|
||||
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { do_add_static_array_element(&$$, &$3, &$5); }
|
||||
| non_empty_static_array_pair_list ',' static_scalar { do_add_static_array_element(&$$, NULL, &$3); }
|
||||
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); }
|
||||
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, NULL, &$1); }
|
||||
| non_empty_static_array_pair_list ',' static_scalar { do_add_static_array_element(&$$, NULL, &$3); }
|
||||
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, &$1, &$3); }
|
||||
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); do_add_static_array_element(&$$, NULL, &$1); }
|
||||
;
|
||||
|
||||
expr:
|
||||
@@ -604,8 +610,8 @@ cvar_without_objects:
|
||||
|
||||
reference_variable:
|
||||
reference_variable '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 CLS_CC); }
|
||||
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| reference_variable '{' expr '}' { fetch_string_offset(&$$, &$1, &$3 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1 CLS_CC); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -660,28 +666,28 @@ assignment_list_element:
|
||||
|
||||
|
||||
array_pair_list:
|
||||
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
|
||||
/* empty */ { do_init_array(&$$, NULL, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list possible_comma { $$ = $1; }
|
||||
;
|
||||
|
||||
non_empty_array_pair_list:
|
||||
non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { do_add_array_element(&$$, &$5, &$3, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr { do_add_array_element(&$$, &$3, NULL, 0 CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW expr { do_init_array(&$$, &$3, &$1, 0 CLS_CC); }
|
||||
| expr { do_init_array(&$$, &$1, NULL, 0 CLS_CC); }
|
||||
| expr { do_init_array(&$$, &$1, NULL, 0 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_cvar { do_add_array_element(&$$, &$6, &$3, 1 CLS_CC); }
|
||||
| non_empty_array_pair_list ',' '&' w_cvar { do_add_array_element(&$$, &$4, NULL, 1 CLS_CC); }
|
||||
| expr T_DOUBLE_ARROW '&' w_cvar { do_init_array(&$$, &$4, &$1, 1 CLS_CC); }
|
||||
| '&' w_cvar { do_init_array(&$$, &$2, NULL, 1 CLS_CC); }
|
||||
| '&' w_cvar { do_init_array(&$$, &$2, NULL, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
encaps_list:
|
||||
encaps_list encaps_var { do_end_variable_parse(BP_VAR_R, 0 CLS_CC); do_add_variable(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_NUM_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_BAD_CHARACTER { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_NUM_STRING { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_ENCAPSED_AND_WHITESPACE { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_CHARACTER { do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list T_BAD_CHARACTER { do_add_string(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '[' { $2.u.constant.value.lval = (long) '['; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list ']' { $2.u.constant.value.lval = (long) ']'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
| encaps_list '{' { $2.u.constant.value.lval = (long) '{'; do_add_char(&$$, &$1, &$2 CLS_CC); }
|
||||
@@ -704,20 +710,18 @@ encaps_var:
|
||||
|
||||
|
||||
encaps_var_offset:
|
||||
T_STRING { $$ = $1; }
|
||||
T_STRING { $$ = $1; }
|
||||
| T_NUM_STRING { $$ = $1; }
|
||||
| T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| T_VARIABLE { fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
internal_functions_in_yacc:
|
||||
T_ISSET '(' cvar ')' { do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); }
|
||||
| T_EMPTY '(' cvar ')' { do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); }
|
||||
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE expr { do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
|
||||
| T_INCLUDE_ONCE expr { do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
|
||||
| T_EVAL '(' expr ')' { do_include_or_eval(ZEND_EVAL, &$$, &$3 CLS_CC); }
|
||||
| T_REQUIRE expr { do_include_or_eval(ZEND_REQUIRE, &$$, &$2 CLS_CC); }
|
||||
| T_REQUIRE_ONCE use_filename { do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_SCANNER_H
|
||||
#define ZEND_SCANNER_H
|
||||
#ifndef _LANGUAGE_SCANNER_H
|
||||
#define _LANGUAGE_SCANNER_H
|
||||
|
||||
#ifdef ZTS
|
||||
class ZendFlexLexer : public yyFlexLexer
|
||||
|
||||
+212
-78
@@ -183,7 +183,7 @@ inline void restore_lexical_state(zend_lex_state *lex_state CLS_DC)
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
|
||||
ZEND_API void zend_file_handle_dtor(zend_file_handle *fh)
|
||||
ZEND_API void zend_open_file_dtor(zend_file_handle *fh)
|
||||
{
|
||||
switch (fh->type) {
|
||||
case ZEND_HANDLE_FP:
|
||||
@@ -235,7 +235,7 @@ int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
{
|
||||
zend_llist_del_element(&CG(open_files), file_handle, (int (*)(void *, void *)) zend_compare_file_handles);
|
||||
}
|
||||
@@ -243,29 +243,23 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle CLS_DC)
|
||||
|
||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
{
|
||||
char *file_path=NULL;
|
||||
|
||||
#ifndef ZTS
|
||||
switch (file_handle->type) {
|
||||
case ZEND_HANDLE_FILENAME:
|
||||
file_handle->handle.fp = zend_fopen(file_handle->filename, &file_handle->opened_path);
|
||||
file_path = file_handle->opened_path;
|
||||
break;
|
||||
case ZEND_HANDLE_FD:
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->opened_path = NULL;
|
||||
file_handle->handle.fp = fdopen(file_handle->handle.fd, "r");
|
||||
break;
|
||||
case ZEND_HANDLE_FP:
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->opened_path = NULL;
|
||||
file_handle->handle.fp = file_handle->handle.fp;
|
||||
break;
|
||||
}
|
||||
if (!file_handle->handle.fp) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (!file_path) {
|
||||
file_path = file_handle->filename;
|
||||
}
|
||||
file_handle->type = ZEND_HANDLE_FP;
|
||||
if (file_handle->handle.fp != stdin) {
|
||||
zend_llist_add_element(&CG(open_files), file_handle);
|
||||
@@ -277,7 +271,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
#else
|
||||
switch (file_handle->type) {
|
||||
case ZEND_HANDLE_FD:
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->opened_path = NULL;
|
||||
file_handle->handle.is = new ifstream(file_handle->handle.fd);
|
||||
file_handle->type = ZEND_HANDLE_FSTREAM;
|
||||
break;
|
||||
@@ -292,7 +286,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
break;
|
||||
}
|
||||
case ZEND_HANDLE_FP:
|
||||
/* file_handle->opened_path = NULL; */
|
||||
file_handle->opened_path = NULL;
|
||||
if (file_handle->handle.fp==stdin) {
|
||||
file_handle->handle.is = &cin;
|
||||
} else {
|
||||
@@ -304,9 +298,6 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
file_path = file_handle->filename;
|
||||
|
||||
if (file_handle->handle.is->fail()) {
|
||||
delete file_handle->handle.is;
|
||||
return FAILURE;
|
||||
@@ -318,23 +309,38 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
|
||||
CG(ZFL) = new ZendFlexLexer;
|
||||
CG(ZFL)->switch_streams(file_handle->handle.is, &cout);
|
||||
#endif
|
||||
zend_set_compiled_filename(file_path);
|
||||
zend_set_compiled_filename(file_handle->filename);
|
||||
CG(zend_lineno) = 1;
|
||||
return SUCCESS;
|
||||
}
|
||||
END_EXTERN_C()
|
||||
|
||||
|
||||
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC)
|
||||
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...)
|
||||
{
|
||||
va_list files;
|
||||
zend_op_array *op_array;
|
||||
|
||||
va_start(files, file_count);
|
||||
op_array = zend_v_compile_files(type CLS_CC, file_count, files);
|
||||
va_end(files);
|
||||
return op_array;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
zend_op_array *op_array = (zend_op_array *) emalloc(sizeof(zend_op_array));
|
||||
zend_op_array *original_active_op_array = CG(active_op_array);
|
||||
zend_op_array *retval=NULL;
|
||||
int i;
|
||||
int compiler_result;
|
||||
zend_bool compilation_successful=0;
|
||||
int compiled_files=0;
|
||||
int last_file=0;
|
||||
znode retval_znode;
|
||||
zend_bool original_in_compilation = CG(in_compilation);
|
||||
zend_file_handle **file_handles = (zend_file_handle **) do_alloca(file_count * sizeof(zend_file_handle *));
|
||||
|
||||
retval_znode.op_type = IS_CONST;
|
||||
retval_znode.u.constant.type = IS_LONG;
|
||||
@@ -342,42 +348,55 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS
|
||||
retval_znode.u.constant.is_ref = 0;
|
||||
retval_znode.u.constant.refcount = 1;
|
||||
|
||||
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
|
||||
retval = op_array; /* success oriented */
|
||||
|
||||
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
||||
if (type==ZEND_REQUIRE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
|
||||
zend_bailout();
|
||||
for (i=0; i<file_count; i++) {
|
||||
file_handles[i] = va_arg(files, zend_file_handle *);
|
||||
if (file_handles[i]) {
|
||||
last_file = i;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<file_count; i++) {
|
||||
if (!file_handles[i]) {
|
||||
continue;
|
||||
}
|
||||
if (open_file_for_scanning(file_handles[i] CLS_CC)==FAILURE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handles[i]->filename);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
compiler_result = zendparse(CLS_C);
|
||||
zend_close_file_handle(file_handles[i] CLS_CC);
|
||||
if (i == last_file) {
|
||||
do_return(&retval_znode, 0 CLS_CC);
|
||||
}
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
CG(unclean_shutdown) = 1;
|
||||
retval = NULL;
|
||||
break;
|
||||
}
|
||||
compiled_files++;
|
||||
}
|
||||
compilation_successful=0;
|
||||
} else {
|
||||
init_op_array(op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
CG(in_compilation) = 1;
|
||||
CG(active_op_array) = op_array;
|
||||
compiler_result = zendparse(CLS_C);
|
||||
do_return(&retval_znode, 0 CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
if (compiler_result==1) { /* parser error */
|
||||
CG(unclean_shutdown) = 1;
|
||||
retval = NULL;
|
||||
}
|
||||
compilation_successful=1;
|
||||
}
|
||||
|
||||
if (retval) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
if (compilation_successful) {
|
||||
if (compiled_files>0) {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array);
|
||||
} else {
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
destroy_op_array(op_array);
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
}
|
||||
}
|
||||
free_alloca(file_handles);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -387,6 +406,7 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
zend_file_handle file_handle;
|
||||
zval tmp;
|
||||
zend_op_array *retval;
|
||||
int error_reporting=0;
|
||||
|
||||
if (filename->type != IS_STRING) {
|
||||
tmp = *filename;
|
||||
@@ -400,8 +420,22 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
file_handle.opened_path = NULL;
|
||||
|
||||
|
||||
retval = zend_compile_file(&file_handle, type CLS_CC);
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
if (type==ZEND_REQUIRE) {
|
||||
/* We don't want to hear about inclusion failures; If we fail,
|
||||
* we'll generate a require failure
|
||||
*/
|
||||
error_reporting = EG(error_reporting);
|
||||
EG(error_reporting) = 0;
|
||||
}
|
||||
retval = zend_compile_files(type CLS_CC, 1, &file_handle);
|
||||
|
||||
if (type==ZEND_REQUIRE) {
|
||||
EG(error_reporting) = error_reporting;
|
||||
if (!retval) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, filename->value.str.val);
|
||||
zend_bailout();
|
||||
}
|
||||
}
|
||||
|
||||
if (filename==&tmp) {
|
||||
zval_dtor(&tmp);
|
||||
@@ -409,11 +443,8 @@ zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC)
|
||||
return retval;
|
||||
}
|
||||
|
||||
#ifndef ZTS
|
||||
static inline int prepare_string_for_scanning(zval *str)
|
||||
#else
|
||||
static inline int prepare_string_for_scanning(zval *str, istrstream **input_stream CLS_DC)
|
||||
#endif
|
||||
|
||||
static inline int prepare_string_for_scanning(zval *str CLS_DC)
|
||||
{
|
||||
#ifndef ZTS
|
||||
/* enforce two trailing NULLs for flex... */
|
||||
@@ -424,10 +455,10 @@ static inline int prepare_string_for_scanning(zval *str, istrstream **input_stre
|
||||
yyin=NULL;
|
||||
yy_scan_buffer(str->value.str.val, str->value.str.len+2);
|
||||
#else
|
||||
*input_stream = new istrstream(str->value.str.val, str->value.str.len);
|
||||
istrstream *input_stream = new istrstream(str->value.str.val, str->value.str.len);
|
||||
CG(ZFL) = new ZendFlexLexer;
|
||||
|
||||
CG(ZFL)->switch_streams(*input_stream, &cout);
|
||||
CG(ZFL)->switch_streams(input_stream, &cout);
|
||||
#endif
|
||||
zend_set_compiled_filename("Eval code");
|
||||
CG(zend_lineno) = 1;
|
||||
@@ -444,9 +475,6 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
zval tmp;
|
||||
int compiler_result;
|
||||
zend_bool original_in_compilation = CG(in_compilation);
|
||||
#ifdef ZTS
|
||||
istrstream *input_stream;
|
||||
#endif
|
||||
|
||||
if (source_string->value.str.len==0) {
|
||||
efree(op_array);
|
||||
@@ -460,16 +488,13 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
convert_to_string(&tmp);
|
||||
source_string = &tmp;
|
||||
|
||||
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
#ifndef ZTS
|
||||
if (prepare_string_for_scanning(source_string)==FAILURE) {
|
||||
#else
|
||||
if (prepare_string_for_scanning(source_string, &input_stream CLS_CC)==FAILURE) {
|
||||
#endif
|
||||
if (prepare_string_for_scanning(source_string CLS_CC)==FAILURE) {
|
||||
destroy_op_array(op_array);
|
||||
efree(op_array);
|
||||
retval = NULL;
|
||||
} else {
|
||||
init_op_array(op_array, ZEND_EVAL_CODE, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
CG(active_op_array) = op_array;
|
||||
#ifndef ZTS
|
||||
BEGIN(ST_IN_SCRIPTING);
|
||||
@@ -487,12 +512,10 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
CG(active_op_array) = original_active_op_array;
|
||||
pass_two(op_array);
|
||||
pass_include_eval(op_array);
|
||||
retval = op_array;
|
||||
}
|
||||
}
|
||||
#ifdef ZTS
|
||||
delete input_stream;
|
||||
#endif
|
||||
zval_dtor(&tmp);
|
||||
CG(in_compilation) = original_in_compilation;
|
||||
return retval;
|
||||
@@ -500,6 +523,87 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
int require_filename(char *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
file_handle.filename = filename;
|
||||
file_handle.free_filename = 0;
|
||||
if (require_file(&file_handle, unique CLS_CC)==FAILURE) {
|
||||
zend_bailout();
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int use_filename(char *filename, uint filename_length CLS_DC)
|
||||
{
|
||||
zend_error(E_COMPILE_ERROR,"use: Not yet supported. Please use include_once() or require_once()");
|
||||
return FAILURE;
|
||||
|
||||
#if 0
|
||||
zend_file_handle file_handle;
|
||||
|
||||
file_handle.filename = (char *) emalloc(filename_length + zend_uv.import_use_extension_length);
|
||||
memcpy(file_handle.filename, filename, filename_length);
|
||||
memcpy(file_handle.filename+filename_length, zend_uv.import_use_extension, zend_uv.import_use_extension_length);
|
||||
file_handle.filename[filename_length+zend_uv.import_use_extension_length] = 0;
|
||||
file_handle.free_filename = 1;
|
||||
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
if (require_file(&file_handle, 1 CLS_CC)==FAILURE) {
|
||||
efree(file_handle.filename);
|
||||
zend_bailout();
|
||||
return FAILURE; /* will never get here */
|
||||
}
|
||||
return SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
int compiler_result;
|
||||
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename);
|
||||
return FAILURE;
|
||||
}
|
||||
if (file_handle->opened_path) {
|
||||
if (unique) {
|
||||
zend_file_handle *pfh;
|
||||
|
||||
if (zend_hash_add(&CG(used_files), file_handle->opened_path, strlen(file_handle->opened_path)+1, file_handle, sizeof(zend_file_handle), (void **) &pfh)==FAILURE) {
|
||||
zend_close_file_handle(file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
/* pfh is a copy we only save for get_used_files() */
|
||||
pfh->type = ZEND_HANDLE_FILENAME;
|
||||
if (pfh->filename) {
|
||||
pfh->filename = estrdup(pfh->filename);
|
||||
pfh->free_filename = 1;
|
||||
}
|
||||
if (pfh->opened_path) {
|
||||
pfh->opened_path = strdup(pfh->opened_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
compiler_result = zendparse(CLS_C);
|
||||
zend_close_file_handle(file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
if (compiler_result==1) {
|
||||
zend_bailout();
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini)
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
@@ -516,7 +620,7 @@ int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlight
|
||||
return FAILURE;
|
||||
}
|
||||
zend_highlight(syntax_highlighter_ini);
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
zend_close_file_handle(&file_handle CLS_CC);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -526,26 +630,16 @@ int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_
|
||||
{
|
||||
zend_lex_state original_lex_state;
|
||||
zval tmp = *str;
|
||||
#ifdef ZTS
|
||||
istrstream *input_stream;
|
||||
#endif
|
||||
CLS_FETCH();
|
||||
|
||||
str = &tmp;
|
||||
zval_copy_ctor(str);
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
#ifndef ZTS
|
||||
if (prepare_string_for_scanning(str)==FAILURE) {
|
||||
#else
|
||||
if (prepare_string_for_scanning(str, &input_stream CLS_CC)==FAILURE) {
|
||||
#endif
|
||||
if (prepare_string_for_scanning(str CLS_CC)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
zend_highlight(syntax_highlighter_ini);
|
||||
restore_lexical_state(&original_lex_state CLS_CC);
|
||||
#ifdef ZTS
|
||||
delete input_stream;
|
||||
#endif
|
||||
zval_dtor(str);
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -594,6 +688,47 @@ int yyFlexLexer::yylex()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* redefine YY_INPUT to handle urls for win32*/
|
||||
#if 0 /*defined(ZEND_WIN32)*/
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
if ( yyin->_tmpfname != "url" ){ \
|
||||
if ( yy_current_buffer->yy_is_interactive ) \
|
||||
{ \
|
||||
int c = '*', n; \
|
||||
for ( n = 0; n < max_size && \
|
||||
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
||||
buf[n] = (char) c; \
|
||||
if ( c == '\n' ) \
|
||||
buf[n++] = (char) c; \
|
||||
if ( c == EOF && ferror( yyin ) ) \
|
||||
YY_FATAL_ERROR( "input in flex scanner failed" ); \
|
||||
result = n; \
|
||||
} \
|
||||
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
|
||||
&& ferror( yyin ) ) \
|
||||
YY_FATAL_ERROR( "input in flex scanner failed" ); \
|
||||
}else{ /* this is a url */ \
|
||||
int recv_char=0,socketd=0; \
|
||||
/*memset(buf,0,max_size);*/ \
|
||||
socketd=yyin->_file; \
|
||||
if ( yy_current_buffer->yy_is_interactive ) \
|
||||
{ \
|
||||
int c = '*', n; \
|
||||
for ( n = 0; n < max_size && \
|
||||
( (recv_char=recv( socketd,(char *)&c,1,0 ))) >0 && c != '\n'; ++n ) \
|
||||
buf[n] = (char) c; \
|
||||
if ( c == '\n' ) \
|
||||
buf[n++] = (char) c; \
|
||||
if ( recv_char == SOCKET_ERROR ) \
|
||||
YY_FATAL_ERROR( "input from url in flex scanner failed" ); \
|
||||
result = n; \
|
||||
} \
|
||||
else if ((result = recv( socketd, (char *)buf, max_size, 0)) == SOCKET_ERROR) \
|
||||
YY_FATAL_ERROR( "input from url read in flex scanner failed" ); \
|
||||
}
|
||||
#endif
|
||||
|
||||
%}
|
||||
|
||||
LNUM [0-9]+
|
||||
@@ -606,7 +741,6 @@ TABS_AND_SPACES [ \t]*
|
||||
TOKENS [;:,.\[\]()|^&+-/*=%!~$<>?@]
|
||||
ENCAPSED_TOKENS [\[\]{}$]
|
||||
ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
|
||||
ANY_CHAR (.|[\n])
|
||||
|
||||
%option noyylineno
|
||||
%option noyywrap
|
||||
@@ -745,7 +879,7 @@ ANY_CHAR (.|[\n])
|
||||
return T_STRING;
|
||||
}
|
||||
|
||||
<ST_LOOKING_FOR_PROPERTY>{ANY_CHAR} {
|
||||
<ST_LOOKING_FOR_PROPERTY>. {
|
||||
/*unput(yytext[0]);*/
|
||||
yyless(0);
|
||||
yy_pop_state();
|
||||
@@ -988,7 +1122,7 @@ ANY_CHAR (.|[\n])
|
||||
}
|
||||
|
||||
|
||||
<ST_LOOKING_FOR_VARNAME>{ANY_CHAR} {
|
||||
<ST_LOOKING_FOR_VARNAME>. {
|
||||
/*unput(yytext[0]);*/
|
||||
yyless(0);
|
||||
yy_pop_state();
|
||||
@@ -1110,7 +1244,7 @@ ANY_CHAR (.|[\n])
|
||||
|
||||
|
||||
<INITIAL>"<?php_track_vars?>"([\n]|"\r\n")? {
|
||||
zend_error(E_WARNING, "<?php_track_vars?> is no longer supported - please use the track_vars INI directive instead");
|
||||
zend_error(E_WARNING, "<?php_track_vars?> is no longer supported - please use the track_vars INI directive instead");
|
||||
HANDLE_NEWLINE(yytext[yyleng-1]);
|
||||
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
|
||||
zendlval->value.str.len = yyleng;
|
||||
@@ -1484,7 +1618,7 @@ ANY_CHAR (.|[\n])
|
||||
return T_CHARACTER;
|
||||
}
|
||||
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\"{ANY_CHAR} {
|
||||
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"\\". {
|
||||
switch (yytext[1]) {
|
||||
case 'n':
|
||||
zendlval->value.lval = (long) '\n';
|
||||
@@ -1552,6 +1686,6 @@ ANY_CHAR (.|[\n])
|
||||
|
||||
|
||||
|
||||
<ST_IN_SCRIPTING,INITIAL,ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_SINGLE_QUOTE,ST_HEREDOC>{ANY_CHAR} {
|
||||
<ST_IN_SCRIPTING,INITIAL,ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_SINGLE_QUOTE,ST_HEREDOC>. {
|
||||
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d",yytext[0],yytext[0],YYSTATE);
|
||||
}
|
||||
+25
-91
@@ -36,7 +36,7 @@
|
||||
# define GLOBAL_CONSTANTS_TABLE CG(zend_constants)
|
||||
#endif
|
||||
|
||||
#if defined(ZEND_WIN32) && ZEND_DEBUG
|
||||
#ifdef ZEND_WIN32
|
||||
BOOL WINAPI IsDebuggerPresent(VOID);
|
||||
#endif
|
||||
|
||||
@@ -233,8 +233,8 @@ static void register_standard_class(void)
|
||||
zend_standard_class_def.name_length = sizeof("stdClass") - 1;
|
||||
zend_standard_class_def.name = zend_strndup("stdClass", zend_standard_class_def.name_length);
|
||||
zend_standard_class_def.parent = NULL;
|
||||
zend_hash_init_ex(&zend_standard_class_def.default_properties, 0, NULL, ZVAL_PTR_DTOR, 1, 0);
|
||||
zend_hash_init_ex(&zend_standard_class_def.function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1, 0);
|
||||
zend_hash_init(&zend_standard_class_def.default_properties, 0, NULL, ZVAL_PTR_DTOR, 1);
|
||||
zend_hash_init(&zend_standard_class_def.function_table, 0, NULL, ZEND_FUNCTION_DTOR, 1);
|
||||
zend_standard_class_def.handle_function_call = NULL;
|
||||
zend_standard_class_def.handle_property_get = NULL;
|
||||
zend_standard_class_def.handle_property_set = NULL;
|
||||
@@ -260,14 +260,12 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals)
|
||||
zend_function tmp_func;
|
||||
zend_class_entry tmp_class;
|
||||
|
||||
compiler_globals->compiled_filename = NULL;
|
||||
|
||||
compiler_globals->function_table = (HashTable *) malloc(sizeof(HashTable));
|
||||
zend_hash_init_ex(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
|
||||
zend_hash_init(compiler_globals->function_table, 100, NULL, ZEND_FUNCTION_DTOR, 1);
|
||||
zend_hash_copy(compiler_globals->function_table, global_function_table, NULL, &tmp_func, sizeof(zend_function));
|
||||
|
||||
compiler_globals->class_table = (HashTable *) malloc(sizeof(HashTable));
|
||||
zend_hash_init_ex(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
|
||||
zend_hash_init(compiler_globals->class_table, 10, NULL, ZEND_CLASS_DTOR, 1);
|
||||
zend_hash_copy(compiler_globals->class_table, global_class_table, (copy_ctor_func_t) zend_class_add_ref, &tmp_class, sizeof(zend_class_entry));
|
||||
|
||||
zend_set_default_compile_time_values(CLS_C);
|
||||
@@ -357,7 +355,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
zend_get_ini_entry_p = utility_functions->get_ini_entry;
|
||||
zend_ticks_function = utility_functions->ticks_function;
|
||||
|
||||
zend_compile_file = compile_file;
|
||||
zend_v_compile_files = v_compile_files;
|
||||
zend_execute = execute;
|
||||
|
||||
zend_startup_extensions();
|
||||
@@ -368,10 +366,10 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
|
||||
|
||||
GLOBAL_FUNCTION_TABLE = (HashTable *) malloc(sizeof(HashTable));
|
||||
GLOBAL_CLASS_TABLE = (HashTable *) malloc(sizeof(HashTable));
|
||||
zend_hash_init_ex(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1, 0);
|
||||
zend_hash_init_ex(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1, 0);
|
||||
zend_hash_init(GLOBAL_FUNCTION_TABLE, 100, NULL, ZEND_FUNCTION_DTOR, 1);
|
||||
zend_hash_init(GLOBAL_CLASS_TABLE, 10, NULL, ZEND_CLASS_DTOR, 1);
|
||||
register_standard_class();
|
||||
zend_hash_init_ex(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1, 0);
|
||||
zend_hash_init(&module_registry, 50, NULL, ZEND_MODULE_DTOR, 1);
|
||||
zend_init_rsrc_list_dtors();
|
||||
|
||||
/* This zval can be used to initialize allocate zval's to an uninit'ed value */
|
||||
@@ -507,9 +505,7 @@ void zend_deactivate_modules()
|
||||
|
||||
void zend_deactivate(CLS_D ELS_DC)
|
||||
{
|
||||
/* we're no longer executing anything */
|
||||
EG(opline_ptr) = NULL;
|
||||
EG(active_symbol_table) = NULL;
|
||||
EG(opline_ptr) = NULL; /* we're no longer executing anything */
|
||||
|
||||
shutdown_scanner(CLS_C);
|
||||
shutdown_executor(ELS_C);
|
||||
@@ -544,10 +540,9 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
va_list args;
|
||||
zval ***params;
|
||||
zval *retval;
|
||||
zval *z_error_type, *z_error_message, *z_error_filename, *z_error_lineno, *z_context;
|
||||
zval *error_type, *error_message;
|
||||
char *error_filename;
|
||||
uint error_lineno;
|
||||
zval *orig_user_error_handler;
|
||||
ELS_FETCH();
|
||||
CLS_FETCH();
|
||||
|
||||
@@ -605,62 +600,34 @@ ZEND_API void zend_error(int type, const char *format, ...)
|
||||
break;
|
||||
default:
|
||||
/* Handle the error in user space */
|
||||
ALLOC_INIT_ZVAL(z_error_message);
|
||||
ALLOC_INIT_ZVAL(z_error_type);
|
||||
ALLOC_INIT_ZVAL(z_error_filename);
|
||||
ALLOC_INIT_ZVAL(z_error_lineno);
|
||||
ALLOC_INIT_ZVAL(z_context);
|
||||
z_error_message->value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
|
||||
ALLOC_INIT_ZVAL(error_message);
|
||||
ALLOC_INIT_ZVAL(error_type);
|
||||
error_message->value.str.val = (char *) emalloc(ZEND_ERROR_BUFFER_SIZE);
|
||||
|
||||
#ifdef HAVE_VSNPRINTF
|
||||
z_error_message->value.str.len = vsnprintf(z_error_message->value.str.val, ZEND_ERROR_BUFFER_SIZE, format, args);
|
||||
error_message->value.str.len = vsnprintf(error_message->value.str.val, ZEND_ERROR_BUFFER_SIZE, format, args);
|
||||
#else
|
||||
/* This is risky... */
|
||||
z_error_message->value.str.len = vsprintf(z_error_message->value.str.val, format, args);
|
||||
error_message->value.str.len = vsprintf(error_message->value.str.val, format, args);
|
||||
#endif
|
||||
z_error_message->type = IS_STRING;
|
||||
error_message->type = IS_STRING;
|
||||
|
||||
z_error_type->value.lval = type;
|
||||
z_error_type->type = IS_LONG;
|
||||
error_type->value.lval = type;
|
||||
error_type->type = IS_LONG;
|
||||
|
||||
if (error_filename) {
|
||||
z_error_filename->value.str.len = strlen(error_filename);
|
||||
z_error_filename->value.str.val = estrndup(error_filename, z_error_filename->value.str.len);
|
||||
z_error_filename->type = IS_STRING;
|
||||
}
|
||||
|
||||
z_error_lineno->value.lval = error_lineno;
|
||||
z_error_lineno->type = IS_LONG;
|
||||
params = (zval ***) emalloc(sizeof(zval **)*2);
|
||||
params[0] = &error_type;
|
||||
params[1] = &error_message;
|
||||
|
||||
z_context->value.ht = EG(active_symbol_table);
|
||||
z_context->type = IS_ARRAY;
|
||||
ZVAL_ADDREF(z_context); /* we don't want this one to be freed */
|
||||
|
||||
params = (zval ***) emalloc(sizeof(zval **)*5);
|
||||
params[0] = &z_error_type;
|
||||
params[1] = &z_error_message;
|
||||
params[2] = &z_error_filename;
|
||||
params[3] = &z_error_lineno;
|
||||
params[4] = &z_context;
|
||||
|
||||
orig_user_error_handler = EG(user_error_handler);
|
||||
EG(user_error_handler) = NULL;
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL)==SUCCESS) {
|
||||
if (call_user_function_ex(CG(function_table), NULL, EG(user_error_handler), &retval, 2, params, 1, NULL)==SUCCESS) {
|
||||
zval_ptr_dtor(&retval);
|
||||
} else {
|
||||
/* The user error handler failed, use built-in error handler */
|
||||
zend_error_cb(type, error_filename, error_lineno, format, args);
|
||||
}
|
||||
EG(user_error_handler) = orig_user_error_handler;
|
||||
|
||||
efree(params);
|
||||
zval_ptr_dtor(&z_error_message);
|
||||
zval_ptr_dtor(&z_error_type);
|
||||
zval_ptr_dtor(&z_error_filename);
|
||||
zval_ptr_dtor(&z_error_lineno);
|
||||
if (ZVAL_REFCOUNT(z_context)==2) {
|
||||
FREE_ZVAL(z_context);
|
||||
}
|
||||
zval_ptr_dtor(&error_message);
|
||||
zval_ptr_dtor(&error_type);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -692,36 +659,3 @@ ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ..
|
||||
va_end(args);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_execute_scripts(int type CLS_DC ELS_DC, int file_count, ...)
|
||||
{
|
||||
va_list files;
|
||||
int i;
|
||||
zend_file_handle *file_handle;
|
||||
|
||||
va_start(files, file_count);
|
||||
for (i=0; i<file_count; i++) {
|
||||
file_handle = va_arg(files, zend_file_handle *);
|
||||
if (!file_handle) {
|
||||
continue;
|
||||
}
|
||||
EG(active_op_array) = zend_compile_file(file_handle, ZEND_INCLUDE CLS_CC);
|
||||
zend_destroy_file_handle(file_handle CLS_CC);
|
||||
if (EG(active_op_array)) {
|
||||
zend_execute(EG(active_op_array) ELS_CC);
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
|
||||
EG(global_return_value_ptr) = NULL;
|
||||
destroy_op_array(EG(active_op_array));
|
||||
efree(EG(active_op_array));
|
||||
} else if (type==ZEND_REQUIRE) {
|
||||
va_end(files);
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
va_end(files);
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+4
-15
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_H
|
||||
#define ZEND_H
|
||||
#ifndef _ZEND_H
|
||||
#define _ZEND_H
|
||||
|
||||
#define ZEND_VERSION "1.0.1"
|
||||
|
||||
@@ -135,7 +135,6 @@
|
||||
typedef unsigned char zend_bool;
|
||||
typedef unsigned char zend_uchar;
|
||||
typedef unsigned int zend_uint;
|
||||
typedef unsigned long zend_ulong;
|
||||
typedef unsigned short zend_ushort;
|
||||
|
||||
#undef SUCCESS
|
||||
@@ -365,11 +364,6 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
#define ZMSG_MEMORY_LEAK_REPEATED 5L
|
||||
#define ZMSG_LOG_SCRIPT_NAME 6L
|
||||
|
||||
|
||||
#define ZVAL_ADDREF(pz) (++(pz)->refcount)
|
||||
#define ZVAL_DELREF(pz) (--(pz)->refcount)
|
||||
#define ZVAL_REFCOUNT(pz) ((pz)->refcount)
|
||||
|
||||
#define INIT_PZVAL(z) \
|
||||
(z)->refcount = 1; \
|
||||
(z)->is_ref = 0;
|
||||
@@ -405,11 +399,6 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
}
|
||||
|
||||
#define SEPARATE_ZVAL_TO_MAKE_IS_REF(ppzv) \
|
||||
if (!PZVAL_IS_REF(*ppzv)) { \
|
||||
SEPARATE_ZVAL(ppzv); \
|
||||
(*(ppzv))->is_ref = 1; \
|
||||
}
|
||||
|
||||
#define COPY_PZVAL_TO_ZVAL(zv, pzv) \
|
||||
(zv) = *(pzv); \
|
||||
@@ -417,7 +406,7 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
zval_copy_ctor(&(zv)); \
|
||||
(pzv)->refcount--; \
|
||||
} else { \
|
||||
FREE_ZVAL(pzv); \
|
||||
FREE_ZVAL(pzv); \
|
||||
} \
|
||||
INIT_PZVAL(&(zv));
|
||||
|
||||
@@ -434,7 +423,7 @@ ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
|
||||
#define EMPTY_SWITCH_DEFAULT_CASE()
|
||||
#endif
|
||||
|
||||
#endif /* ZEND_H */
|
||||
#endif /* _ZEND_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
+6
-6
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_API_H
|
||||
#define ZEND_API_H
|
||||
#ifndef _ZEND_API_H
|
||||
#define _ZEND_API_H
|
||||
|
||||
#include "modules.h"
|
||||
#include "zend_list.h"
|
||||
@@ -227,7 +227,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define ZVAL_EMPTY_STRING(z) { \
|
||||
(z)->value.str.len = 0; \
|
||||
(z)->value.str.val = empty_string; \
|
||||
(z)->value.str.val = empty_string \
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define RETVAL_EMPTY_STRING() { \
|
||||
return_value->value.str.len = 0; \
|
||||
return_value->value.str.val = empty_string; \
|
||||
return_value->value.str.val = empty_string \
|
||||
return_value->type = IS_STRING; \
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
|
||||
#define RETURN_EMPTY_STRING() { \
|
||||
return_value->value.str.len = 0; \
|
||||
return_value->value.str.val = empty_string; \
|
||||
return_value->value.str.val = empty_string \
|
||||
return_value->type = IS_STRING; \
|
||||
return; \
|
||||
}
|
||||
@@ -416,7 +416,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
|
||||
#define HASH_OF(p) ((p)->type==IS_ARRAY ? (p)->value.ht : (((p)->type==IS_OBJECT ? (p)->value.obj.properties : NULL)))
|
||||
#define ZVAL_IS_NULL(z) ((z)->type==IS_NULL)
|
||||
|
||||
#endif /* ZEND_API_H */
|
||||
#endif /* _ZEND_API_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
+5
-18
@@ -57,18 +57,11 @@ ZEND_API zend_alloc_globals alloc_globals;
|
||||
|
||||
#define _CHECK_MEMORY_LIMIT(s, rs, file, lineno) { AG(allocated_memory) += rs;\
|
||||
if (AG(memory_limit)<AG(allocated_memory)) {\
|
||||
if ((AG(memory_limit)+1048576)<AG(allocated_memory)) { \
|
||||
/* failed to handle this gracefully, exit() */ \
|
||||
exit(1); \
|
||||
} \
|
||||
if (!AG(memory_exhausted)) { \
|
||||
if (!file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \
|
||||
} else { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", AG(memory_limit), file, lineno, s); \
|
||||
} \
|
||||
AG(memory_exhausted)=1; \
|
||||
} \
|
||||
if (!file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \
|
||||
} else { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", AG(memory_limit), file, lineno, s); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
# endif
|
||||
@@ -441,9 +434,6 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (long) (total_leak_count));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if MEMORY_LIMIT
|
||||
AG(allocated_memory) -= t->size;
|
||||
#endif
|
||||
p = t->pNext;
|
||||
REMOVE_POINTER_FROM_LIST(t);
|
||||
@@ -461,9 +451,6 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
|
||||
}
|
||||
}
|
||||
}
|
||||
#if MEMORY_LIMIT
|
||||
AG(memory_exhausted)=0;
|
||||
#endif
|
||||
|
||||
#if (ZEND_DEBUG)
|
||||
do {
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_ALLOC_H
|
||||
#define ZEND_ALLOC_H
|
||||
#ifndef _ALLOC_H
|
||||
#define _ALLOC_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ static ZEND_FUNCTION(strlen);
|
||||
static ZEND_FUNCTION(strcmp);
|
||||
static ZEND_FUNCTION(strncmp);
|
||||
static ZEND_FUNCTION(strcasecmp);
|
||||
static ZEND_FUNCTION(strncasecmp);
|
||||
static ZEND_FUNCTION(each);
|
||||
static ZEND_FUNCTION(error_reporting);
|
||||
static ZEND_FUNCTION(define);
|
||||
@@ -47,6 +46,7 @@ static ZEND_FUNCTION(leak);
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
static ZEND_FUNCTION(crash);
|
||||
#endif
|
||||
static ZEND_FUNCTION(get_required_files);
|
||||
static ZEND_FUNCTION(get_included_files);
|
||||
static ZEND_FUNCTION(is_subclass_of);
|
||||
static ZEND_FUNCTION(get_class_vars);
|
||||
@@ -57,7 +57,6 @@ static ZEND_FUNCTION(set_error_handler);
|
||||
static ZEND_FUNCTION(restore_error_handler);
|
||||
static ZEND_FUNCTION(get_declared_classes);
|
||||
static ZEND_FUNCTION(create_function);
|
||||
static ZEND_FUNCTION(get_resource_type);
|
||||
#if ZEND_DEBUG
|
||||
static ZEND_FUNCTION(zend_test_func);
|
||||
#endif
|
||||
@@ -76,7 +75,6 @@ static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(strcmp, NULL)
|
||||
ZEND_FE(strncmp, NULL)
|
||||
ZEND_FE(strcasecmp, NULL)
|
||||
ZEND_FE(strncasecmp, NULL)
|
||||
ZEND_FE(each, first_arg_force_ref)
|
||||
ZEND_FE(error_reporting, NULL)
|
||||
ZEND_FE(define, NULL)
|
||||
@@ -90,8 +88,8 @@ static zend_function_entry builtin_functions[] = {
|
||||
#ifdef ZEND_TEST_EXCEPTIONS
|
||||
ZEND_FE(crash, NULL)
|
||||
#endif
|
||||
ZEND_FE(get_required_files, NULL)
|
||||
ZEND_FE(get_included_files, NULL)
|
||||
ZEND_FALIAS(get_required_files, get_included_files, NULL)
|
||||
ZEND_FE(is_subclass_of, NULL)
|
||||
ZEND_FE(get_class_vars, NULL)
|
||||
ZEND_FE(get_object_vars, NULL)
|
||||
@@ -102,7 +100,6 @@ static zend_function_entry builtin_functions[] = {
|
||||
ZEND_FE(restore_error_handler, NULL)
|
||||
ZEND_FE(get_declared_classes, NULL)
|
||||
ZEND_FE(create_function, NULL)
|
||||
ZEND_FE(get_resource_type, NULL)
|
||||
#if ZEND_DEBUG
|
||||
ZEND_FE(zend_test_func, NULL)
|
||||
#endif
|
||||
@@ -222,7 +219,7 @@ ZEND_FUNCTION(strlen)
|
||||
zval **str;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(str);
|
||||
RETVAL_LONG((*str)->value.str.len);
|
||||
@@ -236,7 +233,7 @@ ZEND_FUNCTION(strcmp)
|
||||
zval **s1, **s2;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
@@ -251,7 +248,7 @@ ZEND_FUNCTION(strncmp)
|
||||
zval **s1, **s2, **s3;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &s1, &s2, &s3) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
@@ -267,7 +264,7 @@ ZEND_FUNCTION(strcasecmp)
|
||||
zval **s1, **s2;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
@@ -275,22 +272,6 @@ ZEND_FUNCTION(strcasecmp)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int strncasecmp(string str1, string str2, int len)
|
||||
Binary safe string comparison */
|
||||
ZEND_FUNCTION(strncasecmp)
|
||||
{
|
||||
zval **s1, **s2, **s3;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &s1, &s2, &s3) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(s1);
|
||||
convert_to_string_ex(s2);
|
||||
convert_to_long_ex(s3);
|
||||
RETURN_LONG(zend_binary_zval_strncasecmp(*s1,*s2,*s3));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_FUNCTION(each)
|
||||
{
|
||||
zval **array,*entry,**entry_ptr, *tmp;
|
||||
@@ -300,7 +281,7 @@ ZEND_FUNCTION(each)
|
||||
HashTable *target_hash;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &array) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
target_hash = HASH_OF(*array);
|
||||
if (!target_hash) {
|
||||
@@ -358,10 +339,10 @@ ZEND_FUNCTION(error_reporting)
|
||||
EG(error_reporting)=(*arg)->value.lval;
|
||||
break;
|
||||
default:
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
RETVAL_LONG(old_error_reporting);
|
||||
}
|
||||
|
||||
@@ -390,10 +371,9 @@ ZEND_FUNCTION(define)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
break;
|
||||
}
|
||||
|
||||
switch((*val)->type) {
|
||||
case IS_LONG:
|
||||
case IS_DOUBLE:
|
||||
@@ -414,11 +394,8 @@ ZEND_FUNCTION(define)
|
||||
c.flags = case_sensitive; /* non persistent */
|
||||
c.name = zend_strndup((*var)->value.str.val, (*var)->value.str.len);
|
||||
c.name_len = (*var)->value.str.len+1;
|
||||
if(zend_register_constant(&c ELS_CC) == SUCCESS) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
zend_register_constant(&c ELS_CC);
|
||||
RETURN_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +405,7 @@ ZEND_FUNCTION(defined)
|
||||
zval c;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &var)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(var);
|
||||
@@ -447,7 +424,7 @@ ZEND_FUNCTION(get_class)
|
||||
zval **arg;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if ((*arg)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
@@ -463,7 +440,7 @@ ZEND_FUNCTION(get_parent_class)
|
||||
zval **arg;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if (((*arg)->type != IS_OBJECT) || !(*arg)->value.obj.ce->parent) {
|
||||
RETURN_FALSE;
|
||||
@@ -481,7 +458,7 @@ ZEND_FUNCTION(is_subclass_of)
|
||||
zend_class_entry *parent_ce = NULL;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &obj, &class_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if ((*obj)->type != IS_OBJECT) {
|
||||
@@ -514,7 +491,7 @@ ZEND_FUNCTION(get_class_vars)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
@@ -540,7 +517,7 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zval *tmp;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &obj) == FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
if ((*obj)->type != IS_OBJECT) {
|
||||
@@ -567,7 +544,7 @@ ZEND_FUNCTION(get_class_methods)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
@@ -601,7 +578,7 @@ ZEND_FUNCTION(method_exists)
|
||||
char *lcname;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &klass, &method_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if ((*klass)->type != IS_OBJECT) {
|
||||
RETURN_FALSE;
|
||||
@@ -628,7 +605,7 @@ ZEND_FUNCTION(class_exists)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(class_name);
|
||||
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
|
||||
@@ -652,7 +629,7 @@ ZEND_FUNCTION(function_exists)
|
||||
int retval;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(function_name);
|
||||
lcname = estrndup((*function_name)->value.str.val, (*function_name)->value.str.len);
|
||||
@@ -712,12 +689,28 @@ static int copy_import_use_file(zend_file_handle *fh, zval *array)
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto array get_required_files(void)
|
||||
Returns an array with the file names that were require_once()'d */
|
||||
ZEND_FUNCTION(get_required_files)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
zend_hash_apply_with_argument(&CG(used_files), (apply_func_arg_t) copy_import_use_file, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
/* {{{ proto array get_included_files(void)
|
||||
Returns an array with the file names that were include_once()'d */
|
||||
ZEND_FUNCTION(get_included_files)
|
||||
{
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
@@ -834,7 +827,7 @@ ZEND_FUNCTION(get_declared_classes)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
array_init(return_value);
|
||||
@@ -856,7 +849,7 @@ ZEND_FUNCTION(create_function)
|
||||
CLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &z_function_args, &z_function_code)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(z_function_args);
|
||||
@@ -904,26 +897,3 @@ ZEND_FUNCTION(zend_test_func)
|
||||
|
||||
zend_get_parameters(ht, 2, &arg1, &arg2);
|
||||
}
|
||||
|
||||
|
||||
ZEND_FUNCTION(get_resource_type)
|
||||
{
|
||||
char *resource_type;
|
||||
zval **z_resource_type;
|
||||
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &z_resource_type)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(z_resource_type) != IS_RESOURCE) {
|
||||
zend_error(E_WARNING, "Supplied argument is not a valid resource handle");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(z_resource_type));
|
||||
if (resource_type) {
|
||||
RETURN_STRING(resource_type, 1);
|
||||
} else {
|
||||
RETURN_STRING("Unknown", 1);
|
||||
}
|
||||
}
|
||||
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_BUILTIN_FUNCTIONS_H
|
||||
#define ZEND_BUILTIN_FUNCTIONS_H
|
||||
#ifndef _ZEND_BUILTIN_FUNCTIONS_H
|
||||
#define _ZEND_BUILTIN_FUNCTIONS_H
|
||||
|
||||
int zend_startup_builtin_functions(void);
|
||||
|
||||
#endif /* ZEND_BUILTIN_FUNCTIONS_H */
|
||||
#endif /* _ZEND_BUILTIN_FUNCTIONS_H */
|
||||
+60
-96
@@ -26,7 +26,7 @@
|
||||
#include "zend_fast_cache.h"
|
||||
|
||||
|
||||
ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type CLS_DC);
|
||||
ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
|
||||
|
||||
|
||||
#ifndef ZTS
|
||||
@@ -43,15 +43,15 @@ static void free_filename(void *p)
|
||||
}
|
||||
|
||||
|
||||
static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline CLS_DC)
|
||||
static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline)
|
||||
{
|
||||
char lineno_buf[32];
|
||||
uint lineno_len;
|
||||
char *filename;
|
||||
|
||||
lineno_len = zend_sprintf(lineno_buf, "%d", opline->lineno);
|
||||
if (CG(active_op_array)->filename) {
|
||||
filename = CG(active_op_array)->filename;
|
||||
if (opline->filename) {
|
||||
filename = opline->filename;
|
||||
} else {
|
||||
filename = "-";
|
||||
}
|
||||
@@ -65,6 +65,12 @@ static void build_runtime_defined_function_key(zval *result, zval *name, zend_op
|
||||
}
|
||||
|
||||
|
||||
static void zend_open_file_dtor_wrapper(zend_file_handle *fh)
|
||||
{
|
||||
zend_open_file_dtor(fh);
|
||||
}
|
||||
|
||||
|
||||
static void init_compiler_declarables(CLS_D ELS_DC)
|
||||
{
|
||||
CG(declarables).ticks.type = IS_LONG;
|
||||
@@ -83,12 +89,13 @@ void init_compiler(CLS_D ELS_DC)
|
||||
CG(active_class_entry) = NULL;
|
||||
zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
|
||||
zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0);
|
||||
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_filename, 0);
|
||||
zend_llist_init(&CG(filenames_list), sizeof(char *), free_filename, 0);
|
||||
CG(handle_op_arrays) = 1;
|
||||
CG(in_compilation) = 0;
|
||||
zend_init_rsrc_list(ELS_C);
|
||||
CG(unclean_shutdown) = 0;
|
||||
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0);
|
||||
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_open_file_dtor, 0);
|
||||
zend_hash_init(&CG(used_files), 5, NULL, (void (*)(void *)) zend_open_file_dtor_wrapper, 0);
|
||||
init_compiler_declarables(CLS_C ELS_CC);
|
||||
}
|
||||
|
||||
@@ -101,22 +108,18 @@ void shutdown_compiler(CLS_D)
|
||||
zend_stack_destroy(&CG(foreach_copy_stack));
|
||||
zend_stack_destroy(&CG(object_stack));
|
||||
zend_stack_destroy(&CG(declare_stack));
|
||||
zend_hash_destroy(&CG(filenames_table));
|
||||
zend_llist_destroy(&CG(filenames_list));
|
||||
zend_llist_destroy(&CG(open_files));
|
||||
zend_hash_destroy(&CG(used_files));
|
||||
}
|
||||
|
||||
|
||||
ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename)
|
||||
{
|
||||
char **pp, *p;
|
||||
int length = strlen(new_compiled_filename);
|
||||
char *p = estrdup(new_compiled_filename);
|
||||
CLS_FETCH();
|
||||
|
||||
if (zend_hash_find(&CG(filenames_table), new_compiled_filename, length+1, (void **) &pp)==SUCCESS) {
|
||||
return *pp;
|
||||
}
|
||||
p = estrndup(new_compiled_filename, length);
|
||||
zend_hash_update(&CG(filenames_table), new_compiled_filename, length+1, &p, sizeof(char *), (void **) &pp);
|
||||
zend_llist_add_element(&CG(filenames_list), &p);
|
||||
CG(compiled_filename) = p;
|
||||
return p;
|
||||
}
|
||||
@@ -325,8 +328,7 @@ void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC)
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
*result = opline->result;
|
||||
} else {
|
||||
/* SET_UNUSED(opline->result); */
|
||||
opline->result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
SET_UNUSED(opline->result);
|
||||
}
|
||||
opline->op1 = *lvar;
|
||||
opline->op2 = *rvar;
|
||||
@@ -514,6 +516,8 @@ void do_begin_variable_parse(CLS_D)
|
||||
{
|
||||
zend_llist fetch_list;
|
||||
|
||||
/* zend_llist_init(&fetch_list, sizeof(int), NULL, 0);
|
||||
zend_stack_push(&CG(bp_stack), (void *) &fetch_list, sizeof(zend_llist));*/
|
||||
zend_llist_init(&fetch_list, sizeof(zend_op), NULL, 0);
|
||||
zend_stack_push(&CG(bp_stack), (void *) &fetch_list, sizeof(zend_llist));
|
||||
}
|
||||
@@ -563,27 +567,6 @@ void do_end_variable_parse(int type, int arg_offset CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
static zend_bool is_method_call(CLS_D)
|
||||
{
|
||||
zend_llist *fetch_list_ptr;
|
||||
zend_llist_element *cur;
|
||||
zend_op *cur_opline;
|
||||
|
||||
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
|
||||
|
||||
cur = fetch_list_ptr->head;
|
||||
/* There is always at least one node in the list */
|
||||
while (cur->next) {
|
||||
cur = cur->next;
|
||||
}
|
||||
cur_opline = (zend_op *)cur->data;
|
||||
if (cur_opline->opcode == ZEND_FETCH_OBJ_W) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void do_init_string(znode *result CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
@@ -715,7 +698,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
function_token->u.op_array = CG(active_op_array);
|
||||
zend_str_tolower(name, name_len);
|
||||
|
||||
init_op_array(&op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE CLS_CC);
|
||||
init_op_array(&op_array, ZEND_USER_FUNCTION, INITIAL_OP_ARRAY_SIZE);
|
||||
|
||||
op_array.function_name = name;
|
||||
op_array.arg_types = NULL;
|
||||
@@ -728,7 +711,7 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
|
||||
opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &function_name->u.constant, opline CLS_CC);
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &function_name->u.constant, opline);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.value.str.val = estrndup(name, name_len);
|
||||
@@ -764,7 +747,6 @@ void do_begin_function_declaration(znode *function_token, znode *function_name,
|
||||
|
||||
void do_end_function_declaration(znode *function_token CLS_DC)
|
||||
{
|
||||
do_extended_info(CLS_C);
|
||||
do_return(NULL, 0 CLS_CC);
|
||||
pass_two(CG(active_op_array));
|
||||
CG(active_op_array) = function_token->u.op_array;
|
||||
@@ -833,7 +815,6 @@ int do_begin_function_call(znode *function_name CLS_DC)
|
||||
}
|
||||
break;
|
||||
}
|
||||
do_extended_fcall_begin(CLS_C);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -841,30 +822,20 @@ int do_begin_function_call(znode *function_name CLS_DC)
|
||||
void do_begin_dynamic_function_call(znode *function_name CLS_DC)
|
||||
{
|
||||
unsigned char *ptr = NULL;
|
||||
int last_op_number;
|
||||
zend_op *last_op;
|
||||
int last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
|
||||
if (function_name->op_type != IS_CONST && is_method_call(CLS_C)) {
|
||||
do_end_variable_parse(BP_VAR_W, 0 CLS_CC);
|
||||
last_op_number = get_next_op_number(CG(active_op_array))-1;
|
||||
last_op = &CG(active_op_array)->opcodes[last_op_number];
|
||||
last_op->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
last_op->extended_value = ZEND_MEMBER_FUNC_CALL;
|
||||
if (last_op_number>=0 && CG(active_op_array)->opcodes[last_op_number].opcode == ZEND_FETCH_OBJ_R) {
|
||||
CG(active_op_array)->opcodes[last_op_number].opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
CG(active_op_array)->opcodes[last_op_number].extended_value = ZEND_MEMBER_FUNC_CALL;
|
||||
} else {
|
||||
zend_op *opline;
|
||||
|
||||
if (function_name->op_type != IS_CONST) {
|
||||
do_end_variable_parse(BP_VAR_R, 0 CLS_CC);
|
||||
}
|
||||
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
opline->op2 = *function_name;
|
||||
opline->extended_value = 0;
|
||||
SET_UNUSED(opline->op1);
|
||||
}
|
||||
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
|
||||
do_extended_fcall_begin(CLS_C);
|
||||
}
|
||||
|
||||
|
||||
@@ -875,15 +846,6 @@ void do_begin_class_member_function_call(znode *class_name, znode *function_name
|
||||
|
||||
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
|
||||
zend_str_tolower(class_name->u.constant.value.str.val, class_name->u.constant.value.str.len);
|
||||
if ((class_name->u.constant.value.str.len == sizeof("parent")-1)
|
||||
&& !memcmp(class_name->u.constant.value.str.val, "parent", sizeof("parent")-1)) {
|
||||
if (!CG(active_class_entry) || !CG(active_class_entry)->parent) {
|
||||
zend_error(E_COMPILE_ERROR, "No parent class available in this context");
|
||||
}
|
||||
efree(class_name->u.constant.value.str.val);
|
||||
class_name->u.constant.value.str.len = CG(active_class_entry)->parent->name_length;
|
||||
class_name->u.constant.value.str.val = estrndup(CG(active_class_entry)->parent->name, class_name->u.constant.value.str.len);
|
||||
}
|
||||
opline->op1 = *class_name;
|
||||
opline->op2 = *function_name;
|
||||
opline->extended_value = ZEND_MEMBER_FUNC_CALL;
|
||||
@@ -1146,7 +1108,6 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
break;
|
||||
case ZEND_DECLARE_INHERITED_CLASS: {
|
||||
zend_class_entry *ce, *parent_ce;
|
||||
int parent_name_length;
|
||||
char *class_name, *parent_name;
|
||||
int found_ce;
|
||||
|
||||
@@ -1154,11 +1115,12 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
found_ce = zend_hash_find(class_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &ce);
|
||||
|
||||
/* Restore base class / derived class names */
|
||||
parent_name = opline->op2.u.constant.value.str.val;
|
||||
class_name = strchr(opline->op2.u.constant.value.str.val, ':');
|
||||
if (!class_name) {
|
||||
zend_error(E_CORE_ERROR, "Invalid runtime class entry");
|
||||
}
|
||||
class_name++;
|
||||
*class_name++ = 0;
|
||||
|
||||
if (found_ce==FAILURE) {
|
||||
zend_error(E_ERROR, "Cannot redeclare class %s", class_name);
|
||||
@@ -1168,17 +1130,14 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
(*ce->refcount)++;
|
||||
|
||||
/* Obtain parent class */
|
||||
parent_name_length = class_name - opline->op2.u.constant.value.str.val - 1;
|
||||
parent_name = estrndup(opline->op2.u.constant.value.str.val, parent_name_length);
|
||||
if (zend_hash_find(class_table, parent_name, parent_name_length+1, (void **) &parent_ce)==FAILURE) {
|
||||
if (zend_hash_find(class_table, parent_name, strlen(parent_name)+1, (void **) &parent_ce)==FAILURE) {
|
||||
if (!compile_time) {
|
||||
zend_error(E_ERROR, "Class %s: Cannot inherit from undefined class %s", class_name, parent_name);
|
||||
}
|
||||
(*ce->refcount)--;
|
||||
efree(parent_name);
|
||||
*(class_name-1) = ':';
|
||||
return FAILURE;
|
||||
}
|
||||
efree(parent_name);
|
||||
|
||||
do_inheritance(ce, parent_ce);
|
||||
|
||||
@@ -1190,8 +1149,10 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
|
||||
(*ce->refcount)--;
|
||||
zend_hash_destroy(&ce->function_table);
|
||||
zend_hash_destroy(&ce->default_properties);
|
||||
*(class_name-1) = ':';
|
||||
return FAILURE;
|
||||
}
|
||||
*(class_name-1) = ':';
|
||||
return SUCCESS;
|
||||
}
|
||||
break;
|
||||
@@ -1343,22 +1304,10 @@ void do_brk_cont(int op, znode *expr CLS_DC)
|
||||
void do_switch_cond(znode *cond CLS_DC)
|
||||
{
|
||||
zend_switch_entry switch_entry;
|
||||
zend_op *opline;
|
||||
|
||||
/* Initialize the conditional value */
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_BOOL;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
opline->op1.u.constant.type = IS_BOOL;
|
||||
opline->op1.u.constant.value.lval = 0;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
SET_UNUSED(opline->op2);
|
||||
|
||||
switch_entry.cond = *cond;
|
||||
switch_entry.default_case = -1;
|
||||
switch_entry.control_var = opline->result.u.var;
|
||||
switch_entry.control_var = -1;
|
||||
zend_stack_push(&CG(switch_cond_stack), (void *) &switch_entry, sizeof(switch_entry));
|
||||
|
||||
do_begin_loop(CLS_C);
|
||||
@@ -1423,6 +1372,9 @@ void do_case_before_statement(znode *case_list, znode *case_token, znode *case_e
|
||||
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
|
||||
|
||||
opline->opcode = ZEND_CASE;
|
||||
if (switch_entry_ptr->control_var==-1) {
|
||||
switch_entry_ptr->control_var = get_temporary_variable(CG(active_op_array));
|
||||
}
|
||||
opline->result.u.var = switch_entry_ptr->control_var;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1 = switch_entry_ptr->cond;
|
||||
@@ -1485,19 +1437,22 @@ void do_default_before_statement(znode *case_list, znode *default_token CLS_DC)
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
opline->opcode = ZEND_BOOL;
|
||||
if (switch_entry_ptr->control_var==-1) {
|
||||
switch_entry_ptr->control_var = get_temporary_variable(CG(active_op_array));
|
||||
}
|
||||
opline->result.u.var = switch_entry_ptr->control_var;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
opline->op1.u.constant.type = IS_BOOL;
|
||||
opline->op1.u.constant.type = IS_LONG;
|
||||
opline->op1.u.constant.value.lval = 1;
|
||||
INIT_PZVAL(&opline->op1.u.constant);
|
||||
SET_UNUSED(opline->op2);
|
||||
switch_entry_ptr->default_case = next_op_number;
|
||||
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
if (case_list->op_type==IS_UNUSED) {
|
||||
return;
|
||||
}
|
||||
next_op_number = get_next_op_number(CG(active_op_array));
|
||||
CG(active_op_array)->opcodes[case_list->u.opline_num].op1.u.opline_num = next_op_number;
|
||||
}
|
||||
|
||||
@@ -1555,7 +1510,7 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
|
||||
opline->opcode = ZEND_DECLARE_FUNCTION_OR_CLASS;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &class_name->u.constant, opline CLS_CC);
|
||||
build_runtime_defined_function_key(&opline->op1.u.constant, &class_name->u.constant, opline);
|
||||
opline->op2.op_type = IS_CONST;
|
||||
opline->op2.u.constant.type = IS_STRING;
|
||||
opline->op2.u.constant.refcount = 1;
|
||||
@@ -1646,7 +1601,7 @@ void do_begin_new_object(znode *new_token, znode *class_name CLS_DC)
|
||||
unsigned char *ptr = NULL;
|
||||
|
||||
opline->opcode = ZEND_NEW;
|
||||
opline->result.op_type = IS_VAR;
|
||||
opline->result.op_type = IS_TMP_VAR;
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *class_name;
|
||||
SET_UNUSED(opline->op2);
|
||||
@@ -1962,6 +1917,20 @@ void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC)
|
||||
{
|
||||
if (filename->op_type==IS_CONST
|
||||
&& filename->u.constant.type==IS_STRING) {
|
||||
require_filename(filename->u.constant.value.str.val, unique CLS_CC);
|
||||
zval_dtor(&filename->u.constant);
|
||||
} else {
|
||||
znode result;
|
||||
|
||||
do_include_or_eval(ZEND_REQUIRE, &result, filename CLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC)
|
||||
{
|
||||
int i;
|
||||
@@ -2012,7 +1981,7 @@ void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC)
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token CLS_DC)
|
||||
{
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
@@ -2022,11 +1991,6 @@ void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_t
|
||||
opline->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline->op1 = *array;
|
||||
SET_UNUSED(opline->op2);
|
||||
if (variable) {
|
||||
opline->extended_value = 1;
|
||||
} else {
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
*open_brackets_token = opline->result;
|
||||
|
||||
zend_stack_push(&CG(foreach_copy_stack), (void *) &opline->result, sizeof(znode));
|
||||
|
||||
+16
-17
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_COMPILE_H
|
||||
#define ZEND_COMPILE_H
|
||||
#ifndef _COMPILE_H
|
||||
#define _COMPILE_H
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
@@ -27,10 +27,6 @@
|
||||
# include <stdarg.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <istream.h>
|
||||
#endif
|
||||
|
||||
#include "zend_llist.h"
|
||||
|
||||
#define DEBUG_ZEND 0
|
||||
@@ -80,6 +76,7 @@ typedef struct _zend_op {
|
||||
znode op1;
|
||||
znode op2;
|
||||
ulong extended_value;
|
||||
char *filename;
|
||||
uint lineno;
|
||||
} zend_op;
|
||||
|
||||
@@ -120,8 +117,6 @@ struct _zend_op_array {
|
||||
zend_bool return_reference;
|
||||
zend_bool done_pass_two;
|
||||
|
||||
char *filename;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
|
||||
@@ -212,7 +207,7 @@ BEGIN_EXTERN_C()
|
||||
void init_compiler(CLS_D ELS_DC);
|
||||
void shutdown_compiler(CLS_D);
|
||||
|
||||
extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type CLS_DC);
|
||||
extern ZEND_API zend_op_array *(*zend_v_compile_files)(int type CLS_DC, int file_count, va_list files);
|
||||
|
||||
void zend_activate(CLS_D ELS_DC);
|
||||
void zend_deactivate(CLS_D ELS_DC);
|
||||
@@ -340,11 +335,12 @@ void do_new_list_end(CLS_D);
|
||||
|
||||
void do_cast(znode *result, znode *expr, int type CLS_DC);
|
||||
void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
|
||||
void do_require(znode *filename, zend_bool unique CLS_DC);
|
||||
|
||||
void do_unset(znode *variable CLS_DC);
|
||||
void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
|
||||
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token, int variable CLS_DC);
|
||||
void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token CLS_DC);
|
||||
void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
|
||||
void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
|
||||
|
||||
@@ -375,15 +371,18 @@ ZEND_API void function_add_ref(zend_function *function);
|
||||
|
||||
|
||||
/* helper functions in zend-scanner.l */
|
||||
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS_DC);
|
||||
ZEND_API int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC);
|
||||
ZEND_API int require_filename(char *filename, zend_bool unique CLS_DC);
|
||||
ZEND_API int use_filename(char *filename, uint filename_length CLS_DC);
|
||||
ZEND_API zend_op_array *zend_compile_files(int type CLS_DC, int file_count, ...);
|
||||
ZEND_API zend_op_array *v_compile_files(int type CLS_DC, int file_count, va_list files);
|
||||
ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
|
||||
ZEND_API zend_op_array *compile_filename(int type, zval *filename CLS_DC ELS_DC);
|
||||
ZEND_API int zend_execute_scripts(int type CLS_DC ELS_DC, int file_count, ...);
|
||||
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size CLS_DC);
|
||||
ZEND_API void init_op_array(zend_op_array *op_array, int type, int initial_ops_size);
|
||||
ZEND_API void destroy_op_array(zend_op_array *op_array);
|
||||
ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void zend_file_handle_dtor(zend_file_handle *fh);
|
||||
ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC);
|
||||
ZEND_API void zend_open_file_dtor(zend_file_handle *fh);
|
||||
|
||||
ZEND_API void destroy_zend_function(zend_function *function);
|
||||
ZEND_API void destroy_zend_class(zend_class_entry *ce);
|
||||
@@ -398,6 +397,7 @@ int get_next_op_number(zend_op_array *op_array);
|
||||
int print_class(zend_class_entry *class_entry);
|
||||
void print_op_array(zend_op_array *op_array, int optimizations);
|
||||
int pass_two(zend_op_array *op_array);
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array);
|
||||
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
|
||||
ZEND_API zend_bool zend_is_compiling(void);
|
||||
|
||||
@@ -568,7 +568,6 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_INCLUDE (1<<1)
|
||||
#define ZEND_INCLUDE_ONCE (1<<2)
|
||||
#define ZEND_REQUIRE (1<<3)
|
||||
#define ZEND_REQUIRE_ONCE (1<<4)
|
||||
|
||||
#define ZEND_ISSET (1<<0)
|
||||
#define ZEND_ISEMPTY (1<<1)
|
||||
@@ -625,4 +624,4 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* ZEND_COMPILE_H */
|
||||
#endif /* _COMPILE_H */
|
||||
+4
-18
@@ -13,14 +13,13 @@
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
| Z
|
||||
eev Suraski <zeev@zend.com> |
|
||||
| Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_CONFIG_W32_H
|
||||
#define ZEND_CONFIG_W32_H
|
||||
#ifndef _ZEND_CONFIG_W32_H
|
||||
#define _ZEND_CONFIG_W32_H
|
||||
|
||||
|
||||
#include <string.h>
|
||||
@@ -48,7 +47,6 @@ typedef unsigned int uint;
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
#define vsnprintf _vsnprintf
|
||||
#define zend_isinf(a) 0
|
||||
|
||||
#ifdef inline
|
||||
#undef inline
|
||||
@@ -66,7 +64,6 @@ typedef unsigned int uint;
|
||||
#endif
|
||||
|
||||
#define zend_finite(A) _finite(A)
|
||||
#define zend_isnan(A) _isnan(A)
|
||||
|
||||
#ifdef LIBZEND_EXPORTS
|
||||
# define ZEND_API __declspec(dllexport)
|
||||
@@ -76,15 +73,4 @@ typedef unsigned int uint;
|
||||
|
||||
#define ZEND_DLEXPORT __declspec(dllexport)
|
||||
|
||||
/* 0x00200000L is MB_SERVICE_NOTIFICATION, which is only supported under Windows NT
|
||||
* (and requires _WIN32_WINNT to be defined, which prevents the resulting executable
|
||||
* from running under Windows 9x
|
||||
* Windows 9x should silently ignore it, so it's being used here directly
|
||||
*/
|
||||
#ifndef MB_SERVICE_NOTIFICATION
|
||||
#define MB_SERVICE_NOTIFICATION 0x00200000L
|
||||
#endif
|
||||
|
||||
#define ZEND_SERVICE_MB_STYLE (MB_TOPMOST|MB_SERVICE_NOTIFICATION)
|
||||
|
||||
#endif /* ZEND_CONFIG_W32_H */
|
||||
#endif /* _ZEND_CONFIG_W32_H */
|
||||
@@ -239,10 +239,9 @@ ZEND_API int zend_get_constant(char *name, uint name_len, zval *result)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_register_constant(zend_constant *c ELS_DC)
|
||||
ZEND_API void zend_register_constant(zend_constant *c ELS_DC)
|
||||
{
|
||||
char *lowercase_name = zend_strndup(c->name, c->name_len);
|
||||
int ret = SUCCESS;
|
||||
|
||||
#if 0
|
||||
printf("Registering constant for module %d\n",c->module_number);
|
||||
@@ -251,11 +250,8 @@ ZEND_API int zend_register_constant(zend_constant *c ELS_DC)
|
||||
zend_str_tolower(lowercase_name, c->name_len);
|
||||
if (zend_hash_add(EG(zend_constants), lowercase_name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
|
||||
zval_dtor(&c->value);
|
||||
zend_error(E_NOTICE,"Constant %s already defined",lowercase_name);
|
||||
ret = FAILURE;
|
||||
}
|
||||
free(lowercase_name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_CONSTANTS_H
|
||||
#define ZEND_CONSTANTS_H
|
||||
#ifndef _CONSTANTS_H
|
||||
#define _CONSTANTS_H
|
||||
|
||||
#include "zend_globals.h"
|
||||
|
||||
@@ -55,7 +55,7 @@ ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval,
|
||||
ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number ELS_DC);
|
||||
ZEND_API void zend_register_string_constant(char *name, uint name_len, char *strval, int flags, int module_number ELS_DC);
|
||||
ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number ELS_DC);
|
||||
ZEND_API int zend_register_constant(zend_constant *c ELS_DC);
|
||||
ZEND_API void zend_register_constant(zend_constant *c ELS_DC);
|
||||
void zend_copy_constants(HashTable *target, HashTable *sourc);
|
||||
void copy_zend_constant(zend_constant *c);
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_DYNAMIC_ARRAY_H
|
||||
#define ZEND_DYNAMIC_ARRAY_H
|
||||
#ifndef _DYNAMIC_ARRAY_H
|
||||
#define _DYNAMIC_ARRAY_H
|
||||
|
||||
typedef struct _dynamic_array {
|
||||
char *array;
|
||||
@@ -35,4 +35,4 @@ ZEND_API void *zend_dynamic_array_pop(dynamic_array *da);
|
||||
ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int index);
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* ZEND_DYNAMIC_ARRAY_H */
|
||||
#endif /* _ZEND_DYNAMIC_ARRAY_H */
|
||||
+3
-3
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_ERRORS_H
|
||||
#define ZEND_ERRORS_H
|
||||
#ifndef _ZEND_ERRORS_H
|
||||
#define _ZEND_ERRORS_H
|
||||
|
||||
#define E_ERROR (1<<0L)
|
||||
#define E_WARNING (1<<1L)
|
||||
@@ -36,5 +36,5 @@
|
||||
#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE)
|
||||
#define E_CORE (E_CORE_ERROR | E_CORE_WARNING)
|
||||
|
||||
#endif /* ZEND_ERRORS_H */
|
||||
#endif /* _ZEND_ERRORS_H */
|
||||
|
||||
+115
-68
@@ -65,6 +65,13 @@ static void zend_extension_statement_handler(zend_extension *extension, zend_op_
|
||||
static void zend_extension_fcall_begin_handler(zend_extension *extension, zend_op_array *op_array);
|
||||
static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_array *op_array);
|
||||
|
||||
|
||||
#define SEPARATE_ON_READ_OBJECT(obj, _type) \
|
||||
if ((obj) && ((_type) == BP_VAR_R) && ((*(obj))->type == IS_OBJECT)) { \
|
||||
SEPARATE_ZVAL_IF_NOT_REF((obj)); \
|
||||
(*(obj))->is_ref = 1; \
|
||||
}
|
||||
|
||||
#define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED))
|
||||
|
||||
static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_free ELS_DC)
|
||||
@@ -134,11 +141,10 @@ static inline zval *_get_object_zval_ptr(znode *node, temp_variable *Ts, int *sh
|
||||
return &Ts[node->u.var].tmp_var;
|
||||
break;
|
||||
case IS_VAR:
|
||||
if (Ts[node->u.var].var.ptr_ptr) {
|
||||
PZVAL_UNLOCK(*Ts[node->u.var].var.ptr_ptr);
|
||||
if (Ts[node->u.var].var.ptr) {
|
||||
PZVAL_UNLOCK(Ts[node->u.var].var.ptr);
|
||||
*should_free = 0;
|
||||
SEPARATE_ZVAL_IF_NOT_REF(Ts[node->u.var].var.ptr_ptr);
|
||||
return *Ts[node->u.var].var.ptr_ptr;
|
||||
return Ts[node->u.var].var.ptr;
|
||||
} else {
|
||||
if (Ts[node->u.var].EA.type==IS_STRING_OFFSET) {
|
||||
PZVAL_UNLOCK(Ts[node->u.var].EA.data.str_offset.str);
|
||||
@@ -496,6 +502,7 @@ static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_v
|
||||
zval_dtor(varname);
|
||||
}
|
||||
Ts[result->u.var].var.ptr_ptr = retval;
|
||||
SEPARATE_ON_READ_OBJECT(retval, type);
|
||||
SELECTIVE_PZVAL_LOCK(*retval, result);
|
||||
}
|
||||
|
||||
@@ -642,8 +649,13 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
case BP_VAR_RW:
|
||||
case BP_VAR_W:
|
||||
if (!PZVAL_IS_REF(container)) {
|
||||
SEPARATE_ZVAL(container_ptr);
|
||||
container = *container_ptr;
|
||||
container->refcount--;
|
||||
if (container->refcount>0) {
|
||||
ALLOC_ZVAL(container);
|
||||
*container_ptr = container;
|
||||
container->is_ref=0;
|
||||
}
|
||||
container->refcount=1;
|
||||
}
|
||||
array_init(container);
|
||||
break;
|
||||
@@ -653,8 +665,12 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
switch (container->type) {
|
||||
case IS_ARRAY:
|
||||
if ((type==BP_VAR_W || type==BP_VAR_RW) && container->refcount>1 && !PZVAL_IS_REF(container)) {
|
||||
SEPARATE_ZVAL(container_ptr);
|
||||
container->refcount--;
|
||||
ALLOC_ZVAL(*container_ptr);
|
||||
**container_ptr = *container;
|
||||
container = *container_ptr;
|
||||
INIT_PZVAL(container);
|
||||
zendi_zval_copy_ctor(*container);
|
||||
}
|
||||
if (op2->op_type == IS_UNUSED) {
|
||||
zval *new_zval = &EG(uninitialized_zval);
|
||||
@@ -664,6 +680,7 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
|
||||
} else {
|
||||
*retval = zend_fetch_dimension_address_inner(container->value.ht, op2, Ts, type ELS_CC);
|
||||
}
|
||||
SEPARATE_ON_READ_OBJECT(*retval, type);
|
||||
SELECTIVE_PZVAL_LOCK(**retval, result);
|
||||
break;
|
||||
case IS_NULL:
|
||||
@@ -817,8 +834,13 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
|
||||
case BP_VAR_RW:
|
||||
case BP_VAR_W:
|
||||
if (!PZVAL_IS_REF(container)) {
|
||||
SEPARATE_ZVAL(container_ptr);
|
||||
container = *container_ptr;
|
||||
container->refcount--;
|
||||
if (container->refcount>0) {
|
||||
ALLOC_ZVAL(container);
|
||||
*container_ptr = container;
|
||||
container->is_ref=0;
|
||||
}
|
||||
container->refcount=1;
|
||||
}
|
||||
object_init(container);
|
||||
break;
|
||||
@@ -841,10 +863,15 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
|
||||
|
||||
|
||||
if ((type==BP_VAR_W || type==BP_VAR_RW) && container->refcount>1 && !PZVAL_IS_REF(container)) {
|
||||
SEPARATE_ZVAL(container_ptr);
|
||||
container->refcount--;
|
||||
ALLOC_ZVAL(*container_ptr);
|
||||
**container_ptr = *container;
|
||||
container = *container_ptr;
|
||||
INIT_PZVAL(container);
|
||||
zendi_zval_copy_ctor(*container);
|
||||
}
|
||||
*retval = zend_fetch_property_address_inner(container->value.obj.properties, op2, Ts, type ELS_CC);
|
||||
SEPARATE_ON_READ_OBJECT(*retval, type);
|
||||
SELECTIVE_PZVAL_LOCK(**retval, result);
|
||||
}
|
||||
|
||||
@@ -1085,9 +1112,17 @@ binary_assign_op_addr: {
|
||||
opline++;
|
||||
continue;
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
|
||||
|
||||
if (!PZVAL_IS_REF(*var_ptr)) {
|
||||
if ((*var_ptr)->refcount>1) {
|
||||
zval *orig_var=*var_ptr;
|
||||
|
||||
(*var_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*var_ptr);
|
||||
**var_ptr = *orig_var;
|
||||
zendi_zval_copy_ctor(**var_ptr);
|
||||
(*var_ptr)->refcount=1;
|
||||
}
|
||||
}
|
||||
EG(binary_op)(*var_ptr, *var_ptr, get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R));
|
||||
Ts[opline->result.u.var].var.ptr_ptr = var_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*var_ptr, &opline->result);
|
||||
@@ -1122,9 +1157,17 @@ binary_assign_op_addr: {
|
||||
zendi_zval_copy_ctor(Ts[opline->result.u.var].tmp_var);
|
||||
break;
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
|
||||
|
||||
if (!PZVAL_IS_REF(*var_ptr)) {
|
||||
if ((*var_ptr)->refcount>1) {
|
||||
zval *orig_var = *var_ptr;
|
||||
|
||||
(*var_ptr)->refcount--;
|
||||
ALLOC_ZVAL(*var_ptr);
|
||||
**var_ptr = *orig_var;
|
||||
zendi_zval_copy_ctor(**var_ptr);
|
||||
(*var_ptr)->refcount=1;
|
||||
}
|
||||
}
|
||||
incdec_op(*var_ptr);
|
||||
switch (opline->opcode) {
|
||||
case ZEND_PRE_INC:
|
||||
@@ -1412,7 +1455,7 @@ binary_assign_op_addr: {
|
||||
/* constructor call */
|
||||
|
||||
if (opline->op1.op_type == IS_VAR) {
|
||||
SELECTIVE_PZVAL_LOCK(*Ts[opline->op1.u.var].var.ptr_ptr, &opline->op1);
|
||||
PZVAL_LOCK(*Ts[opline->op1.u.var].var.ptr_ptr);
|
||||
}
|
||||
if (opline->op2.op_type==IS_VAR) {
|
||||
PZVAL_LOCK(*Ts[opline->op2.u.var].var.ptr_ptr);
|
||||
@@ -1470,10 +1513,6 @@ binary_assign_op_addr: {
|
||||
if (!object.ptr || object.ptr->type != IS_OBJECT) {
|
||||
zend_error(E_ERROR, "Call to a member function on a non-object");
|
||||
}
|
||||
if (!object.ptr->is_ref && object.ptr->refcount > 1) {
|
||||
zend_error(E_ERROR, "Bug: Problem in method call\n");
|
||||
}
|
||||
object.ptr->is_ref=1;
|
||||
object.ptr->refcount++; /* For $this pointer */
|
||||
active_function_table = &(object.ptr->value.obj.ce->function_table);
|
||||
}
|
||||
@@ -1603,8 +1642,10 @@ do_fcall_common:
|
||||
|
||||
retval_ptr_ptr = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_W);
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(retval_ptr_ptr);
|
||||
|
||||
if (!PZVAL_IS_REF(*retval_ptr_ptr)) {
|
||||
SEPARATE_ZVAL(retval_ptr_ptr);
|
||||
(*retval_ptr_ptr)->is_ref = 1;
|
||||
}
|
||||
(*retval_ptr_ptr)->refcount++;
|
||||
(*EG(return_value_ptr_ptr)) = (*retval_ptr_ptr);
|
||||
} else {
|
||||
@@ -1687,8 +1728,21 @@ send_by_ref:
|
||||
zend_error(E_ERROR, "Only variables can be passed by reference");
|
||||
}
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
|
||||
varptr = *varptr_ptr;
|
||||
|
||||
if (!PZVAL_IS_REF(varptr)) {
|
||||
/* code to break away this variable */
|
||||
if (varptr->refcount>1) {
|
||||
varptr->refcount--;
|
||||
ALLOC_ZVAL(*varptr_ptr);
|
||||
**varptr_ptr = *varptr;
|
||||
varptr = *varptr_ptr;
|
||||
varptr->refcount = 1;
|
||||
zval_copy_ctor(varptr);
|
||||
}
|
||||
varptr->is_ref = 1;
|
||||
/* at the end of this code refcount is always 1 */
|
||||
}
|
||||
varptr->refcount++;
|
||||
zend_ptr_stack_push(&EG(argument_stack), varptr);
|
||||
}
|
||||
@@ -1720,7 +1774,6 @@ send_by_ref:
|
||||
if (opline->op2.u.constant.type==IS_CONSTANT_ARRAY) {
|
||||
zval_copy_ctor(default_value);
|
||||
}
|
||||
default_value->refcount=1;
|
||||
zval_update_constant(&default_value, 0);
|
||||
default_value->refcount=0;
|
||||
default_value->is_ref=0;
|
||||
@@ -1734,7 +1787,7 @@ send_by_ref:
|
||||
assignment_value = *param;
|
||||
}
|
||||
|
||||
if (PZVAL_IS_REF(assignment_value) && param) {
|
||||
if (PZVAL_IS_REF(assignment_value)) {
|
||||
zend_assign_to_variable_reference(NULL, get_zval_ptr_ptr(&opline->result, Ts, BP_VAR_W), param, NULL ELS_CC);
|
||||
} else {
|
||||
zend_assign_to_variable(NULL, &opline->result, NULL, assignment_value, IS_VAR, Ts ELS_CC);
|
||||
@@ -1839,11 +1892,9 @@ send_by_ref:
|
||||
if (zend_hash_find(EG(class_table), class_name.value.str.val, class_name.value.str.len+1, (void **) &ce)==FAILURE) {
|
||||
zend_error(E_ERROR, "Cannot instantiate non-existent class: %s", class_name.value.str.val);
|
||||
}
|
||||
Ts[opline->result.u.var].var.ptr_ptr = &Ts[opline->result.u.var].var.ptr;
|
||||
ALLOC_ZVAL(Ts[opline->result.u.var].var.ptr);
|
||||
object_init_ex(Ts[opline->result.u.var].var.ptr, ce);
|
||||
Ts[opline->result.u.var].var.ptr->refcount=1;
|
||||
Ts[opline->result.u.var].var.ptr->is_ref=1;
|
||||
object_init_ex(&Ts[opline->result.u.var].tmp_var, ce);
|
||||
Ts[opline->result.u.var].tmp_var.refcount=1;
|
||||
Ts[opline->result.u.var].tmp_var.is_ref=1;
|
||||
zval_dtor(&class_name);
|
||||
FREE_OP(&opline->op1, EG(free_op1));
|
||||
}
|
||||
@@ -1876,7 +1927,7 @@ send_by_ref:
|
||||
NEXT_OPCODE();
|
||||
}
|
||||
}
|
||||
if (!opline->extended_value && EG(free_op1)) { /* temporary variable */
|
||||
if (opline->op1.op_type == IS_TMP_VAR) { /* temporary variable */
|
||||
zval *new_expr;
|
||||
|
||||
ALLOC_ZVAL(new_expr);
|
||||
@@ -1885,8 +1936,11 @@ send_by_ref:
|
||||
INIT_PZVAL(expr_ptr);
|
||||
} else {
|
||||
if (opline->extended_value) {
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr_ptr);
|
||||
expr_ptr = *expr_ptr_ptr;
|
||||
if (!PZVAL_IS_REF(expr_ptr)) {
|
||||
SEPARATE_ZVAL(expr_ptr_ptr);
|
||||
expr_ptr = *expr_ptr_ptr;
|
||||
expr_ptr->is_ref = 1;
|
||||
}
|
||||
expr_ptr->refcount++;
|
||||
} else if (PZVAL_IS_REF(expr_ptr)) {
|
||||
zval *new_expr;
|
||||
@@ -1972,8 +2026,7 @@ send_by_ref:
|
||||
return_value_used = RETURN_VALUE_USED(opline);
|
||||
|
||||
switch (opline->op2.u.constant.value.lval) {
|
||||
case ZEND_INCLUDE_ONCE:
|
||||
case ZEND_REQUIRE_ONCE: {
|
||||
case ZEND_INCLUDE_ONCE: {
|
||||
char *opened_path;
|
||||
int dummy = 1;
|
||||
zend_file_handle file_handle;
|
||||
@@ -1981,26 +2034,24 @@ send_by_ref:
|
||||
file_handle.handle.fp = zend_fopen(inc_filename->value.str.val, &opened_path);
|
||||
file_handle.type = ZEND_HANDLE_FP;
|
||||
file_handle.filename = inc_filename->value.str.val;
|
||||
file_handle.opened_path = opened_path;
|
||||
file_handle.free_filename = 0;
|
||||
|
||||
|
||||
if (file_handle.handle.fp) {
|
||||
if (!opened_path || zend_hash_add(&EG(included_files), opened_path, strlen(opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) {
|
||||
new_op_array = zend_compile_file(&file_handle, (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE?ZEND_INCLUDE:ZEND_REQUIRE) CLS_CC);
|
||||
zend_destroy_file_handle(&file_handle CLS_CC);
|
||||
opened_path = NULL; /* zend_destroy_file_handle() already frees it */
|
||||
new_op_array = zend_compile_files(ZEND_INCLUDE CLS_CC, 1, &file_handle);
|
||||
if (new_op_array) {
|
||||
pass_include_eval(new_op_array);
|
||||
} else {
|
||||
fclose(file_handle.handle.fp);
|
||||
}
|
||||
} else {
|
||||
fclose(file_handle.handle.fp);
|
||||
}
|
||||
} else {
|
||||
if (opline->op2.u.constant.value.lval==ZEND_INCLUDE_ONCE) {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle.filename);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle.filename);
|
||||
if (opened_path) {
|
||||
free(opened_path);
|
||||
}
|
||||
}
|
||||
if (opened_path) {
|
||||
free(opened_path);
|
||||
} else {
|
||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle.filename);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2009,6 +2060,9 @@ send_by_ref:
|
||||
case ZEND_REQUIRE:
|
||||
{
|
||||
new_op_array = compile_filename(opline->op2.u.constant.value.lval, inc_filename CLS_CC ELS_CC);
|
||||
if (new_op_array) {
|
||||
pass_include_eval(new_op_array);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZEND_EVAL:
|
||||
@@ -2080,8 +2134,6 @@ send_by_ref:
|
||||
if (container) {
|
||||
HashTable *ht;
|
||||
|
||||
SEPARATE_ZVAL_IF_NOT_REF(container);
|
||||
|
||||
switch ((*container)->type) {
|
||||
case IS_ARRAY:
|
||||
ht = (*container)->value.ht;
|
||||
@@ -2128,27 +2180,22 @@ send_by_ref:
|
||||
}
|
||||
NEXT_OPCODE();
|
||||
case ZEND_FE_RESET: {
|
||||
zval *array_ptr, **array_ptr_ptr;
|
||||
zval *array_ptr;
|
||||
HashTable *fe_ht;
|
||||
|
||||
if (opline->extended_value) {
|
||||
array_ptr_ptr = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_R);
|
||||
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
|
||||
array_ptr = *array_ptr_ptr;
|
||||
array_ptr->refcount++;
|
||||
} else {
|
||||
array_ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
if (EG(free_op1)) { /* IS_TMP_VAR */
|
||||
zval *tmp;
|
||||
array_ptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
*tmp = *array_ptr;
|
||||
INIT_PZVAL(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
array_ptr->refcount++;
|
||||
}
|
||||
if (EG(free_op1)) { /* IS_TMP_VAR */
|
||||
zval *tmp;
|
||||
|
||||
ALLOC_ZVAL(tmp);
|
||||
*tmp = *array_ptr;
|
||||
INIT_PZVAL(tmp);
|
||||
array_ptr = tmp;
|
||||
} else {
|
||||
array_ptr->refcount++;
|
||||
}
|
||||
|
||||
PZVAL_LOCK(array_ptr);
|
||||
Ts[opline->result.u.var].var.ptr = array_ptr;
|
||||
Ts[opline->result.u.var].var.ptr_ptr = &Ts[opline->result.u.var].var.ptr;
|
||||
|
||||
+5
-5
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_EXECUTE_H
|
||||
#define ZEND_EXECUTE_H
|
||||
#ifndef _EXECUTE_H
|
||||
#define _EXECUTE_H
|
||||
|
||||
#include "zend_compile.h"
|
||||
#include "zend_hash.h"
|
||||
@@ -157,7 +157,7 @@ ZEND_API zend_bool zend_is_executing(void);
|
||||
|
||||
void zend_set_timeout(long seconds);
|
||||
void zend_unset_timeout(void);
|
||||
ZEND_API void zend_timeout(int dummy);
|
||||
void zend_timeout(int dummy);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
void zend_init_timeout_thread();
|
||||
@@ -216,7 +216,7 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
|
||||
(*variable_ptr_ptr)->is_ref = 1;
|
||||
}
|
||||
|
||||
if (result && !(result->u.EA.type & EXT_TYPE_UNUSED)) {
|
||||
if (result && (result->op_type != IS_UNUSED)) {
|
||||
Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr;
|
||||
SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result);
|
||||
AI_USE_PTR(Ts[result->u.var].var);
|
||||
@@ -229,4 +229,4 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var
|
||||
#define IS_OVERLOADED_OBJECT 1
|
||||
#define IS_STRING_OFFSET 2
|
||||
|
||||
#endif /* ZEND_EXECUTE_H */
|
||||
#endif /* _EXECUTE_H */
|
||||
+15
-12
@@ -115,7 +115,8 @@ void init_executor(CLS_D ELS_DC)
|
||||
original_sigsegv_handler = signal(SIGSEGV, zend_handle_sigsegv);
|
||||
#endif
|
||||
EG(return_value_ptr_ptr) = &EG(global_return_value_ptr);
|
||||
EG(global_return_value_ptr) = NULL;
|
||||
EG(global_return_value_ptr) = &EG(global_return_value);
|
||||
INIT_ZVAL(EG(global_return_value));
|
||||
|
||||
EG(symtable_cache_ptr) = EG(symtable_cache)-1;
|
||||
EG(symtable_cache_limit)=EG(symtable_cache)+SYMTABLE_CACHE_SIZE-1;
|
||||
@@ -128,6 +129,7 @@ void init_executor(CLS_D ELS_DC)
|
||||
|
||||
zend_ptr_stack_init(&EG(argument_stack));
|
||||
|
||||
EG(main_op_array) = NULL;
|
||||
zend_hash_init(&EG(symbol_table), 50, NULL, ZVAL_PTR_DTOR, 0);
|
||||
EG(active_symbol_table) = &EG(symbol_table);
|
||||
|
||||
@@ -143,8 +145,6 @@ void init_executor(CLS_D ELS_DC)
|
||||
|
||||
zend_ptr_stack_init(&EG(user_error_handlers));
|
||||
|
||||
EG(orig_error_reporting) = EG(error_reporting);
|
||||
|
||||
#ifdef ZEND_WIN32
|
||||
EG(timed_out) = 0;
|
||||
#endif
|
||||
@@ -153,6 +153,11 @@ void init_executor(CLS_D ELS_DC)
|
||||
|
||||
void shutdown_executor(ELS_D)
|
||||
{
|
||||
if (EG(global_return_value_ptr) == &EG(global_return_value)) {
|
||||
zval_dtor(&EG(global_return_value));
|
||||
} else {
|
||||
zval_ptr_dtor(EG(return_value_ptr_ptr));
|
||||
}
|
||||
zend_ptr_stack_destroy(&EG(arg_types_stack));
|
||||
|
||||
while (EG(symtable_cache_ptr)>=EG(symtable_cache)) {
|
||||
@@ -173,6 +178,10 @@ void shutdown_executor(ELS_D)
|
||||
zend_ptr_stack_destroy(&EG(argument_stack));
|
||||
|
||||
/* Destroy all op arrays */
|
||||
if (EG(main_op_array)) {
|
||||
destroy_op_array(EG(main_op_array));
|
||||
efree(EG(main_op_array));
|
||||
}
|
||||
zend_hash_apply(EG(function_table), (int (*)(void *)) is_not_internal_function);
|
||||
zend_hash_apply(EG(class_table), (int (*)(void *)) is_not_internal_class);
|
||||
|
||||
@@ -194,8 +203,6 @@ void shutdown_executor(ELS_D)
|
||||
|
||||
zend_ptr_stack_clean(&EG(user_error_handlers), ZVAL_DESTRUCTOR, 1);
|
||||
zend_ptr_stack_destroy(&EG(user_error_handlers));
|
||||
|
||||
EG(error_reporting) = EG(orig_error_reporting);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,8 +232,8 @@ ZEND_API char *get_active_function_name()
|
||||
|
||||
ZEND_API char *zend_get_executed_filename(ELS_D)
|
||||
{
|
||||
if (EG(active_op_array)) {
|
||||
return EG(active_op_array)->filename;
|
||||
if (EG(opline_ptr)) {
|
||||
return active_opline->filename;
|
||||
} else {
|
||||
return "[no active file]";
|
||||
}
|
||||
@@ -543,7 +550,7 @@ void execute_new_code(CLS_D)
|
||||
#endif
|
||||
|
||||
|
||||
ZEND_API void zend_timeout(int dummy)
|
||||
void zend_timeout(int dummy)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
@@ -669,16 +676,12 @@ void zend_set_timeout(long seconds)
|
||||
# ifdef HAVE_SETITIMER
|
||||
{
|
||||
struct itimerval t_r; /* timeout requested */
|
||||
sigset_t sigset;
|
||||
|
||||
t_r.it_value.tv_sec = seconds;
|
||||
t_r.it_value.tv_usec = t_r.it_interval.tv_sec = t_r.it_interval.tv_usec = 0;
|
||||
|
||||
setitimer(ITIMER_PROF, &t_r, NULL);
|
||||
signal(SIGPROF, zend_timeout);
|
||||
sigemptyset(&sigset);
|
||||
sigaddset(&sigset, SIGPROF);
|
||||
sigprocmask(SIG_UNBLOCK,&sigset,NULL);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef ZEND_EXECUTE_LOCKS_H
|
||||
#define ZEND_EXECUTE_LOCKS_H
|
||||
#ifndef _ZEND_EXECUTE_LOCKS_H
|
||||
#define _ZEND_EXECUTE_LOCKS_H
|
||||
|
||||
#define PZVAL_LOCK(z) ((z)->refcount++)
|
||||
#define PZVAL_UNLOCK(z) { ((z)->refcount--); \
|
||||
@@ -19,4 +19,4 @@
|
||||
|
||||
#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); }
|
||||
|
||||
#endif /* ZEND_EXECUTE_LOCKS_H */
|
||||
#endif /* _ZEND_EXECUTE_LOCKS_H */
|
||||
@@ -18,12 +18,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_EXTENSIONS_H
|
||||
#define ZEND_EXTENSIONS_H
|
||||
#ifndef _ZEND_EXTENSIONS_H
|
||||
#define _ZEND_EXTENSIONS_H
|
||||
|
||||
#include "zend_compile.h"
|
||||
|
||||
#define ZEND_EXTENSION_API_NO 20000815
|
||||
#define ZEND_EXTENSION_API_NO 20000622
|
||||
|
||||
typedef struct _zend_extension_version_info {
|
||||
int zend_extension_api_no;
|
||||
@@ -94,4 +94,4 @@ void zend_append_version_info(zend_extension *extension);
|
||||
int zend_startup_extensions(void);
|
||||
void zend_shutdown_extensions(void);
|
||||
|
||||
#endif /* ZEND_EXTENSIONS_H */
|
||||
#endif /* _ZEND_EXTENSIONS_H */
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_FAST_CACHE_H
|
||||
#define ZEND_FAST_CACHE_H
|
||||
#ifndef _ZEND_FAST_CACHE_H
|
||||
#define _ZEND_FAST_CACHE_H
|
||||
|
||||
#ifndef ZEND_ENABLE_FAST_CACHE
|
||||
# if ZEND_DEBUG
|
||||
@@ -130,7 +130,7 @@ typedef struct _zend_fast_cache_list_entry {
|
||||
#define FREE_HASHTABLE_REL(ht) \
|
||||
ZEND_FAST_FREE_REL(ht, HASHTABLE_CACHE_LIST)
|
||||
|
||||
#endif /* ZEND_FAST_CACHE_H */
|
||||
#endif /* _ZEND_FAST_CACHE_H */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
|
||||
+8
-5
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_GLOBALS_H
|
||||
#define ZEND_GLOBALS_H
|
||||
#ifndef _T_GLOBALS_H
|
||||
#define _T_GLOBALS_H
|
||||
|
||||
|
||||
#include <setjmp.h>
|
||||
@@ -91,7 +91,9 @@ struct _zend_compiler_globals {
|
||||
HashTable *function_table; /* function symbol table */
|
||||
HashTable *class_table; /* class table */
|
||||
|
||||
HashTable filenames_table;
|
||||
HashTable used_files; /* files already included using 'use' */
|
||||
|
||||
zend_llist filenames_list;
|
||||
|
||||
zend_bool in_compilation;
|
||||
zend_bool short_tags;
|
||||
@@ -131,6 +133,7 @@ struct _zend_executor_globals {
|
||||
|
||||
/* for global return() support */
|
||||
zval *global_return_value_ptr;
|
||||
zval global_return_value;
|
||||
|
||||
/* symbol table cache */
|
||||
HashTable *symtable_cache[SYMTABLE_CACHE_SIZE];
|
||||
@@ -147,9 +150,9 @@ struct _zend_executor_globals {
|
||||
jmp_buf bailout;
|
||||
|
||||
int error_reporting;
|
||||
int orig_error_reporting;
|
||||
|
||||
zend_op_array *active_op_array;
|
||||
zend_op_array *main_op_array;
|
||||
|
||||
HashTable *function_table; /* function symbol table */
|
||||
HashTable *class_table; /* class table */
|
||||
@@ -213,4 +216,4 @@ struct _zend_alloc_globals {
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* ZEND_GLOBALS_H */
|
||||
#endif /* _T_GLOBALS_H */
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_GLOBALS_MACROS_H
|
||||
#define ZEND_GLOBALS_MACROS_H
|
||||
#ifndef _ZEND_GLOBALS_MACROS_H
|
||||
#define _ZEND_GLOBALS_MACROS_H
|
||||
|
||||
typedef struct _zend_compiler_globals zend_compiler_globals;
|
||||
typedef struct _zend_executor_globals zend_executor_globals;
|
||||
@@ -85,5 +85,5 @@ extern ZEND_API zend_executor_globals executor_globals;
|
||||
extern ZEND_API zend_alloc_globals alloc_globals;
|
||||
#endif
|
||||
|
||||
#endif /* ZEND_GLOBALS_MACROS_H */
|
||||
#endif /* _ZEND_GLOBALS_MACROS_H */
|
||||
|
||||
+9
-29
@@ -108,23 +108,20 @@ static void _zend_is_inconsistent(HashTable *ht, char *file, int line)
|
||||
#define SET_INCONSISTENT(n)
|
||||
#endif
|
||||
|
||||
#define HASH_APPLY_BEGIN(ht) \
|
||||
if ((ht)->bApplyProtection) { \
|
||||
if ((ht)->nApplyCount>=3) { \
|
||||
zend_error(E_WARNING, "Nesting level too deep - recursive dependency?"); \
|
||||
return; \
|
||||
} \
|
||||
(ht)->nApplyCount++; \
|
||||
}
|
||||
#define HASH_APPLY_BEGIN(ht) \
|
||||
if ((ht)->nApplyCount>=3) { \
|
||||
zend_error(E_WARNING, "Nesting level too deep - recursive dependency?"); \
|
||||
return; \
|
||||
} \
|
||||
(ht)->nApplyCount++;
|
||||
|
||||
#define HASH_APPLY_END(ht) \
|
||||
#define HASH_APPLY_END(ht) \
|
||||
(ht)->nApplyCount--;
|
||||
|
||||
|
||||
/* Generated on an Octa-ALPHA 300MHz CPU & 2.5GB RAM monster */
|
||||
static uint PrimeNumbers[] =
|
||||
{5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793, 2097397, 4194103, 8388857, 16777447, 33554201, 67108961, 134217487, 268435697, 536870683, 1073741621, 2147483399};
|
||||
static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(uint);
|
||||
{5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793, 2097397, 4194103, 8388857, 16777447, 33554201, 67108961, 134217487, 268435697, 536870683, 1073741621, 2147483399};
|
||||
|
||||
#define ZEND_HASH_IF_FULL_DO_RESIZE(ht) \
|
||||
if ((ht)->nNumOfElements > (ht)->nTableSize) { \
|
||||
@@ -133,6 +130,7 @@ static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(uint);
|
||||
|
||||
static int zend_hash_do_resize(HashTable *ht);
|
||||
|
||||
static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(ulong);
|
||||
|
||||
ZEND_API ulong hashpjw(char *arKey, uint nKeyLength)
|
||||
{
|
||||
@@ -218,27 +216,9 @@ ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction
|
||||
ht->pInternalPointer = NULL;
|
||||
ht->persistent = persistent;
|
||||
ht->nApplyCount = 0;
|
||||
ht->bApplyProtection = 1;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent, zend_bool bApplyProtection)
|
||||
{
|
||||
int retval = zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent);
|
||||
|
||||
ht->bApplyProtection = bApplyProtection;
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProtection)
|
||||
{
|
||||
ht->bApplyProtection = bApplyProtection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
ZEND_API int zend_hash_add_or_update(HashTable *ht, char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag)
|
||||
{
|
||||
ulong h;
|
||||
|
||||
+3
-5
@@ -17,8 +17,8 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef ZEND_HASH_H
|
||||
#define ZEND_HASH_H
|
||||
#ifndef _HASH_
|
||||
#define _HASH_
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -68,7 +68,6 @@ typedef struct _hashtable {
|
||||
dtor_func_t pDestructor;
|
||||
zend_bool persistent;
|
||||
unsigned char nApplyCount;
|
||||
zend_bool bApplyProtection;
|
||||
#if ZEND_DEBUG
|
||||
int inconsistent;
|
||||
#endif
|
||||
@@ -80,7 +79,6 @@ BEGIN_EXTERN_C()
|
||||
|
||||
/* startup/shutdown */
|
||||
ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent);
|
||||
ZEND_API int zend_hash_init_ex(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent, zend_bool bApplyProtection);
|
||||
ZEND_API void zend_hash_destroy(HashTable *ht);
|
||||
|
||||
ZEND_API void zend_hash_clean(HashTable *ht);
|
||||
@@ -195,4 +193,4 @@ END_EXTERN_C()
|
||||
zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent)
|
||||
|
||||
|
||||
#endif /* ZEND_HASH_H */
|
||||
#endif /* _HASH_ */
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_HIGHLIGHT_H
|
||||
#define ZEND_HIGHLIGHT_H
|
||||
#ifndef _HIGHLIGHT_H
|
||||
#define _HIGHLIGHT_H
|
||||
|
||||
#define HL_COMMENT_COLOR "#FF8000" /* orange */
|
||||
#define HL_DEFAULT_COLOR "#0000BB" /* blue */
|
||||
|
||||
+3
-3
@@ -18,9 +18,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_INDENT_H
|
||||
#define ZEND_INDENT_H
|
||||
#ifndef _ZEND_INDENT_H
|
||||
#define _ZEND_INDENT_H
|
||||
|
||||
ZEND_API void zend_indent(void);
|
||||
|
||||
#endif /* ZEND_INDENT_H */
|
||||
#endif /* _ZEND_INDENT_H */
|
||||
+2
-16
@@ -289,7 +289,7 @@ int zend_init_rsrc_list(ELS_D)
|
||||
|
||||
int zend_init_rsrc_plist(ELS_D)
|
||||
{
|
||||
return zend_hash_init_ex(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1, 0);
|
||||
return zend_hash_init(&EG(persistent_list), 0, NULL, plist_entry_destructor, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +349,6 @@ ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void
|
||||
lde.module_number = module_number;
|
||||
lde.resource_id = list_destructors.nNextFreeElement;
|
||||
lde.type = ZEND_RESOURCE_LIST_TYPE_STD;
|
||||
lde.type_name = NULL;
|
||||
|
||||
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
|
||||
return FAILURE;
|
||||
@@ -358,7 +357,7 @@ ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number)
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, int module_number)
|
||||
{
|
||||
zend_rsrc_list_dtors_entry lde;
|
||||
|
||||
@@ -373,7 +372,6 @@ ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_fu
|
||||
lde.module_number = module_number;
|
||||
lde.resource_id = list_destructors.nNextFreeElement;
|
||||
lde.type = ZEND_RESOURCE_LIST_TYPE_EX;
|
||||
lde.type_name = type_name;
|
||||
|
||||
if (zend_hash_next_index_insert(&list_destructors,(void *) &lde, sizeof(zend_rsrc_list_dtors_entry),NULL)==FAILURE) {
|
||||
return FAILURE;
|
||||
@@ -394,18 +392,6 @@ void zend_destroy_rsrc_list_dtors()
|
||||
}
|
||||
|
||||
|
||||
char *zend_rsrc_list_get_rsrc_type(int resource)
|
||||
{
|
||||
zend_rsrc_list_dtors_entry *lde;
|
||||
|
||||
if (zend_hash_index_find(&list_destructors, resource, (void **) &lde)==SUCCESS) {
|
||||
return lde->type_name;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
||||
+4
-9
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_LIST_H
|
||||
#define ZEND_LIST_H
|
||||
#ifndef _LIST_H
|
||||
#define _LIST_H
|
||||
|
||||
#include "zend_hash.h"
|
||||
#include "zend_globals.h"
|
||||
@@ -35,8 +35,7 @@ typedef struct _zend_rsrc_list_entry {
|
||||
zend_bool valid;
|
||||
} zend_rsrc_list_entry;
|
||||
|
||||
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc);
|
||||
#define ZEND_RSRC_DTOR_FUNC(name) void name(zend_rsrc_list_entry *rsrc)
|
||||
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *le);
|
||||
|
||||
typedef struct _zend_rsrc_list_dtors_entry {
|
||||
/* old style destructors */
|
||||
@@ -47,8 +46,6 @@ typedef struct _zend_rsrc_list_dtors_entry {
|
||||
rsrc_dtor_func_t list_dtor_ex;
|
||||
rsrc_dtor_func_t plist_dtor_ex;
|
||||
|
||||
char *type_name;
|
||||
|
||||
int module_number;
|
||||
int resource_id;
|
||||
unsigned char type;
|
||||
@@ -57,7 +54,7 @@ typedef struct _zend_rsrc_list_dtors_entry {
|
||||
|
||||
#define register_list_destructors(ld, pld) zend_register_list_destructors((void (*)(void *))ld, (void (*)(void *))pld, module_number);
|
||||
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number);
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number);
|
||||
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, int module_number);
|
||||
|
||||
enum list_entry_type {
|
||||
LE_DB=1000
|
||||
@@ -86,8 +83,6 @@ ZEND_API void *zend_plist_find(int id, int *type);
|
||||
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type);
|
||||
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
|
||||
|
||||
ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource);
|
||||
|
||||
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
|
||||
|
||||
#define ZEND_VERIFY_RESOURCE(rsrc) \
|
||||
|
||||
+3
-3
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_LLIST_H
|
||||
#define ZEND_LLIST_H
|
||||
#ifndef _ZEND_LLIST_H
|
||||
#define _ZEND_LLIST_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -73,4 +73,4 @@ ZEND_API void *zend_llist_get_prev_ex(zend_llist *l, zend_llist_position *pos);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* ZEND_LLIST_H */
|
||||
#endif /* _ZEND_LLIST_H */
|
||||
+3
-3
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MODULES_H
|
||||
#define MODULES_H
|
||||
#ifndef _MODULES_H
|
||||
#define _MODULES_H
|
||||
|
||||
#define INIT_FUNC_ARGS int type, int module_number ELS_DC
|
||||
#define INIT_FUNC_ARGS_PASSTHRU type, module_number ELS_CC
|
||||
@@ -37,7 +37,7 @@ extern unsigned char second_arg_allow_ref[];
|
||||
|
||||
#include "zend.h"
|
||||
|
||||
#define ZEND_MODULE_API_NO 20000809
|
||||
#define ZEND_MODULE_API_NO 20000609
|
||||
#ifdef ZTS
|
||||
#define USING_ZTS 1
|
||||
#else
|
||||
|
||||
+13
-5
@@ -50,7 +50,7 @@ static void op_array_alloc_ops(zend_op_array *op_array)
|
||||
|
||||
|
||||
|
||||
void init_op_array(zend_op_array *op_array, int type, int initial_ops_size CLS_DC)
|
||||
void init_op_array(zend_op_array *op_array, int type, int initial_ops_size)
|
||||
{
|
||||
op_array->type = type;
|
||||
#if SUPPORT_INTERACTIVE
|
||||
@@ -78,7 +78,6 @@ void init_op_array(zend_op_array *op_array, int type, int initial_ops_size CLS_D
|
||||
op_array->T = 0;
|
||||
|
||||
op_array->function_name = NULL;
|
||||
op_array->filename = zend_get_compiled_filename(CLS_C);
|
||||
|
||||
op_array->arg_types = NULL;
|
||||
|
||||
@@ -189,6 +188,7 @@ void init_op(zend_op *op CLS_DC)
|
||||
{
|
||||
memset(&op->result, 0, sizeof(znode));
|
||||
op->lineno = CG(zend_lineno);
|
||||
op->filename = zend_get_compiled_filename(CLS_C);
|
||||
op->result.op_type = IS_UNUSED;
|
||||
op->extended_value = 0;
|
||||
memset(&op->op1, 0, sizeof(znode));
|
||||
@@ -252,6 +252,7 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
|
||||
continue;
|
||||
}
|
||||
opline->lineno = (opline+1)->lineno;
|
||||
opline->filename = (opline+1)->filename;
|
||||
} else {
|
||||
opline->opcode = ZEND_NOP;
|
||||
}
|
||||
@@ -263,6 +264,7 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
|
||||
opline->op1.op_type = IS_UNUSED;
|
||||
opline->op2.op_type = IS_UNUSED;
|
||||
if (op_array->last>0) {
|
||||
opline->filename = op_array->opcodes[op_array->last-2].filename;
|
||||
opline->lineno= op_array->opcodes[op_array->last-2].lineno;
|
||||
}
|
||||
}
|
||||
@@ -279,7 +281,6 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a
|
||||
|
||||
int pass_two(zend_op_array *op_array)
|
||||
{
|
||||
zend_op *opline=op_array->opcodes, *end=opline+op_array->last;
|
||||
CLS_FETCH();
|
||||
|
||||
if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) {
|
||||
@@ -291,6 +292,15 @@ int pass_two(zend_op_array *op_array)
|
||||
if (CG(handle_op_arrays)) {
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array);
|
||||
}
|
||||
op_array->done_pass_two = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void pass_include_eval(zend_op_array *op_array)
|
||||
{
|
||||
zend_op *opline=op_array->opcodes, *end=opline+op_array->last;
|
||||
|
||||
while (opline<end) {
|
||||
if (opline->op1.op_type==IS_CONST) {
|
||||
opline->op1.u.constant.is_ref = 1;
|
||||
@@ -302,8 +312,6 @@ int pass_two(zend_op_array *op_array)
|
||||
}
|
||||
opline++;
|
||||
}
|
||||
op_array->done_pass_two = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1473,25 +1473,6 @@ ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length)
|
||||
{
|
||||
int len;
|
||||
int c1,c2;
|
||||
|
||||
len = MIN(length, MIN(len1, len2));
|
||||
|
||||
while (len--) {
|
||||
c1 = tolower(*s1++);
|
||||
c2 = tolower(*s2++);
|
||||
if (c1 != c2) {
|
||||
return c1 - c2;
|
||||
}
|
||||
}
|
||||
|
||||
return len1 - len2;
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2)
|
||||
{
|
||||
return zend_binary_strcmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len);
|
||||
@@ -1509,12 +1490,6 @@ ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3)
|
||||
{
|
||||
return zend_binary_strncasecmp(s1->value.str.val, s1->value.str.len, s2->value.str.val, s2->value.str.len, s3->value.lval);
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
|
||||
{
|
||||
int ret1,ret2;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_OPERATORS_H
|
||||
#define ZEND_OPERATORS_H
|
||||
#ifndef _OPERATORS_H
|
||||
#define _OPERATORS_H
|
||||
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
@@ -148,11 +148,9 @@ ZEND_API void zend_str_tolower(char *str, unsigned int length);
|
||||
ZEND_API int zend_binary_zval_strcmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3);
|
||||
ZEND_API int zend_binary_zval_strcasecmp(zval *s1, zval *s2);
|
||||
ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3);
|
||||
ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2);
|
||||
ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length);
|
||||
ZEND_API int zend_binary_strcasecmp(char *s1, uint len1, char *s2, uint len2);
|
||||
ZEND_API int zend_binary_strncasecmp(char *s1, uint len1, char *s2, uint len2, uint length);
|
||||
|
||||
ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2);
|
||||
ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2);
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_PTR_STACK_H
|
||||
#define ZEND_PTR_STACK_H
|
||||
#ifndef _ZEND_PTR_STACK_H
|
||||
#define _ZEND_PTR_STACK_H
|
||||
|
||||
typedef struct _zend_ptr_stack {
|
||||
int top, max;
|
||||
@@ -40,4 +40,4 @@ ZEND_API void zend_ptr_stack_apply(zend_ptr_stack *stack, void (*func)(void *));
|
||||
ZEND_API void zend_ptr_stack_clean(zend_ptr_stack *stack, void (*func)(void *), zend_bool free_elements);
|
||||
ZEND_API int zend_ptr_stack_num_elements(zend_ptr_stack *stack);
|
||||
|
||||
#endif /* ZEND_PTR_STACK_H */
|
||||
#endif /* _ZEND_PTR_STACK_H */
|
||||
+3
-3
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_STACK_H
|
||||
#define ZEND_STACK_H
|
||||
#ifndef _ZEND_STACK_H
|
||||
#define _ZEND_STACK_H
|
||||
|
||||
typedef struct _zend_stack {
|
||||
int top, max;
|
||||
@@ -44,4 +44,4 @@ ZEND_API void zend_stack_apply_with_argument(zend_stack *stack, int type, int (*
|
||||
#define ZEND_STACK_APPLY_TOPDOWN 1
|
||||
#define ZEND_STACK_APPLY_BOTTOMUP 2
|
||||
|
||||
#endif /* ZEND_STACK_H */
|
||||
#endif /* _ZEND_STACK_H */
|
||||
@@ -16,8 +16,8 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef ZEND_STATIC_ALLOCATOR_H
|
||||
#define ZEND_STATIC_ALLOCATOR_H
|
||||
#ifndef _STATIC_ALLOCATOR_H
|
||||
#define _STATIC_ALLOCATOR_H
|
||||
|
||||
#define ALLOCATOR_BLOCK_SIZE 400000
|
||||
|
||||
@@ -42,4 +42,4 @@ void static_allocator_init(StaticAllocator *sa);
|
||||
char *static_allocator_allocate(StaticAllocator *sa, zend_uint size);
|
||||
void static_allocator_destroy(StaticAllocator *sa);
|
||||
|
||||
#endif /* ZEND_STATIC_ALLOCATOR_H */
|
||||
#endif /* _STATIC_ALLOCATOR_H */
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ZEND_VARIABLES_H
|
||||
#define ZEND_VARIABLES_H
|
||||
#ifndef _VARIABLES_H
|
||||
#define _VARIABLES_H
|
||||
|
||||
|
||||
ZEND_API int zend_print_variable(zval *var);
|
||||
|
||||
+8
-12
@@ -309,7 +309,7 @@ AC_DEFUN(PHP_GEN_CONFIG_VARS,[
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_GEN_MAKEFILES,[
|
||||
$SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $1
|
||||
$SHELL $srcdir/build/fastgen.sh $srcdir $ac_cv_mkdir_p $PHP_FAST_OUTPUT_FILES
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_TM_GMTOFF,[
|
||||
@@ -420,14 +420,6 @@ AC_DEFUN(PHP_BUILD_THREAD_SAFE,[
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(PHP_REQUIRE_CXX,[
|
||||
if test -z "$php_cxx_done"; then
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
php_cxx_done=yes
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl PHP_BUILD_SHARED
|
||||
dnl
|
||||
@@ -547,7 +539,9 @@ AC_DEFUN(AC_ADD_LIBRARY,[
|
||||
c|c_r|pthread*) ;;
|
||||
*)
|
||||
ifelse($3,,[
|
||||
PHP_X_ADD_LIBRARY($1,$2,LIBS)
|
||||
AC_PHP_ONCE(LIBRARY, $1, [
|
||||
PHP_X_ADD_LIBRARY($1,$2,LIBS)
|
||||
])
|
||||
],[
|
||||
if test "$ext_shared" = "yes"; then
|
||||
PHP_X_ADD_LIBRARY($1,$2,$3)
|
||||
@@ -564,7 +558,9 @@ dnl AC_ADD_LIBRARY_DEFER(library[, append])
|
||||
dnl
|
||||
dnl add a library to the link line (deferred)
|
||||
AC_DEFUN(AC_ADD_LIBRARY_DEFER,[
|
||||
ifelse($#, 1, DLIBS="-l$1 $DLIBS", DLIBS="$DLIBS -l$1")
|
||||
AC_PHP_ONCE(LIBRARY, $1, [
|
||||
ifelse($#, 1, DLIBS="-l$1 $DLIBS", DLIBS="$DLIBS -l$1")
|
||||
])
|
||||
])
|
||||
|
||||
dnl
|
||||
@@ -833,7 +829,7 @@ AC_DEFUN(AC_SOCKADDR_SA_LEN,[
|
||||
])
|
||||
|
||||
|
||||
dnl ## PHP_OUTPUT(file)
|
||||
dnl ## PHP_AC_OUTPUT(file)
|
||||
dnl ## adds "file" to the list of files generated by AC_OUTPUT
|
||||
dnl ## This macro can be used several times.
|
||||
AC_DEFUN(PHP_OUTPUT,[
|
||||
|
||||
+21
-13
@@ -1,22 +1,31 @@
|
||||
/* -*- C -*-
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
| PHP HTML Embedded Scripting Language Version 3.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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. |
|
||||
| This program is free software; you can redistribute it and/or modify |
|
||||
| it under the terms of one of the following licenses: |
|
||||
| |
|
||||
| A) the GNU General Public License as published by the Free Software |
|
||||
| Foundation; either version 2 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| B) the PHP License as published by the PHP Development Team and |
|
||||
| included in the distribution in the file: LICENSE |
|
||||
| |
|
||||
| This program is distributed in the hope that it will be useful, |
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
| GNU General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of both licenses referred to here. |
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@fast.no> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
*/
|
||||
|
||||
#define CONFIGURE_COMMAND "@CONFIGURE_COMMAND@"
|
||||
#define PHP_ADA_INCLUDE ""
|
||||
@@ -79,4 +88,3 @@
|
||||
#define PHP_VELOCIS_INCLUDE ""
|
||||
#define PHP_VELOCIS_LIBS ""
|
||||
#define PHP_EXTENSION_DIR "@EXTENSION_DIR@"
|
||||
#define PHP_INCLUDE_PATH "@INCLUDE_PATH@"
|
||||
+22
-16
@@ -1,22 +1,28 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
#
|
||||
# Makefile to generate build tools
|
||||
#
|
||||
|
||||
|
||||
+22
-16
@@ -1,21 +1,27 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# $Id$
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
|
||||
include generated_lists
|
||||
|
||||
|
||||
@@ -1,23 +1,4 @@
|
||||
#! /bin/sh
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Stig Bakken <ssb@fast.no> |
|
||||
# | Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id: buildcheck.sh,v 1.3 2000-08-20 05:39:37 sas Exp $
|
||||
#
|
||||
|
||||
echo "buildconf: checking installation..."
|
||||
|
||||
|
||||
@@ -1,22 +1,3 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
all: all-recursive
|
||||
|
||||
include $(builddir)/libs.mk
|
||||
|
||||
+23
-16
@@ -1,22 +1,29 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# $Id: fastgen.sh,v 1.8 2000-08-20 05:39:37 sas Exp $
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id: fastgen.sh,v 1.7 2000-06-11 10:33:39 sas Exp $
|
||||
#
|
||||
|
||||
srcdir=$1
|
||||
|
||||
+23
-16
@@ -1,23 +1,30 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo) $(LTLIBRARY_OBJECTS_X)
|
||||
LTLIBRARY_OBJECTS = $(LTLIBRARY_SOURCES:.c=.lo)
|
||||
|
||||
$(LTLIBRARY_NAME): $(LTLIBRARY_OBJECTS) $(LTLIBRARY_DEPENDENCIES)
|
||||
$(LINK) $(LTLIBRARY_LDFLAGS) $(LTLIBRARY_OBJECTS) $(LTLIBRARY_LIBADD)
|
||||
+22
-15
@@ -1,19 +1,26 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
# Copyright (c) 1999 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
+22
-15
@@ -1,19 +1,26 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
+63
-16
@@ -1,23 +1,70 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_srcdir)/build/rules_common.mk
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
|
||||
all: all-recursive
|
||||
install: install-recursive
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS)
|
||||
COMPILE = $(CC) $(COMMON_FLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CXX_COMPILE = $(CXX) $(COMMON_FLAGS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
|
||||
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(COMPILE) -c $< && touch $@
|
||||
CXX_SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CXX_COMPILE) -c $< && touch $@
|
||||
|
||||
LINK = $(LIBTOOL) --mode=link $(COMPILE) $(LDFLAGS) -o $@
|
||||
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
|
||||
DEFS = -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
CXX_SUFFIX = .cpp
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c $(CXX_SUFFIX) .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
$(CXX_SUFFIX).o:
|
||||
$(CXX_COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
$(CXX_SUFFIX).lo:
|
||||
$(CXX_PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
$(CXX_SUFFIX).slo:
|
||||
$(CXX_SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
+62
-16
@@ -1,23 +1,69 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
# Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
|
||||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
# EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
##############################################################################
|
||||
# $Id$
|
||||
#
|
||||
|
||||
include $(top_srcdir)/build/rules_common.mk
|
||||
include $(top_builddir)/config_vars.mk
|
||||
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@
|
||||
mkinstalldirs = $(top_srcdir)/build/shtool mkdir -f -p
|
||||
INSTALL = $(top_srcdir)/build/shtool install -c
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
SHARED_COMPILE = $(SHARED_LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $< && touch $@
|
||||
DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I$(top_builddir) -I$(top_builddir)/main
|
||||
|
||||
moduledir = $(EXTENSION_DIR)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .slo .c .lo .o .s .y .l
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.s.lo:
|
||||
$(PHP_COMPILE)
|
||||
|
||||
.c.slo:
|
||||
$(SHARED_COMPILE)
|
||||
|
||||
.y.c:
|
||||
$(YACC) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
|
||||
.l.c:
|
||||
$(LEX) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
|
||||
install_targets = install-modules
|
||||
|
||||
|
||||
+14
-31
@@ -51,7 +51,7 @@ dnl ## All of these are normally in the extension directories.
|
||||
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
|
||||
|
||||
dnl ## This is where the version number is changed from now on!
|
||||
AM_INIT_AUTOMAKE(php, 4.0.2-dev)
|
||||
AM_INIT_AUTOMAKE(php, 4.0.1)
|
||||
|
||||
PHP_VERSION=$VERSION
|
||||
echo "/* automatically generated by configure */" > php_version.h.new
|
||||
@@ -115,9 +115,6 @@ if test "$ac_cv_c_const" = "yes" ; then
|
||||
LEX_CFLAGS="-DYY_USE_CONST"
|
||||
fi
|
||||
|
||||
abs_srcdir=`(cd $srcdir; pwd)`
|
||||
abs_builddir=`pwd`
|
||||
|
||||
sinclude(Zend/acinclude.m4)
|
||||
sinclude(Zend/Zend.m4)
|
||||
sinclude(TSRM/tsrm.m4)
|
||||
@@ -296,7 +293,6 @@ sys/varargs.h \
|
||||
sys/wait.h \
|
||||
unistd.h \
|
||||
unix.h \
|
||||
utime.h \
|
||||
)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
@@ -413,6 +409,9 @@ fi
|
||||
divert(4)
|
||||
|
||||
|
||||
|
||||
abs_srcdir=`(cd $srcdir; pwd)`
|
||||
abs_builddir=`pwd`
|
||||
|
||||
PHP_ARG_WITH(config-file-path,whether to use a configuration file,
|
||||
[ --with-config-file-path=PATH
|
||||
@@ -543,6 +542,7 @@ if test "$PHP_DMALLOC" = "yes"; then
|
||||
CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK"
|
||||
fi
|
||||
|
||||
|
||||
PHP_ARG_ENABLE(pear,whether to install PEAR,
|
||||
[ --disable-pear Do not install PEAR],yes)
|
||||
|
||||
@@ -550,11 +550,8 @@ if test "$PHP_PEAR" = "yes"; then
|
||||
PEAR_DIR=pear
|
||||
fi
|
||||
|
||||
PHP_OUTPUT(pear/pear)
|
||||
PHP_OUTPUT(pear/run-tests)
|
||||
PHP_OUTPUT(pear/phpize)
|
||||
PHP_OUTPUT(pear/php-config)
|
||||
PHP_OUTPUT(pear/PEAR.php)
|
||||
|
||||
|
||||
|
||||
|
||||
divert(5)
|
||||
@@ -668,10 +665,6 @@ ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' $srcdir/Zend/modules.h|s
|
||||
|
||||
EXTENSION_DIR="$prefix/lib/php/extensions/$PART1-$PART2-$ZEND_MODULE_API_NO"
|
||||
|
||||
PEAR_INSTALLDIR="$prefix/lib/php"
|
||||
|
||||
INCLUDE_PATH=".:$PEAR_INSTALLDIR"
|
||||
|
||||
AC_BUILD_RPATH
|
||||
|
||||
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
|
||||
@@ -701,15 +694,12 @@ PHP_SUBST(CONFIGURE_COMMAND)
|
||||
PHP_SUBST(CPP)
|
||||
PHP_SUBST(CPPFLAGS)
|
||||
PHP_SUBST(CXX)
|
||||
PHP_SUBST(CXXFLAGS)
|
||||
PHP_SUBST(CXX_PHP_COMPILE)
|
||||
PHP_SUBST(DEBUG_CFLAGS)
|
||||
PHP_SUBST(DEFS)
|
||||
PHP_SUBST(EXTENSION_DIR)
|
||||
PHP_SUBST(EXTRA_LDFLAGS)
|
||||
PHP_SUBST(EXTRA_LIBS)
|
||||
PHP_SUBST(INCLUDES)
|
||||
PHP_SUBST(INCLUDE_PATH)
|
||||
PHP_SUBST(INSTALL_IT)
|
||||
PHP_SUBST(LEX)
|
||||
PHP_SUBST(LEX_OUTPUT_ROOT)
|
||||
@@ -718,7 +708,6 @@ PHP_SUBST(LIBTOOL)
|
||||
PHP_SUBST(LN_S)
|
||||
PHP_SUBST(NATIVE_RPATHS)
|
||||
PHP_SUBST(PEAR_DIR)
|
||||
PHP_SUBST(PEAR_INSTALLDIR)
|
||||
PHP_SUBST(PHP_BUILD_DATE)
|
||||
PHP_SUBST(PHP_COMPILE)
|
||||
PHP_SUBST(PHP_LDFLAGS)
|
||||
@@ -762,7 +751,6 @@ if test "$enable_debug" != "yes"; then
|
||||
fi
|
||||
|
||||
PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
|
||||
CXX_PHP_COMPILE='$(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $<'
|
||||
|
||||
if test "$enable_shared" = "yes"; then
|
||||
SHARED_LIBTOOL='$(LIBTOOL)'
|
||||
@@ -773,7 +761,6 @@ else
|
||||
SHARED_LIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
|
||||
else
|
||||
PHP_COMPILE='$(COMPILE) -c $< && touch $@'
|
||||
CXX_PHP_COMPILE='$(CXX_COMPILE) -c $< && touch $@'
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -796,17 +783,13 @@ PHP_CONFIGURE_PART(Generating files)
|
||||
PHP_GEN_CONFIG_VARS
|
||||
touch .deps
|
||||
|
||||
ALL_OUTPUT_FILES="php4.spec Zend/Makefile build-defs.h $PHP_OUTPUT_FILES"
|
||||
#libphp4.module
|
||||
AC_OUTPUT([php4.spec Zend/Makefile
|
||||
build-defs.h
|
||||
$PHP_OUTPUT_FILES
|
||||
], [], [
|
||||
|
||||
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
|
||||
|
||||
if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES"; then
|
||||
REDO_ALL=yes
|
||||
fi
|
||||
|
||||
if test -n "\$REDO_ALL"; then
|
||||
PHP_GEN_MAKEFILES($PHP_FAST_OUTPUT_FILES)
|
||||
fi
|
||||
PHP_GEN_MAKEFILES
|
||||
|
||||
if test ! -f $srcdir/ext/bcmath/number.c; then
|
||||
echo "creating number.c"
|
||||
@@ -831,7 +814,7 @@ cat >Zend/zend_config.h <<FEO
|
||||
FEO
|
||||
|
||||
# run this only when generating all the files?
|
||||
if test -n "\$REDO_ALL"; then
|
||||
if true; then
|
||||
# Hacking while airborne considered harmful.
|
||||
#
|
||||
echo "creating main/internal_functions.c"
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
# +----------------------------------------------------------------------+
|
||||
# | PHP version 4.0 |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | This source file is subject to version 2.02 of the PHP license, |
|
||||
# | that is bundled with this package in the file LICENSE, and is |
|
||||
# | available at through the world-wide-web at |
|
||||
# | http://www.php.net/license/2_02.txt. |
|
||||
# | If you did not receive a copy of the PHP license and are unable to |
|
||||
# | obtain it through the world-wide-web, please send a note to |
|
||||
# | license@php.net so we can mail you a copy immediately. |
|
||||
# +----------------------------------------------------------------------+
|
||||
# | Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
# +----------------------------------------------------------------------+
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +5,7 @@ AC_DEFUN(LIB_SHARED_CONVENIENCE,[
|
||||
lib_target="\$(LTLIBRARY_NAME)"
|
||||
cat >>$1<<EOF
|
||||
\$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
|
||||
\$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
|
||||
\$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
|
||||
|
||||
EOF
|
||||
])
|
||||
@@ -32,7 +14,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 \$(COMPILE) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
|
||||
\$(SHARED_LIBTOOL) --mode=link \$(CCLD) \$(CFLAGS) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
|
||||
\$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
|
||||
|
||||
EOF
|
||||
@@ -55,7 +37,7 @@ AC_DEFUN(LIB_BUILD,[
|
||||
|
||||
$php_shtool mkdir -p $1
|
||||
cat >$lib_makefile<<EOF
|
||||
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
|
||||
LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo)
|
||||
LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
|
||||
EOF
|
||||
|
||||
|
||||
+25
-13
@@ -1,25 +1,37 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
| PHP HTML Embedded Scripting Language Version 3.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
| Copyright (c) 1997-1999 PHP Development Team (See Credits file) |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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. |
|
||||
| This program is free software; you can redistribute it and/or modify |
|
||||
| it under the terms of one of the following licenses: |
|
||||
| |
|
||||
| A) the GNU General Public License as published by the Free Software |
|
||||
| Foundation; either version 2 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| B) the PHP License as published by the PHP Development Team and |
|
||||
| included in the distribution in the file: LICENSE |
|
||||
| |
|
||||
| This program is distributed in the hope that it will be useful, |
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
| GNU General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of both licenses referred to here. |
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef PHP_ASPELL_H
|
||||
#define PHP_ASPELL_H
|
||||
#ifndef _ASPELL_H
|
||||
#define _ASPELL_H
|
||||
#if HAVE_ASPELL
|
||||
extern zend_module_entry aspell_module_entry;
|
||||
#define aspell_module_ptr &aspell_module_entry
|
||||
@@ -38,4 +50,4 @@ PHP_FUNCTION(aspell_suggest);
|
||||
|
||||
#define phpext_aspell_ptr aspell_module_ptr
|
||||
|
||||
#endif /* PHP_ASPELL_H */
|
||||
#endif /* _ASPELL_H */
|
||||
+1
-3
@@ -14,9 +14,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
*/
|
||||
|
||||
#include "php.h"
|
||||
|
||||
|
||||
+25
-13
@@ -1,25 +1,37 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
| PHP HTML Embedded Scripting Language Version 3.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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. |
|
||||
| This program is free software; you can redistribute it and/or modify |
|
||||
| it under the terms of one of the following licenses: |
|
||||
| |
|
||||
| A) the GNU General Public License as published by the Free Software |
|
||||
| Foundation; either version 2 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| B) the PHP License as published by the PHP Development Team and |
|
||||
| included in the distribution in the file: LICENSE |
|
||||
| |
|
||||
| This program is distributed in the hope that it will be useful, |
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
| GNU General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of both licenses referred to here. |
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Andi Gutmans <andi@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef PHP_BCMATH_H
|
||||
#define PHP_BCMATH_H
|
||||
#ifndef _PHP_BCMATH_H
|
||||
#define _PHP_BCMATH_H
|
||||
|
||||
#if WITH_BCMATH
|
||||
|
||||
@@ -44,4 +56,4 @@ PHP_FUNCTION(bcscale);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PHP_BCMATH_H */
|
||||
#endif /* _PHP_BCMATH_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef PHP_CALENDAR_H
|
||||
#define PHP_CALENDAR_H
|
||||
#ifndef _INCLUDED_CALENDAR_H
|
||||
#define _INCLUDED_CALENDAR_H
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef SDNCAL_H
|
||||
#define SDNCAL_H
|
||||
#ifndef _INCLUDED_SDNCAL_H
|
||||
#define _INCLUDED_SDNCAL_H
|
||||
/*
|
||||
* This code has been modified for use with PHP
|
||||
* by Shane Caraveo shane@caraveo.com
|
||||
@@ -93,4 +93,4 @@ int DayOfWeek(long int sdn);
|
||||
extern char *DayNameShort[7];
|
||||
extern char *DayNameLong[7];
|
||||
|
||||
#endif /* SDNCAL_H */
|
||||
#endif /* _INCLUDED_SDNCAL_H */
|
||||
@@ -1,6 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
LTLIBRARY_NAME = libccvs.la
|
||||
LTLIBRARY_SOURCES = ccvs.c
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
@@ -1,7 +0,0 @@
|
||||
CCVS Module ToDo List
|
||||
08/14/2000
|
||||
Brendan W. McAdams <bmcadams@php.net>
|
||||
-------------------------------------
|
||||
- Return value of the final stats of an authorization should already be split out into a php aware associative
|
||||
array, instead of having to do this at the PHP level. Right now we are splitting stuff out using text_value;
|
||||
I'm evaluating the merits of having a seperate function for the 'finishing' of a sale....
|
||||
-538
@@ -1,538 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Brendan W. McAdams <brendan@plexmedia.com> |
|
||||
| Doug DeJulio <ddj@redhat.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/*
|
||||
* cvvs.c $Revision$ - PHP4 Interface to the RedHat CCVS API
|
||||
* -------
|
||||
* Interfaces RedHat's CCVS [Credit Card Verification System] <http://www.redhat.com/products/ccvs/>
|
||||
* This code is ported from an original php3 interface written by RedHat's Doug DeJulio <ddj@redhat.com>
|
||||
* The code was subsequently ported to the Zend API by Brendan W. McAdams <brendan@plexmedia.com>
|
||||
* -------
|
||||
*/
|
||||
|
||||
/*
|
||||
* Code started on 2000.07.24@09.04.EST by Brendan W. McAdams <brendan@plexmedia.com>
|
||||
* $Revision$
|
||||
*/
|
||||
|
||||
static char const cvsid[] = "$Id$";
|
||||
|
||||
#include <php.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ccvs.h>
|
||||
|
||||
|
||||
/*
|
||||
* Create the Zend Internal hash construct to track this modules functions
|
||||
*
|
||||
* In case anyone is wondering why we use ccvs_<action> instead of cv_<action>,
|
||||
* it's because we are directly importing functions of the actual CCVS, which uses functions that are
|
||||
* cv_<action>, and we had problems implementing ZEND_NAMED_FE calls (bug in NAMED_FE? investigate
|
||||
* later). We don't want our PHP calls to conflict with the C calls in the CCVS API.
|
||||
*
|
||||
* BWM - 2000.07.27@16.41.EST - Added FALIAS Calls. While I'm of the opinion that naming the
|
||||
* functions in PHP ccvs_<action> is much more readable and clear to anyone reading the code than
|
||||
* cv_<action>, It strikes me that many people coming from php3 -> php4 will need backwards
|
||||
* compatibility. It was kind of careless to simply change the function calls (There were reasons other
|
||||
* than readability behind this; the ZEND_NAMED_FE macro was misbehaving) and not provide for
|
||||
* backwards compatibility - this *IS* an API and should scale with compatibility.
|
||||
*
|
||||
*/
|
||||
|
||||
function_entry ccvs_functions[] = {
|
||||
PHP_FE(ccvs_init,NULL)
|
||||
PHP_FALIAS(cv_init,ccvs_init,NULL)
|
||||
PHP_FE(ccvs_done,NULL)
|
||||
PHP_FALIAS(cv_done,ccvs_done,NULL)
|
||||
PHP_FE(ccvs_new,NULL)
|
||||
PHP_FALIAS(cv_new,ccvs_new,NULL)
|
||||
PHP_FE(ccvs_add,NULL)
|
||||
PHP_FALIAS(cv_add,ccvs_add,NULL)
|
||||
PHP_FE(ccvs_delete,NULL)
|
||||
PHP_FALIAS(cv_delete,ccvs_delete,NULL)
|
||||
PHP_FE(ccvs_auth,NULL)
|
||||
PHP_FALIAS(cv_auth,ccvs_auth,NULL)
|
||||
PHP_FE(ccvs_return,NULL)
|
||||
PHP_FALIAS(cv_return,ccvs_return,NULL)
|
||||
PHP_FE(ccvs_reverse,NULL)
|
||||
PHP_FALIAS(cv_reverse,ccvs_reverse,NULL)
|
||||
PHP_FE(ccvs_sale,NULL)
|
||||
PHP_FALIAS(cv_sale,ccvs_sale,NULL)
|
||||
PHP_FE(ccvs_void,NULL)
|
||||
PHP_FALIAS(cv_void,ccvs_void,NULL)
|
||||
PHP_FE(ccvs_status,NULL)
|
||||
PHP_FALIAS(cv_status,ccvs_status,NULL)
|
||||
PHP_FE(ccvs_count,NULL)
|
||||
PHP_FALIAS(cv_count,ccvs_count,NULL)
|
||||
PHP_FE(ccvs_lookup,NULL)
|
||||
PHP_FALIAS(cv_lookup,ccvs_lookup,NULL)
|
||||
PHP_FE(ccvs_report,NULL)
|
||||
PHP_FALIAS(cv_report,ccvs_report,NULL)
|
||||
PHP_FE(ccvs_command,NULL)
|
||||
PHP_FALIAS(cv_command,ccvs_command,NULL)
|
||||
PHP_FE(ccvs_textvalue,NULL)
|
||||
PHP_FALIAS(cv_textvalue,ccvs_textvalue,NULL)
|
||||
{NULL,NULL}
|
||||
};
|
||||
|
||||
/* End function declarations */
|
||||
|
||||
/* Zend Engine Exports - module information */
|
||||
|
||||
/* Declare our module to the Zend engine */
|
||||
zend_module_entry ccvs_module_entry = {
|
||||
"CCVS",
|
||||
ccvs_functions,
|
||||
NULL,NULL,NULL,NULL,
|
||||
PHP_MINFO(ccvs),
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
|
||||
/* Full Functions (The actual CCVS functions and any internal php hooked functions such as MINFO) */
|
||||
|
||||
PHP_FUNCTION(ccvs_init) /* cv_init() */
|
||||
{
|
||||
zval **name;
|
||||
void *vsess;
|
||||
char *p;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &name) != SUCCESS))
|
||||
/* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(name);
|
||||
|
||||
vsess = cv_init((*name)->value.str.val);
|
||||
|
||||
/*
|
||||
* -- In the case that we don't run error checking on the return value... --
|
||||
* On 32 bit systems a failure of the cv_init call returns 0,0,0,0 ; on 64 bit systems its 0,0,0,0,0,0,0,0
|
||||
* This unconsistent error (not to mention a string of comma seperated zeros in and of itself) is hard to
|
||||
* Trap for in PHP (or any language). However, we can also grab cv_init to return CV_SESS_BAD on
|
||||
* failure at the C API level, and return a set, fixed error code to the user which the user then knows to
|
||||
* trap for... e.g. a NULL Value which PHP can then trap by:
|
||||
* if (!($string = cv_init($config)) { or some such...
|
||||
*/
|
||||
|
||||
if (vsess == CV_SESS_BAD) /* if the cv_init() call failed... */
|
||||
{
|
||||
|
||||
p = ""; /* set p, the value we will return, to NULL */
|
||||
|
||||
}
|
||||
else /* we got a valid session returned, which means it worked */
|
||||
{
|
||||
|
||||
p = hks_ptr_ptrtostring(vsess); /* Convert the (void*) into a string representation. */
|
||||
|
||||
}
|
||||
|
||||
RETVAL_STRING(p, 1);
|
||||
|
||||
free(p);
|
||||
return;
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_done) /* cv_done() */
|
||||
{
|
||||
zval **sess;
|
||||
void *vsess;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &sess) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(sess);
|
||||
|
||||
/* Convert from the string representation back to a (void*) */
|
||||
vsess = hks_ptr_stringtoptr((*sess)->value.str.val);
|
||||
cv_done(vsess);
|
||||
|
||||
RETURN_STRING("OK", 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_new) /* cv_new() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
|
||||
r = cv_new(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_add) /* cv_add() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
zval **pargtype;
|
||||
zval **pargval;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
int argtype;
|
||||
char *argval;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 4) || (zend_get_parameters_ex(4, &psess, &pinvoice, &pargtype, &pargval) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
/* Get meaningful arguments. */
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
convert_to_string_ex(pargtype);
|
||||
convert_to_string_ex(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);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* cv_create can't be implemented because of vararg limits in PHP3's C API.
|
||||
* (COMMENT BY DDJ [from original code])
|
||||
*
|
||||
* BWM: I looked into this, checking in on what cv_create was; it is a deprecated function left in for
|
||||
* backwards compatibility according
|
||||
* to the CCVS C API ref. I didn't try to implement it for that reason. If anyone needs it, they can add it in
|
||||
* themselves I'm sure.
|
||||
*/
|
||||
PHP_FUNCTION(ccvs_delete) /* cv_delete() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_delete(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_auth) /* cv_auth() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_auth(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_return) /* cv_return() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_return(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_reverse) /* cv_reverse() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_reverse(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_sale) /* cv_sale() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(ht, 2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_sale(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_void) /* cv_void() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_void(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_ret2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_status) /* cv_status() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **pinvoice;
|
||||
void *sess;
|
||||
char *invoice;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &pinvoice) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(pinvoice);
|
||||
invoice = (*pinvoice)->value.str.val;
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_status(sess, invoice);
|
||||
|
||||
RETURN_STRING(cv_stat2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_count) /* cv_count() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **ptype;
|
||||
void *sess;
|
||||
int type;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &ptype) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
convert_to_string_ex(ptype);
|
||||
type = cv_str2stat((*ptype)->value.str.val);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
r = cv_count(sess, type);
|
||||
|
||||
RETURN_LONG(r);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_lookup) /* cv_lookup() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **ptype;
|
||||
zval **pinum;
|
||||
void *sess;
|
||||
int type;
|
||||
long inum;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 3) || (zend_get_parameters_ex(3, &psess, &ptype, &pinum) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
convert_to_string_ex(ptype);
|
||||
type = cv_str2stat((*ptype)->value.str.val);
|
||||
convert_to_long_ex(pinum);
|
||||
inum = (*pinum)->value.lval;
|
||||
|
||||
r = cv_lookup(sess, type, inum);
|
||||
|
||||
RETURN_STRING(cv_textvalue(sess), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_report) /* cv_report() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **ptype;
|
||||
void *sess;
|
||||
int type;
|
||||
long inum;
|
||||
register int r;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 2) || (zend_get_parameters_ex(2, &psess, &ptype) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
convert_to_string_ex(ptype);
|
||||
type = cv_str2rep((*ptype)->value.str.val);
|
||||
|
||||
r = cv_report(sess, type);
|
||||
|
||||
RETURN_STRING(cv_stat2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_command) /* cv_command() */
|
||||
{
|
||||
zval **psess;
|
||||
zval **ptype;
|
||||
zval **pargval;
|
||||
void *sess;
|
||||
int type;
|
||||
register int r;
|
||||
char *argval;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 3) || (zend_get_parameters_ex(3, &psess, &ptype, &pargval) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
convert_to_string_ex(ptype);
|
||||
type = cv_str2cmd((*ptype)->value.str.val);
|
||||
convert_to_string_ex(pargval);
|
||||
argval = (*pargval)->value.str.val;
|
||||
|
||||
r = cv_command(sess, type, argval);
|
||||
|
||||
RETURN_STRING(cv_stat2str(r), 1);
|
||||
}
|
||||
|
||||
PHP_FUNCTION(ccvs_textvalue) /* cv_textvalue() */
|
||||
{
|
||||
zval **psess;
|
||||
void *sess;
|
||||
|
||||
if ((ZEND_NUM_ARGS() != 1) || (zend_get_parameters_ex(1, &psess) != SUCCESS)) /* accept only SUCCESS in case something weird gets returned instead of 'FAILURE' on fail */
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(psess);
|
||||
sess = hks_ptr_stringtoptr((*psess)->value.str.val);
|
||||
|
||||
RETURN_STRING(cv_textvalue(sess), 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Our Info Function which reports info on this module out to PHP's phpinfo() function
|
||||
* Brendan W. McAdams <brendan@plexmedia.com> on 2000.07.26@16:22.EST
|
||||
*/
|
||||
|
||||
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 <brendan@plexmedia.com><br>& Doug DeJulio <ddj@redhat.com>");
|
||||
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();
|
||||
|
||||
/* DISPLAY_INI_ENTRIES(); */
|
||||
|
||||
/*
|
||||
* In the future, we will probably have entries in php.ini for runtime config, in which case we will
|
||||
* Uncomment the DISPLAY_INI_ENTRIES call...
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Brendan W. McAdams <brendan@plexmedia.com> |
|
||||
| Doug DeJulio <ddj@redhat.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#include <cv_api.h>
|
||||
|
||||
extern zend_module_entry ccvs_module_entry;
|
||||
|
||||
#define ccvs_module_ptr &ccvs_module_entry
|
||||
#define phpext_ccvs_ptr ccvs_module_ptr
|
||||
|
||||
/* Declare functions not in cv_api.h but in libccvs.a. */
|
||||
char *hks_ptr_ptrtostring(void *vptr);
|
||||
void *hks_ptr_stringtoptr(char *str);
|
||||
|
||||
/* Declare the Functions this Module Makes Available to Zend */
|
||||
|
||||
|
||||
/* Pre-declarations of functions */
|
||||
PHP_FUNCTION(ccvs_init);
|
||||
PHP_FUNCTION(ccvs_done);
|
||||
PHP_FUNCTION(ccvs_new);
|
||||
PHP_FUNCTION(ccvs_add);
|
||||
PHP_FUNCTION(ccvs_delete);
|
||||
PHP_FUNCTION(ccvs_auth);
|
||||
PHP_FUNCTION(ccvs_return);
|
||||
PHP_FUNCTION(ccvs_reverse);
|
||||
PHP_FUNCTION(ccvs_sale);
|
||||
PHP_FUNCTION(ccvs_void);
|
||||
PHP_FUNCTION(ccvs_status);
|
||||
PHP_FUNCTION(ccvs_count);
|
||||
PHP_FUNCTION(ccvs_lookup);
|
||||
PHP_FUNCTION(ccvs_report);
|
||||
PHP_FUNCTION(ccvs_command);
|
||||
PHP_FUNCTION(ccvs_textvalue);
|
||||
PHP_MINFO_FUNCTION(ccvs);
|
||||
|
||||
/* Declare the information we need to dynamically link this module later */
|
||||
#if COMPILE_DL
|
||||
DLEXPORT zend_module_entry *get_module(void) { return &ccvs_module_entry; }
|
||||
#endif
|
||||
|
||||
/* End exports */
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
dnl $Id$
|
||||
dnl config.m4 for PHP4 CCVS Extension
|
||||
|
||||
AC_MSG_CHECKING(CCVS Support)
|
||||
AC_ARG_WITH(ccvs,
|
||||
[ --with-ccvs[=DIR] Compile CCVS support into PHP4.
|
||||
Please specify your CCVS base install directory as DIR.
|
||||
],
|
||||
[
|
||||
if test "$withval" != "no"; then
|
||||
CCVS_DIR="$withval"
|
||||
test -f $withval/include/cv_api.h && CCVS_INCLUDE_DIR="$withval/include"
|
||||
test -f $withval/lib/libccvs.a && CCVS_LIB_DIR="$withval/lib"
|
||||
|
||||
if test -n "$CCVS_DIR"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
PHP_EXTENSION(ccvs)
|
||||
LIBS="$LIBS -L$CCVS_LIB_DIR"
|
||||
AC_ADD_LIBRARY_WITH_PATH(ccvs, $CCVS_LIB_DIR)
|
||||
AC_ADD_INCLUDE($CCVS_INCLUDE_DIR)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
#ifndef PHP_COM_H
|
||||
#define PHP_COM_H
|
||||
#ifndef _PHP_COM_H
|
||||
#define _PHP_COM_H
|
||||
|
||||
#if WIN32|WINNT
|
||||
|
||||
@@ -21,4 +21,4 @@ extern zend_module_entry COM_module_entry;
|
||||
|
||||
#define phpext_COM_ptr COM_module_ptr
|
||||
|
||||
#endif /* PHP_COM_H */
|
||||
#endif /* _PHP_COM_H */
|
||||
+2
-2
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef PHP_CPDF_H
|
||||
#define PHP_CPDF_H
|
||||
#ifndef _PHP_CPDF_H
|
||||
#define _PHP_CPDF_H
|
||||
|
||||
#if HAVE_CPDFLIB
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
LTLIBRARY_NAME = libcurl.la
|
||||
LTLIBRARY_SOURCES = curl.c
|
||||
LTLIBRARY_SHARED_NAME = curl.la
|
||||
LTLIBRARY_SHARED_LIBADD = $(CURL_SHARED_LIBADD)
|
||||
|
||||
include $(top_srcdir)/build/dynlib.mk
|
||||
@@ -1,34 +0,0 @@
|
||||
dnl $Id$
|
||||
dnl config.m4 for extension CURL
|
||||
|
||||
PHP_ARG_WITH(curl, for CURL support,
|
||||
[ --with-curl[=DIR] Include CURL support])
|
||||
|
||||
if test "$PHP_CURL" != "no"; then
|
||||
if test -r $PHP_CURL/include/curl/easy.h; then
|
||||
CURL_DIR=$PHP_CURL
|
||||
else
|
||||
AC_MSG_CHECKING(for CURL in default path)
|
||||
for i in /usr/local /usr; do
|
||||
if test -r $i/include/curl/easy.h; then
|
||||
CURL_DIR=$i
|
||||
AC_MSG_RESULT(found in $i)
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$CURL_DIR"; then
|
||||
AC_MSG_RESULT(not found)
|
||||
AC_MSG_ERROR(Please reinstall the libcurl distribution -
|
||||
easy.h should be in <curl-dir>/include/curl/)
|
||||
fi
|
||||
|
||||
AC_ADD_INCLUDE($CURL_DIR/include)
|
||||
|
||||
PHP_SUBST(CURL_SHARED_LIBADD)
|
||||
AC_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, CURL_SHARED_LIBADD)
|
||||
|
||||
AC_DEFINE(HAVE_CURL,1,[ ])
|
||||
|
||||
PHP_EXTENSION(curl, $ext_shared)
|
||||
fi
|
||||
-564
@@ -1,564 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Sterling Hughes <sterling@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
#include "php.h"
|
||||
|
||||
#if HAVE_CURL
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef PHP_WIN32
|
||||
#include <winsock.h>
|
||||
#include <sys/types.h>
|
||||
#define fstat(handle, buff) _fstat(handle, buff)
|
||||
#define stat _stat
|
||||
#endif
|
||||
#include <curl/curl.h>
|
||||
#include <curl/easy.h>
|
||||
#include <sys/stat.h>
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "ext/standard/info.h"
|
||||
#include "php_curl.h"
|
||||
|
||||
#ifdef ZTS
|
||||
int curl_globals_id;
|
||||
#else
|
||||
php_curl_globals curl_globals;
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
static void win32_cleanup();
|
||||
static void win32_init();
|
||||
|
||||
static void win32_cleanup()
|
||||
{
|
||||
WSACleanup();
|
||||
}
|
||||
|
||||
static CURLcode win32_init()
|
||||
{
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
int err;
|
||||
wVersionRequested = MAKEWORD(1, 1);
|
||||
|
||||
err = WSAStartup(wVersionRequested, &wsaData);
|
||||
|
||||
if (err != 0) return CURLE_FAILED_INIT;
|
||||
|
||||
if ( LOBYTE( wsaData.wVersion ) != 1 ||
|
||||
HIBYTE( wsaData.wVersion ) != 1 ) {
|
||||
WSACleanup();
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
#else
|
||||
static CURLcode win32_init(void) { return CURLE_OK; }
|
||||
#define win32_cleanup()
|
||||
#endif
|
||||
|
||||
|
||||
function_entry curl_functions[] = {
|
||||
PHP_FE(curl_init, NULL)
|
||||
PHP_FE(curl_version, NULL)
|
||||
PHP_FE(curl_setopt, NULL)
|
||||
PHP_FE(curl_exec, NULL)
|
||||
PHP_FE(curl_close, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
zend_module_entry curl_module_entry = {
|
||||
"curl",
|
||||
curl_functions,
|
||||
PHP_MINIT(curl),
|
||||
PHP_MSHUTDOWN(curl),
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(curl),
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
#ifdef COMPILE_DL_CURL
|
||||
ZEND_GET_MODULE (curl)
|
||||
#endif
|
||||
|
||||
static void php_curl_close(CURL *cp);
|
||||
static int php_curl_error_translator(CURLcode err);
|
||||
|
||||
PHP_MINFO_FUNCTION(curl)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "CURL support", "enabled");
|
||||
php_info_print_table_row(2, "CURL Information", curl_version());
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
PHP_MINIT_FUNCTION(curl)
|
||||
{
|
||||
CURLLS_FETCH();
|
||||
CURLG(le_curl) = register_list_destructors(php_curl_close, NULL);
|
||||
|
||||
/* Constants for curl_setopt() */
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_PORT", CURLOPT_PORT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FILE", CURLOPT_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_INFILE", CURLOPT_INFILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_INFILESIZE", CURLOPT_INFILESIZE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_URL", CURLOPT_URL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_PROXY", CURLOPT_PROXY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_VERBOSE", CURLOPT_VERBOSE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_HEADER", CURLOPT_HEADER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_NOPROGRESS", CURLOPT_NOPROGRESS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_NOBODY", CURLOPT_NOBODY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FAILONERROR", CURLOPT_FAILONERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_UPLOAD", CURLOPT_UPLOAD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_POST", CURLOPT_POST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FTPLISTONLY", CURLOPT_FTPLISTONLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FTPAPPEND", CURLOPT_FTPAPPEND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_NETRC", CURLOPT_NETRC, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FOLLOWLOCATION", CURLOPT_FOLLOWLOCATION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FTPASCII", CURLOPT_FTPASCII, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_PUT", CURLOPT_PUT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_MUTE", CURLOPT_MUTE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_USERPWD", CURLOPT_USERPWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_PROXYUSERPWD", CURLOPT_PROXYUSERPWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_RANGE", CURLOPT_RANGE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_TIMEOUT", CURLOPT_TIMEOUT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_POSTFIELDS", CURLOPT_POSTFIELDS, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_REFERER", CURLOPT_REFERER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_USERAGENT", CURLOPT_USERAGENT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_FTPPORT", CURLOPT_FTPPORT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_LOW_SPEED_LIMIT", CURLOPT_LOW_SPEED_LIMIT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_LOW_SPEED_TIME", CURLOPT_LOW_SPEED_TIME, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_RESUME_FROM", CURLOPT_RESUME_FROM, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_COOKIE", CURLOPT_COOKIE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_SSLCERT", CURLOPT_SSLCERT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_SSLCERTPASSWD", CURLOPT_SSLCERTPASSWD, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_WRITEHEADER", CURLOPT_WRITEHEADER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_COOKIEFILE", CURLOPT_COOKIEFILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_SSLVERSION", CURLOPT_SSLVERSION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_TIMECONDITION", CURLOPT_TIMECONDITION, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_TIMEVALUE", CURLOPT_TIMEVALUE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_CUSTOMREQUEST", CURLOPT_CUSTOMREQUEST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_STDERR", CURLOPT_STDERR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_WRITEINFO", CURLOPT_WRITEINFO, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_TRANSFERTEXT", CURLOPT_TRANSFERTEXT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLOPT_RETURNTRANSFER", CURLOPT_RETURNTRANSFER, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
/* Error Constants */
|
||||
REGISTER_LONG_CONSTANT("CURLE_OK", CE_OK, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_UNSUPPORTED_PROTOCOL", CE_UNSUPPORTED_PROTOCOL, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FAILED_INIT", CE_FAILED_INIT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_URL_MALFORMAT", CE_URL_MALFORMAT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_URL_MALFORMAT_USER", CE_URL_MALFORMAT_USER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_COULDNT_RESOLVE_PROXY", CE_COULDNT_RESOLVE_PROXY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_COULDNT_RESOLVE_HOST", CE_COULDNT_RESOLVE_HOST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_COULDNT_CONNECT", CE_COULDNT_CONNECT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_SERVER_REPLY", CE_FTP_WEIRD_SERVER_REPLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_ACCESS_DENIED", CE_FTP_ACCESS_DENIED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_USER_PASSWORD_INCORRECT", CE_FTP_USER_PASSWORD_INCORRECT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_PASS_REPLY", CE_FTP_WEIRD_PASS_REPLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_USER_REPLY", CE_FTP_WEIRD_USER_REPLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_PASV_REPLY", CE_FTP_WEIRD_PASV_REPLY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WEIRD_227_FORMAT", CE_FTP_WEIRD_227_FORMAT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_CANT_GET_HOST", CE_FTP_CANT_GET_HOST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_CANT_RECONNECT", CE_FTP_CANT_RECONNECT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_SET_BINARY", CE_FTP_COULDNT_SET_BINARY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_PARTIAL_FILE", CE_PARTIAL_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_RETR_FILE", CE_FTP_COULDNT_RETR_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_WRITE_ERROR", CE_FTP_WRITE_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_QUOTE_ERROR", CE_FTP_QUOTE_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_HTTP_NOT_FOUND", CE_HTTP_NOT_FOUND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_WRITE_ERROR", CE_WRITE_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_MALFORMAT_USER", CE_MALFORMAT_USER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_STOR_FILE", CE_FTP_COULDNT_STOR_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_READ_ERROR", CE_READ_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_OUT_OF_MEMORY", CE_OUT_OF_MEMORY, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_OPERATION_TIMEOUTED", CE_OPERATION_TIMEOUTED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_SET_ASCII", CE_FTP_COULDNT_SET_ASCII, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_PORT_FAILED", CE_FTP_PORT_FAILED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_USE_REST", CE_FTP_COULDNT_USE_REST, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_COULDNT_GET_SIZE", CE_FTP_COULDNT_GET_SIZE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_HTTP_RANGE_ERROR", CE_HTTP_RANGE_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_HTTP_POST_ERROR", CE_HTTP_POST_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_SSL_CONNECT_ERROR", CE_SSL_CONNECT_ERROR, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FTP_BAD_DOWNLOAD_RESUME", CE_FTP_BAD_DOWNLOAD_RESUME, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FILE_COULDNT_READ_FILE", CE_FILE_COULDNT_READ_FILE, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_LDAP_CANNOT_BIND", CE_LDAP_CANNOT_BIND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_LDAP_SEARCH_FAILED", CE_LDAP_SEARCH_FAILED, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_LIBRARY_NOT_FOUND", CE_LIBRARY_NOT_FOUND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_FUNCTION_NOT_FOUND", CE_FUNCTION_NOT_FOUND, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_ABORTED_BY_CALLBACK", CE_ABORTED_BY_CALLBACK, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_BAD_FUNCTION_ARGUMENT", CE_BAD_FUNCTION_ARGUMENT, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURLE_BAD_CALLING_ORDER", CE_BAD_CALLING_ORDER, CONST_CS | CONST_PERSISTENT);
|
||||
REGISTER_LONG_CONSTANT("CURL_LAST", C_LAST, CONST_CS | CONST_PERSISTENT);
|
||||
|
||||
win32_init();
|
||||
|
||||
CURLG(output_start).next = NULL;
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
PHP_MSHUTDOWN_FUNCTION(curl)
|
||||
{
|
||||
win32_cleanup();
|
||||
}
|
||||
|
||||
|
||||
/* {{{ proto string curl_version (void)
|
||||
Return the CURL version string. */
|
||||
PHP_FUNCTION (curl_version)
|
||||
{
|
||||
RETURN_STRING(curl_version(),1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int curl_init ([string url])
|
||||
Initialize a CURL session */
|
||||
PHP_FUNCTION(curl_init)
|
||||
{
|
||||
zval **u_url;
|
||||
CURL *cp;
|
||||
int argcount = ZEND_NUM_ARGS();
|
||||
CURLLS_FETCH();
|
||||
|
||||
if (argcount < 0 || argcount > 1 ||
|
||||
zend_get_parameters_ex(argcount, &u_url) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
cp = curl_easy_init();
|
||||
|
||||
if (!cp) {
|
||||
php_error(E_ERROR, "Cannot initialize CURL Handle");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (argcount > 0) {
|
||||
convert_to_string_ex(u_url);
|
||||
curl_easy_setopt(cp, CURLOPT_URL, Z_STRVAL_PP(u_url));
|
||||
}
|
||||
|
||||
curl_easy_setopt(cp, CURLOPT_NOPROGRESS, 1);
|
||||
curl_easy_setopt(cp, CURLOPT_VERBOSE, 0);
|
||||
|
||||
ZEND_REGISTER_RESOURCE(return_value, cp, CURLG(le_curl));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool curl_setopt (int ch, string option, mixed value)
|
||||
Set an option for a CURL transfer */
|
||||
PHP_FUNCTION(curl_setopt)
|
||||
{
|
||||
zval **u_curl_id, **u_curl_option, **u_curl_value;
|
||||
CURL *cp;
|
||||
CURLcode ret;
|
||||
int option;
|
||||
CURLLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 ||
|
||||
zend_get_parameters_ex(3, &u_curl_id, &u_curl_option, &u_curl_value) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(cp, CURL *, u_curl_id, -1, "CURL Handle", CURLG(le_curl));
|
||||
|
||||
convert_to_long_ex(u_curl_option);
|
||||
option = Z_LVAL_PP(u_curl_option);
|
||||
|
||||
if (option == CURLOPT_INFILESIZE || option == CURLOPT_VERBOSE ||
|
||||
option == CURLOPT_HEADER || option == CURLOPT_NOPROGRESS ||
|
||||
option == CURLOPT_NOBODY || option == CURLOPT_FAILONERROR ||
|
||||
option == CURLOPT_UPLOAD || option == CURLOPT_POST ||
|
||||
option == CURLOPT_FTPLISTONLY || option == CURLOPT_FTPAPPEND ||
|
||||
option == CURLOPT_NETRC || option == CURLOPT_FOLLOWLOCATION ||
|
||||
option == CURLOPT_PUT || option == CURLOPT_MUTE ||
|
||||
option == CURLOPT_TIMEOUT || option == CURLOPT_LOW_SPEED_LIMIT ||
|
||||
option == CURLOPT_LOW_SPEED_TIME || option == CURLOPT_RESUME_FROM ||
|
||||
option == CURLOPT_SSLVERSION || option == CURLOPT_TIMECONDITION ||
|
||||
option == CURLOPT_TIMEVALUE || option == CURLOPT_TRANSFERTEXT) {
|
||||
|
||||
convert_to_long_ex(u_curl_value);
|
||||
ret = curl_easy_setopt(cp, option, Z_LVAL_PP(u_curl_value));
|
||||
|
||||
} else if (option == CURLOPT_URL || option == CURLOPT_PROXY ||
|
||||
option == CURLOPT_USERPWD || option == CURLOPT_PROXYUSERPWD ||
|
||||
option == CURLOPT_RANGE || option == CURLOPT_POSTFIELDS ||
|
||||
option == CURLOPT_USERAGENT || option == CURLOPT_FTPPORT ||
|
||||
option == CURLOPT_COOKIE || option == CURLOPT_SSLCERT ||
|
||||
option == CURLOPT_SSLCERTPASSWD || option == CURLOPT_COOKIEFILE ||
|
||||
option == CURLOPT_CUSTOMREQUEST) {
|
||||
|
||||
convert_to_string_ex(u_curl_value);
|
||||
ret = curl_easy_setopt(cp, option, Z_STRVAL_PP(u_curl_value));
|
||||
|
||||
} else if (option == CURLOPT_FILE || option == CURLOPT_INFILE ||
|
||||
option == CURLOPT_WRITEHEADER || option == CURLOPT_STDERR) {
|
||||
|
||||
FILE *fp;
|
||||
ZEND_FETCH_RESOURCE(fp, FILE *, u_curl_value, -1, "File-handle", php_file_le_fopen());
|
||||
ret = curl_easy_setopt(cp, option, fp);
|
||||
|
||||
if (option == CURLOPT_FILE) {
|
||||
CURLG(output_node) = &CURLG(output_start);
|
||||
|
||||
while (CURLG(output_node)->next)
|
||||
CURLG(output_node) = CURLG(output_node)->next;
|
||||
|
||||
CURLG(output_node)->next = (struct curl_file_id_table *)emalloc(sizeof(struct curl_file_id_table));
|
||||
CURLG(output_node) = CURLG(output_node)->next;
|
||||
CURLG(output_node)->id = Z_LVAL_PP(u_curl_id);
|
||||
CURLG(output_node)->output_to_file = 1;
|
||||
CURLG(output_node)->return_transfer = 0;
|
||||
CURLG(output_node)->next = NULL;
|
||||
}
|
||||
|
||||
} else if (option == CURLOPT_RETURNTRANSFER) {
|
||||
CURLG(output_node) = &CURLG(output_start);
|
||||
|
||||
while (CURLG(output_node)->next)
|
||||
CURLG(output_node) = CURLG(output_node)->next;
|
||||
|
||||
CURLG(output_node)->next = (struct curl_file_id_table *)emalloc(sizeof(struct curl_file_id_table));
|
||||
CURLG(output_node) = CURLG(output_node)->next;
|
||||
CURLG(output_node)->id = Z_LVAL_PP(u_curl_id);
|
||||
CURLG(output_node)->return_transfer = 1;
|
||||
CURLG(output_node)->output_to_file = 0;
|
||||
CURLG(output_node)->next = NULL;
|
||||
}
|
||||
|
||||
|
||||
RETURN_LONG(php_curl_error_translator(ret));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto bool curl_exec (int ch)
|
||||
Perform a CURL session */
|
||||
PHP_FUNCTION (curl_exec)
|
||||
{
|
||||
zval **u_curl_id;
|
||||
CURL *cp;
|
||||
CURLcode ret;
|
||||
CURLLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 ||
|
||||
zend_get_parameters_ex(1, &u_curl_id) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(cp, CURL *, u_curl_id, -1, "CURL Handle", CURLG(le_curl));
|
||||
|
||||
CURLG(output_node) = CURLG(output_start).next;
|
||||
while (CURLG(output_node))
|
||||
{
|
||||
if (CURLG(output_node)->id == Z_LVAL_PP(u_curl_id)) {
|
||||
break;
|
||||
}
|
||||
CURLG(output_node) = CURLG(output_node)->next;
|
||||
}
|
||||
|
||||
if (CURLG(output_node)->output_to_file) {
|
||||
ret = curl_easy_perform (cp);
|
||||
} else {
|
||||
FILE *tmp;
|
||||
char buf[4096];
|
||||
int b;
|
||||
|
||||
if ((tmp = tmpfile()) == NULL) {
|
||||
php_error(E_WARNING, "Cannot create temporary file to stream output of cURL from");
|
||||
RETURN_LONG(-1);
|
||||
}
|
||||
|
||||
curl_easy_setopt(cp, CURLOPT_FILE, tmp);
|
||||
ret = curl_easy_perform (cp);
|
||||
|
||||
if (ret != CURLE_OK)
|
||||
RETURN_LONG(php_curl_error_translator(ret));
|
||||
|
||||
fseek(tmp, 0, SEEK_SET);
|
||||
|
||||
if (CURLG(output_node)->return_transfer) {
|
||||
char *ret_data;
|
||||
struct stat stat_sb;
|
||||
|
||||
if (fstat(fileno(tmp), &stat_sb)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
ret_data = emalloc((stat_sb.st_size+1)*sizeof(char));
|
||||
|
||||
while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0)
|
||||
strcat(ret_data, buf);
|
||||
|
||||
RETURN_STRINGL(ret_data, stat_sb.st_size, 0);
|
||||
} else {
|
||||
while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0)
|
||||
php_write(buf, b);
|
||||
}
|
||||
|
||||
fclose(tmp);
|
||||
}
|
||||
RETURN_LONG(php_curl_error_translator(ret));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto void curl_close (int ch)
|
||||
Close a CURL session */
|
||||
PHP_FUNCTION (curl_close)
|
||||
{
|
||||
zval **u_curl_id;
|
||||
CURL *cp;
|
||||
CURLLS_FETCH();
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 ||
|
||||
zend_get_parameters_ex(1, &u_curl_id) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
ZEND_FETCH_RESOURCE(cp, CURL *, u_curl_id, -1, "CURL Handle", CURLG(le_curl));
|
||||
|
||||
CURLG(output_node) = CURLG(output_start).next;
|
||||
CURLG(output_previous) = &CURLG(output_start);
|
||||
|
||||
while (CURLG(output_node))
|
||||
{
|
||||
if (CURLG(output_node)->id == Z_LVAL_PP(u_curl_id)) {
|
||||
CURLG(output_previous) = CURLG(output_node)->next;
|
||||
efree(CURLG(output_node));
|
||||
break;
|
||||
} else {
|
||||
CURLG(output_node) = CURLG(output_node)->next;
|
||||
CURLG(output_previous) = CURLG(output_previous)->next;
|
||||
}
|
||||
}
|
||||
|
||||
zend_list_delete(Z_LVAL_PP(u_curl_id));
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
static int php_curl_error_translator(CURLcode err)
|
||||
{
|
||||
switch (err)
|
||||
{
|
||||
case CURLE_OK:
|
||||
return(CE_OK);
|
||||
case CURLE_UNSUPPORTED_PROTOCOL:
|
||||
return(CE_UNSUPPORTED_PROTOCOL);
|
||||
case CURLE_FAILED_INIT:
|
||||
return(CE_FAILED_INIT);
|
||||
case CURLE_URL_MALFORMAT:
|
||||
return(CE_URL_MALFORMAT);
|
||||
case CURLE_URL_MALFORMAT_USER:
|
||||
return(CE_URL_MALFORMAT_USER);
|
||||
case CURLE_COULDNT_RESOLVE_PROXY:
|
||||
return(CE_COULDNT_RESOLVE_PROXY);
|
||||
case CURLE_COULDNT_RESOLVE_HOST:
|
||||
return(CE_COULDNT_RESOLVE_HOST);
|
||||
case CURLE_COULDNT_CONNECT:
|
||||
return(CE_COULDNT_CONNECT);
|
||||
case CURLE_FTP_WEIRD_SERVER_REPLY:
|
||||
return(CE_FTP_WEIRD_SERVER_REPLY);
|
||||
case CURLE_FTP_ACCESS_DENIED:
|
||||
return(CE_FTP_ACCESS_DENIED);
|
||||
case CURLE_FTP_USER_PASSWORD_INCORRECT:
|
||||
return(CE_FTP_USER_PASSWORD_INCORRECT);
|
||||
case CURLE_FTP_WEIRD_PASS_REPLY:
|
||||
return(CE_FTP_WEIRD_PASS_REPLY);
|
||||
case CURLE_FTP_WEIRD_USER_REPLY:
|
||||
return(CE_FTP_WEIRD_USER_REPLY);
|
||||
case CURLE_FTP_WEIRD_PASV_REPLY:
|
||||
return(CE_FTP_WEIRD_PASV_REPLY);
|
||||
case CURLE_FTP_WEIRD_227_FORMAT:
|
||||
return(CE_FTP_WEIRD_227_FORMAT);
|
||||
case CURLE_FTP_CANT_GET_HOST:
|
||||
return(CE_FTP_CANT_GET_HOST);
|
||||
case CURLE_FTP_CANT_RECONNECT:
|
||||
return(CE_FTP_CANT_RECONNECT);
|
||||
case CURLE_FTP_COULDNT_SET_BINARY:
|
||||
return(CE_FTP_COULDNT_SET_BINARY);
|
||||
case CURLE_PARTIAL_FILE:
|
||||
return(CE_PARTIAL_FILE);
|
||||
case CURLE_FTP_COULDNT_RETR_FILE:
|
||||
return(CE_FTP_COULDNT_RETR_FILE);
|
||||
case CURLE_FTP_WRITE_ERROR:
|
||||
return(CE_FTP_WRITE_ERROR);
|
||||
case CURLE_FTP_QUOTE_ERROR:
|
||||
return(CE_FTP_QUOTE_ERROR);
|
||||
case CURLE_HTTP_NOT_FOUND:
|
||||
return(CE_HTTP_NOT_FOUND);
|
||||
case CURLE_WRITE_ERROR:
|
||||
return(CE_WRITE_ERROR);
|
||||
case CURLE_MALFORMAT_USER:
|
||||
return(CE_MALFORMAT_USER);
|
||||
case CURLE_FTP_COULDNT_STOR_FILE:
|
||||
return(CE_FTP_COULDNT_STOR_FILE);
|
||||
case CURLE_READ_ERROR:
|
||||
return(CE_READ_ERROR);
|
||||
case CURLE_OUT_OF_MEMORY:
|
||||
return(CE_OUT_OF_MEMORY);
|
||||
case CURLE_OPERATION_TIMEOUTED:
|
||||
return(CE_OPERATION_TIMEOUTED);
|
||||
case CURLE_FTP_COULDNT_SET_ASCII:
|
||||
return(CE_FTP_COULDNT_SET_ASCII);
|
||||
case CURLE_FTP_PORT_FAILED:
|
||||
return(CE_FTP_PORT_FAILED);
|
||||
case CURLE_FTP_COULDNT_USE_REST:
|
||||
return(CE_FTP_COULDNT_USE_REST);
|
||||
case CURLE_FTP_COULDNT_GET_SIZE:
|
||||
return(CE_FTP_COULDNT_GET_SIZE);
|
||||
case CURLE_HTTP_RANGE_ERROR:
|
||||
return(CE_HTTP_RANGE_ERROR);
|
||||
case CURLE_HTTP_POST_ERROR:
|
||||
return(CE_HTTP_POST_ERROR);
|
||||
case CURLE_SSL_CONNECT_ERROR:
|
||||
return(CE_SSL_CONNECT_ERROR);
|
||||
case CURLE_FTP_BAD_DOWNLOAD_RESUME:
|
||||
return(CE_FTP_BAD_DOWNLOAD_RESUME);
|
||||
case CURLE_FILE_COULDNT_READ_FILE:
|
||||
return(CE_FILE_COULDNT_READ_FILE);
|
||||
case CURLE_LDAP_CANNOT_BIND:
|
||||
return(CE_LDAP_CANNOT_BIND);
|
||||
case CURLE_LDAP_SEARCH_FAILED:
|
||||
return(CE_LDAP_SEARCH_FAILED);
|
||||
case CURLE_LIBRARY_NOT_FOUND:
|
||||
return(CE_LIBRARY_NOT_FOUND);
|
||||
case CURLE_FUNCTION_NOT_FOUND:
|
||||
return(CE_FUNCTION_NOT_FOUND);
|
||||
case CURLE_ABORTED_BY_CALLBACK:
|
||||
return(CE_ABORTED_BY_CALLBACK);
|
||||
case CURLE_BAD_FUNCTION_ARGUMENT:
|
||||
return(CE_BAD_FUNCTION_ARGUMENT);
|
||||
case CURLE_BAD_CALLING_ORDER:
|
||||
return(CE_BAD_CALLING_ORDER);
|
||||
case CURL_LAST:
|
||||
return(C_LAST);
|
||||
}
|
||||
}
|
||||
|
||||
static void php_curl_close(CURL *cp)
|
||||
{
|
||||
curl_easy_cleanup(cp);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.02 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available at through the world-wide-web at |
|
||||
| http://www.php.net/license/2_02.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Sterling Hughes <sterling@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef _PHP_CURL_H
|
||||
#define _PHP_CURL_H
|
||||
|
||||
#ifdef COMPILE_DL_CURL
|
||||
#undef HAVE_CURL
|
||||
#define HAVE_CURL 1
|
||||
#endif
|
||||
|
||||
#if HAVE_CURL
|
||||
|
||||
extern zend_module_entry curl_module_entry;
|
||||
#define curl_module_ptr &curl_module_entry
|
||||
|
||||
PHP_MINIT_FUNCTION(curl);
|
||||
PHP_MSHUTDOWN_FUNCTION(curl);
|
||||
PHP_MINFO_FUNCTION(curl);
|
||||
PHP_FUNCTION(curl_version);
|
||||
PHP_FUNCTION(curl_init);
|
||||
PHP_FUNCTION(curl_setopt);
|
||||
PHP_FUNCTION(curl_exec);
|
||||
PHP_FUNCTION(curl_close);
|
||||
|
||||
#define CE_OK 0
|
||||
#define CE_UNSUPPORTED_PROTOCOL 1
|
||||
#define CE_FAILED_INIT 2
|
||||
#define CE_URL_MALFORMAT 3
|
||||
#define CE_URL_MALFORMAT_USER 4
|
||||
#define CE_COULDNT_RESOLVE_PROXY 5
|
||||
#define CE_COULDNT_RESOLVE_HOST 6
|
||||
#define CE_COULDNT_CONNECT 7
|
||||
#define CE_FTP_WEIRD_SERVER_REPLY 8
|
||||
#define CE_FTP_ACCESS_DENIED 9
|
||||
#define CE_FTP_USER_PASSWORD_INCORRECT 10
|
||||
#define CE_FTP_WEIRD_PASS_REPLY 11
|
||||
#define CE_FTP_WEIRD_USER_REPLY 12
|
||||
#define CE_FTP_WEIRD_PASV_REPLY 13
|
||||
#define CE_FTP_WEIRD_227_FORMAT 14
|
||||
#define CE_FTP_CANT_GET_HOST 15
|
||||
#define CE_FTP_CANT_RECONNECT 16
|
||||
#define CE_FTP_COULDNT_SET_BINARY 17
|
||||
#define CE_PARTIAL_FILE 18
|
||||
#define CE_FTP_COULDNT_RETR_FILE 19
|
||||
#define CE_FTP_WRITE_ERROR 20
|
||||
#define CE_FTP_QUOTE_ERROR 21
|
||||
#define CE_HTTP_NOT_FOUND 22
|
||||
#define CE_WRITE_ERROR 23
|
||||
#define CE_MALFORMAT_USER 24
|
||||
#define CE_FTP_COULDNT_STOR_FILE 25
|
||||
#define CE_READ_ERROR 26
|
||||
#define CE_OUT_OF_MEMORY 27
|
||||
#define CE_OPERATION_TIMEOUTED 28
|
||||
#define CE_FTP_COULDNT_SET_ASCII 29
|
||||
#define CE_FTP_PORT_FAILED 30
|
||||
#define CE_FTP_COULDNT_USE_REST 31
|
||||
#define CE_FTP_COULDNT_GET_SIZE 32
|
||||
#define CE_HTTP_RANGE_ERROR 33
|
||||
#define CE_HTTP_POST_ERROR 34
|
||||
#define CE_SSL_CONNECT_ERROR 35
|
||||
#define CE_FTP_BAD_DOWNLOAD_RESUME 36
|
||||
#define CE_FILE_COULDNT_READ_FILE 37
|
||||
#define CE_LDAP_CANNOT_BIND 38
|
||||
#define CE_LDAP_SEARCH_FAILED 39
|
||||
#define CE_LIBRARY_NOT_FOUND 40
|
||||
#define CE_FUNCTION_NOT_FOUND 41
|
||||
#define CE_ABORTED_BY_CALLBACK 42
|
||||
#define CE_BAD_FUNCTION_ARGUMENT 43
|
||||
#define CE_BAD_CALLING_ORDER 44
|
||||
#define C_LAST 45
|
||||
#define CURLOPT_RETURNTRANSFER 500
|
||||
|
||||
struct curl_file_id_table {
|
||||
int id;
|
||||
int return_transfer;
|
||||
int output_to_file;
|
||||
struct curl_file_id_table *next;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int le_curl;
|
||||
struct curl_file_id_table *output_node, *output_previous, output_start;
|
||||
} php_curl_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
#define CURLG(v) (curl_globals->v)
|
||||
#define CURLLS_FETCH() php_curl_globals *curl_globals = ts_resource(curl_globals_id)
|
||||
#else
|
||||
#define CURLG(v) (curl_globals.v)
|
||||
#define CURLLS_FETCH()
|
||||
#endif
|
||||
|
||||
|
||||
#else
|
||||
#define curl_module_ptr NULL
|
||||
#endif /* HAVE_CURL */
|
||||
#define phpext_curl_ptr curl_module_ptr
|
||||
#endif /* _PHP_CURL_H */
|
||||
+99
-104
@@ -29,10 +29,9 @@
|
||||
*/
|
||||
|
||||
#include "php.h"
|
||||
#include "ext/standard/info.h"
|
||||
#include "cybercash.h"
|
||||
|
||||
#if HAVE_MCK
|
||||
#include "cybercash.h"
|
||||
#include "mckcrypt.h"
|
||||
#include "base64.h"
|
||||
|
||||
@@ -41,40 +40,26 @@ function_entry cybercash_functions[] = {
|
||||
PHP_FE(cybercash_decr, NULL)
|
||||
PHP_FE(cybercash_base64_encode, NULL)
|
||||
PHP_FE(cybercash_base64_decode, NULL)
|
||||
{NULL, NULL, NULL}
|
||||
};
|
||||
{0}
|
||||
};
|
||||
|
||||
zend_module_entry cybercash_module_entry = {
|
||||
"cybercash",
|
||||
cybercash_functions,
|
||||
NULL,NULL,
|
||||
NULL,NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
PHP_MINFO(cybercash),
|
||||
STANDARD_MODULE_PROPERTIES,
|
||||
};
|
||||
|
||||
#ifdef COMPILE_DL_CYBERCASH
|
||||
ZEND_GET_MODULE(cybercash)
|
||||
#endif
|
||||
|
||||
PHP_MINFO_FUNCTION(cybercash)
|
||||
{
|
||||
php_info_print_table_start();
|
||||
php_info_print_table_row(2, "Cybercash Support", "enabled");
|
||||
php_info_print_table_end();
|
||||
}
|
||||
|
||||
PHP_FUNCTION(cybercash_encr)
|
||||
{
|
||||
zval **wmk, **sk, **inbuff;
|
||||
pval **wmk, **sk, **inbuff;
|
||||
unsigned char *outbuff, *macbuff;
|
||||
unsigned int outAlloc, outLth;
|
||||
long errcode;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 ||
|
||||
zend_get_parameters_ex(3, &wmk, &sk, &inbuff) == FAILURE) {
|
||||
|
||||
if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3,&wmk,&sk,&inbuff) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
@@ -82,122 +67,132 @@ PHP_FUNCTION(cybercash_encr)
|
||||
convert_to_string_ex(sk);
|
||||
convert_to_string_ex(inbuff);
|
||||
|
||||
outAlloc = Z_STRLEN_PP(inbuff) + 10;
|
||||
outAlloc = (*inbuff)->value.str.len + 10;
|
||||
|
||||
outbuff = (unsigned char *)emalloc(sizeof(unsigned char) * outAlloc);
|
||||
macbuff = (unsigned char *)emalloc(sizeof(unsigned char) * 20);
|
||||
outbuff = (unsigned char *)emalloc(outAlloc);
|
||||
macbuff = (unsigned char *)emalloc(20);
|
||||
|
||||
errcode = mck_encr(Z_STRVAL_PP(wmk),
|
||||
Z_STRVAL_PP(sk),
|
||||
Z_STRLEN_PP(inbuff) + 1,
|
||||
Z_STRVAL_PP(inbuff),
|
||||
outAlloc,
|
||||
outbuff,
|
||||
&outLth,
|
||||
macbuff);
|
||||
errcode = mck_encr((*wmk)->value.str.val,(*sk)->value.str.val,
|
||||
(*inbuff)->value.str.len+1,
|
||||
(*inbuff)->value.str.val,
|
||||
outAlloc,
|
||||
outbuff,
|
||||
&outLth,
|
||||
macbuff);
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
php_error(E_WARNING, "Return value from cybercash_encr could not be initialized");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
array_init(return_value);
|
||||
|
||||
add_assoc_long(return_value, "errcode", errcode);
|
||||
add_assoc_long(return_value,"errcode",errcode);
|
||||
|
||||
if (!errcode) {
|
||||
add_assoc_stringl(return_value, "outbuff", outbuff, outLth, 0);
|
||||
add_assoc_long(return_value,"outLth",outLth);
|
||||
if(!errcode)
|
||||
{
|
||||
add_assoc_stringl(return_value,"outbuff",outbuff,outLth,0);
|
||||
add_assoc_long(return_value,"outLth",outLth);
|
||||
add_assoc_stringl(return_value,"macbuff",macbuff,20,0);
|
||||
} else {
|
||||
efree(outbuff);
|
||||
efree(macbuff);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
efree(outbuff);
|
||||
efree(macbuff);
|
||||
}
|
||||
}
|
||||
|
||||
PHP_FUNCTION(cybercash_decr)
|
||||
{
|
||||
zval **wmk,**sk,**inbuff;
|
||||
unsigned char *outbuff, *macbuff;
|
||||
unsigned int outAlloc, outLth;
|
||||
long errcode;
|
||||
pval **wmk,**sk,**inbuff;
|
||||
unsigned char *outbuff, *macbuff;
|
||||
unsigned int outAlloc, outLth;
|
||||
long errcode;
|
||||
|
||||
|
||||
if (ZEND_NUM_ARGS() != 3 ||
|
||||
zend_get_parameters_ex(3, &wmk, &sk, &inbuff) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
if(ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3,&wmk,&sk,&inbuff) == FAILURE)
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_string_ex(wmk);
|
||||
convert_to_string_ex(sk);
|
||||
convert_to_string_ex(inbuff);
|
||||
convert_to_string_ex(wmk);
|
||||
convert_to_string_ex(sk);
|
||||
convert_to_string_ex(inbuff);
|
||||
|
||||
outAlloc = Z_STRLEN_PP(inbuff);
|
||||
outAlloc=(*inbuff)->value.str.len;
|
||||
|
||||
outbuff = (unsigned char *)emalloc(sizeof(unsigned char) * outAlloc);
|
||||
macbuff = (unsigned char *)emalloc(sizeof(unsigned char) * 20);
|
||||
outbuff=(unsigned char *)emalloc(outAlloc);
|
||||
macbuff=(unsigned char *)emalloc(20);
|
||||
|
||||
errcode = mck_decr(Z_STRVAL_PP(wmk),
|
||||
Z_STRVAL_PP(sk),
|
||||
Z_STRLEN_PP(inbuff),
|
||||
Z_STRVAL_PP(inbuff),
|
||||
outAlloc,
|
||||
outbuff,
|
||||
&outLth,
|
||||
macbuff);
|
||||
errcode=mck_decr((*wmk)->value.str.val,
|
||||
(*sk)->value.str.val,
|
||||
(*inbuff)->value.str.len,
|
||||
(*inbuff)->value.str.val,
|
||||
outAlloc,
|
||||
outbuff,
|
||||
&outLth,
|
||||
macbuff);
|
||||
|
||||
if (array_init(return_value) == FAILURE) {
|
||||
php_error(E_WARNING, "Could not initialize Return value from cybercash_decr");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
array_init(return_value);
|
||||
|
||||
add_assoc_long(return_value, "errcode", errcode);
|
||||
add_assoc_long(return_value,"errcode",errcode);
|
||||
|
||||
if (!errcode) {
|
||||
add_assoc_stringl(return_value, "outbuff", outbuff, outLth, 0);
|
||||
add_assoc_long(return_value, "outLth", outLth);
|
||||
add_assoc_stringl(return_value, "macbuff", macbuff, 20, 0);
|
||||
} else {
|
||||
efree(outbuff);
|
||||
efree(macbuff);
|
||||
if(!errcode) {
|
||||
add_assoc_stringl(return_value,"outbuff",outbuff,outLth,0);
|
||||
add_assoc_long(return_value,"outLth",outLth);
|
||||
add_assoc_stringl(return_value,"macbuff",macbuff,20,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
efree(outbuff);
|
||||
efree(macbuff);
|
||||
}
|
||||
}
|
||||
|
||||
PHP_FUNCTION(cybercash_base64_encode)
|
||||
{
|
||||
zval **inbuff;
|
||||
char *outbuff;
|
||||
long ret_length;
|
||||
pval **inbuff;
|
||||
char *outbuff;
|
||||
long ret_length;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 ||
|
||||
zend_get_parameters_ex(1, &inbuff) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(inbuff);
|
||||
if(ZEND_NUM_ARGS() != 1 ||
|
||||
zend_get_parameters_ex(1,&inbuff) == FAILURE)
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
outbuff = (char *)emalloc(base64_enc_size((unsigned int)Z_STRLEN_PP(inbuff)));
|
||||
convert_to_string_ex(inbuff);
|
||||
|
||||
outbuff=(char *)emalloc(
|
||||
base64_enc_size((unsigned int)(*inbuff)->value.str.len));
|
||||
|
||||
ret_length = base64_encode(outbuff,
|
||||
Z_STRVAL_PP(inbuff),
|
||||
Z_STRLEN_PP(inbuff));
|
||||
ret_length=base64_encode(outbuff,
|
||||
(*inbuff)->value.str.val,(*inbuff)->value.str.len);
|
||||
|
||||
RETURN_STRINGL(outbuff, ret_length, 0);
|
||||
return_value->value.str.val=outbuff;
|
||||
return_value->value.str.len=ret_length;
|
||||
return_value->type=IS_STRING;
|
||||
|
||||
}
|
||||
|
||||
PHP_FUNCTION(cybercash_base64_decode)
|
||||
{
|
||||
zval **inbuff;
|
||||
char *outbuff;
|
||||
long ret_length;
|
||||
pval **inbuff;
|
||||
char *outbuff;
|
||||
long ret_length;
|
||||
|
||||
if (ZEND_NUM_ARGS() != 1 ||
|
||||
zend_get_parameters_ex(1, &inbuff) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
convert_to_string_ex(inbuff);
|
||||
if(ZEND_NUM_ARGS() != 1 ||
|
||||
zend_get_parameters_ex(1,&inbuff) == FAILURE)
|
||||
{
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
outbuff = (char *)emalloc(base64_dec_size((unsigned int)Z_STRLEN_PP(inbuff)));
|
||||
convert_to_string_ex(inbuff);
|
||||
|
||||
outbuff=(char *)emalloc(
|
||||
base64_dec_size((unsigned int)(*inbuff)->value.str.len));
|
||||
|
||||
ret_length = base64_decode(outbuff, Z_STRVAL_PP(inbuff), Z_STRLEN_PP(inbuff));
|
||||
ret_length=base64_decode(outbuff,
|
||||
(*inbuff)->value.str.val,(*inbuff)->value.str.len);
|
||||
|
||||
RETURN_STRINGL(outbuff, ret_length, 0);
|
||||
return_value->value.str.val=outbuff;
|
||||
return_value->value.str.len=ret_length;
|
||||
return_value->type=IS_STRING;
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -27,16 +27,21 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
#ifndef CYBERCASH_H
|
||||
#define CYBERCASH_H
|
||||
#ifndef _CYBERCASH_H
|
||||
#define _CYBERCASH_H
|
||||
|
||||
|
||||
#if HAVE_MCK
|
||||
|
||||
#if PHP_API_VERSION < 19990421
|
||||
#define zend_module_entry cybercash_module_entry
|
||||
#include "modules.h"
|
||||
#include "internal_functions.h"
|
||||
#endif
|
||||
|
||||
extern zend_module_entry cybercash_module_entry;
|
||||
#define cybercash_module_ptr &cybercash_module_entry
|
||||
|
||||
PHP_MINFO_FUNCTION(cybercash);
|
||||
PHP_FUNCTION(cybercash_encr);
|
||||
PHP_FUNCTION(cybercash_decr);
|
||||
PHP_FUNCTION(cybercash_base64_encode);
|
||||
|
||||
+30
-19
@@ -1,27 +1,38 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
| PHP HTML Embedded Scripting Language Version 3.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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. |
|
||||
| This program is free software; you can redistribute it and/or modify |
|
||||
| it under the terms of one of the following licenses: |
|
||||
| |
|
||||
| A) the GNU General Public License as published by the Free Software |
|
||||
| Foundation; either version 2 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| B) the PHP License as published by the PHP Development Team and |
|
||||
| included in the distribution in the file: LICENSE |
|
||||
| |
|
||||
| This program is distributed in the hope that it will be useful, |
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
| GNU General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of both licenses referred to here. |
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Stig Sæther Bakken <ssb@guardian.no> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
/* $Id */
|
||||
|
||||
#ifndef PHP_DAV_H
|
||||
#define PHP_DAV_H
|
||||
#ifndef _PHP_DAV_H
|
||||
# define _PHP_DAV_H
|
||||
|
||||
#if HAVE_MOD_DAV
|
||||
# if HAVE_MOD_DAV
|
||||
|
||||
typedef struct {
|
||||
int foo;
|
||||
@@ -30,21 +41,21 @@ typedef struct {
|
||||
} phpdav_module;
|
||||
|
||||
extern zend_module_entry phpdav_module_entry;
|
||||
#define phpdav_module_ptr &phpdav_module_entry
|
||||
# define phpdav_module_ptr &phpdav_module_entry
|
||||
|
||||
int phpdav_mkcol_test_handler(request_rec *);
|
||||
|
||||
PHP_FUNCTION(dav_set_mkcol_handlers);
|
||||
|
||||
#else /* !HAVE_MOD_DAV */
|
||||
# else /* !HAVE_MOD_DAV */
|
||||
|
||||
#define phpdav_module_ptr NULL
|
||||
# define phpdav_module_ptr NULL
|
||||
|
||||
#endif /* HAVE_MOD_DAV */
|
||||
# endif /* HAVE_MOD_DAV */
|
||||
|
||||
#define phpext_dav_ptr phpdav_module_ptr
|
||||
|
||||
#endif /* PHP_DAV_H */
|
||||
#endif /* _PHP_DAV_H */
|
||||
|
||||
|
||||
/*
|
||||
|
||||
+24
-13
@@ -1,27 +1,38 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP version 4.0 |
|
||||
| PHP HTML Embedded Scripting Language Version 3.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
|
||||
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
|
||||
+----------------------------------------------------------------------+
|
||||
| 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. |
|
||||
| This program is free software; you can redistribute it and/or modify |
|
||||
| it under the terms of one of the following licenses: |
|
||||
| |
|
||||
| A) the GNU General Public License as published by the Free Software |
|
||||
| Foundation; either version 2 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| B) the PHP License as published by the PHP Development Team and |
|
||||
| included in the distribution in the file: LICENSE |
|
||||
| |
|
||||
| This program is distributed in the hope that it will be useful, |
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
| GNU General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of both licenses referred to here. |
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
|
||||
| Jim Winstead <jimw@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
|
||||
#ifndef PHP_DB_H
|
||||
#define PHP_DB_H
|
||||
#ifndef _PHP_DB_H
|
||||
#define _PHP_DB_H
|
||||
|
||||
|
||||
#ifndef DLEXPORT
|
||||
@@ -78,4 +89,4 @@ PHP_FUNCTION(dbmdelete);
|
||||
PHP_FUNCTION(dbmfirstkey);
|
||||
PHP_FUNCTION(dbmnextkey);
|
||||
|
||||
#endif /* PHP_DB_H */
|
||||
#endif /* _PHP_DB_H */
|
||||
+3
-3
@@ -23,7 +23,7 @@
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
| Authors: Sascha Schumann <sas@schell.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
@@ -338,7 +338,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
/* }}} */
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int dba_popen(string path, string mode, string handlername [, string ...])
|
||||
/* {{{ proto int dba_popen(string path, string mode, string handlername [, ...])
|
||||
Opens path using the specified handler in mode persistently */
|
||||
PHP_FUNCTION(dba_popen)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ PHP_FUNCTION(dba_popen)
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int dba_open(string path, string mode, string handlername [, string ...])
|
||||
/* {{{ proto int dba_open(string path, string mode, string handlername [, ...])
|
||||
Opens path using the specified handler in mode*/
|
||||
PHP_FUNCTION(dba_open)
|
||||
{
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
| Authors: Sascha Schumann <sas@schell.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
| Authors: Sascha Schumann <sas@schell.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
| Authors: Sascha Schumann <sas@schell.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
| Authors: Sascha Schumann <sas@schell.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
| Authors: Sascha Schumann <sas@schell.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Sascha Schumann <sascha@schumann.cx> |
|
||||
| Authors: Sascha Schumann <sas@schell.de> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef PHP_CDB_H
|
||||
#define PHP_CDB_H
|
||||
#ifndef _PHP_CDB_H
|
||||
#define _PHP_CDB_H
|
||||
|
||||
#if DBA_CDB
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef PHP_DB2_H
|
||||
#define PHP_DB2_H
|
||||
#ifndef _PHP_DB2_H
|
||||
#define _PHP_DB2_H
|
||||
|
||||
#if DBA_DB2
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef PHP_DB3_H
|
||||
#define PHP_DB3_H
|
||||
#ifndef _PHP_DB3_H
|
||||
#define _PHP_DB3_H
|
||||
|
||||
#if DBA_DB3
|
||||
|
||||
|
||||
Loaded 100 of 435 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user