Merge remote-tracking branch 'origin/master' into feature/pluginfactoryconfig

Conflicts:
	PHPCI/Builder.php
	PHPCI/Plugin/Util/Factory.php
This commit is contained in:
steve.brazier 2014-03-25 14:17:03 +00:00
parent cc71045e57
commit 7e669ada47

View file

@ -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()
{