Download the PHP package yalesov/zf2-cron without Composer

On this page you can find all versions of the php package yalesov/zf2-cron. 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 zf2-cron

zf2-cron

Build Status

ZF2 cron module

This module serves as a central cron runner. It allows you to register a cron job in your ZF2 app; these jobs will be aggregated and run together. This allows you to maintain only a single entry in your crontab, while maintaining as many cron jobs as needed in the ZF2 app.

Installation

Composer:

Then add Yalesov\Cron to the modules key in (app root)/config/application.config.*

Cron module will also hook onto your application's database, through DoctrineORMModule. It will create a single table, he_cron_job, and will use the default EntityManager doctrine.entitymanager.orm_default. If your settings are different, please modify the doctrine section of config/module.config.yml and instances of doctrine.entitymanager.orm_default in Yalesov\Cron\Controller\CronController as needed.

Finally, you need to update your database schema. The recommended way is through Doctrine's CLI:

Features

Config

Copy config/cron.local.php.dist to (app root)/config/autoload/cron.local.php, and modify the settings.

Usage

Add a cron job

Run Foo::runCron('bar', 'baz') every 15 minutes, with the identifier foo.

Function signature:

$code is a unique identifier for the job. It allows for later job overwriting, retrieval of Jobs by identifier, filtering, etc.

$frequency is any valid cron expression, in addition supporting:

$callback is any valid PHP callback.

$args (optional) are the arguments to the callback. The cron job will be called with call_user_func_array, so $args[0] will be the first argument, $args[1] the second, etc.

Run the cron jobs

In order to actually run the cron jobs, you will need to setup a (real) cron job to trigger the Cron module. It will then run your registered cron jobs at their specified frequencies, retrying and logging as specified.

Recommended: set up a cron job and run the ZF2 app through CLI:

Fallback: if the above doesn't work, you can always run it through a browser (or through lynx, wget, etc)

Security: this will not expose any of your cron data or error outputs to any end-user. The controller will immediately close the connection, send an empty response, and continue running the cron jobs as background.

Retrieving logs; advanced use cases

You can interact with individual cron jobs through the Doctrine 2 ORM API. The Cron module only defines a single Entity Yalesov\Cron\Entity\Job:

Example: retrieve all error messages of the cron job foo:


All versions of zf2-cron with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
yalesov/yaml Version 2.*
zendframework/zendframework Version 2.*
yalesov/arg-validator Version 2.*
yalesov/background-exec Version 2.*
yalesov/zf2-doctrine Version 2.*
yalesov/cron-expr-parser Version 2.*
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 yalesov/zf2-cron contains the following files

Loading the files please wait ....