Commit 7a259012 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[TASK] Use new parser class in reading out ext_emconf on upload

parent 65b3370e
Pipeline #1781 passed with stages
in 2 minutes and 46 seconds
......@@ -26,6 +26,7 @@ namespace T3o\TerFe2\Utility;
******************************************************************/
use T3o\TerFe2\Visitor\ArrayAssurer;
use PhpParser\ParserFactory;
/**
* Utilities to manage zip and t3x files
......@@ -363,10 +364,7 @@ class Archive
public static function extractEmConf($extEmConfCode)
{
$EM_CONF = NULL;
include_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ter_fe2') . 'Resources/Private/Php/PHP-Parser/lib/bootstrap.php');
$parser = new \PhpParser\Parser(new \PhpParser\Lexer);
$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7);
try {
$statements = $parser->parse($extEmConfCode);
......@@ -385,7 +383,7 @@ class Archive
return reset($EM_CONF);
} catch (\Exception $e) {
return NULL;
return null;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment