Skip to content

Add PSR-0 classloading for "CRM" - #265

Merged
totten merged 3 commits into
masterfrom
master-psr0-crm
Oct 7, 2022
Merged

totten merged 3 commits into
masterfrom
master-psr0-crm

Conversation

@totten

@totten totten commented Oct 7, 2022

Copy link
Copy Markdown
Owner

This updates the info.xml in new extensions (civix generate:module) and existing extensions (civix upgrade) to declare:

<classloader>
  <psr0 prefix="CRM_" path=""/>
</classloader>

Todo: Check test results

@demeritcowboy

Copy link
Copy Markdown
Contributor

When I had looked at this before I needed to make path "." - the empty string didn't work (I don't remember the reason).

@totten

totten commented Oct 7, 2022

Copy link
Copy Markdown
Owner Author

Aah, thanks. The "." seems to work in the training scenario that led to this PR. I'm not certain the difference either, but if you've seen cases where "." is better, then let's do that.

Pushed update.

@totten
totten merged commit 592a583 into master Oct 7, 2022
@totten
totten deleted the master-psr0-crm branch October 7, 2022 14:23
colemanw added a commit to colemanw/civix that referenced this pull request Nov 11, 2022
Since totten#265 the `include_path` addition has not been needed except for odd edge-cases where the extension
has stuff that's not covered by the autoloader. I'm honestly not sure what those things might be, but
best-practice is to use the autoloader and not mess with `include_path`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants