Merge "Fix number of parameters passed on recursive function call"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 28 Feb 2014 16:30:34 +0000 (16:30 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 28 Feb 2014 16:30:34 +0000 (16:30 +0000)
includes/DefaultSettings.php
includes/Wiki.php
includes/htmlform/HTMLFormField.php
resources/mediawiki.api/mediawiki.api.js
resources/mediawiki.less/mediawiki.mixins.animation.less [new file with mode: 0644]
resources/mediawiki.less/mediawiki.mixins.rotation.less

index b9b471c..1dae5e7 100644 (file)
@@ -5104,11 +5104,6 @@ $wgUDPProfilerPort = '3811';
  */
 $wgUDPProfilerFormatString = "%s - %d %f %f %f %f %s\n";
 
-/**
- * Detects non-matching wfProfileIn/wfProfileOut calls
- */
-$wgDebugProfiling = false;
-
 /**
  * Output debug message on every wfProfileIn/wfProfileOut
  */
index fb46d80..0f6a0b8 100644 (file)
@@ -621,7 +621,7 @@ class MediaWiki {
         * the socket once it's done.
         */
        protected function triggerJobs() {
-               global $wgJobRunRate, $wgServer, $wgScriptPath, $wgScriptExtension;
+               global $wgJobRunRate, $wgServer, $wgScriptPath, $wgScriptExtension, $wgEnableAPI;
 
                if ( $wgJobRunRate <= 0 || wfReadOnly() ) {
                        return;
@@ -643,16 +643,30 @@ class MediaWiki {
                        'tasks' => 'jobs', 'maxjobs' => $n, 'sigexpiry' => time() + 5 );
                $query['signature'] = ApiRunJobs::getQuerySignature( $query );
 
+               // Slow job running method in case of API or socket functions being disabled
+               $fallback = function() use ( $query ) {
+                       $api = new ApiMain( new FauxRequest( $query, true ) );
+                       $api->execute();
+               };
+
+               if ( !$wgEnableAPI ) {
+                       $fallback();
+                       return;
+               }
+
                $errno = $errstr = null;
                $info = wfParseUrl( $wgServer );
+               wfSuppressWarnings();
                $sock = fsockopen(
                        $info['host'],
                        isset( $info['port'] ) ? $info['port'] : 80,
                        $errno,
                        $errstr
                );
+               wfRestoreWarnings();
                if ( !$sock ) {
                        wfDebugLog( 'runJobs', "Failed to start cron API (socket error $errno): $errstr\n" );
+                       $fallback();
                        return;
                }
 
@@ -661,7 +675,7 @@ class MediaWiki {
 
                wfDebugLog( 'runJobs', "Running $n job(s) via '$url'\n" );
                // Send a cron API request to be performed in the background.
-               // Give up if this takes to long to send (which should be rare).
+               // Give up if this takes too long to send (which should be rare).
                stream_set_timeout( $sock, 1 );
                $bytes = fwrite( $sock, $req );
                if ( $bytes !== strlen( $req ) ) {
index 7be911c..e6d316c 100644 (file)
@@ -558,7 +558,7 @@ abstract class HTMLFormField {
                                $this->mOptions = self::forceToStringRecursive( $this->mParams['options'] );
                        } elseif ( array_key_exists( 'options-message', $this->mParams ) ) {
                                /** @todo This is copied from Xml::listDropDown(), deprecate/avoid duplication? */
-                               $message = $this->msg( $this->mParams['options-message'] )->plain();
+                               $message = $this->msg( $this->mParams['options-message'] )->inContentLanguage()->plain();
 
                                $optgroup = false;
                                $this->mOptions = array();
index 3032f78..0024f4b 100644 (file)
                        apiPromise = this.get( {
                                        action: 'tokens',
                                        type: type
-                               }, {
-                                       // Due to the API assuming we're logged out if we pass the callback-parameter,
-                                       // we have to disable jQuery's callback system, and instead parse JSON string,
-                                       // by setting 'jsonp' to false.
-                                       // TODO: This concern seems genuine but no other module has it. Is it still
-                                       // needed and/or should we pass this by default?
                                } )
                                .done( function ( data ) {
                                        // If token type is not available for this user,
diff --git a/resources/mediawiki.less/mediawiki.mixins.animation.less b/resources/mediawiki.less/mediawiki.mixins.animation.less
new file mode 100644 (file)
index 0000000..ec3cddc
--- /dev/null
@@ -0,0 +1,12 @@
+.animation (...) {
+       -webkit-animation: @arguments;
+       -moz-animation: @arguments;
+       -o-animation: @arguments;
+       animation: @arguments;
+}
+
+.transform-rotate (@deg) {
+       -webkit-transform: rotate(@deg);
+       -moz-transform: rotate(@deg);
+       transform: rotate(@deg);
+}
\ No newline at end of file
index 82de5de..e28b333 100644 (file)
@@ -1,31 +1,33 @@
 // This is a separate file because importing the mixin causes
 // the keyframes blocks to be included in the output, regardless
 // of whether .rotation is used.
-@-webkit-keyframes rotate {
+@import "mediawiki.mixins.animation";
+
+.rotate-frames () {
        from {
-               -webkit-transform:rotate(0deg);
+               .transform-rotate(0deg);
        }
        to {
-               -webkit-transform:rotate(360deg);
+               .transform-rotate(360deg);
        }
 }
 
+@-webkit-keyframes rotate {
+       .rotate-frames;
+}
+
+@-moz-keyframes rotate {
+       .rotate-frames;
+}
+
+@-o-keyframes rotate {
+       .rotate-frames;
+}
+
 @keyframes rotate {
-       from {
-               transform: rotate(0deg);
-       }
-       to {
-               transform: rotate(360deg);
-       }
+       .rotate-frames;
 }
 
-.rotation(@time) {
-       -webkit-animation-name: rotate;
-       -webkit-animation-duration: @time;
-       -webkit-animation-iteration-count: infinite;
-       -webkit-animation-timing-function: linear;
-       animation-name: rotate;
-       animation-duration: @time;
-       animation-iteration-count: infinite;
-       animation-timing-function: linear;
+.rotation( @time ) {
+       .animation(rotate, @time, infinite, linear);
 }