Add code to allow configuration for the plugin factory to be stored on a per install basis.
This commit is contained in:
parent
f09ed3edad
commit
6d4e49d07b
3 changed files with 71 additions and 0 deletions
22
Tests/PHPCI/Plugin/Util/ExamplePluginConfig.php
Normal file
22
Tests/PHPCI/Plugin/Util/ExamplePluginConfig.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
return function (PHPCI\Plugin\Util\Factory $factory) {
|
||||
$factory->registerResource(
|
||||
// This function will be called when the resource is needed.
|
||||
function() {
|
||||
return array(
|
||||
'Foo' => "Stuff",
|
||||
'Bar' => "More Stuff"
|
||||
);
|
||||
},
|
||||
|
||||
// In addition to the function for building the resource the system
|
||||
// also needs to be told when to load the resource. Either or both
|
||||
// of the following arguments can be used (null to ignore)
|
||||
|
||||
// This resource will only be given when the argument name is:
|
||||
"ResourceArray",
|
||||
|
||||
// The resource will only be given when the type hint is:
|
||||
PHPCI\Plugin\Util\Factory::TYPE_ARRAY
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue