box4b/systembundle

The System Wrapper Bundle

Installs: 127

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.0.10 2017-04-25 13:36 UTC

This package is not auto-updated.

Last update: 2024-10-12 20:28:35 UTC


README

Bind Linux System Events (cron, init) with Symfony Event.

Configuration

###AppKernel

add this to your registerBundles() on AppKernel :

new box4b\SystemBundle\SystemBundle()

###For Cron

Create a /etc/cron.d/box4bsystem file containing :

* * * * *	[YOUR_USER]	/usr/bin/php [PATH_TO_SYMFONY_PROJECT]/app/console box4b:cron --env=prod > /dev/null 2> /dev/null

###For Init / Systemd

Create a file calling /usr/bin/php [PATH_TO_SYMFONY_PROJECT]/app/console box4b:init [start|stop]

Usage

Use Symfony Event Listener System to listen for events :

###Init

  • box4b\SystemBundle\Event\InitEvent::EVENT_START
  • box4b\SystemBundle\Event\InitEvent::EVENT_STOP

###Cron

  • box4b\SystemBundle\Event\CronEvent::EVERY_MINUTE
  • box4b\SystemBundle\Event\CronEvent::EVERY_FIVE_MINUTES
  • box4b\SystemBundle\Event\CronEvent::EVERY_HOUR
  • box4b\SystemBundle\Event\CronEvent::EVERY_DAY
  • box4b\SystemBundle\Event\CronEvent::EVERY_WEEK

Enjoy :)