You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
611 B
PHTML
23 lines
611 B
PHTML
5 years ago
|
<?php
|
||
|
use LatinizeUrl\Hanzi2Pinyin;
|
||
|
require_once dirname(__DIR__, 2) . '/maintenance/Maintenance.php';
|
||
|
require('includes/Hanzi2Pinyin.php');
|
||
|
|
||
|
class LatinizeUrlTest extends Maintenance {
|
||
|
|
||
|
public function __construct() {
|
||
|
parent::__construct();
|
||
|
$this->addDescription( '测试拼音URL' );
|
||
|
}
|
||
|
|
||
|
public function execute() {
|
||
|
global $wgLatinizeUrlConfig;
|
||
|
$parser = new Hanzi2Pinyin($wgLatinizeUrlConfig);
|
||
|
$pinyin = $parser->parse('偏爱~But Destined To Be');
|
||
|
$url = $parser->pinyin2String($pinyin);
|
||
|
var_dump($url);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$maintClass = LatinizeUrlTest::class;
|
||
|
require_once RUN_MAINTENANCE_IF_MAIN;
|