phil / terms-bundle
Versioned terms of use for Symfony: versions published once and never changed, an append-only record of each acceptance, a gate to accept a new material version, a signup checkbox, renewal and reminders, public versioned pages with their changes, an administration to publish, and who has not accepte
Package info
github.com/parler-haut-interagir-librement/terms-bundle
Type:symfony-bundle
pkg:composer/phil/terms-bundle
Requires
- php: >=8.5
- ext-filter: *
- ext-mbstring: *
- doctrine/dbal: ^4.5
- psr/clock: ^1.0
- psr/event-dispatcher: ^1.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/http-foundation: ^8.2
- symfony/http-kernel: ^8.2
- symfony/routing: ^8.2
- symfony/security-core: ^8.2
- symfony/security-csrf: ^8.2
- symfony/service-contracts: ^3.6
- symfony/translation-contracts: ^3.6
- symfony/ux-twig-component: ^3.7
- twig/twig: ^3.21
Requires (Dev)
- doctrine/doctrine-bundle: ^3.3
- doctrine/orm: ^3.7
- easycorp/easyadmin-bundle: ^5.8
- phil/ip-anonymizer: ^0.1@dev
- phil/legal-notices: ^0.1@dev
- phil/legal-notices-bundle: ^0.1@dev
- phil/notifications-bundle: ^0.1@dev
- phil/privacy-bundle: ^0.1@dev
- phil/text-diff: ^0.1@dev
- phil/ujo: ^0.1@dev
- phil/ux-kit: >=0.5.0-alpha <1.0
- phpunit/phpunit: ^13.4
- psr/log: ^3.0
- symfony/clock: ^8.2
- symfony/console: ^8.2
- symfony/css-selector: ^8.2
- symfony/dom-crawler: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/form: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/messenger: ^8.2
- symfony/options-resolver: ^8.2
- symfony/scheduler: ^8.2
- symfony/translation: ^8.2
- symfony/twig-bridge: ^8.2
- symfony/twig-bundle: ^8.2
- symfony/ux-toolkit: ^3.7.1
- symfony/yaml: ^8.2
- twig/html-extra: ^3.24
Suggests
- doctrine/orm: To add the two tables to the schema the ORM generates, for doctrine:migrations:diff
- easycorp/easyadmin-bundle: For the links of the administration in an EasyAdmin back office
- phil/ip-anonymizer: To keep the network of the address an acceptance came from, never the address itself
- phil/legal-notices-bundle: For phil:terms:check-legal-links, the check that the legal links exist on the site
- phil/notifications-bundle: To tell the members that a new version awaits their acceptance, and to remind them
- phil/privacy-bundle: For the acceptance records in the export and the erasure of a person's data
- phil/text-diff: For the changes between two versions on the public pages
- phil/ujo: For policy texts written as UJO (Universal JSON Output) documents
- phil/ux-kit: For the recipes the pages draw — Alert, Badge, Button, Checkbox, Field, Input, NativeSelect, Table, Textarea —, through the Symfony UX Toolkit; or the same recipes from the Shadcn kit of the Toolkit, on Tailwind
- symfony/console: For phil:terms:outstanding, the list of the members who have not accepted
- symfony/form: For the acceptance checkbox added to a signup form
- symfony/scheduler: For the reminders sent on a schedule
- symfony/translation: For the pages and the administration in English and French
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-16 01:17:59 UTC
README
Versioned terms of use for Symfony: each version published once, each acceptance kept, and a member asked again when the terms change.
phil/terms-bundle keeps the policies a site asks its members to accept — its terms of use, its privacy policy, its
code of conduct — as versions that are published once and never changed: a number, the text of each locale, the moment
it was published, the moment it takes effect, and whether it changes the terms enough that every member must accept it
again. Each acceptance is a record that is only ever added to: who, which version, when, where, and — when the
application wants it — the network the request came from, never the address. A gate sends a signed-in member who has
a material version to accept to a page where each version comes with its own checkbox, never ticked in advance; an API
is answered 403 with a problem in JSON. A signup form gets the same checkbox from one option. An acceptance can be
asked again after some days, and reminders go out on a schedule. One policy can name the licence of the members'
contributions, chosen with each version and dated by its acceptance. Every version keeps a public address, with the
changes from the version before; an administration publishes them, and a command lists who has not accepted.
It is for any site that opens to the public and must show which terms each member accepted, and when.
Status
| Part | State |
|---|---|
| Policies, immutable versions with their locales, moments and material flag | Implemented and tested |
| Acceptances, append-only, with their channel and, optionally, the network | Implemented and tested |
| The gate on every request, the acceptance page, the problem of an API | Implemented and tested, benchmarked |
| The signup checkbox, the version shown checked at submission | Implemented and tested |
| Periodic renewal, reminders on a schedule, notices of a new version | Implemented and tested |
| The licence of the contributions, chosen with a version and dated by its acceptance | Implemented and tested |
| Public versioned pages and the changes between two versions | Implemented and tested |
| The administration in Twig, in English and French, and the EasyAdmin menu | Implemented and tested |
| The pages drawn by the recipes of the PHIL UX kit or the Shadcn kit, each rendered with both in the tests | Implemented and tested |
| The moments kept in UTC, the administration showing them in its time zone | Implemented and tested |
phil:terms:outstanding, phil:terms:check-legal-links, the export and the erasure of the acceptances |
Implemented and tested |
| The Flex recipe: the bundle, its configuration and its routes, and the two classes that name the members | Written in recipe/0.1, for the recipes repository of PHIL |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, registering the bundle, the tables, the recipe, the routes. |
| Configuration | Every option of phil_terms. |
| Policies and versions | Policies, versions, material changes, the moment a version takes effect, the texts. |
| Acceptance | What a member has to accept, the gate, the acceptance page, APIs, the signup form, recording from code. |
| Renewal and reminders | Acceptances asked again, the reminders, the notices of a new version. |
| Contribution licence | The licence of the members' contributions, chosen with a version and dated by its acceptance. |
| Public pages | The versioned addresses, the changes, the cache, the recipes of the kit. |
| Administration | Publishing a version, the role, the token, the layout, EasyAdmin. |
| Console | phil:terms:outstanding and phil:terms:check-legal-links. |
| Personal data | What an acceptance keeps, the network, the export and the erasure. |
| Extension points | The ports, services and options an application chooses or replaces. |
| Testing | The tests, the mutation bar and the benchmark. |
| Reference | Every type of the bundle, with its role. |
Quick start
composer require phil/terms-bundle
# config/packages/phil_terms.yaml phil_terms: locales: [en, fr] policies: terms: ~ privacy: { renew_after_days: 365 } member_resolver: App\Security\MemberId member_source: App\Security\EveryMember admin: { enabled: true, role: ROLE_LEGAL }
# config/routes/phil_terms.yaml phil_terms: resource: '@PhilTermsBundle/config/routes/pages.php' prefix: /terms phil_terms_admin: resource: '@PhilTermsBundle/config/routes/admin.php' prefix: /admin/terms
use Phil\TermsBundle\Application\Terms; use Phil\TermsBundle\Domain\AcceptanceChannel; $terms->publish('terms', ['en' => $english, 'fr' => $french]); $terms->accept($member->id, 'terms', 1, AcceptanceChannel::Api);
Requirements
PHP 8.5 or later, Symfony 8.2 or later, Doctrine DBAL 4.5 or later, Twig 3.21 or later and Symfony UX Twig Component
3.7 or later, with the recipes of the PHIL UX kit — or of the Shadcn kit — installed by the Symfony UX Toolkit.
Doctrine ORM, the console, the form component, the scheduler, the translator, EasyAdmin, phil/ip-anonymizer,
phil/legal-notices-bundle, phil/notifications-bundle, phil/privacy-bundle, phil/text-diff and phil/ujo 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.