I’m trying to create an extension using an example exactly as in the manual page:
After including the extension in my LocalSettings.php I’ve been obtained an error message:
[11a192d41e25cf6dae7854cc] /index.php?title=Special:SpecialPages Error from line 396 of /var/www/html/includes/specialpage/SpecialPageFactory.php: Class 'MediaWiki\Extension\WikiScoop\Special' not found
Backtrace:
#0 /var/www/html/includes/specialpage/SpecialPageFactory.php(426): MediaWiki\Special\SpecialPageFactory->getPage(string)
#1 /var/www/html/includes/specials/SpecialSpecialpages.php(56): MediaWiki\Special\SpecialPageFactory->getUsablePages(User)
#2 /var/www/html/includes/specials/SpecialSpecialpages.php(44): SpecialSpecialpages->getPageGroups()
#3 /var/www/html/includes/specialpage/SpecialPage.php(569): SpecialSpecialpages->execute(NULL)
#4 /var/www/html/includes/specialpage/SpecialPageFactory.php(558): SpecialPage->run(NULL)
#5 /var/www/html/includes/MediaWiki.php(288): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
#6 /var/www/html/includes/MediaWiki.php(865): MediaWiki->performRequest()
#7 /var/www/html/includes/MediaWiki.php(515): MediaWiki->main()
#8 /var/www/html/index.php(42): MediaWiki->run()
#9 {main}
- Namespace path declaration
I have found the difference of AutoloadNamespaces path declaration between two manual pages: Special Pages and Extension Schema
So this does not explain what is an essence of “Extension” in path declaration “MediaWiki\Extension\MyExtension\”, but rather confuses
-
Autoloading the extension
I’ve created a composer manifest file “composer.json” and configure it using the composer, but still don’t understand how to include it in my extension using the extension’s manifest file or any PHP entry-point. -
Namespaces usage
Does using the AutoloadNamespaces directive mean that I have to use the namespaces in my extension?
How to fix it?
Have you an example of how to use it?
I use
MediaWiki 1.33.1
PHP 7.3.10