Edit on GitHub

PHP Namespaces introduced!

Version 3 of pimcore should be 100% backward compatible to version 2, but of course this also depends on how you're using pimcore in your custom code.

Basically we replaced the prefixed class names by real namespaces so the full name (incl. namespace) of a class stays the same. We've created a custom autoloader which does not only load the classes but also creates alias on-the-fly for the legacy class names. In our opinion this is a very simple and lightweight solution with nearly no overhead.

Example: Pimcore_Controller_Action_Frontend > Pimcore\Controller\Action\Frontend

The important thing here is that both class names work at the same time, so you can do the following for instance:

use Pimcore\Model\Object\Service;
$service = new Service();
if($service instanceof \Object_Service) {
   // yes that will be true ;-)

So there should be no need to change existing code and you can further develop your projects using the old style or by using them together at the same time. Unfortunately it wasn't possible to do this 1:1 renaming for all of the classes, there are 2 exceptions: abstract classes, interfaces and list classes. The following should give you an overview of what has changed:

Element_Abstract => Element\AbstractElement (in the namespace Pimcore\Model)
Object_Abstract => Object\AbstractObject
Pimcore_API_Plugin_Abstract => Pimcore\API\Plugin\AbstractPlugin
Element_Interface => Element\ElementInterface
Pimcore_API_Plugin_Interface => Pimcore\API\Plugin\PluginInterface
Document_List => Document\Listing
Object_Product_List => Object\Product\Listing
Asset_List => Asset\Listing

This matches with the naming conventions of Zend Framework 2 and Symfony, so the idea should be clear. But this was not the reason to change it, we had no other choice since reseved keywords cannot be used as a class name or segment of a namespace. Again, this changes are also automatically handled by the custom autoloader, so you can still use both at the same time => 100% backward compatible. Another thing that has changed is that you don't have to use this ugly call Object_Abstract::getById(); anymore, to get an object of an unknown type, now you can simply use Object::getById() as known from documents and assets in the past.

Known Issues

1.) Dealing with Zend Framework controller, action, view helpers and plugins Unfortunately the ZF uses often the name of the class as a key to retrieve plugins and helpers. If you're using pimcore core helpers or plugins (your project helpers/plugins can stay the same) in your code you have to change the name when retrieving the plugins.


2.x style:

$front = \Zend_Controller_Front::getInstance();

3.x style

$front = \Zend_Controller_Front::getInstance();

So it's a good practise to search you project files for "unregisterPlugin", "addPrefix", ...