This documentation refers to an older version of CiviCRM (3.4 / 4.0). View latest version.

Skip to end of metadata
Go to start of metadata
This page refers to CiviCRM 3.4 and 4.0, current STABLE version.

Documentation Search


CiviCRM 3.4 and 4.0 Documentation

Support and Participation

Developer Resources


CiviCRM books!

Make sure to check out the FLOSS Manual Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

Or support us by buying an eBook or hard copy of Using CiviCRM from Packt Publishing.

Quick & dirty list of handy functions, variables etc - only just started this

Generating CiviURLS

1) To create a CiviCRM URL

 CRM_Utils_System::url($path = null, $query = null, $absolute = false, $fragment = null, $htmlize = true, $frontend = false )

e.g. to generate the URL the user should be directed to after making a payment (e.g. at a bank's site). Note the $frontend variable determines whether Joomla users will return to a front-end (end user) page or not

2) To generate a full path URL in the civicrm code base:
3) To generate a full path URL in the sites custom_php directory
4) To generate a CiviCRM URL from a smarty template

You can construct this URL within a .tpl file using the custom CiviCRM Smarty function crmURL as below where p='the bit before the question mark' (path) and q='the bit after the question mark' (query) and h='the link text'

Debugging & troubleshooting

Redirecting email output
Output all email to disk files OR discard

define('CIVICRM_MAIL_LOG', 1);
This setting causes all outbound CiviCRM email to be written to files on your server's disk drive (Send Email to Contacts, Contribution and Event receipts, CiviMail mail ...). No real emails are sent. Emails are written to files in templates_c/en_US/ConfigAndLog/mail directory by default.

define('CIVICRM_MAIL_LOG', '/dev/null');
This setting causes all outbound emails to be discarded. No email is sent and emails are NOT written to disk.

Increasing what gets output to your CiviCRM log

You can edit your civicrm.settings.php to output more information about queries that run. Obviously there is a performance hit for these so use wisely

Output all sql queries run by CiviCRM to a CiviCRM.*.log file in the files/civicrm/templates_c/en_US/ConfigAndLog/ directory

Include a backtrace of the php functions that led to this query

Output queries to browser screen

define('CIVICRM_DAO_DEBUG', 1);
Writes out various data layer queries to your browser screen.

In many cases enabling MySQL query logging can be more effective.

CiviCRM debug functions

View a variable

crm_core_error::debug( $params ); exit();
Labels