Debuging & Coding Tips - radus28/Vtiger-DevOps GitHub Wiki

#Debugging

PHP Debugging

Add following on the top of config.inc.php to debug globally

ini_set('display_errors', '1');

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING);

Add same for file level (View / Model) debugging on the top of relevant file

Database debugging

To globally debug

Open include/Database/PearDatabase.php

change

$dieOnError = true;

To debug file level (View / Model), add below line at the top of the file

$adb->setDieOnError(true);

Note, the $adb object should be initialized before this

SMTP/ Mail debugging

Open the file modules/Emails/mail.php and search for

$mail_status = MailSend($mail);

Insert the following line, before this MailSend function to get the complete SMTP Log within the response of Ajax request during the save of Mailserver configuration.

$mail->SMTPDebug = 2;

Coding guidelines

Use a PHP IDE such as PHPStorm or NetBeans to find available classes or methods.

Refer Using vtiger get() and set() method