phil / library-bundle
Loans of a game or book library in Symfony: a catalogue searched without JavaScript, copies lent, reserved, renewed and returned, overdue notices by Messenger.
Package info
github.com/parler-haut-interagir-librement/library-bundle
Type:symfony-bundle
pkg:composer/phil/library-bundle
Requires
- php: >=8.5
- ext-mbstring: *
- doctrine/dbal: ^4.5
- doctrine/orm: ^3.7
- phil/reservation: ^0.1@dev
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/form: ^8.2
- symfony/http-foundation: ^8.2
- symfony/http-kernel: ^8.2
- symfony/options-resolver: ^8.2
- symfony/polyfill-php86: ^1.37
- symfony/routing: ^8.2
- symfony/security-core: ^8.2
- symfony/translation: ^8.2
- symfony/translation-contracts: ^3.6
- symfony/uid: ^8.2
- symfony/ux-twig-component: ^3.7
- symfony/validator: ^8.2
- twig/twig: ^3.21
Requires (Dev)
- doctrine/doctrine-bundle: ^3.3
- doctrine/persistence: ^4.1
- easycorp/easyadmin-bundle: ^5.8
- phil/privacy-bundle: ^0.1@dev
- phil/stockroom: ^0.1@dev
- phil/stockroom-bundle: ^0.1@dev
- phil/ux-kit: >=0.5.0-alpha <1.0
- phpunit/phpunit: ^13.4
- psr/log: ^3.0
- symfony/browser-kit: ^8.2
- symfony/clock: ^8.2
- symfony/console: ^8.2
- symfony/css-selector: ^8.2
- symfony/dom-crawler: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/messenger: ^8.2
- symfony/process: ^8.2
- symfony/twig-bridge: ^8.2
- symfony/twig-bundle: ^8.2
Suggests
- easycorp/easyadmin-bundle: For the links of the library in an EasyAdmin back office
- phil/privacy-bundle: For a member's loans in the export and the erasure of their data
- phil/search-bundle: To index the titles in the site's search as well
- phil/stockroom: To move the stockroom item a copy is when it is lent, returned or lost
- phil/stockroom-bundle: To keep the stockroom in the database, each movement locked to its item and written in the loan's transaction when both share the connection
- phil/ux-kit: For the recipes the pages draw — Alert, Badge, Button, Card, Table —, through the Symfony UX Toolkit
- symfony/console: For phil:library:send-reminders and phil:library:forget-history
- symfony/messenger: To send the reminders as messages the application handles
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-21 03:04:22 UTC
README
A game or book library for Symfony: catalogue, search, loans, returns and reminders, its copies stockroom items.
phil/library-bundle runs a library of games, books or anything else lent. Its catalogue holds titles described by their records — ISBN, authors, publisher, year, and for a game the players, the length of a play and the youngest age it suits —, searched by a list filtered with a plain form, paged by links, without JavaScript. Each title has copies, known by their barcodes, each with its condition and a note — the pieces missing from a box.
Copies are lent at the desk or reserved ahead, on phil/reservation: each copy is a resource of one unit and each loan
a booking of it, so that a copy out or reserved over a span is not lent again over it. A loan is due at the end of its
last day on the library's clock, renewed a set number of times when nobody reserved the copy after it, returned with
the condition the copy is in, or recorded lost. A member with a copy overdue, or holding as many loans as allowed,
borrows no more. Reminders before the due date and notices of a loan overdue go out as Messenger messages carrying
identifiers only; no fine is counted.
A member is the application's stable identifier — a card number, an account number —, never an e-mail address. A
member sees their loans on a page of their own; the staff have the desk, the administration of the catalogue and the
list of loans overdue, reached from an EasyAdmin back office if the application has one. The pages are drawn by the
recipes of the PHIL UX kit. The history of a member's loans is part of the access and erasure requests of
phil/privacy-bundle, and can be forgotten after a number of days. A copy can be an item of phil/stockroom: its
loans then move the item out to the loan and back — with phil/stockroom-bundle on the same database, in the loan's
own transaction.
Status
| Part | State |
|---|---|
Title, Copy, Loan in Doctrine, moments in UTC, Record and its ISBN |
Implemented and tested, on SQLite, MySQL 8.4 and PostgreSQL 17 |
Catalogue: titles, records, copies, conditions, stockroom links |
Implemented and tested |
Loans: lend, reserve, check out, renew, return, cancel, lose, the member's limits, the history forgotten |
Implemented and tested |
| Two loans of one copy made at once | Tested on MySQL and PostgreSQL |
DbalTitleSearch, the catalogue's search with DBAL |
Implemented and tested |
Reminders, the Messenger sender, the commands |
Implemented and tested |
| The pages: catalogue, title, member's loans, desk, administration, overdue; the kit's recipes | Implemented and tested |
LoanHistoryPrivacy, the module of phil/privacy-bundle |
Implemented and tested |
StockroomLink, the link between a copy and an item of phil/stockroom, in the transactions of phil/stockroom-bundle |
Implemented and tested |
LibraryAdmin, the links of an EasyAdmin back office |
Implemented and tested |
| The Flex recipe | Written in recipe/ |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, registering the bundle, the schema, the routes, the recipes of the kit. |
| Configuration | Every option of phil_library, with an example. |
| Catalogue and search | Titles, records, ISBNs, copies, the search. |
| Loans | Lending, reserving, renewing, returning, losing, the member's limits, the lock, the stockroom link. |
| Reminders and privacy | The reminders and notices, the commands, the history in the privacy requests. |
| Pages | The routes, the templates, the recipes of the kit, the roles, the EasyAdmin links. |
| Extension points | The ports, events and options an application chooses or replaces. |
| Testing | The bundle's tests, its integration suite on MySQL and PostgreSQL, and its mutation bar. |
| Reference | Every type of the bundle, with its role. |
Quick start
composer require phil/library-bundle
# config/packages/phil_library.yaml phil_library: timezone: America/Toronto loans: { days: 21, max_renewals: 2, max_open: 10 } # config/routes/phil_library.yaml phil_library: resource: '@PhilLibraryBundle/config/routes.php' prefix: /library
use Phil\LibraryBundle\Application\Exception\LoanRefused; use Phil\LibraryBundle\Application\Loans; try { $loan = $loans->lend('G-0042', $member); // due at the end of the 21st day } catch (LoanRefused $refused) { $refused->reason; // taken, overdue, limit… } $loans->giveBack('G-0042', CopyCondition::Incomplete, 'Two tiles missing.');
Requirements
PHP 8.5 or later, Symfony 8.2 or later, Doctrine ORM 3.7 and DBAL 4.5 or later, Twig and Symfony UX Twig Components.
symfony/console, symfony/messenger, phil/privacy-bundle, phil/stockroom, phil/stockroom-bundle and EasyAdmin
are optional.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.