Closed
Description
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 zendframework/zend-servicemanager#161