Skip to content

Commit

Permalink
Merge branch 'stephpy-fixes'
Browse files Browse the repository at this point in the history
Conflicts:
	composer.json
  • Loading branch information
snc committed Jun 2, 2012
2 parents 8a213a1 + 0de6387 commit 656cc63
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
composer.lock
composer.phar
vendor
14 changes: 11 additions & 3 deletions Tests/Doctrine/Cache/RedisCacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,18 @@ class RedisCacheTest extends CacheTest

public function setUp()
{
$config = 'tcp://127.0.0.1:6379';

if (class_exists('\Predis\Client')) {
$config = 'tcp://127.0.0.1:6379';
$this->_redis = new \Predis\Client($config);
} elseif (class_exists('\Redis')) {
$this->_redis = new \Redis();
$this->_redis->connect($config);
} else {
$this->markTestSkipped(sprintf('The %s requires the predis library or phpredis extension.', __CLASS__));
}

if (null !== $this->_redis) {
try {
$ok = $this->_redis->ping();
} catch (\Exception $e) {
Expand All @@ -31,15 +40,14 @@ public function setUp()
if (!$ok) {
$this->markTestSkipped(sprintf('The %s requires a redis instance listening on %s.', __CLASS__, $config));
}
} else {
$this->markTestSkipped(sprintf('The %s requires the predis library.', __CLASS__));
}
}

protected function _getCacheDriver()
{
$driver = new RedisCache();
$driver->setRedis($this->_redis);

return $driver;
}
}
2 changes: 1 addition & 1 deletion Tests/autoload.php.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

$vendorDir = __DIR__ . '/../vendor';
$loader = require $vendorDir . '/.composer/autoload.php';
$loader = require $vendorDir . '/autoload.php';
$loader->add('Doctrine\\Tests', $vendorDir . '/doctrine/common/tests');
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
"homepage": "https://github.com/snc/SncRedisBundle/contributors"
}],
"require": {
"php": ">=5.3.2",
"php": ">=5.3.3",
"symfony/framework-bundle": "2.1.*",
"symfony/yaml": "2.1.*",
"predis/predis": "0.7.*"
"symfony/yaml": "2.1.*"
},
"require-dev": {
"doctrine/common": "2.2.*"
"doctrine/common": "2.2.*",
"predis/predis": "0.7.*"
},
"suggest": {
"monolog/monolog": "If you want to use the monolog redis handler."
"monolog/monolog": "If you want to use the monolog redis handler.",
"predis/predis": "If you want to use predis (currently only v0.7.x is supported)."
},
"autoload": {
"psr-0": { "Snc\\RedisBundle": "" }
Expand Down

0 comments on commit 656cc63

Please sign in to comment.