Skip to content
Permalink
Browse files

[WIP] Pimcore 4 - Re-factored to comply with PHP 7.2 reserved name "O…

…bject" (#3587)

[Pimcore 4] - Re-factored to comply with PHP 7.2 reserved name "Object"
  • Loading branch information...
alesak authored and brusch committed Apr 26, 2019
1 parent f48a761 commit bd6e15d68476330889b7fceaf40db2fbd1bac414
Showing with 4,155 additions and 3,112 deletions.
  1. +2 −1 .travis.yml
  2. +4 −5 pimcore/cli/startup.php
  3. +1 −1 pimcore/config/startup.php
  4. +1 −1 pimcore/lib/Pimcore.php
  5. +1 −2 pimcore/lib/Pimcore/Cache/Tool/Warming.php
  6. +2 −3 pimcore/lib/Pimcore/Console/Command/ClassesRebuildCommand.php
  7. +3 −4 pimcore/lib/Pimcore/Controller/Action/Frontend.php
  8. +2 −2 pimcore/lib/Pimcore/Model/AbstractModel.php
  9. +2 −2 pimcore/lib/Pimcore/Placeholder/{Object.php → DataObject.php}
  10. +4 −5 pimcore/lib/Pimcore/Tool/Newsletter.php
  11. +5 −6 pimcore/lib/Pimcore/Tool/RestClient.php
  12. +2 −3 pimcore/lib/Pimcore/WorkflowManagement/EventHandler.php
  13. +0 −1 pimcore/lib/Pimcore/WorkflowManagement/Workflow/Config.php
  14. +2,733 −1,571 pimcore/lib/simple_html_dom.php
  15. +2 −3 pimcore/models/Document/Tag/Href.php
  16. +3 −4 pimcore/models/Document/Tag/Multihref.php
  17. +5 −6 pimcore/models/Document/Tag/Renderlet.php
  18. +2 −2 pimcore/models/Element/AbstractElement.php
  19. +2 −3 pimcore/models/Element/Export/Service.php
  20. +3 −4 pimcore/models/Element/Import/Service.php
  21. +2 −3 pimcore/models/Element/Note/Dao.php
  22. +6 −7 pimcore/models/Element/Recyclebin/Item.php
  23. +42 −21 pimcore/models/Element/Service.php
  24. +0 −1 pimcore/models/Element/Tag/Dao.php
  25. +0 −1 pimcore/models/Element/WorkflowState/Dao.php
  26. +0 −31 pimcore/models/Object.php
  27. +1 −1 pimcore/models/Object/AbstractObject.php
  28. +6 −7 pimcore/models/Object/AbstractObject/Dao.php
  29. +14 −15 pimcore/models/Object/ClassDefinition.php
  30. +1 −2 pimcore/models/Object/ClassDefinition/CustomLayout.php
  31. +1 −1 pimcore/models/Object/ClassDefinition/CustomLayout/Listing.php
  32. +1 −1 pimcore/models/Object/ClassDefinition/CustomLayout/Listing/Dao.php
  33. +3 −4 pimcore/models/Object/ClassDefinition/Dao.php
  34. +21 −22 pimcore/models/Object/ClassDefinition/Data.php
  35. +30 −31 pimcore/models/Object/ClassDefinition/Data/Block.php
  36. +6 −7 pimcore/models/Object/ClassDefinition/Data/CalculatedValue.php
  37. +16 −17 pimcore/models/Object/ClassDefinition/Data/Checkbox.php
  38. +56 −57 pimcore/models/Object/ClassDefinition/Data/Classificationstore.php
  39. +13 −14 pimcore/models/Object/ClassDefinition/Data/Date.php
  40. +6 −6 pimcore/models/Object/ClassDefinition/Data/Datetime.php
  41. +2 −2 pimcore/models/Object/ClassDefinition/Data/Extension/Text.php
  42. +10 −11 pimcore/models/Object/ClassDefinition/Data/ExternalImage.php
  43. +51 −52 pimcore/models/Object/ClassDefinition/Data/Fieldcollections.php
  44. +29 −30 pimcore/models/Object/ClassDefinition/Data/Geobounds.php
  45. +19 −20 pimcore/models/Object/ClassDefinition/Data/Geopoint.php
  46. +12 −13 pimcore/models/Object/ClassDefinition/Data/Geopolygon.php
  47. +29 −30 pimcore/models/Object/ClassDefinition/Data/Hotspotimage.php
  48. +25 −26 pimcore/models/Object/ClassDefinition/Data/Href.php
  49. +6 −6 pimcore/models/Object/ClassDefinition/Data/Image.php
  50. +4 −4 pimcore/models/Object/ClassDefinition/Data/Input.php
  51. +22 −23 pimcore/models/Object/ClassDefinition/Data/KeyValue.php
  52. +25 −26 pimcore/models/Object/ClassDefinition/Data/Link.php
  53. +43 −44 pimcore/models/Object/ClassDefinition/Data/Localizedfields.php
  54. +21 −22 pimcore/models/Object/ClassDefinition/Data/Multihref.php
  55. +36 −37 pimcore/models/Object/ClassDefinition/Data/MultihrefMetadata.php
  56. +9 −10 pimcore/models/Object/ClassDefinition/Data/Multiselect.php
  57. +10 −11 pimcore/models/Object/ClassDefinition/Data/Nonownerobjects.php
  58. +6 −6 pimcore/models/Object/ClassDefinition/Data/Numeric.php
  59. +50 −51 pimcore/models/Object/ClassDefinition/Data/Objectbricks.php
  60. +28 −29 pimcore/models/Object/ClassDefinition/Data/Objects.php
  61. +43 −44 pimcore/models/Object/ClassDefinition/Data/ObjectsMetadata.php
  62. +11 −12 pimcore/models/Object/ClassDefinition/Data/Password.php
  63. +1 −1 pimcore/models/Object/ClassDefinition/Data/Persona.php
  64. +10 −11 pimcore/models/Object/ClassDefinition/Data/Relations/AbstractRelations.php
  65. +8 −9 pimcore/models/Object/ClassDefinition/Data/Select.php
  66. +8 −9 pimcore/models/Object/ClassDefinition/Data/Slider.php
  67. +21 −22 pimcore/models/Object/ClassDefinition/Data/StructuredTable.php
  68. +9 −10 pimcore/models/Object/ClassDefinition/Data/Table.php
  69. +4 −4 pimcore/models/Object/ClassDefinition/Data/Textarea.php
  70. +1 −1 pimcore/models/Object/ClassDefinition/Data/User.php
  71. +13 −14 pimcore/models/Object/ClassDefinition/Data/Video.php
  72. +9 −10 pimcore/models/Object/ClassDefinition/Data/Wysiwyg.php
  73. +1 −2 pimcore/models/Object/ClassDefinition/Helper/Dao.php
  74. +0 −1 pimcore/models/Object/ClassDefinition/Helper/VarExport.php
  75. +1 −2 pimcore/models/Object/ClassDefinition/Listing/Dao.php
  76. +4 −5 pimcore/models/Object/ClassDefinition/Service.php
  77. +4 −5 pimcore/models/Object/Classificationstore/CollectionConfig/Listing/Dao.php
  78. +7 −8 pimcore/models/Object/Classificationstore/CollectionGroupRelation/Listing/Dao.php
  79. +2 −3 pimcore/models/Object/Classificationstore/Dao.php
  80. +0 −1 pimcore/models/Object/Classificationstore/DefinitionCache.php
  81. +4 −5 pimcore/models/Object/Classificationstore/GroupConfig/Listing/Dao.php
  82. +4 −5 pimcore/models/Object/Classificationstore/KeyConfig/Listing/Dao.php
  83. +13 −14 pimcore/models/Object/Classificationstore/KeyGroupRelation/Listing/Dao.php
  84. +2 −3 pimcore/models/Object/Classificationstore/Service.php
  85. +4 −5 pimcore/models/Object/Classificationstore/StoreConfig/Listing/Dao.php
  86. +3 −3 pimcore/models/Object/Concrete.php
  87. +6 −7 pimcore/models/Object/Concrete/Dao.php
  88. +1 −2 pimcore/models/Object/Concrete/Dao/InheritanceHelper.php
  89. +3 −4 pimcore/models/Object/Data/ElementMetadata.php
  90. +1 −2 pimcore/models/Object/Data/ElementMetadata/Dao.php
  91. +18 −19 pimcore/models/Object/Data/KeyValue.php
  92. +5 −6 pimcore/models/Object/Data/ObjectMetadata.php
  93. +4 −5 pimcore/models/Object/Data/ObjectMetadata/Dao.php
  94. +8 −9 pimcore/models/Object/Fieldcollection/Dao.php
  95. +2 −2 pimcore/models/Object/Fieldcollection/Data/AbstractData.php
  96. +15 −16 pimcore/models/Object/Fieldcollection/Definition.php
  97. +11 −12 pimcore/models/Object/Fieldcollection/Definition/Dao.php
  98. +4 −5 pimcore/models/Object/KeyValue/GroupConfig/Listing/Dao.php
  99. +6 −7 pimcore/models/Object/KeyValue/Helper.php
  100. +4 −5 pimcore/models/Object/KeyValue/KeyConfig/Listing/Dao.php
  101. +4 −5 pimcore/models/Object/KeyValue/TranslatorConfig/Listing/Dao.php
  102. +4 −5 pimcore/models/Object/Listing/Concrete.php
  103. +2 −3 pimcore/models/Object/Listing/Concrete/Dao.php
  104. +4 −5 pimcore/models/Object/Listing/Dao.php
  105. +20 −21 pimcore/models/Object/Localizedfield/Dao.php
  106. +6 −7 pimcore/models/Object/Objectbrick/Dao.php
  107. +9 −10 pimcore/models/Object/Objectbrick/Data/AbstractData.php
  108. +13 −14 pimcore/models/Object/Objectbrick/Data/Dao.php
  109. +15 −16 pimcore/models/Object/Objectbrick/Definition.php
  110. +7 −8 pimcore/models/Object/Objectbrick/Definition/Dao.php
  111. +3 −4 pimcore/models/Object/QuantityValue/Unit/Listing/Dao.php
  112. +1 −1 pimcore/models/Object/Service.php
  113. +3 −4 pimcore/models/Schedule/Task/Executor.php
  114. +7 −8 pimcore/models/Search/Backend/Data.php
  115. +1 −2 pimcore/models/Search/Backend/Data/Listing/Dao.php
  116. +1 −1 pimcore/models/User/Workspace/Dao.php
  117. +1 −1 pimcore/models/User/Workspace/{Object.php → ObjectWorkspace.php}
  118. +1 −1 pimcore/models/Version.php
  119. +1 −1 pimcore/models/Webservice/Data/{Object.php → ConcreteObject.php}
  120. +1 −1 pimcore/models/Webservice/Data/Object/Concrete.php
  121. +1 −1 pimcore/models/Webservice/Data/Object/Folder.php
  122. +26 −27 pimcore/models/Webservice/Service.php
  123. +78 −79 pimcore/modules/admin/controllers/ClassController.php
  124. +7 −8 pimcore/modules/admin/controllers/ClassificationstoreController.php
  125. +8 −9 pimcore/modules/admin/controllers/ElementController.php
  126. +2 −3 pimcore/modules/admin/controllers/KeyValueController.php
  127. +110 −111 pimcore/modules/admin/controllers/ObjectController.php
  128. +44 −45 pimcore/modules/admin/controllers/ObjectHelperController.php
  129. +1 −2 pimcore/modules/admin/controllers/PortalController.php
  130. +0 −1 pimcore/modules/admin/controllers/PrintcontainerController.php
  131. +0 −1 pimcore/modules/admin/controllers/PrintpageController.php
  132. +7 −8 pimcore/modules/admin/controllers/TranslationController.php
  133. +1 −2 pimcore/modules/admin/controllers/UserController.php
  134. +9 −10 pimcore/modules/admin/controllers/VariantsController.php
  135. +1 −2 pimcore/modules/admin/controllers/WorkflowController.php
  136. +5 −6 pimcore/modules/admin/views/scripts/object/diff-versions.php
  137. +6 −7 pimcore/modules/admin/views/scripts/object/preview-version.php
  138. +1 −1 pimcore/modules/install/controllers/IndexController.php
  139. +6 −7 pimcore/modules/searchadmin/controllers/SearchController.php
  140. +20 −21 pimcore/modules/webservice/controllers/RestController.php
  141. +2 −2 tests/lib/Test/Data.php
@@ -9,6 +9,7 @@ php:
- 5.6.29
- 7
- 7.1
- 7.2

addons:
hosts:
@@ -23,7 +24,7 @@ matrix:
include:
- os: linux
sudo: false
php: 7.1
php: 7.2
services: ~
addons: ~
env:
@@ -12,7 +12,6 @@
* @license http://www.pimcore.org/license GPLv3 and PEL
*/
use Pimcore\Model\Object;
use Pimcore\Model\Document;
// determines if we're in Pimcore\Console mode
@@ -38,9 +37,9 @@
//Activate Inheritance for cli-scripts
\Pimcore::unsetAdminMode();
Document::setHideUnpublished(true);
Object\AbstractObject::setHideUnpublished(true);
Object\AbstractObject::setGetInheritedValues(true);
Object\Localizedfield::setGetFallbackValues(true);
\Pimcore\Model\Object\AbstractObject::setHideUnpublished(true);
\Pimcore\Model\Object\AbstractObject::setGetInheritedValues(true);
\Pimcore\Model\Object\Localizedfield::setGetFallbackValues(true);
// CLI has no memory/time limits
@ini_set('memory_limit', -1);
@@ -50,7 +49,7 @@
// Error reporting is enabled in CLI
@ini_set("display_errors", "On");
@ini_set("display_startup_errors", "On");
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
// Pimcore\Console handles maintenance mode through the AbstractCommand
if (!$pimcoreConsole) {
@@ -12,7 +12,7 @@
* @license http://www.pimcore.org/license GPLv3 and PEL
*/
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
// configure some constants needed by pimcore
$pimcoreDocumentRoot = realpath(dirname(__FILE__) . '/../..');
@@ -737,7 +737,7 @@ public static function initConfiguration()
// custom error logging in DEBUG mode & DEVMODE
if (PIMCORE_DEVMODE || PIMCORE_DEBUG) {
error_reporting(E_ALL & ~E_NOTICE);
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
}
}
@@ -18,7 +18,6 @@
use Pimcore\Model\Listing\AbstractListing;
use Pimcore\Model\Document;
use Pimcore\Model\Element;
use Pimcore\Model\Object;
use Pimcore\Model\Asset;
use Pimcore\Logger;
@@ -68,7 +67,7 @@ public static function objects($types = null, $classes = null)
$classesCondition .= " AND o_className IN ('" . implode("','", $classes) . "')";
}
$list = new Object\Listing();
$list = new \Pimcore\Model\Object\Listing();
$list->setCondition("o_type IN ('" . implode("','", $types) . "')" . $classesCondition);
self::loadToCache($list);
@@ -17,7 +17,6 @@
use Pimcore\Cache;
use Pimcore\Console\AbstractCommand;
use Pimcore\Model\Object\ClassDefinition;
use Pimcore\Model\Object;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -91,7 +90,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln("---------------------");
$output->writeln("Saving all object bricks");
}
$list = new Object\Objectbrick\Definition\Listing();
$list = new \Pimcore\Model\Object\Objectbrick\Definition\Listing();
$list = $list->load();
foreach ($list as $brickDefinition) {
if ($output->isVerbose()) {
@@ -106,7 +105,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln("---------------------");
$output->writeln("Saving all field collections");
}
$list = new Object\Fieldcollection\Definition\Listing();
$list = new \Pimcore\Model\Object\Fieldcollection\Definition\Listing();
$list = $list->load();
foreach ($list as $fc) {
if ($output->isVerbose()) {
@@ -20,7 +20,6 @@
use Pimcore\Tool\Authentication;
use Pimcore\Tool\Session;
use Pimcore\Model\Document;
use Pimcore\Model\Object;
use Pimcore\Model;
use Pimcore\Translate;
use Pimcore\Logger;
@@ -83,9 +82,9 @@ public function init()
if (self::$isInitial) {
\Pimcore::unsetAdminMode();
Document::setHideUnpublished(true);
Object\AbstractObject::setHideUnpublished(true);
Object\AbstractObject::setGetInheritedValues(true);
Object\Localizedfield::setGetFallbackValues(true);
\Pimcore\Model\Object\AbstractObject::setHideUnpublished(true);
\Pimcore\Model\Object\AbstractObject::setGetInheritedValues(true);
\Pimcore\Model\Object\Localizedfield::setGetFallbackValues(true);
}
// assign variables
@@ -93,9 +93,9 @@ public function initDao($key = null, $forceDetection = false)
}
// we have 2 static mappings for objects for performance reasons
if ($this instanceof Object\Concrete) {
if ($this instanceof \Pimcore\Model\Object\Concrete) {
$dao = 'Pimcore\Model\Object\Concrete\Dao';
} elseif ($this instanceof Object\Listing\Concrete) {
} elseif ($this instanceof \Pimcore\Model\Object\Listing\Concrete) {
$dao = 'Pimcore\Model\Object\Listing\Concrete\Dao';
} elseif (!$forceDetection && array_key_exists($cacheKey, self::$daoClassCache)) {
$dao = self::$daoClassCache[$cacheKey];
@@ -16,7 +16,7 @@
use Pimcore\Model;
class Object extends AbstractPlaceholder
class DataObject extends AbstractPlaceholder
{
/**
@@ -32,7 +32,7 @@ public function getTestValue()
/**
* Gets a object by it's id and replaces the placeholder width the value form the called "method"
*
* example: %Object(object_id,{"method" : "getId"});
* example: %ConcreteObject(object_id,{"method" : "getId"});
* @return string
*/
public function getReplacement()
@@ -17,7 +17,6 @@
use Pimcore\Document\Newsletter\SendingParamContainer;
use Pimcore\Mail;
use Pimcore\Tool;
use Pimcore\Model\Object;
use Pimcore\Model\Document;
use Pimcore\Model;
use Pimcore\Logger;
@@ -208,14 +207,14 @@ public function __construct($classId = null)
{
$class = null;
if (is_string($classId)) {
$class = Object\ClassDefinition::getByName($classId);
$class = \Pimcore\Model\Object\ClassDefinition::getByName($classId);
} elseif (is_int($classId)) {
$class = Object\ClassDefinition::getById($classId);
$class = \Pimcore\Model\Object\ClassDefinition::getById($classId);
} elseif ($classId !== null) {
throw new \Exception("No valid class identifier given (class name or ID)");
}
if ($class instanceof Object\ClassDefinition) {
if ($class instanceof \Pimcore\Model\Object\ClassDefinition) {
$this->setClass($class);
}
}
@@ -346,7 +345,7 @@ public function getObjectByToken($token)
$data = \Zend_Json::decode(base64_decode($token));
if ($data) {
if ($object = Object::getById($data["id"])) {
if ($object = \Pimcore\Model\Object\AbstractObject::getById($data["id"])) {
if ($version = $object->getLatestVersion()) {
$object = $version->getData();
}
@@ -18,7 +18,6 @@
use Pimcore\Tool;
use Pimcore\Model;
use Pimcore\Model\User;
use Pimcore\Model\Object;
use Pimcore\Model\Document;
use Pimcore\Model\Asset;
use Pimcore\Model\Webservice;
@@ -474,7 +473,7 @@ public function getObjectList($condition = null, $order = null, $orderKey = null
if (!$decode) {
$result[] = $wsDocument;
} else {
$object = new Object\AbstractObject();
$object = new \Pimcore\Model\Object\AbstractObject();
$wsDocument->reverseMap($object);
$result[] = $object;
}
@@ -608,7 +607,7 @@ public function getObjectById($id, $decode = true, $idMapper = null)
}
if ($wsDocument->type == "folder") {
$object = new Object\Folder();
$object = new \Pimcore\Model\Object\Folder();
$wsDocument->reverseMap($object);
return $object;
@@ -617,7 +616,7 @@ public function getObjectById($id, $decode = true, $idMapper = null)
$object = \Pimcore::getDiContainer()->make($classname);
if ($object instanceof Object\Concrete) {
if ($object instanceof \Pimcore\Model\Object\Concrete) {
$curTime = microtime(true);
$wsDocument->reverseMap($object, $this->getDisableMappingExceptions(), $idMapper);
$timeConsumed = round(microtime(true) - $curTime, 3) * 1000;
@@ -937,7 +936,7 @@ public function getClassById($id, $decode = true)
$wsDocument = $this->fillWebserviceData("\\Pimcore\\Model\\Webservice\\Data\\ClassDefinition\\In", $responseData);
$class = new Object\ClassDefinition();
$class = new \Pimcore\Model\Object\ClassDefinition();
$wsDocument->reverseMap($class);
return $class;
@@ -961,7 +960,7 @@ public function getObjectMetaById($id, $decode = true)
return $wsDocument;
}
$class = new Object\ClassDefinition();
$class = new \Pimcore\Model\Object\ClassDefinition();
$wsDocument->reverseMap($class);
return $class;
@@ -17,7 +17,6 @@
use Pimcore\Model\Element\AbstractElement;
use Pimcore\WorkflowManagement\Workflow;
use Pimcore\Tool\Admin;
use Pimcore\Model\Object;
use Pimcore\Model\Object\Concrete as ConcreteObject;
use Pimcore\Model\Asset;
use Pimcore\Model\Document;
@@ -106,7 +105,7 @@ public static function adminElementGetPreSendData($e)
if (!is_null($workflowLayoutId)) {
//load the new layout into the object container
$validLayouts = Object\Service::getValidLayouts($element);
$validLayouts = \Pimcore\Model\Object\Object\Service::getValidLayouts($element);
//check that the layout id is valid before trying to load
if (!empty($validLayouts)) {
@@ -115,7 +114,7 @@ public static function adminElementGetPreSendData($e)
if ($validLayouts && $validLayouts[$workflowLayoutId]) {
$customLayout = ClassDefinition\CustomLayout::getById($workflowLayoutId);
$customLayoutDefinition = $customLayout->getLayoutDefinitions();
Object\Service::enrichLayoutDefinition($customLayoutDefinition, $e->getParam('object'));
\Pimcore\Model\Object\Service::enrichLayoutDefinition($customLayoutDefinition, $e->getParam('object'));
$data["layout"] = $customLayoutDefinition;
}
}
@@ -16,7 +16,6 @@
use Pimcore\Model\Element\AbstractElement;
use Pimcore\Model\Element\Service;
use Pimcore\Model\Object;
use Pimcore\Model\Object\Concrete as ConcreteObject;
use Pimcore\Model\Document;
use Pimcore\Model\Asset;
Oops, something went wrong.

0 comments on commit bd6e15d

Please sign in to comment.
You can’t perform that action at this time.