Commit:    2af38e65cb90aa89274c68b3a53f90c4d295559e
Author:    Christoph M. Becker <[email protected]>         Mon, 25 Jan 2021 
15:11:19 +0100
Parents:   895ee072f1e2a9f2625ccccb7adee7061fb93df8
Branches:  master

Link:       
http://git.php.net/?p=web/windows.git;a=commitdiff;h=2af38e65cb90aa89274c68b3a53f90c4d295559e

Log:
Document how to set up development environment

We also add a `generate_fake_downloads.php` script, so the Website is
usable for development without having to download all the required
files.

Changed paths:
  M  .gitignore
  A  README.md
  A  dev/generate_fake_downloads.php


Diff:
diff --git a/.gitignore b/.gitignore
index 612b0dd..f659036 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,9 @@
 data/*.json
+data/site_generate_listing.lock
 logs/*.log
 logs/*/*.log
 docroot/snapshot.html
+docroot/web.config
 docroot/downloads/pecl/
 docroot/downloads/php-sdk/
 docroot/downloads/pickle/
@@ -9,4 +11,3 @@ docroot/downloads/qa/
 docroot/downloads/releases/
 docroot/downloads/snaps/
 docroot/downloads/nano/
-
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5d25296
--- /dev/null
+++ b/README.md
@@ -0,0 +1,13 @@
+# The sources of the PHP for Windows Website
+
+## Local development
+
+You need IIS and PHP.
+
+* `git clone [email protected]:php/web-windows.git`
+* adapt the `BASE_URL` and `APP_PATH` in `include\config.php` to point to the 
current working directory
+* `php dev\generate_fake_downloads.php`
+* `php script\generate_snap_page.php`
+* set up IIS PHP Website for `APP_PATH` with `index.php` as default document
+* set up TLS for that Website or comment out the HTTPS redirection section in 
`templates\web.config.tpl`
+* visit `/listing.php`; this generates `web.config` in the docroot, so the 
Website is fully usable. You have to make sure that your Website configuration 
is done in the global `applicationHost.config`, or you have to integrate the 
local setup into `templates\web.config.tpl`.
diff --git a/dev/generate_fake_downloads.php b/dev/generate_fake_downloads.php
new file mode 100644
index 0000000..243bd42
--- /dev/null
+++ b/dev/generate_fake_downloads.php
@@ -0,0 +1,162 @@
+<?php
+
+include __DIR__ . '/../include/config.php';
+
+$versions = ['7.3.26', '7.4.14', '8.0.1'];
+
+/*
+ * releases
+ */
+
+$dir = RELEASES_DIR;
+@mkdir($dir);
+foreach ($versions as $version) {
+    switch (true) {
+        case version_compare($version, '7.4.0') < 0:
+            $vc = 'VC15';
+            break;
+        case version_compare($version, '8.0.0') < 0:
+            $vc = 'vc15';
+            break;
+        default:
+            $vc = 'vs16';
+    }
+    touch("{$dir}php-{$version}-nts-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-{$version}-nts-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-{$version}-src.zip");
+    touch("{$dir}php-{$version}-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-{$version}-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-debug-pack-{$version}-nts-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-debug-pack-{$version}-nts-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-debug-pack-{$version}-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-debug-pack-{$version}-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-devel-pack-{$version}-nts-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-devel-pack-{$version}-nts-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-devel-pack-{$version}-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-devel-pack-{$version}-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-test-pack-{$version}.zip");
+}
+
+$sha256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';
+$sha_file = fopen("{$dir}sha256sum.txt", 'w');
+foreach (scandir($dir) as $filename) {
+    if (pathinfo($filename, PATHINFO_EXTENSION) !== 'zip') continue;
+    fwrite($sha_file, "{$sha256} *{$filename}\n");
+}
+fclose($sha_file);
+
+/*
+ * qa
+ */
+
+$dir = QA_DIR;
+@mkdir($dir);
+foreach ($versions as $version) {
+    switch (true) {
+        case version_compare($version, '7.4.0') < 0:
+            $vc = 'VC15';
+            break;
+        case version_compare($version, '8.0.0') < 0:
+            $vc = 'vc15';
+            break;
+        default:
+            $vc = 'vs16';
+    }
+    touch("{$dir}php-{$version}RC1-nts-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-{$version}RC1-nts-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-{$version}RC1-src.zip");
+    touch("{$dir}php-{$version}RC1-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-{$version}RC1-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-debug-pack-{$version}RC1-nts-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-debug-pack-{$version}RC1-nts-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-debug-pack-{$version}RC1-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-debug-pack-{$version}RC1-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-devel-pack-{$version}RC1-nts-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-devel-pack-{$version}RC1-nts-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-devel-pack-{$version}RC1-Win32-{$vc}-x64.zip");
+    touch("{$dir}php-devel-pack-{$version}RC1-Win32-{$vc}-x86.zip");
+    touch("{$dir}php-test-pack-{$version}RC1.zip");
+}
+
+$sha256 = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';
+$sha_file = fopen("{$dir}sha256sum.txt", 'w');
+foreach (scandir($dir) as $filename) {
+    if (pathinfo($filename, PATHINFO_EXTENSION) !== 'zip') continue;
+    fwrite($sha_file, "{$sha256} *{$filename}\n");
+}
+fclose($sha_file);
+
+/*
+ * snaps
+ */
+
+$versions = [
+    'php-7.3' => [
+        "revision_last" => "65d7ade6842bcf06b3d2ed59a796bdd78d073df9",
+        "revision_previous" => null,
+        "revision_last_exported" => "65d7ade",
+        "build_num" => 5,
+        "builds" => [
+            "nts-windows-vc15-x64",
+            "nts-windows-vc15-x86",
+            "ts-windows-vc15-x86",
+            "ts-windows-vc15-x64",
+            "nts-windows-vc15-x64-avx"
+        ]
+    ],
+    'php-7.4' => [
+        "revision_last" => "65d7ade6842bcf06b3d2ed59a796bdd78d073df9",
+        "revision_previous" => null,
+        "revision_last_exported" => "65d7ade",
+        "build_num" => 5,
+        "builds" => [
+            "nts-windows-vc15-x64",
+            "nts-windows-vc15-x86",
+            "ts-windows-vc15-x86",
+            "ts-windows-vc15-x64",
+            "nts-windows-vc15-x64-avx"
+        ]
+    ],
+    'php-8.0' => [
+        "revision_last" => "65d7ade6842bcf06b3d2ed59a796bdd78d073df9",
+        "revision_previous" => null,
+        "revision_last_exported" => "65d7ade",
+        "build_num" => 5,
+        "builds" => [
+            "nts-windows-vs16-x64",
+            "nts-windows-vs16-x86",
+            "ts-windows-vs16-x86",
+            "ts-windows-vs16-x64",
+            "nts-windows-vs16-x64-avx"
+        ]
+    ],
+    'master' => [
+        "revision_last" => "65d7ade6842bcf06b3d2ed59a796bdd78d073df9",
+        "revision_previous" => null,
+        "revision_last_exported" => "65d7ade",
+        "build_num" => 5,
+        "builds" => [
+            "nts-windows-vs16-x64",
+            "nts-windows-vs16-x86",
+            "ts-windows-vs16-x86",
+            "ts-windows-vs16-x64",
+            "nts-windows-vs16-x64-avx"
+        ]
+    ],
+];
+$json = 
'{"stats":{"warning":0,"error":0},"has_php_pkg":true,"has_debug_pkg":false,"has_devel_pkg":false,"has_test_pkg":false}';
+$dir = SNAPS_DIR;
+@mkdir($dir);
+foreach ($versions as $version => $snap_meta) {
+    @mkdir("{$dir}{$version}");
+    file_put_contents("{$dir}{$version}/{$version}.json", 
json_encode($snap_meta));
+    $rev = $snap_meta['revision_last_exported'];
+    $revdir = "{$dir}{$version}/r{$rev}";
+    @mkdir($revdir);
+    touch("{$revdir}/{$version}-src-r{$rev}.zip");
+    foreach ($snap_meta['builds'] as $build) {
+        file_put_contents("{$revdir}/{$build}.json", $json);
+        $prefix = strncmp($version, 'php', 3) ? "php-{$version}" : $version;
+        file_put_contents("{$revdir}/{$prefix}-{$build}-r{$rev}.zip", '*');
+    }
+}


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to