summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2018-10-13 11:23:52 +0200
committerPeter Kokot <peterkokot@gmail.com>2018-10-13 11:23:52 +0200
commitbe2ddc6b6575da0b8e7ed235464f7e23c71674c7 (patch)
tree5874fbbbc1fa30e04b9fc823912bce0ceea92389
parent272c629c0a1efff2a6a7c53af8f1632d2bcef252 (diff)
downloadphp-git-be2ddc6b6575da0b8e7ed235464f7e23c71674c7.tar.gz
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.
-rw-r--r--Zend/zend_vm_trace_map.h162
-rw-r--r--ext/exif/tests/bug76164.phpt32
-rw-r--r--ext/gd/tests/bug47946.phpt102
-rw-r--r--ext/gd/tests/bug52070.phpt50
-rw-r--r--ext/gd/tests/bug73968.phpt30
-rw-r--r--ext/intl/tests/resourcebundle.build64
-rw-r--r--ext/mbstring/tests/bug75944.phpt26
-rw-r--r--ext/pcre/tests/bug73612.phpt54
-rw-r--r--ext/session/mod_files.bat114
-rw-r--r--ext/spl/tests/bug73629.phpt40
-rw-r--r--ext/spl/tests/bug74478.phpt122
-rw-r--r--ext/standard/tests/file/ftruncate_bug76422.phpt72
-rw-r--r--ext/standard/tests/file/ftruncate_bug76803.phpt76
-rw-r--r--ext/standard/tests/file/windows_links/bug73962.phpt154
-rw-r--r--ext/standard/tests/streams/bug74090.phpt44
-rw-r--r--win32/build/buildconf.js524
-rw-r--r--win32/syslog.reg10
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 <dmitry@zend.com> |
- +----------------------------------------------------------------------+
-*/
-
-#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 <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+
+#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--
-<?php
-if (!extension_loaded('exif')) die('skip exif extension not available');
-?>
---FILE--
-<?php
-$var1 = 'nonexistentfile';
-$var2 = 2200000000;
-@exif_read_data($var1, $var2); // we're not interested in the warning, here
-$var2 = 1;
-?>
-===DONE===
---EXPECT--
-===DONE===
+--TEST--
+Bug #76164 (exif_read_data zend_mm_heap corrupted)
+--SKIPIF--
+<?php
+if (!extension_loaded('exif')) die('skip exif extension not available');
+?>
+--FILE--
+<?php
+$var1 = 'nonexistentfile';
+$var2 = 2200000000;
+@exif_read_data($var1, $var2); // we're not interested in the warning, here
+$var2 = 1;
+?>
+===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--
-<?php
-if (!extension_loaded('gd')) die('skip gd extension not available');
-?>
---FILE--
-<?php
-function array_flatten($array)
-{
- $tempArray = array();
-
- foreach ($array as $value) {
- if (is_array($value)) {
- $tempArray = array_merge($tempArray, array_flatten($value));
- } else {
- $tempArray[] = $value;
- }
- }
-
- return $tempArray;
-}
-
-function makeFilter($resource, $matrix, $offset = 1.0)
-{
- $divisor = array_sum(array_flatten($matrix));
- if ($divisor == 0) {
- $divisor = .01;
- }
- return imageconvolution($resource, $matrix, $divisor, $offset);
-}
-
-$edgeMatrix = array(array(1, 0, 1), array(0, 5, 0), array(1, 0, 1));
-
-$im = imagecreatetruecolor(40, 40);
-imagealphablending($im, false);
-imagefilledrectangle($im, 0, 0, 39, 39, 0x7fffffff);
-imagefilledellipse($im, 19, 19, 20, 20, 0x00ff00);
-imagesavealpha($im, true);
-makeFilter($im, $edgeMatrix);
-
-require_once __DIR__ . '/func.inc';
-test_image_equals_file(__DIR__ . '/bug47946_exp.png', $im);
-?>
-===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--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+function array_flatten($array)
+{
+ $tempArray = array();
+
+ foreach ($array as $value) {
+ if (is_array($value)) {
+ $tempArray = array_merge($tempArray, array_flatten($value));
+ } else {
+ $tempArray[] = $value;
+ }
+ }
+
+ return $tempArray;
+}
+
+function makeFilter($resource, $matrix, $offset = 1.0)
+{
+ $divisor = array_sum(array_flatten($matrix));
+ if ($divisor == 0) {
+ $divisor = .01;
+ }
+ return imageconvolution($resource, $matrix, $divisor, $offset);
+}
+
+$edgeMatrix = array(array(1, 0, 1), array(0, 5, 0), array(1, 0, 1));
+
+$im = imagecreatetruecolor(40, 40);
+imagealphablending($im, false);
+imagefilledrectangle($im, 0, 0, 39, 39, 0x7fffffff);
+imagefilledellipse($im, 19, 19, 20, 20, 0x00ff00);
+imagesavealpha($im, true);
+makeFilter($im, $edgeMatrix);
+
+require_once __DIR__ . '/func.inc';
+test_image_equals_file(__DIR__ . '/bug47946_exp.png', $im);
+?>
+===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--
-<?php
-if (!extension_loaded('gd')) die('skip gd extension not available');
-?>
---FILE--
-<?php
-$im = imagecreate(1200, 800);
-$background_color = imagecolorallocate($im, 40, 40, 40);
-$color = imagecolorallocate($im, 255, 255, 255);
-imagedashedline($im, 800, 400, 300, 400, $color);
-imagedashedline($im, 800, 400, 300, 800, $color);
-imagedashedline($im, 800, 400, 400, 800, $color);
-imagedashedline($im, 800, 400, 500, 800, $color);
-imagedashedline($im, 800, 400, 600, 800, $color);
-imagedashedline($im, 800, 400, 700, 800, $color);
-imagedashedline($im, 800, 400, 800, 800, $color);
-include_once __DIR__ . '/func.inc';
-test_image_equals_file(__DIR__ . '/bug52070.png', $im);
-?>
-===DONE===
---EXPECT--
-The images are equal.
-===DONE===
+--TEST--
+Bug #52070 (imagedashedline() - dashed line sometimes is not visible)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+$im = imagecreate(1200, 800);
+$background_color = imagecolorallocate($im, 40, 40, 40);
+$color = imagecolorallocate($im, 255, 255, 255);
+imagedashedline($im, 800, 400, 300, 400, $color);
+imagedashedline($im, 800, 400, 300, 800, $color);
+imagedashedline($im, 800, 400, 400, 800, $color);
+imagedashedline($im, 800, 400, 500, 800, $color);
+imagedashedline($im, 800, 400, 600, 800, $color);
+imagedashedline($im, 800, 400, 700, 800, $color);
+imagedashedline($im, 800, 400, 800, 800, $color);
+include_once __DIR__ . '/func.inc';
+test_image_equals_file(__DIR__ . '/bug52070.png', $im);
+?>
+===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--
-<?php
-if (!extension_loaded('gd')) die('skip gd extension not available');
-?>
---FILE--
-<?php
-$im = imagecreatefromxbm(__DIR__ . DIRECTORY_SEPARATOR . 'bug73968.xbm');
-var_dump($im);
-?>
-===DONE===
---EXPECTF--
-resource(%d) of type (gd)
-===DONE===
+--TEST--
+Bug #73968 (Premature failing of XBM reading)
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+$im = imagecreatefromxbm(__DIR__ . DIRECTORY_SEPARATOR . 'bug73968.xbm');
+var_dump($im);
+?>
+===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 @@
-<?php
-// THIS SCRIPT WILL REBUILD ResourceBundle bundles from source files
-
-// DEFINE YOUR ICU TOOLS PATH HERE
-define("ICU_DIR", "C:/PROJECTS/ICU40/BIN/");
-
-$here = dirname(__FILE__);
-
-$dir = new GlobIterator("$here/_files/*.txt", FilesystemIterator::KEY_AS_FILENAME);
-
-foreach($dir as $file) {
- passthru( ICU_DIR."genrb -s $here/_files/ -d $here/_files/resourcebundle ".$file->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 = <<<END
-res_index:table(nofallback) {
- InstalledLocales {
-$filelist {""}
- }
-}
-END;
-file_put_contents("$here/_files/res_index.txt", $res_index);
-
-passthru( ICU_DIR."genrb -s $here/_files/ -d $here/_files/resourcebundle res_index.txt");
-
+<?php
+// THIS SCRIPT WILL REBUILD ResourceBundle bundles from source files
+
+// DEFINE YOUR ICU TOOLS PATH HERE
+define("ICU_DIR", "C:/PROJECTS/ICU40/BIN/");
+
+$here = dirname(__FILE__);
+
+$dir = new GlobIterator("$here/_files/*.txt", FilesystemIterator::KEY_AS_FILENAME);
+
+foreach($dir as $file) {
+ passthru( ICU_DIR."genrb -s $here/_files/ -d $here/_files/resourcebundle ".$file->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 = <<<END
+res_index:table(nofallback) {
+ InstalledLocales {
+$filelist {""}
+ }
+}
+END;
+file_put_contents("$here/_files/res_index.txt", $res_index);
+
+passthru( ICU_DIR."genrb -s $here/_files/ -d $here/_files/resourcebundle res_index.txt");
+
// passthru(ICU_DIR."icupkg -tl -a $here/rb.txt -s $here/_files -d $here/_files new $here/_files/resourcebundle.dat"); \ No newline at end of file
diff --git a/ext/mbstring/tests/bug75944.phpt b/ext/mbstring/tests/bug75944.phpt
index 81788d7196..cb66d4e230 100644
--- a/ext/mbstring/tests/bug75944.phpt
+++ b/ext/mbstring/tests/bug75944.phpt
@@ -1,13 +1,13 @@
---TEST--
-Bug #75944 (wrong detection cp1251 encoding because of missing last cyrillic letter)
---SKIPIF--
-<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
---FILE--
-<?php
-var_dump(mb_detect_encoding(chr(0xfe), array('CP-1251'))); // letter '?'
-var_dump(mb_detect_encoding(chr(0xff), array('CP-1251'))); // letter '?'
-?>
---EXPECT--
-string(12) "Windows-1251"
-string(12) "Windows-1251"
-
+--TEST--
+Bug #75944 (wrong detection cp1251 encoding because of missing last cyrillic letter)
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--FILE--
+<?php
+var_dump(mb_detect_encoding(chr(0xfe), array('CP-1251'))); // letter '?'
+var_dump(mb_detect_encoding(chr(0xff), array('CP-1251'))); // letter '?'
+?>
+--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--
-<?php
-$obj = new stdClass;
-$obj->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--
+<?php
+$obj = new stdClass;
+$obj->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 ^<basedir^> ^<depth^> ^[^hash_bits^]
- ECHO.
- ECHO Where ^<basedir^> is the session directory
- ECHO ^<depth^> 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 ^<basedir^> ^<depth^> ^[^hash_bits^]
+ ECHO.
+ ECHO Where ^<basedir^> is the session directory
+ ECHO ^<depth^> 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--
-<?php
-$q = new SplQueue();
-try {
- $q->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--
+<?php
+$q = new SplQueue();
+try {
+ $q->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--
-<?php
-
-class MyFixedArray extends \SplFixedArray
-{
- public function offsetExists($name) {
- echo "offsetExists($name)\n";
- return parent::offsetExists($name);
- }
- public function offsetGet($name) {
- echo "offsetGet($name)\n";
- return parent::offsetGet($name);
- }
- public function offsetSet($name, $value) {
- echo "offsetSet($name)\n";
- return parent::offsetSet($name, $value);
- }
- public function offsetUnset($name) {
- echo "offsetUnset($name)\n";
- return parent::offsetUnset($name);
- }
-
-};
-
-$fixedData = new MyFixedArray(10);
-var_dump(isset($fixedData[0][1][2]));
-var_dump(isset($fixedData[0]->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--
+<?php
+
+class MyFixedArray extends \SplFixedArray
+{
+ public function offsetExists($name) {
+ echo "offsetExists($name)\n";
+ return parent::offsetExists($name);
+ }
+ public function offsetGet($name) {
+ echo "offsetGet($name)\n";
+ return parent::offsetGet($name);
+ }
+ public function offsetSet($name, $value) {
+ echo "offsetSet($name)\n";
+ return parent::offsetSet($name, $value);
+ }
+ public function offsetUnset($name) {
+ echo "offsetUnset($name)\n";
+ return parent::offsetUnset($name);
+ }
+
+};
+
+$fixedData = new MyFixedArray(10);
+var_dump(isset($fixedData[0][1][2]));
+var_dump(isset($fixedData[0]->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--
-<?php
-if (PHP_INT_SIZE < 8) {
- die('skip.. only valid for 64-bit');
-}
-?>
---FILE--
-<?php
-
-$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76422";
-
-$file_handle = fopen($fn,'cb');
-
-if (false === $file_handle) {
- die('Cannot open test file :/');
-}
-
-$truncate_offset = 4 * 1024 * 1024 * 1024 + 1;
-$ftruncate_result = ftruncate($file_handle, $truncate_offset);
-
-if (false === $ftruncate_result) {
- die('Truncate has failed :/');
-}
-
-fclose($file_handle);
-var_dump(filesize($fn) >= $truncate_offset);
-?>
---CLEAN--
-<?php
-$fn = dirname(__FILE__) . "/test76422";
-unlink($fn);
-?>
---EXPECT--
-bool(true)
+--TEST--
+Bug #76422 ftruncate fails on files > 2GB
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE < 8) {
+ die('skip.. only valid for 64-bit');
+}
+?>
+--FILE--
+<?php
+
+$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76422";
+
+$file_handle = fopen($fn,'cb');
+
+if (false === $file_handle) {
+ die('Cannot open test file :/');
+}
+
+$truncate_offset = 4 * 1024 * 1024 * 1024 + 1;
+$ftruncate_result = ftruncate($file_handle, $truncate_offset);
+
+if (false === $ftruncate_result) {
+ die('Truncate has failed :/');
+}
+
+fclose($file_handle);
+var_dump(filesize($fn) >= $truncate_offset);
+?>
+--CLEAN--
+<?php
+$fn = dirname(__FILE__) . "/test76422";
+unlink($fn);
+?>
+--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--
-<?php
-
-$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76803";
-
-$f = fopen($fn, "w");
-fwrite($f, "Hello");
-ftruncate($f, 2);
-fwrite($f, "World");
-fclose($f);
-var_dump(addslashes(file_get_contents($fn)));
-
-$f = fopen($fn, "w");
-fwrite($f, "Hello");
-ftruncate($f, 2);
-fclose($f);
-var_dump(addslashes(file_get_contents($fn)));
-
-$f = fopen('php://memory', 'w+');
-fwrite($f, 'Hello');
-ftruncate($f, 2); // in 7.3 changes file pointer to 2
-fwrite($f, 'World');
-rewind($f);
-var_dump(addslashes(stream_get_contents($f)));
-fclose($f);
-
-?>
---CLEAN--
-<?php
-$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76803";
-unlink($fn);
-?>
---EXPECT--
-string(13) "He\0\0\0World"
-string(2) "He"
-string(7) "HeWorld"
+--TEST--
+Bug #76803 ftruncate changes file pointer
+--FILE--
+<?php
+
+$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76803";
+
+$f = fopen($fn, "w");
+fwrite($f, "Hello");
+ftruncate($f, 2);
+fwrite($f, "World");
+fclose($f);
+var_dump(addslashes(file_get_contents($fn)));
+
+$f = fopen($fn, "w");
+fwrite($f, "Hello");
+ftruncate($f, 2);
+fclose($f);
+var_dump(addslashes(file_get_contents($fn)));
+
+$f = fopen('php://memory', 'w+');
+fwrite($f, 'Hello');
+ftruncate($f, 2); // in 7.3 changes file pointer to 2
+fwrite($f, 'World');
+rewind($f);
+var_dump(addslashes(stream_get_contents($f)));
+fclose($f);
+
+?>
+--CLEAN--
+<?php
+$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76803";
+unlink($fn);
+?>
+--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--
-<?php
-if(substr(PHP_OS, 0, 3) != 'WIN' ) {
- die('skip windows only test');
-}
-include_once __DIR__ . '/common.inc';
-$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);
-if (strpos($ret, 'privilege')) {
- die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
-}
-unlink('bug48746_tmp.lnk');
-?>
---FILE--
-<?php
-include_once __DIR__ . '/common.inc';
-$mountvol = get_mountvol();
-$old_dir = __DIR__;
-$dirname = '"' . __DIR__ . "\\mnt\\test\\новая папка" . '"';
-exec("mkdir " . $dirname, $output, $ret_val);
-chdir(__DIR__ . "\\mnt\\test");
-$drive = substr(__DIR__, 0, 2);
-$pathwithoutdrive = substr(__DIR__, 2);
-$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
-exec("mklink /d mounted_volume " . $ret, $output, $ret_val);
-$fullpath = "mounted_volume" . $pathwithoutdrive;
-exec("mklink /d mklink_symlink \"новая папка\"", $output, $ret_val);
-file_put_contents("mklink_symlink\\a.php", "<?php echo \"I am included.\n\" ?>");
-file_put_contents("$fullpath\\mnt\\test\\новая папка\\b.php", "<?php echo \"I am included.\n\" ?>");
-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--
+<?php
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+ die('skip windows only test');
+}
+include_once __DIR__ . '/common.inc';
+$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);
+if (strpos($ret, 'privilege')) {
+ die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
+}
+unlink('bug48746_tmp.lnk');
+?>
+--FILE--
+<?php
+include_once __DIR__ . '/common.inc';
+$mountvol = get_mountvol();
+$old_dir = __DIR__;
+$dirname = '"' . __DIR__ . "\\mnt\\test\\новая папка" . '"';
+exec("mkdir " . $dirname, $output, $ret_val);
+chdir(__DIR__ . "\\mnt\\test");
+$drive = substr(__DIR__, 0, 2);
+$pathwithoutdrive = substr(__DIR__, 2);
+$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
+exec("mklink /d mounted_volume " . $ret, $output, $ret_val);
+$fullpath = "mounted_volume" . $pathwithoutdrive;
+exec("mklink /d mklink_symlink \"новая папка\"", $output, $ret_val);
+file_put_contents("mklink_symlink\\a.php", "<?php echo \"I am included.\n\" ?>");
+file_put_contents("$fullpath\\mnt\\test\\новая папка\\b.php", "<?php echo \"I am included.\n\" ?>");
+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--
-<?php
-if (getenv("SKIP_ONLINE_TESTS")) { die('skip: online test'); }
-if (getenv("SKIP_SLOW_TESTS")) { die('skip: slow test'); }
-?>
---FILE--
-<?php
-$data = base64_decode("1oIBAAABAAAAAAAAB2V4YW1wbGUDb3JnAAABAAE=");
-$fd = stream_socket_client("udp://8.8.8.8:53", $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT);
-stream_set_blocking($fd, 0);
-stream_socket_sendto($fd,$data);
-sleep(1);
-$ret = stream_get_contents($fd,65565);
-var_dump(strlen($ret) > 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--
+<?php
+if (getenv("SKIP_ONLINE_TESTS")) { die('skip: online test'); }
+if (getenv("SKIP_SLOW_TESTS")) { die('skip: slow test'); }
+?>
+--FILE--
+<?php
+$data = base64_decode("1oIBAAABAAAAAAAAB2V4YW1wbGUDb3JnAAABAAE=");
+$fd = stream_socket_client("udp://8.8.8.8:53", $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT);
+stream_set_blocking($fd, 0);
+stream_socket_sendto($fd,$data);
+sleep(1);
+$ret = stream_get_contents($fd,65565);
+var_dump(strlen($ret) > 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 <wez@thebrainroom.com> |
- +----------------------------------------------------------------------+
-*/
-
-// 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 <wez@thebrainroom.com> |
+ +----------------------------------------------------------------------+
+*/
+
+// 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"