[!!!][TASK] Replace ClassInfo with ClassSchema 81/54381/23
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Thu, 12 Oct 2017 14:58:33 +0000 (16:58 +0200)
committerSusanne Moog <susanne.moog@typo3.org>
Tue, 17 Oct 2017 15:35:52 +0000 (17:35 +0200)
commit73b5e17d1807bc0e9bb2a11dc5f2affc65b304bd
tree5dae28c6eff35ac3b2826405e83d9feaf4d0f874
parentc4cd7f10dc73d4b1d4cdf7d61490fea0f262b047
[!!!][TASK] Replace ClassInfo with ClassSchema

Extbase came along with two main caches for reflection data.
extbase_reflection and extbase_object. The latter mostly stored
information that were relevant to the dependency injection, like
inject methods and properties and constructor parameters. The
information was gathered by actual reflection and by analysing
doc blocks of properties and methods.

extbase_reflection stored similar reflection and doc block data
about objects but mainly for the parts outside dependency injection.
For example, the validation resolver used it to identify @validate
tags, the ActionController used it to identity which properties not
to validate. The ORM also used it a lot to find annotated types via
@var and so on.

There were a few issues with these two approaches:

- A lot of redundant data was fetched
- Data was fetched multiple times at different locations
- The extbase_reflection cache was stored each plugin seperately,
  resulting in a lot of redundant cache data for each plugin cache
- At a lot of places, the reflection service was used to reflect
  objects, but the data wasn't cached or taken from a cache resulting
  in performance drawbacks

This patch solves these issues with several approaches:

- The extbase_object cache has been removed completely and all
  necessary information about objects, mainly @inject stuff, is
  now fetched from the ReflectionService as well.
- The ReflectionService does still create ClassSchema instances
  but these were improved a lot. All necessary information is now
  gathered during the instantiation of ClassSchema instances. That
  means that all necessary data is fetched once and then it can be
  used everywhere making any further reflection superfluous.
- As runtime reflection has been removed completey, along with it
  several reflection classes, that analyzed doc blocks, have been
  removed as well. These are no longer necessary.
- The extbase_reflection cache is no longer plugin based and will
  no longer be stored in the database in the first place. Serialized
  ClassSchema instances will stored in typo3temp.

Releases: master
Resolves: #57594
Resolves: #55654
Change-Id: I93b905c85c4f28775f014ca8b585347bf6f1e7d3
Reviewed-on: https://review.typo3.org/54381
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
52 files changed:
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-57594-OptimizeReflectionServiceCacheHandling.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Deprecation-57594-OptimizeReflectionServiceCacheHandling.rst [new file with mode: 0644]
typo3/sysext/core/Documentation/Changelog/master/Feature-57594-OptimizeReflectionServiceCacheHandling.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Core/Bootstrap.php
typo3/sysext/extbase/Classes/Mvc/Cli/Command.php
typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php
typo3/sysext/extbase/Classes/Mvc/Dispatcher.php
typo3/sysext/extbase/Classes/Mvc/RequestHandlerResolver.php
typo3/sysext/extbase/Classes/Object/Container/ClassInfo.php [deleted file]
typo3/sysext/extbase/Classes/Object/Container/ClassInfoCache.php [deleted file]
typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php [deleted file]
typo3/sysext/extbase/Classes/Object/Container/Container.php
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
typo3/sysext/extbase/Classes/Persistence/Generic/Session.php
typo3/sysext/extbase/Classes/Reflection/ClassReflection.php [deleted file]
typo3/sysext/extbase/Classes/Reflection/ClassSchema.php
typo3/sysext/extbase/Classes/Reflection/MethodReflection.php [deleted file]
typo3/sysext/extbase/Classes/Reflection/ObjectAccess.php
typo3/sysext/extbase/Classes/Reflection/ParameterReflection.php [deleted file]
typo3/sysext/extbase/Classes/Reflection/PropertyReflection.php [deleted file]
typo3/sysext/extbase/Classes/Reflection/ReflectionService.php
typo3/sysext/extbase/Classes/Scheduler/TaskExecutor.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/Fixture/Command/MockCCommandController.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/ActionControllerTest.php
typo3/sysext/extbase/Tests/Unit/Object/Container/ClassInfoFactoryTest.php [deleted file]
typo3/sysext/extbase/Tests/Unit/Object/Container/ContainerTest.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/Fixtures/Query.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/PersistentObjectConverterTest.php
typo3/sysext/extbase/Tests/Unit/Reflection/ClassSchemaTest.php
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyClassWithAllTypesOfMethods.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyClassWithAllTypesOfProperties.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyClassWithConstructorAndConstructorArguments.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyClassWithConstructorAndConstructorArgumentsWithDependencies.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyModel.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyModelRepository.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php
typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
typo3/sysext/install/Classes/Configuration/ExtbaseObjectCache/ApcPreset.php [deleted file]
typo3/sysext/install/Classes/Configuration/ExtbaseObjectCache/ApcuPreset.php [deleted file]
typo3/sysext/install/Classes/Configuration/ExtbaseObjectCache/DatabasePreset.php [deleted file]
typo3/sysext/install/Classes/Configuration/ExtbaseObjectCache/ExtbaseObjectCacheFeature.php [deleted file]
typo3/sysext/install/Classes/Configuration/FeatureManager.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php
typo3/sysext/install/Resources/Private/Partials/Settings/Presets/ExtbaseObjectCache.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Settings/Presets/ExtbaseObjectCache/Apc.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Settings/Presets/ExtbaseObjectCache/Apcu.html [deleted file]
typo3/sysext/install/Resources/Private/Partials/Settings/Presets/ExtbaseObjectCache/Database.html [deleted file]