Fix option in the client code itself as well

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2021-01-12 11:01:06 +01:00
parent 9b58a027e3
commit 41c80d6c19
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 18 additions and 12 deletions

View File

@ -95,6 +95,12 @@ class Client implements IClient {
$options[RequestOptions::HEADERS]['Accept-Encoding'] = 'gzip'; $options[RequestOptions::HEADERS]['Accept-Encoding'] = 'gzip';
} }
// Fallback for save_to
if (isset($options['save_to'])) {
$options['sink'] = $options['save_to'];
unset($options['save_to']);
}
return $options; return $options;
} }
@ -218,7 +224,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* 'timeout' => 5, * 'timeout' => 5,
@ -249,7 +255,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* 'timeout' => 5, * 'timeout' => 5,
@ -284,7 +290,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* 'timeout' => 5, * 'timeout' => 5,
@ -324,7 +330,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* 'timeout' => 5, * 'timeout' => 5,
@ -359,7 +365,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* 'timeout' => 5, * 'timeout' => 5,
@ -394,7 +400,7 @@ class Client implements IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* 'timeout' => 5, * 'timeout' => 5,

View File

@ -55,7 +55,7 @@ interface IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* @return IResponse * @return IResponse
@ -80,7 +80,7 @@ interface IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* @return IResponse * @return IResponse
@ -110,7 +110,7 @@ interface IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* @return IResponse * @return IResponse
@ -140,7 +140,7 @@ interface IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* @return IResponse * @return IResponse
@ -170,7 +170,7 @@ interface IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* @return IResponse * @return IResponse
@ -200,7 +200,7 @@ interface IClient {
* 'referer' => true, // add a Referer header * 'referer' => true, // add a Referer header
* 'protocols' => ['https'] // only allow https URLs * 'protocols' => ['https'] // only allow https URLs
* ], * ],
* 'save_to' => '/path/to/file', // save to a file or a stream * 'sink' => '/path/to/file', // save to a file or a stream
* 'verify' => true, // bool or string to CA file * 'verify' => true, // bool or string to CA file
* 'debug' => true, * 'debug' => true,
* @return IResponse * @return IResponse