Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
a8468ac9
Commit
a8468ac9
authored
11 years ago
by
klausi
Committed by
Chris Leppanen
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue #2192819 by twistor, klausi: FeedsHTTPFetcherResult should store the result between batches.
parent
83f1a1d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/FeedsHTTPFetcher.inc
+21
-7
21 additions, 7 deletions
plugins/FeedsHTTPFetcher.inc
with
21 additions
and
7 deletions
plugins/FeedsHTTPFetcher.inc
+
21
−
7
View file @
a8468ac9
...
...
@@ -11,8 +11,19 @@ feeds_include_library('PuSHSubscriber.inc', 'PuSHSubscriber');
* Result of FeedsHTTPFetcher::fetch().
*/
class
FeedsHTTPFetcherResult
extends
FeedsFetcherResult
{
/**
* The URL of the feed being fetched.
*
* @var string
*/
protected
$url
;
protected
$file_path
;
/**
* The timeout in seconds to wait for a download.
*
* @var int
*/
protected
$timeout
;
/**
...
...
@@ -20,19 +31,22 @@ class FeedsHTTPFetcherResult extends FeedsFetcherResult {
*/
public
function
__construct
(
$url
=
NULL
)
{
$this
->
url
=
$url
;
parent
::
__construct
(
''
);
}
/**
* Overrides FeedsFetcherResult::getRaw();
*/
public
function
getRaw
()
{
feeds_include_library
(
'http_request.inc'
,
'http_request'
);
$result
=
http_request_get
(
$this
->
url
,
NULL
,
NULL
,
NULL
,
$this
->
timeout
);
if
(
!
in_array
(
$result
->
code
,
array
(
200
,
201
,
202
,
203
,
204
,
205
,
206
)))
{
throw
new
Exception
(
t
(
'Download of @url failed with code !code.'
,
array
(
'@url'
=>
$this
->
url
,
'!code'
=>
$result
->
code
)));
if
(
!
isset
(
$this
->
raw
))
{
feeds_include_library
(
'http_request.inc'
,
'http_request'
);
$result
=
http_request_get
(
$this
->
url
,
NULL
,
NULL
,
NULL
,
$this
->
timeout
);
if
(
!
in_array
(
$result
->
code
,
array
(
200
,
201
,
202
,
203
,
204
,
205
,
206
)))
{
throw
new
Exception
(
t
(
'Download of @url failed with code !code.'
,
array
(
'@url'
=>
$this
->
url
,
'!code'
=>
$result
->
code
)));
}
$this
->
raw
=
$result
->
data
;
}
return
$this
->
sanitizeRaw
(
$result
->
data
);
return
$this
->
sanitizeRaw
(
$this
->
raw
);
}
public
function
getTimeout
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment