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

Prefix for classes #1

Open
makasim opened this issue Oct 23, 2009 · 6 comments
Open

Prefix for classes #1

makasim opened this issue Oct 23, 2009 · 6 comments

Comments

@makasim
Copy link

makasim commented Oct 23, 2009

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?

@fxb
Copy link
Owner

fxb commented Oct 23, 2009

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

@m4tthumphrey
Copy link

You could just use namespaces.

@fxb
Copy link
Owner

fxb commented Jan 25, 2011

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

@m4tthumphrey
Copy link

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

@patrickgalbraith
Copy link

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.

@Cruel
Copy link

Cruel commented Sep 26, 2013

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.

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

5 participants