[ZF-10089] Zend_Log
[zend/radio.git] / library / Zend / Captcha / Figlet.php
blobd9713edf9abd65e2ff3e23c4907b59ccfe205115
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
15 * @category Zend
16 * @package Zend_Captcha
17 * @subpackage Adapter
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
22 /** @see Zend_Captcha_Word */
23 require_once 'Zend/Captcha/Word.php';
25 /** @see Zend_Text_Figlet */
26 require_once 'Zend/Text/Figlet.php';
28 /**
29 * Captcha based on figlet text rendering service
31 * Note that this engine seems not to like numbers
33 * @category Zend
34 * @package Zend_Captcha
35 * @subpackage Adapter
36 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
37 * @license http://framework.zend.com/license/new-bsd New BSD License
38 * @version $Id$
40 class Zend_Captcha_Figlet extends Zend_Captcha_Word
42 /**
43 * Figlet text renderer
45 * @var Zend_Text_Figlet
47 protected $_figlet;
49 /**
50 * Constructor
52 * @param null|string|array|Zend_Config $options
53 * @return void
55 public function __construct($options = null)
57 parent::__construct($options);
58 $this->_figlet = new Zend_Text_Figlet($options);
61 /**
62 * Generate new captcha
64 * @return string
66 public function generate()
68 $this->_useNumbers = false;
69 return parent::generate();
72 /**
73 * Display the captcha
75 * @param Zend_View_Interface $view
76 * @param mixed $element
77 * @return string
79 public function render(Zend_View_Interface $view = null, $element = null)
81 return '<pre>'
82 . $this->_figlet->render($this->getWord())
83 . "</pre>\n";