setEncoding($options); } } /** * Defined by Zend_Filter_Interface * * Does a lowercase on the content of the given file * * @param string $value Full path of file to change * @return string The given $value * @throws Zend_Filter_Exception */ public function filter($value) { if (!file_exists($value)) { #require_once 'Zend/Filter/Exception.php'; throw new Zend_Filter_Exception("File '$value' not found"); } if (!is_writable($value)) { #require_once 'Zend/Filter/Exception.php'; throw new Zend_Filter_Exception("File '$value' is not writable"); } $content = file_get_contents($value); if (!$content) { #require_once 'Zend/Filter/Exception.php'; throw new Zend_Filter_Exception("Problem while reading file '$value'"); } $content = parent::filter($content); $result = file_put_contents($value, $content); if (!$result) { #require_once 'Zend/Filter/Exception.php'; throw new Zend_Filter_Exception("Problem while writing file '$value'"); } return $value; } }