Przeglądaj źródła

N°954: don't use the same (re)naming scheme, or risk a "cannot redeclare class" error.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4842 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 8 lat temu
rodzic
commit
5bfbcc9886
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      setup/extensionsmap.class.inc.php

+ 2 - 1
setup/extensionsmap.class.inc.php

@@ -322,7 +322,8 @@ class iTopExtensionsMap
 				{
 					// rename any class declaration inside the code to prevent a "duplicate class" declaration
 					// and change its parent class as well so that nobody will find it and try to execute it
-					$sModuleFileContents = str_replace($sClassName.' extends '.$aMatches[2][$idx], $sClassName.'_'.($iDummyClassIndex++).' extends DummyHandler', $sModuleFileContents);
+					// Note: don't use the same naming scheme as ModuleDiscovery otherwise you 'll have the duplicate class error again !!
+					$sModuleFileContents = str_replace($sClassName.' extends '.$aMatches[2][$idx], $sClassName.'_Ext_'.($iDummyClassIndex++).' extends DummyHandler', $sModuleFileContents);
 				}
 				$idx++;
 			}