v1.0.0-alpha.1
Pre-release
Pre-release
·
157 commits
to main
since this release
This version rework completely the library, it's not compatible with previous version. Now you can use OPDS 2.0 with partial support.
BREAKING CHANGES
Opds::class
- static method
response()
removed, now static method isOpds::make()
andget()
is a arrow method:
$opds = Opds::make();
$debug = $opds->get(); // `Opds::class` instance with response
return $opds->response(); // `never` because send response
- To add
entries
, you have to usefeeds()
arrow methodfeeds()
acceptOpdsEntryBook[]
orOpdsEntryNavigation[]
but alsoOpdsEntryNavigation
orOpdsEntryBook
- To add
isSearch
, you have to useisSearch()
arrow method - To add
title
, you have to usetitle()
arrow method - To add
url
, you have to useurl()
arrow method (only for testing, URL is automatically generated) - OPDS version can be handle by query param
version
:?version=2.0
or?version=1.2
- To get generate response and keep
Opds::class
instance, you can useget()
arrow method - To get response as XML or JSON, you can use
response()
arrow method asString
param removed, now you can useget()
arrow method to debug response- To get response after
get()
you can usegetResponse()
arrow method (different thatresponse()
will return full content asnever
with headers)
use Kiwilan\Opds\Opds;
use Kiwilan\Opds\OpdsVersionEnum;
$entries = [];
$opds = Opds::make(new OpdsConfig()) // Accept `OpdsConfig::class`
->title('My search') // To set feed title
->isSearch() // To set feed as search
->url('https://example.com/search') // Only for testing, URL is automatically generated
->feeds($entries); // Accept `OpdsEntryBook[]`, `OpdsEntryNavigation[]`, `OpdsEntryNavigation` or `OpdsEntryBook`
return $opds->get();
Misc
OpdsConfig
usePagination
is now default tofalse
forceJson
param allow to skip OPDS 1.2
OpdsEntry
is nowOpdsEntryNavigation
OpdsEngine
rewrite completelyOpdsResponse
can be debug withgetContent()
method to inspect response (accessible if you useget()
method)OpdsEntry
items have nowget
prefix for all getter
Added
- add ODPS 2.0 support partially