2017 © Pedro Peláez
 

symfony-bundle heroku-scheduler-bundle

Symfony HerokuSchedulerBundle

image

mczolko/heroku-scheduler-bundle

Symfony HerokuSchedulerBundle

  • Thursday, May 19, 2016
  • by mczolko
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,805 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:, (*1)

$ 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., (*2)

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:, (*3)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new mCzolko\HerokuSchedulerBundle\mCzolkoHerokuSchedulerBundle(),
        );

        // ...
    }

    // ...
}

Setup the Scheduler on Heroku

Install the addon: https://elements.heroku.com/addons/scheduler, (*4)

Open it and fill these values:, (*5)

Heroku Scheduler, (*6)

That's it. See Events.php file for available events which you can handle inside your app., (*7)

Note: In Symfony3 console is nolonger in app folder. Use php bin/console instead., (*8)

Usage

Create a event subscriber (or listener) for scheduler events. And do whatever you want. Freedom., (*9)

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
    }
}

The Versions

19/05 2016

dev-master

9999999-dev

Symfony HerokuSchedulerBundle

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

heroku scheduler

17/03 2016

v1.0.0

1.0.0.0

Symfony HerokuSchedulerBundle

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

heroku scheduler

17/03 2016

v0.0.1

0.0.1.0

Symfony HerokuSchedulerBundle

  Sources   Download

MIT

The Requires

  • php >=5.3.9

 

heroku scheduler