Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

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