Merge remote-tracking branch 'origin/master' into feature/pluginfactoryconfig
Conflicts: PHPCI/Builder.php PHPCI/Plugin/Util/Factory.php
This commit is contained in:
parent
060a786303
commit
de846bc06b
1 changed files with 22 additions and 1 deletions
|
|
@ -36,7 +36,28 @@ class Factory {
|
|||
'array'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Trys to get a function from the file path specified. If the
|
||||
* file returns a function then $this will be passed to it.
|
||||
* This enables the config file to call any public methods.
|
||||
*
|
||||
* @param $configPath
|
||||
* @return bool - true if the function exists else false.
|
||||
*/
|
||||
public function addConfigFromFile($configPath)
|
||||
{
|
||||
// The file is expected to return a function which can
|
||||
// act on the pluginFactory to register any resources needed.
|
||||
if (file_exists($configPath)) {
|
||||
$configFunction = require($configPath);
|
||||
if (is_callable($configFunction)) {
|
||||
$configFunction($this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getLastOptions()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue