1
0
Fork 0

Simplify evaluation of PHP code

pull/5393/head
Michele Locati 2016-06-01 12:32:06 +02:00
parent 097003b5bb
commit 0b08daff02
No known key found for this signature in database
GPG Key ID: 98B7CE2E7234E28B
1 changed files with 2 additions and 2 deletions

View File

@ -190,8 +190,8 @@ class PluginManager
$code = str_replace('__FILE__', var_export($path, true), $code);
$code = str_replace('__DIR__', var_export(dirname($path), true), $code);
$code = str_replace('__CLASS__', var_export($class, true), $code);
$code = preg_replace('/^(\s*<\?(?:php)?\s+)declare\s*\(\s*strict_types\s*=\s*\d+\s*\)\s*;/', '$1', $code);
eval('?>'.$code);
$code = preg_replace('/^\s*<\?(php)?/i', '', $code, 1);
eval($code);
$class .= '_composer_tmp'.self::$classCounter;
self::$classCounter++;
}