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:
- Is this a good idea or should I use a better system for my php classes?
- Is there a common handling for that in php? (I saw that Zend Framework uses e.g. instead of Zend_Controller_Request_Abstract the namespace Zend\Controller\Request with class name RequestAbstract -> no domain and double wording...)
thanks for your answers :)