mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-09 02:00:49 +00:00
Compare commits
46
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3756cddb0a | ||
|
|
b06c5731fc | ||
|
|
4213b5d6b6 | ||
|
|
483caf3669 | ||
|
|
4869bd3bfc | ||
|
|
3b53a8ad0f | ||
|
|
1c23f75627 | ||
|
|
4b98f345d1 | ||
|
|
bb6dff9c67 | ||
|
|
4472d05025 | ||
|
|
2e9886de3c | ||
|
|
e3d2234b80 | ||
|
|
79f9f0ce88 | ||
|
|
7685b44c4b | ||
|
|
7656c77c38 | ||
|
|
4fd1d5b81b | ||
|
|
d40e88a016 | ||
|
|
e95ebe0453 | ||
|
|
f92db069c3 | ||
|
|
651e232f04 | ||
|
|
906dc43ed7 | ||
|
|
f8ef66d1a4 | ||
|
|
b6f5873260 | ||
|
|
011813cce8 | ||
|
|
763061bbea | ||
|
|
3e58450513 | ||
|
|
5cb576d81a | ||
|
|
2d7b9b038d | ||
|
|
43c0e94ac9 | ||
|
|
0a6e9ddd7f | ||
|
|
3edb99e8ac | ||
|
|
6a97e1662d | ||
|
|
9d8e0db38f | ||
|
|
f2d5ca7482 | ||
|
|
17bdb70823 | ||
|
|
9d1a9331b3 | ||
|
|
a12d0a1c1c | ||
|
|
22335a4ec7 | ||
|
|
893160fcbe | ||
|
|
135da4b4fc | ||
|
|
d0738c2bc3 | ||
|
|
9bc17ac6b2 | ||
|
|
d1d96d04c6 | ||
|
|
18402e05b9 | ||
|
|
882bbf6f45 | ||
|
|
694d94983b |
No files matched your search
+103
@@ -0,0 +1,103 @@
|
||||
|
||||
This is the ChangeLog from PHP3 as of Apr 12 1999.
|
||||
|
||||
Entries should be removed from this file, if you transfer changes
|
||||
over to PHP4.
|
||||
|
||||
============================================================================
|
||||
|
||||
?? 1999, Version 3.0.8
|
||||
- added Oracle-OCI8 persistent connections
|
||||
- fixed OCIDefineByName crash.
|
||||
- fixed some NULL-column related problems in OCI8-module.
|
||||
- avoid stripping double slashes when fopen'ing files (Sascha)
|
||||
- sql_regcase() change: only apply to alphabetic characters (Sascha)
|
||||
- add snmprealwalk() (Sascha Schumann)
|
||||
- fix serious bug in strftime() (Sascha Schumann)
|
||||
- fix bug in ucwords() (Sascha Schumann)
|
||||
- optimized fgets() and fread()
|
||||
- memory leak in operators.c fixed
|
||||
- socket leak fixed (Sascha Schumann)
|
||||
- Fixed the XML bug that caused garbage behind attributes
|
||||
- Some Informix driver improvements.
|
||||
- PUT method support (mlemos@acm.org)
|
||||
- Add ldap_mod_add(), ldap_mod_del() and ldap_mod_replace() (Gerritt Thomson)
|
||||
- Fix parameter count problem in odbc_setoption()
|
||||
- Replace broken str_replace(). The fix in 3.0.7 was bogus (Sascha Schumann)
|
||||
- Really fix implode() this time. The fix in 3.0.7 was bogus
|
||||
- Added more option to the date() function: (Colin Viebrock)
|
||||
'g' - hour, 12-hour format, no leading zeros
|
||||
'G' - hour, 24-hour format, no leading zeros
|
||||
'n' - month, numeric, no leading zeros
|
||||
- Make fgetss() slightly smarter
|
||||
- Add strip_tags() which uses the fgetss state-machine but acts on a string
|
||||
- Add CRYPT_SALT_LENGTH constant
|
||||
|
||||
March 1 1999, Version 3.0.7
|
||||
- Added pdf_put_image and pdf_execute_image
|
||||
- Initial work on an ImageMagick module - doesn't do anything yet
|
||||
- Make configure script detect Netscape's LDAP SDK automagically
|
||||
- Fixed Oracle-OCI8 module for windows.
|
||||
- Add OCIRowCount function. (Number of affected rows for update-statements)
|
||||
- Add OCIDefineByName function.
|
||||
- Change the behaviour of open_basedir. It's now possible to supply more
|
||||
than one directory. open_basedir paths from parent directories are now
|
||||
automatically inherited.
|
||||
- fix rand() and mt_rand() to make the ranges work correctly
|
||||
- htmlspecialchars() and htmlentities() are now binary safe.
|
||||
- Add extract() function.
|
||||
- Oracle-OCI8 driver now supports BLOBS/CLOBS and IN/OUT binding of local php
|
||||
variables.
|
||||
- Clean up apxs build
|
||||
- Add INSTALL.REDHAT file to walk RedHat users through the install
|
||||
- Added YP/NIS module from Stephanie Wehner
|
||||
- Added optional second argument to mysql_fetch_array(); MYSQL_ASSOC will
|
||||
cause the resulting array to contain the associative indices only,
|
||||
MYSQL_NUM will cause the array to contain the numeric indices only (like
|
||||
mysql_fetch_row()) and MYSQL_BOTH would cause them both to be defined
|
||||
(default).
|
||||
- Backport the Zend debugging memory manager into the PHP 3.0.x tree.
|
||||
- Add function_exists() function.
|
||||
- Add another version of WDDX module
|
||||
(we need to pick a single implementation here)
|
||||
- Fixed includes for iODBC to support both the old and the new LGPL version
|
||||
- Add flock() function
|
||||
- Fix implode() bug - When imploding an array that contained unset() elements
|
||||
it wasn't correctly skipping past these
|
||||
- Add connection_status() function. This returns the raw bitfield which
|
||||
indicates whether the script terminated due to a user abort, a timeout
|
||||
or normally. Note that if ignore_user_abort is enabled, then both the
|
||||
timeout state and the user abort state can be active
|
||||
- Add connection_timeout() function. This one can be called in a shutdown
|
||||
function to tell you if you got there because of a timeout
|
||||
- Add ignore_user_abort() function and .ini/.conf directive of same name
|
||||
- Fix connection abort detection code - It should now work reliably with
|
||||
Apache. Also added a user-level connection_aborted() function designed to
|
||||
let people check whether the user aborted the connection in a user-level
|
||||
shutdown function.
|
||||
- Add pfsockopen() function
|
||||
- Improvements in FreeType support: Macintosh fonts work, and non-antialiased
|
||||
output is considerably cleaner <mka@satama.com>
|
||||
- Fixed checkdate() function, range of valid years is now 0 to 32767
|
||||
- Make sure XML element attributes have the right character encoding
|
||||
- hw_insertdocument() returns object id now
|
||||
- Add pdf_open() warning in configure and documentation
|
||||
- Add diskfreespace() function
|
||||
- Added aspell support
|
||||
- Iptcparse would sometimes find a wrong tag.
|
||||
- Force var_dump() to output headers
|
||||
- Add optional 3th parameter to ora_fetchinto.
|
||||
- Serialize and var_dump no longer show array elements that
|
||||
have been unset.
|
||||
- Add IptcEmbed() function (can replace an APP13-Marker in a JPEG file)
|
||||
- Add OCI8 module for Windows
|
||||
- Fix bug in pdf_close() function
|
||||
- Add WDDX support (see http://www.wddx.org for more info)
|
||||
- Add similar_text() function
|
||||
- Constructors of parent classes weren't accessible to derived classes (as
|
||||
of 3.0.6). Fixed.
|
||||
- Introduce simple regex compilation cache
|
||||
- Add gettimeofday() function
|
||||
- Add getrusage() function
|
||||
|
||||
|
||||
+571
-760
File diff suppressed because it is too large.
Load diff
+2
-2
@@ -49,8 +49,8 @@ features:
|
||||
explanation - you can now call functions before they're declared!
|
||||
* Added here-docs support.
|
||||
* Added foreach. Two syntaxes supported:
|
||||
foreach($val in array_expr) statement
|
||||
foreach($key, $val in array_expr) statement
|
||||
foreach(array_expr as $val) statement
|
||||
foreach(array_expr as $key => $val) statement
|
||||
* A true unset() implementation. A variable or element that is unset(), is now
|
||||
sent to oblivion in its entirely, no trace remains from it.
|
||||
* Output buffering support! Use ob_start() to begin output buffering, ob_end_flush()
|
||||
|
||||
@@ -1,628 +0,0 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on ZendCore.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=ZendCore - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to ZendCore - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "ZendCore - Win32 Release" && "$(CFG)" != "ZendCore - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ZendCore.mak" CFG="ZendCore - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ZendCore - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ZendCore - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\ZendCore.lib"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\alloc.obj"
|
||||
-@erase "$(INTDIR)\alloca.obj"
|
||||
-@erase "$(INTDIR)\compile.obj"
|
||||
-@erase "$(INTDIR)\constants.obj"
|
||||
-@erase "$(INTDIR)\execute.obj"
|
||||
-@erase "$(INTDIR)\highlight.obj"
|
||||
-@erase "$(INTDIR)\llist.obj"
|
||||
-@erase "$(INTDIR)\opcode.obj"
|
||||
-@erase "$(INTDIR)\operators.obj"
|
||||
-@erase "$(INTDIR)\ptr_stack.obj"
|
||||
-@erase "$(INTDIR)\sprintf.obj"
|
||||
-@erase "$(INTDIR)\stack.obj"
|
||||
-@erase "$(INTDIR)\variables.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\zend.obj"
|
||||
-@erase "$(INTDIR)\zend_API.obj"
|
||||
-@erase "$(INTDIR)\zend_hash.obj"
|
||||
-@erase "$(INTDIR)\zend_ini.obj"
|
||||
-@erase "$(OUTDIR)\ZendCore.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR)\ZendCore.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ZendCore.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\ZendCore.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\alloc.obj" \
|
||||
"$(INTDIR)\alloca.obj" \
|
||||
"$(INTDIR)\compile.obj" \
|
||||
"$(INTDIR)\constants.obj" \
|
||||
"$(INTDIR)\execute.obj" \
|
||||
"$(INTDIR)\highlight.obj" \
|
||||
"$(INTDIR)\llist.obj" \
|
||||
"$(INTDIR)\opcode.obj" \
|
||||
"$(INTDIR)\operators.obj" \
|
||||
"$(INTDIR)\ptr_stack.obj" \
|
||||
"$(INTDIR)\sprintf.obj" \
|
||||
"$(INTDIR)\stack.obj" \
|
||||
"$(INTDIR)\variables.obj" \
|
||||
"$(INTDIR)\zend.obj" \
|
||||
"$(INTDIR)\zend_hash.obj" \
|
||||
"$(INTDIR)\zend_ini.obj" \
|
||||
"$(INTDIR)\zend_API.obj"
|
||||
|
||||
"$(OUTDIR)\ZendCore.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : ".\zend-scanner.c" ".\zend-parser.tab.h" ".\zend-parser.tab.c" ".\configuration-scanner.c" ".\configuration-parser.tab.h" ".\configuration-parser.tab.c" "$(OUTDIR)\ZendCore.lib" "$(OUTDIR)\ZendCore.bsc"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\alloc.obj"
|
||||
-@erase "$(INTDIR)\alloc.sbr"
|
||||
-@erase "$(INTDIR)\alloca.obj"
|
||||
-@erase "$(INTDIR)\alloca.sbr"
|
||||
-@erase "$(INTDIR)\compile.obj"
|
||||
-@erase "$(INTDIR)\compile.sbr"
|
||||
-@erase "$(INTDIR)\constants.obj"
|
||||
-@erase "$(INTDIR)\constants.sbr"
|
||||
-@erase "$(INTDIR)\execute.obj"
|
||||
-@erase "$(INTDIR)\execute.sbr"
|
||||
-@erase "$(INTDIR)\highlight.obj"
|
||||
-@erase "$(INTDIR)\highlight.sbr"
|
||||
-@erase "$(INTDIR)\llist.obj"
|
||||
-@erase "$(INTDIR)\llist.sbr"
|
||||
-@erase "$(INTDIR)\opcode.obj"
|
||||
-@erase "$(INTDIR)\opcode.sbr"
|
||||
-@erase "$(INTDIR)\operators.obj"
|
||||
-@erase "$(INTDIR)\operators.sbr"
|
||||
-@erase "$(INTDIR)\ptr_stack.obj"
|
||||
-@erase "$(INTDIR)\ptr_stack.sbr"
|
||||
-@erase "$(INTDIR)\sprintf.obj"
|
||||
-@erase "$(INTDIR)\sprintf.sbr"
|
||||
-@erase "$(INTDIR)\stack.obj"
|
||||
-@erase "$(INTDIR)\stack.sbr"
|
||||
-@erase "$(INTDIR)\variables.obj"
|
||||
-@erase "$(INTDIR)\variables.sbr"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(INTDIR)\zend.obj"
|
||||
-@erase "$(INTDIR)\zend.sbr"
|
||||
-@erase "$(INTDIR)\zend_API.obj"
|
||||
-@erase "$(INTDIR)\zend_API.sbr"
|
||||
-@erase "$(INTDIR)\zend_hash.obj"
|
||||
-@erase "$(INTDIR)\zend_hash.sbr"
|
||||
-@erase "$(INTDIR)\zend_ini.obj"
|
||||
-@erase "$(INTDIR)\zend_ini.sbr"
|
||||
-@erase "$(OUTDIR)\ZendCore.bsc"
|
||||
-@erase "$(OUTDIR)\ZendCore.lib"
|
||||
-@erase "configuration-parser.tab.c"
|
||||
-@erase "configuration-parser.tab.h"
|
||||
-@erase "configuration-scanner.c"
|
||||
-@erase "zend-parser.tab.c"
|
||||
-@erase "zend-parser.tab.h"
|
||||
-@erase "zend-scanner.c"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\ZendCore.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
RSC=rc.exe
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\ZendCore.bsc"
|
||||
BSC32_SBRS= \
|
||||
"$(INTDIR)\alloc.sbr" \
|
||||
"$(INTDIR)\alloca.sbr" \
|
||||
"$(INTDIR)\compile.sbr" \
|
||||
"$(INTDIR)\constants.sbr" \
|
||||
"$(INTDIR)\execute.sbr" \
|
||||
"$(INTDIR)\highlight.sbr" \
|
||||
"$(INTDIR)\llist.sbr" \
|
||||
"$(INTDIR)\opcode.sbr" \
|
||||
"$(INTDIR)\operators.sbr" \
|
||||
"$(INTDIR)\ptr_stack.sbr" \
|
||||
"$(INTDIR)\sprintf.sbr" \
|
||||
"$(INTDIR)\stack.sbr" \
|
||||
"$(INTDIR)\variables.sbr" \
|
||||
"$(INTDIR)\zend.sbr" \
|
||||
"$(INTDIR)\zend_hash.sbr" \
|
||||
"$(INTDIR)\zend_ini.sbr" \
|
||||
"$(INTDIR)\zend_API.sbr"
|
||||
|
||||
"$(OUTDIR)\ZendCore.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
|
||||
$(BSC32) @<<
|
||||
$(BSC32_FLAGS) $(BSC32_SBRS)
|
||||
<<
|
||||
|
||||
LIB32=link.exe -lib
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)\ZendCore.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\alloc.obj" \
|
||||
"$(INTDIR)\alloca.obj" \
|
||||
"$(INTDIR)\compile.obj" \
|
||||
"$(INTDIR)\constants.obj" \
|
||||
"$(INTDIR)\execute.obj" \
|
||||
"$(INTDIR)\highlight.obj" \
|
||||
"$(INTDIR)\llist.obj" \
|
||||
"$(INTDIR)\opcode.obj" \
|
||||
"$(INTDIR)\operators.obj" \
|
||||
"$(INTDIR)\ptr_stack.obj" \
|
||||
"$(INTDIR)\sprintf.obj" \
|
||||
"$(INTDIR)\stack.obj" \
|
||||
"$(INTDIR)\variables.obj" \
|
||||
"$(INTDIR)\zend.obj" \
|
||||
"$(INTDIR)\zend_hash.obj" \
|
||||
"$(INTDIR)\zend_ini.obj" \
|
||||
"$(INTDIR)\zend_API.obj"
|
||||
|
||||
"$(OUTDIR)\ZendCore.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("ZendCore.dep")
|
||||
!INCLUDE "ZendCore.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "ZendCore.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release" || "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
SOURCE=.\zend_alloc.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\alloc.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\alloc.obj" "$(INTDIR)\alloc.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\alloca.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\alloca.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\alloca.obj" "$(INTDIR)\alloca.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_compile.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\compile.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\compile.obj" "$(INTDIR)\compile.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_constants.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\constants.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\constants.obj" "$(INTDIR)\constants.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_execute.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\execute.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\execute.obj" "$(INTDIR)\execute.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_highlight.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\highlight.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\highlight.obj" "$(INTDIR)\highlight.sbr" : $(SOURCE) "$(INTDIR)" ".\zend-parser.tab.h"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_llist.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\llist.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\llist.obj" "$(INTDIR)\llist.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_opcode.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\opcode.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\opcode.obj" "$(INTDIR)\opcode.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_operators.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\operators.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\operators.obj" "$(INTDIR)\operators.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_ptr_stack.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\ptr_stack.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\ptr_stack.obj" "$(INTDIR)\ptr_stack.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\sprintf.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\sprintf.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\sprintf.obj" "$(INTDIR)\sprintf.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_stack.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\stack.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\stack.obj" "$(INTDIR)\stack.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_variables.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\variables.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\variables.obj" "$(INTDIR)\variables.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\zend.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\zend.obj" "$(INTDIR)\zend.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_API.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\zend_API.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\zend_API.obj" "$(INTDIR)\zend_API.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\zend_hash.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\zend_hash.obj" "$(INTDIR)\zend_hash.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=.\zend_ini.c
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
|
||||
"$(INTDIR)\zend_ini.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
|
||||
"$(INTDIR)\zend_ini.obj" "$(INTDIR)\zend_ini.sbr" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=".\configuration-parser.y"
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
InputPath=".\configuration-parser.y"
|
||||
|
||||
".\configuration-parser.tab.c" ".\configuration-parser.tab.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
bison -d -S "C:\Program Files\Cygnus\share\bison.simple" -p cfg configuration-parser.y
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=".\zend-parser.y"
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
InputPath=".\zend-parser.y"
|
||||
|
||||
".\zend-parser.tab.c" ".\zend-parser.tab.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
bison -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p zend zend-parser.y
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=".\configuration-scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
InputPath=".\configuration-scanner.l"
|
||||
|
||||
".\configuration-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
flex -i -Pcfg -oconfiguration-scanner.c configuration-scanner.l
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
SOURCE=".\zend-scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
|
||||
InputPath=".\zend-scanner.l"
|
||||
|
||||
".\zend-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
<<tempfile.bat
|
||||
@echo off
|
||||
flex -i -Pzend -ozend-scanner.c zend-scanner.l
|
||||
<<
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
Index: zend_execute.c
|
||||
===================================================================
|
||||
RCS file: /repository/Zend/ZendCore/zend_execute.c,v
|
||||
retrieving revision 1.25
|
||||
retrieving revision 1.26
|
||||
diff -r1.25 -r1.26
|
||||
17d16
|
||||
< /* $Id$ */
|
||||
@@ -1,24 +1,24 @@
|
||||
# Microsoft Developer Studio Project File - Name="ZendCore" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Project File - Name="libzend" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=ZendCore - Win32 Debug
|
||||
CFG=libzend - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ZendCore.mak".
|
||||
!MESSAGE NMAKE /f "libzend.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ZendCore.mak" CFG="ZendCore - Win32 Debug"
|
||||
!MESSAGE NMAKE /f "libzend.mak" CFG="libzend - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ZendCore - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ZendCore - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "libzend - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "libzend - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
@@ -28,7 +28,7 @@ CFG=ZendCore - Win32 Debug
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
!IF "$(CFG)" == "libzend - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
@@ -51,7 +51,7 @@ LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
!ELSEIF "$(CFG)" == "libzend - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
@@ -78,21 +78,13 @@ LIB32=link.exe -lib
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ZendCore - Win32 Release"
|
||||
# Name "ZendCore - Win32 Debug"
|
||||
# Name "libzend - Win32 Release"
|
||||
# Name "libzend - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\alloca.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\sprintf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\zend-parser.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -165,6 +157,10 @@ SOURCE=.\zend_ptr_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_sprintf.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_stack.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -271,7 +267,7 @@ SOURCE=.\zend_variables.h
|
||||
|
||||
SOURCE=".\zend-parser.y"
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
!IF "$(CFG)" == "libzend - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
@@ -287,7 +283,7 @@ BuildCmds= \
|
||||
$(BuildCmds)
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
!ELSEIF "$(CFG)" == "libzend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputDir=.
|
||||
@@ -314,9 +310,9 @@ BuildCmds= \
|
||||
|
||||
SOURCE=".\zend-scanner.l"
|
||||
|
||||
!IF "$(CFG)" == "ZendCore - Win32 Release"
|
||||
!IF "$(CFG)" == "libzend - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ZendCore - Win32 Debug"
|
||||
!ELSEIF "$(CFG)" == "libzend - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
InputPath=".\zend-scanner.l"
|
||||
+7
-7
@@ -437,8 +437,8 @@ common_scalar:
|
||||
LNUMBER { $$=$1; }
|
||||
| DNUMBER { $$=$1; }
|
||||
| CONSTANT_ENCAPSED_STRING { $$ = $1; }
|
||||
| ZEND_LINE
|
||||
| ZEND_FILE
|
||||
| ZEND_LINE { $$ = $1; }
|
||||
| ZEND_FILE { $$ = $1; }
|
||||
;
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ cvar_without_objects:
|
||||
|
||||
reference_variable:
|
||||
dim_list ']' { $$ = $1; }
|
||||
| compound_variable { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -521,7 +521,7 @@ compound_variable:
|
||||
|
||||
dim_list:
|
||||
dim_list ']' '[' dim_offset { fetch_array_dim(&$$, &$1, &$4 CLS_CC); }
|
||||
| compound_variable { do_begin_variable_parse(CLS_C); } '[' dim_offset { fetch_array_begin(&$$, &$1, &$4 CLS_CC); }
|
||||
| compound_variable { do_fetch_globals(&$1); do_begin_variable_parse(CLS_C); } '[' dim_offset { fetch_array_begin(&$$, &$1, &$4 CLS_CC); }
|
||||
;
|
||||
|
||||
|
||||
@@ -604,10 +604,10 @@ encaps_list:
|
||||
|
||||
|
||||
encaps_var:
|
||||
VARIABLE { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| VARIABLE '[' encaps_var_offset ']' { do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$1, &$3 CLS_CC); }
|
||||
VARIABLE { do_fetch_globals(&$1); do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$1, 1 CLS_CC); }
|
||||
| VARIABLE '[' encaps_var_offset ']' { do_fetch_globals(&$1); do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$1, &$3 CLS_CC); }
|
||||
| VARIABLE ZEND_OBJECT_OPERATOR STRING { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$2, &$1, 1 CLS_CC); do_fetch_property(&$$, &$2, &$3 CLS_CC); }
|
||||
| DOLLAR_OPEN_CURLY_BRACES expr '}' { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$2, 1 CLS_CC); }
|
||||
| DOLLAR_OPEN_CURLY_BRACES expr '}' { do_begin_variable_parse(CLS_C); fetch_simple_variable(&$$, &$2, 1 CLS_CC); }
|
||||
| DOLLAR_OPEN_CURLY_BRACES STRING '[' expr ']' '}' { do_begin_variable_parse(CLS_C); fetch_array_begin(&$$, &$2, &$4 CLS_CC); }
|
||||
| T_CURLY_OPEN cvar '}' { $$ = $2; }
|
||||
;
|
||||
|
||||
+21
-4
@@ -990,9 +990,15 @@ TLS_VARS;
|
||||
}
|
||||
|
||||
|
||||
<IN_SCRIPTING>"<<"{LABEL}("\r")?"\n" {
|
||||
CG(heredoc_len) = yyleng-2-1-(yytext[yyleng-2]=='\r'?1:0);
|
||||
CG(heredoc) = estrndup(yytext+2, CG(heredoc_len));
|
||||
<IN_SCRIPTING>"<<<"{TABS_AND_SPACES}{LABEL}("\r")?"\n" {
|
||||
char *s;
|
||||
CG(heredoc_len) = yyleng-3-1-(yytext[yyleng-2]=='\r'?1:0);
|
||||
s = yytext+3;
|
||||
while ((*s == ' ') || (*s == '\t')) {
|
||||
s++;
|
||||
CG(heredoc_len)--;
|
||||
}
|
||||
CG(heredoc) = estrndup(s, CG(heredoc_len));
|
||||
BEGIN(HEREDOC);
|
||||
return ZEND_HEREDOC;
|
||||
}
|
||||
@@ -1010,16 +1016,27 @@ TLS_VARS;
|
||||
}
|
||||
|
||||
|
||||
<HEREDOC>^{LABEL}("\r")?"\n" {
|
||||
<HEREDOC>^{LABEL}(";")?("\r")?"\n" {
|
||||
int label_len;
|
||||
unsigned char unput_semicolon;
|
||||
|
||||
if (yytext[yyleng-2]=='\r') {
|
||||
label_len = yyleng-2;
|
||||
} else {
|
||||
label_len = yyleng-1;
|
||||
}
|
||||
|
||||
if (yytext[label_len-1]==';') {
|
||||
label_len--;
|
||||
unput_semicolon=1;
|
||||
} else{
|
||||
unput_semicolon=0;
|
||||
}
|
||||
|
||||
if (label_len==CG(heredoc_len) && !memcmp(yytext, CG(heredoc), label_len)) {
|
||||
if (unput_semicolon) {
|
||||
unput(';');
|
||||
}
|
||||
efree(CG(heredoc));
|
||||
CG(heredoc)=NULL;
|
||||
CG(heredoc_len)=0;
|
||||
|
||||
+8
-2
@@ -14,6 +14,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_operators.h"
|
||||
#include "zend_variables.h"
|
||||
@@ -157,7 +158,7 @@ static void register_standard_class()
|
||||
}
|
||||
|
||||
|
||||
int zend_startup(zend_utility_functions *utility_functions, zend_utility_values *utility_values, char **extensions)
|
||||
int zend_startup(zend_utility_functions *utility_functions, char **extensions)
|
||||
{
|
||||
start_memory_manager();
|
||||
|
||||
@@ -175,7 +176,6 @@ int zend_startup(zend_utility_functions *utility_functions, zend_utility_values
|
||||
zend_compile_files = compile_files;
|
||||
zend_execute = execute;
|
||||
|
||||
zend_uv = *utility_values;
|
||||
zend_llist_init(&zend_extensions, sizeof(zend_extension), (void (*)(void *)) zend_extension_dtor, 1);
|
||||
|
||||
/* set up version */
|
||||
@@ -212,6 +212,12 @@ void zend_shutdown()
|
||||
}
|
||||
|
||||
|
||||
void zend_set_utility_values(zend_utility_values *utility_values)
|
||||
{
|
||||
zend_uv = *utility_values;
|
||||
}
|
||||
|
||||
|
||||
/* this should be compatible with the standard zenderror */
|
||||
void zenderror(char *error)
|
||||
{
|
||||
|
||||
+2
-1
@@ -153,8 +153,9 @@ typedef struct {
|
||||
#define IS_CONSTANT 9
|
||||
#define IS_METHOD 10 /* for overloaded function calls */
|
||||
|
||||
int zend_startup(zend_utility_functions *utility_functions, zend_utility_values *utility_values, char **extensions);
|
||||
int zend_startup(zend_utility_functions *utility_functions, char **extensions);
|
||||
void zend_shutdown();
|
||||
void zend_set_utility_values(zend_utility_values *utility_values);
|
||||
ZEND_API void zend_bailout();
|
||||
ZEND_API char *get_zend_version();
|
||||
|
||||
|
||||
+3
-3
@@ -617,14 +617,14 @@ void module_destructor(zend_module_entry *module)
|
||||
#if 0
|
||||
zend_printf("%s: Request shutdown\n",module->name);
|
||||
#endif
|
||||
module->request_shutdown_func();
|
||||
module->request_shutdown_func(module->type, module->module_number);
|
||||
}
|
||||
module->request_started=0;
|
||||
if (module->module_started && module->module_shutdown_func) {
|
||||
#if 0
|
||||
zend_printf("%s: Module shutdown\n",module->name);
|
||||
#endif
|
||||
module->module_shutdown_func();
|
||||
module->module_shutdown_func(module->type, module->module_number);
|
||||
}
|
||||
module->module_started=0;
|
||||
unregister_functions(module->functions,-1);
|
||||
@@ -662,7 +662,7 @@ int module_registry_cleanup(zend_module_entry *module)
|
||||
#if 0
|
||||
zend_printf("%s: Request shutdown\n",module->name);
|
||||
#endif
|
||||
module->request_shutdown_func();
|
||||
module->request_shutdown_func(module->type, module->module_number);
|
||||
}
|
||||
module->request_started=0;
|
||||
return 0;
|
||||
|
||||
+17
-3
@@ -42,11 +42,11 @@ static zend_alloc_globals alloc_globals;
|
||||
# endif
|
||||
|
||||
#define _CHECK_MEMORY_LIMIT(s,file,lineno) { AG(allocated_memory) += (s);\
|
||||
if (php3_ini.memory_limit<AG(allocated_memory)) {\
|
||||
if (AG(memory_limit)<AG(allocated_memory)) {\
|
||||
if (!file) { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)",php3_ini.memory_limit,s); \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted (tried to allocate %d bytes)", AG(memory_limit),s); \
|
||||
} else { \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)",php3_ini.memory_limit,file,lineno,s); \
|
||||
zend_error(E_ERROR,"Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes)", AG(memory_limit), file, lineno, s); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
@@ -304,11 +304,25 @@ ZEND_API char *zend_strndup(const char *s, uint length)
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
|
||||
{
|
||||
#if MEMORY_LIMIT
|
||||
ALS_FETCH();
|
||||
|
||||
AG(memory_limit) = memory_limit;
|
||||
return SUCCESS;
|
||||
#else
|
||||
return FAILURE;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ZEND_API void start_memory_manager(void)
|
||||
{
|
||||
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;
|
||||
#endif
|
||||
|
||||
@@ -92,6 +92,8 @@ ZEND_API void _persist_alloc(void *ptr);
|
||||
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):(empty_string))
|
||||
#define safe_estrndup(ptr,len) ((ptr)?(estrndup((ptr),(len))):(empty_string))
|
||||
|
||||
ZEND_API int zend_set_memory_limit(unsigned int memory_limit);
|
||||
|
||||
ZEND_API void start_memory_manager(void);
|
||||
ZEND_API void shutdown_memory_manager(int silent, int clean_cache);
|
||||
|
||||
|
||||
+24
-2
@@ -154,6 +154,24 @@ void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void do_fetch_globals(znode *varname)
|
||||
{
|
||||
if (!CG(active_op_array)->initialized_globals
|
||||
&& varname->op_type == IS_CONST
|
||||
&& varname->u.constant.type == IS_STRING
|
||||
&& varname->u.constant.value.str.len == (sizeof("GLOBALS")-1)
|
||||
&& !memcmp(varname->u.constant.value.str.val, "GLOBALS", sizeof("GLOBALS")-1)) {
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
|
||||
opline->opcode = ZEND_INIT_GLOBALS;
|
||||
SET_UNUSED(opline->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
CG(active_op_array)->initialized_globals = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC)
|
||||
{
|
||||
int next_op_number = get_next_op_number(CG(active_op_array));
|
||||
@@ -1116,7 +1134,9 @@ void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_
|
||||
CG(class_entry).handle_property_set = NULL;
|
||||
CG(class_entry).handle_property_get = NULL;
|
||||
|
||||
zend_hash_add(CG(class_table), CG(class_entry).name, CG(class_entry).name_length+1, &CG(class_entry), sizeof(zend_class_entry), (void **) &CG(active_class_entry));
|
||||
if (zend_hash_add(CG(class_table), CG(class_entry).name, CG(class_entry).name_length+1, &CG(class_entry), sizeof(zend_class_entry), (void **) &CG(active_class_entry))==FAILURE) {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s cannot be redeclared", CG(class_entry).name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1418,6 +1438,7 @@ void do_list_end(znode *result, znode *expr CLS_DC)
|
||||
le = CG(list_llist).head;
|
||||
while (le) {
|
||||
do_assign(result, &((list_llist_element *) le->data)->var, &((list_llist_element *) le->data)->value CLS_CC);
|
||||
EG(active_op_array)->opcodes[EG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
le = le->next;
|
||||
}
|
||||
zend_llist_destroy(&CG(dimension_llist));
|
||||
@@ -1431,7 +1452,7 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
|
||||
zend_op *opline = get_next_op(CG(active_op_array) CLS_CC);
|
||||
znode lval;
|
||||
|
||||
if (fetch_type==ZEND_FETCH_STATIC) {
|
||||
if (fetch_type==ZEND_FETCH_STATIC && static_assignment) {
|
||||
zval *tmp = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
convert_to_string(&varname->u.constant);
|
||||
@@ -1459,6 +1480,7 @@ void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment
|
||||
|
||||
|
||||
do_assign_ref(NULL, &lval, &opline->result CLS_CC);
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].result.u.EA.type |= EXT_TYPE_UNUSED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+10
-6
@@ -91,6 +91,7 @@ struct _zend_op_array {
|
||||
zend_brk_cont_element *brk_cont_array;
|
||||
int last_brk_cont;
|
||||
int current_brk_cont;
|
||||
unsigned char initialized_globals;
|
||||
|
||||
/* static variables support */
|
||||
HashTable *static_variables;
|
||||
@@ -195,6 +196,7 @@ void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
|
||||
void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC);
|
||||
void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
|
||||
void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
|
||||
void do_fetch_globals(znode *varname);
|
||||
|
||||
void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC);
|
||||
void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC);
|
||||
@@ -316,7 +318,7 @@ ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
|
||||
ZEND_API zend_op_array *compile_filename(zval *filename CLS_DC);
|
||||
inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
|
||||
|
||||
#define INITIAL_OP_ARRAY_SIZE 1024
|
||||
#define INITIAL_OP_ARRAY_SIZE 64
|
||||
|
||||
|
||||
ZEND_API void init_op_array(zend_op_array *op_array, int initial_ops_size);
|
||||
@@ -450,11 +452,13 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
|
||||
#define ZEND_FETCH_DIM_TMP_VAR 89
|
||||
#define ZEND_FETCH_CONSTANT 90
|
||||
|
||||
#define ZEND_EXT_STMT 91
|
||||
#define ZEND_EXT_FCALL_BEGIN 92
|
||||
#define ZEND_EXT_FCALL_END 93
|
||||
#define ZEND_EXT_NOP 94
|
||||
|
||||
#define ZEND_INIT_GLOBALS 91
|
||||
|
||||
#define ZEND_EXT_STMT 92
|
||||
#define ZEND_EXT_FCALL_BEGIN 93
|
||||
#define ZEND_EXT_FCALL_END 94
|
||||
#define ZEND_EXT_NOP 95
|
||||
|
||||
/* end of block */
|
||||
|
||||
|
||||
@@ -379,6 +379,10 @@ static inline void zend_fetch_var_address(znode *result, znode *op1, znode *op2,
|
||||
target_symbol_table = &EG(symbol_table);
|
||||
break;
|
||||
case ZEND_FETCH_STATIC:
|
||||
if (!EG(active_op_array)->static_variables) {
|
||||
EG(active_op_array)->static_variables = (HashTable *) emalloc(sizeof(HashTable));
|
||||
zend_hash_init(EG(active_op_array)->static_variables, 2, NULL, PVAL_PTR_DTOR, 0);
|
||||
}
|
||||
target_symbol_table = EG(active_op_array)->static_variables;
|
||||
break;
|
||||
}
|
||||
@@ -1449,6 +1453,7 @@ send_by_ref:
|
||||
**varptr_ptr = *varptr;
|
||||
varptr = *varptr_ptr;
|
||||
varptr->refcount = 1;
|
||||
zval_copy_ctor(varptr);
|
||||
}
|
||||
varptr->is_ref = 1;
|
||||
/* at the end of this code refcount is always 1 */
|
||||
@@ -1870,6 +1875,16 @@ send_by_ref:
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_fcall_end_handler, op_array);
|
||||
}
|
||||
break;
|
||||
case ZEND_INIT_GLOBALS: {
|
||||
zval *globals = (zval *) emalloc(sizeof(zval));
|
||||
|
||||
globals->refcount=1;
|
||||
globals->is_ref=1;
|
||||
globals->type = IS_ARRAY;
|
||||
globals->value.ht = &EG(symbol_table);
|
||||
zend_hash_add(EG(active_symbol_table), "GLOBALS", sizeof("GLOBALS"), &globals, sizeof(zval *), NULL);
|
||||
}
|
||||
break;
|
||||
case ZEND_EXT_NOP:
|
||||
case ZEND_NOP:
|
||||
break;
|
||||
|
||||
@@ -258,7 +258,6 @@ int call_user_function(HashTable *function_table, zval *object, zval *function_n
|
||||
zend_function_state *original_function_state_ptr;
|
||||
zend_op_array *original_op_array;
|
||||
zend_op **original_opline_ptr;
|
||||
zval *this=NULL;
|
||||
CLS_FETCH();
|
||||
ELS_FETCH();
|
||||
|
||||
|
||||
+2
-1
@@ -199,7 +199,8 @@ struct _zend_alloc_globals {
|
||||
void *cache[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
|
||||
unsigned char cache_count[MAX_CACHED_MEMORY];
|
||||
|
||||
# if MEMORY_LIMIT
|
||||
#if MEMORY_LIMIT
|
||||
unsigned int memory_limit;
|
||||
unsigned int allocated_memory;
|
||||
unsigned char memory_exhausted;
|
||||
#endif
|
||||
|
||||
+4
-7
@@ -17,13 +17,10 @@
|
||||
#ifndef _MODULES_H
|
||||
#define _MODULES_H
|
||||
|
||||
#define INIT_FUNC_ARGS int type, int module_number
|
||||
#define INIT_FUNC_ARGS int type, int module_number
|
||||
#define SHUTDOWN_FUNC_ARGS int type, int module_number
|
||||
|
||||
#ifdef HAS_ZEND_INI_ENTRIES
|
||||
#define STANDARD_MODULE_PROPERTIES 0, 0, 0, NULL, 0
|
||||
#else
|
||||
#define STANDARD_MODULE_PROPERTIES 0, 0, 0, NULL, 0
|
||||
#endif
|
||||
|
||||
|
||||
#define MODULE_PERSISTENT 1
|
||||
@@ -33,9 +30,9 @@ typedef struct {
|
||||
char *name;
|
||||
function_entry *functions;
|
||||
int (*module_startup_func)(INIT_FUNC_ARGS);
|
||||
int (*module_shutdown_func)(void);
|
||||
int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS);
|
||||
int (*request_startup_func)(INIT_FUNC_ARGS);
|
||||
int (*request_shutdown_func)(void);
|
||||
int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS);
|
||||
void (*info_func)(void);
|
||||
int request_started,module_started;
|
||||
unsigned char type;
|
||||
|
||||
@@ -90,6 +90,8 @@ void init_op_array(zend_op_array *op_array, int initial_ops_size)
|
||||
|
||||
op_array->static_variables = NULL;
|
||||
|
||||
op_array->initialized_globals = 0;
|
||||
|
||||
zend_llist_apply_with_argument(&zend_extensions, (void (*)(void *, void *)) zend_extension_op_array_ctor_handler, op_array);
|
||||
}
|
||||
|
||||
|
||||
+4
-10
@@ -1922,12 +1922,6 @@ dnl Create the necessary directories if building using VPATH
|
||||
if test ! -d functions; then
|
||||
mkdir functions
|
||||
fi
|
||||
if test ! -d extra; then
|
||||
mkdir extra
|
||||
fi
|
||||
if test ! -d extra/gd; then
|
||||
mkdir extra/gd
|
||||
fi
|
||||
|
||||
PHP_BUILD_DATE=`date '+%Y-%m-%d'`
|
||||
AC_SUBST(PHP_BUILD_DATE)
|
||||
@@ -1937,10 +1931,10 @@ AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME")
|
||||
PHP_OS=`uname`
|
||||
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS")
|
||||
|
||||
AC_OUTPUT(Makefile build-defs.h stamp-h libphp3.module doc/Makefile
|
||||
doc/version.ent doc/checkdoc extra/gd/bdf2gdfont regex/Makefile
|
||||
dbase/Makefile, [
|
||||
chmod +x doc/checkdoc extra/gd/bdf2gdfont
|
||||
AC_OUTPUT(Makefile build-defs.h stamp-h libphp3.module
|
||||
dnl doc/Makefile doc/version.ent doc/checkdoc extra/gd/bdf2gdfont
|
||||
regex/Makefile dbase/Makefile, [
|
||||
dnl chmod +x doc/checkdoc extra/gd/bdf2gdfont
|
||||
], [
|
||||
|
||||
dnl Warn about CGI version with no extra security options.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/* ========= begin header generated by ./mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === debug.c === */
|
||||
void regprint(regex_t *r, FILE *d);
|
||||
static void s_print(register struct re_guts *g, FILE *d);
|
||||
static char *regchar(int ch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
@@ -0,0 +1,35 @@
|
||||
/* ========= begin header generated by ../../regex/mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === ../../regex/engine.c === */
|
||||
static int matcher(register struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
static char *dissect(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static char *backref(register struct match *m, char *start, char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
static char *fast(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static char *slow(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft);
|
||||
#define BOL (OUT+1)
|
||||
#define EOL (BOL+1)
|
||||
#define BOLEOL (BOL+2)
|
||||
#define NOTHING (BOL+3)
|
||||
#define BOW (BOL+4)
|
||||
#define EOW (BOL+5)
|
||||
#define CODEMAX (BOL+5) /* highest code used */
|
||||
#define NONCHAR(c) ((c) > CHAR_MAX)
|
||||
#define NNONCHAR (CODEMAX-CHAR_MAX)
|
||||
#ifdef REDEBUG
|
||||
static void print(struct match *m, char *caption, states st, int ch, FILE *d);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static void at(struct match *m, char *title, char *start, char *stop, sopno startst, sopno stopst);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static char *pchar(int ch);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ../../regex/mkh ========= */
|
||||
@@ -0,0 +1,19 @@
|
||||
/* ========= begin header generated by ./mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === main.c === */
|
||||
void regress(FILE *in);
|
||||
void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts);
|
||||
int options(int type, char *s);
|
||||
int opt(int c, char *s);
|
||||
void fixstr(register char *p);
|
||||
char *check(char *str, regmatch_t sub, char *should);
|
||||
static char *eprint(int err);
|
||||
static int efind(char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
@@ -0,0 +1,48 @@
|
||||
/* ========= begin header generated by ../../regex/mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === ../../regex/regcomp.c === */
|
||||
static void p_ere(register struct parse *p, int stop);
|
||||
static void p_ere_exp(register struct parse *p);
|
||||
static void p_str(register struct parse *p);
|
||||
static void p_bre(register struct parse *p, register int end1, register int end2);
|
||||
static int p_simp_re(register struct parse *p, int starordinary);
|
||||
static int p_count(register struct parse *p);
|
||||
static void p_bracket(register struct parse *p);
|
||||
static void p_b_term(register struct parse *p, register cset *cs);
|
||||
static void p_b_cclass(register struct parse *p, register cset *cs);
|
||||
static void p_b_eclass(register struct parse *p, register cset *cs);
|
||||
static char p_b_symbol(register struct parse *p);
|
||||
static char p_b_coll_elem(register struct parse *p, int endc);
|
||||
static char othercase(int ch);
|
||||
static void bothcases(register struct parse *p, int ch);
|
||||
static void ordinary(register struct parse *p, register int ch);
|
||||
static void nonnewline(register struct parse *p);
|
||||
static void repeat(register struct parse *p, sopno start, int from, int to);
|
||||
static int seterr(register struct parse *p, int e);
|
||||
static cset *allocset(register struct parse *p);
|
||||
static void freeset(register struct parse *p, register cset *cs);
|
||||
static int freezeset(register struct parse *p, register cset *cs);
|
||||
static int firstch(register struct parse *p, register cset *cs);
|
||||
static int nch(register struct parse *p, register cset *cs);
|
||||
static void mcadd(register struct parse *p, register cset *cs, register char *cp);
|
||||
static void mcinvert(register struct parse *p, register cset *cs);
|
||||
static void mccase(register struct parse *p, register cset *cs);
|
||||
static int isinsets(register struct re_guts *g, int c);
|
||||
static int samesets(register struct re_guts *g, int c1, int c2);
|
||||
static void categorize(struct parse *p, register struct re_guts *g);
|
||||
static sopno dupl(register struct parse *p, sopno start, sopno finish);
|
||||
static void doemit(register struct parse *p, sop op, size_t opnd);
|
||||
static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos);
|
||||
static void dofwd(register struct parse *p, sopno pos, sop value);
|
||||
static void enlarge(register struct parse *p, sopno size);
|
||||
static void stripsnug(register struct parse *p, register struct re_guts *g);
|
||||
static void findmust(register struct parse *p, register struct re_guts *g);
|
||||
static sopno pluscount(register struct parse *p, register struct re_guts *g);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ../../regex/mkh ========= */
|
||||
@@ -0,0 +1,12 @@
|
||||
/* ========= begin header generated by ../../regex/mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === ../../regex/regerror.c === */
|
||||
static char *regatoi(const regex_t *preg, char *localbuf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ../../regex/mkh ========= */
|
||||
@@ -90,10 +90,6 @@
|
||||
#include "functions/php3_sysvshm.h"
|
||||
#include "functions/php3_dav.h"
|
||||
|
||||
|
||||
extern php3_ini_structure php3_ini;
|
||||
extern php3_ini_structure php3_ini_master;
|
||||
|
||||
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 };
|
||||
|
||||
+12
-12
@@ -34,6 +34,8 @@
|
||||
|
||||
#define DEBUG_CFG_PARSER 1
|
||||
#include "php.h"
|
||||
#include "php_globals.h"
|
||||
#include "php_ini.h"
|
||||
#include "functions/dl.h"
|
||||
#include "functions/file.h"
|
||||
#include "functions/php3_browscap.h"
|
||||
@@ -161,7 +163,7 @@ int php3_init_config(void)
|
||||
#if USE_CONFIG_FILE
|
||||
{
|
||||
char *env_location,*default_location,*php_ini_path;
|
||||
int safe_mode_state = php3_ini.safe_mode;
|
||||
int safe_mode_state = PG(safe_mode);
|
||||
char *opened_path;
|
||||
int free_default_location=0;
|
||||
|
||||
@@ -203,13 +205,13 @@ int php3_init_config(void)
|
||||
/* if path was set via -c flag, only look there */
|
||||
strcpy(php_ini_path,default_location);
|
||||
}
|
||||
php3_ini.safe_mode = 0;
|
||||
PG(safe_mode) = 0;
|
||||
cfgin = php3_fopen_with_path("php3.ini","r",php_ini_path,&opened_path);
|
||||
free(php_ini_path);
|
||||
if (free_default_location) {
|
||||
free(default_location);
|
||||
}
|
||||
php3_ini.safe_mode = safe_mode_state;
|
||||
PG(safe_mode) = safe_mode_state;
|
||||
|
||||
if (!cfgin) {
|
||||
# if WIN32|WINNT
|
||||
@@ -247,22 +249,22 @@ int php3_init_config(void)
|
||||
|
||||
int php3_minit_browscap(INIT_FUNC_ARGS)
|
||||
{
|
||||
TLS_VARS;
|
||||
char *browscap = INI_STR("browscap");
|
||||
|
||||
if (php3_ini.browscap) {
|
||||
if (browscap) {
|
||||
if (_php3_hash_init(&GLOBAL(browser_hash), 0, NULL, (void (*)(void *))pvalue_browscap_destructor, 1)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
cfgin = fopen(php3_ini.browscap,"r");
|
||||
cfgin = fopen(browscap, "r");
|
||||
if (!cfgin) {
|
||||
php3_error(E_WARNING,"Cannot open '%s' for reading",php3_ini.browscap);
|
||||
php3_error(E_WARNING,"Cannot open '%s' for reading", browscap);
|
||||
return FAILURE;
|
||||
}
|
||||
init_cfg_scanner();
|
||||
active__php3_hash_table = &GLOBAL(browser_hash);
|
||||
parsing_mode = PARSING_MODE_BROWSCAP;
|
||||
currently_parsed_filename = php3_ini.browscap;
|
||||
currently_parsed_filename = browscap;
|
||||
yyparse();
|
||||
fclose(cfgin);
|
||||
}
|
||||
@@ -278,11 +280,9 @@ int php3_shutdown_config(void)
|
||||
}
|
||||
|
||||
|
||||
int php3_mshutdown_browscap(void)
|
||||
int php3_mshutdown_browscap(SHUTDOWN_FUNC_ARGS)
|
||||
{
|
||||
TLS_VARS;
|
||||
|
||||
if (php3_ini.browscap) {
|
||||
if (INI_STR("browscap")) {
|
||||
_php3_hash_destroy(&GLOBAL(browser_hash));
|
||||
}
|
||||
return SUCCESS;
|
||||
|
||||
+27
-29
@@ -34,6 +34,7 @@
|
||||
#endif
|
||||
|
||||
#include "php.h"
|
||||
#include "php_globals.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -110,10 +111,10 @@ PHPAPI int _php3_check_open_basedir(char *path)
|
||||
int local_open_basedir_pos;
|
||||
|
||||
/* Only check when open_basedir is available */
|
||||
if (php3_ini.open_basedir && *php3_ini.open_basedir) {
|
||||
if (PG(open_basedir) && *PG(open_basedir)) {
|
||||
|
||||
/* Special case basedir==".": Use script-directory */
|
||||
if ((strcmp(php3_ini.open_basedir, ".") == 0) &&
|
||||
if ((strcmp(PG(open_basedir), ".") == 0) &&
|
||||
GLOBAL(request_info).filename &&
|
||||
*GLOBAL(request_info).filename
|
||||
) {
|
||||
@@ -148,7 +149,7 @@ PHPAPI int _php3_check_open_basedir(char *path)
|
||||
|
||||
} else {
|
||||
/* Else use the unmodified path */
|
||||
strcpy(local_open_basedir, php3_ini.open_basedir);
|
||||
strcpy(local_open_basedir, PG(open_basedir));
|
||||
}
|
||||
|
||||
/* Resolve the real path into resolved_name */
|
||||
@@ -185,11 +186,11 @@ PHPAPI FILE *php3_fopen_wrapper(char *path, char *mode, int options, int *issock
|
||||
}
|
||||
#endif
|
||||
|
||||
if (options & USE_PATH && php3_ini.include_path != NULL) {
|
||||
return php3_fopen_with_path(path, mode, php3_ini.include_path, NULL);
|
||||
if (options & USE_PATH && PG(include_path) != NULL) {
|
||||
return php3_fopen_with_path(path, mode, PG(include_path), NULL);
|
||||
} else {
|
||||
if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0;
|
||||
if (options & ENFORCE_SAFE_MODE && php3_ini.safe_mode && (!_php3_checkuid(path, cm))) {
|
||||
if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!_php3_checkuid(path, cm))) {
|
||||
return NULL;
|
||||
}
|
||||
if (_php3_check_open_basedir(path)) return NULL;
|
||||
@@ -211,7 +212,7 @@ FILE *php3_fopen_for_parser(void)
|
||||
fn = GLOBAL(request_info).filename;
|
||||
path_info = GLOBAL(request_info).path_info;
|
||||
#if HAVE_PWD_H
|
||||
if (php3_ini.user_dir && *php3_ini.user_dir
|
||||
if (PG(user_dir) && *PG(user_dir)
|
||||
&& path_info && '/' == path_info[0] && '~' == path_info[1]) {
|
||||
|
||||
char user[32];
|
||||
@@ -229,11 +230,11 @@ FILE *php3_fopen_for_parser(void)
|
||||
|
||||
pw = getpwnam(user);
|
||||
if (pw && pw->pw_dir) {
|
||||
fn = emalloc(strlen(php3_ini.user_dir) + strlen(path_info) + strlen(pw->pw_dir) + 4);
|
||||
fn = emalloc(strlen(PG(user_dir)) + strlen(path_info) + strlen(pw->pw_dir) + 4);
|
||||
if (fn) {
|
||||
strcpy(fn, pw->pw_dir); /* safe */
|
||||
strcat(fn, "/"); /* safe */
|
||||
strcat(fn, php3_ini.user_dir); /* safe */
|
||||
strcat(fn, PG(user_dir)); /* safe */
|
||||
strcat(fn, "/"); /* safe */
|
||||
strcat(fn, s + 1); /* safe (shorter than path_info) */
|
||||
STR_FREE(GLOBAL(request_info).filename);
|
||||
@@ -244,16 +245,16 @@ FILE *php3_fopen_for_parser(void)
|
||||
} else
|
||||
#endif
|
||||
#if WIN32
|
||||
if (php3_ini.doc_root && path_info && ('/' == *php3_ini.doc_root ||
|
||||
'\\' == *php3_ini.doc_root || strstr(php3_ini.doc_root,":\\") ||
|
||||
strstr(php3_ini.doc_root,":/"))) {
|
||||
if (PG(doc_root) && path_info && ('/' == *PG(doc_root) ||
|
||||
'\\' == *PG(doc_root) || strstr(PG(doc_root),":\\") ||
|
||||
strstr(PG(doc_root),":/"))) {
|
||||
#else
|
||||
if (php3_ini.doc_root && '/' == *php3_ini.doc_root && path_info) {
|
||||
if (PG(doc_root) && '/' == *PG(doc_root) && path_info) {
|
||||
#endif
|
||||
l = strlen(php3_ini.doc_root);
|
||||
l = strlen(PG(doc_root));
|
||||
fn = emalloc(l + strlen(path_info) + 2);
|
||||
if (fn) {
|
||||
memcpy(fn, php3_ini.doc_root, l);
|
||||
memcpy(fn, PG(doc_root), l);
|
||||
if ('/' != fn[l - 1] || '\\' != fn[l - 1]) /* l is never 0 */
|
||||
fn[l++] = '/';
|
||||
if ('/' == path_info[0])
|
||||
@@ -316,7 +317,7 @@ PHPAPI FILE *php3_fopen_with_path(char *filename, char *mode, char *path, char *
|
||||
}
|
||||
/* Relative path open */
|
||||
if (*filename == '.') {
|
||||
if (php3_ini.safe_mode && (!_php3_checkuid(filename, cm))) {
|
||||
if (PG(safe_mode) && (!_php3_checkuid(filename, cm))) {
|
||||
return NULL;
|
||||
}
|
||||
if (_php3_check_open_basedir(filename)) return NULL;
|
||||
@@ -332,9 +333,9 @@ PHPAPI FILE *php3_fopen_with_path(char *filename, char *mode, char *path, char *
|
||||
#else
|
||||
if (*filename == '/') {
|
||||
#endif
|
||||
if (php3_ini.safe_mode) {
|
||||
if(php3_ini.doc_root) {
|
||||
snprintf(trypath, MAXPATHLEN, "%s%s", php3_ini.doc_root, filename);
|
||||
if (PG(safe_mode)) {
|
||||
if(PG(doc_root)) {
|
||||
snprintf(trypath, MAXPATHLEN, "%s%s", PG(doc_root), filename);
|
||||
} else {
|
||||
strncpy(trypath,filename,MAXPATHLEN);
|
||||
}
|
||||
@@ -353,7 +354,7 @@ PHPAPI FILE *php3_fopen_with_path(char *filename, char *mode, char *path, char *
|
||||
}
|
||||
}
|
||||
if (!path || (path && !*path)) {
|
||||
if (php3_ini.safe_mode && (!_php3_checkuid(filename, cm))) {
|
||||
if (PG(safe_mode) && (!_php3_checkuid(filename, cm))) {
|
||||
return NULL;
|
||||
}
|
||||
if (_php3_check_open_basedir(filename)) return NULL;
|
||||
@@ -378,7 +379,7 @@ PHPAPI FILE *php3_fopen_with_path(char *filename, char *mode, char *path, char *
|
||||
end++;
|
||||
}
|
||||
snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename);
|
||||
if (php3_ini.safe_mode) {
|
||||
if (PG(safe_mode)) {
|
||||
if (stat(trypath, &sb) == 0 && (!_php3_checkuid(trypath, cm))) {
|
||||
efree(pathbuf);
|
||||
return NULL;
|
||||
@@ -463,8 +464,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i
|
||||
free_url(resource);
|
||||
return NULL;
|
||||
}
|
||||
server.sin_addr.s_addr = lookup_hostname(resource->host);
|
||||
server.sin_family = AF_INET;
|
||||
lookup_hostname(resource->host, &server.sin_addr);
|
||||
|
||||
if (server.sin_addr.s_addr == -1) {
|
||||
SOCK_FCLOSE(*socketd);
|
||||
@@ -629,8 +629,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i
|
||||
free_url(resource);
|
||||
return NULL;
|
||||
}
|
||||
server.sin_addr.s_addr = lookup_hostname(resource->host);
|
||||
server.sin_family = AF_INET;
|
||||
lookup_hostname(resource->host, &server.sin_addr);
|
||||
|
||||
if (server.sin_addr.s_addr == -1) {
|
||||
SOCK_FCLOSE(*socketd);
|
||||
@@ -842,8 +841,7 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i
|
||||
free_url(resource);
|
||||
return NULL;
|
||||
}
|
||||
server.sin_addr.s_addr = lookup_hostname(resource->host);
|
||||
server.sin_family = AF_INET;
|
||||
lookup_hostname(resource->host, &server.sin_addr);
|
||||
|
||||
if (server.sin_addr.s_addr == -1) {
|
||||
free_url(resource);
|
||||
@@ -885,11 +883,11 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i
|
||||
|
||||
} else {
|
||||
if (options & USE_PATH) {
|
||||
fp = php3_fopen_with_path((char *) path, mode, php3_ini.include_path, NULL);
|
||||
fp = php3_fopen_with_path((char *) path, mode, PG(include_path), NULL);
|
||||
} else {
|
||||
int cm=2;
|
||||
if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0;
|
||||
if (options & ENFORCE_SAFE_MODE && php3_ini.safe_mode && (!_php3_checkuid(path, cm))) {
|
||||
if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!_php3_checkuid(path, cm))) {
|
||||
fp = NULL;
|
||||
} else {
|
||||
if (_php3_check_open_basedir((char *) path)) {
|
||||
|
||||
+186
-262
@@ -63,6 +63,7 @@
|
||||
#endif
|
||||
#include "zend.h"
|
||||
#include "php_ini.h"
|
||||
#include "php_globals.h"
|
||||
#include "main.h"
|
||||
#include "control_structures.h"
|
||||
#include "fopen-wrappers.h"
|
||||
@@ -98,12 +99,19 @@ struct sapi_request_info *sapi_rqst;
|
||||
#include "getopt.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ZTS
|
||||
int compiler_globals_id;
|
||||
int executor_globals_id;
|
||||
#endif
|
||||
|
||||
#ifndef ZTS
|
||||
php_core_globals core_globals;
|
||||
#endif
|
||||
|
||||
void _php3_build_argv(char * ELS_DC);
|
||||
static void php3_timeout(int dummy);
|
||||
static void php3_set_timeout(long seconds INLINE_TLS);
|
||||
|
||||
void *gLock; /*mutex variable */
|
||||
|
||||
|
||||
@@ -115,6 +123,137 @@ void *gLock; /*mutex variable */
|
||||
HashTable configuration_hash;
|
||||
char *php3_ini_path = NULL;
|
||||
|
||||
|
||||
static PHP_INI_MH(OnSetPrecision)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
EG(precision) = atoi(new_value);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static PHP_INI_MH(OnChangeMaxExecutionTime)
|
||||
{
|
||||
int new_timeout;
|
||||
|
||||
if (new_value) {
|
||||
new_timeout = atoi(new_value);
|
||||
} else {
|
||||
new_timeout = 0;
|
||||
}
|
||||
php3_set_timeout(new_timeout);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static PHP_INI_MH(OnChangeMemoryLimit)
|
||||
{
|
||||
int new_limit;
|
||||
|
||||
if (new_value) {
|
||||
new_limit = atoi(new_value);
|
||||
} else {
|
||||
new_limit = 2<<30; /* effectively, no limit */
|
||||
}
|
||||
return zend_set_memory_limit(new_limit);
|
||||
}
|
||||
|
||||
|
||||
static PHP_INI_MH(OnUpdateErrorReporting)
|
||||
{
|
||||
ELS_FETCH();
|
||||
|
||||
if (!new_value) {
|
||||
EG(error_reporting) = E_ALL & ~E_NOTICE;
|
||||
} else {
|
||||
EG(error_reporting) = atoi(new_value);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* Need to convert to strings and make use of:
|
||||
* DEFAULT_SHORT_OPEN_TAG
|
||||
* PHP_SAFE_MODE
|
||||
*
|
||||
* Need to be read from the environment (?):
|
||||
* PHP_AUTO_PREPEND_FILE
|
||||
* PHP_AUTO_APPEND_FILE
|
||||
* PHP_DOCUMENT_ROOT
|
||||
* PHP_USER_DIR
|
||||
* PHP_INCLUDE_PATH
|
||||
*/
|
||||
|
||||
#ifndef SAFE_MODE_EXEC_DIR
|
||||
# define SAFE_MODE_EXEC_DIR "/"
|
||||
#endif
|
||||
|
||||
#ifdef PHP_PROG_SENDMAIL
|
||||
# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL " -t"
|
||||
#else
|
||||
# define DEFAULT_SENDMAIL_PATH NULL
|
||||
#endif
|
||||
|
||||
PHP_INI_BEGIN()
|
||||
PHP_INI_ENTRY("short_open_tag", "1", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, short_tags))
|
||||
PHP_INI_ENTRY("asp_tags", "0", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, asp_tags))
|
||||
PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision, NULL)
|
||||
|
||||
PHP_INI_ENTRY("highlight.comment", HL_COMMENT_COLOR, PHP_INI_ALL, NULL, NULL)
|
||||
PHP_INI_ENTRY("highlight.default", HL_DEFAULT_COLOR, PHP_INI_ALL, NULL, NULL)
|
||||
PHP_INI_ENTRY("highlight.html", HL_HTML_COLOR, PHP_INI_ALL, NULL, NULL)
|
||||
PHP_INI_ENTRY("highlight.string", HL_STRING_COLOR, PHP_INI_ALL, NULL, NULL)
|
||||
PHP_INI_ENTRY("highlight.bg", HL_BG_COLOR, PHP_INI_ALL, NULL, NULL)
|
||||
PHP_INI_ENTRY("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, NULL, NULL)
|
||||
|
||||
PHP_INI_ENTRY("magic_quotes_gpc", "1", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, magic_quotes_gpc))
|
||||
PHP_INI_ENTRY("magic_quotes_runtime", "0", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, magic_quotes_runtime))
|
||||
PHP_INI_ENTRY("magic_quotes_sybase", "0", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, magic_quotes_sybase))
|
||||
|
||||
PHP_INI_ENTRY("safe_mode", "0", PHP_INI_SYSTEM, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, safe_mode))
|
||||
PHP_INI_ENTRY("sql.safe_mode", "0", PHP_INI_SYSTEM, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, sql_safe_mode))
|
||||
PHP_INI_ENTRY("safe_mode_exec_dir", SAFE_MODE_EXEC_DIR, PHP_INI_SYSTEM, OnUpdateString, (void *) XtOffsetOf(php_core_globals, safe_mode_exec_dir))
|
||||
PHP_INI_ENTRY("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, enable_dl))
|
||||
|
||||
PHP_INI_ENTRY("SMTP", "localhost", PHP_INI_ALL, NULL, NULL)
|
||||
PHP_INI_ENTRY("sendmail_path", DEFAULT_SENDMAIL_PATH, PHP_INI_SYSTEM, NULL, NULL)
|
||||
PHP_INI_ENTRY("sendmail_from", NULL, PHP_INI_ALL, NULL, NULL)
|
||||
|
||||
PHP_INI_ENTRY("error_reporting", NULL, PHP_INI_ALL, OnUpdateErrorReporting, NULL)
|
||||
PHP_INI_ENTRY("display_errors", "1", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, display_errors))
|
||||
PHP_INI_ENTRY("track_errors", "0", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, track_errors))
|
||||
PHP_INI_ENTRY("log_errors", "0", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, log_errors))
|
||||
PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateString, (void *) XtOffsetOf(php_core_globals, error_log))
|
||||
|
||||
PHP_INI_ENTRY("auto_prepend_file", NULL, PHP_INI_ALL, OnUpdateString, (void *) XtOffsetOf(php_core_globals, auto_prepend_file))
|
||||
PHP_INI_ENTRY("auto_append_file", NULL, PHP_INI_ALL, OnUpdateString, (void *) XtOffsetOf(php_core_globals, auto_append_file))
|
||||
|
||||
PHP_INI_ENTRY("y2k_compliance", "0", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, y2k_compliance))
|
||||
|
||||
PHP_INI_ENTRY("doc_root", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, (void *) XtOffsetOf(php_core_globals, doc_root))
|
||||
PHP_INI_ENTRY("user_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, (void *) XtOffsetOf(php_core_globals, user_dir))
|
||||
PHP_INI_ENTRY("include_path", NULL, PHP_INI_ALL, OnUpdateStringUnempty, (void *) XtOffsetOf(php_core_globals, include_path))
|
||||
PHP_INI_ENTRY("open_basedir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, (void *) XtOffsetOf(php_core_globals, open_basedir))
|
||||
PHP_INI_ENTRY("extension_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, (void *) XtOffsetOf(php_core_globals, extension_dir))
|
||||
|
||||
PHP_INI_ENTRY("upload_tmp_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, (void *) XtOffsetOf(php_core_globals, upload_tmp_dir))
|
||||
PHP_INI_ENTRY("upload_max_filesize", "2097152", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, upload_max_filesize))
|
||||
|
||||
PHP_INI_ENTRY("browscap", NULL, PHP_INI_SYSTEM, NULL, NULL)
|
||||
|
||||
PHP_INI_ENTRY("define_syslog_variables", "0", PHP_INI_ALL, NULL, NULL)
|
||||
|
||||
PHP_INI_ENTRY("max_execution_time", "30", PHP_INI_ALL, OnChangeMaxExecutionTime, NULL)
|
||||
PHP_INI_ENTRY("memory_limit", "8388608", PHP_INI_ALL, OnChangeMemoryLimit, NULL)
|
||||
|
||||
PHP_INI_ENTRY("track_vars", "0", PHP_INI_ALL, OnUpdateInt, (void *) XtOffsetOf(php_core_globals, track_vars))
|
||||
PHP_INI_ENTRY("gpc_order", "GPC", PHP_INI_ALL, OnUpdateStringUnempty, (void *) XtOffsetOf(php_core_globals, gpc_order))
|
||||
PHP_INI_ENTRY("arg_separator", "&", PHP_INI_ALL, OnUpdateStringUnempty, (void *) XtOffsetOf(php_core_globals, arg_separator))
|
||||
PHP_INI_END()
|
||||
|
||||
|
||||
|
||||
#ifndef THREAD_SAFE
|
||||
/*
|
||||
* Globals yet to be protected
|
||||
@@ -139,17 +278,6 @@ request_rec *php3_rqst = NULL; /* request record pointer for apache module versi
|
||||
|
||||
#endif
|
||||
|
||||
php3_ini_structure php3_ini;
|
||||
php3_ini_structure php3_ini_master;
|
||||
|
||||
void _php3_build_argv(char * ELS_DC);
|
||||
static void php3_timeout(int dummy);
|
||||
static void php3_set_timeout(long seconds INLINE_TLS);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if APACHE
|
||||
void php3_apache_puts(const char *s)
|
||||
{
|
||||
@@ -177,17 +305,17 @@ void php3_apache_putc(char c)
|
||||
void php3_log_err(char *log_message)
|
||||
{
|
||||
FILE *log_file;
|
||||
TLS_VARS;
|
||||
PLS_FETCH();
|
||||
|
||||
/* Try to use the specified logging location. */
|
||||
if (php3_ini.error_log != NULL) {
|
||||
if (PG(error_log) != NULL) {
|
||||
#if HAVE_SYSLOG_H
|
||||
if (strcmp(php3_ini.error_log, "syslog")) {
|
||||
if (strcmp(PG(error_log), "syslog")) {
|
||||
syslog(LOG_NOTICE, log_message);
|
||||
return;
|
||||
} else {
|
||||
#endif
|
||||
log_file = fopen(php3_ini.error_log, "a");
|
||||
log_file = fopen(PG(error_log), "a");
|
||||
if (log_file != NULL) {
|
||||
fprintf(log_file, log_message);
|
||||
fprintf(log_file, "\n");
|
||||
@@ -227,7 +355,6 @@ void php3_log_err(char *log_message)
|
||||
/* wrapper for modules to use PHPWRITE */
|
||||
PHPAPI int php3_write(void *buf, int size)
|
||||
{
|
||||
TLS_VARS;
|
||||
return PHPWRITE(buf, size);
|
||||
}
|
||||
|
||||
@@ -315,30 +442,33 @@ PHPAPI void php3_error(int type, const char *format,...)
|
||||
}
|
||||
|
||||
/* get include file name */
|
||||
if (php3_ini.log_errors || php3_ini.display_errors) {
|
||||
if (PG(log_errors) || PG(display_errors)) {
|
||||
va_start(args, format);
|
||||
size = vsnprintf(buffer, sizeof(buffer) - 1, format, args);
|
||||
va_end(args);
|
||||
buffer[sizeof(buffer) - 1] = 0;
|
||||
|
||||
if (php3_ini.log_errors) {
|
||||
if (PG(log_errors)) {
|
||||
char log_buffer[1024];
|
||||
|
||||
snprintf(log_buffer, 1024, "PHP 3 %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);
|
||||
php3_log_err(log_buffer);
|
||||
}
|
||||
if (php3_ini.display_errors) {
|
||||
if(php3_ini.error_prepend_string) {
|
||||
PUTS(php3_ini.error_prepend_string);
|
||||
if (PG(display_errors)) {
|
||||
char *prepend_string = INI_STR("error_prepend_string");
|
||||
char *append_string = INI_STR("error_append_string");
|
||||
|
||||
if (prepend_string) {
|
||||
PUTS(prepend_string);
|
||||
}
|
||||
php3_printf("<br>\n<b>%s</b>: %s in <b>%s</b> on line <b>%d</b><br>\n", error_type_str, buffer, error_filename, error_lineno);
|
||||
if(php3_ini.error_append_string) {
|
||||
PUTS(php3_ini.error_append_string);
|
||||
if (append_string) {
|
||||
PUTS(append_string);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (php3_ini.track_errors) {
|
||||
if (PG(track_errors)) {
|
||||
pval tmp;
|
||||
|
||||
va_start(args, format);
|
||||
@@ -369,9 +499,9 @@ PHPAPI void php3_error(int type, const char *format,...)
|
||||
#if HAVE_SETITIMER
|
||||
static void php3_timeout(int dummy)
|
||||
{
|
||||
TLS_VARS;
|
||||
PLS_FETCH();
|
||||
|
||||
php3_error(E_ERROR, "Maximum execution time of %d seconds exceeded", php3_ini.max_execution_time);
|
||||
php3_error(E_ERROR, "Maximum execution time of %d seconds exceeded", PG(max_execution_time));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -423,7 +553,7 @@ void php3_set_time_limit(INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
pval *new_timeout;
|
||||
|
||||
if (php3_ini.safe_mode) {
|
||||
if (PG(safe_mode)) {
|
||||
php3_error(E_WARNING, "Cannot set time limit in safe mode");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -462,7 +592,7 @@ static void php_message_handler_for_zend(long message, void *data)
|
||||
{
|
||||
switch (message) {
|
||||
case ZMSG_ENABLE_TRACK_VARS:
|
||||
php3_ini.track_vars = 1;
|
||||
PG(track_vars) = 1;
|
||||
break;
|
||||
case ZMSG_FAILED_INCLUDE_FOPEN:
|
||||
php3_error(E_WARNING, "Failed opening '%s' for inclusion", php3_strip_url_passwd((char *) data));
|
||||
@@ -474,11 +604,11 @@ static void php_message_handler_for_zend(long message, void *data)
|
||||
php3_error(E_WARNING, "Failed opening '%s' for highlighting", php3_strip_url_passwd((char *) data));
|
||||
break;
|
||||
case ZMSG_MEMORY_LEAK_DETECTED: {
|
||||
mem_header *t = (mem_header *) data;
|
||||
ELS_FETCH();
|
||||
|
||||
if (EG(error_reporting)&E_WARNING) {
|
||||
#if ZEND_DEBUG
|
||||
mem_header *t = (mem_header *) data;
|
||||
# if APACHE /* log into the errorlog, since at this time we can't send messages to the browser */
|
||||
char memory_leak_buf[512];
|
||||
|
||||
@@ -511,7 +641,7 @@ int php3_request_startup(CLS_D ELS_DC)
|
||||
}
|
||||
#endif
|
||||
|
||||
php3_set_timeout(php3_ini.max_execution_time _INLINE_TLS);
|
||||
php3_set_timeout(PG(max_execution_time) _INLINE_TLS);
|
||||
|
||||
GLOBAL(initialized) = 0;
|
||||
|
||||
@@ -531,13 +661,10 @@ int php3_request_startup(CLS_D ELS_DC)
|
||||
|
||||
/* initialize global variables */
|
||||
{
|
||||
EG(error_reporting) = php3_ini.errors;
|
||||
GLOBAL(header_is_being_sent) = 0;
|
||||
GLOBAL(php3_track_vars) = php3_ini.track_vars;
|
||||
EG(precision) = php3_ini.precision;
|
||||
}
|
||||
|
||||
if (php3_init_request_info((void *) &php3_ini)) {
|
||||
if (php3_init_request_info(NULL)) {
|
||||
php3_printf("Unable to initialize request info.\n");
|
||||
return FAILURE;
|
||||
}
|
||||
@@ -594,7 +721,7 @@ void php3_request_shutdown(void *dummy INLINE_TLS)
|
||||
|
||||
GLOBAL(initialized) &= ~INIT_ENVIRONMENT; /* does not require any special shutdown */
|
||||
|
||||
zend_ini_rshutdown();
|
||||
php_ini_rshutdown();
|
||||
|
||||
shutdown_scanner(CLS_C);
|
||||
|
||||
@@ -603,7 +730,7 @@ void php3_request_shutdown(void *dummy INLINE_TLS)
|
||||
|
||||
if (GLOBAL(initialized) & INIT_REQUEST_INFO) {
|
||||
SHUTDOWN_DEBUG("Request info");
|
||||
php3_destroy_request_info((void *) &php3_ini);
|
||||
php3_destroy_request_info(NULL);
|
||||
GLOBAL(initialized) &= ~INIT_REQUEST_INFO;
|
||||
}
|
||||
if (GLOBAL(initialized) & INIT_SCANNER) {
|
||||
@@ -672,205 +799,10 @@ void php3_request_shutdown(void *dummy INLINE_TLS)
|
||||
|
||||
static int php3_config_ini_startup(ELS_D)
|
||||
{
|
||||
/* set the memory limit to a reasonable number so that we can get
|
||||
* through this startup phase properly
|
||||
*/
|
||||
php3_ini.memory_limit=1<<23; /* 8MB */
|
||||
|
||||
if (php3_init_config() == FAILURE) {
|
||||
php3_printf("PHP: Unable to parse configuration file.\n");
|
||||
return FAILURE;
|
||||
}
|
||||
#if !(USE_SAPI)
|
||||
GLOBAL(module_initialized) |= INIT_CONFIG;
|
||||
#endif
|
||||
/* initialize run-time variables */
|
||||
/* I have remarked out some stuff
|
||||
that may or may not be needed */
|
||||
{
|
||||
char *temp;
|
||||
|
||||
if (cfg_get_long("max_execution_time", &php3_ini.max_execution_time) == FAILURE) {
|
||||
php3_ini.max_execution_time = 30;
|
||||
}
|
||||
if (cfg_get_long("memory_limit", &php3_ini.memory_limit) == FAILURE) {
|
||||
php3_ini.memory_limit = 1<<23; /* 8MB */
|
||||
}
|
||||
if (cfg_get_long("precision", &php3_ini.precision) == FAILURE) {
|
||||
php3_ini.precision = 14;
|
||||
}
|
||||
if (cfg_get_string("SMTP", &php3_ini.smtp) == FAILURE) {
|
||||
php3_ini.smtp = "localhost";
|
||||
}
|
||||
if (cfg_get_string("sendmail_path", &php3_ini.sendmail_path) == FAILURE
|
||||
|| !php3_ini.sendmail_path[0]) {
|
||||
#ifdef PHP_PROG_SENDMAIL
|
||||
php3_ini.sendmail_path = PHP_PROG_SENDMAIL " -t";
|
||||
#else
|
||||
php3_ini.sendmail_path = NULL;
|
||||
#endif
|
||||
}
|
||||
if (cfg_get_string("sendmail_from", &php3_ini.sendmail_from) == FAILURE) {
|
||||
php3_ini.sendmail_from = NULL;
|
||||
}
|
||||
if (cfg_get_long("error_reporting", &php3_ini.errors) == FAILURE) {
|
||||
php3_ini.errors = E_ALL & ~E_NOTICE;
|
||||
}
|
||||
EG(error_reporting) = php3_ini.errors;
|
||||
if (cfg_get_string("error_log", &php3_ini.error_log) == FAILURE) {
|
||||
php3_ini.error_log = NULL;
|
||||
}
|
||||
|
||||
if (cfg_get_long("track_errors", &php3_ini.track_errors) == FAILURE) {
|
||||
php3_ini.track_errors = 0;
|
||||
}
|
||||
if (cfg_get_long("display_errors", &php3_ini.display_errors) == FAILURE) {
|
||||
php3_ini.display_errors = 1;
|
||||
}
|
||||
if (cfg_get_long("log_errors", &php3_ini.log_errors) == FAILURE) {
|
||||
php3_ini.log_errors = 0;
|
||||
}
|
||||
if (cfg_get_long("warn_plus_overloading", &php3_ini.warn_plus_overloading) == FAILURE) {
|
||||
php3_ini.warn_plus_overloading = 0;
|
||||
}
|
||||
if (cfg_get_long("magic_quotes_gpc", &php3_ini.magic_quotes_gpc) == FAILURE) {
|
||||
php3_ini.magic_quotes_gpc = MAGIC_QUOTES;
|
||||
}
|
||||
if (cfg_get_long("magic_quotes_runtime", &php3_ini.magic_quotes_runtime) == FAILURE) {
|
||||
php3_ini.magic_quotes_runtime = MAGIC_QUOTES;
|
||||
}
|
||||
if (cfg_get_long("magic_quotes_sybase", &php3_ini.magic_quotes_sybase) == FAILURE) {
|
||||
php3_ini.magic_quotes_sybase = 0;
|
||||
}
|
||||
if (cfg_get_long("y2k_compliance", &php3_ini.y2k_compliance) == FAILURE) {
|
||||
php3_ini.y2k_compliance = 0;
|
||||
}
|
||||
if (cfg_get_long("define_syslog_variables", &php3_ini.define_syslog_variables) == FAILURE) {
|
||||
php3_ini.define_syslog_variables = 0;
|
||||
}
|
||||
if (cfg_get_string("doc_root", &php3_ini.doc_root) == FAILURE) {
|
||||
if ((temp = getenv("PHP_DOCUMENT_ROOT"))) {
|
||||
php3_ini.doc_root = temp;
|
||||
} else {
|
||||
php3_ini.doc_root = NULL;
|
||||
}
|
||||
}
|
||||
if (cfg_get_long("short_open_tag", &php3_ini.short_open_tag) == FAILURE) {
|
||||
php3_ini.short_open_tag = DEFAULT_SHORT_OPEN_TAG;
|
||||
}
|
||||
if (cfg_get_long("asp_tags", &php3_ini.asp_tags) == FAILURE) {
|
||||
php3_ini.asp_tags = 0;
|
||||
}
|
||||
if (cfg_get_string("user_dir", &php3_ini.user_dir) == FAILURE) {
|
||||
if ((temp = getenv("PHP_USER_DIR"))) {
|
||||
php3_ini.user_dir = temp;
|
||||
} else {
|
||||
php3_ini.user_dir = NULL;
|
||||
}
|
||||
}
|
||||
if (cfg_get_long("safe_mode", &php3_ini.safe_mode) == FAILURE) {
|
||||
php3_ini.safe_mode = PHP_SAFE_MODE;
|
||||
}
|
||||
if (cfg_get_string("safe_mode_exec_dir", &php3_ini.safe_mode_exec_dir) == FAILURE) {
|
||||
#ifdef PHP_SAFE_MODE_EXEC_DIR
|
||||
php3_ini.safe_mode_exec_dir = PHP_SAFE_MODE_EXEC_DIR;
|
||||
#else
|
||||
php3_ini.safe_mode_exec_dir = "/";
|
||||
#endif
|
||||
}
|
||||
if (cfg_get_long("track_vars", &php3_ini.track_vars) == FAILURE) {
|
||||
php3_ini.track_vars = PHP_TRACK_VARS;
|
||||
}
|
||||
if (cfg_get_string("include_path", &php3_ini.include_path) == FAILURE) {
|
||||
if ((temp = getenv("PHP_INCLUDE_PATH"))) {
|
||||
php3_ini.include_path = temp;
|
||||
} else {
|
||||
php3_ini.include_path = NULL;
|
||||
}
|
||||
}
|
||||
if (cfg_get_string("auto_prepend_file", &php3_ini.auto_prepend_file) == FAILURE) {
|
||||
if ((temp = getenv("PHP_AUTO_PREPEND_FILE"))) {
|
||||
php3_ini.auto_prepend_file = temp;
|
||||
} else {
|
||||
php3_ini.auto_prepend_file = NULL;
|
||||
}
|
||||
}
|
||||
if (cfg_get_string("auto_append_file", &php3_ini.auto_append_file) == FAILURE) {
|
||||
if ((temp = getenv("PHP_AUTO_APPEND_FILE"))) {
|
||||
php3_ini.auto_append_file = temp;
|
||||
} else {
|
||||
php3_ini.auto_append_file = NULL;
|
||||
}
|
||||
}
|
||||
if (cfg_get_string("upload_tmp_dir", &php3_ini.upload_tmp_dir) == FAILURE) {
|
||||
/* php3_ini.upload_tmp_dir = UPLOAD_TMPDIR; */
|
||||
php3_ini.upload_tmp_dir = NULL;
|
||||
}
|
||||
if (cfg_get_long("upload_max_filesize", &php3_ini.upload_max_filesize) == FAILURE) {
|
||||
php3_ini.upload_max_filesize = 2097152; /* 2 Meg default */
|
||||
}
|
||||
if (cfg_get_string("extension_dir", &php3_ini.extension_dir) == FAILURE) {
|
||||
php3_ini.extension_dir = NULL;
|
||||
}
|
||||
if (cfg_get_long("sql.safe_mode", &php3_ini.sql_safe_mode) == FAILURE) {
|
||||
php3_ini.sql_safe_mode = 0;
|
||||
}
|
||||
/* Syntax highlighting */
|
||||
if (cfg_get_string("highlight.comment", &php3_ini.highlight_comment) == FAILURE) {
|
||||
php3_ini.highlight_comment = HL_COMMENT_COLOR;
|
||||
}
|
||||
if (cfg_get_string("highlight.default", &php3_ini.highlight_default) == FAILURE) {
|
||||
php3_ini.highlight_default = HL_DEFAULT_COLOR;
|
||||
}
|
||||
if (cfg_get_string("highlight.html", &php3_ini.highlight_html) == FAILURE) {
|
||||
php3_ini.highlight_html = HL_HTML_COLOR;
|
||||
}
|
||||
if (cfg_get_string("highlight.string", &php3_ini.highlight_string) == FAILURE) {
|
||||
php3_ini.highlight_string = HL_STRING_COLOR;
|
||||
}
|
||||
if (cfg_get_string("highlight.bg", &php3_ini.highlight_bg) == FAILURE) {
|
||||
php3_ini.highlight_bg = HL_BG_COLOR;
|
||||
}
|
||||
if (cfg_get_string("highlight.keyword", &php3_ini.highlight_keyword) == FAILURE) {
|
||||
php3_ini.highlight_keyword = HL_KEYWORD_COLOR;
|
||||
}
|
||||
if (cfg_get_long("engine", &php3_ini.engine) == FAILURE) {
|
||||
php3_ini.engine = 1;
|
||||
}
|
||||
if (cfg_get_long("last_modified", &php3_ini.last_modified) == FAILURE) {
|
||||
php3_ini.last_modified = 0;
|
||||
}
|
||||
if (cfg_get_long("xbithack", &php3_ini.xbithack) == FAILURE) {
|
||||
php3_ini.xbithack = 0;
|
||||
}
|
||||
if (cfg_get_string("browscap", &php3_ini.browscap) == FAILURE) {
|
||||
php3_ini.browscap = NULL;
|
||||
}
|
||||
if (cfg_get_string("arg_separator", &php3_ini.arg_separator) == FAILURE) {
|
||||
php3_ini.arg_separator = "&";
|
||||
}
|
||||
if (cfg_get_string("gpc_order", &php3_ini.gpc_order) == FAILURE) {
|
||||
php3_ini.gpc_order = "GPC";
|
||||
}
|
||||
if (cfg_get_string("error_prepend_string", &php3_ini.error_prepend_string) == FAILURE) {
|
||||
php3_ini.error_prepend_string = NULL;
|
||||
}
|
||||
if (cfg_get_string("error_append_string", &php3_ini.error_append_string) == FAILURE) {
|
||||
php3_ini.error_append_string = NULL;
|
||||
}
|
||||
if (cfg_get_string("open_basedir", &php3_ini.open_basedir) == FAILURE) {
|
||||
php3_ini.open_basedir = NULL;
|
||||
}
|
||||
if (cfg_get_long("enable_dl", &php3_ini.enable_dl) == FAILURE) {
|
||||
php3_ini.enable_dl = 1;
|
||||
}
|
||||
/* THREADX Will have to look into this on windows
|
||||
* Make a master copy to use as a basis for every per-dir config.
|
||||
* Without two copies we would have a previous requst's per-dir
|
||||
* config carry forward to the next one.
|
||||
*/
|
||||
memcpy(&php3_ini_master, &php3_ini, sizeof(php3_ini));
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -890,6 +822,7 @@ int php3_module_startup(CLS_D ELS_DC)
|
||||
{
|
||||
zend_utility_functions zuf;
|
||||
zend_utility_values zuv;
|
||||
int module_number=0; /* for REGISTER_INI_ENTRIES() */
|
||||
|
||||
#if (WIN32|WINNT) && !(USE_SAPI)
|
||||
WORD wVersionRequested;
|
||||
@@ -912,12 +845,7 @@ int php3_module_startup(CLS_D ELS_DC)
|
||||
zuf.block_interruptions = BLOCK_INTERRUPTIONS;
|
||||
zuf.unblock_interruptions = UNBLOCK_INTERRUPTIONS;
|
||||
|
||||
zuv.short_tags = DEFAULT_SHORT_OPEN_TAG;
|
||||
zuv.asp_tags = 0;
|
||||
|
||||
zend_startup(&zuf, &zuv, NULL);
|
||||
|
||||
zend_ini_mstartup();
|
||||
zend_startup(&zuf, NULL);
|
||||
|
||||
#if HAVE_SETLOCALE
|
||||
setlocale(LC_CTYPE, "");
|
||||
@@ -938,15 +866,16 @@ int php3_module_startup(CLS_D ELS_DC)
|
||||
le_index_ptr = _register_list_destructors(NULL, NULL, 0);
|
||||
FREE_MUTEX(gLock);
|
||||
|
||||
|
||||
|
||||
/* We cannot do the config starup until after all the above
|
||||
happens, otherwise loading modules from ini file breaks */
|
||||
#if !USE_SAPI
|
||||
if (php3_config_ini_startup(ELS_C) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
php_ini_mstartup();
|
||||
REGISTER_INI_ENTRIES();
|
||||
|
||||
zuv.short_tags = (unsigned char) PG(short_tags);
|
||||
zuv.asp_tags = (unsigned char) PG(asp_tags);
|
||||
zend_set_utility_values(&zuv);
|
||||
|
||||
if (module_startup_modules() == FAILURE) {
|
||||
php3_printf("Unable to start modules\n");
|
||||
@@ -964,11 +893,10 @@ void php3_module_shutdown_for_exec(void)
|
||||
|
||||
void php3_module_shutdown()
|
||||
{
|
||||
int module_number=0; /* for UNREGISTER_INI_ENTRIES() */
|
||||
CLS_FETCH();
|
||||
ELS_FETCH();
|
||||
|
||||
zend_ini_mshutdown();
|
||||
|
||||
#if !USE_SAPI
|
||||
/* close down the ini config */
|
||||
php3_config_ini_shutdown(_INLINE_TLS_VOID);
|
||||
@@ -993,6 +921,8 @@ void php3_module_shutdown()
|
||||
#endif
|
||||
|
||||
zend_shutdown();
|
||||
UNREGISTER_INI_ENTRIES();
|
||||
php_ini_mshutdown();
|
||||
shutdown_memory_manager(0, 1);
|
||||
}
|
||||
|
||||
@@ -1005,7 +935,7 @@ int _php3_hash_environment(void)
|
||||
pval *tmp;
|
||||
ELS_FETCH();
|
||||
|
||||
p = php3_ini.gpc_order;
|
||||
p = PG(gpc_order);
|
||||
while(*p) {
|
||||
switch(*p++) {
|
||||
case 'p':
|
||||
@@ -1263,26 +1193,15 @@ static void php3_parse(zend_file_handle *primary_file CLS_DC ELS_DC)
|
||||
_php3_hash_environment();
|
||||
|
||||
|
||||
#if 0
|
||||
if (php3_ini.auto_prepend_file && php3_ini.auto_prepend_file[0]) {
|
||||
require_filename(php3_ini.auto_prepend_file CLS_CC);
|
||||
}
|
||||
require_file(primary_file CLS_CC);
|
||||
if (php3_ini.auto_append_file && php3_ini.auto_append_file[0]) {
|
||||
require_filename(php3_ini.auto_append_file CLS_CC);
|
||||
}
|
||||
pass_two(CG(main_op_array));
|
||||
#endif
|
||||
|
||||
if (php3_ini.auto_prepend_file && php3_ini.auto_prepend_file[0]) {
|
||||
prepend_file.filename = php3_ini.auto_prepend_file;
|
||||
if (PG(auto_prepend_file) && PG(auto_prepend_file)[0]) {
|
||||
prepend_file.filename = PG(auto_prepend_file);
|
||||
prepend_file.type = ZEND_HANDLE_FILENAME;
|
||||
prepend_file_p = &prepend_file;
|
||||
} else {
|
||||
prepend_file_p = NULL;
|
||||
}
|
||||
if (php3_ini.auto_append_file && php3_ini.auto_append_file[0]) {
|
||||
append_file.filename = php3_ini.auto_append_file;
|
||||
if (PG(auto_append_file) && PG(auto_append_file)[0]) {
|
||||
append_file.filename = PG(auto_append_file);
|
||||
append_file.type = ZEND_HANDLE_FILENAME;
|
||||
append_file_p = &append_file;
|
||||
} else {
|
||||
@@ -1431,6 +1350,11 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
|
||||
php3_noheader();
|
||||
break;
|
||||
case 'v':
|
||||
if (!_cgi_started) {
|
||||
if (php3_module_startup(CLS_C ELS_CC) == FAILURE || php3_request_startup(CLS_C ELS_CC) == FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
}
|
||||
php3_printf("%s\n", PHP_VERSION);
|
||||
exit(1);
|
||||
break;
|
||||
|
||||
+33
-4
@@ -200,8 +200,6 @@ extern char *strerror(int);
|
||||
|
||||
#include "fopen-wrappers.h"
|
||||
|
||||
#include "mod_php3.h" /* the php3_ini structure comes from here */
|
||||
|
||||
#if APACHE /* apache httpd */
|
||||
# if HAVE_AP_CONFIG_H
|
||||
#include "ap_config.h"
|
||||
@@ -378,8 +376,6 @@ PHPAPI int cfg_get_long(char *varname, long *result);
|
||||
PHPAPI int cfg_get_double(char *varname, double *result);
|
||||
PHPAPI int cfg_get_string(char *varname, char **result);
|
||||
|
||||
extern PHPAPI php3_ini_structure php3_ini;
|
||||
|
||||
|
||||
/* Output support */
|
||||
#include "output.h"
|
||||
@@ -475,6 +471,39 @@ extern int yylineno;
|
||||
#endif
|
||||
extern void phprestart(FILE *input_file);
|
||||
|
||||
|
||||
/* Finding offsets of elements within structures.
|
||||
* Taken from the Apache code, which in turn, was taken from X code...
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
#ifndef _PHP_GLOBALS_H
|
||||
#define _PHP_GLOBALS_H
|
||||
|
||||
typedef struct _php_core_globals php_core_globals;
|
||||
|
||||
#ifdef ZTS
|
||||
# define PLS_D php_core_globals *core_globals
|
||||
# define PLS_DC , PLS_D
|
||||
# define PLS_C core_globals
|
||||
# define PLS_CC , PLS_C
|
||||
# define PG(v) (core_globals->v)
|
||||
# define PLS_FETCH() php_core_globals *core_globals = ts_resource(core_globals_id)
|
||||
#else
|
||||
# define PLS_D
|
||||
# define PLS_DC
|
||||
# define PLS_C
|
||||
# define PLS_CC
|
||||
# define PG(v) (core_globals.v)
|
||||
# define PLS_FETCH()
|
||||
extern ZEND_API php_core_globals core_globals;
|
||||
#endif
|
||||
|
||||
|
||||
struct _php_core_globals {
|
||||
long magic_quotes_gpc;
|
||||
long magic_quotes_runtime;
|
||||
long magic_quotes_sybase;
|
||||
|
||||
long asp_tags;
|
||||
long short_tags;
|
||||
|
||||
long safe_mode;
|
||||
long sql_safe_mode;
|
||||
char *safe_mode_exec_dir;
|
||||
long enable_dl;
|
||||
|
||||
long max_execution_time;
|
||||
long memory_limit;
|
||||
|
||||
long track_errors;
|
||||
long display_errors;
|
||||
long log_errors;
|
||||
char *error_log;
|
||||
|
||||
char *doc_root;
|
||||
char *user_dir;
|
||||
char *include_path;
|
||||
char *open_basedir;
|
||||
char *extension_dir;
|
||||
|
||||
char *upload_tmp_dir;
|
||||
long upload_max_filesize;
|
||||
|
||||
char *auto_prepend_file;
|
||||
char *auto_append_file;
|
||||
|
||||
char *arg_separator;
|
||||
char *gpc_order;
|
||||
|
||||
long track_vars;
|
||||
|
||||
long y2k_compliance;
|
||||
};
|
||||
|
||||
|
||||
#endif /* _PHP_GLOBALS_H */
|
||||
+195
-29
@@ -1,8 +1,39 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP HTML Embedded Scripting Language Version 4.0 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This program is free software; you can redistribute it and/or modify |
|
||||
| it under the terms of one of the following licenses: |
|
||||
| |
|
||||
| A) the GNU General Public License as published by the Free Software |
|
||||
| Foundation; either version 2 of the License, or (at your option) |
|
||||
| any later version. |
|
||||
| |
|
||||
| B) the PHP License as published by the PHP Development Team and |
|
||||
| included in the distribution in the file: LICENSE |
|
||||
| |
|
||||
| This program is distributed in the hope that it will be useful, |
|
||||
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
| GNU General Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of both licenses referred to here. |
|
||||
| If you did not, or have any questions about PHP licensing, please |
|
||||
| contact core@php.net. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "php.h"
|
||||
#include "php_ini.h"
|
||||
#include "zend_alloc.h"
|
||||
#include "php_globals.h"
|
||||
|
||||
static HashTable known_directives;
|
||||
|
||||
@@ -10,7 +41,7 @@ static HashTable known_directives;
|
||||
/*
|
||||
* hash_apply functions
|
||||
*/
|
||||
static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number)
|
||||
static int php_remove_ini_entries(php_ini_entry *ini_entry, int *module_number)
|
||||
{
|
||||
if (ini_entry->module_number == *module_number) {
|
||||
return 1;
|
||||
@@ -20,13 +51,15 @@ static int zend_remove_ini_entries(zend_ini_entry *ini_entry, int *module_number
|
||||
}
|
||||
|
||||
|
||||
static int zend_restore_ini_entry(zend_ini_entry *ini_entry)
|
||||
static int php_restore_ini_entry_cb(php_ini_entry *ini_entry)
|
||||
{
|
||||
if (ini_entry->modified) {
|
||||
efree(ini_entry->value);
|
||||
ini_entry->value = ini_entry->orig_value;
|
||||
ini_entry->value_length = ini_entry->orig_value_length;
|
||||
ini_entry->modified = 0;
|
||||
ini_entry->orig_value = NULL;
|
||||
ini_entry->orig_value_length = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -34,7 +67,7 @@ static int zend_restore_ini_entry(zend_ini_entry *ini_entry)
|
||||
/*
|
||||
* Startup / shutdown
|
||||
*/
|
||||
int zend_ini_mstartup()
|
||||
int php_ini_mstartup()
|
||||
{
|
||||
if (_php3_hash_init(&known_directives, 100, NULL, NULL, 1)==FAILURE) {
|
||||
return FAILURE;
|
||||
@@ -43,16 +76,16 @@ int zend_ini_mstartup()
|
||||
}
|
||||
|
||||
|
||||
int zend_ini_mshutdown()
|
||||
int php_ini_mshutdown()
|
||||
{
|
||||
_php3_hash_destroy(&known_directives);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int zend_ini_rshutdown()
|
||||
int php_ini_rshutdown()
|
||||
{
|
||||
_php3_hash_apply(&known_directives, (int (*)(void *)) zend_restore_ini_entry);
|
||||
_php3_hash_apply(&known_directives, (int (*)(void *)) php_restore_ini_entry_cb);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -60,21 +93,28 @@ int zend_ini_rshutdown()
|
||||
* Registration / unregistration
|
||||
*/
|
||||
|
||||
int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number)
|
||||
int php_register_ini_entries(php_ini_entry *ini_entry, int module_number)
|
||||
{
|
||||
zend_ini_entry *p = ini_entry;
|
||||
zend_ini_entry *hashed_ini_entry;
|
||||
php_ini_entry *p = ini_entry;
|
||||
php_ini_entry *hashed_ini_entry;
|
||||
pval *default_value;
|
||||
|
||||
while (p->name) {
|
||||
p->module_number = module_number;
|
||||
if (_php3_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);
|
||||
if (_php3_hash_add(&known_directives, p->name, p->name_length, p, sizeof(php_ini_entry), (void **) &hashed_ini_entry)==FAILURE) {
|
||||
php_unregister_ini_entries(module_number);
|
||||
return FAILURE;
|
||||
}
|
||||
if ((default_value=cfg_get_entry(p->name, p->name_length))) {
|
||||
hashed_ini_entry->value = default_value->value.str.val;
|
||||
hashed_ini_entry->value_length = default_value->value.str.len;
|
||||
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_arg)==SUCCESS) {
|
||||
hashed_ini_entry->value = default_value->value.str.val;
|
||||
hashed_ini_entry->value_length = default_value->value.str.len;
|
||||
}
|
||||
} else {
|
||||
if (hashed_ini_entry->on_modify) {
|
||||
hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg);
|
||||
}
|
||||
}
|
||||
hashed_ini_entry->modified = 0;
|
||||
p++;
|
||||
@@ -83,14 +123,16 @@ int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number)
|
||||
}
|
||||
|
||||
|
||||
void zend_unregister_ini_entries(int module_number)
|
||||
void php_unregister_ini_entries(int module_number)
|
||||
{
|
||||
_php3_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) zend_remove_ini_entries, (void *) &module_number);
|
||||
_php3_hash_apply_with_argument(&known_directives, (int (*)(void *, void *)) php_remove_ini_entries, (void *) &module_number);
|
||||
}
|
||||
|
||||
int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type)
|
||||
|
||||
int php_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
php_ini_entry *ini_entry;
|
||||
char *duplicate;
|
||||
|
||||
if (_php3_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
|
||||
return FAILURE;
|
||||
@@ -100,49 +142,173 @@ int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
ini_entry->value = estrndup(new_value, new_value_length);
|
||||
ini_entry->value_length = new_value_length;
|
||||
ini_entry->modified = 1;
|
||||
duplicate = estrndup(new_value, new_value_length);
|
||||
|
||||
if (!ini_entry->on_modify
|
||||
|| ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg)==SUCCESS) {
|
||||
if (!ini_entry->orig_value) {
|
||||
ini_entry->orig_value = ini_entry->value;
|
||||
ini_entry->orig_value_length = ini_entry->value_length;
|
||||
} else { /* we already changed the value, free the changed value */
|
||||
efree(ini_entry->value);
|
||||
}
|
||||
ini_entry->value = duplicate;
|
||||
ini_entry->value_length = new_value_length;
|
||||
ini_entry->modified = 1;
|
||||
} else {
|
||||
efree(duplicate);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int php_restore_ini_entry(char *name, uint name_length)
|
||||
{
|
||||
php_ini_entry *ini_entry;
|
||||
|
||||
if (_php3_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==FAILURE) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (ini_entry->orig_value) {
|
||||
ini_entry->value = ini_entry->orig_value;
|
||||
ini_entry->value_length = ini_entry->orig_value_length;
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Data retrieval
|
||||
*/
|
||||
|
||||
long zend_ini_long(char *name, uint name_length)
|
||||
long php_ini_long(char *name, uint name_length, int orig)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
php_ini_entry *ini_entry;
|
||||
|
||||
if (_php3_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
|
||||
return (long) atoi(ini_entry->value);
|
||||
if (orig && ini_entry->orig_value) {
|
||||
return strtol(ini_entry->orig_value, NULL, 0);
|
||||
} else if (ini_entry->value) {
|
||||
return strtol(ini_entry->value, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
double zend_ini_double(char *name, uint name_length)
|
||||
double php_ini_double(char *name, uint name_length, int orig)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
php_ini_entry *ini_entry;
|
||||
|
||||
if (_php3_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
|
||||
return (double) strtod(ini_entry->value, NULL);
|
||||
if (orig && ini_entry->orig_value) {
|
||||
return (double) strtod(ini_entry->orig_value, NULL);
|
||||
} else if (ini_entry->value) {
|
||||
return (double) strtod(ini_entry->value, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
char *zend_ini_string(char *name, uint name_length)
|
||||
char *php_ini_string(char *name, uint name_length, int orig)
|
||||
{
|
||||
zend_ini_entry *ini_entry;
|
||||
php_ini_entry *ini_entry;
|
||||
|
||||
if (_php3_hash_find(&known_directives, name, name_length, (void **) &ini_entry)==SUCCESS) {
|
||||
return ini_entry->value;
|
||||
if (orig && ini_entry->orig_value) {
|
||||
return ini_entry->orig_value;
|
||||
} else if (ini_entry->value) {
|
||||
return ini_entry->value;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Standard message handlers for core_globals */
|
||||
|
||||
PHP_INI_MH(OnUpdateInt)
|
||||
{
|
||||
long *p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) &core_globals;
|
||||
#else
|
||||
char *base;
|
||||
PLS_FETCH();
|
||||
|
||||
base = (char *) core_globals;
|
||||
#endif
|
||||
|
||||
p = (long *) (base+(size_t) mh_arg);
|
||||
|
||||
*p = atoi(new_value);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
PHP_INI_MH(OnUpdateReal)
|
||||
{
|
||||
double *p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) &core_globals;
|
||||
#else
|
||||
char *base;
|
||||
PLS_FETCH();
|
||||
|
||||
base = (char *) core_globals;
|
||||
#endif
|
||||
|
||||
p = (double *) (base+(size_t) mh_arg);
|
||||
|
||||
*p = strtod(new_value, NULL);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
PHP_INI_MH(OnUpdateString)
|
||||
{
|
||||
char **p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) &core_globals;
|
||||
#else
|
||||
char *base;
|
||||
PLS_FETCH();
|
||||
|
||||
base = (char *) core_globals;
|
||||
#endif
|
||||
|
||||
p = (char **) (base+(size_t) mh_arg);
|
||||
|
||||
*p = new_value;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
PHP_INI_MH(OnUpdateStringUnempty)
|
||||
{
|
||||
char **p;
|
||||
#ifndef ZTS
|
||||
char *base = (char *) &core_globals;
|
||||
#else
|
||||
char *base;
|
||||
PLS_FETCH();
|
||||
|
||||
base = (char *) core_globals;
|
||||
#endif
|
||||
|
||||
if (new_value && !new_value[0]) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
p = (char **) (base+(size_t) mh_arg);
|
||||
|
||||
*p = new_value;
|
||||
return SUCCESS;
|
||||
}
|
||||
+51
-24
@@ -1,18 +1,24 @@
|
||||
#ifndef _ZEND_INI_H
|
||||
#define _ZEND_INI_H
|
||||
#ifndef _PHP_INI_H
|
||||
#define _PHP_INI_H
|
||||
|
||||
|
||||
#define ZEND_INI_USER (1<<0)
|
||||
#define ZEND_INI_PERDIR (1<<1)
|
||||
#define ZEND_INI_SYSTEM (1<<2)
|
||||
#define PHP_INI_USER (1<<0)
|
||||
#define PHP_INI_PERDIR (1<<1)
|
||||
#define PHP_INI_SYSTEM (1<<2)
|
||||
|
||||
#define ZEND_INI_ALL (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
|
||||
#define PHP_INI_ALL (PHP_INI_USER|PHP_INI_PERDIR|PHP_INI_SYSTEM)
|
||||
|
||||
typedef struct {
|
||||
typedef struct _php_ini_entry php_ini_entry;
|
||||
|
||||
#define PHP_INI_MH(name) int name(php_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg)
|
||||
|
||||
struct _php_ini_entry {
|
||||
int module_number;
|
||||
int modifyable;
|
||||
char *name;
|
||||
uint name_length;
|
||||
PHP_INI_MH((*on_modify));
|
||||
void *mh_arg;
|
||||
|
||||
char *value;
|
||||
uint value_length;
|
||||
@@ -20,29 +26,50 @@ typedef struct {
|
||||
char *orig_value;
|
||||
uint orig_value_length;
|
||||
int modified;
|
||||
} zend_ini_entry;
|
||||
};
|
||||
|
||||
|
||||
int zend_ini_mstartup();
|
||||
int zend_ini_mshutdown();
|
||||
int zend_ini_rshutdown();
|
||||
int php_ini_mstartup();
|
||||
int php_ini_mshutdown();
|
||||
int php_ini_rshutdown();
|
||||
|
||||
int zend_register_ini_entries(zend_ini_entry *ini_entry, int module_number);
|
||||
void zend_unregister_ini_entries(int module_number);
|
||||
int zend_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type);
|
||||
int php_register_ini_entries(php_ini_entry *ini_entry, int module_number);
|
||||
void php_unregister_ini_entries(int module_number);
|
||||
int php_alter_ini_entry(char *name, uint name_length, char *new_value, uint new_value_length, int modify_type);
|
||||
int php_restore_ini_entry(char *name, uint name_length);
|
||||
|
||||
long zend_ini_long(char *name, uint name_length);
|
||||
double zend_ini_double(char *name, uint name_length);
|
||||
char *zend_ini_string(char *name, uint name_length);
|
||||
long php_ini_long(char *name, uint name_length, int orig);
|
||||
double php_ini_double(char *name, uint name_length, int orig);
|
||||
char *php_ini_string(char *name, uint name_length, int orig);
|
||||
|
||||
#define ZEND_INI_BEGIN() static zend_ini_entry ini_entries[] = {
|
||||
#define ZEND_INI_ENTRY(name, default_value, modifyable) { 0, modifyable, name, sizeof(name), default_value, sizeof(default_value)-1, NULL, 0, 0 },
|
||||
#define ZEND_INI_END() { 0, 0, NULL, 0, NULL, 0, NULL, 0, 0 } };
|
||||
#define PHP_INI_BEGIN() static php_ini_entry ini_entries[] = {
|
||||
|
||||
#define INI_INT(name) zend_ini_long((name), sizeof(name))
|
||||
#define INI_FLT(name) zend_ini_double((name), sizeof(name))
|
||||
#define INI_STR(name) zend_ini_string((name), sizeof(name))
|
||||
#define PHP_INI_ENTRY(name, default_value, modifyable, on_modify, ptr) \
|
||||
{ 0, modifyable, name, sizeof(name), on_modify, ptr, default_value, sizeof(default_value)-1, NULL, 0, 0 },
|
||||
|
||||
#define PHP_INI_END() \
|
||||
{ 0, 0, NULL, 0, NULL, NULL, NULL, 0, NULL, 0, 0 } };
|
||||
|
||||
#define INI_INT(name) php_ini_long((name), sizeof(name), 0)
|
||||
#define INI_FLT(name) php_ini_double((name), sizeof(name), 0)
|
||||
#define INI_STR(name) php_ini_string((name), sizeof(name), 0)
|
||||
|
||||
|
||||
#define INI_ORIG_INT(name) php_ini_long((name), sizeof(name), 1)
|
||||
#define INI_ORIG_FLT(name) php_ini_double((name), sizeof(name), 1)
|
||||
#define INI_ORIG_STR(name) php_ini_string((name), sizeof(name), 1)
|
||||
|
||||
|
||||
#define REGISTER_INI_ENTRIES() php_register_ini_entries(ini_entries, module_number)
|
||||
#define UNREGISTER_INI_ENTRIES() php_unregister_ini_entries(module_number)
|
||||
|
||||
pval *cfg_get_entry(char *name, uint name_length);
|
||||
|
||||
#endif /* _ZEND_INI_H */
|
||||
|
||||
/* Standard message handlers */
|
||||
PHP_INI_MH(OnUpdateInt);
|
||||
PHP_INI_MH(OnUpdateReal);
|
||||
PHP_INI_MH(OnUpdateString);
|
||||
PHP_INI_MH(OnUpdateStringUnempty);
|
||||
|
||||
#endif /* _PHP_INI_H */
|
||||
+48
-262
@@ -25,6 +25,7 @@
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
|
||||
| (with helpful hints from Dean Gaudet <dgaudet@arctic.org> |
|
||||
| PHP4 patches by Zeev Suraski <zeev@zend.com> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
/* $Id$ */
|
||||
@@ -49,6 +50,14 @@
|
||||
#include "http_log.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* These are taken out of php_ini.h
|
||||
* they must be updated if php_ini.h changes!
|
||||
*/
|
||||
#define PHP_INI_USER (1<<0)
|
||||
#define PHP_INI_PERDIR (1<<1)
|
||||
#define PHP_INI_SYSTEM (1<<2)
|
||||
|
||||
#include "util_script.h"
|
||||
|
||||
#include "php_version.h"
|
||||
@@ -95,8 +104,7 @@ int saved_umask;
|
||||
# define php3i_popenf(p,n,f,m) popenf((p),(n),(f),(m))
|
||||
#endif
|
||||
|
||||
extern php3_ini_structure php3_ini; /* active config */
|
||||
extern php3_ini_structure php3_ini_master; /* master copy of config */
|
||||
php_apache_info_struct php_apache_info; /* active config */
|
||||
|
||||
int apache_php3_module_main(request_rec * r, int fd, int display_source_mode);
|
||||
extern int php3_module_startup();
|
||||
@@ -178,7 +186,6 @@ void php3_restore_umask()
|
||||
int send_php3(request_rec *r, int display_source_mode, char *filename)
|
||||
{
|
||||
int fd, retval;
|
||||
php3_ini_structure *conf;
|
||||
|
||||
/* We don't accept OPTIONS requests, but take everything else */
|
||||
if (r->method_number == M_OPTIONS) {
|
||||
@@ -191,16 +198,10 @@ int send_php3(request_rec *r, int display_source_mode, char *filename)
|
||||
return NOT_FOUND;
|
||||
}
|
||||
|
||||
/* grab configuration settings */
|
||||
conf = (php3_ini_structure *) get_module_config(r->per_dir_config,
|
||||
&php3_module);
|
||||
/* copy to active configuration */
|
||||
memcpy(&php3_ini,conf,sizeof(php3_ini_structure));
|
||||
|
||||
/* If PHP parser engine has been turned off with a "php3_engine off"
|
||||
* directive, then decline to handle this request
|
||||
*/
|
||||
if (!conf->engine) {
|
||||
if (!php_apache_info.engine) {
|
||||
r->content_type = "text/html";
|
||||
r->allowed |= (1 << METHODS) - 1;
|
||||
return DECLINED;
|
||||
@@ -220,7 +221,7 @@ int send_php3(request_rec *r, int display_source_mode, char *filename)
|
||||
return retval;
|
||||
#endif
|
||||
|
||||
if (conf->last_modified) {
|
||||
if (php_apache_info.last_modified) {
|
||||
#if MODULE_MAGIC_NUMBER < 19970912
|
||||
if ((retval = set_last_modified(r, r->finfo.st_mtime))) {
|
||||
return retval;
|
||||
@@ -262,232 +263,53 @@ int send_parsed_php3_source(request_rec * r)
|
||||
}
|
||||
|
||||
/*
|
||||
* Create the per-directory config structure with defaults from php3_ini_master
|
||||
* Create the per-directory config structure with defaults
|
||||
*/
|
||||
static void *php3_create_dir(pool * p, char *dummy)
|
||||
{
|
||||
php3_ini_structure *new;
|
||||
|
||||
php3_module_startup(); /* php3_ini_master is set up here */
|
||||
|
||||
new = (php3_ini_structure *) palloc(p, sizeof(php3_ini_structure));
|
||||
memcpy(new,&php3_ini_master,sizeof(php3_ini_structure));
|
||||
php_apache_info_struct *new;
|
||||
|
||||
new = (php_apache_info_struct *) palloc(p, sizeof(php_apache_info_struct));
|
||||
memcpy(new, &php_apache_info, sizeof(php_apache_info_struct));
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
/*
|
||||
* Merge in per-directory .conf directives
|
||||
*/
|
||||
static void *php3_merge_dir(pool *p, void *basev, void *addv)
|
||||
|
||||
#if MODULE_MAGIC_NUMBER > 19961007
|
||||
#define CONST_PREFIX const
|
||||
#else
|
||||
#define CONST_PREFIX
|
||||
#endif
|
||||
|
||||
CONST_PREFIX char *php_apache_value_handler(cmd_parms *cmd, php_apache_info_struct *conf, char *arg1, char *arg2)
|
||||
{
|
||||
php3_ini_structure *new = (php3_ini_structure *) palloc(p, sizeof(php3_ini_structure));
|
||||
php3_ini_structure *base = (php3_ini_structure *) basev;
|
||||
php3_ini_structure *add = (php3_ini_structure *) addv;
|
||||
php3_ini_structure orig = php3_ini_master;
|
||||
php_alter_ini_entry(arg1, strlen(arg1)+1, arg2, strlen(arg2)+1, PHP_INI_PERDIR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Start with the base config */
|
||||
memcpy(new,base,sizeof(php3_ini_structure));
|
||||
|
||||
/* Now, add any fields that have changed in *add compared to the master config */
|
||||
if (add->smtp != orig.smtp) new->smtp = add->smtp;
|
||||
if (add->sendmail_path != orig.sendmail_path) new->sendmail_path = add->sendmail_path;
|
||||
if (add->sendmail_from != orig.sendmail_from) new->sendmail_from = add->sendmail_from;
|
||||
if (add->errors != orig.errors) new->errors = add->errors;
|
||||
if (add->magic_quotes_gpc != orig.magic_quotes_gpc) new->magic_quotes_gpc = add->magic_quotes_gpc;
|
||||
if (add->magic_quotes_runtime != orig.magic_quotes_runtime) new->magic_quotes_runtime = add->magic_quotes_runtime;
|
||||
if (add->magic_quotes_sybase != orig.magic_quotes_sybase) new->magic_quotes_sybase = add->magic_quotes_sybase;
|
||||
if (add->track_errors != orig.track_errors) new->track_errors = add->track_errors;
|
||||
if (add->display_errors != orig.display_errors) new->display_errors = add->display_errors;
|
||||
if (add->log_errors != orig.log_errors) new->log_errors = add->log_errors;
|
||||
if (add->doc_root != orig.doc_root) new->doc_root = add->doc_root;
|
||||
if (add->user_dir != orig.user_dir) new->user_dir = add->user_dir;
|
||||
if (add->safe_mode != orig.safe_mode) new->safe_mode = add->safe_mode;
|
||||
if (add->track_vars != orig.track_vars) new->track_vars = add->track_vars;
|
||||
if (add->safe_mode_exec_dir != orig.safe_mode_exec_dir) new->safe_mode_exec_dir = add->safe_mode_exec_dir;
|
||||
if (add->cgi_ext != orig.cgi_ext) new->cgi_ext = add->cgi_ext;
|
||||
if (add->isapi_ext != orig.isapi_ext) new->isapi_ext = add->isapi_ext;
|
||||
if (add->nsapi_ext != orig.nsapi_ext) new->nsapi_ext = add->nsapi_ext;
|
||||
if (add->include_path != orig.include_path) new->include_path = add->include_path;
|
||||
if (add->auto_prepend_file != orig.auto_prepend_file) new->auto_prepend_file = add->auto_prepend_file;
|
||||
if (add->auto_append_file != orig.auto_append_file) new->auto_append_file = add->auto_append_file;
|
||||
if (add->upload_tmp_dir != orig.upload_tmp_dir) new->upload_tmp_dir = add->upload_tmp_dir;
|
||||
if (add->upload_max_filesize != orig.upload_max_filesize) new->upload_max_filesize = add->upload_max_filesize;
|
||||
if (add->extension_dir != orig.extension_dir) new->extension_dir = add->extension_dir;
|
||||
if (add->short_open_tag != orig.short_open_tag) new->short_open_tag = add->short_open_tag;
|
||||
if (add->debugger_host != orig.debugger_host) new->debugger_host = add->debugger_host;
|
||||
if (add->debugger_port != orig.debugger_port) new->debugger_port = add->debugger_port;
|
||||
if (add->error_log != orig.error_log) new->error_log = add->error_log;
|
||||
/* skip the highlight stuff */
|
||||
if (add->sql_safe_mode != orig.sql_safe_mode) new->sql_safe_mode = add->sql_safe_mode;
|
||||
if (add->xbithack != orig.xbithack) new->xbithack = add->xbithack;
|
||||
if (add->engine != orig.engine) new->engine = add->engine;
|
||||
if (add->last_modified != orig.last_modified) new->last_modified = add->last_modified;
|
||||
if (add->max_execution_time != orig.max_execution_time) new->max_execution_time = add->max_execution_time;
|
||||
if (add->memory_limit != orig.memory_limit) new->memory_limit = add->memory_limit;
|
||||
if (add->browscap != orig.browscap) new->browscap = add->browscap;
|
||||
if (add->arg_separator != orig.arg_separator) new->arg_separator = add->arg_separator;
|
||||
if (add->gpc_order != orig.gpc_order) new->gpc_order = add->gpc_order;
|
||||
if (add->error_prepend_string != orig.error_prepend_string) new->error_prepend_string = add->error_prepend_string;
|
||||
if (add->error_append_string != orig.error_append_string) new->error_append_string = add->error_append_string;
|
||||
if (add->open_basedir != orig.open_basedir) new->open_basedir = add->open_basedir;
|
||||
if (add->enable_dl != orig.enable_dl) new->enable_dl = add->enable_dl;
|
||||
if (add->asp_tags != orig.asp_tags) new->asp_tags = add->asp_tags;
|
||||
if (add->dav_script != orig.dav_script) new->dav_script = add->dav_script;
|
||||
CONST_PREFIX char *php_apache_flag_handler(cmd_parms *cmd, php_apache_info_struct *conf, char *arg1, char *arg2)
|
||||
{
|
||||
char bool_val[2];
|
||||
|
||||
if (!strcmp(arg2, "On")) {
|
||||
bool_val[0] = '1';
|
||||
} else {
|
||||
bool_val[0] = '0';
|
||||
}
|
||||
bool_val[1] = 0;
|
||||
|
||||
return new;
|
||||
}
|
||||
|
||||
#if MODULE_MAGIC_NUMBER > 19961007
|
||||
const char *php3flaghandler(cmd_parms * cmd, php3_ini_structure * conf, int val)
|
||||
{
|
||||
#else
|
||||
char *php3flaghandler(cmd_parms * cmd, php3_ini_structure * conf, int val)
|
||||
{
|
||||
#endif
|
||||
int c = (int) cmd->info;
|
||||
|
||||
switch (c) {
|
||||
case 0:
|
||||
conf->track_errors = val;
|
||||
break;
|
||||
case 1:
|
||||
conf->magic_quotes_gpc = val;
|
||||
break;
|
||||
case 2:
|
||||
conf->magic_quotes_runtime = val;
|
||||
break;
|
||||
case 3:
|
||||
conf->short_open_tag = val;
|
||||
break;
|
||||
case 4:
|
||||
conf->safe_mode = val;
|
||||
break;
|
||||
case 5:
|
||||
conf->track_vars = val;
|
||||
break;
|
||||
case 6:
|
||||
conf->sql_safe_mode = val;
|
||||
break;
|
||||
case 7:
|
||||
conf->engine = val;
|
||||
break;
|
||||
case 8:
|
||||
conf->xbithack = val;
|
||||
break;
|
||||
case 9:
|
||||
conf->last_modified = val;
|
||||
break;
|
||||
case 10:
|
||||
conf->log_errors = val;
|
||||
break;
|
||||
case 11:
|
||||
conf->display_errors = val;
|
||||
break;
|
||||
case 12:
|
||||
conf->magic_quotes_sybase = val;
|
||||
break;
|
||||
case 13:
|
||||
conf->enable_dl = val;
|
||||
break;
|
||||
case 14:
|
||||
conf->asp_tags = val;
|
||||
break;
|
||||
}
|
||||
php_alter_ini_entry(arg1, strlen(arg1)+1, bool_val, 2, PHP_INI_PERDIR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if MODULE_MAGIC_NUMBER > 19961007
|
||||
const char *php3take1handler(cmd_parms * cmd, php3_ini_structure * conf, char *arg)
|
||||
{
|
||||
#else
|
||||
char *php3take1handler(cmd_parms * cmd, php3_ini_structure * conf, char *arg)
|
||||
{
|
||||
#endif
|
||||
int c = (int) cmd->info;
|
||||
|
||||
switch (c) {
|
||||
case 0:
|
||||
conf->errors = atoi(arg);
|
||||
break;
|
||||
case 1:
|
||||
conf->doc_root = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 2:
|
||||
conf->user_dir = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 3:
|
||||
conf->safe_mode_exec_dir = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 4:
|
||||
conf->include_path = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 5:
|
||||
if (strncasecmp(arg, "none", 4)) {
|
||||
conf->auto_prepend_file = pstrdup(cmd->pool, arg);
|
||||
} else {
|
||||
conf->auto_prepend_file = "";
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (strncasecmp(arg, "none", 4)) {
|
||||
conf->auto_append_file = pstrdup(cmd->pool, arg);
|
||||
} else {
|
||||
conf->auto_append_file = "";
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
conf->upload_tmp_dir = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 8:
|
||||
conf->extension_dir = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 9:
|
||||
conf->error_log = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 10:
|
||||
conf->arg_separator = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 11:
|
||||
conf->max_execution_time = atoi(arg);
|
||||
break;
|
||||
case 12:
|
||||
conf->memory_limit = atoi(arg);
|
||||
break;
|
||||
case 13:
|
||||
conf->sendmail_path = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 14:
|
||||
conf->browscap = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 15:
|
||||
conf->gpc_order = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 16:
|
||||
conf->error_prepend_string = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 17:
|
||||
conf->error_append_string = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 18:
|
||||
conf->open_basedir = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
case 19:
|
||||
conf->upload_max_filesize = atol(arg);
|
||||
break;
|
||||
case 20:
|
||||
conf->dav_script = pstrdup(cmd->pool, arg);
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int php3_xbithack_handler(request_rec * r)
|
||||
{
|
||||
php3_ini_structure *conf;
|
||||
php_apache_info_struct *conf;
|
||||
|
||||
conf = (php3_ini_structure *) get_module_config(r->per_dir_config, &php3_module);
|
||||
conf = (php_apache_info_struct *) get_module_config(r->per_dir_config, &php3_module);
|
||||
if (!(r->finfo.st_mode & S_IXUSR)) {
|
||||
r->allowed |= (1 << METHODS) - 1;
|
||||
return DECLINED;
|
||||
@@ -502,6 +324,7 @@ int php3_xbithack_handler(request_rec * r)
|
||||
void php3_init_handler(server_rec *s, pool *p)
|
||||
{
|
||||
register_cleanup(p, NULL, php3_module_shutdown, php3_module_shutdown_for_exec);
|
||||
php3_module_startup();
|
||||
#if MODULE_MAGIC_NUMBER >= 19980527
|
||||
ap_add_version_component("PHP/" PHP_VERSION);
|
||||
#endif
|
||||
@@ -516,18 +339,18 @@ extern int phpdav_mkcol_create_handler(request_rec *r);
|
||||
/* conf is being read twice (both here and in send_php3()) */
|
||||
int send_parsed_php3_dav_script(request_rec *r)
|
||||
{
|
||||
php3_ini_structure *conf;
|
||||
php_apache_info_struct *conf;
|
||||
|
||||
conf = (php3_ini_structure *) get_module_config(r->per_dir_config,
|
||||
conf = (php_apache_info_struct *) get_module_config(r->per_dir_config,
|
||||
&php3_module);
|
||||
return send_php3(r, 0, 0, conf->dav_script);
|
||||
}
|
||||
|
||||
static int php3_type_checker(request_rec *r)
|
||||
{
|
||||
php3_ini_structure *conf;
|
||||
php_apache_info_struct *conf;
|
||||
|
||||
conf = (php3_ini_structure *)get_module_config(r->per_dir_config,
|
||||
conf = (php_apache_info_struct *)get_module_config(r->per_dir_config,
|
||||
&php3_module);
|
||||
|
||||
/* If DAV support is enabled, use mod_dav's type checker. */
|
||||
@@ -560,45 +383,8 @@ handler_rec php3_handlers[] =
|
||||
|
||||
command_rec php3_commands[] =
|
||||
{
|
||||
{"php3_error_reporting", php3take1handler, (void *)0, OR_OPTIONS, TAKE1, "error reporting level"},
|
||||
{"php3_doc_root", php3take1handler, (void *)1, ACCESS_CONF|RSRC_CONF, TAKE1, "directory"}, /* not used yet */
|
||||
{"php3_user_dir", php3take1handler, (void *)2, ACCESS_CONF|RSRC_CONF, TAKE1, "user directory"}, /* not used yet */
|
||||
{"php3_safe_mode_exec_dir", php3take1handler, (void *)3, ACCESS_CONF|RSRC_CONF, TAKE1, "safe mode executable dir"},
|
||||
{"php3_include_path", php3take1handler, (void *)4, OR_OPTIONS, TAKE1, "colon-separated path"},
|
||||
{"php3_auto_prepend_file", php3take1handler, (void *)5, OR_OPTIONS, TAKE1, "file name"},
|
||||
{"php3_auto_append_file", php3take1handler, (void *)6, OR_OPTIONS, TAKE1, "file name"},
|
||||
{"php3_upload_tmp_dir", php3take1handler, (void *)7, ACCESS_CONF|RSRC_CONF, TAKE1, "directory"},
|
||||
{"php3_extension_dir", php3take1handler, (void *)8, ACCESS_CONF|RSRC_CONF, TAKE1, "directory"},
|
||||
{"php3_error_log", php3take1handler, (void *)9, OR_OPTIONS, TAKE1, "error log file"},
|
||||
{"php3_arg_separator", php3take1handler, (void *)10, OR_OPTIONS, TAKE1, "GET method arg separator"},
|
||||
{"php3_max_execution_time", php3take1handler, (void *)11, OR_OPTIONS, TAKE1, "Max script run time in seconds"},
|
||||
{"php3_memory_limit", php3take1handler, (void *)12, OR_OPTIONS, TAKE1, "Max memory in bytes a script may use"},
|
||||
{"php3_sendmail_path", php3take1handler, (void *)13, OR_OPTIONS, TAKE1, "Full path to sendmail binary"},
|
||||
{"php3_browscap", php3take1handler, (void *)14, OR_OPTIONS, TAKE1, "Full path to browscap file"},
|
||||
{"php3_gpc_order", php3take1handler, (void *)15, OR_OPTIONS, TAKE1, "Set GET-COOKIE-POST order [default is GPC]"},
|
||||
{"php3_error_prepend_string", php3take1handler, (void *)16, OR_OPTIONS, TAKE1, "String to add before an error message from PHP"},
|
||||
{"php3_error_append_string", php3take1handler, (void *)17, OR_OPTIONS, TAKE1, "String to add after an error message from PHP"},
|
||||
{"php3_open_basedir", php3take1handler, (void *)18, OR_OPTIONS|RSRC_CONF, TAKE1, "Limit opening of files to this directory"},
|
||||
{"php3_upload_max_filesize", php3take1handler, (void *)19, OR_OPTIONS|RSRC_CONF, TAKE1, "Limit uploaded files to this many bytes"},
|
||||
#if HAVE_MOD_DAV
|
||||
{"php3_dav_script", php3take1handler, (void *)20, OR_OPTIONS|RSRC_CONF, TAKE1,
|
||||
"Lets PHP handle DAV requests by parsing this script."},
|
||||
#endif
|
||||
{"php3_track_errors", php3flaghandler, (void *)0, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_magic_quotes_gpc", php3flaghandler, (void *)1, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_magic_quotes_runtime", php3flaghandler, (void *)2, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_short_open_tag", php3flaghandler, (void *)3, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_safe_mode", php3flaghandler, (void *)4, ACCESS_CONF|RSRC_CONF, FLAG, "on|off"},
|
||||
{"php3_track_vars", php3flaghandler, (void *)5, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_sql_safe_mode", php3flaghandler, (void *)6, ACCESS_CONF|RSRC_CONF, FLAG, "on|off"},
|
||||
{"php3_engine", php3flaghandler, (void *)7, RSRC_CONF|ACCESS_CONF, FLAG, "on|off"},
|
||||
{"php3_xbithack", php3flaghandler, (void *)8, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_last_modified", php3flaghandler, (void *)9, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_log_errors", php3flaghandler, (void *)10, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_display_errors", php3flaghandler, (void *)11, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_magic_quotes_sybase", php3flaghandler, (void *)12, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php3_enable_dl", php3flaghandler, (void *)13, RSRC_CONF|ACCESS_CONF, FLAG, "on|off"},
|
||||
{"php3_asp_tags", php3flaghandler, (void *)14, OR_OPTIONS, FLAG, "on|off"},
|
||||
{"php4_value", php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"},
|
||||
{"php4_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
@@ -609,7 +395,7 @@ module MODULE_VAR_EXPORT php3_module =
|
||||
STANDARD_MODULE_STUFF,
|
||||
php3_init_handler, /* initializer */
|
||||
php3_create_dir, /* per-directory config creator */
|
||||
php3_merge_dir, /* dir merger */
|
||||
NULL, /* dir merger */
|
||||
NULL, /* per-server config creator */
|
||||
NULL, /* merge server config */
|
||||
php3_commands, /* command table */
|
||||
|
||||
+4
-51
@@ -38,60 +38,13 @@
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char *smtp; /*win 32 only*/
|
||||
char *sendmail_path;
|
||||
char *sendmail_from; /*win 32 only*/
|
||||
long precision;
|
||||
long errors;
|
||||
long magic_quotes_gpc;
|
||||
long magic_quotes_runtime;
|
||||
long magic_quotes_sybase;
|
||||
long track_errors;
|
||||
long display_errors;
|
||||
long log_errors;
|
||||
long warn_plus_overloading;
|
||||
char *doc_root;
|
||||
char *user_dir;
|
||||
long safe_mode;
|
||||
long track_vars;
|
||||
char *safe_mode_exec_dir;
|
||||
char *cgi_ext;
|
||||
char *isapi_ext;
|
||||
char *nsapi_ext;
|
||||
char *include_path;
|
||||
char *auto_prepend_file;
|
||||
char *auto_append_file;
|
||||
char *upload_tmp_dir;
|
||||
long upload_max_filesize;
|
||||
char *extension_dir;
|
||||
long short_open_tag;
|
||||
long asp_tags;
|
||||
char *debugger_host;
|
||||
long debugger_port;
|
||||
char *error_log;
|
||||
char *highlight_comment;
|
||||
char *highlight_default;
|
||||
char *highlight_html;
|
||||
char *highlight_string;
|
||||
char *highlight_bg;
|
||||
char *highlight_keyword;
|
||||
long sql_safe_mode;
|
||||
long xbithack;
|
||||
long engine;
|
||||
long last_modified;
|
||||
long max_execution_time;
|
||||
long memory_limit;
|
||||
char *browscap;
|
||||
char *arg_separator;
|
||||
char *gpc_order;
|
||||
long y2k_compliance;
|
||||
long define_syslog_variables;
|
||||
char *error_prepend_string;
|
||||
char *error_append_string;
|
||||
char *open_basedir;
|
||||
long enable_dl;
|
||||
char *dav_script;
|
||||
} php3_ini_structure;
|
||||
long xbithack;
|
||||
} php_apache_info_struct;
|
||||
|
||||
extern php_apache_info_struct php_apache_info;
|
||||
|
||||
#if MSVC5
|
||||
#define S_IXUSR _S_IEXEC
|
||||
|
||||
@@ -66,7 +66,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "c:\projects\php4\include" /I "c:\projects\zend\zendcore" /I "." /I "regex\\" /I "d:\src\bind\include" /I "c:\projects\sapi" /D "DEBUG" /D "_DEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "COMPILE_LIBZEND" /FR /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "c:\projects\php4\include" /I "c:\projects\libzend" /I "." /I "regex\\" /I "d:\src\bind\include" /I "c:\projects\sapi" /D "DEBUG" /D "_DEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "COMPILE_LIBZEND" /FR /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
|
||||
@@ -75,7 +75,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 lib44bsd95.lib resolv.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib SAPI.lib libzend.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libcd" /out:"cgi_debug\php.exe" /pdbtype:sept /libpath:"c:\Projects\php4\lib" /libpath:"\src\lib" /libpath:"d:\src\bind\lib" /libpath:"c:\projects\sapi\debug" /libpath:"c:\projects\zend\zendcore\debug"
|
||||
# ADD LINK32 lib44bsd95.lib resolv.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib SAPI.lib libzend.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libcd" /out:"cgi_debug\php.exe" /pdbtype:sept /libpath:"c:\Projects\php4\lib" /libpath:"\src\lib" /libpath:"d:\src\bind\lib" /libpath:"c:\projects\sapi\debug" /libpath:"c:\projects\libzend\debug"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
@@ -200,6 +200,10 @@ SOURCE=.\php3_realpath.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_globals.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\php_ini.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ZendCore"=.\ZendCore.dsp - Package Owner=<4>
|
||||
Project: "libzend"=..\libzend\libzend.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
@@ -15,31 +15,7 @@ Package=<4>
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ZendDebugger"=..\ZendDebugger\ZendDebugger.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ZendOpArrayViewer"=..\ZendOpArrayViewer\ZendOpArrayViewer.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ZendOptimizer"=..\ZendOptimizer\ZendOptimizer.dsp - Package Owner=<4>
|
||||
Project: "php4"=.\php4.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
@@ -47,6 +23,9 @@ Package=<5>
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name libzend
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
@@ -0,0 +1,14 @@
|
||||
/* ========= begin header generated by ./mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === debug.c === */
|
||||
void regprint(regex_t *r, FILE *d);
|
||||
static void s_print(register struct re_guts *g, FILE *d);
|
||||
static char *regchar(int ch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
@@ -0,0 +1,35 @@
|
||||
/* ========= begin header generated by ../../regex/mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === ../../regex/engine.c === */
|
||||
static int matcher(register struct re_guts *g, char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
static char *dissect(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static char *backref(register struct match *m, char *start, char *stop, sopno startst, sopno stopst, sopno lev);
|
||||
static char *fast(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static char *slow(register struct match *m, char *start, char *stop, sopno startst, sopno stopst);
|
||||
static states step(register struct re_guts *g, sopno start, sopno stop, register states bef, int ch, register states aft);
|
||||
#define BOL (OUT+1)
|
||||
#define EOL (BOL+1)
|
||||
#define BOLEOL (BOL+2)
|
||||
#define NOTHING (BOL+3)
|
||||
#define BOW (BOL+4)
|
||||
#define EOW (BOL+5)
|
||||
#define CODEMAX (BOL+5) /* highest code used */
|
||||
#define NONCHAR(c) ((c) > CHAR_MAX)
|
||||
#define NNONCHAR (CODEMAX-CHAR_MAX)
|
||||
#ifdef REDEBUG
|
||||
static void print(struct match *m, char *caption, states st, int ch, FILE *d);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static void at(struct match *m, char *title, char *start, char *stop, sopno startst, sopno stopst);
|
||||
#endif
|
||||
#ifdef REDEBUG
|
||||
static char *pchar(int ch);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ../../regex/mkh ========= */
|
||||
@@ -0,0 +1,19 @@
|
||||
/* ========= begin header generated by ./mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === main.c === */
|
||||
void regress(FILE *in);
|
||||
void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts);
|
||||
int options(int type, char *s);
|
||||
int opt(int c, char *s);
|
||||
void fixstr(register char *p);
|
||||
char *check(char *str, regmatch_t sub, char *should);
|
||||
static char *eprint(int err);
|
||||
static int efind(char *name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ./mkh ========= */
|
||||
@@ -0,0 +1,48 @@
|
||||
/* ========= begin header generated by ../../regex/mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === ../../regex/regcomp.c === */
|
||||
static void p_ere(register struct parse *p, int stop);
|
||||
static void p_ere_exp(register struct parse *p);
|
||||
static void p_str(register struct parse *p);
|
||||
static void p_bre(register struct parse *p, register int end1, register int end2);
|
||||
static int p_simp_re(register struct parse *p, int starordinary);
|
||||
static int p_count(register struct parse *p);
|
||||
static void p_bracket(register struct parse *p);
|
||||
static void p_b_term(register struct parse *p, register cset *cs);
|
||||
static void p_b_cclass(register struct parse *p, register cset *cs);
|
||||
static void p_b_eclass(register struct parse *p, register cset *cs);
|
||||
static char p_b_symbol(register struct parse *p);
|
||||
static char p_b_coll_elem(register struct parse *p, int endc);
|
||||
static char othercase(int ch);
|
||||
static void bothcases(register struct parse *p, int ch);
|
||||
static void ordinary(register struct parse *p, register int ch);
|
||||
static void nonnewline(register struct parse *p);
|
||||
static void repeat(register struct parse *p, sopno start, int from, int to);
|
||||
static int seterr(register struct parse *p, int e);
|
||||
static cset *allocset(register struct parse *p);
|
||||
static void freeset(register struct parse *p, register cset *cs);
|
||||
static int freezeset(register struct parse *p, register cset *cs);
|
||||
static int firstch(register struct parse *p, register cset *cs);
|
||||
static int nch(register struct parse *p, register cset *cs);
|
||||
static void mcadd(register struct parse *p, register cset *cs, register char *cp);
|
||||
static void mcinvert(register struct parse *p, register cset *cs);
|
||||
static void mccase(register struct parse *p, register cset *cs);
|
||||
static int isinsets(register struct re_guts *g, int c);
|
||||
static int samesets(register struct re_guts *g, int c1, int c2);
|
||||
static void categorize(struct parse *p, register struct re_guts *g);
|
||||
static sopno dupl(register struct parse *p, sopno start, sopno finish);
|
||||
static void doemit(register struct parse *p, sop op, size_t opnd);
|
||||
static void doinsert(register struct parse *p, sop op, size_t opnd, sopno pos);
|
||||
static void dofwd(register struct parse *p, sopno pos, sop value);
|
||||
static void enlarge(register struct parse *p, sopno size);
|
||||
static void stripsnug(register struct parse *p, register struct re_guts *g);
|
||||
static void findmust(register struct parse *p, register struct re_guts *g);
|
||||
static sopno pluscount(register struct parse *p, register struct re_guts *g);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ../../regex/mkh ========= */
|
||||
@@ -0,0 +1,12 @@
|
||||
/* ========= begin header generated by ../../regex/mkh ========= */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* === ../../regex/regerror.c === */
|
||||
static char *regatoi(const regex_t *preg, char *localbuf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/* ========= end header generated by ../../regex/mkh ========= */
|
||||
@@ -96,7 +96,6 @@ int php3_init_request_info(void *conf)
|
||||
|
||||
int php3_destroy_request_info(void *conf)
|
||||
{
|
||||
TLS_VARS;
|
||||
STR_FREE(GLOBAL(request_info).current_user);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,6 @@ typedef struct php3_global_struct{
|
||||
long page_inode;
|
||||
long page_mtime;
|
||||
/*post.c*/
|
||||
int php3_track_vars;
|
||||
int le_uploads;
|
||||
/*strings.h*/
|
||||
char *strtok_string;
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@
|
||||
#include <memory.h>
|
||||
#include <winbase.h>
|
||||
#include "sendmail.h"
|
||||
|
||||
#include "php_ini.h"
|
||||
|
||||
/*
|
||||
extern int _daylight;
|
||||
@@ -126,8 +126,8 @@ int TSendMail(char *host, int *error,
|
||||
strcpy(GLOBAL(MailHost), host);
|
||||
}
|
||||
|
||||
if (php3_ini.sendmail_from){
|
||||
RPath = estrdup(php3_ini.sendmail_from);
|
||||
if (INI_STR("sendmail_from")){
|
||||
RPath = estrdup(INI_STR("sendmail_from"));
|
||||
} else {
|
||||
return 19;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user