By Gregor de Lijzer on Friday, 11 November 2016
Posted in Technical Issues
Replies 5
Likes 0
Views 198
Votes 0
Developing an app i like to debug my php scripts on backend. Under Joomla i normally do that wit a bunch of JLogs. But this doesn't work under ES. Any suggestions? How do you debug your backend or how do i get JLog running?
I include joomla.log.log and add an JLog Statement which gives me an error.

thanks greg
Hello,

Hm, not really sure what are you trying to debug eh but we normally just use our own method called "dump" which is to output variables on the screen.
·
Friday, 11 November 2016 16:24
·
0 Likes
·
0 Votes
·
0 Comments
·
You mean "var_dump" in php?
·
Friday, 11 November 2016 16:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Yep, that is correct. We have created a dump method which invokes var_dump with exit so you could debug the codes. JLog, if I recall correctly only logs the files on an error log and doesn't output on the screen?
·
Friday, 11 November 2016 16:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Bit how gets the Output of dump to the screen?
You call dump (var) in your eg view.html.php Script. And you put the Output to a variable in the Theme?
Are There Code examples?
·
Friday, 11 November 2016 16:48
·
0 Likes
·
0 Votes
·
0 Comments
·
It actually depend on which part you would like to vardump.

For example : this file show the user listing page from Easysocial backend (http://yourdomain.com/administrator/index.php?option=com_easysocial&view=users) -> ../administrator/components/com_easysocial/views/users/view.html.php

when you put following debug code like :

dump($something);

// OR

var_dump($something);

Then refresh the page, it will show the variable output.

Or you can use this matter, so your variable output will store in the log file.


ob_start();
var_dump($result, $content);
$output .= ob_get_contents();
ob_end_clean();

jimport('joomla.filesystem.file');
Jfile::write(dirname(__FILE__) . '/output.txt', $output);



Hope this help.
·
Saturday, 12 November 2016 00:05
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post