From 2aa897476fd584c037d2414e18382a7e9531e6db Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 13 Oct 2018 11:22:30 +0200 Subject: [PATCH] Convert CRLF line endings to LF This patch simplifies line endings tracked in the Git repository and syncs them to all include the LF style instead of the CRLF files. Newline characters: - LF (\n) (*nix and Mac) - CRLF (\r\n) (Windows) - CR (\r) (old Mac, obsolete) To see which line endings are in the index and in the working copy the following command can be used: `git ls-files --eol` Git additionally provides `.gitattributes` file to specify if some files need to have specific line endings on all platforms (either CRLF or LF). Changed files shouldn't cause issues on modern Windows platforms because also Git can do output conversion is core.autocrlf=true is set on Windows and use CRLF newlines in all files in the working tree. Unless CRLF files are tracked specifically, Git by default tracks all files in the index using LF newlines. --- ext/exif/tests/bug76164.phpt | 32 +- ext/gd/tests/bug47946.phpt | 102 ++-- ext/gd/tests/bug52070.phpt | 50 +- ext/gd/tests/bug73968.phpt | 30 +- ext/intl/tests/resourcebundle.build | 64 +-- ext/mbstring/tests/bug75944.phpt | 26 +- ext/pcre/tests/bug73612.phpt | 54 +- ext/session/mod_files.bat | 114 ++-- ext/spl/tests/bug73629.phpt | 40 +- ext/spl/tests/bug74478.phpt | 122 ++-- .../tests/file/windows_links/bug73962.phpt | 154 ++--- ext/standard/tests/streams/bug74090.phpt | 44 +- win32/build/buildconf.js | 526 +++++++++--------- win32/syslog.reg | 10 +- 14 files changed, 684 insertions(+), 684 deletions(-) diff --git a/ext/exif/tests/bug76164.phpt b/ext/exif/tests/bug76164.phpt index ea77e1d5e9..72aefad6f1 100644 --- a/ext/exif/tests/bug76164.phpt +++ b/ext/exif/tests/bug76164.phpt @@ -1,16 +1,16 @@ ---TEST-- -Bug #76164 (exif_read_data zend_mm_heap corrupted) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -===DONE=== +--TEST-- +Bug #76164 (exif_read_data zend_mm_heap corrupted) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +===DONE=== diff --git a/ext/gd/tests/bug47946.phpt b/ext/gd/tests/bug47946.phpt index c84508509c..aeea7fb324 100644 --- a/ext/gd/tests/bug47946.phpt +++ b/ext/gd/tests/bug47946.phpt @@ -1,51 +1,51 @@ ---TEST-- -Bug #47946 (ImageConvolution overwrites background) ---DESCRIPTION-- -The expected image has black pixel artifacts, what is another issue, though -(perhaps #40158). ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -The images are equal. -===DONE=== +--TEST-- +Bug #47946 (ImageConvolution overwrites background) +--DESCRIPTION-- +The expected image has black pixel artifacts, what is another issue, though +(perhaps #40158). +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +The images are equal. +===DONE=== diff --git a/ext/gd/tests/bug52070.phpt b/ext/gd/tests/bug52070.phpt index acf56e6b5b..d44a527479 100644 --- a/ext/gd/tests/bug52070.phpt +++ b/ext/gd/tests/bug52070.phpt @@ -1,25 +1,25 @@ ---TEST-- -Bug #52070 (imagedashedline() - dashed line sometimes is not visible) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECT-- -The images are equal. -===DONE=== +--TEST-- +Bug #52070 (imagedashedline() - dashed line sometimes is not visible) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +The images are equal. +===DONE=== diff --git a/ext/gd/tests/bug73968.phpt b/ext/gd/tests/bug73968.phpt index fd17fe26ba..2211840f58 100644 --- a/ext/gd/tests/bug73968.phpt +++ b/ext/gd/tests/bug73968.phpt @@ -1,15 +1,15 @@ ---TEST-- -Bug #73968 (Premature failing of XBM reading) ---SKIPIF-- - ---FILE-- - -===DONE=== ---EXPECTF-- -resource(%d) of type (gd) -===DONE=== +--TEST-- +Bug #73968 (Premature failing of XBM reading) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +resource(%d) of type (gd) +===DONE=== diff --git a/ext/intl/tests/resourcebundle.build b/ext/intl/tests/resourcebundle.build index 6a7eeae5eb..560dc8fb45 100644 --- a/ext/intl/tests/resourcebundle.build +++ b/ext/intl/tests/resourcebundle.build @@ -1,33 +1,33 @@ -getFileName()); -} - -$dir = new GlobIterator("$here/_files/resourcebundle/*.res", FilesystemIterator::KEY_AS_FILENAME); -foreach($dir as $file) { - if($file->getFileName() == "res_index.res") continue; - $list[] = str_replace(".res", "", $file->getFileName()); -} - -$filelist = join(" {\"\"}\n", $list); -$res_index = <<getFileName()); +} + +$dir = new GlobIterator("$here/_files/resourcebundle/*.res", FilesystemIterator::KEY_AS_FILENAME); +foreach($dir as $file) { + if($file->getFileName() == "res_index.res") continue; + $list[] = str_replace(".res", "", $file->getFileName()); +} + +$filelist = join(" {\"\"}\n", $list); +$res_index = << ---FILE-- - ---EXPECT-- -string(12) "Windows-1251" -string(12) "Windows-1251" - +--TEST-- +Bug #75944 (wrong detection cp1251 encoding because of missing last cyrillic letter) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +string(12) "Windows-1251" +string(12) "Windows-1251" + diff --git a/ext/pcre/tests/bug73612.phpt b/ext/pcre/tests/bug73612.phpt index 707e10bce6..210e706bfb 100644 --- a/ext/pcre/tests/bug73612.phpt +++ b/ext/pcre/tests/bug73612.phpt @@ -1,27 +1,27 @@ ---TEST-- -Bug #73612 (preg_*() may leak memory) ---FILE-- -obj = $obj; -preg_match('/./', 'x', $obj); - -$obj = new stdClass; -$obj->obj = $obj; -preg_replace('/./', '', 'x', -1, $obj); - -$obj = new stdClass; -$obj->obj = $obj; -preg_replace_callback('/./', 'count', 'x', -1, $obj); - -$obj = new stdClass; -$obj->obj = $obj; -preg_replace_callback_array(['/./' => 'count'], 'x', -1, $obj); - -$obj = new stdClass; -$obj->obj = $obj; -preg_filter('/./', '', 'x', -1, $obj); -?> -===DONE=== ---EXPECT-- -===DONE=== +--TEST-- +Bug #73612 (preg_*() may leak memory) +--FILE-- +obj = $obj; +preg_match('/./', 'x', $obj); + +$obj = new stdClass; +$obj->obj = $obj; +preg_replace('/./', '', 'x', -1, $obj); + +$obj = new stdClass; +$obj->obj = $obj; +preg_replace_callback('/./', 'count', 'x', -1, $obj); + +$obj = new stdClass; +$obj->obj = $obj; +preg_replace_callback_array(['/./' => 'count'], 'x', -1, $obj); + +$obj = new stdClass; +$obj->obj = $obj; +preg_filter('/./', '', 'x', -1, $obj); +?> +===DONE=== +--EXPECT-- +===DONE=== diff --git a/ext/session/mod_files.bat b/ext/session/mod_files.bat index 4ec9a49ca2..b6a8babae8 100644 --- a/ext/session/mod_files.bat +++ b/ext/session/mod_files.bat @@ -1,57 +1,57 @@ -@ECHO OFF -SETLOCAL ENABLEDELAYEDEXPANSION - -IF _%1_==_AUTO_ ( - GOTO MakeDirs -) - -IF _%2_==__ ( - ECHO Usage %0 ^ ^ ^[^hash_bits^] - ECHO. - ECHO Where ^ is the session directory - ECHO ^ is the number of levels defined in session.save_path - ECHO ^[hash_bits^] is the number of bits defined in session.hash_bits_per_character - EXIT /B 1 -) - -SET /A Depth=%2 + 0 2>NUL -IF /I %ERRORLEVEL% EQU 9167 GOTO DepthError -IF _%Depth%_==__ GOTO DepthError -IF /I %Depth% LEQ 0 GOTO DepthError - -IF _%3_==__ GOTO DefaultBits - -SET /A Bits=%3 + 0 2>NUL -IF /I %ERRORLEVEL% EQU 9167 GOTO BitsError -IF _%Bits%_==__ GOTO BitsError -IF /I %Bits% LSS 4 GOTO BitsError -IF /I %Bits% GTR 6 GOTO BitsError -GOTO BitsSet - -:DefaultBits -SET Bits=4 -:BitsSet - -SET HashChars=0 1 2 3 4 5 6 7 8 9 A B C D E F -IF /I %Bits% GEQ 5 SET HashChars=!HashChars! G H I J K L M N O P Q R S T U V -IF /I %Bits% GEQ 6 SET HashChars=!HashChars! W X Y Z - , - -FOR %%A IN (%HashChars%) DO ( - ECHO Making %%A - CALL "%~0" AUTO "%~1\%%~A" %Depth% -) -GOTO :EOF - -:MakeDirs -MKDIR "%~2" -SET /A ThisDepth=%3 - 1 -IF /I %ThisDepth% GTR 0 FOR %%A IN (%HashChars%) DO CALL "%~0" AUTO "%~2\%%~A" %ThisDepth% -GOTO :EOF - -:DepthError -ECHO ERROR: Invalid depth : %2 -EXIT /B 0 - -:BitsError -ECHO ERROR: Invalid hash_bits : %3 -EXIT /B 0 +@ECHO OFF +SETLOCAL ENABLEDELAYEDEXPANSION + +IF _%1_==_AUTO_ ( + GOTO MakeDirs +) + +IF _%2_==__ ( + ECHO Usage %0 ^ ^ ^[^hash_bits^] + ECHO. + ECHO Where ^ is the session directory + ECHO ^ is the number of levels defined in session.save_path + ECHO ^[hash_bits^] is the number of bits defined in session.hash_bits_per_character + EXIT /B 1 +) + +SET /A Depth=%2 + 0 2>NUL +IF /I %ERRORLEVEL% EQU 9167 GOTO DepthError +IF _%Depth%_==__ GOTO DepthError +IF /I %Depth% LEQ 0 GOTO DepthError + +IF _%3_==__ GOTO DefaultBits + +SET /A Bits=%3 + 0 2>NUL +IF /I %ERRORLEVEL% EQU 9167 GOTO BitsError +IF _%Bits%_==__ GOTO BitsError +IF /I %Bits% LSS 4 GOTO BitsError +IF /I %Bits% GTR 6 GOTO BitsError +GOTO BitsSet + +:DefaultBits +SET Bits=4 +:BitsSet + +SET HashChars=0 1 2 3 4 5 6 7 8 9 A B C D E F +IF /I %Bits% GEQ 5 SET HashChars=!HashChars! G H I J K L M N O P Q R S T U V +IF /I %Bits% GEQ 6 SET HashChars=!HashChars! W X Y Z - , + +FOR %%A IN (%HashChars%) DO ( + ECHO Making %%A + CALL "%~0" AUTO "%~1\%%~A" %Depth% +) +GOTO :EOF + +:MakeDirs +MKDIR "%~2" +SET /A ThisDepth=%3 - 1 +IF /I %ThisDepth% GTR 0 FOR %%A IN (%HashChars%) DO CALL "%~0" AUTO "%~2\%%~A" %ThisDepth% +GOTO :EOF + +:DepthError +ECHO ERROR: Invalid depth : %2 +EXIT /B 0 + +:BitsError +ECHO ERROR: Invalid hash_bits : %3 +EXIT /B 0 diff --git a/ext/spl/tests/bug73629.phpt b/ext/spl/tests/bug73629.phpt index 5b6587c685..ee0b8a6fba 100644 --- a/ext/spl/tests/bug73629.phpt +++ b/ext/spl/tests/bug73629.phpt @@ -1,20 +1,20 @@ ---TEST-- -Bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags) ---FILE-- -setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); -} catch (Exception $e) { - echo 'unexpected exception: ' . $e->getMessage() . "\n"; -} -try { - $q->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); -} catch (Exception $e) { - echo 'expected exception: ' . $e->getMessage() . "\n"; -} -?> -===DONE=== ---EXPECTF-- -expected exception: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen -===DONE=== +--TEST-- +Bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags) +--FILE-- +setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); +} catch (Exception $e) { + echo 'unexpected exception: ' . $e->getMessage() . "\n"; +} +try { + $q->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); +} catch (Exception $e) { + echo 'expected exception: ' . $e->getMessage() . "\n"; +} +?> +===DONE=== +--EXPECTF-- +expected exception: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen +===DONE=== diff --git a/ext/spl/tests/bug74478.phpt b/ext/spl/tests/bug74478.phpt index da63984d5c..c384648466 100644 --- a/ext/spl/tests/bug74478.phpt +++ b/ext/spl/tests/bug74478.phpt @@ -1,62 +1,62 @@ ---TEST-- -Bug #74478: null coalescing operator failing with SplFixedArray ---FILE-- -foo)); -var_dump($fixedData[0] ?? 42); -var_dump($fixedData[0][1][2] ?? 42); - -$fixedData[0] = new MyFixedArray(10); -$fixedData[0][1] = new MyFixedArray(10); -var_dump(isset($fixedData[0][1][2])); -var_dump($fixedData[0][1][2] ?? 42); - -?> ---EXPECT-- -offsetExists(0) -bool(false) -offsetExists(0) -bool(false) -offsetExists(0) -int(42) -offsetExists(0) -int(42) -offsetSet(0) -offsetGet(0) -offsetSet(1) -offsetExists(0) -offsetGet(0) -offsetExists(1) -offsetGet(1) -offsetExists(2) -bool(false) -offsetExists(0) -offsetGet(0) -offsetExists(1) -offsetGet(1) -offsetExists(2) +--TEST-- +Bug #74478: null coalescing operator failing with SplFixedArray +--FILE-- +foo)); +var_dump($fixedData[0] ?? 42); +var_dump($fixedData[0][1][2] ?? 42); + +$fixedData[0] = new MyFixedArray(10); +$fixedData[0][1] = new MyFixedArray(10); +var_dump(isset($fixedData[0][1][2])); +var_dump($fixedData[0][1][2] ?? 42); + +?> +--EXPECT-- +offsetExists(0) +bool(false) +offsetExists(0) +bool(false) +offsetExists(0) +int(42) +offsetExists(0) +int(42) +offsetSet(0) +offsetGet(0) +offsetSet(1) +offsetExists(0) +offsetGet(0) +offsetExists(1) +offsetGet(1) +offsetExists(2) +bool(false) +offsetExists(0) +offsetGet(0) +offsetExists(1) +offsetGet(1) +offsetExists(2) int(42) \ No newline at end of file diff --git a/ext/standard/tests/file/windows_links/bug73962.phpt b/ext/standard/tests/file/windows_links/bug73962.phpt index 6d578386e6..9be48c7eeb 100644 --- a/ext/standard/tests/file/windows_links/bug73962.phpt +++ b/ext/standard/tests/file/windows_links/bug73962.phpt @@ -1,77 +1,77 @@ ---TEST-- -Bug #73962 bug with symlink related to cyrillic directory ---SKIPIF-- -&1', $out); -if (strpos($ret, 'privilege')) { - die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); -} -unlink('bug48746_tmp.lnk'); -?> ---FILE-- -"); -file_put_contents("$fullpath\\mnt\\test\\новая папка\\b.php", ""); -var_dump(scandir("mklink_symlink")); -var_dump(scandir("$fullpath\\mnt\\test\\новая папка")); -var_dump(scandir("$fullpath\\mnt\\test\\mklink_symlink")); -var_dump(is_readable("$fullpath\\mnt\\test\\mklink_symlink\b.php")); -unlink("$fullpath\\mnt\\test\\новая папка\\b.php"); -unlink("mklink_symlink\\a.php"); -chdir($old_dir); -rmdir(__DIR__ . "\\mnt\\test\\новая папка"); -rmdir(__DIR__ . "\\mnt\\test\\mklink_symlink"); -rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); -rmdir(__DIR__ . "\\mnt\\test"); -rmdir(__DIR__ . "\\mnt"); - -?> ---EXPECT-- -array(4) { - [0]=> - string(1) "." - [1]=> - string(2) ".." - [2]=> - string(5) "a.php" - [3]=> - string(5) "b.php" -} -array(4) { - [0]=> - string(1) "." - [1]=> - string(2) ".." - [2]=> - string(5) "a.php" - [3]=> - string(5) "b.php" -} -array(4) { - [0]=> - string(1) "." - [1]=> - string(2) ".." - [2]=> - string(5) "a.php" - [3]=> - string(5) "b.php" -} -bool(true) - +--TEST-- +Bug #73962 bug with symlink related to cyrillic directory +--SKIPIF-- +&1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); +} +unlink('bug48746_tmp.lnk'); +?> +--FILE-- +"); +file_put_contents("$fullpath\\mnt\\test\\новая папка\\b.php", ""); +var_dump(scandir("mklink_symlink")); +var_dump(scandir("$fullpath\\mnt\\test\\новая папка")); +var_dump(scandir("$fullpath\\mnt\\test\\mklink_symlink")); +var_dump(is_readable("$fullpath\\mnt\\test\\mklink_symlink\b.php")); +unlink("$fullpath\\mnt\\test\\новая папка\\b.php"); +unlink("mklink_symlink\\a.php"); +chdir($old_dir); +rmdir(__DIR__ . "\\mnt\\test\\новая папка"); +rmdir(__DIR__ . "\\mnt\\test\\mklink_symlink"); +rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); +rmdir(__DIR__ . "\\mnt\\test"); +rmdir(__DIR__ . "\\mnt"); + +?> +--EXPECT-- +array(4) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(5) "a.php" + [3]=> + string(5) "b.php" +} +array(4) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(5) "a.php" + [3]=> + string(5) "b.php" +} +array(4) { + [0]=> + string(1) "." + [1]=> + string(2) ".." + [2]=> + string(5) "a.php" + [3]=> + string(5) "b.php" +} +bool(true) + diff --git a/ext/standard/tests/streams/bug74090.phpt b/ext/standard/tests/streams/bug74090.phpt index 370dd13f1b..c0fc85c5ef 100644 --- a/ext/standard/tests/streams/bug74090.phpt +++ b/ext/standard/tests/streams/bug74090.phpt @@ -1,22 +1,22 @@ ---TEST-- -Bug #74090 stream_get_contents maxlength>-1 returns empty string on windows ---SKIPIF-- - ---FILE-- - 0); -stream_socket_shutdown($fd,STREAM_SHUT_RDWR); -?> -==DONE== ---EXPECTF-- -bool(true) -==DONE== +--TEST-- +Bug #74090 stream_get_contents maxlength>-1 returns empty string on windows +--SKIPIF-- + +--FILE-- + 0); +stream_socket_shutdown($fd,STREAM_SHUT_RDWR); +?> +==DONE== +--EXPECTF-- +bool(true) +==DONE== diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js index 49ed480482..9d2f318c97 100644 --- a/win32/build/buildconf.js +++ b/win32/build/buildconf.js @@ -1,263 +1,263 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 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_01.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 | - +----------------------------------------------------------------------+ -*/ - -/* $Id: buildconf.js,v 1.13.2.2.2.1.2.5 2009-01-02 12:18:21 kalle 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 B = FSO.CreateTextFile("configure.bat", true); - -var modules = ""; -var MODULES = WScript.CreateObject("Scripting.Dictionary"); -var module_dirs = new Array(); - -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 == '.svn' || 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; -} - -// Process buildconf arguments -function buildconf_process_args() -{ - args = WScript.Arguments; - - for (i = 0; i < args.length; i++) { - arg = args(i); - // 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; - } - - if (argname == '--add-modules-dir' && argval != null) { - WScript.StdOut.WriteLine("Adding " + argval + " to the module search path"); - module_dirs[module_dirs.length] = argval; - } - } -} - -buildconf_process_args(); - -// Write the head of the configure script -C.WriteLine("/* This file automatically generated from win32/build/confutils.js */"); -C.WriteLine("MODE_PHPIZE=false;"); -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(); - -// If we have not specified any module dirs let's add some defaults -if (module_dirs.length == 0) { - find_config_w32("pecl"); - find_config_w32("..\\pecl"); - find_config_w32("pecl\\rpc"); - find_config_w32("..\\pecl\\rpc"); -} else { - for (i = 0; i < module_dirs.length; i++) { - find_config_w32(module_dirs[i]); - } -} - -// 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("try {"); - C.WriteLine(item); - C.WriteLine("} catch (e) {"); - C.WriteLine('\tSTDOUT.WriteLine("problem: " + e);'); - C.WriteLine("}"); -} - -C.WriteBlankLines(1); -C.WriteLine("check_binary_tools_sdk();"); -C.WriteBlankLines(1); -C.WriteLine("STDOUT.WriteLine(\"PHP Version: \" + PHP_VERSION_STRING);"); -C.WriteLine("STDOUT.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")); - -B.WriteLine("@echo off"); -B.WriteLine("cscript /nologo configure.js %*"); - +/* + +----------------------------------------------------------------------+ + | PHP Version 7 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2018 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 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_01.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 | + +----------------------------------------------------------------------+ +*/ + +/* $Id: buildconf.js,v 1.13.2.2.2.1.2.5 2009-01-02 12:18:21 kalle 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 B = FSO.CreateTextFile("configure.bat", true); + +var modules = ""; +var MODULES = WScript.CreateObject("Scripting.Dictionary"); +var module_dirs = new Array(); + +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 == '.svn' || 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; +} + +// Process buildconf arguments +function buildconf_process_args() +{ + args = WScript.Arguments; + + for (i = 0; i < args.length; i++) { + arg = args(i); + // 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; + } + + if (argname == '--add-modules-dir' && argval != null) { + WScript.StdOut.WriteLine("Adding " + argval + " to the module search path"); + module_dirs[module_dirs.length] = argval; + } + } +} + +buildconf_process_args(); + +// Write the head of the configure script +C.WriteLine("/* This file automatically generated from win32/build/confutils.js */"); +C.WriteLine("MODE_PHPIZE=false;"); +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(); + +// If we have not specified any module dirs let's add some defaults +if (module_dirs.length == 0) { + find_config_w32("pecl"); + find_config_w32("..\\pecl"); + find_config_w32("pecl\\rpc"); + find_config_w32("..\\pecl\\rpc"); +} else { + for (i = 0; i < module_dirs.length; i++) { + find_config_w32(module_dirs[i]); + } +} + +// 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("try {"); + C.WriteLine(item); + C.WriteLine("} catch (e) {"); + C.WriteLine('\tSTDOUT.WriteLine("problem: " + e);'); + C.WriteLine("}"); +} + +C.WriteBlankLines(1); +C.WriteLine("check_binary_tools_sdk();"); +C.WriteBlankLines(1); +C.WriteLine("STDOUT.WriteLine(\"PHP Version: \" + PHP_VERSION_STRING);"); +C.WriteLine("STDOUT.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")); + +B.WriteLine("@echo off"); +B.WriteLine("cscript /nologo configure.js %*"); + diff --git a/win32/syslog.reg b/win32/syslog.reg index 2974bfbd48..54184159d0 100644 --- a/win32/syslog.reg +++ b/win32/syslog.reg @@ -1,5 +1,5 @@ -REGEDIT4 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.3.99-dev] -"TypesSupported"=dword:00000007 -"EventMessageFile"="g:\\test\\srctrunkinstall\\php7ts.dll" +REGEDIT4 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.3.99-dev] +"TypesSupported"=dword:00000007 +"EventMessageFile"="g:\\test\\srctrunkinstall\\php7ts.dll" -- 2.40.0