The multisite installer script
This page is for developers who change or debug the sevenx_multisite install, and for hosts who need to know what a
default install does to a database and to settings/. It answers: what settings/sevenx-multi-site-installer.php
runs, when, and in which order. All facts are from the file itself (7692 lines in 6.0.15) and from the kernel's
kernel/setup/steps/ezstep_create_sites.php and kernel/classes/ezsiteinstaller.php.
Contents
- The class and when it runs
- Phase 1: settings the installer works out
- Phase 2: the pre-install
- Phase 3: settings, roles and preferences
- Phase 4: the post-install steps
- When a step fails
- The command-line install method
The class and when it runs
The file defines class sevenxMultiSiteInstaller extends eZSiteInstaller. The kernel's eZSiteInstaller
constructor calls initSettings( $parameters ) and then initSteps(), so every new sevenxMultiSiteInstaller(...)
works out its settings and its list of post-install steps first. The small wrapper files of the package
(see What it is made of) each create one and call one method:
CreateSites (kernel/setup/steps/ezstep_create_sites.php)
include every <settings-file> of the site package
eZSitePreInstall() -> preInstall()
install the required packages (classes, then content)
eZSiteINISettings() -> siteINISettings()
eZSiteAdminINISettings() -> adminINISettings()
eZSiteCommonINISettings() -> commonINISettings()
eZSiteRoles() -> siteRoles()
eZSitePreferences() -> sitePreferences()
eZSitePostInstall() -> postInstall() = the 50 steps of initSteps()
then: exp_adminui in the admin siteaccess, the editor siteaccess, the adminui siteaccessThe setup front ends (web wizard, kickstarter, exp:install) all run CreateSites, so this is the same for every
install method. See How the setup wizard uses packages and
How the kickstarter and console use packages.
Phase 1: settings the installer works out
initSettings() reads the parameters the setup passes and stores what the later steps need:
| Setting | Value |
|---|---|
template_look_class_id, template_look_object_id | the template_look class and its first object |
admin_account_id, guest_accounts_id, anonymous_accounts_id | from the setup's object remote map |
main_site_design | media |
extension_list | 60 extensions, see Extensions it activates |
locales, primary_language | the languages chosen in the setup, the first one primary |
fallback_locales | eng-US when it was not chosen, because "the bundled content is in eng-US" |
user_siteaccess | the setup's value, site by default (sevenx_site_user or empty also become site) |
admin_siteaccess | the setup's value, admin by default |
editor_siteaccess | editor |
adminui_siteaccess | adminui when the kernel can make it and exp_adminui is installed, else empty |
site_title | the title typed in the setup; when it is empty or only repeats the package summary: "Fit & Healthy" (or "Bold Agency" when the user siteaccess is bold) |
language_based_siteaccess_list, language_siteaccess_map | one siteaccess name per extra language, see Siteaccesses and languages |
host, siteaccess_urls | the site's address and the addresses of the admin, editor, user and translation siteaccesses |
var_dir | var/site |
Phase 2: the pre-install
eZSitePreInstall() creates the installer with array( 'var_dir' => 'var/site' ) and calls preInstall(), before
any package is installed:
- Records the highest node id and object id of the base data in
$GLOBALS['sevenxBaseMaxNodeID']and$GLOBALS['sevenxBaseMaxObjectID']. The post-install fix uses them to tell base data from package content. - Adds
tags(ezkeyword) andpublish_date(ezdatetime) to thefolderclass. - Sets
[FileSettings] VarDir=var/sitefor the running process, so images and files land in the site's var directory. activateSiteExtensionSettings(): adds thesettings/folder of every extension inextension_listto the running configuration, so the datatypes and INI files of those extensions are known while the classes and objects are imported.- Registers the datatype directories
ezstarrating,ezgmaplocation,exp_enhanced_link,eztagsand the datatypesezsrrating,ezgmaplocation,ngenhancedlink,eztagsincontent.ini [DataTypeSettings]. - When
extension/sevenx_authentication_2faexists, adds the "Two-step sign-in" field to theuserclass. dropExtensionTables(), theninsertDBFile()for each extension schema: this is where the layout tables and their rows come in. See Layouts data and the share .dba files.- Corrects the language ids of
eng-GBrows ineztags_keywordandeztags.
Phase 3: settings, roles and preferences
While CreateSites builds the settings it asks the package for its own. The installer returns lists of INI groups:
| Function | Written to | Files |
|---|---|---|
siteINISettings() | the user siteaccess | menu.ini, override.ini, toolbar.ini, site.ini, image.ini, content.ini, design.ini, browse.ini, template.ini, contentstructuremenu.ini, odf.ini |
adminINISettings() | the admin siteaccess | toolbar.ini, contentstructuremenu.ini, override.ini, site.ini, content.ini, icon.ini, viewcache.ini, odf.ini, ezoe.ini, menu.ini |
commonINISettings() | settings/override/ | site.ini, content.ini, menu.ini, viewcache.ini, staticcache.ini, httpcache.ini, override.ini, forum.ini, ezoe_attributes.ini, ezxml.ini, and sevenxauthentication2fa.ini when 2FA is installed |
The settings/override/site.ini group is written with discard_old_values: what it does not set is gone after the
install. siteRoles() and sitePreferences() return the roles and the administrator's preferences; see
Roles and policies.
Phase 4: the post-install steps
postInstall() runs the step list of initSteps() through executeSteps(). In order:
| # | Step | What it does |
|---|---|---|
| 1-2 | dbBegin, setVersion | open a transaction, record the solution version (solutionVersion(), built from the class constants MAJOR_VERSION and MINOR_VERSION) |
| 3 | postInstallFixContentObjectNameLanguages | make language ids of names, attributes and masks agree with their locale |
| 4 | postInstallResolveRelationListIds | turn relation list items stored by remote id into object ids |
| 5 | postInstallRekeyStarRatings | move the seeded rating of the "Test Product" onto the installed object |
| 6 | postInstallImportNewsletterClasses | import the cjw_newsletter classes and newsletter tree |
| 7-8 | postInstallAdminSiteaccessINIUpdate, postInstallUserSiteaccessINIUpdate | designs, home node, root node and URLs of admin and site |
| 9-10 | createTranslationSiteAccesses, createSecondarySiteaccesses | one siteaccess per extra language; bold and bold_ger |
| 11-12 | updateTemplateLookClassAttributes, updateTemplateLookObjectAttributes | twelve extra "look and feel" fields and their values |
| 13-14 | swapNodes, removeContentObject | the legacy node named eZ Publish in older clean data is swapped with "Home" and removed; skipped when absent |
| 15 | removeClassAttribute | removes id from template_look |
| 16-31 | sections, roles, user groups | Restricted section, Anonymous/Editor/Partner/Member policies, Partners group, Members group, role assignments |
| 32 | updateClassAttributes | folder attribute names "Summary" and "Display sub items" |
| 33 | setRSSExport | the feed "My RSS Feed" at /rss/feed/my_feed (not for _clean packages) |
| 34 | dbCommit | commit |
| 35 | postInstallFixPackageNodesAndExplayouts | node placement, layout references, menus, tags, embeds; clears all caches |
| 36 | postInstallImportAdminLayouts | the three default admin layouts |
| 37-39 | postInstallCleanUrlText, postInstallRegenerateURLAliases, postInstallCreateSitePrefixAliases | URL aliases of both sites, with their path prefixes |
| 40 | postInstallClearLinksToContentNotInstalled | block links to pages the package did not install are switched off |
| 41 | postInstallPlaceOrphanedPackageObjects | objects installed without a node get one |
| 42 | postInstallSetSiteHomeAndPrefix | PathPrefix, IndexPage, DefaultPage of site, bold, bold_ger and the translations |
| 43 | postInstallCloseInformationPagesOnPublicSiteaccesses | the ezinfo module off on public siteaccesses |
| 44-45 | postInstallResyncContentClassNames, postInstallRepairClassNameLists | class name lists |
| 46 | postInstallCreateAdminUISiteaccess | settings/siteaccess/adminui from the admin siteaccess |
| 47 | postInstallEnableSearchStatsOnEverySiteaccess | LogSearchStats=enabled |
| 48 | postInstallWriteMultisiteURLSettings | settings/override/ezurlmultisite.ini.append.php |
| 49-50 | updateObjectAttributeFromString (twice) | the site logo from files/default/image/logo.png, and the site style ezwebin_design_blue |
The details of steps 35 to 41 are on Post-install fixes.
When a step fails
executeSteps() stops at the first step that reports an error the installer does not handle; the installer's own
handleError() commits the open transaction on an abort. The setup then reports EZSW-080: "The post-install of
site package '...' stopped at step N of M (...): the steps after it did not run". That is why the code orders the
steps the way it does: the two cosmetic logo steps run last "because executeSteps aborts the whole chain on the first
step that reports an error", and several kernel steps are overridden (swapNodes, removeContentObject,
setSection, setRSSExport) to log a notice and carry on when what they name is not there.
Tip
After a failed install, the step number in EZSW-080 tells you where to look in this table. The installer and
the setup write their notices to the debug output, and some of them to the log file setup.log through eZLog::write() (for example "no adminui siteaccess").
The command-line install method
The class also has an install() method for use outside CreateSites. It writes the user siteaccess, admin
siteaccess and settings/override groups itself, then calls updateRoles(), updatePreferences() and
postInstall(). The setup front ends do not use it; they go through the hooks above.
Related pages
- sevenx_multisite
- Install scripts in a site package
- Post-install fixes
- Changing the installer script
- 4.3 Site packages: what is installed
- Site packages: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.