Gregwar / Image

A PHP library to handle images
MIT License
1k stars 191 forks source link

Fixed namespace #17

Closed barryvdh closed 11 years ago

Gregwar commented 11 years ago

Hi, Can you explain why you are doing such thing?

barryvdh commented 11 years ago

Hi, Well, the namespace is Gregwar\Image and the classname is Image, so the full classname should be Gregwar\Image\Image right? If I include your library with composer and use the example, I get an error 'Error: Class 'Gregwar\Image' not found in ..' So I can either use \Gregwar\Image\Image::open(..), or change the use statement to Gregwar\Image\Image.

(Or am I doing something wrong?)

Gregwar commented 11 years ago

The namespace is Gregwar\Image and the class name Image, which means that the full qualified class name is Gregwar\Image\Image, you can use it directly like \Gregwar\Image\Image::open(...) or add an use statement use Gregwar\Image\Image and use the Image class directly (Image::open(...))

There are some tiny examples in the demo/ directory

barryvdh commented 11 years ago

Well yeah, that is what I said. But in the example in your readme, the examples are incorrect, that is why I changed them.

Gregwar commented 11 years ago

Ok, sorry my appologize missed something :-)

You're right, the README examples are wrong

Gregwar commented 11 years ago

Thanks for contributing