Skip to content

Installation

tilttek/reading-quests-bundle

Requirements

  • PHP 8.5 or later, Symfony 8.2, Doctrine DBAL 4.6.
  • tilttek/activity-bundle, whose journal the activities of reading go to, and tilttek/reading-quests, which turns a position into those activities.
  • phil/reading-progress, which measures how far a reader got in a document.
  • psr/clock and psr/event-dispatcher; FrameworkBundle provides both.
  • Optional: doctrine/orm for the schema listener, phil/privacy-bundle for the export and the erasure of a reader.

Enabling the bundle

composer require tilttek/reading-quests-bundle
// config/bundles.php
return [
    // …
    Tilttek\ActivityBundle\TilttekActivityBundle::class => ['all' => true],
    Tilttek\ReadingQuestsBundle\TilttekReadingQuestsBundle::class => ['all' => true],
];

The verbs of the journal

The activities of reading are book.started, book.read and book.finished. When tilttek_activity.verbs lists the verbs the application records, add their pattern to it, or the journal refuses them:

tilttek_activity:
    verbs: ['news.commented', 'book.*']

An empty list lets every verb through, and needs nothing.

The migration

Let Doctrine write the migration of the tables:

bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate

Without the ORM, create the tables from ReadingTables::tables() in a migration of your own: it gives them for the platform of the connection, as The readings in the database describes.

The books

Each document a reader opens is a book of the shelf, found by the identifier of its Document. List them in the configuration, keep them in a table, or name the application's catalogue (Configuration). A position in a document the shelf does not hold throws UnknownBook and records nothing.