dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e4484b1
)
coding style tweaks to Interwiki.php
author
Jack Phoenix
<ashley@users.mediawiki.org>
Sun, 25 Jul 2010 15:50:23 +0000
(15:50 +0000)
committer
Jack Phoenix
<ashley@users.mediawiki.org>
Sun, 25 Jul 2010 15:50:23 +0000
(15:50 +0000)
includes/Interwiki.php
patch
|
blob
|
history
diff --git
a/includes/Interwiki.php
b/includes/Interwiki.php
index
6a179f2
..
865119a
100644
(file)
--- a/
includes/Interwiki.php
+++ b/
includes/Interwiki.php
@@
-7,7
+7,8
@@
/**
* The interwiki class
* All information is loaded on creation when called by Interwiki::fetch( $prefix ).
/**
* The interwiki class
* All information is loaded on creation when called by Interwiki::fetch( $prefix ).
- * All work is done on slave, because this should *never* change (except during schema updates etc, which arent wiki-related)
+ * All work is done on slave, because this should *never* change (except during
+ * schema updates etc, which aren't wiki-related)
*/
class Interwiki {
*/
class Interwiki {
@@
-17,11
+18,11
@@
class Interwiki {
protected $mPrefix, $mURL, $mAPI, $mWikiID, $mLocal, $mTrans;
protected $mPrefix, $mURL, $mAPI, $mWikiID, $mLocal, $mTrans;
- public function __construct( $prefix = null, $url = '', $api = '', $wiki
i
d = '', $local = 0, $trans = 0 ) {
+ public function __construct( $prefix = null, $url = '', $api = '', $wiki
I
d = '', $local = 0, $trans = 0 ) {
$this->mPrefix = $prefix;
$this->mURL = $url;
$this->mAPI = $api;
$this->mPrefix = $prefix;
$this->mURL = $url;
$this->mAPI = $api;
- $this->mWikiID = $wiki
i
d;
+ $this->mWikiID = $wiki
I
d;
$this->mLocal = $local;
$this->mTrans = $trans;
}
$this->mLocal = $local;
$this->mTrans = $trans;
}
@@
-63,7
+64,7
@@
class Interwiki {
}
if( self::CACHE_LIMIT && count( self::$smCache ) >= self::CACHE_LIMIT ) {
reset( self::$smCache );
}
if( self::CACHE_LIMIT && count( self::$smCache ) >= self::CACHE_LIMIT ) {
reset( self::$smCache );
- unset( self::$smCache[
key( self::$smCache )
] );
+ unset( self::$smCache[
key( self::$smCache )
] );
}
self::$smCache[$prefix] = $iw;
return $iw;
}
self::$smCache[$prefix] = $iw;
return $iw;
@@
-109,7
+110,7
@@
class Interwiki {
$db = CdbReader::open( $wgInterwikiCache );
}
/* Resolve site name */
$db = CdbReader::open( $wgInterwikiCache );
}
/* Resolve site name */
- if( $wgInterwikiScopes
>=
3 && !$site ) {
+ if( $wgInterwikiScopes
>=
3 && !$site ) {
$site = $db->get( '__sites:' . wfWikiID() );
if ( $site == '' ) {
$site = $wgInterwikiFallbackSite;
$site = $db->get( '__sites:' . wfWikiID() );
if ( $site == '' ) {
$site = $wgInterwikiFallbackSite;
@@
-125,8
+126,9
@@
class Interwiki {
if ( $value == '' && $wgInterwikiScopes >= 2 ) {
$value = $db->get( "__global:{$prefix}" );
}
if ( $value == '' && $wgInterwikiScopes >= 2 ) {
$value = $db->get( "__global:{$prefix}" );
}
- if ( $value == 'undef' )
+ if ( $value == 'undef' )
{
$value = '';
$value = '';
+ }
return $value;
}
return $value;
}
@@
-155,7
+157,12
@@
class Interwiki {
__METHOD__ ) );
$iw = Interwiki::loadFromArray( $row );
if ( $iw ) {
__METHOD__ ) );
$iw = Interwiki::loadFromArray( $row );
if ( $iw ) {
- $mc = array( 'iw_url' => $iw->mURL, 'iw_api' => $iw->mAPI, 'iw_local' => $iw->mLocal, 'iw_trans' => $iw->mTrans );
+ $mc = array(
+ 'iw_url' => $iw->mURL,
+ 'iw_api' => $iw->mAPI,
+ 'iw_local' => $iw->mLocal,
+ 'iw_trans' => $iw->mTrans
+ );
$wgMemc->add( $key, $mc, $wgInterwikiExpiry );
return $iw;
}
$wgMemc->add( $key, $mc, $wgInterwikiExpiry );
return $iw;
}
@@
-177,7
+184,7
@@
class Interwiki {
$iw->mTrans = $mc['iw_trans'];
$iw->mAPI = isset( $mc['iw_api'] ) ? $mc['iw_api'] : '';
$iw->mWikiID = isset( $mc['iw_wikiid'] ) ? $mc['iw_wikiid'] : '';
$iw->mTrans = $mc['iw_trans'];
$iw->mAPI = isset( $mc['iw_api'] ) ? $mc['iw_api'] : '';
$iw->mWikiID = isset( $mc['iw_wikiid'] ) ? $mc['iw_wikiid'] : '';
-
+
return $iw;
}
return false;
return $iw;
}
return false;
@@
-185,7
+192,7
@@
class Interwiki {
/**
* Get the URL for a particular title (or with $1 if no title given)
/**
* Get the URL for a particular title (or with $1 if no title given)
- *
+ *
* @param $title String: what text to put for the article name
* @return String: the URL
*/
* @param $title String: what text to put for the article name
* @return String: the URL
*/
@@
-199,19
+206,19
@@
class Interwiki {
/**
* Get the API URL for this wiki
/**
* Get the API URL for this wiki
- *
+ *
* @return String: the URL
*/
* @return String: the URL
*/
- public function getAPI(
) {
+ public function getAPI() {
return $this->mAPI;
}
/**
* Get the DB name for this wiki
return $this->mAPI;
}
/**
* Get the DB name for this wiki
- *
+ *
* @return String: the DB name
*/
* @return String: the DB name
*/
- public function getWikiID(
) {
+ public function getWikiID() {
return $this->mWikiID;
}
return $this->mWikiID;
}