Update PicoFeed version

This commit is contained in:
Frederic Guillot 2016-07-28 21:14:51 -04:00
parent 53c5475f48
commit c4a5d4a7bc
No known key found for this signature in database
GPG Key ID: 92D77191BA7FBC99
24 changed files with 730 additions and 285 deletions

View File

@ -15,7 +15,7 @@
"fguillot/simple-validator": "v1.0.0",
"fguillot/json-rpc": "v1.1.0",
"fguillot/picodb": "v1.0.2",
"fguillot/picofeed": "v0.1.23",
"fguillot/picofeed": "v0.1.24",
"pda/pheanstalk": "v3.1.0"
},
"require-dev": {

View File

@ -13,9 +13,7 @@
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0 class loader
*
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
@ -39,6 +37,8 @@ namespace Composer\Autoload;
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
@ -147,7 +147,7 @@ class ClassLoader
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-0 base directories
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException

View File

@ -1,5 +1,5 @@
Copyright (c) 2015 Nils Adermann, Jordi Boggiano
Copyright (c) 2016 Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -113,6 +113,7 @@ return array(
'PicoFeed\\Parser\\MalformedXmlException' => $vendorDir . '/fguillot/picofeed/lib/PicoFeed/Parser/MalformedXmlException.php',
'PicoFeed\\Parser\\Parser' => $vendorDir . '/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php',
'PicoFeed\\Parser\\ParserException' => $vendorDir . '/fguillot/picofeed/lib/PicoFeed/Parser/ParserException.php',
'PicoFeed\\Parser\\ParserInterface' => $vendorDir . '/fguillot/picofeed/lib/PicoFeed/Parser/ParserInterface.php',
'PicoFeed\\Parser\\Rss10' => $vendorDir . '/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php',
'PicoFeed\\Parser\\Rss20' => $vendorDir . '/fguillot/picofeed/lib/PicoFeed/Parser/Rss20.php',
'PicoFeed\\Parser\\Rss91' => $vendorDir . '/fguillot/picofeed/lib/PicoFeed/Parser/Rss91.php',

View File

@ -6,23 +6,23 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
$baseDir . '/lib/helpers.php',
$baseDir . '/lib/Translator.php',
$baseDir . '/lib/Request.php',
$baseDir . '/lib/Response.php',
$baseDir . '/lib/Router.php',
$baseDir . '/lib/Session.php',
$baseDir . '/lib/Template.php',
$baseDir . '/models/config.php',
$baseDir . '/models/service.php',
$baseDir . '/models/user.php',
$baseDir . '/models/feed.php',
$baseDir . '/models/item.php',
$baseDir . '/models/proxy.php',
$baseDir . '/models/schema.php',
$baseDir . '/models/auto_update.php',
$baseDir . '/models/database.php',
$baseDir . '/models/remember_me.php',
$baseDir . '/models/group.php',
$baseDir . '/models/favicon.php',
'441b53696b2c1c13da1210b9b5d22213' => $baseDir . '/lib/helpers.php',
'2ba60f191527015eb45c05a71d95b69f' => $baseDir . '/lib/Translator.php',
'1d58cdba7ce052ff0ce0219a932c284a' => $baseDir . '/lib/Request.php',
'8e1ed5229092ce48fdcef0a911fd739d' => $baseDir . '/lib/Response.php',
'4782391ac54646918f4edda27244ef7a' => $baseDir . '/lib/Router.php',
'8254a9abcf2a29f2c9e0505482e542ca' => $baseDir . '/lib/Session.php',
'ff80894032fd9c2cba066a346e2e80a4' => $baseDir . '/lib/Template.php',
'044f1c6c1ed68d7380e7cf9c1cbf264f' => $baseDir . '/models/config.php',
'66494fdbaa467880453e0c3bf7e1b4b6' => $baseDir . '/models/service.php',
'1f1a35303269c57e110e7f2e8ad5322c' => $baseDir . '/models/user.php',
'13b4e62b011b583c99539e59127b04c8' => $baseDir . '/models/feed.php',
'a34e2b55c1e205f246bb314c6ece3ece' => $baseDir . '/models/item.php',
'5f0802749b9b6c20dcc4a40bad2c5ab5' => $baseDir . '/models/proxy.php',
'5fd6b051860571d955491546dde72b3e' => $baseDir . '/models/schema.php',
'19b5b92aaacb0223866ea24a70b6a079' => $baseDir . '/models/auto_update.php',
'70b7654853824fd9bf3e8f66157a36b3' => $baseDir . '/models/database.php',
'6b591661432612d3117d7448ab74aebf' => $baseDir . '/models/remember_me.php',
'7a00c855e2b58e86f58b8e0eed83ebdb' => $baseDir . '/models/group.php',
'5d5d97d152d4281dff599cbd7871bf65' => $baseDir . '/models/favicon.php',
);

View File

@ -23,6 +23,12 @@ class ComposerAutoloaderInitfd7e8d436e1dc450edc3153ac8bc31b4
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitfd7e8d436e1dc450edc3153ac8bc31b4', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitfd7e8d436e1dc450edc3153ac8bc31b4::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
@ -37,19 +43,28 @@ class ComposerAutoloaderInitfd7e8d436e1dc450edc3153ac8bc31b4
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitfd7e8d436e1dc450edc3153ac8bc31b4::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequirefd7e8d436e1dc450edc3153ac8bc31b4($file);
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirefd7e8d436e1dc450edc3153ac8bc31b4($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequirefd7e8d436e1dc450edc3153ac8bc31b4($file)
function composerRequirefd7e8d436e1dc450edc3153ac8bc31b4($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}

261
vendor/composer/autoload_static.php vendored Normal file
View File

@ -0,0 +1,261 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInitfd7e8d436e1dc450edc3153ac8bc31b4
{
public static $files = array (
'441b53696b2c1c13da1210b9b5d22213' => __DIR__ . '/../..' . '/lib/helpers.php',
'2ba60f191527015eb45c05a71d95b69f' => __DIR__ . '/../..' . '/lib/Translator.php',
'1d58cdba7ce052ff0ce0219a932c284a' => __DIR__ . '/../..' . '/lib/Request.php',
'8e1ed5229092ce48fdcef0a911fd739d' => __DIR__ . '/../..' . '/lib/Response.php',
'4782391ac54646918f4edda27244ef7a' => __DIR__ . '/../..' . '/lib/Router.php',
'8254a9abcf2a29f2c9e0505482e542ca' => __DIR__ . '/../..' . '/lib/Session.php',
'ff80894032fd9c2cba066a346e2e80a4' => __DIR__ . '/../..' . '/lib/Template.php',
'044f1c6c1ed68d7380e7cf9c1cbf264f' => __DIR__ . '/../..' . '/models/config.php',
'66494fdbaa467880453e0c3bf7e1b4b6' => __DIR__ . '/../..' . '/models/service.php',
'1f1a35303269c57e110e7f2e8ad5322c' => __DIR__ . '/../..' . '/models/user.php',
'13b4e62b011b583c99539e59127b04c8' => __DIR__ . '/../..' . '/models/feed.php',
'a34e2b55c1e205f246bb314c6ece3ece' => __DIR__ . '/../..' . '/models/item.php',
'5f0802749b9b6c20dcc4a40bad2c5ab5' => __DIR__ . '/../..' . '/models/proxy.php',
'5fd6b051860571d955491546dde72b3e' => __DIR__ . '/../..' . '/models/schema.php',
'19b5b92aaacb0223866ea24a70b6a079' => __DIR__ . '/../..' . '/models/auto_update.php',
'70b7654853824fd9bf3e8f66157a36b3' => __DIR__ . '/../..' . '/models/database.php',
'6b591661432612d3117d7448ab74aebf' => __DIR__ . '/../..' . '/models/remember_me.php',
'7a00c855e2b58e86f58b8e0eed83ebdb' => __DIR__ . '/../..' . '/models/group.php',
'5d5d97d152d4281dff599cbd7871bf65' => __DIR__ . '/../..' . '/models/favicon.php',
);
public static $prefixLengthsPsr4 = array (
'P' =>
array (
'Pheanstalk\\' => 11,
),
);
public static $prefixDirsPsr4 = array (
'Pheanstalk\\' =>
array (
0 => __DIR__ . '/..' . '/pda/pheanstalk/src',
),
);
public static $prefixesPsr0 = array (
'Z' =>
array (
'ZendXml\\' =>
array (
0 => __DIR__ . '/..' . '/zendframework/zendxml/library',
),
),
'S' =>
array (
'SimpleValidator' =>
array (
0 => __DIR__ . '/..' . '/fguillot/simple-validator/src',
),
),
'P' =>
array (
'PicoFeed' =>
array (
0 => __DIR__ . '/..' . '/fguillot/picofeed/lib',
),
'PicoDb' =>
array (
0 => __DIR__ . '/..' . '/fguillot/picodb/lib',
),
),
'J' =>
array (
'JsonRPC' =>
array (
0 => __DIR__ . '/..' . '/fguillot/json-rpc/src',
),
),
);
public static $classMap = array (
'JsonRPC\\Client' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Client.php',
'JsonRPC\\Exception\\AccessDeniedException' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Exception/AccessDeniedException.php',
'JsonRPC\\Exception\\AuthenticationFailureException' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Exception/AuthenticationFailureException.php',
'JsonRPC\\Exception\\ConnectionFailureException' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Exception/ConnectionFailureException.php',
'JsonRPC\\Exception\\InvalidJsonFormatException' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Exception/InvalidJsonFormatException.php',
'JsonRPC\\Exception\\InvalidJsonRpcFormatException' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Exception/InvalidJsonRpcFormatException.php',
'JsonRPC\\Exception\\ResponseEncodingFailureException' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Exception/ResponseEncodingFailureException.php',
'JsonRPC\\Exception\\ResponseException' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Exception/ResponseException.php',
'JsonRPC\\Exception\\ServerErrorException' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Exception/ServerErrorException.php',
'JsonRPC\\HttpClient' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/HttpClient.php',
'JsonRPC\\ProcedureHandler' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/ProcedureHandler.php',
'JsonRPC\\Request\\BatchRequestParser' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Request/BatchRequestParser.php',
'JsonRPC\\Request\\RequestBuilder' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Request/RequestBuilder.php',
'JsonRPC\\Request\\RequestParser' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Request/RequestParser.php',
'JsonRPC\\Response\\ResponseBuilder' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Response/ResponseBuilder.php',
'JsonRPC\\Response\\ResponseParser' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Response/ResponseParser.php',
'JsonRPC\\Server' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Server.php',
'JsonRPC\\Validator\\HostValidator' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Validator/HostValidator.php',
'JsonRPC\\Validator\\JsonEncodingValidator' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Validator/JsonEncodingValidator.php',
'JsonRPC\\Validator\\JsonFormatValidator' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Validator/JsonFormatValidator.php',
'JsonRPC\\Validator\\RpcFormatValidator' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Validator/RpcFormatValidator.php',
'JsonRPC\\Validator\\UserValidator' => __DIR__ . '/..' . '/fguillot/json-rpc/src/JsonRPC/Validator/UserValidator.php',
'Pheanstalk\\Command' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command.php',
'Pheanstalk\\Command\\AbstractCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/AbstractCommand.php',
'Pheanstalk\\Command\\BuryCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/BuryCommand.php',
'Pheanstalk\\Command\\DeleteCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/DeleteCommand.php',
'Pheanstalk\\Command\\IgnoreCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/IgnoreCommand.php',
'Pheanstalk\\Command\\KickCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/KickCommand.php',
'Pheanstalk\\Command\\KickJobCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/KickJobCommand.php',
'Pheanstalk\\Command\\ListTubeUsedCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/ListTubeUsedCommand.php',
'Pheanstalk\\Command\\ListTubesCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/ListTubesCommand.php',
'Pheanstalk\\Command\\ListTubesWatchedCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/ListTubesWatchedCommand.php',
'Pheanstalk\\Command\\PauseTubeCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/PauseTubeCommand.php',
'Pheanstalk\\Command\\PeekCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/PeekCommand.php',
'Pheanstalk\\Command\\PutCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/PutCommand.php',
'Pheanstalk\\Command\\ReleaseCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/ReleaseCommand.php',
'Pheanstalk\\Command\\ReserveCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/ReserveCommand.php',
'Pheanstalk\\Command\\StatsCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/StatsCommand.php',
'Pheanstalk\\Command\\StatsJobCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/StatsJobCommand.php',
'Pheanstalk\\Command\\StatsTubeCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/StatsTubeCommand.php',
'Pheanstalk\\Command\\TouchCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/TouchCommand.php',
'Pheanstalk\\Command\\UseCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/UseCommand.php',
'Pheanstalk\\Command\\WatchCommand' => __DIR__ . '/..' . '/pda/pheanstalk/src/Command/WatchCommand.php',
'Pheanstalk\\Connection' => __DIR__ . '/..' . '/pda/pheanstalk/src/Connection.php',
'Pheanstalk\\Exception' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception.php',
'Pheanstalk\\Exception\\ClientException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/ClientException.php',
'Pheanstalk\\Exception\\CommandException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/CommandException.php',
'Pheanstalk\\Exception\\ConnectionException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/ConnectionException.php',
'Pheanstalk\\Exception\\ServerBadFormatException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/ServerBadFormatException.php',
'Pheanstalk\\Exception\\ServerDrainingException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/ServerDrainingException.php',
'Pheanstalk\\Exception\\ServerException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/ServerException.php',
'Pheanstalk\\Exception\\ServerInternalErrorException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/ServerInternalErrorException.php',
'Pheanstalk\\Exception\\ServerOutOfMemoryException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/ServerOutOfMemoryException.php',
'Pheanstalk\\Exception\\ServerUnknownCommandException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/ServerUnknownCommandException.php',
'Pheanstalk\\Exception\\SocketException' => __DIR__ . '/..' . '/pda/pheanstalk/src/Exception/SocketException.php',
'Pheanstalk\\Job' => __DIR__ . '/..' . '/pda/pheanstalk/src/Job.php',
'Pheanstalk\\Pheanstalk' => __DIR__ . '/..' . '/pda/pheanstalk/src/Pheanstalk.php',
'Pheanstalk\\PheanstalkInterface' => __DIR__ . '/..' . '/pda/pheanstalk/src/PheanstalkInterface.php',
'Pheanstalk\\Response' => __DIR__ . '/..' . '/pda/pheanstalk/src/Response.php',
'Pheanstalk\\ResponseParser' => __DIR__ . '/..' . '/pda/pheanstalk/src/ResponseParser.php',
'Pheanstalk\\Response\\ArrayResponse' => __DIR__ . '/..' . '/pda/pheanstalk/src/Response/ArrayResponse.php',
'Pheanstalk\\Socket' => __DIR__ . '/..' . '/pda/pheanstalk/src/Socket.php',
'Pheanstalk\\Socket\\NativeSocket' => __DIR__ . '/..' . '/pda/pheanstalk/src/Socket/NativeSocket.php',
'Pheanstalk\\Socket\\StreamFunctions' => __DIR__ . '/..' . '/pda/pheanstalk/src/Socket/StreamFunctions.php',
'Pheanstalk\\Socket\\WriteHistory' => __DIR__ . '/..' . '/pda/pheanstalk/src/Socket/WriteHistory.php',
'Pheanstalk\\YamlResponseParser' => __DIR__ . '/..' . '/pda/pheanstalk/src/YamlResponseParser.php',
'PicoDb\\Condition' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Condition.php',
'PicoDb\\Database' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Database.php',
'PicoDb\\Driver\\Base' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Driver/Base.php',
'PicoDb\\Driver\\Mysql' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Driver/Mysql.php',
'PicoDb\\Driver\\Postgres' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Driver/Postgres.php',
'PicoDb\\Driver\\Sqlite' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Driver/Sqlite.php',
'PicoDb\\Hashtable' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Hashtable.php',
'PicoDb\\SQLException' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/SQLException.php',
'PicoDb\\Schema' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Schema.php',
'PicoDb\\Table' => __DIR__ . '/..' . '/fguillot/picodb/lib/PicoDb/Table.php',
'PicoFeed\\Base' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Base.php',
'PicoFeed\\Client\\Client' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/Client.php',
'PicoFeed\\Client\\ClientException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/ClientException.php',
'PicoFeed\\Client\\Curl' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/Curl.php',
'PicoFeed\\Client\\ForbiddenException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/ForbiddenException.php',
'PicoFeed\\Client\\HttpHeaders' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/HttpHeaders.php',
'PicoFeed\\Client\\InvalidCertificateException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/InvalidCertificateException.php',
'PicoFeed\\Client\\InvalidUrlException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/InvalidUrlException.php',
'PicoFeed\\Client\\MaxRedirectException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/MaxRedirectException.php',
'PicoFeed\\Client\\MaxSizeException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/MaxSizeException.php',
'PicoFeed\\Client\\Stream' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/Stream.php',
'PicoFeed\\Client\\TimeoutException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/TimeoutException.php',
'PicoFeed\\Client\\UnauthorizedException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/UnauthorizedException.php',
'PicoFeed\\Client\\Url' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Client/Url.php',
'PicoFeed\\Config\\Config' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Config/Config.php',
'PicoFeed\\Encoding\\Encoding' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Encoding/Encoding.php',
'PicoFeed\\Filter\\Attribute' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php',
'PicoFeed\\Filter\\Filter' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php',
'PicoFeed\\Filter\\Html' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Filter/Html.php',
'PicoFeed\\Filter\\Tag' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php',
'PicoFeed\\Generator\\ContentGeneratorInterface' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Generator/ContentGeneratorInterface.php',
'PicoFeed\\Generator\\FileContentGenerator' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Generator/FileContentGenerator.php',
'PicoFeed\\Generator\\YoutubeContentGenerator' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Generator/YoutubeContentGenerator.php',
'PicoFeed\\Logging\\Logger' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Logging/Logger.php',
'PicoFeed\\Parser\\Atom' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php',
'PicoFeed\\Parser\\DateParser' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/DateParser.php',
'PicoFeed\\Parser\\Feed' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/Feed.php',
'PicoFeed\\Parser\\Item' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/Item.php',
'PicoFeed\\Parser\\MalformedXmlException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/MalformedXmlException.php',
'PicoFeed\\Parser\\Parser' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php',
'PicoFeed\\Parser\\ParserException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/ParserException.php',
'PicoFeed\\Parser\\ParserInterface' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/ParserInterface.php',
'PicoFeed\\Parser\\Rss10' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php',
'PicoFeed\\Parser\\Rss20' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/Rss20.php',
'PicoFeed\\Parser\\Rss91' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/Rss91.php',
'PicoFeed\\Parser\\Rss92' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/Rss92.php',
'PicoFeed\\Parser\\XmlEntityException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/XmlEntityException.php',
'PicoFeed\\Parser\\XmlParser' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php',
'PicoFeed\\PicoFeedException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/PicoFeedException.php',
'PicoFeed\\Processor\\ContentFilterProcessor' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Processor/ContentFilterProcessor.php',
'PicoFeed\\Processor\\ContentGeneratorProcessor' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Processor/ContentGeneratorProcessor.php',
'PicoFeed\\Processor\\ItemPostProcessor' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Processor/ItemPostProcessor.php',
'PicoFeed\\Processor\\ItemProcessorInterface' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Processor/ItemProcessorInterface.php',
'PicoFeed\\Processor\\ScraperProcessor' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Processor/ScraperProcessor.php',
'PicoFeed\\Reader\\Favicon' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Reader/Favicon.php',
'PicoFeed\\Reader\\Reader' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php',
'PicoFeed\\Reader\\ReaderException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Reader/ReaderException.php',
'PicoFeed\\Reader\\SubscriptionNotFoundException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Reader/SubscriptionNotFoundException.php',
'PicoFeed\\Reader\\UnsupportedFeedFormatException' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Reader/UnsupportedFeedFormatException.php',
'PicoFeed\\Scraper\\CandidateParser' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Scraper/CandidateParser.php',
'PicoFeed\\Scraper\\ParserInterface' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Scraper/ParserInterface.php',
'PicoFeed\\Scraper\\RuleLoader' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Scraper/RuleLoader.php',
'PicoFeed\\Scraper\\RuleParser' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Scraper/RuleParser.php',
'PicoFeed\\Scraper\\Scraper' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Scraper/Scraper.php',
'PicoFeed\\Serialization\\Subscription' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Serialization/Subscription.php',
'PicoFeed\\Serialization\\SubscriptionList' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Serialization/SubscriptionList.php',
'PicoFeed\\Serialization\\SubscriptionListBuilder' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Serialization/SubscriptionListBuilder.php',
'PicoFeed\\Serialization\\SubscriptionListParser' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Serialization/SubscriptionListParser.php',
'PicoFeed\\Serialization\\SubscriptionParser' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Serialization/SubscriptionParser.php',
'PicoFeed\\Syndication\\AtomFeedBuilder' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Syndication/AtomFeedBuilder.php',
'PicoFeed\\Syndication\\AtomHelper' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Syndication/AtomHelper.php',
'PicoFeed\\Syndication\\AtomItemBuilder' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Syndication/AtomItemBuilder.php',
'PicoFeed\\Syndication\\FeedBuilder' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Syndication/FeedBuilder.php',
'PicoFeed\\Syndication\\ItemBuilder' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Syndication/ItemBuilder.php',
'PicoFeed\\Syndication\\Rss20FeedBuilder' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20FeedBuilder.php',
'PicoFeed\\Syndication\\Rss20Helper' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20Helper.php',
'PicoFeed\\Syndication\\Rss20ItemBuilder' => __DIR__ . '/..' . '/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20ItemBuilder.php',
'SimpleValidator\\Validator' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validator.php',
'SimpleValidator\\Validators\\Alpha' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Alpha.php',
'SimpleValidator\\Validators\\AlphaNumeric' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/AlphaNumeric.php',
'SimpleValidator\\Validators\\Base' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Base.php',
'SimpleValidator\\Validators\\Date' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Date.php',
'SimpleValidator\\Validators\\Email' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Email.php',
'SimpleValidator\\Validators\\Equals' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Equals.php',
'SimpleValidator\\Validators\\Exists' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Exists.php',
'SimpleValidator\\Validators\\GreaterThan' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/GreaterThan.php',
'SimpleValidator\\Validators\\InArray' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/InArray.php',
'SimpleValidator\\Validators\\Integer' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Integer.php',
'SimpleValidator\\Validators\\Ip' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Ip.php',
'SimpleValidator\\Validators\\Length' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Length.php',
'SimpleValidator\\Validators\\MaxLength' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/MaxLength.php',
'SimpleValidator\\Validators\\MinLength' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/MinLength.php',
'SimpleValidator\\Validators\\NotEquals' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/NotEquals.php',
'SimpleValidator\\Validators\\NotInArray' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/NotInArray.php',
'SimpleValidator\\Validators\\Numeric' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Numeric.php',
'SimpleValidator\\Validators\\Range' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Range.php',
'SimpleValidator\\Validators\\Required' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Required.php',
'SimpleValidator\\Validators\\Unique' => __DIR__ . '/..' . '/fguillot/simple-validator/src/SimpleValidator/Validators/Unique.php',
'ZendXml\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/zendframework/zendxml/library/ZendXml/Exception/ExceptionInterface.php',
'ZendXml\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/zendframework/zendxml/library/ZendXml/Exception/InvalidArgumentException.php',
'ZendXml\\Exception\\RuntimeException' => __DIR__ . '/..' . '/zendframework/zendxml/library/ZendXml/Exception/RuntimeException.php',
'ZendXml\\Security' => __DIR__ . '/..' . '/zendframework/zendxml/library/ZendXml/Security.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitfd7e8d436e1dc450edc3153ac8bc31b4::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitfd7e8d436e1dc450edc3153ac8bc31b4::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInitfd7e8d436e1dc450edc3153ac8bc31b4::$prefixesPsr0;
$loader->classMap = ComposerStaticInitfd7e8d436e1dc450edc3153ac8bc31b4::$classMap;
}, null, ClassLoader::class);
}
}

View File

@ -123,56 +123,6 @@
"zf2"
]
},
{
"name": "fguillot/picofeed",
"version": "v0.1.23",
"version_normalized": "0.1.23.0",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
"reference": "a7c3d420c239fe9ffc39b0d06b6e57db39ce3797"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/a7c3d420c239fe9ffc39b0d06b6e57db39ce3797",
"reference": "a7c3d420c239fe9ffc39b0d06b6e57db39ce3797",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"php": ">=5.3.0",
"zendframework/zendxml": "^1.0"
},
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
"time": "2016-04-17 22:31:55",
"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",
@ -262,5 +212,55 @@
],
"description": "Simple Json-RPC client/server library that just works",
"homepage": "https://github.com/fguillot/JsonRPC"
},
{
"name": "fguillot/picofeed",
"version": "v0.1.24",
"version_normalized": "0.1.24.0",
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
"reference": "25f9653ca663e098f51eabbdf495eb9a130c041b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/25f9653ca663e098f51eabbdf495eb9a130c041b",
"reference": "25f9653ca663e098f51eabbdf495eb9a130c041b",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"php": ">=5.3.0",
"zendframework/zendxml": "^1.0"
},
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
"time": "2016-07-03 00:02:03",
"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

@ -9,6 +9,7 @@ use PicoFeed\Client\Url;
/**
* Atom parser.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class Atom extends Parser
@ -154,30 +155,33 @@ class Atom extends Parser
}
/**
* Find the item date.
* Find the item published date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
public function findItemDate(SimpleXMLElement $entry, Item $item, Feed $feed)
public function findItemPublishedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
{
$published = XmlParser::getXPathResult($entry, 'atom:published', $this->namespaces)
$date = XmlParser::getXPathResult($entry, 'atom:published', $this->namespaces)
?: XmlParser::getXPathResult($entry, 'published');
$updated = XmlParser::getXPathResult($entry, 'atom:updated', $this->namespaces)
$item->setPublishedDate(!empty($date) ? $this->getDateParser()->getDateTime((string) current($date)) : null);
}
/**
* Find the item updated date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
public function findItemUpdatedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
{
$date = XmlParser::getXPathResult($entry, 'atom:updated', $this->namespaces)
?: XmlParser::getXPathResult($entry, 'updated');
$published = !empty($published) ? $this->getDateParser()->getDateTime((string) current($published)) : null;
$updated = !empty($updated) ? $this->getDateParser()->getDateTime((string) current($updated)) : null;
if ($published === null && $updated === null) {
$item->setDate($feed->getDate()); // We use the feed date if there is no date for the item
} elseif ($published !== null && $updated !== null) {
$item->setDate(max($published, $updated)); // We use the most recent date between published and updated
} else {
$item->setDate($updated ?: $published);
}
$item->setUpdatedDate(!empty($date) ? $this->getDateParser()->getDateTime((string) current($date)) : null);
}
/**

View File

@ -9,6 +9,7 @@ use PicoFeed\Base;
/**
* Date Parser.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class DateParser extends Base

View File

@ -5,6 +5,7 @@ namespace PicoFeed\Parser;
/**
* Feed.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class Feed

View File

@ -5,6 +5,7 @@ namespace PicoFeed\Parser;
/**
* Feed Item.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class Item
@ -60,6 +61,20 @@ class Item
*/
public $date = null;
/**
* Item published date.
*
* @var \DateTime
*/
public $publishedDate = null;
/**
* Item updated date.
*
* @var \DateTime
*/
public $updatedDate = null;
/**
* Item content.
*
@ -151,7 +166,12 @@ class Item
$output .= 'Item::'.$property.' = '.$this->$property.PHP_EOL;
}
$publishedDate = $this->publishedDate != null ? $this->publishedDate->format(DATE_RFC822) : null;
$updatedDate = $this->updatedDate != null ? $this->updatedDate->format(DATE_RFC822) : null;
$output .= 'Item::date = '.$this->date->format(DATE_RFC822).PHP_EOL;
$output .= 'Item::publishedDate = '.$publishedDate.PHP_EOL;
$output .= 'Item::updatedDate = '.$updatedDate.PHP_EOL;
$output .= 'Item::isRTL() = '.($this->isRTL() ? 'true' : 'false').PHP_EOL;
$output .= 'Item::content = '.strlen($this->content).' bytes'.PHP_EOL;
@ -212,6 +232,26 @@ class Item
return $this->date;
}
/**
* Get published date.
*
* @return \DateTime
*/
public function getPublishedDate()
{
return $this->publishedDate;
}
/**
* Get updated date.
*
* @return \DateTime
*/
public function getUpdatedDate()
{
return $this->updatedDate;
}
/**
* Get content.
*
@ -333,6 +373,30 @@ class Item
return $this;
}
/**
* Set item published date.
*
* @param \DateTime $publishedDate
* @return Item
*/
public function setPublishedDate($publishedDate)
{
$this->publishedDate = $publishedDate;
return $this;
}
/**
* Set item updated date.
*
* @param \DateTime $updatedDate
* @return Item
*/
public function setUpdatedDate($updatedDate)
{
$this->updatedDate = $updatedDate;
return $this;
}
/**
* Set enclosure url.
*

View File

@ -5,6 +5,7 @@ namespace PicoFeed\Parser;
/**
* MalformedXmlException Exception.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class MalformedXmlException extends ParserException

View File

@ -15,9 +15,10 @@ use PicoFeed\Logging\Logger;
/**
* Base parser class.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
abstract class Parser
abstract class Parser implements ParserInterface
{
/**
* Config object.
@ -211,6 +212,30 @@ abstract class Parser
$item->url = Url::resolve($item->getUrl(), $feed->getSiteUrl());
}
/**
* Find the item date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
public function findItemDate(SimpleXMLElement $entry, Item $item, Feed $feed)
{
$this->findItemPublishedDate($entry, $item, $feed);
$published = $item->getPublishedDate();
$this->findItemUpdatedDate($entry, $item, $feed);
$updated = $item->getUpdatedDate();
if ($published === null && $updated === null) {
$item->setDate($feed->getDate()); // We use the feed date if there is no date for the item
} elseif ($published !== null && $updated !== null) {
$item->setDate(max($published, $updated)); // We use the most recent date between published and updated
} else {
$item->setDate($updated ?: $published);
}
}
/**
* Get Item Post Processor instance
*
@ -371,153 +396,5 @@ abstract class Parser
return $xml;
}
/**
* Find the feed url.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findFeedUrl(SimpleXMLElement $xml, Feed $feed);
/**
* Find the site url.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findSiteUrl(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed title.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findFeedTitle(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed description.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findFeedDescription(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed language.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findFeedLanguage(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed id.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findFeedId(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed date.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findFeedDate(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed logo url.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findFeedLogo(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed icon.
*
* @param SimpleXMLElement $xml Feed xml
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findFeedIcon(SimpleXMLElement $xml, Feed $feed);
/**
* Get the path to the items XML tree.
*
* @param SimpleXMLElement $xml Feed xml
*
* @return SimpleXMLElement
*/
abstract public function getItemsTree(SimpleXMLElement $xml);
/**
* Find the item author.
*
* @param SimpleXMLElement $xml Feed
* @param SimpleXMLElement $entry Feed item
* @param \PicoFeed\Parser\Item $item Item object
*/
abstract public function findItemAuthor(SimpleXMLElement $xml, SimpleXMLElement $entry, Item $item);
/**
* Find the item URL.
*
* @param SimpleXMLElement $entry Feed item
* @param \PicoFeed\Parser\Item $item Item object
*/
abstract public function findItemUrl(SimpleXMLElement $entry, Item $item);
/**
* Find the item title.
*
* @param SimpleXMLElement $entry Feed item
* @param \PicoFeed\Parser\Item $item Item object
*/
abstract public function findItemTitle(SimpleXMLElement $entry, Item $item);
/**
* Genereate the item id.
*
* @param SimpleXMLElement $entry Feed item
* @param \PicoFeed\Parser\Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed);
/**
* Find the item date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findItemDate(SimpleXMLElement $entry, Item $item, Feed $feed);
/**
* Find the item content.
*
* @param SimpleXMLElement $entry Feed item
* @param \PicoFeed\Parser\Item $item Item object
*/
abstract public function findItemContent(SimpleXMLElement $entry, Item $item);
/**
* Find the item enclosure.
*
* @param SimpleXMLElement $entry Feed item
* @param \PicoFeed\Parser\Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findItemEnclosure(SimpleXMLElement $entry, Item $item, Feed $feed);
/**
* Find the item language.
*
* @param SimpleXMLElement $entry Feed item
* @param \PicoFeed\Parser\Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
abstract public function findItemLanguage(SimpleXMLElement $entry, Item $item, Feed $feed);
}

View File

@ -7,6 +7,7 @@ use PicoFeed\PicoFeedException;
/**
* ParserException Exception.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
abstract class ParserException extends PicoFeedException

View File

@ -0,0 +1,173 @@
<?php
namespace PicoFeed\Parser;
use SimpleXMLElement;
/**
* Interface ParserInterface
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
interface ParserInterface
{
/**
* Find the feed url.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findFeedUrl(SimpleXMLElement $xml, Feed $feed);
/**
* Find the site url.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findSiteUrl(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed title.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findFeedTitle(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed description.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findFeedDescription(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed language.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findFeedLanguage(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed id.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findFeedId(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed date.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findFeedDate(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed logo url.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findFeedLogo(SimpleXMLElement $xml, Feed $feed);
/**
* Find the feed icon.
*
* @param SimpleXMLElement $xml Feed xml
* @param Feed $feed Feed object
*/
public function findFeedIcon(SimpleXMLElement $xml, Feed $feed);
/**
* Get the path to the items XML tree.
*
* @param SimpleXMLElement $xml Feed xml
*
* @return SimpleXMLElement
*/
public function getItemsTree(SimpleXMLElement $xml);
/**
* Find the item author.
*
* @param SimpleXMLElement $xml Feed
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
*/
public function findItemAuthor(SimpleXMLElement $xml, SimpleXMLElement $entry, Item $item);
/**
* Find the item URL.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
*/
public function findItemUrl(SimpleXMLElement $entry, Item $item);
/**
* Find the item title.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
*/
public function findItemTitle(SimpleXMLElement $entry, Item $item);
/**
* Genereate the item id.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param Feed $feed Feed object
*/
public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed);
/**
* Find the item published date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param Feed $feed Feed object
*/
public function findItemPublishedDate(SimpleXMLElement $entry, Item $item, Feed $feed);
/**
* Find the item updated date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param Feed $feed Feed object
*/
public function findItemUpdatedDate(SimpleXMLElement $entry, Item $item, Feed $feed);
/**
* Find the item content.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
*/
public function findItemContent(SimpleXMLElement $entry, Item $item);
/**
* Find the item enclosure.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param Feed $feed Feed object
*/
public function findItemEnclosure(SimpleXMLElement $entry, Item $item, Feed $feed);
/**
* Find the item language.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param Feed $feed Feed object
*/
public function findItemLanguage(SimpleXMLElement $entry, Item $item, Feed $feed);
}

View File

@ -8,6 +8,7 @@ use PicoFeed\Filter\Filter;
/**
* RSS 1.0 parser.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class Rss10 extends Parser
@ -157,17 +158,32 @@ class Rss10 extends Parser
}
/**
* Find the item date.
* Find the item published date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
public function findItemDate(SimpleXMLElement $entry, Item $item, Feed $feed)
public function findItemPublishedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
{
$date = XmlParser::getXPathResult($entry, 'dc:date', $this->namespaces);
$item->setDate(empty($date) ? $feed->getDate() : $this->getDateParser()->getDateTime(XmlParser::getValue($date)));
$item->setPublishedDate(!empty($date) ? $this->getDateParser()->getDateTime(XmlParser::getValue($date)) : null);
}
/**
* Find the item updated date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
public function findItemUpdatedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
{
if ($item->publishedDate === null) {
$this->findItemPublishedDate($entry, $item, $feed);
}
$item->setUpdatedDate($item->getPublishedDate()); // No updated date in RSS 1.0 specifications
}
/**

View File

@ -9,6 +9,7 @@ use PicoFeed\Client\Url;
/**
* RSS 2.0 Parser.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class Rss20 extends Parser
@ -152,17 +153,32 @@ class Rss20 extends Parser
}
/**
* Find the item date.
* Find the item published date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
public function findItemDate(SimpleXMLElement $entry, Item $item, Feed $feed)
public function findItemPublishedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
{
$date = XmlParser::getXPathResult($entry, 'pubDate');
$item->setDate(empty($date) ? $feed->getDate() : $this->getDateParser()->getDateTime(XmlParser::getValue($date)));
$item->setPublishedDate(!empty($date) ? $this->getDateParser()->getDateTime(XmlParser::getValue($date)) : null);
}
/**
* Find the item updated date.
*
* @param SimpleXMLElement $entry Feed item
* @param Item $item Item object
* @param \PicoFeed\Parser\Feed $feed Feed object
*/
public function findItemUpdatedDate(SimpleXMLElement $entry, Item $item, Feed $feed)
{
if ($item->publishedDate === null) {
$this->findItemPublishedDate($entry, $item, $feed);
}
$item->setUpdatedDate($item->getPublishedDate()); // No updated date in RSS 2.0 specifications
}
/**

View File

@ -5,6 +5,7 @@ namespace PicoFeed\Parser;
/**
* RSS 0.91 Parser.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class Rss91 extends Rss20

View File

@ -5,6 +5,7 @@ namespace PicoFeed\Parser;
/**
* RSS 0.92 Parser.
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class Rss92 extends Rss20

View File

@ -5,6 +5,7 @@ namespace PicoFeed\Parser;
/**
* XmlEntityException Exception.
*
* @package PicoFeed\Parser
* @author Bernhard Posselt
*/
class XmlEntityException extends MalformedXmlException

View File

@ -2,9 +2,9 @@
namespace PicoFeed\Parser;
use DomDocument;
use SimpleXmlElement;
use DOMDocument;
use SimpleXMLElement;
use ZendXml\Exception\RuntimeException;
use ZendXml\Security;
/**
@ -12,6 +12,7 @@ use ZendXml\Security;
*
* Checks for XML eXternal Entity (XXE) and XML Entity Expansion (XEE) attacks on XML documents
*
* @package PicoFeed\Parser
* @author Frederic Guillot
*/
class XmlParser
@ -33,7 +34,7 @@ class XmlParser
*
* @static
* @param string $input XML content
* @return \DOMDocument
* @return DOMDocument
*/
public static function getDomDocument($input)
{
@ -52,18 +53,20 @@ class XmlParser
}
/**
* Small wrapper around ZendXml to turn their exceptions into picoFeed
* exceptions
* Small wrapper around ZendXml to turn their exceptions into PicoFeed exceptions
*
* @param $input the xml to load
* @param $dom pass in a dom document or use null/omit if simpleXml should
* be used
* @static
* @access private
* @param string $input
* @param DOMDocument $dom
* @throws XmlEntityException
* @return SimpleXMLElement|DomDocument|boolean
*/
private static function scan($input, $dom = null)
{
try {
return Security::scan($input, $dom);
} catch(\ZendXml\Exception\RuntimeException $e) {
} catch(RuntimeException $e) {
throw new XmlEntityException($e->getMessage());
}
}
@ -72,8 +75,9 @@ class XmlParser
* Load HTML document by using a DomDocument instance or return false on failure.
*
* @static
* @access public
* @param string $input XML content
* @return \DOMDocument
* @return DOMDocument
*/
public static function getHtmlDocument($input)
{
@ -98,9 +102,8 @@ class XmlParser
* Convert a HTML document to XML.
*
* @static
*
* @access public
* @param string $html HTML document
*
* @return string
*/
public static function htmlToXml($html)
@ -113,6 +116,7 @@ class XmlParser
* Get XML parser errors.
*
* @static
* @access public
* @return string
*/
public static function getErrors()
@ -135,6 +139,7 @@ class XmlParser
* Get the encoding from a xml tag.
*
* @static
* @access public
* @param string $data Input data
* @return string
*/
@ -162,6 +167,7 @@ class XmlParser
* Get the charset from a meta tag.
*
* @static
* @access public
* @param string $data Input data
* @return string
*/
@ -179,6 +185,8 @@ class XmlParser
/**
* Rewrite XPath query to use namespace-uri and local-name derived from prefix.
*
* @static
* @access public
* @param string $query XPath query
* @param array $ns Prefix to namespace URI mapping
* @return string
@ -199,10 +207,12 @@ class XmlParser
/**
* Get the result elements of a XPath query.
*
* @param \SimpleXMLElement $xml XML element
* @static
* @access public
* @param SimpleXMLElement $xml XML element
* @param string $query XPath query
* @param array $ns Prefix to namespace URI mapping
* @return \SimpleXMLElement[]
* @return SimpleXMLElement[]
*/
public static function getXPathResult(SimpleXMLElement $xml, $query, array $ns = array())
{

View File

@ -6,6 +6,7 @@ return array(
'test_url' => 'https://medium.com/lessons-learned/917b8b63ae3e',
'body' => array(
'//div[contains(@class, "post-field body")]',
'//div[contains(@class, "section-inner layoutSingleColumn")]',
),
'strip' => array(
),

View File

@ -4,14 +4,14 @@ return array(
'%.*%' => array(
'test_url' => 'http://www.rugbyrama.fr/rugby/top-14/2015-2016/top-14-hayman-coupe-du-monde-finale-2012-lutte.-voici-levan-chilachava-toulon_sto5283863/story.shtml',
'body' => array(
'//div[@class="story-simple-content"]',
'//div[@class="storyfull__content"]',
),
'strip' => array(
'//script',
'//form',
'//style',
'//*[@class="share-buttons"]',
'//*[@class="show-mobile-block"]',
'//*[@class="ad"]',
'//*[@class="hide-desktop"]',
'//*[@id="tracking_img"]',
)