Commit a5e3c21b authored by Wouter Wolters's avatar Wouter Wolters Committed by Andreas Fernandez
Browse files

[TASK] Use global namespace when concatenating ext_(localconf/tables)

With using a global namespace the usage of use statements
is not a problem anymore.

Resolves: #94280
Releases: master
Change-Id: I642b47b4257c22fa59a812763e5f92d5a0d2236a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70548


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: crell's avatarcrell <larry@garfieldtech.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent 86653767
......@@ -1540,7 +1540,9 @@ tt_content.' . $key . $suffix . ' {
$phpCodeToCache[] = ' */';
$phpCodeToCache[] = '';
// Add ext_localconf.php content of extension
$phpCodeToCache[] = 'namespace {';
$phpCodeToCache[] = trim((string)file_get_contents($extLocalconfPath));
$phpCodeToCache[] = '}';
$phpCodeToCache[] = '';
$phpCodeToCache[] = '';
}
......@@ -1768,13 +1770,16 @@ tt_content.' . $key . $suffix . ' {
$phpCodeToCache[] = ' */';
$phpCodeToCache[] = '';
// Add ext_tables.php content of extension
$phpCodeToCache[] = 'namespace {';
$phpCodeToCache[] = trim((string)file_get_contents($extTablesPath));
$phpCodeToCache[] = '}';
$phpCodeToCache[] = '';
}
}
$phpCodeToCache = implode(LF, $phpCodeToCache);
// Remove all start and ending php tags from content
$phpCodeToCache = preg_replace('/<\\?php|\\?>/is', '', $phpCodeToCache);
$phpCodeToCache = preg_replace('/declare\\s?+\\(\\s?+strict_types\\s?+=\\s?+1\\s?+\\);/is', '', (string)$phpCodeToCache);
self::getCacheManager()->getCache('core')->set(self::getExtTablesCacheIdentifier(), $phpCodeToCache);
}
......
Supports Markdown
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