Fatal error w/ Rhumsaa\Uuid\Uuid
Closed this issue · 1 comments
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
I created a pull request for this:
#45