BUG 9697 "PM 2.0.43 testing 7/ Enterprise 2.0.16 Cuando se..." SOLVED
- When importing a plugin, the version does not register (when the plugin already exists) - Problem solved, established the plugin version at register, if the plugin exists * Available from version 2.0.45
This commit is contained in:
@@ -175,21 +175,42 @@ class PMPluginRegistry
|
||||
* @param unknown_type $sNamespace
|
||||
* @param unknown_type $sFilename
|
||||
*/
|
||||
function registerPlugin ($sNamespace, $sFilename = null)
|
||||
public function registerPlugin($sNamespace, $sFilename=null)
|
||||
{
|
||||
$sClassName = $sNamespace . 'plugin';
|
||||
if (isset( $this->_aPluginDetails[$sNamespace] ))
|
||||
//require_once ($sFilename);
|
||||
|
||||
$sClassName = $sNamespace . "plugin";
|
||||
$plugin = new $sClassName($sNamespace, $sFilename);
|
||||
|
||||
if (isset($this->_aPluginDetails[$sNamespace])) {
|
||||
$this->_aPluginDetails[$sNamespace]->iVersion = $plugin->iVersion;
|
||||
|
||||
return;
|
||||
//require_once ( $sFilename );
|
||||
$plugin = new $sClassName( $sNamespace, $sFilename );
|
||||
$detail = new pluginDetail( $sNamespace, $sClassName, $sFilename, $plugin->sFriendlyName, $plugin->sPluginFolder, $plugin->sDescription, $plugin->sSetupPage, $plugin->iVersion );
|
||||
if (isset( $plugin->aWorkspaces ))
|
||||
}
|
||||
|
||||
$detail = new pluginDetail(
|
||||
$sNamespace,
|
||||
$sClassName,
|
||||
$sFilename,
|
||||
$plugin->sFriendlyName,
|
||||
$plugin->sPluginFolder,
|
||||
$plugin->sDescription,
|
||||
$plugin->sSetupPage,
|
||||
$plugin->iVersion
|
||||
);
|
||||
|
||||
if (isset($plugin->aWorkspaces)) {
|
||||
$detail->aWorkspaces = $plugin->aWorkspaces;
|
||||
if (isset( $plugin->bPrivate ))
|
||||
}
|
||||
|
||||
if (isset($plugin->bPrivate)) {
|
||||
$detail->bPrivate = $plugin->bPrivate;
|
||||
//if ( isset( $this->_aPluginDetails[$sNamespace] ) ){
|
||||
// $detail->enabled=$this->_aPluginDetails[$sNamespace]->enabled;
|
||||
//}
|
||||
}
|
||||
|
||||
//if (isset($this->_aPluginDetails[$sNamespace])){
|
||||
// $detail->enabled = $this->_aPluginDetails[$sNamespace]->enabled;
|
||||
//}
|
||||
|
||||
$this->_aPluginDetails[$sNamespace] = $detail;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,10 +147,12 @@ 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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user