Merge "Localisation updates from http://translatewiki.net."
authorReedy <reedy@wikimedia.org>
Tue, 29 May 2012 20:43:36 +0000 (20:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 29 May 2012 20:43:36 +0000 (20:43 +0000)
includes/GlobalFunctions.php
includes/job/JobQueue.php
includes/specials/SpecialEmailuser.php
includes/upload/UploadBase.php
includes/upload/UploadFromChunks.php
includes/upload/UploadFromFile.php
includes/upload/UploadFromStash.php
includes/upload/UploadFromUrl.php
includes/upload/UploadStash.php
maintenance/nextJobDB.php

index cc93aa4..57ab64c 100644 (file)
@@ -2625,11 +2625,7 @@ function wfTempDir() {
                        return $tmp;
                }
        }
-       if( function_exists( 'sys_get_temp_dir' ) ) {
-               return sys_get_temp_dir();
-       }
-       # Usual defaults
-       return wfIsWindows() ? 'C:\Windows\Temp' : '/tmp';
+       return sys_get_temp_dir();
 }
 
 /**
index aa952a9..7a4f0ad 100644 (file)
@@ -113,7 +113,6 @@ abstract class Job {
         * @return Job or false if there's no jobs
         */
        static function pop( $offset = 0 ) {
-               global $wgJobTypesExcludedFromDefaultQueue;
                wfProfileIn( __METHOD__ );
 
                $dbr = wfGetDB( DB_SLAVE );
@@ -124,12 +123,9 @@ abstract class Job {
                        NB: If random fetch previously was used, offset
                                will always be ahead of few entries
                */
-               $conditions = array();
-               if ( count( $wgJobTypesExcludedFromDefaultQueue ) != 0 ) {
-                       foreach ( $wgJobTypesExcludedFromDefaultQueue as $cmdType ) {
-                               $conditions[] = "job_cmd != " . $dbr->addQuotes( $cmdType );
-                       }
-               }
+
+               $conditions = self::defaultQueueConditions();
+
                $offset = intval( $offset );
                $options = array( 'ORDER BY' => 'job_id', 'USE INDEX' => 'PRIMARY' );
 
@@ -319,6 +315,26 @@ abstract class Job {
                wfIncrStats( 'job-insert', count( $jobs ) );
        }
 
+
+       /**
+        * SQL conditions to apply on most JobQueue queries
+        *
+        * Whenever we exclude jobs types from the default queue, we want to make
+        * sure that queries to the job queue actually ignore them.
+        *
+        * @return array SQL conditions suitable for Database:: methods
+        */
+       static function defaultQueueConditions( ) {
+               global $wgJobTypesExcludedFromDefaultQueue;
+               $conditions = array();
+               if ( count( $wgJobTypesExcludedFromDefaultQueue ) > 0 ) {
+                       foreach ( $wgJobTypesExcludedFromDefaultQueue as $cmdType ) {
+                               $conditions[] = "job_cmd != " . $dbr->addQuotes( $cmdType );
+                       }
+               }
+               return $conditions;
+       }
+
        /*-------------------------------------------------------------------------
         * Non-static functions
         *------------------------------------------------------------------------*/
index 55b500d..2ab02cb 100644 (file)
@@ -254,7 +254,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
         * or maybe even true on success if anything uses the EmailUser hook.
         */
        public static function submit( array $data, IContextSource $context ) {
-               global $wgUser, $wgUserEmailUseReplyTo;
+               global $wgUserEmailUseReplyTo;
 
                $target = self::getTarget( $data['Target'] );
                if( !$target instanceof User ) {
index a4de98a..8eb2781 100644 (file)
@@ -1,4 +1,26 @@
 <?php
+/**
+ * Base class for the backend of file upload.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Upload
+ */
+
 /**
  * @defgroup Upload
  */
index 11780e4..e50c6da 100644 (file)
@@ -1,4 +1,26 @@
 <?php
+/**
+ * Backend for uploading files from chunks.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Upload
+ */
+
 /**
  * Implements uploading from chunks
  *
index 234fde8..fae9974 100644 (file)
@@ -1,4 +1,26 @@
 <?php
+/**
+ * Backend for regular file upload.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Upload
+ */
+
 /**
  * Implements regular file uploads
  *
index 317dd55..d5cce14 100644 (file)
@@ -1,4 +1,26 @@
 <?php
+/**
+ * Backend for uploading files from previously stored file.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Upload
+ */
+
 /**
  * Implements uploading from previously stored file.
  *
index 49bfb91..c7e482e 100644 (file)
@@ -1,4 +1,26 @@
 <?php
+/**
+ * Backend for uploading files from a HTTP resource.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Upload
+ */
+
 /**
  * Implements uploading from a HTTP resource.
  *
index e347408..12531c2 100644 (file)
@@ -1,4 +1,26 @@
 <?php
+/**
+ * Temporary storage for uploaded files.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup Upload
+ */
+
 /**
  * UploadStash is intended to accomplish a few things:
  *   - enable applications to temporarily stash files without publishing them to the wiki.
index 67aa308..d9bd3b8 100644 (file)
@@ -94,11 +94,12 @@ class nextJobDB extends Maintenance {
                $lb = wfGetLB( $dbName );
                $db = $lb->getConnection( DB_MASTER, array(), $dbName );
                if ( $type === false ) {
-                       $conds = array();
+                       $conds = JobQueue::defaultQueueConditions( );
                } else {
                        $conds = array( 'job_cmd' => $type );
                }
 
+
                $exists = (bool) $db->selectField( 'job', '1', $conds, __METHOD__ );
                $lb->reuseConnection( $db );
                return $exists;