-
Notifications
You must be signed in to change notification settings - Fork 89
Created tool to inject factory maps into configuration #161
base: develop
Are you sure you want to change the base?
Created tool to inject factory maps into configuration #161
Conversation
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`.
@GeeH I think this completes the pieces we need for the 3.2 release; can you review? |
ping @GeeH would be great to have this can you review? just a reminder in case you forgot :) |
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. |
*/ | ||
private function parseArgs(array $args) | ||
{ | ||
if (! count($args)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be if (! $args) {
like in #199
Moved target milestone to |
require $a; | ||
} elseif (file_exists($a = __DIR__ . '/../vendor/autoload.php')) { | ||
require $a; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$autoload = array_filter(
[
getcwd() . '/autoload.php',
__DIR__ . '/../../../autoload.php',
__DIR__ . '/../vendor/autoload.php',
],
'is_file'
);
<?php | ||
/** | ||
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository | ||
* @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be 2018
?
/** | ||
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository | ||
* @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May use https
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://framework.zend.com/license/new-bsd got 404 page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repository has been closed and moved to laminas/laminas-servicemanager; a new issue has been opened at laminas/laminas-servicemanager#21. |
This repository has been moved to laminas/laminas-servicemanager. If you feel that this patch is still relevant, please re-open against that repository, and reference this issue. To re-open, we suggest the following workflow:
|
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 toservice_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
andFactoryMapperCommand
.