avatar_Marius P.

[ Video Sharing CMS v4 ] [HOW TO] Debugging PHPVibe

Started by Marius P.,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marius P.Topic starter

Hello!

Here is how you should get some debugging from PHPVibe.

Open index.php (in root).

At the beginning replace:
<?php  error_reporting(0);


with:

<?php  error_reporting(E_ALL); 
// Degugging?
$sttime = microtime(true);


at the end:

//end sitewide


with:

//end sitewide
if(is_admin()) {
echo "Time Elapsed: ".(microtime(true) - $sttime)."s <br />";
echo "Database debug";
echo '<pre>';
$db->debug();
echo '</pre>';
echo '----------------';
echo "Cache database debug";
echo '<pre>';
$cachedb->debug();
echo '</pre>';
}



Note: This will only show up to the admins.
Warning: You should not leave it on error reporting for long to avoid printing paths to users in eventual notices.





Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

TheBritain

Don't forget that some host have PHP debug still turned off, so you might also need to add:
ini_set('display_errors', True);
  •  

PHPVibe A.

Quote from: TheBritain on
Don't forget that some host have PHP debug still turned off, so you might also need to add:
ini_set('display_errors', True);

Indeed. But on most cases, the

error_reporting(E_ALL);

will work alone.

TheBritain

I was going insane, because I was intentionally writing bad code, and it wasn't throwing an error. I figured it might save someone less patient from hair pulling.
  •  

PHPVibe A.


arnlweb

ezSQL (v2.17) Debug..

Query [17] -- [SELECT count(*) as nr FROM  xomtube_langs WHERE `term` = 'If you don\'t have an account yet, you can']
Query Result..
(row)   int 1
nr
1   1
----------------Cache database debug
ezSQL (v2.17) Debug..

Results retrieved from disk cache
Query [3] -- [SELECT `lang_code`, `lang_name` FROM xomtube_languages LIMIT 0,100]
Query Result..
(row)   string 6
lang_code   string 18
lang_name
1   en   English
2   as-1-1   অসমীয়া
Web Development Services
  •  

PHPVibe A.


Similar topics (7)

Replies: 6
Views: 1643

Replies: 30
Views: 7552

Replies: 16
Views: 2260

Replies: 2
Views: 3090