An open API service indexing awesome lists of open source software.

https://github.com/aurimasniekis/scheduler-bundle

A simple Symfony Job Scheduling Bundle
https://github.com/aurimasniekis/scheduler-bundle

Last synced: 3 months ago
JSON representation

A simple Symfony Job Scheduling Bundle

Awesome Lists containing this project

README

        

# Scheduler Bundle

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE)
[![Build Status][ico-travis]][link-travis]
[![Code Quality][ico-quality]][link-scrutinizer]
[![Code Coverage][ico-coverage]][link-scrutinizer]
[![Mutation testing badge][ico-mutation]][link-mutator]
[![Total Downloads][ico-downloads]][link-downloads]

[![Email][ico-email]][link-email]

A simple scheduler bundle for Symfony which provides a way to execute code at specific cron expressions without
modifying cron tab every time.

## Install

Via Composer

```bash
$ composer require aurimasniekis/scheduler-bundle
```

Add line to `bundle.php`:

```php
['all' => true],
// ...
AurimasNiekis\SchedulerBundle\AurimasNiekisSchedulerBundle::class => ['all' => true],
];
```

Add the scheduler to cron tab to run every minute:

```bash
* * * * * /path/to/symfony/install/bin/console scheduler:run 1>> /dev/null 2>&1
```

## Usage

Scheduler Bundle uses Symfony Container `autoconfigure` feature which automatically registers all services
which implement `ScheduledJobInterface` or `NamedScheduledJobInterface` interface into Scheduler.

To create a scheduled job you have two options either simple Scheduled Job or Named Scheduled Job. First one uses
class name as job name, second provides method to define a job name.

```php
> /dev/null 2>&1
```

## Testing

Run test cases

```bash
$ composer test
```

Run test cases with coverage (HTML format)

```bash
$ composer test-coverage
```

Run PHP style checker

```bash
$ composer cs-check
```

Run PHP style fixer

```bash
$ composer cs-fix
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

## License

Please see [License File](LICENSE) for more information.

[ico-version]: https://img.shields.io/packagist/v/aurimasniekis/scheduler-bundle.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/com/aurimasniekis/scheduler-bundle/master.svg?style=flat-square
[ico-quality]: https://img.shields.io/scrutinizer/quality/g/aurimasniekis/scheduler-bundle?style=flat-square
[ico-coverage]: https://img.shields.io/scrutinizer/coverage/g/aurimasniekis/scheduler-bundle?style=flat-square
[ico-mutation]: https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Faurimasniekis%2Fscheduler-bundle%2Fmaster
[ico-downloads]: https://img.shields.io/packagist/dt/aurimasniekis/scheduler-bundle.svg?style=flat-square
[ico-email]: https://img.shields.io/badge/[email protected]?style=flat-square

[link-travis]: https://travis-ci.com/aurimasniekis/scheduler-bundle
[link-packagist]: https://packagist.org/packages/aurimasniekis/scheduler-bundle
[link-scrutinizer]: https://scrutinizer-ci.com/g/aurimasniekis/scheduler-bundle
[link-mutator]: https://dashboard.stryker-mutator.io/reports/github.com/aurimasniekis/scheduler-bundle/master
[link-downloads]: https://packagist.org/packages/aurimasniekis/scheduler-bundle/stats
[link-email]: mailto:[email protected]