Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from rolies106/master
Browse files Browse the repository at this point in the history
Some enhancement
  • Loading branch information
wa0x6e committed Sep 18, 2013
2 parents a376581 + 8d369ac commit 5ba56c9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ node_modules/
composer.lock
composer.phar
vendor/
src/ResqueBoard/cache/*
src/ResqueBoard/cache/*

*.DS_Store
*Thumbs.db
*~
3 changes: 2 additions & 1 deletion src/ResqueBoard/Config/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
$settings = array(
'cubePublic' => array(
'host' => $_SERVER['SERVER_NAME'],
'host' => (isset($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : 'http://localhost:1081/',
'port' => 1081
),
'readOnly' => true,
Expand All @@ -50,6 +50,7 @@
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
'password' => '',
'prefix' => 'resque'
),
'Mongo' => array(
Expand Down
6 changes: 6 additions & 0 deletions src/ResqueBoard/Lib/Service/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public function __construct($settings)

try {
$redis->connect($settings['host'], $settings['port']);

if (isset($settings['password']) && !empty($settings['password'])) {
if ($redis->auth($settings['password']) === false) {
throw new \Exception('Unable to authenticate with redis!');
}
}
} catch (\Exception $e) {
throw new \Exception('Unable to connect to Redis server');
}
Expand Down
4 changes: 4 additions & 0 deletions tests/ResqueBoard/Lib/Resque/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

namespace ResqueBoard\Test\Lib\Resque;

# Include configuration files
require_once(dirname(__FILE__) . '/../../../../src/ResqueBoard/Config/Bootstrap.php');
require_once(dirname(__FILE__) . '/../../../../src/ResqueBoard/Config/Core.php');

/**
* ApiTest Class
*
Expand Down

0 comments on commit 5ba56c9

Please sign in to comment.