HOR-3502 HOR-2043

This commit is contained in:
dev-ronald
2017-07-21 16:56:44 -04:00
committed by Ronald Quenta
parent a500ec3ea1
commit 519e9e477f
36 changed files with 5242 additions and 97 deletions

View File

@@ -386,7 +386,7 @@ class headPublisher
*/
// Load external/plugin css
// NOTE is necesary to move this to decorator server
if (class_exists('PMPluginRegistry')) {
if (class_exists('PMPluginRegistry') && PATH_DATA != PATH_C) {
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$registeredCss = $oPluginRegistry->getRegisteredCss();
foreach ($registeredCss as $cssFile) {
@@ -550,7 +550,7 @@ class headPublisher
$this->extJsScript[] = '/extjs/' . $cacheName;
//hook for registered javascripts from plugins
if (class_exists('PMPluginRegistry')) {
if (class_exists('PMPluginRegistry') && PATH_DATA != PATH_C) {
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$pluginJavascripts = $oPluginRegistry->getRegisteredJavascriptBy($filename);
} else {

View File

@@ -56,11 +56,6 @@ function run_addon_core_install($args)
define("DB_ADAPTER", $args[3]);
}
$sSerializedFile = PATH_DATA_SITE . "plugin.singleton";
$oPluginRegistry = &PMPluginRegistry::getSingleton();
if (file_exists($sSerializedFile)) {
$oPluginRegistry->unSerializeInstance(file_get_contents($sSerializedFile));
}
///////
//echo "** Installation starting... (workspace: $workspace, store: $storeId, id: $addonName)\n";
$ws = new workspaceTools($workspace);

View File

@@ -303,6 +303,19 @@ CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "Specify the language to migrate the content data. If not specified, then 'en' (English) will be used by default.\n Ex: -lfr (French) Ex: --lang=zh-CN (Mainland Chinese)", "l:","lang=");
CLI::taskRun("run_migrate_content");
CLI::taskName('migrate-plugin-information');
CLI::taskDescription(<<<EOT
Migrating the content schema to match the latest version
  Specify the WORKSPACE to migrate from a existing workspace.
If no workspace is specified, then the tables schema will be upgraded or
migrate on all available workspaces.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_migrate_plugin");
CLI::taskName('migrate-self-service-value');
CLI::taskDescription(<<<EOT
Migrate the Self-Service values to a new related table APP_ASSIGN_SELF_SERVICE_VALUE_GROUPS
@@ -1081,3 +1094,24 @@ function run_migrate_indexing_acv($args, $opts) {
$stop = microtime(true);
CLI::logging("<*> Migrating and populating indexing for avoiding the use of table APP_CACHE_VIEW process took " . ($stop - $start) . " seconds.\n");
}
function run_migrate_plugin($args, $opts) {
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$args = $filter->xssFilterHard($args);
$workspaces = get_workspaces_from_args($args);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : SYS_LANG;
$start = microtime(true);
CLI::logging("> Migrating and populating data...\n");
/** @var workspaceTools $workspace */
foreach ($workspaces as $workspace) {
if (!defined('SYS_SYS')) {
define('SYS_SYS', $workspace->name);
}
print_r('Regenerating Singleton in: ' . pakeColor::colorize($workspace->name, 'INFO') . "\n");
CLI::logging("-> Regenerating Singleton \n");
$workspace->migrateSingleton($workspace->name, $lang);
}
$stop = microtime(true);
CLI::logging("<*> Migrating and populating data Singleton took " . ($stop - $start) . " seconds.\n");
}

View File

@@ -140,30 +140,21 @@ class PMPluginRegistry
*
* @return object
*/
public static function getSingleton ()
public static function getSingleton()
{
if (self::$instance == null) {
self::$instance = new PMPluginRegistry();
}
return self::$instance;
return \ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
}
/**
* Load the singleton instance from a serialized stored file
*
* @param $file
* @return PMPluginRegistry
* @return object
* @throws Exception
*/
public static function loadSingleton($file)
{
self::$instance = unserialize(file_get_contents($file));
if (! is_object(self::$instance) || get_class(self::$instance) != "PMPluginRegistry") {
throw new Exception("Can't load main PMPluginRegistry object.");
}
return self::$instance;
return \ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
}
/**
@@ -1939,7 +1930,7 @@ class PMPluginRegistry
}
/**
* Saves the state of instance, in the private property 'stateSaved'.
* Saves the state of instance, in the private property 'stateSaved'.
* Use the 'restoreState()' method to put the instance in the saved state.
*/
public static function saveState()
@@ -1949,8 +1940,8 @@ class PMPluginRegistry
}
/**
* Restores the state of the instance that is in the private variable 'stateSaved'.
* You must save the state of the instacia with the method 'saveState()'
* Restores the state of the instance that is in the private variable 'stateSaved'.
* You must save the state of the instacia with the method 'saveState()'
* before being called.
*/
public static function restoreState()
@@ -1962,4 +1953,12 @@ class PMPluginRegistry
}
}
function iterateVisible()
{
$response = array();
foreach ($this as $key => $value) {
$response[$key] = $value;
}
return $response;
}
}

View File

@@ -201,6 +201,12 @@ class workspaceTools
$this->updatingWebEntryClassicModel($workSpace);
$stop = microtime(true);
CLI::logging("<*> Updating rows in Web Entry table for classic processes took " . ($stop - $start) . " seconds.\n");
$start = microtime(true);
CLI::logging("> Migrating and populating data...\n");
$this->migrateSingleton($workSpace, $lang);
$stop = microtime(true);
CLI::logging("<*> Migrating and populating data Singleton took " . ($stop - $start) . " seconds.\n");
}
/**
@@ -3867,4 +3873,30 @@ class workspaceTools
$this->initPropel(true);
$this->upgradeTriggersOfTables($flagRecreate, $lang);
}
/**
* @param $workspace
* @param mixed|string $lang
*/
public function migrateSingleton($workspace, $lang = SYS_LANG)
{
if ((!class_exists('Memcache') || !class_exists('Memcached')) && !defined('MEMCACHED_ENABLED')) {
define('MEMCACHED_ENABLED', false);
}
$this->initPropel(true);
$conf = new Configuration();
if(!$bExist = $conf->exists('MIGRATED_PLUGIN', 'singleton')){
$pathSingleton = PATH_DATA . 'sites' . PATH_SEP . $workspace . PATH_SEP . 'plugin.singleton';
$oPluginRegistry = unserialize(file_get_contents($pathSingleton));
$pluginAdapter = new \ProcessMaker\Plugins\Adapters\PluginAdapter();
$pluginAdapter->save($oPluginRegistry);
$data["CFG_UID"] = 'MIGRATED_PLUGIN';
$data["OBJ_UID"] = 'singleton';
$data["CFG_VALUE"] = 'true';
$data["PRO_UID"] = '';
$data["USR_UID"] = '';
$data["APP_UID"] = '';
$conf->create($data);
}
}
}

View File

@@ -149,9 +149,7 @@ class AddonsManager extends BaseAddonsManager
//$oPluginRegistry->disablePlugin($oDetails->sNamespace);
$oPluginRegistry->disablePlugin($this->getAddonName());
}
//$oPluginRegistry->setupPlugins();
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance());
$oPluginRegistry->pluginAdapter->savePlugin($this->getAddonName(), $oPluginRegistry);
return true;
}

View File

@@ -0,0 +1,138 @@
<?php
require_once 'classes/model/om/BasePluginsRegistry.php';
/**
* Skeleton subclass for representing a row from the 'PLUGINS_REGISTRY' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class PluginsRegistry extends BasePluginsRegistry
{
/**
* @return array
* @throws Exception
*/
public static function loadPlugins()
{
$oCriteria = new Criteria();
$oDataset = PluginsRegistryPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rows = array();
while ($oDataset->next()) {
$rows[] = $oDataset->getRow();
}
return $rows;
}
/**
* @param $PR_UID
* @return array
* @throws Exception
*/
public static function load($PR_UID)
{
$oPluginsRegistry = PluginsRegistryPeer::retrieveByPK($PR_UID);
if ($oPluginsRegistry) {
/** @var array $aFields */
$aFields = $oPluginsRegistry->toArray(BasePeer::TYPE_FIELDNAME);
return $aFields;
} else {
throw new Exception("User with $PR_UID does not exist!");
}
}
/**
* @param $PR_UID
* @return mixed|bool
*/
public static function exists($PR_UID)
{
$oPluginsRegistry = PluginsRegistryPeer::retrieveByPk($PR_UID);
if ($oPluginsRegistry) {
return true;
} else {
return false;
}
}
/**
* @param $PR_UID
* @param array $pluginData
* @return mixed|array|bool
*/
public static function loadOrCreateIfNotExists($PR_UID, $pluginData = array())
{
if (!self::exists($PR_UID)) {
$pluginData['PR_UID'] = $PR_UID;
self::create($pluginData);
} else {
$fields = self::load($PR_UID);
$pluginData = array_merge($fields, $pluginData);
}
return $pluginData;
}
public static function create($aData)
{
$oConnection = Propel::getConnection(PluginsRegistryPeer::DATABASE_NAME);
try {
$oPluginsRegistry = new PluginsRegistry();
$oPluginsRegistry->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oPluginsRegistry->validate()) {
$oConnection->begin();
$oPluginsRegistry->save();
$oConnection->commit();
return true;
} else {
$sMessage = '';
$aValidationFailures = $oPluginsRegistry->getValidationFailures();
/** @var ValidationFailed $oValidationFailure */
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw (new Exception('The registry cannot be created!<br />' . $sMessage));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
public static function update($aData)
{
$oConnection = Propel::getConnection(UsersPropertiesPeer::DATABASE_NAME);
try {
$oPluginsRegistry = PluginsRegistryPeer::retrieveByPK($aData['PR_UID']);
if ($oPluginsRegistry) {
$oPluginsRegistry->fromArray($aData, BasePeer::TYPE_FIELDNAME);
if ($oPluginsRegistry->validate()) {
$oConnection->begin();
$iResult = $oPluginsRegistry->save();
$oConnection->commit();
return $iResult;
} else {
$sMessage = '';
$aValidationFailures = $oPluginsRegistry->getValidationFailures();
/** @var ValidationFailed $oValidationFailure */
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw (new Exception('The registry cannot be updated!<br />' . $sMessage));
}
} else {
throw (new Exception('This row doesn\'t exist!'));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
}

View File

@@ -0,0 +1,23 @@
<?php
// include base peer class
require_once 'classes/model/om/BasePluginsRegistryPeer.php';
// include object class
include_once 'classes/model/PluginsRegistry.php';
/**
* Skeleton subclass for performing query and update operations on the 'PLUGINS_REGISTRY' table.
*
*
*
* You should add additional methods to this class to meet the
* application requirements. This class will only be generated as
* long as it does not already exist in the output directory.
*
* @package classes.model
*/
class PluginsRegistryPeer extends BasePluginsRegistryPeer {
} // PluginsRegistryPeer

View File

@@ -0,0 +1,112 @@
<?php
require_once 'propel/map/MapBuilder.php';
include_once 'creole/CreoleTypes.php';
/**
* This class adds structure of 'PLUGINS_REGISTRY' table to 'workflow' DatabaseMap object.
*
*
*
* These statically-built map classes are used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package workflow.classes.model.map
*/
class PluginsRegistryMapBuilder
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'classes.model.map.PluginsRegistryMapBuilder';
/**
* The database map.
*/
private $dbMap;
/**
* Tells us if this DatabaseMapBuilder is built so that we
* don't have to re-build it every time.
*
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
*/
public function isBuilt()
{
return ($this->dbMap !== null);
}
/**
* Gets the databasemap this map builder built.
*
* @return the databasemap
*/
public function getDatabaseMap()
{
return $this->dbMap;
}
/**
* The doBuild() method builds the DatabaseMap
*
* @return void
* @throws PropelException
*/
public function doBuild()
{
$this->dbMap = Propel::getDatabaseMap('workflow');
$tMap = $this->dbMap->addTable('PLUGINS_REGISTRY');
$tMap->setPhpName('PluginsRegistry');
$tMap->setUseIdGenerator(true);
$tMap->addColumn('ID', 'Id', 'int', CreoleTypes::INTEGER, true, null);
$tMap->addPrimaryKey('PR_UID', 'PrUid', 'string', CreoleTypes::VARCHAR, true, 32);
$tMap->addColumn('PLUGIN_NAMESPACE', 'PluginNamespace', 'string', CreoleTypes::VARCHAR, true, 100);
$tMap->addColumn('PLUGIN_DESCRIPTION', 'PluginDescription', 'string', CreoleTypes::VARCHAR, false, 200);
$tMap->addColumn('CLASS_NAME', 'ClassName', 'string', CreoleTypes::VARCHAR, true, 100);
$tMap->addColumn('FRIENDLY_NAME', 'FriendlyName', 'string', CreoleTypes::VARCHAR, false, 150);
$tMap->addColumn('FILE_NAME', 'FileName', 'string', CreoleTypes::VARCHAR, true, 250);
$tMap->addColumn('PLUGIN_FOLDER', 'PluginFolder', 'string', CreoleTypes::VARCHAR, true, 100);
$tMap->addColumn('PLUGIN_VERSION', 'PluginVersion', 'string', CreoleTypes::VARCHAR, false, 50);
$tMap->addColumn('PLUGIN_ENABLE', 'PluginEnable', 'boolean', CreoleTypes::BOOLEAN, false, null);
$tMap->addColumn('PLUGIN_PRIVATE', 'PluginPrivate', 'boolean', CreoleTypes::BOOLEAN, false, null);
$tMap->addColumn('PLUGIN_MENUS', 'PluginMenus', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_FOLDERS', 'PluginFolders', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_TRIGGERS', 'PluginTriggers', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_PM_FUNCTIONS', 'PluginPmFunctions', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_REDIRECT_LOGIN', 'PluginRedirectLogin', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_STEPS', 'PluginSteps', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_CSS', 'PluginCss', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_JS', 'PluginJs', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_REST_SERVICE', 'PluginRestService', 'string', CreoleTypes::LONGVARCHAR, false, null);
$tMap->addColumn('PLUGIN_ATTRIBUTES', 'PluginAttributes', 'string', CreoleTypes::LONGVARCHAR, false, null);
} // doBuild()
} // PluginsRegistryMapBuilder

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,667 @@
<?php
require_once 'propel/util/BasePeer.php';
// The object class -- needed for instanceof checks in this class.
// actual class may be a subclass -- as returned by PluginsRegistryPeer::getOMClass()
include_once 'classes/model/PluginsRegistry.php';
/**
* Base static class for performing query and update operations on the 'PLUGINS_REGISTRY' table.
*
*
*
* @package workflow.classes.model.om
*/
abstract class BasePluginsRegistryPeer
{
/** the default database name for this class */
const DATABASE_NAME = 'workflow';
/** the table name for this class */
const TABLE_NAME = 'PLUGINS_REGISTRY';
/** A class that can be returned by this peer. */
const CLASS_DEFAULT = 'classes.model.PluginsRegistry';
/** The total number of columns. */
const NUM_COLUMNS = 21;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** the column name for the ID field */
const ID = 'PLUGINS_REGISTRY.ID';
/** the column name for the PR_UID field */
const PR_UID = 'PLUGINS_REGISTRY.PR_UID';
/** the column name for the PLUGIN_NAMESPACE field */
const PLUGIN_NAMESPACE = 'PLUGINS_REGISTRY.PLUGIN_NAMESPACE';
/** the column name for the PLUGIN_DESCRIPTION field */
const PLUGIN_DESCRIPTION = 'PLUGINS_REGISTRY.PLUGIN_DESCRIPTION';
/** the column name for the CLASS_NAME field */
const CLASS_NAME = 'PLUGINS_REGISTRY.CLASS_NAME';
/** the column name for the FRIENDLY_NAME field */
const FRIENDLY_NAME = 'PLUGINS_REGISTRY.FRIENDLY_NAME';
/** the column name for the FILE_NAME field */
const FILE_NAME = 'PLUGINS_REGISTRY.FILE_NAME';
/** the column name for the PLUGIN_FOLDER field */
const PLUGIN_FOLDER = 'PLUGINS_REGISTRY.PLUGIN_FOLDER';
/** the column name for the PLUGIN_VERSION field */
const PLUGIN_VERSION = 'PLUGINS_REGISTRY.PLUGIN_VERSION';
/** the column name for the PLUGIN_ENABLE field */
const PLUGIN_ENABLE = 'PLUGINS_REGISTRY.PLUGIN_ENABLE';
/** the column name for the PLUGIN_PRIVATE field */
const PLUGIN_PRIVATE = 'PLUGINS_REGISTRY.PLUGIN_PRIVATE';
/** the column name for the PLUGIN_MENUS field */
const PLUGIN_MENUS = 'PLUGINS_REGISTRY.PLUGIN_MENUS';
/** the column name for the PLUGIN_FOLDERS field */
const PLUGIN_FOLDERS = 'PLUGINS_REGISTRY.PLUGIN_FOLDERS';
/** the column name for the PLUGIN_TRIGGERS field */
const PLUGIN_TRIGGERS = 'PLUGINS_REGISTRY.PLUGIN_TRIGGERS';
/** the column name for the PLUGIN_PM_FUNCTIONS field */
const PLUGIN_PM_FUNCTIONS = 'PLUGINS_REGISTRY.PLUGIN_PM_FUNCTIONS';
/** the column name for the PLUGIN_REDIRECT_LOGIN field */
const PLUGIN_REDIRECT_LOGIN = 'PLUGINS_REGISTRY.PLUGIN_REDIRECT_LOGIN';
/** the column name for the PLUGIN_STEPS field */
const PLUGIN_STEPS = 'PLUGINS_REGISTRY.PLUGIN_STEPS';
/** the column name for the PLUGIN_CSS field */
const PLUGIN_CSS = 'PLUGINS_REGISTRY.PLUGIN_CSS';
/** the column name for the PLUGIN_JS field */
const PLUGIN_JS = 'PLUGINS_REGISTRY.PLUGIN_JS';
/** the column name for the PLUGIN_REST_SERVICE field */
const PLUGIN_REST_SERVICE = 'PLUGINS_REGISTRY.PLUGIN_REST_SERVICE';
/** the column name for the PLUGIN_ATTRIBUTES field */
const PLUGIN_ATTRIBUTES = 'PLUGINS_REGISTRY.PLUGIN_ATTRIBUTES';
/** The PHP to DB Name Mapping */
private static $phpNameMap = null;
/**
* holds an array of fieldnames
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'PrUid', 'PluginNamespace', 'PluginDescription', 'ClassName', 'FriendlyName', 'FileName', 'PluginFolder', 'PluginVersion', 'PluginEnable', 'PluginPrivate', 'PluginMenus', 'PluginFolders', 'PluginTriggers', 'PluginPmFunctions', 'PluginRedirectLogin', 'PluginSteps', 'PluginCss', 'PluginJs', 'PluginRestService', 'PluginAttributes', ),
BasePeer::TYPE_COLNAME => array (PluginsRegistryPeer::ID, PluginsRegistryPeer::PR_UID, PluginsRegistryPeer::PLUGIN_NAMESPACE, PluginsRegistryPeer::PLUGIN_DESCRIPTION, PluginsRegistryPeer::CLASS_NAME, PluginsRegistryPeer::FRIENDLY_NAME, PluginsRegistryPeer::FILE_NAME, PluginsRegistryPeer::PLUGIN_FOLDER, PluginsRegistryPeer::PLUGIN_VERSION, PluginsRegistryPeer::PLUGIN_ENABLE, PluginsRegistryPeer::PLUGIN_PRIVATE, PluginsRegistryPeer::PLUGIN_MENUS, PluginsRegistryPeer::PLUGIN_FOLDERS, PluginsRegistryPeer::PLUGIN_TRIGGERS, PluginsRegistryPeer::PLUGIN_PM_FUNCTIONS, PluginsRegistryPeer::PLUGIN_REDIRECT_LOGIN, PluginsRegistryPeer::PLUGIN_STEPS, PluginsRegistryPeer::PLUGIN_CSS, PluginsRegistryPeer::PLUGIN_JS, PluginsRegistryPeer::PLUGIN_REST_SERVICE, PluginsRegistryPeer::PLUGIN_ATTRIBUTES, ),
BasePeer::TYPE_FIELDNAME => array ('ID', 'PR_UID', 'PLUGIN_NAMESPACE', 'PLUGIN_DESCRIPTION', 'CLASS_NAME', 'FRIENDLY_NAME', 'FILE_NAME', 'PLUGIN_FOLDER', 'PLUGIN_VERSION', 'PLUGIN_ENABLE', 'PLUGIN_PRIVATE', 'PLUGIN_MENUS', 'PLUGIN_FOLDERS', 'PLUGIN_TRIGGERS', 'PLUGIN_PM_FUNCTIONS', 'PLUGIN_REDIRECT_LOGIN', 'PLUGIN_STEPS', 'PLUGIN_CSS', 'PLUGIN_JS', 'PLUGIN_REST_SERVICE', 'PLUGIN_ATTRIBUTES', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, )
);
/**
* holds an array of keys for quick access to the fieldnames array
*
* first dimension keys are the type constants
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'PrUid' => 1, 'PluginNamespace' => 2, 'PluginDescription' => 3, 'ClassName' => 4, 'FriendlyName' => 5, 'FileName' => 6, 'PluginFolder' => 7, 'PluginVersion' => 8, 'PluginEnable' => 9, 'PluginPrivate' => 10, 'PluginMenus' => 11, 'PluginFolders' => 12, 'PluginTriggers' => 13, 'PluginPmFunctions' => 14, 'PluginRedirectLogin' => 15, 'PluginSteps' => 16, 'PluginCss' => 17, 'PluginJs' => 18, 'PluginRestService' => 19, 'PluginAttributes' => 20, ),
BasePeer::TYPE_COLNAME => array (PluginsRegistryPeer::ID => 0, PluginsRegistryPeer::PR_UID => 1, PluginsRegistryPeer::PLUGIN_NAMESPACE => 2, PluginsRegistryPeer::PLUGIN_DESCRIPTION => 3, PluginsRegistryPeer::CLASS_NAME => 4, PluginsRegistryPeer::FRIENDLY_NAME => 5, PluginsRegistryPeer::FILE_NAME => 6, PluginsRegistryPeer::PLUGIN_FOLDER => 7, PluginsRegistryPeer::PLUGIN_VERSION => 8, PluginsRegistryPeer::PLUGIN_ENABLE => 9, PluginsRegistryPeer::PLUGIN_PRIVATE => 10, PluginsRegistryPeer::PLUGIN_MENUS => 11, PluginsRegistryPeer::PLUGIN_FOLDERS => 12, PluginsRegistryPeer::PLUGIN_TRIGGERS => 13, PluginsRegistryPeer::PLUGIN_PM_FUNCTIONS => 14, PluginsRegistryPeer::PLUGIN_REDIRECT_LOGIN => 15, PluginsRegistryPeer::PLUGIN_STEPS => 16, PluginsRegistryPeer::PLUGIN_CSS => 17, PluginsRegistryPeer::PLUGIN_JS => 18, PluginsRegistryPeer::PLUGIN_REST_SERVICE => 19, PluginsRegistryPeer::PLUGIN_ATTRIBUTES => 20, ),
BasePeer::TYPE_FIELDNAME => array ('ID' => 0, 'PR_UID' => 1, 'PLUGIN_NAMESPACE' => 2, 'PLUGIN_DESCRIPTION' => 3, 'CLASS_NAME' => 4, 'FRIENDLY_NAME' => 5, 'FILE_NAME' => 6, 'PLUGIN_FOLDER' => 7, 'PLUGIN_VERSION' => 8, 'PLUGIN_ENABLE' => 9, 'PLUGIN_PRIVATE' => 10, 'PLUGIN_MENUS' => 11, 'PLUGIN_FOLDERS' => 12, 'PLUGIN_TRIGGERS' => 13, 'PLUGIN_PM_FUNCTIONS' => 14, 'PLUGIN_REDIRECT_LOGIN' => 15, 'PLUGIN_STEPS' => 16, 'PLUGIN_CSS' => 17, 'PLUGIN_JS' => 18, 'PLUGIN_REST_SERVICE' => 19, 'PLUGIN_ATTRIBUTES' => 20, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, )
);
/**
* @return MapBuilder the map builder for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getMapBuilder()
{
include_once 'classes/model/map/PluginsRegistryMapBuilder.php';
return BasePeer::getMapBuilder('classes.model.map.PluginsRegistryMapBuilder');
}
/**
* Gets a map (hash) of PHP names to DB column names.
*
* @return array The PHP to DB name map for this peer
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
*/
public static function getPhpNameMap()
{
if (self::$phpNameMap === null) {
$map = PluginsRegistryPeer::getTableMap();
$columns = $map->getColumns();
$nameMap = array();
foreach ($columns as $column) {
$nameMap[$column->getPhpName()] = $column->getColumnName();
}
self::$phpNameMap = $nameMap;
}
return self::$phpNameMap;
}
/**
* Translates a fieldname to another type
*
* @param string $name field name
* @param string $fromType One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @param string $toType One of the class type constants
* @return string translated name of the field.
*/
static public function translateFieldName($name, $fromType, $toType)
{
$toNames = self::getFieldNames($toType);
$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
if ($key === null) {
throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
}
return $toNames[$key];
}
/**
* Returns an array of of field names.
*
* @param string $type The type of fieldnames to return:
* One of the class type constants TYPE_PHPNAME,
* TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
* @return array A list of field names
*/
static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, self::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
}
return self::$fieldNames[$type];
}
/**
* Convenience method which changes table.column to alias.column.
*
* Using this method you can maintain SQL abstraction while using column aliases.
* <code>
* $c->addAlias("alias1", TablePeer::TABLE_NAME);
* $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
* </code>
* @param string $alias The alias for the current table.
* @param string $column The column name for current table. (i.e. PluginsRegistryPeer::COLUMN_NAME).
* @return string
*/
public static function alias($alias, $column)
{
return str_replace(PluginsRegistryPeer::TABLE_NAME.'.', $alias.'.', $column);
}
/**
* Add all the columns needed to create a new object.
*
* Note: any columns that were marked with lazyLoad="true" in the
* XML schema will not be added to the select list and only loaded
* on demand.
*
* @param criteria object containing the columns to add.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function addSelectColumns(Criteria $criteria)
{
$criteria->addSelectColumn(PluginsRegistryPeer::ID);
$criteria->addSelectColumn(PluginsRegistryPeer::PR_UID);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_NAMESPACE);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_DESCRIPTION);
$criteria->addSelectColumn(PluginsRegistryPeer::CLASS_NAME);
$criteria->addSelectColumn(PluginsRegistryPeer::FRIENDLY_NAME);
$criteria->addSelectColumn(PluginsRegistryPeer::FILE_NAME);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_FOLDER);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_VERSION);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_ENABLE);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_PRIVATE);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_MENUS);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_FOLDERS);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_TRIGGERS);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_PM_FUNCTIONS);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_REDIRECT_LOGIN);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_STEPS);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_CSS);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_JS);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_REST_SERVICE);
$criteria->addSelectColumn(PluginsRegistryPeer::PLUGIN_ATTRIBUTES);
}
const COUNT = 'COUNT(PLUGINS_REGISTRY.PR_UID)';
const COUNT_DISTINCT = 'COUNT(DISTINCT PLUGINS_REGISTRY.PR_UID)';
/**
* Returns the number of rows matching criteria.
*
* @param Criteria $criteria
* @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
* @param Connection $con
* @return int Number of matching rows.
*/
public static function doCount(Criteria $criteria, $distinct = false, $con = null)
{
// we're going to modify criteria, so copy it first
$criteria = clone $criteria;
// clear out anything that might confuse the ORDER BY clause
$criteria->clearSelectColumns()->clearOrderByColumns();
if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
$criteria->addSelectColumn(PluginsRegistryPeer::COUNT_DISTINCT);
} else {
$criteria->addSelectColumn(PluginsRegistryPeer::COUNT);
}
// just in case we're grouping: add those columns to the select statement
foreach ($criteria->getGroupByColumns() as $column) {
$criteria->addSelectColumn($column);
}
$rs = PluginsRegistryPeer::doSelectRS($criteria, $con);
if ($rs->next()) {
return $rs->getInt(1);
} else {
// no rows returned; we infer that means 0 matches.
return 0;
}
}
/**
* Method to select one object from the DB.
*
* @param Criteria $criteria object used to create the SELECT statement.
* @param Connection $con
* @return PluginsRegistry
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelectOne(Criteria $criteria, $con = null)
{
$critcopy = clone $criteria;
$critcopy->setLimit(1);
$objects = PluginsRegistryPeer::doSelect($critcopy, $con);
if ($objects) {
return $objects[0];
}
return null;
}
/**
* Method to do selects.
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con
* @return array Array of selected Objects
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doSelect(Criteria $criteria, $con = null)
{
return PluginsRegistryPeer::populateObjects(PluginsRegistryPeer::doSelectRS($criteria, $con));
}
/**
* Prepares the Criteria object and uses the parent doSelect()
* method to get a ResultSet.
*
* Use this method directly if you want to just get the resultset
* (instead of an array of objects).
*
* @param Criteria $criteria The Criteria object used to build the SELECT statement.
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
* @return ResultSet The resultset object with numerically-indexed fields.
* @see BasePeer::doSelect()
*/
public static function doSelectRS(Criteria $criteria, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if (!$criteria->getSelectColumns()) {
$criteria = clone $criteria;
PluginsRegistryPeer::addSelectColumns($criteria);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
// BasePeer returns a Creole ResultSet, set to return
// rows indexed numerically.
return BasePeer::doSelect($criteria, $con);
}
/**
* The returned array will contain objects of the default type or
* objects that inherit from the default.
*
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function populateObjects(ResultSet $rs)
{
$results = array();
// set the class once to avoid overhead in the loop
$cls = PluginsRegistryPeer::getOMClass();
$cls = Propel::import($cls);
// populate the object(s)
while ($rs->next()) {
$obj = new $cls();
$obj->hydrate($rs);
$results[] = $obj;
}
return $results;
}
/**
* Returns the TableMap related to this peer.
* This method is not needed for general use but a specific application could have a need.
* @return TableMap
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function getTableMap()
{
return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
}
/**
* The class that the Peer will make instances of.
*
* This uses a dot-path notation which is tranalted into a path
* relative to a location on the PHP include_path.
* (e.g. path.to.MyClass -> 'path/to/MyClass.php')
*
* @return string path.to.ClassName
*/
public static function getOMClass()
{
return PluginsRegistryPeer::CLASS_DEFAULT;
}
/**
* Method perform an INSERT on the database, given a PluginsRegistry or Criteria object.
*
* @param mixed $values Criteria or PluginsRegistry object containing data that is used to create the INSERT statement.
* @param Connection $con the connection to use
* @return mixed The new primary key.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doInsert($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} else {
$criteria = $values->buildCriteria(); // build Criteria from PluginsRegistry object
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
try {
// use transaction because $criteria could contain info
// for more than one table (I guess, conceivably)
$con->begin();
$pk = BasePeer::doInsert($criteria, $con);
$con->commit();
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
return $pk;
}
/**
* Method perform an UPDATE on the database, given a PluginsRegistry or Criteria object.
*
* @param mixed $values Criteria or PluginsRegistry object containing data create the UPDATE statement.
* @param Connection $con The connection to use (specify Connection exert more control over transactions).
* @return int The number of affected rows (if supported by underlying database driver).
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doUpdate($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$selectCriteria = new Criteria(self::DATABASE_NAME);
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
$comparison = $criteria->getComparison(PluginsRegistryPeer::PR_UID);
$selectCriteria->add(PluginsRegistryPeer::PR_UID, $criteria->remove(PluginsRegistryPeer::PR_UID), $comparison);
} else {
$criteria = $values->buildCriteria(); // gets full criteria
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
}
// set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
return BasePeer::doUpdate($selectCriteria, $criteria, $con);
}
/**
* Method to DELETE all rows from the PLUGINS_REGISTRY table.
*
* @return int The number of affected rows (if supported by underlying database driver).
*/
public static function doDeleteAll($con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDeleteAll(PluginsRegistryPeer::TABLE_NAME, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Method perform a DELETE on the database, given a PluginsRegistry or Criteria object OR a primary key value.
*
* @param mixed $values Criteria or PluginsRegistry object or primary key or array of primary keys
* which is used to create the DELETE statement
* @param Connection $con the connection to use
* @return int The number of affected rows (if supported by underlying database driver).
* This includes CASCADE-related rows
* if supported by native driver or if emulated using Propel.
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function doDelete($values, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(PluginsRegistryPeer::DATABASE_NAME);
}
if ($values instanceof Criteria) {
$criteria = clone $values; // rename for clarity
} elseif ($values instanceof PluginsRegistry) {
$criteria = $values->buildPkeyCriteria();
} else {
// it must be the primary key
$criteria = new Criteria(self::DATABASE_NAME);
$criteria->add(PluginsRegistryPeer::PR_UID, (array) $values, Criteria::IN);
}
// Set the correct dbName
$criteria->setDbName(self::DATABASE_NAME);
$affectedRows = 0; // initialize var to track total num of affected rows
try {
// use transaction because $criteria could contain info
// for more than one table or we could emulating ON DELETE CASCADE, etc.
$con->begin();
$affectedRows += BasePeer::doDelete($criteria, $con);
$con->commit();
return $affectedRows;
} catch (PropelException $e) {
$con->rollback();
throw $e;
}
}
/**
* Validates all modified columns of given PluginsRegistry object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param PluginsRegistry $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(PluginsRegistry $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(PluginsRegistryPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(PluginsRegistryPeer::TABLE_NAME);
if (! is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->$get();
}
}
} else {
}
return BasePeer::doValidate(PluginsRegistryPeer::DATABASE_NAME, PluginsRegistryPeer::TABLE_NAME, $columns);
}
/**
* Retrieve a single object by pkey.
*
* @param mixed $pk the primary key.
* @param Connection $con the connection to use
* @return PluginsRegistry
*/
public static function retrieveByPK($pk, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria(PluginsRegistryPeer::DATABASE_NAME);
$criteria->add(PluginsRegistryPeer::PR_UID, $pk);
$v = PluginsRegistryPeer::doSelect($criteria, $con);
return !empty($v) > 0 ? $v[0] : null;
}
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param Connection $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria();
$criteria->add(PluginsRegistryPeer::PR_UID, $pks, Criteria::IN);
$objs = PluginsRegistryPeer::doSelect($criteria, $con);
}
return $objs;
}
}
// static code to register the map builder for this Peer with the main Propel class
if (Propel::isInit()) {
// the MapBuilder classes register themselves with Propel during initialization
// so we need to load them here.
try {
BasePluginsRegistryPeer::getMapBuilder();
} catch (Exception $e) {
Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
}
} else {
// even if Propel is not yet initialized, the map builder class can be registered
// now and then it will be loaded when Propel initializes.
require_once 'classes/model/map/PluginsRegistryMapBuilder.php';
Propel::registerMapBuilder('classes.model.map.PluginsRegistryMapBuilder');
}

View File

@@ -5615,4 +5615,32 @@
<index-column name="NOT_STATUS"/>
</index>
</table>
<table name="PLUGINS_REGISTRY" idMethod="native">
<!--PluginDetails-->
<column name="ID" type="INTEGER" required="true" autoIncrement="true" unique="true"/>
<column name="PR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
<column name="PLUGIN_NAMESPACE" type="VARCHAR" size="100" required="true"/>
<column name="PLUGIN_DESCRIPTION" type="VARCHAR" size="200" default=""/>
<column name="CLASS_NAME" type="VARCHAR" size="100" required="true"/>
<column name="FRIENDLY_NAME" type="VARCHAR" size="150" default=""/>
<column name="FILE_NAME" type="VARCHAR" size="250" required="true" default=""/>
<column name="PLUGIN_FOLDER" type="VARCHAR" size="100" required="true" default=""/>
<column name="PLUGIN_VERSION" type="VARCHAR" size="50" default=""/>
<column name="PLUGIN_ENABLE" type="BOOLEAN" default="false"/>
<column name="PLUGIN_PRIVATE" type="BOOLEAN" default="false"/>
<!--PluginProperties-->
<column name="PLUGIN_MENUS" type="LONGVARCHAR"/>
<column name="PLUGIN_FOLDERS" type="LONGVARCHAR"/>
<column name="PLUGIN_TRIGGERS" type="LONGVARCHAR"/>
<column name="PLUGIN_PM_FUNCTIONS" type="LONGVARCHAR"/>
<column name="PLUGIN_REDIRECT_LOGIN" type="LONGVARCHAR"/>
<column name="PLUGIN_STEPS" type="LONGVARCHAR"/>
<column name="PLUGIN_CSS" type="LONGVARCHAR"/>
<column name="PLUGIN_JS" type="LONGVARCHAR"/>
<column name="PLUGIN_REST_SERVICE" type="LONGVARCHAR"/>
<column name="PLUGIN_ATTRIBUTES" type="LONGVARCHAR"/>
<unique name="INDEX_PLUGINS_REGISTRY_ID">
<unique-column name="ID" />
</unique>
</table>
</database>

View File

@@ -3133,5 +3133,38 @@ CREATE TABLE `NOTIFICATION_QUEUE`
PRIMARY KEY (`NOT_UID`),
KEY `indexNotStatus`(`NOT_STATUS`)
)ENGINE=InnoDB ;
#-----------------------------------------------------------------------------
#-- PLUGINS_REGISTRY
#-----------------------------------------------------------------------------
DROP TABLE IF EXISTS `PLUGINS_REGISTRY`;
CREATE TABLE `PLUGINS_REGISTRY`
(
`ID` INTEGER NOT NULL AUTO_INCREMENT,
`PR_UID` VARCHAR(32) default '' NOT NULL,
`PLUGIN_NAMESPACE` VARCHAR(100) NOT NULL,
`PLUGIN_DESCRIPTION` VARCHAR(200) default '',
`CLASS_NAME` VARCHAR(100) NOT NULL,
`FRIENDLY_NAME` VARCHAR(150) default '',
`FILE_NAME` VARCHAR(250) default '' NOT NULL,
`PLUGIN_FOLDER` VARCHAR(100) default '' NOT NULL,
`PLUGIN_VERSION` VARCHAR(50) default '',
`PLUGIN_ENABLE` INTEGER default 0,
`PLUGIN_PRIVATE` INTEGER default 0,
`PLUGIN_MENUS` MEDIUMTEXT,
`PLUGIN_FOLDERS` MEDIUMTEXT,
`PLUGIN_TRIGGERS` MEDIUMTEXT,
`PLUGIN_PM_FUNCTIONS` MEDIUMTEXT,
`PLUGIN_REDIRECT_LOGIN` MEDIUMTEXT,
`PLUGIN_STEPS` MEDIUMTEXT,
`PLUGIN_CSS` MEDIUMTEXT,
`PLUGIN_JS` MEDIUMTEXT,
`PLUGIN_REST_SERVICE` MEDIUMTEXT,
`PLUGIN_ATTRIBUTES` MEDIUMTEXT,
PRIMARY KEY (`PR_UID`),
UNIQUE KEY `INDEX_PLUGINS_REGISTRY_ID` (`ID`)
)ENGINE=InnoDB ;
# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;

View File

@@ -117,11 +117,11 @@ class enterprisePlugin extends PMPlugin
public function setup()
{
if (!file_exists(PATH_DATA_SITE . "plugin.singleton")) {
if (!PluginsRegistryPeer::retrieveByPK(md5('enterprise'))) {
$pluginRegistry = &PMPluginRegistry::getSingleton();
$pluginDetail = $pluginRegistry->getPluginDetails("enterprise.php");
$pluginRegistry->enablePlugin($pluginDetail->sNamespace);
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
$pluginRegistry->pluginAdapter->savePlugin($pluginDetail->sNamespace, $pluginRegistry);
}
}

View File

@@ -36,36 +36,6 @@ if ($aux['extension'] != 'dat') {
BasePeer::doUpdate($oCriteriaSelect, $oCriteriaUpdate, $cnn);
//plugin.singleton //are all the plugins that are enabled in the SYS_SYS
$pluginRegistry = &PMPluginRegistry::getSingleton();
$arrayAddon = array();
//ee //all plugins enterprise installed in /processmaker/workflow/engine/plugins (no matter if they are enabled/disabled)
if (file_exists(PATH_DATA_SITE . "ee")) {
$arrayAddon = unserialize(trim(file_get_contents(PATH_DATA_SITE . "ee")));
}
foreach ($arrayAddon as $addon) {
$sFileName = substr($addon["sFilename"], 0, strpos($addon["sFilename"], "-"));
if (file_exists(PATH_PLUGINS . $sFileName . ".php")) {
$addonDetails = $pluginRegistry->getPluginDetails($sFileName . ".php");
$enabled = 0;
if ($addonDetails) {
$enabled = ($addonDetails->enabled)? 1 : 0;
}
if ($enabled == 1 && !in_array($sFileName, $licenseManager->features)) {
require_once (PATH_PLUGINS . $sFileName . ".php");
$pluginRegistry->disablePlugin($sFileName);
}
}
}
file_put_contents(PATH_DATA_SITE . "plugin.singleton", $pluginRegistry->serializeInstance());
G::SendTemporalMessage('ID_NLIC', 'info');
} else {
G::SendTemporalMessage('ID_WARNING_ENTERPRISE_LICENSE_MSG', 'warning');

View File

@@ -32,18 +32,17 @@ $filter = new InputFilter();
$path = PATH_PLUGINS . $pluginFile;
$path = $filter->validateInput($path, 'path');
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if ($handle = opendir( PATH_PLUGINS )) {
while (false !== ($file = readdir( $handle ))) {
if (strpos( $file, '.php', 1 ) && $file == $pluginFile) {
$oPluginRegistry =& ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
if ($handle = opendir(PATH_PLUGINS)) {
while (false !== ($file = readdir($handle))) {
if (strpos($file, '.php', 1) && $file == $pluginFile) {
if ($pluginStatus == '1') {
//print "change to disable";
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
$oPluginRegistry->disablePlugin( $details->sNamespace );
$size = file_put_contents( PATH_DATA_SITE . 'plugin.singleton', $oPluginRegistry->serializeInstance() );
G::auditLog("DisablePlugin", "Plugin Name: ".$details->sNamespace);
$details = $oPluginRegistry->getPluginDetails($pluginFile);
$oPluginRegistry->disablePlugin($details->sNamespace);
$oPluginRegistry->pluginAdapter->savePlugin($details->sNamespace, $oPluginRegistry);
G::auditLog("DisablePlugin", "Plugin Name: " . $details->sNamespace);
//print "size saved : $size <br>";
} else {
$pluginName = str_replace(".php", "", $pluginFile);
@@ -51,17 +50,21 @@ if ($handle = opendir( PATH_PLUGINS )) {
if (is_file(PATH_PLUGINS . $pluginName . ".php") && is_dir(PATH_PLUGINS . $pluginName)) {
/*----------------------------------********---------------------------------*/
if (!$oPluginRegistry->isEnterprisePlugin($pluginName) &&
PMLicensedFeatures::getSingleton()->verifyfeature('B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=')
PMLicensedFeatures::getSingleton()
->verifyfeature('B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=')
) {
//Check disabled code
$cs = new CodeScanner(SYS_SYS);
$arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"), $cs->checkDisabledCode("PATH", PATH_PLUGINS . $pluginName));
$arrayFoundDisabledCode = array_merge(
$cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"),
$cs->checkDisabledCode("PATH", PATH_PLUGINS . $pluginName)
);
if (!empty($arrayFoundDisabledCode)) {
$response = array();
$response["status"] = "DISABLED-CODE";
$response["status"] = "DISABLED-CODE";
$response["message"] = G::LoadTranslation("ID_DISABLED_CODE_PLUGIN");
echo G::json_encode($response);
@@ -75,16 +78,16 @@ if ($handle = opendir( PATH_PLUGINS )) {
$details = $oPluginRegistry->getPluginDetails($pluginFile);
$oPluginRegistry->enablePlugin($details->sNamespace);
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$size = file_put_contents(PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance());
$oPluginRegistry->pluginAdapter->savePlugin($details->sNamespace, $oPluginRegistry);
G::auditLog("EnablePlugin", "Plugin Name: " . $details->sNamespace);
//print "size saved : $size <br>";
}
}
}
}
closedir( $handle );
closedir($handle);
}
//$oPluginRegistry->showArrays();
//G::Header('location: pluginsList');
//$oPluginRegistry->showArrays();
//G::Header('location: pluginsList');

View File

@@ -222,7 +222,7 @@ try {
file_put_contents($pathFileFlag, 'New Enterprise');
}
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$oPluginRegistry =& ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
$pluginFile = $sClassName . '.php';
if ($bMainFile && $bClassFile) {
@@ -323,14 +323,13 @@ try {
require_once (PATH_PLUGINS . $pluginFile);
$oPluginRegistry->registerPlugin( $sClassName, PATH_PLUGINS . $sClassName . ".php" );
$size = file_put_contents( PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance() );
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
$oPluginRegistry->installPlugin( $details->sNamespace );
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$size = file_put_contents( PATH_DATA_SITE . "plugin.singleton", $oPluginRegistry->serializeInstance() );
$oPluginRegistry->pluginAdapter->savePlugin($details->sNamespace , $oPluginRegistry);
$response = $oPluginRegistry->verifyTranslation( $details->sNamespace);
G::auditLog("InstallPlugin", "Plugin Name: ".$details->sNamespace );

View File

@@ -42,13 +42,9 @@ $filter = new InputFilter();
$pluginName = $_REQUEST['pluginUid'];
$pluginName = $filter->xssFilterHard($pluginName);
if (file_exists( PATH_PLUGINS . $pluginName . '.php' )) {
$pluginRegistry = &PMPluginRegistry::getSingleton();
$pluginRegistry =& ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
$pluginRegistry->uninstallPlugin($pluginName);
$pluginRegistry->uninstallPlugin( $pluginName );
$path = $filter->validateInput(PATH_DATA_SITE . 'plugin.singleton', 'path');
$pluginRegistry->unSerializeInstance( file_get_contents( $path ) );
}
G::auditLog('RemovePlugin','Plugin Name: '.$pluginName);
echo $pluginName . ' ' . nl2br( $filter->xssFilterHard(G::LoadTranslation( 'ID_MSG_REMOVE_PLUGIN_SUCCESS' )) );

View File

@@ -0,0 +1,249 @@
<?php
namespace ProcessMaker\Plugins\Adapters;
use PMPluginRegistry;
use ProcessMaker\Plugins\Interfaces\Plugins;
use ProcessMaker\Plugins\PluginsRegistry;
class PluginAdapter
{
protected $pluginRegistry;
/**
* @var array $aliasNameAttributes
*/
private $aliasNameAttributes = [
'sNamespace' => 'PLUGIN_NAMESPACE',
'sDescription' => 'PLUGIN_DESCRIPTION',
'sClassName' => 'CLASS_NAME',
'sFriendlyName' => 'FRIENDLY_NAME',
'sFilename' => 'FILE_NAME',
'sPluginFolder' => 'PLUGIN_FOLDER',
'iVersion' => 'PLUGIN_VERSION',
'enabled' => 'PLUGIN_ENABLE',
'bPrivate' => 'PLUGIN_PRIVATE',
'_aMenus' => 'PLUGIN_MENUS',
'_aFolders' => 'PLUGIN_FOLDERS',
'_aTriggers' => 'PLUGIN_TRIGGERS',
'_aPmFunctions' => 'PLUGIN_PM_FUNCTIONS',
'_aRedirectLogin' => 'PLUGIN_REDIRECT_LOGIN',
'_aSteps' => 'PLUGIN_STEPS',
'_aCSSStyleSheets' => 'PLUGIN_CSS',
'_aJavascripts' => 'PLUGIN_JS',
'_restServices' => 'PLUGIN_REST_SERVICE',
];
/**
* @param PMPluginRegistry|PluginsRegistry $pluginsSingleton
*/
public function save($pluginsSingleton)
{
$this->pluginRegistry = \G::json_decode(\G::json_encode($pluginsSingleton->iterateVisible()));
foreach ($this->pluginRegistry->_aPluginDetails as $nameSpace => $value) {
$this->savePluginOld($nameSpace, $this->pluginRegistry);
}
}
public function savePluginOld($sNamespace, $pluginRegistry)
{
$structurePlugin = $this->getOldPluginStructure($sNamespace, $pluginRegistry);
$plugin = $this->diffFieldTable($structurePlugin);
if ($plugin['PLUGIN_NAMESPACE']) {
$fieldPlugin = \PluginsRegistry::loadOrCreateIfNotExists(md5($plugin['PLUGIN_NAMESPACE']), $plugin);
\PluginsRegistry::update($fieldPlugin);
}
}
public function savePlugin($sNamespace, $pluginRegistry)
{
$structurePlugin = $this->getPluginStructure($sNamespace, $pluginRegistry);
$plugin = $this->diffFieldTable($structurePlugin);
if ($plugin['PLUGIN_NAMESPACE']) {
$fieldPlugin = \PluginsRegistry::loadOrCreateIfNotExists(md5($plugin['PLUGIN_NAMESPACE']), $plugin);
\PluginsRegistry::update($fieldPlugin);
}
}
/**
* @param string $nameSpace
* @param object $pluginsRegistry
* @return array
*/
public function getOldPluginStructure($nameSpace, $pluginsRegistry)
{
$pluginRegistry = clone $pluginsRegistry;
$structurePlugins = $pluginRegistry->_aPluginDetails->{$nameSpace};
unset($pluginRegistry->_aPluginDetails);
$aPlugins = isset($pluginRegistry->_aPlugins->{$nameSpace}) ? $pluginRegistry->_aPlugins->{$nameSpace} : [];
$structurePlugins = array_merge((array)$structurePlugins, (array)$aPlugins);
unset($pluginRegistry->_aPlugins);
foreach ($pluginRegistry as $propertyName => $propertyValue) {
foreach ($propertyValue as $key => $plugin) {
if (is_object($plugin) &&
(
(property_exists($plugin, 'sNamespace') && $plugin->sNamespace == $nameSpace) ||
(!is_int($key) && $key == $nameSpace)
)
) {
$structurePlugins[$propertyName][] = $plugin;
} elseif (is_object($plugin) &&
property_exists($plugin, 'pluginName') &&
$plugin->pluginName == $nameSpace
) {
$structurePlugins[$propertyName][] = $plugin;
} elseif (is_string($plugin) && $plugin == $nameSpace) {
$structurePlugins[$propertyName][] = $plugin;
}
}
}
return $structurePlugins;
}
/**
* @param string $nameSpace
* @param object $pluginsRegistry
* @return array
*/
public function getPluginStructure($nameSpace, $pluginsRegistry)
{
$pluginRegistry = clone $pluginsRegistry;
$structurePlugins = $pluginRegistry->_aPluginDetails[$nameSpace];
unset($pluginRegistry->_aPluginDetails);
$aPlugins = isset($pluginRegistry->_aPlugins[$nameSpace]) ? $pluginRegistry->_aPlugins[$nameSpace] : [];
$structurePlugins = array_merge((array)$structurePlugins, get_object_vars($aPlugins));
unset($pluginRegistry->_aPlugins);
foreach ($pluginRegistry as $propertyName => $propertyValue) {
foreach ($propertyValue as $key => $plugin) {
if (is_object($plugin) &&
(
(property_exists($plugin, 'sNamespace') && $plugin->sNamespace == $nameSpace) ||
(!is_int($key) && $key == $nameSpace)
)
) {
$structurePlugins[$propertyName][] = $plugin;
} elseif (is_object($plugin) &&
property_exists($plugin, 'pluginName') &&
$plugin->pluginName == $nameSpace
) {
$structurePlugins[$propertyName][] = $plugin;
} elseif (is_string($plugin) && $plugin == $nameSpace) {
$structurePlugins[$propertyName][] = $plugin;
}
}
}
return $structurePlugins;
}
/**
* @param $plugin
* @return array
*/
public function diffFieldTable($plugin)
{
$fields = [];
$map = \PluginsRegistryPeer::getTableMap();
$columns = $map->getColumns();
$attributes = array_diff_key((array)$plugin, $this->aliasNameAttributes);
$fieldsTMP = array_intersect_key((array)$plugin, $this->aliasNameAttributes);
foreach ($this->aliasNameAttributes as $name => $nameTable) {
if (array_key_exists($name, $fieldsTMP)) {
switch (gettype($fieldsTMP[$name])) {
case 'string':
$valueField = array_key_exists($name, $fieldsTMP) ? $fieldsTMP[$name] : '';
break;
case 'array':
$valueField = array_key_exists($name, $fieldsTMP) ? $fieldsTMP[$name] : [];
$valueField = \G::json_encode($valueField);
break;
case 'integer':
$valueField = array_key_exists($name, $fieldsTMP) ? $fieldsTMP[$name] : 0;
break;
case 'boolean':
$valueField = array_key_exists($name, $fieldsTMP) ? ($fieldsTMP[$name] ? true : false ): false;
break;
case 'NULL':
default:
$valueField = array_key_exists($name, $fieldsTMP) ?
$fieldsTMP[$name] :
$this->getDefaultValueType($columns[$nameTable]->getType());
break;
}
} else {
$valueField = $this->getDefaultValueType($columns[$nameTable]->getType());
}
$fields[$nameTable] = $valueField;
}
$fields['PLUGIN_ATTRIBUTES'] = \G::json_encode($attributes);
return $fields;
}
public function getDefaultValueType($var)
{
switch ($var) {
case 'string':
$response = '';
break;
case 'int':
$response = 0;
break;
case 'boolean':
$response = false;
break;
default:
$response = '';
break;
}
return $response;
}
/**
* @param PluginsRegistry $oPlugins
* @return mixed
*/
public function getPluginsDefinition($oPlugins)
{
$oldStructure = $this->convertArrayStructure();
$oPlugins->setPlugins($oldStructure);
$oPlugins = $this->populateAttributes($oPlugins, $oldStructure);
return $oPlugins;
}
public function convertArrayStructure()
{
$invertAlias = array_flip($this->aliasNameAttributes);
$plugins = \PluginsRegistry::loadPlugins();
$pluginsRegistry = [];
foreach ($plugins as $index => $plugin) {
$namePlugin = $plugin['PLUGIN_NAMESPACE'];
$pluginsRegistry[$namePlugin] = new \stdClass();
array_walk($plugin, function ($value, $key) use ($invertAlias, &$pluginsRegistry, $namePlugin) {
if (array_key_exists($key, $invertAlias)) {
$pluginsRegistry[$namePlugin]->{$invertAlias[$key]} = !is_null($data = \G::json_decode($value)) ?
$data :
(!empty($value) ? $value : []);
}
});
$moreAttributes = \G::json_decode($plugin['PLUGIN_ATTRIBUTES']);
$pluginsRegistry[$namePlugin] = Plugins::setter(array_merge(
(array)$pluginsRegistry[$namePlugin],
$moreAttributes ? (array)$moreAttributes : []
));
}
return $pluginsRegistry;
}
public function populateAttributes($oPlugins, $structures)
{
foreach ($structures as $namePlugin => $plugin) {
foreach ($plugin as $nameAttribute => $detail) {
if ($detail &&
property_exists($oPlugins, $nameAttribute) &&
$plugin->_aPluginDetails[$namePlugin]->enabled
) {
$oPlugins->{$nameAttribute} = array_merge($oPlugins->{$nameAttribute}, $detail);
}
}
}
return $oPlugins;
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class CaseSchedulerPlugin
{
public $sNamespace;
public $sActionId;
public $sActionForm;
public $sActionSave;
public $sActionExecute;
public $sActionGetFields;
/**
* This function is the constructor of the caseSchedulerPlugin class
* @param string $sNamespace
* @param string $sActionId
* @param string $sActionForm
* @param string $sActionSave
* @param string $sActionExecute
* @param string $sActionGetFields
*/
public function __construct($sNamespace, $sActionId, $sActionForm, $sActionSave, $sActionExecute, $sActionGetFields)
{
$this->sNamespace = $sNamespace;
$this->sActionId = $sActionId;
$this->sActionForm = $sActionForm;
$this->sActionSave = $sActionSave;
$this->sActionExecute = $sActionExecute;
$this->sActionGetFields = $sActionGetFields;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class CronFile
{
public $namespace;
public $cronFile;
/**
* This function is the constructor of the cronFile class
* @param string $namespace
* @param string $cronFile
*/
public function __construct($namespace, $cronFile)
{
$this->namespace = $namespace;
$this->cronFile = $cronFile;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class CssFile
{
public $sNamespace;
public $sCssFile;
/**
* This function is the constructor of the cssFile class
* @param string $sNamespace
* @param string $sCssFile
*/
public function __construct($sNamespace, $sCssFile)
{
$this->sNamespace = $sNamespace;
$this->sCssFile = $sCssFile;
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class DashboardPage
{
public $sNamespace;
public $sPage;
public $sName;
public $sIcon;
/**
* This function is the constructor of the dashboardPage class
* @param string $sNamespace
* @param string $sPage
* @param string $sName
* @param string $sIcon
*/
public function __construct($sNamespace, $sPage, $sName, $sIcon)
{
$this->sNamespace = $sNamespace;
$this->sPage = $sPage;
$this->sName = $sName;
$this->sIcon = $sIcon;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class FolderDetail
{
public $sNamespace;
public $sFolderId;
public $sFolderName;
/**
* This function is the constructor of the folderDetail class
* @param string $sNamespace
* @param string $sFolderId
* @param string $sFolderName
*/
public function __construct($sNamespace, $sFolderId, $sFolderName)
{
$this->sNamespace = $sNamespace;
$this->sFolderId = $sFolderId;
$this->sFolderName = $sFolderName;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class ImportCallBack
{
public $namespace;
public $callBackFile;
/**
* This function is the constructor of the cronFile class
* @param string $namespace
* @param string $callBackFile
*/
public function __construct($namespace, $callBackFile)
{
$this->namespace = $namespace;
$this->callBackFile = $callBackFile;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class MenuDetail
{
public $sNamespace;
public $sMenuId;
public $sFilename;
/**
* This function is the constructor of the menuDetail class
* @param string $sNamespace
* @param string $sMenuId
* @param string $sFilename
*/
public function __construct($sNamespace, $sMenuId, $sFilename)
{
$this->sNamespace = $sNamespace;
$this->sMenuId = $sMenuId;
$this->sFilename = $sFilename;
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class OpenReassignCallback
{
public $callBackFile;
/**
* This function is the constructor of the cronFile class
* @param string $callBackFile
*/
public function __construct($callBackFile)
{
$this->callBackFile = $callBackFile;
}
}

View File

@@ -0,0 +1,55 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class PluginDetail
{
public $sNamespace;
public $sClassName;
public $sFriendlyName = null;
public $sDescription = null;
public $sSetupPage = null;
public $sFilename;
public $sPluginFolder = '';
public $sCompanyLogo = '';
public $iVersion = 0;
public $enabled = false;
public $aWorkspaces = null;
public $bPrivate = false;
/**
* This function is the constructor of the pluginDetail class
*
* @param string $sNamespace
* @param string $sClassName
* @param string $sFilename
* @param string $sFriendlyName
* @param string $sPluginFolder
* @param string $sDescription
* @param string $sSetupPage
* @param integer $iVersion
*/
public function __construct(
$sNamespace,
$sClassName,
$sFilename,
$sFriendlyName = '',
$sPluginFolder = '',
$sDescription = '',
$sSetupPage = '',
$iVersion = 0
) {
$this->sNamespace = $sNamespace;
$this->sClassName = $sClassName;
$this->sFriendlyName = $sFriendlyName;
$this->sDescription = $sDescription;
$this->sSetupPage = $sSetupPage;
$this->iVersion = $iVersion;
$this->sFilename = $sFilename;
if ($sPluginFolder == '') {
$this->sPluginFolder = $sNamespace;
} else {
$this->sPluginFolder = $sPluginFolder;
}
}
}

View File

@@ -0,0 +1,83 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class Plugins
{
public $_aPluginDetails = array();
public $_aPlugins = array();
public $_aMenus = array();
public $_aFolders = array();
public $_aTriggers = array();
public $_aDashlets = array();
public $_aReports = array();
public $_aPmFunctions = array();
public $_aRedirectLogin = array();
public $_aSteps = array();
public $_aCSSStyleSheets = array();
public $_aToolbarFiles = array();
public $_aCaseSchedulerPlugin = array();
public $_aTaskExtendedProperties = array();
public $_aDashboardPages = array();
public $_aCronFiles = array();
public $_arrayDesignerMenu = array();
public $_aMenuOptionsToReplace = array();
public $_aImportProcessCallbackFile = array();
public $_aOpenReassignCallback = array();
public $_arrayDesignerSourcePath = array();
/**
* Registry a plugin javascript to include with js core at same runtime
*/
public $_aJavascripts = array();
/**
* Contains all rest services classes from plugins
*/
public $_restServices = array();
public $_restExtendServices = array();
public $_restServiceEnabled = array();
public static function setter($vars)
{
$has = get_object_vars(new static());
$newObject = new \stdClass();
foreach ($has as $name => $oldValue) {
if (isset($vars[$name])) {
$newObject->{$name} = $vars[$name];
unset($vars[$name]);
} else {
$newObject->{$name} = $oldValue;
}
}
if ($vars) {
$sClassName = $vars['sClassName'];
$sNamespace = $vars['sNamespace'];
$sFilename = $vars['sFilename'];
$newObjectDetails = new PluginDetail(
$sNamespace,
$sClassName,
$sFilename
);
if (class_exists($sClassName)) {
$oPlugin = new $sClassName($sNamespace, $sFilename);
} else {
$oPlugin = $newObjectDetails;
}
$newObject->_aPlugins[$sNamespace] = $oPlugin;
$hasDetails = get_object_vars($newObjectDetails);
foreach ($hasDetails as $name => $oldValue) {
if (isset($vars[$name])) {
$newObjectDetails->{$name} = $vars[$name];
unset($vars[$name]);
} else {
$newObjectDetails->{$name} = $oldValue;
}
}
$newObject->_aPluginDetails[$sNamespace] = $newObjectDetails;
}
return $newObject;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class RedirectDetail
{
public $sNamespace;
public $sRoleCode;
public $sPathMethod;
/**
* This function is the constructor of the redirectDetail class
* @param string $sNamespace
* @param string $sRoleCode
* @param string $sPathMethod
*/
public function __construct($sNamespace, $sRoleCode, $sPathMethod)
{
$this->sNamespace = $sNamespace;
$this->sRoleCode = $sRoleCode;
$this->sPathMethod = $sPathMethod;
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* Created by PhpStorm.
* User: dev-ronald
* Date: 7/20/17
* Time: 9:49 AM
*/
namespace ProcessMaker\Plugins\Interfaces;
class StepDetail
{
public $sNamespace;
public $sStepId;
public $sStepName;
public $sStepTitle;
public $sSetupStepPage;
/**
* This function is the constructor of the stepDetail class
* @param string $sNamespace
* @param string $sStepId
* @param string $sStepName
* @param string $sStepTitle
* @param string $sSetupStepPage
*/
public function __construct($sNamespace, $sStepId, $sStepName, $sStepTitle, $sSetupStepPage)
{
$this->sNamespace = $sNamespace;
$this->sStepId = $sStepId;
$this->sStepName = $sStepName;
$this->sStepTitle = $sStepTitle;
$this->sSetupStepPage = $sSetupStepPage;
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class TaskExtendedProperty
{
public $sNamespace;
public $sPage;
public $sName;
public $sIcon;
/**
* This function is the constructor of the taskExtendedProperty class
* @param string $sNamespace
* @param string $sPage
* @param string $sName
* @param string $sIcon
*/
public function __construct($sNamespace, $sPage, $sName, $sIcon)
{
$this->sNamespace = $sNamespace;
$this->sPage = $sPage;
$this->sName = $sName;
$this->sIcon = $sIcon;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class ToolbarDetail
{
public $sNamespace;
public $sToolbarId;
public $sFilename;
/**
* This function is the constructor of the menuDetail class
* @param string $sNamespace
* @param string $sToolbarId
* @param string $sFilename
*/
public function __construct($sNamespace, $sToolbarId, $sFilename)
{
$this->sNamespace = $sNamespace;
$this->sToolbarId = $sToolbarId;
$this->sFilename = $sFilename;
}
}

View File

@@ -0,0 +1,23 @@
<?php
namespace ProcessMaker\Plugins\Interfaces;
class TriggerDetail
{
public $sNamespace;
public $sTriggerId;
public $sTriggerName;
/**
* This function is the constructor of the triggerDetail class
* @param string $sNamespace
* @param string $sTriggerId
* @param string $sTriggerName
*/
public function __construct($sNamespace, $sTriggerId, $sTriggerName)
{
$this->sNamespace = $sNamespace;
$this->sTriggerId = $sTriggerId;
$this->sTriggerName = $sTriggerName;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -638,17 +638,6 @@ $memcache = & PMmemcached::getSingleton( SYS_SYS );
// load Plugins base class
//here we are loading all plugins registered
//the singleton has a list of enabled plugins
$sSerializedFile = PATH_DATA_SITE . 'plugin.singleton';
if (file_exists( $sSerializedFile )) {
$oPluginRegistry = PMPluginRegistry::loadSingleton($sSerializedFile);
$attributes = $oPluginRegistry->getAttributes();
Bootstrap::LoadTranslationPlugins( defined( 'SYS_LANG' ) ? SYS_LANG : "en" , $attributes);
} else{
$oPluginRegistry = PMPluginRegistry::getSingleton();
}
// setup propel definitions and logging
//changed to autoloader
//require_once ("propel/Propel.php");
@@ -689,6 +678,17 @@ if (defined( 'DEBUG_SQL_LOG' ) && DEBUG_SQL_LOG) {
Propel::init( PATH_CORE . "config/databases.php" );
}
//here we are loading all plugins registered
//the singleton has a list of enabled plugins
$sSerializedFile = PATH_DATA_SITE . 'plugin.singleton';
$oPluginRegistry = &ProcessMaker\Plugins\PluginsRegistry::loadSingleton();
$attributes = $oPluginRegistry->getAttributes();
Bootstrap::LoadTranslationPlugins( defined( 'SYS_LANG' ) ? SYS_LANG : "en" , $attributes);
// Setup plugins
$avoidChangedWorkspaceValidation = false;
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
//Set Time Zone
/*----------------------------------********---------------------------------*/
$_SESSION['__SYSTEM_UTC_TIME_ZONE__'] = (int)($config['system_utc_time_zone']) == 1;
@@ -740,9 +740,7 @@ if (SYS_LANG != 'en' && ! is_file( PATH_LANGUAGECONT . 'translation.' . SYS_LANG
Bootstrap::LoadTranslationObject(SYS_LANG);
}
// Setup plugins
$oPluginRegistry->setupPlugins(); //get and setup enabled plugins
$avoidChangedWorkspaceValidation = false;
// Load custom Classes and Model from Plugins.
Bootstrap::LoadAllPluginModelClasses();