An empty list of items should not throw an exception as this is
technically still a valid feed (just empty). Instead the error
message should focus on actual transformation errors.
This adds the same error message for load of cache and data as used
for data transformation.
Notice: Errors during data transformation are less likely if data
loading succeeded.
Replace error message and add additional information:
- Name of the bridge
- Possible solutions
- Error description
- Error code
- Error message
The error description also includes an URI to create a new issue
on GitHub based on the given error information (prepared).
* add function getExtraInfos() to BridgeAbstract
* replace call to $bridge->getName() and $bridge->getURI() by $bridge->getExtraInfos()
replace call to $bridge->getName() and $bridge->getURI() by $bridge->getExtraInfos() defined by default in BridgeAbstract.
So we could pass additionals ExtraInfos from custom bridges to custom formats.
Previously the cache file name was only build upon bridge
parameters. If two bridges don't make use of any parameter
this would result into equal file names.
Previously BridgeAbstract needed to know which exact implementation
of CacheInterface was used (since we only got one right now its
not a problem). Initializing the cache in index.php instead allows
to change cache types more easily.
Methods displayBridgeCard, sanitize, defaultImageSrcTo are now
functions in lib/html.php
getHelperButtinsFormat and getFormHeader are now anonymous functions
defined in displayBridgeCard
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
- returnError, returnServerError, returnClientError ,debugMessage are
moved to lib/error.php
- getContents, getSimpleHTMLDOM, getSimpleHTMLDOMCached are moved to
lib/contents.php
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
getDatas -> getItems
setDatas -> setItems
Note: Bridge->setDatas actually sets data, where Bridge->getItems
only returns items (this is why Bridge->setDatas was not changed)
if a bridge needs to modify some of the data that were initialized
there, ::__construct() should be used instead.
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
therefore, the provider decides if the service use a
proxy or not, and if users can have the possibility to
disable it on a bridge basis.
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>