Download the PHP package okvpn/cron-bundle without Composer

On this page you can find all versions of the php package okvpn/cron-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cron-bundle

Okvpn - Cron Bundle

This bundle provides interfaces for registering and handle scheduled tasks within your Symfony application.

Latest Stable Version Total Downloads Latest Unstable Version License

Purpose

This is a simpler alternative of existing cron bundle without doctrine deps. Here also added support middleware for customization handling cron jobs across a cluster install: (Send jobs to message queue, like Symfony Messenger; locking; etc.). This allows to limit the number of parallel running processes and prioritized it.

Features

Table of Contents

Install

Install using composer:

For Symfony 4+ add bundle to config/bundles.php

Quick Usage

You can use AsCron or AsPeriodicTask attribute for autoconfigure.

Commands

Runs the current cron schedule

Debug and execute cron jobs manually and show list

Dry run cron tasks.

Cron Expression

A CRON expression syntax was take from lib dragonmantank/cron-expressions

Also, it was extent with @random to avoid running things at midnight or once an hour at XX:00. Most people do so and same services have traffic peaks every hour.

Examples:

First way. Install system crontab

To regularly run a set of commands from your application, configure your system to run the oro:cron command every minute. On UNIX-based systems, you can simply set up a crontab entry for this:

Second way. Using supervisor

Setup Supervisor to run cron on demand.

Create a new supervisor configuration.

Add the following lines to the file.

Registration a new scheduled task

To add a new scheduled task you can use tag okvpn.cron or using autoconfigure with interface Okvpn\Bundle\CronBundle\CronSubscriberInterface.

Services.

If you use the default configuration, the corresponding service will be automatically registered thanks to autoconfigure. To declare the service explicitly you can use the following snippet:

Possible options to configure with tags are:

Symfony console command

Via configuration / shell commands

Full Configuration Reference

Handle Cron Jobs via Symfony Messenger

To limit the number of parallel running processes you can handle the cron jobs in the queue using Symfony Messenger.

  1. Install Symfony Messenger
  2. Enable default route for cron job

  3. Enable Messenger for cron.

More information how to use messenger here

Your own Scheduled Tasks Loaders

You can create custom tasks loaders, see example

And register your loader.

Handling cron jobs across a cluster or custom message queue

You can use the cron $group to split many scheduled tasks between clusters, see example:

See example of customization one, two

Use ReactPHP EventLoop

You can add your own periodic tasks directly to Loop. The bundle uses a simple wrapper Okvpn\Bundle\CronBundle\Runner\ScheduleLoopInterface for the library react/event-loop

Configure ReactPHP adapter

Need to install react/event-loop if you want to use with async I/O, for example for handle websockets, redis.

License

MIT License.


All versions of cron-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
symfony/framework-bundle Version ^4.4 || ^5.4 || ^6.0 || ^7.0
dragonmantank/cron-expression Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package okvpn/cron-bundle contains the following files

Loading the files please wait ....