Definition at line 35 of file Rar.php.
◆ __construct()
__construct |
( |
|
$options = null | ) |
|
Class constructor
- Parameters
-
array | $options | (Optional) Options to set |
Definition at line 60 of file Rar.php.
62 if (!extension_loaded(
'rar')) {
63 #require_once 'Zend/Filter/Exception.php';
◆ compress()
Compresses the given content
- Parameters
-
- Returns
- string
Implements Zend_Filter_Compress_CompressInterface.
Definition at line 176 of file Rar.php.
179 if ($callback ===
null) {
180 #require_once 'Zend/Filter/Exception.php'; 189 #require_once 'Zend/Filter/Exception.php';
call_user_func($callable, $param)
◆ decompress()
Decompresses the given content
- Parameters
-
- Returns
- boolean
Implements Zend_Filter_Compress_CompressInterface.
Definition at line 202 of file Rar.php.
206 $archive = str_replace(array(
'/',
'\\'), DIRECTORY_SEPARATOR, realpath(
$content));
207 }
elseif (empty($archive) || !file_exists($archive)) {
208 #require_once 'Zend/Filter/Exception.php'; 213 if ($password !==
null) {
214 $archive = rar_open($archive, $password);
216 $archive = rar_open($archive);
220 #require_once 'Zend/Filter/Exception.php'; 229 $filelist = rar_list($archive);
231 #require_once 'Zend/Filter/Exception.php'; 235 foreach($filelist as $file) {
elseif(isset( $params[ 'redirect_parent']))
◆ getArchive()
Returns the set archive
- Returns
- string
Definition at line 101 of file Rar.php.
103 return $this->_options[
'archive'];
◆ getCallback()
Returns the set callback for compression
- Returns
- string
Definition at line 74 of file Rar.php.
76 return $this->_options[
'callback'];
◆ getPassword()
Returns the set password
- Returns
- string
Definition at line 125 of file Rar.php.
127 return $this->_options[
'password'];
◆ getTarget()
Returns the set targetpath
- Returns
- string
Definition at line 147 of file Rar.php.
149 return $this->_options[
'target'];
◆ setArchive()
Sets the archive to use for de-/compression
- Parameters
-
string | $archive | Archive to use |
- Returns
- Zend_Filter_Compress_Rar
Definition at line 112 of file Rar.php.
114 $archive = str_replace(array(
'/',
'\\'), DIRECTORY_SEPARATOR, $archive);
115 $this->_options[
'archive'] = (string) $archive;
◆ setCallback()
Sets the callback to use
- Parameters
-
- Returns
- Zend_Filter_Compress_Rar
Definition at line 85 of file Rar.php.
87 if (!is_callable($callback)) {
88 #require_once 'Zend/Filter/Exception.php'; 92 $this->_options[
'callback'] = $callback;
◆ setPassword()
◆ setTarget()
Sets the targetpath to use
- Parameters
-
- Returns
- Zend_Filter_Compress_Rar
Definition at line 158 of file Rar.php.
160 if (!file_exists(dirname(
$target))) {
161 #require_once 'Zend/Filter/Exception.php'; 165 $target = str_replace(array(
'/',
'\\'), DIRECTORY_SEPARATOR,
$target);
166 $this->_options[
'target'] = (string)
$target;
◆ toString()
◆ $_options
Initial value:= array(
'callback' => null,
'archive' => null,
'password' => null,
'target' => '.',
)
Definition at line 48 of file Rar.php.
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Filter/Compress/Rar.php