Page MenuHomePhabricator

Fatal error: Class already declared: OAuthException
Closed, ResolvedPublic

Description

HHVM bundles a port of the OAuth PECL extension by default, and it defines an OAuthException class. Attempting to load Extension:OAuth under HHVM causes a "Class already declared" fatal to be thrown.


Version: master
Severity: normal

Details

Reference
bz66929

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 3:29 AM
bzimport set Reference to bz66929.

Since the PECL extension just extends the default exception with two extra properties (if I understand the code right), which is compatible with the library we're using, I think we can just conditionally define the exception, and everything will work.

Changing the name would be fine, except we already have an MWOAuthException, which has a slightly different usage, and I'd rather not have to refactor those.

Change 141496 had a related patch set uploaded by CSteipp:
Play nice with PECL

https://gerrit.wikimedia.org/r/141496

Change 141608 had a related patch set uploaded by CSteipp:
Add MWOAuth namespace

https://gerrit.wikimedia.org/r/141608

Change 141496 abandoned by CSteipp:
Play nice with PECL

https://gerrit.wikimedia.org/r/141496

Change 141608 merged by Ori.livneh:
Add MediaWiki\Extensions\OAuth namespace

https://gerrit.wikimedia.org/r/141608