Revert "[BUGFIX] Fix serializable object creation with PHP 5.6"
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Object / Container / Container.php
index 652cee7..cef2c75 100644 (file)
@@ -49,11 +49,6 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface {
        private $classInfoFactory = NULL;
 
        /**
-        * @var \Doctrine\Instantiator\InstantiatorInterface
-        */
-       protected $instantiator = NULL;
-
-       /**
         * holds references of singletons
         *
         * @var array
@@ -101,18 +96,6 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
-        * Internal method to create the class instantiator, extracted to be mockable
-        *
-        * @return \Doctrine\Instantiator\InstantiatorInterface
-        */
-       protected function getInstantiator() {
-               if ($this->instantiator == NULL) {
-                       $this->instantiator = new \Doctrine\Instantiator\Instantiator();
-               }
-               return $this->instantiator;
-       }
-
-       /**
         * Main method which should be used to get an instance of the wished class
         * specified by $className.
         *
@@ -134,7 +117,8 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface {
        public function getEmptyObject($className) {
                $className = $this->getImplementationClassName($className);
                $classInfo = $this->getClassInfo($className);
-               $object = $this->getInstantiator()->instantiate($className);
+               // get an object and avoid calling __construct()
+               $object = unserialize('O:' . strlen($className) . ':"' . $className . '":0:{};');
                $this->injectDependencies($object, $classInfo);
                return $object;
        }