Pimcore: Rename Namespace `Pimcore\Model\Object` to `Pimcore\Model\DataObject`

Created on 28 Aug 2017  路  5Comments  路  Source: pimcore/pimcore

  • necessary because of PHP 7.2 object typehints https://wiki.php.net/rfc/object-typehint#backward_incompatible_changes
  • eg. use Pimcore\Model\Object wouldn't be possible anymore
  • also rename "Objects" to "Data Objects" in UI
  • implement compatibility autoloader that dynamically creates aliases to Pimcore\Model\DataObject\* for classes requested out of the Pimcore\Model\Object\* namespace (< PHP 7.2 only)
Task

All 5 comments

pimcore/models/Object.php also needs a version check

Just dropping by... I work on a refactoring tool, that helps with PHP code migration to newer version.

I've just added PR https://github.com/rectorphp/rector/pull/657 that help with Object migration anywhere in the code. Class, parent, typehints, new instances etc.
It really helps with hude code base upgrades.

Is there any chance of patching this into Pimcore 4.6?

We have a couple of (really) old Pimcore projects which we would like to upgrade to 4.6, because the jump from Zend to Symfony required for version 5 would be pretty expensive. But since PHP 5.6 is nearing end of life and PHP 7.1 will only be supported until the end of 2019, we would like to go to PHP 7.2.

@i-telligence-af yes, that should be possible.
But we're not going to implement that anymore in the open source version, that's a topic for our commercial LTS offering for v4.

Was this page helpful?
0 / 5 - 0 ratings