-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include the CMS Composer project's autoloader #166
Conversation
This avoids errors including e. g. PEAR's Log.php while loading CRM_Core_Config when using CiviCRM Core/packages as symlinked dependencies in dev environments
Can one of the admins verify this patch? |
add to whitelist |
civibot, test this please |
Before I forget -- in Also, it helps me understand the gist of the patch by omitting the conditionals/whitespace/etc -- it's basically saying: /* 1 */ require_once $GLOBALS["civicrm_root"] . "/CRM/Core/ClassLoader.php";
/* 2 */ \CRM_Core_ClassLoader::singleton()->register();
/* +3 */ require_once '/home/totten/bknix/build/d9/vendor/autoload.php';
/* 4 */ \CRM_Core_Config::singleton();
/* 5 */ \CRM_Utils_System::loadBootStrap(array(), FALSE); The patch adds step 3.
Well, that's fun a scenario. I've been trying to understand what makes that scenario problematic (and why this fixes it). Thinking out loud:
(Note to self: Tested a bit with |
Thanks, @totten for elaborating!
This makes cv commands successfully include the And:
So why not just port |
Cool, glad it worked for
Yeah, that theoretically could get your configuration to work. I should note that there are currently two variations of I quite like the idea of updating (I'll poke around that a bit today...) |
@jensschuppe OK, based on #168 and totten/civix#300, I've published civix v23.07.1. It should support |
It does (with a minor thing to consider, see totten/civix#300 (comment)). I think this PR is now obsolete. Thanks a lot for being that quick! |
This avoids errors including e. g. PEAR's
Log.php
while loadingCRM_Core_Config
when using CiviCRM Core as symlinked Composer dependency in dev environments.I'm not sure, however, whether this makes sense in all environments, but if that addition is trying to include the same autoloader again,
require_once
will take care of it, so it won't hurt. I'm not able to run certain cv or civix commands without it, but I'd be happy to explain my setup, if there's doubt it's necessary.