Skip to content

v1.0.0-alpha.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@ewilan-riviere ewilan-riviere released this 30 Aug 11:55
· 157 commits to main since this release
8fd65cf

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 is Opds::make() and get() 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 use feeds() arrow method
    • feeds() accept OpdsEntryBook[] or OpdsEntryNavigation[] but also OpdsEntryNavigation or OpdsEntryBook
  • To add isSearch, you have to use isSearch() arrow method
  • To add title, you have to use title() arrow method
  • To add url, you have to use url() 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 use get() arrow method
  • To get response as XML or JSON, you can use response() arrow method
  • asString param removed, now you can use get() arrow method to debug response
  • To get response after get() you can use getResponse() arrow method (different that response() will return full content as never 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 to false
    • forceJson param allow to skip OPDS 1.2
  • OpdsEntry is now OpdsEntryNavigation
  • OpdsEngine rewrite completely
  • OpdsResponse can be debug with getContent() method to inspect response (accessible if you use get() method)
  • OpdsEntry items have now get prefix for all getter

Added

  • add ODPS 2.0 support partially