2013-08-11 13:30:41 +02:00
|
|
|
<?php
|
|
|
|
/* rss-bridge library.
|
|
|
|
Foundation functions for rss-bridge project.
|
|
|
|
See https://github.com/sebsauvage/rss-bridge
|
|
|
|
Licence: Public domain.
|
|
|
|
*/
|
|
|
|
|
|
|
|
define('PATH_VENDOR', '/../vendor');
|
|
|
|
|
|
|
|
require __DIR__ . '/Exceptions.php';
|
|
|
|
require __DIR__ . '/Format.php';
|
2016-09-05 18:05:19 +02:00
|
|
|
require __DIR__ . '/FormatAbstract.php';
|
2013-08-11 13:30:41 +02:00
|
|
|
require __DIR__ . '/Bridge.php';
|
2016-09-05 18:05:19 +02:00
|
|
|
require __DIR__ . '/BridgeAbstract.php';
|
|
|
|
require __DIR__ . '/FeedExpander.php';
|
2013-08-11 13:30:41 +02:00
|
|
|
require __DIR__ . '/Cache.php';
|
2018-06-27 19:09:41 +02:00
|
|
|
require __DIR__ . '/Authentication.php';
|
|
|
|
require __DIR__ . '/Configuration.php';
|
2018-07-21 18:15:07 +02:00
|
|
|
require __DIR__ . '/BridgeCard.php';
|
|
|
|
require __DIR__ . '/BridgeList.php';
|
2016-09-26 00:09:29 +02:00
|
|
|
|
|
|
|
require __DIR__ . '/validation.php';
|
2016-09-25 23:58:52 +02:00
|
|
|
require __DIR__ . '/html.php';
|
2016-09-25 23:22:33 +02:00
|
|
|
require __DIR__ . '/error.php';
|
|
|
|
require __DIR__ . '/contents.php';
|
2013-08-11 13:30:41 +02:00
|
|
|
|
|
|
|
$vendorLibSimpleHtmlDom = __DIR__ . PATH_VENDOR . '/simplehtmldom/simple_html_dom.php';
|
2017-07-29 19:28:00 +02:00
|
|
|
if(!file_exists($vendorLibSimpleHtmlDom)) {
|
2016-09-10 21:01:02 +02:00
|
|
|
throw new \HttpException('"PHP Simple HTML DOM Parser" library is missing.
|
|
|
|
Get it from http://simplehtmldom.sourceforge.net and place the script "simple_html_dom.php" in '
|
2017-02-14 17:28:07 +01:00
|
|
|
. substr(PATH_VENDOR, 4)
|
|
|
|
. '/simplehtmldom/',
|
|
|
|
500);
|
2013-08-11 13:30:41 +02:00
|
|
|
}
|
|
|
|
require_once $vendorLibSimpleHtmlDom;
|
|
|
|
|
2018-08-02 06:31:56 +02:00
|
|
|
$vendorLibPhpUrlJoin = __DIR__ . PATH_VENDOR . '/php-urljoin/src/urljoin.php';
|
|
|
|
if(!file_exists($vendorLibPhpUrlJoin)) {
|
|
|
|
throw new \HttpException('"php-urljoin" library is missing.
|
|
|
|
Get it from https://github.com/fluffy-critter/php-urljoin and place the script "urljoin.php" in '
|
|
|
|
. substr(PATH_VENDOR, 4)
|
|
|
|
. '/php-urljoin/src/',
|
|
|
|
500);
|
|
|
|
}
|
|
|
|
require_once $vendorLibPhpUrlJoin;
|
|
|
|
|
|
|
|
|
2013-08-11 13:30:41 +02:00
|
|
|
/* Example use
|
2016-09-10 20:41:11 +02:00
|
|
|
|
|
|
|
require_once __DIR__ . '/lib/RssBridge.php';
|
|
|
|
|
|
|
|
// Data retrieval
|
|
|
|
Bridge::setDir(__DIR__ . '/bridges/');
|
|
|
|
$bridge = Bridge::create('GoogleSearch');
|
|
|
|
$bridge->collectData($_REQUEST);
|
|
|
|
|
|
|
|
// Data transformation
|
|
|
|
Format::setDir(__DIR__ . '/formats/');
|
|
|
|
$format = Format::create('Atom');
|
|
|
|
$format
|
|
|
|
->setItems($bridge->getItems())
|
|
|
|
->setExtraInfos(array(
|
|
|
|
'name' => $bridge->getName(),
|
|
|
|
'uri' => $bridge->getURI(),
|
2018-08-21 17:46:47 +02:00
|
|
|
'icon' => $bridge->getIcon(),
|
2016-09-10 20:41:11 +02:00
|
|
|
))
|
|
|
|
->display();
|
2013-08-11 13:30:41 +02:00
|
|
|
|
2015-11-05 11:12:58 +01:00
|
|
|
*/
|