This Script was developed using the scripts "dumpr" and "dBug".
I added the following features:
######################################################################### ######################################################################### ######################################################################### /* * dd - DataDumper - Dump any resource with syntax highlighting, * indenting and variable type information to the screen in a very intuitive format * * based on Dumpr and on dBug * * Licensed under the terms of the GNU Lesser General Public License: * http://www.opensource.org/licenses/lgpl-license.php * * Author Emile Schenk * https://sourceforge.net/projects/datadumper * License LGPL * Modified June 2008 * Revision 3.0 * * Changes * Revision 2.0 * - Initial release taken from dumpr version 1.8 * - added: file and line number of dumpr-call * - added: name of variable displayed * - added: logging into a file instead of screen (parameter 2, $DD[logfile] needs to be global defined) * Revision 2.1 * - added: when no parameter is given, $_SESSION, $_GET, $_POST are displayed * - added: function dde(...), exits after displaying variables * Revision 2.2 * - changed: function ddf(...) is now used for writing into the file $DD[logfile] * Revision 2.3 * - changed: $DD[logfile] has a default: ddlog.htm (in the current directory) * - new parameter $DD[download] if=0 then no downloadlink is shown * - new parameter $DD[wordwrap] if=0 then no wordwraplink is shown * - new parameter $DD[fileline] if=0 then no file and line-info is shown * Revision 2.4 * - changed: Productlink to sourceforge * Revision 2.5 * - changed: Resolved error in productlink * Revision 2.6 * - new parameter $DD[off] if=1 then dd is off (for easy switching off debugging) * Revision 3.0 * - completely new revision also based on dBug * - strings up to $GLOBALS[DD][maxstringforhex] characters are also shown in HEX format * - functionnames are even shorter now: * - d for display variable * - de for display and exit * - df for display in file * - dc display variable only when cookie is set: $_COOKIE[d] == 1 */ ######################################################################### ######################################################################### #########################################################################
Log variable in file:
$DD[logfile] = 'somedir/somefile.htm'; // without this line logfile is 'ddlog.htm'
df($variable);
// the newest variable is logged at the beginning of the file