I know that Namespaces in PHP are relatively new and so there are many possibilities to use them. Because it was not usable on the Server i did define my classnames like folder_folder_classname
if they where in /folder/folder/classname.php
Now i want to change that to get better class names. I thought to redesign my class structure to a java based one, like com\domain\project\folder\folder\class
(e.g. in java: com.domain.project.folder.folder
package structure) and was thinking that this is a nice solution to avoid any problems with other classes i ever use and don't think about include()
for my classes any more :)
So now my Questions:
thanks for your answers :)
I would definitely avoid using the domain wording and just prepend the project name itself like Zend does (that way you avoid collision, too). Since you are thinking about restructuring and if you are using PHP > 5.3.0 (which you should) you might also want to consider the PHP namespaces.