1
0
Fork 0

Allow whitespace in installers - fix for issue #2071

Custom installers can have the class definition indented.
pull/2101/head
Elenor 2013-07-22 19:11:27 -07:00
parent 6a1262e675
commit 2a33a7bed6
1 changed files with 1 additions and 1 deletions

View File

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