* Class constructor.
*/
public function __construct() {
+ // Below is a *default* set of functions to calculate paths/URLs.
+ // Some variables may be overridden as follow:
+ // - The global `$civicrm_paths` may be preset before Civi boots. (Ex: via `civicrm.settings.php`, `settings.php`, or `vendor/autoload.php`)
+ // - Variables may be re-registered. (Ex: via `CRM_Utils_System_WordPress`)
$this
->register('civicrm.root', function () {
return \CRM_Core_Config::singleton()->userSystem->getCiviSourceStorage();
}
$defaultContainer = self::DEFAULT_PATH;
- if ($value && $value{0} == '[' && preg_match(';^\[([a-zA-Z0-9\._]+)\]/(.*);', $value, $matches)) {
+ if ($value && $value[0] == '[' && preg_match(';^\[([a-zA-Z0-9\._]+)\]/(.*);', $value, $matches)) {
$defaultContainer = $matches[1];
$value = $matches[2];
}
}
$defaultContainer = self::DEFAULT_URL;
- if ($value && $value{0} == '[' && preg_match(';^\[([a-zA-Z0-9\._]+)\](/(.*))$;', $value, $matches)) {
+ if ($value && $value[0] == '[' && preg_match(';^\[([a-zA-Z0-9\._]+)\](/(.*))$;', $value, $matches)) {
$defaultContainer = $matches[1];
$value = $matches[3];
}