php-last.fm-api icon indicating copy to clipboard operation
php-last.fm-api copied to clipboard

Prefix for classes

Open makasim opened this issue 16 years ago • 6 comments

It would be better if all classes in the library have prefix like lfCaller or like PEAR Services_LastFm_Caller. In this way we'll avoid a lot of troubles with class names conflicts.

What do you think?

makasim avatar Oct 23 '09 07:10 makasim

Yeah, you're right. I also thought of that, but never changed it. I think I'll go with "LastfmCaller", "LastfmAlbum", etc.

fxb avatar Oct 23 '09 09:10 fxb

You could just use namespaces.

m4tthumphrey avatar Jan 25 '11 16:01 m4tthumphrey

true. don't want to restrict it to PHP >= 5.3 though.

fxb avatar Jan 25 '11 16:01 fxb

Yeh, agreed. Maybe include an example of how to use with namespaces.

m4tthumphrey avatar Jan 25 '11 17:01 m4tthumphrey

I created a fork that is namespaced with LastFM_ ie LastFM_Artist etc... https://github.com/patrickgalbraith/php-last.fm-api

I also added the Chart api and changed the __autoload function to use spl_autoload_register() to avoid conflicts.

patrickgalbraith avatar Jun 22 '12 08:06 patrickgalbraith

I have a PSR-0 compliant namedspaced fork here for those interested: https://github.com/Cruel/php-last.fm-api

It also has a composer.json for easy installation and autoloading in many workspaces.

Cruel avatar Sep 26 '13 01:09 Cruel