From 114b3ca7224fe55bcd9a744617ff702a9ec92ff6 Mon Sep 17 00:00:00 2001 From: neoblackie Date: Sun, 14 Mar 2021 16:38:29 +0800 Subject: [PATCH 1/5] Add logic to use CURL retrieving Config and JWT --- composer.json | 6 +++--- src/Base/MicrosoftConfiguration.php | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 649a300a..ff64ba77 100644 --- a/composer.json +++ b/composer.json @@ -45,8 +45,8 @@ } }, "scripts": { - "test": ["./vendor/bin/phpunit --colors=always"], - "coverage": ["./vendor/bin/phpunit --colors=always --coverage-text --coverage-html ./coverage --coverage-clover=build/logs/clover.xml"], - "coveralls": ["composer run coverage && ./vendor/bin/php-coveralls"] + "test": [ "@putenv XDEBUG_MODE=coverage", "./vendor/bin/phpunit --colors=always" ], + "coverage": [ "@putenv XDEBUG_MODE=coverage", "./vendor/bin/phpunit --colors=always --coverage-text --coverage-html ./coverage --coverage-clover=build/logs/clover.xml" ], + "coveralls": ["@putenv XDEBUG_MODE=coverage", "composer run coverage && ./vendor/bin/php-coveralls"] } } diff --git a/src/Base/MicrosoftConfiguration.php b/src/Base/MicrosoftConfiguration.php index fdc58678..fa0a1030 100644 --- a/src/Base/MicrosoftConfiguration.php +++ b/src/Base/MicrosoftConfiguration.php @@ -161,6 +161,13 @@ private function getFromUrlOrFile($value) $targetUri = $value; if (filter_var($value, FILTER_VALIDATE_URL) === false) { $targetUri = realpath($value) === false ? __DIR__ . $value : $value; + $result = @file_get_contents($targetUri); + } else { + $ch = curl_init($value); + curl_setopt($ch, CURLOPT_HTTPGET, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + $result = curl_exec($ch); + curl_close($ch); } $result = @file_get_contents($targetUri); From dccc7ecc1609a334a3babec987c43577a1b1be4b Mon Sep 17 00:00:00 2001 From: wccheung Date: Mon, 15 Mar 2021 11:14:09 +0800 Subject: [PATCH 2/5] Amend coveralls.yml for handling PHP 7 --- .github/workflows/coveralls.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index dde873c5..15bf71ac 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -13,6 +13,10 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + - name: Validate composer.json and composer.lock run: composer validate From 15b5a3e23dc9090bc84202a185fbaa6d60a9bee7 Mon Sep 17 00:00:00 2001 From: wccheung Date: Mon, 15 Mar 2021 11:47:39 +0800 Subject: [PATCH 3/5] Amend coveralls.yml for handling PHP 7 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index ff64ba77..7aee04fc 100644 --- a/composer.json +++ b/composer.json @@ -45,8 +45,8 @@ } }, "scripts": { - "test": [ "@putenv XDEBUG_MODE=coverage", "./vendor/bin/phpunit --colors=always" ], - "coverage": [ "@putenv XDEBUG_MODE=coverage", "./vendor/bin/phpunit --colors=always --coverage-text --coverage-html ./coverage --coverage-clover=build/logs/clover.xml" ], - "coveralls": ["@putenv XDEBUG_MODE=coverage", "composer run coverage && ./vendor/bin/php-coveralls"] + "test": [ "./vendor/bin/phpunit --colors=always" ], + "coverage": [ "./vendor/bin/phpunit --colors=always --coverage-text --coverage-html ./coverage --coverage-clover=build/logs/clover.xml" ], + "coveralls": [ "composer run coverage && ./vendor/bin/php-coveralls"] } } From 8488c06aa0f3b059020d443bb063a0ad15abba91 Mon Sep 17 00:00:00 2001 From: wccheung Date: Mon, 15 Mar 2021 11:53:51 +0800 Subject: [PATCH 4/5] Amend coveralls.yml for handling PHP 7 --- .github/workflows/coveralls.yml | 6 ++++-- composer.json | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index 15bf71ac..d4c34c2e 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -13,9 +13,11 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 + - name: Setup PHP with Xdebug 2.x + uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: '7.4' + coverage: xdebug - name: Validate composer.json and composer.lock run: composer validate diff --git a/composer.json b/composer.json index 7aee04fc..8559114c 100644 --- a/composer.json +++ b/composer.json @@ -45,8 +45,8 @@ } }, "scripts": { - "test": [ "./vendor/bin/phpunit --colors=always" ], - "coverage": [ "./vendor/bin/phpunit --colors=always --coverage-text --coverage-html ./coverage --coverage-clover=build/logs/clover.xml" ], - "coveralls": [ "composer run coverage && ./vendor/bin/php-coveralls"] + "test": [ "@putenv XDEBUG_MODE=coverage", "./vendor/bin/phpunit --colors=always" ], + "coverage": [ "@putenv XDEBUG_MODE=coverage", "./vendor/bin/phpunit --colors=always --coverage-text --coverage-html ./coverage --coverage-clover=build/logs/clover.xml" ], + "coveralls": [ "@putenv XDEBUG_MODE=coverage", "composer run coverage && ./vendor/bin/php-coveralls"] } } From 74b98bbb57b822793c6f66f26dccf36198e8c193 Mon Sep 17 00:00:00 2001 From: wccheung Date: Mon, 15 Mar 2021 11:56:15 +0800 Subject: [PATCH 5/5] Amend coveralls.yml for handling PHP 7 --- .github/workflows/coveralls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index d4c34c2e..8d2580b9 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup PHP with Xdebug 2.x + - name: Setup PHP with Xdebug uses: shivammathur/setup-php@v2 with: php-version: '7.4'