Feature #2109

Support constructor / factory arguments in Objects injection configuration

Added by Robert Lemke over 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2008-11-10
Priority:Should have Due date:
Assigned To:Robert Lemke % Done:

100%

Category:Object
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 1
PHP Version: Complexity:
Has patch:

Description

Currently it is not possible to pass (constructor) arguments or properties (for setter injection) to the object which is supposed to be injected into another object. In order to support this, the configuration syntax for the Objects.* file needs to be enhanced (and while we're at it, cleaned up a bit).

As soon as the object framework supports custom factories, the syntax needs to reflect that, too.

Example:

F3\Test\Controller\DefaultController:
‧‧properties:
‧‧‧‧cache:‧
‧‧‧‧‧‧object:
‧‧‧‧‧‧‧‧factoryClassName:‧F3\FLOW3\Cache\Factory
‧‧‧‧‧‧‧‧arguments:
‧‧‧‧‧‧‧‧‧‧1:‧value:‧MyCache
‧‧‧‧‧‧‧‧‧‧2:‧value:‧F3\FLOW3\Cache\VariableCache
‧‧‧‧‧‧‧‧‧‧3:‧value:‧F3\FLOW3\Cache\Backend\File
‧‧‧‧‧‧‧‧‧‧4:‧value:‧{cacheDirectory:‧/tmp}

Related issues

related to TYPO3.Flow - Feature #2110: Add support for custom factories Resolved 2008-11-10

Associated revisions

Revision 6810cb20
Added by Robert Lemke over 6 years ago

  • FLOW3: (Cache) Introduced two new interfaces - for Cache frontends and backends
  • FLOW3: (Cache) Fixed an issue with the File Backend: initializeObject() overrode the cacheDirectory setting even if it has been set through setter injection
  • FLOW3: (Object) The property / argument type "reference" has been renamed to "object" (see also updated documentation)
  • FLOW3: (Object) The object configuration option "constructorArguments" has been renamed to "arguments"
  • FLOW3: (Object) In the code "Constructor Arguments" are now referred to simply as "Arguments"
  • FLOW3: (Object) Implemented support for custom factories. Resolves #2110
  • FLOW3: (Object) Implemented support for specifying arguments / properties for objects which are injected. Resolves #2109
  • FLOW3: (Resource) Added the file_exists() check again to the Class Loader. Ommitting the check resulted in hard-to-track error messages
  • FLOW3: (Documentation) Updated the documentation. Still missing: custom factories and syntax of feature #2109
  • FLOW3: (TestPackage) Adopted and cleaned up the Object related tests

History

#1 Updated by Robert Lemke over 6 years ago

  • Subject changed from Support constructor / factory arguments in Components injection configuration to Support constructor / factory arguments in Objects injection configuration

#2 Updated by Robert Lemke over 6 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r1670.

Also available in: Atom PDF