Merge "Return $wgSitename as displayname for local repo in filerepoinfo API"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 5 May 2014 06:38:40 +0000 (06:38 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 5 May 2014 06:38:40 +0000 (06:38 +0000)
1  2 
includes/filerepo/FileRepo.php

@@@ -52,7 -52,7 +52,7 @@@ class FileRepo 
        /** @var FileBackend */
        protected $backend;
  
 -      /** @var Array Map of zones to config */
 +      /** @var array Map of zones to config */
        protected $zones = array();
  
        /** @var string URL of thumb.php */
         * from the URL path, one can configure thumb_handler.php to recognize a special path on the
         * same host name as the wiki that is used for viewing thumbnails.
         *
 -       * @param string $zone one of: public, deleted, temp, thumb
 +       * @param string $zone One of: public, deleted, temp, thumb
         * @return string|bool String or false
         */
        public function getZoneHandlerUrl( $zone ) {
         *
         * @param string $src Source file system path, storage path, or virtual URL
         * @param string $dst Virtual URL or storage path
 -       * @param Array|string|null $options An array consisting of a key named headers
 +       * @param array|string|null $options An array consisting of a key named headers
         *   listing extra headers. If a string, taken as content-disposition header.
         *   (Support for array of options new in 1.23)
         * @return FileRepoStatus
                        // This will check if the archive file also exists and fail if does.
                        // This is a sanity check to avoid data loss. On Windows and Linux,
                        // copy() will overwrite, so the existence check is vulnerable to
 -                      // race conditions unless an functioning LockManager is used.
 +                      // race conditions unless a functioning LockManager is used.
                        // LocalFile also uses SELECT FOR UPDATE for synchronization.
                        $operations[] = array(
                                'op' => 'copy',
         * @param mixed $srcRel Relative path for the file to be deleted
         * @param mixed $archiveRel Relative path for the archive location.
         *   Relative to a private archive directory.
 -       * @return FileRepoStatus object
 +       * @return FileRepoStatus
         */
        public function delete( $srcRel, $archiveRel ) {
                $this->assertWritableRepo(); // fail out if read-only
         * Properties should ultimately be obtained via FSFile::getProps().
         *
         * @param string $virtualUrl
 -       * @return Array
 +       * @return array
         */
        public function getFileProps( $virtualUrl ) {
                $path = $this->resolveToStoragePath( $virtualUrl );
         * Get the size of a file with a given virtual URL/storage path
         *
         * @param string $virtualUrl
 -       * @return integer|bool False on failure
 +       * @return int|bool False on failure
         */
        public function getFileSize( $virtualUrl ) {
                $path = $this->resolveToStoragePath( $virtualUrl );
        /**
         * Determine if a relative path is valid, i.e. not blank or involving directory traveral
         *
 -       * @param $filename string
 +       * @param string $filename
         * @return bool
         */
        public function validateFilename( $filename ) {
        /**
         * Create a new fatal error
         *
 -       * @param $message
 +       * @param string $message
         * @return FileRepoStatus
         */
        public function newFatal( $message /*, parameters...*/ ) {
         * @return string
         */
        public function getDisplayName() {
-               // We don't name our own repo, return nothing
+               global $wgSitename;
                if ( $this->isLocal() ) {
-                       return null;
+                       return $wgSitename;
                }
  
                // 'shared-repo-name-wikimediacommons' is used when $wgUseInstantCommons = true
         * Get the portion of the file that contains the origin file name.
         * If that name is too long, then the name "thumbnail.<ext>" will be given.
         *
 -       * @param $name string
 +       * @param string $name
         * @return string
         */
        public function nameForThumb( $name ) {