geoPHP icon indicating copy to clipboard operation
geoPHP copied to clipboard

Collection namespace too common

Open dortheimer opened this issue 11 years ago • 8 comments

Complex project have many dependancies, so the class name "Collection" might collide with other classes. This is an example error message: Fatal error: Cannot redeclare class Collection in /project/vendor/phayes/geophp/lib/geometry/Collection.class.php on line 293 This issue can be fixed in two ways:

  1. Using a certain namespace for the library.
  2. Prefixing the classes.

dortheimer avatar Dec 23 '13 20:12 dortheimer

This library needs some PSR-* :)

alexweber avatar Feb 12 '14 19:02 alexweber

+1

Experiencing this issue integrating into another codebase. Working on implementing a new namespace for the project.

brendanvinson avatar Jul 15 '15 14:07 brendanvinson

Hi,

What is the status for supporting at least PSR-0? This awesome lib seems unusable in modern projects without a proper namespacing.

Thanks!

winzou avatar Sep 28 '15 03:09 winzou

Was anyone able to use this inside Laravel?

jadjoubran avatar Oct 13 '15 18:10 jadjoubran

@jadjoubran We have just wrapped this in a simple package for laravel...

https://github.com/spinen/laravel-geometry

It is not done yet as we are going to wrap the adapters & geometries in namespaces classes, but it is a start. Hopefully it will be a little help to you...

jimmypuckett avatar Nov 10 '15 12:11 jimmypuckett

@jimmypuckett wow awesome! Thanks

puts contributor hat on

jadjoubran avatar Nov 10 '15 15:11 jadjoubran

+1 Was seriously looking at using this library until I found, to my surprise, it didn't use namespaces. Hopefully this can come in a future release.

jamespole avatar Jan 13 '17 11:01 jamespole

Several forks of this repo use namespaces (including mine). I tried to contact the author if its worth preparing the PR, but with no response.

mishal avatar Jan 13 '17 11:01 mishal