Download the PHP package deploy-dog/slavedriver without Composer

On this page you can find all versions of the php package deploy-dog/slavedriver. 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 slavedriver

Slavedriver

A PHP based cron job runner. Manage, monitor, log and react to problems with your scheduled tasks. Created by the team at deploy.dog initially for internal use, but modified and released for other to enjoy too. Created by deploy.dog initially for internal use, but released for others to enjoy too.

Travis CI Packagist Packagist Packagist Packagist PHP 7 ready

deploy.dog - Finally, website deployments done right!

Requirements

Installation (via Composer obviously)

Usage

Create your file which describes your jobs.

We suggest using a file named slavedriver.php in the project root, and that's what we'll be using in this example.

A more detailed example of this file can be seen here, but the basics are below

Running Slavedriver

You need to get something (e.g. the real system crontab) to run your Slavedriver file every 1 minute (this time internal is important, don't change it).

Events

Events are dispatched throughout the process which you can listen to. You can use any PSR-14 (Event Manager) compatible event manager. PSR-14 is currently at the "proposed" stage so we should expect it to change. We'd recommend using phossa2/event as your PSR-14 event manager if you don't have one currently and don't want to implement your own. As PSR-14 is not out yet, we require a class which implements Phossa2\Event\Interfaces\EventManagerInterface so if you don't want to use phossa2/event you can write something else which implements that same class. Not ideal, I know, and we expect to change this in v2 when PSR-14 is approved.

You can listen to the follow events to monitor your Slavedriver jobs and act accordingly.

Hint: Use the Job's CustomData if you want to pass through additional data, such as whether to wake people up in the night if the job fails!

Catching events

Handling specific events

Handling all Slavedriver events

Slavedriver itself started (should be roughly every 1 minute)

Job started

Job finished successfully

Job finished with error (based on exit code)

Job stdOut data (this is called every few seconds with additional data)

Job stdErr data (this is called every few seconds with additional data)

Job was still running when the timeout value was hit (and it will have been killed)

Job should have been started but the last instance was still running and they cannot overlap

Job still running but expected runtime has elapsed (job not killed)

Logging

Logging is provided by any PSR-3 compatible logger. You can provider custom log levels for different messages if you wish, or leave the leave the log levels at the defaults which are sensible. To setup logging, call the setLogger() method on the Slavedriver object, passing in the PSR-3 logger and optionally the log levels.

Or with custom log levels (e.g. override the ErrorExitCode log level to alert)

Exceptions

All exceptions thrown by Slavedriver extend the base Slavedriver exception deploydog\Slavedriver\Exception\Slavedriver which extends the base PHP exception \Exception. Different Slavedriver exceptions are thrown for different reasons, for example InvalidJob and InvalidSlavedriverConfig. Check the Exceptions directory for the possible options.


All versions of slavedriver with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
psr/simple-cache Version ^1.0
psr/log Version ^1.0
dragonmantank/cron-expression Version ^2.0.0
malkusch/lock Version *
cocur/slugify Version *
phossa2/event Version ^2.1.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 deploy-dog/slavedriver contains the following files

Loading the files please wait ....