Simplify evaluation of PHP code
parent
097003b5bb
commit
0b08daff02
|
@ -190,8 +190,8 @@ class PluginManager
|
||||||
$code = str_replace('__FILE__', var_export($path, true), $code);
|
$code = str_replace('__FILE__', var_export($path, true), $code);
|
||||||
$code = str_replace('__DIR__', var_export(dirname($path), true), $code);
|
$code = str_replace('__DIR__', var_export(dirname($path), true), $code);
|
||||||
$code = str_replace('__CLASS__', var_export($class, 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);
|
$code = preg_replace('/^\s*<\?(php)?/i', '', $code, 1);
|
||||||
eval('?>'.$code);
|
eval($code);
|
||||||
$class .= '_composer_tmp'.self::$classCounter;
|
$class .= '_composer_tmp'.self::$classCounter;
|
||||||
self::$classCounter++;
|
self::$classCounter++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue