getDB()->getType(); $updater->addExtensionTable('aitoolbox_usage', $dir . $type . '/aitoolbox_usage.sql'); } public static function onLoad(OutputPage $outputPage) { $user = $outputPage->getUser(); $permissionManager = MediaWikiServices::getInstance()->getPermissionManager(); if ($user->isRegistered() && $permissionManager->userHasRight($user, 'chatcomplete')) { $outputPage->addModules(["ext.isekai.ai-toolbox.launcher"]); } } public static function onResourceLoaderGetConfigVars(array &$vars, string $skin, Config $config){ $vars['wgIsekaiAIToolboxFrontendUrl'] = $config->get('IsekaiAIToolboxFrontendUrl'); } /** * @param \WikiPage $wikiPage * @param \MediaWiki\User\UserIdentity $user * @param string $summary * @param int $flags * @param \MediaWiki\Revision\RevisionRecord $revisionRecord * @param \MediaWiki\Storage\EditResult $editResult */ public static function onPageSaveComplete($wikiPage, $user, $summary, $flags, $revisionRecord, $editResult) { $title = $wikiPage->getTitle(); if ($title && $title->inNamespace(NS_MAIN)) { wfDebug('[IsekaiAIToolbox] push UpdateTitleIndexJob'); $job = new UpdateTitleIndexJob($wikiPage->getTitle()); MediaWikiServices::getInstance()->getJobQueueGroup()->push($job); } } }