You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logic is within \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory:
foreach ($iteratoras$key => $fileinfo) {
// All extension names in Drupal have to be valid PHP function names due// to the module hook architecture.if (!preg_match(static::PHP_FUNCTION_PATTERN, $fileinfo->getBasename('.info.yml'))) {
continue;
}
It is invoked by \Drupal\Core\Extension\ExtensionDiscovery::scan.
One problem is that ExtensionDiscovery is constructed directly in some cases. But for modules and themes it is constructed and invoked by the ExtensionList class via \Drupal\Core\Extension\ExtensionList::doScanExtensions.
We can decorate extension.list.module and extension.list.theme. The decoration will need to extend the service's class (ModuleExtensionList, ThemeExtensionList.) The method getExtensionDiscovery will need to be overridden to return a new ExtensionDiscovery child class which supports .info discovery.
Then the new class will need to extend \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory to also scan for .info and convert for new .info.yml format.
This could be a major performance issue as it scans the disk twice.
The text was updated successfully, but these errors were encountered:
What is your opinion if we would have Drush command(s) that converts legacy .info and generates the .info.yml files? Something like: ‘$ drush retrofit:init theme’
This would simplify using Retrofit.
The logic is within
\Drupal\Core\Extension\ExtensionDiscovery::scanDirectory
:It is invoked by
\Drupal\Core\Extension\ExtensionDiscovery::scan
.One problem is that
ExtensionDiscovery
is constructed directly in some cases. But for modules and themes it is constructed and invoked by theExtensionList
class via\Drupal\Core\Extension\ExtensionList::doScanExtensions
.We can decorate
extension.list.module
andextension.list.theme
. The decoration will need to extend the service's class (ModuleExtensionList
,ThemeExtensionList
.) The methodgetExtensionDiscovery
will need to be overridden to return a newExtensionDiscovery
child class which supports.info
discovery.Then the new class will need to extend
\Drupal\Core\Extension\ExtensionDiscovery::scanDirectory
to also scan for.info
and convert for new.info.yml
format.This could be a major performance issue as it scans the disk twice.
The text was updated successfully, but these errors were encountered: