Now a few plugin developers will know that "namespaces" are being added into Alpha 1.4 (not sure if they were there already). Now this is quite easy for me to understand as namespaces are basically like packages in Java. However I can't convince myself that you're allowed to do these: PHP: $test = new test\example\plugin\Thing(); and I'm really confused with this: PHP: if(class_exists("Hello")) { // Do stuff}/*Would this count "test\plugin\Hello" or just classes with no namespace defined?*/} Thanks for the help.
Inside your own namespace you should be able to work as you did before, namespaces allow plugins to use any class names they want without causing an issue. You may want to look at http://www.php.net/manual/en/language.namespaces.basics.php
If you are not using the namespace of the function you can't acces to the function directly. PHP: <?php//Example//Wrongif(class_exist("Hello")){ // Do Stuff}//Goodif(class_exist("\\test\\plugin\\namespace\\Hello")){ // Do Stuff} class_exist()
Add: It is a bad practice to use full namespaces inside the main code (without `use`). It is easier to fix typos with that.