Download the PHP package softwarepunt/php-resque without Composer

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

php-resque

php-resque is a Redis-based library for enqueuing and running background jobs.

This is a lightly maintained fork of chrisboulton/php-resque, with fixes and improvements, compatible with PHP 8.2+.

⚠️ Not recommended for new projects. We are only maintaining this for legacy projects.

Installation

Add the package with composer:

Usage

Configuration

If you are not using default Redis configuration, set the backend manually:

Define jobs

Each job should be in its own class, and include a perform method:

Enqueue jobs

Jobs instances are placed in specific queues with a set of context data (args):

Dequeue jobs

Jobs can be removed from queues:

Workers

Start a worker with the QUEUE environment variable to begin processing jobs from that queue:

Environment variables

You can set the following environment variables on the worker:

Name Description
QUEUE Required. Defines one or more comma-separated queues to process tasks from. Set to * to process from any queue.
APP_INCLUDE Optional. Defines a bootstrap script to run before starting the worker.
PREFIX Optional. Prefix to use in Redis.
COUNT Optional. Amount of worker forks to start. If set to > 1, the process will start the workers and then exit immediately.
SCHEDULE Optional. An expression with a from/until time, e.g. 22:00-06:00 to only run tasks between 10pm and 6am. The worker is paused outside of the schedule. Relative to default timezone (date_default_timezone_set).
VERBOSE Optional. Forces verbose log output.
VVERBOSE Optional. Forces detailed verbose log output.

Events

You can listen for specific events to track status changes:

$callback may be anything in PHP that is callable by call_user_func_array.

Name Description Event arguments
beforeFirstFork Called once, as a worker initializes. Resque_Worker $worker
beforeFork Called before php-resque forks to run a job. Resque_Job $job
afterFork Called after php-resque forks to run a job (but before the job is run). Resque_Job $job
beforePerform Called once per job run, before setUp and perform. Resque_Job $job
afterPerform Called once per job run, after perform and tearDown. Resque_Job $job
onFailure Called whenever a job fails. Exception $ex, Resque_Job $job
beforeEnqueue Called before a job has been queued using enqueue. string $class, ?array $args, string $queue, string $id
afterEnqueue Called after a job has been queued using enqueue. string $class, ?array $args, string $queue, string $id

Advanced

Getting self job info

You can get the ID, queue, etc. from within an executing job:


All versions of php-resque with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-pcntl Version *
colinmollenhour/credis Version dev-master
psr/log Version ~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 softwarepunt/php-resque contains the following files

Loading the files please wait ....