适配MW 1.43
parent
533a905c40
commit
0b899e24c3
@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Isekai\AIReview\Maintenance;
|
||||||
|
|
||||||
|
use Isekai\AIReview\AliyunAIReview;
|
||||||
|
use MediaWiki\MediaWikiServices;
|
||||||
|
use Maintenance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make sure the index for the wiki is sane.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
* http://www.gnu.org/copyleft/gpl.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
$IP = getenv( 'MW_INSTALL_PATH' );
|
||||||
|
if ( $IP === false ) {
|
||||||
|
$IP = __DIR__ . '/../../..';
|
||||||
|
}
|
||||||
|
require_once "$IP/maintenance/Maintenance.php";
|
||||||
|
|
||||||
|
class TryAIReview extends Maintenance {
|
||||||
|
public function __construct() {
|
||||||
|
parent::__construct();
|
||||||
|
$this->addDescription('Test AI Review');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function execute() {
|
||||||
|
$services = MediaWikiServices::getInstance();
|
||||||
|
$entryFactory = $services->getService('Moderation.EntryFactory');
|
||||||
|
|
||||||
|
$robotUser = $services->getUserFactory()->newFromId(1);
|
||||||
|
|
||||||
|
$approveEntry = $entryFactory->findApprovableEntry(1228);
|
||||||
|
$approveEntry->approve($robotUser);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$maintClass = TryAIReview::class;
|
||||||
|
require_once RUN_MAINTENANCE_IF_MAIN;
|
@ -0,0 +1 @@
|
|||||||
|
测试AI审核
|
Loading…
Reference in New Issue