Project structure

An Energine 2.13 site is two folders: the core — the clone of the repository — and your project, a copy of its starter/.

The core

energine/
├── core/modules/     the eleven modules: share, user, apps, forms, seo, calendar, comments, mail, ads, blog, shop
├── starter/          the starter project you copy
├── tools/            install-check.sh — the release's clean-install check
└── README.md  INSTALL.md  CHANGELOG.md  LICENSE

A module keeps components/ (component classes, namespace Energine\<module>\components), gears/ (other classes), config/ (<Class>.component.xml), templates/content/ and templates/layout/ (page templates), transformers/ (XSLT, with an include.xslt) and scripts/, stylesheets/, images/.

Your project

my-site/
├── htdocs/           the document root
│   ├── index.php  bootstrap.php  auth.php  resizer/
│   ├── uploads/      uploaded files
│   ├── system.config.php   your configuration
│   └── images/  scripts/  stylesheets/  templates/  system.jsmap.php   made by setup
├── site/modules/main/   your site's code
├── core/modules/     links to the core's modules, made by setup
├── setup/            the console tool
├── sql/              the database: an empty site and a site with demo content
├── configs/          the configuration template
├── cli/              mail_sender.php — sends the newsletters
├── jambalaya/        nginx and Apache examples
└── composer.json  composer.lock  vendor/

htdocs/auth.php takes the sign-in form; htdocs/resizer/ is the TimThumb image resizer.

Your site's code: site/modules/main

  • components/, gears/ — your classes: Composer loads EnergineSite\main\components\<Class> from site/modules/main/components/<Class>.php.
  • config/ — component configs; a file with a core config's name replaces it.
  • templates/content/, templates/layout/ — your page templates; the starter keeps its admin pages' templates here.
  • transformers/ — main.xslt, the entry of the XSLT views, include.xslt, energine.xslt with the page's layout, and error_page.xslt.
  • scripts/, stylesheets/, images/ — linked into htdocs/scripts/main/, htdocs/stylesheets/main/, htdocs/images/main/.

The folder name main is the site's «Вариант дизайна» (Design variant); another site can have its own folder.

Setup

Setup runs from htdocs/ as the site's user, from the console only, and exits with a non-zero status when it fails:

Command What it does
php index.php setup install checks the database, writes the site's address, then runs linker and scriptMap
php index.php setup linker links the core's modules into core/modules/ and fills htdocs/images/, scripts/, stylesheets/ and templates/: core files directly, your site's into main/; with debug mode off the scripts are copied minified
php index.php setup scriptMap writes htdocs/system.jsmap.php, the scripts' dependencies; without it no page is built
php index.php setup syncUploads registers files already in htdocs/uploads/public/ in the file repository
php index.php setup untranslated, exportTrans, loadTransFile interface strings; see Interface languages

Run linker after adding files to site/modules/main/ (templates, scripts, styles, images), after updating or moving the core or the project and after changing debug; run scriptMap after adding a script. PHP classes, configs and XSLT stylesheets are read where they lie.

Files and caches

  • htdocs/uploads/public/ — the file repository; uploads/temp/ — uploads in progress; uploads/tmp/ — temporary files.
  • The image resizer caches in the system's temporary folder.
  • With site.cache on, the database structure is cached in the project's cache/ folder.
  • Composer installs symfony/console and its dependencies into vendor/; it is used by cli/mail_sender.php. MooTools, CKEditor, TimThumb and the other libraries are files in the repository, not packages.