From 62cdbf80ca1d3921577495d6cc4316fc1eb3302c Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Wed, 30 Aug 2023 15:48:09 +0100 Subject: [PATCH 1/3] Migrate sdk files to http://downloads.php.net/~windows/php-sdk --- lib/php/libsdk/SDK/Config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/php/libsdk/SDK/Config.php b/lib/php/libsdk/SDK/Config.php index e6b6d08..5d5c054 100644 --- a/lib/php/libsdk/SDK/Config.php +++ b/lib/php/libsdk/SDK/Config.php @@ -7,10 +7,10 @@ class Config { /* Config variables. */ - protected static $depsHost = 'windows.php.net'; + protected static $depsHost = 'downloads.php.net'; protected static $depsPort = 443; protected static $depsUriScheme = "https"; - protected static $depsBaseUri = "/downloads/php-sdk/deps"; + protected static $depsBaseUri = "/~windows/php-sdk/deps"; /* protected static $sdkNugetFeedUrl = "http://127.0.0.1/sdk/nuget"; */ From f2e53e6f2c16d62f9bd522f06cc00265714f6a8e Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Wed, 30 Aug 2023 18:53:35 +0100 Subject: [PATCH 2/3] Add some debugging --- lib/php/libsdk/SDK/Config.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/php/libsdk/SDK/Config.php b/lib/php/libsdk/SDK/Config.php index 5d5c054..f876907 100644 --- a/lib/php/libsdk/SDK/Config.php +++ b/lib/php/libsdk/SDK/Config.php @@ -146,6 +146,7 @@ public static function getKnownBranches() : array $fetcher = new Fetcher(self::$depsHost, self::$depsPort, self::$depsUriScheme); $tmp = $fetcher->getByUri(self::$depsBaseUri . "/series/"); + var_dump($tmp); if (false !== $tmp) { $data = array(); if (preg_match_all(",/packages-(.+)-(v[cs]\d+)-(x86|x64|arm64)-(stable|staging)\.txt,U", $tmp, $m, PREG_SET_ORDER)) { @@ -179,6 +180,7 @@ public static function getKnownBranches() : array public static function setCurrentBranchName(string $name) : void {/*{{{*/ + print_r(self::getKnownBranches()); if (!array_key_exists($name, self::getKnownBranches())) { throw new Exception("Unsupported branch '$name'"); } From 2c99f8165d460c8c2c960aa3836082861ab69209 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Thu, 31 Aug 2023 10:52:14 +0100 Subject: [PATCH 3/3] Allow multiline package match --- lib/php/libsdk/SDK/Config.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/php/libsdk/SDK/Config.php b/lib/php/libsdk/SDK/Config.php index f876907..89f3d8d 100644 --- a/lib/php/libsdk/SDK/Config.php +++ b/lib/php/libsdk/SDK/Config.php @@ -146,10 +146,9 @@ public static function getKnownBranches() : array $fetcher = new Fetcher(self::$depsHost, self::$depsPort, self::$depsUriScheme); $tmp = $fetcher->getByUri(self::$depsBaseUri . "/series/"); - var_dump($tmp); if (false !== $tmp) { $data = array(); - if (preg_match_all(",/packages-(.+)-(v[cs]\d+)-(x86|x64|arm64)-(stable|staging)\.txt,U", $tmp, $m, PREG_SET_ORDER)) { + if (preg_match_all(",packages-(.+)-(v[cs]\d+)-(x86|x64|arm64)-(stable|staging)\.txt,Us", $tmp, $m, PREG_SET_ORDER)) { foreach ($m as $b) { if (!isset($data[$b[1]])) { $data[$b[1]] = array(); @@ -180,7 +179,6 @@ public static function getKnownBranches() : array public static function setCurrentBranchName(string $name) : void {/*{{{*/ - print_r(self::getKnownBranches()); if (!array_key_exists($name, self::getKnownBranches())) { throw new Exception("Unsupported branch '$name'"); }