Merge "Added a --cache option to mctest.php and mcc.php."
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 15 Mar 2013 13:56:43 +0000 (13:56 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 15 Mar 2013 13:56:43 +0000 (13:56 +0000)
RELEASE-NOTES-1.21
includes/DefaultSettings.php
includes/cache/MessageCache.php
includes/specials/SpecialActiveusers.php
includes/upload/UploadFromChunks.php
maintenance/mwdocgen.php

index e7e718d..fe7f95c 100644 (file)
@@ -203,6 +203,7 @@ production.
 * (bug 44719) Removed mention of non-existing maintenance/migrateCurStubs.php
   script in includes/DefaultSettings.php
 * (bug 45143) jquery.badge: Treat non-Latin variants of zero as zero as well.
+* (bug 46151) mwdocgen.php should not ignore exit code of doxygen command.
 
 === API changes in 1.21 ===
 * prop=revisions can now report the contentmodel and contentformat.
index 5d051d7..cefd882 100644 (file)
@@ -55,13 +55,19 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 /**
  * wgConf hold the site configuration.
  * Not used for much in a default install.
+ * @since 1.5
  */
 $wgConf = new SiteConfiguration;
 
-/** MediaWiki version number */
+/**
+ * MediaWiki version number
+ * @since 1.2
+ */
 $wgVersion = '1.21alpha';
 
-/** Name of the site. It must be changed in LocalSettings.php */
+/**
+ * Name of the site. It must be changed in LocalSettings.php
+ */
 $wgSitename = 'MediaWiki';
 
 /**
@@ -87,6 +93,7 @@ $wgServer = WebRequest::detectServer();
  * Must be fully qualified, even if $wgServer is protocol-relative.
  *
  * Defaults to $wgServer, expanded to a fully qualified http:// URL if needed.
+ * @since 1.18
  */
 $wgCanonicalServer = false;
 
@@ -121,6 +128,7 @@ $wgScriptPath = '/wiki';
  * The default $wgArticlePath will be set based on this value at runtime, but if
  * you have customized it, having this incorrectly set to true can cause
  * redirect loops when "pretty URLs" are used.
+ * @since 1.2.1
  */
 $wgUsePathInfo = ( strpos( PHP_SAPI, 'cgi' ) === false ) &&
        ( strpos( PHP_SAPI, 'apache2filter' ) === false ) &&
@@ -132,6 +140,7 @@ $wgUsePathInfo = ( strpos( PHP_SAPI, 'cgi' ) === false ) &&
  *
  * Some hosting providers use PHP 4 for *.php files, and PHP 5 for *.php5. This
  * variable is provided to support those providers.
+ * @since 1.11
  */
 $wgScriptExtension = '.php';
 
@@ -174,12 +183,14 @@ $wgRedirectScript = false;
  * The URL path to load.php.
  *
  * Defaults to "{$wgScriptPath}/load{$wgScriptExtension}".
+ * @since 1.17
  */
 $wgLoadScript = false;
 
 /**
  * The URL path of the skins directory.
  * Defaults to "{$wgScriptPath}/skins".
+ * @since 1.3
  */
 $wgStylePath = false;
 $wgStyleSheetPath = &$wgStylePath;
@@ -187,6 +198,7 @@ $wgStyleSheetPath = &$wgStylePath;
 /**
  * The URL path of the skins directory. Should not point to an external domain.
  * Defaults to "{$wgScriptPath}/skins".
+ * @since 1.17
  */
 $wgLocalStylePath = false;
 
@@ -200,6 +212,7 @@ $wgExtensionAssetsPath = false;
 /**
  * Filesystem stylesheets directory.
  * Defaults to "{$IP}/skins".
+ * @since 1.3
  */
 $wgStyleDirectory = false;
 
@@ -237,12 +250,14 @@ $wgLogo = false;
 
 /**
  * The URL path of the shortcut icon.
+ * @since 1.6
  */
 $wgFavicon = '/favicon.ico';
 
 /**
  * The URL path of the icon for iPhone and iPod Touch web app bookmarks.
  * Defaults to no icon.
+ * @since 1.12
  */
 $wgAppleTouchIcon = false;
 
@@ -266,6 +281,7 @@ $wgTmpDirectory = false;
 /**
  * If set, this URL is added to the start of $wgUploadPath to form a complete
  * upload URL.
+ * @since 1.4
  */
 $wgUploadBaseUrl = '';
 
@@ -274,6 +290,7 @@ $wgUploadBaseUrl = '';
  * Full thumbnail URL will be like $wgUploadStashScalerBaseUrl/e/e6/Foo.jpg/123px-Foo.jpg
  * where 'e6' are the first two characters of the MD5 hash of the file name.
  * If $wgUploadStashScalerBaseUrl is set to false, thumbs are rendered locally as needed.
+ * @since 1.17
  */
 $wgUploadStashScalerBaseUrl = false;
 
@@ -289,6 +306,7 @@ $wgUploadStashScalerBaseUrl = false;
  *
  * There must be an appropriate script or rewrite rule in place to handle these
  * URLs.
+ * @since 1.5
  */
 $wgActionPaths = array();
 
index 6e9d413..7425978 100644 (file)
@@ -327,31 +327,39 @@ class MessageCache {
                        $where[] = 'cache is empty';
                        $where[] = 'loading from database';
 
-                       $this->lock( $cacheKey );
+                       if ( $this->lock( $cacheKey ) ) {
+                               $that = $this;
+                               $osc = new ScopedCallback( function() use ( $that, $cacheKey ) {
+                                       $that->unlock( $cacheKey );
+                               } );
+                       }
                        # Limit the concurrency of loadFromDB to a single process
                        # This prevents the site from going down when the cache expires
                        $statusKey = wfMemcKey( 'messages', $code, 'status' );
                        $success = $this->mMemc->add( $statusKey, 'loading', MSG_LOAD_TIMEOUT );
                        if ( $success ) { // acquired lock
+                               $cache = $this->mMemc;
+                               $isc = new ScopedCallback( function() use ( $cache, $statusKey ) {
+                                       $cache->delete( $statusKey );
+                               } );
                                $cache = $this->loadFromDB( $code );
                                $success = $this->setCache( $cache, $code );
                                if ( $success ) { // messages loaded
                                        $success = $this->saveToCaches( $cache, true, $code );
-                                       if ( $success ) {
-                                               $this->mMemc->delete( $statusKey );
-                                       } else {
+                                       $isc = null; // unlock
+                                       if ( !$success ) {
                                                $this->mMemc->set( $statusKey, 'error', 60 * 5 );
                                                wfDebug( __METHOD__ . ": set() error: restart memcached server!\n" );
                                                $exception = new MWException( "Could not save cache for '$code'." );
                                        }
                                } else {
-                                       $this->mMemc->delete( $statusKey );
+                                       $isc = null; // unlock
                                        $exception = new MWException( "Could not load cache from DB for '$code'." );
                                }
                        } else {
                                $exception = new MWException( "Could not acquire '$statusKey' lock." );
                        }
-                       $this->unlock( $cacheKey );
+                       $osc = null; // unlock
                }
 
                if ( !$success ) {
index 20da4a3..c9c82ad 100644 (file)
@@ -97,17 +97,19 @@ class ActiveUsersPager extends UsersPager {
                        $conds[] = 'ipb_deleted IS NULL OR ipb_deleted = 0'; // don't show hidden names
                }
                $conds[] = 'rc_log_type IS NULL OR rc_log_type != ' . $dbr->addQuotes( 'newusers' );
-               $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes( $dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge*24*3600 ) );
+               $conds[] = 'rc_timestamp >= ' . $dbr->addQuotes(
+                       $dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge*24*3600 ) );
 
                if( $this->requestedUser != '' ) {
                        $conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser );
                }
 
-               $query = array(
-                       'tables' => array( 'recentchanges', 'user', 'ipblocks' ),
-                       'fields' => array( 'user_name' => 'rc_user_text', // inheritance
+               return array(
+                       'tables' => array( 'recentchanges', 'ipblocks' ),
+                       'fields' => array(
+                               'user_name' => 'rc_user_text', // for Pager inheritance
                                'rc_user_text', // for Pager
-                               'user_id',
+                               'user_id' => 'rc_user',
                                'recentedits' => 'COUNT(*)',
                                'ipb_deleted' => 'MAX(ipb_deleted)'
                        ),
@@ -115,16 +117,14 @@ class ActiveUsersPager extends UsersPager {
                                'GROUP BY' => array( 'rc_user_text', 'user_id' ),
                                'USE INDEX' => array( 'recentchanges' => 'rc_user_text' )
                        ),
-                       'join_conds' => array(
-                               'user' => array( 'INNER JOIN', 'rc_user_text=user_name' ),
+                       'join_conds' => array( // check for suppression blocks
                                'ipblocks' => array( 'LEFT JOIN', array(
-                                       'user_id=ipb_user',
-                                       'ipb_auto' => 0
+                                       'rc_user=ipb_user',
+                                       'ipb_auto' => 0 # avoid duplicate blocks
                                )),
                        ),
                        'conds' => $conds
                );
-               return $query;
        }
 
        function formatRow( $row ) {
index fb0c786..e784e51 100644 (file)
@@ -66,7 +66,7 @@ class UploadFromChunks extends UploadFromFile {
         *
         * @return UploadStashFile stashed file
         */
-       public function stashFile() {
+       public function stashFile( User $user = null ) {
                // Stash file is the called on creating a new chunk session:
                $this->mChunkIndex = 0;
                $this->mOffset = 0;
index 5e505eb..4fad7a7 100644 (file)
@@ -63,6 +63,8 @@ $doxygenInputFilter = "php {$mwPath}maintenance/mwdoc-filter.php";
 /** where Phpdoc should output documentation */
 $doxyOutput = $mwPath . 'docs' . DIRECTORY_SEPARATOR ;
 
+$doxyVersion = 'master';
+
 /** MediaWiki subpaths */
 $mwPathI = $mwPath . 'includes/';
 $mwPathL = $mwPath . 'languages/';
@@ -164,6 +166,12 @@ if ( is_array( $argv ) ) {
                                $doxyOutput = realpath( $argv[$i] );
                        }
                        break;
+               case '--version':
+                       $i++;
+                       if ( isset( $argv[$i] ) ) {
+                               $doxyVersion = $argv[$i];
+                       }
+                       break;
                case '--generate-man':
                        $doxyGenerateMan = true;
                        break;
@@ -183,8 +191,9 @@ Commands:
 If no command is given, you will be prompted.
 
 Other options:
-    --output <dir>  Set output directory (default $doxyOutput)
+    --output <dir>  Set output directory (default: $doxyOutput)
     --generate-man  Generates man page documentation
+    --version       Project version to display in the outut (default: $doxyVersion)
     --help          Show this help and exit.
 
 
@@ -234,14 +243,11 @@ case 6:
        $excludePatterns = 'extensions';
 }
 
-// @todo FIXME to work on git
-$version = 'master';
-
 // Generate path exclusions
 $excludedPaths = $mwPath . join( " $mwPath", $mwExcludePaths );
 print "EXCLUDE: $excludedPaths\n\n";
 
-$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $version, $input, $excludedPaths, $excludePatterns, $doxyGenerateMan, $doxygenInputFilter );
+$generatedConf = generateConfigFile( $doxygenTemplate, $doxyOutput, $mwPath, $doxyVersion, $input, $excludedPaths, $excludePatterns, $doxyGenerateMan, $doxygenInputFilter );
 $command = $doxygenBin . ' ' . $generatedConf;
 
 echo <<<TEXT
@@ -254,7 +260,8 @@ $command
 
 TEXT;
 
-passthru( $command );
+$exitcode = 1;
+passthru( $command, $exitcode );
 
 echo <<<TEXT
 ---------------------------------------------------
@@ -264,3 +271,5 @@ Check above for possible errors.
 You might want to delete the temporary file $generatedConf
 
 TEXT;
+
+exit( $exitcode );