1

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!

4

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;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.