/**
* Create a new compressor channel based a given compression handler
*
- * @return $cInstance An instance of this class
+ * @return $compressorInstance An instance of this class
*/
public static final function createBzip2Compressor () {
+ // Routines not found by default
+ $compressorInstance = null;
+
// Get new instance
if ((function_exists('bzcompress')) && (function_exists('bzdecompress'))) {
// Compressor can maybe be used
- $cInstance = new Bzip2Compressor();
- } else {
- // Routines not found!
- $cInstance = null;
- }
+ $compressorInstance = new Bzip2Compressor();
+ } // END - if
// Return the compressor instance
- return $cInstance;
+ return $compressorInstance;
}
/**
if (is_object($streamData)) {
// Throw an exception
throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
- }
+ } // END - if
// Return the compressed stream
return bzcompress($streamData, 1);
if (is_object($streamData)) {
// Throw an exception
throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
- }
+ } // END - if
// Return the decompressed stream
return bzdecompress($streamData);
* @return $string Returns always "bz2"
*/
public final function getCompressorExtension () {
- return "bz2";
+ return 'bz2';
}
}
/**
* Create a new compressor channel based a given compression handler
*
- * @return $cInstance An instance of this class
+ * @return $compressorInstance An instance of this class
*/
public static final function createGzipCompressor () {
+ // Routines not found by default
+ $compressorInstance = null;
+
// Get new instance
if ((function_exists('gzcompress')) && (function_exists('gzuncompress'))) {
// Compressor can maybe be used
- $cInstance = new GzipCompressor();
- } else {
- // Routines not found!
- $cInstance = null;
- }
+ $compressorInstance = new GzipCompressor();
+ } // END - if
// Return the compressor instance
- return $cInstance;
+ return $compressorInstance;
}
/**
if (is_object($streamData)) {
// Throw an exception
throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
- }
+ } // END - if
// Return the compressed stream
return gzcompress($streamData, 1);
if (is_object($streamData)) {
// Throw an exception
throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
- }
+ } // END - if
// Return the decompressed stream
return gzuncompress($streamData);
/**
* Create a new compressor channel based a given compression handler
*
- * @return $cInstance An instance of this class
+ * @return $compressorInstance An instance of this class
*/
public static final function createNullCompressor () {
// Get new instance
- $cInstance = new NullCompressor();
+ $compressorInstance = new NullCompressor();
// Return the compressor instance
- return $cInstance;
+ return $compressorInstance;
}
/**
if (is_object($streamData)) {
// Throw an exception
throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
- }
+ } // END - if
// Return the compressed stream
return $streamData;
if (is_object($streamData)) {
// Throw an exception
throw new InvalidObjectException($streamData, self::EXCEPTION_UNEXPECTED_OBJECT);
- }
+ } // END - if
// Return the decompressed stream
return $streamData;
* @return $string Returns always "null"
*/
public final function getCompressorExtension () {
- return "null";
+ return 'null';
}
}