Skip to content

Configuration

tilttek/reading-quests-bundle
tilttek_reading_quests:
    store: doctrine            # or memory, for tests
    connection: default
    measure:
        unit: pages            # or minutes
        characters_per_minute: 1000
    completion_percent: 100
    timezone: UTC
    shelf:
        source: config         # or doctrine, or service
        service: null
        books: {}
    privacy:
        member_kind: member
KeyDefaultHolds
storedoctrineWhere the readings and the goals are kept: doctrine, or memory for tests.
connectiondefaultThe Doctrine DBAL connection of the readings, the goals and the books.
measure.unitpagespages, the printed pages of each book, or minutes, the length of the text at the reading speed.
measure.characters_per_minute1000The reading speed of a measure in minutes, 1 to 100 000.
completion_percent100The furthest percent from which a book counts as finished, 1 to 100.
timezoneUTCThe timezone the calendar year of a goal runs in, a name PHP knows.
shelf.sourceconfigWhere the books are found: config, doctrine or service.
shelf.servicenullThe application's shelf when the source is service.
shelf.books{}The books when the source is config.
privacy.member_kindmemberThe kind of the reader a data subject of phil/privacy-bundle stands for.

The measure

With pages, every book counted needs its page count: a position in a book without one throws InvalidReadingQuest. With minutes, the amount of a book is the length of its document divided by the reading speed, rounded up. Both follow the furthest percent reached, never the time a page stays on screen. A goal of an amount is counted in this unit.

The completion percent

Below 100, a book counts as finished once the reader passes that percent: for rulebooks whose index or appendices readers seldom reach. It is given to Progress::record() for every position.

The shelf

  • config reads shelf.books, keyed by the identifier of each document, as InMemoryBookShelf::fromArray() reads them: pages, null or 1 to 100 000, and up to 15 facts, booleans, integers or strings of at most 100 bytes, unit reserved. An identifier keeps its dashes.
    shelf: books: core-rules: { pages: 320, facts: { system: dnd5e, local_author: true } } short-story: { facts: { genre: horror } }
  • doctrine keeps the books in tilttek_reading_book; the application adds, replaces and removes them through DbalBookShelf (The readings in the database). It needs store: doctrine.
  • service names the application's catalogue, an implementation of Tilttek\ReadingQuests\BookShelfInterface.

shelf.books is refused with another source, so that a list that would be ignored is not left in the configuration.

What the container refuses

The container does not compile, with the reason, for a book out of its bounds, a speed outside 1 to 100 000, a timezone PHP does not know, a service source without its service, a doctrine shelf with store: memory, or a member kind that is not 1 to 64 lowercase letters, digits, _, . or -, starting with a letter.