Download the PHP package alpixel/cronbundle without Composer
On this page you can find all versions of the php package alpixel/cronbundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cronbundle
CRONBundle
The AlpixelCronBundle is a fork of predakanga/CronBundle which isn't maintained anymore. It provides a Symfony Bundle capable of saving cronjob and running them at given intervals.
Installation
-
Install the package
-
Update AppKernel.php
-
If you use doctrine migrations create new migration
-
or update DB Schema
-
Start using the bundle
- CRON setup
In order to run the symfony cron:run task, you should setup a real cronjob on the server just as follows. This example check the cron scrip every 5 minutes.
Creating a new task
Creating your own tasks with CronBundle couldn't be easier - all you have to do is create a normal Symfony2 Command (or ContainerAwareCommand) and tag it with the @CronJob annotation, as demonstrated below:
The interval spec ("PT1H" in the above example) is documented on the DateInterval documentation page, and can be modified. For your CronJob to be scanned and included in future runs, you must first run app/console cron:scan - it will be scheduled to run the next time you run app/console cron:run
You can also configure the startTime to schedule the first run of the cronjob.
Limitations
Be aware that your cron will be runned by the PHP CLI so your Symfony won't have any information about your website real URL (unless you specified it somewhere). So, for example, if you use the cron to send an email, you can't rely on the "url()" in a twig template since Symfony doesn't know what your domain is.
All versions of cronbundle with dependencies
symfony/symfony Version >=2.7
symfony/console Version >=2.7
doctrine/orm Version ^2.4.8
doctrine/doctrine-bundle Version ~1.4