[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move FSFile classes to /fsfile

2016-10-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Move FSFile classes to /fsfile
..


Move FSFile classes to /fsfile

Change-Id: I21f3a9ac52b1f953ca09da0705cac868785193e1
---
M autoload.php
R includes/libs/filebackend/fsfile/FSFile.php
R includes/libs/filebackend/fsfile/TempFSFile.php
3 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/autoload.php b/autoload.php
index 1beb00c..3a2d06f 100644
--- a/autoload.php
+++ b/autoload.php
@@ -436,7 +436,7 @@
'ExternalStoreHttp' => __DIR__ . 
'/includes/externalstore/ExternalStoreHttp.php',
'ExternalStoreMedium' => __DIR__ . 
'/includes/externalstore/ExternalStoreMedium.php',
'ExternalStoreMwstore' => __DIR__ . 
'/includes/externalstore/ExternalStoreMwstore.php',
-   'FSFile' => __DIR__ . '/includes/libs/filebackend/FSFile.php',
+   'FSFile' => __DIR__ . '/includes/libs/filebackend/fsfile/FSFile.php',
'FSFileBackend' => __DIR__ . 
'/includes/libs/filebackend/FSFileBackend.php',
'FSFileBackendDirList' => __DIR__ . 
'/includes/libs/filebackend/FSFileBackend.php',
'FSFileBackendFileList' => __DIR__ . 
'/includes/libs/filebackend/FSFileBackend.php',
@@ -1415,7 +1415,7 @@
'TableDiffFormatter' => __DIR__ . 
'/includes/diff/TableDiffFormatter.php',
'TablePager' => __DIR__ . '/includes/pager/TablePager.php',
'TagLogFormatter' => __DIR__ . '/includes/logging/TagLogFormatter.php',
-   'TempFSFile' => __DIR__ . '/includes/libs/filebackend/TempFSFile.php',
+   'TempFSFile' => __DIR__ . 
'/includes/libs/filebackend/fsfile/TempFSFile.php',
'TempFileRepo' => __DIR__ . '/includes/filerepo/FileRepo.php',
'TemplateParser' => __DIR__ . '/includes/TemplateParser.php',
'TemplatesOnThisPageFormatter' => __DIR__ . 
'/includes/TemplatesOnThisPageFormatter.php',
diff --git a/includes/libs/filebackend/FSFile.php 
b/includes/libs/filebackend/fsfile/FSFile.php
similarity index 100%
rename from includes/libs/filebackend/FSFile.php
rename to includes/libs/filebackend/fsfile/FSFile.php
diff --git a/includes/libs/filebackend/TempFSFile.php 
b/includes/libs/filebackend/fsfile/TempFSFile.php
similarity index 100%
rename from includes/libs/filebackend/TempFSFile.php
rename to includes/libs/filebackend/fsfile/TempFSFile.php

-- 
To view, visit https://gerrit.wikimedia.org/r/316717
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I21f3a9ac52b1f953ca09da0705cac868785193e1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: BryanDavis 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Move FSFile classes to /fsfile

2016-10-18 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316717

Change subject: Move FSFile classes to /fsfile
..

Move FSFile classes to /fsfile

Change-Id: I21f3a9ac52b1f953ca09da0705cac868785193e1
---
M autoload.php
D includes/libs/filebackend/FSFile.php
D includes/libs/filebackend/TempFSFile.php
3 files changed, 2 insertions(+), 421 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/316717/1

diff --git a/autoload.php b/autoload.php
index 1beb00c..3a2d06f 100644
--- a/autoload.php
+++ b/autoload.php
@@ -436,7 +436,7 @@
'ExternalStoreHttp' => __DIR__ . 
'/includes/externalstore/ExternalStoreHttp.php',
'ExternalStoreMedium' => __DIR__ . 
'/includes/externalstore/ExternalStoreMedium.php',
'ExternalStoreMwstore' => __DIR__ . 
'/includes/externalstore/ExternalStoreMwstore.php',
-   'FSFile' => __DIR__ . '/includes/libs/filebackend/FSFile.php',
+   'FSFile' => __DIR__ . '/includes/libs/filebackend/fsfile/FSFile.php',
'FSFileBackend' => __DIR__ . 
'/includes/libs/filebackend/FSFileBackend.php',
'FSFileBackendDirList' => __DIR__ . 
'/includes/libs/filebackend/FSFileBackend.php',
'FSFileBackendFileList' => __DIR__ . 
'/includes/libs/filebackend/FSFileBackend.php',
@@ -1415,7 +1415,7 @@
'TableDiffFormatter' => __DIR__ . 
'/includes/diff/TableDiffFormatter.php',
'TablePager' => __DIR__ . '/includes/pager/TablePager.php',
'TagLogFormatter' => __DIR__ . '/includes/logging/TagLogFormatter.php',
-   'TempFSFile' => __DIR__ . '/includes/libs/filebackend/TempFSFile.php',
+   'TempFSFile' => __DIR__ . 
'/includes/libs/filebackend/fsfile/TempFSFile.php',
'TempFileRepo' => __DIR__ . '/includes/filerepo/FileRepo.php',
'TemplateParser' => __DIR__ . '/includes/TemplateParser.php',
'TemplatesOnThisPageFormatter' => __DIR__ . 
'/includes/TemplatesOnThisPageFormatter.php',
diff --git a/includes/libs/filebackend/FSFile.php 
b/includes/libs/filebackend/FSFile.php
deleted file mode 100644
index dacad1c..000
--- a/includes/libs/filebackend/FSFile.php
+++ /dev/null
@@ -1,223 +0,0 @@
-http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup FileBackend
- */
-
-/**
- * Class representing a non-directory file on the file system
- *
- * @ingroup FileBackend
- */
-class FSFile {
-   /** @var string Path to file */
-   protected $path;
-
-   /** @var string File SHA-1 in base 36 */
-   protected $sha1Base36;
-
-   /**
-* Sets up the file object
-*
-* @param string $path Path to temporary file on local disk
-*/
-   public function __construct( $path ) {
-   $this->path = $path;
-   }
-
-   /**
-* Returns the file system path
-*
-* @return string
-*/
-   public function getPath() {
-   return $this->path;
-   }
-
-   /**
-* Checks if the file exists
-*
-* @return bool
-*/
-   public function exists() {
-   return is_file( $this->path );
-   }
-
-   /**
-* Get the file size in bytes
-*
-* @return int|bool
-*/
-   public function getSize() {
-   return filesize( $this->path );
-   }
-
-   /**
-* Get the file's last-modified timestamp
-*
-* @return string|bool TS_MW timestamp or false on failure
-*/
-   public function getTimestamp() {
-   MediaWiki\suppressWarnings();
-   $timestamp = filemtime( $this->path );
-   MediaWiki\restoreWarnings();
-   if ( $timestamp !== false ) {
-   $timestamp = wfTimestamp( TS_MW, $timestamp );
-   }
-
-   return $timestamp;
-   }
-
-   /**
-* Get an associative array containing information about
-* a file with the given storage path.
-*
-* Resulting array fields include:
-*   - fileExists
-*   - size (filesize in bytes)
-*   - mime (as major/minor)
-*   - file-mime (as major/minor)
-*   - sha1 (in base 36)
-*   - major_mime
-*   - minor_mime
-*
-* @param string|bool $ext The file extension, or true to extract it 
from the filename.
-* Set it to false to ignore the extension. Currently 
unused.
-* @return array
-*/
-   public function getProps( $ext = true ) {
-   $info = self::placeholderProps();
-   $info['fileExists'] = $this->exists();
-
-   if ( $info['fileExists'] ) {
-   $info['size'] = $this->getSize(); // bytes
-   $info['sha1'] = $this->getSha1Base36();
-
-   $mime = mime_content_type( $this->path );
-   # MIME type