2017 © Pedro Peláez
 

symfony-bundle cron-bundle

Manage dynamically crons with requests in your PHP site.

image

valentinmari/cron-bundle

Manage dynamically crons with requests in your PHP site.

  • Friday, June 26, 2015
  • by valentinmari
  • Repository
  • 1 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Installation

  1. Download CronBundle using composer
  2. Enable the Bundle
  3. Define crons in your config

Step 1: Download CronBundle using composer

Add CronBundle by running the command:, (*1)

``` bash $ php composer.phar require valentinmari/cron-bundle "dev-master", (*2)


Composer will install the bundle to your project's `vendor/valentinmari` directory. ### Step 2: Enable the bundle Enable the bundle in the kernel: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new CronBundle\CronBundle(), ); }

Step 3: Define crons in your config

Your site is ready to run crons. Now, write them in the config.yml file. It's recommended put all crons in a new file named cron.yml in your config folder., (*3)

#app/config.yml
imports:
    # ...
    - { resource: cron.yml }

```yaml, (*4)

app/cron.yml

cron: - { format: '/1 * * * *', service: test_job } - { format: '/1 * * * *', service: test_job }, (*5)


The format is like Cron, from Unix. You must define a service, this service must implement `JobInterface` and redefine the run() method. Inside run() you can put your Job and do anything you want. You can inject things in your service too. ```php // AppBundle/Services/YourJob.php namespace AppBundle\Services; use CronBundle\JobInterface; class YourJob implements JobInterface{ public function run(){ // Do your stuff. } }

The Versions

26/06 2015

dev-master

9999999-dev

Manage dynamically crons with requests in your PHP site.

  Sources   Download

GPL-2.0

The Requires

 

cron

04/06 2015

v0.1

0.1.0.0

Manage dynamically crons with requests in your PHP site.

  Sources   Download

GPL-2.0

The Requires

 

cron