All notable changes to php-opds
will be documented in this file.
- OPDS version has now a fallback to existing version if an unknown version is provided
- OPDS version query parameter is now
v
instead ofversion
(old parameter is still supported)
OpdsConfig::class
:isForceJson()
is nowisUseForceJson()
,forceExit
property allow to forceexit
on response sending, you can use constructor orforceExit()
method to set it (default isfalse
)OpdsResponse::class
:forceExit
property can be set withforceExit()
method (default isfalse),
send()method can use
exitparameter to override global
forceExitproperty, of course if
OpdsConfig::classproperty is
truethen
forceExit` will be true
Add multi-byte safe substr() for OPDS summary from PR #48 by @mikespub
- Add
OpdsPaginate::class
based on #40 from @mikespub to handle manual pagination for issue #38 Opds
methodsend()
have now a new parameterbool $exit = false
to control if the script should exit after sending the response to replacebool $mock = false
parameter. By default,send()
will not exit the script.- Merge paginator with
paginate()
method, if you not set any parameter, it will generate pagination, if you setOpdsPaginate
object, it will generate pagination based on it - Remove
usePagination
anduseAutoPagination
fromOpdsConfig
class, now you can usepaginate()
method to handle pagination
OpdsConfig::class
can have nullableupdated
attribute
- Methods
toXML()
andtoJSON()
ofOpdsEngine
are now public - OpdsEntryBook: now volume can be a float, issue #36, thanks to @mikespub
- Add
opis/json-schema
to validate OPDS JSON, issue #35, thanks to @mikespub - OpdsResponse has now
getJson()
method, nowsend()
has default parametermock
tofalse
- Fix XML search, when some feeds present switch to feed
- Fix XML search page root
- Update
OpdsJsonEngine
to use these options for OPDS 2.0 output - @todo OPDS 1.2 was not adapted in this PR by @mikespub - Add
properties
option forOpdsEntryNavigation
to include extra properties (like numberOfItems for facets) by @mikespub - Add
relation
option forOpdsEntryNavigation
to specify the relation to use (instead ofcurrent
) by @mikespub - Add
identifier
option forOpdsEntryBook
to specify the actual identifier to use (instead ofurn:isbn:...
) by @mikespub - Fix XML links
type
attribute - Add
paginationQuery
property toOpdsConfig
to specify the query parameter for pagination (default:page
) - Fix bug with paginator when using
page
query parameter #30
- Add
useAutoPagination
option forOpdsConfig
to enable/disable auto pagination (works only forOpdsEntryBook
)
This version rework completely the library, it's not compatible with previous version. Now you can use OPDS 2.0 with partial support.
- static method
response()
removed, now static method isOpds::make()
andget()
is a arrow method:
$opds = Opds::make()
->get(); // `Opds::class` instance with response
return $opds->send(); // `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
send()
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 thatsend()
will return full content asnever
with headers) -
Add fallback for old OPDS versions to v1.2
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`
->get()
;
-
OpdsConfig
usePagination
is now default tofalse
forceJson
param allow to skip OPDS 1.2searchQuery
removed fromOpdsConfig
because query parameter is statically defined (q
for OPDS 1.2,query
for OPDS 2.0)
-
OpdsEntry
is nowOpdsEntryNavigation
-
OpdsEngine
rewrite completely -
OpdsResponse
can be debug withgetContents()
method to inspect response (accessible if you useget()
method) -
OpdsEntry
items have nowget
prefix for all getter -
remove modules system
-
OpdsEngine
propertyxml
is nowcontents
getXml()
is nowgetContents()
- add setter
setContents()
- add ODPS 2.0 support partially
- add setters to
OpdsEntry
- XML pagination is now supported
- JSON pagination is now supported
- rewrite documentation
Opds
improvesend()
with new parametermock
, a boolean to send the response or not.- Move all
enum
toKiwilan\Opds\Enums
namespace. - Add new
OpdsPaginator
class to handle pagination - more tests
- Change default pagination from
15
to32
- Add more characters for
content
property ofOpdsEntryBook
media
mime type fix
OpdsEntryBook
addcontent
property with HTML
- add
OpdsVersionEnum
forversion
OpdsVersionOneDotTwoModule
is nowOpds1Dot2Module
-
OpdsApp
is nowOpdsConfig
Opds
propertyapp
is nowconfig
-
OpdsEntry
,OpdsEntryBook
,OpdsEntryBookAuthor
has now namespaceKiwilan\Opds\Entries
-
OpdsXmlConverter
is has now one static method
- add pagination feature, see
usePagination
andmaxItemsPerPage
inOpdsConfig
- add
OpdsConfig
property:iconUrl
- search template fixing
- add
OpdsEntryBookAuthor
- Add documentation
init