Example #1
0
 /**
  * main action
  */
 public function mainAction()
 {
     /**
      * Get input variables
      */
     $text = $this->GET['text'];
     /**
      * Check input variables
      */
     if (!$text || trim($text) === '' || !preg_match('/[a-zA-Z0-9\\ _-]/', $text) || strlen($text) > 256) {
         $text = "Invalid String";
     }
     /**
      * Initialize
      */
     require_once 'Zend/Text/Figlet.php';
     $figlet = new Zend_Text_Figlet();
     /**
      * Process
      */
     $figlet_result = $figlet->render($text);
     /**
      * Output
      */
     //we need to prevent striping of white spaces by xtemplate->assign function
     $figlet_result = "<pre>{$figlet_result}</pre>";
     $this->tpl->assign('RESULT', $figlet_result);
     return true;
 }
Example #2
0
 public function process($args)
 {
     $figlet = new Zend_Text_Figlet();
     if (strlen($args) > $this->maxlength) {
         $this->output = 'Los siento. Solo acepto un maximo de ' . $this->maxlength . ' caracteres';
     } else {
         $this->output = $figlet->render($args);
     }
 }
Example #3
0
 /**
  * Display a figlet
  *
  * @param array $args
  * @return bool
  */
 public function display(array $args = array())
 {
     if (empty($args)) {
         Garp_Cli::errorOut('The least you can do is provide a text...');
     } else {
         $text = implode(' ', $args);
         $figlet = new Zend_Text_Figlet();
         Garp_Cli::lineOut($figlet->render($text));
     }
     return true;
 }
 public function testEmptyString()
 {
     $figlet = new Zend_Text_Figlet();
     $this->assertEquals('', $figlet->render(''));
 }
Example #5
0
 /**
  * Display the captcha
  *
  * @param Zend_View_Interface $view
  * @param mixed $element
  * @return string
  */
 public function render(Zend_View_Interface $view = null, $element = null)
 {
     return '<pre>' . $this->_figlet->render($this->getWord()) . "</pre>\n";
 }
Example #6
0
    public function testParagraphOn()
    {
        $figlet = new Zend_Text_Figlet(array('handleParagraphs' => true));

        $this->_equalAgainstFile($figlet->render("Dum\nDum\n\nDum\n"), 'ParagraphOn.figlet');
    }
Example #7
0
<?php

error_reporting(E_ALL);
chdir('..');
$systemroot = getcwd();
include_once 'include/command.php';
require_once 'include/figlet.php';
$figlet = new Zend_Text_Figlet();
print $figlet->render('foobar');