Re: DEBUG console feature

From: Date: Fri, 19 Dec 2003 17:25:51 +0000
Subject: Re: DEBUG console feature
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2005@lists.php.net to get a copy of this message
I implement a similar scenario. My config file has the following structure. psuedo code if server_name == www define smarty_dir force compile = false debugging = false etc.... elseif server_name = lan_server define smarty_dir force_compile = true $_SESSION['smarty'][debug] = isset($_get['smarty_debug']) ? $_get['smarty_debug'] : 0; debugging = $_SESSION['smarty'][debug] etc.. end if include Smarty.classs.php smarty = new Smarty() smarty->debugging = $_SESSION['smarty']['debug']; etc... This makes sure the debugging session never appear online and me and my colloegues can switch it on and off locally. Works great for us ! the things on our wishlist would be ability to add more info to the debug console.. eg tabs with the POST, GET, SERVER vars etc also to be ability to add db-sql queeries as well eg smarty->debugAdd(sql) apart from that smarty is wonderful. ta regards pete Monte Ohrt wrote:
This is a feature that has come up in the past but has never been implemented. I thought I'd run the idea by the dev list before doing anything. Right now you can bring up the debug console by putting SMARTY_DEBUG somewhere in the URL. Sometimes it is not possible to bring up the debug console in this fashion, such as on the results to a form post. One way to remedy this is adding the capability to enable/disable the debug console for the entire browser session. So maybe something like: http://www.foo.com/foobar.php?SMARTY_DEBUG=on http://www.foo.com/foobar.php?SMARTY_DEBUG=off Basically this would set a SMARTY_DEBUG cookie on the browser and then that value would be used throughout the session to determine if the console shows up. My only reservation about this is that it starts a session, which means it may have to output an HTTP header to the browser. I don't know if it is smarty's place to be messing with sessions. Thoughts? Monte


« previous php.smarty.dev (#2005) next »