locomotivemtl / charcoal-contrib-notification
Admin notification module.
Requires
- php: >=5.6.0 || >=7.0
- locomotivemtl/charcoal-admin: >=0.15.7
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ^5.7 || ^6.5
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-12-07 02:15:22 UTC
README
Admin notification service.
Table of Contents
Installation
The preferred (and only supported) method is with Composer:
$ composer require locomotivemtl/charcoal-contrib-notification
Dependencies
Required
- PHP 5.6+: PHP 7 is recommended.
- locomotivemtl/charcoal-admin >=0.15.7
PSR
- PSR-7: Common interface for HTTP messages. Fulfilled by Slim.
- PSR-11: Common interface for dependency containers. Fulfilled by Pimple.
Configuration
In your project's config file, require the notification module :
{ "modules": { "charcoal/notification/notification": {} } }
Usage
Define notifiable objects with object/collection?obj_type=charcoal/notification/notification-target
Setup your notifications via object/collection?obj_type=charcoal/notification/notification
Set the cron jobs as follow:
// Daily (8 stands for 8am)
0 8 * * * cd /[project]/web && /usr/local/bin/php /[project]/web/vendor/bin/charcoal admin/notification/daily
// Hourly
0 * * * * cd /[project]/web && /usr/local/bin/php /[project]/web/vendor/bin/charcoal admin/notification/hourly
// Every minute
* * * * * cd /[project]/web && /usr/local/bin/php /[project]/web/vendor/bin/charcoal admin/notification/minute
// Monthly (8 stands for 8am)
0 8 1 * * cd /[project]/web && /usr/local/bin/php /[project]/web/vendor/bin/charcoal admin/notification/montly
// Weekly (8 stands for 8am, 1 stands for monday)
0 8 * * 1 cd /[project]/web && /usr/local/bin/php /[project]/web/vendor/bin/charcoal admin/notification/weekly
Development
To install the development environment:
$ composer install
To run the scripts (phplint, phpcs, and phpunit):
$ composer test
API Documentation
- The auto-generated
phpDocumentor
API documentation is available at:
https://locomotivemtl.github.io/charcoal-contrib-notification/docs/master/ - The auto-generated
apigen
API documentation is available at:
https://codedoc.pub/locomotivemtl/charcoal-contrib-notification/master/
Development Dependencies
- [php-coveralls/php-coveralls][phpcov]
- [phpunit/phpunit][phpunit]
- [squizlabs/php_codesniffer][phpcs]
Coding Style
The charcoal-contrib-notification module follows the Charcoal coding-style:
- PSR-1
- PSR-2
- PSR-4, autoloading is therefore provided by Composer.
- phpDocumentor comments.
- phpcs.xml.dist and .editorconfig for coding standards.
Coding style validation / enforcement can be performed with
composer phpcs
. An auto-fixer is also available withcomposer phpcbf
.
Credits
License
Charcoal is licensed under the MIT license. See LICENSE for details.