firephp

FirePHP doesn't always write log messages

纵然是瞬间 提交于 2019-12-12 18:39:28
问题 I set my loggers up in my Bootstrap.php like so: $logger = new Zend_Log(); if($environment->debug == '1') { $stream = @fopen('/var/www/html/rta/rta.log','a',false); if(!$stream){ throw new Exception('Failed to open log stream'); } $writer = new Zend_Log_Writer_Stream($stream); $logger->addWriter($writer); $logger->addWriter(new Zend_Log_Writer_Firebug()); } else { // Do something else } Zend_Registry::set('logger',$logger); I have the following code that I set up to fail: $data = array(

How to view session details in php using firebug?

蓝咒 提交于 2019-12-07 20:16:46
问题 I'm trying to figure out I how can do something like: console.log('<?php print_r($_SESSION); ?>'); To see the results in the console. console.log('<?php echo serialize($_SESSION); ?>'); does not work either. Is there a way for me to echo the session information in firebug or inspect element in chrome for testing purposes? 回答1: You could try this : <script> console.log(<?php echo json_encode($_SESSION, JSON_HEX_TAG); ?>); </script> No quotes are required. See as well Firebug and Logging. [edit

How to view session details in php using firebug?

眉间皱痕 提交于 2019-12-06 10:33:16
I'm trying to figure out I how can do something like: console.log('<?php print_r($_SESSION); ?>'); To see the results in the console. console.log('<?php echo serialize($_SESSION); ?>'); does not work either. Is there a way for me to echo the session information in firebug or inspect element in chrome for testing purposes? You could try this : <script> console.log(<?php echo json_encode($_SESSION, JSON_HEX_TAG); ?>); </script> No quotes are required. See as well Firebug and Logging . [edit, May 2014] Updated the code to be safe against XSS attacks. Always pass JSON_HEX_TAG to json_encode if you

Sending “var_dump” to FireBug console

社会主义新天地 提交于 2019-11-30 08:54:33
As you know var_dump() in addition to value show its data type and length . Is there any way to log its output to FireBug console ? I tried FirePHP and FireLogger but both output only value of a variable (sometimes even incorrect variable value). Walter Tross Maybe what you need is something like this: function var2console($var, $name='', $now=false) { if ($var === null) $type = 'NULL'; else if (is_bool ($var)) $type = 'BOOL'; else if (is_string ($var)) $type = 'STRING['.strlen($var).']'; else if (is_int ($var)) $type = 'INT'; else if (is_float ($var)) $type = 'FLOAT'; else if (is_array ($var)