Fullscreen
[Show/Hide Left Column]
[Show/Hide Right Column]

(Cached)
Refresh Print

Debugger Console

 RatingSubjectSubmitted byPriorityCategoryTiki VersionFeatureResolution status (legacy)Created
closed-2-1012(1)Helpsmarty {debug} function gives PHP error "E_USER_WARNING"sinnlos7Bug: Error3.xDebugger Console
Templates (Smarty)
Fixed2009-06
open-2-1012(1)Helpdebugger console breaks the admin panelspkdilleBug: Error5.xDebugger Console2010-02



General Description
For a TikiAdmin this tool is a great first step towards making Tiki as easy to debug as it is to extend and modify!

Overview
When processing a page, your code can send output to the debug console with commands such as $debugger->msg("your message"). This writes the output to the debugconsole which you can then view by displaying the console.

When executing debugging commands, the page is re-loaded with the output of the debugging commands written to the debugconsole. This may pose problems for pages which are processing user input, uploading files, or that crash and do not return.

The debug console is embedded within a div class="debugconsole" id="debugconsole" which is turned on by clicking on the link to toggle the console. Careful inspection will note that the footer.tpl includes tiki-debug_console.php which handles the processing after most of the rest of the page has already executed.

General Notes
  • Enable debugger console by selecting checkbox on Admin -> Features -> Administration Features.
  • Debugger can be extended with commands and/or interface extensions (tabs).
  • Every command in debugger is a PHP class.
  • Sources lib/debug
  • Search for debug-command_*.php it is filenames mask... for debugger commands
  • one command == one class == one file


Key Function and sub-features

General info

*help  	Display list of commands or help for specified command (help print for example)
*tikitables 	Show list of Tiki tables in DB schema
*features 	Show features on/off state
*perm 	        Show current permissions in a convenient way
*print 	Print PHP variable. Indexes are OK.
*slist 	Display list of Smarty variables. Better to specify partial name or 
               very long list of vars will return.
*sprint 	Print Smarty variable
*watch 	Manage variables watch list
*sql 	        Exec SQL query on Tiki DB



How to extend debugger

Look for example skeleton lib/debug/debugger-command_test.php

Related Links


Typical Uses

Debug messages on console

It is possible to print debug info to special debug tab called 'Debug messages' during page generation. It is possible from PHP and Smarty as well.
Dump Smarty variable from template:
{var_dump var=left_modules}

Dump Smarty variable from template using modificator:
{$description|str_replace:"\n":"<br />"|dbg}

Of couse modificator dbg can be used more than once:
{$description|dbg|str_replace:"\n":"<br />"|dbg}

... so you will get 2 messages before and after modification of $description.
// PHP code
global $debugger;
// Print message
$debugger->msg('Value of $myvar = "'.$myvar.'"');
// Print variable
$debugger->var_dump('$myvar');



Case Studies


Bugs
Non command-line commands should not print help. — Fixed in CVS.

Support Requests
We need more examples of the commands that are being passed here...

TikiTeam
zaufi

For more information
lookup sources lib/debug


Contributors to this page: jh7 points  and marclaporte31748 points  .
Page last modified on Sunday 30 November, 2008 13:38:48 UTC by jh7 points .

Main Menu [toggle]


Bugs and Wishes
  1. Report a Bug (or suggest a feature enhancement)

  2. Search Bugs

  3. List yours



About Development

Mailing lists

Extra Stuff

Teams

External Links

Full list of Wiki Pages

TikiWiki on Social Networks


To register [toggle]

To have an account at this site, please register at Tikiwiki.org (external link), and then use that user name and password to log in here.

Search a Wiki Page [toggle]

Exact match

Search Tracker Items Subject [toggle]

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI – 508)
Action log 2.x
Administration
Ajax 2.x
Alert 3.x
Articles & Submissions
Backlinks
Banner
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution 2.x
Cookie
Copyright
Custom Home (and Group Home Page)
Database independence
Database MySQL
Date and Time
Debugger Console
Directory (of hyperlinks)
Documentation link from Tiki to doc.tikiwiki.org (Help System)
DogFood
Dynamic Content
Dynamic Variable
External Authentication
FAQ
Featured links
File Gallery
Forum
Friendship Network (Community)
Gmap Google maps
Group
Help System
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interaction
Inter-User Messages
InterTiki
jQuery
Karma
Live Support
Lost edit protection
Mail-in
Map with Mapserver
Menu
Meta Tag
Missing features
MindMap 3.x
Mobile Tiki and Voice Tiki
Mods
Module
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Payment 5.x
Performance Speed / Load / Compression / Cache
Permission
Poll
Profile Manager
Quiz
Rating
RSS
Score
Search engine optimization (SEO)
Search
Security
Semantic links 3.x
Shoutbox
Site Identity
Slideshow
Smarty Template
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
System log
Tags 2.x
Task
Tell a Friend + Social Bookmarking 2.x
TikiTests 2.x
Theme
Toolbar (Quicktags)
Trackers
TRIM
User Administration
User Files
User Menu
Watch
WebHelp
Webmail and Groupmail
WebServices 3.x
Wiki 3D
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace Ideas 4.x
WYSIWTSN 4.x
WYSIWYCA
WYSIWYG 2.x
XMLRPC

Last Comments [toggle]

  1. Home-made fix
  2. Tutorial
  3. Hack for Multiple Uploads
  4. More findings
  5. that could work