I'm working on an extension and I need to include a PHP file that is in the civicrm module root dir. Is there a way to get this directory through PHP? I need it to work for all CMS, not just Drupal.
Thanks!
I'm working on an extension and I need to include a PHP file that is in the civicrm module root dir. Is there a way to get this directory through PHP? I need it to work for all CMS, not just Drupal.
Thanks!
I found the answer in the docs here: https://docs.civicrm.org/dev/en/latest/framework/filesystem/#tip-programmatic-lookup_1
You can use the following:
Civi::paths()->getPath("[civicrm.root]/.")
or
global $civicrm_root;