projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- toggle debugging flag
[m6w6/ext-http]
/
docs
/
examples
/
Simple_Feed_Aggregator.php
diff --git
a/docs/examples/Simple_Feed_Aggregator.php
b/docs/examples/Simple_Feed_Aggregator.php
index fd7ade47e17ce4b6ba4c9529d6441d5162bd4ec8..c28e83873fa2cb09429dd01d324aec327ba777e5 100644
(file)
--- a/
docs/examples/Simple_Feed_Aggregator.php
+++ b/
docs/examples/Simple_Feed_Aggregator.php
@@
-38,7
+38,7
@@
class FeedAggregator
{
$pool = new HttpRequestPool;
foreach ($urls as $url) {
{
$pool = new HttpRequestPool;
foreach ($urls as $url) {
- $pool->attach($this->setupRequest($url));
+ $pool->attach($
r = $
this->setupRequest($url));
}
$pool->send();
}
$pool->send();
@@
-74,7
+74,7
@@
class FeedAggregator
protected function loadFeed($file)
{
protected function loadFeed($file)
{
- if (isset($this->feeds[$file]) {
+ if (isset($this->feeds[$file])
)
{
if ($data = file_get_contents($this->directory .'/'. $file .'.xml')) {
return $data;
} else {
if ($data = file_get_contents($this->directory .'/'. $file .'.xml')) {
return $data;
} else {
@@
-93,7
+93,7
@@
class FeedAggregator
$file = $this->url2name($url);
if (isset($this->feeds[$file])) {
$file = $this->url2name($url);
if (isset($this->feeds[$file])) {
- $r->
add
Options(array('lastmodified' => $this->feeds[$file]));
+ $r->
set
Options(array('lastmodified' => $this->feeds[$file]));
}
return $r;
}
return $r;
@@
-108,7
+108,7
@@
class FeedAggregator
if (!strlen($body = $r->getResponseBody())) {
throw new Exception("Received empty feed from ". $r->getUrl());
}
if (!strlen($body = $r->getResponseBody())) {
throw new Exception("Received empty feed from ". $r->getUrl());
}
- $this->saveFeed($
file
, $body);
+ $this->saveFeed($
this->url2name($r->getUrl())
, $body);
}
}
}
}
}
}