Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
LowerCase.php
Go to the documentation of this file.
1 <?php
25 #require_once 'Zend/Filter/StringToLower.php';
26 
34 {
40  public function __construct($options = null)
41  {
42  if (!empty($options)) {
43  $this->setEncoding($options);
44  }
45  }
46 
56  public function filter($value)
57  {
58  if (!file_exists($value)) {
59  #require_once 'Zend/Filter/Exception.php';
60  throw new Zend_Filter_Exception("File '$value' not found");
61  }
62 
63  if (!is_writable($value)) {
64  #require_once 'Zend/Filter/Exception.php';
65  throw new Zend_Filter_Exception("File '$value' is not writable");
66  }
67 
69  if (!$content) {
70  #require_once 'Zend/Filter/Exception.php';
71  throw new Zend_Filter_Exception("Problem while reading file '$value'");
72  }
73 
74  $content = parent::filter($content);
76 
77  if (!$result) {
78  #require_once 'Zend/Filter/Exception.php';
79  throw new Zend_Filter_Exception("Problem while writing file '$value'");
80  }
81 
82  return $value;
83  }
84 }
__construct($options=null)
Definition: LowerCase.php:40
$value
Definition: gender.phtml:16
setEncoding($encoding=null)
is_writable($path)
Definition: io.php:25