|thiemowmde added a subscriber: adrianheine.|
thiemowmde added a comment.
I remember working on these regular expressions:
preg_match( '+' . preg_quote( DIRECTORY_SEPARATOR ) . '(?:vendor|extensions)' . preg_quote( DIRECTORY_SEPARATOR ) . '.*+', __DIR__, $remoteExtPath );
I once made sure they are all identical, and as short and fast as possible. Note the regex searches for the last occurrence of "vendor|extensions", so a match against "…/extensions/A/vendor/B" would result in "/vendor/B".
The meat of these lines of code was the fact that modules could end in either a "vendor" or an "extensions" subdirectory. This was true for the ValueView extension for a long time, and a possibility we wanted to keep open for more components. From todays perspective these preg_match are not needed any more, and can be replaced with static strings, or even removed.
I strongly oppose the suggestion to merge files. This would way to easily result in giant, unstructured blobs of module definitions that are already hard to read and to maintain on their own. The "ResourceModules" section I currently see growing at the end of extensions/WikibaseLexeme/extension.json in the #lexicographical_data project is a 400 lines mess – and development on this extension is not even finished yet. I remember we discussed the existence of the resources.php files in the Wikibase codebase years ago with @adrianheine and, as far as I remember, you, @Krinkle. It might be possible to merge a few modules that closely belong together anyway. But I will not support a reduction from 62 files to 2, not even 10.
Cc: adrianheine, thiemowmde, WMDE-leszek, Addshore, Aklapper, Krinkle, Imarlier, Lahi, Gq86, GoranSMilovanovic, QZanden, LawExplorer, Vali.matei, Wikidata-bugs, aude, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidatafirstname.lastname@example.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs