From 85290bbfccb29c1c8204652fa5956742732c7d10 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 13 Oct 2018 11:23:20 +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. --- Zend/zend_vm_trace_map.h | 162 +++--- 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/ftruncate_bug76422.phpt | 72 +-- .../tests/file/ftruncate_bug76803.phpt | 76 +-- .../tests/file/windows_links/bug73962.phpt | 154 ++--- ext/standard/tests/streams/bug74090.phpt | 44 +- win32/build/buildconf.js | 524 +++++++++--------- win32/syslog.reg | 10 +- 17 files changed, 838 insertions(+), 838 deletions(-) diff --git a/Zend/zend_vm_trace_map.h b/Zend/zend_vm_trace_map.h index 1d8828b3a8..a5da487611 100644 --- a/Zend/zend_vm_trace_map.h +++ b/Zend/zend_vm_trace_map.h @@ -1,82 +1,82 @@ -/* - +----------------------------------------------------------------------+ - | Zend Engine | - +----------------------------------------------------------------------+ - | Copyright (c) 1998-2018 Zend Technologies Ltd. (http://www.zend.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | - | If you did not receive a copy of the Zend license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@zend.com so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Dmitry Stogov | - +----------------------------------------------------------------------+ -*/ - -#include "zend_vm_handlers.h" -#include "zend_sort.h" - -#define GEN_MAP(n, name) do { \ - ZVAL_LONG(&tmp, (zend_long)(uintptr_t)zend_opcode_handlers[n]); \ - zend_hash_str_add(&vm_trace_ht, #name, sizeof(#name) - 1, &tmp); \ - } while (0); - -#define VM_TRACE_START() do { \ - zval tmp; \ - zend_hash_init(&vm_trace_ht, 0, NULL, NULL, 1); \ - VM_HANDLERS(GEN_MAP) \ - zend_vm_trace_init(); \ - } while (0) - -#ifdef _WIN64 -# define ADDR_FMT "%016I64x" -#elif SIZEOF_SIZE_T == 4 -# define ADDR_FMT "%08zx" -#elif SIZEOF_SIZE_T == 8 -# define ADDR_FMT "%016zx" -#else -# error "Unknown SIZEOF_SIZE_T" -#endif - -static HashTable vm_trace_ht; - -static int zend_vm_trace_compare(const Bucket *p1, const Bucket *p2) -{ - if (Z_LVAL(p1->val) > Z_LVAL(p2->val)) { - return 1; - } else if (Z_LVAL(p1->val) < Z_LVAL(p2->val)) { - return -1; - } else { - return 0; - } -} - -static void zend_vm_trace_init(void) -{ - FILE *f; - zend_string *key, *prev_key; - zval *val; - zend_long prev_addr; - - f = fopen("zend_vm.map", "w+"); - if (f) { - zend_hash_sort(&vm_trace_ht, (compare_func_t)zend_vm_trace_compare, 0); - prev_key = NULL; - ZEND_HASH_FOREACH_STR_KEY_VAL(&vm_trace_ht, key, val) { - if (prev_key) { - fprintf(f, ADDR_FMT" "ADDR_FMT" t %s\n", prev_addr, Z_LVAL_P(val) - prev_addr, ZSTR_VAL(prev_key)); - } - prev_key = key; - prev_addr = Z_LVAL_P(val); - } ZEND_HASH_FOREACH_END(); - if (prev_key) { - fprintf(f, ADDR_FMT" "ADDR_FMT" t %s\n", prev_addr, 0, ZSTR_VAL(prev_key)); - } - fclose(f); - } - zend_hash_destroy(&vm_trace_ht); -} +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) 1998-2018 Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | + | If you did not receive a copy of the Zend license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@zend.com so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Dmitry Stogov | + +----------------------------------------------------------------------+ +*/ + +#include "zend_vm_handlers.h" +#include "zend_sort.h" + +#define GEN_MAP(n, name) do { \ + ZVAL_LONG(&tmp, (zend_long)(uintptr_t)zend_opcode_handlers[n]); \ + zend_hash_str_add(&vm_trace_ht, #name, sizeof(#name) - 1, &tmp); \ + } while (0); + +#define VM_TRACE_START() do { \ + zval tmp; \ + zend_hash_init(&vm_trace_ht, 0, NULL, NULL, 1); \ + VM_HANDLERS(GEN_MAP) \ + zend_vm_trace_init(); \ + } while (0) + +#ifdef _WIN64 +# define ADDR_FMT "%016I64x" +#elif SIZEOF_SIZE_T == 4 +# define ADDR_FMT "%08zx" +#elif SIZEOF_SIZE_T == 8 +# define ADDR_FMT "%016zx" +#else +# error "Unknown SIZEOF_SIZE_T" +#endif + +static HashTable vm_trace_ht; + +static int zend_vm_trace_compare(const Bucket *p1, const Bucket *p2) +{ + if (Z_LVAL(p1->val) > Z_LVAL(p2->val)) { + return 1; + } else if (Z_LVAL(p1->val) < Z_LVAL(p2->val)) { + return -1; + } else { + return 0; + } +} + +static void zend_vm_trace_init(void) +{ + FILE *f; + zend_string *key, *prev_key; + zval *val; + zend_long prev_addr; + + f = fopen("zend_vm.map", "w+"); + if (f) { + zend_hash_sort(&vm_trace_ht, (compare_func_t)zend_vm_trace_compare, 0); + prev_key = NULL; + ZEND_HASH_FOREACH_STR_KEY_VAL(&vm_trace_ht, key, val) { + if (prev_key) { + fprintf(f, ADDR_FMT" "ADDR_FMT" t %s\n", prev_addr, Z_LVAL_P(val) - prev_addr, ZSTR_VAL(prev_key)); + } + prev_key = key; + prev_addr = Z_LVAL_P(val); + } ZEND_HASH_FOREACH_END(); + if (prev_key) { + fprintf(f, ADDR_FMT" "ADDR_FMT" t %s\n", prev_addr, 0, ZSTR_VAL(prev_key)); + } + fclose(f); + } + zend_hash_destroy(&vm_trace_ht); +} \ No newline at end of file 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 29b9dfc061..9ad0cec60f 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=== ---EXPECT-- -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=== +--EXPECT-- +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/ftruncate_bug76422.phpt b/ext/standard/tests/file/ftruncate_bug76422.phpt index 46f52aace9..b149f02c64 100644 --- a/ext/standard/tests/file/ftruncate_bug76422.phpt +++ b/ext/standard/tests/file/ftruncate_bug76422.phpt @@ -1,36 +1,36 @@ ---TEST-- -Bug #76422 ftruncate fails on files > 2GB ---SKIPIF-- - ---FILE-- -= $truncate_offset); -?> ---CLEAN-- - ---EXPECT-- -bool(true) +--TEST-- +Bug #76422 ftruncate fails on files > 2GB +--SKIPIF-- + +--FILE-- += $truncate_offset); +?> +--CLEAN-- + +--EXPECT-- +bool(true) diff --git a/ext/standard/tests/file/ftruncate_bug76803.phpt b/ext/standard/tests/file/ftruncate_bug76803.phpt index 7e99cf2fb2..fe261e8861 100644 --- a/ext/standard/tests/file/ftruncate_bug76803.phpt +++ b/ext/standard/tests/file/ftruncate_bug76803.phpt @@ -1,38 +1,38 @@ ---TEST-- -Bug #76803 ftruncate changes file pointer ---FILE-- - ---CLEAN-- - ---EXPECT-- -string(13) "He\0\0\0World" -string(2) "He" -string(7) "HeWorld" +--TEST-- +Bug #76803 ftruncate changes file pointer +--FILE-- + +--CLEAN-- + +--EXPECT-- +string(13) "He\0\0\0World" +string(2) "He" +string(7) "HeWorld" 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 47efc2c7cd..f6187003fa 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== ---EXPECT-- -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== +--EXPECT-- +bool(true) +==DONE== diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js index 5d5fb499ec..e20e92848b 100644 --- a/win32/build/buildconf.js +++ b/win32/build/buildconf.js @@ -1,262 +1,262 @@ -/* - +----------------------------------------------------------------------+ - | 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 | - +----------------------------------------------------------------------+ -*/ - -// 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 | + +----------------------------------------------------------------------+ +*/ + +// 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 71942f5b84..a817b52faf 100644 --- a/win32/syslog.reg +++ b/win32/syslog.reg @@ -1,5 +1,5 @@ -REGEDIT4 - -[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-7.3.0-dev] -"TypesSupported"=dword:00000007 -"EventMessageFile"="g:\\test\\srctrunkinstall\\php7ts.dll" +REGEDIT4 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-7.3.0-dev] +"TypesSupported"=dword:00000007 +"EventMessageFile"="g:\\test\\srctrunkinstall\\php7ts.dll" -- 2.50.0