diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
commit | c9aa36da061816dee256a979c2ff8d2ee41824d9 (patch) | |
tree | 29f7002b80ee984b488bd047dbbd80b36bf892e9 /includes/site/SiteSQLStore.php | |
parent | b4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff) | |
parent | d1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff) |
Merge branch 'archwiki'
# Conflicts:
# skins/ArchLinux.php
# skins/ArchLinux/archlogo.gif
Diffstat (limited to 'includes/site/SiteSQLStore.php')
-rw-r--r-- | includes/site/SiteSQLStore.php | 52 |
1 files changed, 20 insertions, 32 deletions
diff --git a/includes/site/SiteSQLStore.php b/includes/site/SiteSQLStore.php index 11141e07..d1334680 100644 --- a/includes/site/SiteSQLStore.php +++ b/includes/site/SiteSQLStore.php @@ -29,7 +29,6 @@ * @author Jeroen De Dauw < jeroendedauw@gmail.com > */ class SiteSQLStore implements SiteStore { - /** * @since 1.21 * @@ -90,7 +89,7 @@ class SiteSQLStore implements SiteStore { * * @see SiteList::getSerialVersionId * - * @return String The cache key. + * @return string The cache key. */ protected function getCacheKey() { wfProfileIn( __METHOD__ ); @@ -115,7 +114,7 @@ class SiteSQLStore implements SiteStore { * * @since 1.21 * - * @param string $source either 'cache' or 'recache' + * @param string $source Either 'cache' or 'recache' * * @return SiteList */ @@ -169,7 +168,10 @@ class SiteSQLStore implements SiteStore { } if ( $siteRow->hasField( 'language' ) ) { - $site->setLanguageCode( $siteRow->getField( 'language' ) === '' ? null : $siteRow->getField( 'language' ) ); + $site->setLanguageCode( $siteRow->getField( 'language' ) === '' + ? null + : $siteRow->getField( 'language' ) + ); } if ( $siteRow->hasField( 'source' ) ) { @@ -193,7 +195,7 @@ class SiteSQLStore implements SiteStore { * * @since 1.22 * - * @param Site + * @param Site $site * * @return ORMRow */ @@ -287,7 +289,7 @@ class SiteSQLStore implements SiteStore { * * @param Site $site * - * @return boolean Success indicator + * @return bool Success indicator */ public function saveSite( Site $site ) { return $this->saveSites( array( $site ) ); @@ -300,7 +302,7 @@ class SiteSQLStore implements SiteStore { * * @param Site[] $sites * - * @return boolean Success indicator + * @return bool Success indicator */ public function saveSites( array $sites ) { wfProfileIn( __METHOD__ ); @@ -312,11 +314,7 @@ class SiteSQLStore implements SiteStore { $dbw = $this->sitesTable->getWriteDbConnection(); - $trx = $dbw->trxLevel(); - - if ( $trx == 0 ) { - $dbw->begin( __METHOD__ ); - } + $dbw->startAtomic( __METHOD__ ); $success = true; @@ -358,9 +356,7 @@ class SiteSQLStore implements SiteStore { ); } - if ( $trx == 0 ) { - $dbw->commit( __METHOD__ ); - } + $dbw->endAtomic( __METHOD__ ); // purge cache $this->reset(); @@ -390,24 +386,16 @@ class SiteSQLStore implements SiteStore { * * @see SiteStore::clear() * - * @return bool success + * @return bool Success */ public function clear() { wfProfileIn( __METHOD__ ); $dbw = $this->sitesTable->getWriteDbConnection(); - $trx = $dbw->trxLevel(); - - if ( $trx == 0 ) { - $dbw->begin( __METHOD__ ); - } - + $dbw->startAtomic( __METHOD__ ); $ok = $dbw->delete( 'sites', '*', __METHOD__ ); $ok = $dbw->delete( 'site_identifiers', '*', __METHOD__ ) && $ok; - - if ( $trx == 0 ) { - $dbw->commit( __METHOD__ ); - } + $dbw->endAtomic( __METHOD__); $this->reset(); @@ -458,7 +446,7 @@ class SiteSQLStore implements SiteStore { } /** - * @deprecated + * @deprecated since 1.21 */ class Sites extends SiteSQLStore { @@ -466,9 +454,9 @@ class Sites extends SiteSQLStore { * Factory for creating new site objects. * * @since 1.21 - * @deprecated + * @deprecated since 1.21 * - * @param string|boolean false $globalId + * @param string|bool $globalId * * @return Site */ @@ -483,7 +471,7 @@ class Sites extends SiteSQLStore { } /** - * @deprecated + * @deprecated since 1.21 * @return SiteStore */ public static function singleton() { @@ -497,11 +485,11 @@ class Sites extends SiteSQLStore { } /** - * @deprecated + * @deprecated since 1.21 + * @param string $group * @return SiteList */ public function getSiteGroup( $group ) { return $this->getSites()->getGroup( $group ); } - } |