本文整理匯總了PHP中Resque::loadConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP Resque::loadConfig方法的具體用法?PHP Resque::loadConfig怎麽用?PHP Resque::loadConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Resque
的用法示例。
在下文中一共展示了Resque::loadConfig方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
public function init()
{
if ($this->configFile !== null) {
\Resque::loadConfig($this->configFile);
}
}
示例2: date_default_timezone_set
* with php-resque. Navigate to /path/to/php-resque/examples/ in your browser
* and you can add some test jobs to see how it all works.
*
* Note that you will also have to run `/path/to/bin/resque worker:start` from
* your command line in order for php-resque to process jobs.
*/
if (!ini_get('date.timezone') or !date_default_timezone_get()) {
date_default_timezone_set('UTC');
}
if (file_exists($file = __DIR__ . '/../vendor/autoload.php')) {
require_once $file;
} else {
echo 'You need to set up the project dependencies using the following commands:' . 'curl -s http://getcomposer.org/installer | php' . 'php composer.phar install';
exit(1);
}
Resque::loadConfig();
$job = false;
if (isset($_GET['action'])) {
switch ($_GET['action']) {
case 'reset':
$redis = Resque\Redis::instance();
$keys = $redis->keys('*');
foreach ($keys as $key) {
$redis->del($key);
}
header('Location: ?');
break;
case 'push':
$job = Resque::push('HelloWorld', array());
break;
case 'delayed':