reverted: --- b/feeds_ui/feeds_ui.install +++ a/feeds_ui/feeds_ui.install @@ -6,31 +6,8 @@ */ /** - * Implement hook_install() - */ -function feeds_ui_install() { - variable_set('http_request_timeout', 30); -} - -/** - * Implement hook_uninstall() - */ -function feeds_ui_uninstall() { - variable_del('http_request_timeout'); -} - -/** * Empty update function to trigger a menu rebuild. */ function feeds_ui_update_7000() { // Do nothing. } - -/** - * Create http_request_timeout variable if it is not set yet. - */ -function feeds_ui_update_7200() { - // If it was already set - use it. - // If not - set to default value. - variable_set('http_request_timeout', variable_get('http_request_timeout', 30)); -} \ No newline at end of file diff -u b/plugins/FeedsHTTPFetcher.inc b/plugins/FeedsHTTPFetcher.inc --- b/plugins/FeedsHTTPFetcher.inc +++ b/plugins/FeedsHTTPFetcher.inc @@ -18,9 +18,8 @@ /** * Constructor. */ - public function __construct($url = NULL, $timeout = NULL) { + public function __construct($url = NULL) { $this->url = $url; - $this->timeout = $timeout; parent::__construct(''); } @@ -35,6 +34,14 @@ } return $this->sanitizeRaw($result->data); } + + public function getTimeout() { + return $this->timeout; + } + + public function setTimeout($timeout) { + $this->timeout = $timeout; + } } /** @@ -50,8 +57,10 @@ if ($this->config['use_pubsubhubbub'] && ($raw = $this->subscriber($source->feed_nid)->receive())) { return new FeedsFetcherResult($raw); } - // When request_timeout is empty, global value is used. - return new FeedsHTTPFetcherResult($source_config['source'], $this->config['request_timeout']); + $fetcher_result = new FeedsHTTPFetcherResult($source_config['source']); + // When request_timeout is empty, the global value is used. + $fetcher_result->setTimeout($this->config['request_timeout']); + return $fetcher_result; } /** @@ -134,7 +143,7 @@ '#title' => t('Request timeout'), '#description' => t('Timeout in seconds to wait for an HTTP get request to finish.
' . 'Note: this setting will override global setting.
' . - 'When left empty, global value is used.'), + 'When left empty, the global value is used.'), '#default_value' => $this->config['request_timeout'], '#element_validate' => array('element_validate_integer_positive'), '#maxlength' => 3, only in patch2: unchanged: --- a/feeds.install +++ b/feeds.install @@ -6,6 +6,13 @@ */ /** + * Implement hook_uninstall() + */ +function feeds_uninstall() { + variable_del('http_request_timeout'); +} + +/** * Implements hook_schema(). */ function feeds_schema() {