up observations

This commit is contained in:
qronald
2017-02-14 15:23:41 -04:00
parent f4356a0c5c
commit d8f160cfa0
3 changed files with 53 additions and 11 deletions

View File

@@ -117,6 +117,8 @@ class PMPluginRegistry
*/
private $_restServices = array ();
private $_restExtendServices = array ();
private $_restServiceEnabled = array();
private static $instance = null;
@@ -1458,6 +1460,38 @@ class PMPluginRegistry
return true;
}
/**
* Register a extend rest service class from a plugin to be served by processmaker
*
* @param string $sNamespace The namespace for the plugin
* @param string $className The service (api) class name
* @return bool
*/
public function registerExtendsRestService($sNamespace, $className)
{
$baseSrcPluginPath = PATH_PLUGINS . $sNamespace . PATH_SEP . "src";
$apiPath = PATH_SEP . "Services" . PATH_SEP . "Ext" . PATH_SEP;
$classFile = $baseSrcPluginPath . $apiPath . 'Ext' . $className . '.php';
if(file_exists($classFile)){
$this->_restExtendServices[$className] = array(
"filePath" => $classFile,
"classParent" => $className,
"classExtend" => 'Ext' . $className
);
}
return true;
}
/**
* Get a extend rest service class from a plugin to be served by processmaker
*
* @param string $className The service (api) class name
* @return bool
*/
public function getExtendsRestService($className)
{
return isset($this->_restExtendServices[$className]) ? $this->_restExtendServices[$className] : array();
}
/**
* Unregister a rest service class of a plugin
*