summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:21 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:34:21 -0400
commit0e920280a2e04b110827bb766b9f29e3d581c4ee (patch)
tree8f2125f3d00fe3089e3b94adb06f04479ee15f2a /win32
downloadphp-0e920280a2e04b110827bb766b9f29e3d581c4ee.tar.gz
Imported Upstream version 5.0.4upstream/5.0.4
Diffstat (limited to 'win32')
-rwxr-xr-xwin32/EngineSelect.bat5
-rw-r--r--win32/EngineSelect.dsp85
-rw-r--r--win32/build/Makefile125
-rw-r--r--win32/build/buildconf.js227
-rw-r--r--win32/build/config.w32254
-rw-r--r--win32/build/config.w32.h.in144
-rw-r--r--win32/build/configure.tail6
-rw-r--r--win32/build/confutils.js1527
-rw-r--r--win32/build/cvsclean.js120
-rw-r--r--win32/build/deplister.c60
-rw-r--r--win32/build/mkdist.php409
-rw-r--r--win32/build/php.icobin0 -> 1718 bytes
-rw-r--r--win32/build/template.rc64
-rw-r--r--win32/builddef.bat7
-rw-r--r--win32/crypt_win32.c355
-rw-r--r--win32/crypt_win32.h60
-rw-r--r--win32/flock.c84
-rw-r--r--win32/flock.h11
-rw-r--r--win32/glob.c922
-rw-r--r--win32/glob.h101
-rwxr-xr-xwin32/globals.c51
-rw-r--r--win32/grp.h26
-rw-r--r--win32/install.txt1624
-rw-r--r--win32/installer/README93
-rw-r--r--win32/installer/gen-nsis.php446
-rw-r--r--win32/installer/setini.php87
-rw-r--r--win32/md5crypt.c163
-rw-r--r--win32/md5crypt.h37
-rw-r--r--win32/param.h16
-rw-r--r--win32/php5.dsp134
-rw-r--r--win32/php5.dsw107
-rw-r--r--win32/php5dll.dsp1731
-rw-r--r--win32/php5dllts.dsp2442
-rw-r--r--win32/php5dllts.rc126
-rw-r--r--win32/php5dllts.rc261
-rw-r--r--win32/php5ts.dsp187
-rw-r--r--win32/php5ts.dsw242
-rw-r--r--win32/php5ts.rc126
-rw-r--r--win32/php5ts.rc261
-rw-r--r--win32/php5ts_cli.dsp175
-rw-r--r--win32/php5ts_cli.rc126
-rw-r--r--win32/php5ts_cli.rc261
-rw-r--r--win32/php_modules.dsw521
-rw-r--r--win32/php_registry.h8
-rwxr-xr-xwin32/php_win32_globals.h58
-rw-r--r--win32/pwd.c66
-rw-r--r--win32/pwd.h38
-rw-r--r--win32/pws-php5cgi.reg6
-rw-r--r--win32/pws-php5isapi.reg5
-rw-r--r--win32/readdir.c146
-rw-r--r--win32/readdir.h43
-rw-r--r--win32/registry.c114
-rw-r--r--win32/resource.h15
-rw-r--r--win32/select.c176
-rw-r--r--win32/select.h22
-rw-r--r--win32/sendmail.c966
-rw-r--r--win32/sendmail.h61
-rw-r--r--win32/signal.h16
-rw-r--r--win32/syslog.h78
-rw-r--r--win32/testsuite.dsp150
-rw-r--r--win32/time.c228
-rw-r--r--win32/time.h43
-rw-r--r--win32/unistd.h4
-rw-r--r--win32/wfile.c17
-rw-r--r--win32/wfile.h16
-rw-r--r--win32/winutil.c33
-rw-r--r--win32/winutil.h21
-rw-r--r--win32/wsyslog.c126
68 files changed, 15665 insertions, 0 deletions
diff --git a/win32/EngineSelect.bat b/win32/EngineSelect.bat
new file mode 100755
index 000000000..0785bd12f
--- /dev/null
+++ b/win32/EngineSelect.bat
@@ -0,0 +1,5 @@
+@if exist ..\ZendEngine2\OBJECTS2_HOWTO (
+move ..\Zend ..\ZendEngine1
+move ..\ZendEngine2 ..\Zend
+echo "PLEASE RESTART VISUAL C++ TO RELOAD THE ZEND PROJECT."
+exit 1 )
diff --git a/win32/EngineSelect.dsp b/win32/EngineSelect.dsp
new file mode 100644
index 000000000..4aee213c2
--- /dev/null
+++ b/win32/EngineSelect.dsp
@@ -0,0 +1,85 @@
+# Microsoft Developer Studio Project File - Name="EngineSelect" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) External Target" 0x0106
+
+CFG=EngineSelect - Win32 Release
+!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 "EngineSelect.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 "EngineSelect.mak" CFG="EngineSelect - Win32 Release"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "EngineSelect - Win32 Release" (based on "Win32 (x86) External Target")
+!MESSAGE "EngineSelect - Win32 Debug" (based on "Win32 (x86) External Target")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+
+!IF "$(CFG)" == "EngineSelect - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Cmd_Line "NMAKE /f EngineSelect.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "EngineSelect.exe"
+# PROP BASE Bsc_Name "EngineSelect.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Cmd_Line "EngineSelect.bat"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "EngineSelect.exe"
+# PROP Bsc_Name ""
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "EngineSelect - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Cmd_Line "NMAKE /f EngineSelect.mak"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "EngineSelect.exe"
+# PROP BASE Bsc_Name "EngineSelect.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Cmd_Line "EngineSelect.bat"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "EngineSelect.exe"
+# PROP Bsc_Name ""
+# PROP Target_Dir ""
+
+!ENDIF
+
+# Begin Target
+
+# Name "EngineSelect - Win32 Release"
+# Name "EngineSelect - Win32 Debug"
+
+!IF "$(CFG)" == "EngineSelect - Win32 Release"
+
+!ELSEIF "$(CFG)" == "EngineSelect - Win32 Debug"
+
+!ENDIF
+
+# End Target
+# End Project
diff --git a/win32/build/Makefile b/win32/build/Makefile
new file mode 100644
index 000000000..4efb935b7
--- /dev/null
+++ b/win32/build/Makefile
@@ -0,0 +1,125 @@
+# +----------------------------------------------------------------------+
+# | PHP Version 5 |
+# +----------------------------------------------------------------------+
+# | Copyright (c) 1997-2004 The PHP Group |
+# +----------------------------------------------------------------------+
+# | This source file is subject to version 3.0 of the PHP license, |
+# | that is bundled with this package in the file LICENSE, and is |
+# | available through the world-wide-web at the following url: |
+# | http://www.php.net/license/3_0.txt. |
+# | If you did not receive a copy of the PHP license and are unable to |
+# | obtain it through the world-wide-web, please send a note to |
+# | license@php.net so we can mail you a copy immediately. |
+# +----------------------------------------------------------------------+
+# | Author: Wez Furlong <wez@thebrainroom.com> |
+# +----------------------------------------------------------------------+
+#
+# $Id: Makefile,v 1.23.2.4 2005/02/26 01:10:50 edink Exp $
+# This is the makefile template for the win32 build
+
+CC="$(CL)"
+LD="$(LINK)"
+
+all: $(BUILD_DIR) $(BUILD_DIRS_SUB) generated_files $(EXT_TARGETS) $(PECL_TARGETS) $(SAPI_TARGETS)
+
+generated_files: Zend\zend_ini_parser.c \
+ Zend\zend_language_parser.c Zend\zend_ini_scanner.c \
+ Zend\zend_language_scanner.c \
+ ext\standard\parsedate.c \
+ $(PHPDEF)
+
+$(BUILD_DIR)\$(PHPDLL).def: $(PHP_DLL_DEF_SOURCES)
+ type $(PHP_DLL_DEF_SOURCES) > $(BUILD_DIR)\$(PHPDLL).def
+
+Zend\zend_ini_parser.c Zend\zend_ini_parser.h: Zend\zend_ini_parser.y
+ $(BISON) --output=Zend/zend_ini_parser.c -v -d -p ini_ Zend/zend_ini_parser.y
+
+Zend\zend_language_parser.c Zend\zend_language_parser.h: Zend\zend_language_parser.y
+ $(BISON) --output=Zend/zend_language_parser.c -v -d -p zend Zend/zend_language_parser.y
+
+Zend\zend_ini_scanner.c: Zend\flex.skl Zend\zend_ini_scanner.l
+ $(FLEX) -B -i -SZend/flex.skl -Pini_ -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l
+
+Zend\zend_language_scanner.c: Zend\flex.skl Zend\zend_language_scanner.l
+ $(FLEX) -i -SZend/flex.skl -Pzend -oZend/zend_language_scanner.c Zend/zend_language_scanner.l
+
+ext\standard\parsedate.c ext\standard\parsedate.h: ext\standard\parsedate.y
+ $(BISON) --output=ext/standard/parsedate.c -v -d ext/standard/parsedate.y
+
+PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res
+
+$(PHPDLL_RES): win32\build\template.rc
+ $(RC) /fo $(PHPDLL_RES) /d FILE_DESCRIPTION="\"PHP Script Interpreter\"" \
+ /d FILE_NAME="\"$(PHPDLL)\"" /d PRODUCT_NAME="\"PHP Script Interpreter\"" \
+ win32\build\template.rc
+
+$(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES)
+ $(LD) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES)
+
+$(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL)
+
+$(BUILD_DIR) $(BUILD_DIRS_SUB):
+ @echo Recreating build dirs
+ @if not exist $(BUILD_DIR) mkdir $(BUILD_DIR)
+ @for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D > NUL
+
+clean-sapi:
+ @echo Cleaning SAPI
+ @for %D in (_x $(EXT_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL
+ @for %D in (_x $(PECL_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL
+ @for %D in (_x $(SAPI_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL
+ -@del /F /Q $(BUILD_DIR)\$(PHPDLL)
+
+clean: clean-sapi
+ @echo Cleaning build dirs
+ @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL
+ -@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL
+ -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
+
+clean-pecl:
+ @echo Cleaning PECL targets only
+ -rmdir /s /q $(BUILD_DIR)\pecl
+
+test:
+ <<test_suite_uses_lame_env_vars.bat
+set TEST_PHP_EXECUTABLE=$(BUILD_DIR)\php.exe
+$(BUILD_DIR)\php.exe -d open_basedir= -d safe_mode=0 -d output_buffering=0 run-tests.php $(TESTS)
+<<NOKEEP
+
+build-snap:
+ @$(MAKE) "$(BUILD_DIR)\$(PHPDLL)"
+ -for %T in ($(SAPI_TARGETS)) do $(MAKE) /I /nologo "%T"
+ -for %T in ($(EXT_TARGETS)) do $(MAKE) /I /nologo "%T"
+ -for %T in ($(PECL_TARGETS)) do $(MAKE) /I /nologo "%T"
+
+build-dist: $(BUILD_DIR)\deplister.exe
+ -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
+ -rmdir /s /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)
+ -del /f /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip
+ -del /f /q $(BUILD_DIR)\php-debug-pack-$(PHP_VERSION_STRING)-Win32.zip
+ -del /f /q $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip
+ $(BUILD_DIR)\php.exe -n win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS) $(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) $(PECL_EXTRA_DIST_FILES)" "$(SNAPSHOT_TEMPLATE)"
+ cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
+ -$(ZIP) -9 -r ..\php-$(PHP_VERSION_STRING)-Win32.zip .
+ cd ..\..
+ cd $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)
+ -$(ZIP) -9 -r ..\pecl-$(PHP_VERSION_STRING)-Win32.zip .
+ cd ..\..
+ cd $(BUILD_DIR)
+ -$(ZIP) -9 php-debug-pack-$(PHP_VERSION_STRING)-Win32.zip *.pdb
+ cd ..\..
+
+dist: all build-dist
+snap: build-snap build-dist
+
+$(BUILD_DIR)\deplister.exe: win32\build\deplister.c
+ $(CL) /Fo$(BUILD_DIR)\ /Fd$(BUILD_DIR)\ /Fp$(BUILD_DIR)\ /FR$(BUILD_DIR) -o$(BUILD_DIR)\deplister.exe win32\build\deplister.c imagehlp.lib
+
+msi-installer: dist
+ $(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)"
+
+install: all
+ @if not exist $(PHP_PREFIX) mkdir $(PHP_PREFIX)
+ @copy $(BUILD_DIR)\*.exe $(PHP_PREFIX) /y >nul
+ @copy $(BUILD_DIR)\*.dll $(PHP_PREFIX) /y >nul
+
diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js
new file mode 100644
index 000000000..3a9f17715
--- /dev/null
+++ b/win32/build/buildconf.js
@@ -0,0 +1,227 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@thebrainroom.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: buildconf.js,v 1.11 2004/02/12 12:30:41 wez Exp $ */
+// This generates a configure script for win32 build
+
+WScript.StdOut.WriteLine("Rebuilding configure.js");
+var FSO = WScript.CreateObject("Scripting.FileSystemObject");
+var C = FSO.CreateTextFile("configure.js", true);
+
+var modules = "";
+var MODULES = WScript.CreateObject("Scripting.Dictionary");
+
+function file_get_contents(filename)
+{
+ var F = FSO.OpenTextFile(filename, 1);
+ var t = F.ReadAll();
+ F.Close();
+ return t;
+}
+
+function Module_Item(module_name, config_path, dir_line, deps, content)
+{
+ this.module_name = module_name;
+ this.config_path = config_path;
+ this.dir_line = dir_line;
+ this.deps = deps;
+ this.content = content;
+}
+
+function find_config_w32(dirname)
+{
+ if (!FSO.FolderExists(dirname)) {
+ return;
+ }
+
+ var f = FSO.GetFolder(dirname);
+ var fc = new Enumerator(f.SubFolders);
+ var c, i, ok, n;
+ var item = null;
+ var re_dep_line = new RegExp("ADD_EXTENSION_DEP\\([^,]*\\s*,\\s*['\"]([^'\"]+)['\"].*\\);", "gm");
+
+ for (; !fc.atEnd(); fc.moveNext())
+ {
+ ok = true;
+ /* check if we already picked up a module with the same dirname;
+ * if we have, don't include it here */
+ n = FSO.GetFileName(fc.item());
+
+ if (n == 'CVS' || n == 'tests')
+ continue;
+
+ // WScript.StdOut.WriteLine("checking " + dirname + "/" + n);
+ if (MODULES.Exists(n)) {
+ WScript.StdOut.WriteLine("Skipping " + dirname + "/" + n + " -- already have a module with that name");
+ continue;
+ }
+
+
+ c = FSO.BuildPath(fc.item(), "config.w32");
+ if (FSO.FileExists(c)) {
+// WScript.StdOut.WriteLine(c);
+
+ var dir_line = "configure_module_dirname = condense_path(FSO.GetParentFolderName('"
+ + c.replace(new RegExp('(["\\\\])', "g"), '\\$1') + "'));\r\n";
+ var contents = file_get_contents(c);
+ var deps = new Array();
+
+ // parse out any deps from the file
+ var calls = contents.match(re_dep_line);
+ if (calls != null) {
+ for (i = 0; i < calls.length; i++) {
+ // now we need the extension name out of this thing
+ if (calls[i].match(re_dep_line)) {
+// WScript.StdOut.WriteLine("n depends on " + RegExp.$1);
+ deps[deps.length] = RegExp.$1;
+ }
+ }
+ }
+
+ item = new Module_Item(n, c, dir_line, deps, contents);
+ MODULES.Add(n, item);
+ }
+ }
+}
+
+// Emit core modules array. This is used by a snapshot
+// build to override a default "yes" value so that external
+// modules don't break the build by becoming statically compiled
+function emit_core_module_list()
+{
+ var module_names = (new VBArray(MODULES.Keys())).toArray();
+ var i, mod_name, j;
+ var item;
+ var output = "";
+
+ C.WriteLine("core_module_list = new Array(");
+
+ // first, look for modules with empty deps; emit those first
+ for (i in module_names) {
+ mod_name = module_names[i];
+ C.WriteLine("\"" + mod_name.replace(/_/g, "-") + "\",");
+ }
+
+ C.WriteLine("false // dummy");
+
+ C.WriteLine(");");
+}
+
+
+function emit_module(item)
+{
+ return item.dir_line + item.content;
+}
+
+function emit_dep_modules(module_names)
+{
+ var i, mod_name, j;
+ var output = "";
+ var item = null;
+
+ for (i in module_names) {
+ mod_name = module_names[i];
+
+ if (MODULES.Exists(mod_name)) {
+ item = MODULES.Item(mod_name);
+ MODULES.Remove(mod_name);
+ if (item.deps.length) {
+ output += emit_dep_modules(item.deps);
+ }
+ output += emit_module(item);
+ }
+ }
+
+ return output;
+}
+
+function gen_modules()
+{
+ var module_names = (new VBArray(MODULES.Keys())).toArray();
+ var i, mod_name, j;
+ var item;
+ var output = "";
+
+ // first, look for modules with empty deps; emit those first
+ for (i in module_names) {
+ mod_name = module_names[i];
+ item = MODULES.Item(mod_name);
+ if (item.deps.length == 0) {
+ MODULES.Remove(mod_name);
+ output += emit_module(item);
+ }
+ }
+
+ // now we are left with modules that have dependencies on other modules
+ module_names = (new VBArray(MODULES.Keys())).toArray();
+ output += emit_dep_modules(module_names);
+
+ return output;
+}
+
+if (FSO.FileExists("ZendEngine2\\OBJECTS2_HOWTO")) {
+ if (FSO.FolderExists("Zend")) {
+ FSO.MoveFolder("Zend", "ZendEngine1");
+ }
+ FSO.MoveFolder("ZendEngine2", "Zend");
+}
+
+// Write the head of the configure script
+C.WriteLine("/* This file automatically generated from win32/build/confutils.js */");
+C.Write(file_get_contents("win32/build/confutils.js"));
+
+// Pull in code from sapi and extensions
+modules = file_get_contents("win32/build/config.w32");
+
+// Pick up confs from TSRM and Zend if present
+find_config_w32(".");
+find_config_w32("sapi");
+find_config_w32("ext");
+emit_core_module_list();
+
+find_config_w32("pecl");
+find_config_w32("..\\pecl");
+find_config_w32("pecl\\rpc");
+find_config_w32("..\\pecl\\rpc");
+
+
+// Now generate contents of module based on MODULES, chasing dependencies
+// to ensure that dependent modules are emitted first
+modules += gen_modules();
+
+// Look for ARG_ENABLE or ARG_WITH calls
+re = new RegExp("(ARG_(ENABLE|WITH)\([^;]+\);)", "gm");
+calls = modules.match(re);
+for (i = 0; i < calls.length; i++) {
+ item = calls[i];
+ C.WriteLine(item);
+}
+
+C.WriteBlankLines(1);
+C.WriteLine("conf_process_args();");
+C.WriteBlankLines(1);
+
+// Comment out the calls from their original positions
+modules = modules.replace(re, "/* $1 */");
+C.Write(modules);
+
+C.WriteBlankLines(1);
+C.Write(file_get_contents("win32/build/configure.tail"));
+
+WScript.StdOut.WriteLine("Now run 'cscript /nologo configure.js --help'");
+
diff --git a/win32/build/config.w32 b/win32/build/config.w32
new file mode 100644
index 000000000..ce56f3ac0
--- /dev/null
+++ b/win32/build/config.w32
@@ -0,0 +1,254 @@
+// vim:ft=javascript
+// $Id: config.w32,v 1.26.2.8 2005/02/25 23:00:17 edink Exp $
+// "Master" config file; think of it as a configure.in
+// equivalent.
+
+ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin');
+
+PATH_PROG('cl');
+PATH_PROG('link');
+PATH_PROG('nmake');
+// we don't want to define LIB, as that will override the default library path
+// that is set in that env var
+PATH_PROG('lib', null, 'MAKE_LIB');
+PATH_PROG('bison');
+PATH_PROG('flex');
+PATH_PROG('re2c');
+PATH_PROG('zip');
+PATH_PROG('lemon');
+
+ARG_ENABLE('debug', 'Compile with debugging symbols', "no");
+ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');
+if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") {
+ ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");
+}
+ARG_ENABLE('zts', 'Thread safety', 'yes');
+// Configures the hard-coded installation dir
+ARG_ENABLE('prefix', 'where PHP will be installed', '');
+if (PHP_PREFIX == '') {
+ PHP_PREFIX = "C:\\php" + PHP_VERSION;
+ if (PHP_DEBUG == "yes")
+ PHP_PREFIX += "\\debug";
+}
+DEFINE('PHP_PREFIX', PHP_PREFIX);
+
+DEFINE("BASE_INCLUDES", "/I . /I main /I regex /I Zend /I TSRM ");
+
+// CFLAGS for building the PHP dll
+DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \
+/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x400");
+
+DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
+
+// General CFLAGS for building objects
+DEFINE("CFLAGS", "/nologo /YX /FD $(BASE_INCLUDES) /D _WINDOWS \
+/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS");
+
+// General link flags
+DEFINE("LDFLAGS", "/nologo /version:" +
+ PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION);
+
+// General DLL link flags
+DEFINE("DLL_LDFLAGS", "/dll ");
+
+// PHP DLL link flags
+DEFINE("PHP_LDFLAGS", "$(DLL_LDFLAGS)");
+
+// General libs
+// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib
+DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib");
+
+// Set some debug/release specific options
+if (PHP_DEBUG == "yes") {
+ ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /ZI /Od /GZ /D _DEBUG /D ZEND_DEBUG=1");
+ ADD_FLAG("LDFLAGS", "/debug");
+ // Avoid problems when linking to release libraries that use the release
+ // version of the libc
+ ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
+} else {
+ // Generate external debug files when --enable-debug-pack is specified
+ if (PHP_DEBUG_PACK == "yes") {
+ ADD_FLAG("CFLAGS", "/Zi");
+ ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
+ }
+ // Equivalent to Release_TSInline build -> best optimization
+ ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG \
+/D ZEND_WIN32_FORCE_INLINE /GB /GF /D ZEND_DEBUG=0");
+ // if you have VS.Net /GS hardens the binary against buffer overruns
+ // ADD_FLAG("CFLAGS", "/GS");
+}
+
+if (PHP_ZTS == "yes") {
+ ADD_FLAG("CFLAGS", "/D ZTS=1");
+}
+
+// we want msvcrt in the PHP DLL
+ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");
+
+// set up the build dir and DLL name
+if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
+ DEFINE("BUILD_DIR", "Debug_TS");
+ DEFINE("PHPDLL", "php5ts_debug.dll");
+ DEFINE("PHPLIB", "php5ts_debug.lib");
+} else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") {
+ DEFINE("BUILD_DIR", "Debug");
+ DEFINE("PHPDLL", "php5_debug.dll");
+ DEFINE("PHPLIB", "php5_debug.lib");
+} else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") {
+ DEFINE("BUILD_DIR", "Release_TS");
+ DEFINE("PHPDLL", "php5ts.dll");
+ DEFINE("PHPLIB", "php5ts.lib");
+} else if (PHP_DEBUG == "no" && PHP_ZTS == "no") {
+ DEFINE("BUILD_DIR", "Release");
+ DEFINE("PHPDLL", "php5.dll");
+ DEFINE("PHPLIB", "php5.lib");
+}
+
+// Find the php_build dir - it contains headers and libraries
+// that we need
+ARG_WITH('php-build', 'Path to where you extracted http://www.php.net/extra/win32build.zip. Assumes that it is a sibling of this source dir (..\\php_build) if not specified', 'no');
+
+if (PHP_PHP_BUILD == 'no') {
+ if (FSO.FolderExists("..\\php_build")) {
+ PHP_PHP_BUILD = "..\\php_build";
+ } else if (FSO.FolderExists("..\\win32build")) {
+ PHP_PHP_BUILD = "..\\win32build";
+ } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) {
+ PHP_PHP_BUILD = "..\\php-win32-dev\\php_build";
+ }
+}
+
+ARG_WITH('extra-includes', 'Extra include path to use when building everything', '');
+ARG_WITH('extra-libs', 'Extra library path to use when linking everything', '');
+
+var php_usual_include_suspects = "..\\php_build\\include;..\\win32build\\include;..\\bindlib_w32";
+var php_usual_lib_suspects = "..\\php_build\\lib;..\\win32build\\lib;..\\bindlib_w32";
+
+// Poke around for some headers
+function probe_basic_headers()
+{
+ var p;
+
+ if (PHP_PHP_BUILD != "no") {
+ php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include";
+ php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib";
+ }
+
+ p = CHECK_HEADER_ADD_INCLUDE("arpa\\nameser.h", "CFLAGS", php_usual_include_suspects);
+
+ // hack to catch common location of libs
+ if (typeof(p) == "string") {
+ p = p.replace(new RegExp("include$"), "lib");
+ ADD_FLAG("LDFLAGS", '/libpath:"' + p + '" ');
+ php_usual_lib_suspects += ";" + p;
+ } else if (!p) {
+ ERROR("We really need that arpa\\nameser.h file - it is part of the win32build package");
+ }
+}
+
+function add_extra_dirs()
+{
+ var path, i, f;
+
+ if (PHP_EXTRA_INCLUDES.length) {
+ path = PHP_EXTRA_INCLUDES.split(';');
+ for (i = 0; i < path.length; i++) {
+ f = FSO.GetAbsolutePathName(path[i]);
+ if (FSO.FolderExists(f)) {
+ ADD_FLAG("CFLAGS", '/I "' + f + '" ');
+ }
+ }
+ }
+ if (PHP_EXTRA_LIBS.length) {
+ path = PHP_EXTRA_LIBS.split(';');
+ for (i = 0; i < path.length; i++) {
+ f = FSO.GetAbsolutePathName(path[i]);
+ if (FSO.FolderExists(f)) {
+ ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" ');
+ }
+ }
+ }
+
+}
+
+probe_basic_headers();
+add_extra_dirs();
+CHECK_LIB("resolv.lib");
+
+//DEFINE("PHP_BUILD", PHP_PHP_BUILD);
+
+STDOUT.WriteBlankLines(1);
+STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR'));
+STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PHPLIB'));
+
+ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \
+ zend_ini_parser.c zend_ini_scanner.c zend_alloc.c zend_compile.c \
+ zend_constants.c zend_dynamic_array.c zend_exceptions.c \
+ zend_execute_API.c zend_highlight.c \
+ zend_llist.c zend_opcode.c zend_operators.c zend_ptr_stack.c \
+ zend_stack.c zend_variables.c zend.c zend_API.c zend_extensions.c \
+ zend_hash.c zend_list.c zend_indent.c zend_builtin_functions.c \
+ zend_sprintf.c zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c \
+ zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \
+ zend_object_handlers.c zend_objects_API.c \
+ zend_mm.c zend_default_classes.c zend_reflection_api.c zend_execute.c zend_strtod.c");
+
+ADD_SOURCES("main", "main.c snprintf.c spprintf.c safe_mode.c fopen_wrappers.c \
+ php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
+ strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \
+ php_open_temporary_file.c php_logos.c output.c internal_functions.c php_sprintf.c");
+
+ADD_SOURCES("main/streams", "streams.c cast.c memory.c filter.c plain_wrapper.c \
+ userspace.c transports.c xp_socket.c mmap.c");
+
+ADD_SOURCES("win32", "crypt_win32.c flock.c glob.c md5crypt.c pwd.c readdir.c \
+ registry.c select.c sendmail.c time.c wfile.c winutil.c wsyslog.c globals.c");
+
+ADD_SOURCES("regex", "regcomp.c regerror.c regexec.c regfree.c");
+
+STDOUT.WriteBlankLines(1);
+
+/* Can we build with IPv6 support? */
+ARG_ENABLE("ipv6", "Disable IPv6 support (default is turn it on if available)", "yes");
+
+var main_network_has_ipv6 = 0;
+if (PHP_IPV6 == "yes") {
+ main_network_has_ipv6 = CHECK_HEADER_ADD_INCLUDE("wspiapi.h", "CFLAGS") ? 1 : 0;
+}
+if (main_network_has_ipv6) {
+ STDOUT.WriteLine("Enabling IPv6 support");
+}
+AC_DEFINE('HAVE_GETADDRINFO', main_network_has_ipv6);
+AC_DEFINE('HAVE_GAI_STRERROR', main_network_has_ipv6);
+AC_DEFINE('HAVE_IPV6', main_network_has_ipv6);
+
+/* this allows up to 256 sockets to be select()ed in a single
+ * call to select(), instead of the usual 64 */
+ARG_ENABLE('fd-setsize', "Set maximum number of sockets for select(2)", "256");
+ADD_FLAG("CFLAGS", "/D FD_SETSIZE=" + parseInt(PHP_FD_SETSIZE));
+
+ARG_ENABLE("memory-limit", "Enable memory limit checking code", "no");
+
+AC_DEFINE('MEMORY_LIMIT', PHP_MEMORY_LIMIT == "yes" ? 1 : 0);
+
+ARG_ENABLE("zend-multibyte", "Enable Zend multibyte encoding support", "no");
+if (PHP_ZEND_MULTIBYTE == "yes") {
+ STDOUT.WriteLine("Enabling Zend multibyte encoding support");
+ AC_DEFINE('ZEND_MULTIBYTE', 1);
+}
+
+AC_DEFINE('HAVE_USLEEP', 1);
+AC_DEFINE('HAVE_STRCOLL', 1);
+
+/* For snapshot builders, where can we find the additional
+ * files that make up the snapshot template? */
+ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no");
+
+if (PHP_SNAPSHOT_TEMPLATE == "no") {
+ /* default is as a sibling of the php_build dir */
+ if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) {
+ PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template");
+ }
+}
+
+DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE);
diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in
new file mode 100644
index 000000000..f13518c58
--- /dev/null
+++ b/win32/build/config.w32.h.in
@@ -0,0 +1,144 @@
+/*
+ Build Configuration Template for Win32.
+ $Id: config.w32.h.in,v 1.5 2004/04/29 00:17:09 wez Exp $
+*/
+
+/* Default PHP / PEAR directories */
+#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):""
+#define CONFIGURATION_FILE_PATH "php.ini"
+#define PEAR_INSTALLDIR "@PREFIX@\\pear"
+#define PHP_BINDIR "@PREFIX@"
+#define PHP_DATADIR "@PREFIX@"
+#define PHP_EXTENSION_DIR "@PREFIX@"
+#define PHP_INCLUDE_PATH ".;@PREFIX@\\pear"
+#define PHP_LIBDIR "@PREFIX@"
+#define PHP_LOCALSTATEDIR "@PREFIX@"
+#define PHP_PREFIX "@PREFIX@"
+#define PHP_SYSCONFDIR "@PREFIX@"
+
+/* Enable / Disable crypt() function (default: enabled) */
+#define HAVE_CRYPT 1
+#define PHP_STD_DES_CRYPT 1
+#define PHP_EXT_DES_CRYPT 0
+#define PHP_MD5_CRYPT 1
+#define PHP_BLOWFISH_CRYPT 0
+
+/* PHP Runtime Configuration */
+#define PHP_URL_FOPEN 1
+#define PHP_SAFE_MODE 0
+#define MAGIC_QUOTES 0
+#define USE_CONFIG_FILE 1
+#define DEFAULT_SHORT_OPEN_TAG "1"
+
+/* Platform-Specific Configuration. Should not be changed. */
+#define PHP_SIGCHILD 0
+#define HAVE_LIBBIND 1
+#define HAVE_GETSERVBYNAME 1
+#define HAVE_GETSERVBYPORT 1
+#define HAVE_GETPROTOBYNAME 1
+#define HAVE_GETPROTOBYNUMBER 1
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+#define HAVE_ERRMSG_H 0
+#undef HAVE_ADABAS
+#undef HAVE_SOLID
+#undef HAVE_LINK
+#undef HAVE_SYMLINK
+
+/* its in win32/time.c */
+#define HAVE_USLEEP 1
+
+#define HAVE_GETCWD 1
+#define HAVE_POSIX_READDIR_R 1
+#define NEED_ISBLANK 1
+#define DISCARD_PATH 0
+#undef HAVE_SETITIMER
+#undef HAVE_IODBC
+#define HAVE_LIBDL 1
+#define HAVE_SENDMAIL 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_PUTENV 1
+#define HAVE_LIMITS_H 1
+#define HAVE_TZSET 1
+#define HAVE_TZNAME 1
+#undef HAVE_FLOCK
+#define HAVE_ALLOCA 1
+#undef HAVE_SYS_TIME_H
+#define HAVE_SIGNAL_H 1
+#undef HAVE_ST_BLKSIZE
+#undef HAVE_ST_BLOCKS
+#define HAVE_ST_RDEV 1
+#define HAVE_UTIME_NULL 1
+#define HAVE_VPRINTF 1
+#define STDC_HEADERS 1
+#define REGEX 1
+#define HSREGEX 1
+#define HAVE_GCVT 1
+#define HAVE_GETLOGIN 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_PUTENV 1
+#define HAVE_REGCOMP 1
+#define HAVE_SETLOCALE 1
+#define HAVE_LOCALECONV 1
+#define HAVE_LOCALE_H 1
+#ifndef HAVE_LIBBIND
+# define HAVE_SETVBUF 1
+#endif
+#define HAVE_SHUTDOWN 1
+#define HAVE_SNPRINTF 1
+#define HAVE_VSNPRINTF 1
+#define HAVE_STRCASECMP 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRSTR 1
+#define HAVE_TEMPNAM 1
+#define HAVE_UTIME 1
+#undef HAVE_DIRENT_H
+#define HAVE_ASSERT_H 1
+#define HAVE_FCNTL_H 1
+#define HAVE_GRP_H 0
+#define HAVE_PWD_H 1
+#define HAVE_STRING_H 1
+#undef HAVE_SYS_FILE_H
+#undef HAVE_SYS_SOCKET_H
+#undef HAVE_SYS_WAIT_H
+#define HAVE_SYSLOG_H 1
+#undef HAVE_UNISTD_H
+#define HAVE_LIBDL 1
+#define HAVE_LIBM 1
+#define HAVE_CUSERID 0
+#undef HAVE_RINT
+#define HAVE_STRFTIME 1
+/* int and long are stll 32bit in 64bit compiles */
+#define SIZEOF_INT 4
+#define SIZEOF_LONG 4
+/* MSVC.6/NET don't allow 'long long' or know 'intmax_t' */
+#define SIZEOF_LONG_LONG_INT 0
+#define SIZEOF_LONG_LONG 0
+#define SIZEOF_INTMAX_T 0
+#define ssize_t SSIZE_T
+#ifdef _WIN64
+# define SIZEOF_SIZE_T 8
+# define SIZEOF_PTRDIFF_T 8
+#else
+# define SIZEOF_SIZE_T 4
+# define SIZEOF_PTRDIFF_T 4
+#endif
+#define HAVE_GLOB
+#define PHP_SHLIB_SUFFIX "dll"
+#define HAVE_SQLDATASOURCES
+
+/* Win32 supports strcoll */
+#define HAVE_STRCOLL 1
+
+/* Win32 support proc_open */
+#define PHP_CAN_SUPPORT_PROC_OPEN 1
+
+#define HAVE_MBLEN
+
+#undef HAVE_ATOF_ACCEPTS_NAN
+#undef HAVE_ATOF_ACCEPTS_INF
+#define HAVE_HUGE_VAL_NAN 1
diff --git a/win32/build/configure.tail b/win32/build/configure.tail
new file mode 100644
index 000000000..49e537825
--- /dev/null
+++ b/win32/build/configure.tail
@@ -0,0 +1,6 @@
+// vim:ft=javascript
+// $Id: configure.tail,v 1.1 2003/12/02 23:17:04 wez Exp $
+// tail end of configure
+
+generate_files();
+
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
new file mode 100644
index 000000000..f06092211
--- /dev/null
+++ b/win32/build/confutils.js
@@ -0,0 +1,1527 @@
+// Utils for configure script
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@thebrainroom.com> |
+ +----------------------------------------------------------------------+
+*/
+
+// $Id: confutils.js,v 1.42.2.3 2005/02/26 01:10:50 edink Exp $
+
+var STDOUT = WScript.StdOut;
+var STDERR = WScript.StdErr;
+var WshShell = WScript.CreateObject("WScript.Shell");
+var FSO = WScript.CreateObject("Scripting.FileSystemObject");
+var MFO = null;
+var SYSTEM_DRIVE = WshShell.Environment("Process").Item("SystemDrive");
+var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles");
+
+if (PROGRAM_FILES == null) {
+ PROGRAM_FILES = "C:\\Program Files";
+}
+
+if (!FSO.FileExists("README.CVS-RULES")) {
+ STDERR.WriteLine("Must be run from the root of the php source");
+ WScript.Quit(10);
+}
+
+var CWD = WshShell.CurrentDirectory;
+
+if (typeof(CWD) == "undefined") {
+ CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.CVS-RULES"));
+}
+
+/* defaults; we pick up the precise versions from configure.in */
+var PHP_VERSION = 5;
+var PHP_MINOR_VERSION = 0;
+var PHP_RELEASE_VERSION = 0;
+var PHP_EXTRA_VERSION = "";
+var PHP_VERSION_STRING = "5.0.0";
+
+function get_version_numbers()
+{
+ var cin = file_get_contents("configure.in");
+
+ if (cin.match(new RegExp("MAJOR_VERSION=(\\d+)"))) {
+ PHP_VERSION = RegExp.$1;
+ }
+ if (cin.match(new RegExp("MINOR_VERSION=(\\d+)"))) {
+ PHP_MINOR_VERSION = RegExp.$1;
+ }
+ if (cin.match(new RegExp("RELEASE_VERSION=(\\d+)"))) {
+ PHP_RELEASE_VERSION = RegExp.$1;
+ }
+ PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION;
+
+ if (cin.match(new RegExp("EXTRA_VERSION=\"([^\"]+)\""))) {
+ PHP_EXTRA_VERSION = RegExp.$1;
+ if (PHP_EXTRA_VERSION.length) {
+ PHP_VERSION_STRING += PHP_EXTRA_VERSION;
+ }
+ }
+ DEFINE('PHP_VERSION_STRING', PHP_VERSION_STRING);
+}
+
+configure_args = new Array();
+configure_subst = WScript.CreateObject("Scripting.Dictionary");
+
+configure_hdr = WScript.CreateObject("Scripting.Dictionary");
+build_dirs = new Array();
+
+extension_include_code = "";
+extension_module_ptrs = "";
+
+get_version_numbers();
+
+/* execute a command and return the output as a string */
+function execute(command_line)
+{
+ var e = WshShell.Exec(command_line);
+ var ret = "";
+
+ ret = e.StdOut.ReadAll();
+
+//STDOUT.WriteLine("command " + command_line);
+//STDOUT.WriteLine(ret);
+
+ return ret;
+}
+
+function condense_path(path)
+{
+ path = FSO.GetAbsolutePathName(path);
+
+ if (path.substr(0, CWD.length).toLowerCase()
+ == CWD.toLowerCase() &&
+ (path.charCodeAt(CWD.length) == 92 || path.charCodeAt(CWD.length) == 47)) {
+ return path.substr(CWD.length + 1);
+ }
+
+ var a = CWD.split("\\");
+ var b = path.split("\\");
+ var i, j;
+
+ for (i = 0; i < b.length; i++) {
+ if (a[i].toLowerCase() == b[i].toLowerCase())
+ continue;
+ if (i > 0) {
+ /* first difference found */
+ path = "";
+ for (j = 0; j < a.length - i; j++) {
+ path += "..\\";
+ }
+ for (j = i; j < b.length; j++) {
+ path += b[j];
+ if (j < b.length - 1)
+ path += "\\";
+ }
+ return path;
+ }
+ /* on a different drive */
+ break;
+ }
+
+ return path;
+}
+
+function ConfigureArg(type, optname, helptext, defval)
+{
+ var opptype = type == "enable" ? "disable" : "without";
+
+ if (defval == "yes" || defval == "yes,shared") {
+ this.arg = "--" + opptype + "-" + optname;
+ this.imparg = "--" + type + "-" + optname;
+ } else {
+ this.arg = "--" + type + "-" + optname;
+ this.imparg = "--" + opptype + "-" + optname;
+ }
+
+ this.optname = optname;
+ this.helptext = helptext;
+ this.defval = defval;
+ this.symval = optname.toUpperCase().replace(new RegExp("-", "g"), "_");
+ this.seen = false;
+ this.argval = defval;
+}
+
+function ARG_WITH(optname, helptext, defval)
+{
+ configure_args[configure_args.length] = new ConfigureArg("with", optname, helptext, defval);
+}
+
+function ARG_ENABLE(optname, helptext, defval)
+{
+ configure_args[configure_args.length] = new ConfigureArg("enable", optname, helptext, defval);
+}
+
+function analyze_arg(argval)
+{
+ var ret = new Array();
+ var shared = false;
+
+ if (argval == "shared") {
+ shared = true;
+ argval = "yes";
+ } else if (argval == null) {
+ /* nothing */
+ } else if (arg_match = argval.match(new RegExp("^shared,(.*)"))) {
+ shared = true;
+ argval = arg_match[1];
+ } else if (arg_match = argval.match(new RegExp("^(.*),shared$"))) {
+ shared = true;
+ argval = arg_match[1];
+ }
+
+ ret[0] = shared;
+ ret[1] = argval;
+ return ret;
+}
+
+function word_wrap_and_indent(indent, text, line_suffix, indent_char)
+{
+ if (text == null) {
+ return "";
+ }
+
+ var words = text.split(new RegExp("\\s+", "g"));
+ var i = 0;
+ var ret_text = "";
+ var this_line = "";
+ var t;
+ var space = "";
+ var lines = 0;
+
+ if (line_suffix == null) {
+ line_suffix = "";
+ }
+
+ if (indent_char == null) {
+ indent_char = " ";
+ }
+
+ for (i = 0; i < indent; i++) {
+ space += indent_char;
+ }
+
+ for (i = 0; i < words.length; i++) {
+ if (this_line.length) {
+ t = this_line + " " + words[i];
+ } else {
+ t = words[i];
+ }
+
+ if (t.length + indent > 78) {
+ if (lines++) {
+ ret_text += space;
+ }
+ ret_text += this_line + line_suffix + "\r\n";
+ this_line = "";
+ }
+
+ if (this_line.length) {
+ this_line += " " + words[i];
+ } else {
+ this_line = words[i];
+ }
+ }
+
+ if (this_line.length) {
+ if (lines)
+ ret_text += space;
+ ret_text += this_line;
+ }
+
+ return ret_text;
+}
+
+function conf_process_args()
+{
+ var i, j;
+ var configure_help_mode = false;
+ var analyzed = false;
+ var nice = "cscript /nologo configure.js ";
+ var disable_all = false;
+
+ args = WScript.Arguments;
+ for (i = 0; i < args.length; i++) {
+ arg = args(i);
+ nice += ' "' + arg + '"';
+ if (arg == "--help") {
+ configure_help_mode = true;
+ break;
+ }
+ if (arg == "--disable-all") {
+ disable_all = true;
+ continue;
+ }
+
+ // If it is --foo=bar, split on the equals sign
+ arg = arg.split("=", 2);
+ argname = arg[0];
+ if (arg.length > 1) {
+ argval = arg[1];
+ } else {
+ argval = null;
+ }
+
+ // Find the arg
+ found = false;
+ for (j = 0; j < configure_args.length; j++) {
+ if (argname == configure_args[j].imparg || argname == configure_args[j].arg) {
+ found = true;
+
+ arg = configure_args[j];
+ arg.seen = true;
+
+ analyzed = analyze_arg(argval);
+ shared = analyzed[0];
+ argval = analyzed[1];
+
+ if (argname == arg.imparg) {
+ /* we matched the implicit, or default arg */
+ if (argval == null) {
+ argval = arg.defval;
+ }
+ } else {
+ /* we matched the non-default arg */
+ if (argval == null) {
+ argval = arg.defval == "no" ? "yes" : "no";
+ }
+ }
+
+ arg.argval = argval;
+ eval("PHP_" + arg.symval + " = argval;");
+ eval("PHP_" + arg.symval + "_SHARED = shared;");
+ break;
+ }
+ }
+ if (!found) {
+ STDERR.WriteLine("Unknown option " + argname + "; please try configure.js --help for a list of valid options");
+ WScript.Quit(2);
+ }
+ }
+
+ if (configure_help_mode) {
+ STDOUT.WriteLine(word_wrap_and_indent(0,
+"Options that enable extensions and SAPI will accept \
+'yes' or 'no' as a parameter. They also accept 'shared' \
+as a synonym for 'yes' and request a shared build of that \
+module. Not all modules can be built as shared modules; \
+configure will display [shared] after the module name if \
+can be built that way. \
+"
+ ));
+ STDOUT.WriteBlankLines(1);
+
+ // Measure width to pretty-print the output
+ max_width = 0;
+ for (i = 0; i < configure_args.length; i++) {
+ arg = configure_args[i];
+ if (arg.arg.length > max_width)
+ max_width = arg.arg.length;
+ }
+
+ for (i = 0; i < configure_args.length; i++) {
+ arg = configure_args[i];
+
+ n = max_width - arg.arg.length;
+ pad = " ";
+ for (j = 0; j < n; j++) {
+ pad += " ";
+ }
+ STDOUT.WriteLine(" " + arg.arg + pad + word_wrap_and_indent(max_width + 5, arg.helptext));
+ }
+ WScript.Quit(1);
+ }
+
+ var snapshot_build_exclusions = new Array(
+ 'debug', 'crt-debug', 'lzf-better-compression',
+ 'php-build', 'snapshot-template',
+ 'pcre-regex', 'fastcgi', 'force-cgi-redirect',
+ 'path-info-check', 'zts', 'ipv6', 'memory-limit',
+ 'zend-multibyte'
+ );
+ var force;
+
+ // Now set any defaults we might have missed out earlier
+ for (i = 0; i < configure_args.length; i++) {
+ arg = configure_args[i];
+ if (arg.seen)
+ continue;
+ analyzed = analyze_arg(arg.defval);
+ shared = analyzed[0];
+ argval = analyzed[1];
+
+ // Don't trust a default "yes" answer for a non-core module
+ // in a snapshot build
+ if (PHP_SNAPSHOT_BUILD != "no" && argval == "yes" && !shared) {
+
+ force = true;
+ for (j = 0; j < snapshot_build_exclusions.length; j++) {
+ if (snapshot_build_exclusions[j] == arg.optname) {
+ force = false;
+ break;
+ }
+ }
+
+ if (force) {
+ /* now check if it is a core module */
+ force = false;
+ for (j = 0; j < core_module_list.length; j++) {
+ if (core_module_list[j] == arg.optname) {
+ force = true;
+ break;
+ }
+ }
+
+ if (!force) {
+ STDOUT.WriteLine("snapshot: forcing " + arg.arg + " shared");
+ shared = true;
+ }
+ }
+ }
+
+ if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") {
+ force = true;
+ for (j = 0; j < snapshot_build_exclusions.length; j++) {
+ if (snapshot_build_exclusions[j] == arg.optname) {
+ force = false;
+ break;
+ }
+ }
+ if (force) {
+ STDOUT.WriteLine("snapshot: forcing " + arg.optname + " on");
+ argval = "yes";
+ shared = true;
+ }
+ }
+
+ if (disable_all) {
+ force = true;
+ for (j = 0; j < snapshot_build_exclusions.length; j++) {
+ if (snapshot_build_exclusions[j] == arg.optname) {
+ force = false;
+ break;
+ }
+ }
+ if (force) {
+ argval = "no";
+ shared = false;
+ }
+ }
+
+ eval("PHP_" + arg.symval + " = argval;");
+ eval("PHP_" + arg.symval + "_SHARED = shared;");
+ }
+
+ MFO = FSO.CreateTextFile("Makefile.objects", true);
+
+ STDOUT.WriteLine("Saving configure options to config.nice.bat");
+ var nicefile = FSO.CreateTextFile("config.nice.bat", true);
+ nicefile.WriteLine(nice);
+ nicefile.Close();
+
+ AC_DEFINE('CONFIGURE_COMMAND', nice);
+}
+
+function DEFINE(name, value)
+{
+ if (configure_subst.Exists(name)) {
+ configure_subst.Remove(name);
+ }
+ configure_subst.Add(name, value);
+}
+
+// Searches a set of paths for a file;
+// returns the dir in which the file was found,
+// true if it was found in the default env path,
+// or false if it was not found at all.
+// env_name is the optional name of an env var
+// specifying the default path to search
+function search_paths(thing_to_find, explicit_path, env_name)
+{
+ var i, found = false, place = false, file, env;
+
+ STDOUT.Write("Checking for " + thing_to_find + " ... ");
+
+ thing_to_find = thing_to_find.replace(new RegExp("/", "g"), "\\");
+
+ if (explicit_path != null) {
+ if (typeof(explicit_path) == "string") {
+ explicit_path = explicit_path.split(";");
+ }
+
+ for (i = 0; i < explicit_path.length; i++) {
+ file = glob(explicit_path[i] + "\\" + thing_to_find);
+ if (file) {
+ found = true;
+ place = file[0];
+ place = place.substr(0, place.length - thing_to_find.length - 1);
+ break;
+ }
+ }
+ }
+
+ if (!found && env_name != null) {
+ env = WshShell.Environment("Process").Item(env_name);
+ env = env.split(";");
+ for (i = 0; i < env.length; i++) {
+ file = glob(env[i] + "\\" + thing_to_find);
+ if (file) {
+ found = true;
+ place = true;
+ break;
+ }
+ }
+ }
+
+ if (found && place == true) {
+ STDOUT.WriteLine(" <in default path>");
+ } else if (found) {
+ STDOUT.WriteLine(" " + place);
+ } else {
+ STDOUT.WriteLine(" <not found>");
+ }
+ return place;
+}
+
+function PATH_PROG(progname, additional_paths, symbol)
+{
+ var exe;
+ var place;
+ var cyg_path = PHP_CYGWIN + "\\bin;" + PHP_CYGWIN + "\\usr\\local\\bin";
+
+ exe = progname + ".exe";
+
+ if (additional_paths == null) {
+ additional_paths = cyg_path;
+ } else {
+ additional_paths += ";" + cyg_path;
+ }
+
+ place = search_paths(exe, additional_paths, "PATH");
+
+ if (place == true) {
+ place = exe;
+ } else if (place != false) {
+ place = place + "\\" + exe;
+ }
+
+ if (place) {
+ if (symbol == null) {
+ symbol = progname.toUpperCase();
+ }
+ DEFINE(symbol, place);
+ }
+ return place;
+}
+
+function find_pattern_in_path(pattern, path)
+{
+ if (path == null) {
+ return false;
+ }
+
+ var dirs = path.split(';');
+ var i;
+ var items;
+
+ for (i = 0; i < dirs.length; i++) {
+ items = glob(dirs[i] + "\\" + pattern);
+ if (items) {
+ return condense_path(items[0]);
+ }
+ }
+ return false;
+}
+
+function CHECK_LIB(libnames, target, path_to_check, common_name)
+{
+ STDOUT.Write("Checking for library " + libnames + " ... ");
+
+ if (common_name == null && target != null) {
+ common_name = target;
+ }
+
+ if (path_to_check == null) {
+ path_to_check = "";
+ }
+
+ // if they specified a common name for the package that contains
+ // the library, tag some useful defaults on to the end of the
+ // path to be searched
+ if (common_name != null) {
+ path_to_check += ";" + PHP_PHP_BUILD + "\\" + common_name + "*";
+ path_to_check += ";" + PHP_PHP_BUILD + "\\lib\\" + common_name + "*";
+ path_to_check += ";..\\" + common_name + "*";
+ }
+
+ // Determine target for build flags
+ if (target == null) {
+ target = "";
+ } else {
+ target = "_" + target.toUpperCase();
+ }
+
+ // Expand path to include general dirs
+ path_to_check += ";" + php_usual_lib_suspects;
+
+ // It is common practice to put libs under one of these dir names
+ var subdirs = new Array(PHP_DEBUG == "yes" ? "Debug" : "Release", "lib", "libs", "libexec");
+
+ // libnames can be ; separated list of accepted library names
+ libnames = libnames.split(';');
+
+ var i, j, k, libname;
+ var location = false;
+ var path = path_to_check.split(';');
+
+ for (i = 0; i < libnames.length; i++) {
+ libname = libnames[i];
+
+ for (k = 0; k < path.length; k++) {
+ location = glob(path[k] + "\\" + libname);
+ if (location) {
+ location = location[0];
+ break;
+ }
+ for (j = 0; j < subdirs.length; j++) {
+ location = glob(path[k] + "\\" + subdirs[j] + "\\" + libname);
+ if (location) {
+ location = location[0];
+ break;
+ }
+ }
+ if (location)
+ break;
+ }
+
+ if (location) {
+ location = condense_path(location);
+ var libdir = FSO.GetParentFolderName(location);
+ libname = FSO.GetFileName(location);
+ ADD_FLAG("LDFLAGS" + target, '/libpath:"' + libdir + '" ');
+ ADD_FLAG("LIBS" + target, libname);
+
+ STDOUT.WriteLine(location);
+
+ return location;
+ }
+
+ // Check in their standard lib path
+ location = find_pattern_in_path(libname, WshShell.Environment("Process").Item("LIB"));
+
+ if (location) {
+ location = condense_path(location);
+ libname = FSO.GetFileName(location);
+ ADD_FLAG("LIBS" + target, libname);
+
+ STDOUT.WriteLine("<in LIB path> " + libname);
+ return location;
+ }
+
+ // Check in their general extra libs path
+ location = find_pattern_in_path(libname, PHP_EXTRA_LIBS);
+ if (location) {
+ location = condense_path(location);
+ libname = FSO.GetFileName(location);
+ ADD_FLAG("LIBS" + target, libname);
+ STDOUT.WriteLine("<in extra libs path>");
+ return location;
+ }
+ }
+
+ STDOUT.WriteLine("<not found>");
+
+ return false;
+}
+
+function OLD_CHECK_LIB(libnames, target, path_to_check)
+{
+ if (target == null) {
+ target = "";
+ } else {
+ target = "_" + target.toUpperCase();
+ }
+
+ if (path_to_check == null) {
+ path_to_check = php_usual_lib_suspects;
+ } else {
+ path_to_check += ";" + php_usual_lib_suspects;
+ }
+ var have = 0;
+ var p;
+ var i;
+ var libname;
+
+ var subdir = PHP_DEBUG == "yes" ? "Debug" : "Release";
+
+ libnames = libnames.split(';');
+ for (i = 0; i < libnames.length; i++) {
+ libname = libnames[i];
+ p = search_paths(libname, path_to_check, "LIB");
+
+ if (!p) {
+ p = search_paths(subdir + "\\" + libname, path_to_check, "LIB");
+ if (p) {
+ p += "\\" + subdir;
+ }
+ }
+
+ if (typeof(p) == "string") {
+ ADD_FLAG("LDFLAGS" + target, '/libpath:"' + p + '" ');
+ ADD_FLAG("LIBS" + target, libname);
+ have = 1;
+ } else if (p == true) {
+ ADD_FLAG("LIBS" + target, libname);
+ have = 1;
+ } else {
+ /* not found in the defaults or the explicit paths,
+ * so check the general extra libs; if we find
+ * it here, no need to add another /libpath: for it as we
+ * already have it covered, but we need to add the lib
+ * to LIBS_XXX */
+ if (false != search_paths(libname, PHP_EXTRA_LIBS, null)) {
+ ADD_FLAG("LIBS" + target, libname);
+ have = 1;
+ }
+ }
+
+ if (have) {
+ break;
+ }
+ }
+
+// AC_DEFINE("HAVE_" + header_name.toUpperCase().replace(new RegExp("/\\\\-\.", "g"), "_"), have);
+
+ return have;
+
+}
+
+function CHECK_FUNC_IN_HEADER(header_name, func_name, path_to_check, add_to_flag)
+{
+ var c = false;
+ var sym;
+
+ STDOUT.Write("Checking for " + func_name + " in " + header_name + " ... ");
+
+ c = GREP_HEADER(header_name, func_name, path_to_check);
+
+ sym = func_name.toUpperCase();
+ sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_");
+
+ if (typeof(add_to_flag) == "undefined") {
+ AC_DEFINE("HAVE_" + sym, c ? 1 : 0);
+ } else {
+ ADD_FLAG(add_to_flag, "/DHAVE_" + sym + "=" + (c ? "1" : "0"));
+ }
+
+ if (c) {
+ STDOUT.WriteLine("OK");
+ return c;
+ }
+ STDOUT.WriteLine("No");
+ return false;
+}
+
+function GREP_HEADER(header_name, regex, path_to_check)
+{
+ var c = false;
+
+ if (FSO.FileExists(path_to_check + "\\" + header_name)) {
+ c = file_get_contents(path_to_check + "\\" + header_name);
+ }
+
+ if (!c) {
+ /* look in the include path */
+
+ var p = search_paths(header_name, path_to_check, "INCLUDE");
+ if (typeof(p) == "string") {
+ c = file_get_contents(p);
+ } else if (p == false) {
+ p = search_paths(header_name, PHP_EXTRA_INCLUDES, null);
+ if (typeof(p) == "string") {
+ c = file_get_contents(p);
+ }
+ }
+ if (!c) {
+ return false;
+ }
+ }
+
+ if (typeof(regex) == "string") {
+ regex = new RegExp(regex);
+ }
+
+ if (c.match(regex)) {
+ /* caller can now use RegExp.$1 etc. to get at patterns */
+ return true;
+ }
+ return false;
+}
+
+function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env, add_dir_part, add_to_flag_only)
+{
+ var dir_part_to_add = "";
+
+ if (use_env == null) {
+ use_env = true;
+ }
+
+ // if true, add the dir part of the header_name to the include path
+ if (add_dir_part == null) {
+ add_dir_part = false;
+ } else if (add_dir_part) {
+ var basename = FSO.GetFileName(header_name);
+ dir_part_to_add = "\\" + header_name.substr(0, header_name.length - basename.length - 1);
+ }
+
+ if (path_to_check == null) {
+ path_to_check = php_usual_include_suspects;
+ } else {
+ path_to_check += ";" + php_usual_include_suspects;
+ }
+
+ var p = search_paths(header_name, path_to_check, use_env ? "INCLUDE" : null);
+ var have = 0;
+ var sym;
+
+ if (typeof(p) == "string") {
+ ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" ');
+ } else if (p == false) {
+ /* not found in the defaults or the explicit paths,
+ * so check the general extra includes; if we find
+ * it here, no need to add another /I for it as we
+ * already have it covered, unless we are adding
+ * the dir part.... */
+ p = search_paths(header_name, PHP_EXTRA_INCLUDES, null);
+ if (typeof(p) == "string" && add_dir_part) {
+ ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" ');
+ }
+ }
+ have = p ? 1 : 0
+
+ sym = header_name.toUpperCase();
+ sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_");
+
+ if (typeof(add_to_flag_only) != "undefined") {
+ ADD_FLAG(flag_name, "/DHAVE_" + sym + "=" + have);
+ } else {
+ AC_DEFINE("HAVE_" + sym, have);
+ }
+
+ return p;
+}
+
+/* emits rule to generate version info for a SAPI
+ * or extension. Returns the name of the .res file
+ * that will be generated */
+function generate_version_info_resource(makefiletarget, creditspath)
+{
+ var resname = makefiletarget + ".res";
+ var res_desc = "PHP " + makefiletarget;
+ var res_prod_name = res_desc;
+ var credits;
+ var thanks = "";
+ var logo = "";
+
+ if (FSO.FileExists(creditspath + '/CREDITS')) {
+ credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1);
+ res_desc = credits.ReadLine();
+ try {
+ thanks = credits.ReadLine();
+ } catch (e) {
+ thanks = null;
+ }
+ if (thanks == null) {
+ thanks = "";
+ } else {
+ thanks = "Thanks to " + thanks;
+ }
+ credits.Close();
+ }
+
+ if (makefiletarget.match(new RegExp("\\.exe$"))) {
+ logo = " /D WANT_LOGO ";
+ }
+
+ MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");
+ MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo +
+ ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' + makefiletarget +
+ '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d THANKS_GUYS="\\"' +
+ thanks + '\\"" win32\\build\\template.rc');
+ MFO.WriteBlankLines(1);
+
+ return resname;
+}
+
+function SAPI(sapiname, file_list, makefiletarget, cflags)
+{
+ var SAPI = sapiname.toUpperCase();
+ var ldflags;
+ var resname;
+ var ld = "$(LD)";
+
+ STDOUT.WriteLine("Enabling SAPI " + configure_module_dirname);
+
+ MFO.WriteBlankLines(1);
+ MFO.WriteLine("# objects for SAPI " + sapiname);
+ MFO.WriteBlankLines(1);
+
+ if (cflags) {
+ ADD_FLAG('CFLAGS_' + SAPI, cflags);
+ }
+
+ ADD_SOURCES(configure_module_dirname, file_list, sapiname);
+ MFO.WriteBlankLines(1);
+ MFO.WriteLine("# SAPI " + sapiname);
+ MFO.WriteBlankLines(1);
+
+ /* generate a .res file containing version information */
+ resname = generate_version_info_resource(makefiletarget, configure_module_dirname);
+
+ MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
+ MFO.WriteLine("\t@echo SAPI " + configure_module_dirname + " build complete");
+ MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
+
+ if (makefiletarget.match(new RegExp("\\.dll$"))) {
+ ldflags = "/dll $(LDFLAGS)";
+ } else if (makefiletarget.match(new RegExp("\\.lib$"))) {
+ ldflags = "$(LDFLAGS)";
+ ld = "$(MAKE_LIB)";
+ } else {
+ ldflags = "$(LDFLAGS)";
+ }
+
+ MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
+
+ DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')');
+
+ if (configure_module_dirname.match("pecl")) {
+ ADD_FLAG("PECL_TARGETS", makefiletarget);
+ } else {
+ ADD_FLAG("SAPI_TARGETS", makefiletarget);
+ }
+
+ MFO.WriteBlankLines(1);
+}
+
+function ADD_DIST_FILE(filename)
+{
+ if (configure_module_dirname.match("pecl")) {
+ ADD_FLAG("PECL_EXTRA_DIST_FILES", filename);
+ } else {
+ ADD_FLAG("PHP_EXTRA_DIST_FILES", filename);
+ }
+}
+
+function file_get_contents(filename)
+{
+ var f, c;
+ try {
+ f = FSO.OpenTextFile(filename, 1);
+ c = f.ReadAll();
+ f.Close();
+ return c;
+ } catch (e) {
+ STDOUT.WriteLine("Problem reading " + filename);
+ return false;
+ }
+}
+
+// Add a dependency on another extension, so that
+// the dependencies are built before extname
+function ADD_EXTENSION_DEP(extname, dependson, optional)
+{
+ var EXT = extname.toUpperCase();
+ var DEP = dependson.toUpperCase();
+ var dep_present = false;
+ var dep_shared = false;
+
+ try {
+ dep_present = eval("PHP_" + DEP);
+ dep_shared = eval("PHP_" + DEP + "_SHARED");
+ } catch (e) {
+ dep_present = "no";
+ dep_shared = false;
+ }
+
+ if (optional) {
+ if (dep_present == "no")
+ return;
+ }
+
+ var ext_shared = eval("PHP_" + EXT + "_SHARED");
+
+ if (dep_shared) {
+ if (!ext_shared) {
+ if (optional) {
+ return;
+ }
+ ERROR("static " + extname + " cannot depend on shared " + dependson);
+ }
+ ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR)");
+ ADD_FLAG("LIBS_" + EXT, "php_" + dependson + ".lib");
+ ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR)\\php_" + dependson + ".lib");
+ }
+}
+
+function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
+{
+ var objs = null;
+ var EXT = extname.toUpperCase();
+ var extname_for_printing;
+
+ if (shared == null) {
+ eval("shared = PHP_" + EXT + "_SHARED;");
+ }
+ if (cflags == null) {
+ cflags = "";
+ }
+
+ if (typeof(obj_dir) == "undefined") {
+ extname_for_printing = configure_module_dirname;
+ } else {
+ extname_for_printing = configure_module_dirname + " (via " + obj_dir + ")";
+ }
+
+ if (shared) {
+ STDOUT.WriteLine("Enabling extension " + extname_for_printing + " [shared]");
+ cflags = "/D COMPILE_DL_" + EXT + " /D " + EXT + "_EXPORTS=1 " + cflags;
+ ADD_FLAG("CFLAGS_PHP", "/D COMPILE_DL_" + EXT);
+ } else {
+ STDOUT.WriteLine("Enabling extension " + extname_for_printing);
+ }
+
+ MFO.WriteBlankLines(1);
+ MFO.WriteLine("# objects for EXT " + extname);
+ MFO.WriteBlankLines(1);
+
+
+ ADD_SOURCES(configure_module_dirname, file_list, extname, obj_dir);
+
+ MFO.WriteBlankLines(1);
+
+ if (shared) {
+ if (dllname == null) {
+ dllname = "php_" + extname + ".dll";
+ }
+ var libname = dllname.substring(0, dllname.length-4) + ".lib";
+
+ var resname = generate_version_info_resource(dllname, configure_module_dirname);
+ var ld = "$(LD)";
+
+ MFO.WriteLine("$(BUILD_DIR)\\" + dllname + " $(BUILD_DIR)\\" + libname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
+ MFO.WriteLine("\t" + ld + " /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname);
+ MFO.WriteBlankLines(1);
+
+ if (configure_module_dirname.match("pecl")) {
+ ADD_FLAG("PECL_TARGETS", dllname);
+ } else {
+ ADD_FLAG("EXT_TARGETS", dllname);
+ }
+ MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname);
+ MFO.WriteLine("\t@echo EXT " + extname + " build complete");
+ MFO.WriteBlankLines(1);
+
+ DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')');
+ } else {
+ ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)");
+ ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")");
+ ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")");
+ ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")");
+
+ /* find the header that declares the module pointer,
+ * so we can include it in internal_functions.c */
+ var ext_dir = FSO.GetFolder(configure_module_dirname);
+ var fc = new Enumerator(ext_dir.Files);
+ var re = /\.h$/;
+ var s, c;
+ for (; !fc.atEnd(); fc.moveNext()) {
+ s = fc.item() + "";
+ if (s.match(re)) {
+ c = file_get_contents(s);
+ if (c.match("phpext_")) {
+ extension_include_code += '#include "' + configure_module_dirname + '/' + FSO.GetFileName(s) + '"\r\n';
+ }
+ }
+ }
+
+ extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n';
+
+ DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')');
+ }
+ ADD_FLAG("CFLAGS_" + EXT, cflags);
+}
+
+function ADD_SOURCES(dir, file_list, target, obj_dir)
+{
+ var i;
+ var tv;
+ var src, obj, sym, flags;
+
+ if (target == null) {
+ target = "php";
+ }
+
+ sym = target.toUpperCase() + "_GLOBAL_OBJS";
+ flags = "CFLAGS_" + target.toUpperCase() + '_OBJ';
+
+ if (configure_subst.Exists(sym)) {
+ tv = configure_subst.Item(sym);
+ } else {
+ tv = "";
+ }
+
+ file_list = file_list.split(new RegExp("\\s+"));
+ file_list.sort();
+
+ var re = new RegExp("\.[a-z0-9A-Z]+$");
+
+ dir = dir.replace(new RegExp("/", "g"), "\\");
+ var objs_line = "";
+ var srcs_line = "";
+
+ var sub_build = "$(BUILD_DIR)\\";
+
+ /* if module dir is not a child of the main source dir,
+ * we need to tweak it; we should have detected such a
+ * case in condense_path and rewritten the path to
+ * be relative.
+ * This probably breaks for non-sibling dirs, but that
+ * is not a problem as buildconf only checks for pecl
+ * as either a child or a sibling */
+ if (obj_dir == null) {
+ var build_dir = dir.replace(new RegExp("^..\\\\"), "");
+ var mangle_dir = build_dir.replace(new RegExp("[\\\\/.]", "g"), "_");
+ var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase();
+ }
+ else {
+ var build_dir = obj_dir.replace(new RegExp("^..\\\\"), "");
+ var mangle_dir = build_dir.replace(new RegExp("[\\\\/.]", "g"), "_");
+ var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase();
+ }
+
+ var dirs = build_dir.split("\\");
+ var i, d = "";
+ for (i = 0; i < dirs.length; i++) {
+ d += dirs[i];
+ build_dirs[build_dirs.length] = d;
+ d += "\\";
+ }
+ sub_build += d;
+
+
+ DEFINE(bd_flags_name, " /Fd" + sub_build + " /Fp" + sub_build + " /FR" + sub_build + " ");
+
+ for (i in file_list) {
+ src = file_list[i];
+ obj = src.replace(re, ".obj");
+ tv += " " + sub_build + obj;
+
+ if (PHP_ONE_SHOT == "yes") {
+ if (i > 0) {
+ objs_line += " " + sub_build + obj;
+ srcs_line += " " + dir + "\\" + src;
+ } else {
+ objs_line = sub_build + obj;
+ srcs_line = dir + "\\" + src;
+ }
+ } else {
+ MFO.WriteLine(sub_build + obj + ": " + dir + "\\" + src);
+ MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") /c " + dir + "\\" + src + " /Fo" + sub_build + obj);
+ }
+ }
+
+ if (PHP_ONE_SHOT == "yes") {
+ MFO.WriteLine(objs_line + ": " + srcs_line);
+ MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) /Fo" + sub_build + " $(" + bd_flags_name + ") /c " + srcs_line);
+ }
+
+ DEFINE(sym, tv);
+}
+
+function generate_internal_functions()
+{
+ var infile, outfile;
+ var indata;
+
+ STDOUT.WriteLine("Generating main/internal_functions.c");
+
+ infile = FSO.OpenTextFile("main/internal_functions.c.in", 1);
+ indata = infile.ReadAll();
+ infile.Close();
+
+ indata = indata.replace("@EXT_INCLUDE_CODE@", extension_include_code);
+ indata = indata.replace("@EXT_MODULE_PTRS@", extension_module_ptrs);
+
+ if (FSO.FileExists("main/internal_functions.c")) {
+ var origdata = file_get_contents("main/internal_functions.c");
+
+ if (origdata == indata) {
+ STDOUT.WriteLine("\t[content unchanged; skipping]");
+ return;
+ }
+ }
+
+ outfile = FSO.CreateTextFile("main/internal_functions.c", true);
+ outfile.Write(indata);
+ outfile.Close();
+}
+
+function generate_files()
+{
+ var i, dir, bd, last;
+
+ STDOUT.WriteBlankLines(1);
+ STDOUT.WriteLine("Creating build dirs...");
+ dir = get_define("BUILD_DIR");
+ build_dirs.sort();
+ last = null;
+
+ if (!FSO.FolderExists(dir)) {
+ FSO.CreateFolder(dir);
+ }
+
+ for (i = 0; i < build_dirs.length; i++) {
+ bd = FSO.BuildPath(dir, build_dirs[i]);
+ if (bd == last) {
+ continue;
+ }
+ last = bd;
+ ADD_FLAG("BUILD_DIRS_SUB", bd);
+ if (!FSO.FolderExists(bd)) {
+ FSO.CreateFolder(bd);
+ }
+ }
+
+ STDOUT.WriteLine("Generating files...");
+ generate_makefile();
+ generate_internal_functions();
+ generate_config_h();
+
+
+ STDOUT.WriteLine("Done.");
+ STDOUT.WriteBlankLines(1);
+ if (PHP_SNAPSHOT_BUILD != "no") {
+ STDOUT.WriteLine("Type 'nmake snap' to build a PHP snapshot");
+ } else {
+ STDOUT.WriteLine("Type 'nmake' to build PHP");
+ }
+}
+
+function generate_config_h()
+{
+ var infile, outfile;
+ var indata;
+ var prefix;
+
+ prefix = PHP_PREFIX.replace(new RegExp("\\\\", "g"), "\\\\");
+
+ STDOUT.WriteLine("Generating main/config.w32.h");
+
+ infile = FSO.OpenTextFile("win32/build/config.w32.h.in", 1);
+ indata = infile.ReadAll();
+ infile.Close();
+
+ outfile = FSO.CreateTextFile("main/config.w32.h", true);
+
+ indata = indata.replace(new RegExp("@PREFIX@", "g"), prefix);
+ outfile.Write(indata);
+
+ var keys = (new VBArray(configure_hdr.Keys())).toArray();
+ var i, j;
+ var item;
+ var pieces, stuff_to_crack, chunk;
+
+ outfile.WriteBlankLines(1);
+ outfile.WriteLine("/* values determined by configure.js */");
+
+ for (i in keys) {
+ item = configure_hdr.Item(keys[i]);
+ outfile.WriteBlankLines(1);
+ outfile.WriteLine("/* " + item[1] + " */");
+ pieces = item[0];
+
+ if (typeof(pieces) == "string" && pieces.charCodeAt(0) == 34) {
+ /* quoted string have a maximal length of 2k under vc.
+ * solution is to crack them and let the compiler concat
+ * them implicitly */
+ stuff_to_crack = pieces;
+ pieces = "";
+
+ while (stuff_to_crack.length) {
+ j = 65;
+ while (stuff_to_crack.charCodeAt(j) != 32 && j < stuff_to_crack.length)
+ j++;
+
+ chunk = stuff_to_crack.substr(0, j);
+ pieces += chunk;
+ stuff_to_crack = stuff_to_crack.substr(chunk.length);
+ if (stuff_to_crack.length)
+ pieces += '" "';
+ }
+ }
+
+ outfile.WriteLine("#define " + keys[i] + " " + pieces);
+ }
+
+ outfile.Close();
+}
+
+function generate_makefile()
+{
+ STDOUT.WriteLine("Generating Makefile");
+ var MF = FSO.CreateTextFile("Makefile", true);
+
+ MF.WriteLine("# Generated by configure.js");
+
+ /* spit out variable definitions */
+ var keys = (new VBArray(configure_subst.Keys())).toArray();
+ var i;
+
+ for (i in keys) {
+ // The trailing space is needed to prevent the trailing backslash
+ // that is part of the build dir flags (CFLAGS_BD_XXX) from being
+ // seen as a line continuation character
+ MF.WriteLine(keys[i] + "=" +
+ //word_wrap_and_indent(1, configure_subst.Item(keys[i]), ' \\', '\t') + " "
+ configure_subst.Item(keys[i]) + " "
+ );
+ MF.WriteBlankLines(1);
+ }
+
+ MF.WriteBlankLines(1);
+
+ var TF = FSO.OpenTextFile("win32/build/Makefile", 1);
+ MF.Write(TF.ReadAll());
+ TF.Close();
+
+ MF.WriteBlankLines(2);
+
+ MFO.Close();
+ TF = FSO.OpenTextFile("Makefile.objects", 1);
+ MF.Write(TF.ReadAll());
+ TF.Close();
+
+ MF.Close();
+}
+
+function ADD_FLAG(name, flags, target)
+{
+ if (target != null) {
+ name = target.toUpperCase() + "_" + name;
+ }
+ if (configure_subst.Exists(name)) {
+ var curr_flags = configure_subst.Item(name);
+
+ if (curr_flags.indexOf(flags) >= 0) {
+ return;
+ }
+
+ flags = curr_flags + " " + flags;
+ configure_subst.Remove(name);
+ }
+ configure_subst.Add(name, flags);
+}
+
+function get_define(name)
+{
+ return configure_subst.Item(name);
+}
+
+// Add a .def to the core to export symbols
+function ADD_DEF_FILE(name)
+{
+ if (!configure_subst.Exists("PHPDEF")) {
+ DEFINE("PHPDEF", "$(BUILD_DIR)\\$(PHPDLL).def");
+ ADD_FLAG("PHP_LDFLAGS", "/def:$(PHPDEF)");
+ }
+ ADD_FLAG("PHP_DLL_DEF_SOURCES", name);
+}
+
+function AC_DEFINE(name, value, comment, quote)
+{
+ if (quote == null) {
+ quote = true;
+ }
+ if (quote && typeof(value) == "string") {
+ value = '"' + value.replace(new RegExp('(["\\\\])', "g"), '\\$1') + '"';
+ } else if (value.length == 0) {
+ value = '""';
+ }
+ var item = new Array(value, comment);
+ if (configure_hdr.Exists(name)) {
+ var orig_item = configure_hdr.Item(name);
+ STDOUT.WriteLine("AC_DEFINE[" + name + "]=" + value + ": is already defined to " + item[0]);
+ } else {
+ configure_hdr.Add(name, item);
+ }
+}
+
+function ERROR(msg)
+{
+ STDERR.WriteLine("ERROR: " + msg);
+ WScript.Quit(3);
+}
+
+function WARNING(msg)
+{
+ STDERR.WriteLine("WARNING: " + msg);
+ STDERR.WriteBlankLines(1);
+}
+
+function copy_and_subst(srcname, destname, subst_array)
+{
+ if (!FSO.FileExists(srcname)) {
+ srcname = configure_module_dirname + "\\" + srcname;
+ destname = configure_module_dirname + "\\" + destname;
+ }
+
+ var content = file_get_contents(srcname);
+ var i;
+
+ for (i = 0; i < subst_array.length; i+=2) {
+ var re = subst_array[i];
+ var rep = subst_array[i+1];
+
+ content = content.replace(re, rep);
+ }
+
+ var f = FSO.CreateTextFile(destname, true);
+ f.Write(content);
+ f.Close();
+}
+
+// glob using simple filename wildcards
+// returns an array of matches that are found
+// in the filesystem
+function glob(path_pattern)
+{
+ var path_parts = path_pattern.replace(new RegExp("/", "g"), "\\").split("\\");
+ var p;
+ var base = "";
+ var is_pat_re = /\*/;
+
+//STDOUT.WriteLine("glob: " + path_pattern);
+
+ if (FSO.FileExists(path_pattern)) {
+ return new Array(path_pattern);
+ }
+
+ // first, build as much as possible that doesn't have a pattern
+ for (p = 0; p < path_parts.length; p++) {
+ if (path_parts[p].match(is_pat_re))
+ break;
+ if (p)
+ base += "\\";
+ base += path_parts[p];
+ }
+
+ return _inner_glob(base, p, path_parts);
+}
+
+function _inner_glob(base, p, parts)
+{
+ var pat = parts[p];
+ var full_name = base + "\\" + pat;
+ var re = null;
+ var items = null;
+
+ if (p == parts.length) {
+ return false;
+ }
+
+//STDOUT.WriteLine("inner: base=" + base + " p=" + p + " pat=" + pat);
+
+ if (FSO.FileExists(full_name)) {
+ if (p < parts.length - 1) {
+ // we didn't reach the full extent of the pattern
+ return false;
+ }
+ return new Array(full_name);
+ }
+
+ if (FSO.FolderExists(full_name) && p == parts.length - 1) {
+ // we have reached the end of the pattern; no need to recurse
+ return new Array(full_name);
+ }
+
+ // Convert the pattern into a regexp
+ re = new RegExp("^" + pat.replace(/\./g, '\\.').replace(/\*/g, '.*').replace(/\?/g, '.') + "$", "i");
+
+ items = new Array();
+
+ if (!FSO.FolderExists(base)) {
+ return false;
+ }
+
+ var folder = FSO.GetFolder(base);
+ var fc = null;
+ var subitems = null;
+ var item_name = null;
+ var j;
+
+ fc = new Enumerator(folder.SubFolders);
+ for (; !fc.atEnd(); fc.moveNext()) {
+ item_name = FSO.GetFileName(fc.item());
+
+ if (item_name.match(re)) {
+ // got a match; if we are at the end of the pattern, just add these
+ // things to the items array
+ if (p == parts.length - 1) {
+ items[items.length] = fc.item();
+ } else {
+ // we should recurse and do more matches
+ subitems = _inner_glob(base + "\\" + item_name, p + 1, parts);
+ if (subitems) {
+ for (j = 0; j < subitems.length; j++) {
+ items[items.length] = subitems[j];
+ }
+ }
+ }
+ }
+ }
+
+ // if we are at the end of the pattern, we should match
+ // files too
+ if (p == parts.length - 1) {
+ fc = new Enumerator(folder.Files);
+ for (; !fc.atEnd(); fc.moveNext()) {
+ item_name = FSO.GetFileName(fc.item());
+ if (item_name.match(re)) {
+ items[items.length] = fc.item();
+ }
+ }
+ }
+
+ if (items.length == 0)
+ return false;
+
+ return items;
+}
+
+
+// for snapshot builders, this option will attempt to enable everything
+// and you can then build everything, ignoring fatal errors within a module
+// by running "nmake snap"
+PHP_SNAPSHOT_BUILD = "no";
+ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no');
+
+// one-shot build optimizes build by asking compiler to build
+// several objects at once, reducing overhead of starting new
+// compiler processes.
+ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot builders, not so hot for edit-and-rebuild hacking', 'no');
+
+
diff --git a/win32/build/cvsclean.js b/win32/build/cvsclean.js
new file mode 100644
index 000000000..63bea9133
--- /dev/null
+++ b/win32/build/cvsclean.js
@@ -0,0 +1,120 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@thebrainroom.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: cvsclean.js,v 1.4 2004/04/08 19:08:37 fmk Exp $ */
+// Cleans up files that do not belong in CVS
+
+var FSO = WScript.CreateObject("Scripting.FileSystemObject");
+
+function find_cvsignore(dirname)
+{
+ if (!FSO.FolderExists(dirname))
+ return;
+
+ var f = FSO.GetFolder(dirname);
+ var fc = new Enumerator(f.SubFolders);
+
+ for (; !fc.atEnd(); fc.moveNext()) {
+ find_cvsignore(fc.item());
+ }
+
+ if (FSO.FileExists(dirname + "\\.cvsignore")) {
+ kill_from_cvsignore(dirname + "\\.cvsignore");
+ }
+}
+
+/* recursive remove using cvsignore style wildcard matching;
+ * note that FSO.DeleteFolder and FSO.DeleteFile methods both
+ * accept wildcards, but that they are dangerous to use eg:
+ * "*.php" will match "*.phpt" */
+function rm_r(filename)
+{
+ if (FSO.FolderExists(filename)) {
+ var fc = new Enumerator(FSO.GetFolder(filename).SubFolders);
+
+ for (; !fc.atEnd(); fc.moveNext()) {
+ rm_r(fc.item());
+ }
+
+ fc = new Enumerator(FSO.GetFolder(filename).Files);
+
+ for (; !fc.atEnd(); fc.moveNext()) {
+ FSO.DeleteFile(fc.item(), true);
+ }
+
+ FSO.DeleteFolder(filename, true);
+ } else if (FSO.FileExists(filename)) {
+ FSO.DeleteFile(filename, true);
+ } else {
+ /* we need to handle wildcards here */
+ var foldername = FSO.GetParentFolderName(filename);
+
+ if (foldername == "")
+ foldername = ".";
+
+ var filename = FSO.GetFileName(filename);
+
+ var retext = filename.replace(/\./g, '\\.');
+ retext = '^' + retext.replace(/\*/g, '.*') + "$";
+ var re = new RegExp(retext);
+
+ var folder = FSO.GetFolder(foldername);
+ var fc = new Enumerator(folder.SubFolders);
+ for (; !fc.atEnd(); fc.moveNext()) {
+
+ var item = FSO.GetFileName(fc.item());
+
+ if (item.match(re)) {
+ rm_r(fc.item());
+ }
+ }
+ var fc = new Enumerator(folder.Files);
+ for (; !fc.atEnd(); fc.moveNext()) {
+ item = FSO.GetFileName(fc.item());
+
+ if (item.match(re)) {
+ FSO.DeleteFile(fc.item(), true);
+ }
+ }
+ }
+}
+
+function kill_from_cvsignore(igfile)
+{
+ var dir = FSO.GetParentFolderName(igfile) + "\\";
+ var t = FSO.OpenTextFile(igfile, 1);
+ var l;
+
+ if (dir == ".\\") {
+ dir = "";
+ }
+
+ while (!t.atEndOfStream) {
+ l = t.ReadLine();
+ // don't kill their config.nice file(s)
+ if (l.match("config\.nice.*") ||
+ l.match("") ||
+ l.match("*"))
+ continue;
+ rm_r(dir + l);
+ }
+
+}
+
+find_cvsignore(".");
+
diff --git a/win32/build/deplister.c b/win32/build/deplister.c
new file mode 100644
index 000000000..d6e7be65c
--- /dev/null
+++ b/win32/build/deplister.c
@@ -0,0 +1,60 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@thebrainroom.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: deplister.c,v 1.2 2004/01/08 08:18:22 andi Exp $ */
+
+/* This little application will list the DLL dependencies for a PE
+ * module to it's stdout for use by distro/installer building tools */
+
+#include <windows.h>
+#include <imagehlp.h>
+
+BOOL CALLBACK StatusRoutine(IMAGEHLP_STATUS_REASON reason,
+ PSTR image_name, PSTR dll_name,
+ ULONG va, ULONG param)
+{
+ switch (reason) {
+ case BindImportModuleFailed:
+ printf("%s,NOTFOUND\n", dll_name);
+ return TRUE;
+
+ case BindImportModule:
+ printf("%s,OK\n", dll_name);
+ return TRUE;
+ }
+ return TRUE;
+}
+
+/* usage:
+ * deplister.exe path\to\module.exe path\to\symbols\root
+ * */
+
+int main(int argc, char *argv[])
+{
+ return BindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES,
+ argv[1], NULL, argv[2], StatusRoutine);
+}
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php
new file mode 100644
index 000000000..21f4e6c5e
--- /dev/null
+++ b/win32/build/mkdist.php
@@ -0,0 +1,409 @@
+<?php # $Id: mkdist.php,v 1.10.2.1 2005/02/26 00:38:27 edink Exp $
+/* piece together a windows binary distro */
+
+$build_dir = $argv[1];
+$phpdll = $argv[2];
+$sapi_targets = explode(" ", $argv[3]);
+$ext_targets = explode(" ", $argv[4]);
+$pecl_targets = explode(" ", $argv[5]);
+$snapshot_template = $argv[6];
+
+$is_debug = preg_match("/^debug/i", $build_dir);
+
+echo "Making dist for $build_dir\n";
+
+$dist_dir = $build_dir . "/php-" . phpversion();
+$pecl_dir = $build_dir . "/pecl-" . phpversion();
+
+@mkdir($dist_dir);
+@mkdir("$dist_dir/ext");
+@mkdir("$dist_dir/dev");
+@mkdir("$dist_dir/extras");
+@mkdir($pecl_dir);
+
+/* figure out additional DLL's that are required */
+$extra_dll_deps = array();
+$per_module_deps = array();
+$pecl_dll_deps = array();
+
+function get_depends($module)
+{
+ static $no_dist = array(
+ /* windows system dlls that should not be bundled */
+ 'advapi32.dll', 'comdlg32.dll', 'gdi32.dll', 'kernel32.dll', 'ntdll.dll',
+ 'odbc32.dll', 'ole32.dll', 'oleaut32.dll', 'rpcrt4.dll',
+ 'shell32.dll', 'shlwapi.dll', 'user32.dll', 'ws2_32.dll', 'ws2help.dll',
+ 'comctl32.dll', 'winmm.dll', 'wsock32.dll', 'winspool.drv', 'msasn1.dll',
+ 'secur32.dll', 'netapi32.dll',
+
+ /* apache */
+ 'apachecore.dll',
+
+ /* apache 2 */
+ 'libhttpd.dll', 'libapr.dll', 'libaprutil.dll',
+
+ /* pi3web */
+ 'piapi.dll', 'pi3api.dll',
+
+ /* nsapi */
+ 'ns-httpd30.dll', 'ns-httpd35.dll', 'ns-httpd36.dll', 'ns-httpd40.dll',
+
+ /* oracle */
+ 'oci.dll', 'ociw32.dll',
+
+ /* sybase */
+ 'libcs.dll', 'libct.dll',
+
+ /* visual C++; mscvrt.dll is present on everyones system,
+ * but the debug version (msvcrtd.dll) and those from visual studio.net
+ * (msvcrt7x.dll) are not */
+ 'msvcrt.dll',
+
+ );
+ global $build_dir, $extra_dll_deps, $ext_targets, $sapi_targets, $pecl_targets, $phpdll, $per_module_deps, $pecl_dll_deps;
+
+ $bd = strtolower(realpath($build_dir));
+
+ $is_pecl = in_array($module, $pecl_targets);
+
+ $cmd = "$GLOBALS[build_dir]\\deplister.exe \"$module\" \"$GLOBALS[build_dir]\"";
+ $proc = proc_open($cmd,
+ array(1 => array("pipe", "w")),
+ $pipes);
+
+ $n = 0;
+ while (($line = fgetcsv($pipes[1]))) {
+ $n++;
+
+ $dep = strtolower($line[0]);
+ $depbase = basename($dep);
+ /* ignore stuff in our build dir, but only if it is
+ * one of our targets */
+ if (((in_array($depbase, $sapi_targets) ||
+ in_array($depbase, $ext_targets) || in_array($depbase, $pecl_targets)) ||
+ $depbase == $phpdll) && file_exists($GLOBALS['build_dir'] . "/$depbase")) {
+ continue;
+ }
+ /* ignore some well-known system dlls */
+ if (in_array(basename($dep), $no_dist)) {
+ continue;
+ }
+
+ if ($is_pecl) {
+ if (!in_array($dep, $pecl_dll_deps)) {
+ $pecl_dll_deps[] = $dep;
+ }
+ } else {
+ if (!in_array($dep, $extra_dll_deps)) {
+ $extra_dll_deps[] = $dep;
+ }
+ }
+
+ $per_module_deps[basename($module)][] = $dep;
+ }
+ fclose($pipes[1]);
+ proc_close($proc);
+//echo "Module $module [$n lines]\n";
+}
+
+function copy_file_list($source_dir, $dest_dir, $list)
+{
+ global $is_debug, $dist_dir;
+
+ foreach ($list as $item) {
+ echo "Copying $item from $source_dir to $dest_dir\n";
+ copy($source_dir . DIRECTORY_SEPARATOR . $item, $dest_dir . DIRECTORY_SEPARATOR . $item);
+ if ($is_debug) {
+ $itemdb = preg_replace("/\.(exe|dll|lib)$/i", ".pdb", $item);
+ if (file_exists("$source_dir/$itemdb")) {
+ copy("$source_dir/$itemdb", "$dist_dir/dev/$itemdb");
+ }
+ }
+ if (preg_match("/\.(exe|dll)$/i", $item)) {
+ get_depends($source_dir . '/' . $item);
+ }
+ }
+}
+
+function copy_text_file($source, $dest)
+{
+ $text = file_get_contents($source);
+ $text = preg_replace("/(\r\n?)|\n/", "\r\n", $text);
+ $fp = fopen($dest, "w");
+ fwrite($fp, $text);
+ fclose($fp);
+}
+
+/* very light-weight function to extract a single named file from
+ * a gzipped tarball. This makes assumptions about the files
+ * based on the PEAR info set in $packages. */
+function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */
+{
+ global $packages;
+
+ $name = $pkg . '-' . $packages[$pkg];
+ $tarball = $dest_dir . "/" . $name . '.tgz';
+ $filename = $name . '/' . $filename;
+ $destfilename = $dest_dir . "/" . basename($filename);
+
+ $fp = gzopen($tarball, 'rb');
+
+ $done = false;
+ do {
+ /* read the header */
+ $hdr_data = gzread($fp, 512);
+ if (strlen($hdr_data) == 0)
+ break;
+ $checksum = 0;
+ for ($i = 0; $i < 148; $i++)
+ $checksum += ord($hdr_data{$i});
+ for ($i = 148; $i < 156; $i++)
+ $checksum += 32;
+ for ($i = 156; $i < 512; $i++)
+ $checksum += ord($hdr_data{$i});
+
+ $hdr = unpack("a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor", $hdr_data);
+
+ $hdr['checksum'] = octdec(trim($hdr['checksum']));
+
+ if ($hdr['checksum'] != $checksum) {
+ echo "Checksum for $tarball $hdr[filename] is invalid\n";
+ print_r($hdr);
+ return;
+ }
+
+ $hdr['size'] = octdec(trim($hdr['size']));
+ echo "File: $hdr[filename] $hdr[size]\n";
+
+ if ($filename == $hdr['filename']) {
+ echo "Found the file we want\n";
+ $dest = fopen($destfilename, 'wb');
+ $x = stream_copy_to_stream($fp, $dest, $hdr['size']);
+ fclose($dest);
+ echo "Wrote $x bytes into $destfilename\n";
+ break;
+ }
+
+ /* skip body of the file */
+ $size = 512 * ceil((int)$hdr['size'] / 512);
+ echo "Skipping $size bytes\n";
+ gzseek($fp, gztell($fp) + $size);
+
+ } while (!$done);
+
+} /* }}} */
+
+
+/* the core dll */
+copy("$build_dir/php.exe", "$dist_dir/php.exe");
+copy("$build_dir/$phpdll", "$dist_dir/$phpdll");
+
+/* and the .lib goes into dev */
+$phplib = str_replace(".dll", ".lib", $phpdll);
+copy("$build_dir/$phplib", "$dist_dir/dev/$phplib");
+/* debug builds; copy the symbols too */
+if ($is_debug) {
+ $phppdb = str_replace(".dll", ".pdb", $phpdll);
+ copy("$build_dir/$phppdb", "$dist_dir/dev/$phppdb");
+}
+/* copy the sapi */
+copy_file_list($build_dir, "$dist_dir", $sapi_targets);
+
+/* copy the extensions */
+copy_file_list($build_dir, "$dist_dir/ext", $ext_targets);
+
+/* pecl sapi and extensions */
+copy_file_list($build_dir, $pecl_dir, $pecl_targets);
+
+/* populate reading material */
+$text_files = array(
+ "LICENSE" => "license.txt",
+ "NEWS" => "news.txt",
+ "php.ini-dist" => "php.ini-dist",
+ "php.ini-recommended" => "php.ini-recommended",
+ "win32/install.txt" => "install.txt",
+ "win32/pws-php5cgi.reg" => "pws-php5cgi.reg",
+ "win32/pws-php5isapi.reg" => "pws-php5isapi.reg",
+);
+
+foreach ($text_files as $src => $dest) {
+ copy_text_file($src, $dist_dir . '/' . $dest);
+}
+
+/* general other files */
+$general_files = array(
+ "php.gif" => "php.gif",
+);
+
+foreach ($general_files as $src => $dest) {
+ copy($src, $dist_dir . '/' . $dest);
+}
+
+/* include a snapshot identifier */
+$branch = "HEAD"; // TODO - determine this from CVS/Entries
+$fp = fopen("$dist_dir/snapshot.txt", "w");
+$now = date("r");
+$version = phpversion();
+fwrite($fp, <<<EOT
+This snapshot was automatically generated on
+$now
+
+Version: $version
+Branch: $branch
+Build: $build_dir
+
+EOT
+);
+/* list build-in extensions */
+$exts = get_loaded_extensions();
+fprintf($fp, "\r\nBuilt-in Extensions\r\n");
+fwrite($fp, "===========================\r\n");
+foreach ($exts as $ext) {
+ fprintf($fp, "%s\r\n", $ext);
+}
+fwrite($fp, "\r\n\r\n");
+
+/* list dependencies */
+fprintf($fp, "Dependency information:\r\n");
+foreach ($per_module_deps as $modulename => $deps) {
+ if (in_array($modulename, $pecl_targets))
+ continue;
+
+ fprintf($fp, "Module: %s\r\n", $modulename);
+ fwrite($fp, "===========================\r\n");
+ foreach ($deps as $dll) {
+ fprintf($fp, "\t%s\r\n", basename($dll));
+ }
+ fwrite($fp, "\r\n");
+}
+fclose($fp);
+
+/* Now add those dependencies */
+foreach ($extra_dll_deps as $dll) {
+ if (!file_exists($dll)) {
+ /* try template dir */
+ $tdll = $snapshot_template . "/dlls/" . basename($dll);
+ if (!file_exists($tdll)) {
+ echo "WARNING: distro depends on $dll, but could not find it on your system\n";
+ continue;
+ }
+ $dll = $tdll;
+ }
+ copy($dll, "$dist_dir/" . basename($dll));
+}
+/* and those for pecl */
+foreach ($pecl_dll_deps as $dll) {
+ if (in_array($dll, $extra_dll_deps)) {
+ /* already in main distro */
+ continue;
+ }
+ if (!file_exists($dll)) {
+ /* try template dir */
+ $tdll = $snapshot_template . "/dlls/" . basename($dll);
+ if (!file_exists($tdll)) {
+ echo "WARNING: distro depends on $dll, but could not find it on your system\n";
+ continue;
+ }
+ $dll = $tdll;
+ }
+ copy($dll, "$pecl_dir/" . basename($dll));
+}
+
+function copy_dir($source, $dest)
+{
+ if (!is_dir($dest)) {
+ if (!mkdir($dest)) {
+ return false;
+ }
+ }
+
+ $d = opendir($source);
+ while (($f = readdir($d)) !== false) {
+ if ($f == '.' || $f == '..' || $f == 'CVS') {
+ continue;
+ }
+ $fs = $source . '/' . $f;
+ $fd = $dest . '/' . $f;
+ if (is_dir($fs)) {
+ copy_dir($fs, $fd);
+ } else {
+ copy($fs, $fd);
+ }
+ }
+ closedir($d);
+}
+
+/* change this next line to true to use good-old
+ * hand-assembled go-pear-bundle from the snapshot template */
+$use_pear_template = true;
+
+if (!$use_pear_template) {
+ /* Let's do a PEAR-less pear setup */
+ mkdir("$dist_dir/PEAR");
+ mkdir("$dist_dir/PEAR/go-pear-bundle");
+
+ /* grab the bootstrap script */
+ echo "Downloading go-pear\n";
+ copy("http://go-pear.org/", "$dist_dir/PEAR/go-pear.php");
+
+ /* import the package list -- sets $packages variable */
+ include "pear/go-pear-list.php";
+
+ /* download the packages into the destination */
+ echo "Fetching packages\n";
+
+ foreach ($packages as $name => $version) {
+ $filename = "$name-$version.tgz";
+ $destfilename = "$dist_dir/PEAR/go-pear-bundle/$filename";
+ if (file_exists($destfilename))
+ continue;
+ $url = "http://pear.php.net/get/$filename";
+ echo "Downloading $name from $url\n";
+ flush();
+ copy($url, $destfilename);
+ }
+
+ echo "Download complete. Extracting bootstrap files\n";
+
+ /* Now, we want PEAR.php, Getopt.php (Console_Getopt) and Tar.php (Archive_Tar)
+ * broken out of the tarballs */
+ extract_file_from_tarball('PEAR', 'PEAR.php', "$dist_dir/PEAR/go-pear-bundle");
+ extract_file_from_tarball('Archive_Tar', 'Archive/Tar.php', "$dist_dir/PEAR/go-pear-bundle");
+ extract_file_from_tarball('Console_Getopt', 'Console/Getopt.php', "$dist_dir/PEAR/go-pear-bundle");
+}
+
+/* add extras from the template dir */
+if (file_exists($snapshot_template)) {
+ $items = glob("$snapshot_template/*");
+ print_r($items);
+
+ foreach ($items as $item) {
+ $bi = basename($item);
+ if (is_dir($item)) {
+ if ($bi == 'dlls' || $bi == 'symbols') {
+ continue;
+ } else if ($bi == 'PEAR') {
+ if ($use_pear_template) {
+ /* copy to top level */
+ copy_dir($item, "$dist_dir/$bi");
+ }
+ } else {
+ /* copy that dir into extras */
+ copy_dir($item, "$dist_dir/extras/$bi");
+ }
+ } else {
+ if ($bi == 'go-pear.bat') {
+ /* copy to top level */
+ copy($item, "$dist_dir/$bi");
+ } else {
+ /* copy to extras */
+ copy($item, "$dist_dir/extras/$bi");
+ }
+ }
+ }
+} else {
+ echo "WARNING: you don't have a snapshot template\n";
+ echo " your dist will not be complete\n";
+}
+
+?>
diff --git a/win32/build/php.ico b/win32/build/php.ico
new file mode 100644
index 000000000..43bf0027d
--- /dev/null
+++ b/win32/build/php.ico
Binary files differ
diff --git a/win32/build/template.rc b/win32/build/template.rc
new file mode 100644
index 000000000..6230e7390
--- /dev/null
+++ b/win32/build/template.rc
@@ -0,0 +1,64 @@
+/* This is a template RC file.
+ * $Id: template.rc,v 1.5 2004/01/08 10:58:27 wez Exp $
+ * Do not edit with MSVC */
+#ifdef APSTUDIO_INVOKED
+# error dont edit with MSVC
+#endif
+
+#include "winres.h"
+#include "main/php_version.h"
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+
+#ifndef THANKS_GUYS
+# define THANKS_GUYS ""
+#endif
+
+#ifdef WANT_LOGO
+0 ICON win32\build\php.ico
+#endif
+
+#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build
+#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel
+#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build)
+#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel)
+
+//Version
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION
+ PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", THANKS_GUYS "\0"
+ VALUE "CompanyName", "The PHP Group\0"
+ VALUE "FileDescription", FILE_DESCRIPTION "\0"
+ VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION)
+ VALUE "InternalName", FILE_NAME "\0"
+ VALUE "LegalCopyright", "Copyright © 1997-2004 The PHP Group\0"
+ VALUE "LegalTrademarks", "PHP\0"
+ VALUE "OriginalFilename", FILE_NAME "\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", PRODUCT_NAME "\0"
+ VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION)
+ VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0"
+ VALUE "URL", "http://www.php.net"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
diff --git a/win32/builddef.bat b/win32/builddef.bat
new file mode 100644
index 000000000..09c1adc8e
--- /dev/null
+++ b/win32/builddef.bat
@@ -0,0 +1,7 @@
+@echo off
+rem Generate phpts.def file, which exports symbols from our dll that
+rem are present in some of the libraries which are compiled statically
+rem into PHP
+rem $Id: builddef.bat,v 1.4 2003/12/08 12:56:47 rrichards Exp $
+type ..\ext\sqlite\php_sqlite.def
+type ..\ext\libxml\php_libxml2.def
diff --git a/win32/crypt_win32.c b/win32/crypt_win32.c
new file mode 100644
index 000000000..e2c796032
--- /dev/null
+++ b/win32/crypt_win32.c
@@ -0,0 +1,355 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: crypt_win32.c,v 1.7 2004/01/08 08:18:21 andi Exp $ */
+
+/* This code is distributed under the PHP license with permission from
+ the author Jochen Obalek <jochen.obalek@bigfoot.de> */
+
+/* encrypt.c - providing 56 bit DES encryption
+ Copyright (C) 1991 Jochen Obalek
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ 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 the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <time.h>
+#include <string.h>
+#include <stdlib.h>
+#include "md5crypt.h"
+
+#define BS 64
+#define BS2 32
+#define KS 48
+#define KS2 24
+#define IS 56
+#define IS2 28
+
+static char schluessel[16][KS];
+
+
+static char PC1[] =
+{
+ 56, 48, 40, 32, 24, 16, 8, 0,
+ 57, 49, 41, 33, 25, 17, 9, 1,
+ 58, 50, 42, 34, 26, 18, 10, 2,
+ 59, 51, 43, 35,
+ 62, 54, 46, 38, 30, 22, 14, 6,
+ 61, 53, 45, 37, 29, 21, 13, 5,
+ 60, 52, 44, 36, 28, 20, 12, 4,
+ 27, 19, 11, 3
+};
+
+
+static char PC2[] =
+{
+ 13, 16, 10, 23, 0, 4, 2, 27,
+ 14, 5, 20, 9, 22, 18, 11, 3,
+ 25, 7, 15, 6, 26, 19, 12, 1,
+ 40, 51, 30, 36, 46, 54, 29, 39,
+ 50, 44, 32, 47, 43, 48, 38, 55,
+ 33, 52, 45, 41, 49, 35, 28, 31
+};
+
+
+static char IP[] =
+{
+ 57, 49, 41, 33, 25, 17, 9, 1,
+ 59, 51, 43, 35, 27, 19, 11, 3,
+ 61, 53, 45, 37, 29, 21, 13, 5,
+ 63, 55, 47, 39, 31, 23, 15, 7,
+ 56, 48, 40, 32, 24, 16, 8, 0,
+ 58, 50, 42, 34, 26, 18, 10, 2,
+ 60, 52, 44, 36, 28, 20, 12, 4,
+ 62, 54, 46, 38, 30, 22, 14, 6
+};
+
+
+static char EP[] =
+{
+ 7, 39, 15, 47, 23, 55, 31, 63,
+ 6, 38, 14, 46, 22, 54, 30, 62,
+ 5, 37, 13, 45, 21, 53, 29, 61,
+ 4, 36, 12, 44, 20, 52, 28, 60,
+ 3, 35, 11, 43, 19, 51, 27, 59,
+ 2, 34, 10, 42, 18, 50, 26, 58,
+ 1, 33, 9, 41, 17, 49, 25, 57,
+ 0, 32, 8, 40, 16, 48, 24, 56
+};
+
+
+static char E0[] =
+{
+ 31, 0, 1, 2, 3, 4, 3, 4,
+ 5, 6, 7, 8, 7, 8, 9, 10,
+ 11, 12, 11, 12, 13, 14, 15, 16,
+ 15, 16, 17, 18, 19, 20, 19, 20,
+ 21, 22, 23, 24, 23, 24, 25, 26,
+ 27, 28, 27, 28, 29, 30, 31, 0
+};
+
+
+static char E[KS];
+
+
+static char PERM[] =
+{
+ 15, 6, 19, 20, 28, 11, 27, 16,
+ 0, 14, 22, 25, 4, 17, 30, 9,
+ 1, 7, 23, 13, 31, 26, 2, 8,
+ 18, 12, 29, 5, 21, 10, 3, 24
+};
+
+
+static char S_BOX[][64] =
+{
+ {
+ 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,
+ 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,
+ 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,
+ 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13
+ },
+ {
+ 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,
+ 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,
+ 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,
+ 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9
+ },
+ {
+ 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,
+ 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,
+ 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,
+ 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12
+ },
+ {
+ 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,
+ 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,
+ 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,
+ 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14
+ },
+ {
+ 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,
+ 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,
+ 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,
+ 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3
+ },
+ {
+ 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,
+ 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,
+ 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,
+ 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13
+ },
+ {
+ 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,
+ 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,
+ 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,
+ 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12
+ },
+ {
+ 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,
+ 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,
+ 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,
+ 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11
+ }
+};
+
+static void
+perm (a, e, pc, n)
+ register char *a, *e;
+ register char *pc;
+ int n;
+{
+ for (; n--; pc++, a++)
+ *a = e[*pc];
+}
+
+static void
+crypt_main (nachr_l, nachr_r, schl)
+ register char *nachr_l, *nachr_r;
+ register char *schl;
+{
+ char tmp[KS];
+ register int sbval;
+ register char *tp = tmp;
+ register char *e = E;
+ register int i, j;
+
+ for (i = 0; i < 8; i++)
+ {
+ for (j = 0, sbval = 0; j < 6; j++)
+ sbval = (sbval << 1) | (nachr_r[*e++] ^ *schl++);
+ sbval = S_BOX[i][sbval];
+ for (tp += 4, j = 4; j--; sbval >>= 1)
+ *--tp = sbval & 1;
+ tp += 4;
+ }
+
+ e = PERM;
+ for (i = 0; i < BS2; i++)
+ *nachr_l++ ^= tmp[*e++];
+}
+
+void
+encrypt (char *nachr, int decr)
+{
+ char (*schl)[KS] = decr ? schluessel + 15 : schluessel;
+ char tmp[BS];
+ int i;
+
+ perm (tmp, nachr, IP, BS);
+
+ for (i = 8; i--;)
+ {
+ crypt_main (tmp, tmp + BS2, *schl);
+ if (decr)
+ schl--;
+ else
+ schl++;
+ crypt_main (tmp + BS2, tmp, *schl);
+ if (decr)
+ schl--;
+ else
+ schl++;
+ }
+
+ perm (nachr, tmp, EP, BS);
+}
+
+void
+setkey (char *schl)
+{
+ char tmp1[IS];
+ register unsigned int ls = 0x7efc;
+ register int i, j, k;
+ register int shval = 0;
+ register char *akt_schl;
+
+ memcpy (E, E0, KS);
+ perm (tmp1, schl, PC1, IS);
+
+ for (i = 0; i < 16; i++)
+ {
+ shval += 1 + (ls & 1);
+ akt_schl = schluessel[i];
+ for (j = 0; j < KS; j++)
+ {
+ if ((k = PC2[j]) >= IS2)
+ {
+ if ((k += shval) >= IS)
+ k = (k - IS2) % IS2 + IS2;
+ }
+ else if ((k += shval) >= IS2)
+ k %= IS2;
+ *akt_schl++ = tmp1[k];
+ }
+ ls >>= 1;
+ }
+}
+
+char *
+des_crypt (const char *wort, const char *salt)
+{
+ static char retkey[14];
+ char key[BS + 2];
+ char *k;
+ int tmp, keybyte;
+ int i, j;
+
+ memset (key, 0, BS + 2);
+
+ for (k = key, i = 0; i < BS; i++)
+ {
+ if (!(keybyte = *wort++))
+ break;
+ k += 7;
+ for (j = 0; j < 7; j++, i++)
+ {
+ *--k = keybyte & 1;
+ keybyte >>= 1;
+ }
+ k += 8;
+ }
+
+ setkey (key);
+ memset (key, 0, BS + 2);
+
+ for (k = E, i = 0; i < 2; i++)
+ {
+ retkey[i] = keybyte = *salt++;
+ if (keybyte > 'Z')
+ keybyte -= 'a' - 'Z' - 1;
+ if (keybyte > '9')
+ keybyte -= 'A' - '9' - 1;
+ keybyte -= '.';
+
+ for (j = 0; j < 6; j++, keybyte >>= 1, k++)
+ {
+ if (!(keybyte & 1))
+ continue;
+ tmp = *k;
+ *k = k[24];
+ k[24] = tmp;
+ }
+ }
+
+ for (i = 0; i < 25; i++)
+ encrypt (key, 0);
+
+ for (k = key, i = 0; i < 11; i++)
+ {
+ for (j = keybyte = 0; j < 6; j++)
+ {
+ keybyte <<= 1;
+ keybyte |= *k++;
+ }
+
+ keybyte += '.';
+ if (keybyte > '9')
+ keybyte += 'A' - '9' - 1;
+ if (keybyte > 'Z')
+ keybyte += 'a' - 'Z' - 1;
+ retkey[i + 2] = keybyte;
+ }
+
+ retkey[i + 2] = 0;
+
+ if (!retkey[1])
+ retkey[1] = *retkey;
+
+ return retkey;
+}
+
+char *
+crypt (const char *pw, const char *salt)
+{
+ if (strlen(salt)>MD5_MAGIC_LEN && strncmp(salt, MD5_MAGIC, MD5_MAGIC_LEN)==0) {
+ return md5_crypt(pw, salt);
+ } else {
+ return des_crypt(pw, salt);
+ }
+}
diff --git a/win32/crypt_win32.h b/win32/crypt_win32.h
new file mode 100644
index 000000000..f5d5741a9
--- /dev/null
+++ b/win32/crypt_win32.h
@@ -0,0 +1,60 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: crypt_win32.h,v 1.6 2004/01/08 17:33:28 sniper Exp $ */
+
+/* This code is distributed under the PHP license with permission from
+ the author Jochen Obalek <jochen.obalek@bigfoot.de> */
+
+/* encrypt.h - API to 56 bit DES encryption via calls
+ encrypt(3), setkey(3) and crypt(3)
+ Copyright (C) 1991 Jochen Obalek
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ 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 the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _ENCRYPT_H_
+#define _ENCRYPT_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <_ansi.h>
+
+void _EXFUN(encrypt, (char *block, int edflag));
+void _EXFUN(setkey, (char *key));
+char * _EXFUN(crypt, (const char *key, const char *salt));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ENCRYPT_H_ */
diff --git a/win32/flock.c b/win32/flock.c
new file mode 100644
index 000000000..e659de659
--- /dev/null
+++ b/win32/flock.c
@@ -0,0 +1,84 @@
+/*
+ * Program: Unix compatibility routines
+ *
+ * Author: Mark Crispin
+ * Networks and Distributed Computing
+ * Computing & Communications
+ * University of Washington
+ * Administration Building, AG-44
+ * Seattle, WA 98195
+ * Internet: MRC@CAC.Washington.EDU
+ *
+ * Date: 14 September 1996
+ * Last Edited: 14 August 1997
+ *
+ * Copyright 1997 by the University of Washington
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * above copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the University of Washington not be
+ * used in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. This software is made available
+ * "as is", and
+ * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
+ * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+
+/* DEDICATION
+
+ * This file is dedicated to my dog, Unix, also known as Yun-chan and
+ * Unix J. Terwilliker Jehosophat Aloysius Monstrosity Animal Beast. Unix
+ * passed away at the age of 11 1/2 on September 14, 1996, 12:18 PM PDT, after
+ * a two-month bout with cirrhosis of the liver.
+ *
+ * He was a dear friend, and I miss him terribly.
+ *
+ * Lift a leg, Yunie. Luv ya forever!!!!
+ */
+
+#include "php.h"
+#include <windows.h>
+#include <io.h>
+#include <errno.h>
+#include "flock.h"
+
+PHPAPI int flock(int fd, int op)
+{
+ HANDLE hdl = (HANDLE) _get_osfhandle(fd);
+ DWORD low = 1, high = 0;
+ OVERLAPPED offset =
+ {0, 0, 0, 0, NULL};
+ if (hdl < 0)
+ return -1; /* error in file descriptor */
+ /* bug for bug compatible with Unix */
+ UnlockFileEx(hdl, 0, low, high, &offset);
+ switch (op & ~LOCK_NB) { /* translate to LockFileEx() op */
+ case LOCK_EX: /* exclusive */
+ if (LockFileEx(hdl, LOCKFILE_EXCLUSIVE_LOCK +
+ ((op & LOCK_NB) ? LOCKFILE_FAIL_IMMEDIATELY : 0),
+ 0, low, high, &offset))
+ return 0;
+ break;
+ case LOCK_SH: /* shared */
+ if (LockFileEx(hdl, ((op & LOCK_NB) ? LOCKFILE_FAIL_IMMEDIATELY : 0),
+ 0, low, high, &offset))
+ return 0;
+ break;
+ case LOCK_UN: /* unlock */
+ return 0; /* always succeeds */
+ default: /* default */
+ break;
+ }
+ errno = EINVAL; /* bad call */
+ return -1;
+}
diff --git a/win32/flock.h b/win32/flock.h
new file mode 100644
index 000000000..d228e855d
--- /dev/null
+++ b/win32/flock.h
@@ -0,0 +1,11 @@
+#define fsync _commit
+#define ftruncate chsize
+
+/* For flock() emulation */
+
+#define LOCK_SH 1
+#define LOCK_EX 2
+#define LOCK_NB 4
+#define LOCK_UN 8
+
+PHPAPI int flock(int fd, int op);
diff --git a/win32/glob.c b/win32/glob.c
new file mode 100644
index 000000000..079e1545c
--- /dev/null
+++ b/win32/glob.c
@@ -0,0 +1,922 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $Id: glob.c,v 1.6 2003/09/20 03:22:36 sniper Exp $ */
+
+/*
+ * glob(3) -- a superset of the one defined in POSIX 1003.2.
+ *
+ * The [!...] convention to negate a range is supported (SysV, Posix, ksh).
+ *
+ * Optional extra services, controlled by flags not defined by POSIX:
+ *
+ * GLOB_QUOTE:
+ * Escaping convention: \ inhibits any special meaning the following
+ * character might have (except \ at end of string is retained).
+ * GLOB_MAGCHAR:
+ * Set in gl_flags if pattern contained a globbing character.
+ * GLOB_NOMAGIC:
+ * Same as GLOB_NOCHECK, but it will only append pattern if it did
+ * not contain any magic characters. [Used in csh style globbing]
+ * GLOB_ALTDIRFUNC:
+ * Use alternately specified directory access functions.
+ * GLOB_TILDE:
+ * expand ~user/foo to the /home/dir/of/user/foo
+ * GLOB_BRACE:
+ * expand {1,2}{a,b} to 1a 1b 2a 2b
+ * gl_matchc:
+ * Number of matches in the current invocation of glob.
+ */
+#ifdef PHP_WIN32
+#define _POSIX_
+#include <limits.h>
+#undef _POSIX_
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & _S_IFDIR) == _S_IFDIR)
+#endif
+#ifndef S_ISLNK
+#define S_ISLNK(m) (0)
+#endif
+#endif
+
+#include "php.h"
+#include <sys/stat.h>
+
+#include <ctype.h>
+#ifndef PHP_WIN32
+#include <sys/param.h>
+#include <dirent.h>
+#include <pwd.h>
+#include <unistd.h>
+#else
+#include "win32/pwd.h"
+#endif
+#include <errno.h>
+#include "glob.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define DOLLAR '$'
+#define DOT '.'
+#define EOS '\0'
+#define LBRACKET '['
+#define NOT '!'
+#define QUESTION '?'
+#define QUOTE '\\'
+#define RANGE '-'
+#define RBRACKET ']'
+#define SEP DEFAULT_SLASH
+#define STAR '*'
+#define TILDE '~'
+#define UNDERSCORE '_'
+#define LBRACE '{'
+#define RBRACE '}'
+#define SLASH '/'
+#define COMMA ','
+
+#ifndef DEBUG
+
+#define M_QUOTE 0x8000
+#define M_PROTECT 0x4000
+#define M_MASK 0xffff
+#define M_ASCII 0x00ff
+
+typedef u_short Char;
+
+#else
+
+#define M_QUOTE 0x80
+#define M_PROTECT 0x40
+#define M_MASK 0xff
+#define M_ASCII 0x7f
+
+typedef char Char;
+
+#endif
+
+
+#define CHAR(c) ((Char)((c)&M_ASCII))
+#define META(c) ((Char)((c)|M_QUOTE))
+#define M_ALL META('*')
+#define M_END META(']')
+#define M_NOT META('!')
+#define M_ONE META('?')
+#define M_RNG META('-')
+#define M_SET META('[')
+#define ismeta(c) (((c)&M_QUOTE) != 0)
+
+static int compare(const void *, const void *);
+static int g_Ctoc(const Char *, char *, u_int);
+static int g_lstat(Char *, struct stat *, glob_t *);
+static DIR *g_opendir(Char *, glob_t *);
+static Char *g_strchr(Char *, int);
+static int g_stat(Char *, struct stat *, glob_t *);
+static int glob0(const Char *, glob_t *);
+static int glob1(Char *, Char *, glob_t *, size_t *);
+static int glob2(Char *, Char *, Char *, Char *, Char *, Char *,
+ glob_t *, size_t *);
+static int glob3(Char *, Char *, Char *, Char *, Char *, Char *,
+ Char *, Char *, glob_t *, size_t *);
+static int globextend(const Char *, glob_t *, size_t *);
+static const Char *
+ globtilde(const Char *, Char *, size_t, glob_t *);
+static int globexp1(const Char *, glob_t *);
+static int globexp2(const Char *, const Char *, glob_t *, int *);
+static int match(Char *, Char *, Char *);
+#ifdef DEBUG
+static void qprintf(const char *, Char *);
+#endif
+
+int
+glob(pattern, flags, errfunc, pglob)
+ const char *pattern;
+ int flags, (*errfunc)(const char *, int);
+ glob_t *pglob;
+{
+ const u_char *patnext;
+ int c;
+ Char *bufnext, *bufend, patbuf[MAXPATHLEN];
+
+#ifdef PHP_WIN32
+ /* Force skipping escape sequences on windows
+ * due to the ambiguity with path backslashes
+ */
+ flags |= GLOB_NOESCAPE;
+#endif
+
+ patnext = (u_char *) pattern;
+ if (!(flags & GLOB_APPEND)) {
+ pglob->gl_pathc = 0;
+ pglob->gl_pathv = NULL;
+ if (!(flags & GLOB_DOOFFS))
+ pglob->gl_offs = 0;
+ }
+ pglob->gl_flags = flags & ~GLOB_MAGCHAR;
+ pglob->gl_errfunc = errfunc;
+ pglob->gl_matchc = 0;
+
+ bufnext = patbuf;
+ bufend = bufnext + MAXPATHLEN - 1;
+ if (flags & GLOB_NOESCAPE)
+ while (bufnext < bufend && (c = *patnext++) != EOS)
+ *bufnext++ = c;
+ else {
+ /* Protect the quoted characters. */
+ while (bufnext < bufend && (c = *patnext++) != EOS)
+ if (c == QUOTE) {
+ if ((c = *patnext++) == EOS) {
+ c = QUOTE;
+ --patnext;
+ }
+ *bufnext++ = c | M_PROTECT;
+ } else
+ *bufnext++ = c;
+ }
+ *bufnext = EOS;
+
+ if (flags & GLOB_BRACE)
+ return globexp1(patbuf, pglob);
+ else
+ return glob0(patbuf, pglob);
+}
+
+/*
+ * Expand recursively a glob {} pattern. When there is no more expansion
+ * invoke the standard globbing routine to glob the rest of the magic
+ * characters
+ */
+static int
+globexp1(pattern, pglob)
+ const Char *pattern;
+ glob_t *pglob;
+{
+ const Char* ptr = pattern;
+ int rv;
+
+ /* Protect a single {}, for find(1), like csh */
+ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)
+ return glob0(pattern, pglob);
+
+ while ((ptr = (const Char *) g_strchr((Char *) ptr, LBRACE)) != NULL)
+ if (!globexp2(ptr, pattern, pglob, &rv))
+ return rv;
+
+ return glob0(pattern, pglob);
+}
+
+
+/*
+ * Recursive brace globbing helper. Tries to expand a single brace.
+ * If it succeeds then it invokes globexp1 with the new pattern.
+ * If it fails then it tries to glob the rest of the pattern and returns.
+ */
+static int
+globexp2(ptr, pattern, pglob, rv)
+ const Char *ptr, *pattern;
+ glob_t *pglob;
+ int *rv;
+{
+ int i;
+ Char *lm, *ls;
+ const Char *pe, *pm, *pl;
+ Char patbuf[MAXPATHLEN];
+
+ /* copy part up to the brace */
+ for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
+ ;
+ *lm = EOS;
+ ls = lm;
+
+ /* Find the balanced brace */
+ for (i = 0, pe = ++ptr; *pe; pe++)
+ if (*pe == LBRACKET) {
+ /* Ignore everything between [] */
+ for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++)
+ ;
+ if (*pe == EOS) {
+ /*
+ * We could not find a matching RBRACKET.
+ * Ignore and just look for RBRACE
+ */
+ pe = pm;
+ }
+ } else if (*pe == LBRACE)
+ i++;
+ else if (*pe == RBRACE) {
+ if (i == 0)
+ break;
+ i--;
+ }
+
+ /* Non matching braces; just glob the pattern */
+ if (i != 0 || *pe == EOS) {
+ *rv = glob0(patbuf, pglob);
+ return 0;
+ }
+
+ for (i = 0, pl = pm = ptr; pm <= pe; pm++) {
+ switch (*pm) {
+ case LBRACKET:
+ /* Ignore everything between [] */
+ for (pl = pm++; *pm != RBRACKET && *pm != EOS; pm++)
+ ;
+ if (*pm == EOS) {
+ /*
+ * We could not find a matching RBRACKET.
+ * Ignore and just look for RBRACE
+ */
+ pm = pl;
+ }
+ break;
+
+ case LBRACE:
+ i++;
+ break;
+
+ case RBRACE:
+ if (i) {
+ i--;
+ break;
+ }
+ /* FALLTHROUGH */
+ case COMMA:
+ if (i && *pm == COMMA)
+ break;
+ else {
+ /* Append the current string */
+ for (lm = ls; (pl < pm); *lm++ = *pl++)
+ ;
+
+ /*
+ * Append the rest of the pattern after the
+ * closing brace
+ */
+ for (pl = pe + 1; (*lm++ = *pl++) != EOS; )
+ ;
+
+ /* Expand the current pattern */
+#ifdef DEBUG
+ qprintf("globexp2:", patbuf);
+#endif
+ *rv = globexp1(patbuf, pglob);
+
+ /* move after the comma, to the next string */
+ pl = pm + 1;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ *rv = 0;
+ return 0;
+}
+
+
+
+/*
+ * expand tilde from the passwd file.
+ */
+static const Char *
+globtilde(pattern, patbuf, patbuf_len, pglob)
+ const Char *pattern;
+ Char *patbuf;
+ size_t patbuf_len;
+ glob_t *pglob;
+{
+ struct passwd *pwd;
+ char *h;
+ const Char *p;
+ Char *b, *eb;
+
+ if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))
+ return pattern;
+
+ /* Copy up to the end of the string or / */
+ eb = &patbuf[patbuf_len - 1];
+ for (p = pattern + 1, h = (char *) patbuf;
+ h < (char *)eb && *p && *p != SLASH; *h++ = (char) *p++)
+ ;
+
+ *h = EOS;
+
+#if 0
+ if (h == (char *)eb)
+ return what;
+#endif
+
+ if (((char *) patbuf)[0] == EOS) {
+ /*
+ * handle a plain ~ or ~/ by expanding $HOME
+ * first and then trying the password file
+ */
+ if ((h = getenv("HOME")) == NULL) {
+#ifndef PHP_WIN32
+ if ((pwd = getpwuid(getuid())) == NULL)
+ return pattern;
+ else
+ h = pwd->pw_dir;
+#else
+ return pattern;
+#endif
+ }
+ } else {
+ /*
+ * Expand a ~user
+ */
+ if ((pwd = getpwnam((char*) patbuf)) == NULL)
+ return pattern;
+ else
+ h = pwd->pw_dir;
+ }
+
+ /* Copy the home directory */
+ for (b = patbuf; b < eb && *h; *b++ = *h++)
+ ;
+
+ /* Append the rest of the pattern */
+ while (b < eb && (*b++ = *p++) != EOS)
+ ;
+ *b = EOS;
+
+ return patbuf;
+}
+
+
+/*
+ * The main glob() routine: compiles the pattern (optionally processing
+ * quotes), calls glob1() to do the real pattern matching, and finally
+ * sorts the list (unless unsorted operation is requested). Returns 0
+ * if things went well, nonzero if errors occurred. It is not an error
+ * to find no matches.
+ */
+static int
+glob0(pattern, pglob)
+ const Char *pattern;
+ glob_t *pglob;
+{
+ const Char *qpatnext;
+ int c, err, oldpathc;
+ Char *bufnext, patbuf[MAXPATHLEN];
+ size_t limit = 0;
+
+ qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob);
+ oldpathc = pglob->gl_pathc;
+ bufnext = patbuf;
+
+ /* We don't need to check for buffer overflow any more. */
+ while ((c = *qpatnext++) != EOS) {
+ switch (c) {
+ case LBRACKET:
+ c = *qpatnext;
+ if (c == NOT)
+ ++qpatnext;
+ if (*qpatnext == EOS ||
+ g_strchr((Char *) qpatnext+1, RBRACKET) == NULL) {
+ *bufnext++ = LBRACKET;
+ if (c == NOT)
+ --qpatnext;
+ break;
+ }
+ *bufnext++ = M_SET;
+ if (c == NOT)
+ *bufnext++ = M_NOT;
+ c = *qpatnext++;
+ do {
+ *bufnext++ = CHAR(c);
+ if (*qpatnext == RANGE &&
+ (c = qpatnext[1]) != RBRACKET) {
+ *bufnext++ = M_RNG;
+ *bufnext++ = CHAR(c);
+ qpatnext += 2;
+ }
+ } while ((c = *qpatnext++) != RBRACKET);
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ *bufnext++ = M_END;
+ break;
+ case QUESTION:
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ *bufnext++ = M_ONE;
+ break;
+ case STAR:
+ pglob->gl_flags |= GLOB_MAGCHAR;
+ /* collapse adjacent stars to one,
+ * to avoid exponential behavior
+ */
+ if (bufnext == patbuf || bufnext[-1] != M_ALL)
+ *bufnext++ = M_ALL;
+ break;
+ default:
+ *bufnext++ = CHAR(c);
+ break;
+ }
+ }
+ *bufnext = EOS;
+#ifdef DEBUG
+ qprintf("glob0:", patbuf);
+#endif
+
+ if ((err = glob1(patbuf, patbuf+MAXPATHLEN-1, pglob, &limit)) != 0)
+ return(err);
+
+ /*
+ * If there was no match we are going to append the pattern
+ * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
+ * and the pattern did not contain any magic characters
+ * GLOB_NOMAGIC is there just for compatibility with csh.
+ */
+ if (pglob->gl_pathc == oldpathc) {
+ if ((pglob->gl_flags & GLOB_NOCHECK) ||
+ ((pglob->gl_flags & GLOB_NOMAGIC) &&
+ !(pglob->gl_flags & GLOB_MAGCHAR)))
+ return(globextend(pattern, pglob, &limit));
+ else
+ return(GLOB_NOMATCH);
+ }
+ if (!(pglob->gl_flags & GLOB_NOSORT))
+ qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
+ pglob->gl_pathc - oldpathc, sizeof(char *), (const void *) compare);
+ return(0);
+}
+
+static int
+compare(p, q)
+ const void *p, *q;
+{
+ return(strcmp(*(char **)p, *(char **)q));
+}
+
+static int
+glob1(pattern, pattern_last, pglob, limitp)
+ Char *pattern, *pattern_last;
+ glob_t *pglob;
+ size_t *limitp;
+{
+ Char pathbuf[MAXPATHLEN];
+
+ /* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */
+ if (*pattern == EOS)
+ return(0);
+ return(glob2(pathbuf, pathbuf+MAXPATHLEN-1,
+ pathbuf, pathbuf+MAXPATHLEN-1,
+ pattern, pattern_last, pglob, limitp));
+}
+
+/*
+ * The functions glob2 and glob3 are mutually recursive; there is one level
+ * of recursion for each segment in the pattern that contains one or more
+ * meta characters.
+ */
+static int
+glob2(pathbuf, pathbuf_last, pathend, pathend_last, pattern,
+ pattern_last, pglob, limitp)
+ Char *pathbuf, *pathbuf_last, *pathend, *pathend_last;
+ Char *pattern, *pattern_last;
+ glob_t *pglob;
+ size_t *limitp;
+{
+ struct stat sb;
+ Char *p, *q;
+ int anymeta;
+
+ /*
+ * Loop over pattern segments until end of pattern or until
+ * segment with meta character found.
+ */
+ for (anymeta = 0;;) {
+ if (*pattern == EOS) { /* End of pattern? */
+ *pathend = EOS;
+ if (g_lstat(pathbuf, &sb, pglob))
+ return(0);
+
+ if (((pglob->gl_flags & GLOB_MARK) &&
+ !IS_SLASH(pathend[-1])) && (S_ISDIR(sb.st_mode) ||
+ (S_ISLNK(sb.st_mode) &&
+ (g_stat(pathbuf, &sb, pglob) == 0) &&
+ S_ISDIR(sb.st_mode)))) {
+ if (pathend+1 > pathend_last)
+ return (1);
+ *pathend++ = SEP;
+ *pathend = EOS;
+ }
+ ++pglob->gl_matchc;
+ return(globextend(pathbuf, pglob, limitp));
+ }
+
+ /* Find end of next segment, copy tentatively to pathend. */
+ q = pathend;
+ p = pattern;
+ while (*p != EOS && !IS_SLASH(*p)) {
+ if (ismeta(*p))
+ anymeta = 1;
+ if (q+1 > pathend_last)
+ return (1);
+ *q++ = *p++;
+ }
+
+ if (!anymeta) { /* No expansion, do next segment. */
+ pathend = q;
+ pattern = p;
+ while (IS_SLASH(*pattern)) {
+ if (pathend+1 > pathend_last)
+ return (1);
+ *pathend++ = *pattern++;
+ }
+ } else
+ /* Need expansion, recurse. */
+ return(glob3(pathbuf, pathbuf_last, pathend,
+ pathend_last, pattern, pattern_last,
+ p, pattern_last, pglob, limitp));
+ }
+ /* NOTREACHED */
+}
+
+static int
+glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last,
+ restpattern, restpattern_last, pglob, limitp)
+ Char *pathbuf, *pathbuf_last, *pathend, *pathend_last;
+ Char *pattern, *pattern_last, *restpattern, *restpattern_last;
+ glob_t *pglob;
+ size_t *limitp;
+{
+ register struct dirent *dp;
+ DIR *dirp;
+ int err;
+ char buf[MAXPATHLEN];
+
+ /*
+ * The readdirfunc declaration can't be prototyped, because it is
+ * assigned, below, to two functions which are prototyped in glob.h
+ * and dirent.h as taking pointers to differently typed opaque
+ * structures.
+ */
+ struct dirent *(*readdirfunc)();
+
+ if (pathend > pathend_last)
+ return (1);
+ *pathend = EOS;
+ errno = 0;
+
+ if ((dirp = g_opendir(pathbuf, pglob)) == NULL) {
+ /* TODO: don't call for ENOENT or ENOTDIR? */
+ if (pglob->gl_errfunc) {
+ if (g_Ctoc(pathbuf, buf, sizeof(buf)))
+ return(GLOB_ABORTED);
+ if (pglob->gl_errfunc(buf, errno) ||
+ pglob->gl_flags & GLOB_ERR)
+ return(GLOB_ABORTED);
+ }
+ return(0);
+ }
+
+ err = 0;
+
+ /* Search directory for matching names. */
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ readdirfunc = pglob->gl_readdir;
+ else
+ readdirfunc = readdir;
+ while ((dp = (*readdirfunc)(dirp))) {
+ register u_char *sc;
+ register Char *dc;
+
+ /* Initial DOT must be matched literally. */
+ if (dp->d_name[0] == DOT && *pattern != DOT)
+ continue;
+ dc = pathend;
+ sc = (u_char *) dp->d_name;
+ while (dc < pathend_last && (*dc++ = *sc++) != EOS)
+ ;
+ if (dc >= pathend_last) {
+ *dc = EOS;
+ err = 1;
+ break;
+ }
+
+ if (!match(pathend, pattern, restpattern)) {
+ *pathend = EOS;
+ continue;
+ }
+ err = glob2(pathbuf, pathbuf_last, --dc, pathend_last,
+ restpattern, restpattern_last, pglob, limitp);
+ if (err)
+ break;
+ }
+
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ (*pglob->gl_closedir)(dirp);
+ else
+ closedir(dirp);
+ return(err);
+}
+
+
+/*
+ * Extend the gl_pathv member of a glob_t structure to accomodate a new item,
+ * add the new item, and update gl_pathc.
+ *
+ * This assumes the BSD realloc, which only copies the block when its size
+ * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic
+ * behavior.
+ *
+ * Return 0 if new item added, error code if memory couldn't be allocated.
+ *
+ * Invariant of the glob_t structure:
+ * Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and
+ * gl_pathv points to (gl_offs + gl_pathc + 1) items.
+ */
+static int
+globextend(path, pglob, limitp)
+ const Char *path;
+ glob_t *pglob;
+ size_t *limitp;
+{
+ register char **pathv;
+ register int i;
+ u_int newsize, len;
+ char *copy;
+ const Char *p;
+
+ newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);
+ pathv = pglob->gl_pathv ? realloc((char *)pglob->gl_pathv, newsize) :
+ malloc(newsize);
+ if (pathv == NULL) {
+ if (pglob->gl_pathv) {
+ free(pglob->gl_pathv);
+ pglob->gl_pathv = NULL;
+ }
+ return(GLOB_NOSPACE);
+ }
+
+ if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
+ /* first time around -- clear initial gl_offs items */
+ pathv += pglob->gl_offs;
+ for (i = pglob->gl_offs; --i >= 0; )
+ *--pathv = NULL;
+ }
+ pglob->gl_pathv = pathv;
+
+ for (p = path; *p++;)
+ ;
+ len = (size_t)(p - path);
+ *limitp += len;
+ if ((copy = malloc(len)) != NULL) {
+ if (g_Ctoc(path, copy, len)) {
+ free(copy);
+ return(GLOB_NOSPACE);
+ }
+ pathv[pglob->gl_offs + pglob->gl_pathc++] = copy;
+ }
+ pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
+
+ if ((pglob->gl_flags & GLOB_LIMIT) &&
+ newsize + *limitp >= ARG_MAX) {
+ errno = 0;
+ return(GLOB_NOSPACE);
+ }
+
+ return(copy == NULL ? GLOB_NOSPACE : 0);
+}
+
+
+/*
+ * pattern matching function for filenames. Each occurrence of the *
+ * pattern causes a recursion level.
+ */
+static int
+match(name, pat, patend)
+ register Char *name, *pat, *patend;
+{
+ int ok, negate_range;
+ Char c, k;
+
+ while (pat < patend) {
+ c = *pat++;
+ switch (c & M_MASK) {
+ case M_ALL:
+ if (pat == patend)
+ return(1);
+ do
+ if (match(name, pat, patend))
+ return(1);
+ while (*name++ != EOS)
+ ;
+ return(0);
+ case M_ONE:
+ if (*name++ == EOS)
+ return(0);
+ break;
+ case M_SET:
+ ok = 0;
+ if ((k = *name++) == EOS)
+ return(0);
+ if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS)
+ ++pat;
+ while (((c = *pat++) & M_MASK) != M_END)
+ if ((*pat & M_MASK) == M_RNG) {
+ if (c <= k && k <= pat[1])
+ ok = 1;
+ pat += 2;
+ } else if (c == k)
+ ok = 1;
+ if (ok == negate_range)
+ return(0);
+ break;
+ default:
+ if (*name++ != c)
+ return(0);
+ break;
+ }
+ }
+ return(*name == EOS);
+}
+
+/* Free allocated data belonging to a glob_t structure. */
+void
+globfree(pglob)
+ glob_t *pglob;
+{
+ register int i;
+ register char **pp;
+
+ if (pglob->gl_pathv != NULL) {
+ pp = pglob->gl_pathv + pglob->gl_offs;
+ for (i = pglob->gl_pathc; i--; ++pp)
+ if (*pp)
+ free(*pp);
+ free(pglob->gl_pathv);
+ pglob->gl_pathv = NULL;
+ }
+}
+
+static DIR *
+g_opendir(str, pglob)
+ register Char *str;
+ glob_t *pglob;
+{
+ char buf[MAXPATHLEN];
+
+ if (!*str)
+ strlcpy(buf, ".", sizeof buf);
+ else {
+ if (g_Ctoc(str, buf, sizeof(buf)))
+ return(NULL);
+ }
+
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_opendir)(buf));
+
+ return(opendir(buf));
+}
+
+static int
+g_lstat(fn, sb, pglob)
+ register Char *fn;
+ struct stat *sb;
+ glob_t *pglob;
+{
+ char buf[MAXPATHLEN];
+
+ if (g_Ctoc(fn, buf, sizeof(buf)))
+ return(-1);
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_lstat)(buf, sb));
+ return(lstat(buf, sb));
+}
+
+static int
+g_stat(fn, sb, pglob)
+ register Char *fn;
+ struct stat *sb;
+ glob_t *pglob;
+{
+ char buf[MAXPATHLEN];
+
+ if (g_Ctoc(fn, buf, sizeof(buf)))
+ return(-1);
+ if (pglob->gl_flags & GLOB_ALTDIRFUNC)
+ return((*pglob->gl_stat)(buf, sb));
+ return(stat(buf, sb));
+}
+
+static Char *
+g_strchr(str, ch)
+ Char *str;
+ int ch;
+{
+ do {
+ if (*str == ch)
+ return (str);
+ } while (*str++);
+ return (NULL);
+}
+
+static int
+g_Ctoc(str, buf, len)
+ register const Char *str;
+ char *buf;
+ u_int len;
+{
+
+ while (len--) {
+ if ((*buf++ = (char) *str++) == EOS)
+ return (0);
+ }
+ return (1);
+}
+
+#ifdef DEBUG
+static void
+qprintf(str, s)
+ const char *str;
+ register Char *s;
+{
+ register Char *p;
+
+ (void)printf("%s:\n", str);
+ for (p = s; *p; p++)
+ (void)printf("%c", CHAR(*p));
+ (void)printf("\n");
+ for (p = s; *p; p++)
+ (void)printf("%c", *p & M_PROTECT ? '"' : ' ');
+ (void)printf("\n");
+ for (p = s; *p; p++)
+ (void)printf("%c", ismeta(*p) ? '_' : ' ');
+ (void)printf("\n");
+}
+#endif
diff --git a/win32/glob.h b/win32/glob.h
new file mode 100644
index 000000000..67f4fc112
--- /dev/null
+++ b/win32/glob.h
@@ -0,0 +1,101 @@
+/* $Id: glob.h,v 1.1 2002/05/19 14:32:24 edink Exp $ */
+/* OpenBSD: glob.h,v 1.7 2002/02/17 19:42:21 millert Exp */
+/* NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp */
+
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)glob.h 8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _GLOB_H_
+#define _GLOB_H_
+
+#include <sys/cdefs.h>
+
+struct stat;
+typedef struct {
+ int gl_pathc; /* Count of total paths so far. */
+ int gl_matchc; /* Count of paths matching pattern. */
+ int gl_offs; /* Reserved at beginning of gl_pathv. */
+ int gl_flags; /* Copy of flags parameter to glob. */
+ char **gl_pathv; /* List of paths matching pattern. */
+ /* Copy of errfunc parameter to glob. */
+ int (*gl_errfunc)(const char *, int);
+
+ /*
+ * Alternate filesystem access methods for glob; replacement
+ * versions of closedir(3), readdir(3), opendir(3), stat(2)
+ * and lstat(2).
+ */
+ void (*gl_closedir)(void *);
+ struct dirent *(*gl_readdir)(void *);
+ void *(*gl_opendir)(const char *);
+ int (*gl_lstat)(const char *, struct stat *);
+ int (*gl_stat)(const char *, struct stat *);
+} glob_t;
+
+/* Flags */
+#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
+#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
+#define GLOB_ERR 0x0004 /* Return on error. */
+#define GLOB_MARK 0x0008 /* Append / to matching directories. */
+#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
+#define GLOB_NOSORT 0x0020 /* Don't sort. */
+
+#ifndef _POSIX_SOURCE
+#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
+#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
+#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
+#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
+#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
+#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
+#define GLOB_NOESCAPE 0x1000 /* Disable backslash escaping. */
+#define GLOB_LIMIT 0x2000 /* Limit pattern match output to ARG_MAX */
+#endif
+
+/* Error values returned by glob(3) */
+#define GLOB_NOSPACE (-1) /* Malloc call failed. */
+#define GLOB_ABORTED (-2) /* Unignored error. */
+#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK not set. */
+#define GLOB_NOSYS (-4) /* Function not supported. */
+#define GLOB_ABEND GLOB_ABORTED
+
+__BEGIN_DECLS
+int glob(const char *, int, int (*)(const char *, int), glob_t *);
+void globfree(glob_t *);
+__END_DECLS
+
+#endif /* !_GLOB_H_ */
diff --git a/win32/globals.c b/win32/globals.c
new file mode 100755
index 000000000..a3e736364
--- /dev/null
+++ b/win32/globals.c
@@ -0,0 +1,51 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: globals.c,v 1.2.2.1 2004/07/30 14:24:59 wez Exp $ */
+
+#include "php.h"
+#include "php_win32_globals.h"
+
+#ifdef ZTS
+PHPAPI int php_win32_core_globals_id;
+#else
+php_win32_core_globals php_win32_core_globals;
+#endif
+
+void php_win32_core_globals_ctor(void *vg TSRMLS_DC)
+{
+ php_win32_core_globals *wg = (php_win32_core_globals*)vg;
+ memset(wg, 0, sizeof(*wg));
+}
+
+PHP_RSHUTDOWN_FUNCTION(win32_core_globals)
+{
+ php_win32_core_globals *wg =
+#ifdef ZTS
+ ts_resource(php_win32_core_globals_id)
+#else
+ &php_win32_core_globals
+#endif
+ ;
+
+ STR_FREE(wg->login_name);
+
+ memset(wg, 0, sizeof(*wg));
+ return SUCCESS;
+}
+
diff --git a/win32/grp.h b/win32/grp.h
new file mode 100644
index 000000000..4f6e9d8b8
--- /dev/null
+++ b/win32/grp.h
@@ -0,0 +1,26 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Sterling Hughes <sterling@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: grp.h,v 1.6 2004/01/08 17:33:28 sniper Exp $ */
+
+struct group {
+ char *gr_name;
+ char *gr_passwd;
+ int gr_gid;
+ char **gr_mem;
+};
diff --git a/win32/install.txt b/win32/install.txt
new file mode 100644
index 000000000..470d944e2
--- /dev/null
+++ b/win32/install.txt
@@ -0,0 +1,1624 @@
+
+Installing PHP
+ _________________________________________________________________
+
+ Table of Contents
+ Preface
+ 1. General Installation Considerations
+ 2. Installation on Windows systems
+
+ Windows Installer
+ Manual Installation Steps
+ ActiveScript
+ Microsoft IIS / PWS
+ Apache 1.3.x on Microsoft Windows
+ Apache 2.0.x on Microsoft Windows
+ Sun, iPlanet and Netscape servers on Microsoft Windows
+ OmniHTTPd Server
+ Sambar Server on Microsoft Windows
+ Xitami on Microsoft Windows
+ Installation of extensions on Windows
+
+ 3. Installation of PECL extensions
+
+ Introduction to PECL Installations
+ Downloading PECL extensions
+ PECL for Windows users
+ Compiling shared PECL extensions with PEAR
+ Compiling shared PECL extensions with phpize
+ Compiling PECL extensions statically into PHP
+
+ 4. Problems?
+
+ Read the FAQ
+ Other problems
+ Bug reports
+
+ 5. Runtime Configuration
+
+ The configuration file
+ How to change configuration settings
+ _________________________________________________________________
+
+Preface
+
+ These installation instructions were generated from the HTML version
+ of the PHP Manual so formatting and linking have been altered. See the
+ online and updated version at: http://php.net/install.windows
+ _________________________________________________________________
+
+Chapter 1. General Installation Considerations
+
+ Before starting the installation, first you need to know what do you
+ want to use PHP for. There are three main fields you can use PHP, as
+ described in the What can PHP do? section:
+
+ * Server-side scripting
+ * Command line scripting
+ * Client-side GUI applications
+
+ For the first and most common form, you need three things: PHP itself,
+ a web server and a web browser. You probably already have a web
+ browser, and depending on your operating system setup, you may also
+ have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows).
+ You may also rent webspace at a company. This way, you don't need to
+ set up anything on your own, only write your PHP scripts, upload it to
+ the server you rent, and see the results in your browser.
+
+ While setting up the server and PHP on your own, you have two choices
+ for the method of connecting PHP to the server. For many servers PHP
+ has a direct module interface (also called SAPI). These servers
+ include Apache, Microsoft Internet Information Server, Netscape and
+ iPlanet servers. Many other servers have support for ISAPI, the
+ Microsoft module interface (OmniHTTPd for example). If PHP has no
+ module support for your web server, you can always use it as a CGI or
+ FastCGI processor. This means you set up your server to use the CGI
+ executable of PHP to process all PHP file requests on the server.
+
+ If you are also interested to use PHP for command line scripting (e.g.
+ write scripts autogenerating some images for you offline, or
+ processing text files depending on some arguments you pass to them),
+ you always need the command line executable. For more information,
+ read the section about writing command line PHP applications. In this
+ case, you need no server and no browser.
+
+ With PHP you can also write desktop GUI applications using the PHP-GTK
+ extension. This is a completely different approach than writing web
+ pages, as you do not output any HTML, but manage windows and objects
+ within them. For more information about PHP-GTK, please visit the site
+ dedicated to this extension. PHP-GTK is not included in the official
+ PHP distribution.
+
+ From now on, this section deals with setting up PHP for web servers on
+ Unix and Windows with server module interfaces and CGI executables.
+ You will also find information on the command line executable in the
+ following sections.
+
+ PHP source code and binary distributions for Windows can be found at
+ http://www.php.net/downloads.php. We recommend you to choose a mirror
+ nearest to you for downloading the distributions.
+ _________________________________________________________________
+
+Chapter 2. Installation on Windows systems
+
+ This section applies to Windows 98/Me and Windows NT/2000/XP/2003. PHP
+ will not work on 16 bit platforms such as Windows 3.1 and sometimes we
+ refer to the supported Windows platforms as Win32. Windows 95 is no
+ longer supported as of PHP 4.3.0.
+
+ There are two main ways to install PHP for Windows: either manually or
+ by using the installer.
+
+ If you have Microsoft Visual Studio, you can also build PHP from the
+ original source code.
+
+ Once you have PHP installed on your Windows system, you may also want
+ to load various extensions for added functionality.
+
+ Warning
+
+ There are several all-in-one installers over the Internet, but none of
+ those are endorsed by PHP.net, as we believe that the manual
+ installation is the best choice to have your system secure and
+ optimised.
+ _________________________________________________________________
+
+Windows Installer
+
+ The Windows PHP installer is available from the downloads page at
+ http://www.php.net/downloads.php. This installs the CGI version of PHP
+ and for IIS, PWS, and Xitami, it configures the web server as well.
+ The installer does not include any extra external PHP extensions
+ (php_*.dll) as you'll only find those in the Windows Zip Package and
+ PECL downloads.
+
+ Note: While the Windows installer is an easy way to make PHP work,
+ it is restricted in many aspects as, for example, the automatic
+ setup of extensions is not supported. Use of the installer isn't
+ the preferred method for installing PHP.
+
+ First, install your selected HTTP (web) server on your system, and
+ make sure that it works.
+
+ Run the executable installer and follow the instructions provided by
+ the installation wizard. Two types of installation are supported -
+ standard, which provides sensible defaults for all the settings it
+ can, and advanced, which asks questions as it goes along.
+
+ The installation wizard gathers enough information to set up the
+ php.ini file, and configure certain web servers to use PHP. One of the
+ web servers the PHP installer does not configure for is Apache, so
+ you'll need to configure it manually.
+
+ Once the installation has completed, the installer will inform you if
+ you need to restart your system, restart the server, or just start
+ using PHP.
+
+ Warning
+
+ Be aware, that this setup of PHP is not secure. If you would like to
+ have a secure PHP setup, you'd better go on the manual way, and set
+ every option carefully. This automatically working setup gives you an
+ instantly working PHP installation, but it is not meant to be used on
+ online servers.
+ _________________________________________________________________
+
+Manual Installation Steps
+
+ This install guide will help you manually install and configure PHP
+ with a web server on Microsoft Windows. To get started you'll need to
+ download the zip binary distribution from the downloads page at
+ http://www.php.net/downloads.php.
+
+ Although there are many all-in-one installation kits, and we also
+ distribute a PHP installer for Microsoft Windows, we recommend you
+ take the time to setup PHP yourself as this will provide you with a
+ better understanding of the system, and enables you to install PHP
+ extensions easily when needed.
+
+ Upgrading from a previous PHP version: Previous editions of the
+ manual suggest moving various ini and DLL files into your SYSTEM
+ (i.e. C:\WINDOWS) folder and while this simplifies the installation
+ procedure it makes upgrading difficult. We advise you remove all of
+ these files (like php.ini and PHP related DLLs from the Windows
+ SYSTEM folder) before moving on with a new PHP installation. Be
+ sure to backup these files as you might break the entire system.
+ The old php.ini might be useful in setting up the new PHP as well.
+ And as you'll soon learn, the preferred method for installing PHP
+ is to keep all PHP related files in one directory and have this
+ directory available to your systems PATH.
+
+ MDAC requirements: If you use Microsoft Windows 98/NT4 download the
+ latest version of the Microsoft Data Access Components (MDAC) for
+ your platform. MDAC is available at
+ http://msdn.microsoft.com/data/. This requirement exists because
+ ODBC is built into the distributed Windows binaries.
+
+ The following steps should be completed on all installations before
+ any server specific instructions are performed:
+
+ Extract the distribution file into a directory of your choice. If you
+ are installing PHP 4, extract to C:\, as the zip file expands to a
+ foldername like php-4.3.7-Win32. If you are installing PHP 5, extract
+ to C:\php as the zip file doesn't expand as in PHP 4. You may choose a
+ different location but do not have spaces in the path (like C:\Program
+ Files\PHP) as some web servers will crash if you do.
+
+ The directory structure extracted from the zip is different for PHP
+ versions 4 and 5 and look like as follows:
+
+ Example 2-1. PHP 4 package structure
+c:\php
+ |
+ +--cli
+ | |
+ | |-php.exe -- CLI executable - ONLY for commandline scripting
+ |
+ +--dlls -- support DLLs required by some extensions
+ | |
+ | |-expat.dll
+ | |
+ | |-fdftk.dll
+ | |
+ | |-...
+ |
+ +--extensions -- extension DLLs for PHP
+ | |
+ | |-php_bz2.dll
+ | |
+ | |-php_cpdf.dll
+ | |
+ | |-..
+ |
+ +--mibs -- support files for SNMP
+ |
+ +--openssl -- support files for Openssl
+ |
+ +--pdf-related -- support files for PDF
+ |
+ +--sapi -- SAPI (server module support) DLLs
+ | |
+ | |-php4activescript.dll
+ | |
+ | |-php4apache.dll
+ | |
+ | |-php4apache2.dll
+ | |
+ | |-..
+ |
+ +--PEAR -- initial copy of PEAR
+ |
+ |
+ |-go-pear.bat -- PEAR setup script
+ |
+ |-..
+ |
+ |-php.exe -- CGI executable
+ |
+ |-..
+ |
+ |-php.ini-dist -- default php.ini settings
+ |
+ |-php.ini-recommended -- recommended php.ini settings
+ |
+ |-php4ts.dll -- core PHP DLL
+ |
+ |-...
+
+ Or:
+
+ Example 2-2. PHP 5 package structure
+c:\php
+ |
+ +--dev
+ | |
+ | |-php5ts.lib
+ |
+ +--ext -- extension DLLs for PHP
+ | |
+ | |-php_bz2.dll
+ | |
+ | |-php_cpdf.dll
+ | |
+ | |-..
+ |
+ +--extras
+ | |
+ | +--mibs -- support files for SNMP
+ | |
+ | +--openssl -- support files for Openssl
+ | |
+ | +--pdf-related -- support files for PDF
+ | |
+ | |-mime.magic
+ |
+ +--pear -- initial copy of PEAR
+ |
+ |
+ |-go-pear.bat -- PEAR setup script
+ |
+ |-fdftk.dll
+ |
+ |-..
+ |
+ |-php-cgi.exe -- CGI executable
+ |
+ |-php-win.exe -- executes scripts without an opened command prompt
+ |
+ |-php.exe -- CLI executable - ONLY for command line scripting
+ |
+ |-..
+ |
+ |-php.ini-dist -- default php.ini settings
+ |
+ |-php.ini-recommended -- recommended php.ini settings
+ |
+ |-php5activescript.dll
+ |
+ |-php5apache.dll
+ |
+ |-php5apache2.dll
+ |
+ |-..
+ |
+ |-php5ts.dll -- core PHP DLL
+ |
+ |-...
+
+ Notice the differences and similarities. Both PHP 4 and PHP 5 have a
+ CGI executable, a CLI executable, and server modules, but they are
+ located in different folders and/or have different names. While PHP 4
+ packages have the server modules in the sapi folder, PHP 5
+ distributions have no such directory and instead they're in the PHP
+ folder root. The supporting DLLs for the PHP 5 extensions are also not
+ in a seperate directory.
+
+ Note: In PHP 4, you should move all files located in the dll and
+ sapi folders to the main folder (e.g. C:\php).
+
+ Here is a list of server modules shipped with PHP 4 and PHP 5:
+
+ * sapi/php4activescript.dll (php5activescript.dll) - ActiveScript
+ engine, allowing you to embed PHP in your Windows applications.
+ * sapi/php4apache.dll (php5apache.dll) - Apache 1.3.x module.
+ * sapi/php4apache2.dll (php5apache2.dll) - Apache 2.0.x module.
+ * sapi/php4isapi.dll (php5isapi.dll) - ISAPI Module for ISAPI
+ compliant web servers like IIS 4.0/PWS 4.0 or newer.
+ * sapi/php4nsapi.dll (php5nsapi.dll) - Sun/iPlanet/Netscape server
+ module.
+ * sapi/php4pi3web.dll (no equivalent in PHP 5) - Pi3Web server
+ module.
+
+ Server modules provide significantly better performance and additional
+ functionality compared to the CGI binary. The CLI version is designed
+ to let you use PHP for command line scripting. More information about
+ CLI is available in the chapter about using PHP from the command line.
+
+ Warning
+
+ The SAPI modules have been significantly improved as of the 4.1
+ release, however, in older systems you may encounter server errors or
+ other server modules failing, such as ASP.
+
+ The CGI and CLI binaries, and the web server modules all require the
+ php4ts.dll (php5ts.dll) file to be available to them. You have to make
+ sure that this file can be found by your PHP installation. The search
+ order for this DLL is as follows:
+
+ * The same directory from where php.exe is called, or in case you
+ use a SAPI module, the web server's directory (e.g. C:\Program
+ Files\Apache Group\Apache2\bin).
+ * Any directory in your Windows PATH environment variable.
+
+ To make php4ts.dll / php5ts.dll available you have three options: copy
+ the file to the Windows system directory, copy the file to the web
+ server's directory, or add your PHP directory, C:\php to the PATH. For
+ better maintenance, we advise you to follow the last option, add
+ C:\php to the PATH, because it will be simpler to upgrade PHP in the
+ future. Read more about how to add your PHP directory to PATH in the
+ corresponding FAQ entry.
+
+ The next step is to set up a valid configuration file for PHP,
+ php.ini. There are two ini files distributed in the zip file,
+ php.ini-dist and php.ini-recommended. We advise you to use
+ php.ini-recommended, because we optimized the default settings in this
+ file for performance, and security. Read this well documented file
+ carefully because it has changes from php.ini-dist that will
+ drastically affect your setup. Some examples are display_errors being
+ off and magic_quotes_gpc being off. In addition to reading these,
+ study the ini settings and set every element manually yourself. If you
+ would like to achieve the best security, then this is the way for you,
+ although PHP works fine with these default ini files. Copy your chosen
+ ini-file to a directory that PHP is able to find and rename it to
+ php.ini. PHP searches for php.ini in the following locations (in
+ order):
+
+ * PHPIniDir directive (Apache 2 module only)
+ * HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath
+ * The PHPRC environment variable
+ * Directory of PHP (for CLI), or the web server's directory (for
+ SAPI modules)
+ * Windows directory (C:\windows or C:\winnt)
+
+ If you are running Apache 2, the simpler option is to use the
+ PHPIniDir directive (read the installation on Apache 2 page),
+ otherwise your best option is to set the PHPRC environment variable.
+ This process is explained in the following FAQ entry.
+
+ Note: If you're using NTFS on Windows NT, 2000, XP or 2003, make
+ sure that the user running the web server has read permissions to
+ your php.ini (e.g. make it readable by Everyone).
+
+ The following steps are optional:
+
+ * Edit your new php.ini file. If you plan to use OmniHTTPd, do not
+ follow the next step. Set the doc_root to point to your web
+ servers document_root. For example:
+
+doc_root = c:\inetpub\wwwroot // for IIS/PWS
+
+doc_root = c:\apache\htdocs // for Apache
+
+ * Choose the extensions you would like to load when PHP starts. See
+ the section about Windows extensions, about how to set up one, and
+ what is already built in. Note that on a new installation it is
+ advisable to first get PHP working and tested without any
+ extensions before enabling them in php.ini.
+ * On PWS and IIS, you can set the browscap configuration setting to
+ point to: c:\windows\system\inetsrv\browscap.ini on Windows 9x/Me,
+ c:\winnt\system32\inetsrv\browscap.ini on NT/2000, and
+ c:\windows\system32\inetsrv\browscap.ini on XP. For an up-to-date
+ browscap.ini, read the following FAQ.
+
+ PHP is now setup on your system. The next step is to choose a web
+ server, and enable it to run PHP. Choose a webserver from the table of
+ contents.
+ _________________________________________________________________
+
+ActiveScript
+
+ This section contains notes specific to the ActiveScript installation.
+
+ ActiveScript is a windows only SAPI that enables you to use PHP script
+ in any ActiveScript compliant host, like Windows Script Host,
+ ASP/ASP.NET, Windows Script Components or Microsoft Scriptlet control.
+
+ As of PHP 5.0.1, ActiveScript has been moved to the PECL repository.
+ You may download this PECL extension DLL from the PHP Downloads page
+ or at http://snaps.php.net/.
+
+ Note: You should read the manual installation steps first!
+
+ After installing PHP, you should download the ActiveScript DLL
+ (php5activescript.dll) and place it in the main PHP folder (e.g.
+ C:\php).
+
+ After having all the files needed, you must register the DLL on your
+ system. To achieve this, open a Command Prompt window (located in the
+ Start Menu). Then go to your PHP directory by typing something like cd
+ C:\php. To register the DLL just type regsvr32 php5activescript.dll.
+
+ To test if ActiveScript is working, create a new file, named test.wsf
+ (the extension is very important) and type:
+<job id="test">
+
+ <script language="PHPScript">
+ $WScript->Echo("Hello World!");
+ </script>
+
+</job>
+
+ Save and double-click on the file. If you receive a little window
+ saying "Hello World!" you're done.
+
+ Note: ActiveScript doesn't use the default php.ini file. Instead,
+ it will look only in the same directory as the .exe that caused it
+ to load. You should create php-activescript.ini and place it in
+ that folder, if you wish to load extensions, etc.
+ _________________________________________________________________
+
+Microsoft IIS / PWS
+
+ This section contains notes and hints specific to IIS (Microsoft
+ Internet Information Server).
+
+ Warning
+
+ By using the CGI setup, your server is open to several possible
+ attacks. Please read our CGI security section to learn how to defend
+ yourself from those attacks.
+ _________________________________________________________________
+
+General considerations for all installations of PHP with IIS
+
+ * First, read the Manual Installation Instructions. Do not skip this
+ step as it provides crucial information for installing PHP on
+ Windows.
+ * CGI users must set the cgi.force_redirect PHP directive to 0
+ inside php.ini. Read the faq on cgi.force_redirect for important
+ details. Also, CGI users should set the cgi.redirect_status_env
+ directive to ENV_VAR_NAME. Be sure these directives aren't
+ commented out inside php.ini.
+ * The PHP 4 CGI is named php.exe while in PHP 5 it's php-cgi.exe. In
+ PHP 5, php.exe is the CLI, and not the CGI.
+ * Modify the Windows PATH environment variable to include the PHP
+ directory. This way the PHP DLL files, PHP executables, and
+ php.ini can all remain in the PHP directory without cluttering up
+ the Windows system directory. For more details, see the FAQ on
+ Setting the PATH.
+ * Be sure the extension_dir and doc_root PHP directives are
+ appropriately set in php.ini. These directives depend on the
+ system that PHP is being installed on. In PHP 4, the extension_dir
+ is extensions while with PHP 5 it's ext. So, an example PHP 5
+ extensions_dir value is "c:\php\ext" and an example IIS doc_root
+ value is "c:\Inetpub\wwwroot".
+ * PHP extension DLL files, such as php_mysql.dll and php_curl.dll,
+ are found in the zip package of the PHP download (not the PHP
+ installer). In PHP 5, many extensions are part of PECL and can be
+ downloaded in the "Collection of PECL modules" package. Files such
+ as php_zip.dll and php_ssh2.dll. Download PHP files here.
+ * When defining the executable, the 'check that file exists' box may
+ also be checked. For a small performance penalty, the IIS (or PWS)
+ will check that the script file exists and sort out authentication
+ before firing up PHP. This means that the web server will provide
+ sensible 404 style error messages instead of CGI errors
+ complaining that PHP did not output any data.
+ _________________________________________________________________
+
+Windows NT/200x/XP and IIS 4 or newer
+
+ PHP may be installed as a CGI binary, or with the ISAPI module. In
+ either case, you need to start the Microsoft Management Console (may
+ appear as 'Internet Services Manager', either in your Windows NT 4.0
+ Option Pack branch or the Control Panel=>Administrative Tools under
+ Windows 2000/XP). Then right click on your Web server node (this will
+ most probably appear as 'Default Web Server'), and select
+ 'Properties'.
+
+ If you want to use the CGI binary, do the following:
+
+ * Under 'Home Directory', 'Virtual Directory', or 'Directory', do
+ the following:
+ * Change the Execute Permissions to 'Scripts only'
+ * Click on the 'Configuration' button, and choose the Application
+ Mappings tab. Click Add and set the Executable path to the
+ appropriate CGI file. An example PHP 5 value is:
+ C:\php\php-cgi.exe Supply .php as the extension. Leave 'Method
+ exclusions' blank, and check the 'Script engine' checkbox. Now,
+ click OK a few times.
+ * Set up the appropriate security. (This is done in Internet Service
+ Manager), and if your NT Server uses NTFS file system, add execute
+ rights for I_USR_ to the directory that contains php.exe /
+ php-cgi.exe.
+
+ To use the ISAPI module, do the following:
+
+ * If you don't want to perform HTTP Authentication using PHP, you
+ can (and should) skip this step. Under ISAPI Filters, add a new
+ ISAPI filter. Use PHP as the filter name, and supply a path to the
+ php4isapi.dll / php5isapi.dll.
+ * Under 'Home Directory', 'Virtual Directory', or 'Directory', do
+ the following:
+ * Change the Execute Permissions to 'Scripts only'
+ * Click on the 'Configuration' button, and choose the Application
+ Mappings tab. Click Add and set the Executable path to the
+ appropriate ISAPI DLL. An example PHP 5 value is:
+ C:\php\php5isapi.dll Supply .php as the extension. Leave 'Method
+ exclusions' blank, and check the 'Script engine' checkbox. Now,
+ click OK a few times.
+ * Stop IIS completely (NET STOP iisadmin)
+ * Start IIS again (NET START w3svc)
+
+ With IIS 6 (2003 Server), open up the IIS Manager, go to Web Service
+ Extensions, choose "Add a new Web service extension", enter in a name
+ such as PHP, choose the Add button and for the value browse to either
+ the ISAPI file (php4isapi.dll or php5isapi.dll) or CGI (php.exe or
+ php-cgi.exe) then check "Set extension status to Allowed" and click
+ OK.
+
+ In order to use index.php as a default content page, do the following:
+ From within the Documents tab, choose Add. Type in index.php and click
+ OK. Adjust the order by choosing Move Up or Move Down. This is similar
+ to setting DirectoryIndex with Apache.
+
+ The steps above must be repeated for each extension that is to be
+ associated with PHP scripts. .php is the most common although .php3
+ may be required for legacy applications.
+
+ If you experience 100% CPU usage after some time, turn off the IIS
+ setting Cache ISAPI Application.
+ _________________________________________________________________
+
+Windows and PWS 4
+
+ PWS 4 does not support ISAPI, only PHP CGI should be used.
+
+ * Edit the enclosed pws-php4cgi.reg / pws-php5cgi.reg file (look
+ into the SAPI folder for PHP 4, or in the main folder for PHP 5)
+ to reflect the location of your php.exe / php-cgi.exe. Backslashes
+ should be escaped, for example:
+ [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parame
+ ters\Script Map] ".php"="C:\\php\\php.exe" (change to
+ C:\\php\\php-cgi.exe if you are using PHP 5) Now merge this
+ registery file into your system; you may do this by
+ double-clicking it.
+ * In the PWS Manager, right click on a given directory you want to
+ add PHP support to, and select Properties. Check the 'Execute'
+ checkbox, and confirm.
+ _________________________________________________________________
+
+Windows and PWS/IIS 3
+
+ The recommended method for configuring these servers is to use the REG
+ file included with the distribution (pws-php4cgi.reg in the SAPI
+ folder for PHP 4, or pws-php5cgi.reg in the main folder for PHP 5).
+ You may want to edit this file and make sure the extensions and PHP
+ install directories match your configuration. Or you can follow the
+ steps below to do it manually.
+
+ Warning
+
+ These steps involve working directly with the Windows registry. One
+ error here can leave your system in an unstable state. We highly
+ recommend that you back up your registry first. The PHP Development
+ team will not be held responsible if you damage your registry.
+
+ * Run Regedit.
+ * Navigate to: HKEY_LOCAL_MACHINE /System /CurrentControlSet
+ /Services /W3Svc /Parameters /ScriptMap.
+ * On the edit menu select: New->String Value.
+ * Type in the extension you wish to use for your php scripts. For
+ example .php
+ * Double click on the new string value and enter the path to php.exe
+ in the value data field. ex: C:\php\php.exe for PHP 4, or
+ C:\php\php-cgi.exe for PHP 5.
+ * Repeat these steps for each extension you wish to associate with
+ PHP scripts.
+
+ The following steps do not affect the web server installation and only
+ apply if you want your PHP scripts to be executed when they are run
+ from the command line (ex. run C:\myscripts\test.php) or by double
+ clicking on them in a directory viewer window. You may wish to skip
+ these steps as you might prefer the PHP files to load into a text
+ editor when you double click on them.
+
+ * Navigate to: HKEY_CLASSES_ROOT
+ * On the edit menu select: New->Key.
+ * Name the key to the extension you setup in the previous section.
+ ex: .php
+ * Highlight the new key and in the right side pane, double click the
+ "default value" and enter phpfile.
+ * Repeat the last step for each extension you set up in the previous
+ section.
+ * Now create another New->Key under HKEY_CLASSES_ROOT and name it
+ phpfile.
+ * Highlight the new key phpfile and in the right side pane, double
+ click the "default value" and enter PHP Script.
+ * Right click on the phpfile key and select New->Key, name it Shell.
+ * Right click on the Shell key and select New->Key, name it open.
+ * Right click on the open key and select New->Key, name it command.
+ * Highlight the new key command and in the right side pane, double
+ click the "default value" and enter the path to php.exe. ex:
+ c:\php\php.exe -q %1. (don't forget the %1).
+ * Exit Regedit.
+ * If using PWS on Windows, reboot to reload the registry.
+
+ PWS and IIS 3 users now have a fully operational system. IIS 3 users
+ can use a nifty tool from Steven Genusa to configure their script
+ maps.
+ _________________________________________________________________
+
+Apache 1.3.x on Microsoft Windows
+
+ This section contains notes and hints specific to Apache 1.3.x
+ installs of PHP on Microsoft Windows systems. There are also
+ instructions and notes for Apache 2 on a separate page.
+
+ Note: Please read the manual installation steps first!
+
+ There are two ways to set up PHP to work with Apache 1.3.x on Windows.
+ One is to use the CGI binary (php.exe for PHP 4 and php-cgi.exe for
+ PHP 5), the other is to use the Apache Module DLL. In either case you
+ need to edit your httpd.conf to configure Apache to work with PHP, and
+ then restart the server.
+
+ It is worth noting here that now the SAPI module has been made more
+ stable under Windows, we recommend it's use above the CGI binary,
+ since it is more transparent and secure.
+
+ Although there can be a few variations of configuring PHP under
+ Apache, these are simple enough to be used by the newcomer. Please
+ consult the Apache Documentation for further configuration directives.
+
+ After changing the configuration file, remember to restart the server,
+ for example, NET STOP APACHE followed by NET START APACHE, if you run
+ Apache as a Windows Service, or use your regular shortcuts.
+
+ Note: Remember that when adding path values in the Apache
+ configuration files on Windows, all backslashes such as
+ c:\directory\file.ext must be converted to forward slashes, as
+ c:/directory/file.ext.
+ _________________________________________________________________
+
+Installing as an Apache module
+
+ You should add the following lines to your Apache httpd.conf file:
+
+ Example 2-3. PHP as an Apache 1.3.x module
+
+ This assumes PHP is installed to c:\php. Adjust the path if this is
+ not the case.
+
+ For PHP 4:
+# Add to the end of the LoadModule section
+LoadModule php4_module "c:/php/php4apache.dll"
+
+# Add to the end of the AddModule section
+AddModule mod_php4.c
+
+ For PHP 5:
+# Add to the end of the LoadModule section
+LoadModule php5_module "c:/php/php5apache.dll"
+
+# Add to the end of the AddModule section
+AddModule mod_php5.c
+
+ For both:
+# Add this line inside the <IfModule mod_mime.c> conditional brace
+AddType application/x-httpd-php .php
+
+# For syntax highlighted .phps files, also add
+AddType application/x-httpd-php-source .phps
+ _________________________________________________________________
+
+Installing as a CGI binary
+
+ If you unzipped the PHP package to C:\php\ as described in the Manual
+ Installation Steps section, you need to insert these lines to your
+ Apache configuration file to set up the CGI binary:
+
+ Example 2-4. PHP and Apache 1.3.x as CGI
+ScriptAlias /php/ "c:/php/"
+AddType application/x-httpd-php .php
+
+# For PHP 4
+Action application/x-httpd-php "/php/php.exe"
+
+# For PHP 5
+Action application/x-httpd-php "/php/php-cgi.exe"
+
+# specify the directory where php.ini is
+SetEnv PHPRC C:/php
+
+ Note that the second line in the list above can be found in the actual
+ versions of httpd.conf, but it is commented out. Remember also to
+ substitute the c:/php/ for your actual path to PHP.
+
+ Warning
+
+ By using the CGI setup, your server is open to several possible
+ attacks. Please read our CGI security section to learn how to defend
+ yourself from those attacks.
+
+ If you would like to present PHP source files syntax highlighted,
+ there is no such convenient option as with the module version of PHP.
+ If you chose to configure Apache to use PHP as a CGI binary, you will
+ need to use the highlight_file() function. To do this simply create a
+ PHP script file and add this code: <?php
+ highlight_file('some_php_script.php'); ?>.
+ _________________________________________________________________
+
+Apache 2.0.x on Microsoft Windows
+
+ This section contains notes and hints specific to Apache 2.0.x
+ installs of PHP on Microsoft Windows systems. We also have
+ instructions and notes for Apache 1.3.x users on a separate page.
+
+ Note: You should read the manual installation steps first!
+
+ Warning
+
+ We do not recommend using a threaded MPM in production with Apache2.
+ Use the prefork MPM instead, or use Apache1. For information on why,
+ read the following FAQ entry
+
+ You are highly encouraged to take a look at the Apache Documentation
+ to get a basic understanding of the Apache 2.0.x Server. Also consider
+ to read the Windows specific notes for Apache 2.0.x before reading on
+ here.
+
+ PHP and Apache 2.0.x compatibility notes: The following versions of
+ PHP are known to work with the most recent version of Apache 2.0.x:
+
+ * PHP 4.3.0 or later available at http://www.php.net/downloads.php.
+ * the latest stable development version. Get the source code
+ http://snaps.php.net/php4-latest.tar.gz or download binaries for
+ Windows http://snaps.php.net/win32/php4-win32-latest.zip.
+ * a prerelease version downloadable from http://qa.php.net/.
+ * you have always the option to obtain PHP through anonymous CVS.
+
+ These versions of PHP are compatible to Apache 2.0.40 and later.
+
+ Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works
+ with Apache 2.0.39, don't use any other version of Apache with PHP
+ 4.2.3. However, the recommended setup is to use PHP 4.3.0 or later
+ with the most recent version of Apache2.
+
+ All mentioned versions of PHP will work still with Apache 1.3.x.
+
+ Warning
+
+ Apache 2.0.x is designed to run on Windows NT 4.0, Windows 2000 or
+ Windows XP. At this time, support for Windows 9x is incomplete. Apache
+ 2.0.x is not expected to work on those platforms at this time.
+
+ Download the most recent version of Apache 2.0.x and a fitting PHP
+ version. Follow the Manual Installation Steps and come back to go on
+ with the integration of PHP and Apache.
+
+ There are two ways to set up PHP to work with Apache 2.0.x on Windows.
+ One is to use the CGI binary the other is to use the Apache module
+ DLL. In either case you need to edit your httpd.conf to configure
+ Apache to work with PHP and then restart the server.
+
+ Note: Remember that when adding path values in the Apache
+ configuration files on Windows, all backslashes such as
+ c:\directory\file.ext must be converted to forward slashes, as
+ c:/directory/file.ext.
+ _________________________________________________________________
+
+Installing as a CGI binary
+
+ You need to insert these three lines to your Apache httpd.conf
+ configuration file to set up the CGI binary:
+
+ Example 2-5. PHP and Apache 2.0 as CGI
+ScriptAlias /php/ "c:/php/"
+AddType application/x-httpd-php .php
+
+# For PHP 4
+Action application/x-httpd-php "/php/php.exe"
+
+# For PHP 5
+Action application/x-httpd-php "/php/php-cgi.exe"
+
+ Warning
+
+ By using the CGI setup, your server is open to several possible
+ attacks. Please read our CGI security section to learn how to defend
+ yourself from those attacks.
+ _________________________________________________________________
+
+Installing as an Apache module
+
+ You need to insert these two lines to your Apache httpd.conf
+ configuration file to set up the PHP module for Apache 2.0:
+
+ Example 2-6. PHP and Apache 2.0 as Module
+# For PHP 4 do something like this:
+LoadModule php4_module "c:/php/php4apache2.dll"
+AddType application/x-httpd-php .php
+
+# For PHP 5 do something like this:
+LoadModule php5_module "c:/php/php5apache2.dll"
+AddType application/x-httpd-php .php
+
+# configure the path to php.ini
+PHPIniDir "C:/php"
+
+ Note: Remember to substitute the c:/php/ for your actual path to
+ PHP in the above examples. Take care to use either php4apache2.dll
+ or php5apache2.dll in your LoadModule directive and not
+ php4apache.dll or php5apache.dll as the latter ones are designed to
+ run with Apache 1.3.x.
+
+ Note: If you want to use content negotiation, read related FAQ.
+
+ Warning
+
+ Don't mix up your installation with DLL files from different PHP
+ versions. You have the only choice to use the DLL's and extensions
+ that ship with your downloaded PHP version.
+ _________________________________________________________________
+
+Sun, iPlanet and Netscape servers on Microsoft Windows
+
+ This section contains notes and hints specific to Sun Java System Web
+ Server, Sun ONE Web Server, iPlanet and Netscape server installs of
+ PHP on Windows.
+
+ From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to
+ generate custom directory listings and error pages. Additional
+ functions for Apache compatibility are also available. For support in
+ current webservers read the note about subrequests.
+ _________________________________________________________________
+
+CGI setup on Sun, iPlanet and Netscape servers
+
+ To install PHP as a CGI handler, do the following:
+
+ * Copy php4ts.dll to your systemroot (the directory where you
+ installed Windows)
+ * Make a file association from the command line. Type the following
+ two lines:
+
+assoc .php=PHPScript
+ftype PHPScript=c:\php\php.exe %1 %*
+
+ * In the Netscape Enterprise Administration Server create a dummy
+ shellcgi directory and remove it just after (this step creates 5
+ important lines in obj.conf and allow the web server to handle
+ shellcgi scripts).
+ * In the Netscape Enterprise Administration Server create a new mime
+ type (Category: type, Content-Type: magnus-internal/shellcgi, File
+ Suffix:php).
+ * Do it for each web server instance you want PHP to run
+
+ More details about setting up PHP as a CGI executable can be found
+ here: http://benoit.noss.free.fr/php/install-php.html
+ _________________________________________________________________
+
+NSAPI setup on Sun, iPlanet and Netscape servers
+
+ To install PHP with NSAPI, do the following:
+
+ * Copy php4ts.dll to your systemroot (the directory where you
+ installed Windows)
+ * Make a file association from the command line. Type the following
+ two lines:
+
+assoc .php=PHPScript
+ftype PHPScript=c:\php\php.exe %1 %*
+
+ * In the Netscape Enterprise Administration Server create a new mime
+ type (Category: type, Content-Type: magnus-internal/x-httpd-php,
+ File Suffix: php).
+ * Edit magnus.conf (for servers >= 6) or obj.conf (for servers < 6)
+ and add the following: You should place the lines after mime types
+ init.
+
+Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="c:
+/php/sapi/php4nsapi.dll"
+Init fn="php4_init" LateInit="yes" errorString="Failed to initialise PHP!" [php
+_ini="c:/path/to/php.ini"]
+
+ (PHP >= 4.3.3) The php_ini parameter is optional but with it you
+ can place your php.ini in your webserver config directory.
+ * Configure the default object in obj.conf (for virtual server
+ classes [Sun Web Server 6.0+] in their vserver.obj.conf): In the
+ <Object name="default"> section, place this line necessarily after
+ all 'ObjectType' and before all 'AddLog' lines:
+
+Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inik
+ey=value ...]
+
+ (PHP >= 4.3.3) As additional parameters you can add some special
+ php.ini-values, for example you can set a
+ docroot="/path/to/docroot" specific to the context php4_execute is
+ called. For boolean ini-keys please use 0/1 as value, not
+ "On","Off",... (this will not work correctly), e.g.
+ zlib.output_compression=1 instead of zlib.output_compression="On"
+ * This is only needed if you want to configure a directory that only
+ consists of PHP scripts (same like a cgi-bin directory):
+
+<Object name="x-httpd-php">
+ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
+Service fn=php4_execute [inikey=value inikey=value ...]
+</Object>
+
+ After that you can configure a directory in the Administration
+ server and assign it the style x-httpd-php. All files in it will
+ get executed as PHP. This is nice to hide PHP usage by renaming
+ files to .html.
+ * Restart your web service and apply changes
+ * Do it for each web server instance you want PHP to run
+
+ Note: More details about setting up PHP as an NSAPI filter can be
+ found here: http://benoit.noss.free.fr/php/install-php4.html
+
+ Note: The stacksize that PHP uses depends on the configuration of
+ the webserver. If you get crashes with very large PHP scripts, it
+ is recommended to raise it with the Admin Server (in the section
+ "MAGNUS EDITOR").
+ _________________________________________________________________
+
+CGI environment and recommended modifications in php.ini
+
+ Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE
+ WS/iPlanet/Netscape is a multithreaded web server. Because of that all
+ requests are running in the same process space (the space of the
+ webserver itself) and this space has only one environment. If you want
+ to get CGI variables like PATH_INFO, HTTP_HOST etc. it is not the
+ correct way to try this in the old PHP 3.x way with getenv() or a
+ similar way (register globals to environment, $_ENV). You would only
+ get the environment of the running webserver without any valid CGI
+ variables!
+
+ Note: Why are there (invalid) CGI variables in the environment?
+
+ Answer: This is because you started the webserver process from the
+ admin server which runs the startup script of the webserver, you
+ wanted to start, as a CGI script (a CGI script inside of the admin
+ server!). This is why the environment of the started webserver has
+ some CGI environment variables in it. You can test this by starting
+ the webserver not from the administration server. Use the command
+ line as root user and start it manually - you will see there are no
+ CGI-like environment variables.
+
+ Simply change your scripts to get CGI variables in the correct way for
+ PHP 4.x by using the superglobal $_SERVER. If you have older scripts
+ which use $HTTP_HOST, etc., you should turn on register_globals in
+ php.ini and change the variable order too (important: remove "E" from
+ it, because you do not need the environment here):
+variables_order = "GPCS"
+register_globals = On
+ _________________________________________________________________
+
+Special use for error pages or self-made directory listings (PHP >= 4.3.3)
+
+ You can use PHP to generate the error pages for "404 Not Found" or
+ similar. Add the following line to the object in obj.conf for every
+ error page you want to overwrite:
+Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value ini
+key=value...]
+
+ where XXX is the HTTP error code. Please delete any other Error
+ directives which could interfere with yours. If you want to place a
+ page for all errors that could exist, leave the code parameter out.
+ Your script can get the HTTP status code with $_SERVER['ERROR_TYPE'].
+
+ Another possibility is to generate self-made directory listings. Just
+ create a PHP script which displays a directory listing and replace the
+ corresponding default Service line for
+ type="magnus-internal/directory" in obj.conf with the following:
+Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/scr
+ipt.php" [inikey=value inikey=value...]
+
+ For both error and directory listing pages the original URI and
+ translated URI are in the variables $_SERVER['PATH_INFO'] and
+ $_SERVER['PATH_TRANSLATED'].
+ _________________________________________________________________
+
+Note about nsapi_virtual() and subrequests (PHP >= 4.3.3)
+
+ The NSAPI module now supports the nsapi_virtual() function (alias:
+ virtual()) to make subrequests on the webserver and insert the result
+ in the webpage. The problem is, that this function uses some
+ undocumented features from the NSAPI library.
+
+ Under Unix this is not a problem, because the module automatically
+ looks for the needed functions and uses them if available. If not,
+ nsapi_virtual() is disabled.
+
+ Under Windows limitations in the DLL handling need the use of a
+ automatic detection of the most recent ns-httpdXX.dll file. This is
+ tested for servers till version 6.1. If a newer version of the Sun
+ server is used, the detection fails and nsapi_virtual() is disabled.
+
+ If this is the case, try the following: Add the following parameter to
+ php4_init in magnus.conf/obj.conf:
+ Init fn=php4_init ... server_lib="ns-httpdXX.dll"
+
+ where XX is the correct DLL version number. To get it, look in the
+ server-root for the correct DLL name. The DLL with the biggest
+ filesize is the right one.
+
+ You can check the status by using the phpinfo() function.
+
+ Note: But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!!
+ _________________________________________________________________
+
+OmniHTTPd Server
+
+ This section contains notes and hints specific to OmniHTTPd on
+ Windows.
+
+ Note: You should read the manual installation steps first!
+
+ Warning
+
+ By using the CGI setup, your server is open to several possible
+ attacks. Please read our CGI security section to learn how to defend
+ yourself from those attacks.
+
+ You need to complete the following steps to make PHP work with
+ OmniHTTPd. This is a CGI executable setup. SAPI is supported by
+ OmniHTTPd, but some tests have shown that it is not so stable to use
+ PHP as an ISAPI module.
+
+ Important for CGI users: Read the faq on cgi.force_redirect for
+ important details. This directive needs to be set to 0.
+
+ 1. Install OmniHTTPd server.
+ 2. Right click on the blue OmniHTTPd icon in the system tray and
+ select Properties
+ 3. Click on Web Server Global Settings
+ 4. On the 'External' tab, enter: virtual = .php | actual =
+ c:\php\php.exe (use php-cgi.exe if installing PHP 5), and use the
+ Add button.
+ 5. On the Mime tab, enter: virtual = wwwserver/stdcgi | actual =
+ .php, and use the Add button.
+ 6. Click OK
+
+ Repeat steps 2 - 6 for each extension you want to associate with PHP.
+
+ Note: Some OmniHTTPd packages come with built in PHP support. You
+ can choose at setup time to do a custom setup, and uncheck the PHP
+ component. We recommend you to use the latest PHP binaries. Some
+ OmniHTTPd servers come with PHP 4 beta distributions, so you should
+ choose not to set up the built in support, but install your own. If
+ the server is already on your machine, use the Replace button in
+ Step 4 and 5 to set the new, correct information.
+ _________________________________________________________________
+
+Sambar Server on Microsoft Windows
+
+ This section contains notes and hints specific to the Sambar Server
+ for Windows.
+
+ Note: You should read the manual installation steps first!
+
+ This list describes how to set up the ISAPI module to work with the
+ Sambar server on Windows.
+
+ * Find the file called mappings.ini (in the config directory) in the
+ Sambar install directory.
+ * Open mappings.ini and add the following line under [ISAPI]:
+
+ Example 2-7. ISAPI configuration of Sambar
+#for PHP 4
+*.php = c:\php\php4isapi.dll
+
+#for PHP 5
+*.php = c:\php\php5isapi.dll
+
+ (This line assumes that PHP was installed in c:\php.)
+ * Now restart the Sambar server for the changes to take effect.
+ _________________________________________________________________
+
+Xitami on Microsoft Windows
+
+ This section contains notes and hints specific to Xitami on Windows.
+
+ Note: You should read the manual installation steps first!
+
+ This list describes how to set up the PHP CGI binary to work with
+ Xitami on Windows.
+
+ Important for CGI users: Read the faq on cgi.force_redirect for
+ important details. This directive needs to be set to 0. If you want
+ to use $_SERVER['PHP_SELF'] you have to enable the cgi.fix_pathinfo
+ directive.
+
+ Warning
+
+ By using the CGI setup, your server is open to several possible
+ attacks. Please read our CGI security section to learn how to defend
+ yourself from those attacks.
+
+ * Make sure the webserver is running, and point your browser to
+ xitamis admin console (usually http://127.0.0.1/admin), and click
+ on Configuration.
+ * Navigate to the Filters, and put the extension which PHP should
+ parse (i.e. .php) into the field File extensions (.xxx).
+ * In Filter command or script put the path and name of your PHP CGI
+ executable i.e. C:\php\php.exe for PHP 4, or C:\php\php-cgi.exe
+ for PHP 5.
+ * Press the 'Save' icon.
+ * Restart the server to reflect changes.
+ _________________________________________________________________
+
+Installation of extensions on Windows
+
+ After installing PHP and a webserver on Windows, you will probably
+ want to install some extensions for added functionality. You can
+ choose which extensions you would like to load when PHP starts by
+ modifying your php.ini. You can also load a module dynamically in your
+ script using dl().
+
+ The DLLs for PHP extensions are prefixed with php_.
+
+ Note: In PHP 4.3.1 BCMath, Calendar, COM, Ctype, FTP, MySQL, ODBC,
+ Overload, PCRE, Session, Tokenizer, WDDX, XML and Zlib support is
+ built in. You don't need to load any additional extensions in order
+ to use these functions. See your distributions README.txt or
+ install.txt or this table for a list of built in modules.
+
+ The default location PHP searches for extensions is c:\php4\extensions
+ in PHP 4 and c:\php5 in PHP 5. To change this setting to reflect your
+ setup of PHP edit your php.ini file:
+
+ * You will need to change the extension_dir setting to point to the
+ directory where your extensions lives, or where you have placed
+ your php_*.dll files. Please do not forget the last backslash. For
+ example:
+
+extension_dir = c:/php/extensions/
+
+ * Enable the extension(s) in php.ini you want to use by uncommenting
+ the extension=php_*.dll lines in php.ini. This is done by deleting
+ the leading ; from the extension you want to load.
+
+ Example 2-8. Enable Bzip2 extension for PHP-Windows
+// change the following line from ...
+;extension=php_bz2.dll
+
+// ... to
+extension=php_bz2.dll
+
+ * Some of the extensions need extra DLLs to work. Couple of them can
+ be found in the distribution package, in the C:\php\dlls\ folder
+ in PHP 4 or in the main folder in PHP 5, but some, for example
+ Oracle (php_oci8.dll) require DLLs which are not bundled with the
+ distribution package. If you are installing PHP 4, copy the
+ bundled DLLs from C:\php\dlls folder to the main C:\php folder.
+ Don't forget to include C:\php in the system PATH (this process is
+ explained in a separate FAQ entry).
+ * Some of these DLLs are not bundled with the PHP distribution. See
+ each extensions documentation page for details. Also, read the
+ manual section titled Installation of PECL extensions for details
+ on PECL. An increasingly large number of PHP extensions are found
+ in PECL, and these extensions require a separate download.
+
+ Note: If you are running a server module version of PHP remember to
+ restart your webserver to reflect your changes to php.ini.
+
+ The following table describes some of the extensions available and
+ required additional dlls.
+
+ Table 2-1. PHP Extensions
+ Extension Description Notes
+ php_bz2.dll bzip2 compression functions None
+ php_calendar.dll Calendar conversion functions Built in since PHP
+ 4.0.3
+ php_cpdf.dll ClibPDF functions None
+ php_crack.dll Crack functions None
+ php_ctype.dll ctype family functions Built in since PHP 4.3.0
+ php_curl.dll CURL, Client URL library functions Requires:
+ libeay32.dll, ssleay32.dll (bundled)
+ php_cybercash.dll Cybercash payment functions PHP <= 4.2.0
+ php_db.dll DBM functions Deprecated. Use DBA instead (php_dba.dll)
+ php_dba.dll DBA: DataBase (dbm-style) Abstraction layer functions None
+ php_dbase.dll dBase functions None
+ php_dbx.dll dbx functions
+ php_domxml.dll DOM XML functions PHP <= 4.2.0 requires: libxml2.dll
+ (bundled) PHP >= 4.3.0 requires: iconv.dll (bundled)
+ php_dotnet.dll .NET functions PHP <= 4.1.1
+ php_exif.dll EXIF functions php_mbstring.dll. And, php_exif.dll must
+ be loaded after php_mbstring.dll in php.ini.
+ php_fbsql.dll FrontBase functions PHP <= 4.2.0
+ php_fdf.dll FDF: Forms Data Format functions. Requires: fdftk.dll
+ (bundled)
+ php_filepro.dll filePro functions Read-only access
+ php_ftp.dll FTP functions Built-in since PHP 4.0.3
+ php_gd.dll GD library image functions Removed in PHP 4.3.2. Also note
+ that truecolor functions are not available in GD1, instead, use
+ php_gd2.dll.
+ php_gd2.dll GD library image functions GD2
+ php_gettext.dll Gettext functions PHP <= 4.2.0 requires
+ gnu_gettext.dll (bundled), PHP >= 4.2.3 requires libintl-1.dll,
+ iconv.dll (bundled).
+ php_hyperwave.dll HyperWave functions None
+ php_iconv.dll ICONV characterset conversion Requires: iconv-1.3.dll
+ (bundled), PHP >=4.2.1 iconv.dll
+ php_ifx.dll Informix functions Requires: Informix libraries
+ php_iisfunc.dll IIS management functions None
+ php_imap.dll IMAP POP3 and NNTP functions None
+ php_ingres.dll Ingres II functions Requires: Ingres II libraries
+ php_interbase.dll InterBase functions Requires: gds32.dll (bundled)
+ php_java.dll Java functions PHP <= 4.0.6 requires: jvm.dll (bundled)
+ php_ldap.dll LDAP functions PHP <= 4.2.0 requires libsasl.dll
+ (bundled), PHP >= 4.3.0 requires libeay32.dll, ssleay32.dll (bundled)
+ php_mbstring.dll Multi-Byte String functions None
+ php_mcrypt.dll Mcrypt Encryption functions Requires: libmcrypt.dll
+ php_mhash.dll Mhash functions PHP >= 4.3.0 requires: libmhash.dll
+ (bundled)
+ php_mime_magic.dll Mimetype functions Requires: magic.mime (bundled)
+ php_ming.dll Ming functions for Flash None
+ php_msql.dll mSQL functions Requires: msql.dll (bundled)
+ php_mssql.dll MSSQL functions Requires: ntwdblib.dll (bundled)
+ php_mysql.dll MySQL functions PHP >= 5.0.0, requires libmysql.dll
+ (bundled)
+ php_mysqli.dll MySQLi functions PHP >= 5.0.0, requires libmysql.dll
+ (libmysqli.dll in PHP <= 5.0.2) (bundled)
+ php_oci8.dll Oracle 8 functions Requires: Oracle 8.1+ client libraries
+ php_openssl.dll OpenSSL functions Requires: libeay32.dll (bundled)
+ php_oracle.dll Oracle functions Requires: Oracle 7 client libraries
+ php_overload.dll Object overloading functions Built in since PHP 4.3.0
+ php_pdf.dll PDF functions None
+ php_pgsql.dll PostgreSQL functions None
+ php_printer.dll Printer functions None
+ php_shmop.dll Shared Memory functions None
+ php_snmp.dll SNMP get and walk functions NT only!
+ php_soap.dll SOAP functions PHP >= 5.0.0
+ php_sockets.dll Socket functions None
+ php_sybase_ct.dll Sybase functions Requires: Sybase client libraries
+ php_tidy.dll Tidy functions PHP >= 5.0.0
+ php_tokenizer.dll Tokenizer functions Built in since PHP 4.3.0
+ php_w32api.dll W32api functions None
+ php_xmlrpc.dll XML-RPC functions PHP >= 4.2.1 requires: iconv.dll
+ (bundled)
+ php_xslt.dll XSLT functions PHP <= 4.2.0 requires sablot.dll,
+ expat.dll (bundled). PHP >= 4.2.1 requires sablot.dll, expat.dll,
+ iconv.dll (bundled).
+ php_yaz.dll YAZ functions Requires: yaz.dll (bundled)
+ php_zip.dll Zip File functions Read only access
+ php_zlib.dll ZLib compression functions Built in since PHP 4.3.0
+ _________________________________________________________________
+
+Chapter 3. Installation of PECL extensions
+
+Introduction to PECL Installations
+
+ PHP extensions may be installed in a variety of ways. PECL is a
+ repository of PHP extensions living within the PEAR structure, and the
+ following demonstrates how to install these extensions.
+
+ These instructions assume /your/phpsrcdir/ is the path to the PHP
+ source, and extname is the name of the PECL extension. Adjust
+ accordingly. These instructions also assume a familiarity with the
+ pear command.
+
+ Shared extensions may be installed by including them inside of php.ini
+ using the extension PHP directive. See also the extensions_dir
+ directive, and dl(). The installation methods described below do not
+ automatically configure PHP to include these extensions, this step
+ must be done manually.
+
+ When building PHP modules, it's important to have the appropriate
+ versions of the required tools (autoconf, automake, libtool, etc.) See
+ the Anonymous CVS Instructions for details on the required tools, and
+ required versions.
+ _________________________________________________________________
+
+Downloading PECL extensions
+
+ There are several options for downloading PECL extensions, such as:
+
+ * http://pecl.php.net
+ Listed here is information like the ChangeLog, release
+ information, requirements, revisions, etc. Although not every PECL
+ extension has a webpage, most do.
+ * pear download extname
+ The pear command may also be used to download source files.
+ Specific revisions may also be specified.
+ * CVS
+ All PECL files reside in CVS. A web-based view may be seen at
+ http://cvs.php.net/pecl/. To download straight from CVS, consider
+ the following where phpfi is the password for user cvsread:
+
+$ cvs -d:pserver:cvsread@cvs.php.net:/repository login
+$ cvs -d:pserver:cvsread@cvs.php.net:/repository co pecl/extname
+
+ * Windows downloads
+ Windows users may find compiled PECL binaries by downloading the
+ Collection of PECL modules from the PHP Downloads page, and by
+ retrieving a PECL Snapshot. To compile PHP under Windows, read the
+ Win32 Build README.
+ _________________________________________________________________
+
+PECL for Windows users
+
+ Like with any other PHP extension DLL, to install move the PECL
+ extension DLLs into the extension_dir folder and include them within
+ php.ini. For example:
+
+ extension=php_extname.dll
+
+ After doing this, restart the web server.
+ _________________________________________________________________
+
+Compiling shared PECL extensions with PEAR
+
+ PEAR makes it easy to create shared PHP extensions. Using the pear
+ command, do the following:
+
+ $ pear install extname
+
+ That will download the source for extname, and compile it on the
+ system. This results in an extname.so file that may then be included
+ in php.ini
+
+ In case the systems preferred_state is set higher than an available
+ extname version, like it's set to stable and the extension is still in
+ beta, either alter the preferred_state via pear config-set or specify
+ a specific version of the PECL extension. For example:
+
+ $ pear install extname-0.1.1
+
+ Regardless, pear will copy this extname.so into the extensions
+ directory. Adjust php.ini accordingly.
+ _________________________________________________________________
+
+Compiling shared PECL extensions with phpize
+
+ If using pear is not an option, like for building shared PECL
+ extensions from CVS, or for unreleased PECL packages, then creating a
+ shared extension may also be done by manually using the phpize
+ command. The pear command essentially does this but it may also be
+ done manually. Assuming the source file is named extname.tgz, and that
+ it was downloaded into the current directory, consider the following:
+
+$ pear download extname
+$ gzip -d < extname.tgz | tar -xvf -
+$ cd extname
+$ phpize
+$ ./configure && make
+
+ Upon success, this will create extname.so and put it into the modules/
+ and/or .libs/ directory within the extname/ source. Move this shared
+ extension (extname.so) into the PHP extensions directory, and adjust
+ php.ini accordingly.
+ _________________________________________________________________
+
+Compiling PECL extensions statically into PHP
+
+ To statically include the extension within the PHP build, put the
+ extensions source into the ext/ directory found in the PHP source. For
+ example:
+
+$ cd /your/phpsrcdir/ext
+$ pear download extname
+$ gzip -d < extname.tgz | tar -xvf -
+$ mv extname-x.x.x extname
+$ rm package.xml
+
+ This will result in the following directory:
+
+ /your/phpsrcdir/ext/extname
+
+ From here, build PHP as normal:
+
+$ cd /your/phpsrcdir
+$ ./buildconf
+$ ./configure --help
+$ ./configure --with-extname --enable-someotherext --with-foobar
+$ make
+$ make install
+
+ Whether --enable-extname or --with-extname is used depends on the
+ extension. Typically an extension that does not require external
+ libraries uses --enable. To be sure, run the following after
+ buildconf:
+
+ $ ./configure --help | grep extname
+ _________________________________________________________________
+
+Chapter 4. Problems?
+
+Read the FAQ
+
+ Some problems are more common than others. The most common ones are
+ listed in the PHP FAQ, part of this manual.
+ _________________________________________________________________
+
+Other problems
+
+ If you are still stuck, someone on the PHP installation mailing list
+ may be able to help you. You should check out the archive first, in
+ case someone already answered someone else who had the same problem as
+ you. The archives are available from the support page on
+ http://www.php.net/support.php. To subscribe to the PHP installation
+ mailing list, send an empty mail to
+ php-install-subscribe@lists.php.net. The mailing list address is
+ php-install@lists.php.net.
+
+ If you want to get help on the mailing list, please try to be precise
+ and give the necessary details about your environment (which operating
+ system, what PHP version, what web server, if you are running PHP as
+ CGI or a server module, safe mode, etc...), and preferably enough code
+ to make others able to reproduce and test your problem.
+ _________________________________________________________________
+
+Bug reports
+
+ If you think you have found a bug in PHP, please report it. The PHP
+ developers probably don't know about it, and unless you report it,
+ chances are it won't be fixed. You can report bugs using the
+ bug-tracking system at http://bugs.php.net/. Please do not send bug
+ reports in mailing list or personal letters. The bug system is also
+ suitable to submit feature requests.
+
+ Read the How to report a bug document before submitting any bug
+ reports!
+ _________________________________________________________________
+
+Chapter 5. Runtime Configuration
+
+The configuration file
+
+ The configuration file (called php3.ini in PHP 3, and simply php.ini
+ as of PHP 4) is read when PHP starts up. For the server module
+ versions of PHP, this happens only once when the web server is
+ started. For the CGI and CLI version, it happens on every invocation.
+
+ The default location of php.ini is a compile time option (see the FAQ
+ entry), but can be changed for the CGI and CLI version with the -c
+ command line switch, see the chapter about using PHP from the command
+ line. You can also use the environment variable PHPRC for an
+ additional path to search for a php.ini file.
+
+ If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is
+ e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini.
+
+ Note: The Apache web server changes the directory to root at
+ startup causing PHP to attempt to read php.ini from the root
+ filesystem if it exists.
+
+ The php.ini directives handled by extensions are documented
+ respectively on the pages of the extensions themselves. The list of
+ the core directives is available in the appendix. Probably not all the
+ PHP directives are documented in the manual though. For a completel
+ list of directives available in your PHP version, please read your
+ well commented php.ini file. Alternatively, you may find the the
+ latest php.ini from CVS helpful too.
+
+ Example 5-1. php.ini example
+; any text on a line after an unquoted semicolon (;) is ignored
+[php] ; section markers (text within square brackets) are also ignored
+; Boolean values can be set to either:
+; true, on, yes
+; or false, off, no, none
+register_globals = off
+track_errors = yes
+
+; you can enclose strings in double-quotes
+include_path = ".:/usr/local/lib/php"
+
+; backslashes are treated the same as any other character
+include_path = ".;c:\php\lib"
+ _________________________________________________________________
+
+How to change configuration settings
+
+Running PHP as an Apache module
+
+ When using PHP as an Apache module, you can also change the
+ configuration settings using directives in Apache configuration files
+ (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride
+ Options" or "AllowOverride All" privileges to do so.
+
+ With PHP 4 and PHP 5, there are several Apache directives that allow
+ you to change the PHP configuration from within the Apache
+ configuration files. For a listing of which directives are
+ PHP_INI_ALL, PHP_INI_PERDIR, or PHP_INI_SYSTEM, have a look at the
+ List of php.ini directives appendix.
+
+ Note: With PHP 3, there are Apache directives that correspond to
+ each configuration setting in the php3.ini name, except the name is
+ prefixed by "php3_".
+
+ php_value name value
+ Sets the value of the specified directive. Can be used only
+ with PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a
+ previously set value use none as the value.
+
+ Note: Don't use php_value to set boolean values. php_flag (see
+ below) should be used instead.
+
+ php_flag name on|off
+ Used to set a boolean configuration directive. Can be used only
+ with PHP_INI_ALL and PHP_INI_PERDIR type directives.
+
+ php_admin_value name value
+ Sets the value of the specified directive. This can not be used
+ in .htaccess files. Any directive type set with php_admin_value
+ can not be overridden by .htaccess or virtualhost directives.
+ To clear a previously set value use none as the value.
+
+ php_admin_flag name on|off
+ Used to set a boolean configuration directive. This can not be
+ used in .htaccess files. Any directive type set with
+ php_admin_flag can not be overridden by .htaccess or
+ virtualhost directives.
+
+ Example 5-2. Apache configuration example
+<IfModule mod_php5.c>
+ php_value include_path ".:/usr/local/lib/php"
+ php_admin_flag safe_mode on
+</IfModule>
+<IfModule mod_php4.c>
+ php_value include_path ".:/usr/local/lib/php"
+ php_admin_flag safe_mode on
+</IfModule>
+<IfModule mod_php3.c>
+ php3_include_path ".:/usr/local/lib/php"
+ php3_safe_mode on
+</IfModule>
+
+ Caution
+
+ PHP constants do not exist outside of PHP. For example, in httpd.conf
+ you can not use PHP constants such as E_ALL or E_NOTICE to set the
+ error_reporting directive as they will have no meaning and will
+ evaluate to 0. Use the associated bitmask values instead. These
+ constants can be used in php.ini
+ _________________________________________________________________
+
+Changing PHP configuration via the Windows registry
+
+ When running PHP on Windows, the configuration values can be modified
+ on a per-directory basis using the Windows registry. The configuration
+ values are stored in the registry key HKLM\SOFTWARE\PHP\Per Directory
+ Values, in the sub-keys corresponding to the path names. For example,
+ configuration values for the directory c:\inetpub\wwwroot would be
+ stored in the key HKLM\SOFTWARE\PHP\Per Directory
+ Values\c\inetpub\wwwroot. The settings for the directory would be
+ active for any script running from this directory or any subdirectory
+ of it. The values under the key should have the name of the PHP
+ configuration directive and the string value. PHP constants in the
+ values are not parsed. However, only configuration values changeable
+ in PHP_INI_USER can be set this way, PHP_INI_PERDIR values can not.
+ _________________________________________________________________
+
+Other interfaces to PHP
+
+ Regardless of how you run PHP, you can change certain values at
+ runtime of your scripts through ini_set(). See the documentation on
+ the ini_set() page for more information.
+
+ If you are interested in a complete list of configuration settings on
+ your system with their current values, you can execute the phpinfo()
+ function, and review the resulting page. You can also access the
+ values of individual configuration directives at runtime using
+ ini_get() or get_cfg_var().
diff --git a/win32/installer/README b/win32/installer/README
new file mode 100644
index 000000000..e72534c99
--- /dev/null
+++ b/win32/installer/README
@@ -0,0 +1,93 @@
+PHP Installer for Win32, by Wez Furlong <wez@thebrainroom.com>
+==============================================================
+$Id: README,v 1.3 2004/01/17 13:00:24 sniper Exp $
+
+Here are the supporting scripts for building the win32 PHP installer.
+
+Requirements:
+
+ MSI-2-XML from http://msi2xml.sourceforge.net/#Installation
+
+
+Installer Layout:
+
+We have the following features:
+
+ o PHP Core - Always installed.
+ Includes php5ts.dll, php.ini + common dlls
+ and config files
+
+ o SAPI
+ Contains a node for each stable SAPI
+
+ o Extensions
+ Contains a node for each stable extension
+
+ o Experimental
+ o SAPI Experimental SAPIs
+ o Extensions Experimental Extensions
+
+
+
+
+
+
+
+
+You need to have the Super-Pimp Installer from Nullsoft (Open Source).
+It is available here:
+ http://nsis.sourceforge.net/
+
+To build an installer, you need:
+
+ o A Source Tree
+ o A win32 snapshot (extracted from the .zip)
+
+ (The source tree and snapshot should have matching versions!)
+
+A Script/Batch file.
+I'm using this (in a .bat file):
+
+----------------------------------------------------------------
+cd <snapshot_root>
+cli\php <source_root>\win32\installer\gen-nsis.php > php.nsi
+"C:\Program Files\NSIS\makensis" /pause /nocd php.nsi
+----------------------------------------------------------------
+
+ ** It is a good idea to examine the php.nsi file for WARNING
+ ** comments. These indicate inconsistencies about your source
+ ** tree structure.
+
+This will generate InstallPHP<Version>.exe, where <Version> is the version of
+the php in the snapshot. The Installer will be placed in the snapshot root.
+
+Installer Concept
+=================
+
+Maintaining installers is a real chore, so we use PHP to generate as much as
+possible.
+
+The gen-nsis.php script will examine the extensions dir from the snapshot and
+then attempt to extract information about the extensions from the source code.
+The sapi dir is subjected to similar treatment.
+
+Throughout the installation, values for php.ini settings are decided; these are
+appended to a temporary file. After everything has been installed, the
+iniset.php script is run and merges the values from the temporary file into the
+"official" php.ini.
+
+These scripts take advantage of features found in PHP 4.3.0 and later, so you
+can't build a PHP 4.2.x distro with it.
+
+Hacking
+=======
+
+While hacking, it's a good idea to comment out the SetCompressor line; it will
+speed up your installer builds...
+Also, switch the logic for the $SYSDIR define at the top to install vital DLLs
+to a fake system dir.
+
+
+
+vim:et:tw=78
+
diff --git a/win32/installer/gen-nsis.php b/win32/installer/gen-nsis.php
new file mode 100644
index 000000000..50092bac1
--- /dev/null
+++ b/win32/installer/gen-nsis.php
@@ -0,0 +1,446 @@
+; PHP Installer for NSIS
+; Based on Welcome/Finish Page Example Script (Written by Joost Verburg)
+; Author: Wez Furlong <wez@thebrainroom.com>
+; $Id: gen-nsis.php,v 1.4 2004/01/17 13:00:24 sniper Exp $
+<?php
+
+define('PHPVERSION', phpversion());
+define('SOURCEDIR', dirname(__FILE__) . "\\..\\..\\");
+define('DISTDIR', getcwd());
+
+/* for testing, install system files in a safe dir */
+
+if (false) {
+ $SYSDIR = "\$INSTDIR\\system";
+} else {
+ $SYSDIR = "\$SYSDIR";
+}
+
+$sections = array(
+ "core" => array(
+ "label" => "-PHP Core (Required)",
+ "files" => array(
+ "$SYSDIR" => array(
+ "dlls\\*.dll",
+ "php5ts.dll",
+ ),
+ "\$INSTDIR" => array(
+ "*.txt",
+ "php.gif",
+ "php.ini-*",
+ ),
+ ),
+ "extras" => "Call CopyPHPIni\nWriteUninstaller \"\$INSTDIR\\Uninstall.exe\""
+ ),
+
+ "cgi" => array(
+ "group" => "SAPI",
+ "label" => "CGI",
+ "description" => "CGI Interface - should work with most web servers",
+ "files" => array(
+ "\$INSTDIR" => array(
+ "php.exe"
+ ),
+ "\$INSTDIR\\sapi" => array(
+ "sapi\\pws-php5cgi.reg"
+ ),
+ ),
+ ),
+
+ /* CLI is required by the installer */
+ "cli" => array(
+ "group" => "SAPI",
+ "label" => "-CLI",
+ "description" => "Command Line Interface for running PHP scripts as batch files",
+ "files" => array(
+ "\$INSTDIR\\cli" => array(
+ "cli\\php.exe"
+ ),
+ ),
+ ),
+
+ "embed" => array(
+ "group" => "SAPI",
+ "label" => "Embed",
+ "description" => "Libraries for embedding PHP into your own projects",
+ "files" => array(
+ "\$INSTDIR" => array(
+ "*.lib"
+ ),
+ ),
+ ),
+
+ "mibs" => array(
+ "group" => "Extras",
+ "label" => "MIBS for SNMP",
+ "description" => "MIB information for the SNMP extension",
+ "files" => array(
+ "\$INSTDIR\\mibs" => array(
+ "mibs\\*"
+ ),
+ ),
+ ),
+
+ "pdfstuff" => array(
+ "group" => "Extras",
+ "label" => "PDF support files",
+ "description" => "Fonts and codepage data files for the PDF extensions",
+ "files" => array(
+ "\$INSTDIR\\pdf-related" => array(
+ "pdf-related\\*"
+ ),
+ ),
+ ),
+
+ "mimemagic" => array(
+ "group" => "Extras",
+ "label" => "Mime Magic",
+ "description" => "The magic information file for the mimemagic extension",
+ "files" => array(
+ "\$INSTDIR" => array(
+ "magic.mime"
+ ),
+ ),
+ ),
+
+ "openssl" => array(
+ "group" => "Extras",
+ "label" => "OpenSSL",
+ "description" => "OpenSSL configuration information which you must read if you plan to use PHP as a Certificate Authority",
+ "files" => array(
+ "\$INSTDIR\\openssl" => array(
+ "openssl\\*"
+ ),
+ ),
+ ),
+
+
+
+);
+
+$groups = array(
+ 'SAPI' => array("SAPI", "Select which Server API's to install."),
+ 'EXT' => array("Extensions", "Select which extensions to install."),
+ 'XSAPI' => array("Experimental SAPI", "Experimental Server API's - use at your own risk!"),
+ 'XEXT' => array("Experimental Extensions", "Experimental Extensions - use at your own risk!"),
+ 'Extras' => array("Extras", "Supplemental Files"),
+ );
+
+function xglob($pattern)
+{
+ if (strpos($pattern, '*') === false) {
+ return array($pattern);
+ }
+ $dir = dirname($pattern);
+ $pattern = basename($pattern);
+
+ $pattern = str_replace(array('*', '.'), array('.*', '\.'), $pattern);
+
+ $files = array();
+
+ $d = opendir($dir);
+ while ($f = readdir($d)) {
+ if ($f == '.' || $f == '..' || preg_match('/^\..*\.swp$/', $f))
+ continue;
+ if (preg_match('@' . $pattern . '@i', $f)) {
+ $files[] = $dir . '\\' . $f;
+ }
+ }
+
+ return $files;
+}
+
+/* Look for extensions and determine their info based on the source tree.
+ * We can determine the name and author from the CREDITS file.
+ * We can determine experimental status from the EXPERIMENTAL file.
+ * It would be nice to have a standard description line in the CREDITS too.
+ */
+$extension_abbreviations = array(
+ 'ifx' => 'informix',
+ 'gd2' => 'gd',
+ );
+
+$sapi_abbreviations = array(
+ 'apache2' => 'apache2filter',
+ 'srvlt' => 'servlet',
+);
+
+function add_sections($pattern, $groupname, $abbrev, &$sections, $sourcedirs, $instdir)
+{
+ $avail = xglob($pattern);
+
+ foreach ($avail as $extname) {
+ /* mangle name */
+ if (preg_match('/(php_|php5|php)([^_].*)\.dll/', basename($extname), $matches)) {
+ $ext = $matches[2];
+ } else {
+ $ext = basename($extname);
+ }
+
+ if (isset($abbrev[$ext])) {
+ $ext = $abbrev[$ext];
+ }
+
+ $extdir = null;
+
+ foreach ($sourcedirs as $sourcedir) {
+ // Allow absolute path for separate PECL checkout
+ if ($sourcedir{0} == '\\' || $sourcedir{1} == ':')
+ $extdir = $sourcedir;
+ else
+ $extdir = SOURCEDIR . $sourcedir . '/' . $ext . '/';
+
+ if (is_dir($extdir))
+ break;
+
+ $extdir = null;
+ }
+
+ if ($extdir === null || !is_dir($extdir)) {
+ echo "; WARNING: could not find source dir for extension $extname -> $extdir ($ext)\n";
+ }
+
+ $exp = file_exists($extdir . 'EXPERIMENTAL');
+ if (file_exists($extdir . 'CREDITS')) {
+ list($title, $authors, $description) = file($extdir . 'CREDITS');
+ $title = trim($title);
+ $authors = trim($authors);
+ $description = trim($description);
+
+ if (strlen($title) == 0)
+ $title = $ext;
+
+ } else {
+ $title = $ext;
+ $authors = "Unknown, or uncredited";
+ $description = "";
+ }
+
+ /* build list of support files.
+ * in theory, only needed for the srvlt sapi, but useful to keep this
+ * generic */
+ $filepat = preg_replace('/\.[^\.]+$/', '.*', $extname);
+
+ if ($groupname == 'EXT') {
+ }
+
+ $sections['ext_' . $ext] = array(
+ 'group' => ($exp ? 'X' : '') . $groupname,
+ 'label' => $title,
+ 'description' => $title . ".\$\\nAuthors: $authors",
+ 'files' => array(
+ "\$INSTDIR\\" . $instdir => array(
+ $filepat
+ ),
+ ),
+/* 'extras' => $groupname == 'EXT' ? "Push \"extension=" . basename($extname) . "\"\nCall AddIniSetting\n\n" : "" */
+ );
+
+ }
+
+
+}
+
+add_sections('extensions\\*.dll', 'EXT', $extension_abbreviations, $sections, array('ext'), 'extensions');
+add_sections('sapi\\*.dll', 'SAPI', $sapi_abbreviations, $sections, array('sapi'), 'sapi');
+
+
+
+
+
+$SECTIONS = "";
+$sections_stage1 = array();
+
+/* list of files to uninstall */
+$uninstall = array();
+$rmdirs = array();
+/* description texts */
+$descriptions = array();
+
+$dirs_no_delete = array("\$SYSDIR", "\$INSTDIR");
+
+foreach ($sections as $sectionid => $sectiondata) {
+ $descriptions[] = "\t!insertmacro MUI_DESCRIPTION_TEXT \${Sec$sectionid} \"" . $sectiondata['description'] . "\"";
+
+ if (isset($sectiondata['group'])) {
+ $sub = "Sub";
+ $group = $sectiondata['group'];
+ } else {
+ $sub = "";
+ $group = '_top_';
+ }
+
+ $body = "Section \"" . $sectiondata['label'] . "\" Sec$sectionid\n";
+
+ foreach ($sectiondata['files'] as $outputdir => $filelist) {
+ $body .= "\tSetOutPath \"$outputdir\"\n";
+ foreach ($filelist as $pattern) {
+ $files = xglob($pattern);
+ foreach ($files as $filename) {
+ $uninstall[] = "\tDelete \"$outputdir\\" . basename($filename) . "\"";
+
+ $body .= "\tFile \"$filename\"\n";
+ }
+ }
+ if (!in_array($outputdir, $dirs_no_delete) && !isset($rmdirs[$outputdir])) {
+ $rmdirs[$outputdir] = "\tRMDir \"$outputdir\"";
+ }
+ }
+
+ $body .= $sectiondata['extras'];
+
+ $body .= "\nSectionEnd\n";
+
+ $sections_stage1[$group] .= $body . "\n\n";
+}
+
+foreach ($sections_stage1 as $group => $data)
+{
+ if ($group == '_top_') {
+ $SECTIONS .= $data . "\n";
+ } else {
+ $descriptions[] = "\t!insertmacro MUI_DESCRIPTION_TEXT \${SecGroup$group} \"" . $groups[$group][1] . "\"";
+ $SECTIONS .= "SubSection /e \"" . $groups[$group][0] . "\" SecGroup$group\n$data\nSubSectionEnd\n\n";
+ }
+}
+
+/* Now build descriptions */
+$DESCRIPTIONS = implode("\n", $descriptions) . "\n";
+
+/* And the uninstallation section */
+$UNINSTALL = implode("\n", $uninstall) . "\n" . implode("\n", $rmdirs) . "\n";
+
+?>
+
+!define MUI_PRODUCT "PHP - Hypertext Preprocessor"
+!define MUI_VERSION "<?= PHPVERSION ?>"
+; The second UI has a wider area for the component names
+!define MUI_UI "${NSISDIR}\Contrib\UIs\modern2.exe"
+
+!include "${NSISDIR}\Contrib\Modern UI\System.nsh"
+
+;--------------------------------
+;Configuration
+
+!define MUI_WELCOMEPAGE
+!define MUI_LICENSEPAGE
+!define MUI_COMPONENTSPAGE
+!define MUI_DIRECTORYPAGE
+
+!define MUI_FINISHPAGE
+;!define MUI_FINISHPAGE_RUN "$INSTDIR\modern.exe"
+
+!define MUI_ABORTWARNING
+
+!define MUI_UNINSTALLER
+!define MUI_UNCONFIRMPAGE
+
+;Language
+!insertmacro MUI_LANGUAGE "English"
+
+;General
+OutFile "InstallPHP<?= PHPVERSION ?>.exe"
+
+SetCompressor bzip2
+ShowInstDetails show
+;License page
+LicenseData "license.txt"
+
+;Folder-selection page
+InstallDir "C:\PHP-<?= PHPVERSION ?>"
+;define NSIS_CONFIG_LOG "install.log"
+;LogSet on
+
+!cd <?= SOURCEDIR ?>win32\installer
+
+;Things that need to be extracted on startup (keep these lines before any File command!)
+;Only useful for BZIP2 compression
+;Use ReserveFile for your own Install Options ini files too!
+!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
+!insertmacro MUI_RESERVEFILE_SPECIALINI
+!insertmacro MUI_RESERVEFILE_SPECIALBITMAP
+
+!cd <?= DISTDIR ?>
+
+!insertmacro MUI_SYSTEM
+
+
+;--------------------------------
+;Installer Sections
+
+Function AddIniSetting
+ Pop $R0
+
+ FileOpen $R2 "$INSTDIR\.ini-add" "a"
+ FileSeek $R2 0 END
+ FileWrite $R2 "$R0$\n"
+ FileClose $R2
+
+FunctionEnd
+
+Function CopyPHPIni
+ ; Ensure that we have a working php.ini to reflect the
+ ; installation options.
+ ; Extensions will call a function to activate their entry
+ ; in the ini file as they are installed.
+
+ Rename "$WINDIR\php.ini" "$WINDIR\php.ini.old"
+ CopyFiles "$INSTDIR\php.ini-dist" "$WINDIR\php.ini"
+
+; These files will be deleted during post-installation
+ CopyFiles "<?= $SYSDIR ?>\php5ts.dll" "$INSTDIR\php5ts.dll"
+ File "<?= dirname(__FILE__) ?>\setini.php"
+
+; Set the extension_dir setting in the php.ini
+ Push "extension_dir=$\"$INSTDIR\extensions$\""
+ Call AddIniSetting
+
+FunctionEnd
+
+; Generated Section Info
+<?= $SECTIONS ?>
+; ---------
+
+; Perform final actions after everything has been installed
+Section -post
+ ; Merge ini settings
+
+ Sleep 1000
+
+ ExecWait "$\"$INSTDIR\cli\php.exe$\" $\"-n$\" $\"$INSTDIR\setini.php$\" $\"$WINDIR\php.ini$\" $\"$INSTDIR\.ini-add$\""
+
+ Delete "$INSTDIR\.ini-add" ; Created by the AddIniSetting function
+ Delete "$INSTDIR\setini.php"
+ Delete "$INSTDIR\php5ts.dll"
+
+ ; Add to Add/Remove programs list
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PHP-<?= PHPVERSION ?>" "UninstallString" "$INSTDIR\Uninstall.exe"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PHP-<?= PHPVERSION ?>" "DisplayName" "PHP-<?= PHPVERSION ?> (Uninstall only)"
+
+
+SectionEnd
+
+;--------------------------------
+;Descriptions
+
+!insertmacro MUI_FUNCTIONS_DESCRIPTION_BEGIN
+<?= $DESCRIPTIONS ?>
+!insertmacro MUI_FUNCTIONS_DESCRIPTION_END
+
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+<?= $UNINSTALL ?>
+
+ Delete "$INSTDIR\Uninstall.exe"
+ Delete "$WINDIR\php.ini"
+ RMDir "$INSTDIR"
+ ; Remove from Add/Remove programs list
+ DeleteRegKey /ifempty HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PHP-<?= PHPVERSION ?>"
+
+ !insertmacro MUI_UNFINISHHEADER
+
+SectionEnd
+; vim:sw=4:ts=4:
+; vim600:sw=4:ts=4:noet:fdm=marker
diff --git a/win32/installer/setini.php b/win32/installer/setini.php
new file mode 100644
index 000000000..b443a50ec
--- /dev/null
+++ b/win32/installer/setini.php
@@ -0,0 +1,87 @@
+<?php
+/* $Id: setini.php,v 1.3 2003/02/16 23:46:45 wez Exp $
+ * Wez Furlong <wez@thebrainroom.com>
+ *
+ * Set options in a php.ini file.
+ * This is a support script for the installer.
+ *
+ * $argv[1] is the path to the ini file
+ * $argv[2] is the path to the option file
+ */
+
+echo "Running post-installation script to configure php.ini\n";
+
+function fatal($msg)
+{
+ echo $msg;
+ sleep(5);
+ exit(1);
+}
+
+$ini_name = $argv[1];
+$option_file = $argv[2];
+
+if (!file_exists($option_file)) {
+ fatal("Option file $option_file does not exist");
+}
+
+if (!file_exists($ini_name)) {
+ fatal("inifile $ini_name does not exist");
+}
+
+$options = explode("\n", file_get_contents($option_file));
+$opts = array();
+
+/* Parse the options */
+foreach ($options as $line) {
+ if (strlen(trim($line)) == 0)
+ continue;
+
+ list($name, $value) = explode("=", $line);
+
+ if ($name == "extension") {
+ $pat = "/^;?extension\s*=\s*" . preg_quote($value, '/') . "/i";
+ } else {
+ $pat = "/^;?" . preg_quote($name, '/') . "\s*=\s*/i";
+ }
+
+ $opts[] = array('pat' => $pat, 'name' => $name, 'value' => $value);
+}
+
+$new_name = $ini_name . "~";
+$dest = fopen($new_name, "w");
+
+if (!$dest) {
+ echo "Could not create temporary file! $new_name\n";
+ flush();
+ sleep(10);
+ die("Cannot create temporary file!");
+}
+
+$lines = file($ini_name);
+
+foreach ($lines as $line) {
+
+ foreach ($opts as $k => $optdata) {
+ extract($optdata);
+
+ if (preg_match($pat, $line)) {
+ echo "Found $pat ; setting $name to $value\n";
+ $line = "$name=$value\r\n";
+ // No need to match again
+ unset($opts[$k]);
+ break;
+ }
+ }
+
+ fwrite($dest, $line);
+}
+
+fclose($dest);
+
+unlink($ini_name);
+rename($new_name, $ini_name);
+
+echo "All done!\n";
+sleep(1);
+?>
diff --git a/win32/md5crypt.c b/win32/md5crypt.c
new file mode 100644
index 000000000..46af2f0aa
--- /dev/null
+++ b/win32/md5crypt.c
@@ -0,0 +1,163 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Edin Kadribasic |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: md5crypt.c,v 1.5 2004/01/08 08:18:21 andi Exp $ */
+
+/*
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ *
+ * from FreeBSD: crypt.c,v 1.5 1996/10/14 08:34:02 phk Exp
+ * via OpenBSD: md5crypt.c,v 1.9 1997/07/23 20:58:27 kstailey Exp
+ * via NetBSD: md5crypt.c,v 1.4.2.1 2002/01/22 19:31:59 he Exp
+ *
+ */
+
+#include "php.h"
+#include "ext/standard/md5.h"
+#include "md5crypt.h"
+
+static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
+ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+
+static void to64(char *, php_uint32, int);
+
+static void
+to64(char *s, php_uint32 v, int n)
+{
+
+ while (--n >= 0) {
+ *s++ = itoa64[v & 0x3f];
+ v >>= 6;
+ }
+}
+
+/*
+ * MD5 password encryption.
+ */
+char *
+md5_crypt(const char *pw, const char *salt)
+{
+ static char passwd[120], *p;
+ const char *sp, *ep;
+ unsigned char final[16];
+ unsigned int i, sl, pwl;
+ PHP_MD5_CTX ctx, ctx1;
+ php_uint32 l;
+ int pl;
+
+ pwl = strlen(pw);
+
+ /* Refine the salt first */
+ sp = salt;
+
+ /* If it starts with the magic string, then skip that */
+ if (strncmp(sp, MD5_MAGIC, MD5_MAGIC_LEN) == 0)
+ sp += MD5_MAGIC_LEN;
+
+ /* It stops at the first '$', max 8 chars */
+ for (ep = sp; *ep != '\0' && *ep != '$' && ep < (sp + 8); ep++)
+ continue;
+
+ /* get the length of the true salt */
+ sl = ep - sp;
+
+ PHP_MD5Init(&ctx);
+
+ /* The password first, since that is what is most unknown */
+ PHP_MD5Update(&ctx, (const unsigned char *)pw, pwl);
+
+ /* Then our magic string */
+ PHP_MD5Update(&ctx, (const unsigned char *)MD5_MAGIC, MD5_MAGIC_LEN);
+
+ /* Then the raw salt */
+ PHP_MD5Update(&ctx, (const unsigned char *)sp, sl);
+
+ /* Then just as many characters of the MD5(pw,salt,pw) */
+ PHP_MD5Init(&ctx1);
+ PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl);
+ PHP_MD5Update(&ctx1, (const unsigned char *)sp, sl);
+ PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl);
+ PHP_MD5Final(final, &ctx1);
+
+ for (pl = pwl; pl > 0; pl -= 16)
+ PHP_MD5Update(&ctx, final, (unsigned int)(pl > 16 ? 16 : pl));
+
+ /* Don't leave anything around in vm they could use. */
+ memset(final, 0, sizeof(final));
+
+ /* Then something really weird... */
+ for (i = pwl; i != 0; i >>= 1)
+ if ((i & 1) != 0)
+ PHP_MD5Update(&ctx, final, 1);
+ else
+ PHP_MD5Update(&ctx, (const unsigned char *)pw, 1);
+
+ /* Now make the output string */
+ memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN);
+ strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1);
+ strcat(passwd, "$");
+
+ PHP_MD5Final(final, &ctx);
+
+ /*
+ * And now, just to make sure things don't run too fast. On a 60 MHz
+ * Pentium this takes 34 msec, so you would need 30 seconds to build
+ * a 1000 entry dictionary...
+ */
+ for (i = 0; i < 1000; i++) {
+ PHP_MD5Init(&ctx1);
+
+ if ((i & 1) != 0)
+ PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl);
+ else
+ PHP_MD5Update(&ctx1, final, 16);
+
+ if ((i % 3) != 0)
+ PHP_MD5Update(&ctx1, (const unsigned char *)sp, sl);
+
+ if ((i % 7) != 0)
+ PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl);
+
+ if ((i & 1) != 0)
+ PHP_MD5Update(&ctx1, final, 16);
+ else
+ PHP_MD5Update(&ctx1, (const unsigned char *)pw, pwl);
+
+ PHP_MD5Final(final, &ctx1);
+ }
+
+ p = passwd + sl + MD5_MAGIC_LEN + 1;
+
+ l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p,l,4); p += 4;
+ l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p,l,4); p += 4;
+ l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p,l,4); p += 4;
+ l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p,l,4); p += 4;
+ l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p,l,4); p += 4;
+ l = final[11] ; to64(p,l,2); p += 2;
+ *p = '\0';
+
+ /* Don't leave anything around in vm they could use. */
+ memset(final, 0, sizeof(final));
+ return (passwd);
+}
+
diff --git a/win32/md5crypt.h b/win32/md5crypt.h
new file mode 100644
index 000000000..db742ac70
--- /dev/null
+++ b/win32/md5crypt.h
@@ -0,0 +1,37 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Edin Kadribasic |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: md5crypt.h,v 1.4 2004/01/08 17:33:28 sniper Exp $ */
+#ifndef _MD5CRYPT_H_
+#define _MD5CRYPT_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define MD5_MAGIC "$1$"
+#define MD5_MAGIC_LEN 3
+
+char *md5_crypt(const char *pw, const char *salt);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MD5CRYPT_H_ */ \ No newline at end of file
diff --git a/win32/param.h b/win32/param.h
new file mode 100644
index 000000000..3d0da1e8d
--- /dev/null
+++ b/win32/param.h
@@ -0,0 +1,16 @@
+
+/*****************************************************************************
+ * *
+ * sys/param.c *
+ * *
+ * Freely redistributable and modifiable. Use at your own risk. *
+ * *
+ * Copyright 1994 The Downhill Project *
+ * *
+ *****************************************************************************/
+#ifndef MAXPATHLEN
+#define MAXPATHLEN _MAX_PATH
+#endif
+#define MAXHOSTNAMELEN 64
+#define howmany(x,y) (((x)+((y)-1))/(y))
+#define roundup(x,y) ((((x)+((y)-1))/(y))*(y))
diff --git a/win32/php5.dsp b/win32/php5.dsp
new file mode 100644
index 000000000..0b5b9a6d6
--- /dev/null
+++ b/win32/php5.dsp
@@ -0,0 +1,134 @@
+# Microsoft Developer Studio Project File - Name="php5" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=php5 - 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 "php5.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 "php5.mak" CFG="php5 - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "php5 - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "php5 - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "php5 - Win32 Release_inline" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "php5 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release"
+# PROP Intermediate_Dir "..\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /machine:I386
+# ADD LINK32 php5nts.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 /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php.exe" /libpath:"..\Release"
+
+!ELSEIF "$(CFG)" == "php5 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "c:\php-fcgi"
+# PROP Intermediate_Dir "..\Debug"
+# 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 /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D "_CONSOLE" /D "MSVC5" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 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 php5nts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"c:\php-fcgi\php.exe" /pdbtype:sept /libpath:"..\Debug"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "php5 - Win32 Release_inline"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "php5___Win32_Release_inline"
+# PROP BASE Intermediate_Dir "php5___Win32_Release_inline"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_inline"
+# PROP Intermediate_Dir "..\Release_inline"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex\\" /I "..\bindlib_w32" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c
+# SUBTRACT BASE CPP /YX /Yc /Yu
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 php5nts.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 /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release\php.exe" /libpath:"Release"
+# ADD LINK32 php5nts.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 /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php.exe" /libpath:"..\Release_inline"
+
+!ENDIF
+
+# Begin Target
+
+# Name "php5 - Win32 Release"
+# Name "php5 - Win32 Debug"
+# Name "php5 - Win32 Release_inline"
+# Begin Group "Source Files"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\sapi\cgi\cgi_main.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sapi\cgi\getopt.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ".h"
+# End Group
+# End Target
+# End Project
diff --git a/win32/php5.dsw b/win32/php5.dsw
new file mode 100644
index 000000000..2e7d26672
--- /dev/null
+++ b/win32/php5.dsw
@@ -0,0 +1,107 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "Zend"=..\Zend\Zend.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name TSRM
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "fastcgi"=..\sapi\fastcgi\fastcgi.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dll
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name TSRM
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name Zend
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5"=.\php5.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dll
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name Zend
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name TSRM
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5dll"=.\php5dll.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name Zend
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libmysql
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name TSRM
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/win32/php5dll.dsp b/win32/php5dll.dsp
new file mode 100644
index 000000000..542ce057f
--- /dev/null
+++ b/win32/php5dll.dsp
@@ -0,0 +1,1731 @@
+# Microsoft Developer Studio Project File - Name="php5dll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=php5dll - 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 "php5dll.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 "php5dll.mak" CFG="php5dll - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "php5dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php5dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php5dll - Win32 Release_inline" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "c:\php-fcgi\"
+# PROP Intermediate_Dir "..\Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D "MSVC5" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D "ZEND_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40d /d "_DEBUG"
+# ADD RSC /l 0x40d /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib TSRM.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"c:\php-fcgi\php5nts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug" /libpath:"..\Zend\Debug" /libpath:"..\..\bindlib_w32\Debug"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release"
+# PROP Intermediate_Dir "..\Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLL_EXPORTS" /D "PHP_EXPORTS" /D "SAPI_EXPORTS" /D "LIBZEND_EXPORTS" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40d /d "NDEBUG"
+# ADD RSC /l 0x40d /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib tsrm.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php5nts.dll" /libpath:"..\Zend\Release" /libpath:"..\TSRM\Release_TS" /libpath:"..\..\bindlib_w32\Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "php5dll___Win32_Release_inline"
+# PROP BASE Intermediate_Dir "php5dll___Win32_Release_inline"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_inline"
+# PROP Intermediate_Dir "..\Release_inline"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex" /I "..\bindlib_w32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D ZEND_DEBUG=0 /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40d /d "NDEBUG"
+# ADD RSC /l 0x40d /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php5nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib tsrm.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release\php5nts.dll" /libpath:"..\Zend\Release_inline" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\..\bindlib_w32\Release"
+
+!ENDIF
+
+# Begin Target
+
+# Name "php5dll - Win32 Debug"
+# Name "php5dll - Win32 Release"
+# Name "php5dll - Win32 Release_inline"
+# Begin Group "Core"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\css.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\cyr_convert.c
+# End Source File
+# Begin Source File
+
+SOURCE="..\main\fopen_wrappers.c"
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\internal_functions_win32.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\main.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\mergesort.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\network.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\output.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_content_types.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_ini.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_logos.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_open_temporary_file.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_ticks.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_variables.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\proc_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\quot_print.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\reentrancy.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\rfc1867.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\safe_mode.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\SAPI.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\snprintf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\spprintf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\memory_streams.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\user_streams.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\filters.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\user_filters.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\strlcat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\strlcpy.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\config.w32.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\css.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\cyr_convert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\getopt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\internal_functions_registry.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\logos.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\main.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\output.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php3_compat.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_content_types.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_globals.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_ini.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_logos.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_open_temporary_file.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_realpath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_ticks.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_variables.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\quot_print.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\rfc1867.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\safe_mode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\SAPI.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\snprintf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\spprintf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\win95nt.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Function Modules"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 1"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\array.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\assert.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\base64.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\basic_functions.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\bcmath.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\browscap.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\crc32.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\credits.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\datetime.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dl.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dns.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\exec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\file.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\filestat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\flock_compat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\formatted_print.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\fsock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\ftp_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\head.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\html.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\http_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\image.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\incomplete_class.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\info.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\iptc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\lcg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\levenshtein.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\link.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\mail.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\math.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\md5.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\metaphone.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\microtime.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\mod_files.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\mod_user.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\pack.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\pageinfo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\parsedate.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\odbc\php_odbc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\php_pcre.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# ADD CPP /D "STATIC"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\rand.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\reg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\scanf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\session.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\soundex.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\string.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\strnatcmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\syslog.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\type.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\uniqid.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner_ex.c
+# ADD CPP /W2
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\var.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\var_unserializer.c
+# ADD CPP /W2
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\versioning.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 1"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\base64.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\basic_functions.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\datetime.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dl.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dns.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\exec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\file.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\flock_compat.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\fsock.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\functions\global.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\head.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\html.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\md5.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\mime.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\mod_user.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\pageinfo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\php_bcmath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_dir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_filestat.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_fopen_wrappers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ldap\php_ldap.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_mail.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_metaphone.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\odbc\php_odbc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\php_pcre.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_string.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_syslog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\functions\phpdir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\functions\phpmath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\reg.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\scanf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\type.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\uniqid.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner_ex.h
+# End Source File
+# End Group
+# Begin Group "Regular Expressions"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\regex\regcomp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\regex\regerror.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\regex\regexec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\regex\regfree.c
+# End Source File
+# End Group
+# Begin Group "PCRE"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 3"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\chartables.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# ADD CPP /D "STATIC"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\get.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# ADD CPP /D "STATIC"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\maketables.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# ADD CPP /D "STATIC"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\pcre.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# ADD CPP /D "STATIC"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\study.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# ADD CPP /D "STATIC"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files No. 3"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\internal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\pcre.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "XML"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 4"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\ctype\ctype.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\overload\overload.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\tokenizer\tokenizer.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\wddx\wddx.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\xml\compat.c
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\xml\xml.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 4"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\xml\php_xml.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "FTP"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 6"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\ftp\ftp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ftp\php_ftp.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 6"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\ftp\ftp.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ftp\php_ftp.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Calendar"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 7"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\calendar\cal_unix.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\calendar.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\dow.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\easter.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\french.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\gregor.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\jewish.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\julian.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 7"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\calendar\php_calendar.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\sdncal.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "bcmath"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 8"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\add.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\compare.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\debug.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\div.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\divmod.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\doaddsub.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\init.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\int2num.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\nearzero.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\neg.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\num2long.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\num2str.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\outofmem.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\output.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\raise.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\raisemod.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\recmul.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\rmzero.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\rt.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\sqrt.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\str2num.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\sub.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\zero.c
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files No. 8"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\bcmath.h
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\config.h
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\private.h
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# PROP Intermediate_Dir "..\Release_inline_bcmath"
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Group
+# End Group
+# Begin Group "Win32"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 2"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\com\COM.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com\conversion.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\pwd.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\readdir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\registry.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\sendmail.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\time.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com\VARIANT.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\wfile.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\snmp\winsnmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\winutil.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\wsyslog.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 2"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\com\com.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com\conversion.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\grp.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\param.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com\php_COM.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\php_registry.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com\php_VARIANT.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com\php_versioning.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\pwd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\readdir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\sendmail.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\syslog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\time.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\unistd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com\variant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\wfile.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Parsers"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\parsedate.y
+
+!IF "$(CFG)" == "php5dll - Win32 Debug"
+
+# Begin Custom Build - Generating ext/standard/parsedate.c
+InputPath=..\ext\standard\parsedate.y
+
+"..\ext\standard\parsedate.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\ext\standard
+ bison --output=parsedate.c -v -d parsedate.y
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release"
+
+# Begin Custom Build - Generating ext/standard/parsedate.c
+InputPath=..\ext\standard\parsedate.y
+
+"..\ext\standard\parsedate.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\ext\standard
+ bison --output=parsedate.c -v -d parsedate.y
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "php5dll - Win32 Release_inline"
+
+# Begin Custom Build - Generating ext/standard/parsedate.c
+InputPath=..\ext\standard\parsedate.y
+
+"..\ext\standard\parsedate.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\ext\standard
+ bison --output=parsedate.c -v -d parsedate.y
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Text Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ChangeLog
+# End Source File
+# Begin Source File
+
+SOURCE=..\LICENSE
+# End Source File
+# End Group
+# Begin Group "Support"
+
+# PROP Default_Filter ""
+# End Target
+# End Project
diff --git a/win32/php5dllts.dsp b/win32/php5dllts.dsp
new file mode 100644
index 000000000..60bbad92e
--- /dev/null
+++ b/win32/php5dllts.dsp
@@ -0,0 +1,2442 @@
+# Microsoft Developer Studio Project File - Name="php5dllts" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=php5dllts - Win32 Debug_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "php5dllts.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 "php5dllts.mak" CFG="php5dllts - Win32 Debug_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "php5dllts - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php5dllts - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php5dllts - Win32 Release_TS_inline" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "php5dllts - Win32 Release_TSDbg" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40d /d "_DEBUG"
+# ADD RSC /l 0x40d /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"msvcrt" /out:"..\Debug_TS\php5ts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug_TS" /libpath:"..\..\bindlib_w32\Debug" /libpath:"Debug_TS" /libpath:"..\..\zlib\Debug" /libpath:"..\..\libxml\lib\Debug" /libpath:"..\ext\sqlite\Debug_TS" /libpath:"..\..\libiconv\lib"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TS"
+# PROP Intermediate_Dir "Release_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_STATIC" /FR /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40d /d "NDEBUG"
+# ADD RSC /l 0x40d /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"Release_TS" /libpath:"..\ext\sqlite\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "php5dllts___Win32_Release_TS_inline"
+# PROP BASE Intermediate_Dir "php5dllts___Win32_Release_TS_inline"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TS_inline"
+# PROP Intermediate_Dir "Release_TS_inline"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /FR /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40d /d "NDEBUG"
+# ADD RSC /l 0x40d /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"Release_TS/php5ts.dll" /libpath:"TSRM\Release_TS" /libpath:"Zend\Release_TS" /libpath:"..\bindlib_w32\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TS_inline\php5ts.dll" /libpath:"..\TSRM\Release_TS_inline" /libpath:"..\Zend\Release_TS_inline" /libpath:"Release_TS_Inline" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib" /libpath:"..\ext\sqlite\Release_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "php5dllts___Win32_Release_TSDbg"
+# PROP BASE Intermediate_Dir "php5dllts___Win32_Release_TSDbg"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TSDbg"
+# PROP Intermediate_Dir "Release_TSDbg"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\..\zlib" /I "..\Zend" /I "..\TSRM" /I "..\..\libxml\include" /I "..\ext\sqlite\libsqlite\src" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_WINDOWS" /D "_USRDLL" /D "PHP5DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "TSRM_EXPORTS" /D "SAPI_EXPORTS" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /D "LIBXML_THREAD_ENABLED" /D "LIBXML_STATIC" /FR /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40d /d "NDEBUG"
+# ADD RSC /l 0x40d /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib /nologo /version:4.0 /dll /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcmt.lib" /out:"..\Release_TS\php5ts.dll" /libpath:"..\TSRM\Release_TS" /libpath:"..\Zend\Release_TS" /libpath:"..\..\bindlib_w32\Release" /libpath:"Release_TS"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib ws2_32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ZendTS.lib TSRM.lib resolv.lib zlib.lib libxml2_a.lib Urlmon.lib libsqlite.lib iconv_a.lib /nologo /version:4.0 /dll /debug /machine:I386 /nodefaultlib:"libcmt" /out:"..\Release_TSDbg\php5ts.dll" /libpath:"..\TSRM\Release_TSDbg" /libpath:"..\Zend\Release_TSDbg" /libpath:"Release_TSDbg" /libpath:"..\ext\sqlite\Release_TSDbg" /libpath:"..\..\bindlib_w32\Release" /libpath:"..\..\zlib\Release" /libpath:"..\..\libxml\lib\Release" /libpath:"..\..\libiconv\lib"
+
+!ENDIF
+
+# Begin Target
+
+# Name "php5dllts - Win32 Debug_TS"
+# Name "php5dllts - Win32 Release_TS"
+# Name "php5dllts - Win32 Release_TS_inline"
+# Name "php5dllts - Win32 Release_TSDbg"
+# Begin Group "Core"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\css.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\cyr_convert.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\filters.c
+# End Source File
+# Begin Source File
+
+SOURCE="..\main\fopen_wrappers.c"
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\internal_functions_win32.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\main.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\mergesort.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\network.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\output.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_content_types.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_ini.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_logos.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_open_temporary_file.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_scandir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_sprintf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_ticks.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_variables.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\proc_open.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\quot_print.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\reentrancy.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\rfc1867.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\safe_mode.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\SAPI.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\snprintf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\spprintf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\strlcat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\strlcpy.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\main\config.w32.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\css.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\cyr_convert.h
+# End Source File
+# Begin Source File
+
+SOURCE="..\main\fopen_wrappers.h"
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\getopt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\internal_functions_registry.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\logos.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\output.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php3_compat.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_compat.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_content_types.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_globals.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_ini.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_logos.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_main.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_open_temporary_file.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_output.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_regex.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_scandir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_streams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\php_variables.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\quot_print.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\rfc1867.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\safe_mode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\SAPI.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\snprintf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\spprintf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\win95nt.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Function Modules"
+
+# PROP Default_Filter ""
+# Begin Group "PCRE"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 3"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\chartables.c
+# ADD CPP /D "STATIC" /D "SUPPORT_UTF8"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\get.c
+# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" /D LINK_SIZE=2
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\maketables.c
+# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" /D LINK_SIZE=2
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\pcre.c
+# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" /D LINK_SIZE=2
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\study.c
+# ADD CPP /D "STATIC" /D "SUPPORT_UTF8" /D LINK_SIZE=2
+# End Source File
+# End Group
+# Begin Group "Header Files No. 3"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\internal.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\pcrelib\pcre.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "DOM"
+
+# PROP Default_Filter ""
+# Begin Group "DOM Source Files"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\dom\attr.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\cdatasection.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\characterdata.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\comment.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\document.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\documentfragment.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\documenttype.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\dom_iterators.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domconfiguration.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domerror.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domerrorhandler.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domexception.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domimplementation.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domimplementationlist.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domimplementationsource.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domlocator.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\domstringlist.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\element.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\entity.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\entityreference.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\namednodemap.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\namelist.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\node.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\nodelist.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\notation.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\php_dom.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\processinginstruction.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\string_extend.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\text.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\typeinfo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\userdatahandler.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\xpath.c
+# End Source File
+# End Group
+# Begin Group "DOM Header Files"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\dom\dom_ce.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\dom_fe.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\dom_properties.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\php_dom.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\dom\xml_common.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Group
+# Begin Group "SimpleXML"
+
+# PROP Default_Filter ""
+# Begin Group "SimpleXML Source Files"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\simplexml\simplexml.c
+# End Source File
+# End Group
+# Begin Group "SimpleXML Header Files"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\simplexml\php_simplexml.h
+# End Source File
+# End Group
+# Begin Group "Resource Files No. 1"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Group
+# Begin Group "Regular Expressions"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\regex\regcomp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\regex\regerror.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\regex\regexec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\regex\regfree.c
+# End Source File
+# End Group
+# Begin Group "XML"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 4"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\xml\compat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ctype\ctype.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\tokenizer\tokenizer.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\wddx\wddx.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\xml\xml.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 4"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\wddx\php_wddx.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\wddx\php_wddx_api.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\xml\php_xml.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "FTP"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 6"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\ftp\ftp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ftp\php_ftp.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 6"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\ftp\ftp.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ftp\php_ftp.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Calendar"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 7"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\calendar\cal_unix.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\calendar.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\dow.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\easter.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\french.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\gregor.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\jewish.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\julian.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 7"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\calendar\php_calendar.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\sdncal.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "bcmath"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 8"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\add.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\compare.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\debug.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\div.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\divmod.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\doaddsub.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\init.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\int2num.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\nearzero.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\neg.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\num2long.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\num2str.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\outofmem.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\output.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\raise.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\raisemod.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\recmul.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\rmzero.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\rt.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\sqrt.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\str2num.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\sub.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\zero.c
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# ADD BASE CPP /I "..\ext\bcmath\libbcmath\src"
+# ADD CPP /I "..\ext\bcmath\libbcmath\src"
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Header Files No. 8"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\bcmath.h
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\config.h
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\libbcmath\src\private.h
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Debug_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS_inline"
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# PROP BASE Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+# PROP Intermediate_Dir "ext\bcmath\libbcmath\Release_TS"
+
+!ENDIF
+
+# End Source File
+# End Group
+# End Group
+# Begin Group "zlib"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 10 Nr. 1"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\zlib\zlib.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\zlib\zlib_fopen_wrapper.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 10 Nr. 1"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\zlib\php_zlib.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Standard"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 1"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\array.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\assert.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\base64.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\basic_functions.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\bcmath.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\browscap.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\crc32.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\credits.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\crypt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\datetime.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dl.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dns.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\exec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\file.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\filestat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\flock_compat.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\formatted_print.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\fsock.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\ftp_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\head.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\html.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\http.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\http_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\image.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\incomplete_class.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\info.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\iptc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\lcg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\levenshtein.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\link.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\mail.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\math.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\md5.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\metaphone.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\microtime.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\mod_files.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\mod_user.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\pack.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\pageinfo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\parsedate.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\odbc\php_odbc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\php_pcre.c
+# ADD CPP /D "STATIC"
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\rand.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\reg.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\scanf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\session.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\sha1.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\soundex.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\streamsfuncs.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\string.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\strnatcmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\sunfuncs.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\syslog.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\type.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\uniqid.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner_ex.c
+# ADD CPP /W2
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\uuencode.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\var.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\var_unserializer.c
+# ADD CPP /W2
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\versioning.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 1"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\base64.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\basic_functions.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\datetime.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dl.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\dns.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\exec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\file.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\flock_compat.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\fsock.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\functions\global.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\head.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\html.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\info.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\md5.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\mod_user.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\pageinfo.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_array.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\bcmath\php_bcmath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_crypt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_dir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_filestat.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_fopen_wrappers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_http.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_lcg.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ldap\php_ldap.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_mail.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\odbc\php_odbc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\odbc\php_odbc_includes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\pcre\php_pcre.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_rand.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\session\php_session.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_string.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_sunfuncs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\php_syslog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\functions\phpdir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\functions\phpmath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\reg.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\scanf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\sha1.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\type.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\uniqid.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner_ex.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "SQLite"
+
+# PROP Default_Filter ""
+# Begin Group "Header Files No. 5"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\sqlite\php_sqlite.h
+# End Source File
+# End Group
+# Begin Group "Source Files No. 5"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\sqlite\sess_sqlite.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\sqlite\sqlite.c
+# End Source File
+# End Group
+# End Group
+# Begin Group "LIBXML"
+
+# PROP Default_Filter ""
+# Begin Group "Header Files No. 10"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\libxml\php_libxml.h
+# End Source File
+# End Group
+# Begin Group "Source Files No. 9"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\libxml\libxml.c
+# End Source File
+# End Group
+# End Group
+# End Group
+# Begin Group "Win32"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 2"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\crypt_win32.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\glob.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\md5crypt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\pwd.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\readdir.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\registry.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\select.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\sendmail.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\time.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\wfile.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\snmp\winsnmp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\winutil.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\wsyslog.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 2"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\crypt_win32.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\glob.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\grp.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\param.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\php_registry.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\pwd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\readdir.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\select.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\sendmail.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\syslog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\time.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\unistd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\win32\wfile.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\winutil.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Parsers"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\standard\parsedate.y
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+# Begin Custom Build - Generating ext/standard/parsedate.c
+InputPath=..\ext\standard\parsedate.y
+
+"..\ext\standard\parsedate.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\ext\standard
+ bison --output=parsedate.c -v -d parsedate.y
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+# Begin Custom Build - Generating ext/standard/parsedate.c
+InputPath=..\ext\standard\parsedate.y
+
+"..\ext\standard\parsedate.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\ext\standard
+ bison --output=parsedate.c -v -d parsedate.y
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+# Begin Custom Build - Generating ext/standard/parsedate.c
+InputPath=..\ext\standard\parsedate.y
+
+"..\ext\standard\parsedate.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\ext\standard
+ bison --output=parsedate.c -v -d parsedate.y
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+# Begin Custom Build - Generating ext/standard/parsedate.c
+InputPath=..\ext\standard\parsedate.y
+
+"..\ext\standard\parsedate.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ cd ..\ext\standard
+ bison --output=parsedate.c -v -d parsedate.y
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Group "Text Files"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ChangeLog
+# End Source File
+# Begin Source File
+
+SOURCE=..\LICENSE
+# End Source File
+# Begin Source File
+
+SOURCE=..\NEWS
+# End Source File
+# Begin Source File
+
+SOURCE="..\php.ini-dist"
+# End Source File
+# Begin Source File
+
+SOURCE="..\php.ini-recommended"
+# End Source File
+# Begin Source File
+
+SOURCE="..\README.CVS-RULES"
+# End Source File
+# Begin Source File
+
+SOURCE=..\TODO
+# End Source File
+# End Group
+# Begin Group "Support"
+
+# PROP Default_Filter ""
+# End Group
+# Begin Group "Streams"
+
+# PROP Default_Filter ""
+# Begin Group "streams headers"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\main\streams\php_stream_context.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\php_stream_filter_api.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\php_stream_mmap.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\php_stream_plain_wrapper.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\php_stream_transport.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\php_stream_userspace.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\php_streams_int.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\main\streams\cast.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\filter.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\memory.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\mmap.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\plain_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\streams.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\transports.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\user_filters.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\userspace.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\main\streams\xp_socket.c
+# End Source File
+# End Group
+# Begin Group "COM and DotNet"
+
+# PROP Default_Filter ""
+# Begin Group "Header Files No. 9"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_saproxy.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_wrapper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\php_com_dotnet.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\php_com_dotnet_internal.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_com.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_dotnet.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_extension.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_handlers.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_iterator.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_misc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_olechar.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_persist.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_typeinfo.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\com_dotnet\com_variant.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\php5dllts.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\php5dllts.rc2
+# End Source File
+# Begin Source File
+
+SOURCE=.\phpts.def
+
+!IF "$(CFG)" == "php5dllts - Win32 Debug_TS"
+
+USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def"
+# Begin Custom Build - Generating $(InputPath)
+InputPath=.\phpts.def
+
+"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ builddef.bat > phpts.def
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS"
+
+USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def"
+# Begin Custom Build - Generating $(InputPath)
+InputPath=.\phpts.def
+
+"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ builddef.bat > phpts.def
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TS_inline"
+
+USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def"
+# Begin Custom Build - Generating $(InputPath)
+InputPath=.\phpts.def
+
+"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ builddef.bat > phpts.def
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "php5dllts - Win32 Release_TSDbg"
+
+USERDEP__PHPTS="..\ext\sqlite\php_sqlite.def"
+# Begin Custom Build - Generating $(InputPath)
+InputPath=.\phpts.def
+
+"phpts.def" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ builddef.bat > phpts.def
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# End Target
+# End Project
diff --git a/win32/php5dllts.rc b/win32/php5dllts.rc
new file mode 100644
index 000000000..2e01037ee
--- /dev/null
+++ b/win32/php5dllts.rc
@@ -0,0 +1,126 @@
+//Microsoft Developer Studio generated resource script.
+
+//
+
+#include "resource.h"
+
+
+
+#define APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// Generated from the TEXTINCLUDE 2 resource.
+
+//
+
+#include "winres.h"
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#undef APSTUDIO_READONLY_SYMBOLS
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+// English (U.S.) resources
+
+
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+
+#ifdef _WIN32
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+#pragma code_page(1252)
+
+#endif //_WIN32
+
+
+
+#ifdef APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// TEXTINCLUDE
+
+//
+
+
+
+1 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "resource.h\0"
+
+END
+
+
+
+2 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "#include ""php5dllts.rc2""\r\n"
+
+ "\0"
+
+END
+
+
+
+3 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "\r\n"
+
+ "\0"
+
+END
+
+
+
+#endif // APSTUDIO_INVOKED
+
+
+
+#endif // English (U.S.) resources
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+
+#ifndef APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// Generated from the TEXTINCLUDE 3 resource.
+
+//
+
+#include "php5dllts.rc2"
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#endif // not APSTUDIO_INVOKED
+
+
+
diff --git a/win32/php5dllts.rc2 b/win32/php5dllts.rc2
new file mode 100644
index 000000000..b6c76d18a
--- /dev/null
+++ b/win32/php5dllts.rc2
@@ -0,0 +1,61 @@
+//
+// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+ #error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+#include "../main/php_version.h"
+
+#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build
+#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel
+#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build)
+#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel)
+
+#ifndef _MAC
+//Version
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION
+ PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", "The PHP Group\0"
+ VALUE "FileDescription", "PHP Script Interpreter\0"
+ VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION)
+ VALUE "InternalName", "php\0"
+ VALUE "LegalCopyright", "Copyright © 1997-2004 The PHP Group\0"
+ VALUE "LegalTrademarks", "php\0"
+ VALUE "OriginalFilename", "php5ts.dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "PHP Thread Safe\0"
+ VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION)
+ VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0"
+ VALUE "URL", "http://www.php.net"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/win32/php5ts.dsp b/win32/php5ts.dsp
new file mode 100644
index 000000000..3922904e6
--- /dev/null
+++ b/win32/php5ts.dsp
@@ -0,0 +1,187 @@
+# Microsoft Developer Studio Project File - Name="php5ts" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=php5ts - Win32 Debug_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "php5ts.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 "php5ts.mak" CFG="php5ts - Win32 Debug_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "php5ts - Win32 Release_TS" (based on "Win32 (x86) Console Application")
+!MESSAGE "php5ts - Win32 Debug_TS" (based on "Win32 (x86) Console Application")
+!MESSAGE "php5ts - Win32 Release_TS_inline" (based on "Win32 (x86) Console Application")
+!MESSAGE "php5ts - Win32 Release_TSDbg" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "php5ts - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TS"
+# PROP Intermediate_Dir "Release_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /machine:I386
+# ADD LINK32 php5ts.lib winmm.lib ws2_32.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 /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS"
+
+!ELSEIF "$(CFG)" == "php5ts - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP 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 /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "DEBUG" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 winmm.lib netapi32.lib ws2_32.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 php5ts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"..\Debug_TS/php.exe" /pdbtype:sept /libpath:"..\Debug_TS"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "php5ts - Win32 Release_TS_inline"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "php5ts___Win32_Release_TS_inline"
+# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TS_inline"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TS_inline"
+# PROP Intermediate_Dir "Release_TS_inline"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c
+# SUBTRACT BASE CPP /YX /Yc /Yu
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 php5ts.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 /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS"
+# ADD LINK32 php5ts.lib winmm.lib ws2_32.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 /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS_inline\php.exe" /libpath:"..\Release_TS_inline"
+
+!ELSEIF "$(CFG)" == "php5ts - Win32 Release_TSDbg"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "php5ts___Win32_Release_TSDbg"
+# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TSDbg"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TSDbg"
+# PROP Intermediate_Dir "Release_TSDbg"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
+# SUBTRACT BASE CPP /YX /Yc /Yu
+# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /I "..\sapi\cgi\libfcgi\include" /D FCGI_STATIC=1 /D PHP_FASTCGI=1 /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 php5ts.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 /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS"
+# ADD LINK32 php5ts.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 Ws2_32.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TSDbg\php.exe" /libpath:"..\Release_TSDbg"
+
+!ENDIF
+
+# Begin Target
+
+# Name "php5ts - Win32 Release_TS"
+# Name "php5ts - Win32 Debug_TS"
+# Name "php5ts - Win32 Release_TS_inline"
+# Name "php5ts - Win32 Release_TSDbg"
+# Begin Group "Source Files"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\sapi\cgi\cgi_main.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sapi\cgi\getopt.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\sapi\cgi\php_getopt.h
+# End Source File
+# End Group
+# Begin Group "libfcgi"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\sapi\cgi\libfcgi\fcgiapp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sapi\cgi\libfcgi\os_win32.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\php5ts.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\php5ts.rc2
+# End Source File
+# End Target
+# End Project
diff --git a/win32/php5ts.dsw b/win32/php5ts.dsw
new file mode 100644
index 000000000..029923a11
--- /dev/null
+++ b/win32/php5ts.dsw
@@ -0,0 +1,242 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "EngineSelect"=.\EngineSelect.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ZendTS"=..\Zend\ZendTS.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name TSRM
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name EngineSelect
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "libsqlite"=..\ext\sqlite\libsqlite\src\libsqlite.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "php5activescript"=..\SAPI\activescript\php5activescript.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5aolserver"=..\sapi\aolserver\php5aolserver.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5apache"=..\sapi\apache\php5apache.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5apache2"=..\SAPI\APACHE2HANDLER\php5apache2.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5dllts"=.\php5dllts.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name ZendTS
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name TSRM
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name libsqlite
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5isapi"=..\sapi\isapi\php5isapi.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5nsapi"=..\sapi\nsapi\php5nsapi.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5pi3web"=..\sapi\pi3web\php5pi3web.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5ts"=.\php5ts.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "php5ts_cli"=.\php5ts_cli.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5dllts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "testsuite"=.\testsuite.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name php5ts
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/win32/php5ts.rc b/win32/php5ts.rc
new file mode 100644
index 000000000..d9a4aa541
--- /dev/null
+++ b/win32/php5ts.rc
@@ -0,0 +1,126 @@
+//Microsoft Developer Studio generated resource script.
+
+//
+
+#include "resource.h"
+
+
+
+#define APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// Generated from the TEXTINCLUDE 2 resource.
+
+//
+
+#include "winres.h"
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#undef APSTUDIO_READONLY_SYMBOLS
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+// English (U.S.) resources
+
+
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+
+#ifdef _WIN32
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+#pragma code_page(1252)
+
+#endif //_WIN32
+
+
+
+#ifdef APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// TEXTINCLUDE
+
+//
+
+
+
+1 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "resource.h\0"
+
+END
+
+
+
+2 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "#include ""php5ts.rc2""\r\n"
+
+ "\0"
+
+END
+
+
+
+3 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "\r\n"
+
+ "\0"
+
+END
+
+
+
+#endif // APSTUDIO_INVOKED
+
+
+
+#endif // English (U.S.) resources
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+
+#ifndef APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// Generated from the TEXTINCLUDE 3 resource.
+
+//
+
+#include "php5ts.rc2"
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#endif // not APSTUDIO_INVOKED
+
+
+
diff --git a/win32/php5ts.rc2 b/win32/php5ts.rc2
new file mode 100644
index 000000000..a708ac5ea
--- /dev/null
+++ b/win32/php5ts.rc2
@@ -0,0 +1,61 @@
+//
+// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+ #error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+#include "../main/php_version.h"
+
+#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build
+#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel
+#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build)
+#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel)
+
+#ifndef _MAC
+//Version
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION
+ PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", "The PHP Group\0"
+ VALUE "FileDescription", "PHP Script Interpreter\0"
+ VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION)
+ VALUE "InternalName", "php-cgi\0"
+ VALUE "LegalCopyright", "Copyright © 1997-2004 The PHP Group\0"
+ VALUE "LegalTrademarks", "php\0"
+ VALUE "OriginalFilename", "php.exe\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "PHP Thread Safe CGI\0"
+ VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION)
+ VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0"
+ VALUE "URL", "http://www.php.net"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/win32/php5ts_cli.dsp b/win32/php5ts_cli.dsp
new file mode 100644
index 000000000..37a4113ad
--- /dev/null
+++ b/win32/php5ts_cli.dsp
@@ -0,0 +1,175 @@
+# Microsoft Developer Studio Project File - Name="php5ts_cli" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=php5ts_cli - Win32 Debug_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "php5ts_cli.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 "php5ts_cli.mak" CFG="php5ts_cli - Win32 Debug_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "php5ts_cli - Win32 Release_TS" (based on "Win32 (x86) Console Application")
+!MESSAGE "php5ts_cli - Win32 Debug_TS" (based on "Win32 (x86) Console Application")
+!MESSAGE "php5ts_cli - Win32 Release_TS_inline" (based on "Win32 (x86) Console Application")
+!MESSAGE "php5ts_cli - Win32 Release_TSDbg" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "php5ts_cli - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TS"
+# PROP Intermediate_Dir "Release_TS"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 /machine:I386
+# ADD LINK32 php5ts.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 /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\cli\php.exe" /libpath:"..\Release_TS"
+
+!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\Debug_TS"
+# PROP Intermediate_Dir "Debug_TS"
+# PROP 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 /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D ZEND_DEBUG=1 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /FR /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# 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 winmm.lib netapi32.lib wsock32.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 php5ts_debug.lib /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"..\Debug_TS\cli\php.exe" /pdbtype:sept /libpath:"..\Debug_TS"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Release_TS_inline"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "php5ts___Win32_Release_TS_inline"
+# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TS_inline"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TS_inline"
+# PROP Intermediate_Dir "Release_TS_inline"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "." /I "regex" /I "..\bindlib_w32" /I "Zend" /I "tsrm" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c
+# SUBTRACT BASE CPP /YX /Yc /Yu
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 php5ts.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 /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS"
+# ADD LINK32 php5ts.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 /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS_inline\cli\php.exe" /libpath:"..\Release_TS_inline"
+
+!ELSEIF "$(CFG)" == "php5ts_cli - Win32 Release_TSDbg"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "php5ts___Win32_Release_TSDbg"
+# PROP BASE Intermediate_Dir "php5ts___Win32_Release_TSDbg"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\Release_TSDbg"
+# PROP Intermediate_Dir "Release_TSDbg"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
+# SUBTRACT BASE CPP /YX /Yc /Yu
+# ADD CPP /nologo /MD /W3 /GX /Zi /Od /I ".." /I "..\main" /I "..\regex" /I "..\..\bindlib_w32" /I "..\Zend" /I "..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "_CONSOLE" /D "MSVC5" /D "ZTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "WIN32" /D "_MBCS" /Fr /FD /c
+# SUBTRACT CPP /YX /Yc /Yu
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 php5ts.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 /nologo /version:4.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TS\php.exe" /libpath:"..\Release_TS"
+# ADD LINK32 php5ts.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 /nologo /version:4.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libc.lib" /out:"..\Release_TSDbg\php.exe" /libpath:"..\Release_TSDbg"
+
+!ENDIF
+
+# Begin Target
+
+# Name "php5ts_cli - Win32 Release_TS"
+# Name "php5ts_cli - Win32 Debug_TS"
+# Name "php5ts_cli - Win32 Release_TS_inline"
+# Name "php5ts_cli - Win32 Release_TSDbg"
+# Begin Group "Source Files"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\sapi\cli\getopt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\sapi\cli\php_cli.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\sapi\cli\php_getopt.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\php5ts_cli.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\php5ts_cli.rc2
+# End Source File
+# End Target
+# End Project
diff --git a/win32/php5ts_cli.rc b/win32/php5ts_cli.rc
new file mode 100644
index 000000000..0053e0c7f
--- /dev/null
+++ b/win32/php5ts_cli.rc
@@ -0,0 +1,126 @@
+//Microsoft Developer Studio generated resource script.
+
+//
+
+#include "resource.h"
+
+
+
+#define APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// Generated from the TEXTINCLUDE 2 resource.
+
+//
+
+#include "winres.h"
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#undef APSTUDIO_READONLY_SYMBOLS
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+// English (U.S.) resources
+
+
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+
+#ifdef _WIN32
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+#pragma code_page(1252)
+
+#endif //_WIN32
+
+
+
+#ifdef APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// TEXTINCLUDE
+
+//
+
+
+
+1 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "resource.h\0"
+
+END
+
+
+
+2 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "#include ""php5ts_cli.rc2""\r\n"
+
+ "\0"
+
+END
+
+
+
+3 TEXTINCLUDE DISCARDABLE
+
+BEGIN
+
+ "\r\n"
+
+ "\0"
+
+END
+
+
+
+#endif // APSTUDIO_INVOKED
+
+
+
+#endif // English (U.S.) resources
+
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+
+
+#ifndef APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+
+//
+
+// Generated from the TEXTINCLUDE 3 resource.
+
+//
+
+#include "php5ts_cli.rc2"
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+#endif // not APSTUDIO_INVOKED
+
+
+
diff --git a/win32/php5ts_cli.rc2 b/win32/php5ts_cli.rc2
new file mode 100644
index 000000000..2f1d9e343
--- /dev/null
+++ b/win32/php5ts_cli.rc2
@@ -0,0 +1,61 @@
+//
+// php5dllts.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+ #error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+#include "../main/php_version.h"
+
+#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build
+#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel
+#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build)
+#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel)
+
+#ifndef _MAC
+//Version
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION
+ PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "\0"
+ VALUE "CompanyName", "The PHP Group\0"
+ VALUE "FileDescription", "PHP Script Interpreter\0"
+ VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION)
+ VALUE "InternalName", "php-cli\0"
+ VALUE "LegalCopyright", "Copyright © 1997-2004 The PHP Group\0"
+ VALUE "LegalTrademarks", "php\0"
+ VALUE "OriginalFilename", "php.exe\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "PHP Thread Safe Command Line Interface\0"
+ VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION)
+ VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0"
+ VALUE "URL", "http://www.php.net"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+#endif // !_MAC
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/win32/php_modules.dsw b/win32/php_modules.dsw
new file mode 100644
index 000000000..37b0af64e
--- /dev/null
+++ b/win32/php_modules.dsw
@@ -0,0 +1,521 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "bz2"=..\ext\bz2\bz2.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "cpdf"=..\ext\cpdf\cpdf.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ctype"=..\ext\ctype\ctype.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "curl"=..\ext\curl\curl.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "dba"=..\ext\dba\dba.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "dbase"=..\ext\dbase\dbase.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "dbx"=..\ext\dbx\dbx.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "exif"=..\ext\exif\exif.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "fbsql"=..\ext\fbsql\fbsql.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "fdf"=..\ext\fdf\fdf.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "filepro"=..\ext\filepro\filepro.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "gd"=..\ext\gd\gd.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "gettext"=..\ext\gettext\gettext.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "iconv"=..\ext\iconv\iconv.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ifx"=..\ext\informix\ifx.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "imap"=..\ext\imap\imap.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ingres"=..\ext\ingres_ii\ingres.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "interbase"=..\ext\interbase\interbase.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ldap"=..\ext\ldap\ldap.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "mbstring"=..\ext\mbstring\mbstring.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "mcrypt"=..\ext\mcrypt\mcrypt.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "mcve"=..\ext\mcve\mcve.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "mhash"=..\ext\mhash\mhash.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "mime_magic"=..\ext\mime_magic\mime_magic.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "ming"=..\ext\ming\ming.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "msql"=..\ext\msql\msql.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "mssql"=..\ext\mssql\mssql.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "mysql"=..\ext\mysql\mysql.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "oci8"=..\ext\oci8\oci8.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "openssl"=..\ext\openssl\openssl.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "oracle"=..\ext\oracle\oracle.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "pdf"=..\ext\pdf\pdf.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "pgsql"=..\ext\pgsql\pgsql.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "shmop"=..\ext\shmop\shmop.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "snmp"=..\ext\snmp\snmp.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "sockets"=..\ext\sockets\sockets.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "sybase_ct"=..\ext\sybase_ct\sybase_ct.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "tokenizer"=..\ext\tokenizer\tokenizer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "w32api"=..\ext\w32api\w32api.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "xmlrpc"=..\ext\xmlrpc\xmlrpc.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "xsl"=..\ext\xsl\xsl.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "yaz"=..\ext\yaz\yaz.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/win32/php_registry.h b/win32/php_registry.h
new file mode 100644
index 000000000..2b111dbb8
--- /dev/null
+++ b/win32/php_registry.h
@@ -0,0 +1,8 @@
+#ifndef PHP_REGISTRY_H
+#define PHP_REGISTRY_H
+
+
+void UpdateIniFromRegistry(char *path TSRMLS_DC);
+char *GetIniPathFromRegistry();
+
+#endif /* PHP_REGISTRY_H */
diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h
new file mode 100755
index 000000000..ff9abb30c
--- /dev/null
+++ b/win32/php_win32_globals.h
@@ -0,0 +1,58 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: php_win32_globals.h,v 1.1.2.1 2004/07/30 14:24:59 wez Exp $ */
+
+#ifndef PHP_WIN32_GLOBALS_H
+#define PHP_WIN32_GLOBALS_H
+
+/* misc globals for thread-safety under win32 */
+
+#include "pwd.h"
+
+typedef struct _php_win32_core_globals php_win32_core_globals;
+
+#ifdef ZTS
+# define PW32G(v) TSRMG(php_win32_core_globals_id, php_win32_core_globals*, v)
+extern PHPAPI int php_win32_core_globals_id;
+#else
+# define PW32G(v) (php_win32_core_globals.v)
+extern PHPAPI struct _php_win32_core_globals php_win32_core_globals;
+#endif
+
+struct _php_win32_core_globals {
+ /* syslog */
+ char *log_header;
+ HANDLE log_source;
+
+ /* getpwuid */
+ struct passwd pwd;
+
+ /* getlogin */
+ char *login_name;
+
+ /* time */
+ struct timeval starttime;
+ __int64 lasttime, freq;
+};
+
+void php_win32_core_globals_ctor(void *vg TSRMLS_DC);
+PHP_RSHUTDOWN_FUNCTION(win32_core_globals);
+
+#endif
+
diff --git a/win32/pwd.c b/win32/pwd.c
new file mode 100644
index 000000000..24ceb70e3
--- /dev/null
+++ b/win32/pwd.c
@@ -0,0 +1,66 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Sterling Hughes <sterling@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pwd.c,v 1.9.2.2 2004/09/27 22:21:52 edink Exp $ */
+
+#include "php.h" /*php specific */
+#include <lmaccess.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <lmapibuf.h>
+#include "pwd.h"
+#include "grp.h"
+#include "php_win32_globals.h"
+
+static char *home_dir = ".";
+static char *login_shell = "not command.com!";
+
+struct passwd *
+getpwnam(char *name)
+{
+ return (struct passwd *) 0;
+}
+
+
+char *
+getlogin()
+{
+ char name[256];
+ DWORD max_len = 256;
+ TSRMLS_FETCH();
+
+ STR_FREE(PW32G(login_name));
+ GetUserName(name, &max_len);
+ name[max_len] = '\0';
+ PW32G(login_name) = estrdup(name);
+ return PW32G(login_name);
+}
+
+struct passwd *
+getpwuid(int user_id)
+{
+ TSRMLS_FETCH();
+ PW32G(pwd).pw_name = getlogin();
+ PW32G(pwd).pw_dir = home_dir;
+ PW32G(pwd).pw_shell = login_shell;
+ PW32G(pwd).pw_uid = 0;
+
+ return &PW32G(pwd);
+}
+
diff --git a/win32/pwd.h b/win32/pwd.h
new file mode 100644
index 000000000..68fab897a
--- /dev/null
+++ b/win32/pwd.h
@@ -0,0 +1,38 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Sterling Hughes <sterling@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: pwd.h,v 1.7 2004/01/08 17:33:28 sniper Exp $ */
+
+#ifndef PWD_H
+#define PWD_H
+
+struct passwd {
+ char *pw_name;
+ char *pw_passwd;
+ int pw_uid;
+ int pw_gid;
+ char *pw_comment;
+ char *pw_gecos;
+ char *pw_dir;
+ char *pw_shell;
+};
+
+extern struct passwd *getpwuid(int);
+extern struct passwd *getpwnam(char *name);
+extern char *getlogin(void);
+#endif
diff --git a/win32/pws-php5cgi.reg b/win32/pws-php5cgi.reg
new file mode 100644
index 000000000..46edc7738
--- /dev/null
+++ b/win32/pws-php5cgi.reg
@@ -0,0 +1,6 @@
+REGEDIT4
+
+[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
+".php"="[PUT PATH HERE]\\php.exe"
+
+
diff --git a/win32/pws-php5isapi.reg b/win32/pws-php5isapi.reg
new file mode 100644
index 000000000..393604d28
--- /dev/null
+++ b/win32/pws-php5isapi.reg
@@ -0,0 +1,5 @@
+REGEDIT4
+
+[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map]
+".php"="[PUT PATH HERE]\\php5isapi.dll"
+
diff --git a/win32/readdir.c b/win32/readdir.c
new file mode 100644
index 000000000..6aaafced4
--- /dev/null
+++ b/win32/readdir.c
@@ -0,0 +1,146 @@
+#include <malloc.h>
+#include <string.h>
+#include <errno.h>
+
+#include "readdir.h"
+#include "php.h"
+
+/**********************************************************************
+ * Implement dirent-style opendir/readdir/rewinddir/closedir on Win32
+ *
+ * Functions defined are opendir(), readdir(), rewinddir() and
+ * closedir() with the same prototypes as the normal dirent.h
+ * implementation.
+ *
+ * Does not implement telldir(), seekdir(), or scandir(). The dirent
+ * struct is compatible with Unix, except that d_ino is always 1 and
+ * d_off is made up as we go along.
+ *
+ * The DIR typedef is not compatible with Unix.
+ **********************************************************************/
+
+DIR *opendir(const char *dir)
+{
+ DIR *dp;
+ char *filespec;
+ long handle;
+ int index;
+
+ filespec = malloc(strlen(dir) + 2 + 1);
+ strcpy(filespec, dir);
+ index = strlen(filespec) - 1;
+ if (index >= 0 && (filespec[index] == '/' ||
+ (filespec[index] == '\\' && !IsDBCSLeadByte(filespec[index-1]))))
+ filespec[index] = '\0';
+ strcat(filespec, "/*");
+
+ dp = (DIR *) malloc(sizeof(DIR));
+ dp->offset = 0;
+ dp->finished = 0;
+
+ if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0) {
+ if (errno == ENOENT) {
+ dp->finished = 1;
+ } else {
+ free(dp);
+ free(filespec);
+ return NULL;
+ }
+ }
+ dp->dir = strdup(dir);
+ dp->handle = handle;
+ free(filespec);
+
+ return dp;
+}
+
+struct dirent *readdir(DIR *dp)
+{
+ if (!dp || dp->finished)
+ return NULL;
+
+ if (dp->offset != 0) {
+ if (_findnext(dp->handle, &(dp->fileinfo)) < 0) {
+ dp->finished = 1;
+ return NULL;
+ }
+ }
+ dp->offset++;
+
+ strlcpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME+1);
+ dp->dent.d_ino = 1;
+ dp->dent.d_reclen = strlen(dp->dent.d_name);
+ dp->dent.d_off = dp->offset;
+
+ return &(dp->dent);
+}
+
+int readdir_r(DIR *dp, struct dirent *entry, struct dirent **result)
+{
+ if (!dp || dp->finished) {
+ *result = NULL;
+ return 0;
+ }
+
+ if (dp->offset != 0) {
+ if (_findnext(dp->handle, &(dp->fileinfo)) < 0) {
+ dp->finished = 1;
+ *result = NULL;
+ return 0;
+ }
+ }
+ dp->offset++;
+
+ strlcpy(dp->dent.d_name, dp->fileinfo.name, _MAX_FNAME+1);
+ dp->dent.d_ino = 1;
+ dp->dent.d_reclen = strlen(dp->dent.d_name);
+ dp->dent.d_off = dp->offset;
+
+ memcpy(entry, &dp->dent, sizeof(*entry));
+
+ *result = &dp->dent;
+
+ return 0;
+}
+
+int closedir(DIR *dp)
+{
+ if (!dp)
+ return 0;
+ _findclose(dp->handle);
+ if (dp->dir)
+ free(dp->dir);
+ if (dp)
+ free(dp);
+
+ return 0;
+}
+
+int rewinddir(DIR *dp)
+{
+ /* Re-set to the beginning */
+ char *filespec;
+ long handle;
+ int index;
+
+ _findclose(dp->handle);
+
+ dp->offset = 0;
+ dp->finished = 0;
+
+ filespec = malloc(strlen(dp->dir) + 2 + 1);
+ strcpy(filespec, dp->dir);
+ index = strlen(filespec) - 1;
+ if (index >= 0 && (filespec[index] == '/' || filespec[index] == '\\'))
+ filespec[index] = '\0';
+ strcat(filespec, "/*");
+
+ if ((handle = _findfirst(filespec, &(dp->fileinfo))) < 0) {
+ if (errno == ENOENT)
+ dp->finished = 1;
+ }
+ dp->handle = handle;
+ free(filespec);
+
+return 0;
+}
diff --git a/win32/readdir.h b/win32/readdir.h
new file mode 100644
index 000000000..419dc95c2
--- /dev/null
+++ b/win32/readdir.h
@@ -0,0 +1,43 @@
+#ifndef READDIR_H
+#define READDIR_H
+
+
+/*
+ * Structures and types used to implement opendir/readdir/closedir
+ * on Windows 95/NT.
+ */
+
+#include <io.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+
+/* struct dirent - same as Unix */
+
+struct dirent {
+ long d_ino; /* inode (always 1 in WIN32) */
+ off_t d_off; /* offset to this dirent */
+ unsigned short d_reclen; /* length of d_name */
+ char d_name[_MAX_FNAME + 1]; /* filename (null terminated) */
+};
+
+
+/* typedef DIR - not the same as Unix */
+typedef struct {
+ long handle; /* _findfirst/_findnext handle */
+ short offset; /* offset into directory */
+ short finished; /* 1 if there are not more files */
+ struct _finddata_t fileinfo; /* from _findfirst/_findnext */
+ char *dir; /* the dir we are reading */
+ struct dirent dent; /* the dirent to return */
+} DIR;
+
+/* Function prototypes */
+DIR *opendir(const char *);
+struct dirent *readdir(DIR *);
+int readdir_r(DIR *, struct dirent *, struct dirent **);
+int closedir(DIR *);
+int rewinddir(DIR *);
+
+#endif /* READDIR_H */
diff --git a/win32/registry.c b/win32/registry.c
new file mode 100644
index 000000000..95d142cfa
--- /dev/null
+++ b/win32/registry.c
@@ -0,0 +1,114 @@
+#include "php.h"
+#include "php_ini.h"
+
+#define PHP_REGISTRY_KEY "SOFTWARE\\PHP"
+
+void UpdateIniFromRegistry(char *path TSRMLS_DC)
+{
+ char *p, *orig_path;
+ HKEY MainKey;
+ char *strtok_buf = NULL;
+
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY "\\Per Directory Values", 0, KEY_READ, &MainKey)!=ERROR_SUCCESS) {
+ return;
+ }
+
+ orig_path = path = estrdup(path);
+
+ /* Get rid of C:, if exists */
+ p = strchr(path, ':');
+ if (p) {
+ *p = path[0]; /* replace the colon with the drive letter */
+ path = p; /* make path point to the drive letter */
+ } else {
+ if (path[0] != '\\' && path[0] != '/') {
+ char tmp_buf[MAXPATHLEN], *cwd;
+ char drive_letter;
+
+ /* get current working directory and prepend it to the path */
+ if (!VCWD_GETCWD(tmp_buf, MAXPATHLEN)) {
+ efree(orig_path);
+ return;
+ }
+ cwd = strchr(tmp_buf, ':');
+ if (!cwd) {
+ drive_letter = 'C';
+ cwd = tmp_buf;
+ } else {
+ drive_letter = tmp_buf[0];
+ cwd++;
+ }
+ while (*cwd == '\\' || *cwd == '/') {
+ cwd++;
+ }
+ path = (char *) emalloc(2+strlen(cwd)+1+strlen(orig_path)+1);
+ sprintf(path, "%c\\%s\\%s", drive_letter, cwd, orig_path);
+ efree(orig_path);
+ orig_path = path;
+ }
+ }
+
+
+ path = p = php_strtok_r(path, "\\/", &strtok_buf);
+
+ while (p) {
+ HKEY hKey;
+ DWORD lType;
+ DWORD values = 0, max_name = 0, max_value = 0, i = 0;
+
+ if (p>path) {
+ *(p-1) = '\\'; /* restore the slash */
+ }
+
+ if (RegOpenKeyEx(MainKey, path, 0, KEY_READ, &hKey)!=ERROR_SUCCESS) {
+ break;
+ }
+
+ if(RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &values, &max_name, &max_value, NULL, NULL) == ERROR_SUCCESS) {
+ LPTSTR namebuf = (LPTSTR)emalloc(max_name + 1);
+ PBYTE valuebuf = (PBYTE)emalloc(max_value);
+
+ while (i < values) {
+ DWORD namebuf_len = max_name + 1;
+ DWORD valuebuf_len = max_value;
+
+ RegEnumValue(hKey, i, namebuf, &namebuf_len, NULL, &lType, valuebuf, &valuebuf_len);
+
+ if ((lType == REG_SZ) || (lType == REG_EXPAND_SZ)) {
+ /* valuebuf_len includes trailing 0 */
+ zend_alter_ini_entry(namebuf, namebuf_len + 1, valuebuf, valuebuf_len?valuebuf_len-1:0, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+ }
+
+ i++;
+ }
+
+ efree(namebuf);
+ efree(valuebuf);
+ }
+
+ RegCloseKey(hKey);
+ p = php_strtok_r(NULL, "\\/", &strtok_buf);
+ }
+ RegCloseKey(MainKey);
+ efree(orig_path);
+}
+
+#define PHPRC_REGISTRY_NAME "IniFilePath"
+
+char *GetIniPathFromRegistry()
+{
+ char *reg_location = NULL;
+ HKEY hKey;
+
+ if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
+ DWORD buflen = MAXPATHLEN;
+ reg_location = emalloc(MAXPATHLEN+1);
+ if(RegQueryValueEx(hKey, PHPRC_REGISTRY_NAME, 0, NULL, reg_location, &buflen) != ERROR_SUCCESS) {
+ efree(reg_location);
+ reg_location = NULL;
+ return reg_location;
+ }
+ RegCloseKey(hKey);
+ }
+ return reg_location;
+}
diff --git a/win32/resource.h b/win32/resource.h
new file mode 100644
index 000000000..0c58f6908
--- /dev/null
+++ b/win32/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by php5dllts.rc
+//
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/win32/select.c b/win32/select.c
new file mode 100644
index 000000000..b99869c14
--- /dev/null
+++ b/win32/select.c
@@ -0,0 +1,176 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@thebrainroom.com> |
+ +----------------------------------------------------------------------+
+*/
+
+#include "php.h"
+#include "php_network.h"
+
+#ifdef PHP_WIN32
+
+/* $Id: select.c,v 1.9 2004/01/08 08:18:21 andi Exp $ */
+
+/* Win32 select() will only work with sockets, so we roll our own implementation here.
+ * - If you supply only sockets, this simply passes through to winsock select().
+ * - If you supply file handles, there is no way to distinguish between
+ * ready for read/write or OOB, so any set in which the handle is found will
+ * be marked as ready.
+ * - If you supply a mixture of handles and sockets, the system will interleave
+ * calls between select() and WaitForMultipleObjects(). The time slicing may
+ * cause this function call to take up to 100 ms longer than you specified.
+ * - Calling this with NULL sets as a portable way to sleep with sub-second
+ * accuracy is not supported.
+ * */
+PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv)
+{
+ DWORD ms_total, limit;
+ HANDLE handles[MAXIMUM_WAIT_OBJECTS];
+ int handle_slot_to_fd[MAXIMUM_WAIT_OBJECTS];
+ int n_handles = 0, i;
+ fd_set sock_read, sock_write, sock_except;
+ fd_set aread, awrite, aexcept;
+ int sock_max_fd = -1;
+ struct timeval tvslice;
+ int retcode;
+
+#define SAFE_FD_ISSET(fd, set) (set != NULL && FD_ISSET(fd, set))
+
+ /* calculate how long we need to wait in milliseconds */
+ if (tv == NULL) {
+ ms_total = INFINITE;
+ } else {
+ ms_total = tv->tv_sec * 1000;
+ ms_total += tv->tv_usec / 1000;
+ }
+
+ FD_ZERO(&sock_read);
+ FD_ZERO(&sock_write);
+ FD_ZERO(&sock_except);
+
+ /* build an array of handles for non-sockets */
+ for (i = 0; i < max_fd; i++) {
+ if (SAFE_FD_ISSET(i, rfds) || SAFE_FD_ISSET(i, wfds) || SAFE_FD_ISSET(i, efds)) {
+ handles[n_handles] = (HANDLE)_get_osfhandle(i);
+ if ((DWORD)handles[n_handles] == 0xffffffff) {
+ /* socket */
+ if (SAFE_FD_ISSET(i, rfds)) {
+ FD_SET(i, &sock_read);
+ }
+ if (SAFE_FD_ISSET(i, wfds)) {
+ FD_SET(i, &sock_write);
+ }
+ if (SAFE_FD_ISSET(i, efds)) {
+ FD_SET(i, &sock_except);
+ }
+ if (i > sock_max_fd) {
+ sock_max_fd = i;
+ }
+ } else {
+ handle_slot_to_fd[n_handles] = i;
+ n_handles++;
+ }
+ }
+ }
+
+ if (n_handles == 0) {
+ /* plain sockets only - let winsock handle the whole thing */
+ return select(max_fd, rfds, wfds, efds, tv);
+ }
+
+ /* mixture of handles and sockets; lets multiplex between
+ * winsock and waiting on the handles */
+
+ FD_ZERO(&aread);
+ FD_ZERO(&awrite);
+ FD_ZERO(&aexcept);
+
+ limit = GetTickCount() + ms_total;
+ do {
+ retcode = 0;
+
+ if (sock_max_fd >= 0) {
+ /* overwrite the zero'd sets here; the select call
+ * will clear those that are not active */
+ aread = sock_read;
+ awrite = sock_write;
+ aexcept = sock_except;
+
+ tvslice.tv_sec = 0;
+ tvslice.tv_usec = 100000;
+
+ retcode = select(sock_max_fd+1, &aread, &awrite, &aexcept, &tvslice);
+ }
+ if (n_handles > 0) {
+ /* check handles */
+ DWORD wret;
+
+ wret = MsgWaitForMultipleObjects(n_handles, handles, FALSE, retcode > 0 ? 0 : 100, QS_ALLEVENTS);
+
+ if (wret == WAIT_TIMEOUT) {
+ /* set retcode to 0; this is the default.
+ * select() may have set it to something else,
+ * in which case we leave it alone, so this branch
+ * does nothing */
+ ;
+ } else if (wret == WAIT_FAILED) {
+ if (retcode == 0) {
+ retcode = -1;
+ }
+ } else {
+ if (retcode < 0) {
+ retcode = 0;
+ }
+ for (i = 0; i < n_handles; i++) {
+ if (WAIT_OBJECT_0 == WaitForSingleObject(handles[i], 0)) {
+ if (SAFE_FD_ISSET(handle_slot_to_fd[i], rfds)) {
+ FD_SET(handle_slot_to_fd[i], &aread);
+ }
+ if (SAFE_FD_ISSET(handle_slot_to_fd[i], wfds)) {
+ FD_SET(handle_slot_to_fd[i], &awrite);
+ }
+ if (SAFE_FD_ISSET(handle_slot_to_fd[i], efds)) {
+ FD_SET(handle_slot_to_fd[i], &aexcept);
+ }
+ retcode++;
+ }
+ }
+ }
+ }
+ } while (retcode == 0 && (ms_total == INFINITE || GetTickCount() < limit));
+
+ if (rfds) {
+ *rfds = aread;
+ }
+ if (wfds) {
+ *wfds = awrite;
+ }
+ if (efds) {
+ *efds = aexcept;
+ }
+
+ return retcode;
+}
+
+#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/win32/select.h b/win32/select.h
new file mode 100644
index 000000000..e027fecda
--- /dev/null
+++ b/win32/select.h
@@ -0,0 +1,22 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Wez Furlong <wez@thebrainroom.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: select.h,v 1.3 2004/01/08 17:33:28 sniper Exp $ */
+
+PHPAPI int php_select(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tv);
+
diff --git a/win32/sendmail.c b/win32/sendmail.c
new file mode 100644
index 000000000..d0faf17bd
--- /dev/null
+++ b/win32/sendmail.c
@@ -0,0 +1,966 @@
+/*
+ * PHP Sendmail for Windows.
+ *
+ * This file is rewriten specificly for PHPFI. Some functionality
+ * has been removed (MIME and file attachments). This code was
+ * modified from code based on code writen by Jarle Aase.
+ *
+ * This class is based on the original code by Jarle Aase, see bellow:
+ * wSendmail.cpp It has been striped of some functionality to match
+ * the requirements of phpfi.
+ *
+ * Very simple SMTP Send-mail program for sending command-line level
+ * emails and CGI-BIN form response for the Windows platform.
+ *
+ * The complete wSendmail package with source code can be located
+ * from http://www.jgaa.com
+ *
+ */
+
+/* $Id: sendmail.c,v 1.59.2.3 2005/03/11 10:48:06 hyanantha Exp $ */
+
+#include "php.h" /*php specific */
+#include <stdio.h>
+#include <stdlib.h>
+#ifndef NETWARE
+#include <winsock2.h>
+#include "time.h"
+#else /* NETWARE */
+#include <netware/sendmail_nw.h>
+#endif /* NETWARE */
+#include <string.h>
+#include <math.h>
+#ifndef NETWARE
+#include <malloc.h>
+#include <memory.h>
+#include <winbase.h>
+#endif /* NETWARE */
+#include "sendmail.h"
+#include "php_ini.h"
+
+#if HAVE_PCRE || HAVE_BUNDLED_PCRE
+#include "ext/pcre/php_pcre.h"
+#endif
+
+#include "ext/standard/php_string.h"
+
+/*
+ extern int _daylight;
+ extern long _timezone;
+ */
+/*enum
+ {
+ DO_CONNECT = WM_USER +1
+ };
+ */
+
+static char *days[] =
+{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
+static char *months[] =
+{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
+
+/* '*error_message' has to be passed around from php_mail() */
+#define SMTP_ERROR_RESPONSE_SPEC "SMTP server response: %s"
+/* Convinient way to handle error messages from the SMTP server.
+ response is ecalloc()d in Ack() itself and efree()d here
+ because the content is in *error_message now */
+#define SMTP_ERROR_RESPONSE(response) { \
+ if (response && error_message) { \
+ if (NULL != (*error_message = ecalloc(1, sizeof(SMTP_ERROR_RESPONSE_SPEC) + strlen(response)))) { \
+ snprintf(*error_message, sizeof(SMTP_ERROR_RESPONSE_SPEC) + strlen(response), SMTP_ERROR_RESPONSE_SPEC, response); \
+ } \
+ efree(response); \
+ } \
+ }
+#define SMTP_SKIP_SPACE(str) { while (isspace(*str)) { str++; } }
+
+
+#ifndef THREAD_SAFE
+char Buffer[MAIL_BUFFER_SIZE];
+
+/* socket related data */
+SOCKET sc;
+#ifndef NETWARE
+WSADATA Data;
+struct hostent *adr;
+#endif /* NETWARE */
+SOCKADDR_IN sock_in;
+#ifndef NETWARE
+int WinsockStarted;
+/* values set by the constructor */
+char *AppName;
+#endif /* NETWARE */
+char MailHost[HOST_NAME_LEN];
+char LocalHost[HOST_NAME_LEN];
+#endif
+char seps[] = " ,\t\n";
+#ifndef NETWARE
+char *php_mailer = "PHP 4 WIN32";
+#else
+char *php_mailer = "PHP 4 NetWare";
+#endif /* NETWARE */
+
+char *get_header(char *h, char *headers);
+
+/* Error messages */
+static char *ErrorMessages[] =
+{
+ {"Success"}, /* 0 */
+ {"Bad arguments from form"}, /* 1 */
+ {"Unable to open temporary mailfile for read"},
+ {"Failed to Start Sockets"},
+ {"Failed to Resolve Host"},
+ {"Failed to obtain socket handle"}, /* 5 */
+ {"Failed to connect to mailserver, verify your \"SMTP\" setting in php.ini"},
+ {"Failed to Send"},
+ {"Failed to Receive"},
+ {"Server Error"},
+ {"Failed to resolve the host IP name"}, /* 10 */
+ {"Out of memory"},
+ {"Unknown error"},
+ {"Bad Message Contents"},
+ {"Bad Message Subject"},
+ {"Bad Message destination"}, /* 15 */
+ {"Bad Message Return Path"},
+ {"Bad Mail Host"},
+ {"Bad Message File"},
+ {"\"sendmail_from\" not set in php.ini or custom \"From:\" header missing"},
+ {"Mailserver rejected our \"sendmail_from\" setting"}, /* 20 */
+ {"Error while trimming mail header with PCRE, please file a bug report at http://bugs.php.net/"} /* 21 */
+};
+
+/* This pattern converts all single occurences of \n (Unix)
+ * withour a leading \r to \r\n and all occurences of \r (Mac)
+ * without a trailing \n to \r\n
+ * Thx to Nibbler from ircnet/#linuxger
+ */
+#define PHP_WIN32_MAIL_UNIFY_PATTERN "/(\r\n?)|\n/"
+#define PHP_WIN32_MAIL_UNIFY_REPLACE "\r\n"
+
+/* This pattern removes \r\n from the start of the string,
+ * \r\n from the end of the string and also makes sure every line
+ * is only wrapped with a single \r\n (thus reduces multiple
+ * occurences of \r\n between lines to a single \r\n) */
+#define PHP_WIN32_MAIL_RMVDBL_PATTERN "/^\r\n|(\r\n)+$/m"
+#define PHP_WIN32_MAIL_RMVDBL_REPLACE ""
+
+/* This pattern escapes \n. inside the message body. It prevents
+ * premature end of message if \n.\n or \r\n.\r\n is encountered
+ * and ensures that \n. sequences are properly displayed in the
+ * message body. */
+#define PHP_WIN32_MAIL_DOT_PATTERN "\n."
+#define PHP_WIN32_MAIL_DOT_REPLACE "\n.."
+
+/* This function is meant to unify the headers passed to to mail()
+ * This means, use PCRE to transform single occurences of \n or \r in \r\n
+ * As a second step we also eleminate all \r\n occurences which are:
+ * 1) At the start of the header
+ * 2) At the end of the header
+ * 3) Two or more occurences in the header are removed so only one is left
+ *
+ * Returns NULL on error, or the new char* buffer on success.
+ * You have to take care and efree() the buffer on your own.
+ */
+static char *php_win32_mail_trim_header(char *header TSRMLS_DC)
+{
+
+#if HAVE_PCRE || HAVE_BUNDLED_PCRE
+
+ char *result, *result2;
+ int result_len;
+ zval *replace;
+
+ if (!header) {
+ return NULL;
+ }
+
+ MAKE_STD_ZVAL(replace);
+ ZVAL_STRING(replace, PHP_WIN32_MAIL_UNIFY_REPLACE, 0);
+
+ result = php_pcre_replace(PHP_WIN32_MAIL_UNIFY_PATTERN, sizeof(PHP_WIN32_MAIL_UNIFY_PATTERN)-1,
+ header, strlen(header),
+ replace,
+ 0,
+ &result_len,
+ -1 TSRMLS_CC);
+ if (NULL == result) {
+ FREE_ZVAL(replace);
+ return NULL;
+ }
+
+ ZVAL_STRING(replace, PHP_WIN32_MAIL_RMVDBL_REPLACE, 0);
+
+ result2 = php_pcre_replace(PHP_WIN32_MAIL_RMVDBL_PATTERN, sizeof(PHP_WIN32_MAIL_RMVDBL_PATTERN)-1,
+ result, result_len,
+ replace,
+ 0,
+ &result_len,
+ -1 TSRMLS_CC);
+ efree(result);
+ FREE_ZVAL(replace);
+ return result2;
+#else
+ /* In case we don't have PCRE support (for whatever reason...) simply do nothing and return the unmodified header */
+ return estrdup(header);
+#endif
+}
+
+/*********************************************************************
+// Name: TSendMail
+// Input: 1) host: Name of the mail host where the SMTP server resides
+// max accepted length of name = 256
+// 2) appname: Name of the application to use in the X-mailer
+// field of the message. if NULL is given the application
+// name is used as given by the GetCommandLine() function
+// max accespted length of name = 100
+// Output: 1) error: Returns the error code if something went wrong or
+// SUCCESS otherwise.
+//
+// See SendText() for additional args!
+//********************************************************************/
+PHPAPI int TSendMail(char *host, int *error, char **error_message,
+ char *headers, char *Subject, char *mailTo, char *data,
+ char *mailCc, char *mailBcc, char *mailRPath)
+{
+ int ret;
+ char *RPath = NULL;
+ char *headers_lc = NULL; /* headers_lc is only created if we've a header at all */
+ char *pos1 = NULL, *pos2 = NULL;
+ TSRMLS_FETCH();
+
+#ifndef NETWARE
+ WinsockStarted = FALSE;
+#endif
+
+ if (host == NULL) {
+ *error = BAD_MAIL_HOST;
+ return FAILURE;
+ } else if (strlen(host) >= HOST_NAME_LEN) {
+ *error = BAD_MAIL_HOST;
+ return FAILURE;
+ } else {
+ strcpy(MailHost, host);
+ }
+
+ if (headers) {
+ char *pos = NULL;
+ size_t i;
+
+ /* Use PCRE to trim the header into the right format */
+ if (NULL == (headers = php_win32_mail_trim_header(headers TSRMLS_CC))) {
+ *error = W32_SM_PCRE_ERROR;
+ return FAILURE;
+ }
+
+ /* Create a lowercased header for all the searches so we're finally case
+ * insensitive when searching for a pattern. */
+ if (NULL == (headers_lc = estrdup(headers))) {
+ efree(headers);
+ *error = OUT_OF_MEMORY;
+ return FAILURE;
+ }
+ for (i = 0; i < strlen(headers_lc); i++) {
+ headers_lc[i] = tolower(headers_lc[i]);
+ }
+ }
+
+ /* Fall back to sendmail_from php.ini setting */
+ if (mailRPath && *mailRPath) {
+ RPath = estrdup(mailRPath);
+ } else if (INI_STR("sendmail_from")) {
+ RPath = estrdup(INI_STR("sendmail_from"));
+ } else if ( headers_lc &&
+ (pos1 = strstr(headers_lc, "from:")) &&
+ ((pos1 == headers_lc) || (*(pos1-1) == '\n'))
+ ) {
+ /* Real offset is memaddress from the original headers + difference of
+ * string found in the lowercase headrs + 5 characters to jump over
+ * the from: */
+ pos1 = headers + (pos1 - headers_lc) + 5;
+ if (NULL == (pos2 = strstr(pos1, "\r\n"))) {
+ RPath = estrndup(pos1, strlen(pos1));
+ } else {
+ RPath = estrndup(pos1, pos2-pos1);
+ }
+ } else {
+ if (headers) {
+ efree(headers);
+ efree(headers_lc);
+ }
+ *error = W32_SM_SENDMAIL_FROM_NOT_SET;
+ return FAILURE;
+ }
+
+ /* attempt to connect with mail host */
+ *error = MailConnect();
+ if (*error != 0) {
+ if (RPath) {
+ efree(RPath);
+ }
+ if (headers) {
+ efree(headers);
+ efree(headers_lc);
+ }
+ /* 128 is safe here, the specifier in snprintf isn't longer than that */
+ if (NULL == (*error_message = ecalloc(1, HOST_NAME_LEN + 128))) {
+ return FAILURE;
+ }
+ snprintf(*error_message, HOST_NAME_LEN + 128,
+ "Failed to connect to mailserver at \"%s\" port %d, verify your \"SMTP\" "
+ "and \"smtp_port\" setting in php.ini or use ini_set()",
+ MailHost, !INI_INT("smtp_port") ? 25 : INI_INT("smtp_port"));
+ return FAILURE;
+ } else {
+ ret = SendText(RPath, Subject, mailTo, mailCc, mailBcc, data, headers, headers_lc, error_message);
+ TSMClose();
+ if (RPath) {
+ efree(RPath);
+ }
+ if (headers) {
+ efree(headers);
+ efree(headers_lc);
+ }
+ if (ret != SUCCESS) {
+ *error = ret;
+ return FAILURE;
+ }
+ return SUCCESS;
+ }
+}
+
+//********************************************************************
+// Name: TSendMail::~TSendMail
+// Input:
+// Output:
+// Description: DESTRUCTOR
+// Author/Date: jcar 20/9/96
+// History:
+//********************************************************************/
+PHPAPI void TSMClose()
+{
+ Post("QUIT\r\n");
+ Ack(NULL);
+ /* to guarantee that the cleanup is not made twice and
+ compomise the rest of the application if sockets are used
+ elesewhere
+ */
+
+ shutdown(sc, 0);
+#ifndef NETWARE
+ closesocket(sc);
+#else
+ /* closesocket commented out since it was giving undefined symbol linker error
+ * close added in its place
+ */
+ close(sc);
+#endif /* NETWARE */
+}
+
+
+/*********************************************************************
+// Name: char *GetSMErrorText
+// Input: Error index returned by the menber functions
+// Output: pointer to a string containing the error description
+// Description:
+// Author/Date: jcar 20/9/96
+// History:
+//*******************************************************************/
+PHPAPI char *GetSMErrorText(int index)
+{
+ if (MIN_ERROR_INDEX <= index && index < MAX_ERROR_INDEX) {
+ return (ErrorMessages[index]);
+
+ } else {
+ return (ErrorMessages[UNKNOWN_ERROR]);
+
+ }
+}
+
+
+/*********************************************************************
+// Name: TSendText
+// Input: 1) RPath: return path of the message
+// Is used to fill the "Return-Path" and the
+// "X-Sender" fields of the message.
+// 2) Subject: Subject field of the message. If NULL is given
+// the subject is set to "No Subject"
+// 3) mailTo: Destination address
+// 4) data: Null terminated string containing the data to be send.
+// 5,6) headers of the message. Note that the second
+// parameter, headers_lc, is actually a lowercased version of
+// headers. The should match exactly (in terms of length),
+// only differ in case
+// Output: Error code or SUCCESS
+// Description:
+// Author/Date: jcar 20/9/96
+// History:
+//*******************************************************************/
+int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data,
+ char *headers, char *headers_lc, char **error_message)
+{
+ int res;
+ char *p;
+ char *tempMailTo, *token, *pos1, *pos2;
+ char *server_response = NULL;
+ char *stripped_header = NULL;
+ char *data_cln;
+ int data_cln_len;
+
+ /* check for NULL parameters */
+ if (data == NULL)
+ return (BAD_MSG_CONTENTS);
+ if (mailTo == NULL)
+ return (BAD_MSG_DESTINATION);
+ if (RPath == NULL)
+ return (BAD_MSG_RPATH);
+
+ /* simple checks for the mailto address */
+ /* have ampersand ? */
+ /* mfischer, 20020514: I commented this out because it really
+ seems bogus. Only a username for example may still be a
+ valid address at the destination system.
+ if (strchr(mailTo, '@') == NULL)
+ return (BAD_MSG_DESTINATION);
+ */
+
+ sprintf(Buffer, "HELO %s\r\n", LocalHost);
+
+ /* in the beggining of the dialog */
+ /* attempt reconnect if the first Post fail */
+ if ((res = Post(Buffer)) != SUCCESS) {
+ MailConnect();
+ if ((res = Post(Buffer)) != SUCCESS)
+ return (res);
+ }
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ return (res);
+ }
+
+ snprintf(Buffer, MAIL_BUFFER_SIZE, "MAIL FROM:<%s>\r\n", RPath);
+ if ((res = Post(Buffer)) != SUCCESS)
+ return (res);
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ return W32_SM_SENDMAIL_FROM_MALFORMED;
+ }
+
+ tempMailTo = estrdup(mailTo);
+ /* Send mail to all rcpt's */
+ token = strtok(tempMailTo, ",");
+ while(token != NULL)
+ {
+ snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
+ if ((res = Post(Buffer)) != SUCCESS) {
+ efree(tempMailTo);
+ return (res);
+ }
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ efree(tempMailTo);
+ return (res);
+ }
+ token = strtok(NULL, ",");
+ }
+ efree(tempMailTo);
+
+ if (mailCc && *mailCc) {
+ tempMailTo = estrdup(mailCc);
+ /* Send mail to all rcpt's */
+ token = strtok(tempMailTo, ",");
+ while(token != NULL)
+ {
+ snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
+ if ((res = Post(Buffer)) != SUCCESS) {
+ efree(tempMailTo);
+ return (res);
+ }
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ efree(tempMailTo);
+ return (res);
+ }
+ token = strtok(NULL, ",");
+ }
+ efree(tempMailTo);
+ }
+ /* Send mail to all Cc rcpt's */
+ else if (headers && (pos1 = strstr(headers_lc, "cc:")) && ((pos1 == headers_lc) || (*(pos1-1) == '\n'))) {
+ /* Real offset is memaddress from the original headers + difference of
+ * string found in the lowercase headrs + 3 characters to jump over
+ * the cc: */
+ pos1 = headers + (pos1 - headers_lc) + 3;
+ if (NULL == (pos2 = strstr(pos1, "\r\n"))) {
+
+ tempMailTo = estrndup(pos1, strlen(pos1));
+
+ } else {
+ tempMailTo = estrndup(pos1, pos2-pos1);
+
+ }
+
+ token = strtok(tempMailTo, ",");
+ while(token != NULL)
+ {
+ SMTP_SKIP_SPACE(token);
+ sprintf(Buffer, "RCPT TO:<%s>\r\n", token);
+ if ((res = Post(Buffer)) != SUCCESS)
+ return (res);
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ return (res);
+ }
+ token = strtok(NULL, ",");
+ }
+ efree(tempMailTo);
+ }
+
+ /* Send mail to all Bcc rcpt's
+ This is basically a rip of the Cc code above.
+ Just don't forget to remove the Bcc: from the header afterwards. */
+ if (mailBcc && *mailBcc) {
+ tempMailTo = estrdup(mailBcc);
+ /* Send mail to all rcpt's */
+ token = strtok(tempMailTo, ",");
+ while(token != NULL)
+ {
+ SMTP_SKIP_SPACE(token);
+ snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
+ if ((res = Post(Buffer)) != SUCCESS) {
+ efree(tempMailTo);
+ return (res);
+ }
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ efree(tempMailTo);
+ return (res);
+ }
+ token = strtok(NULL, ",");
+ }
+ efree(tempMailTo);
+ }
+ else if (headers) {
+ if (pos1 = strstr(headers_lc, "bcc:")) {
+ /* Real offset is memaddress from the original headers + difference of
+ * string found in the lowercase headrs + 4 characters to jump over
+ * the bcc: */
+ pos1 = headers + (pos1 - headers_lc) + 4;
+ if (NULL == (pos2 = strstr(pos1, "\r\n"))) {
+ int foo = strlen(pos1);
+ tempMailTo = estrndup(pos1, strlen(pos1));
+ /* Later, when we remove the Bcc: out of the
+ header we know it was the last thing. */
+ pos2 = pos1;
+ } else {
+ tempMailTo = estrndup(pos1, pos2 - pos1);
+ }
+
+ token = strtok(tempMailTo, ",");
+ while(token != NULL)
+ {
+ SMTP_SKIP_SPACE(token);
+ sprintf(Buffer, "RCPT TO:<%s>\r\n", token);
+ if ((res = Post(Buffer)) != SUCCESS) {
+ return (res);
+ }
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ return (res);
+ }
+ token = strtok(NULL, ",");
+ }
+ efree(tempMailTo);
+
+ /* Now that we've identified that we've a Bcc list,
+ remove it from the current header. */
+ if (NULL == (stripped_header = ecalloc(1, strlen(headers)))) {
+ return OUT_OF_MEMORY;
+ }
+ /* headers = point to string start of header
+ pos1 = pointer IN headers where the Bcc starts
+ '4' = Length of the characters 'bcc:'
+ Because we've added +4 above for parsing the Emails
+ we've to substract them here. */
+ memcpy(stripped_header, headers, pos1 - headers - 4);
+ if (pos1 != pos2) {
+ /* if pos1 != pos2 , pos2 points to the rest of the headers.
+ Since pos1 != pos2 if "\r\n" was found, we know those characters
+ are there and so we jump over them (else we would generate a new header
+ which would look like "\r\n\r\n". */
+ memcpy(stripped_header + (pos1 - headers - 4), pos2 + 2, strlen(pos2) - 2);
+ }
+ }
+ }
+
+ /* Simplify the code that we create a copy of stripped_header no matter if
+ we actually strip something or not. So we've a single efree() later. */
+ if (headers && !stripped_header) {
+ if (NULL == (stripped_header = estrndup(headers, strlen(headers)))) {
+ return OUT_OF_MEMORY;
+ }
+ }
+
+ if ((res = Post("DATA\r\n")) != SUCCESS) {
+ if (stripped_header) {
+ efree(stripped_header);
+ }
+ return (res);
+ }
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ if (stripped_header) {
+ efree(stripped_header);
+ }
+ return (res);
+ }
+
+ /* send message header */
+ if (Subject == NULL) {
+ res = PostHeader(RPath, "No Subject", mailTo, stripped_header);
+ } else {
+ res = PostHeader(RPath, Subject, mailTo, stripped_header);
+ }
+ if (stripped_header) {
+ efree(stripped_header);
+ }
+ if (res != SUCCESS) {
+ return (res);
+ }
+
+ /* Escape \n. sequences
+ * We use php_str_to_str() and not php_str_replace_in_subject(), since the latter
+ * uses ZVAL as it's parameters */
+ data_cln = php_str_to_str(data, strlen(data), PHP_WIN32_MAIL_DOT_PATTERN, sizeof(PHP_WIN32_MAIL_DOT_PATTERN) - 1,
+ PHP_WIN32_MAIL_DOT_REPLACE, sizeof(PHP_WIN32_MAIL_DOT_REPLACE) - 1, &data_cln_len);
+ if (!data_cln) {
+ data_cln = estrdup("");
+ data_cln_len = 1;
+ }
+
+ /* send message contents in 1024 chunks */
+ {
+ char c, *e2, *e = data_cln + data_cln_len;
+ p = data_cln;
+
+ while (e - p > 1024) {
+ e2 = p + 1024;
+ c = *e2;
+ *e2 = '\0';
+ if ((res = Post(p)) != SUCCESS) {
+ efree(data_cln);
+ return(res);
+ }
+ *e2 = c;
+ p = e2;
+ }
+ if ((res = Post(p)) != SUCCESS) {
+ efree(data_cln);
+ return(res);
+ }
+ }
+
+ efree(data_cln);
+
+ /*send termination dot */
+ if ((res = Post("\r\n.\r\n")) != SUCCESS)
+ return (res);
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ return (res);
+ }
+
+ return (SUCCESS);
+}
+
+int addToHeader(char **header_buffer, const char *specifier, char *string) {
+ if (NULL == (*header_buffer = erealloc(*header_buffer, strlen(*header_buffer) + strlen(specifier) + strlen(string) + 1))) {
+ return 0;
+ }
+ sprintf(*header_buffer + strlen(*header_buffer), specifier, string);
+ return 1;
+}
+
+/*********************************************************************
+// Name: PostHeader
+// Input: 1) return path
+// 2) Subject
+// 3) destination address
+// 4) headers
+// Output: Error code or Success
+// Description:
+// Author/Date: jcar 20/9/96
+// History:
+//********************************************************************/
+int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders)
+{
+
+ /* Print message header according to RFC 822 */
+ /* Return-path, Received, Date, From, Subject, Sender, To, cc */
+
+ time_t tNow = time(NULL);
+ struct tm *tm = localtime(&tNow);
+ int zoneh = abs(_timezone);
+ int zonem, res;
+ char *header_buffer;
+ char *headers_lc = NULL;
+ size_t i;
+
+ if (xheaders) {
+ if (NULL == (headers_lc = estrdup(xheaders))) {
+ return OUT_OF_MEMORY;
+ }
+ for (i = 0; i < strlen(headers_lc); i++) {
+ headers_lc[i] = tolower(headers_lc[i]);
+ }
+ }
+
+ if (NULL == (header_buffer = ecalloc(1, MAIL_BUFFER_SIZE))) {
+ efree(headers_lc);
+ return OUT_OF_MEMORY;
+ }
+ zoneh /= (60 * 60);
+ zonem = (abs(_timezone) / 60) - (zoneh * 60);
+
+ if(!xheaders || !strstr(headers_lc, "date:")){
+ sprintf(header_buffer, "Date: %s, %02d %s %04d %02d:%02d:%02d %s%02d%02d\r\n",
+ days[tm->tm_wday],
+ tm->tm_mday,
+ months[tm->tm_mon],
+ tm->tm_year + 1900,
+ tm->tm_hour,
+ tm->tm_min,
+ tm->tm_sec,
+ (_timezone <= 0) ? "+" : (_timezone > 0) ? "-" : "",
+ zoneh,
+ zonem);
+ }
+
+ if (!headers_lc || !strstr(headers_lc, "from:")) {
+ if (!addToHeader(&header_buffer, "From: %s\r\n", RPath)) {
+ goto PostHeader_outofmem;
+ }
+ }
+ if (!addToHeader(&header_buffer, "Subject: %s\r\n", Subject)) {
+ goto PostHeader_outofmem;
+ }
+
+ /* Only add the To: field from the $to parameter if isn't in the custom headers */
+ if ((headers_lc && (!strstr(headers_lc, "\r\nto:") && (strncmp(headers_lc, "to:", 3) != 0))) || !headers_lc) {
+ if (!addToHeader(&header_buffer, "To: %s\r\n", mailTo)) {
+ goto PostHeader_outofmem;
+ }
+ }
+ if(xheaders){
+ if (!addToHeader(&header_buffer, "%s\r\n", xheaders)) {
+ goto PostHeader_outofmem;
+ }
+ }
+
+ if (headers_lc) {
+ efree(headers_lc);
+ }
+ if ((res = Post(header_buffer)) != SUCCESS) {
+ efree(header_buffer);
+ return (res);
+ }
+ efree(header_buffer);
+
+ if ((res = Post("\r\n")) != SUCCESS) {
+ return (res);
+ }
+
+ return (SUCCESS);
+
+PostHeader_outofmem:
+ if (headers_lc) {
+ efree(headers_lc);
+ }
+ return OUT_OF_MEMORY;
+}
+
+
+
+/*********************************************************************
+// Name: MailConnect
+// Input: None
+// Output: None
+// Description: Connect to the mail host and receive the welcome message.
+// Author/Date: jcar 20/9/96
+// History:
+//********************************************************************/
+int MailConnect()
+{
+
+ int res;
+ short portnum;
+
+ /* Create Socket */
+ if ((sc = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
+ return (FAILED_TO_OBTAIN_SOCKET_HANDLE);
+
+ /* Get our own host name */
+ if (gethostname(LocalHost, HOST_NAME_LEN))
+ return (FAILED_TO_GET_HOSTNAME);
+
+ /* Resolve the servers IP */
+ /*
+ if (!isdigit(MailHost[0])||!gethostbyname(MailHost))
+ {
+ return (FAILED_TO_RESOLVE_HOST);
+ }
+ */
+
+ portnum = (short) INI_INT("smtp_port");
+ if (!portnum) {
+ portnum = 25;
+ }
+
+ /* Connect to server */
+ sock_in.sin_family = AF_INET;
+ sock_in.sin_port = htons(portnum);
+ sock_in.sin_addr.S_un.S_addr = GetAddr(MailHost);
+
+ if (connect(sc, (LPSOCKADDR) & sock_in, sizeof(sock_in)))
+ return (FAILED_TO_CONNECT);
+
+ /* receive Server welcome message */
+ res = Ack(NULL);
+ return (res);
+}
+
+
+
+
+
+
+/*********************************************************************
+// Name: Post
+// Input:
+// Output:
+// Description:
+// Author/Date: jcar 20/9/96
+// History:
+//********************************************************************/
+#ifndef NETWARE
+int Post(LPCSTR msg)
+#else
+int Post(char *msg)
+#endif
+{
+ int len = strlen(msg);
+ int slen;
+ int index = 0;
+
+ while (len > 0) {
+ if ((slen = send(sc, msg + index, len, 0)) < 1)
+ return (FAILED_TO_SEND);
+ len -= slen;
+ index += slen;
+ }
+ return (SUCCESS);
+}
+
+
+
+/*********************************************************************
+// Name: Ack
+// Input:
+// Output:
+// Description:
+// Get the response from the server. We only want to know if the
+// last command was successful.
+// Author/Date: jcar 20/9/96
+// History:
+//********************************************************************/
+int Ack(char **server_response)
+{
+ static char buf[MAIL_BUFFER_SIZE];
+ int rlen;
+ int Index = 0;
+ int Received = 0;
+
+ again:
+
+ if ((rlen = recv(sc, buf + Index, ((MAIL_BUFFER_SIZE) - 1) - Received, 0)) < 1)
+ return (FAILED_TO_RECEIVE);
+
+ Received += rlen;
+ buf[Received] = 0;
+ /*err_msg fprintf(stderr,"Received: (%d bytes) %s", rlen, buf + Index); */
+
+ /* Check for newline */
+ Index += rlen;
+
+ /* SMPT RFC says \r\n is the only valid line ending, who are we to argue ;)
+ * The response code must contain at least 5 characters ex. 220\r\n */
+ if (Received < 5 || buf[Received - 1] != '\n' || buf[Received - 2] != '\r') {
+ goto again;
+ }
+
+ if (buf[0] > '3') {
+ /* If we've a valid pointer, return the SMTP server response so the error message contains more information */
+ if (server_response) {
+ int dec = 0;
+ /* See if we have something like \r, \n, \r\n or \n\r at the end of the message and chop it off */
+ if (Received > 2) {
+ if (buf[Received-1] == '\n' || buf[Received-1] == '\r') {
+ dec++;
+ if (buf[Received-2] == '\r' || buf[Received-2] == '\n') {
+ dec++;
+ }
+ }
+
+ }
+ *server_response = estrndup(buf, Received - dec);
+ }
+ return (SMTP_SERVER_ERROR);
+ }
+
+ return (SUCCESS);
+}
+
+
+/*********************************************************************
+// Name: unsigned long GetAddr (LPSTR szHost)
+// Input:
+// Output:
+// Description: Given a string, it will return an IP address.
+// - first it tries to convert the string directly
+// - if that fails, it tries o resolve it as a hostname
+//
+// WARNING: gethostbyname() is a blocking function
+// Author/Date: jcar 20/9/96
+// History:
+//********************************************************************/
+#ifndef NETWARE
+unsigned long GetAddr(LPSTR szHost)
+#else
+unsigned long GetAddr(char * szHost)
+#endif
+{
+ LPHOSTENT lpstHost;
+ u_long lAddr = INADDR_ANY;
+
+ /* check that we have a string */
+ if (*szHost) {
+
+ /* check for a dotted-IP address string */
+ lAddr = inet_addr(szHost);
+
+ /* If not an address, then try to resolve it as a hostname */
+ if ((lAddr == INADDR_NONE) && (strcmp(szHost, "255.255.255.255"))) {
+
+ lpstHost = gethostbyname(szHost);
+ if (lpstHost) { /* success */
+#ifndef NETWARE
+ lAddr = *((u_long FAR *) (lpstHost->h_addr));
+#else
+ lAddr = *((u_long *) (lpstHost->h_addr));
+#endif /* NETWARE */
+ } else {
+ lAddr = INADDR_ANY; /* failure */
+ }
+ }
+ }
+ return (lAddr);
+} /* end GetAddr() */
diff --git a/win32/sendmail.h b/win32/sendmail.h
new file mode 100644
index 000000000..3f3539e24
--- /dev/null
+++ b/win32/sendmail.h
@@ -0,0 +1,61 @@
+#if !defined(sendmail_h) /* Sentry, use file only if it's not already included. */
+#define sendmail_h
+#ifndef NETWARE
+#include <windows.h>
+#endif
+
+#define HOST_NAME_LEN 256
+#define MAX_APPNAME_LENGHT 100
+#define MAIL_BUFFER_SIZE (1024*4) /* 4k buffer */
+/* Return values */
+#define MIN_ERROR_INDEX 0 /* Always 0 like SUCCESS */
+#define SUCCESS 0
+#define FAILED_TO_PARSE_ARGUMENTS 1
+#define FAILED_TO_OPEN_MAILFILE 2
+#define FAILED_TO_START_SOCKETS 3
+#define FAILED_TO_RESOLVE_HOST 4
+#define FAILED_TO_OBTAIN_SOCKET_HANDLE 5
+#define FAILED_TO_CONNECT 6
+#define FAILED_TO_SEND 7
+#define FAILED_TO_RECEIVE 8
+#define SMTP_SERVER_ERROR 9
+#define FAILED_TO_GET_HOSTNAME 10
+#define OUT_OF_MEMORY 11
+#define UNKNOWN_ERROR 12
+#define BAD_MSG_CONTENTS 13
+#define BAD_MSG_SUBJECT 14
+#define BAD_MSG_DESTINATION 15
+#define BAD_MSG_RPATH 16
+#define BAD_MAIL_HOST 17
+#define BAD_MSG_FILE 18
+#define W32_SM_SENDMAIL_FROM_NOT_SET 19
+#define W32_SM_SENDMAIL_FROM_MALFORMED 20
+#define W32_SM_PCRE_ERROR 21
+#define MAX_ERROR_INDEX 22 /* Always last error message + 1 */
+
+
+PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message,
+ char *RPath, char *Subject, char *mailTo, char *data,
+ char *mailCc, char *mailBcc, char *mailRPath);
+PHPAPI void TSMClose(void);
+int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data,
+ char *headers, char *headers_lc, char **error_message);
+PHPAPI char *GetSMErrorText(int index);
+
+int MailConnect();
+int PostHeader(char *, char *, char *, char *);
+#ifndef NETWARE
+int Post(LPCSTR msg);
+#else
+int Post(char *msg);
+#endif
+int Ack(char **server_response);
+#ifndef NETWARE
+unsigned long GetAddr(LPSTR szHost);
+#else
+unsigned long GetAddr(char * szHost);
+#endif
+
+
+
+#endif /* sendmail_h */
diff --git a/win32/signal.h b/win32/signal.h
new file mode 100644
index 000000000..de43f98e8
--- /dev/null
+++ b/win32/signal.h
@@ -0,0 +1,16 @@
+/*
+** Change here: if you plan to use your own version of <signal.h>
+** the original "#include <signal.h>" produces an infinite reinclusion
+** of this file, instead of including the standard include-file.
+** Under MS Visual Studio, there are occurences in the source where
+** <signal.h> gets included throughout the PHP sources, and this should
+** include THIS file, not the standard one which does not have the
+** additional signals defined below.
+** One way to remove the infinite reinclusion of this file (which is located
+** in ../win32), is to specify the parent directory in which the standard
+** include file is located.
+*/
+#include <../include/signal.h>
+#define SIGALRM 13
+#define SIGVTALRM 26 /* virtual time alarm */
+#define SIGPROF 27 /* profiling time alarm */
diff --git a/win32/syslog.h b/win32/syslog.h
new file mode 100644
index 000000000..46119510a
--- /dev/null
+++ b/win32/syslog.h
@@ -0,0 +1,78 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Sterling Hughes <sterling@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id: syslog.h,v 1.9 2004/01/08 17:33:28 sniper Exp $ */
+
+#ifndef SYSLOG_H
+#define SYSLOG_H
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#define LOG_EMERG 1
+#define LOG_ALERT 1
+#define LOG_CRIT 1
+#define LOG_ERR 4
+#define LOG_WARNING 5
+#define LOG_NOTICE 6
+#define LOG_INFO 6
+#define LOG_DEBUG 6
+
+#define LOG_PRIMASK 0x07
+
+#define LOG_PRI(p) ((p) & LOG_PRIMASK)
+#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
+
+#define LOG_KERN (0<<3)
+#define LOG_USER (1<<3)
+#define LOG_MAIL (2<<3)
+#define LOG_DAEMON (3<<3)
+#define LOG_AUTH (4<<3)
+#define LOG_SYSLOG (5<<3)
+#define LOG_LPR (6<<3)
+#define LOG_NEWS (7<<3)
+#define LOG_UUCP (8<<3)
+#define LOG_CRON (9<<3)
+#define LOG_AUTHPRIV (10<<3)
+
+#define LOG_NFACILITIES 10
+#define LOG_FACMASK 0x03f8
+#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
+
+#define LOG_MASK(pri) (1 << (pri))
+#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1)
+
+/*
+ * Option flags for openlog.
+ *
+ * LOG_ODELAY no longer does anything.
+ * LOG_NDELAY is the inverse of what it used to be.
+ */
+#define LOG_PID 0x01 /* log the pid with each message */
+#define LOG_CONS 0x02 /* log on the console if errors in sending */
+#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
+#define LOG_NDELAY 0x08 /* don't delay open */
+#define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
+#define LOG_PERROR 0x20 /* log to stderr as well */
+
+
+extern void closelog(void);
+extern void openlog(const char *, int, int);
+extern void syslog(int, const char *, ...);
+
+
+#endif /* SYSLOG_H */
diff --git a/win32/testsuite.dsp b/win32/testsuite.dsp
new file mode 100644
index 000000000..5cd65622f
--- /dev/null
+++ b/win32/testsuite.dsp
@@ -0,0 +1,150 @@
+# Microsoft Developer Studio Project File - Name="testsuite" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Generic Project" 0x010a
+
+CFG=testsuite - Win32 Debug_TS
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "testsuite.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 "testsuite.mak" CFG="testsuite - Win32 Debug_TS"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "testsuite - Win32 Release_TS_Inline" (based on "Win32 (x86) Generic Project")
+!MESSAGE "testsuite - Win32 Release_TS" (based on "Win32 (x86) Generic Project")
+!MESSAGE "testsuite - Win32 Release_TSDbg" (based on "Win32 (x86) Generic Project")
+!MESSAGE "testsuite - Win32 Debug_TS" (based on "Win32 (x86) Generic Project")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+MTL=midl.exe
+
+!IF "$(CFG)" == "testsuite - Win32 Release_TS_Inline"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS_Inline"
+# PROP BASE Intermediate_Dir "Release_TS_Inline"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\Release_TS_Inline"
+# PROP Intermediate_Dir "..\..\"
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TS"
+# PROP BASE Intermediate_Dir "Release_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\Release_TS"
+# PROP Intermediate_Dir "..\..\"
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TSDbg"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release_TSDbg"
+# PROP BASE Intermediate_Dir "Release_TSDbg"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "..\..\Release_TSDbg"
+# PROP Intermediate_Dir "..\..\"
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "testsuite - Win32 Debug_TS"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug_TS"
+# PROP BASE Intermediate_Dir "Debug_TS"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "..\..\Debug_TS"
+# PROP Intermediate_Dir "..\..\"
+# PROP Target_Dir ""
+
+!ENDIF
+
+# Begin Target
+
+# Name "testsuite - Win32 Release_TS_Inline"
+# Name "testsuite - Win32 Release_TS"
+# Name "testsuite - Win32 Release_TSDbg"
+# Name "testsuite - Win32 Debug_TS"
+# Begin Source File
+
+SOURCE=..\results.txt
+
+!IF "$(CFG)" == "testsuite - Win32 Release_TS_Inline"
+
+# PROP Intermediate_Dir "..\Release_TS_Inline"
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build - Running Testsuite, please wait...
+IntDir=.\..\Release_TS_Inline
+InputPath=..\results.txt
+
+"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ set TOP_BUILDDIR=Release_TS_inline
+ set TEST_DIR=tests
+ $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TS"
+
+# PROP Intermediate_Dir "..\Release_TS"
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build - Running Testsuite, please wait...
+IntDir=.\..\Release_TS
+InputPath=..\results.txt
+
+"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ set TOP_BUILDDIR=Release_TS
+ set TEST_DIR=tests
+ $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "testsuite - Win32 Release_TSDbg"
+
+# PROP Intermediate_Dir "..\Release_TSDbg"
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build - Running Testsuite, please wait...
+IntDir=.\..\Release_TSDbg
+InputPath=..\results.txt
+
+"..\..\results.txt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ set TOP_BUILDDIR=Release_TSDbg
+ set TEST_DIR=tests
+ $(IntDir)\php.exe -q ..\run-tests.php > ..\results.txt
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "testsuite - Win32 Debug_TS"
+
+# PROP Intermediate_Dir "..\Debug_TS"
+# PROP Exclude_From_Build 1
+
+!ENDIF
+
+# End Source File
+# End Target
+# End Project
diff --git a/win32/time.c b/win32/time.c
new file mode 100644
index 000000000..325f65ed4
--- /dev/null
+++ b/win32/time.c
@@ -0,0 +1,228 @@
+
+/*****************************************************************************
+ * *
+ * DH_TIME.C *
+ * *
+ * Freely redistributable and modifiable. Use at your own risk. *
+ * *
+ * Copyright 1994 The Downhill Project *
+ *
+ * Modified by Shane Caraveo for use with PHP
+ *
+ *****************************************************************************/
+
+/* $Id: time.c,v 1.9.2.1 2004/07/30 14:24:59 wez Exp $ */
+
+ /**
+ *
+ * 04-Feb-2001
+ * - Added patch by "Vanhanen, Reijo" <Reijo.Vanhanen@helsoft.fi>
+ * Improves accuracy of msec
+ */
+
+/* Include stuff ************************************************************ */
+
+/* this allows the use of the WaitableTimer functions.
+ * For win98 and later */
+#define _WIN32_WINNT 0x400
+
+#include "time.h"
+#include "unistd.h"
+#include "signal.h"
+#include <windows.h>
+#include <winbase.h>
+#include <mmsystem.h>
+#include <errno.h>
+#include "php_win32_globals.h"
+
+int getfilesystemtime(struct timeval *time_Info)
+{
+FILETIME ft;
+__int64 ff;
+
+ GetSystemTimeAsFileTime(&ft); /* 100 ns blocks since 01-Jan-1641 */
+ /* resolution seems to be 0.01 sec */
+ ff = *(__int64*)(&ft);
+ time_Info->tv_sec = (int)(ff/(__int64)10000000-(__int64)11644473600);
+ time_Info->tv_usec = (int)(ff % 10000000)/10;
+ return 0;
+}
+
+
+
+PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info)
+{
+ __int64 timer;
+ LARGE_INTEGER li;
+ BOOL b;
+ double dt;
+ TSRMLS_FETCH();
+
+ /* Get the time, if they want it */
+ if (time_Info != NULL) {
+ if (PW32G(starttime).tv_sec == 0) {
+ b = QueryPerformanceFrequency(&li);
+ if (!b) {
+ PW32G(starttime).tv_sec = -1;
+ }
+ else {
+ PW32G(freq) = li.QuadPart;
+ b = QueryPerformanceCounter(&li);
+ if (!b) {
+ PW32G(starttime).tv_sec = -1;
+ }
+ else {
+ getfilesystemtime(&PW32G(starttime));
+ timer = li.QuadPart;
+ dt = (double)timer/PW32G(freq);
+ PW32G(starttime).tv_usec -= (int)((dt-(int)dt)*1000000);
+ if (PW32G(starttime).tv_usec < 0) {
+ PW32G(starttime).tv_usec += 1000000;
+ --PW32G(starttime).tv_sec;
+ }
+ PW32G(starttime).tv_sec -= (int)dt;
+ }
+ }
+ }
+ if (PW32G(starttime).tv_sec > 0) {
+ b = QueryPerformanceCounter(&li);
+ if (!b) {
+ PW32G(starttime).tv_sec = -1;
+ }
+ else {
+ timer = li.QuadPart;
+ if (timer < PW32G(lasttime)) {
+ getfilesystemtime(time_Info);
+ dt = (double)timer/PW32G(freq);
+ PW32G(starttime) = *time_Info;
+ PW32G(starttime).tv_usec -= (int)((dt-(int)dt)*1000000);
+ if (PW32G(starttime).tv_usec < 0) {
+ PW32G(starttime).tv_usec += 1000000;
+ --PW32G(starttime).tv_sec;
+ }
+ PW32G(starttime).tv_sec -= (int)dt;
+ }
+ else {
+ PW32G(lasttime) = timer;
+ dt = (double)timer/PW32G(freq);
+ time_Info->tv_sec = PW32G(starttime).tv_sec + (int)dt;
+ time_Info->tv_usec = PW32G(starttime).tv_usec + (int)((dt-(int)dt)*1000000);
+ if (time_Info->tv_usec > 1000000) {
+ time_Info->tv_usec -= 1000000;
+ ++time_Info->tv_sec;
+ }
+ }
+ }
+ }
+ if (PW32G(starttime).tv_sec < 0) {
+ getfilesystemtime(time_Info);
+ }
+
+ }
+ /* Get the timezone, if they want it */
+ if (timezone_Info != NULL) {
+ _tzset();
+ timezone_Info->tz_minuteswest = _timezone;
+ timezone_Info->tz_dsttime = _daylight;
+ }
+ /* And return */
+ return 0;
+}
+
+void usleep(unsigned int useconds)
+{
+ HANDLE timer;
+ LARGE_INTEGER due;
+
+ due.QuadPart = -(10 * (__int64)useconds);
+
+ timer = CreateWaitableTimer(NULL, TRUE, NULL);
+ SetWaitableTimer(timer, &due, 0, NULL, NULL, 0);
+ WaitForSingleObject(timer, INFINITE);
+ CloseHandle(timer);
+}
+
+#if 0 /* looks pretty ropey in here */
+#ifdef HAVE_SETITIMER
+
+
+#ifndef THREAD_SAFE
+unsigned int proftimer, virttimer, realtimer;
+extern LPMSG phpmsg;
+#endif
+
+struct timer_msg {
+ int signal;
+ unsigned int threadid;
+};
+
+
+LPTIMECALLBACK setitimer_timeout(UINT uTimerID, UINT info, DWORD dwUser, DWORD dw1, DWORD dw2)
+{
+ struct timer_msg *msg = (struct timer_msg *) info;
+
+ if (msg) {
+ raise((int) msg->signal);
+ PostThreadMessage(msg->threadid,
+ WM_NOTIFY, msg->signal, 0);
+ free(msg);
+ }
+ return 0;
+}
+
+PHPAPI int setitimer(int which, const struct itimerval *value, struct itimerval *ovalue)
+{
+ int timeout = value->it_value.tv_sec * 1000 + value->it_value.tv_usec;
+ int repeat = TIME_ONESHOT;
+
+ /*make sure the message queue is initialized */
+ PeekMessage(phpmsg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
+ if (timeout > 0) {
+ struct timer_msg *msg = malloc(sizeof(struct timer_msg));
+ msg->threadid = GetCurrentThreadId();
+ if (!ovalue) {
+ repeat = TIME_PERIODIC;
+ }
+ switch (which) {
+ case ITIMER_REAL:
+ msg->signal = SIGALRM;
+ realtimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat);
+ break;
+ case ITIMER_VIRT:
+ msg->signal = SIGVTALRM;
+ virttimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat);
+ break;
+ case ITIMER_PROF:
+ msg->signal = SIGPROF;
+ proftimer = timeSetEvent(timeout, 100, (LPTIMECALLBACK) setitimer_timeout, (UINT) msg, repeat);
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
+ break;
+ }
+ } else {
+ switch (which) {
+ case ITIMER_REAL:
+ timeKillEvent(realtimer);
+ break;
+ case ITIMER_VIRT:
+ timeKillEvent(virttimer);
+ break;
+ case ITIMER_PROF:
+ timeKillEvent(proftimer);
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
+ break;
+ }
+ }
+
+
+ return 0;
+}
+
+#endif
+#endif
+
diff --git a/win32/time.h b/win32/time.h
new file mode 100644
index 000000000..5c52e7837
--- /dev/null
+++ b/win32/time.h
@@ -0,0 +1,43 @@
+/*****************************************************************************
+ * *
+ * sys/time.h *
+ * *
+ * Freely redistributable and modifiable. Use at your own risk. *
+ * *
+ * Copyright 1994 The Downhill Project *
+ *
+ * Modified by Shane Caraveo for PHP
+ *
+ *****************************************************************************/
+#ifndef TIME_H
+#define TIME_H
+
+/* Include stuff ************************************************************ */
+#include <time.h>
+#include "php.h"
+
+/* Struct stuff ************************************************************* */
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+
+
+struct itimerval {
+ struct timeval it_interval; /* next value */
+ struct timeval it_value; /* current value */
+};
+
+#define ITIMER_REAL 0 /*generates sigalrm */
+#define ITIMER_VIRTUAL 1 /*generates sigvtalrm */
+#define ITIMER_VIRT 1 /*generates sigvtalrm */
+#define ITIMER_PROF 2 /*generates sigprof */
+
+/* Prototype stuff ********************************************************** */
+PHPAPI extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info);
+
+/* setitimer operates at 100 millisecond resolution */
+PHPAPI extern int setitimer(int which, const struct itimerval *value,
+ struct itimerval *ovalue);
+
+#endif
diff --git a/win32/unistd.h b/win32/unistd.h
new file mode 100644
index 000000000..96e0aedc1
--- /dev/null
+++ b/win32/unistd.h
@@ -0,0 +1,4 @@
+#ifndef _PHP_WIN32_UNISTD_H
+#define _PHP_WIN32_UNISTD_H
+void usleep(unsigned int useconds);
+#endif
diff --git a/win32/wfile.c b/win32/wfile.c
new file mode 100644
index 000000000..1407d6a32
--- /dev/null
+++ b/win32/wfile.c
@@ -0,0 +1,17 @@
+
+/* Function borrowed from the Downhill Project */
+#include "wfile.h"
+#include "direct.h"
+
+int readlink(char *file_Name, char *buf_Mem, int buf_Size)
+{
+ /* See if the file exists */
+ if (access(file_Name, X_OK) == -1) {
+ errno = ENOENT;
+ } else {
+ errno = EINVAL;
+ }
+
+ /* Either way, it's not a link */
+ return -1;
+}
diff --git a/win32/wfile.h b/win32/wfile.h
new file mode 100644
index 000000000..2e7940647
--- /dev/null
+++ b/win32/wfile.h
@@ -0,0 +1,16 @@
+#include <io.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#define access _access
+#define X_OK 0
+#ifndef ENOENT
+#define ENOENT 136
+#endif
+#ifndef EINVAL
+#define EINVAL 131
+#endif
+
+int readlink(char *, char *, int);
+int checkroot(char *path);
diff --git a/win32/winutil.c b/win32/winutil.c
new file mode 100644
index 000000000..c0569920d
--- /dev/null
+++ b/win32/winutil.c
@@ -0,0 +1,33 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: |
+ +----------------------------------------------------------------------+
+ */
+
+/* $Id: winutil.c,v 1.15 2004/01/08 08:18:21 andi Exp $ */
+
+#include "php.h"
+
+PHPAPI char *php_win_err(int error)
+{
+ char *buf = NULL;
+
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&buf, 0, NULL
+ );
+
+ return (buf ? (char *) buf : "");
+}
diff --git a/win32/winutil.h b/win32/winutil.h
new file mode 100644
index 000000000..8fb1ce3d4
--- /dev/null
+++ b/win32/winutil.h
@@ -0,0 +1,21 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2004 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.0 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_0.txt. |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: |
+ +----------------------------------------------------------------------+
+ */
+
+PHPAPI char *php_win_err(int error);
+
+#define php_win_err() php_win_err(GetLastError())
diff --git a/win32/wsyslog.c b/win32/wsyslog.c
new file mode 100644
index 000000000..ca1e45b9c
--- /dev/null
+++ b/win32/wsyslog.c
@@ -0,0 +1,126 @@
+/*
+ * This file modified from sources for imap4 for use
+ * in PHP 3
+ */
+/*
+ * Program: Unix compatibility routines
+ *
+ * Author: Mark Crispin
+ * Networks and Distributed Computing
+ * Computing & Communications
+ * University of Washington
+ * Administration Building, AG-44
+ * Seattle, WA 98195
+ * Internet: MRC@CAC.Washington.EDU
+ *
+ * Date: 14 September 1996
+ * Last Edited: 22 October 1996
+ *
+ * Copyright 1996 by the University of Washington
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * above copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the University of Washington not be
+ * used in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. This software is made available
+ * "as is", and
+ * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
+ * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
+ * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+
+/* DEDICATION
+
+ * This file is dedicated to my dog, Unix, also known as Yun-chan and
+ * Unix J. Terwilliker Jehosophat Aloysius Monstrosity Animal Beast. Unix
+ * passed away at the age of 11 1/2 on September 14, 1996, 12:18 PM PDT, after
+ * a two-month bout with cirrhosis of the liver.
+ *
+ * He was a dear friend, and I miss him terribly.
+ *
+ * Lift a leg, Yunie. Luv ya forever!!!!
+ */
+
+#include "php.h" /*php specific */
+#include "syslog.h"
+#include <stdio.h>
+#include <fcntl.h>
+#include <process.h>
+
+#include "php_win32_globals.h"
+
+void closelog(void)
+{
+ TSRMLS_FETCH();
+ DeregisterEventSource(PW32G(log_source));
+ STR_FREE(PW32G(log_header));
+ PW32G(log_header) = NULL;
+}
+
+/* Emulator for BSD syslog() routine
+ * Accepts: priority
+ * message
+ * parameters
+ */
+
+void syslog(int priority, const char *message, ...)
+{
+ va_list args;
+ LPTSTR strs[2];
+ unsigned short etype;
+ char *tmp = NULL;
+ TSRMLS_FETCH();
+
+ /* default event source */
+ if (!PW32G(log_source))
+ openlog("php", LOG_PID, LOG_SYSLOG);
+
+ switch (priority) { /* translate UNIX type into NT type */
+ case LOG_ALERT:
+ etype = EVENTLOG_ERROR_TYPE;
+ break;
+ case LOG_INFO:
+ etype = EVENTLOG_INFORMATION_TYPE;
+ break;
+ default:
+ etype = EVENTLOG_WARNING_TYPE;
+ }
+ va_start(args, message); /* initialize vararg mechanism */
+ vspprintf(&tmp, 0, message, args); /* build message */
+ strs[0] = PW32G(log_header); /* write header */
+ strs[1] = tmp; /* then the message */
+ /* report the event */
+ ReportEvent(PW32G(log_source), etype, (unsigned short) priority, 2000, NULL, 2, 0, strs, NULL);
+ va_end(args);
+ efree(tmp);
+}
+
+
+/* Emulator for BSD openlog() routine
+ * Accepts: identity
+ * options
+ * facility
+ */
+
+void openlog(const char *ident, int logopt, int facility)
+{
+ TSRMLS_FETCH();
+
+ if (PW32G(log_source)) {
+ closelog();
+ }
+
+ STR_FREE(PW32G(log_header));
+
+ PW32G(log_source) = RegisterEventSource(NULL, ident);
+ spprintf(&PW32G(log_header), 0, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid());
+}