- //Set http default timeout
- $this->timeout = ini_get('default_socket_timeout');
- //Set http default user agent
- $this->userAgent = ini_get('user_agent');
- //Set http default redirect
- $this->redirect = 20;
-
- //Try to load service defaults
- if ($this->containerInterface->hasParameter('rapsys_pack')) {
- if ($parameters = $this->containerInterface->getParameter('rapsys_pack')) {
- if (!empty($parameters['timeout'])) {
- $this->timeout = $parameters['timeout'];
- }
- if (!empty($parameters['agent'])) {
- $this->userAgent = $parameters['agent'];
- }
- if (!empty($parameters['redirect'])) {
- $this->redirect = $parameters['redirect'];
- }
- }
- }