7 * Locate the civicrm-packages source tree.
9 * @param string $srcPath
10 * The path to the civicrm-core source tree.
12 * The path to the civicrm-packages source tree.
14 public static function getPath($srcPath) {
15 global $civicrm_paths;
18 // TODO: Trace the code-path and allow reading $model for packages dir?
19 $civicrm_paths['civicrm.packages']['path'] ??
NULL,
20 implode(DIRECTORY_SEPARATOR
, [$srcPath, 'packages']),
21 implode(DIRECTORY_SEPARATOR
, [dirname($srcPath), 'civicrm-packages']),
24 foreach ($candidates as $candidate) {
25 if (!empty($candidate) && file_exists($candidate)) {
30 throw new \
RuntimeException("Failed to locate civicrm-packages");