Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ public function boot($options = array()) {
require_once $civicrm_root . '/CRM/Core/ClassLoader.php';
\CRM_Core_ClassLoader::singleton()->register();

// Include the UF's autoloader. Should this be tuned based on UF type?
if (!isset($cmsBasePath)) {
list (, $cmsBasePath) = $this->findCmsRoot($this->getSearchDir());
}
$cmsAutoloader = dirname($cmsBasePath) . DIRECTORY_SEPARATOR . 'vendor/autoload.php';
if (file_exists($cmsAutoloader)) {
require_once $cmsAutoloader;
}

if (!empty($options['prefetch'])) {
$this->writeln("Call core bootstrap", OutputInterface::VERBOSITY_VERBOSE);
// I'm not sure why this is called explicitly during bootstrap
Expand Down Expand Up @@ -286,6 +295,13 @@ public function generate() {
$code[] = 'require_once $GLOBALS["civicrm_root"] . "/CRM/Core/ClassLoader.php";';
$code[] = '\CRM_Core_ClassLoader::singleton()->register();';

// Include the UF's autoloader. Should this be tuned based on UF type?
list (, $cmsBasePath) = $this->findCmsRoot($this->getSearchDir());
$cmsAutoloader = dirname($cmsBasePath) . DIRECTORY_SEPARATOR . 'vendor/autoload.php';
if (file_exists($cmsAutoloader)) {
$code[] = sprintf('require_once %s;', var_export($cmsAutoloader, 1));
}

return implode("\n", $code);
}

Expand Down