Page MenuHomePhabricator

Fatal error: Class 'CirrusSearch\CommonTermsQueryProfiles' not found
Closed, ResolvedPublic

Description

Fatal error: Class 'CirrusSearch\CommonTermsQueryProfiles' not found in /var/www/mediawiki/extensions/CirrusSearch/includes/Hooks.php on line 115

Reported in IRC

Why is the class not in the autoloader? Why are they just require_once'd?

require_once __DIR__ . "/profiles/SuggestProfiles.php";
require_once __DIR__ . "/profiles/PhraseSuggesterProfiles.php";
require_once __DIR__ . "/profiles/CommonTermsQueryProfiles.php";
require_once __DIR__ . "/profiles/RescoreProfiles.php";
require_once __DIR__ . "/profiles/SimilarityProfiles.php";

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I suspect they are not in autoloader because these files define both classes and $wg* variables. Not sure whether it is the best approach but that's what it is now. I wonder however how we got to initializeForRequest hook without passing CirrusSearch.php given that the hooks are defined in CirrusSearch.php...

Smalyshev claimed this task.

This should be gone now after T183279 is merged.