Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Commit

Permalink
Fix Class 'SanctionsCreateTemplates' not found
Browse files Browse the repository at this point in the history
(cherry picked from commit 32fde3b)
  • Loading branch information
lens0021 committed Dec 17, 2020
1 parent d233331 commit 442bd2a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 3 additions & 0 deletions extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"AutoloadNamespaces": {
"MediaWiki\\Extension\\Sanctions\\": "includes/"
},
"AutoloadClasses": {
"SanctionsCreateTemplates": "maintenance/SanctionsCreateTemplates.php"
},
"ResourceModules": {
"ext.sanctions.special.sanctions.styles": {
"styles": [ "styles/spacial-sanctions.less" ]
Expand Down
3 changes: 2 additions & 1 deletion includes/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use MWException;
use OutputPage;
use RequestContext;
use SanctionsCreateTemplates;
use Skin;
use SpecialPage;
use Title;
Expand All @@ -37,7 +38,7 @@ public static function onLoadExtensionSchemaUpdates( DatabaseUpdater $updater =
} // @todo else

require_once "$dir/../maintenance/SanctionsCreateTemplates.php";
$updater->addPostDatabaseUpdateMaintenance( 'SanctionsCreateTemplates' );
$updater->addPostDatabaseUpdateMaintenance( SanctionsCreateTemplates::class );

return true;
}
Expand Down
10 changes: 1 addition & 9 deletions maintenance/SanctionsCreateTemplates.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
<?php

namespace MediaWiki\Extension\Sanctions;

use Article;
use LoggedUpdateMaintenance;
use MediaWiki\MediaWikiServices;
use MWException;
use Status;
use Title;
use WikitextContent;

require_once getenv( 'MW_INSTALL_PATH' ) !== false
? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
Expand Down Expand Up @@ -123,5 +115,5 @@ protected function create( Title $title, WikitextContent $content ) {
}
}

$maintClass = 'SanctionsCreateTemplates';
$maintClass = SanctionsCreateTemplates::class;
require_once RUN_MAINTENANCE_IF_MAIN;

0 comments on commit 442bd2a

Please sign in to comment.