public function upperAction()
 {
     $v = new Zend_Filter_StringToUpper();
     $texto = 'hoje eh quarta-feira';
     echo $v->filter($texto);
     exit;
 }
Example #2
0
    /**
     * 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;
    }
 /**
  * @ZF-8989
  */
 public function testInitiationWithEncoding()
 {
     $valuesExpected = array('ü' => 'Ü', 'ñ' => 'Ñ', 'üñ123' => 'ÜÑ123');
     try {
         $filter = new Zend_Filter_StringToUpper(array('encoding' => 'UTF-8'));
         foreach ($valuesExpected as $input => $output) {
             $this->assertEquals($output, $filter->filter($input));
         }
     } catch (Zend_Filter_Exception $e) {
         $this->assertContains('mbstring is required', $e->getMessage());
     }
 }
 /** The direct action
  * @access public
  * @param string $broadperiod
  * @param array $coinDataFlat
  * @return void
  */
 public function direct($broadperiod, array $coinDataFlat)
 {
     $broadperiod = $this->_filter->filter($broadperiod);
     return $this->optionsAddClone($broadperiod, $coinDataFlat);
 }