laminas-servicemanager icon indicating copy to clipboard operation
laminas-servicemanager copied to clipboard

Created tool to inject factory maps into configuration

Open weierophinney opened this issue 5 years ago • 5 comments

This patch adds a new tool, create-factory-map, which will map a given class to a given factory in the specified configuration file, under the provided configuration key (defaulting to service_manager).

Usage:

  ./vendor/zendframework/zend-servicemanager/bin/create-factory-map [-h|--help|help] <configFile> <className> <factoryName> [<key>]

Arguments:

  -h|--help|help    This usage message
  <configFile>      Path to an config file in which to map the factory.
                    If the file does not exist, it will be created. If
                    it does exist, it must return an array.
  <className>       Name of the class to map to a factory.
  <factoryName>     Name of the factory class to use with <className>.
  [<key>]           (Optional) The top-level configuration key under which
                    the factory map should appear; defaults to
                    "service_manager".

As part of this work, I moved the methods for dumping configuration files into a trait; this trait is now composed by both the ConfigDumper and FactoryMapperCommand.


Originally posted by @weierophinney at https://github.com/zendframework/zend-servicemanager/pull/161

weierophinney avatar Dec 31 '19 22:12 weierophinney

@GeeH I think this completes the pieces we need for the 3.2 release; can you review?


Originally posted by @weierophinney at https://github.com/zendframework/zend-servicemanager/pull/161#issuecomment-248917197

weierophinney avatar Dec 31 '19 22:12 weierophinney

ping @GeeH would be great to have this can you review? just a reminder in case you forgot :)


Originally posted by @svycka at https://github.com/zendframework/zend-servicemanager/pull/161#issuecomment-265113871

weierophinney avatar Dec 31 '19 22:12 weierophinney

I spoke to @weierophinney in person which is naughty and I should have commented on here. @weierophinney I suggest we release 3.2 as it is and make further improvements in this area for 3.3.


Originally posted by @GeeH at https://github.com/zendframework/zend-servicemanager/pull/161#issuecomment-265116243

weierophinney avatar Dec 31 '19 22:12 weierophinney

Moved target milestone to 3.4.0


Originally posted by @Ocramius at https://github.com/zendframework/zend-servicemanager/pull/161#issuecomment-356202202

weierophinney avatar Dec 31 '19 22:12 weierophinney

@weierophinney I forget what the hell we did here; do we want to release this as part of the 3.5 release I'm working towards?

GeeH avatar Jun 08 '20 10:06 GeeH

Closing here as the PR was never re-opened and I do not want to dive too deep into this as of now. If this is still a feature we want to ship at some point, feel free to re-open the PR on top of #176

boesing avatar Mar 05 '23 14:03 boesing