forked from vend/php-resque
-
Notifications
You must be signed in to change notification settings - Fork 4
/
cli-config.php
45 lines (37 loc) · 1.22 KB
/
cli-config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
declare(strict_types=1);
/**
* CLI Config file
*
* This file is sourced by the Resque command line tools. It should be copied out to the project that wants to use
* Resque, and modified to suit. The only important thing is that this file returns a HelperSet, with a 'redis' helper,
* so that Resque can talk to your Redis instance.
*/
/*
* Configure your application's bootstrap/autoloading here. If
* you're just using Composer, this should be enough to give
* you access to your application's classes.
*/
(@include_once __DIR__ . '/vendor/autoload.php') || @include_once __DIR__ . '/../../autoload.php';
/*
* Configure the client however you'd like, here. Or, you could
* grab it from your application's service/injection container.
*/
use Predis\Client;
use Resque\Client\ClientInterface;
use Resque\Console\ConsoleRunner;
/* @var ClientInterface $predis */
$predis = new Client(
[
'scheme' => 'tcp',
'host' => '127.0.0.1',
'port' => 6379,
]
);
/*
* You can optionally customize the PSR3 logger used on the CLI. The
* default is the Console component's ConsoleLogger
*
* $logger = new Monolog\Logger('resque');
*/
return ConsoleRunner::createHelperSet($predis/*, $logger*/);