HOR-3670-RG-4 Files review:
workflow/engine/classes/Stat.php workflow/engine/classes/Tar_File.php workflow/engine/classes/Tasks.php workflow/engine/classes/ToolBar.php workflow/engine/classes/TriggerLibrary.php
This commit is contained in:
@@ -1,56 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @author Hugo Loza <hugo@colosa.com>
|
||||
*
|
||||
* This
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.ProcessMaker
|
||||
*/class triggerLibrary
|
||||
|
||||
class TriggerLibrary
|
||||
{
|
||||
|
||||
private $_aTriggerClasses_ = array ();
|
||||
|
||||
private static $instance = NULL;
|
||||
private $_aTriggerClasses_ = array();
|
||||
private static $instance = null;
|
||||
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function __construct ()
|
||||
public function __construct()
|
||||
{
|
||||
//Initialize the Library and register the Default
|
||||
$this->registerFunctionsFileToLibrary( PATH_CORE . "classes" . PATH_SEP . "class.pmFunctions.php", "ProcessMaker Functions" );
|
||||
$this->registerFunctionsFileToLibrary(PATH_CORE . "classes" . PATH_SEP . "class.pmFunctions.php", "ProcessMaker Functions");
|
||||
|
||||
//Register all registered PLugin Functions
|
||||
if (class_exists( 'folderData' )) {
|
||||
//$folderData = new folderData($sProUid, $proFields['PRO_TITLE'], $sAppUid, $Fields['APP_TITLE'], $sUsrUid);
|
||||
if (class_exists('folderData')) {
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$aAvailablePmFunctions = $oPluginRegistry->getPmFunctions();
|
||||
$oPluginRegistry->setupPlugins(); //Get and setup enabled plugins
|
||||
foreach ($aAvailablePmFunctions as $key => $class) {
|
||||
$filePlugin = PATH_PLUGINS . $class . PATH_SEP . 'classes' . PATH_SEP . 'class.pmFunctions.php';
|
||||
|
||||
if (file_exists( $filePlugin ) && ! is_dir( $filePlugin )) {
|
||||
$this->registerFunctionsFileToLibrary( $filePlugin, "ProcessMaker Functions" );
|
||||
if (file_exists($filePlugin) && !is_dir($filePlugin)) {
|
||||
$this->registerFunctionsFileToLibrary($filePlugin, "ProcessMaker Functions");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//Add External Triggers
|
||||
$dir = G::ExpandPath( "classes" ) . 'triggers';
|
||||
$filesArray = array ();
|
||||
$dir = G::ExpandPath("classes") . 'triggers';
|
||||
$filesArray = array();
|
||||
|
||||
if (file_exists( $dir )) {
|
||||
if ($handle = opendir( $dir )) {
|
||||
while (false !== ($file = readdir( $handle ))) {
|
||||
if ($file != "." && $file != ".." && ! is_dir( $dir . PATH_SEP . $file )) {
|
||||
$this->registerFunctionsFileToLibrary( $dir . PATH_SEP . $file, "ProcessMaker External Functions" );
|
||||
if (file_exists($dir)) {
|
||||
if ($handle = opendir($dir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
if ($file != "." && $file != ".." && !is_dir($dir . PATH_SEP . $file)) {
|
||||
$this->registerFunctionsFileToLibrary($dir . PATH_SEP . $file, "ProcessMaker External Functions");
|
||||
}
|
||||
}
|
||||
closedir( $handle );
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,10 +49,10 @@
|
||||
*
|
||||
* @return self::$instance;
|
||||
*/
|
||||
function &getSingleton ()
|
||||
public function &getSingleton()
|
||||
{
|
||||
if (self::$instance == NULL) {
|
||||
self::$instance = new triggerLibrary();
|
||||
if (self::$instance == null) {
|
||||
self::$instance = new TriggerLibrary();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
@@ -73,9 +62,9 @@
|
||||
*
|
||||
* @return serialize ( self::$instance );
|
||||
*/
|
||||
function serializeInstance ()
|
||||
public function serializeInstance()
|
||||
{
|
||||
return serialize( self::$instance );
|
||||
return serialize(self::$instance);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,13 +73,13 @@
|
||||
* @param integer $serialized
|
||||
* @return void
|
||||
*/
|
||||
function unSerializeInstance ($serialized)
|
||||
public function unSerializeInstance($serialized)
|
||||
{
|
||||
if (self::$instance == NULL) {
|
||||
if (self::$instance == null) {
|
||||
self::$instance = new PluginRegistry();
|
||||
}
|
||||
|
||||
$instance = unserialize( $serialized );
|
||||
$instance = unserialize($serialized);
|
||||
self::$instance = $instance;
|
||||
}
|
||||
|
||||
@@ -101,15 +90,14 @@
|
||||
* @param string $libraryName
|
||||
* @return void
|
||||
*/
|
||||
function registerFunctionsFileToLibrary ($filePath, $libraryName)
|
||||
public function registerFunctionsFileToLibrary($filePath, $libraryName)
|
||||
{
|
||||
$aLibrary = $this->getMethodsFromLibraryFile( $filePath );
|
||||
$aLibrary = $this->getMethodsFromLibraryFile($filePath);
|
||||
$aLibrary->libraryFile = $filePath;
|
||||
$aLibrary->libraryName = $libraryName;
|
||||
if (isset( $aLibrary->info['className'] )) {
|
||||
if (isset($aLibrary->info['className'])) {
|
||||
$this->_aTriggerClasses_[$aLibrary->info['className']] = $aLibrary;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -118,12 +106,11 @@
|
||||
* @param string $file
|
||||
* @return object(PHPClass) $parsedLibrary
|
||||
*/
|
||||
function getMethodsFromLibraryFile ($file)
|
||||
public function getMethodsFromLibraryFile($file)
|
||||
{
|
||||
// parse class comments from file
|
||||
$parsedLibrary = new PHPClass();
|
||||
//$success = $parsedLibrary->parseFromFile ( PATH_CORE . "classes" . PATH_SEP . $file );
|
||||
$success = $parsedLibrary->parseFromFile( $file );
|
||||
$success = $parsedLibrary->parseFromFile($file);
|
||||
|
||||
return $parsedLibrary;
|
||||
}
|
||||
@@ -133,7 +120,7 @@
|
||||
*
|
||||
* @return array ($this->_aTriggerClasses_)
|
||||
*/
|
||||
function getRegisteredClasses ()
|
||||
public function getRegisteredClasses()
|
||||
{
|
||||
return ($this->_aTriggerClasses_);
|
||||
}
|
||||
@@ -144,7 +131,7 @@
|
||||
* @param string $libraryClassName
|
||||
* @return array ($this->_aTriggerClasses_[$libraryClassName])
|
||||
*/
|
||||
function getLibraryDefinition ($libraryClassName)
|
||||
public function getLibraryDefinition($libraryClassName)
|
||||
{
|
||||
return ($this->_aTriggerClasses_[$libraryClassName]);
|
||||
}
|
||||
@@ -154,9 +141,8 @@
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function __destruct ()
|
||||
public function __destruct()
|
||||
{
|
||||
|
||||
//TODO - Insert your code here
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user