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 w/ Rhumsaa\Uuid\Uuid #44

Closed
adamthehutt opened this issue May 14, 2014 · 1 comment
Closed

Fatal error w/ Rhumsaa\Uuid\Uuid #44

adamthehutt opened this issue May 14, 2014 · 1 comment

Comments

@adamthehutt
Copy link
Contributor

Hi,

My application uses composer to manage dependencies and autoloading. We're currently using the Rhumsaa\Uuid library in a number of places.

Raygun4Php uses the same library, but embeds it in the Raygun4Php code base. This means that we end up with a fatal error when the RaygunClient class is loaded, since on line 6 you've got:

require_once realpath(DIR . '/Uuid.php');

Since my application is already using the Rhumsaa\Uuid library, this results in the same namespace\class being redeclared.

If you want to embed the Rhumsaa\Uuid library inside Raygun4Php, then a better way to do this would be to include it in the Raygun4Php namespace as well. That way, an application that uses both would simply have duplicate code (i.e. Raygun4Php\Rhumsaa\Uuid and Rhumsaa\Uuid) without duplicate class names. This would prevent a fatal error and allow the libraries to peacefully coexist.

Alternatively, you could remove the require_once call and rely on autoloaders to handle the class loading.

Thanks,
Adam

@adamthehutt
Copy link
Contributor Author

I created a pull request for this:
#45

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

1 participant