2017 © Pedro Peláez
 

library croncom

image

sw2/croncom

  • Monday, November 16, 2015
  • by Lupo112
  • Repository
  • 0 Watchers
  • 0 Stars
  • 15 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Croncom

Description

Simple tool which helps with maintenance of cron tasks. Croncom = cron commands., (*1)

WARNING: This is not stable release! Do not use it on production!, (*2)

It requires PHP >= 5.5, Nette Framework and Kdyby Console., (*3)

Usage

1) Add extension Sw2\Croncom\DI\CroncomExtension, for more information about configuration see the class definition., (*4)

extension:
    croncom: Sw2\Croncom\DI\CroncomExtension

2) Define your tasks:, (*5)

/**
 * @cron  *\5  *  *  *  *
 */
class MyCoolTask extends Sw2\Croncom\Task
{
    // here i can use injects and black magic

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        // do some awesome work
    }

}

3) Add it to runner:, (*6)

croncom:
    tasks:
        - Namespace\To\MyCoolTask

4) Set crontab on your server for * * * * * for command php www/index.php app:cron, (*7)

5) Enjoy!, (*8)

Annotations

@cron

This anotation is required for automatic running. Define it as you know it from linux., (*9)

If you want to define e.g. */5 (every 5 minutes), use backslash e.g. *\5. Try it... you will know why., (*10)

Credits

Dependent on Kdyby/Console - this extension is here to provide integration of Symfony Console into Nette Framework., (*11)

Inspired by stekycz/Cronner - great idea, look at it if you want to solve cron tasks on production. His project is more mature., (*12)

Look also on mtdowling/cron-expression - it is used on annotation processing. See for more information about definition of cron task., (*13)

License

BSD, (*14)

The Versions

16/11 2015

dev-master

9999999-dev

  Sources   Download

BSD

The Requires

 

by Lukas Povoda

16/11 2015

v0.9.0

0.9.0.0

  Sources   Download

BSD

The Requires

 

by Lukas Povoda