Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezgzipshellcompressionhandler.php
Go to the documentation of this file.
1 <?php
21 class eZGZIPShellCompressionHandler extends eZCompressionHandler
22 {
23 public function __construct()
24 {
25 $this->File = false;
26 $this->Level = false;
27 parent::__construct( 'GZIP (shell)', 'gzipshell' );
28 }
29
33 function setCompressionLevel( $level )
34 {
35 if ( $level < 0 or $level > 9 )
36 $level = false;
37 $this->Level = $level;
38 }
39
44 function compressionLevel()
45 {
46 return $this->Level;
47 }
48
52 static function isAvailable()
53 {
54 return false;
55 }
56
57 function gunzipFile( $filename )
58 {
59 $command = 'gzip -dc ' . escapeshellarg( $filename );
60 }
61
62 function doOpen( $filename, $mode )
63 {
64 $this->File = @gzopen( $filename, $mode );
65 }
66
67 function doClose()
68 {
69 return @gzclose( $this->File );
70 }
71
72 function doRead( $uncompressedLength = false )
73 {
74 return @gzread( $this->File, $uncompressedLength );
75 }
76
77 function doWrite( $data, $uncompressedLength = false )
78 {
79 return @gzwrite( $this->File, $uncompressedLength );
80 }
81
82 function doFlush()
83 {
84 return @fflush( $this->File );
85 }
86
87 function doSeek( $offset, $whence )
88 {
89 if ( $whence == SEEK_SET )
90 $offset = $offset - gztell( $this->File );
91 else if ( $whence == SEEK_END )
92 {
93 eZDebugSetting::writeError( 'lib-ezfile-gziplibz',
94 "Seeking from end is not supported for gzipped files" );
95 return false;
96 }
97 return @gzseek( $this->File, $offset );
98 }
99
100 function doRewind()
101 {
102 return @gzrewind( $this->File );
103 }
104
105 function doTell()
106 {
107 return @gztell( $this->File );
108 }
109
110 function doEOF()
111 {
112 return @gzeof( $this->File );
113 }
114
115 function doPasstrough( $closeFile = true )
116 {
117 return @gzpassthru( $this->File );
118 }
119
120 function compress( $source )
121 {
122 return @gzcompress( $source, $this->Level );
123 }
124
125 function decompress( $source )
126 {
127 return @gzuncompress( $source );
128 }
129
130 function errorString()
131 {
132 return false;
133 }
134
135 function errorNumber()
136 {
137 return false;
138 }
139
142 public $File;
144 public $Level;
145 }
146
147 ?>
eZCompressionHandler
Interface for file handlers using compression.
Definition: ezcompressionhandler.php:34
eZDebugSetting\writeError
static writeError( $conditionName, $string, $label="")
Definition: ezdebugsetting.php:113
eZGZIPShellCompressionHandler
Handles files compressed with gzip using the shell commands.
Definition: ezgzipshellcompressionhandler.php:22
eZGZIPShellCompressionHandler\doPasstrough
doPasstrough( $closeFile=true)
Definition: ezgzipshellcompressionhandler.php:115
eZGZIPShellCompressionHandler\doEOF
doEOF()
Definition: ezgzipshellcompressionhandler.php:110
eZGZIPShellCompressionHandler\compressionLevel
compressionLevel()
Definition: ezgzipshellcompressionhandler.php:44
eZGZIPShellCompressionHandler\errorString
errorString()
Definition: ezgzipshellcompressionhandler.php:130
eZGZIPShellCompressionHandler\doFlush
doFlush()
Definition: ezgzipshellcompressionhandler.php:82
eZGZIPShellCompressionHandler\doRead
doRead( $uncompressedLength=false)
Definition: ezgzipshellcompressionhandler.php:72
eZGZIPShellCompressionHandler\doTell
doTell()
Definition: ezgzipshellcompressionhandler.php:105
eZGZIPShellCompressionHandler\doClose
doClose()
Definition: ezgzipshellcompressionhandler.php:67
eZGZIPShellCompressionHandler\errorNumber
errorNumber()
Definition: ezgzipshellcompressionhandler.php:135
eZGZIPShellCompressionHandler\$File
$File
Definition: ezgzipshellcompressionhandler.php:142
eZGZIPShellCompressionHandler\doSeek
doSeek( $offset, $whence)
Definition: ezgzipshellcompressionhandler.php:87
eZGZIPShellCompressionHandler\__construct
__construct()
Definition: ezgzipshellcompressionhandler.php:23
eZGZIPShellCompressionHandler\doOpen
doOpen( $filename, $mode)
Definition: ezgzipshellcompressionhandler.php:62
eZGZIPShellCompressionHandler\$Level
$Level
The compression level.
Definition: ezgzipshellcompressionhandler.php:144
eZGZIPShellCompressionHandler\doWrite
doWrite( $data, $uncompressedLength=false)
Definition: ezgzipshellcompressionhandler.php:77
eZGZIPShellCompressionHandler\compress
compress( $source)
Definition: ezgzipshellcompressionhandler.php:120
eZGZIPShellCompressionHandler\gunzipFile
gunzipFile( $filename)
Definition: ezgzipshellcompressionhandler.php:57
eZGZIPShellCompressionHandler\setCompressionLevel
setCompressionLevel( $level)
Definition: ezgzipshellcompressionhandler.php:33
eZGZIPShellCompressionHandler\doRewind
doRewind()
Definition: ezgzipshellcompressionhandler.php:100
eZGZIPShellCompressionHandler\decompress
decompress( $source)
Definition: ezgzipshellcompressionhandler.php:125
eZGZIPShellCompressionHandler\isAvailable
static isAvailable()
Definition: ezgzipshellcompressionhandler.php:52
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.