-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparseTitle.php
More file actions
34 lines (26 loc) · 728 Bytes
/
parseTitle.php
File metadata and controls
34 lines (26 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
require_once( dirname( __FILE__ ) . '/Maintenance.php' );
class ParseTitle extends Maintenance {
public function __construct() {
parent::__construct();
}
public function executeLine( $line ) {
$title = Title::newFromText( $line );
$data = array();
if ( $title ) {
$data['interwiki'] = $title->getInterwiki();
$data['namespace'] = $title->getNamespace();
$data['fragment'] = $title->getFragment();
$data['dbkey'] = $title->getDBKey();
}
$this->output( FormatJson::encode( $data ) );
$this->output( "\n" );
}
public function execute() {
foreach ( $this->mArgs as $line ) {
$this->executeLine( $line );
}
}
}
$maintClass = "ParseTitle";
require_once( RUN_MAINTENANCE_IF_MAIN );