]> granicus.if.org Git - php/commitdiff
Convert CRLF line endings to LF
authorPeter Kokot <peterkokot@gmail.com>
Sat, 13 Oct 2018 09:23:20 +0000 (11:23 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Sat, 13 Oct 2018 09:23:20 +0000 (11:23 +0200)
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.

17 files changed:
Zend/zend_vm_trace_map.h
ext/exif/tests/bug76164.phpt
ext/gd/tests/bug47946.phpt
ext/gd/tests/bug52070.phpt
ext/gd/tests/bug73968.phpt
ext/intl/tests/resourcebundle.build
ext/mbstring/tests/bug75944.phpt
ext/pcre/tests/bug73612.phpt
ext/session/mod_files.bat
ext/spl/tests/bug73629.phpt
ext/spl/tests/bug74478.phpt
ext/standard/tests/file/ftruncate_bug76422.phpt
ext/standard/tests/file/ftruncate_bug76803.phpt
ext/standard/tests/file/windows_links/bug73962.phpt
ext/standard/tests/streams/bug74090.phpt
win32/build/buildconf.js
win32/syslog.reg

index 1d8828b3a8ad71a3237048957a522d6443ddf831..a5da487611e8b2446cd78125975dbd3e1620fa5b 100644 (file)
@@ -1,82 +1,82 @@
-/*\r
-   +----------------------------------------------------------------------+\r
-   | Zend Engine                                                          |\r
-   +----------------------------------------------------------------------+\r
-   | Copyright (c) 1998-2018 Zend Technologies Ltd. (http://www.zend.com) |\r
-   +----------------------------------------------------------------------+\r
-   | This source file is subject to version 2.00 of the Zend license,     |\r
-   | that is bundled with this package in the file LICENSE, and is        |\r
-   | available through the world-wide-web at the following url:           |\r
-   | http://www.zend.com/license/2_00.txt.                                |\r
-   | If you did not receive a copy of the Zend license and are unable to  |\r
-   | obtain it through the world-wide-web, please send a note to          |\r
-   | license@zend.com so we can mail you a copy immediately.              |\r
-   +----------------------------------------------------------------------+\r
-   | Authors: Dmitry Stogov <dmitry@zend.com>                             |\r
-   +----------------------------------------------------------------------+\r
-*/\r
-\r
-#include "zend_vm_handlers.h"\r
-#include "zend_sort.h"\r
-\r
-#define GEN_MAP(n, name) do { \\r
-               ZVAL_LONG(&tmp, (zend_long)(uintptr_t)zend_opcode_handlers[n]); \\r
-               zend_hash_str_add(&vm_trace_ht, #name, sizeof(#name) - 1, &tmp); \\r
-       } while (0);\r
-\r
-#define VM_TRACE_START() do { \\r
-               zval tmp; \\r
-               zend_hash_init(&vm_trace_ht, 0, NULL, NULL, 1); \\r
-               VM_HANDLERS(GEN_MAP) \\r
-               zend_vm_trace_init(); \\r
-       } while (0)\r
-\r
-#ifdef _WIN64\r
-# define ADDR_FMT "%016I64x"\r
-#elif SIZEOF_SIZE_T == 4\r
-# define ADDR_FMT "%08zx"\r
-#elif SIZEOF_SIZE_T == 8\r
-# define ADDR_FMT "%016zx"\r
-#else\r
-# error "Unknown SIZEOF_SIZE_T"\r
-#endif\r
-\r
-static HashTable vm_trace_ht;\r
-\r
-static int zend_vm_trace_compare(const Bucket *p1, const Bucket *p2)\r
-{\r
-       if (Z_LVAL(p1->val) > Z_LVAL(p2->val)) {\r
-               return 1;\r
-       } else if (Z_LVAL(p1->val) < Z_LVAL(p2->val)) {\r
-               return -1;\r
-       } else {\r
-               return 0;\r
-       }\r
-}\r
-\r
-static void zend_vm_trace_init(void)\r
-{\r
-       FILE *f;\r
-       zend_string *key, *prev_key;\r
-       zval *val;\r
-       zend_long prev_addr;\r
-\r
-       f = fopen("zend_vm.map", "w+");\r
-       if (f) {\r
-               zend_hash_sort(&vm_trace_ht, (compare_func_t)zend_vm_trace_compare, 0);\r
-               prev_key = NULL;\r
-               ZEND_HASH_FOREACH_STR_KEY_VAL(&vm_trace_ht, key, val) {\r
-                       if (prev_key) {\r
-                               fprintf(f, ADDR_FMT" "ADDR_FMT" t %s\n", prev_addr, Z_LVAL_P(val) - prev_addr, ZSTR_VAL(prev_key));\r
-                       }\r
-                       prev_key  = key;\r
-                       prev_addr = Z_LVAL_P(val);\r
-               } ZEND_HASH_FOREACH_END();\r
-               if (prev_key) {\r
-                       fprintf(f, ADDR_FMT" "ADDR_FMT" t %s\n", prev_addr, 0, ZSTR_VAL(prev_key));\r
-               }\r
-               fclose(f);\r
-       }\r
-       zend_hash_destroy(&vm_trace_ht);\r
-}\r
+/*
+   +----------------------------------------------------------------------+
+   | 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
index ea77e1d5e99b0c282eb50a14ab9fc212ee538198..72aefad6f1063dd750be1ba218569871929986f3 100644 (file)
@@ -1,16 +1,16 @@
---TEST--\r
-Bug #76164 (exif_read_data zend_mm_heap corrupted)\r
---SKIPIF--\r
-<?php\r
-if (!extension_loaded('exif')) die('skip exif extension not available');\r
-?>\r
---FILE--\r
-<?php\r
-$var1 = 'nonexistentfile';\r
-$var2 = 2200000000;\r
-@exif_read_data($var1, $var2); // we're not interested in the warning, here\r
-$var2 = 1;\r
-?>\r
-===DONE===\r
---EXPECT--\r
-===DONE===\r
+--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===
index c84508509ceee36e0a156be40b21c7682b94131f..aeea7fb324f801fb080384d5c9afba0d8538269c 100644 (file)
@@ -1,51 +1,51 @@
---TEST--\r
-Bug #47946 (ImageConvolution overwrites background)\r
---DESCRIPTION--\r
-The expected image has black pixel artifacts, what is another issue, though\r
-(perhaps #40158).\r
---SKIPIF--\r
-<?php\r
-if (!extension_loaded('gd')) die('skip gd extension not available');\r
-?>\r
---FILE--\r
-<?php\r
-function array_flatten($array)\r
-{\r
-    $tempArray = array();\r
-\r
-    foreach ($array as $value) {\r
-        if (is_array($value)) {\r
-            $tempArray = array_merge($tempArray, array_flatten($value));\r
-        } else {\r
-            $tempArray[] = $value;\r
-        }\r
-    }\r
-\r
-    return $tempArray;\r
-}\r
-\r
-function makeFilter($resource, $matrix, $offset = 1.0)\r
-{\r
-    $divisor = array_sum(array_flatten($matrix));\r
-    if ($divisor == 0) {\r
-        $divisor = .01;\r
-    }\r
-    return imageconvolution($resource, $matrix, $divisor, $offset);\r
-}\r
-\r
-$edgeMatrix = array(array(1, 0, 1), array(0, 5, 0), array(1, 0, 1));\r
-\r
-$im = imagecreatetruecolor(40, 40);\r
-imagealphablending($im, false);\r
-imagefilledrectangle($im, 0, 0, 39, 39, 0x7fffffff);\r
-imagefilledellipse($im, 19, 19, 20, 20, 0x00ff00);\r
-imagesavealpha($im, true);\r
-makeFilter($im, $edgeMatrix);\r
-\r
-require_once __DIR__ . '/func.inc';\r
-test_image_equals_file(__DIR__ . '/bug47946_exp.png', $im);\r
-?>\r
-===DONE===\r
---EXPECT--\r
-The images are equal.\r
-===DONE===\r
+--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===
index acf56e6b5b2b50fe7d28b5c67970df9a7e965272..d44a5274799487cf4877e751f2763f7d6191053a 100644 (file)
@@ -1,25 +1,25 @@
---TEST--\r
-Bug #52070 (imagedashedline() - dashed line sometimes is not visible)\r
---SKIPIF--\r
-<?php\r
-if (!extension_loaded('gd')) die('skip gd extension not available');\r
-?>\r
---FILE--\r
-<?php\r
-$im = imagecreate(1200, 800);\r
-$background_color = imagecolorallocate($im, 40, 40, 40);\r
-$color = imagecolorallocate($im, 255, 255, 255);\r
-imagedashedline($im, 800, 400, 300, 400, $color);\r
-imagedashedline($im, 800, 400, 300, 800, $color);\r
-imagedashedline($im, 800, 400, 400, 800, $color);\r
-imagedashedline($im, 800, 400, 500, 800, $color);\r
-imagedashedline($im, 800, 400, 600, 800, $color);\r
-imagedashedline($im, 800, 400, 700, 800, $color);\r
-imagedashedline($im, 800, 400, 800, 800, $color);\r
-include_once __DIR__ . '/func.inc';\r
-test_image_equals_file(__DIR__ . '/bug52070.png', $im);\r
-?>\r
-===DONE===\r
---EXPECT--\r
-The images are equal.\r
-===DONE===\r
+--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===
index fd17fe26ba9c2ab25d75aea4a0266b5655b41032..2211840f581b562017f3a5a37fd086dc48c9c627 100644 (file)
@@ -1,15 +1,15 @@
---TEST--\r
-Bug #73968 (Premature failing of XBM reading)\r
---SKIPIF--\r
-<?php\r
-if (!extension_loaded('gd')) die('skip gd extension not available');\r
-?>\r
---FILE--\r
-<?php\r
-$im = imagecreatefromxbm(__DIR__ . DIRECTORY_SEPARATOR . 'bug73968.xbm');\r
-var_dump($im);\r
-?>\r
-===DONE===\r
---EXPECTF--\r
-resource(%d) of type (gd)\r
-===DONE===\r
+--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===
index 6a7eeae5eb13377eff9a284a3eb246f609ca8062..560dc8fb450d1e8519564122bcc02a2e6c6c6971 100644 (file)
@@ -1,33 +1,33 @@
-<?php\r
-// THIS SCRIPT WILL REBUILD ResourceBundle bundles from source files\r
-\r
-// DEFINE YOUR ICU TOOLS PATH HERE\r
-define("ICU_DIR", "C:/PROJECTS/ICU40/BIN/");\r
-\r
-$here = dirname(__FILE__);\r
-\r
-$dir = new GlobIterator("$here/_files/*.txt", FilesystemIterator::KEY_AS_FILENAME);\r
-\r
-foreach($dir as $file) {\r
-  passthru( ICU_DIR."genrb -s $here/_files/ -d $here/_files/resourcebundle ".$file->getFileName());\r
-}\r
-\r
-$dir = new GlobIterator("$here/_files/resourcebundle/*.res", FilesystemIterator::KEY_AS_FILENAME);\r
-foreach($dir as $file) {\r
-  if($file->getFileName() == "res_index.res") continue;\r
-  $list[] = str_replace(".res", "", $file->getFileName());\r
-}\r
-\r
-$filelist = join(" {\"\"}\n", $list);\r
-$res_index = <<<END\r
-res_index:table(nofallback) {\r
-    InstalledLocales {\r
-$filelist {""}\r
-    }\r
-}\r
-END;\r
-file_put_contents("$here/_files/res_index.txt", $res_index);\r
-\r
-passthru( ICU_DIR."genrb -s $here/_files/ -d $here/_files/resourcebundle res_index.txt");\r
-\r
+<?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
index 81788d719656e45cf9e947d943b4123612983235..cb66d4e2301fd37caeeb2c0d5cba7104ccab3418 100644 (file)
@@ -1,13 +1,13 @@
---TEST--\r
-Bug #75944 (wrong detection cp1251 encoding because of missing last cyrillic letter)\r
---SKIPIF--\r
-<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>\r
---FILE--\r
-<?php\r
-var_dump(mb_detect_encoding(chr(0xfe), array('CP-1251'))); // letter '?'\r
-var_dump(mb_detect_encoding(chr(0xff), array('CP-1251'))); // letter '?'\r
-?>\r
---EXPECT--\r
-string(12) "Windows-1251"\r
-string(12) "Windows-1251"\r
-\r
+--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"
+
index 707e10bce686f2fa9d4e5b6b3dc3399043abbc96..210e706bfbbe52fb86b2d4bd85700a6ec76e3d02 100644 (file)
@@ -1,27 +1,27 @@
---TEST--\r
-Bug #73612 (preg_*() may leak memory)\r
---FILE--\r
-<?php\r
-$obj = new stdClass;\r
-$obj->obj = $obj;\r
-preg_match('/./', 'x', $obj);\r
-\r
-$obj = new stdClass;\r
-$obj->obj = $obj;\r
-preg_replace('/./', '', 'x', -1, $obj);\r
-\r
-$obj = new stdClass;\r
-$obj->obj = $obj;\r
-preg_replace_callback('/./', 'count', 'x', -1, $obj);\r
-\r
-$obj = new stdClass;\r
-$obj->obj = $obj;\r
-preg_replace_callback_array(['/./' => 'count'], 'x', -1, $obj);\r
-\r
-$obj = new stdClass;\r
-$obj->obj = $obj;\r
-preg_filter('/./', '', 'x', -1, $obj);\r
-?>\r
-===DONE===\r
---EXPECT--\r
-===DONE===\r
+--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===
index 4ec9a49ca2959a944bc17a0c8e7e2db31641b978..b6a8babae8b88002640d1340f6c61d0047254ae6 100644 (file)
@@ -1,57 +1,57 @@
-@ECHO OFF\r
-SETLOCAL ENABLEDELAYEDEXPANSION\r
-\r
-IF _%1_==_AUTO_ (\r
-       GOTO MakeDirs\r
-)\r
-\r
-IF _%2_==__ (\r
-       ECHO Usage %0 ^<basedir^> ^<depth^> ^[^hash_bits^]\r
-       ECHO.\r
-       ECHO Where ^<basedir^>   is the session directory \r
-       ECHO       ^<depth^>     is the number of levels defined in session.save_path\r
-       ECHO       ^[hash_bits^] is the number of bits defined in session.hash_bits_per_character\r
-       EXIT /B 1\r
-)\r
-\r
-SET /A Depth=%2 + 0 2>NUL\r
-IF /I %ERRORLEVEL% EQU 9167 GOTO DepthError\r
-IF _%Depth%_==__ GOTO DepthError\r
-IF /I %Depth% LEQ 0 GOTO DepthError\r
-\r
-IF _%3_==__ GOTO DefaultBits\r
-\r
-SET /A Bits=%3 + 0 2>NUL\r
-IF /I %ERRORLEVEL% EQU 9167 GOTO BitsError\r
-IF _%Bits%_==__ GOTO BitsError\r
-IF /I %Bits% LSS 4 GOTO BitsError\r
-IF /I %Bits% GTR 6 GOTO BitsError\r
-GOTO BitsSet\r
-\r
-:DefaultBits\r
-SET Bits=4\r
-:BitsSet\r
-\r
-SET HashChars=0 1 2 3 4 5 6 7 8 9 A B C D E F\r
-IF /I %Bits% GEQ 5 SET HashChars=!HashChars! G H I J K L M N O P Q R S T U V\r
-IF /I %Bits% GEQ 6 SET HashChars=!HashChars! W X Y Z  - ,\r
-\r
-FOR %%A IN (%HashChars%) DO (\r
-       ECHO Making %%A\r
-       CALL "%~0" AUTO "%~1\%%~A" %Depth%\r
-)\r
-GOTO :EOF\r
-\r
-:MakeDirs\r
-MKDIR "%~2"\r
-SET /A ThisDepth=%3 - 1\r
-IF /I %ThisDepth% GTR 0 FOR %%A IN (%HashChars%) DO CALL "%~0" AUTO "%~2\%%~A" %ThisDepth%\r
-GOTO :EOF\r
-\r
-:DepthError\r
-ECHO ERROR: Invalid depth : %2\r
-EXIT /B 0\r
-\r
-:BitsError\r
-ECHO ERROR: Invalid hash_bits : %3\r
-EXIT /B 0\r
+@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
index 29b9dfc061479031e4b888e38b539e2621a5c33f..9ad0cec60fc9cd06ecaa7be1f86447f9f043c61e 100644 (file)
@@ -1,20 +1,20 @@
---TEST--\r
-Bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)\r
---FILE--\r
-<?php\r
-$q = new SplQueue();\r
-try {\r
-    $q->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO);\r
-} catch (Exception $e) {\r
-    echo 'unexpected exception: ' . $e->getMessage() . "\n";\r
-}\r
-try {\r
-    $q->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO);\r
-} catch (Exception $e) {\r
-    echo 'expected exception: ' . $e->getMessage() . "\n";\r
-}\r
-?>\r
-===DONE===\r
---EXPECT--\r
-expected exception: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen\r
-===DONE===\r
+--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===
index da63984d5c95eae1e7e41ee038898efec6ee3b76..c38464846648e9474dd3c3def5eaadac645d40bc 100644 (file)
@@ -1,62 +1,62 @@
---TEST--\r
-Bug #74478: null coalescing operator failing with SplFixedArray\r
---FILE--\r
-<?php\r
-\r
-class MyFixedArray extends \SplFixedArray\r
-{\r
-    public function offsetExists($name) {\r
-        echo "offsetExists($name)\n";\r
-        return parent::offsetExists($name);\r
-    }\r
-    public function offsetGet($name) {\r
-        echo "offsetGet($name)\n";\r
-        return parent::offsetGet($name);\r
-    }\r
-    public function offsetSet($name, $value) {\r
-        echo "offsetSet($name)\n";\r
-        return parent::offsetSet($name, $value);\r
-    }\r
-    public function offsetUnset($name) {\r
-        echo "offsetUnset($name)\n";\r
-        return parent::offsetUnset($name);\r
-    }\r
-\r
-};\r
-\r
-$fixedData = new MyFixedArray(10);\r
-var_dump(isset($fixedData[0][1][2]));\r
-var_dump(isset($fixedData[0]->foo));\r
-var_dump($fixedData[0] ?? 42);\r
-var_dump($fixedData[0][1][2] ?? 42);\r
-\r
-$fixedData[0] = new MyFixedArray(10);\r
-$fixedData[0][1] = new MyFixedArray(10);\r
-var_dump(isset($fixedData[0][1][2]));\r
-var_dump($fixedData[0][1][2] ?? 42);\r
-\r
-?>\r
---EXPECT--\r
-offsetExists(0)\r
-bool(false)\r
-offsetExists(0)\r
-bool(false)\r
-offsetExists(0)\r
-int(42)\r
-offsetExists(0)\r
-int(42)\r
-offsetSet(0)\r
-offsetGet(0)\r
-offsetSet(1)\r
-offsetExists(0)\r
-offsetGet(0)\r
-offsetExists(1)\r
-offsetGet(1)\r
-offsetExists(2)\r
-bool(false)\r
-offsetExists(0)\r
-offsetGet(0)\r
-offsetExists(1)\r
-offsetGet(1)\r
-offsetExists(2)\r
+--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
index 46f52aace9a65fa8c5c4f8b1e31360d835b3775f..b149f02c64f3cf56093a55bfaae44a5cdb4d9660 100644 (file)
@@ -1,36 +1,36 @@
---TEST--\r
-Bug #76422 ftruncate fails on files > 2GB\r
---SKIPIF--\r
-<?php\r
-if (PHP_INT_SIZE < 8) {\r
-    die('skip.. only valid for 64-bit');\r
-}\r
-?>\r
---FILE--\r
-<?php\r
-\r
-$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76422";\r
-\r
-$file_handle = fopen($fn,'cb');\r
-\r
-if (false === $file_handle) {\r
-    die('Cannot open test file :/');\r
-}\r
-\r
-$truncate_offset = 4 * 1024 * 1024 * 1024 + 1;\r
-$ftruncate_result = ftruncate($file_handle, $truncate_offset);\r
-\r
-if (false === $ftruncate_result) {\r
-    die('Truncate has failed :/');\r
-}\r
-\r
-fclose($file_handle);\r
-var_dump(filesize($fn) >= $truncate_offset);\r
-?>\r
---CLEAN--\r
-<?php\r
-$fn = dirname(__FILE__) . "/test76422";\r
-unlink($fn);\r
-?>\r
---EXPECT--\r
-bool(true)\r
+--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)
index 7e99cf2fb2724b89c221bfcdc81aa35d0996fe21..fe261e88610a850c5385f29edbb5f141b166f52d 100644 (file)
@@ -1,38 +1,38 @@
---TEST--\r
-Bug #76803 ftruncate changes file pointer\r
---FILE--\r
-<?php\r
-\r
-$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76803";\r
-\r
-$f = fopen($fn, "w");\r
-fwrite($f, "Hello");\r
-ftruncate($f, 2);\r
-fwrite($f, "World");\r
-fclose($f);\r
-var_dump(addslashes(file_get_contents($fn)));\r
-\r
-$f = fopen($fn, "w");\r
-fwrite($f, "Hello");\r
-ftruncate($f, 2);\r
-fclose($f);\r
-var_dump(addslashes(file_get_contents($fn)));\r
-\r
-$f = fopen('php://memory', 'w+');\r
-fwrite($f, 'Hello');\r
-ftruncate($f, 2); // in 7.3 changes file pointer to 2\r
-fwrite($f, 'World');\r
-rewind($f);\r
-var_dump(addslashes(stream_get_contents($f)));\r
-fclose($f);\r
-\r
-?>\r
---CLEAN--\r
-<?php\r
-$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "test76803";\r
-unlink($fn);\r
-?>\r
---EXPECT--\r
-string(13) "He\0\0\0World"\r
-string(2) "He"\r
-string(7) "HeWorld"\r
+--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"
index 6d578386e6645a0dfd305322b3bc8db931391fd2..9be48c7eebcddb61971cf6e0398db3050beab8eb 100644 (file)
@@ -1,77 +1,77 @@
---TEST--\r
-Bug #73962 bug with symlink related to cyrillic directory\r
---SKIPIF--\r
-<?php\r
-if(substr(PHP_OS, 0, 3) != 'WIN' ) {\r
-    die('skip windows only test');\r
-}\r
-include_once __DIR__ . '/common.inc';\r
-$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);\r
-if (strpos($ret, 'privilege')) {\r
-       die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');\r
-}\r
-unlink('bug48746_tmp.lnk');\r
-?>\r
---FILE--\r
-<?php\r
-include_once __DIR__ . '/common.inc';\r
-$mountvol = get_mountvol();\r
-$old_dir = __DIR__;\r
-$dirname = '"' . __DIR__ . "\\mnt\\test\\новая папка" . '"';\r
-exec("mkdir " . $dirname, $output, $ret_val);\r
-chdir(__DIR__ . "\\mnt\\test");\r
-$drive = substr(__DIR__, 0, 2);\r
-$pathwithoutdrive = substr(__DIR__, 2);\r
-$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);\r
-exec("mklink /d mounted_volume " . $ret, $output, $ret_val);\r
-$fullpath = "mounted_volume" . $pathwithoutdrive;\r
-exec("mklink /d mklink_symlink \"новая папка\"", $output, $ret_val);\r
-file_put_contents("mklink_symlink\\a.php", "<?php echo \"I am included.\n\" ?>");\r
-file_put_contents("$fullpath\\mnt\\test\\новая папка\\b.php", "<?php echo \"I am included.\n\" ?>");\r
-var_dump(scandir("mklink_symlink"));\r
-var_dump(scandir("$fullpath\\mnt\\test\\новая папка"));\r
-var_dump(scandir("$fullpath\\mnt\\test\\mklink_symlink"));\r
-var_dump(is_readable("$fullpath\\mnt\\test\\mklink_symlink\b.php"));\r
-unlink("$fullpath\\mnt\\test\\новая папка\\b.php");\r
-unlink("mklink_symlink\\a.php");\r
-chdir($old_dir);\r
-rmdir(__DIR__ . "\\mnt\\test\\новая папка");\r
-rmdir(__DIR__ . "\\mnt\\test\\mklink_symlink");\r
-rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");\r
-rmdir(__DIR__ . "\\mnt\\test");\r
-rmdir(__DIR__ . "\\mnt");\r
-\r
-?>\r
---EXPECT--\r
-array(4) {\r
-  [0]=>\r
-  string(1) "."\r
-  [1]=>\r
-  string(2) ".."\r
-  [2]=>\r
-  string(5) "a.php"\r
-  [3]=>\r
-  string(5) "b.php"\r
-}\r
-array(4) {\r
-  [0]=>\r
-  string(1) "."\r
-  [1]=>\r
-  string(2) ".."\r
-  [2]=>\r
-  string(5) "a.php"\r
-  [3]=>\r
-  string(5) "b.php"\r
-}\r
-array(4) {\r
-  [0]=>\r
-  string(1) "."\r
-  [1]=>\r
-  string(2) ".."\r
-  [2]=>\r
-  string(5) "a.php"\r
-  [3]=>\r
-  string(5) "b.php"\r
-}\r
-bool(true)\r
-\r
+--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)
+
index 47efc2c7cdfff6bdb283b8ee320bc56adc4ab21f..f6187003fa6086164512e4d00967c72948745ef5 100644 (file)
@@ -1,22 +1,22 @@
---TEST--\r
-Bug #74090 stream_get_contents maxlength>-1 returns empty string on windows\r
---SKIPIF--\r
-<?php\r
-if (getenv("SKIP_ONLINE_TESTS")) { die('skip: online test'); }\r
-if (getenv("SKIP_SLOW_TESTS")) { die('skip: slow test'); }\r
-?>\r
---FILE--\r
-<?php\r
-$data = base64_decode("1oIBAAABAAAAAAAAB2V4YW1wbGUDb3JnAAABAAE=");\r
-$fd = stream_socket_client("udp://8.8.8.8:53", $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT);\r
-stream_set_blocking($fd, 0);\r
-stream_socket_sendto($fd,$data);\r
-sleep(1);\r
-$ret = stream_get_contents($fd,65565);\r
-var_dump(strlen($ret) > 0);\r
-stream_socket_shutdown($fd,STREAM_SHUT_RDWR);\r
-?>\r
-==DONE==\r
---EXPECT--\r
-bool(true)\r
-==DONE==\r
+--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==
index 5d5fb499ec978f6eea86bfbdd70655aef8a1a60a..e20e92848b1667999c7eeb2e005c3b11c32204b7 100644 (file)
-/*\r
-  +----------------------------------------------------------------------+\r
-  | PHP Version 7                                                        |\r
-  +----------------------------------------------------------------------+\r
-  | Copyright (c) 1997-2018 The PHP Group                                |\r
-  +----------------------------------------------------------------------+\r
-  | This source file is subject to version 3.01 of the PHP license,      |\r
-  | that is bundled with this package in the file LICENSE, and is        |\r
-  | available through the world-wide-web at the following url:           |\r
-  | http://www.php.net/license/3_01.txt                                  |\r
-  | If you did not receive a copy of the PHP license and are unable to   |\r
-  | obtain it through the world-wide-web, please send a note to          |\r
-  | license@php.net so we can mail you a copy immediately.               |\r
-  +----------------------------------------------------------------------+\r
-  | Author: Wez Furlong <wez@thebrainroom.com>                           |\r
-  +----------------------------------------------------------------------+\r
-*/\r
-\r
-// This generates a configure script for win32 build\r
-\r
-WScript.StdOut.WriteLine("Rebuilding configure.js");\r
-var FSO = WScript.CreateObject("Scripting.FileSystemObject");\r
-var C = FSO.CreateTextFile("configure.js", true);\r
-var B = FSO.CreateTextFile("configure.bat", true);\r
-\r
-var modules = "";\r
-var MODULES = WScript.CreateObject("Scripting.Dictionary");\r
-var module_dirs = new Array();\r
-\r
-function file_get_contents(filename)\r
-{\r
-       var F = FSO.OpenTextFile(filename, 1);\r
-       var t = F.ReadAll();\r
-       F.Close();\r
-       return t;\r
-}\r
-\r
-function Module_Item(module_name, config_path, dir_line, deps, content)\r
-{\r
-       this.module_name = module_name;\r
-       this.config_path = config_path;\r
-       this.dir_line = dir_line;\r
-       this.deps = deps;\r
-       this.content = content;\r
-}\r
-\r
-function find_config_w32(dirname)\r
-{\r
-       if (!FSO.FolderExists(dirname)) {\r
-               return;\r
-       }\r
-\r
-       var f = FSO.GetFolder(dirname);\r
-       var     fc = new Enumerator(f.SubFolders);\r
-       var c, i, ok, n;\r
-       var item = null;\r
-       var re_dep_line = new RegExp("ADD_EXTENSION_DEP\\([^,]*\\s*,\\s*['\"]([^'\"]+)['\"].*\\)", "gm");\r
-       \r
-       for (; !fc.atEnd(); fc.moveNext())\r
-       {\r
-               ok = true;\r
-               /* check if we already picked up a module with the same dirname;\r
-                * if we have, don't include it here */\r
-               n = FSO.GetFileName(fc.item());\r
-               \r
-               if (n == '.svn' || n == 'tests')\r
-                       continue;\r
-                       \r
-       //      WScript.StdOut.WriteLine("checking " + dirname + "/" + n);\r
-               if (MODULES.Exists(n)) {\r
-                       WScript.StdOut.WriteLine("Skipping " + dirname + "/" + n + " -- already have a module with that name");\r
-                       continue;\r
-               }\r
-\r
-               c = FSO.BuildPath(fc.item(), "config.w32");\r
-               if (FSO.FileExists(c)) {\r
-//                     WScript.StdOut.WriteLine(c);\r
-\r
-                       var dir_line = "configure_module_dirname = condense_path(FSO.GetParentFolderName('"\r
-                                                               + c.replace(new RegExp('(["\\\\])', "g"), '\\$1') + "'));\r\n";\r
-                       var contents = file_get_contents(c);\r
-                       var deps = new Array();\r
-\r
-                       // parse out any deps from the file\r
-                       var calls = contents.match(re_dep_line);\r
-                       if (calls != null) {\r
-                               for (i = 0; i < calls.length; i++) {\r
-                                       // now we need the extension name out of this thing\r
-                                       if (calls[i].match(re_dep_line)) {\r
-//                                             WScript.StdOut.WriteLine("n depends on " + RegExp.$1);\r
-                                               deps[deps.length] = RegExp.$1;\r
-\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       item = new Module_Item(n, c, dir_line, deps, contents);\r
-                       MODULES.Add(n, item);\r
-               }\r
-       }\r
-}\r
-\r
-// Emit core modules array.  This is used by a snapshot\r
-// build to override a default "yes" value so that external\r
-// modules don't break the build by becoming statically compiled\r
-function emit_core_module_list()\r
-{\r
-       var module_names = (new VBArray(MODULES.Keys())).toArray();\r
-       var i, mod_name, j;\r
-       var item;\r
-       var output = "";\r
-\r
-       C.WriteLine("core_module_list = new Array(");\r
-\r
-       // first, look for modules with empty deps; emit those first\r
-       for (i in module_names) {\r
-               mod_name = module_names[i];\r
-               C.WriteLine("\"" + mod_name.replace(/_/g, "-") + "\",");\r
-       }\r
-\r
-       C.WriteLine("false // dummy");\r
-\r
-       C.WriteLine(");");\r
-}\r
-\r
-\r
-function emit_module(item)\r
-{\r
-       return item.dir_line + item.content;\r
-}\r
-\r
-function emit_dep_modules(module_names)\r
-{\r
-       var i, mod_name, j;\r
-       var output = "";\r
-       var item = null;\r
-\r
-       for (i in module_names) {\r
-               mod_name = module_names[i];\r
-\r
-               if (MODULES.Exists(mod_name)) {\r
-                       item = MODULES.Item(mod_name);\r
-                       MODULES.Remove(mod_name);\r
-                       if (item.deps.length) {\r
-                               output += emit_dep_modules(item.deps);\r
-                       }\r
-                       output += emit_module(item);\r
-               }\r
-       }\r
-\r
-       return output;\r
-}\r
-\r
-function gen_modules()\r
-{\r
-       var module_names = (new VBArray(MODULES.Keys())).toArray();\r
-       var i, mod_name, j;\r
-       var item;\r
-       var output = "";\r
-\r
-       // first, look for modules with empty deps; emit those first\r
-       for (i in module_names) {\r
-               mod_name = module_names[i];\r
-               item = MODULES.Item(mod_name);\r
-               if (item.deps.length == 0) {\r
-                       MODULES.Remove(mod_name);\r
-                       output += emit_module(item);\r
-               }\r
-       }\r
-\r
-       // now we are left with modules that have dependencies on other modules\r
-       module_names = (new VBArray(MODULES.Keys())).toArray();\r
-       output += emit_dep_modules(module_names);\r
-\r
-       return output;\r
-}\r
-\r
-// Process buildconf arguments\r
-function buildconf_process_args()\r
-{\r
-       args = WScript.Arguments;\r
-\r
-       for (i = 0; i < args.length; i++) {\r
-               arg = args(i);\r
-               // If it is --foo=bar, split on the equals sign\r
-               arg = arg.split("=", 2);\r
-               argname = arg[0];\r
-               if (arg.length > 1) {\r
-                       argval = arg[1];\r
-               } else {\r
-                       argval = null;\r
-               }\r
-\r
-               if (argname == '--add-modules-dir' && argval != null) {\r
-                       WScript.StdOut.WriteLine("Adding " + argval + " to the module search path");\r
-                       module_dirs[module_dirs.length] = argval;\r
-               }\r
-       }\r
-}\r
-\r
-buildconf_process_args();\r
-\r
-// Write the head of the configure script\r
-C.WriteLine("/* This file automatically generated from win32/build/confutils.js */");\r
-C.WriteLine("MODE_PHPIZE=false;");\r
-C.Write(file_get_contents("win32/build/confutils.js"));\r
-\r
-// Pull in code from sapi and extensions\r
-modules = file_get_contents("win32/build/config.w32");\r
-\r
-// Pick up confs from TSRM and Zend if present\r
-find_config_w32(".");\r
-find_config_w32("sapi");\r
-find_config_w32("ext");\r
-emit_core_module_list();\r
-\r
-// If we have not specified any module dirs let's add some defaults\r
-if (module_dirs.length == 0) {\r
-       find_config_w32("pecl");\r
-       find_config_w32("..\\pecl");\r
-       find_config_w32("pecl\\rpc");\r
-       find_config_w32("..\\pecl\\rpc");\r
-} else {\r
-       for (i = 0; i < module_dirs.length; i++) {\r
-               find_config_w32(module_dirs[i]);\r
-       }\r
-}\r
-\r
-// Now generate contents of module based on MODULES, chasing dependencies\r
-// to ensure that dependent modules are emitted first\r
-modules += gen_modules();\r
-\r
-// Look for ARG_ENABLE or ARG_WITH calls\r
-re = new RegExp("(ARG_(ENABLE|WITH)\([^;]+\);)", "gm");\r
-calls = modules.match(re);\r
-for (i = 0; i < calls.length; i++) {\r
-       item = calls[i];\r
-       C.WriteLine("try {");\r
-       C.WriteLine(item);\r
-       C.WriteLine("} catch (e) {");\r
-       C.WriteLine('\tSTDOUT.WriteLine("problem: " + e);');\r
-       C.WriteLine("}");\r
-}\r
-\r
-C.WriteBlankLines(1);\r
-C.WriteLine("check_binary_tools_sdk();");\r
-C.WriteBlankLines(1);\r
-C.WriteLine("STDOUT.WriteLine(\"PHP Version: \" + PHP_VERSION_STRING);");\r
-C.WriteLine("STDOUT.WriteBlankLines(1);");\r
-C.WriteLine("conf_process_args();");\r
-C.WriteBlankLines(1);\r
-\r
-// Comment out the calls from their original positions\r
-modules = modules.replace(re, "/* $1 */");\r
-C.Write(modules);\r
-\r
-C.WriteBlankLines(1);\r
-C.Write(file_get_contents("win32/build/configure.tail"));\r
-\r
-B.WriteLine("@echo off");\r
-B.WriteLine("cscript /nologo configure.js %*");\r
-\r
+/*
+  +----------------------------------------------------------------------+
+  | 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 %*");
+
index 71942f5b84d73e0996c3c22809c5f11cad74ab8c..a817b52faf294036b0391dd0b85d41c2079b1fdd 100644 (file)
@@ -1,5 +1,5 @@
-REGEDIT4\r
-\r
-[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-7.3.0-dev]\r
-"TypesSupported"=dword:00000007\r
-"EventMessageFile"="g:\\test\\srctrunkinstall\\php7ts.dll"\r
+REGEDIT4
+
+[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-7.3.0-dev]
+"TypesSupported"=dword:00000007
+"EventMessageFile"="g:\\test\\srctrunkinstall\\php7ts.dll"