Compare commits

...

5 commits
2.3.0 ... main

Author SHA1 Message Date
aad9334fba
2.5.3 - Update LOG()
Some checks failed
CI / Linter (push) Has been cancelled
CI / PHPTest (8.1) (push) Has been cancelled
CI / PHPTest (8.2) (push) Has been cancelled
CI / PHPTest (8.3) (push) Has been cancelled
CI / PHPTest (8.4) (push) Has been cancelled
2025-06-08 15:20:22 +12:00
b9042358e1
v2.5.2 add support for psr/log ^1 2025-06-08 14:21:33 +12:00
eb3395645f
v2.5.1 - Update psr/log reqs
Some checks are pending
CI / Linter (push) Waiting to run
CI / PHPTest (8.1) (push) Waiting to run
CI / PHPTest (8.2) (push) Waiting to run
CI / PHPTest (8.3) (push) Waiting to run
CI / PHPTest (8.4) (push) Waiting to run
2025-06-08 13:59:27 +12:00
e3ac97920c
v2.5.0 - Update packages/docs 2025-06-08 13:49:16 +12:00
81fe761577 v3.4.0 - Update packages 2024-12-11 14:31:58 +13:00
11 changed files with 103 additions and 73 deletions

View file

@ -19,7 +19,7 @@ jobs:
container: php:${{ matrix.php_version }} container: php:${{ matrix.php_version }}
strategy: strategy:
matrix: matrix:
php_version: [8.1, 8.2] php_version: [8.1, 8.2,8.3,8.4]
services: services:
redis: redis:
image: redis:7.0 image: redis:7.0

View file

@ -1,3 +1,18 @@
# 2.5.3 (2025-06-08)
- Update typing of Log() to support all psr\log versions
- # 2.5.2 (2025-06-08)
- Update typing of Log() to support all psr\log versions
# 2.5.1 (2025-06-08)
- Update psr/log version requirements
# 2.5.0 (2025-06-08)
- Update packages
# 2.4.0 (2024-12-11)
- Update packages (psr/log ^3.0.2)
# 2.3.0 (2024-09-04) # 2.3.0 (2024-09-04)
- Update packages - Update packages

View file

@ -42,7 +42,7 @@ On top of the original fork (chrisboulton/php-resque) I have added:
## Requirements ## ## Requirements ##
* PHP 7.0+ * PHP 8.1+
* phpredis * phpredis
* Redis 2.2+ * Redis 2.2+
@ -74,7 +74,7 @@ Resque::setBackend('redis:6379');
$args = ['name' => 'TestName']; $args = ['name' => 'TestName'];
Resque::enqueue('default', 'My_Job', $args); Resque::enqueue('default', '\App\MyJobClass', $args);
``` ```
### Defining Jobs ### ### Defining Jobs ###
@ -82,7 +82,9 @@ Resque::enqueue('default', 'My_Job', $args);
Each job should be in its own class, and include a `perform` method. Each job should be in its own class, and include a `perform` method.
```php ```php
class My_Job namespace \App;
class MyJobClass
{ {
public function perform() public function perform()
{ {
@ -105,7 +107,9 @@ The `tearDown` method, if defined, will be called after the job finishes.
```php ```php
class My_Job namespace App;
class MyJobClass
{ {
public function setUp() public function setUp()
{ {
@ -129,17 +133,17 @@ class My_Job
This method can be used to conveniently remove a job from a queue. This method can be used to conveniently remove a job from a queue.
```php ```php
// Removes job class 'My_Job' of queue 'default' // Removes job class '\App\MyJobClass' of queue 'default'
Resque::dequeue('default', ['My_Job']); Resque::dequeue('default', ['\App\MyJobClass']);
// Removes job class 'My_Job' with Job ID '087df5819a790ac666c9608e2234b21e' of queue 'default' // Removes job class '\App\MyJobClass' with Job ID '087df5819a790ac666c9608e2234b21e' of queue 'default'
Resque::dequeue('default', ['My_Job' => '087df5819a790ac666c9608e2234b21e']); Resque::dequeue('default', ['\App\MyJobClass' => '087df5819a790ac666c9608e2234b21e']);
// Removes job class 'My_Job' with arguments of queue 'default' // Removes job class '\App\MyJobClass' with arguments of queue 'default'
Resque::dequeue('default', ['My_Job' => ['foo' => 1, 'bar' => 2]]); Resque::dequeue('default', ['\App\MyJobClass' => ['foo' => 1, 'bar' => 2]]);
// Removes multiple jobs // Removes multiple jobs
Resque::dequeue('default', ['My_Job', 'My_Job2']); Resque::dequeue('default', ['\App\MyJobClass', '\App\MyJobClass2']);
``` ```
If no jobs are given, this method will dequeue all jobs matching the provided queue. If no jobs are given, this method will dequeue all jobs matching the provided queue.
@ -160,7 +164,7 @@ To track the status of a job, pass `true` as the fourth argument to
returned: returned:
```php ```php
$token = Resque::enqueue('default', 'My_Job', $args, true); $token = Resque::enqueue('default', '\App\MyJobClass', $args, true);
echo $token; echo $token;
``` ```

View file

@ -17,7 +17,7 @@
], ],
"require": { "require": {
"php": ">=8.1", "php": ">=8.1",
"psr/log": "^1.1.0", "psr/log": "^1.1 || ^2.0 || ^3.0",
"colinmollenhour/credis": "^1.14.0" "colinmollenhour/credis": "^1.14.0"
}, },
"require-dev": { "require-dev": {

100
composer.lock generated
View file

@ -4,24 +4,24 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "3e6f3671c2543806a8e045bb8386f9cd", "content-hash": "d8e5313006d5c73b54ee6a410b1ad016",
"packages": [ "packages": [
{ {
"name": "colinmollenhour/credis", "name": "colinmollenhour/credis",
"version": "v1.16.1", "version": "v1.17.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/colinmollenhour/credis.git", "url": "https://github.com/colinmollenhour/credis.git",
"reference": "f11a89fd068d3e5db0c2b5a9ba8663bc36162e95" "reference": "f4930b426f6b1238b687a1ffe6ee5af7f835b40a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/colinmollenhour/credis/zipball/f11a89fd068d3e5db0c2b5a9ba8663bc36162e95", "url": "https://api.github.com/repos/colinmollenhour/credis/zipball/f4930b426f6b1238b687a1ffe6ee5af7f835b40a",
"reference": "f11a89fd068d3e5db0c2b5a9ba8663bc36162e95", "reference": "f4930b426f6b1238b687a1ffe6ee5af7f835b40a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.6.0" "php": ">=7.4.0"
}, },
"suggest": { "suggest": {
"ext-redis": "Improved performance for communicating with redis" "ext-redis": "Improved performance for communicating with redis"
@ -49,36 +49,36 @@
"homepage": "https://github.com/colinmollenhour/credis", "homepage": "https://github.com/colinmollenhour/credis",
"support": { "support": {
"issues": "https://github.com/colinmollenhour/credis/issues", "issues": "https://github.com/colinmollenhour/credis/issues",
"source": "https://github.com/colinmollenhour/credis/tree/v1.16.1" "source": "https://github.com/colinmollenhour/credis/tree/v1.17.0"
}, },
"time": "2024-07-04T15:08:03+00:00" "time": "2025-02-10T18:58:46+00:00"
}, },
{ {
"name": "psr/log", "name": "psr/log",
"version": "1.1.4", "version": "3.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/log.git", "url": "https://github.com/php-fig/log.git",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11" "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11", "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.0" "php": ">=8.0.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.1.x-dev" "dev-master": "3.x-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Psr\\Log\\": "Psr/Log/" "Psr\\Log\\": "src"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -99,9 +99,9 @@
"psr-3" "psr-3"
], ],
"support": { "support": {
"source": "https://github.com/php-fig/log/tree/1.1.4" "source": "https://github.com/php-fig/log/tree/3.0.2"
}, },
"time": "2021-05-03T11:20:27+00:00" "time": "2024-09-11T13:17:53+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
@ -255,16 +255,16 @@
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
"version": "1.12.0", "version": "1.13.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/DeepCopy.git", "url": "https://github.com/myclabs/DeepCopy.git",
"reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c",
"reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -303,7 +303,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/myclabs/DeepCopy/issues", "issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1"
}, },
"funding": [ "funding": [
{ {
@ -311,20 +311,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-06-12T14:39:25+00:00" "time": "2025-04-29T12:36:36+00:00"
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v5.1.0", "version": "v5.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" "reference": "ae59794362fe85e051a58ad36b289443f57be7a9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9",
"reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", "reference": "ae59794362fe85e051a58ad36b289443f57be7a9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -367,9 +367,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nikic/PHP-Parser/issues", "issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0"
}, },
"time": "2024-07-01T20:03:41+00:00" "time": "2025-05-31T08:24:38+00:00"
}, },
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
@ -872,16 +872,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.6.20", "version": "9.6.23",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "49d7820565836236411f5dc002d16dd689cde42f" "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95",
"reference": "49d7820565836236411f5dc002d16dd689cde42f", "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -892,11 +892,11 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-xml": "*", "ext-xml": "*",
"ext-xmlwriter": "*", "ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.12.0", "myclabs/deep-copy": "^1.13.1",
"phar-io/manifest": "^2.0.4", "phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1", "phar-io/version": "^3.2.1",
"php": ">=7.3", "php": ">=7.3",
"phpunit/php-code-coverage": "^9.2.31", "phpunit/php-code-coverage": "^9.2.32",
"phpunit/php-file-iterator": "^3.0.6", "phpunit/php-file-iterator": "^3.0.6",
"phpunit/php-invoker": "^3.1.1", "phpunit/php-invoker": "^3.1.1",
"phpunit/php-text-template": "^2.0.4", "phpunit/php-text-template": "^2.0.4",
@ -955,7 +955,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.23"
}, },
"funding": [ "funding": [
{ {
@ -966,12 +966,20 @@
"url": "https://github.com/sebastianbergmann", "url": "https://github.com/sebastianbergmann",
"type": "github" "type": "github"
}, },
{
"url": "https://liberapay.com/sebastianbergmann",
"type": "liberapay"
},
{
"url": "https://thanks.dev/u/gh/sebastianbergmann",
"type": "thanks_dev"
},
{ {
"url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-07-10T11:45:39+00:00" "time": "2025-05-02T06:40:34+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -1938,16 +1946,16 @@
}, },
{ {
"name": "squizlabs/php_codesniffer", "name": "squizlabs/php_codesniffer",
"version": "3.10.2", "version": "3.13.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
"reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" "reference": "65ff2489553b83b4597e89c3b8b721487011d186"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/65ff2489553b83b4597e89c3b8b721487011d186",
"reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", "reference": "65ff2489553b83b4597e89c3b8b721487011d186",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2012,9 +2020,13 @@
{ {
"url": "https://opencollective.com/php_codesniffer", "url": "https://opencollective.com/php_codesniffer",
"type": "open_collective" "type": "open_collective"
},
{
"url": "https://thanks.dev/u/gh/phpcsstandards",
"type": "thanks_dev"
} }
], ],
"time": "2024-07-21T23:26:44+00:00" "time": "2025-05-11T03:36:00+00:00"
}, },
{ {
"name": "theseer/tokenizer", "name": "theseer/tokenizer",
@ -2069,12 +2081,12 @@
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": [], "stability-flags": {},
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=8.1" "php": ">=8.1"
}, },
"platform-dev": [], "platform-dev": {},
"plugin-api-version": "2.6.0" "plugin-api-version": "2.6.0"
} }

View file

@ -22,6 +22,7 @@ class Event
* *
* @param string $event Name of event to be raised. * @param string $event Name of event to be raised.
* @param mixed $data Optional, any data that should be passed to each callback. * @param mixed $data Optional, any data that should be passed to each callback.
*
* @return true * @return true
*/ */
public static function trigger($event, $data = null) public static function trigger($event, $data = null)
@ -49,7 +50,8 @@ class Event
* Listen in on a given event to have a specified callback fired. * Listen in on a given event to have a specified callback fired.
* *
* @param string $event Name of event to listen on. * @param string $event Name of event to listen on.
* @param mixed $callback Any callback callable by call_user_func_array. * @param mixed $callback Any callback callable by call_user_func_array
*
* @return true * @return true
*/ */
public static function listen($event, $callback) public static function listen($event, $callback)
@ -67,6 +69,7 @@ class Event
* *
* @param string $event Name of event. * @param string $event Name of event.
* @param mixed $callback The callback as defined when listen() was called. * @param mixed $callback The callback as defined when listen() was called.
*
* @return true * @return true
*/ */
public static function stopListening($event, $callback) public static function stopListening($event, $callback)
@ -85,8 +88,10 @@ class Event
/** /**
* Call all registered listeners. * Call all registered listeners.
*
* @return void
*/ */
public static function clearListeners() public static function clearListeners(): void
{ {
self::$events = []; self::$events = [];
} }

View file

@ -9,6 +9,7 @@ namespace Resque\Job;
* @author Daniel Mason <daniel@m2.nz> * @author Daniel Mason <daniel@m2.nz>
* @license http://www.opensource.org/licenses/mit-license.php * @license http://www.opensource.org/licenses/mit-license.php
*/ */
class Factory implements FactoryInterface class Factory implements FactoryInterface
{ {
public ?Job $job; public ?Job $job;
@ -16,6 +17,8 @@ class Factory implements FactoryInterface
public array $args; public array $args;
/** /**
* Create job factory
*
* @param $className * @param $className
* @param array $args * @param array $args
* @param $queue * @param $queue

View file

@ -25,9 +25,10 @@ class Log extends \Psr\Log\AbstractLogger
* @param mixed $level PSR-3 log level constant, or equivalent string * @param mixed $level PSR-3 log level constant, or equivalent string
* @param string $message Message to log, may contain a { placeholder } * @param string $message Message to log, may contain a { placeholder }
* @param array $context Variables to replace { placeholder } * @param array $context Variables to replace { placeholder }
*
* @return null * @return null
*/ */
public function log($level, $message, array $context = []) public function log($level, $message, array $context = []): void
{ {
$logLevels = [ $logLevels = [
'emergency', 'emergency',

View file

@ -97,17 +97,6 @@ class Redis
'rename', 'rename',
'rpoplpush' 'rpoplpush'
]; ];
// sinterstore
// sunion
// sunionstore
// sdiff
// sdiffstore
// sinter
// smove
// mget
// msetnx
// mset
// renamenx
/** /**
* Set Redis namespace (prefix) default: resque * Set Redis namespace (prefix) default: resque

View file

@ -12,7 +12,7 @@ namespace Resque;
class Resque class Resque
{ {
public const VERSION = '2.3.0'; public const VERSION = '2.5.3';
public const DEFAULT_INTERVAL = 5; public const DEFAULT_INTERVAL = 5;

View file

@ -97,6 +97,7 @@ class Worker
foreach ($workers as $workerId) { foreach ($workers as $workerId) {
$instances[] = self::find($workerId); $instances[] = self::find($workerId);
} }
return $instances; return $instances;
} }