Search by

omnibase's demonstration, a package a site installs or not: the `demo` environment - declared accounts one per role, reset every night (demo:reset), the sign-in page's note, a back office kept to its own accounts, no page indexed, no e-mail sent -, its classes under omnibase's Base\ names (Base\Demo

v1.0.3 2026-12-02 03:06 UTC

This package is not auto-updated.

Last update: 2026-12-02 07:08:47 UTC


README

omnibase's demonstration as a package a site installs or not: APP_ENV=demo runs the site as a demonstration - production's behaviour, a database of its own, accounts that are always there (one for each role of the trade), reset every night - and keeps from its visitors what a public demonstration must keep: no page indexed, no e-mail sent, a back office open to its own accounts alone.

composer require omnibridge/demo

It was omnisense/omnibase's until 8.0, which moved it out (a decision of Marco's: a site that is no demonstration carries nothing of it). Its classes keep omnibase's names, the portable Base\ + App\ convention:

  • Base\Demo\*: DemoMode (the demo environment), DemoAccount, DemoAccountProviderInterface (what a bundle or the application declares), DemoAccountRegistry, DemoAccountFactory (the declarations as rows), DemoAccountLock (what an account keeps), DemoGuard (no debug, never the production database), DemoSecrets (what an account signs in with), DemoSwitches (the back office's « Démonstration » screen), DemoSafeguards (indexing, e-mails, the back office), DemoSignIn (the one-click sign-in's rule);
  • Base\Auth\DemoPasswords (omniauth's passwords in a demonstration), Base\View\Demo and Base\Twig\Extension\DemoTwigExtension (demo_mode(), demo_accounts(), demo_sign_in_accounts(), demo_identifier_passwords()), Base\Console\Task\DemoReset (demo:reset), Base\Exception\DemoRefusedException;
  • the templates @Base/demo/_notice.html.twig (the sign-in page's note), _accounts.html.twig (its former name) and _banner.html.twig, rewritten by a site under templates/bundles/BaseBundle/demo/; the demo catalogue;
  • the options base.demo.* (src/Resources/options.php), which the core's schema reads where the package is installed, and its services (src/Resources/services/demo.php), the core's group "demo".

The package is framework-free. What a framework answers - its events, its sign-in form, its console, its routes - is hooked by its bridge where the package is installed, guarded by class_exists(): omnibridge/symfony (the subscribers, the one-click route, demo:reset, the guard at boot), omnibridge/laravel (the middleware, the mail transport, the one-click route, demo:reset), omnibridge/doctrine and omnibridge/eloquent (the account lock on their unit of work), omnipack/admin (the « Démonstration » screen, the banner). Each piece has one owner: the rules here, each host's glue in its bridge.

On or off is the package itself, like a debug bundle: the demonstration is on where omnibridge/demo is installed and the site runs APP_ENV=demo, and nowhere else. composer remove omnibridge/demo turns it off - the site, in demo too, then has nothing of it: no banner nor note, no header, its e-mails sent, its back office as usual, no demo:reset, no « Démonstration » screen. Install it only on the sites that are shown as a demonstration. Which declared accounts may sign in is the back office's « Démonstration » screen (DemoSwitches).

The documentation: docs/demo.md.

Tests

The kernel tests boot the host application - the omnibase harness (demo test, this package mounted over vendor/omnibridge/demo, HARNESS_SUITE_BOOTSTRAP=vendor/omnibridge/demo/tests/bootstrap.php) or a site's suite - and are skipped without it; the others run alone.