1
0
Fork 0

Fix loading error when plugin is a final class, fixes #4482

pull/4623/head
Jordi Boggiano 2015-11-21 20:33:47 +00:00
parent 7a06615bf0
commit 977b8c8f41
1 changed files with 1 additions and 1 deletions

View File

@ -144,7 +144,7 @@ class PluginManager
foreach ($classes as $class) { foreach ($classes as $class) {
if (class_exists($class, false)) { if (class_exists($class, false)) {
$code = file_get_contents($classLoader->findFile($class)); $code = file_get_contents($classLoader->findFile($class));
$code = preg_replace('{^(\s*)class\s+(\S+)}mi', '$1class $2_composer_tmp'.self::$classCounter, $code); $code = preg_replace('{^((?:final\s+)?(?:\s*))class\s+(\S+)}mi', '$1class $2_composer_tmp'.self::$classCounter, $code);
eval('?>'.$code); eval('?>'.$code);
$class .= '_composer_tmp'.self::$classCounter; $class .= '_composer_tmp'.self::$classCounter;
self::$classCounter++; self::$classCounter++;