Skip to content

Commit 4df3981

Browse files
committed
New configuration directive.
The default timeout for external requests is now configurable.
1 parent 2fc9201 commit 4df3981

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

Changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ __*Why "v3.0.0" instead of "v1.0.0?"*__ Prior to phpMussel v3, the "phpMussel Co
3535
### v3.1.1
3636

3737
[2021.01.10; Maikuolan]: Separated the code for performing outbound requests through cURL out to its own independent class.
38+
39+
[2021.02.05; Maikuolan]: The default timeout for external requests is now configurable.

assets/config.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# License: GNU/GPLv2
88
# @see LICENSE.txt
99
#
10-
# This file: Configuration defaults file (last modified: 2020.07.16).
10+
# This file: Configuration defaults file (last modified: 2021.02.05).
1111
##/
1212

1313
core:
@@ -188,6 +188,10 @@ core:
188188
VirusTotal_HTTP: "VirusTotal (HTTP)"
189189
value_preg_filter:
190190
"~\s~": ""
191+
default_timeout:
192+
type: "int"
193+
default: 12
194+
preview: "seconds"
191195
signatures:
192196
active:
193197
type: "string"

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"require": {
1414
"php": ">=7.2.0",
15-
"maikuolan/common": "^2.4.0",
15+
"maikuolan/common": "^2.5",
1616
"ext-pcre": "*"
1717
},
1818
"suggest": {

src/Loader.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* License: GNU/GPLv2
99
* @see LICENSE.txt
1010
*
11-
* This file: The loader (last modified: 2021.01.10).
11+
* This file: The loader (last modified: 2021.02.05).
1212
*/
1313

1414
namespace phpMussel\Core;
@@ -328,6 +328,7 @@ public function __construct(
328328

329329
/** Instantiate request class. */
330330
$this->Request = new \Maikuolan\Common\Request();
331+
$this->Request->DefaultTimeout = $this->Configuration['core']['default_timeout'];
331332
$this->Request->Channels = (
332333
$Channels = $this->readFileBlocks($this->AssetsPath . 'channels.yaml')
333334
) ? (new \Maikuolan\Common\YAML($Channels))->Data : [];

0 commit comments

Comments
 (0)