Configuration

A site's settings live in two places: the configuration file — one per installation — and the database, where the admin keeps the sites, their domains, names and pages.

The file

The site reads only htdocs/system.config.php, a PHP file that returns an array. You make it from the template in step 5 of Installation: cp configs/system.config.default.php htdocs/system.config.php, then replace the placeholders 'PATH TO CORE', 'DB HOST NAME', 'DB NAME', 'DB LOGIN', 'DB PASSWORD' and 'PROJECT DOMAIN NAME'. It lies in the document root and stays private only while the web server passes .php files to PHP; see Known risks.

The keys of the template

Key In the template What it does
setup_dir ROOT_DIR . '/setup' the folder of the console tool
modules 11 modules the core's modules; setup links each into the project's core/modules/
database host, port, db, username, password the MariaDB connection
site.domain placeholder the main host: setup install writes it as the site's address, and the session cookie is set for it and its subdomains
site.root / the site's path, written by setup install with the address
site.debug 1 debug mode; set 0 on a live site — see below
site.useTimer 1 adds the header X-Timer with the build time
site.asXML 0 1 returns every page as its XML
site.aggressive_cleanup 1 cleans the HTML of texts with PHP's tidy, when the extension is loaded
site.action_log Energine\share\components\ActionLog logs saves and deletes of the admin's grids and pages; empty — no log
site.vars, site.js-lib commented examples values given to every page's XML; addresses of jQuery and MooTools
document.transformer main.xslt the main XSLT stylesheet in site/modules/main/transformers/
document.xslcache 0 XSLT caching through the PHP extension xslcache; the release is tested with it off
thumbnails 8 sizes extra images of a file, one per size; see Files and media
session.lifespan 108000 how long a session lives, in seconds: 30 hours
session.timeout, project, mail.feedback — not read by any code
mail.from [email protected] the sender of every letter
mail.manager [email protected] gets the form builder's results when a form names no address
mail.subscriptions news, crm the kinds of newsletters and their classes; see Mailing lists
repositories mapping, quick_upload_path, ftp the file repositories; see Files and media
seo sitemapSegment, sitemapTemplate, maxVideosInMap the Google sitemap; without these keys robots.txt closes the site
wysiwyg.styles commented example extra styles of the visual editor

Keys outside the template

Key What it does
site.static, site.media, site.resizer other base addresses for static files, media and the image resizer
site.compress compresses the answers with gzip when the browser accepts it and debug mode is off
site.cache caches the database structure in the project's cache/ folder (../cache/ from htdocs/), with debug mode off and the folder writable; empty it after changing tables — the form builder does
site.dev_domains with debug mode on, a list of domains used instead of the database's
database.persistent a persistent database connection
document.errorTransformer the XSLT stylesheet of the 403 and 404 pages; by default document.transformer
forms.database, forms.result_num_fields the database of the form builder's tables; the number of columns of its results
repositories.watermark a class that puts a watermark on the images uploaded to a repository

Fixed in the code: the time zone Europe/Kyiv and the session cookie NRGNSID.

Debug mode

site.debug is 1 in the template, for development. With it on:

  • ?debug after a page's address returns the page's XML;
  • error pages show the file and the line;
  • newsletters are not sent: each letter is appended to htdocs/uploads/tmp/mailout.txt, which the web server serves — the letters of registration, password restore and forms still go out;
  • setup linker links the scripts instead of copying them minified;
  • the database cache and gzip are off.

Debug mode does not control display_errors: the core turns it on itself. Turn it off in the site's PHP-FPM pool with php_admin_flag[display_errors] = off, as Installation shows.

In the database: sites and domains

One installation can hold several sites. «Редактор сайтов» (Site editor, /admin/structure/sites/, or «Сайты» on the page toolbar) keeps each site's «Название сайта» (Site name), «Вариант дизайна» (Design variant — a folder of site/modules/), «Активный» (Active) and «Базовый» (Default), the meta tags in each language, and on the tab «Домены» (Domains) its addresses: «Протокол» (Protocol), «Хост» (Host), «Порт» (Port) and «Корень» (Root).

Energine compares each request's scheme, host, port and path with these rows: the matching site answers, an unknown address goes to the default site, and a switched-off site answers 403. A site's first domain is its address in links. An HTTPS address or another port is one more row; see step 8 of Installation. Free name and value pairs per site — «Свойства» (Properties) of the site editor — are read in PHP as $site-><name>.