Compare commits

..
Author SHA1 Message Date
SVN Migration 9fc46d3a46 This commit was manufactured by cvs2svn to create tag 'php_4_0_4RC5'. 2000-12-14 14:18:39 +00:00
Sterling Hughes ec94654316 MFH 2000-12-12 19:24:59 +00:00
Stanislav Malyshev 03e748888b MFH 2000-12-12 17:09:40 +00:00
Sascha Schumann 3dca869c7b Preparing 4.0.4RC5 2000-12-12 17:05:39 +00:00
Stanislav Malyshev 480a2ea1b7 MFH 2000-12-12 11:13:26 +00:00
foobar bf80795cad MFH 2000-12-11 16:32:08 +00:00
Stanislav Malyshev 881e6b69c4 Fix serializer bug (merge with HEAD) 2000-12-11 15:21:37 +00:00
Sterling Hughes 888e41a834 Merge with HEAD 2000-12-11 14:49:49 +00:00
Thies C. Arntzen 02e8c41b24 fix #6348 2000-12-11 12:55:17 +00:00
Andi Gutmans bd3b413dc9 - Merge message about assinging new MyClass() expressions by reference. 2000-12-10 20:27:47 +00:00
Sascha Schumann 83a354b69a Enabled improved shared library handling on HP-UX 11. 2000-12-09 11:37:27 +00:00
Sascha Schumann 3de6716235 MFH fix for #8181 2000-12-09 10:36:13 +00:00
Sascha Schumann 288d437b3e MFH off-by-one fix 2000-12-08 16:21:47 +00:00
Sascha Schumann 40cd0d8909 MFH memory leak fix 2000-12-08 16:20:20 +00:00
foobar ac6d2d4fe9 Merge changes from HEAD. 2000-12-08 13:13:04 +00:00
Sterling Hughes ebc2ff7c07 Correct merge. 2000-12-08 12:57:42 +00:00
Sascha Schumann a8b9717374 MFH on Sterling's request. 2000-12-08 12:43:26 +00:00
Sascha Schumann de138d3468 MFH namespace protecting changes 2000-12-08 11:38:02 +00:00
Sascha Schumann a5ce3491ef MFH LFS-related changes 2000-12-07 19:15:03 +00:00
Sascha Schumann d07f47f59e MFH --enable-libgcc change 2000-12-07 19:07:40 +00:00
foobar c3670534df Merge changes from HEAD. 2000-12-07 11:07:40 +00:00
foobar b583e753b5 merge from HEAD. 2000-12-07 10:46:18 +00:00
Sascha Schumann f81e218f15 Merge from HEAD 2000-12-07 10:03:56 +00:00
foobar 71fa3102fc merge from HEAD. 2000-12-07 00:31:36 +00:00
Sascha Schumann ded8918b9e Merge HEAD changes 2000-12-06 17:41:53 +00:00
Andi Gutmans a574e24080 - Update 4.0.4 branches NEWS file 2000-12-05 17:12:30 +00:00
Sascha Schumann d812632083 Merge from HEAD 2000-12-05 11:07:11 +00:00
Sascha Schumann ad39ef1462 Merge entries manually 2000-12-04 18:00:25 +00:00
foobar c0446845b9 Merge changes from head branch. 2000-12-04 17:26:11 +00:00
Sascha Schumann 326dcb9e79 Merged with HEAD, 1.21 2000-12-04 16:15:39 +00:00
Sascha Schumann 26a0663044 Merged with HEAD, 1.8 2000-12-04 16:15:26 +00:00
Sascha Schumann 9b4e521b9c Merged with HEAD, 1.35 2000-12-04 16:14:09 +00:00
Sascha Schumann 449ddbccb1 Merge from HEAD 2000-12-04 12:27:47 +00:00
Sascha Schumann fa077c7be9 Merge changes from HEAD. 2000-12-04 10:24:06 +00:00
Zeev Suraski 786eacfd45 Import the MySQL updates from the main branch 2000-12-03 21:25:28 +00:00
Hartmut Holzgraefe 46cdd040e2 changed run-tests.php to use 'php -q' instead of 'php -f' 2000-12-03 10:45:57 +00:00
Zeev Suraski 6f164ad7dc Fix the bug with -f not filling in the $argv[] arguments.
I'm not sure what used to be the behavior - but the new code puts the -f
argument as $argv[0], which is the Right Thing to do IMHO...  Comments
welcome
2000-12-03 01:09:13 +00:00
Zeev Suraski 58f0cbd534 Don't mislead people... 2000-12-03 00:39:56 +00:00
Zeev Suraski 594b7989cc Commit the fix to the 4.0.4 branch 2000-12-03 00:26:35 +00:00
Sascha Schumann 44294ada47 Merge changes from HEAD 2000-12-02 13:46:08 +00:00
Sascha Schumann c277e3f98d 4.0.4RC3 is coming. 2000-12-02 08:14:57 +00:00
SVN Migration cd14d04924 This commit was manufactured by cvs2svn to create branch 'php_4_0_4'. 2000-12-02 02:09:18 +00:00
873 changed files with 47925 additions and 88843 deletions

No files matched your search

+7 -40
View File
@@ -64,11 +64,11 @@ Exceptions:
Naming Conventions
------------------
[1] Function names for user-level functions should be enclosed with in
[1] Function names for user functions should be enclosed with in
the PHP_FUNCTION() macro. They should be in lowercase, with words
underscore delimited, with care taken to minimize the letter count.
Abbreviations should not be used when they greatly decrease the
readability of the function name itself.
If they are part of a "parent set" of functions, that parent should
be included in the user function name.
Good:
'mcrypt_enc_self_test'
@@ -83,35 +83,17 @@ Naming Conventions
Bad:
'hw_GetObjectByQueryCollObj'
'pg_setclientencoding'
'jf_n_s_i'
[2] If they are part of a "parent set" of functions, that parent should
be included in the user function name, and should be clearly related
to the parent program or function family. This should be in the form
of parent_*.
A family of 'foo' functions, for example:
Good:
'foo_select_bar'
'foo_insert_baz'
'foo_delete_baz'
Bad:
'fooselect_bar'
'fooinsertbaz'
'delete_foo_baz'
[3] Function names used by user functions should be prefixed
[2] Function names used by user functions should be prefixed
with "_php_", and followed by a word or an underscore-delimited list of
words, in lowercase letters, that describes the function. If applicable,
they should be declared 'static'.
[4] Variable names must be meaningful. One letter variable names must be
[3] Variable names must be meaningful. One letter variable names must be
avoided, except for places where the variable has no real meaning or
a trivial meaning (e.g. for (i=0; i<100; i++) ...).
[5] Variable names should be in lowercase; Use underscores to seperate
[4] Variable names should be in lowercase; Use underscores to seperate
between words.
@@ -185,23 +167,8 @@ messing up the function summary.
Optional arguments are written like this:
/* {{{ proto object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]])
Returns a header object with the defined parameters. */
And yes, please keep the prototype on a single line, even if that line
is massive.
New and Experimental Functions
-----------------------------------
To reduce the problems normally associated with the first public
implementation of a new set of functions, it has been suggested
that the first implementation include a file labeled 'EXPERIMENTAL'
in the function directory, and that the functions follow the
standard prefixing conventions during their initial implementation.
The file labelled 'EXPERIMENTAL' should include the following
information:
Any authoring infomration (known bugs, future directions of the module).
Ongoing status notes which may not be appropriate for CVS comments.
And yes, please keep everything on a single line, even if that line is massive.
Aliases & Legacy Documentation
-----------------------------------
+31840 -8578
View File
File diff suppressed because it is too large. Load diff
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+10 -73
View File
@@ -109,7 +109,7 @@ STATUS: Experimental
SINCE: 4.0.2
-------------------------------------------------------------------------------
EXTENSION: interbase
PRIMARY MAINTAINER: Jouni Ahto <jouni.ahto@exdec.fi>
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
MAINTENANCE: Odd Fixes
STATUS: Working
-------------------------------------------------------------------------------
@@ -128,7 +128,7 @@ MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: pgsql
PRIMARY MAINTAINER: Jouni Ahto <jouni.ahto@exdec.fi>
PRIMARY MAINTAINER: Jouni Ahto <jah@mork.net>
MAINTENANCE: Odd fixes
STATUS: Working
-------------------------------------------------------------------------------
@@ -171,12 +171,6 @@ EXTENSION: bcmath
MAINTENANCE: Unknown
STATUS: Unknown
-------------------------------------------------------------------------------
EXTENSION: bz2
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.3
-------------------------------------------------------------------------------
EXTENSION: calendar
MAINTENANCE: Unknown
STATUS: Unknown
@@ -190,15 +184,10 @@ PRIMARY MAINTAINER: Uwe Steinmann <steinm@php.net>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: crack
MAINTENANCE: Unknown
STATUS: Experimental
SINCE: 4.0.5
-------------------------------------------------------------------------------
EXTENSION: curl
EXTENSION: CURL
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
MAINTENANCE: Maintained
STATUS: Working
STATUS: Experimental
SINCE: 4.0.2
-------------------------------------------------------------------------------
EXTENSION: cybercash
@@ -239,11 +228,6 @@ EXTENSION: gettext
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: gmp
MAINTENANCE: Unknown
STATUS: Unknown
SINCE: 4.0.4
-------------------------------------------------------------------------------
EXTENSION: icap
MAINTENANCE: Unknown
STATUS: Obsolete
@@ -278,18 +262,10 @@ PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: muscat
PRIMARY MAINTAINER: Sam Liddicott <sam@ananova.com>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.5
COMMENT: Not tested against windows, only core API completed, rest under development
-------------------------------------------------------------------------------
EXTENSION: openssl
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>
PRIMARY MAINTAINER: Stig Venaas <venaas@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
SINCE: 4.0.4
-------------------------------------------------------------------------------
EXTENSION: pcre
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
@@ -312,24 +288,12 @@ PRIMARY MAINTAINER: Kristian K
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: printer
PRIMARY MAINTAINER: Daniel Beulshausen <daniel@php4win.de>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.4
COMMENT: Only for Win32
-------------------------------------------------------------------------------
EXTENSION: pspell
PRIMARY MAINTAINER: Vlad Krupin <phpdevel@echospace.com>
MAINTENANCE: Unknown
STATUS: Unknown
SINCE: 4.0.2
-------------------------------------------------------------------------------
EXTENSION: qtdom
MAINTENANCE: Unknown
STATUS: Experimental
SINCE: 4.0.4
-------------------------------------------------------------------------------
EXTENSION: readline
MAINTENANCE: Unknown
STATUS: Unknown
@@ -339,12 +303,6 @@ PRIMARY MAINTAINER: Kristian K
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: sablot
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
SINCE: 4.0.3
-------------------------------------------------------------------------------
EXTENSION: satellite
PRIMARY MAINTAINER: David Eriksson <eriksson@php.net>
MAINTENANCE: Odd Fixes
@@ -356,12 +314,6 @@ PRIMARY MAINTAINER: Sascha Schumann <sascha@schumann.cx>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: shmop
PRIMARY MAINTAINER: Unknown
MAINTENANCE: Unknown
STATUS: Experimental
SINCE: 4.0.3
-------------------------------------------------------------------------------
EXTENSION: snmp
PRIMARY MAINTAINER: Rasmus Lerdorf <rasmus@php.net>
MAINTENANCE: Odd Fixes
@@ -369,15 +321,14 @@ STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: sockets
PRIMARY MAINTAINER: Chris Vandomelen <chrisv@b0rked.dhs.org>
MAINTENANCE: Maintained
STATUS: Experimental
MAINTENANCE: Unknown
STATUS: Unknown
SINCE: 4.0.2
-------------------------------------------------------------------------------
EXTENSION: swf
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
MAINTENANCE: Maintained
STATUS: Depreciated (Use the ming swf extension instead)
COMMENT: Only for Unix (won't change)
STATUS: Unix (won't change)
-------------------------------------------------------------------------------
EXTENSION: sysvsem
MAINTENANCE: Unknown
@@ -387,11 +338,6 @@ EXTENSION: sysvshm
MAINTENANCE: Unknown
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: vpopmail
MAINTENANCE: Unknown
STATUS: Experimental
SINCE: 4.0.5
-------------------------------------------------------------------------------
EXTENSION: wddx
PRIMARY MAINTAINER: Andrei Zmievski <andrei@ispi.net>
MAINTENANCE: Maintained
@@ -400,7 +346,7 @@ STATUS: Working
EXTENSION: xml
PRIMARY MAINTAINER: Thies C. Arntzen <thies@thieso.net>
MAINTENANCE: Maintained
STATUS: Working
STATUS: Unknown
-------------------------------------------------------------------------------
EXTENSION: yaz
PRIMARY MAINTAINER: Adam Dickmeiss <adam@indexdata.dk>
@@ -408,19 +354,10 @@ MAINTENANCE: Maintained
STATUS: Unknown
SINCE: 4.0.1
-------------------------------------------------------------------------------
EXTENSION: yp
MAINTENANCE: Unknown
STATUS: Unknown
-------------------------------------------------------------------------------
EXTENSION: zlib
PRIMARY MAINTAINER: Stefan Roehrich <sr@linux.de>
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: zziplib
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>
MAINTENANCE: Maintained
STATUS: Experimental
SINCE: 4.0.5
-------------------------------------------------------------------------------
# iptc?
+538
View File
@@ -0,0 +1,538 @@
Functions:
Functions marked with 'u' do not work, or may not work correctly under windows.
basic_functions
include
_include
isset
intval
doubleval
strval
short_tags
sleep
u usleep
ksort
asort
sort
count
chr
ord
flush
end
prev
next
reset
current
key
gettype
settype
min
max
addslashes
chop
pos
fsockopen
getimagesize
htmlspecialchars
md5
parse_url
parse_str
phpinfo
phpversion
strlen
strtok
strtoupper
strtolower
strchr
basename
dirname
stripslashes
strstr
strrchr
substr
quotemeta
urlencode
urldecode
ucfirst
strtr
sprintf
printf
exec
system
escapeshellcmd
passthru
soundex
rand
srand
getrandmax
gethostbyaddr
gethostbyname
explode
implode
error_reporting
clearstatcache
get_current_user
getmyuid
getmypid
u getmyinode
getlastmod
base64_decode
base64_encode
abs
ceil
floor
sin
cos
tan
asin
acos
atan
pi
pow
exp
log
log10
sqrt
bindec
hexdec
octdec
decbin
decoct
dechex
getenv
putenv
time
mktime
date
gmdate
getdate
checkdate
microtime
uniqid
u linkinfo
u readlink
u symlink
u link
u unlink
bcmath_functions
bcadd
bcsub
bcmul
bcdiv
bcmod
bcpow
bcsqrt
bcscale
bccomp
dir_functions
opendir
closedir
chdir
rewinddir
readdir
dir
dl_functions
dl(string module_name); dynamicly load a module
dns_functions
gethostbyaddr
gethostbyname
file_functions
pclose
popen
readfile
rewind
rmdir
umask
fclose
feof
fgets
fgetss
fopen
fpassthru
fseek
ftell
fputs
mkdir
rename
copy
tempnam
file
filestat_functions
fileatime
filectime
u filegroup
u fileinode
filemtime
u fileowner
fileperms
filesize
filetype
stat
u chown
u chgrp
u chmod
touch
file_exists
is_executable
is_dir
is_readable
is_writeable
u is_link
header_functions
setcookie
header
mail_functions
mail
reg_functions
ereg
ereg_replace
eregi
eregi_replace
split
sql_regcase
syslog_functions (writes to event log on win NT)
openlog
syslog
closelog
The following are optional modules and may or may not be compiled into php, or may be compiled as a loadable module.
odbc_functions (obsolete, use uodbc below)
sqlconnect
sqldisconnect
sqlfetch
sqlexecdirect
sqlgetdata
sqlfree
sqlrowcount
uodbc_functions
(int) odbc_autocommit($connection_id, $OnOff)
(void) odbc_close($connection_id)
(void) odbc_close_all(void)
(int) odbc_commit($connection_id)
(int) odbc_connect($dsn, $user, $password)
(int) odbc_pconnect($dsn, $user, $password)
(string) odbc_cursor($result_id)
(int) odbc_do($connection_id, $query_string)
(int) odbc_exec($connection_id, $query_string)
(int) odbc_prepare($connection_id, $query_string)
(int) odbc_execute($result_id, $array)
(int) odbc_fetch_row($result_id, $row_number)
(int) odbc_fetch_into($result_id, $row_number, $array_ptr)
(int) odbc_field_len($result_id, $field_number)
(string) odbc_field_name($result_id, $field_number)
(string) odbc_field_type($result_id, $field)
(int) odbc_free_result($result_id)
(int) odbc_num_fields($result_id)
(int) odbc_num_rows($result_id)
(string) odbc_result($result_id, $field)
(int) odbc_result_all($result_id, $format)
(int) odbc_rollback($connection_id)
msql_functions
msql_connect
msql_pconnect
msql_close
msql_select_db
msql_create_db
msql_drop_db
msql_query
msql
msql_list_dbs
msql_list_tables
msql_list_fields
msql_result
msql_num_rows
msql_num_fields
msql_fetch_row
msql_fetch_array
msql_fetch_object
msql_data_seek
msql_fetch_field
msql_field_seek
msql_free_result
msql_fieldname
msql_fieldtable
msql_fieldlen
msql_fieldtype
msql_fieldflags
msql_regcase
/* for downwards compatability */
msql_selectdb
msql_createdb
msql_dropdb
msql_freeresult
msql_numfields
msql_numrows
msql_listdbs
msql_listtables
msql_listfields
msql_dbname
msql_tablename
ldap_functions
ldap_connect
ldap_bind
ldap_unbind
ldap_read
ldap_list
ldap_search
ldap_free_result
ldap_count_entries
ldap_first_entry
ldap_next_entry
ldap_get_entries
ldap_free_entry
ldap_first_attribute
ldap_next_attribute
ldap_get_attributes
ldap_get_values
ldap_get_dn
ldap_dn2ufn
ldap_add
ldap_delete
ldap_modify
gd_functions
imagearc
imagechar
imagecharup
imagecolorallocate
imagecolorclosest
imagecolorexact
imagecolortransparent
imagecopyresized
imagecreate
imagecreatefromgif
imagedestroy
imagefill
imagefilledpolygon
imagefilledrectangle
imagefilltoborder
imagegif
imageinterlace
imageline
imagepolygon
imagerectangle
imagesetpixel
imagestring
imagestringup
imagesx
imagesy
filepro_functions
filepro
filepro_rowcount
filepro_fieldname
filepro_fieldtype
filepro_fieldwidth
filepro_fieldcount
filepro_retrieve
dbm_functions
dblist
dbmopen
dbmclose
dbminsert
dbmfetch
dbmreplace
dbmexists
dbmdelete
dbmfirstkey
dbmnextkey
dbase_functions
dbase_open
dbase_create
dbase_close
dbase_numrecords
dbase_numfields
dbase_add_record
dbase_get_record
dbase_delete_record
dbase_pack
calendar_functions
jdtogregorian
gregoriantojd
jdtojulian
juliantojd
jdtojewish
jewishtojd
jdtofrench
frenchtojd
jddayofweek
jdmonthname
adabas_functions
(int) ada_afetch($result_id, $rownumber, $result array)
(int) ada_autocommit($connection_id, $OnOff)
(void) ada_close($connection_id)
ada_closeall
(int) ada_commit($connection_id)
(int) ada_connect($dsn, $user, $password)
(int) ada_exec($connection_id, $query_string)
(int) ada_fetchrow($result_id, $row?number)
ada_fieldlen
(string) ada_fieldname($result_id, $field_number)
(string) ada_fieldtype($result_id, $field)
(int) ada_freeresult($result_id)
(int) ada_numfields($result_id)
(int) ada_numrows($result_id)
(string) ada_result($result_id, $field)
(int) ada_resultall($result_id, $format)
(int) ada_rollback($connection_id)
***(int) ada_fieldnum($result_id, $field_name) (this function is not in adabase.c
crypt_functions
crypt
mysql_functions
mysql_connect
mysql_pconnect
mysql_close
mysql_select_db
mysql_create_db
mysql_drop_db
mysql_query
mysql
mysql_list_dbs
mysql_list_tables
mysql_list_fields
mysql_affected_rows
mysql_insert_id
mysql_result
mysql_num_rows
mysql_num_fields
mysql_fetch_row
mysql_fetch_array
mysql_fetch_object
mysql_data_seek
mysql_fetch_lengths
mysql_fetch_field
mysql_field_seek
mysql_free_result
mysql_fieldname
mysql_fieldtable
mysql_fieldlen
mysql_fieldtype
mysql_fieldflags
/* for downwards compatability */
mysql_selectdb
mysql_createdb
mysql_dropdb
mysql_freeresult
mysql_numfields
mysql_numrows
mysql_listdbs
mysql_listtables
mysql_listfields
mysql_dbname
mysql_tablename
oracle_functions
ora_close
ora_commit
ora_commitoff
ora_commiton
ora_error
ora_errorcode
ora_exec
ora_fetch
ora_getcolumn
ora_logoff
ora_logon
ora_open
ora_parse
ora_rollback
pgsql_functions
pg_connect
pg_pconnect
pg_close
pg_dbname
pg_errormessage
pg_options
pg_port
pg_tty
pg_host
pg_exec
pg_numrows
pg_numfields
pg_fieldname
pg_fieldsize
pg_fieldtype
pg_fieldnum
pg_result
pg_fieldprtlen
pg_getlastoid
pg_freeresult
pg_locreate
pg_lounlink
pg_loopen
pg_loclose
pg_loread
pg_lowrite
pg_loreadall
sybase_functions
sybase_connect
sybase_pconnect
sybase_close
sybase_select_db
sybase_query
sybase_free_result
sybase_get_last_message
sybase_num_rows
sybase_num_fields
sybase_fetch_row
sybase_fetch_array
sybase_fetch_object
sybase_data_seek
sybase_fetch_field
sybase_field_seek
sybase_result
sybase_old_functions
sybsql_seek
sybsql_exit
sybsql_dbuse
sybsql_query
sybsql_isrow
sybsql_result
sybsql_connect
sybsql_nextrow
sybsql_numrows
sybsql_getfield
sybsql_numfields
sybsql_fieldname
sybsql_result_all
sybsql_checkconnect
+1 -1
View File
@@ -390,7 +390,7 @@ USING PHP 3 AND PHP 4 AS CONCURRENT APACHE MODULES
- Solaris 2.5 or better
- FreeBSD (3.2, 4.0 tested)
- IRIX64 6.5
To enable it, configure PHP 3 and PHP 4 to use APXS (--with-apxs) and the
necessary link extensions (--enable-versioning). Otherwise, all standard
installations instructions apply. For example:
+5 -11
View File
@@ -18,7 +18,7 @@ LTLIBRARY_LIBADD = $(LTLIBRARY_DEPENDENCIES) $(EXTRA_LIBS)
PROGRAM_NAME = php
PROGRAM_SOURCES = stub.c
PROGRAM_LDADD = libphp4.la $(EXT_PROGRAM_LDADD)
PROGRAM_LDADD = libphp4.la
PROGRAM_LDFLAGS = -export-dynamic
PROGRAM_DEPENDENCIES = $(PROGRAM_LDADD)
@@ -32,7 +32,7 @@ include $(top_srcdir)/build/program.mk
install-sapi:
@$(LIBTOOL) --silent --mode=install cp libphp4.la $(phptempdir)/libphp4.la >/dev/null 2>&1
-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
-@$(mkinstalldirs) $(bindir)
-@if test ! -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME); then \
for i in 0.0.0 0.0 0; do \
if test -r $(phptempdir)/libphp4.$(SHLIB_SUFFIX_NAME).$$i; then \
@@ -45,18 +45,12 @@ install-sapi:
install-modules:
@test -d modules && \
$(mkinstalldirs) $(INSTALL_ROOT)$(moduledir) && \
$(mkinstalldirs) $(moduledir) && \
echo "installing shared modules into $(moduledir)" && \
rm -f modules/*.la && \
cp modules/* $(INSTALL_ROOT)$(moduledir) >/dev/null 2>&1 || true
cp modules/* $(moduledir) >/dev/null 2>&1 || true
install-tester:
-$(mkinstalldirs) $(datadir)
$(INSTALL) -m 755 $(srcdir)/run-tests.php $(INSTALL_ROOT)$(datadir)
install-pear: install-modules
install-su: install-modules
(cd pear && $(MAKE) install)
install-su: install-pear install-tester
.NOEXPORT:
+5 -254
View File
@@ -1,256 +1,9 @@
PHP 4.0 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, Version 4.0.6
- Fix memory fragmention problem which could lead to web server processes
growing much more than they should. (Andi, Zend Engine)
- Made $HTTP_SESSION_VARS['foo'] and $foo be references to the same value
when register_globals is on. (Andrei)
- Fix disk_free_space() and disk_total_space() under FreeBSD. (Jon)
- Fixed readfile/passthru losing resources during connection abort (Sascha)
- Fixed bug in the mcrypt extension that caused segfaults when using a key
that is too large for the used algorithm, and a bug that caused
mcrypt_generic() to segfault PHP (Derick)
- Fixed getopt so that it accepts command line arguments in the form
-<opt><arg> and -<opt> <arg>. (Jmoore)
- Fixed race in writing session files (Sascha)
- Fixed a possible crash in the PHP CGI when no input file is
specified (Zeev)
- Added is_callable() function that can be used to find out whether
its argument is a valid callable construct. (Andrei)
- Fixed a rare possible crash when generating extended information. (Dmitri
Dmitrienko, Zend Engine)
- Improved virtual() to support PHP-enabled URIs. (Zeev)
- Fixed undefined behavior when using floating point keys in array()
expressions. (Zeev, Zend Engine)
- Fixed a possible crash in case of parse errors in include files or eval
statements. (Zeev, Zend Engine)
- Added --with-layout configure option. (Stig)
- Improved interactive mode - supports function calls, and works in
multithreaded builds. (Zeev, Zend Engine)
- Fixed a crash bug in interactive mode. (Zeev, Zend Engine)
- Add pg_last_notice() function. (Rasmus from suggestion by Dirk@rackspace.com)
- Fixed a bug in preg_split() that would incorrectly limit the number of
results when used along with PREG_SPLIT_NO_EMPTY flag. (Andrei)
- Added connection error support to mysql_error() and mysql_errno(). (Jason)
- Added support to getimagesize to return dimensions of BMP and PSD
files. (Derick)
- Added heuristic to kill stale IRC connections, message scanner caching, and
nickname escaping to IRCG, suppress option to ircg_msg(), and statistics to
IRCG phpinfo() output. (Sascha)
- Added Japanese multibyte string functions support. (Rui)
- Added Mac OS X "\r" line ending support. (Andi, Zend Engine)
- Fixed a bug regarding the $PHP_SELF being incorrectly registered when
force-cgi-redirect was not enabled. (Sterling)
- pfpro extension now supports version 3 of the Verisign SDK. (John Donagher)
- Udm_Cat_List and Udm_Cat_Path functions has been added.
- Added key_exists() to check if a given key or index exists in an
array or object. (David Croft)
- Modify the cURL extension to compile only with the latest cURL release.
Backwards compatibility with regards to the extension api has not been
broken. (Sterling)
- Added the ability to use user-defined callbacks with cURL. (Sterling)
- Added the SSL_VERIFYPEER, CAINFO, MAXREDIRS, FILETIME, RANDOM_FILE, EGDSOCKET
and CONNECTTIMEOUT options to curl_setopt(). (Sterling)
- Added support for persistent connections with cURL. (Sterling)
- Fixed a problem in cURL with file descriptors being allocated, but never
closed. (Sterling)
- Fixed interactive mode (-a). It works again with the same limitations it
has always had. (Andi, Zend Engine)
- Improved memory manager to use less memory and provide better memory overflow
detection abilities in debug mode. (Andi, Zend Engine)
- Fixed resource leaks when resources were being cast to numbers. (Zeev, Zend
Engine)
- Fixed foreach() to not crash when being sent an invalid argument. (Andi, Zend
Engine)
- Fixed a bug in opendir() under Windows when trying to open a non-exisiting
directory. (Andi)
- Fixed popen() and the exec family under Win32 (Unable to fork issue). (Daniel)
- Make the printf family of functions binary clean. (Rasmus)
- Fixed WDDX serialization to HTML-escape key/variable names so as not to
break the XML packet. (Andrei)
- Made WDDX extension enabled by default. (Andrei)
- Added -C command-line option to avoid chdir to the script's directory. (Stig)
- Fixed a bug with /e modifier in preg_replace(), that would not correctly
replace two-digit references if single digit references were present
before them. This fixed bug #10218. (Andrei)
- Added temporary LOB support in OCI8. (Patch by David Benson)
- Fixed crash in pathinfo()
- OCI8 now supports binding of collections. (Patch by Andy Sautins
<asautins@veripost.net>)
- Added GD 2.0.1 support for truecolor and alpha channels, plus some other gd
functions, both old and new - see docs for more info. (Wez)
- Added S/MIME sign/verify encrypt/decrypt functions to openssl extension,
along with some other certificate manipulation and interrogation functions.
See docs for more info. (Wez)
- printf argnum (parameter swapping) support. (Morten Poulsen, Rasmus)
- Add DIRECTORY_SEPARATOR constant ('/' on UNIX, '\' on Windows). (Stig)
- Added small change to php_odbc module, to check for failed SQLDisconnects
and to close any outstanding transactions if the call fails, then disconnect
again. (lurcher)
- Modified get_parent_class() and get_class_methods() to accept a class name as
well as a class instance. (Andrei, Zend Engine)
- Added support for UNC style paths. (\\server\share\file,
//server/share/file). (Daniel, TSRM)
- Added dbx module (database abstraction) to the repository. (Marc)
- Using ITypeInfo instead of IDispatch if possible. This makes DCOM calls
and even COM calls much faster.
All ini settings are now prefixed by 'com.'.
Now you need not provide a path to the file containing the typelib, you can
also provide the GUID of the TypeLib - entry or an IID for preloading
type - information. (phanto)
- Rewrite of domxml. It's now mostly DOM Level 2 conform. (Uwe)
- Added array_map() function that applies a callback to the elements
of given arrays and returns the result. It can also be used with a
null callback to transpose arrays. (Andrei)
- Added array_filter(), which allows filtering of array elements via
the specified callback. (Andrei)
- Fixed all relevant array functions to avoid moving the internal array
pointer during operations. (Andrei)
- Added mysql_unbuffered_query(), which is useful for very large result sets.
(Zeev)
30 Apr 2001, Version 4.0.5
- Added new php.ini directive: arg_separator.input which is used to tell
PHP which characters are considered as argument separators in URLs.
Renamed php.ini directive: arg_separator -> arg_separator.output (Jani)
- Added FastCGI SAPI module. (Ben Mansell)
- Added array_reduce(), which allows iterative reduction of an array
to a single value via a callback function. (Andrei)
- The imageloadfont function of the gd extension should be not platform
dependent after this fix. (alex@zend.com)
- Fixed a compatibility problem in some file functions (fgets, fputs, fread,
fwrite). The ANSI standard says that if a file is opened in read/write
mode, fseek() should be called before switching from reading to writing
and vice versa. (alex@zend.com)
- Fixed argument checking for call_user_func* functions and allowed
specifying array($obj, 'method') syntax for call_user_func_array. (Andrei)
- Fixed parent::method() to also work with runtime bindings.
(Zeev, Zend Engine)
- Implemented high-performance zlib-based output compression - see
zlib.output_compression INI directive. (Zeev)
- Improved ob_gzhandler() to support chunked output buffering - it's
recommended to use it with 4KB chunks. (Zeev)
- Fixed chunked output buffering. (Zeev)
- Forced call_user_method() and call_user_method_array() to take the
object argument by reference. (Andrei)
- Fixed binding of ROWIDs in OCI8. (Thies)
- Added PEAR/Cache as a generic Caching System. (Sebastian, PEAR/Cache)
- Added IMAP quota support (imap_set_quota, imap_get_quota), enabled/added via
c-client2000. (kalowsky)
- Upgraded PCRE to version 3.4. (Andrei)
- Added array_search which works similar to in_array but returns
the key instead of a boolean. (jason@php.net)
- Fixed pgsql transaction support. (Stig, PEAR/DB)
- Added new object VARIANT() to encapsulate values for use with
the COM and DOTNET module. Therefore it is now possible to pass
values by reference, convert php values to extended variant types (currency,
date, idispatch, iunknown, ...) and define the codepage that should
be used for unicode - conversion.
- Improved overall speed of IRCG, added URL handling to message scanner.
(Sascha)
- Fixed some modules to allow using output-buffering. (Thies)
- Added the chroot() function. (Derick)
- PostgreSQL now does a rollback at the end of a request on every
persistent connection. This is done by doing an "empty" transaction
on the connection. This was advised by someone from the PostgreSQL
core-team. (Thies)
- Fixed PostgeSQL pg_connect() bug. We would sometimes close the default
link by accident. (Patch by: aja@nlgroup.ca)
- Improved OCI8 dead-session detection. (Patch by: George Schlossnagle)
- Fixed get_meta_tags() multiline bug #4556. (Sean)
- Prefer random() over *rand48(). (JimJag)
- Sped up WDDX serialization 2x. (Andrei)
- Added a new parameter to mail() which appends aditional command line
parameters to the mail program. (Derick)
- Added Udm_Clear_Search_Limits mnoGoSearch extension function. (gluke)
- Fixed mnogosearch protos. Fixed mnogosearch functions return values.
A bug with capital letters break search has been fixed. (gluke)
- Static methods can now be called via call_user_method_* functions, e.g.
call_user_method('method', 'class'), and also array('class', 'method')
constructs (for array_walk(), for example). (Andrei, Zend Engine)
- microtime() under Windows now returns accurate values. (James)
- Added PREG_SPLIT_DELIM_CAPTURE flag to preg_split() that allows for Perl-like
functionality of capturing parenthesized delimiter expression. (Andrei)
- Fixed strip_tags() to not strip a lone > character. (Rasmus)
- When using the ob_gzhandler() PHP now automagically also sets the
Content-Lengh correctly which enables browsers to use the HTTP
Keep-Alive feature. (Thies)
- Improved handling of preg_replace() /F modifier so that it's possible to
specify array($obj, 'method') construct as a replacement function. (Andrei)
- Added mysql_get_client_info(), mysql_get_server_info(),
mysql_get_proto_info(), and mysql_get_host_info() functions. (Sean)
- Major change of the php pdf api. It could break some functions though
backwards compatibility was tried to maintain. Adding some still
missing functions as well. (Uwe)
- Added mnoGoSearch extension - http://search.mnogo.ru. (Sergey K)
- Allow URL encoding in DB usernames and passwords. (Stig, PEAR)
- Added raiseError and setErrorHandling methods to PEAR class. (Stig, PEAR)
- Added support for converting images from JPG/PNG on the fly with the GD
extension, which is usefull for creating dynamic WAP-sites. (Derick)
- Updated ext/mysql/libmysql to version 3.23.32; bug fixes. (tim@mysql.com)
- Fixed possible crash in all (non-pcre) regex functions. (Thies)
- Improved str_replace() to accept an array for any parameter - similar
to preg_replace(). (Andrei)
- Fixed extract() to properly prefix numeric keys when EXTR_PREFIX_ALL is
used. (Andrei)
- Added EXTR_PREFIX_INVALID flag to extract() to automatically prefix
string keys that do not constitute valid variable names. (Andrei)
- BeOS patch from svanegmond@bang.dhs.org, modified somewhat by Rasmus.
- Fixed the Apache module to overwrite PATH_TRANSLATED with SCRIPT_FILENAME,
only if PATH_TRANSLATED is not previously set. (Zeev)
- Fixed crash bug in highlight_string(). (Rasmus)
- Added URL support for getimagesize() function. (Jani)
- Added xslt_set_scheme_handler() function. (carmelo@akooe.com)
- Added the pg_lolseek and pg_lotell functions. (Derick)
- Fixed wrong breaking with the wordwrap function. (Derick)
- Fixed 'O' and 'r' flags of date() to have correct sign for timezone
offset. (Andrei)
- Changed 'Z' flag to date() to always return timezone offset with
negative sign if it's west of UTC. (Andrei)
- Added the HTML_Processor class which provides common functions for
processing HTML. (Sterling)
- Added localeconv() and strcoll() functions for localization. (Sean)
- Added the xslt_set_base function. (Sterling)
- Added support for Zeus 3.3.8.
- Added odbc_error() and odbc_errormsg() functions. (Stig)
- New extension for vpopmail - http://www.inter7.com/vpopmail,
give it a try, but keep in mind that it is not ready for production
environments. (David Croft, Boian Bonev)
- Added sybase_get_last_message() to the Sybase CT module. (Jan Fedak)
- Made ldap_list(), ldap_read() and ldap_search() do parallel search when
first parameter is an array of link identifiers. (Stig Venaas)
- Made fopen() of HTTP URL follow redirects, $http_response_header will
contain all headers with empty string as delimiter. (Stig Venaas)
- Added Console_Getopt class for parsing command-line args. (Andrei, PEAR)
- Added an experimental version of the ZZipLib extension which provides the
ability to read zip files. (Sterling)
- Allow access to uploaded files in safe_mode. Beware that you can only
read the file. If you copy it to new location the copy will not have the
right UID and you script won't be able to access that copy. (Thies)
- Changed extract() to check that prefixed name is a valid one. (Andrei)
- Changed extract() to return the number of variables extracted. (Andrei)
- Added ldap_rename() function. (Stig Venaas)
- Made ldap_set_option() support controls. (Stig Venaas)
- Changed ldap_search() and added functions ldap_parse_result(),
ldap_first_reference(), ldap_next_reference() and ldap_parse_reference()
to cope with LDAPv3 stuff like referrals and references. (Stig Venaas)
- Fixed date('r') overflow.
- Made the php.ini path reported in phpinfo() always point to the absolute
path that was opened. (Zeev)
- Made the INI mechanism thread safe. (Zeev, Zend Engine)
- Changed setlocale() to use LC_* constants. (Jani)
- ctype functions now follow the extension naming conventions. (Hartmut)
- Added iconv() function (using libc or libiconv). (Stig)
- Added ODBC_TYPE constant. (Stig)
- Added the call_user_method_array function which allows you to call a method
with an arbitrary number of parameters. (Sterling)
- ext/odbc: IBM DB2 patch by Walter Franzini. <walter@sys-net.it>
- Added extension for the cracklib library. (Alexander Feldman)
19 Dec. 2000, Version 4.0.4
- Allow assigning a newly created object by reference. This is needed only if
your constructor makes other data structures reference the $this object (for
?? Dec 2000, Version 4.0.4
- Allow assigning a newly created object by reference. This is needed only if
your constructor makes other data structures reference the $this object (for
example, $GLOBALS["foobar"] =& $this;)
The new syntax is $obj =& new MyClass(); (Andi, Zend Engine)
- Allow for three expression types to be sent to functions which are requesting
@@ -268,7 +21,7 @@ PHP 4.0 NEWS
- Made ldap_get_entries() return an array even if there are no entries
in search result. (Jani)
- Fixed bad mod_perl interaction which caused segfaults when using LFS (Sascha)
- const CONSTNAME now gets recognized. Before the patch only @const CONSTNAME
- const CONSTNAME now gets recognized. Before the patch only @const CONSTNAME
description was recognized.
- Added the is_null() function that will return true if a variable is of
type null. (Sterling)
@@ -290,7 +43,6 @@ PHP 4.0 NEWS
at run-time to provide the replacement string. It is passed an array of
matched pattern and subpatterns. (Andrei)
- Put an end to BUG#4615 (kalowsky & Eric Veldhuyzen)
- Added the IRCG extension (Sascha)
- Fixed realpath() in Virtual Directory mode (Daniel)
- Integrated the Phil Nelson's bc math library routines into PHP, now that
the license allows it (Phil Nelson <phil@cs.wwu.edu>)
@@ -328,7 +80,6 @@ PHP 4.0 NEWS
the full path (Jani)
- Added ImageCreateFromString() which creates an image stream out of
e.g. a MySQL blob. (Mathieu)
- Fixed a crash bug in imagewbmp() (Jani)
- Changed the sablot configuration file so that if you use any version of
Sablotron below 0.44 you must use Sablotron's built-in Expat libraries.
(Sterling)
@@ -658,7 +409,7 @@ PHP 4.0 NEWS
and currently run through a system call. This will speed up the UdmSearch
php frontend significantly. (Rasmus)
- Modified in_array() to not touch array pointer. (Andrei)
- Added restore_error_handler(). (Zeev, Zend Engine)
- Added restore_error_handler(). (Zeev, Zend engine)
- Fixed erroneous file names and line numbers in error situations under the
multithreaded version of PHP - most noticeably Win32 (Zeev, Zend Engine)
- Fixed problem with CGI crashing on certain servers especially Windows Apache
+6
View File
@@ -0,0 +1,6 @@
As of PHP 4.0.4, the BC math library routines are bundled in the
standard PHP distribution. There is no need to install any additional
files.
Thanks goes to Phil Nelson, for releasing the BC math library routines
under the LGPL.
+1 -2
View File
@@ -64,8 +64,7 @@ NEWS file. Everything else goes into the ChangeLog.
It is important to note that if your comment or news logline spans multiple
lines, you have to put # or @ at the beginning of _every_ such line. Every
entry in NEWS has to have a name after it, so if you did it with someone's
help, put both your names there. Your name WILL NOT be automatically put
at the end of the NEWS entry - so, please provide it yourself.
help, put both your names there.
Example. Say you modified two files, datetime.c and string.c. In datetime.c
you added a new format option for date() function, and in string.c you fixed
-243
View File
@@ -1,243 +0,0 @@
An Overview of the PHP Streams abstraction
==========================================
$Id$
Please send comments to: Wez Furlong <wez@thebrainroom.com>
Note: this doc is preliminary and is intended to give the reader an idea of
how streams work and should be used.
Why Streams?
============
You may have noticed a shed-load of issock parameters flying around the PHP
code; we don't want them - they are ugly and cumbersome and force you to
special case sockets and files everytime you need to work with a "user-level"
PHP file pointer.
Streams take care of that and present the PHP extension coder with an ANSI
stdio-alike API that looks much nicer and can be extended to support non file
based data sources.
Using Streams
=============
Streams use a php_stream* parameter just as ANSI stdio (fread etc.) use a
FILE* parameter.
The main functions are:
PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count);
PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t
count);
PHPAPI int php_stream_eof(php_stream * stream);
PHPAPI int php_stream_getc(php_stream * stream);
PHPAPI char *php_stream_gets(php_stream * stream, char *buf, size_t maxlen);
PHPAPI int php_stream_close(php_stream * stream);
PHPAPI int php_stream_flush(php_stream * stream);
PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence);
PHPAPI off_t php_stream_tell(php_stream * stream);
These (should) behave in the same way as the ANSI stdio functions with similar
names: fread, fwrite, feof, fgetc, fgets, fclose, fflush, fseek, ftell.
Opening Streams
===============
Ultimately, I aim to implement an fopen_wrapper-like call to do this with
minimum fuss.
Currently, mostly for testing purposes, you can use php_stream_fopen to open a
stream on a regular file.
PHPAPI php_stream * php_stream_fopen(const char * filename, const char *
mode);
This call behaves just like fopen(), except it returns a stream instead of a
FILE *
Casting Streams
===============
What if your extension needs to access the FILE* of a user level file pointer?
You need to "cast" the stream into a FILE*, and this is how you do it:
FILE * fp;
php_stream * stream; /* already opened */
if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, &fp, 1) == FAILURE) {
RETURN_FALSE;
}
The prototype is:
PHPAPI int php_stream_cast(php_stream * stream, int castas, void ** ret, int
show_err);
The show_err parameter, if non-zero, will cause the function to display an
appropriate error message of type E_WARNING if the cast fails.
castas can be one of the following values:
PHP_STREAM_AS_STDIO - a stdio FILE*
PHP_STREAM_AS_FD - a generic file descriptor
PHP_STREAM_AS_SOCKETD - a socket descriptor
If you ask a socket stream for a FILE*, the abstraction will use fdopen to
create it for you. Be warned that doing so may cause buffered data to be lost
if you mix ANSI stdio calls on the FILE* with php stream calls on the stream.
If your system has the fopencookie function, php streams can synthesize a
FILE* on top of any stream, which is useful for SSL sockets, memory based
streams, data base streams etc. etc.
NOTE: There might be situations where this is not desireable, and we need to
provide a flag to inform the casting routine of this.
You can use:
PHPAPI int php_stream_can_cast(php_stream * stream, int castas)
to find out if a stream can be cast, without actually performing the cast, so
to check if a stream is a socket you might use:
if (php_stream_can_cast(stream, PHP_STREAM_AS_SOCKETD) == SUCCESS) {
/* it's a socket */
}
Stream Internals
================
There are two main structures associated with a stream - the php_stream
itself, which holds some state information (and possibly a buffer) and a
php_stream_ops structure, which holds the "virtual method table" for the
underlying implementation.
The php_streams ops struct consists of pointers to methods that implement
read, write, close, flush, seek, gets and cast operations. Of these, an
implementation need only implement write, read, close and flush. The gets
method is intended to be used for non-buffered streams if there is an
underlying method that can efficiently behave as fgets. The ops struct also
contains a label for the implementation that will be used when printing error
messages - the stdio implementation has a label of "STDIO" for example.
The idea is that a stream implementation defines a php_stream_ops struct, and
associates it with a php_stream using php_stream_alloc.
As an example, the php_stream_fopen() function looks like this:
PHPAPI php_stream * php_stream_fopen(const char * filename, const char * mode)
{
FILE * fp = fopen(filename, mode);
php_stream * ret;
if (fp) {
ret = php_stream_alloc(&php_stream_stdio_ops, fp, 0, 0, mode);
if (ret)
return ret;
fclose(fp);
}
return NULL;
}
php_stream_stdio_ops is a php_stream_ops structure that can be used to handle
FILE* based streams.
A socket based stream would use code similar to that above to create a stream
to be passed back to fopen_wrapper (or it's yet to be implemented successor).
The prototype for php_stream_alloc is this:
PHPAPI php_stream * php_stream_alloc(php_stream_ops * ops, void * abstract,
size_t bufsize, int persistent, const char * mode)
ops is a pointer to the implementation,
abstract holds implementation specific data that is relevant to this instance
of the stream,
bufsize is the size of the buffer to use - if 0, then buffering at the stream
level will be disabled (recommended for underlying sources that implement
their own buffering - such a FILE*),
persistent controls how the memory is to be allocated - persistently so that
it lasts across requests, or non-persistently so that it is freed at the end
of a request (it uses pemalloc),
mode is the stdio-like mode of operation - php streams places no real meaning
in the mode parameter, except that it checks for a 'w' in the string when
attempting to write (this may change).
The mode parameter is passed on to fdopen/fopencookie when the stream is cast
into a FILE*, so it should be compatible with the mode parameter of fopen().
Writing your own stream implementation
======================================
First, you need to figure out what data you need to associate with the
php_stream. For example, you might need a pointer to some memory for memory
based streams, or if you were making a stream to read data from an RDBMS like
mysql, you might want to store the connection and rowset handles.
The stream has a field called abstract that you can use to hold this data.
If you need to store more than a single field of data, define a structure to
hold it, allocate it (use pemalloc with the persistent flag set
appropriately), and use the abstract pointer to refer to it.
For structured state you might have this:
struct my_state {
MYSQL conn;
MYSQL_RES * result;
};
struct my_state * state = pemalloc(sizeof(struct my_state), persistent);
/* initialize the connection, and run a query, using the fields in state to
* hold the results */
state->result = mysql_use_result(&state->conn);
/* now allocate the stream itself */
stream = php_stream_alloc(&my_ops, state, 0, persistent, "r");
/* now stream->abstract == state */
Once you have that part figured out, you can write your implementation and
define the your own php_stream_ops struct (we called it my_ops in the above
example).
For example, for reading from this wierd mysql stream:
static size_t php_mysqlop_read(php_stream * stream, char * buf, size_t count)
{
struct my_state * state = (struct my_state*)stream->abstract;
if (buf == NULL && count == 0) {
/* in this special case, php_streams is asking if we have reached the
* end of file */
if (... at end of file ...)
return EOF;
else
return 0;
}
/* pull out some data from the stream and put it in buf */
... mysql_fetch_row(state->result) ...
/* we could do something strange, like format the data as XML here,
and place that in the buf, but that brings in some complexities,
such as coping with a buffer size too small to hold the data,
so I won't even go in to how to do that here */
}
Implement the other operations - remember that write, read, close and flush
are all mandatory. The rest are optional. Declare your stream ops struct:
php_stream_ops my_ops = {
php_mysqlop_write, php_mysqlop_read, php_mysqlop_close,
php_mysqlop_flush, NULL, NULL, NULL,
"Strange mySQL example"
}
Thats it!
Take a look at the STDIO implementation in streams.c for more information
about how these operations work.
The main thing to remember is that in your close operation you need to release
and free the resources you allocated for the abstract field. In the case of
the example above, you need to use mysql_free_result on the rowset, close the
connection and then use pefree to dispose of the struct you allocated.
You may read the stream->persistent field to determine if your struct was
allocated in persistent mode or not.
vim:tw=78
+125 -98
View File
@@ -1,126 +1,153 @@
Using PHP4 with the Zeus Web Server
-----------------------------------
Zeus fully supports running PHP in combination with our
webserver. There are three different interfaces that can be used to
enable PHP:
Zeus fully supports running PHP in combination with our webserver. A
significant improvement in PHP 4 is that you can now run PHP as an
ISAPI module, giving great performance benefits over traditional CGI
code.
* CGI
* ISAPI
* FastCGI
Of the three, we recommend using FastCGI, which has been tested and
benchmarked as providing the best performance and reliability.
Full details of how to install PHP are available from our
website, at:
http://support.zeus.com/products/php.html
If you have any problems, please check the support site for more
up-to-date information and advice.
Note that you will need to be running at least version 3.3.6 of the
webserver. If you are running an earlier version, please see our
website (http://www.zeus.com) for upgrade instructions.
Quick guide to installing FastCGI with Zeus
-------------------------------------------
To build the ISAPI version of PHP, start the configuration with:
Step 1 - obtain and install FastCGI development kit.
./configure --with-zeus=/usr/local/zeus
Grab the package from:
http://www.fastcgi.com/dist/devkit_2.2.0.tar.gz
Obviously, replace /usr/local/zeus with the location of where you have
installed Zeus on your machine. For PHP to build successfully, you
need to have 3.3.6 already installed, because the code relies on the
presence of header files provided with the latest version.
Extract the package and follow the instructions:
./configure
make
make export
(run the last as root)
This will install to /usr/local/lib/libfcgi.a
and /usr/local/include/*fcgi*
You may have to adjust the environment variable LDFLAGS and EXTRA_LIBS
in order to link in extra libraries. This depends on the platform on
which you are building and also on the compiler used (see below). A
standard GNU/Linux install with GCC should build fine with no changes.
Configuring the webserver
-------------------------
Step 2 - Compile PHP as FastCGI.
After running 'make' and 'make install', you will have a 'libphp4.so'
file. Copy this file into a directory reserved for ISAPI
binaries. Now, perform the following steps for each virtual server
that you wish to run PHP on:
Compile as follows:
./configure --with-fastcgi
make
Note that PHP has many options to the configure script -
e.g. --with-mysql. You will probably want to select your usual options
before compiling; the above is just a bare minimum, for illustration.
After compilation finishes, you will be left with an executable
program called 'php'. Copy this into your document root, under a
dedicated FastCGI directory (e.g. $DOCROOT/fcgi-bin/php)
1) On the Admin server, go to 'edit server->path mapping'
2) Add an alias to the directory with libphp4.so in it, mapped to
/isapi/ (or a location of your choice). Make sure you set the alias
type to ISAPI.
3) Click 'update'
4) Add a handler for file extension 'php' to be run by /isapi/libphp4.so
5) Click 'update', then go back to the previous page.
6) Click on the 'module configuration' button, ensure that ISAPI
support is ticked.
7) Click on the ISAPI link. At the bottom of the page, click the
checkbox for running ISAPI extensions 'out of process'.
8) Click 'update'. Then restart the virtual server. Done!
Step 3 - configure Zeus
Troubleshooting
---------------
Four stages:
- enable FastCGI
- configure FastCGI
- setup alias for FastCGI
- setup alias for PHP
*) Why does the compile fail at Zend/zend-scanner-cc.cc
or Zend/zend-parser.c ?
1) Using the admin server, go to the 'module configuration' page for
your virtual server, and ensure that 'fastcgi' is enabled (select the
tickbox to the left).
These source files are auto-generated from the corresponding .y files.
The default distribution of PHP contains pre-generated versions of these
files that have caused problems for some people. The simplest solution is
to delete the files. They will then be rebuilt correctly. You must have the
following GNU tools to do this:
2) While we can run FastCGI's locally, there are known problems with
some OS's (specifically, the communication between web server and
FastCGI happens over a unix domain socket, and some OS's have trouble
sustaining high connection rates over these sockets). So instead, we
are going to set up the PHP FastCGI to run 'remotely' over localhost
(this uses TCP sockets, which do not suffer this problem). Go to the
'fastcgi configuration' page, and under 'add remote fastcgi':
Add Remote FastCGI
Docroot path /fcgi-bin/php
Remote machine localhost:8002
The first entry is where you saved PHP, above.
The second entry is localhost:<any unused port>
We will start the FastCGI listening on this port shortly.
Click 'update' to commit these changes.
bison 1.28 or later
flex 2.5.4 or later
3) Go to the path mapping module and add an alias for FastCGI:
Add Alias
Docroot path /fcgi-bin
Filesystem directory /path/to/docroot/fcgi-bin
Alias type fastcgi
Click 'update' to commit these changes
*) Why does my PHP library fail to load?
4) Also on the path mapping module, add a handler for PHP:
Add handler
File extension php
Handler /fcgi-bin/php
Click 'update' to commit these changes
After configuring Zeus, if you get a '502 Bad Gateway' error when
accessing a PHP page, there are problems loading the PHP
library. Check the error log ($ZEUSHOME/web/log/errors) for errors.
Finally restart your virtual server for these changes to take effect.
Failing to load the PHP ISAPI module is likely to be due to unresolved
symbols in the module. A way to check for this is to visit our support
page at http://support.zeus.com/faq/entries/isapi_error.html and run
the program there on your libphp4.so. It will list any unresolved
symbols.
*) My libphp4.so has unresolved symbols. How do I fix this?
You must ensure that the PHP build process links in the appropriate
libraries that contain these symbols! The libraries required will
depend on the platform you are running PHP on.
You may need to set one or two environment variables before running
the 'configure' program to set up PHP; LDFLAGS and EXTRA_LIBS. Make
sure that you also export these variables to the build process.
(Type 'export LDFLAGS EXTRA_LIBS' in the shell to do this.)
If you are using 3rd party tools and libraries which are installed
in non-standard locations, you may need to set the environment
variable LD_LIBRARY_PATH to point to the library's location, prior
to running the Zeus Web Server. For example, if you have compiled
external MySQL support, and mysql is installed in /usr/local/mysql,
you should set LD_LIBRARY_PATH to '/usr/local/mysql/lib/mysql'
and then 'export LD_LIBRARY_PATH'. For convenience, you should add
this to the 'start-zeus' script provided.
Yet another method of ensuring the linked libraries are found is to
set the environment variable LD_RUN_PATH before compiling PHP. This
works in a similar way to LD_LIBRARY_PATH, but at compile-time.
Libraries produced with this envrionment variable set will have its
value 'burned' into the resultant binary, specifying a runtime
search pth to locate other required libraries such as MySQL.
On Linux, you can also tell the dynamic linker where to find the
libraries, by adding '/usr/local/mysql/lib/mysql' to the file
/etc/ld.so.conf - after editting this file, run 'ldconfig' as root,
to use the changes.
Step 4 - start PHP as a FastCGI runner
Specific examples:
When you start PHP, it will pre-fork a given number of child processes
to handle incoming PHP requests. Each process will handle a given
number of requests before exiting (and being replaced by a newly
forked process). You can control these two parameters by setting the
following environment variables BEFORE starting the FastCGI runner:
Solaris + gcc:
Ensure you run ./configure with the `--enable-libgcc' parameter. You
may need to set LDFLAGS to '-L/usr/local/egcs/lib' (path depends on
your gcc installation)
PHP_FCGI_CHILDREN - the number of child processes to pre-fork. If not
set, defaults to 8.
FreeBSD 4:
Some people may find they need to run ./configure with the
'--enable-libgcc' compile option too.
PHP_FCGI_MAX_REQUESTS - the number of requests each PHP child process
handles before exiting. If not set, defaults to 500.
To start the FastCGI runner, execute '$ZEUSHOME/web/bin/fcgirunner
8002 $DOCROOT/fcgi-bin/php'. Substitute the appropriate values for
$ZEUSHOME and $DOCROOT; also substitute for 8002 the port you chose,
above.
Performance issues
==================
To stop the runner (e.g. to experiment with the above environment
variables) you will need to manually stop and running PHP
processes. (Use 'ps' and 'kill'). As it is PHP which is forking lots
of children and not the runner, Zeus unfortunately cannot keep track
of what processes are running, sorry. A typical command line may look
like 'ps -efl | grep $DOCROOT/fcgi-bin/php | grep -v grep | awk
'{print $4}' | xargs kill'
To make PHP run fast under Zeus, check the following points:
1) Run PHP as an ISAPI module, not a CGI - compile it with the --with-zeus=...
flag!
2) Tune the ISAPI runner to your required workload. There are several
tuneables that can be given. These are set by adding the appropriate
lines to the $ZEUSHOME/web/global.cfg file. Changes to this file will only
be picked up after the web server is restarted (run stop-zeus ; start-zeus)
tuning!modules!isapi!external!maxthreads xxx
- Sets the maximum number of threads that the ISAPI runner will spawn. If
further PHP page requests arrive, they will be queued until a current
page is finished. For busy websites, we suggest increasing this value
(defaults to 16). Replace the 'xxx' in the above line with the required
number of threads. Note that the threads are equally shared between
ISAPI extensions and filters, so if you want to handle 100 concurrent
PHP page requests, set this tuneable to 200.
tuning!modules!isapi!external!minthreads xxx
- Sets the minimum number of threads. Idle threads will be kept in a pool,
which avoids costly thread creation/deletion.
For more information and help with Zeus, please visit our website:
http://support.zeus.com
-186
View File
@@ -1,186 +0,0 @@
Advisory on the PHP Release Cycle
Copyright & Liciencing
This Document is (c) Copyright 2000,2001 by The PHP Group
This Document is distributed under the terms of 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.
Table of Contents
1. Introduction
2. Dealing with bugs
2.1 As a QA Team Member
2.2 As a Developer
3. Releaseing another RC
4. CVS During the Release Process
4.1 Useful CVS Commands
5 The Final Release
6 Summary
1. Introduction
This cycle should take place over roughly 10 days. When it is
decided it is time for an Release to occur Andi/Zeev (Or
Whoever) will tarball RC1, Tag & Branch CVS (see section 4)
and then announce the RC on PHP-QA and PHP-DEV. At this
point the build tracker and QA Bug System come into play.
If you successfully build PHP then report it in the build
tracker, If you then run and complete all the tests you
should report this too in the build tracker when
these features become avalible.
2. Dealing with Bugs
2.1 As a QA Team member
If you find a bug in an RC that you think is a showstopper
then, even if it is a known bug, you should report it in the
QA Bug system. This marks the bug for discussion at least,
and preferably fixing before the actual release. This system
is separate from the main bugs system so that important bugs
dont get lost in the midst if lots of feature/change request
in the approach to a release. It is imperitive where
appropraite that as a QA'er a test script, Configure options
and PHP.ini files are provided to enable the developer to
reproduce the bug, this is an important part of our job. If
you have a serious bug then you should also create a test
script to be added to the tests dir of the php source so
that at the end of the process to enable us to make sure bug
does not return. It is not difficult to create these test
scripts and a readme on it can be found in
php4/tests/README.
2.2 As a Developer
What should happen is that when a bug is reported it
is send to php-dev and php-qa as with other bugs. We should
have far stricter assignment system in this bug cycle rather
than just leaving them. Once again bugs should be able to be
marked as To Be Fixed Before release or moved to other bug
system. (This is currently the Release Masters responsibility)
Then before the actual release the qa bugs system can be
checked and if there are outstanding To Be Fixed Before
release bugs the Developers can see this easyly rather than
show stoppers being dismissed and not worried about.
When a bug is fixed the QAer who reported the bug is emailed
and asked to test again and see if the bug is fixed.
3 Releasing another RC
If it is felt necessary that a 2nd RC is needed then it
should be packaged as before and announced to both lists
again. The testing process then starts again, the RC2 is
added to the build tracker and QA'ers are asked to build and
retest the scripts as appropriate, espectially if you
reported a bug, you should test thourghly for your
bug and make sure it no longer occurs. This will normally
add anouther 3 days to the cycle, giving QA'ers time to
build test and report back, then for developers to
fix any problems.
4 CVS during the release process
At the point where the first RC is create a branch is
formed. This branch is not altered form that point onward
other than major bug fixes. Minor non important bug
fixes should not be applied to this branch but to the main
tree instead. Any major bug fixes should be applied to both
trees. The developer should test and check the RC tree then
also test and check the MAIN tree. This is their
responsibility to make sure (as far as possible) that the
bug fix works on both trees.
4.1 Useful CVS Commands
To create a Branch <Should only be done by person tarballing
the RC (The Release Master)>:
$ cvs tag -b php_4_0_<Version>RC<NUMBER>
IE:
$ cvs tag -b php_4_0_1RC1
This should be executed in the PHP directory of an up to
date checkout. Remember to also tag the Zend and TSRM repositories.
You can retrieve a branch in one of two ways: by checking it
out fresh from the repository, or by switching an existing
working copy over to the branch, I would suggest you
checkout a new copy.
To check out a new copy:
$ cvs checkout -r php_4_0_<Version>RC<NUMBER> php4
IE:
$ cvs checkout -r php_4_0_1RC1 php4
To switch a working copy (Not recomended due to possible
commiting to wrong branch)
$ cvs update -r php_4_0_<Version>RC<NUMBER> php4
IE:
$ cvs update -r php_4_0_1RC1 php4
This should be done in the PHP4 directory itself.
To revert back to normal branch you should use the
following:
$ cvs update -A
To Commit to the branch you follow exactly the same
procedure as normal
$ cvs commit file.c
MAKE SURE YOU DO NOT COMMIT TO THE WRONG BRANCH.
5 The Final Release
When it is time to make the final release the following
proceedure should be followed. The person who is tarballing
the final release should check the QA bugs system and make
sure there are no showstoppers left unfixed. If there are
then bug the person the bug is assigned to until they fix
it. If there are no more qa bugs then they should tag the
branch as php_4_0_<Version> and tarball as usual. An email
should be sent to PHP-GEN, PHP_DEV and PHP-QA about the new
release and it should be added to php.net. The windows
binaries and servelets should be built as soon as possible
and added too, as should the windows installer.
6 Summary
Here is a summary of what a release cycle might look like:
Thurs: RC is agreed on and packaged, an email is sent to
PHP_QA and PHP-DEV, the CVS is Branched and the
Release Cycle Begins.
Mon: After a weekends testing most show stoppers should
have been found (Hopefully) and the developers get to
work on fixing them.
Thurs: A second RC is released if needed with the new bug
fixes in and the QAers test again.
Sun: A review is made of all outstanding bugs and any show
stoppers should be fixed. if there are no show
stoppers then the final release is packaged and
released on the monday morning on php.net
Mon: Release is made.
James
--
James Moore
PHP QA Team
jmoore@php.net
+8 -40
View File
@@ -5,28 +5,21 @@ Zend
----
* allow foreach ($array as $k => &$val) syntax. right now we cannot
traverse an array without copying each element.
* allow foreach ($array as $k => list($a, $b)) syntax for multi
dimensional arrays.
* look at replacing c-lib call tolower().
* make hash API functions work with HASH_OF() to save time.
* native large number support (probably with GNU GMP)
* Const'ify APIs. Right now, many functions leave parameters untouched,
but don't declare those as const. This makes interaction with other
interfaces difficult which pass const parameters to us.
* add try..catch/throw exception handling
global
------
* when used in standalone (skell-script like) mode don't urldecode
arguments passed to php. right now it's not possible to say
/usr/local/bin/php somescript.php dog+cat.txt
as "dog+cat.txt" will arrive in php as "dog cat.txt".
* make everything on the language-level independent of your locale setings.
* always build the standalone executable as well as the chosen SAPI
target.
* make sure all source files have the "right" copyright.
* the following modules still use PHP3_TLS_*() macros (and thereby don't
work in ZTS mode): ext/db/db.c, ext/gd/gd.c
work in ZTS mode): ext/dav/dav.c, ext/db/db.c, ext/gd/gd.c, ext/ldap/ldap.c
* make sure that all ZTS globals get destructed. Most ts_allocate_id()
calls should have a dtor entry.
* activate all extensions by default that don't rely on external
@@ -55,16 +48,6 @@ documentation
-------------
* add remarks in the documentation which functions are not implemented on win32.
* add remarks in the documentation which functions are not binary-safe.
* improve documentation for the sablotron extension
* update curl documentation
* write documentation for the bzip2 extension
* write documentation for the zziplib extension
ext/curl
--------
* Use the cURL write handler to save data for use when returning data or outputting
data.
* Have a warning scheme for when people use unsupported features.
ext/dav
--------
@@ -74,43 +57,32 @@ ext/oci8
--------
* all OCIFetch*() functions should return 0 for no more data and false on error.
* have a flag that trims trailing spaces from CHAR fields on retrieval.
* make allow_call_time_pass_reference=Off working.
* for additional todo information, see oci8.c, in ext/oci8
* make allow_call_time_pass_reference=Off working.
ext/pcre
--------
* Allow user to set PCRE_NOTEMPTY, PCRE_ANCHORED at execution time, maybe
* add option to preg_grep() to return entries that _don't_ match
ext/sablot
----------
* Re-write the error handling and reporting interface
* Cleanup the underlying code a bit
* Add proper support for the message handlers
* update the online docs from version 3.1 man page
ext/session
-----------
* implement a call to set a session read-only to overcome
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
* provide a callback facility which is executed upon encountering
an unknown classname during deserialization
ext/sockets
-----------
* Make the extension work on windows (Daniel Beulshausen)
* Make the extension work with Solaris and the Sun GCC
ext/standard
------------
* array_mean()
* add a version number to data serialized via serialize().
* array_add(). (Andrei)
* possibly modify parsing of GPC data to automatically create arrays if
variable name is seen more than once.
* implement regex-cache for url-functions.
* stri_replace(). (Andrei)
* strcase_replace(). (Andrei)
* move socket related functions to fsock.c.
* get_defined_funcs(), get_defined_vars().
* NOT binary safe:
strtok()
basename()
@@ -121,10 +93,6 @@ ext/standard
* rewrite win32 SMTP code to be useable for *ix to, maybe as a (default)
module of its own (Hartmut)
ext/zziplib
------------
* more fully support the zziplib api
ext/wddx
--------
* See if we can support the remaining datatypes:
-29
View File
@@ -1,29 +0,0 @@
* Remove --with-openlink configure option (--with-iodbc replaces it).
* Always build CGI (--disable-cgi option to disable).
* Move most extensions and PEAR packages out of the PHP CVS tree,
include them again during release packaging.
* Renaming functions, so that they all are conform to one standard form.
* Allow foreach($array as $key => &$value).
* Allow foreach($array as list($var1, $var2)).
* Clean up "$instance = &new object" syntax (default to the =& behaviour?).
* Allow to set a default value for call-by-reference-parameters. eg:
function hallo (&$pallo = NULL) {}
* Change PHP error messages, so that they point to pages or sections in the
PHP Manual.
* Fix Zend shallow copy issues with objects and arrays.
* Make all extensions thread-safe.
* Finish PHP streams abstraction, nuke all that issock stuff, implement SSL
socket support. (wez)
- ext/ftp/ -> all FILEs to streams
- ext/bz2/ -> convert to stream impl.
+16 -60
View File
@@ -59,9 +59,6 @@ static void (*tsrm_new_thread_end_handler)();
/* Debug support */
int tsrm_error(int level, const char *format, ...);
/* Read a resource from a thread's resource storage */
void *ts_resource_read( tsrm_tls_entry *thread_resources, ts_rsrc_id id );
static int tsrm_error_level;
static FILE *tsrm_error_file;
#if TSRM_DEBUG
@@ -72,19 +69,11 @@ static FILE *tsrm_error_file;
#define TSRM_SAFE_ARRAY_OFFSET(array, offset, range) array[offset]
#endif
#if defined(PTHREADS)
/* Thread local storage */
static pthread_key_t tls_key;
#endif
/* Startup TSRM (call once for the entire process) */
TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)
{
#if defined(GNUPTH)
pth_init();
#elif defined(PTHREADS)
pthread_key_create( &tls_key, 0 );
#endif
tsrm_error_file = stderr;
@@ -152,8 +141,6 @@ TSRM_API void tsrm_shutdown(void)
}
#if defined(GNUPTH)
pth_kill();
#elif defined(PTHREADS)
pthread_key_delete( tls_key );
#endif
}
@@ -224,10 +211,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
(*thread_resources_ptr)->thread_id = thread_id;
(*thread_resources_ptr)->next = NULL;
#if defined(PTHREADS)
/* Set thread local storage to this new thread resources structure */
pthread_setspecific( tls_key, (void *)*thread_resources_ptr );
#endif
tsrm_mutex_unlock(tsmm_mutex);
if (tsrm_new_thread_begin_handler) {
tsrm_new_thread_begin_handler(thread_id);
@@ -238,9 +222,6 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
resource_types_table[i].ctor((*thread_resources_ptr)->storage[i]);
}
}
tsrm_mutex_unlock(tsmm_mutex);
if (tsrm_new_thread_end_handler) {
tsrm_new_thread_end_handler(thread_id);
}
@@ -253,25 +234,13 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
THREAD_T thread_id;
int hash_value;
tsrm_tls_entry *thread_resources;
void *resource;
if (!th_id) {
#if defined(PTHREADS)
/* Fast path for looking up the resources for the current
* thread. Its used by just about every call to
* ts_resource_ex(). This avoids the need for a mutex lock
* and our hashtable lookup.
*/
thread_resources = pthread_getspecific( tls_key );
if (thread_resources) {
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for current thread %d", id, (long) thread_resources->thread_id );
return ts_resource_read( thread_resources, id );
}
#endif
thread_id = tsrm_thread_id();
} else {
if (th_id) {
thread_id = *th_id;
} else {
thread_id = tsrm_thread_id();
}
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Fetching resource id %d for thread %ld", id, (long) thread_id);
tsrm_mutex_lock(tsmm_mutex);
@@ -280,7 +249,8 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
if (!thread_resources) {
allocate_new_resource(&tsrm_tls_table[hash_value], thread_id);
return ts_resource_ex(id, &thread_id);
return ts_resource(id);
/* thread_resources = tsrm_tls_table[hash_value]; */
} else {
do {
if (thread_resources->thread_id == thread_id) {
@@ -290,7 +260,7 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
thread_resources = thread_resources->next;
} else {
allocate_new_resource(&thread_resources->next, thread_id);
return ts_resource_ex(id, &thread_id);
return ts_resource(id);
/*
* thread_resources = thread_resources->next;
* break;
@@ -298,25 +268,15 @@ TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)
}
} while (thread_resources);
}
tsrm_mutex_unlock(tsmm_mutex);
return ts_resource_read( thread_resources, id );
}
/* Read a specific resource from the thread's resources.
* This is called outside of a mutex, so have to be aware about external
* changes to the structure as we read it.
*/
void *ts_resource_read( tsrm_tls_entry *thread_resources, ts_rsrc_id id )
{
void *resource;
resource = TSRM_SAFE_ARRAY_OFFSET(thread_resources->storage, TSRM_UNSHUFFLE_RSRC_ID(id), thread_resources->count);
tsrm_mutex_unlock(tsmm_mutex);
if (resource) {
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Successfully fetched resource id %d for thread id %ld - %x", id, (long) thread_resources->thread_id, (long) resource);
TSRM_ERROR(TSRM_ERROR_LEVEL_INFO, "Successfully fetched resource id %d for thread id %ld - %x", id, (long) thread_id, (long) resource);
} else {
TSRM_ERROR(TSRM_ERROR_LEVEL_ERROR, "Resource id %d is out of range (%d..%d)", id, TSRM_SHUFFLE_RSRC_ID(0), TSRM_SHUFFLE_RSRC_ID(thread_resources->count-1));
abort();
}
return resource;
}
@@ -325,10 +285,9 @@ void *ts_resource_read( tsrm_tls_entry *thread_resources, ts_rsrc_id id )
/* frees all resources allocated for the current thread */
void ts_free_thread(void)
{
tsrm_tls_entry *thread_resources;
int i;
THREAD_T thread_id = tsrm_thread_id();
int hash_value;
tsrm_tls_entry *thread_resources;
tsrm_tls_entry *last=NULL;
tsrm_mutex_lock(tsmm_mutex);
@@ -337,23 +296,20 @@ void ts_free_thread(void)
while (thread_resources) {
if (thread_resources->thread_id == thread_id) {
int i;
for (i=0; i<thread_resources->count; i++) {
if (resource_types_table[i].dtor) {
resource_types_table[i].dtor(thread_resources->storage[i]);
}
}
for (i=0; i<thread_resources->count; i++) {
free(thread_resources->storage[i]);
}
free(thread_resources->storage);
if (last) {
last->next = thread_resources->next;
} else {
tsrm_tls_table[hash_value] = thread_resources->next;
tsrm_tls_table[hash_value]=NULL;
}
#if defined(PTHREADS)
pthread_setspecific(tls_key, 0);
#endif
free(thread_resources);
break;
}
-37
View File
@@ -20,7 +20,6 @@ CFG=TSRM - Win32 Debug_TS
!MESSAGE "TSRM - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
!MESSAGE "TSRM - Win32 Release_TS" (based on "Win32 (x86) Static Library")
!MESSAGE "TSRM - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library")
!MESSAGE "TSRM - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
@@ -99,29 +98,6 @@ LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "TSRM - Win32 Release_TSDbg"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "TSRM___Win32_Release_TSDbg"
# PROP BASE Intermediate_Dir "TSRM___Win32_Release_TSDbg"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release_TSDbg"
# PROP Intermediate_Dir "Release_TSDbg"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "." /D "NDEBUG" /D "ZTS" /D "_LIB" /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /D TSRM_DEBUG=0 /YX /FD /c
# ADD BASE RSC /l 0x40d /d "NDEBUG"
# ADD RSC /l 0x40d /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
@@ -129,7 +105,6 @@ LIB32=link.exe -lib
# Name "TSRM - Win32 Debug_TS"
# Name "TSRM - Win32 Release_TS"
# Name "TSRM - Win32 Release_TS_inline"
# Name "TSRM - Win32 Release_TSDbg"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@@ -145,20 +120,12 @@ SOURCE=.\tsrm_strtok_r.c
SOURCE=.\tsrm_virtual_cwd.c
# End Source File
# Begin Source File
SOURCE=.\tsrm_win32.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\readdir.h
# End Source File
# Begin Source File
SOURCE=.\TSRM.h
# End Source File
# Begin Source File
@@ -177,10 +144,6 @@ SOURCE=.\tsrm_strtok_r.h
SOURCE=.\tsrm_virtual_cwd.h
# End Source File
# Begin Source File
SOURCE=.\tsrm_win32.h
# End Source File
# End Group
# End Target
# End Project
+10 -18
View File
@@ -33,7 +33,6 @@
#ifdef TSRM_WIN32
#include <io.h>
#include "tsrm_win32.h"
#endif
#define VIRTUAL_CWD_DEBUG 0
@@ -276,7 +275,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
if (path_length == 0)
return (0);
#if !defined(TSRM_WIN32) && !defined(__BEOS__)
#ifndef TSRM_WIN32
if (IS_ABSOLUTE_PATH(path, path_length)) {
if (realpath(path, resolved_path)) {
path = resolved_path;
@@ -314,10 +313,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
copy_amount = COPY_WHEN_ABSOLUTE;
is_absolute = 1;
#ifdef TSRM_WIN32
} else if (IS_UNC_PATH(path_copy, path_length)) {
copy_amount = 1;
is_absolute = 1;
} else if (IS_SLASH(path_copy[0])) {
} else if(IS_SLASH(path_copy[0])) {
copy_amount = 2;
#endif
}
@@ -364,16 +360,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
}
} else if (!IS_DIRECTORY_CURRENT(ptr, ptr_length)) {
state->cwd = (char *) realloc(state->cwd, state->cwd_length+ptr_length+1+1);
#ifdef TSRM_WIN32
/* Windows 9x will consider C:\\Foo as a network path. Avoid it. */
if (state->cwd[state->cwd_length-1]!=DEFAULT_SLASH) {
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
}
#else
state->cwd[state->cwd_length++] = DEFAULT_SLASH;
#endif
memcpy(&state->cwd[state->cwd_length], ptr, ptr_length+1);
state->cwd_length += ptr_length;
state->cwd[state->cwd_length] = DEFAULT_SLASH;
memcpy(&state->cwd[state->cwd_length+1], ptr, ptr_length+1);
state->cwd_length += (ptr_length+1);
}
ptr = tsrm_strtok_r(NULL, TOKENIZER_STRING, &tok);
}
@@ -746,8 +735,11 @@ CWD_API FILE *virtual_popen(const char *command, const char *type)
*ptr++ = ' ';
memcpy(ptr, command, command_length+1);
#ifdef TSRM_WIN32
retval = _popen(command_line, type);
#else
retval = popen(command_line, type);
#endif
free(command_line);
return retval;
}
@@ -774,7 +766,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type)
#endif
chdir(CWDG(cwd).cwd);
retval = popen(command, type);
retval = _popen(command, type);
chdir(prev_cwd);
#ifdef ZTS
+40 -42
View File
@@ -51,8 +51,6 @@ typedef unsigned short mode_t;
#define COPY_WHEN_ABSOLUTE 2
#define IS_ABSOLUTE_PATH(path, len) \
(len >= 2 && isalpha(path[0]) && path[1] == ':')
#define IS_UNC_PATH(path, len) \
(len >= 2 && IS_SLASH(path[0]) && IS_SLASH(path[1]))
#else
#ifdef HAVE_DIRENT_H
@@ -154,59 +152,59 @@ typedef struct _virtual_cwd_globals {
#ifdef VIRTUAL_DIR
#define VCWD_GETCWD(buff, size) virtual_getcwd(buff,size)
#define VCWD_FOPEN(path, mode) virtual_fopen(path, mode)
/* The VCWD_OPEN macro will need to be used as VCWD_OPEN((path, flags, ...)) */
#define VCWD_OPEN(open_args) virtual_open open_args
#define VCWD_CREAT(path, mode) virtual_creat(path, mode)
#define VCWD_CHDIR(path) virtual_chdir(path)
#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir)
#define VCWD_GETWD(buf)
#define VCWD_REALPATH(path,real_path) virtual_realpath(path,real_path)
#define VCWD_RENAME(oldname,newname) virtual_rename(oldname,newname)
#define VCWD_STAT(path, buff) virtual_stat(path, buff)
#define V_GETCWD(buff, size) virtual_getcwd(buff,size)
#define V_FOPEN(path, mode) virtual_fopen(path, mode)
/* The V_OPEN macro will need to be used as V_OPEN((path, flags, ...)) */
#define V_OPEN(open_args) virtual_open open_args
#define V_CREAT(path, mode) virtual_creat(path, mode)
#define V_CHDIR(path) virtual_chdir(path)
#define V_CHDIR_FILE(path) virtual_chdir_file(path, virtual_chdir)
#define V_GETWD(buf)
#define V_REALPATH(path,real_path) virtual_realpath(path,real_path)
#define V_RENAME(oldname,newname) virtual_rename(oldname,newname)
#define V_STAT(path, buff) virtual_stat(path, buff)
#ifdef TSRM_WIN32
#define VCWD_LSTAT(path, buff) virtual_stat(path, buff)
#define V_LSTAT(path, buff) virtual_stat(path, buff)
#else
#define VCWD_LSTAT(path, buff) virtual_lstat(path, buff)
#define V_LSTAT(path, buff) virtual_lstat(path, buff)
#endif
#define VCWD_UNLINK(path) virtual_unlink(path)
#define VCWD_MKDIR(pathname, mode) virtual_mkdir(pathname, mode)
#define VCWD_RMDIR(pathname) virtual_rmdir(pathname)
#define VCWD_OPENDIR(pathname) virtual_opendir(pathname)
#define VCWD_POPEN(command, type) virtual_popen(command, type)
#define V_UNLINK(path) virtual_unlink(path)
#define V_MKDIR(pathname, mode) virtual_mkdir(pathname, mode)
#define V_RMDIR(pathname) virtual_rmdir(pathname)
#define V_OPENDIR(pathname) virtual_opendir(pathname)
#define V_POPEN(command, type) virtual_popen(command, type)
#if HAVE_UTIME
#define VCWD_UTIME(path,time) virtual_utime(path,time)
#define V_UTIME(path,time) virtual_utime(path,time)
#endif
#define VCWD_CHMOD(path,mode) virtual_chmod(path,mode)
#define V_CHMOD(path,mode) virtual_chmod(path,mode)
#ifndef TSRM_WIN32
#define VCWD_CHOWN(path,owner,group) virtual_chown(path,owner,group)
#define V_CHOWN(path,owner,group) virtual_chown(path,owner,group)
#endif
#else
#define VCWD_GETCWD(buff, size) getcwd(buff,size)
#define VCWD_FOPEN(path, mode) fopen(path, mode)
#define VCWD_OPEN(open_args) open open_args
#define VCWD_CREAT(path, mode) creat(path, mode)
#define VCWD_RENAME(oldname,newname) rename(oldname,newname)
#define VCWD_CHDIR(path) chdir(path)
#define VCWD_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
#define VCWD_GETWD(buf) getwd(buf)
#define VCWD_STAT(path, buff) stat(path, buff)
#define VCWD_LSTAT(path, buff) lstat(path, buff)
#define VCWD_UNLINK(path) unlink(path)
#define VCWD_MKDIR(pathname, mode) mkdir(pathname, mode)
#define VCWD_RMDIR(pathname) rmdir(pathname)
#define VCWD_OPENDIR(pathname) opendir(pathname)
#define VCWD_POPEN(command, type) popen(command, type)
#define VCWD_REALPATH(path,real_path) realpath(path,real_path)
#define V_GETCWD(buff, size) getcwd(buff,size)
#define V_FOPEN(path, mode) fopen(path, mode)
#define V_OPEN(open_args) open open_args
#define V_CREAT(path, mode) creat(path, mode)
#define V_RENAME(oldname,newname) rename(oldname,newname)
#define V_CHDIR(path) chdir(path)
#define V_CHDIR_FILE(path) virtual_chdir_file(path, chdir)
#define V_GETWD(buf) getwd(buf)
#define V_STAT(path, buff) stat(path, buff)
#define V_LSTAT(path, buff) lstat(path, buff)
#define V_UNLINK(path) unlink(path)
#define V_MKDIR(pathname, mode) mkdir(pathname, mode)
#define V_RMDIR(pathname) rmdir(pathname)
#define V_OPENDIR(pathname) opendir(pathname)
#define V_POPEN(command, type) popen(command, type)
#define V_REALPATH(path,real_path) realpath(path,real_path)
#if HAVE_UTIME
#define VCWD_UTIME(path,time) utime(path,time)
#define V_UTIME(path,time) utime(path,time)
#endif
#define VCWD_CHMOD(path,mode) chmod(path,mode)
#define V_CHMOD(path,mode) chmod(path,mode)
#ifndef TSRM_WIN32
#define VCWD_CHOWN(path,owner,group) chown(path,owner,group)
#define V_CHOWN(path,owner,group) chown(path,owner,group)
#endif
#endif
-181
View File
@@ -1,181 +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: Daniel Beulshausen <daniel@php4win.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include <process.h>
#include "TSRM.h"
#ifdef TSRM_WIN32
#include <windows.h>
#include "tsrm_win32.h"
#ifdef ZTS
static ts_rsrc_id win32_globals_id;
#else
static tsrm_win32_globals win32_globals;
#endif
static void tsrm_win32_ctor(tsrm_win32_globals *globals)
{
globals->process = NULL;
globals->process_size = 0;
}
static void tsrm_win32_dtor(tsrm_win32_globals *globals)
{
if (globals->process != NULL) {
free(globals->process);
}
}
TSRM_API void tsrm_win32_startup(void)
{
#ifdef ZTS
win32_globals_id = ts_allocate_id(sizeof(tsrm_win32_globals), (ts_allocate_ctor)tsrm_win32_ctor, (ts_allocate_ctor)tsrm_win32_dtor);
#else
tsrm_win32_ctor(&win32_globals);
#endif
}
TSRM_API void tsrm_win32_shutdown(void)
{
#ifndef ZTS
tsrm_win32_dtor(&win32_globals);
#endif
}
static ProcessPair* process_get(FILE *stream)
{
ProcessPair* ptr;
ProcessPair* newptr;
TWLS_FETCH();
for (ptr = TWG(process); ptr < (TWG(process) + TWG(process_size)); ptr++) {
if (stream != NULL && ptr->stream == stream) {
break;
} else if (stream == NULL && !ptr->inuse) {
break;
}
}
if (ptr < (TWG(process) + TWG(process_size))) {
return ptr;
}
newptr = (ProcessPair*)realloc((void*)TWG(process), (TWG(process_size)+1)*sizeof(ProcessPair));
if (newptr == NULL) {
return NULL;
}
TWG(process) = newptr;
ptr = newptr + TWG(process_size);
TWG(process_size)++;
return ptr;
}
TSRM_API FILE* popen(const char *command, const char *type)
{
FILE *stream = NULL;
int fno, str_len = strlen(type), read, mode;
STARTUPINFO startup;
PROCESS_INFORMATION process;
SECURITY_ATTRIBUTES security;
HANDLE in, out;
ProcessPair *proc;
security.nLength = sizeof(SECURITY_ATTRIBUTES);
security.bInheritHandle = TRUE;
security.lpSecurityDescriptor = NULL;
if (!str_len || !CreatePipe(&in, &out, &security, 2048L)) {
return NULL;
}
memset(&startup, 0, sizeof(STARTUPINFO));
memset(&process, 0, sizeof(PROCESS_INFORMATION));
startup.cb = sizeof(STARTUPINFO);
startup.dwFlags = STARTF_USESTDHANDLES;
startup.hStdError = GetStdHandle(STD_ERROR_HANDLE);
read = (type[0] == 'r') ? TRUE : FALSE;
mode = ((str_len == 2) && (type[1] == 'b')) ? O_BINARY : O_TEXT;
if (read) {
startup.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
startup.hStdOutput = out;
} else {
startup.hStdInput = in;
startup.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
}
if (!CreateProcess(NULL, (LPTSTR)command, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS, NULL, NULL, &startup, &process)) {
return NULL;
}
CloseHandle(process.hThread);
proc = process_get(NULL);
if (read) {
fno = _open_osfhandle((long)in, _O_RDONLY | mode);
CloseHandle(out);
} else {
fno = _open_osfhandle((long)out, _O_WRONLY | mode);
CloseHandle(in);
}
stream = _fdopen(fno, type);
proc->prochnd = process.hProcess;
proc->stream = stream;
proc->inuse = 1;
return stream;
}
TSRM_API int pclose(FILE* stream)
{
DWORD termstat = 0;
ProcessPair* process;
if ((process = process_get(stream)) == NULL) {
return 0;
}
fflush(process->stream);
fclose(process->stream);
GetExitCodeProcess(process->prochnd, &termstat);
if (termstat == STILL_ACTIVE) {
TerminateProcess(process->prochnd, termstat);
}
process->stream = NULL;
process->inuse = 0;
CloseHandle(process->prochnd);
return termstat;
}
#endif
+1 -1
View File
@@ -1,6 +1,6 @@
---------------------------------------------------------------------------
The Zend License, version 0.92
Copyright (C) 1999-2001 Zend Technologies Ltd.
Copyright (C) 1999-2000 Zend Technologies Ltd.
---------------------------------------------------------------------------
The Zend scripting engine library is a product of Zend Technologies Ltd.
+9 -5
View File
@@ -215,7 +215,7 @@ SOURCE=.\FlexLexer.h
# End Source File
# Begin Source File
SOURCE=.\zend_modules.h
SOURCE=.\modules.h
# End Source File
# Begin Source File
@@ -330,7 +330,8 @@ InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -356,7 +357,8 @@ InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -373,7 +375,8 @@ InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -390,7 +393,8 @@ InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+3 -3
View File
@@ -19,7 +19,7 @@ AC_DEFUN(LIBZEND_BASIC_CHECKS,[
AC_REQUIRE([AC_PROG_YACC])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_CC_C_O])
AC_REQUIRE([AC_PROG_LEX])
AC_REQUIRE([AM_PROG_LEX])
AC_REQUIRE([AC_HEADER_STDC])
LIBZEND_BISON_CHECK
@@ -62,7 +62,7 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MEMCMP
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass)
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite)
AC_ZEND_BROKEN_SPRINTF
AC_CHECK_FUNCS(finite isfinite isinf isnan)
@@ -169,7 +169,7 @@ fi
changequote({,})
if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
INLINE_CFLAGS=`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9s]*//`
INLINE_CFLAGS=`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9]*//`
else
INLINE_CFLAGS="$CFLAGS"
fi
+5 -5
View File
@@ -30,7 +30,7 @@
".\zend_config.w32.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\modules.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
@@ -63,7 +63,7 @@
".\zend_constants.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\modules.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
@@ -110,7 +110,7 @@
".\zend_config.w32.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\modules.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
@@ -168,7 +168,7 @@
".\zend_constants.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\modules.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
".\zend_variables.h"\
@@ -200,7 +200,7 @@
".\zend_constants.h"\
".\zend_execute.h"\
".\zend_llist.h"\
".\zend_modules.h"\
".\modules.h"\
".\zend_operators.h"\
".\zend_ptr_stack.h"\
".\zend_stack.h"\
+15 -90
View File
@@ -4,7 +4,7 @@
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=ZendTS - Win32 Release_TSDbg
CFG=ZendTS - Win32 Release_TS_inline
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
@@ -13,14 +13,13 @@ CFG=ZendTS - Win32 Release_TSDbg
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "ZendTS.mak" CFG="ZendTS - Win32 Release_TSDbg"
!MESSAGE NMAKE /f "ZendTS.mak" CFG="ZendTS - Win32 Release_TS_inline"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ZendTS - Win32 Release_TS" (based on "Win32 (x86) Static Library")
!MESSAGE "ZendTS - Win32 Debug_TS" (based on "Win32 (x86) Static Library")
!MESSAGE "ZendTS - Win32 Release_TS_inline" (based on "Win32 (x86) Static Library")
!MESSAGE "ZendTS - Win32 Release_TSDbg" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
@@ -96,29 +95,6 @@ LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
# PROP BASE Use_MFC 0
# PROP BASE Output_Dir "ZendTS___Win32_Release_TSDbg"
# PROP BASE Intermediate_Dir "ZendTS___Win32_Release_TSDbg"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Output_Dir "Release_TSDbg"
# PROP Intermediate_Dir "Release_TSDbg"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I "." /D "NDebug_TS" /D ZEND_DEBUG=0 /D _WIN32_WINNT=0x400 /D "_LIB" /D "TSRM_EXPORTS" /D "LIBZEND_EXPORTS" /D "ZTS" /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x40d /d "NDebug_TS"
# ADD RSC /l 0x40d /d "NDebug_TS"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
@@ -126,7 +102,6 @@ LIB32=link.exe -lib
# Name "ZendTS - Win32 Release_TS"
# Name "ZendTS - Win32 Debug_TS"
# Name "ZendTS - Win32 Release_TS_inline"
# Name "ZendTS - Win32 Release_TSDbg"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@@ -244,7 +219,7 @@ SOURCE=.\FlexLexer.h
# End Source File
# Begin Source File
SOURCE=.\zend_modules.h
SOURCE=.\modules.h
# End Source File
# Begin Source File
@@ -332,10 +307,6 @@ SOURCE=.\zend_ini_scanner.h
# End Source File
# Begin Source File
SOURCE=.\zend_istdiostream.h
# End Source File
# Begin Source File
SOURCE=".\zend_language_parser.h"
# End Source File
# Begin Source File
@@ -381,7 +352,8 @@ InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -398,7 +370,8 @@ InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -415,7 +388,8 @@ InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p ini_ zend_ini_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_ini_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p ini_ zend_ini_parser.y \
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -425,22 +399,6 @@ BuildCmds= \
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
# Begin Custom Build
InputDir=.
InputPath=.\zend_ini_parser.y
BuildCmds= \
bison --output=zend_ini_parser.c -v -d -p ini_ zend_ini_parser.y
"$(InputDir)\zend_ini_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend_ini_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
@@ -455,7 +413,8 @@ InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -472,7 +431,8 @@ InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -489,7 +449,8 @@ InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y \
if not "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p zend zend_language_parser.y \
if "X%CYGWIN%"=="X" bison --output=zend_language_parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend_language_parser.y \
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
@@ -499,22 +460,6 @@ BuildCmds= \
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
# Begin Custom Build
InputDir=.
InputPath=".\zend_language_parser.y"
BuildCmds= \
bison --output=zend_language_parser.c -v -d -p zend zend_language_parser.y
"$(InputDir)\zend_language_parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(InputDir)\zend_language_parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
@@ -556,16 +501,6 @@ InputPath=.\zend_ini_scanner.l
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
# Begin Custom Build
InputPath=.\zend_ini_scanner.l
"zend_ini_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pini_ -ozend_ini_scanner.cpp zend_ini_scanner.l
# End Custom Build
!ENDIF
# End Source File
@@ -603,16 +538,6 @@ InputPath=".\zend_language_scanner.l"
# End Custom Build
!ELSEIF "$(CFG)" == "ZendTS - Win32 Release_TSDbg"
# Begin Custom Build
InputPath=".\zend_language_scanner.l"
"zend_language_scanner.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
flex -+ -B -i -Sflex.skl -Pzend -ozend_language_scanner.cpp zend_language_scanner.l
# End Custom Build
!ENDIF
# End Source File
-8
View File
@@ -19,10 +19,6 @@
# include <sys/types.h>
#endif
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#else
@@ -41,8 +37,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
#define zend_isnan(a) isnan(a)
#elif defined(NAN)
#define zend_isnan(a) (((a)==NAN)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#endif
@@ -52,8 +46,6 @@ int zend_sprintf(char *buffer, const char *format, ...);
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
/* A Lexical scanner generated by flex */
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header$
+26 -56
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -20,12 +20,11 @@
#include "zend.h"
#include "zend_extensions.h"
#include "zend_modules.h"
#include "modules.h"
#include "zend_constants.h"
#include "zend_list.h"
#include "zend_API.h"
#include "zend_builtin_functions.h"
#include "zend_ini.h"
#ifdef ZTS
# define GLOBAL_FUNCTION_TABLE global_function_table
@@ -52,7 +51,7 @@ ZEND_API void (*zend_ticks_function)(int ticks);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
static void (*zend_message_dispatcher_p)(long message, void *data);
static int (*zend_get_configuration_directive_p)(char *name, uint name_length, zval *contents);
static int (*zend_get_ini_entry_p)(char *name, uint name_length, zval *contents);
#ifdef ZTS
@@ -71,7 +70,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */
/* version information */
static char *zend_version_info;
static uint zend_version_info_length;
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2001 Zend Technologies\n"
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2000 Zend Technologies\n"
#define PRINT_ZVAL_INDENT 4
@@ -80,8 +79,7 @@ static void print_hash(HashTable *ht, int indent)
{
zval **tmp;
char *string_key;
HashPosition iterator;
unsigned long num_key, str_len;
unsigned long num_key;
int i;
for (i=0; i<indent; i++) {
@@ -89,15 +87,16 @@ static void print_hash(HashTable *ht, int indent)
}
ZEND_PUTS("(\n");
indent += PRINT_ZVAL_INDENT;
zend_hash_internal_pointer_reset_ex(ht, &iterator);
while (zend_hash_get_current_data_ex(ht, (void **) &tmp, &iterator) == SUCCESS) {
zend_hash_internal_pointer_reset(ht);
while (zend_hash_get_current_data(ht, (void **) &tmp) == SUCCESS) {
for (i=0; i<indent; i++) {
ZEND_PUTS(" ");
}
ZEND_PUTS("[");
switch (zend_hash_get_current_key_ex(ht, &string_key, &str_len, &num_key, 0, &iterator)) {
switch (zend_hash_get_current_key(ht, &string_key, &num_key)) {
case HASH_KEY_IS_STRING:
ZEND_PUTS(string_key);
efree(string_key);
break;
case HASH_KEY_IS_LONG:
zend_printf("%ld",num_key);
@@ -106,7 +105,7 @@ static void print_hash(HashTable *ht, int indent)
ZEND_PUTS("] => ");
zend_print_zval_r(*tmp, indent+PRINT_ZVAL_INDENT);
ZEND_PUTS("\n");
zend_hash_move_forward_ex(ht, &iterator);
zend_hash_move_forward(ht);
}
indent -= PRINT_ZVAL_INDENT;
for (i=0; i<indent; i++) {
@@ -301,10 +300,6 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals)
}
zend_init_rsrc_plist(ELS_C);
EG(lambda_count)=0;
EG(user_error_handler) = NULL;
#if SUPPORT_INTERACTIVE
EG(interactive) = 0;
#endif
}
@@ -312,7 +307,6 @@ static void executor_globals_dtor(zend_executor_globals *executor_globals)
{
zend_shutdown_constants(ELS_C);
zend_destroy_rsrc_plist(ELS_C);
zend_ini_shutdown(ELS_C);
}
@@ -328,17 +322,6 @@ static void alloc_globals_ctor(zend_alloc_globals *alloc_globals)
#include <floatingpoint.h>
#endif
#ifdef ZTS
static void zend_new_thread_end_handler(THREAD_T thread_id)
{
ELS_FETCH();
zend_copy_ini_directives(ELS_C);
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP ELS_CC);
}
#endif
int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions)
{
#ifdef ZTS
@@ -351,8 +334,18 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
#endif
#ifdef __FreeBSD__
/* FreeBSD floating point precision fix */
fpsetmask(0);
{
/* FreeBSD floating point precision fix */
#ifdef HAVE_FP_EXCEPT
fp_except
#else
fp_except_t
#endif
mask;
mask = fpgetmask();
fpsetmask(mask & ~FP_X_IMP);
}
#endif
zend_startup_extensions_mechanism();
@@ -368,7 +361,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_message_dispatcher_p = utility_functions->message_handler;
zend_block_interruptions = utility_functions->block_interruptions;
zend_unblock_interruptions = utility_functions->unblock_interruptions;
zend_get_configuration_directive_p = utility_functions->get_configuration_directive;
zend_get_ini_entry_p = utility_functions->get_ini_entry;
zend_ticks_function = utility_functions->ticks_function;
zend_compile_file = compile_file;
@@ -405,7 +398,6 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
#else
zend_startup_constants();
zend_set_default_compile_time_values(CLS_C);
EG(user_error_handler) = NULL;
#endif
zend_register_standard_constants(ELS_C);
@@ -417,12 +409,6 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_startup_builtin_functions();
}
zend_ini_startup(ELS_C);
#ifdef ZTS
tsrm_set_new_thread_end_handler(zend_new_thread_end_handler);
#endif
return SUCCESS;
}
@@ -470,7 +456,6 @@ ZEND_API void zend_bailout()
ELS_FETCH();
CG(unclean_shutdown) = 1;
CG(in_compilation) = EG(in_execution) = 0;
longjmp(EG(bailout), FAILURE);
}
END_EXTERN_C()
@@ -542,9 +527,6 @@ void zend_deactivate(CLS_D ELS_DC)
if (setjmp(EG(bailout))==0) {
shutdown_compiler(CLS_C);
}
if (setjmp(EG(bailout))==0) {
zend_ini_deactivate(ELS_C);
}
}
@@ -558,10 +540,10 @@ ZEND_API void zend_message_dispatcher(long message, void *data)
END_EXTERN_C()
ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents)
ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents)
{
if (zend_get_configuration_directive_p) {
return zend_get_configuration_directive_p(name, name_length, contents);
if (zend_get_ini_entry_p) {
return zend_get_ini_entry_p(name, name_length, contents);
} else {
return FAILURE;
}
@@ -700,10 +682,6 @@ ZEND_API void zend_error(int type, const char *format, ...)
}
va_end(args);
if (type==E_PARSE) {
zend_init_compiler_data_structures(CLS_C);
}
}
@@ -738,7 +716,6 @@ 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;
zend_op_array *orig_op_array = EG(active_op_array);
va_start(files, file_count);
for (i=0; i<file_count; i++) {
@@ -757,12 +734,10 @@ ZEND_API int zend_execute_scripts(int type CLS_DC ELS_DC, int file_count, ...)
efree(EG(active_op_array));
} else if (type==ZEND_REQUIRE) {
va_end(files);
EG(active_op_array) = orig_op_array;
return FAILURE;
}
}
va_end(files);
EG(active_op_array) = orig_op_array;
return SUCCESS;
}
@@ -793,8 +768,3 @@ ZEND_API char *zend_make_compiled_string_description(char *name)
return compiled_string_description;
}
void free_estring(char **str_p)
{
efree(*str_p);
}
+6 -22
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,7 +21,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "1.0.6"
#define ZEND_VERSION "1.0.3"
#ifdef __cplusplus
#define BEGIN_EXTERN_C() extern "C" {
@@ -39,10 +39,8 @@
#ifdef ZEND_WIN32
# include "zend_config.w32.h"
# define ZEND_PATHS_SEPARATOR ';'
#else
# include "zend_config.h"
# define ZEND_PATHS_SEPARATOR ':'
#endif
/* all HAVE_XXX test have to be after the include of zend_config above */
@@ -140,18 +138,6 @@ typedef unsigned int zend_uint;
typedef unsigned long zend_ulong;
typedef unsigned short zend_ushort;
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef LONG_MAX
#define LONG_MAX 2147483647L
#endif
#ifndef LONG_MIN
#define LONG_MIN (- LONG_MAX - 1)
#endif
#undef SUCCESS
#undef FAILURE
#define SUCCESS 0
@@ -246,7 +232,7 @@ typedef struct _zend_utility_functions {
void (*message_handler)(long message, void *data);
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
int (*get_configuration_directive)(char *name, uint name_length, zval *contents);
int (*get_ini_entry)(char *name, uint name_length, zval *contents);
void (*ticks_function)(int ticks);
} zend_utility_functions;
@@ -321,8 +307,6 @@ ZEND_API void zend_output_debug_string(zend_bool trigger_break, char *format, ..
ZEND_API extern char *empty_string;
ZEND_API void free_estring(char **str_p);
#define STR_FREE(ptr) if (ptr && ptr!=empty_string) { efree(ptr); }
#define STR_FREE_REL(ptr) if (ptr && ptr!=empty_string) { efree_rel(ptr); }
@@ -370,7 +354,7 @@ BEGIN_EXTERN_C()
ZEND_API void zend_message_dispatcher(long message, void *data);
END_EXTERN_C()
ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval *contents);
ZEND_API int zend_get_ini_entry(char *name, uint name_length, zval *contents);
/* Messages for applications of Zend */
@@ -445,14 +429,14 @@ ZEND_API int zend_get_configuration_directive(char *name, uint name_length, zval
refcount = (*ppzv_dest)->refcount; \
zval_dtor(*ppzv_dest); \
**ppzv_dest = *pzv_src; \
if (copy) { \
if(copy) { \
zval_copy_ctor(*ppzv_dest); \
} \
(*ppzv_dest)->is_ref = is_ref; \
(*ppzv_dest)->refcount = refcount; \
}
#define ZEND_MAX_RESERVED_RESOURCES 4
#define ZEND_MAX_RESERVED_RESOURCES 2
#ifdef ZEND_WIN32
/* Only use this macro if you know for sure that all of the switches values
+281 -308
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,7 +21,7 @@
#include "zend.h"
#include "zend_execute.h"
#include "zend_API.h"
#include "zend_modules.h"
#include "modules.h"
#include "zend_constants.h"
#ifdef HAVE_STDARG_H
@@ -227,82 +227,95 @@ ZEND_API inline int add_assoc_function(zval *arg, char *key,void (*function_ptr)
}
ZEND_API inline int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n)
ZEND_API inline int add_assoc_long(zval *arg, char *key, long n)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_LONG;
tmp->value.lval = n;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_null_ex(zval *arg, char *key, uint key_len)
ZEND_API inline int add_assoc_unset(zval *arg, char *key)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_NULL;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
ZEND_API inline int add_assoc_bool(zval *arg, char *key, int b)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_BOOL;
tmp->value.lval = b;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
ZEND_API inline int add_assoc_resource(zval *arg, char *key, int r)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
ZEND_API inline int add_assoc_double(zval *arg, char *key, double d)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate)
ZEND_API inline int add_assoc_string(zval *arg, char *key, char *str, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate)
ZEND_API inline int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value)
{
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = length;
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
@@ -310,136 +323,151 @@ ZEND_API inline int add_index_long(zval *arg, uint index, long n)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_LONG;
tmp->value.lval = n;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}
ZEND_API inline int add_index_null(zval *arg, uint index)
ZEND_API inline int add_index_unset(zval *arg, uint index)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_NULL;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_index_bool(zval *arg, uint index, int b)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_BOOL;
tmp->value.lval = b;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}
ZEND_API inline int add_index_resource(zval *arg, uint index, int r)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}
ZEND_API inline int add_index_double(zval *arg, uint index, double d)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}
ZEND_API inline int add_index_string(zval *arg, uint index, char *str, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_index_stringl(zval *arg, uint index, char *str, uint length, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_index_zval(zval *arg, uint index, zval *value)
{
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &value, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = length;
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),NULL);
}
ZEND_API inline int add_next_index_long(zval *arg, long n)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_LONG;
tmp->value.lval = n;
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_next_index_null(zval *arg)
ZEND_API inline int add_next_index_unset(zval *arg)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_NULL;
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_next_index_bool(zval *arg, int b)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_BOOL;
tmp->value.lval = b;
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_next_index_resource(zval *arg, int r)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_RESOURCE;
tmp->value.lval = r;
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_next_index_double(zval *arg, double d)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *), NULL);
}
@@ -447,10 +475,16 @@ ZEND_API inline int add_next_index_string(zval *arg, char *str, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *),NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *),NULL);
}
@@ -458,162 +492,201 @@ ZEND_API inline int add_next_index_stringl(zval *arg, char *str, uint length, in
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *),NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = length;
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_next_index_insert(arg->value.ht, &tmp, sizeof(zval *),NULL);
}
ZEND_API inline int add_next_index_zval(zval *arg, zval *value)
{
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &value, sizeof(zval *), NULL);
}
ZEND_API inline int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate)
ZEND_API inline int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API inline int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate)
ZEND_API inline int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
return zend_hash_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = length;
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.ht, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API inline int add_get_index_long(zval *arg, uint index, long l, void **dest)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, l);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
ALLOC_ZVAL(tmp);
tmp->type = IS_LONG;
tmp->value.lval = l;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),dest);
}
ZEND_API inline int add_get_index_double(zval *arg, uint index, double d, void **dest)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
ALLOC_ZVAL(tmp);
tmp->type = IS_DOUBLE;
tmp->value.dval= d;
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),dest);
}
ZEND_API inline int add_get_index_string(zval *arg, uint index, char *str, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *),dest);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),dest);
}
ZEND_API inline int add_get_index_stringl(zval *arg, uint index, char *str, uint length, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = length;
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_index_update(arg->value.ht, index, (void *) &tmp, sizeof(zval *),dest);
}
ZEND_API inline int add_property_long_ex(zval *arg, char *key, uint key_len, long n)
ZEND_API inline int add_property_long(zval *arg, char *key, long n)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_LONG;
tmp->value.lval = n;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_bool_ex(zval *arg, char *key, uint key_len, int b)
ZEND_API inline int add_property_bool(zval *arg, char *key, int b)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_BOOL;
tmp->value.lval = b;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_null_ex(zval *arg, char *key, uint key_len)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_resource_ex(zval *arg, char *key, uint key_len, long n)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, n);
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_double_ex(zval *arg, char *key, uint key_len, double d)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate)
ZEND_API inline int add_property_unset(zval *arg, char *key)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_NULL;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate)
ZEND_API inline int add_property_resource(zval *arg, char *key, long n)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
ALLOC_ZVAL(tmp);
tmp->type = IS_RESOURCE;
tmp->value.lval = n;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value)
ZEND_API inline int add_property_double(zval *arg, char *key, double d)
{
return zend_hash_update(Z_OBJPROP_P(arg), key, key_len, (void *) &value, sizeof(zval *), NULL);
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->type = IS_DOUBLE;
tmp->value.dval = d;
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_string(zval *arg, char *key, char *str, int duplicate)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = strlen(str);
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API inline int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->type = IS_STRING;
tmp->value.str.len = length;
if (duplicate) {
tmp->value.str.val = estrndup(str,tmp->value.str.len);
} else {
tmp->value.str.val = str;
}
INIT_PZVAL(tmp);
return zend_hash_update(arg->value.obj.properties, key, strlen(key)+1, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int zend_startup_module(zend_module_entry *module)
{
if (module) {
@@ -873,7 +946,7 @@ ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
symbol->is_ref = is_ref;
va_start(symbol_table_list, num_symbol_tables);
while (num_symbol_tables-- > 0) {
while(num_symbol_tables-- > 0) {
symbol_table = va_arg(symbol_table_list, HashTable *);
zend_hash_update(symbol_table, name, name_length + 1, &symbol, sizeof(zval *), NULL);
zval_add_ref(&symbol);
@@ -909,103 +982,3 @@ ZEND_API int zend_disable_function(char *function_name, uint function_name_lengt
disabled_function[0].fname = function_name;
return zend_register_functions(disabled_function, CG(function_table), MODULE_PERSISTENT);
}
zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name)
{
char *lcname;
int retval = 0;
ELS_FETCH();
switch (Z_TYPE_P(callable)) {
case IS_STRING:
if (callable_name)
*callable_name = estrndup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
if (syntax_only)
return 1;
lcname = estrndup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
zend_str_tolower(lcname, Z_STRLEN_P(callable));
if (zend_hash_exists(EG(function_table), lcname, Z_STRLEN_P(callable)+1))
retval = 1;
efree(lcname);
break;
case IS_ARRAY:
{
zval **method;
zval **obj;
zend_class_entry *ce = NULL;
char callable_name_len;
if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2 &&
zend_hash_index_find(Z_ARRVAL_P(callable), 0, (void **) &obj) == SUCCESS &&
zend_hash_index_find(Z_ARRVAL_P(callable), 1, (void **) &method) == SUCCESS &&
(Z_TYPE_PP(obj) == IS_OBJECT || Z_TYPE_PP(obj) == IS_STRING) &&
Z_TYPE_PP(method) == IS_STRING) {
if (Z_TYPE_PP(obj) == IS_STRING) {
if (callable_name) {
char *ptr;
callable_name_len = Z_STRLEN_PP(obj) + Z_STRLEN_PP(method) + sizeof("::");
ptr = *callable_name = emalloc(callable_name_len);
memcpy(ptr, Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
ptr += Z_STRLEN_PP(obj);
memcpy(ptr, "::", sizeof("::") - 1);
ptr += sizeof("::") - 1;
memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1);
}
if (syntax_only)
return 1;
lcname = estrndup(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
zend_str_tolower(lcname, Z_STRLEN_PP(obj));
zend_hash_find(EG(class_table), lcname, Z_STRLEN_PP(obj) + 1, (void**)&ce);
efree(lcname);
} else {
ce = Z_OBJCE_PP(obj);
if (callable_name) {
char *ptr;
callable_name_len = ce->name_length + Z_STRLEN_PP(method) + sizeof("::");
ptr = *callable_name = emalloc(callable_name_len);
memcpy(ptr, ce->name, ce->name_length);
ptr += ce->name_length;
memcpy(ptr, "::", sizeof("::") - 1);
ptr += sizeof("::") - 1;
memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1);
}
if (syntax_only)
return 1;
}
if (ce) {
lcname = estrndup(Z_STRVAL_PP(method), Z_STRLEN_PP(method));
zend_str_tolower(lcname, Z_STRLEN_PP(method));
if (zend_hash_exists(&ce->function_table, lcname, Z_STRLEN_PP(method)+1))
retval = 1;
efree(lcname);
}
} else if (callable_name)
*callable_name = estrndup("Array", sizeof("Array")-1);
}
break;
default:
if (callable_name) {
zval expr_copy;
int use_copy;
zend_make_printable_zval(callable, &expr_copy, &use_copy);
*callable_name = estrndup(Z_STRVAL(expr_copy), Z_STRLEN(expr_copy));
zval_dtor(&expr_copy);
}
break;
}
return retval;
}
+24 -61
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,7 +21,7 @@
#ifndef ZEND_API_H
#define ZEND_API_H
#include "zend_modules.h"
#include "modules.h"
#include "zend_list.h"
#include "zend_fast_cache.h"
#include "zend_operators.h"
@@ -63,18 +63,14 @@
#ifdef ZTS
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
ts_rsrc_id module_name##_globals_id;
#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \
extern ts_rsrc_id module_name##_globals_id;
static ts_rsrc_id module_name##_globals_id;
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
module_name##_globals_id = ts_allocate_id(sizeof(zend_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
#else
#define ZEND_DECLARE_MODULE_GLOBALS(module_name) \
zend_##module_name##_globals module_name##_globals;
#define ZEND_EXTERN_MODULE_GLOBALS(module_name) \
extern zend_##module_name##_globals module_name##_globals;
static zend_##module_name##_globals module_name##_globals;
#define ZEND_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
globals_ctor(&module_name##_globals);
@@ -124,7 +120,6 @@ ZEND_API zend_module_entry *zend_get_module(int module_number);
ZEND_API int zend_disable_function(char *function_name, uint function_name_length);
ZEND_API void wrong_param_count(void);
ZEND_API zend_bool zend_is_callable(zval *callable, zend_bool syntax_only, char **callable_name);
#define getThis() (this_ptr)
@@ -151,79 +146,47 @@ ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
/* no longer supported */
ZEND_API int add_assoc_function(zval *arg, char *key,void (*function_ptr)(INTERNAL_FUNCTION_PARAMETERS));
ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n);
ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len);
ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b);
ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r);
ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d);
ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate);
ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate);
ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
#define add_assoc_resource(__arg, __key, __r) add_assoc_resource_ex(__arg, __key, strlen(__key)+1, __r)
#define add_assoc_double(__arg, __key, __d) add_assoc_double_ex(__arg, __key, strlen(__key)+1, __d)
#define add_assoc_string(__arg, __key, __str, __duplicate) add_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
#define add_assoc_stringl(__arg, __key, __str, __length, __duplicate) add_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
#define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
/* unset() functions are only suported for legacy modules and null() functions should be used */
#define add_assoc_unset(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
#define add_index_unset(__arg, __key) add_index_null(__arg, __key)
#define add_next_index_unset(__arg) add_next_index_null(__arg)
#define add_property_unset(__arg, __key) add_property_null(__arg, __key)
ZEND_API int add_assoc_long(zval *arg, char *key, long n);
ZEND_API int add_assoc_unset(zval *arg, char *key);
ZEND_API int add_assoc_bool(zval *arg, char *key, int b);
ZEND_API int add_assoc_resource(zval *arg, char *key, int r);
ZEND_API int add_assoc_double(zval *arg, char *key, double d);
ZEND_API int add_assoc_string(zval *arg, char *key, char *str, int duplicate);
ZEND_API int add_assoc_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
ZEND_API int add_index_long(zval *arg, uint idx, long n);
ZEND_API int add_index_null(zval *arg, uint idx);
ZEND_API int add_index_unset(zval *arg, uint idx);
ZEND_API int add_index_bool(zval *arg, uint idx, int b);
ZEND_API int add_index_resource(zval *arg, uint idx, int r);
ZEND_API int add_index_double(zval *arg, uint idx, double d);
ZEND_API int add_index_string(zval *arg, uint idx, char *str, int duplicate);
ZEND_API int add_index_stringl(zval *arg, uint idx, char *str, uint length, int duplicate);
ZEND_API int add_index_zval(zval *arg, uint index, zval *value);
ZEND_API int add_next_index_long(zval *arg, long n);
ZEND_API int add_next_index_null(zval *arg);
ZEND_API int add_next_index_unset(zval *arg);
ZEND_API int add_next_index_bool(zval *arg, int b);
ZEND_API int add_next_index_resource(zval *arg, int r);
ZEND_API int add_next_index_double(zval *arg, double d);
ZEND_API int add_next_index_string(zval *arg, char *str, int duplicate);
ZEND_API int add_next_index_stringl(zval *arg, char *str, uint length, int duplicate);
ZEND_API int add_next_index_zval(zval *arg, zval *value);
ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate);
ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate);
#define add_get_assoc_string(__arg, __key, __str, __dest, __duplicate) add_get_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __dest, __duplicate)
#define add_get_assoc_stringl(__arg, __key, __str, __length, __dest, __duplicate) add_get_assoc_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __dest, __duplicate)
ZEND_API int add_get_index_long(zval *arg, uint idx, long l, void **dest);
ZEND_API int add_get_index_double(zval *arg, uint idx, double d, void **dest);
ZEND_API int add_get_assoc_string(zval *arg, char *key, char *str, void **dest, int duplicate);
ZEND_API int add_get_assoc_stringl(zval *arg, char *key, char *str, uint length, void **dest, int duplicate);
ZEND_API int add_get_index_string(zval *arg, uint idx, char *str, void **dest, int duplicate);
ZEND_API int add_get_index_stringl(zval *arg, uint idx, char *str, uint length, void **dest, int duplicate);
ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long l);
ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len);
ZEND_API int add_property_bool_ex(zval *arg, char *key, uint key_len, int b);
ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long r);
ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d);
ZEND_API int add_property_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate);
ZEND_API int add_property_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate);
ZEND_API int add_property_zval_ex(zval *arg, char *key, uint key_len, zval *value);
ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n)
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1)
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b)
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r)
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d)
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value)
ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[]);
ZEND_API int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table);
ZEND_API int add_property_long(zval *arg, char *key, long l);
ZEND_API int add_property_unset(zval *arg, char *key);
ZEND_API int add_property_bool(zval *arg, char *key, int b);
ZEND_API int add_property_resource(zval *arg, char *key, long r);
ZEND_API int add_property_double(zval *arg, char *key, double d);
ZEND_API int add_property_string(zval *arg, char *key, char *str, int duplicate);
ZEND_API int add_property_stringl(zval *arg, char *key, char *str, uint length, int duplicate);
ZEND_API int zend_set_hash_symbol(zval *symbol, char *name, int name_length,
int is_ref, int num_symbol_tables, ...);
+70 -74
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -41,9 +41,10 @@ ZEND_API zend_alloc_globals alloc_globals;
#if ZEND_DEBUG
# define END_MAGIC_SIZE sizeof(long)
static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
# define END_ALIGNMENT(size) (((size)%PLATFORM_ALIGNMENT)?(PLATFORM_ALIGNMENT-((size)%PLATFORM_ALIGNMENT)):0)
#else
# define END_MAGIC_SIZE 0
# define END_ALIGNMENT(size) 0
#endif
@@ -105,9 +106,9 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
} \
p->pLast = (zend_mem_header *) NULL;
#define DECLARE_CACHE_VARS() \
#define DECLARE_CACHE_VARS \
unsigned int real_size; \
unsigned int cache_index
unsigned int cache_index;
#define REAL_SIZE(size) ((size+7) & ~0x7)
@@ -122,7 +123,7 @@ static long mem_block_end_magic = MEM_BLOCK_END_MAGIC;
ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
zend_mem_header *p;
DECLARE_CACHE_VARS();
DECLARE_CACHE_VARS
ALS_FETCH();
CALCULATE_REAL_SIZE_AND_CACHE_INDEX(size);
@@ -140,19 +141,21 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
* from this thread's cache
*/
AG(cache_stats)[CACHE_INDEX][1]++;
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
#endif
p->persistent = 0;
p->cached = 0;
p->size = size;
return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING);
HANDLE_BLOCK_INTERRUPTIONS();
ADD_POINTER_TO_LIST(p);
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *)((char *)p + sizeof(zend_mem_header) + PLATFORM_PADDING);
} else {
#if ZEND_DEBUG
if (CACHE_INDEX<MAX_CACHED_MEMORY) {
AG(cache_stats)[CACHE_INDEX][0]++;
}
#endif
p = (zend_mem_header *) malloc(sizeof(zend_mem_header) + MEM_HEADER_PADDING + SIZE + END_MAGIC_SIZE);
p = (zend_mem_header *) malloc(sizeof(zend_mem_header) + SIZE + PLATFORM_PADDING + END_ALIGNMENT(SIZE) + END_MAGIC_SIZE);
}
HANDLE_BLOCK_INTERRUPTIONS();
@@ -180,20 +183,20 @@ ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
# ifdef ZTS
p->thread_id = tsrm_thread_id();
# endif
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
*((long *)(((char *) p) + sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE))) = MEM_BLOCK_END_MAGIC;
#endif
#if MEMORY_LIMIT
CHECK_MEMORY_LIMIT(size, SIZE);
#endif
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING);
return (void *)((char *)p + sizeof(zend_mem_header) + PLATFORM_PADDING);
}
ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - MEM_HEADER_PADDING);
DECLARE_CACHE_VARS();
zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - PLATFORM_PADDING);
DECLARE_CACHE_VARS
ALS_FETCH();
#if defined(ZTS) && ZEND_DEBUG
@@ -210,7 +213,7 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
if (!_mem_block_check(ptr, 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
return;
}
memset(ptr, 0x5a, p->size);
memset(ptr, 0x5a, SIZE);
#endif
if (!ZEND_DISABLE_MEMORY_CACHE
@@ -220,6 +223,9 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
#if ZEND_DEBUG
p->magic = MEM_BLOCK_CACHED_MAGIC;
#endif
HANDLE_BLOCK_INTERRUPTIONS();
REMOVE_POINTER_FROM_LIST(p);
HANDLE_UNBLOCK_INTERRUPTIONS();
return;
}
HANDLE_BLOCK_INTERRUPTIONS();
@@ -237,7 +243,7 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
void *p;
int final_size = size*nmemb;
int final_size=size*nmemb;
HANDLE_BLOCK_INTERRUPTIONS();
p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
@@ -245,7 +251,7 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *) p;
}
memset(p, 0, final_size);
memset(p,(int)NULL, final_size);
HANDLE_UNBLOCK_INTERRUPTIONS();
return p;
}
@@ -253,17 +259,15 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
zend_mem_header *p;
zend_mem_header *orig;
DECLARE_CACHE_VARS();
zend_mem_header *p = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-PLATFORM_PADDING);
zend_mem_header *orig = p;
DECLARE_CACHE_VARS
ALS_FETCH();
if (!ptr) {
return _emalloc(size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
p = orig = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-MEM_HEADER_PADDING);
#if defined(ZTS) && ZEND_DEBUG
if (p->thread_id != tsrm_thread_id()) {
void *new_p;
@@ -281,7 +285,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
HANDLE_BLOCK_INTERRUPTIONS();
REMOVE_POINTER_FROM_LIST(p);
p = (zend_mem_header *) realloc(p,sizeof(zend_mem_header)+MEM_HEADER_PADDING+SIZE+END_MAGIC_SIZE);
p = (zend_mem_header *) realloc(p,sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE)+END_MAGIC_SIZE);
if (!p) {
if (!allow_failure) {
fprintf(stderr,"FATAL: erealloc(): Unable to allocate %ld bytes\n", (long) size);
@@ -300,7 +304,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
p->filename = __zend_filename;
p->lineno = __zend_lineno;
p->magic = MEM_BLOCK_START_MAGIC;
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
*((long *)(((char *) p) + sizeof(zend_mem_header)+SIZE+PLATFORM_PADDING+END_ALIGNMENT(SIZE))) = MEM_BLOCK_END_MAGIC;
#endif
#if MEMORY_LIMIT
CHECK_MEMORY_LIMIT(size - p->size, SIZE - REAL_SIZE(p->size));
@@ -308,7 +312,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
p->size = size;
HANDLE_UNBLOCK_INTERRUPTIONS();
return (void *)((char *)p+sizeof(zend_mem_header)+MEM_HEADER_PADDING);
return (void *)((char *)p+sizeof(zend_mem_header)+PLATFORM_PADDING);
}
@@ -325,7 +329,7 @@ ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
return (char *)NULL;
}
HANDLE_UNBLOCK_INTERRUPTIONS();
memcpy(p, s, length);
memcpy(p,s,length);
return p;
}
@@ -341,8 +345,8 @@ ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_
return (char *)NULL;
}
HANDLE_UNBLOCK_INTERRUPTIONS();
memcpy(p, s, length);
p[length] = 0;
memcpy(p,s,length);
p[length]=0;
return p;
}
@@ -356,9 +360,9 @@ ZEND_API char *zend_strndup(const char *s, uint length)
return (char *)NULL;
}
if (length) {
memcpy(p, s, length);
memcpy(p,s,length);
}
p[length] = 0;
p[length]=0;
return p;
}
@@ -386,15 +390,14 @@ ZEND_API void start_memory_manager(ALS_D)
AG(phead) = AG(head) = NULL;
#if MEMORY_LIMIT
AG(memory_limit) = 1<<30; /* rediculous limit, effectively no limit */
AG(allocated_memory) = 0;
AG(memory_exhausted) = 0;
AG(memory_limit)=1<<30; /* rediculous limit, effectively no limit */
AG(allocated_memory)=0;
AG(memory_exhausted)=0;
#endif
memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head)));
memset(AG(cache_count), 0, sizeof(AG(cache_count)));
memset(AG(cache_count),0,sizeof(AG(cache_count)));
#if 0
#ifndef ZTS
/* Initialize cache, to prevent fragmentation */
/* We can't do this in ZTS mode, because calling emalloc() from within start_memory_manager()
@@ -411,7 +414,6 @@ ZEND_API void start_memory_manager(ALS_D)
}
}
#endif
#endif
#if ZEND_DEBUG
memset(AG(cache_stats), 0, sizeof(AG(cache_stats)));
@@ -425,7 +427,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
zend_mem_header *p, *t;
unsigned int fci, i, j;
#if ZEND_DEBUG
int had_leaks = 0;
int had_leaks=0;
#endif
zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry;
ALS_FETCH();
@@ -440,29 +442,16 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
AG(fast_cache_list_head)[fci] = NULL;
}
if (1 || clean_cache) {
zend_mem_header *ptr;
for (i=1; i<MAX_CACHED_MEMORY; i++) {
for (j=0; j<AG(cache_count)[i]; j++) {
ptr = (zend_mem_header *) AG(cache)[i][j];
REMOVE_POINTER_FROM_LIST(ptr);
free(ptr);
}
AG(cache_count)[i] = 0;
}
}
p = AG(head);
t = AG(head);
p=AG(head);
t=AG(head);
while (t) {
if (!t->cached) {
if (!t->cached || clean_cache) {
#if ZEND_DEBUG
if (!t->cached && !t->reported) {
zend_mem_header *iterator;
int total_leak=0, total_leak_count=0;
had_leaks = 1;
had_leaks=1;
if (!silent) {
zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, t);
}
@@ -493,6 +482,13 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
}
}
if(clean_cache) {
for (i=1; i<MAX_CACHED_MEMORY; i++) {
for (j=0; j<AG(cache_count)[i]; j++) {
free(AG(cache)[i][j]);
}
}
}
#if MEMORY_LIMIT
AG(memory_exhausted)=0;
#endif
@@ -506,7 +502,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache)
/* we're shutting down completely, don't even touch the INI subsystem */
break;
}
if (zend_get_configuration_directive("display_memory_cache_stats", sizeof("display_memory_cache_stats"), &display_memory_cache_stats)==FAILURE) {
if (zend_get_ini_entry("display_memory_cache_stats", sizeof("display_memory_cache_stats"), &display_memory_cache_stats)==FAILURE) {
break;
}
if (!atoi(display_memory_cache_stats.value.str.val)) {
@@ -559,19 +555,18 @@ void zend_debug_alloc_output(char *format, ...)
ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - MEM_HEADER_PADDING);
zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - PLATFORM_PADDING);
int no_cache_notice=0;
int valid_beginning=1;
int had_problems=0;
long end_magic;
if (silent==2) {
silent = 1;
no_cache_notice = 1;
silent=1;
no_cache_notice=1;
}
if (silent==3) {
silent = 0;
no_cache_notice = 1;
silent=0;
no_cache_notice=1;
}
if (!silent) {
zend_message_dispatcher(ZMSG_LOG_SCRIPT_NAME, NULL);
@@ -592,7 +587,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
case MEM_BLOCK_FREED_MAGIC:
if (!silent) {
zend_debug_alloc_output("Freed\n");
had_problems = 1;
had_problems=1;
} else {
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
@@ -601,7 +596,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
if (!silent) {
if (!no_cache_notice) {
zend_debug_alloc_output("Cached (allocated on %s:%d, %d bytes)\n", p->filename, p->lineno, p->size);
had_problems = 1;
had_problems=1;
}
} else {
if (!no_cache_notice) {
@@ -615,24 +610,24 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
} else {
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
had_problems = 1;
valid_beginning = 0;
had_problems=1;
valid_beginning=0;
break;
}
memcpy(&end_magic, (((char *) p)+sizeof(zend_mem_header)+MEM_HEADER_PADDING+p->size), sizeof(long));
if (valid_beginning && (end_magic != MEM_BLOCK_END_MAGIC)) {
char *overflow_ptr, *magic_ptr=(char *) &mem_block_end_magic;
if (valid_beginning
&& *((long *)(((char *) p)+sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING+END_ALIGNMENT(REAL_SIZE(p->size)))) != MEM_BLOCK_END_MAGIC) {
long magic_num = MEM_BLOCK_END_MAGIC;
char *overflow_ptr, *magic_ptr=(char *) &magic_num;
int overflows=0;
int i;
if (silent) {
return _mem_block_check(ptr, 0 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
had_problems = 1;
overflow_ptr = (char *) &end_magic;
had_problems=1;
overflow_ptr = ((char *) p)+sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING;
for (i=0; i<sizeof(long); i++) {
if (overflow_ptr[i]!=magic_ptr[i]) {
@@ -641,7 +636,8 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
}
zend_debug_alloc_output("%10s\t", "End:");
zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n", end_magic, MEM_BLOCK_END_MAGIC);
zend_debug_alloc_output("Overflown (magic=0x%0.8lX instead of 0x%0.8lX)\n",
*((long *)(((char *) p) + sizeof(zend_mem_header)+REAL_SIZE(p->size)+PLATFORM_PADDING+END_ALIGNMENT(REAL_SIZE(p->size)))), MEM_BLOCK_END_MAGIC);
zend_debug_alloc_output("%10s\t","");
if (overflows>=sizeof(long)) {
zend_debug_alloc_output("At least %d bytes overflown\n", sizeof(long));
@@ -660,7 +656,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
if (had_problems) {
int foo = 5;
foo += 1;
foo+=1;
}
if (!silent) {
@@ -683,7 +679,7 @@ ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D
zend_debug_alloc_output("Full Memory Check at %s:%d\n" ZEND_FILE_LINE_RELAY_CC);
while (p) {
if (!_mem_block_check((void *)((char *)p + sizeof(zend_mem_header) + MEM_HEADER_PADDING), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
if (!_mem_block_check((void *)((char *)p + sizeof(zend_mem_header) + PLATFORM_PADDING), (silent?2:3) ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC)) {
errors++;
}
p = p->pNext;
@@ -696,7 +692,7 @@ ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D
ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
zend_mem_header *p = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-MEM_HEADER_PADDING);
zend_mem_header *p = (zend_mem_header *) ((char *)ptr-sizeof(zend_mem_header)-PLATFORM_PADDING);
ALS_FETCH();
#if ZEND_DEBUG
@@ -713,7 +709,7 @@ ZEND_API int _persist_alloc(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
/* add the block to the persistent list */
ADD_POINTER_TO_LIST(p);
HANDLE_UNBLOCK_INTERRUPTIONS();
return REAL_SIZE(p->size)+sizeof(zend_mem_header)+MEM_HEADER_PADDING;
return REAL_SIZE(p->size)+sizeof(zend_mem_header)+PLATFORM_PADDING;
}
+3 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -30,7 +30,7 @@
#include "zend_globals_macros.h"
#define MEM_BLOCK_START_MAGIC 0x7312F8DCL
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
#define MEM_BLOCK_END_MAGIC 0x2A8FCC84L
#define MEM_BLOCK_FREED_MAGIC 0x99954317L
#define MEM_BLOCK_CACHED_MAGIC 0xFB8277DCL
@@ -69,7 +69,7 @@ typedef union _align_test {
#define PLATFORM_ALIGNMENT (sizeof(align_test))
#endif
#define MEM_HEADER_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
#define PLATFORM_PADDING (((PLATFORM_ALIGNMENT-sizeof(zend_mem_header))%PLATFORM_ALIGNMENT+PLATFORM_ALIGNMENT)%PLATFORM_ALIGNMENT)
BEGIN_EXTERN_C()
+68 -53
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -64,10 +64,10 @@ static ZEND_FUNCTION(get_resource_type);
static ZEND_FUNCTION(zend_test_func);
#endif
ZEND_API unsigned char first_arg_force_ref[] = { 1, BYREF_FORCE };
ZEND_API unsigned char first_arg_allow_ref[] = { 1, BYREF_ALLOW };
ZEND_API unsigned char second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
ZEND_API unsigned char second_arg_allow_ref[] = { 2, BYREF_NONE, BYREF_ALLOW };
unsigned char first_arg_force_ref[] = { 1, BYREF_FORCE };
unsigned char first_arg_allow_ref[] = { 1, BYREF_ALLOW };
unsigned char second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
unsigned char second_arg_allow_ref[] = { 2, BYREF_NONE, BYREF_ALLOW };
static zend_function_entry builtin_functions[] = {
ZEND_FE(zend_version, NULL)
@@ -332,7 +332,7 @@ ZEND_FUNCTION(each)
entry->refcount++;
/* add the key elements */
switch (zend_hash_get_current_key(target_hash, &string_key, &num_key, 1)) {
switch (zend_hash_get_current_key(target_hash, &string_key, &num_key)) {
case HASH_KEY_IS_STRING:
add_get_index_string(return_value,0,string_key,(void **) &inserted_pointer,0);
break;
@@ -418,7 +418,7 @@ 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) {
if(zend_register_constant(&c ELS_CC) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -460,30 +460,19 @@ ZEND_FUNCTION(get_class)
}
/* }}} */
/* {{{ proto string get_parent_class(mixed object)
Retrieves the parent class name for object or class. */
/* {{{ proto string get_parent_class(object object)
Retrieves the parent class name */
ZEND_FUNCTION(get_parent_class)
{
zval **arg;
zend_class_entry *ce = NULL;
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
if (Z_TYPE_PP(arg) == IS_OBJECT)
ce = Z_OBJCE_PP(arg);
else if (Z_TYPE_PP(arg) == IS_STRING) {
SEPARATE_ZVAL(arg);
zend_str_tolower(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg));
zend_hash_find(EG(class_table), Z_STRVAL_PP(arg), Z_STRLEN_PP(arg)+1, (void **)&ce);
}
if (ce && ce->parent) {
RETURN_STRINGL(ce->parent->name, ce->parent->name_length, 1);
} else {
if (((*arg)->type != IS_OBJECT) || !(*arg)->value.obj.ce->parent) {
RETURN_FALSE;
}
RETURN_STRINGL((*arg)->value.obj.ce->parent->name, (*arg)->value.obj.ce->parent->name_length, 1);
}
/* }}} */
@@ -526,6 +515,7 @@ ZEND_FUNCTION(get_class_vars)
char *lcname;
zend_class_entry *ce;
zval *tmp;
CLS_FETCH();
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -535,7 +525,7 @@ ZEND_FUNCTION(get_class_vars)
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
zend_str_tolower(lcname, (*class_name)->value.str.len);
if (zend_hash_find(EG(class_table), lcname, (*class_name)->value.str.len+1, (void **)&ce)==FAILURE) {
if (zend_hash_find(CG(class_table), lcname, (*class_name)->value.str.len+1, (void **)&ce)==FAILURE) {
efree(lcname);
RETURN_FALSE;
} else {
@@ -571,42 +561,42 @@ ZEND_FUNCTION(get_object_vars)
}
/* }}} */
/* {{{ proto array get_class_methods(mixed class)
Returns an array of method names for class or class instance. */
/* {{{ proto array get_class_methods(string class_name)
Returns an array of class methods' names */
ZEND_FUNCTION(get_class_methods)
{
zval **class;
zval **class_name;
zval *method_name;
zend_class_entry *ce = NULL;
char *lcname;
zend_class_entry *ce;
char *string_key;
ulong num_key;
int key_type;
CLS_FETCH();
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class)==FAILURE) {
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
if (Z_TYPE_PP(class) == IS_OBJECT)
ce = Z_OBJCE_PP(class);
else if (Z_TYPE_PP(class) == IS_STRING) {
SEPARATE_ZVAL(class);
zend_str_tolower(Z_STRVAL_PP(class), Z_STRLEN_PP(class));
zend_hash_find(EG(class_table), Z_STRVAL_PP(class), Z_STRLEN_PP(class)+1, (void **)&ce);
}
convert_to_string_ex(class_name);
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
zend_str_tolower(lcname, (*class_name)->value.str.len);
if (!ce) {
if (zend_hash_find(CG(class_table), lcname, (*class_name)->value.str.len+1, (void **)&ce)==FAILURE) {
efree(lcname);
RETURN_NULL();
}
array_init(return_value);
zend_hash_internal_pointer_reset(&ce->function_table);
while ((key_type = zend_hash_get_current_key(&ce->function_table, &string_key, &num_key, 1)) != HASH_KEY_NON_EXISTANT) {
if (key_type == HASH_KEY_IS_STRING) {
MAKE_STD_ZVAL(method_name);
ZVAL_STRING(method_name, string_key, 0);
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
} else {
efree(lcname);
array_init(return_value);
zend_hash_internal_pointer_reset(&ce->function_table);
while ((key_type = zend_hash_get_current_key(&ce->function_table, &string_key, &num_key)) != HASH_KEY_NON_EXISTANT) {
if (key_type == HASH_KEY_IS_STRING) {
MAKE_STD_ZVAL(method_name);
ZVAL_STRING(method_name, string_key, 0);
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
}
zend_hash_move_forward(&ce->function_table);
}
zend_hash_move_forward(&ce->function_table);
}
}
/* }}} */
@@ -627,7 +617,7 @@ ZEND_FUNCTION(method_exists)
convert_to_string_ex(method_name);
lcname = estrndup((*method_name)->value.str.val, (*method_name)->value.str.len);
zend_str_tolower(lcname, (*method_name)->value.str.len);
if (zend_hash_exists(&(*klass)->value.obj.ce->function_table, lcname, (*method_name)->value.str.len+1)) {
if(zend_hash_exists(&(*klass)->value.obj.ce->function_table, lcname, (*method_name)->value.str.len+1)) {
efree(lcname);
RETURN_TRUE;
} else {
@@ -643,6 +633,7 @@ ZEND_FUNCTION(class_exists)
{
zval **class_name;
char *lcname;
CLS_FETCH();
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class_name)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
@@ -650,7 +641,7 @@ ZEND_FUNCTION(class_exists)
convert_to_string_ex(class_name);
lcname = estrndup((*class_name)->value.str.val, (*class_name)->value.str.len);
zend_str_tolower(lcname, (*class_name)->value.str.len);
if (zend_hash_exists(EG(class_table), lcname, (*class_name)->value.str.len+1)) {
if (zend_hash_exists(CG(class_table), lcname, (*class_name)->value.str.len+1)) {
efree(lcname);
RETURN_TRUE;
} else {
@@ -709,6 +700,26 @@ ZEND_FUNCTION(crash)
#endif
static int copy_import_use_file(zend_file_handle *fh, zval *array)
{
if (fh->filename) {
char *extension_start;
extension_start = strstr(fh->filename, zend_uv.import_use_extension);
if (extension_start) {
*extension_start = 0;
if (fh->opened_path) {
add_assoc_string(array, fh->filename, fh->opened_path, 1);
} else {
add_assoc_stringl(array, fh->filename, "N/A", sizeof("N/A")-1, 1);
}
*extension_start = zend_uv.import_use_extension[0];
}
}
return 0;
}
/* {{{ proto array get_included_files(void)
Returns an array with the file names that were include_once()'d */
ZEND_FUNCTION(get_included_files)
@@ -720,10 +731,12 @@ ZEND_FUNCTION(get_included_files)
array_init(return_value);
zend_hash_internal_pointer_reset(&EG(included_files));
while (zend_hash_get_current_key(&EG(included_files), &entry, NULL, 1) == HASH_KEY_IS_STRING) {
add_next_index_string(return_value, entry, 0);
while(zend_hash_get_current_key(&EG(included_files), &entry,NULL) == HASH_KEY_IS_STRING) {
add_next_index_string(return_value,entry,0);
zend_hash_move_forward(&EG(included_files));
}
/* zend_hash_apply_with_argument(&EG(included_files), (apply_func_arg_t) copy_import_use_file, return_value); */
}
/* }}} */
@@ -835,12 +848,14 @@ static int copy_class_name(zend_class_entry *ce, int num_args, va_list args, zen
Returns an array of all declared classes. */
ZEND_FUNCTION(get_declared_classes)
{
CLS_FETCH();
if (ZEND_NUM_ARGS() != 0) {
ZEND_WRONG_PARAM_COUNT();
}
array_init(return_value);
zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t)copy_class_name, 1, return_value);
zend_hash_apply_with_arguments(CG(class_table), (apply_func_args_t)copy_class_name, 1, return_value);
}
/* }}} */
@@ -854,9 +869,9 @@ static int copy_function_name(zend_function *func, int num_args, va_list args, z
}
if (func->type == ZEND_INTERNAL_FUNCTION) {
add_next_index_stringl(internal_ar, hash_key->arKey, hash_key->nKeyLength-1, 1);
add_next_index_stringl(internal_ar, hash_key->arKey, hash_key->nKeyLength, 1);
} else if (func->type == ZEND_USER_FUNCTION) {
add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength-1, 1);
add_next_index_stringl(user_ar, hash_key->arKey, hash_key->nKeyLength, 1);
}
return 0;
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+18 -31
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -34,6 +34,11 @@ ZEND_API zend_compiler_globals compiler_globals;
ZEND_API zend_executor_globals executor_globals;
#endif
static void free_filename(void *p)
{
efree(*((char **) p));
}
static void build_runtime_defined_function_key(zval *result, zval *name, zend_op *opline CLS_DC)
{
@@ -57,15 +62,14 @@ static void build_runtime_defined_function_key(zval *result, zval *name, zend_op
}
static void init_compiler_declarables(CLS_D)
static void init_compiler_declarables(CLS_D ELS_DC)
{
CG(declarables).ticks.type = IS_LONG;
CG(declarables).ticks.value.lval = 0;
}
void zend_init_compiler_data_structures(CLS_D)
void init_compiler(CLS_D ELS_DC)
{
zend_stack_init(&CG(bp_stack));
zend_stack_init(&CG(function_call_stack));
@@ -76,19 +80,13 @@ void zend_init_compiler_data_structures(CLS_D)
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);
CG(handle_op_arrays) = 1;
CG(in_compilation) = 0;
init_compiler_declarables(CLS_C);
}
void init_compiler(CLS_D ELS_DC)
{
zend_init_compiler_data_structures(CLS_C);
zend_init_rsrc_list(ELS_C);
zend_hash_init(&CG(filenames_table), 5, NULL, (dtor_func_t) free_estring, 0);
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0);
CG(unclean_shutdown) = 0;
zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_file_handle_dtor, 0);
init_compiler_declarables(CLS_C ELS_CC);
}
@@ -578,7 +576,7 @@ static zend_bool is_method_call(CLS_D)
}
cur_opline = (zend_op *)cur->data;
if (cur_opline->opcode == ZEND_FETCH_OBJ_W) {
return 1;
return 1;
}
return 0;
}
@@ -670,7 +668,7 @@ void zend_do_free(znode *op1 CLS_DC)
} else if (op1->op_type==IS_VAR) {
zend_op *opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
while (opline->opcode == ZEND_END_SILENCE || opline->opcode == ZEND_EXT_FCALL_END) {
if (opline->opcode == ZEND_END_SILENCE) {
opline--;
}
if (opline->result.op_type == op1->op_type
@@ -701,9 +699,7 @@ void zend_do_free(znode *op1 CLS_DC)
opline--;
}
}
} else if (op1->op_type == IS_CONST) {
zval_dtor(&op1->u.constant);
}
}
}
@@ -769,10 +765,6 @@ void zend_do_end_function_declaration(znode *function_token CLS_DC)
zend_do_extended_info(CLS_C);
zend_do_return(NULL, 0 CLS_CC);
pass_two(CG(active_op_array));
#if SUPPORT_INTERACTIVE
CG(active_op_array)->start_op_number = 0;
CG(active_op_array)->end_op_number = CG(active_op_array)->last;
#endif
CG(active_op_array) = function_token->u.op_array;
/* Pop the switch and foreach seperators */
@@ -882,9 +874,10 @@ void zend_do_begin_class_member_function_call(znode *class_name, znode *function
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)
&& CG(active_class_entry)
&& CG(active_class_entry)->parent) {
&& !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);
@@ -1113,12 +1106,6 @@ void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce)
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, (void *) &tmp, sizeof(zval *), 0);
zend_hash_merge(&ce->function_table, &parent_ce->function_table, (void (*)(void *)) function_add_ref, &tmp_zend_function, sizeof(zend_function), 0);
ce->parent = parent_ce;
if (!ce->handle_property_get)
ce->handle_property_get = parent_ce->handle_property_get;
if (!ce->handle_property_set)
ce->handle_property_set = parent_ce->handle_property_set;
if (!ce->handle_function_call)
ce->handle_function_call = parent_ce->handle_function_call;
do_inherit_parent_constructor(ce);
}
+2 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -28,7 +28,7 @@
#endif
#ifdef __cplusplus
#include <iostream.h>
#include <istream.h>
#endif
#include "zend_llist.h"
@@ -212,7 +212,6 @@ BEGIN_EXTERN_C()
void init_compiler(CLS_D ELS_DC);
void shutdown_compiler(CLS_D);
void zend_init_compiler_data_structures(CLS_D);
extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type CLS_DC);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+110 -100
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -98,7 +98,6 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
zval *str = T->EA.data.str_offset.str;
if (T->EA.data.str_offset.str->type != IS_STRING
|| (T->EA.data.str_offset.offset<0)
|| (T->EA.data.str_offset.str->value.str.len <= T->EA.data.str_offset.offset)) {
T->tmp_var.value.str.val = empty_string;
T->tmp_var.value.str.len = 0;
@@ -174,7 +173,8 @@ static inline zval **_get_zval_ptr_ptr(znode *node, temp_variable *Ts ELS_DC)
static inline zval **zend_fetch_property_address_inner(HashTable *ht, znode *op2, temp_variable *Ts, int type ELS_DC)
{
zval *prop_ptr = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
int free_op2;
zval *prop_ptr = get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R);
zval **retval;
zval tmp;
@@ -219,7 +219,7 @@ static inline zval **zend_fetch_property_address_inner(HashTable *ht, znode *op2
if (prop_ptr == &tmp) {
zval_dtor(prop_ptr);
}
FREE_OP(op2, EG(free_op2));
FREE_OP(op2, free_op2);
return retval;
}
@@ -264,7 +264,6 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
temp_variable *T = &Ts[op1->u.var];
if (T->EA.data.str_offset.str->type == IS_STRING
&& (T->EA.data.str_offset.offset >= 0)
&& (T->EA.data.str_offset.offset < T->EA.data.str_offset.str->value.str.len)) {
zval tmp;
zval *final_value = value;
@@ -346,7 +345,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (variable_ptr==value) {
variable_ptr->refcount++;
} else if (PZVAL_IS_REF(value)) {
zval tmp;
zval tmp = *value;
tmp = *value;
zval_copy_ctor(&tmp);
@@ -503,7 +502,8 @@ static void zend_fetch_var_address(znode *result, znode *op1, znode *op2, temp_v
static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, znode *op2, temp_variable *Ts, int type ELS_DC)
{
zval *dim = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
int free_op2;
zval *dim = get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R);
zval **retval;
char *offset_key;
int offset_key_length;
@@ -581,58 +581,52 @@ fetch_string_dim:
}
break;
}
FREE_OP(op2, EG(free_op2));
FREE_OP(op2, free_op2);
return retval;
}
static void fetch_overloaded_element(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type, zval ***retval, int overloaded_element_type ELS_DC)
{
zend_overloaded_element overloaded_element;
if (Ts[op1->u.var].EA.type == IS_STRING_OFFSET) {
zval_ptr_dtor(&Ts[op1->u.var].EA.data.str_offset.str);
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
*retval = &EG(uninitialized_zval_ptr);
break;
case BP_VAR_W:
case BP_VAR_RW:
*retval = &EG(error_zval_ptr);
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
SELECTIVE_PZVAL_LOCK(**retval, result);
return;
}
overloaded_element.element = *get_zval_ptr(op2, Ts, &EG(free_op2), type);
overloaded_element.type = overloaded_element_type;
if (!EG(free_op2)) {
zval_copy_ctor(&overloaded_element.element);
}
Ts[result->u.var].EA = Ts[op1->u.var].EA;
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
*retval = NULL;
return;
}
static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type ELS_DC)
{
int free_op2;
zval **container_ptr = get_zval_ptr_ptr(op1, Ts, type);
zval *container;
zval ***retval = &Ts[result->u.var].var.ptr_ptr;
if (container_ptr == NULL) {
fetch_overloaded_element(result, op1, op2, Ts, type, retval, OE_IS_ARRAY ELS_CC);
zend_overloaded_element overloaded_element;
if (Ts[op1->u.var].EA.type == IS_STRING_OFFSET) {
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
*retval = &EG(uninitialized_zval_ptr);
break;
case BP_VAR_W:
case BP_VAR_RW:
*retval = &EG(error_zval_ptr);
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
SELECTIVE_PZVAL_LOCK(**retval, result);
return;
}
/* prepare the new element */
overloaded_element.element = *get_zval_ptr(op2, Ts, &free_op2, type);
overloaded_element.type = OE_IS_ARRAY;
if (!free_op2) {
zval_copy_ctor(&overloaded_element.element);
}
Ts[result->u.var].EA = Ts[op1->u.var].EA;
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
*retval = NULL;
return;
}
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
@@ -674,10 +668,10 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
break;
case IS_NULL:
/* for read-mode only */
get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R);
*retval = &EG(uninitialized_zval_ptr);
SELECTIVE_PZVAL_LOCK(**retval, result);
FREE_OP(op2, EG(free_op2));
FREE_OP(op2, free_op2);
if (type==BP_VAR_W || type==BP_VAR_RW) {
zend_error(E_WARNING, "Cannot use a NULL value as an array");
}
@@ -690,7 +684,7 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
zend_error(E_ERROR, "[] operator not supported for strings");
}
offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
offset = get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R);
if (offset->type != IS_LONG) {
tmp = *offset;
@@ -706,7 +700,7 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
PZVAL_LOCK(container);
Ts[result->u.var].EA.data.str_offset.offset = offset->value.lval;
Ts[result->u.var].EA.type = IS_STRING_OFFSET;
FREE_OP(op2, EG(free_op2));
FREE_OP(op2, free_op2);
*retval = NULL;
return;
}
@@ -714,13 +708,13 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
default: {
zval *offset;
offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
offset = get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R);
if (type==BP_VAR_R || type==BP_VAR_IS) {
*retval = &EG(uninitialized_zval_ptr);
} else {
*retval = &EG(error_zval_ptr);
}
FREE_OP(op2, EG(free_op2));
FREE_OP(op2, free_op2);
SELECTIVE_PZVAL_LOCK(**retval, result);
if (type==BP_VAR_W || type==BP_VAR_RW) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
@@ -749,13 +743,43 @@ static void zend_fetch_dimension_address_from_tmp_var(znode *result, znode *op1,
static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, temp_variable *Ts, int type ELS_DC)
{
int free_op2;
zval **container_ptr = get_zval_ptr_ptr(op1, Ts, type);
zval *container;
zval ***retval = &Ts[result->u.var].var.ptr_ptr;
if (container_ptr == NULL) {
fetch_overloaded_element(result, op1, op2, Ts, type, retval, OE_IS_OBJECT ELS_CC);
zend_overloaded_element overloaded_element;
if (Ts[op1->u.var].EA.type == IS_STRING_OFFSET) {
zval_ptr_dtor(&Ts[op1->u.var].EA.data.str_offset.str);
switch (type) {
case BP_VAR_R:
case BP_VAR_IS:
*retval = &EG(uninitialized_zval_ptr);
break;
case BP_VAR_W:
case BP_VAR_RW:
*retval = &EG(error_zval_ptr);
break;
EMPTY_SWITCH_DEFAULT_CASE()
}
SELECTIVE_PZVAL_LOCK(**retval, result);
return;
}
overloaded_element.element = *get_zval_ptr(op2, Ts, &free_op2, type);
overloaded_element.type = OE_IS_OBJECT;
if (!free_op2) {
zval_copy_ctor(&overloaded_element.element);
}
Ts[result->u.var].EA = Ts[op1->u.var].EA;
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
Ts[result->u.var].EA.type = IS_OVERLOADED_OBJECT;
*retval = NULL;
return;
}
@@ -774,9 +798,9 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
Ts[result->u.var].EA.data.overloaded_element.type = type;
Ts[result->u.var].EA.data.overloaded_element.elements_list = (zend_llist *) emalloc(sizeof(zend_llist));
zend_llist_init(Ts[result->u.var].EA.data.overloaded_element.elements_list, sizeof(zend_overloaded_element), NULL, 0);
overloaded_element.element = *get_zval_ptr(op2, Ts, &EG(free_op2), type);
overloaded_element.element = *get_zval_ptr(op2, Ts, &free_op2, type);
overloaded_element.type = OE_IS_OBJECT;
if (!EG(free_op2)) {
if (!free_op2) {
zval_copy_ctor(&overloaded_element.element);
}
zend_llist_add_element(Ts[result->u.var].EA.data.overloaded_element.elements_list, &overloaded_element);
@@ -804,8 +828,8 @@ static void zend_fetch_property_address(znode *result, znode *op1, znode *op2, t
if (container->type != IS_OBJECT) {
zval *offset;
offset = get_zval_ptr(op2, Ts, &EG(free_op2), BP_VAR_R);
FREE_OP(op2, EG(free_op2));
offset = get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R);
FREE_OP(op2, free_op2);
if (type==BP_VAR_R || type==BP_VAR_IS) {
*retval = &EG(uninitialized_zval_ptr);
} else {
@@ -839,12 +863,7 @@ static zval get_overloaded_property(temp_variable *T ELS_DC)
static void set_overloaded_property(temp_variable *T, zval *value ELS_DC)
{
if ((T->EA.data.overloaded_element.object)->value.obj.ce->handle_property_set) {
(T->EA.data.overloaded_element.object)->value.obj.ce->handle_property_set(&T->EA.data.overloaded_element, value);
} else {
zend_error(E_ERROR, "Class '%s' does not support setting overloaded properties",
(T->EA.data.overloaded_element.object)->value.obj.ce->name);
}
(T->EA.data.overloaded_element.object)->value.obj.ce->handle_property_set(&T->EA.data.overloaded_element, value);
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
}
@@ -852,12 +871,7 @@ static void set_overloaded_property(temp_variable *T, zval *value ELS_DC)
static void call_overloaded_function(temp_variable *T, int arg_count, zval *return_value ELS_DC)
{
if ((T->EA.data.overloaded_element.object)->value.obj.ce->handle_function_call) {
(T->EA.data.overloaded_element.object)->value.obj.ce->handle_function_call(arg_count, return_value, T->EA.data.overloaded_element.object, 1 ELS_CC, &T->EA.data.overloaded_element);
} else {
zend_error(E_ERROR, "Class '%s' does not support overloaded method calls",
(T->EA.data.overloaded_element.object)->value.obj.ce->name);
}
(T->EA.data.overloaded_element.object)->value.obj.ce->handle_function_call(arg_count, return_value, T->EA.data.overloaded_element.object, 1 ELS_CC, &T->EA.data.overloaded_element);
zend_llist_destroy(T->EA.data.overloaded_element.elements_list);
efree(T->EA.data.overloaded_element.elements_list);
}
@@ -898,7 +912,7 @@ typedef struct _object_info {
zval *ptr;
} object_info;
ZEND_API void execute(zend_op_array *op_array ELS_DC)
void execute(zend_op_array *op_array ELS_DC)
{
zend_op *opline = op_array->opcodes;
#if SUPPORT_INTERACTIVE
@@ -1308,32 +1322,38 @@ binary_assign_op_addr: {
zend_op *original_opline = opline;
int retval = zend_is_true(get_zval_ptr(&original_opline->op1, Ts, &EG(free_op1), BP_VAR_R));
FREE_OP(&original_opline->op1, EG(free_op1));
Ts[original_opline->result.u.var].tmp_var.value.lval = retval;
Ts[original_opline->result.u.var].tmp_var.type = IS_LONG;
if (!retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
#endif
opline = &op_array->opcodes[opline->op2.u.opline_num];
FREE_OP(&original_opline->op1, EG(free_op1));
Ts[original_opline->result.u.var].tmp_var.value.lval = retval;
Ts[original_opline->result.u.var].tmp_var.type = IS_LONG;
continue;
}
FREE_OP(&original_opline->op1, EG(free_op1));
Ts[original_opline->result.u.var].tmp_var.value.lval = retval;
Ts[original_opline->result.u.var].tmp_var.type = IS_LONG;
}
NEXT_OPCODE();
case ZEND_JMPNZ_EX: {
zend_op *original_opline = opline;
int retval = zend_is_true(get_zval_ptr(&original_opline->op1, Ts, &EG(free_op1), BP_VAR_R));
FREE_OP(&original_opline->op1, EG(free_op1));
Ts[original_opline->result.u.var].tmp_var.value.lval = retval;
Ts[original_opline->result.u.var].tmp_var.type = IS_LONG;
if (retval) {
#if DEBUG_ZEND>=2
printf("Conditional jmp to %d\n", opline->op2.u.opline_num);
#endif
opline = &op_array->opcodes[opline->op2.u.opline_num];
FREE_OP(&original_opline->op1, EG(free_op1));
Ts[original_opline->result.u.var].tmp_var.value.lval = retval;
Ts[original_opline->result.u.var].tmp_var.type = IS_LONG;
continue;
}
FREE_OP(&original_opline->op1, EG(free_op1));
Ts[original_opline->result.u.var].tmp_var.value.lval = retval;
Ts[original_opline->result.u.var].tmp_var.type = IS_LONG;
}
NEXT_OPCODE();
case ZEND_FREE:
@@ -1394,7 +1414,7 @@ binary_assign_op_addr: {
if (opline->op1.op_type == IS_VAR) {
SELECTIVE_PZVAL_LOCK(*Ts[opline->op1.u.var].var.ptr_ptr, &opline->op1);
}
if (opline->op2.op_type == IS_VAR) {
if (opline->op2.op_type==IS_VAR) {
PZVAL_LOCK(*Ts[opline->op2.u.var].var.ptr_ptr);
}
}
@@ -1411,6 +1431,10 @@ binary_assign_op_addr: {
zend_class_entry *ce;
zval **object_ptr_ptr;
if (zend_hash_find(EG(class_table), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len+1, (void **) &ce)==FAILURE) {
zend_error(E_ERROR, "Undefined class name '%s'", opline->op1.u.constant.value.str.val);
}
active_function_table = &ce->function_table;
if (zend_hash_find(EG(active_symbol_table), "this", sizeof("this"), (void **) &object_ptr_ptr)==FAILURE) {
object.ptr=NULL;
} else {
@@ -1419,15 +1443,6 @@ binary_assign_op_addr: {
object.ptr = *object_ptr_ptr;
object.ptr->refcount++; /* For this pointer */
}
if (zend_hash_find(EG(class_table), opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len+1, (void **) &ce)==FAILURE) { /* class doesn't exist */
/* test for parent:: special case - if it doesn't exist - error out */
if (opline->op1.u.constant.value.str.len!=(sizeof("parent")-1)
|| memcmp(opline->op1.u.constant.value.str.val, "parent", sizeof("parent")-1)!=0
|| !(ce = object.ptr->value.obj.ce->parent)) {
zend_error(E_ERROR, "Undefined class name '%s'", opline->op1.u.constant.value.str.val);
}
}
active_function_table = &ce->function_table;
} else { /* used for member function calls */
object.ptr = _get_object_zval_ptr(&opline->op1, Ts, &EG(free_op1) ELS_CC);
@@ -1532,7 +1547,7 @@ do_fcall_common:
zend_hash_update(function_state.function_symbol_table, "this", sizeof("this"), &null_ptr, sizeof(zval *), (void **) &this_ptr);
if (!PZVAL_IS_REF(object.ptr)) {
zend_error(E_WARNING, "Problem with method call - please report this bug");
zend_error(E_WARNING,"Problem with method call. Report this bug\n");
}
*this_ptr = object.ptr;
object.ptr = NULL;
@@ -1569,10 +1584,9 @@ do_fcall_common:
zval_ptr_dtor(&Ts[opline->result.u.var].var.ptr);
}
}
object.ptr = zend_ptr_stack_pop(&EG(arg_types_stack));
if (opline->opcode == ZEND_DO_FCALL_BY_NAME) {
zend_ptr_stack_n_pop(&EG(arg_types_stack), 2, &object.ptr, &fbc);
} else {
object.ptr = zend_ptr_stack_pop(&EG(arg_types_stack));
fbc = zend_ptr_stack_pop(&EG(arg_types_stack));
}
function_state.function = (zend_function *) op_array;
EG(function_state_ptr) = &function_state;
@@ -1806,7 +1820,7 @@ send_by_ref:
FREE_OP(&opline->op2, EG(free_op2));
continue;
}
/* Never reaches this point */
NEXT_OPCODE();
case ZEND_CASE: {
int switch_expr_is_overloaded=0;
@@ -1917,7 +1931,7 @@ send_by_ref:
if (offset) {
switch(offset->type) {
case IS_DOUBLE:
zend_hash_index_update(array_ptr->value.ht, (long) offset->value.dval, &expr_ptr, sizeof(zval *), NULL);
zend_hash_index_update(array_ptr->value.ht, (long) offset->value.lval, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_LONG:
zend_hash_index_update(array_ptr->value.ht, offset->value.lval, &expr_ptr, sizeof(zval *), NULL);
@@ -1992,7 +2006,7 @@ send_by_ref:
switch (opline->op2.u.constant.value.lval) {
case ZEND_INCLUDE_ONCE:
case ZEND_REQUIRE_ONCE: {
char *opened_path=NULL;
char *opened_path;
int dummy = 1;
zend_file_handle file_handle;
@@ -2151,13 +2165,9 @@ send_by_ref:
if (opline->extended_value) {
array_ptr_ptr = get_zval_ptr_ptr(&opline->op1, Ts, BP_VAR_R);
if (array_ptr_ptr == NULL) {
MAKE_STD_ZVAL(array_ptr);
} else {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
array_ptr = *array_ptr_ptr;
array_ptr->refcount++;
}
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 */
@@ -2211,7 +2221,7 @@ send_by_ref:
ALLOC_ZVAL(key);
INIT_PZVAL(key);
switch (zend_hash_get_current_key(fe_ht, &str_key, &int_key, 1)) {
switch (zend_hash_get_current_key(fe_ht, &str_key, &int_key)) {
case HASH_KEY_IS_STRING:
key->value.str.val = str_key;
key->value.str.len = strlen(str_key);
+2 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -52,7 +52,7 @@ ZEND_API extern void (*zend_execute)(zend_op_array *op_array ELS_DC);
void init_executor(CLS_D ELS_DC);
void shutdown_executor(ELS_D);
ZEND_API void execute(zend_op_array *op_array ELS_DC);
void execute(zend_op_array *op_array ELS_DC);
ZEND_API int zend_is_true(zval *op);
static inline void safe_free_zval_ptr(zval *p)
{
+17 -63
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -312,7 +312,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg)
}
int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, int param_count, zval *params[])
int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, int param_count, zval *params[])
{
zval ***params_array = (zval ***) emalloc(sizeof(zval **)*param_count);
int i;
@@ -322,7 +322,7 @@ int call_user_function(HashTable *function_table, zval **object_pp, zval *functi
for (i=0; i<param_count; i++) {
params_array[i] = &params[i];
}
ex_retval = call_user_function_ex(function_table, object_pp, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
ex_retval = call_user_function_ex(function_table, object, function_name, &local_retval_ptr, param_count, params_array, 1, NULL);
if (local_retval_ptr) {
COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr);
} else {
@@ -333,7 +333,7 @@ int call_user_function(HashTable *function_table, zval **object_pp, zval *functi
}
int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval **retval_ptr_ptr, int param_count, zval **params[], int no_separation, HashTable *symbol_table)
{
int i;
zval **original_return_value;
@@ -342,9 +342,6 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun
zend_function_state *original_function_state_ptr;
zend_op_array *original_op_array;
zend_op **original_opline_ptr;
int orig_free_op1, orig_free_op2;
int (*orig_unary_op)(zval *result, zval *op1);
int (*orig_binary_op)(zval *result, zval *op1, zval *op2);
ELS_FETCH();
*retval_ptr_ptr = NULL;
@@ -360,32 +357,15 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun
}
function_name = *tmp_real_function_name;
SEPARATE_ZVAL_IF_NOT_REF(tmp_object_ptr);
object_pp = tmp_object_ptr;
(*object_pp)->is_ref = 1;
object = *tmp_object_ptr;
object->is_ref = 1;
}
if (object_pp && !*object_pp) {
object_pp = NULL;
}
if (object_pp) {
if (Z_TYPE_PP(object_pp) == IS_OBJECT) {
function_table = &(*object_pp)->value.obj.ce->function_table;
} else if (Z_TYPE_PP(object_pp) == IS_STRING) {
zend_class_entry *ce;
char *lc_class;
int found;
lc_class = estrndup(Z_STRVAL_PP(object_pp), Z_STRLEN_PP(object_pp));
zend_str_tolower(lc_class, Z_STRLEN_PP(object_pp));
found = zend_hash_find(EG(class_table), lc_class, Z_STRLEN_PP(object_pp) + 1, (void **) &ce);
efree(lc_class);
if (found == FAILURE)
return FAILURE;
function_table = &ce->function_table;
object_pp = NULL;
} else
if (object) {
if (object->type != IS_OBJECT) {
return FAILURE;
}
function_table = &object->value.obj.ce->function_table;
}
if (function_name->type!=IS_STRING) {
@@ -434,8 +414,6 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun
zend_ptr_stack_n_push(&EG(argument_stack), 2, (void *) (long) param_count, NULL);
EG(function_state_ptr) = &function_state;
if (function_state.function->type == ZEND_USER_FUNCTION) {
calling_symbol_table = EG(active_symbol_table);
if (symbol_table) {
@@ -444,23 +422,20 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun
ALLOC_HASHTABLE(EG(active_symbol_table));
zend_hash_init(EG(active_symbol_table), 0, NULL, ZVAL_PTR_DTOR, 0);
}
if (object_pp) {
if (object) {
zval *dummy, **this_ptr;
ALLOC_ZVAL(dummy);
INIT_ZVAL(*dummy);
INIT_ZVAL(*dummy);
zend_hash_update(EG(active_symbol_table), "this", sizeof("this"), &dummy, sizeof(zval *), (void **) &this_ptr);
zend_assign_to_variable_reference(NULL, this_ptr, object_pp, NULL ELS_CC);
zend_assign_to_variable_reference(NULL, this_ptr, &object, NULL ELS_CC);
}
original_return_value = EG(return_value_ptr_ptr);
original_op_array = EG(active_op_array);
EG(return_value_ptr_ptr) = retval_ptr_ptr;
EG(active_op_array) = (zend_op_array *) function_state.function;
original_opline_ptr = EG(opline_ptr);
orig_free_op1 = EG(free_op1);
orig_free_op2 = EG(free_op2);
orig_unary_op = EG(unary_op);
orig_binary_op = EG(binary_op);
zend_execute(EG(active_op_array) ELS_CC);
if (!symbol_table) {
zend_hash_destroy(EG(active_symbol_table));
@@ -470,13 +445,9 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun
EG(active_op_array) = original_op_array;
EG(return_value_ptr_ptr)=original_return_value;
EG(opline_ptr) = original_opline_ptr;
EG(free_op1) = orig_free_op1;
EG(free_op2) = orig_free_op2;
EG(unary_op) = orig_unary_op;
EG(binary_op) = orig_binary_op;
} else {
ALLOC_INIT_ZVAL(*retval_ptr_ptr);
((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, (object_pp?*object_pp:NULL), 1 ELS_CC);
((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, object, 1 ELS_CC);
INIT_PZVAL(*retval_ptr_ptr);
}
zend_ptr_stack_clear_multiple(ELS_C);
@@ -557,7 +528,6 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name CLS
#if SUPPORT_INTERACTIVE
void execute_new_code(CLS_D)
{
zend_op *opline, *end;
ELS_FETCH();
if (!EG(interactive)
@@ -566,22 +536,6 @@ void execute_new_code(CLS_D)
|| CG(active_op_array)->type!=ZEND_USER_FUNCTION) {
return;
}
opline=CG(active_op_array)->opcodes + CG(active_op_array)->start_op_number;
end=CG(active_op_array)->opcodes+CG(active_op_array)->last;
while (opline<end) {
if (opline->op1.op_type==IS_CONST) {
opline->op1.u.constant.is_ref = 1;
opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */
}
if (opline->op2.op_type==IS_CONST) {
opline->op2.u.constant.is_ref = 1;
opline->op2.u.constant.refcount = 2;
}
opline++;
}
CG(active_op_array)->start_op_number = CG(active_op_array)->last_executed_op_number;
CG(active_op_array)->end_op_number = CG(active_op_array)->last;
EG(active_op_array) = CG(active_op_array);
@@ -661,7 +615,7 @@ static unsigned __stdcall timeout_thread_proc(void *pArgs)
wc.hbrBackground=(HBRUSH)(COLOR_BACKGROUND + 5);
wc.lpszMenuName=NULL;
wc.lpszClassName = "Zend Timeout Window";
if (!RegisterClass(&wc)) {
if(!RegisterClass(&wc)) {
return -1;
}
timeout_window = CreateWindow(wc.lpszClassName, wc.lpszClassName, 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
+3 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -49,7 +49,7 @@ int zend_load_extension(char *path)
/* allow extension to proclaim compatibility with any Zend version */
if (extension_version_info->zend_extension_api_no != ZEND_EXTENSION_API_NO &&(!new_extension->api_no_check || new_extension->api_no_check(ZEND_EXTENSION_API_NO) != SUCCESS)) {
if(extension_version_info->zend_extension_api_no != ZEND_EXTENSION_API_NO &&(!new_extension->api_no_check || new_extension->api_no_check(ZEND_EXTENSION_API_NO) != SUCCESS)) {
if (extension_version_info->zend_extension_api_no > ZEND_EXTENSION_API_NO) {
fprintf(stderr, "%s requires Zend Engine API version %d\n"
"The installed Zend Engine API version is %d\n\n",
@@ -107,6 +107,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
zend_llist_add_element(&zend_extensions, &extension);
zend_append_version_info(&extension);
/*fprintf(stderr, "Loaded %s, version %s\n", extension.name, extension.version);*/
#endif
@@ -130,7 +131,6 @@ static int zend_extension_startup(zend_extension *extension)
if (extension->startup(extension)!=SUCCESS) {
return 1;
}
zend_append_version_info(extension);
}
#endif
return 0;
+4 -4
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -23,7 +23,7 @@
#include "zend_compile.h"
#define ZEND_EXTENSION_API_NO 20001224
#define ZEND_EXTENSION_API_NO 20001120
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -38,8 +38,8 @@ typedef struct _zend_extension zend_extension;
/* Typedef's for zend_extension function pointers */
typedef int (*startup_func_t)(zend_extension *extension);
typedef void (*shutdown_func_t)(zend_extension *extension);
typedef void (*activate_func_t)(void);
typedef void (*deactivate_func_t)(void);
typedef void (*activate_func_t)();
typedef void (*deactivate_func_t)();
typedef void (*message_handler_func_t)(int message, void *arg);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -191,8 +191,6 @@ struct _zend_executor_globals {
int lambda_count;
HashTable ini_directives;
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
#if SUPPORT_INTERACTIVE
int interactive;
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+9 -8
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -26,6 +26,10 @@
# include <stdlib.h>
#endif
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#define HANDLE_NUMERIC(key, length, func) { \
register char *tmp=key; \
\
@@ -48,7 +52,7 @@
return func; \
} \
} \
} while (0); \
} while(0); \
}
@@ -1015,7 +1019,7 @@ ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
/* This function should be made binary safe */
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos)
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *str_length, ulong *num_index, HashPosition *pos)
{
Bucket *p;
@@ -1025,11 +1029,8 @@ ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong
if (p) {
if (p->nKeyLength) {
if (duplicate) {
*str_index = estrndup(p->arKey, p->nKeyLength);
} else {
*str_index = p->arKey;
}
*str_index = (char *) pemalloc(p->nKeyLength, ht->persistent);
memcpy(*str_index, p->arKey, p->nKeyLength);
if (str_length) {
*str_length = p->nKeyLength;
}
+4 -4
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -146,7 +146,7 @@ ZEND_API ulong zend_hash_next_free_element(HashTable *ht);
/* traversing */
ZEND_API int zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *str_length, ulong *num_index, zend_bool duplicate, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_ex(HashTable *ht, char **str_index, ulong *str_length, ulong *num_index, HashPosition *pos);
ZEND_API int zend_hash_get_current_key_type_ex(HashTable *ht, HashPosition *pos);
ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosition *pos);
ZEND_API void zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos);
@@ -156,8 +156,8 @@ ZEND_API void zend_hash_internal_pointer_end_ex(HashTable *ht, HashPosition *pos
zend_hash_move_forward_ex(ht, NULL)
#define zend_hash_move_backwards(ht) \
zend_hash_move_backwards_ex(ht, NULL)
#define zend_hash_get_current_key(ht, str_index, num_index, duplicate) \
zend_hash_get_current_key_ex(ht, str_index, NULL, num_index, duplicate, NULL)
#define zend_hash_get_current_key(ht, str_index, num_index) \
zend_hash_get_current_key_ex(ht, str_index, NULL, num_index, NULL)
#define zend_hash_get_current_key_type(ht) \
zend_hash_get_current_key_type_ex(ht, NULL)
#define zend_hash_get_current_data(ht, pData) \
+1 -11
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -66,15 +66,6 @@ ZEND_API void zend_html_puts(char *s, uint len)
register char *ptr=s, *end=s+len;
while (ptr<end) {
if (*ptr==' '
&& len>1
&& !(((ptr+1)>=end) || (*(ptr+1)==' ')) /* next is not a space */
&& !((ptr==s) || (*(ptr-1)==' '))) /* last is not a space */ {
char c = *ptr++;
ZEND_PUTC(c);
continue;
}
zend_html_putc(*ptr++);
}
}
@@ -158,7 +149,6 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
case T_OPEN_TAG_WITH_ECHO:
case T_CLOSE_TAG:
case T_WHITESPACE:
case T_COMMENT:
break;
default:
efree(token.value.str.val);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+32 -46
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -25,7 +25,7 @@
#include "zend_alloc.h"
#include "zend_operators.h"
static HashTable *registered_zend_ini_directives;
static HashTable known_directives;
/*
@@ -60,39 +60,25 @@ static int zend_restore_ini_entry_cb(zend_ini_entry *ini_entry, int stage)
/*
* Startup / shutdown
*/
ZEND_API int zend_ini_startup(ELS_D)
int zend_ini_mstartup()
{
registered_zend_ini_directives = &EG(ini_directives);
if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0)==FAILURE) {
if (zend_hash_init_ex(&known_directives, 100, NULL, NULL, 1, 0)==FAILURE) {
return FAILURE;
}
return SUCCESS;
}
ZEND_API int zend_ini_shutdown(ELS_D)
int zend_ini_mshutdown()
{
zend_hash_destroy(&EG(ini_directives));
zend_hash_destroy(&known_directives);
return SUCCESS;
}
ZEND_API int zend_ini_deactivate(ELS_D)
int zend_ini_rshutdown()
{
zend_hash_apply_with_argument(&EG(ini_directives), (int (*)(void *, void *)) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE);
return SUCCESS;
}
ZEND_API int zend_copy_ini_directives(ELS_D)
{
zend_ini_entry ini_entry;
if (zend_hash_init_ex(&EG(ini_directives), registered_zend_ini_directives->nNumOfElements, NULL, NULL, 1, 0)==FAILURE) {
return FAILURE;
}
zend_hash_copy(&EG(ini_directives), registered_zend_ini_directives, NULL, &ini_entry, sizeof(zend_ini_entry));
zend_ini_refresh_caches(ZEND_INI_STAGE_STARTUP ELS_CC);
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_restore_ini_entry_cb, (void *) ZEND_INI_STAGE_DEACTIVATE);
return SUCCESS;
}
@@ -117,9 +103,9 @@ static int ini_key_compare(const void *a, const void *b)
}
ZEND_API void zend_ini_sort_entries(ELS_D)
void zend_ini_sort_entries(void)
{
zend_hash_sort(&EG(ini_directives), qsort, ini_key_compare, 0);
zend_hash_sort(&known_directives, qsort, ini_key_compare, 0);
}
/*
@@ -130,19 +116,19 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num
{
zend_ini_entry *p = ini_entry;
zend_ini_entry *hashed_ini_entry;
zval default_value;
zval *default_value;
while (p->name) {
p->module_number = module_number;
if (zend_hash_add(registered_zend_ini_directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
if (zend_hash_add(&known_directives, p->name, p->name_length, p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
zend_unregister_ini_entries(module_number);
return FAILURE;
}
if ((zend_get_configuration_directive(p->name, p->name_length, &default_value))==SUCCESS) {
if ((default_value=cfg_get_entry(p->name, p->name_length))) {
if (!hashed_ini_entry->on_modify
|| hashed_ini_entry->on_modify(hashed_ini_entry, default_value.value.str.val, default_value.value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP)==SUCCESS) {
hashed_ini_entry->value = default_value.value.str.val;
hashed_ini_entry->value_length = default_value.value.str.len;
|| hashed_ini_entry->on_modify(hashed_ini_entry, default_value->value.str.val, default_value->value.str.len, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP)==SUCCESS) {
hashed_ini_entry->value = default_value->value.str.val;
hashed_ini_entry->value_length = default_value->value.str.len;
}
} else {
if (hashed_ini_entry->on_modify) {
@@ -157,7 +143,7 @@ ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_num
ZEND_API void zend_unregister_ini_entries(int module_number)
{
zend_hash_apply_with_argument(registered_zend_ini_directives, (int (*)(void *, void *)) zend_remove_ini_entries, (void *) &module_number);
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_remove_ini_entries, (void *) &module_number);
}
@@ -170,9 +156,9 @@ static int zend_ini_refresh_cache(zend_ini_entry *p, int stage)
}
ZEND_API void zend_ini_refresh_caches(int stage ELS_DC)
ZEND_API void zend_ini_refresh_caches(int stage)
{
zend_hash_apply_with_argument(&EG(ini_directives), (int (*)(void *, void *)) zend_ini_refresh_cache, (void *)(long) stage);
zend_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_ini_refresh_cache, (void *)(long) stage);
}
@@ -180,9 +166,8 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
{
zend_ini_entry *ini_entry;
char *duplicate;
ELS_FETCH();
if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE) {
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
return FAILURE;
}
@@ -214,9 +199,8 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage)
{
zend_ini_entry *ini_entry;
ELS_FETCH();
if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==FAILURE) {
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
return FAILURE;
}
@@ -229,7 +213,7 @@ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*di
{
zend_ini_entry *ini_entry;
if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
return FAILURE;
}
@@ -246,9 +230,8 @@ ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*di
ZEND_API long zend_ini_long(char *name, uint name_length, int orig)
{
zend_ini_entry *ini_entry;
ELS_FETCH();
if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
if (orig && ini_entry->modified) {
return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0);
} else if (ini_entry->value) {
@@ -263,9 +246,8 @@ ZEND_API long zend_ini_long(char *name, uint name_length, int orig)
ZEND_API double zend_ini_double(char *name, uint name_length, int orig)
{
zend_ini_entry *ini_entry;
ELS_FETCH();
if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
if (orig && ini_entry->modified) {
return (double) (ini_entry->orig_value ? strtod(ini_entry->orig_value, NULL) : 0.0);
} else if (ini_entry->value) {
@@ -280,9 +262,8 @@ ZEND_API double zend_ini_double(char *name, uint name_length, int orig)
ZEND_API char *zend_ini_string(char *name, uint name_length, int orig)
{
zend_ini_entry *ini_entry;
ELS_FETCH();
if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
if (orig && ini_entry->modified) {
return ini_entry->orig_value;
} else {
@@ -297,9 +278,8 @@ ZEND_API char *zend_ini_string(char *name, uint name_length, int orig)
zend_ini_entry *get_ini_entry(char *name, uint name_length)
{
zend_ini_entry *ini_entry;
ELS_FETCH();
if (zend_hash_find(&EG(ini_directives), name, name_length, (void **) &ini_entry)==SUCCESS) {
if (zend_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
return ini_entry;
} else {
return NULL;
@@ -395,6 +375,12 @@ ZEND_INI_DISP(display_link_numbers)
}
ZEND_API void zend_ini_apply_with_argument(apply_func_arg_t apply_func, void *arg)
{
zend_hash_apply_with_argument(&known_directives, apply_func, arg);
}
/* Standard message handlers */
ZEND_API ZEND_INI_MH(OnUpdateBool)
+11 -38
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -26,36 +26,6 @@
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
#ifndef XtOffsetOf
# if defined(CRAY) || (defined(__arm) && !defined(LINUX))
# ifdef __STDC__
# define XtOffset(p_type,field) _Offsetof(p_type,field)
# else
# ifdef CRAY2
# define XtOffset(p_type,field) \
(sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
# else /* !CRAY2 */
# define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
# endif /* !CRAY2 */
# endif /* __STDC__ */
# else /* ! (CRAY || __arm) */
# define XtOffset(p_type,field) \
((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
# endif /* !CRAY */
# ifdef offsetof
# define XtOffsetOf(s_type,field) offsetof(s_type,field)
# else
# define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
# endif
#endif
typedef struct _zend_ini_entry zend_ini_entry;
#define ZEND_INI_MH(name) int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage)
@@ -82,17 +52,15 @@ struct _zend_ini_entry {
};
ZEND_API int zend_ini_startup(ELS_D);
ZEND_API int zend_ini_shutdown(ELS_D);
ZEND_API int zend_ini_deactivate(ELS_D);
int zend_ini_mstartup(void);
int zend_ini_mshutdown(void);
int zend_ini_rshutdown(void);
ZEND_API int zend_copy_ini_directives(ELS_D);
ZEND_API void zend_ini_sort_entries(ELS_D);
void zend_ini_sort_entries(void);
ZEND_API int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number);
ZEND_API void zend_unregister_ini_entries(int module_number);
ZEND_API void zend_ini_refresh_caches(int stage ELS_DC);
ZEND_API void zend_ini_refresh_caches(int stage);
ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage);
ZEND_API int zend_restore_ini_entry(char *name, uint name_length, int stage);
ZEND_API void display_ini_entries(zend_module_entry *module);
@@ -104,6 +72,8 @@ zend_ini_entry *get_ini_entry(char *name, uint name_length);
ZEND_API int zend_ini_register_displayer(char *name, uint name_length, void (*displayer)(zend_ini_entry *ini_entry, int type));
ZEND_API void zend_ini_apply_with_argument(apply_func_arg_t apply_func, void *arg);
ZEND_API ZEND_INI_DISP(zend_ini_boolean_displayer_cb);
ZEND_API ZEND_INI_DISP(zend_ini_color_displayer_cb);
ZEND_API ZEND_INI_DISP(display_link_numbers);
@@ -169,6 +139,9 @@ ZEND_API ZEND_INI_DISP(display_link_numbers);
#define REGISTER_INI_DISPLAYER(name, displayer) zend_ini_register_displayer((name), sizeof(name), displayer)
#define REGISTER_INI_BOOLEAN(name) REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb)
zval *cfg_get_entry(char *name, uint name_length);
/* Standard message handlers */
ZEND_API ZEND_INI_MH(OnUpdateBool);
ZEND_API ZEND_INI_MH(OnUpdateInt);
+1 -1
View File
@@ -3,7 +3,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+2 -2
View File
@@ -14,8 +14,8 @@ public:
#endif /* ZTS && __cplusplus */
BEGIN_EXTERN_C()
int zend_ini_scanner_get_lineno(void);
char *zend_ini_scanner_get_filename(void);
int zend_ini_scanner_get_lineno();
char *zend_ini_scanner_get_filename();
int zend_ini_open_file_for_scanning(zend_file_handle *fh);
void zend_ini_close_file(zend_file_handle *fh);
int ini_lex(zval *ini_lval);
+4 -9
View File
@@ -3,7 +3,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -45,9 +45,6 @@
#define YY_DECL int ini_lex(zval *ini_lval)
#endif
#include "zend_istdiostream.h"
#ifndef ZTS
static char *ini_filename;
@@ -162,8 +159,6 @@ void zend_ini_close_file(zend_file_handle *fh)
%}
NEWLINE ("\r"|"\n"|"\r\n")
%option noyywrap
%option yylineno
@@ -185,7 +180,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
return CFG_FALSE;
}
<INITIAL>[[][^[]+[\]]{NEWLINE}? {
<INITIAL>[[][^[]+[\]]([\n]?|"\r\n"?) {
/* SECTION */
/* eat trailng ] */
@@ -263,11 +258,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
return yytext[0];
}
<INITIAL>{NEWLINE} {
<INITIAL>"\r\n" {
return '\n';
}
<INITIAL>[;][^\r\n]*{NEWLINE}? {
<INITIAL>[;][^\r\n]*[\r\n]? {
/* comment */
return '\n';
}
-15
View File
@@ -1,15 +0,0 @@
#ifndef _ZEND_STDIOSTREAM
#define _ZEND_STDIOSTREAM
#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM)
class istdiostream : public istream
{
private:
stdiobuf _file;
public:
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
stdiobuf* rdbuf()/* const */ { return &_file; }
};
#endif
#endif
+11 -8
View File
@@ -3,7 +3,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -139,7 +139,7 @@ start:
;
top_statement_list:
top_statement_list { zend_do_extended_info(CLS_C); } top_statement { ELS_FETCH(); HANDLE_INTERACTIVE(); }
top_statement_list { zend_do_extended_info(CLS_C); } top_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
@@ -151,7 +151,7 @@ top_statement:
inner_statement_list:
inner_statement_list { zend_do_extended_info(CLS_C); } inner_statement { ELS_FETCH(); HANDLE_INTERACTIVE(); }
inner_statement_list { zend_do_extended_info(CLS_C); } inner_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
@@ -568,6 +568,13 @@ expr:
| expr_without_variable { $$ = $1; }
;
/*
w_expr:
w_cvar { $$ = $1; }
| expr_without_variable { $$ = $1; }
;
*/
r_cvar:
cvar { zend_do_end_variable_parse(BP_VAR_R, 0 CLS_CC); $$ = $1; }
@@ -705,7 +712,7 @@ encaps_var_offset:
internal_functions_in_yacc:
T_ISSET '(' isset_variables ')' { $$ = $3; }
T_ISSET '(' cvar ')' { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$3 CLS_CC); }
| T_EMPTY '(' cvar ')' { zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 CLS_CC); }
| T_INCLUDE expr { zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 CLS_CC); }
| T_INCLUDE_ONCE expr { zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 CLS_CC); }
@@ -714,10 +721,6 @@ internal_functions_in_yacc:
| T_REQUIRE_ONCE expr { zend_do_include_or_eval(ZEND_REQUIRE_ONCE, &$$, &$2 CLS_CC); }
;
isset_variables:
cvar { zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 CLS_CC); }
| isset_variables ',' { zend_do_boolean_and_begin(&$1, &$2 CLS_CC); } cvar { znode tmp; zend_do_isset_or_isempty(ZEND_ISSET, &tmp, &$4 CLS_CC); zend_do_boolean_and_end(&$$, &$1, &tmp, &$2 CLS_CC); }
;
%%
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+59 -81
View File
@@ -4,7 +4,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -29,7 +29,6 @@
%x ST_LOOKING_FOR_PROPERTY
%x ST_LOOKING_FOR_VARNAME
%x ST_COMMENT
%x ST_ONE_LINE_COMMENT
%option stack
%{
@@ -39,6 +38,7 @@
#endif
#include <errno.h>
#include <limits.h>
#include "zend.h"
#include "zend_alloc.h"
#include "zend_language_parser.h"
@@ -78,10 +78,6 @@
#define YY_DECL int lex_scan(zval *zendlval CLS_DC)
#endif
#if SUPPORT_INTERACTIVE
#define YY_INTERACTIVE
#endif
#define ECHO { ZEND_WRITE( yytext, yyleng ); }
#ifdef ZTS
@@ -90,33 +86,39 @@
# define MY_INPUT input
#endif
#include "zend_istdiostream.h"
#if defined(ZTS) && !defined(HAVE_CLASS_ISTDIOSTREAM)
class istdiostream : public istream
{
private:
stdiobuf _file;
public:
istdiostream (FILE* __f) : istream(), _file(__f) { init(&_file); }
stdiobuf* rdbuf()/* const */ { return &_file; }
};
#endif
#define YY_FATAL_ERROR zend_fatal_scanner_error
#define HANDLE_NEWLINES(s,l) \
do { \
char *p = (s),*boundary = p+(l); \
\
while (p<boundary) { \
if (*p == '\n') { \
CG(zend_lineno)++; \
} else if ((*p == '\r') && (p+1 < boundary) && (*(p+1) != '\n')) { \
CG(zend_lineno)++; \
} \
p++; \
} \
} while (0)
#define HANDLE_NEWLINES(s,l) \
do { \
char *p = (s),*boundary = p+(l); \
\
while(p<boundary) { \
if (*p++=='\n') { \
CG(zend_lineno)++; \
} \
} \
} while(0)
#define HANDLE_NEWLINE(c) \
{ \
if (c == '\n' || c == '\r') { \
if (c=='\n') { \
CG(zend_lineno)++; \
} \
}
#define ZEND_IS_OCT(c) ((c)>='0' && (c)<='7')
#define ZEND_IS_OCT(c) ((c)>='0' && (c)<'8')
#define ZEND_IS_HEX(c) (((c)>='0' && (c)<='9') || ((c)>='a' && (c)<='f') || ((c)>='A' && (c)<='F'))
@@ -249,18 +251,23 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC)
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->handle.fp = fdopen(file_handle->handle.fd, "r");
break;
case ZEND_HANDLE_FP:
/* 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);
@@ -272,6 +279,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->handle.is = new ifstream(file_handle->handle.fd);
file_handle->type = ZEND_HANDLE_FSTREAM;
break;
@@ -286,6 +294,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; */
if (file_handle->handle.fp==stdin) {
file_handle->handle.is = &cin;
} else {
@@ -298,6 +307,8 @@ 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;
@@ -309,13 +320,6 @@ 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
if (file_handle->opened_path) {
file_path = file_handle->opened_path;
} else {
file_path = file_handle->filename;
}
zend_set_compiled_filename(file_path);
CG(zend_lineno) = 1;
return SUCCESS;
@@ -358,6 +362,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS
CG(active_op_array) = op_array;
compiler_result = zendparse(CLS_C);
zend_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;
@@ -375,9 +380,6 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type CLS
retval = NULL;
}
}
if (compilation_successful) {
restore_lexical_state(&original_lex_state CLS_CC);
}
return retval;
}
@@ -481,6 +483,7 @@ zend_op_array *compile_string(zval *source_string, char *filename CLS_DC)
CG(ZFL)->BeginState(ST_IN_SCRIPTING);
#endif
compiler_result = zendparse(CLS_C);
restore_lexical_state(&original_lex_state CLS_CC);
if (compiler_result==1) {
CG(active_op_array) = original_active_op_array;
@@ -492,7 +495,6 @@ zend_op_array *compile_string(zval *source_string, char *filename CLS_DC)
pass_two(op_array);
retval = op_array;
}
restore_lexical_state(&original_lex_state CLS_CC);
}
#ifdef ZTS
delete input_stream;
@@ -610,7 +612,6 @@ TOKENS [;:,.\[\]()|^&+-/*=%!~$<>?@]
ENCAPSED_TOKENS [\[\]{}$]
ESCAPED_AND_WHITESPACE [\n\t\r #'.:;,()|^&+-/*=%!~<>?@]+
ANY_CHAR (.|[\n])
NEWLINE ("\r"|"\n"|"\r\n")
%option noyylineno
%option noyywrap
@@ -750,6 +751,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_LOOKING_FOR_PROPERTY>{ANY_CHAR} {
/*unput(yytext[0]);*/
yyless(0);
yy_pop_state();
}
@@ -902,6 +904,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
return T_CONCAT_EQUAL;
}
<ST_IN_SCRIPTING>"%=" {
return T_MOD_EQUAL;
}
@@ -991,6 +994,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_LOOKING_FOR_VARNAME>{ANY_CHAR} {
/*unput(yytext[0]);*/
yyless(0);
yy_pop_state();
yy_push_state(ST_IN_SCRIPTING);
@@ -1018,7 +1022,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
zendlval->value.lval = LONG_MAX; /* maximal long */
zend_error(E_NOTICE,"Hex number is too big: %s",yytext);
} else {
if (zendlval->value.lval < 0) {
if(zendlval->value.lval < 0) {
/* maintain consistency with the old way */
zendlval->value.dval = (unsigned long) zendlval->value.lval;
zendlval->type = IS_DOUBLE;
@@ -1056,7 +1060,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
filename = "";
}
zendlval->value.str.len = strlen(filename);
zendlval->value.str.val = estrndup(filename, zendlval->value.str.len);
zendlval->value.str.val = estrndup(filename,zendlval->value.str.len);
zendlval->type = IS_STRING;
return T_FILE;
}
@@ -1066,7 +1070,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext, yyleng);
HANDLE_NEWLINES(yytext,yyleng);
return T_INLINE_HTML;
}
@@ -1120,7 +1124,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<INITIAL>"<?php"([ \t]|{NEWLINE}) {
<INITIAL>"<?php"[ \n\r\t] {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
@@ -1130,7 +1134,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<INITIAL>"<?php_track_vars?>"{NEWLINE}? {
<INITIAL>"<?php_track_vars?>"([\n]|"\r\n")? {
zend_error(E_WARNING, "&lt;?php_track_vars?&gt; 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);
@@ -1172,41 +1176,11 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>"#"|"//" {
BEGIN(ST_ONE_LINE_COMMENT);
yymore();
}
<ST_ONE_LINE_COMMENT>"?"|"%"|">" {
yymore();
}
<ST_ONE_LINE_COMMENT>[^\n\r?%>]+ {
yymore();
}
<ST_ONE_LINE_COMMENT>{NEWLINE} {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
BEGIN(ST_IN_SCRIPTING);
CG(zend_lineno)++;
<ST_IN_SCRIPTING>([#]|"//")([^\n\r?]|"?"[^>\n\r])*("?\n"|"?\r\n")? { /* eat one line comments */
HANDLE_NEWLINE(yytext[yyleng-1]);
return T_COMMENT;
}
<ST_ONE_LINE_COMMENT>"?>"|"%>" {
if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
yyless(yyleng-2);
BEGIN(ST_IN_SCRIPTING);
return T_COMMENT;
} else {
yymore();
}
}
<ST_IN_SCRIPTING>"/*" {
CG(comment_start_line) = CG(zend_lineno);
BEGIN(ST_COMMENT);
@@ -1228,7 +1202,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
yymore();
}
<ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">"){NEWLINE}? {
<ST_IN_SCRIPTING>("?>"|"</script"{WHITESPACE}*">")([\n]|"\r\n")? {
zendlval->value.str.val = yytext; /* no copying - intentional */
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
@@ -1238,17 +1212,17 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>"%>"{NEWLINE}? {
<ST_IN_SCRIPTING>"%>"([\n]|"\r\n")? {
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
HANDLE_NEWLINES(yytext,yyleng);
if (CG(asp_tags)) {
BEGIN(INITIAL);
zendlval->value.str.len = yyleng;
zendlval->type = IS_STRING;
zendlval->value.str.val = yytext; /* no copying - intentional */
HANDLE_NEWLINES(yytext,yyleng);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
} else {
yyless(1);
return yytext[0];
zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
return T_INLINE_HTML;
}
}
@@ -1381,7 +1355,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_IN_SCRIPTING>"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} {
<ST_IN_SCRIPTING>"<<<"{TABS_AND_SPACES}{LABEL}("\r")?"\n" {
char *s;
CG(zend_lineno)++;
CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0);
@@ -1408,7 +1382,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<ST_HEREDOC>^{LABEL}(";")?{NEWLINE} {
<ST_HEREDOC>^{LABEL}(";")?("\r")?"\n" {
int label_len;
unsigned char unput_semicolon;
@@ -1483,6 +1457,9 @@ NEWLINE ("\r"|"\n"|"\r\n")
zendlval->value.lval = (long) yytext[0];
if (yyleng == 2) {
yyless(1);
/*unput(yytext[1]);
yytext[1] = 0;
yyleng--;*/
}
return T_CHARACTER;
}
@@ -1496,6 +1473,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
<ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC>"{$" {
zendlval->value.lval = (long) yytext[0];
yy_push_state(ST_IN_SCRIPTING);
/*unput('$');*/
yyless(1);
return T_CURLY_OPEN;
}
+94 -30
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -31,22 +31,24 @@ ZEND_API int le_index_ptr;
static HashTable list_destructors;
ZEND_API int zend_list_insert(void *ptr, int type)
static inline int zend_list_do_insert(HashTable *list, void *ptr, int type, zend_bool valid)
{
int index;
zend_rsrc_list_entry le;
ELS_FETCH();
index = zend_hash_next_free_element(list);
if (index==0) index++;
le.ptr=ptr;
le.type=type;
le.refcount=1;
index = zend_hash_next_free_element(&EG(regular_list));
zend_hash_index_update(&EG(regular_list), index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL);
le.valid = valid;
zend_hash_index_update(list, index, (void *) &le, sizeof(zend_rsrc_list_entry), NULL);
return index;
}
ZEND_API int zend_list_delete(int id)
static inline int zend_list_do_delete(HashTable *list,int id)
{
zend_rsrc_list_entry *le;
ELS_FETCH();
@@ -64,12 +66,11 @@ ZEND_API int zend_list_delete(int id)
}
ZEND_API void *zend_list_find(int id, int *type)
static inline void *zend_list_do_find(HashTable *list,int id, int *type)
{
zend_rsrc_list_entry *le;
ELS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
if (zend_hash_index_find(list, id, (void **) &le)==SUCCESS) {
*type = le->type;
return le->ptr;
} else {
@@ -79,6 +80,22 @@ ZEND_API void *zend_list_find(int id, int *type)
}
ZEND_API int zend_list_insert(void *ptr, int type)
{
ELS_FETCH();
return zend_list_do_insert(&EG(regular_list), ptr, type, 1);
}
ZEND_API int zend_plist_insert(void *ptr, int type)
{
ELS_FETCH();
return zend_list_do_insert(&EG(persistent_list), ptr, type, 1);
}
ZEND_API int zend_list_addref(int id)
{
zend_rsrc_list_entry *le;
@@ -94,6 +111,52 @@ ZEND_API int zend_list_addref(int id)
}
ZEND_API int zend_list_delete(int id)
{
ELS_FETCH();
return zend_list_do_delete(&EG(regular_list), id);
}
ZEND_API int zend_plist_delete(int id)
{
ELS_FETCH();
return zend_list_do_delete(&EG(persistent_list), id);
}
ZEND_API int zend_list_convert_to_number(int id)
{
zend_rsrc_list_entry *le;
ELS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS
&& le->valid) {
return id;
}
return 0;
}
ZEND_API void *zend_list_find(int id, int *type)
{
ELS_FETCH();
return zend_list_do_find(&EG(regular_list), id, type);
}
ZEND_API void *zend_plist_find(int id, int *type)
{
ELS_FETCH();
return zend_list_do_find(&EG(persistent_list), id, type);
}
ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
{
int rsrc_id;
@@ -109,6 +172,22 @@ ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int r
}
ZEND_API int zend_register_false_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
{
int rsrc_id;
ELS_FETCH();
rsrc_id = zend_list_do_insert(&EG(regular_list), rsrc_pointer, rsrc_type, 0);
if (rsrc_result) {
rsrc_result->value.lval = rsrc_id;
rsrc_result->type = IS_RESOURCE;
}
return rsrc_id;
}
ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
{
int id;
@@ -193,18 +272,8 @@ void plist_entry_destructor(void *ptr)
zend_rsrc_list_dtors_entry *ld;
if (zend_hash_index_find(&list_destructors, le->type,(void **) &ld)==SUCCESS) {
switch (ld->type) {
case ZEND_RESOURCE_LIST_TYPE_STD:
if (ld->plist_dtor) {
(ld->plist_dtor)(le->ptr);
}
break;
case ZEND_RESOURCE_LIST_TYPE_EX:
if (ld->plist_dtor_ex) {
ld->plist_dtor_ex(le);
}
break;
EMPTY_SWITCH_DEFAULT_CASE()
if (ld->plist_dtor) {
(ld->plist_dtor)(le->ptr);
}
} else {
zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)",le->type);
@@ -214,12 +283,7 @@ void plist_entry_destructor(void *ptr)
int zend_init_rsrc_list(ELS_D)
{
if (zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0)==SUCCESS) {
EG(regular_list).nNextFreeElement=1; /* we don't want resource id 0 */
return SUCCESS;
} else {
return FAILURE;
}
return zend_hash_init(&EG(regular_list), 0, NULL, list_entry_destructor, 0);
}
@@ -318,13 +382,13 @@ ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_fu
}
int zend_init_rsrc_list_dtors(void)
int zend_init_rsrc_list_dtors()
{
return zend_hash_init(&list_destructors, 50, NULL, NULL, 1);
}
void zend_destroy_rsrc_list_dtors(void)
void zend_destroy_rsrc_list_dtors()
{
zend_hash_destroy(&list_destructors);
}
+8 -3
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -32,6 +32,7 @@ typedef struct _zend_rsrc_list_entry {
void *ptr;
int type;
int refcount;
zend_bool valid;
} zend_rsrc_list_entry;
typedef void (*rsrc_dtor_func_t)(zend_rsrc_list_entry *rsrc);
@@ -70,13 +71,17 @@ int zend_init_rsrc_list(ELS_D);
int zend_init_rsrc_plist(ELS_D);
void zend_destroy_rsrc_list(ELS_D);
void zend_destroy_rsrc_plist(ELS_D);
int zend_init_rsrc_list_dtors(void);
void zend_destroy_rsrc_list_dtors(void);
int zend_init_rsrc_list_dtors();
void zend_destroy_rsrc_list_dtors();
ZEND_API int zend_list_insert(void *ptr, int type);
ZEND_API int zend_plist_insert(void *ptr, int type);
ZEND_API int zend_list_addref(int id);
ZEND_API int zend_list_delete(int id);
ZEND_API int zend_plist_delete(int id);
ZEND_API int zend_list_convert_to_number(int id);
ZEND_API void *zend_list_find(int id, int *type);
ZEND_API void *zend_plist_find(int id, int *type);
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, ...);
+2 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,7 +21,7 @@
#include "zend.h"
#include "zend_llist.h"
ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent)
ZEND_API void zend_llist_init(zend_llist *l, size_t size, void (*dtor)(void *data), unsigned char persistent)
{
l->head = NULL;
l->tail = NULL;
+8 -9
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -29,25 +29,24 @@ typedef struct _zend_llist_element {
char data[1]; /* Needs to always be last in the struct */
} zend_llist_element;
typedef void (*llist_dtor_func_t)(void *);
typedef int (*llist_compare_func_t)(const zend_llist_element *, const zend_llist_element *);
typedef void (*llist_apply_with_arg_func_t)(void *data, void *arg);
typedef void (*llist_apply_with_args_func_t)(void *data, int num_args, va_list args);
typedef void (*llist_apply_func_t)(void *);
typedef struct _zend_llist {
zend_llist_element *head;
zend_llist_element *tail;
size_t size;
llist_dtor_func_t dtor;
void (*dtor)(void *data);
unsigned char persistent;
zend_llist_element *traverse_ptr;
} zend_llist;
typedef int (*llist_compare_func_t)(const zend_llist_element *, const zend_llist_element *);
typedef void(*llist_apply_with_arg_func_t)(void *data, void *arg);
typedef void(*llist_apply_with_args_func_t)(void *data, int num_args, va_list args);
typedef void (*llist_apply_func_t)(void *);
typedef zend_llist_element* zend_llist_position;
BEGIN_EXTERN_C()
ZEND_API void zend_llist_init(zend_llist *l, size_t size, llist_dtor_func_t dtor, unsigned char persistent);
ZEND_API void zend_llist_init(zend_llist *l, size_t size, void (*dtor)(void *data), unsigned char persistent);
ZEND_API void zend_llist_add_element(zend_llist *l, void *element);
ZEND_API void zend_llist_prepend_element(zend_llist *l, void *element);
ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare)(void *element1, void *element2));
+8 -8
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,8 +21,6 @@
#ifndef MODULES_H
#define MODULES_H
#include "zend.h"
#define INIT_FUNC_ARGS int type, int module_number ELS_DC
#define INIT_FUNC_ARGS_PASSTHRU type, module_number ELS_CC
#define SHUTDOWN_FUNC_ARGS int type, int module_number
@@ -32,12 +30,14 @@
#define GINIT_FUNC_ARGS void
#define GINIT_FUNC_ARGS_PASSTHRU
ZEND_API extern unsigned char first_arg_force_ref[];
ZEND_API extern unsigned char first_arg_allow_ref[];
ZEND_API extern unsigned char second_arg_force_ref[];
ZEND_API extern unsigned char second_arg_allow_ref[];
extern unsigned char first_arg_force_ref[];
extern unsigned char first_arg_allow_ref[];
extern unsigned char second_arg_force_ref[];
extern unsigned char second_arg_allow_ref[];
#define ZEND_MODULE_API_NO 20001222
#include "zend.h"
#define ZEND_MODULE_API_NO 20000809
#ifdef ZTS
#define USING_ZTS 1
#else
+13 -11
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -251,15 +251,20 @@ static void zend_update_extended_info(zend_op_array *op_array CLS_DC)
opline++;
continue;
}
if (opline+1<end) {
opline->lineno = (opline+1)->lineno;
}
opline->lineno = (opline+1)->lineno;
} else {
opline->opcode = ZEND_NOP;
}
}
opline++;
}
opline = get_next_op(op_array CLS_CC);
opline->opcode = ZEND_EXT_STMT;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
if (op_array->last>0) {
opline->lineno= op_array->opcodes[op_array->last-2].lineno;
}
}
@@ -274,7 +279,7 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a
int pass_two(zend_op_array *op_array)
{
zend_op *opline, *end;
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) {
@@ -286,15 +291,12 @@ int pass_two(zend_op_array *op_array)
if (CG(handle_op_arrays)) {
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_handler, op_array);
}
opline = op_array->opcodes;
end = opline + op_array->last;
while (opline < end) {
if (opline->op1.op_type == IS_CONST) {
while (opline<end) {
if (opline->op1.op_type==IS_CONST) {
opline->op1.u.constant.is_ref = 1;
opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */
}
if (opline->op2.op_type == IS_CONST) {
if (opline->op2.op_type==IS_CONST) {
opline->op2.u.constant.is_ref = 1;
opline->op2.u.constant.refcount = 2;
}
+98 -109
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include <math.h>
@@ -107,77 +108,58 @@ ZEND_API double zend_string_to_double(const char *number, zend_uint length)
ZEND_API void convert_scalar_to_number(zval *op)
{
switch (op->type) {
case IS_STRING:
{
char *strval;
char *strval;
strval = op->value.str.val;
switch ((op->type=is_numeric_string(strval, op->value.str.len, &op->value.lval, &op->value.dval))) {
case IS_DOUBLE:
case IS_LONG:
break;
#if 0 && WITH_BCMATH
case FLAG_IS_BC:
op->type = IS_DOUBLE; /* may have lost significant digits */
break;
#endif
default:
op->value.lval = strtol(op->value.str.val, NULL, 10);
op->type = IS_LONG;
break;
}
STR_FREE(strval);
if (op->type == IS_STRING) {
strval = op->value.str.val;
switch ((op->type=is_numeric_string(strval, op->value.str.len, &op->value.lval, &op->value.dval))) {
case IS_DOUBLE:
case IS_LONG:
break;
}
case IS_BOOL:
op->type = IS_LONG;
break;
case IS_RESOURCE:
zend_list_delete(op->value.lval);
op->type = IS_LONG;
break;
case IS_NULL:
op->type = IS_LONG;
op->value.lval = 0;
break;
#if 0&&WITH_BCMATH
case FLAG_IS_BC:
op->type = IS_DOUBLE; /* may have lost significant digits */
break;
#endif
default:
op->value.lval = strtol(op->value.str.val, NULL, 10);
op->type = IS_LONG;
break;
}
STR_FREE(strval);
} else if (op->type==IS_BOOL || op->type==IS_RESOURCE) {
op->type = IS_LONG;
} else if (op->type==IS_NULL) {
op->type = IS_LONG;
op->value.lval = 0;
}
}
#define zendi_convert_scalar_to_number(op, holder, result) \
if (op==result) { \
convert_scalar_to_number(op); \
} else { \
switch ((op)->type) { \
case IS_STRING: \
{ \
switch (((holder).type=is_numeric_string((op)->value.str.val, (op)->value.str.len, &(holder).value.lval, &(holder).value.dval))) { \
case IS_DOUBLE: \
case IS_LONG: \
break; \
case FLAG_IS_BC: \
(holder).type = IS_DOUBLE; /* may have lost significant digits */ \
break; \
default: \
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
(holder).type = IS_LONG; \
break; \
} \
(op) = &(holder); \
break; \
} \
case IS_BOOL: \
case IS_RESOURCE: \
(holder).value.lval = (op)->value.lval; \
(holder).type = IS_LONG; \
(op) = &(holder); \
break; \
case IS_NULL: \
(holder).value.lval = 0; \
(holder).type = IS_LONG; \
(op) = &(holder); \
break; \
} \
} else if ((op)->type == IS_STRING) { \
switch (((holder).type=is_numeric_string((op)->value.str.val, (op)->value.str.len, &(holder).value.lval, &(holder).value.dval))) { \
case IS_DOUBLE: \
case IS_LONG: \
break; \
case FLAG_IS_BC: \
(holder).type = IS_DOUBLE; /* may have lost significant digits */ \
break; \
default: \
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
(holder).type = IS_LONG; \
break; \
} \
(op) = &(holder); \
} else if ((op)->type==IS_BOOL || (op)->type==IS_RESOURCE) { \
(holder).value.lval = (op)->value.lval; \
(holder).type = IS_LONG; \
(op) = &(holder); \
} else if ((op)->type==IS_NULL) { \
(holder).value.lval = 0; \
(holder).type = IS_LONG; \
(op) = &(holder); \
}
@@ -185,6 +167,10 @@ ZEND_API void convert_scalar_to_number(zval *op)
#define zendi_convert_to_long(op, holder, result) \
if (op==result) { \
convert_to_long(op); \
} else if ((op)->type==IS_BOOL || (op)->type==IS_RESOURCE) { \
(holder).value.lval = (op)->value.lval; \
(holder).type = IS_LONG; \
(op) = &(holder); \
} else if ((op)->type != IS_LONG) { \
switch ((op)->type) { \
case IS_NULL: \
@@ -194,20 +180,16 @@ ZEND_API void convert_scalar_to_number(zval *op)
(holder).value.lval = (long) (op)->value.dval; \
break; \
case IS_STRING: \
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
(holder).value.lval = strtol((op)->value.str.val, NULL, 10); \
break; \
case IS_ARRAY: \
(holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \
(holder).value.lval = (zend_hash_num_elements((op)->value.ht)?1:0); \
break; \
case IS_OBJECT: \
(holder).value.lval = (zend_hash_num_elements((op)->value.obj.properties)?1:0); \
break; \
case IS_BOOL: \
case IS_RESOURCE: \
(holder).value.lval = (op)->value.lval; \
break; \
default: \
zend_error(E_WARNING, "Cannot convert to ordinal value"); \
zend_error(E_WARNING, "Cannot convert to ordinal value"); \
(holder).value.lval = 0; \
break; \
} \
@@ -270,8 +252,6 @@ ZEND_API void convert_to_long_base(zval *op, int base)
op->value.lval = 0;
break;
case IS_RESOURCE:
zend_list_delete(op->value.lval);
/* break missing intentionally */
case IS_BOOL:
case IS_LONG:
break;
@@ -314,8 +294,6 @@ ZEND_API void convert_to_double(zval *op)
op->value.dval = 0.0;
break;
case IS_RESOURCE:
zend_list_delete(op->value.lval);
/* break missing intentionally */
case IS_BOOL:
case IS_LONG:
op->value.dval = (double) op->value.lval;
@@ -367,8 +345,6 @@ ZEND_API void convert_to_boolean(zval *op)
op->value.lval = 0;
break;
case IS_RESOURCE:
zend_list_delete(op->value.lval);
/* break missing intentionally */
case IS_LONG:
op->value.lval = (op->value.lval ? 1 : 0);
break;
@@ -429,8 +405,6 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
break;
case IS_RESOURCE: {
long tmp = op->value.lval;
zend_list_delete(op->value.lval);
op->value.str.val = (char *) emalloc(sizeof("Resource id #")-1 + MAX_LENGTH_OF_LONG);
op->value.str.len = sprintf(op->value.str.val, "Resource id #%ld", tmp);
break;
@@ -452,13 +426,11 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
zval_dtor(op);
op->value.str.val = estrndup_rel("Array",sizeof("Array")-1);
op->value.str.len = sizeof("Array")-1;
zend_error(E_NOTICE, "Array to string conversion");
break;
case IS_OBJECT:
zval_dtor(op);
op->value.str.val = estrndup_rel("Object",sizeof("Object")-1);
op->value.str.len = sizeof("Object")-1;
zend_error(E_NOTICE, "Object to string conversion");
break;
default:
zval_dtor(op);
@@ -769,6 +741,47 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2)
}
ZEND_API int boolean_or_function(zval *result, zval *op1, zval *op2)
{
zval op1_copy, op2_copy;
result->type = IS_BOOL;
zendi_convert_to_boolean(op1, op1_copy, result);
if (op1->value.lval) {
result->value.lval = 1;
return SUCCESS;
}
zendi_convert_to_boolean(op2, op2_copy, result);
if (op2->value.lval) {
result->value.lval = 1;
return SUCCESS;
}
result->value.lval = 0;
return SUCCESS;
}
ZEND_API int boolean_and_function(zval *result, zval *op1, zval *op2)
{
zval op1_copy, op2_copy;
result->type = IS_BOOL;
zendi_convert_to_boolean(op1, op1_copy, result);
if (!op1->value.lval) {
result->value.lval = 0;
return SUCCESS;
}
zendi_convert_to_boolean(op2, op2_copy, result);
if (!op2->value.lval) {
result->value.lval = 0;
return SUCCESS;
}
result->value.lval = 1;
return SUCCESS;
}
ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2)
{
@@ -1124,7 +1137,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2)
if (op1->type == IS_LONG && op2->type == IS_LONG) {
result->type = IS_LONG;
result->value.lval = op1->value.lval>op2->value.lval?1:(op1->value.lval<op2->value.lval?-1:0);
result->value.lval = ZEND_NORMALIZE_BOOL(op1->value.lval-op2->value.lval);
return SUCCESS;
}
if ((op1->type == IS_DOUBLE || op1->type == IS_LONG)
@@ -1357,7 +1370,7 @@ static void increment_string(zval *str)
return;
}
while (pos >= 0) {
while(pos >= 0) {
ch = s[pos];
if (ch >= 'a' && ch <= 'z') {
if (ch == 'z') {
@@ -1431,32 +1444,8 @@ ZEND_API int increment_function(zval *op1)
op1->value.lval = 1;
op1->type = IS_LONG;
break;
case IS_STRING: {
long lval;
double dval;
char *strval = op1->value.str.val;
switch (is_numeric_string(strval, op1->value.str.len, &lval, &dval)) {
case IS_LONG:
op1->value.lval = lval+1;
op1->type = IS_LONG;
efree(strval);
break;
case IS_DOUBLE:
op1->value.dval = dval+1;
op1->type = IS_DOUBLE;
efree(strval);
break;
#if 0
case FLAG_IS_BC:
/* Not implemented */
#endif
default:
/* Perl style string increment */
increment_string(op1);
break;
}
}
case IS_STRING: /* Perl style string increment */
increment_string(op1);
break;
default:
return FAILURE;
+5 -12
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -41,7 +41,9 @@ ZEND_API int sub_function(zval *result, zval *op1, zval *op2);
ZEND_API int mul_function(zval *result, zval *op1, zval *op2);
ZEND_API int div_function(zval *result, zval *op1, zval *op2);
ZEND_API int mod_function(zval *result, zval *op1, zval *op2);
ZEND_API int boolean_or_function(zval *result, zval *op1, zval *op2);
ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2);
ZEND_API int boolean_and_function(zval *result, zval *op1, zval *op2);
ZEND_API int boolean_not_function(zval *result, zval *op1);
ZEND_API int bitwise_not_function(zval *result, zval *op1);
ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2);
@@ -62,18 +64,13 @@ static inline int is_numeric_string(char *str, int length, long *lval, double *d
long local_lval;
double local_dval;
char *end_ptr;
int conv_base=10;
if (!length) {
return 0;
}
/* handle hex numbers */
if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
conv_base=16;
}
errno=0;
local_lval = strtol(str, &end_ptr, conv_base);
local_lval = strtol(str, &end_ptr, 10);
if (errno!=ERANGE && end_ptr == str+length) { /* integer string */
if (lval) {
*lval = local_lval;
@@ -81,10 +78,6 @@ static inline int is_numeric_string(char *str, int length, long *lval, double *d
return IS_LONG;
}
if (conv_base==16) { /* hex string, under UNIX strtod() messes it up */
return 0;
}
errno=0;
local_dval = strtod(str, &end_ptr);
if (errno!=ERANGE && end_ptr == str+length) { /* floating point string */
@@ -100,7 +93,7 @@ static inline int is_numeric_string(char *str, int length, long *lval, double *d
if (length>16) {
register char *ptr=str, *end=str+length;
while (ptr<end) {
while(ptr<end) {
switch(*ptr++) {
case 'e':
case 'E':
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
+11 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -90,6 +90,16 @@ ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
}
ZEND_API void zval_del_ref(zval **p)
{
(*p)->refcount--;
if ((*p)->refcount==0) {
zval_dtor(*p);
FREE_ZVAL(*p);
}
}
ZEND_API void zval_add_ref(zval **p)
{
(*p)->refcount++;
+2 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2001 Zend Technologies Ltd. (http://www.zend.com) |
| Copyright (c) 1998-2000 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 0.92 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -49,6 +49,7 @@ END_EXTERN_C()
ZEND_API void zval_add_ref(zval **p);
ZEND_API void zval_del_ref(zval **p);
#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper
#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper
+39 -115
View File
@@ -4,64 +4,6 @@ dnl This file contains local autoconf functions.
sinclude(dynlib.m4)
AC_DEFUN(PHP_REMOVE_USR_LIB,[
ac_new_flags=""
for i in [$]$1; do
case [$]i in
-L/usr/lib|-L/usr/lib/) ;;
*) ac_new_flags="[$]ac_new_flags [$]i" ;;
esac
done
$1=[$]ac_new_flags
])
AC_DEFUN(PHP_SETUP_OPENSSL,[
if test "$PHP_OPENSSL" = "no"; then
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
for i in $PHP_OPENSSL; do
if test -r $i/include/openssl/evp.h; then
OPENSSL_DIR=$i
OPENSSL_INC=$i/include
fi
done
if test -z "$OPENSSL_DIR"; then
AC_MSG_ERROR(Cannot find OpenSSL's <evp.h>)
fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="-I$OPENSSL_INC"
AC_MSG_CHECKING(for OpenSSL version)
AC_EGREP_CPP(yes,[
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090500fL
yes
#endif
],[
AC_MSG_RESULT(>= 0.9.5)
],[
AC_MSG_ERROR(OpenSSL version 0.9.5 or greater required.)
])
CPPFLAGS=$old_CPPFLAGS
PHP_ADD_LIBPATH($OPENSSL_DIR/lib)
AC_CHECK_LIB(crypto, CRYPTO_free, [
PHP_ADD_LIBRARY(crypto)
],[
AC_MSG_ERROR(libcrypto not found!)
])
AC_CHECK_LIB(ssl, SSL_CTX_set_ssl_version, [
PHP_ADD_LIBRARY(ssl)
],[
AC_MSG_ERROR(libssl not found!)
])
PHP_ADD_INCLUDE($OPENSSL_INC)
])
dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD)
dnl
dnl Use this macro, if you need to add libraries and or library search
@@ -73,11 +15,11 @@ AC_DEFUN(PHP_EVAL_LIBLINE,[
case "$ac_i" in
-l*)
ac_ii=`echo $ac_i|cut -c 3-`
PHP_ADD_LIBRARY($ac_ii,,$2)
AC_ADD_LIBRARY($ac_ii,,$2)
;;
-L*)
ac_ii=`echo $ac_i|cut -c 3-`
PHP_ADD_LIBPATH($ac_ii,$2)
AC_ADD_LIBPATH($ac_ii,$2)
;;
esac
done
@@ -93,7 +35,7 @@ AC_DEFUN(PHP_EVAL_INCLINE,[
case "$ac_i" in
-I*)
ac_ii=`echo $ac_i|cut -c 3-`
PHP_ADD_INCLUDE($ac_ii)
AC_ADD_INCLUDE($ac_ii)
;;
esac
done
@@ -234,7 +176,7 @@ case "[$]$1" in
shared,*)
ext_output="yes, shared"
ext_shared=yes
$1=`echo "[$]$1"|sed 's/^shared,//'`
$1=`echo $ac_n "[$]$1$ac_c"|sed s/^shared,//`
;;
shared)
ext_output="yes, shared"
@@ -263,8 +205,7 @@ AC_MSG_RESULT($ext_output)
dnl
dnl PHP_ARG_WITH(arg-name, check message, help text[, default-val])
dnl Sets PHP_ARG_NAME either to the user value or to the default value.
dnl default-val defaults to no. This will also set the variable ext_shared,
dnl and will overwrite any previous variable of that name.
dnl default-val defaults to no.
dnl
AC_DEFUN(PHP_ARG_WITH,[
PHP_REAL_ARG_WITH([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z0-9-,A-Z0-9_))
@@ -279,8 +220,7 @@ PHP_ARG_ANALYZE($5)
dnl
dnl PHP_ARG_ENABLE(arg-name, check message, help text[, default-val])
dnl Sets PHP_ARG_NAME either to the user value or to the default value.
dnl default-val defaults to no. This will also set the variable ext_shared,
dnl and will overwrite any previous variable of that name.
dnl default-val defaults to no.
dnl
AC_DEFUN(PHP_ARG_ENABLE,[
PHP_REAL_ARG_ENABLE([$1],[$2],[$3],[$4],PHP_[]translit($1,a-z-,A-Z_))
@@ -344,10 +284,6 @@ fi
AC_DEFUN(PHP_SUBST,[
PHP_VAR_SUBST="$PHP_VAR_SUBST $1"
])
AC_DEFUN(PHP_SUBST_OLD,[
PHP_SUBST($1)
AC_SUBST($1)
])
@@ -400,7 +336,7 @@ AC_DEFUN(PHP_CONFIGURE_PART,[
])
AC_DEFUN(PHP_PROG_SENDMAIL,[
AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib)
AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH:/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib)
if test -n "$PROG_SENDMAIL"; then
AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail])
fi
@@ -535,11 +471,11 @@ AC_DEFUN(AC_PHP_ONCE,[
])
dnl
dnl PHP_EXPAND_PATH(path, variable)
dnl AC_EXPAND_PATH(path, variable)
dnl
dnl expands path to an absolute path and assigns it to variable
dnl
AC_DEFUN(PHP_EXPAND_PATH,[
AC_DEFUN(AC_EXPAND_PATH,[
if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then
$2="$1"
else
@@ -552,13 +488,13 @@ AC_DEFUN(PHP_EXPAND_PATH,[
])
dnl
dnl PHP_ADD_LIBPATH(path[, shared-libadd])
dnl AC_ADD_LIBPATH(path[, shared-libadd])
dnl
dnl add a library to linkpath/runpath
dnl
AC_DEFUN(PHP_ADD_LIBPATH,[
AC_DEFUN(AC_ADD_LIBPATH,[
if test "$1" != "/usr/lib"; then
PHP_EXPAND_PATH($1, ai_p)
AC_EXPAND_PATH($1, ai_p)
if test "$ext_shared" = "yes" && test -n "$2"; then
$2="-R$1 -L$1 [$]$2"
else
@@ -572,11 +508,11 @@ AC_DEFUN(PHP_ADD_LIBPATH,[
])
dnl
dnl PHP_BUILD_RPATH()
dnl AC_BUILD_RPATH()
dnl
dnl builds RPATH from PHP_RPATHS
dnl
AC_DEFUN(PHP_BUILD_RPATH,[
AC_DEFUN(AC_BUILD_RPATH,[
if test "$PHP_RPATH" = "yes" && test -n "$PHP_RPATHS"; then
OLD_RPATHS="$PHP_RPATHS"
PHP_RPATHS=""
@@ -589,19 +525,15 @@ AC_DEFUN(PHP_BUILD_RPATH,[
])
dnl
dnl PHP_ADD_INCLUDE(path [,before])
dnl AC_ADD_INCLUDE(path)
dnl
dnl add a include pat, if before is 1, add in front.
dnl add a include path
dnl
AC_DEFUN(PHP_ADD_INCLUDE,[
AC_DEFUN(AC_ADD_INCLUDE,[
if test "$1" != "/usr/include"; then
PHP_EXPAND_PATH($1, ai_p)
AC_EXPAND_PATH($1, ai_p)
AC_PHP_ONCE(INCLUDEPATH, $ai_p, [
if test "$2"; then
INCLUDES="-I$ai_p $INCLUDES"
else
INCLUDES="$INCLUDES -I$ai_p"
fi
INCLUDES="$INCLUDES -I$ai_p"
])
fi
])
@@ -611,11 +543,11 @@ AC_DEFUN(PHP_X_ADD_LIBRARY,[
])
dnl
dnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]])
dnl AC_ADD_LIBRARY(library[, append[, shared-libadd]])
dnl
dnl add a library to the link line
dnl
AC_DEFUN(PHP_ADD_LIBRARY,[
AC_DEFUN(AC_ADD_LIBRARY,[
case "$1" in
c|c_r|pthread*) ;;
*)
@@ -625,7 +557,7 @@ ifelse($3,,[
if test "$ext_shared" = "yes"; then
PHP_X_ADD_LIBRARY($1,$2,$3)
else
PHP_ADD_LIBRARY($1,$2)
AC_ADD_LIBRARY($1,$2)
fi
])
;;
@@ -633,52 +565,49 @@ ifelse($3,,[
])
dnl
dnl PHP_ADD_LIBRARY_DEFER(library[, append])
dnl AC_ADD_LIBRARY_DEFER(library[, append])
dnl
dnl add a library to the link line (deferred)
AC_DEFUN(PHP_ADD_LIBRARY_DEFER,[
AC_DEFUN(AC_ADD_LIBRARY_DEFER,[
ifelse($#, 1, DLIBS="-l$1 $DLIBS", DLIBS="$DLIBS -l$1")
])
dnl
dnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])
dnl AC_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])
dnl
dnl add a library to the link line and path to linkpath/runpath.
dnl if shared-libadd is not empty and $ext_shared is yes,
dnl shared-libadd will be assigned the library information
dnl
AC_DEFUN(PHP_ADD_LIBRARY_WITH_PATH,[
AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH,[
ifelse($3,,[
if test -n "$2"; then
PHP_ADD_LIBPATH($2)
AC_ADD_LIBPATH($2)
fi
PHP_ADD_LIBRARY($1)
AC_ADD_LIBRARY($1)
],[
if test "$ext_shared" = "yes"; then
$3="-l$1 [$]$3"
if test -n "$2"; then
PHP_ADD_LIBPATH($2,$3)
AC_ADD_LIBPATH($2,$3)
fi
else
PHP_ADD_LIBRARY_WITH_PATH($1,$2)
AC_ADD_LIBRARY_WITH_PATH($1,$2)
fi
])
])
dnl
dnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path)
dnl AC_ADD_LIBRARY_DEFER_WITH_PATH(library, path)
dnl
dnl add a library to the link line (deferred)
dnl and path to linkpath/runpath (not deferred)
dnl
AC_DEFUN(PHP_ADD_LIBRARY_DEFER_WITH_PATH,[
PHP_ADD_LIBPATH($2)
PHP_ADD_LIBRARY_DEFER($1)
AC_DEFUN(AC_ADD_LIBRARY_DEFER_WITH_PATH,[
AC_ADD_LIBPATH($2)
AC_ADD_LIBRARY_DEFER($1)
])
dnl
dnl Set libtool variable
dnl
AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
LIBTOOL='$(SHELL) $(top_builddir)/libtool $1'
])
@@ -686,7 +615,7 @@ AC_DEFUN(AM_SET_LIBTOOL_VARIABLE,[
dnl
dnl Check for cc option
dnl
AC_DEFUN(PHP_CHECK_CC_OPTION,[
AC_DEFUN(AC_CHECK_CC_OPTION,[
echo "main(){return 0;}" > conftest.$ac_ext
opt="$1"
changequote({,})
@@ -731,7 +660,7 @@ PHP_SUBST(HSREGEX)
dnl
dnl See if we have broken header files like SunOS has.
dnl
AC_DEFUN(PHP_MISSING_FCLOSE_DECL,[
AC_DEFUN(AC_MISSING_FCLOSE_DECL,[
AC_MSG_CHECKING([for fclose declaration])
AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[
AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ])
@@ -745,7 +674,7 @@ AC_DEFUN(PHP_MISSING_FCLOSE_DECL,[
dnl
dnl Check for broken sprintf()
dnl
AC_DEFUN(PHP_AC_BROKEN_SPRINTF,[
AC_DEFUN(AC_BROKEN_SPRINTF,[
AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
ac_cv_broken_sprintf=no
@@ -862,7 +791,7 @@ dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
dnl Written by Paul Eggert <eggert@twinsun.com>.
AC_DEFUN(PHP_SYS_LFS,
AC_DEFUN(AC_SYS_LFS,
[dnl
# If available, prefer support for large files unless the user specified
# one of the CPPFLAGS, LDFLAGS, or LIBS variables.
@@ -897,7 +826,7 @@ AC_DEFUN(PHP_SYS_LFS,
esac
])
AC_DEFUN(PHP_SOCKADDR_SA_LEN,[
AC_DEFUN(AC_SOCKADDR_SA_LEN,[
AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>],
@@ -954,11 +883,6 @@ int main(void) {
fi
])
AC_DEFUN(AC_ADD_LIBPATH, [indir([PHP_ADD_LIBPATH])])
AC_DEFUN(AC_ADD_LIBRARY, [indir([PHP_ADD_LIBRARY])])
AC_DEFUN(AC_ADD_LIBRARY_WITH_PATH, [indir([PHP_ADD_LIBRARY_WITH_PATH])])
AC_DEFUN(AC_ADD_INCLUDE, [indir([PHP_ADD_INCLUDE])])
AC_DEFUN(PHP_FOPENCOOKIE,[
AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])
+6 -7
View File
@@ -21,7 +21,7 @@ include generated_lists
TOUCH_FILES = mkinstalldirs install-sh missing
LT_TARGETS = ltmain.sh config.guess config.sub
LT_TARGETS = ltconfig ltmain.sh config.guess config.sub
makefile_in_files = $(makefile_am_files:.am=.in)
makefile_files = $(makefile_am_files:e.am=e)
@@ -54,24 +54,23 @@ $(makefile_in_files): $(makefile_am_files) aclocal.m4 configure.in $(config_m4_f
fi; \
done
@test -f want_dependencies || flag=-i; \
automake -a $$flag $(AMFLAGS) $(makefile_files) 2>&1 | $(SUPPRESS_WARNINGS)
automake -a $$flag $(AMFLAGS) $(makefile_files) \
|| true >&2
@for i in $(LT_TARGETS); do mv $$i.bak $$i; done
aclocal.m4: configure.in acinclude.m4 dynlib.m4
aclocal 2>&1 | $(SUPPRESS_WARNINGS)
SUPPRESS_WARNINGS = (egrep -v '(warning: AC_TRY_RUN called without default to allow cross compiling|AC_PROG_CXXCPP was called before AC_PROG_CXX|.*AM_PROG_LEX.*|defined in acinclude.m4 but never used)'||true)
aclocal
$(config_h_in): configure acconfig.h
# explicitly remove target since autoheader does not seem to work
# correctly otherwise (timestamps are not updated)
@echo rebuilding $@
@rm -f $@
@autoheader 2>&1 | $(SUPPRESS_WARNINGS)
@autoheader 2>&1 | (grep -v 'warning: AC_TRY_RUN called without default to allow cross compiling'||true)
$(TOUCH_FILES):
touch $(TOUCH_FILES)
configure: aclocal.m4 configure.in $(config_m4_files)
@echo rebuilding $@
@autoconf 2>&1 | $(SUPPRESS_WARNINGS)
@autoconf 2>&1 | (grep -v 'warning: AC_TRY_RUN called without default to allow cross compiling'||true)
+5 -8
View File
@@ -16,7 +16,7 @@
# | Sascha Schumann <sascha@schumann.cx> |
# +----------------------------------------------------------------------+
#
# $Id: buildcheck.sh,v 1.8.2.1 2001-05-12 09:03:58 andi Exp $
# $Id: buildcheck.sh,v 1.3 2000-08-20 05:39:37 sas Exp $
#
echo "buildconf: checking installation..."
@@ -58,9 +58,7 @@ echo "buildconf: automake version $am_version (ok)"
fi
# libtool 1.3.3 or newer
libtool=`which libtool`
if test ! -f "$libtool"; then libtool=`which glibtool`; fi
lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
lt_pversion=`libtool --version 2>/dev/null|sed -e 's/^[^0-9]*//' -e 's/[- ].*//'`
if test "$lt_pversion" = ""; then
echo "buildconf: libtool not found."
echo " You need libtool version 1.3 or newer installed"
@@ -69,19 +67,18 @@ exit 1
fi
lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
IFS=.; set $lt_version; IFS=' '
if test "$1" -gt "1" || test "$2" -gt "3" || (test "$2" = "3" && (test "$3" = "c" || test "$3" -ge "3"))
if test "$1" -gt "1" || test "$2" -gt "3" || test "$2" = "3" && (test "$3" = "c" || test "$3" -ge "3")
then
echo "buildconf: libtool version $lt_pversion (ok)"
else
echo "buildconf: libtool version $lt_pversion found."
echo " You need libtool version 1.4 or newer installed"
echo " You need libtool version 1.3.3 or newer installed"
echo " to build PHP from CVS."
exit 1
fi
am_prefix=`which automake | sed -e 's#/[^/]*/[^/]*$##'`
lt_prefix=`which $libtool | sed -e 's#/[^/]*/[^/]*$##'`
lt_prefix=`which libtool | sed -e 's#/[^/]*/[^/]*$##'`
if test "$am_prefix" != "$lt_prefix"; then
echo "WARNING: automake and libtool are installed in different"
echo " directories. This may cause aclocal to fail."
-6
View File
@@ -1,6 +0,0 @@
/phpext_/ {
if (old_filename != FILENAME) {
printf "#include \"" FILENAME "\"@NEWLINE@"
old_filename = FILENAME
}
}
+1 -5
View File
@@ -54,11 +54,7 @@ distclean: distclean-recursive clean-x
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
test: $(top_builddir)/php
@if test "$(TESTS)" = ""; then \
TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(srcdir); \
else \
TOP_BUILDDIR=$(top_builddir) TOP_SRCDIR=$(top_srcdir) $(top_builddir)/php -C -q $(top_srcdir)/run-tests.php $(TESTS); \
fi
@$(top_builddir)/php -q $(top_srcdir)/run-tests.php `pwd`
include $(builddir)/.deps
+1 -7
View File
@@ -53,13 +53,7 @@ clean-x:
distclean: distclean-recursive clean-x
rm -f config.cache config.log config.status config_vars.mk libtool \
config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
cvsclean:
@for i in `find . -name .cvsignore`; do \
(cd `dirname $$i` 2>/dev/null && rm -rf `cat .cvsignore` *.o *.a || true); \
done
@rm -f $(SUBDIRS) 2>/dev/null || true
php_config.h stamp-h Makefile build-defs.h php4.spec libphp4.module
install-modules:
@test -d modules && \
+233 -421
View File
@@ -1,10 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
timestamp='2001-04-20'
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@@ -32,86 +30,26 @@ timestamp='2001-04-20'
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit build system type.
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
# Use $HOST_CC if defined. $CC may point to a cross-compiler
if test x"$CC_FOR_BUILD" = x; then
if test x"$HOST_CC" != x; then
CC_FOR_BUILD="$HOST_CC"
else
if test x"$CC" != x; then
CC_FOR_BUILD="$CC"
else
CC_FOR_BUILD=cc
fi
fi
fi
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int dummy(){}" > $dummy.c
for c in cc gcc c89 ; do
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
if test $? = 0 ; then
CC_FOR_BUILD="$c"; break
fi
done
rm -f $dummy.c $dummy.o $dummy.rel
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@@ -120,9 +58,12 @@ fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
dummy=dummy-$$
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -136,7 +77,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# object file format.
# Determine the machine/vendor (is the vendor relevant).
case "${UNAME_MACHINE}" in
amiga) machine=m68k-unknown ;;
amiga) machine=m68k-cbm ;;
arm32) machine=arm-unknown ;;
atari*) machine=m68k-atari ;;
sun3*) machine=m68k-sun ;;
@@ -146,24 +87,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ibmrt|romp-ibm) machine=romp-ibm ;;
*) machine=${UNAME_MACHINE}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE}" in
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The Operating System including object format.
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
@@ -240,7 +173,7 @@ EOF
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
echo m68k-cbm-sysv4
exit 0;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
@@ -272,7 +205,7 @@ EOF
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
SR2?01:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
@@ -408,13 +341,10 @@ EOF
EOF
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm -f $dummy.c $dummy && exit 0
&& rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
@@ -462,17 +392,9 @@ EOF
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
i?86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >$dummy.c
@@ -486,7 +408,7 @@ EOF
exit(0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
@@ -495,9 +417,9 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:[45])
*:AIX:*:4)
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -505,7 +427,7 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
IBM_REV=4.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
@@ -531,28 +453,10 @@ EOF
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
case "${HPUX_REV}" in
11.[0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
esac ;;
esac
fi ;;
esac
if [ "${HP_ARCH}" = "" ]; then
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
@@ -587,15 +491,10 @@ EOF
}
EOF
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy
fi ;;
esac
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >$dummy.c
@@ -623,7 +522,7 @@ EOF
exit (0);
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
@@ -642,7 +541,7 @@ EOF
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
i*86:OSF1:*:*)
i?86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
@@ -687,11 +586,8 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
@@ -699,16 +595,18 @@ EOF
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
@@ -729,9 +627,6 @@ EOF
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
@@ -750,41 +645,58 @@ EOF
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
mips:Linux:*:*)
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
;;
ppc:Linux:*:*)
# Determine Lib Version
cat >$dummy.c <<EOF
*:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_help_string=`cd /; ld --help 2>&1`
ld_supported_emulations=`echo $ld_help_string \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
*ia64)
echo "${UNAME_MACHINE}-unknown-linux"
exit 0
;;
i?86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
elf_i?86)
echo "${UNAME_MACHINE}-pc-linux"
exit 0
;;
i?86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0
;;
sparclinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
armlinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32arm*)
echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
exit 0
;;
armelf_linux*)
echo "${UNAME_MACHINE}-unknown-linux-gnu"
exit 0
;;
m68klinux)
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
exit 0
;;
elf32ppc | elf32ppclinux)
# Determine Lib Version
cat >$dummy.c <<EOF
#include <features.h>
#if defined(__GLIBC__)
extern char __libc_version[];
@@ -797,127 +709,123 @@ main(argc, argv)
#if defined(__GLIBC__)
printf("%s %s\n", __libc_version, __libc_release);
#else
printf("unknown\n");
printf("unkown\n");
#endif
return 0;
}
EOF
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then LIBC="libc1" ; fi
fi
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0 ;;
alpha:Linux:*:*)
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0) UNAME_MACHINE="alpha" ;;
1-0) UNAME_MACHINE="alphaev5" ;;
1-1) UNAME_MACHINE="alphaev56" ;;
1-101) UNAME_MACHINE="alphapca56" ;;
2-303) UNAME_MACHINE="alphaev6" ;;
2-307) UNAME_MACHINE="alphaev67" ;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
LIBC=""
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
if test "$?" = 0 ; then
LIBC="libc1"
./$dummy | grep 1\.99 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit 0 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit 0 ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
ld_supported_emulations=`cd /; ld --help 2>&1 \
| sed -ne '/supported emulations:/!d
s/[ ][ ]*/ /g
s/.*supported emulations: *//
s/ .*//
p'`
case "$ld_supported_emulations" in
i*86linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit 0
;;
elf_i*86)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
i*86coff)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
rm -f $dummy.c $dummy
echo powerpc-unknown-linux-gnu${LIBC}
exit 0
;;
esac
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i*86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
if test "${UNAME_MACHINE}" = "alpha" ; then
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
LIBC=""
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
1-0)
UNAME_MACHINE="alphaev5"
;;
1-1)
UNAME_MACHINE="alphaev56"
;;
1-101)
UNAME_MACHINE="alphapca56"
;;
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
esac
objdump --private-headers $dummy | \
grep ld.so.1 > /dev/null
if test "$?" = 0 ; then
LIBC="libc1"
fi
fi
rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
elif test "${UNAME_MACHINE}" = "mips" ; then
cat >$dummy.c <<EOF
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __MIPSEB__
printf ("%s-unknown-linux-gnu\n", argv[1]);
#endif
#ifdef __MIPSEL__
printf ("%sel-unknown-linux-gnu\n", argv[1]);
#endif
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
elif test "${UNAME_MACHINE}" = "s390"; then
echo s390-ibm-linux && exit 0
else
# Either a pre-BFD a.out linker (linux-gnuoldld)
# or one that does not give us useful --help.
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
# If ld does not provide *any* "supported emulations:"
# that means it is gnuoldld.
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
case "${UNAME_MACHINE}" in
i?86)
VENDOR=pc;
;;
*)
VENDOR=unknown;
;;
esac
# Determine whether the default compiler is a.out or elf
cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@@ -941,16 +849,15 @@ EOF
return 0;
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i*86:DYNIX/ptx:4*:*)
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i*86:UNIX_SV:4.2MP:2.*)
i?86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
@@ -958,7 +865,7 @@ EOF
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
@@ -966,7 +873,7 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
i*86:*:5:7*)
i?86:*:5:7*)
# Fixed at (any) Pentium or better
UNAME_MACHINE=i586
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
@@ -975,7 +882,7 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i*86:*:3.2:*)
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
@@ -993,7 +900,7 @@ EOF
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
i*86:*DOS:*:*)
i?86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*)
@@ -1021,7 +928,7 @@ EOF
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -1032,24 +939,21 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
m68*:LynxOS:2.*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:*)
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
@@ -1083,7 +987,7 @@ EOF
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:6*:*)
news*:NEWS-OS:*:6*)
echo mips-sony-newsos6
exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
@@ -1126,52 +1030,15 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-[KW]:NONSTOP_KERNEL:*:*)
NSR-W:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit 0 ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit 0 ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit 0 ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit 0 ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1263,24 +1130,11 @@ main ()
#endif
#if defined (vax)
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#if defined (alliant) && defined (i860)
@@ -1291,7 +1145,7 @@ main ()
}
EOF
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
@@ -1324,48 +1178,6 @@ then
esac
fi
cat >&2 <<EOF
$0: unable to guess system type
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
#echo '(Unable to guess system type)' 1>&2
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
Vendored
+72 -166
View File
@@ -1,10 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
# Free Software Foundation, Inc.
timestamp='2001-04-20'
#
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -29,6 +27,7 @@ timestamp='2001-04-20'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
@@ -51,73 +50,30 @@ timestamp='2001-04-20'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
nto-qnx* | linux-gnu*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -143,7 +99,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis)
-apple)
os=
basic_machine=$1
;;
@@ -215,40 +171,30 @@ esac
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
| pyramid | mn10200 | mn10300 | tron | a29k \
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| hppa64 \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | sh[34] \
| powerpc | powerpcle \
| 1750a | dsp16xx | pdp10 | pdp11 \
| mips16 | mips64 | mipsel | mips64el \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
| v850 | c4x \
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
| pj | pjl | h8500)
| mips64vr5000 | miprs64vr5000el | mcore \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30 | avr)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
i[34567]86)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
@@ -258,30 +204,27 @@ case $basic_machine in
;;
# Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here.
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| hppa2.0n-* | hppa64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
| alphaev6[78]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \
| sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
| mips16-* | mips64-* | mipsel-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
| [cjt]90-* \
| f301-* | armv*-* | s390-* | sv1-* | t3e-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \
| bs2000-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -318,14 +261,14 @@ case $basic_machine in
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
basic_machine=m68k-cbm
;;
amigaos | amigados)
basic_machine=m68k-unknown
basic_machine=m68k-cbm
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
basic_machine=m68k-cbm
os=-sysv4
;;
apollo68)
@@ -372,16 +315,13 @@ case $basic_machine in
basic_machine=cray2-cray
os=-unicos
;;
[cjt]90)
basic_machine=${basic_machine}-cray
[ctj]90-cray)
basic_machine=c90-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -429,10 +369,6 @@ case $basic_machine in
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
@@ -508,19 +444,19 @@ case $basic_machine in
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
i[34567]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
i[34567]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
i[34567]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
i[34567]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
@@ -532,6 +468,14 @@ case $basic_machine in
basic_machine=i386-unknown
os=-vsta
;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
@@ -557,10 +501,6 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe)
basic_machine=m68000-convergent
;;
@@ -591,7 +531,7 @@ case $basic_machine in
os=-coff
;;
msdos)
basic_machine=i386-pc
basic_machine=i386-unknown
os=-msdos
;;
mvs)
@@ -655,10 +595,6 @@ case $basic_machine in
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
@@ -694,28 +630,28 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen)
pentium | p5 | k5 | k6 | nexen)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon)
pentiumpro | p6 | 6x86)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i686-pc
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
pentium-* | p5-* | k5-* | k6-* | nexen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
pentiumpro-* | p6-* | 6x86-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
power) basic_machine=rs6000-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
@@ -730,10 +666,6 @@ case $basic_machine in
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@@ -825,10 +757,6 @@ case $basic_machine in
basic_machine=t3e-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -924,20 +852,13 @@ case $basic_machine in
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh3 | sh4)
basic_machine=sh-unknown
;;
sparc | sparcv9 | sparcv9b)
sparc | sparcv9)
basic_machine=sparc-sun
;;
cydra)
@@ -959,9 +880,6 @@ case $basic_machine in
basic_machine=c4x-none
os=-coff
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
@@ -1021,13 +939,12 @@ case $os in
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
| -openstep* | -oskit*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
x86-* | i[34567]86-*)
;;
*)
os=-nto$os
@@ -1083,7 +1000,7 @@ case $os in
-ns2 )
os=-nextstep2
;;
-nsk*)
-nsk)
os=-nsk
;;
# Preserve the version number of sinix5.
@@ -1120,7 +1037,7 @@ case $os in
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-*mint | -*MiNT)
os=-mint
;;
-none)
@@ -1154,9 +1071,6 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
@@ -1265,7 +1179,7 @@ case $basic_machine in
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
f301-fujitsu)
os=-uxpv
;;
*-rom68k)
@@ -1343,7 +1257,7 @@ case $basic_machine in
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-*mint | -*MiNT)
vendor=atari
;;
esac
@@ -1352,11 +1266,3 @@ case $basic_machine in
esac
echo $basic_machine$os
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
+128 -199
View File
@@ -51,7 +51,7 @@ dnl ## All of these are normally in the extension directories.
dnl ## Diversion 5 is the last one. Here we generate files and clean up.
dnl ## This is where the version number is changed from now on!
AM_INIT_AUTOMAKE(php, 4.0.6RC4, nodefine)
AM_INIT_AUTOMAKE(php, 4.0.4RC5, nodefine)
PHP_VERSION=$VERSION
echo "/* automatically generated by configure */" > php_version.h.new
@@ -106,9 +106,6 @@ case "$host_alias" in
CPPFLAGS="$CPPFLAGS -traditional-cpp";;
*bsdi*)
BSD_MAKEFILE=yes;;
*beos*)
beos_threads=1
LIBS="$LIBS -lbe -lroot";;
esac
AM_PROG_CC_STDC
@@ -117,10 +114,7 @@ AC_PROG_RANLIB
AC_PROG_CC_C_O
AC_PROG_LN_S
AC_PROG_LEX
if test -n "$LEX"; then
AC_DECL_YYTEXT
fi
AM_PROG_LEX
dnl ## Make flex scanners use const if they can, even if __STDC__ is not
dnl ## true, for compilers like Sun's that only set __STDC__ true in
@@ -213,10 +207,10 @@ INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
AC_CHECK_LIB(socket, socket, [
PHP_ADD_LIBRARY(socket)
AC_ADD_LIBRARY(socket)
AC_DEFINE(HAVE_LIBSOCKET,1,[ ]) ], [
AC_CHECK_LIB(socket, htonl, [
PHP_ADD_LIBRARY(socket)
AC_ADD_LIBRARY(socket)
])])
dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try
@@ -231,28 +225,30 @@ unset ac_cv_func_yp_get_default_domain
if test "$php_no_nsl_checks" != "yes"; then
AC_CHECK_LIB(nsl, gethostname, [
PHP_ADD_LIBRARY(nsl)
AC_ADD_LIBRARY(nsl)
AC_DEFINE(HAVE_LIBNSL,1,[ ]) ],[
AC_CHECK_LIB(nsl, gethostbyaddr, [
PHP_ADD_LIBRARY(nsl)
AC_ADD_LIBRARY(nsl)
AC_DEFINE(HAVE_LIBNSL,1,[ ]) ], [])
])
fi
AC_CHECK_LIB(dl, dlopen,[PHP_ADD_LIBRARY(dl)])
AC_CHECK_LIB(crypt, crypt, [
AC_ADD_LIBRARY(crypt)
AC_DEFINE(HAVE_LIBCRYPT,1,[ ]) ], [])
AC_CHECK_LIB(dl, dlopen,[AC_ADD_LIBRARY(dl)])
dnl The sin may be in a library which need not be specifed
dnl as well as res_search resides in libsocket
AC_CHECK_LIB(m, sin)
dnl Only include libbind if inet_aton is not found in
dnl libresolv.
AC_CHECK_LIB(resolv, inet_aton, [], [
AC_CHECK_LIB(bind, inet_aton, [], [
AC_CHECK_LIB(bind, __inet_aton)
])
])
AC_CHECK_LIB(bind, inet_aton, [
AC_ADD_LIBRARY(bind)
AC_DEFINE(HAVE_LIBBIND,1,[Whether you have bind]) ], [])
AC_CHECK_LIB(resolv, inet_aton)
dnl The res_search may be in libsocket as well, and if it is
dnl make sure to check for dn_skipname in libresolv, or if res_search
@@ -280,36 +276,30 @@ if test "`uname -s 2>/dev/null`" != "QNX"; then
else
AC_CHECK_HEADERS(dirent.h)
fi
PHP_MISSING_FCLOSE_DECL
AC_MISSING_FCLOSE_DECL
dnl QNX requires unix.h to allow functions in libunix to work properly
AC_CHECK_HEADERS(
alloca.h \
arpa/inet.h \
arpa/nameser.h \
crypt.h \
fcntl.h \
grp.h \
ieeefp.h \
limits.h \
locale.h \
netinet/in.h \
pwd.h \
resolv.h \
signal.h \
stdarg.h \
stdlib.h \
string.h \
syslog.h \
sysexits.h \
sys/file.h \
sys/mman.h \
sys/mount.h \
sys/resource.h \
sys/select.h \
sys/socket.h \
sys/statfs.h \
sys/statvfs.h \
sys/sysexits.h \
sys/time.h \
sys/types.h \
sys/varargs.h \
@@ -330,7 +320,7 @@ PHP_SOCKLEN_T
AC_CHECK_SIZEOF(long, 8)
AC_CHECK_SIZEOF(int, 4)
test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
test -d /usr/ucblib && AC_ADD_LIBPATH(/usr/ucblib)
dnl Check for members of the stat structure
AC_STRUCT_ST_BLKSIZE
@@ -350,8 +340,7 @@ AC_TYPE_UID_T
dnl Check for IPv6 support
AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
[AC_TRY_COMPILE([ #include <sys/types.h>
#include <sys/socket.h>
[AC_TRY_COMPILE([#include <sys/socket.h>
#include <netinet/in.h>], [struct sockaddr_in6 s; int i=AF_INET6; s],
ac_cv_ipv6_support=yes, ac_cv_ipv6_support=no)])
if test "$ac_cv_ipv6_support" = yes; then
@@ -362,18 +351,13 @@ dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(
asctime_r \
chroot \
crypt \
ctime_r \
cuserid \
flock \
gai_strerror \
gcvt \
getlogin \
gethostbyaddr \
getprotobyname \
getprotobynumber \
getservbyname \
getservbyport \
getrusage \
gettimeofday \
gmtime_r \
@@ -391,10 +375,8 @@ putenv \
random \
rand_r \
regcomp \
res_search \
setitimer \
setlocale \
localeconv \
setsockopt \
setvbuf \
shutdown \
@@ -406,7 +388,6 @@ statfs \
statvfs \
std_syslog \
strcasecmp \
strcoll \
strdup \
strerror \
strftime \
@@ -433,7 +414,7 @@ fi
AC_REPLACE_FUNCS(strlcat strlcpy getopt)
AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
PHP_AC_BROKEN_SPRINTF
AC_BROKEN_SPRINTF
PHP_DECLARED_TIMEZONE
PHP_TIME_R_TYPE
PHP_READDIR_R_TYPE
@@ -460,6 +441,25 @@ fi
divert(4)
PHP_ARG_WITH(config-file-path,whether to use a configuration file,
[ --with-config-file-path=PATH
Sets the path in which to look for php.ini.
defaults to /usr/local/lib], yes)
if test "$PHP_CONFIG_FILE_PATH" = "yes"; then
PHP_CONFIG_FILE_PATH="/usr/local/lib"
fi
if test "$PHP_CONFIG_FILE_PATH" != "no"; then
AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "$PHP_CONFIG_FILE_PATH",[ ])
AC_DEFINE(USE_CONFIG_FILE, 1, [ ])
else
AC_DEFINE(CONFIGURATION_FILE_PATH, 0, [ ])
AC_DEFINE(USE_CONFIG_FILE, 0, [ ])
fi
PHP_ARG_ENABLE(debug, whether to include debugging symbols,
[ --enable-debug Compile with debugging symbols.], no)
@@ -471,45 +471,6 @@ else
ZEND_DEBUG=no
fi
PHP_ARG_WITH(layout,[layout of installed files],
[ --with-layout=TYPE Sets how installed files will be laid out. Type is
one of "PHP" (default) or "GNU"], PHP)
PHP_ARG_WITH(config-file-path,[path to configuration file],
[ --with-config-file-path=PATH
Sets the path in which to look for php.ini,
defaults to PREFIX/lib], DEFAULT)
if test "x$PHP_CONFIG_FILE_PATH" = "xDEFAULT"; then
case $PHP_LAYOUT in
GNU)
PHP_CONFIG_FILE_PATH="$sysconfdir"
oldstyleextdir=no;;
*)
PHP_CONFIG_FILE_PATH="$libdir"
oldstyleextdir=yes;;
esac
fi
# compatibility
if test "x$with_pear" = "x" -a "x$enable_pear" = "xno"; then
with_pear="no"
fi
PHP_ARG_WITH(pear, [whether to install PEAR, and where],
[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php)
--without-pear Do not install PEAR], DEFAULT)
if test "x$PHP_PEAR" != "xno"; then
PEAR_DIR=pear
fi
if test "x$PHP_PEAR" = "xDEFAULT"; then
case $PHP_LAYOUT in
GNU) PEAR_INSTALLDIR="$datadir/pear";;
*) PEAR_INSTALLDIR="$libdir/php";;
esac
fi
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
@@ -545,11 +506,48 @@ AC_ARG_WITH(exec-dir,
])
PHP_ARG_WITH(openssl,for OpenSSL support,
[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.5) ])
[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6) ])
if test "$PHP_OPENSSL" = "yes"; then
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
AC_DEFUN(PHP_SETUP_OPENSSL,[
if test "$PHP_OPENSSL" = "no"; then
PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
fi
for i in $PHP_OPENSSL; do
if test -r $i/include/openssl/evp.h; then
OPENSSL_DIR=$i
OPENSSL_INC=$i/include
fi
done
if test -z "$OPENSSL_DIR"; then
AC_MSG_ERROR(Cannot find OpenSSL's <evp.h>)
fi
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS="-I$OPENSSL_INC"
AC_MSG_CHECKING(for OpenSSL version)
AC_EGREP_CPP(yes,[
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
yes
#endif
],[
AC_MSG_RESULT(>= 0.9.6)
],[
AC_MSG_ERROR(OpenSSL version 0.9.6 or greater required.)
])
CPPFLAGS=$old_CPPFLAGS
AC_ADD_LIBPATH($OPENSSL_DIR/lib)
AC_ADD_LIBRARY(ssl)
AC_ADD_LIBRARY(crypto)
AC_ADD_INCLUDE($OPENSSL_INC)
])
if test "$PHP_OPENSSL" != "no"; then
PHP_SETUP_OPENSSL
fi
@@ -584,17 +582,17 @@ if test "$PHP_LIBGCC" = "yes"; then
if test -z "$libgcc_libpath"; then
AC_MSG_ERROR(Cannot locate libgcc. Make sure that gcc is in your path)
fi
PHP_ADD_LIBPATH($libgcc_libpath)
PHP_ADD_LIBRARY(gcc, yes)
AC_ADD_LIBPATH($libgcc_libpath)
AC_ADD_LIBRARY(gcc, yes)
fi
PHP_ARG_ENABLE(short-tags,whether to enable short tags by default,
[ --disable-short-tags Disable the short-form <? start tag by default.],yes)
if test "$PHP_SHORT_TAGS" = "yes"; then
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG,"1",[ ])
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG,1,[ ])
else
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG,"0",[ ])
AC_DEFINE(DEFAULT_SHORT_OPEN_TAG,0,[ ])
fi
@@ -607,32 +605,27 @@ PHP_ARG_ENABLE(dmalloc,whether to enable dmalloc,
if test "$PHP_DMALLOC" = "yes"; then
AC_DEFINE(HAVE_DMALLOC,1,[Whether you have dmalloc])
PHP_ADD_LIBRARY(dmalloc)
AC_ADD_LIBRARY(dmalloc)
CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK"
fi
# temporary until streams are better integrated
PHP_ARG_ENABLE(php-streams,whether to enable php streams,
[ --enable-php-streams Include experimental php streams.
Do not use unless you are testing the code!])
PHP_ARG_ENABLE(pear,whether to install PEAR,
[ --disable-pear Do not install PEAR],yes)
if test "$PHP_PHP_STREAMS" = "yes"; then
AC_DEFINE(HAVE_PHP_STREAM, 1, [Whether to use php streams])
if test "$PHP_PEAR" = "yes"; then
PEAR_DIR=pear
fi
AC_CHECK_LIB(crypt, crypt, [
PHP_ADD_LIBRARY(crypt)
AC_DEFINE(HAVE_LIBCRYPT,1,[ ])
AC_DEFINE(HAVE_CRYPT,1,[ ])
], [])
PHP_OUTPUT(pear/pear)
PHP_OUTPUT(pear/phpize)
PHP_OUTPUT(pear/php-config)
PHP_OUTPUT(pear/PEAR.php)
divert(5)
PHP_CONFIGURE_PART(Configuring extensions)
# zlib checks have to be here
sinclude(./ext/zlib/zlib.m4)
# reading config stubs
esyscmd(./scripts/config-stubs ext)
@@ -677,11 +670,6 @@ if test "$PHP_SAPI" = "cgi"; then
PHP_PROGRAM=php
fi
if test "$PHP_SAPI" = "fastcgi"; then
PHP_PROGRAM=php
fi
PHP_REGEX
PHP_CONFIGURE_PART(Configuring Zend)
@@ -717,93 +705,39 @@ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
EXTRA_LIBS="$EXTRA_LIBS $LIBS"
LDFLAGS=""
LIBS=""
PHP_OUTPUT(TSRM/Makefile)
test "$prefix" = "NONE" && prefix="/usr/local"
test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
case $libdir in
'${exec_prefix}/lib')
libdir="$libdir/php"
;;
esac
case $datadir in
'${prefix}/share')
datadir="$datadir/php"
;;
*) ;;
esac
phplibdir="`pwd`/modules"
$php_shtool mkdir -p $phplibdir
phptempdir="`pwd`/libs"
old_exec_prefix="$exec_prefix"
old_libdir="$libdir"
old_datadir="$datadir"
exec_prefix=`eval echo $exec_prefix`
libdir=`eval echo $libdir`
datadir=`eval echo $datadir`
test "$prefix" = "NONE" && prefix="/usr/local"
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
dnl Build extension directory path
ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' $srcdir/Zend/zend_modules.h|sed 's/#define ZEND_MODULE_API_NO //'`
if test "x$EXTENSION_DIR" = "x"; then
extbasedir="$ZEND_MODULE_API_NO"
if test "$oldstyleextdir" = "yes"; then
if test "$PHP_DEBUG" = "1"; then
part1="debug"
else
part1="no-debug"
fi
if test "$enable_experimental_zts" = "yes"; then
part2="zts"
else
part2="non-zts"
fi
extbasedir="$part1-$part2-$extbasedir"
EXTENSION_DIR="$libdir/extensions/$extbasedir"
else
if test "$enable_experimental_zts" = "yes"; then
extbasedir="${extbasedir}-zts"
fi
if test "$PHP_DEBUG" = "1"; then
extbasedir="${extbasedir}-debug"
fi
EXTENSION_DIR="$libdir/$extbasedir"
fi
if test "$PHP_DEBUG" = "1"; then
PART1=debug
else
PART1=no-debug
fi
dnl Expand all directory names for use in macros/constants
EXPANDED_PEAR_INSTALLDIR=`eval echo $PEAR_INSTALLDIR`
EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR`
EXPANDED_LOCALSTATEDIR=`eval echo $localstatedir`
EXPANDED_BINDIR=`eval echo $bindir`
EXPANDED_LIBDIR="$libdir"
EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
EXPANDED_DATADIR="$datadir"
EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
INCLUDE_PATH=".:${EXPANDED_PEAR_INSTALLDIR}"
if test "$enable_experimental_zts" = "yes"; then
PART2=zts
else
PART2=non-zts
fi
exec_prefix="$old_exec_prefix"
libdir="$old_libdir"
datadir="$old_datadir"
ZEND_MODULE_API_NO=`egrep '#define ZEND_MODULE_API_NO ' $srcdir/Zend/modules.h|sed 's/#define ZEND_MODULE_API_NO //'`
AC_SUBST(INCLUDE_PATH)
AC_SUBST(EXPANDED_PEAR_INSTALLDIR)
AC_SUBST(EXPANDED_EXTENSION_DIR)
AC_SUBST(EXPANDED_BINDIR)
AC_SUBST(EXPANDED_LIBDIR)
AC_SUBST(EXPANDED_DATADIR)
AC_SUBST(EXPANDED_SYSCONFDIR)
AC_SUBST(EXPANDED_LOCALSTATEDIR)
AC_SUBST(EXPANDED_PHP_CONFIG_FILE_PATH)
EXTENSION_DIR="$prefix/lib/php/extensions/$PART1-$PART2-$ZEND_MODULE_API_NO"
PHP_BUILD_RPATH
PEAR_INSTALLDIR="$prefix/lib/php"
PHP_REMOVE_USR_LIB(PHP_LDFLAGS)
PHP_REMOVE_USR_LIB(LDFLAGS)
INCLUDE_PATH=".:$PEAR_INSTALLDIR"
AC_BUILD_RPATH
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
@@ -815,8 +749,9 @@ PHP_OS=`uname`
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
PHP_SUBST_OLD(abs_builddir)
PHP_SUBST_OLD(abs_srcdir)
PHP_SUBST(abs_builddir)
PHP_SUBST(abs_srcdir)
PHP_SUBST(bindir)
PHP_SUBST(exec_prefix)
PHP_SUBST(includedir)
@@ -824,39 +759,36 @@ PHP_SUBST(libdir)
PHP_SUBST(phplibdir)
PHP_SUBST(phptempdir)
PHP_SUBST(prefix)
PHP_SUBST(localstatedir)
PHP_SUBST(datadir)
PHP_SUBST(sysconfdir)
PHP_SUBST(AWK)
PHP_SUBST(CC)
PHP_SUBST(CFLAGS)
PHP_SUBST_OLD(CONFIGURE_COMMAND)
PHP_SUBST(CONFIGURE_COMMAND)
PHP_SUBST(CPP)
PHP_SUBST(CPPFLAGS)
PHP_SUBST(CXX)
PHP_SUBST(CXXFLAGS)
PHP_SUBST(CXX_PHP_COMPILE)
PHP_SUBST_OLD(DEBUG_CFLAGS)
PHP_SUBST(DEBUG_CFLAGS)
PHP_SUBST(DEFS)
PHP_SUBST_OLD(EXTENSION_DIR)
PHP_SUBST(EXTENSION_DIR)
PHP_SUBST(EXTRA_LDFLAGS)
PHP_SUBST_OLD(EXTRA_LIBS)
PHP_SUBST(EXTRA_LIBS)
PHP_SUBST(INCLUDES)
PHP_SUBST_OLD(INCLUDE_PATH)
PHP_SUBST_OLD(INSTALL_IT)
PHP_SUBST(INCLUDE_PATH)
PHP_SUBST(INSTALL_IT)
PHP_SUBST(LEX)
PHP_SUBST(LEX_OUTPUT_ROOT)
PHP_SUBST(LFLAGS)
PHP_SUBST(LIBTOOL)
PHP_SUBST(LN_S)
PHP_SUBST_OLD(NATIVE_RPATHS)
PHP_SUBST(NATIVE_RPATHS)
PHP_SUBST(PEAR_DIR)
PHP_SUBST_OLD(PEAR_INSTALLDIR)
PHP_SUBST(PEAR_INSTALLDIR)
PHP_SUBST(PHP_BUILD_DATE)
PHP_SUBST(PHP_COMPILE)
PHP_SUBST_OLD(PHP_LDFLAGS)
PHP_SUBST_OLD(PHP_LIBS)
PHP_SUBST(PHP_LDFLAGS)
PHP_SUBST(PHP_LIBS)
PHP_SUBST(PHP_PROGRAM)
PHP_SUBST(PHP_RPATHS)
PHP_SUBST(PHP_SAPI)
@@ -867,7 +799,7 @@ PHP_SUBST(SHARED_LIBTOOL)
PHP_SUBST(TSRM_DIR)
PHP_SUBST(TSRM_LIB)
PHP_SUBST(WARNING_LEVEL)
PHP_SUBST_OLD(YACC)
PHP_SUBST(YACC)
PHP_CONFIGURE_PART(Configuring libtool)
@@ -929,10 +861,7 @@ PHP_CONFIGURE_PART(Generating files)
PHP_GEN_CONFIG_VARS
$php_shtool mkdir -p pear/scripts
ALL_OUTPUT_FILES="php4.spec Zend/Makefile main/build-defs.h \
pear/scripts/pear pear/scripts/phpize pear/scripts/php-config \
TSRM/Makefile $PHP_OUTPUT_FILES"
ALL_OUTPUT_FILES="php4.spec Zend/Makefile main/build-defs.h $PHP_OUTPUT_FILES"
AC_OUTPUT($ALL_OUTPUT_FILES, [], [
@@ -971,9 +900,9 @@ if test -n "\$REDO_ALL"; then
# Hacking while airborne considered harmful.
#
echo "creating main/internal_functions.c"
extensions="$EXT_STATIC"
extensions=\`grep '^s.@EXT_STATIC@' \$0|sed -e 's/^.*@% *//' -e 's/%.*$//'\`
dnl mv -f main/internal_functions.c main/internal_functions.c.old 2>/dev/null
sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$extensions > main/internal_functions.c
sh $srcdir/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" \$extensions > main/internal_functions.c
dnl if cmp main/internal_functions.c.old main/internal_functions.c > /dev/null 2>&1; then
dnl echo "main/internal_functions.c is unchanged"
dnl mv main/internal_functions.c.old main/internal_functions.c
+1 -1
View File
@@ -1,7 +1,7 @@
# +----------------------------------------------------------------------+
# | PHP version 4.0 |
# +----------------------------------------------------------------------+
# | Copyright (c) 1997-2001 The PHP Group |
# | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
# +----------------------------------------------------------------------+
# | This source file is subject to version 2.02 of the PHP license, |
# | that is bundled with this package in the file LICENSE, and is |
+1 -5
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,10 +18,6 @@
/* $Id$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#ifdef COMPILE_DL_ASPELL
+4 -4
View File
@@ -11,17 +11,17 @@ AC_ARG_WITH(aspell,
ASPELL_DIR=$withval
fi
PHP_ADD_INCLUDE($ASPELL_DIR/include)
PHP_ADD_LIBRARY_WITH_PATH(aspell, $ASPELL_DIR/lib)
AC_ADD_INCLUDE($ASPELL_DIR/include)
AC_ADD_LIBRARY_WITH_PATH(aspell, $ASPELL_DIR/lib)
if test ! -f "$ASPELL_DIR/include/aspell-c.h"; then
AC_MSG_ERROR(Could not find aspell-c.h in $ASPELL_DIR/include - please copy it manually from the aspell sources to $ASPELL_DIR/include)
fi
AC_DEFINE(HAVE_ASPELL,1,[Whether you have aspell])
AC_MSG_RESULT(yes)
PHP_EXTENSION(aspell)
PHP_EXTENSION(aspell)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR(no)
fi
],[
AC_MSG_RESULT(no)
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -5
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -18,10 +18,6 @@
/* $Id$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#if WITH_BCMATH
+1 -2
View File
@@ -11,8 +11,7 @@ libbcmath_a_SOURCES= add.c compare.c debug.c div.c divmod.c doaddsub.c \
INCLUDES = -I$(srcdir) -I..
CFLAGS = @CFLAGS@
CPPFLAGS = $(INCLUDES) -Wall
CFLAGS = @CFLAGS@ $(INCLUDES) -Wall
MAINTAINERCLEANFILES= Makefile.in $(libbcmath_a_SOURCES) private.h bcmath.h
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP version 4.0 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2001 The PHP Group |
| Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
Loaded 100 of 873 files, more files were not shown because too many files have changed in this diff. Show more