(civicrm-setup#1) CRM_Core_I18n - Don't require immediate bootstrap
authorTim Otten <totten@civicrm.org>
Fri, 16 Feb 2018 11:45:29 +0000 (03:45 -0800)
committerTim Otten <totten@civicrm.org>
Fri, 16 Feb 2018 11:45:29 +0000 (03:45 -0800)
commit4954910a708f2d7dc210d02f7a265e685c511322
tree3d7aaf58610186fa1f615844db630c7494bdbac5
parentdac3ef1fc2c52c531075be99117ebce5728b03ae
(civicrm-setup#1) CRM_Core_I18n - Don't require immediate bootstrap

For civicrm/civicrm-setup#1, the general goal is to allow installing the
database schema without needing to run `GenCode`.

The current draft is crashing because the SQL does translation using `ts()`.
But if you try to use `ts()` in a pre-boot environment, it will attempt to
boot automatically so that it can read `$config->customTranslateFunction.

This is a chicken-egg situation.  We haven't yet reached the phase where the
installer can boot up Civi...  because we don't have the SQL...  but the SQL
can't be generated (translated) because Civi hasn't been booted.

The aim of this patch is to loosen the coupling between `ts()`
and `CRM_Core_Config` so that `ts()` can be used on its own.

> Aside: You might ask how this works today -- basically, `GenCode` does a
> database-less-boot, which placates `ts()`.  However, the `civicrm-setup`
> will eventually need to do full-boot, and AFAIK we don't have any
> situations where one transitions from database-less-boot to full-boot; I
> have a gut fear that such a transition would be its own slipper slope.
CRM/Core/I18n.php