Skip to content

Commit

Permalink
Add logic to use CURL retrieving Config and JWT (#5)
Browse files Browse the repository at this point in the history
* Add logic to use CURL retrieving Config and JWT
* Amend coveralls.yml for handling PHP 7
Co-authored-by: neoblackie <[email protected]>
  • Loading branch information
neodeblackie authored Mar 15, 2021
1 parent 3d6269b commit c174e77
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: xdebug

- name: Validate composer.json and composer.lock
run: composer validate

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}
7 changes: 7 additions & 0 deletions src/Base/MicrosoftConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c174e77

Please sign in to comment.