Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

The multisite installer script

What sevenx-multi-site-installer.php does during an install, in order - its settings, the pre-install, the settings and roles the setup asks it for, and the 50 post-install steps.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/site-packages/sevenx-multisite/the-multisite-installer-script.md

On this page

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

  1. The class and when it runs
  2. Phase 1: settings the installer works out
  3. Phase 2: the pre-install
  4. Phase 3: settings, roles and preferences
  5. Phase 4: the post-install steps
  6. When a step fails
  7. 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 siteaccess

The 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:

SettingValue
template_look_class_id, template_look_object_idthe template_look class and its first object
admin_account_id, guest_accounts_id, anonymous_accounts_idfrom the setup's object remote map
main_site_designmedia
extension_list60 extensions, see Extensions it activates
locales, primary_languagethe languages chosen in the setup, the first one primary
fallback_localeseng-US when it was not chosen, because "the bundled content is in eng-US"
user_siteaccessthe setup's value, site by default (sevenx_site_user or empty also become site)
admin_siteaccessthe setup's value, admin by default
editor_siteaccesseditor
adminui_siteaccessadminui when the kernel can make it and exp_adminui is installed, else empty
site_titlethe 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_mapone siteaccess name per extra language, see Siteaccesses and languages
host, siteaccess_urlsthe site's address and the addresses of the admin, editor, user and translation siteaccesses
var_dirvar/site

Phase 2: the pre-install

eZSitePreInstall() creates the installer with array( 'var_dir' => 'var/site' ) and calls preInstall(), before any package is installed:

  1. 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.
  2. Adds tags (ezkeyword) and publish_date (ezdatetime) to the folder class.
  3. Sets [FileSettings] VarDir=var/site for the running process, so images and files land in the site's var directory.
  4. activateSiteExtensionSettings(): adds the settings/ folder of every extension in extension_list to the running configuration, so the datatypes and INI files of those extensions are known while the classes and objects are imported.
  5. Registers the datatype directories ezstarrating, ezgmaplocation, exp_enhanced_link, eztags and the datatypes ezsrrating, ezgmaplocation, ngenhancedlink, eztags in content.ini [DataTypeSettings].
  6. When extension/sevenx_authentication_2fa exists, adds the "Two-step sign-in" field to the user class.
  7. dropExtensionTables(), then insertDBFile() for each extension schema: this is where the layout tables and their rows come in. See Layouts data and the share .dba files.
  8. Corrects the language ids of eng-GB rows in eztags_keyword and eztags.

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:

FunctionWritten toFiles
siteINISettings()the user siteaccessmenu.ini, override.ini, toolbar.ini, site.ini, image.ini, content.ini, design.ini, browse.ini, template.ini, contentstructuremenu.ini, odf.ini
adminINISettings()the admin siteaccesstoolbar.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:

#StepWhat it does
1-2dbBegin, setVersionopen a transaction, record the solution version (solutionVersion(), built from the class constants MAJOR_VERSION and MINOR_VERSION)
3postInstallFixContentObjectNameLanguagesmake language ids of names, attributes and masks agree with their locale
4postInstallResolveRelationListIdsturn relation list items stored by remote id into object ids
5postInstallRekeyStarRatingsmove the seeded rating of the "Test Product" onto the installed object
6postInstallImportNewsletterClassesimport the cjw_newsletter classes and newsletter tree
7-8postInstallAdminSiteaccessINIUpdate, postInstallUserSiteaccessINIUpdatedesigns, home node, root node and URLs of admin and site
9-10createTranslationSiteAccesses, createSecondarySiteaccessesone siteaccess per extra language; bold and bold_ger
11-12updateTemplateLookClassAttributes, updateTemplateLookObjectAttributestwelve extra "look and feel" fields and their values
13-14swapNodes, removeContentObjectthe legacy node named eZ Publish in older clean data is swapped with "Home" and removed; skipped when absent
15removeClassAttributeremoves id from template_look
16-31sections, roles, user groupsRestricted section, Anonymous/Editor/Partner/Member policies, Partners group, Members group, role assignments
32updateClassAttributesfolder attribute names "Summary" and "Display sub items"
33setRSSExportthe feed "My RSS Feed" at /rss/feed/my_feed (not for _clean packages)
34dbCommitcommit
35postInstallFixPackageNodesAndExplayoutsnode placement, layout references, menus, tags, embeds; clears all caches
36postInstallImportAdminLayoutsthe three default admin layouts
37-39postInstallCleanUrlText, postInstallRegenerateURLAliases, postInstallCreateSitePrefixAliasesURL aliases of both sites, with their path prefixes
40postInstallClearLinksToContentNotInstalledblock links to pages the package did not install are switched off
41postInstallPlaceOrphanedPackageObjectsobjects installed without a node get one
42postInstallSetSiteHomeAndPrefixPathPrefix, IndexPage, DefaultPage of site, bold, bold_ger and the translations
43postInstallCloseInformationPagesOnPublicSiteaccessesthe ezinfo module off on public siteaccesses
44-45postInstallResyncContentClassNames, postInstallRepairClassNameListsclass name lists
46postInstallCreateAdminUISiteaccesssettings/siteaccess/adminui from the admin siteaccess
47postInstallEnableSearchStatsOnEverySiteaccessLogSearchStats=enabled
48postInstallWriteMultisiteURLSettingssettings/override/ezurlmultisite.ini.append.php
49-50updateObjectAttributeFromString (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.

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x