-
Notifications
You must be signed in to change notification settings - Fork 3
Update composer.json #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SyZn
wants to merge
12
commits into
heimrichhannot:0.24.x
Choose a base branch
from
SyZn:SyZn-patch-1
base: 0.24.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
77683f2
Update composer.json
SyZn e39182b
Added new parameter for ignoring self-signed SSL-certs
SyZn 208b7f1
Added HTTPOptions parameter, fix ErrorHanding
SyZn 02e1e3f
Added don't check SSL field
SyZn bc65d07
Fix positioning
SyZn 6e53a98
Added translation for SSL-Field
SyZn d9b91c2
Added en translation of SSL-Field
SyZn c45e030
Update tl_entity_import_source.php
Defcon0 c7ffc40
Update tl_entity_import_source.php
Defcon0 bb5e1a1
[Fix] Moved dontCheckSSL field after sourceUrl
SyZn a82639d
[Fix] httpAuth parameters fix naming
SyZn 65e7485
[Fix] Generalized auth and SSL verification
SyZn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,17 +100,20 @@ protected function getMappedItemData(?array $element, array $mapping): array | |
| return $result; | ||
| } | ||
|
|
||
| protected function getContentFromUrl(string $method, string $url, array $auth = []): array | ||
| protected function getContentFromUrl(string $method, string $url, array $options = []): array | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename $options to $httpClientOptions since we might have a general $options array sometimes. (same below) |
||
| { | ||
| $client = new Client(); | ||
|
|
||
| try { | ||
| $response = $client->request($method, \Contao\StringUtil::decodeEntities($url), $auth); | ||
| $response = $client->request($method, \Contao\StringUtil::decodeEntities($url), $options); | ||
| } catch (RequestException $e) { | ||
| return [ | ||
| 'statusCode' => $e->getResponse()->getStatusCode(), | ||
| 'result' => $e->getResponse()->getBody()->getContents(), | ||
| ]; | ||
| if($e->hasResponse()){ | ||
| return [ | ||
| 'statusCode' => $e->getResponse()->getStatusCode(), | ||
| 'result' => $e->getResponse()->getBody()->getContents(), | ||
| ]; | ||
| } | ||
| throw $e; | ||
| } | ||
|
|
||
| return [ | ||
|
|
@@ -133,11 +136,11 @@ protected function deleteValueFromRemoteCache(string $cacheKey): string | |
| return $filesystemCache->deleteItem('entity-import-remote.'.$cacheKey); | ||
| } | ||
|
|
||
| protected function storeValueToRemoteCache(string $url, string $cacheKey, string $method, array $auth = []) | ||
| protected function storeValueToRemoteCache(string $url, string $cacheKey, string $method, array $options = []) | ||
| { | ||
| $filesystemCache = $this->getFilesystemCache(); | ||
|
|
||
| $response = $this->getContentFromUrl($method, $url, $auth); | ||
| $response = $this->getContentFromUrl($method, $url, $options); | ||
|
|
||
| if (200 === $response['statusCode']) { | ||
| $filesystemCache->set('entity-import-remote.'.$cacheKey, $response['result']); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please replace auth by options and fix the getter and setter; Afterwards please pass $event->getOptions() to storeValueToRemoteCache() and getContentFromUrl(). Then I guess we have it :-) Thanks for your support!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rename the event to
ModifySourceHttpClientOptionsEventsince this makes more sense. This way we can modify all options of guzzle and not only auth settings.