How debug zikula:
- echo, print_r, var_dump - don't work
- netbeans and xdebug - breakpoints don't work
How?
Thanks for reply
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
How debug zikula
-
- Rank: Registered User
- Registered: May 28, 2009
- Last visit: Jul 20, 2009
- Posts: 5
-
- Rank: Developer
- Registered: May 17, 2004
- Last visit: Apr 08, 2010
- Posts: 386
-
- Rank: Registered User
- Registered: May 28, 2009
- Last visit: Jul 20, 2009
- Posts: 5
pndebug ?
- assigned template variables
- Zikula session variables
- assigned config file variables
Example:
index.php?module=Groups&func=view
Code
<!--[$SCRIPT_NAME]--> "/echupl/index.php"
<!--[$active]--> "1"
<!--[$baseuri]--> "/echupl"
<!--[$baseurl]--> "http://localhost/echupl/"
<!--[$bid]--> "1"
<!--[$bkey]--> "extmenu"
<!--[$blanguage]--> ""
<!--[$collapsable]--> "1"
<!--[$content]--> "<div id="navcontainer_1" class="nav..."
<!--[$defaultstate]--> "1"
<!--[$filter]--> Array (0)
<!--[$func]--> "view"
<!--[$imagelangpath]--> "http://localhost/echupl/themes/andreas08/images/eng"
<!--[$imagepath]--> "http://localhost/echupl/themes/andreas08/images"
<!--[$lang]--> "eng"
<!--[$language]--> ""
<!--[$last_update]--> "2009-05-27 18:21:11"
<!--[$loggedin]--> true
<!--[$maincontent]--> "<div id="pn-maincontent" class="pn-module-Groups"><div >..."
<!--[$mid]--> "11"
<!--[$minbox]--> ""
<!--[$module]--> "Groups"
<!--[$pagetype]--> "module"
<!--[$palette]--> "palette1"
<!--[$position]--> "left"
<!--[$profileMod]--> ""
<!--[$refresh]--> "3600"
<!--[$scriptpath]--> "http://localhost/echupl/themes/andreas08/javascript"
<!--[$stylepath]--> "http://localhost/echupl/themes/andreas08/style"
<!--[$themepath]--> "themes/andreas08"
<!--[$title]--> "Main menu"
<!--[$type]--> "user"
<!--[$uid]--> "2"
<!--[$url]--> ""
pnuser.php
Code
function Groups_user_view()
{
// Security check
if (!SecurityUtil::checkPermission('Groups::', '::', ACCESS_OVERVIEW)) {
return LogUtil::registerPermissionError();
}
// Get parameters from whatever input we need.
$startnum = (int)FormUtil::getPassedValue('startnum', null, 'GET');
$show = FormUtil::getPassedValue('show', null, 'GET');
$showgid = FormUtil::getPassedValue('showgid', null, 'GET');
// we need this value multiple times, so we keep it
$itemsperpage = pnModGetVar('Groups', 'itemsperpage');
if (pnUserLoggedIn()) {
$islogged = true;
} else {
$islogged = false;
}
// The user API function is called.
$groups = pnModAPIFunc('Groups', 'user', 'getallgroups',
array('startnum' => $startnum,
'numitems' => $itemsperpage,
'uid' => pnUserGetVar('uid'),
'islogged' => $islogged));
$pnRender = pnRender::getInstance('Groups', false);
$pnRender->add_core_data();
$pnRender->assign('mainpage', true);
// The return value of the function is checked here, and if the function
// failed then an appropriate message is posted.
if ($groups == false) {
$pnRender->assign('nogroups', true);
return $pnRender->fetch('groups_user_view.htm');
}
// load the admin language file
pnModLangLoad('Groups', 'admin');
$groupitems = array();
$typelabel = array();
$statelabel = array();
$typelabel = array('-1' => _GROUPS_CORE,
'0' => _GROUPS_CORE,
'1' => _GROUPS_PUBLICSHORT,
'2' => _GROUPS_PRIVATESHORT);
$statelabel = array('0' => _GROUPS_CLOSED,
'1' => _GROUPS_OPEN);
foreach ($groups as $group) {
if (SecurityUtil::checkPermission('Groups::', "$group[name]::$group[gid]", ACCESS_OVERVIEW)) {
$group['typelbl'] = $typelabel[$group['gtype']];
$group['statelbl'] = $statelabel[$group['state']];
$pnRender->assign($group);
if ($islogged == true && SecurityUtil::checkPermission('Groups::', "$group[name]::$group[gid]", ACCESS_READ)) {
// The right to apply
$groupitems[] = $pnRender->fetch('groups_user_grouprow_read.htm', $group['gid']);
} else {
// No right to apply
$groupitems[] = $pnRender->fetch('groups_user_grouprow_overview.htm', $group['gid']);
}
}
}
$pnRender->add_core_data();
$pnRender->assign('nogroups', false);
$pnRender->assign('items', $groupitems);
$pnRender->assign('groups', $groups);
$pnRender->assign('pager', array('numitems' => pnModAPIFunc('Groups', 'user', 'countitems'),
'itemsperpage' => $itemsperpage));
return $pnRender->fetch('groups_user_view.htm');
}
I want to see: $groups. How?
I know: pndebug --> groups_user_view.htm
Thank you mumuri!
edited by: dariuszg, May 28, 2009 - 08:56 PM -
- Rank: Developer
- Registered: Mar 29, 2005
- Last visit: Mar 13, 2010
- Posts: 228
If you want to see a variable that is not assigned to any template you can always use die(print_r($var));
It's a really easy form of debug but it works
--
Zikula Italia
SimpleGallery -
- Rank: Team Member
- Registered: Sep 06, 2006
- Last visit: May 09, 2010
- Posts: 2446
sometimes i just print_r inside the controller (pnuser.php) and it's printed in the very beggining of the page...
--
- Mateo T. -
Mis principios... son mis fines
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
