Merge "Revert "Adding sanity check to Title::isRedirect().""
[lhc/web/wiklou.git] / includes / upload / UploadFromChunks.php
index f047b14..e50c6da 100644 (file)
@@ -1,12 +1,32 @@
 <?php
 /**
- * Implements uploading from chunks
+ * 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
- * @author Michael Dale
+ * @ingroup Upload
  */
 
+/**
+ * Implements uploading from chunks
+ *
+ * @ingroup Upload
+ * @author Michael Dale
+ */
 class UploadFromChunks extends UploadFromFile {
        protected $mOffset, $mChunkIndex, $mFileKey, $mVirtualTempPath;
        
@@ -130,7 +150,8 @@ class UploadFromChunks extends UploadFromFile {
 
        /**
         * Returns the virtual chunk location:  
-        * @param unknown_type $index
+        * @param $index
+        * @return string
         */
        function getVirtualChunkLocation( $index ){
                return $this->repo->getVirtualUrl( 'temp' ) . 
@@ -140,12 +161,13 @@ class UploadFromChunks extends UploadFromFile {
                                ) . 
                                $this->getChunkFileKey( $index );
        }
+
        /**
         * Add a chunk to the temporary directory
         *
-        * @param $chunkPath path to temporary chunk file
-        * @param $chunkSize size of the current chunk
-        * @param $offset offset of current chunk ( mutch match database chunk offset ) 
+        * @param $chunkPath string path to temporary chunk file
+        * @param $chunkSize int size of the current chunk
+        * @param $offset int offset of current chunk ( mutch match database chunk offset )
         * @return Status
         */
        public function addChunk( $chunkPath, $chunkSize, $offset ) {
@@ -242,6 +264,7 @@ class UploadFromChunks extends UploadFromFile {
         * Output the chunk to disk
         * 
         * @param $chunkPath string
+        * @return FileRepoStatus
         */
        private function outputChunk( $chunkPath ){
                // Key is fileKey + chunk index