MediaWiki master
License.php
Go to the documentation of this file.
1<?php
14
18class License {
19 public string $template;
20 public string $text;
21
22 public function __construct( string $str ) {
23 $str = $this->parse( $str );
24 [ $this->template, $this->text ] = $this->split( $str );
25 }
26
31 protected function parse( $str ) {
32 return $str;
33 }
34
39 protected function split( $str ) {
40 [ $text, $template ] = explode( '|', strrev( $str ), 2 );
41 return [ strrev( $template ), strrev( $text ) ];
42 }
43}
44
46class_alias( License::class, 'License' );
A License class for use on Special:Upload (represents a single type of license).
Definition License.php:18