horde / alarm
Alarm library
v3.0.0beta1
2026-03-30 00:00 UTC
Requires
- php: ^7.4 || ^8
- horde/date: ^3 || dev-FRAMEWORK_6_0
- horde/exception: ^3 || dev-FRAMEWORK_6_0
- horde/horde-installer-plugin: dev-FRAMEWORK_6_0 || ^3 || ^2
- horde/translation: ^3 || dev-FRAMEWORK_6_0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- horde/cli: ^3 || dev-FRAMEWORK_6_0
- horde/db: ^3 || dev-FRAMEWORK_6_0
- horde/log: ^3 || dev-FRAMEWORK_6_0
- horde/mail: ^3 || dev-FRAMEWORK_6_0
- horde/mime: ^3 || dev-FRAMEWORK_6_0
- horde/notification: ^3 || dev-FRAMEWORK_6_0
- horde/serialize: ^3 || dev-FRAMEWORK_6_0
- horde/test: ^3 || dev-FRAMEWORK_6_0
- phpstan/phpstan: ^2
- phpunit/phpunit: ^12 || ^11 || ^10 || ^9
Suggests
- horde/db: ^3 || dev-FRAMEWORK_6_0
- horde/log: ^3 || dev-FRAMEWORK_6_0
- horde/mail: ^3 || dev-FRAMEWORK_6_0
- horde/mime: ^3 || dev-FRAMEWORK_6_0
- horde/notification: ^3 || dev-FRAMEWORK_6_0
This package is auto-updated.
Last update: 2026-03-30 15:51:10 UTC
README
Modern alarm/notification system for PHP 8.1+.
Usage
use Horde\Alarm\AlarmConfig; use Horde\Alarm\AlarmManager; use Horde\Alarm\SqlStorage; use Horde\Alarm\MailHandler; use Horde\Alarm\NotificationMethod; // Storage backend $storage = new SqlStorage($db); $storage->set(new AlarmConfig( id: 'meeting', user: 'john@example.com', start: new Horde_Date('2026-04-01 14:00'), methods: [NotificationMethod::Mail], title: 'Team Meeting' )); // Alarm manager with handlers $manager = new AlarmManager($storage); $manager->addHandler(new MailHandler($identityFactory, $transport, $storage)); $manager->notify('john@example.com');
Features
- Type-safe: Full PHP 8.1 strict types, enums, readonly properties
- Modern: PSR-4 namespace, constructor promotion, value objects
- Flexible: Multiple storage backends (memory, SQL) and notification methods
- Tested: 142 tests, 217 assertions, full PHPUnit 11+ compatibility
Install
composer require horde/alarm
Documentation
doc/ALERTS.md- Alarm vs Notification vs Log subsystemsdoc/TESTING.md- Test organization and running testsdoc/INTEGRATIONTEST.md- Running integration testsdoc/UPGRADING.md- Migration guide from lib/ 2.x PSR-0 to src/ 3.0 PSR-4
License
LGPL-2.1-only