]> Raphaƫl G. Git Repositories - packbundle/blobdiff - Controller/MapController.php
Version 0.5.0
[packbundle] / Controller / MapController.php
index 869d5abe913e40787142d9e2c2d072b939de0b61..8d38aa644fa2a7236ad29706c52244ced22b1dcd 100644 (file)
 
 namespace Rapsys\PackBundle\Controller;
 
+use Rapsys\PackBundle\Util\MapUtil;
+use Rapsys\PackBundle\Util\SluggerUtil;
+
 use Psr\Container\ContainerInterface;
 
-use Symfony\Component\HttpFoundation\HeaderUtils;
 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
 use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
 use Symfony\Component\Filesystem\Filesystem;
 use Symfony\Component\HttpFoundation\BinaryFileResponse;
+use Symfony\Component\HttpFoundation\HeaderUtils;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Symfony\Component\Routing\RequestContext;
 use Symfony\Contracts\Service\ServiceSubscriberInterface;
 
-use Rapsys\PackBundle\Util\MapUtil;
-use Rapsys\PackBundle\Util\SluggerUtil;
-
 /**
  * {@inheritdoc}
  */
@@ -54,7 +54,7 @@ class MapController extends AbstractController implements ServiceSubscriberInter
                                'http' => [
                                        #'header' => ['Referer: https://www.openstreetmap.org/'],
                                        'max_redirects' => $_ENV['RAPSYSPACK_REDIRECT'] ?? 20,
-                                       'timeout' => $_ENV['RAPSYSPACK_TIMEOUT'] ?? (int)ini_get('default_socket_timeout') ?: 60,
+                                       '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 : RapsysPackBundle::getAlias().'/'.RapsysPackBundle::getVersion())
                                ]
                        ]