summaryrefslogtreecommitdiff
path: root/src/Http
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-11-27 23:43:21 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-12-08 02:20:48 +0100
commit42721e95726559b4a601240bb5b0fe4e5d755b2a (patch)
tree6810e05f845ca787acc1d02fa82d3df15cd0ef9b /src/Http
parent377b390c97afb9106fd9a139819d00306f996f24 (diff)
Added Schedule parsing and replaced old Fahrplan importer
Resolves #553 (Change Frab Import from xCal to XML) Resolves #538 (Feature Request: Multi Frab Import)
Diffstat (limited to 'src/Http')
-rw-r--r--src/Http/GuzzleServiceProvider.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/Http/GuzzleServiceProvider.php b/src/Http/GuzzleServiceProvider.php
new file mode 100644
index 00000000..f81a91f5
--- /dev/null
+++ b/src/Http/GuzzleServiceProvider.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Engelsystem\Http;
+
+use Engelsystem\Container\ServiceProvider;
+use GuzzleHttp\Client as GuzzleClient;
+
+class GuzzleServiceProvider extends ServiceProvider
+{
+ public function register()
+ {
+ $this->app->when(GuzzleClient::class)
+ ->needs('$config')
+ ->give(
+ function () {
+ return [
+ // No exception on >= 400 responses
+ 'http_errors' => false,
+ // Wait max n seconds for a response
+ 'timeout' => 2.0,
+ ];
+ }
+ );
+ }
+}