From 606c4549b1a4b68594c82bc4d4b8b9238e9d76cb Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 30 Mar 2011 18:40:36 +0000 Subject: [PATCH] Move duplicated Site class into own class in Maintenance.php, include in 2 users --- maintenance/Site.php | 19 +++++++++++++++++++ maintenance/dumpInterwiki.php | 19 +------------------ maintenance/rebuildInterwiki.php | 19 +------------------ 3 files changed, 21 insertions(+), 36 deletions(-) create mode 100644 maintenance/Site.php diff --git a/maintenance/Site.php b/maintenance/Site.php new file mode 100644 index 0000000000..85e012605f --- /dev/null +++ b/maintenance/Site.php @@ -0,0 +1,19 @@ +suffix = $s; + $this->lateral = $l; + $this->url = $u; + } + + function getURL( $lang ) { + $xlang = str_replace( '_', '-', $lang ); + return "http://$xlang.{$this->url}/wiki/\$1"; + } +} \ No newline at end of file diff --git a/maintenance/dumpInterwiki.php b/maintenance/dumpInterwiki.php index b5202f83f0..b4f8e82fab 100644 --- a/maintenance/dumpInterwiki.php +++ b/maintenance/dumpInterwiki.php @@ -24,24 +24,7 @@ * @ingroup Wikimedia */ -/** - * @todo document - * @ingroup Maintenance - */ -class Site { - var $suffix, $lateral, $url; - - function __construct( $s, $l, $u ) { - $this->suffix = $s; - $this->lateral = $l; - $this->url = $u; - } - - function getURL( $lang ) { - $xlang = str_replace( '_', '-', $lang ); - return "http://$xlang.{$this->url}/wiki/\$1"; - } -} +require_once( dirname( __FILE__ ) . '/Site.php' ); require_once( dirname( __FILE__ ) . '/Maintenance.php' ); diff --git a/maintenance/rebuildInterwiki.php b/maintenance/rebuildInterwiki.php index 5bb4f4bb71..25aea2deb5 100644 --- a/maintenance/rebuildInterwiki.php +++ b/maintenance/rebuildInterwiki.php @@ -24,24 +24,7 @@ * @ingroup Wikimedia */ -/** - * @todo document - * @ingroup Maintenance - */ -class Site { - var $suffix, $lateral, $url; - - function __construct( $s, $l, $u ) { - $this->suffix = $s; - $this->lateral = $l; - $this->url = $u; - } - - function getURL( $lang ) { - $xlang = str_replace( '_', '-', $lang ); - return "http://$xlang.{$this->url}/wiki/\$1"; - } -} +require_once( dirname( __FILE__ ) . '/Site.php' ); require_once( dirname( __FILE__ ) . '/Maintenance.php' ); -- 2.20.1