]> Raphaƫl G. Git Repositories - packbundle/blobdiff - Controller.php
Move stream context array in context parameter
[packbundle] / Controller.php
index 148d37c15cf6aebbd41cff1315913acef1b2c4f6..77a3e14e5a10d1c4d1e2c64e9c89f062e96766a1 100644 (file)
@@ -63,15 +63,7 @@ class Controller extends AbstractController implements ServiceSubscriberInterfac
                $this->config = $container->getParameter($this->alias = RapsysPackBundle::getAlias());
 
                //Set ctx
                $this->config = $container->getParameter($this->alias = RapsysPackBundle::getAlias());
 
                //Set ctx
-               $this->ctx = stream_context_create(
-                       [
-                               'http' => [
-                                       'max_redirects' => $_ENV['RAPSYSPACK_REDIRECT'] ?? 20,
-                                       'timeout' => $_ENV['RAPSYSPACK_TIMEOUT'] ?? (($timeout = ini_get('default_socket_timeout')) !== false && $timeout !== '' ? (float)$timeout : 60),
-                                       'user_agent' => $_ENV['RAPSYSPACK_AGENT'] ?? (($agent = ini_get('user_agent')) !== false && $agent !== '' ? (string)$agent : $this->alias.'/'.($this->version = RapsysPackBundle::getVersion()))
-                               ]
-                       ]
-               );
+               $this->ctx = stream_context_create($this->config['context']);
        }
 
        /**
        }
 
        /**