Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Cannot redeclare class RedisException in [snip]/lib/Redisent/Redisent.php #19

Closed
ssx opened this issue May 20, 2011 · 11 comments

Comments

@ssx
Copy link

ssx commented May 20, 2011

When downloading and running the demo's against the latest version of redis, I get the above titled exception.

Any ideas?

@Bandit
Copy link

Bandit commented Jun 2, 2011

I get that too.

@ssx
Copy link
Author

ssx commented Jun 11, 2011

Seems it doesn't like the friendly wrapped Exception handler in lib/Redisent/Redisent.php. If you comment out lines 15 and 16, then it'll run the demos without issue.

@chrisboulton
Copy link
Owner

I don't suppose you guys are using php-resque in combination with some sort of framework/library that's already creating its own RedisException class?

I really hate how Redisent hasn't named the class Redisent_Exception - I might look at changing that.

@Bandit
Copy link

Bandit commented Jun 14, 2011

I have PHPRedis installed: https://github.com/nicolasff/phpredis

@chrisboulton
Copy link
Owner

Ah cool - I guess I'll rename the RedisException class to Redisent_Exception or similar then.

@eby
Copy link

eby commented Jul 1, 2011

we're using redisent for other stuff so was looking at setting php-resque to use the external lib. A quick look at commits seems to show that he has integrated most of the fixes you have implemented so might do a pull request for an exception rename.

@cj
Copy link

cj commented Nov 1, 2011

Any update on this?

@ssx
Copy link
Author

ssx commented Nov 7, 2011

Hello,

There was indeed, this commit should fix it:

1a5564d

The issue was with the autoloader loading it twice.

Hope thats helpful.

On 1 Nov 2011, at 22:18, cj wrote:

Any update on this?

Reply to this email directly or view it on GitHub:
#19 (comment)

Scott Wilcox

@dordotky | scott@dor.ky | http://dor.ky
+44 (0) 7538 842418 | +1 (646) 827-0580

@stevencorona
Copy link

I don't think this has been fixed yet, as long as /lib/Redisent/Redisent.php defines a RedisException class, it will still conflict with php-resque and break PHP. I'm all for renaming RedisException to RedisentException (or something similar), but at the very least can we wrap the class definition in a class_exists? i.e,

if (! class_exists('RedisException')) {
  class RedisException extends Exception {
  }
}

@ghost
Copy link

ghost commented Mar 21, 2012

Still having the same issue here. I am also using php-redis in addition

@chrisboulton
Copy link
Owner

Above changes were merged in, which should fix this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants