kirankoyande / php-reader

Automatically exported from code.google.com/p/php-reader
0 stars 0 forks source link

Add class prefixes #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there, nice class!

I would really appreciate if your classes would have a common class prefix,
like PHPReader_ oder PhpReader_.

Like Zend is doing it in the Zend framework, Zend_Log or Zend_Mail.

This way you will avoid naming collisions, your classes have very common
names, Magic, Transform, Reader and so on. Anyone who has a class that has
the same classname will have severe problems.

Original issue reported on code.google.com by stephan....@gmail.com on 7 Oct 2008 at 11:29

GoogleCodeExporter commented 8 years ago
I agree about the need for the namespace. However, I'm not quite sure what 
prefix to
put there. PhpReader seems a bit undescriptive now that the nature of the 
classes has
changed to support also writing the information, and it is quite long too. It 
is the
name of the project, though, so in that sense it would do its job to uniquely 
isolate
the classes.

So, in short, suggestions for a good prefix or should we go for PhpReader_? 

Original comment by svollbehr on 20 Feb 2009 at 9:06

GoogleCodeExporter commented 8 years ago

Original comment by svollbehr on 20 Feb 2009 at 9:55

GoogleCodeExporter commented 8 years ago
Wow, a reaction :-D

Hmmm... dunno. Don't know how well-established the name php-reader is. If it 
is, it
should be PhpReader_*

Otherwise... since you're dealing with meta information, maybe MediaMeta_* ? 
Hmm...
sounds bad ;-)

MediaInfo? Metaphor? :-D

Sorry, I can't even think of good prefixes for MY code :-p

In the worst case, stick with PhpReader - that doesn't reflect what the lib 
does, but
everyone will know what is meant ;-)

Original comment by stephan....@gmail.com on 6 Mar 2009 at 12:19

GoogleCodeExporter commented 8 years ago
Is there a timeframe for this? 

And another hint - _please_ try to avoid a root-level class. This is hell for 
using
svn:external with one include dir...

Example: if you use the prefix PhpReader_, then don't use a class PhpReader.php 
for
misc stuff. Zend framework had this in pre-1.0, at least they recognized how 
bad this
is and stuffed everything in Zend_* (Zend_Loader, Zend_Version, Zend_Debug, 
these
were all combined in Zend.php before).

I'm still trying to convince the doctrine-people from discarding Doctrine.php, 
but
yet no luck ;-)

Original comment by stephan....@gmail.com on 6 Mar 2009 at 12:22

GoogleCodeExporter commented 8 years ago
This actually leads to another matter. I have been thinking for some time now 
about
how to make the library more available for everyone. Broader usage could be 
achieved
by converting the library to a new proposal for addition to the Zend Framework.

In doing so the namespace issue would resolve automatically having more 
meaningful
value of Zend_Media_* or something similar instead of rather meaningless 
PhpReader_*.
The code is already quite close to Zend coding conventions and the 
transformation
should be relatively easy.

Even though this does not directly relate to this issue, would you (and/or 
others)
care to join in on the attempt of making the library part of the Zend Framework?

Original comment by svollbehr on 4 Apr 2009 at 9:16

GoogleCodeExporter commented 8 years ago
That'd be great!
I'm using php-reader in my app with Zend Framework right now ;-)

I'll provide any help I can to get this thing to Zend Framework! But the 
proposal
process is rather time consuming, maybe it would be a good idea to have a 
ready-to-go
package rather sooner than later. Most proposals only have class skeletons, but 
if
you can provide a rather complete package that only needs some polishing...

Anyway, I love this idea ;-)

Original comment by stephan....@gmail.com on 7 Apr 2009 at 9:46

GoogleCodeExporter commented 8 years ago
Btw, with ready-to-go I meant having a package that already follows Zend Coding
Standards and has work-in-progress name like Zend_Media_Info or something.

Original comment by stephan....@gmail.com on 7 Apr 2009 at 9:47

GoogleCodeExporter commented 8 years ago
I have now separated Zend Framework development to its own branch

Original comment by svollbehr on 9 Apr 2009 at 9:43

GoogleCodeExporter commented 8 years ago
The new ZF code now introduces a good namespace.

Original comment by svollbehr on 29 Dec 2009 at 6:46

GoogleCodeExporter commented 8 years ago
php-reader-1.8-zf introduces new Zend_Io and Zend_Media namespaces

Original comment by svollbehr on 7 Mar 2010 at 9:01