Update to PicoFeed v0.1.29

This commit is contained in:
Frederic Guillot 2017-01-09 18:20:34 -05:00
parent d82d7324af
commit 1c6d132324
7 changed files with 88 additions and 66 deletions

View File

@ -17,7 +17,7 @@
"fguillot/simple-validator": "v1.0.0",
"fguillot/json-rpc": "v1.2.3",
"fguillot/picodb": "v1.0.14 ",
"fguillot/picofeed": "v0.1.28",
"fguillot/picofeed": "v0.1.29",
"pda/pheanstalk": "v3.1.0",
"ircmaxell/password-compat": "^1.0.4"
},

14
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "204c4faa66655c7453c47a6e0f754286",
"content-hash": "9a6bca283efab41057f6a3c13cfacbef",
"hash": "a1111f43530dee7323d23b4fe76637b0",
"content-hash": "957098eb24a77f8299716d34353d0fc8",
"packages": [
{
"name": "fguillot/json-rpc",
@ -88,16 +88,16 @@
},
{
"name": "fguillot/picofeed",
"version": "v0.1.28",
"version": "v0.1.29",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
"reference": "9da506c308bcb40b6fc630f9123466028c03170b"
"reference": "03a0a603173f5d5916d54fd6b8191a3981f949e7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/9da506c308bcb40b6fc630f9123466028c03170b",
"reference": "9da506c308bcb40b6fc630f9123466028c03170b",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/03a0a603173f5d5916d54fd6b8191a3981f949e7",
"reference": "03a0a603173f5d5916d54fd6b8191a3981f949e7",
"shasum": ""
},
"require": {
@ -137,7 +137,7 @@
],
"description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/fguillot/picoFeed",
"time": "2016-12-29 00:06:41"
"time": "2017-01-09 23:10:47"
},
{
"name": "fguillot/simple-validator",

View File

@ -167,61 +167,6 @@
"zf2"
]
},
{
"name": "fguillot/picofeed",
"version": "v0.1.28",
"version_normalized": "0.1.28.0",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
"reference": "9da506c308bcb40b6fc630f9123466028c03170b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/9da506c308bcb40b6fc630f9123466028c03170b",
"reference": "9da506c308bcb40b6fc630f9123466028c03170b",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"php": ">=5.3.0",
"zendframework/zendxml": "^1.0"
},
"require-dev": {
"phpdocumentor/reflection-docblock": "2.0.4",
"phpunit/phpunit": "4.8.26",
"symfony/yaml": "2.8.7"
},
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
"time": "2016-12-29 00:06:41",
"bin": [
"picofeed"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PicoFeed": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frédéric Guillot"
}
],
"description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/fguillot/picoFeed"
},
{
"name": "pda/pheanstalk",
"version": "v3.1.0",
@ -317,5 +262,60 @@
"hashing",
"password"
]
},
{
"name": "fguillot/picofeed",
"version": "v0.1.29",
"version_normalized": "0.1.29.0",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
"reference": "03a0a603173f5d5916d54fd6b8191a3981f949e7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/03a0a603173f5d5916d54fd6b8191a3981f949e7",
"reference": "03a0a603173f5d5916d54fd6b8191a3981f949e7",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"php": ">=5.3.0",
"zendframework/zendxml": "^1.0"
},
"require-dev": {
"phpdocumentor/reflection-docblock": "2.0.4",
"phpunit/phpunit": "4.8.26",
"symfony/yaml": "2.8.7"
},
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
"time": "2017-01-09 23:10:47",
"bin": [
"picofeed"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PicoFeed": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frédéric Guillot"
}
],
"description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/fguillot/picoFeed"
}
]

View File

@ -31,4 +31,8 @@ abstract class Base
$this->config = $config ?: new Config();
Logger::setTimezone($this->config->getTimezone());
}
public function setConfig(Config $config) {
$this->config = $config;
}
}

View File

@ -110,7 +110,10 @@ class Curl extends Client
return $this->handleRedirection($headers['Location']);
}
header(':', true, $status);
// Do not work with PHP-FPM
if (substr(PHP_SAPI, 0, 3) !== 'cgi') {
header(':', true, $status);
}
if (isset($headers['Content-Type'])) {
header('Content-Type:' .$headers['Content-Type']);
@ -354,6 +357,11 @@ class Curl extends Client
* @see http://curl.haxx.se/libcurl/c/libcurl-errors.html
*
* @param int $errno cURL error code
* @throws InvalidCertificateException
* @throws InvalidUrlException
* @throws MaxRedirectException
* @throws MaxSizeException
* @throws TimeoutException
*/
private function handleError($errno)
{
@ -377,8 +385,7 @@ class Curl extends Client
case 66: // CURLE_SSL_ENGINE_INITFAILED
case 77: // CURLE_SSL_CACERT_BADFILE
case 83: // CURLE_SSL_ISSUER_ERROR
$msg = 'Invalid SSL certificate caused by CURL error number ' .
$errno;
$msg = 'Invalid SSL certificate caused by CURL error number ' . $errno;
throw new InvalidCertificateException($msg, $errno);
case 47: // CURLE_TOO_MANY_REDIRECTS
throw new MaxRedirectException('Maximum number of redirections reached', $errno);

View File

@ -329,6 +329,7 @@ abstract class Parser implements ParserInterface
public function setConfig($config)
{
$this->config = $config;
$this->itemPostProcessor->setConfig($config);
return $this;
}

View File

@ -5,6 +5,7 @@ namespace PicoFeed\Processor;
use PicoFeed\Base;
use PicoFeed\Parser\Feed;
use PicoFeed\Parser\Item;
use PicoFeed\Config\Config;
/**
* Item Post Processor
@ -93,4 +94,13 @@ class ItemPostProcessor extends Base
{
return isset($this->processors[$class]) ? $this->processors[$class] : null;
}
public function setConfig(Config $config)
{
foreach ($this->processors as $processor) {
$processor->setConfig($config);
}
return false;
}
}