BUG 0000 solved problem in "import" for plugins.
solved problem in "import" for plugins, fatal error in class.pluginRegistry.php. Also resolved the problem in inclusion of the variable PATH_SEP in $path
This commit is contained in:
@@ -80,15 +80,18 @@ try {
|
|||||||
unset($oClass);
|
unset($oClass);
|
||||||
}
|
}
|
||||||
$res = $tar->extract ( $path );
|
$res = $tar->extract ( $path );
|
||||||
$sContent = file_get_contents($path . PATH_SEP . $pluginFile);
|
$sContent = file_get_contents($path . $pluginFile);
|
||||||
$sContent = str_ireplace($sAux, $sAux . '_', $sContent);
|
$sContent = str_ireplace($sAux, $sAux . '_', $sContent);
|
||||||
$sContent = str_ireplace('PATH_PLUGINS', "'".$path."'", $sContent);
|
$sContent = str_ireplace('PATH_PLUGINS', "'".$path."'", $sContent);
|
||||||
$sContent = str_ireplace('$oPluginRegistry =& PMPluginRegistry::getSingleton();', '', $sContent);
|
$sContent = preg_replace("/\\\$oPluginRegistry\s*=\s*&\s*PMPluginRegistry::getSingleton\(\);/i", null, $sContent);
|
||||||
$sContent = str_ireplace('$oPluginRegistry->registerPlugin(\'' . $sClassName . '\', __FILE__);', '', $sContent);
|
$sContent = preg_replace("/\\\$oPluginRegistry->registerPlugin\([\"\']" . $sClassName . "[\"\'], __FILE__\);/i", null, $sContent);
|
||||||
|
|
||||||
//header('Content-Type: text/plain');var_dump($sClassName, $sContent);die;
|
//header('Content-Type: text/plain');var_dump($sClassName, $sContent);die;
|
||||||
file_put_contents($path . PATH_SEP . $pluginFile, $sContent);
|
file_put_contents($path . $pluginFile, $sContent);
|
||||||
$sAux = $sAux . '_';
|
$sAux = $sAux . '_';
|
||||||
include $path . PATH_SEP . $pluginFile;
|
|
||||||
|
include ($path . $pluginFile);
|
||||||
|
|
||||||
$oClass = new $sAux($sClassName);
|
$oClass = new $sAux($sClassName);
|
||||||
$fVersionNew = $oClass->iVersion;
|
$fVersionNew = $oClass->iVersion;
|
||||||
if (!isset($oClass->iPMVersion)) {
|
if (!isset($oClass->iPMVersion)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user