Also apply the __toString fix to UserInfo
[cacert-mgr.git] / external / ZendFramework-1.9.5 / demos / Zend / Wildfire / application / controllers / ZendLogWriterFirebugController.php
1 <?php
2 /**
3 * Zend Framework
4 *
5 * LICENSE
6 *
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.
14 *
15 * @category Zend
16 * @package Zend_Wildfire
17 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 */
20
21 /** Zend_Controller_Action */
22 require_once 'Zend/Controller/Action.php';
23
24 /**
25 * Tests for Zend_Log_Writer_Firebug
26 *
27 * @category Zend
28 * @package Zend_Wildfire
29 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
30 * @license http://framework.zend.com/license/new-bsd New BSD License
31 */
32 class ZendLogWriterFirebugController extends Zend_Controller_Action
33 {
34
35 public function testloggingAction()
36 {
37 $logger = Zend_Registry::get('logger');
38
39 $logger->log('Emergency: system is unusable', Zend_Log::EMERG);
40 $logger->log('Alert: action must be taken immediately', Zend_Log::ALERT);
41 $logger->log('Critical: critical conditions', Zend_Log::CRIT);
42 $logger->log('Error: error conditions', Zend_Log::ERR);
43 $logger->log('Warning: warning conditions', Zend_Log::WARN);
44 $logger->log('Notice: normal but significant condition', Zend_Log::NOTICE);
45 $logger->log('Informational: informational messages', Zend_Log::INFO);
46 $logger->log('Debug: debug messages', Zend_Log::DEBUG);
47 $logger->log(array('$_SERVER',$_SERVER), Zend_Log::DEBUG);
48
49 $logger->trace('Trace to here');
50
51 $table = array('Summary line for the table',
52 array(
53 array('Column 1', 'Column 2'),
54 array('Row 1 c 1',' Row 1 c 2'),
55 array('Row 2 c 1',' Row 2 c 2')
56 )
57 );
58 $logger->table($table);
59 }
60
61
62 public function testerrorcontrollerAction()
63 {
64 require_once 'Zend/Exception.php';
65 throw new Zend_Exception('Test Exception');
66 }
67
68 public function testlargemessageAction()
69 {
70 $message = array();
71
72 for ( $i=0 ; $i<300 ; $i++ ) {
73 $message[] = 'This is message #' . $i;
74 }
75
76 $logger = Zend_Registry::get('logger');
77 $logger->log($message, Zend_Log::INFO);
78 }
79 }