/** * Overrides the connection timeout based on module configuration. * * Constructor. * @param ConfigFactory $config_factory * @param ClientInterface $http_client * * @see Mollom::__construct(). */ public function __construct(ConfigFactory $config_factory, ClientInterface $http_client) { $this->config = $config_factory->getEditable('mollom.settings'); $this->requestTimeout = $this->config->get('connection_timeout_seconds'); $this->client = $http_client; parent::__construct(); // Set any configured server that may be different from the default. $configured_server = $this->loadConfiguration('server'); if (!empty($configured_server)) { $this->saveConfiguration('server', $configured_server); } $this->requestTimeout = $this->config->get('connection_timeout_seconds'); }