Upgrading: siteaccess switches and siteaccess matching
This page describes how switching from one siteaccess to another behaves now, for processes that serve or work for more than one siteaccess (previews, cronjobs, workers).
A switch takes the regional settings of the new siteaccess
eZSiteAccess::load() on the global path now resets the translations, ezpI18n and the memoized default content
language, so they are built again from the [RegionalSettings] of the loaded siteaccess. Before, a process that loaded
another siteaccess kept the interface language, the translation tables and the default content language of the
siteaccess before. Code that reset these itself after a switch may keep doing so; it is now redundant.
change() to another siteaccess is a full switch
eZSiteAccess::change() called while a siteaccess is current, with another siteaccess name and no local site.ini
instance, now runs eZSiteAccess::load(): the settings, the access extensions and the module repositories of the
siteaccess before are dropped and those of the new one are applied. The first call of a process, a call with the name
of the current siteaccess (a change of type or URI part) and every call with a $siteINI instance keep the bootstrap
step as before. A cronjob that loops over siteaccesses with change() now sees the settings of each one.
A failed load keeps the current siteaccess
When eZSiteAccess::load() throws, the siteaccess that was current before is current again (or none, if there was
none). A failed global load may leave the settings partly switched, because the settings before were already discarded.
The cron language mode stays across a switch
eZContentLanguage::setCronjobMode() is a property of the process, not a cache: eZContentLanguage::expireCache() and
a siteaccess switch no longer turn it off. A script that sets the mode before it initialises a siteaccess now keeps
it, so it sees every content language. The cron runner no longer turns the mode on before the parts run: each part
sees the language list of the siteaccess it runs in, and a part that needs every language calls setCronjobMode()
itself.
Matching
host_uri: the uri part of aHostUriMatchMapItemsentry is compared as literal text and matches whole leading segments of the path. Before, it was used inside a pattern:.meant any character,+and*were quantifiers, and a part such asengalso matched/eng-usor/eng.html(any non-word character ended the match). Entries that relied on this now need one entry per segment.RedirectOnNormalize=enabledredirects only siteaccesses matched on the URI, to the cleaned name followed by the rest of the path. A match on the host, the port, the index file orhost_uriis no longer redirected, and the rest of the path is no longer dropped. The status line follows the protocol of the request,HTTP/1.1where the server reports none.- An unset
URIMatchSubtextPre/Post,HostMatchSubtextPre/PostorIndexMatchSubtextPre/Postcounts as empty and no longer stores anUndefined variablemessage in the debug output.