]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/compressor/class_Bzip2Compressor.php
Minor: Comments improved
[core.git] / inc / classes / main / compressor / class_Bzip2Compressor.php
index 6e9fb8440a8aa7c353a0695d1dd491488922973a..32991b81273322f985f9a7b592a54acdbc97b15b 100644 (file)
@@ -33,9 +33,9 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
        }
 
        /**
-        * Create a new compressor channel based a given compression handler
+        * Create a new compressor channel based a given compression handler or NULL if the required PHP functions are not found.
         *
-        * @return      $compressorInstance             An instance of this class
+        * @return      $compressorInstance             An instance of this class or NULL if the required PHP functions are not found.
         */
        public static final function createBzip2Compressor () {
                // Routines not found by default
@@ -55,7 +55,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
         * BZIP2 compression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The compressed stream data      
+        * @return      $streamData             The compressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function compressStream ($streamData) {
@@ -72,7 +72,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
         * BZIP2 decompression stream
         *
         * @param       $streamData             Mixed non-object stream data
-        * @return      $streamData             The decompressed stream data    
+        * @return      $streamData             The decompressed stream data
         * @throws      InvalidObjectException  If the stream is an object
         */
        public function decompressStream ($streamData) {
@@ -81,14 +81,17 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
                        throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
                } // END - if
 
+               // Decompress it
+               $streamData = bzdecompress($streamData, true);
+
                // Return the decompressed stream
-               return bzdecompress($streamData);
+               return $streamData;
        }
 
        /**
         * Getter for the file extension of this compressor
         *
-        * @return      $string         Returns always "bz2"
+        * @return      $string         Returns always 'bz2'
         */
        public final function getCompressorExtension () {
                return 'bz2';