Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require mczolko/heroku-scheduler-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new mCzolko\HerokuSchedulerBundle\mCzolkoHerokuSchedulerBundle(),
);
// ...
}
// ...
}
Install the addon: https://elements.heroku.com/addons/scheduler
Open it and fill these values:
That's it. See Events.php file for available events which you can handle inside your app.
Note: In Symfony3 console is nolonger in app folder. Use php bin/console
instead.
Create a event subscriber (or listener) for scheduler events. And do whatever you want. Freedom.
use mCzolko\HerokuSchedulerBundle\Events;
class HerokuSchedulerSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
Events::TEN_MINUTES => 'tenMinutes',
Events::HOURLY => 'hourly',
Events::DAILY => 'daily'
];
}
public function tenMinutes()
{
// Check notifications on your Apple watch
}
public function hourly()
{
// Send message at least one hot chick on Badoo
}
public function daily()
{
// https://www.youtube.com/watch?v=lxptFSJJ14Y
}
}