The installer scripts of cjw_multisite
cjw_multisite builds its site with two PHP files in settings/ of the package: cjw-multi-site-installer.php
(the class cjwMultiSiteInstaller, 5,939 lines) and cjw-starter-install.php (the starter content functions, 827
lines), with post-install-fix.php (593 lines) as a helper. This page follows an install through them in order. It
is for developers who change the installer or write one like it; administrators reading a setup log find here what
each step's notice means.
The file's header says where it comes from: "Generated from the 7x MultiSite installer (sevenx_multisite, sevenx-multi-site-installer.php) for the starter site of the cjw_themes_jumper extension". Most steps are therefore the same as in The multisite installer script; this page dwells on what is different.
Contents
- When the setup calls what
- The settings the installer starts from
- Before the packages: preInstall()
- INI settings, roles and preferences
- After the packages: the post-install steps
- The starter content steps
- Reading the log
- Related pages
When the setup calls what
The create sites step of the setup (kernel/setup/steps/ezstep_create_sites.php) loads the settings files of the
site package and calls the functions they define, in this order:
| Order | Function (settings file) | Installer method |
|---|---|---|
| 1 | eZSitePreInstall() (install-scripts.php) | preInstall() |
| 2 | the kernel installs the required packages ($package->install()) | none |
| 3 | eZSiteINISettings(), eZSiteAdminINISettings(), eZSiteCommonINISettings() | siteINISettings(), adminINISettings(), commonINISettings() |
| 4 | eZSiteRoles() (roles.php) | siteRoles() |
| 5 | eZSitePreferences() (preferences.php) | sitePreferences() |
| 6 | eZSitePostInstall( &$parameters ) (install-scripts.php) | postInstall(), which runs the steps of initSteps() |
The kernel's eZSiteInstaller::executeSteps() runs the post-install steps one after the other and stops the chain at
the first step that reports an error, so the installer puts robust repairs early and cosmetic steps last.
The settings the installer starts from
initSettings() reads the parameters of the setup and fixes these values:
| Setting | Value |
|---|---|
main_site_design | starter |
user_siteaccess | the setup's choice, site when empty |
admin_siteaccess, editor_siteaccess | the setup's choice (admin when empty), editor |
adminui_siteaccess | adminui when the exp_adminui extension is there and the kernel can make it, else empty |
site_title | the typed title; CJW JAC Exponential when it is empty, the package summary, CJW Multisite or Exponential |
extension_list | the ActiveExtensions[] list: the same list as sevenx_multisite plus cjw_themes_jumper and cjw_tmv; cjw_tmv is dropped when extension/cjw_tmv is missing |
language_siteaccess_map | one translation siteaccess per further language (see Siteaccesses and languages) |
fallback_locales | eng-US when the chosen languages lack it, unless the setup passes its own fallback_language_codes |
var_dir | var/site |
Before the packages: preInstall()
- Records the highest node id and object id of the base data (
cjwBaseMaxNodeID,cjwBaseMaxObjectID), so the later node fix can tell base data from package content. - Adds the attributes
tags(ezkeyword) andpublish_date(ezdatetime) to the classfolder, named in the site's primary language. - Sets
[FileSettings] VarDir=var/sitefor the run and prepends thesettings/folder of every extension in the list (activateSiteExtensionSettings()), so datatypes such as those of enhancedselection2 and eztags are known while classes and objects are imported. - Links the starter content's images and files from
extension/cjw_themes_jumper/share/into the content package (cjwLinkStarterFilesFromExtension()). - Registers the datatypes
ezsrrating,ezgmaplocation,ngenhancedlinkandeztagsfor the run. - Adds the two-step sign-in field to the user class when
sevenx_authentication_2fais available. - Drops and recreates the tables of every extension schema (
dropExtensionTables(),insertDBFile()): the named ones (ezstarrating,ezgmaplocation,eztags,explayouts,enhancedselection2,cjw_newsletter,syndication) plus every other listed extension with ashare/db_schema.dbaorsql/<engine>/schema.sql, and the admin access extensions. Tables only: nodb_data.dbais loaded (declaredExtensionSchemas()passesfalsefor every entry). - Repairs the language columns of eztags rows from the base data when
eng-GBexists.
INI settings, roles and preferences
| Method | Writes |
|---|---|
siteINISettings() | settings/siteaccess/<site>/: menu, override, toolbar, site.ini (locale, SiteLanguageList, LoginPage=embedded, one session across the public siteaccesses), image, content, template, content structure menu, ODF |
adminINISettings() | settings/siteaccess/<admin>/: login required, ShowHiddenNodes=true, TranslationSA, ActiveAccessExtensions[] (expai, exp_adminui where present), menus, toolbar, overrides, icons |
commonINISettings() | settings/override/: AvailableSiteAccessList, SiteList, DefaultAccess, MatchOrder (uri;host, or uri;port for port access), ForceVirtualHost=true, ActiveExtensions[], the database settings of the chosen driver, cache headers for anonymous visitors (public, max-age=300) and more |
siteRoles() | policies for Anonymous and Member (rss feed, user/login on every served siteaccess except admin and adminui, content/read in section 3, tags/view, info-collection/read, osm_proxy/tiles) and the user2fa policies when two-step sign-in is available |
sitePreferences() | the administrator's admin panel preferences |
The osm_proxy/tiles policy is specific to this package: the maps of the starter design load their tiles through the
osm_proxy module of cjw_themes_jumper.
After the packages: the post-install steps
The steps of initSteps(), in order, grouped:
| Steps | What they do |
|---|---|
postInstallFixContentObjectNameLanguages, postInstallResolveRelationListIds, postInstallImportNewsletterClasses | Repairs of the imported data; the newsletter classes of cjw_newsletter |
postInstallAdminSiteaccessINIUpdate | Admin design admin4l with admin4, admin3, admin2, admin after it; RootNode=2 |
postInstallUserSiteaccessINIUpdate | The user siteaccess: SiteDesign=starter, AdditionalSiteDesignList[]=standard, ExtensionSettingsSiteAccess=cjw_starter, start page, starter root, PathPrefix, TranslationSA; the override blocks of other extensions for a siteaccess of this name are taken out of use |
createTranslationSiteAccesses, createSecondarySiteaccesses | One siteaccess per further language; no secondary siteaccesses |
template look, swap and remove steps, createContentSection (Restricted), role policies, user groups (Partners, Members), role assignments, folder attribute names | As in the 7x installer |
setRSSExport | The feed my_feed ("My RSS Feed") of ng_article objects below the starter root |
postInstallFixPackageNodesAndExplayouts | Maps package node and object ids to the installed ones (cjwFixPackageNodesAndExplayouts()) |
postInstallStarterContent | The starter content steps below |
postInstallImportAdminLayouts | The admin layouts from explayouts/share/fragments/admin_layouts_db_data.dba, ids from 100001 on, once |
postInstallRegenerateURLAliases, postInstallCreateSitePrefixAliases, postInstallStarterPaths | URL aliases, then the starter's own paths from cjw-paths.json |
postInstallClearLinksToContentNotInstalled | Title block links to sections that are not installed are switched off |
postInstallPlaceOrphanedPackageObjects | Places objects the package install left without a node, under the parent named in their object file |
postInstallSetSiteHomeAndPrefix | IndexPage, RootNode, RootNodeDepth and PathPrefix for the user siteaccess and its translations; menus copied to the translations |
postInstallStarterPolicyPages | menu.ini [SiteInfo] PrivacyPolicyID and CookiePolicyID to the privacy page (cjw-starter-n-809) |
postInstallCloseInformationPagesOnPublicSiteaccesses | The ezinfo module is switched off on the public siteaccesses |
postInstallResyncContentClassNames, postInstallRepairClassNameLists | Class names keyed by a language |
postInstallCreateAdminUISiteaccess | settings/siteaccess/adminui from the admin's files |
postInstallEnableSearchStatsOnEverySiteaccess | LogSearchStats=enabled |
postInstallWriteMultisiteURLSettings | settings/override/ezurlmultisite.ini.append.php |
two updateObjectAttributeFromString steps | The logo and the site style on the template look object, deliberately last |
The starter content steps
cjwInstallStarterContent( $siteaccesses ) runs as the administrator (user 14) and calls, in order:
| Part | Function | Effect |
|---|---|---|
| class additions | cjwEnsureStarterClassAdditions() | Missing attributes from cjw-class-additions.xml |
| rich text references | cjwPostUnserializeStarterObjects() | eZContentObject::postUnserialize() for every starter object, which the handler skips for remote ids that are not 32 characters long |
| links | cjwResolveStarterLinks() | ngenhancedlink values get the target's object id |
| tags | cjwFixStarterTags() | The tag "Starter" and its tags, linked to the eztags fields |
| dates | cjwRestoreStarterDates() | Publish and modify times from the package |
| hidden folder | cjwHideStarterNodes() | Hides cjw-starter-n-807 |
| layouts | cjwSeedStarterLayouts() | The rows of cjw-explayouts.json, band 900000 |
| file links removed | cjwUnlinkStarterFilesFromExtension() | Removes the links made before the install |
Each part logs its result; a failed part is named in one error line, and the install carries on. All content caches are cleared at the end.
Reading the log
Notices to look for in the debug output of the install:
Base data before the content package: nodes up to ..., objects up to ...; content package cjw_multisite_democontent
Starter content files from the extension: <n> linked, <n> copied, <n> missing
Class additions of the starter content: <n> added, <n> present
Starter layouts: <n> rows in 10 tables, rules for <the user siteaccesses>
Starter paths: <n> renamed, <n> differences leftWarning
"Files of the starter content not found in extension/cjw_themes_jumper/share" means the extension is missing or incomplete: the images of the site will be missing too. Put the extension in place and install again.
Related pages
- cjw_multisite
- The demo content package
- Siteaccesses and languages
- The multisite installer script of sevenx_multisite
- Install scripts in a site package
- Changing the installer script
- 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.