Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Zend_Filter_File_Decrypt Class Reference
Inheritance diagram for Zend_Filter_File_Decrypt:
Zend_Filter_Decrypt Zend_Filter_Encrypt Zend_Filter_Interface

Public Member Functions

 getFilename ()
 
 setFilename ($filename=null)
 
 filter ($value)
 
- Public Member Functions inherited from Zend_Filter_Decrypt
 filter ($value)
 
- Public Member Functions inherited from Zend_Filter_Encrypt
 __construct ($options=null)
 
 getAdapter ()
 
 setAdapter ($options=null)
 
 __call ($method, $options)
 
 filter ($value)
 

Protected Attributes

 $_filename
 
- Protected Attributes inherited from Zend_Filter_Encrypt
 $_adapter
 

Detailed Description

Definition at line 35 of file Decrypt.php.

Member Function Documentation

◆ filter()

filter (   $value)

Defined by Zend_Filter_Interface

Decrypts the file $value with the defined settings

Parameters
string$valueFull path of file to change
Returns
string The filename which has been set, or false when there were errors

Implements Zend_Filter_Interface.

Definition at line 74 of file Decrypt.php.

75  {
76  if (!file_exists($value)) {
77  #require_once 'Zend/Filter/Exception.php';
78  throw new Zend_Filter_Exception("File '$value' not found");
79  }
80 
81  if (!isset($this->_filename)) {
82  $this->_filename = $value;
83  }
84 
85  if (file_exists($this->_filename) and !is_writable($this->_filename)) {
86  #require_once 'Zend/Filter/Exception.php';
87  throw new Zend_Filter_Exception("File '{$this->_filename}' is not writable");
88  }
89 
91  if (!$content) {
92  #require_once 'Zend/Filter/Exception.php';
93  throw new Zend_Filter_Exception("Problem while reading file '$value'");
94  }
95 
96  $decrypted = parent::filter($content);
97  $result = file_put_contents($this->_filename, $decrypted);
98 
99  if (!$result) {
100  #require_once 'Zend/Filter/Exception.php';
101  throw new Zend_Filter_Exception("Problem while writing file '{$this->_filename}'");
102  }
103 
104  return $this->_filename;
105  }
$value
Definition: gender.phtml:16
is_writable($path)
Definition: io.php:25

◆ getFilename()

getFilename ( )

Returns the new filename where the content will be stored

Returns
string

Definition at line 49 of file Decrypt.php.

50  {
51  return $this->_filename;
52  }

◆ setFilename()

setFilename (   $filename = null)

Sets the new filename where the content will be stored

Parameters
string$filename(Optional) New filename to set
Returns
Zend_Filter_File_Encryt

Definition at line 60 of file Decrypt.php.

61  {
62  $this->_filename = $filename;
63  return $this;
64  }

Field Documentation

◆ $_filename

$_filename
protected

Definition at line 42 of file Decrypt.php.


The documentation for this class was generated from the following file: