Migrating from 2.12

Energine 2.13 is the 2.12 code brought to PHP 8.4+ and MariaDB 10.11. The release has no upgrade script: it is tested on fresh installs only. This page lists what a 2.12 site has to change; make the move on a copy of the site and of its database first.

The platform

  • PHP 8.4 or newer, with the ctype and fileinfo extensions, and MariaDB 10.11 or newer; MySQL is not supported.
  • The project's composer.json: symfony/console ^7.4 instead of 2.6, no google/recaptcha. Bring it in line with the starter's and run composer install --no-dev.

Files from the 2.13 starter

  • setup/: setup runs from the console only — php index.php setup … in htdocs/ — while 2.12 ran it in a browser at /setup/.
  • htdocs/bootstrap.php, htdocs/auth.php and htdocs/resizer/timthumb.php; the web-server examples in jambalaya/.
  • site/modules/main/templates/content/news_categories_editor.content.xml: the class it names has changed.

The configuration

  • $energine_release = 'PATH TO CORE'; now stands before return array(, and 'setup_dir' => ROOT_DIR . '/setup'.
  • modules: add mail, ads, blog and shop — the base layout now includes a component of the ads module.
  • site.action_log is on in the template; it needs the column share_action_log.al_action, which modules.structure.sql adds.
  • mail.subscriptions is new; recaptcha and the commented auth block are gone.

See Configuration for every key.

The database

  • The base schema, starter.structure.sql and starter.routines.sql, has not changed since 2.12.
  • starter.structure.fixes.sql adds what the 2.13 code reads and the 2016 dump lacked; modules.structure.sql adds the tables of the mail, ads, blog and shop modules and leaves existing tables as they are. Both are written to be run again (IF NOT EXISTS, INSERT IGNORE), but the release has not tried them on a 2.12 database: import them into the copy first.
  • modules.data.sql adds the modules' strings, mail templates, shop references and their pages — /subscribe/, /subscriptions/, /banners/, /blogs/, /catalog/, /search/, /cart/, /wishlist/, /my-orders/ and admin pages; an address the site already has is left alone. Review the new pages. starter.data.sitemap.sql adds /google-sitemap/.
  • starter.data.admin.sql and starter.data.demo.fixes.sql are not for an existing database.
  • Passwords keep working: both versions use password_hash.

Your XSLT and templates

  • main.xslt includes the core through ../../../../core/… — four levels, 2.12 had five — and the include.xslt of the four new modules; the same depth applies in include.xslt and error_page.xslt.
  • energine.xslt places pageAds, topBanner, Branding and ErrorComponent; without the last, the new 404 page has no text.
  • A component given noCaptcha or use_captcha now stops the page with «Компоненту передан неизвестный параметр.» (An unknown parameter was passed to the component): remove them from the templates and from the XML that pages and widgets keep in the database. SocialLoginForm is gone.

Removed

  • Sign-in through Facebook, VK, Google, OK and Instagram. Accounts made that way have generated passwords, and some have addresses such as …@vk.com: set a real address and a password in «Пользователи» (Users); see Users.
  • reCAPTCHA and the MoveToFooter behaviour of the login form. HTMLCap is deprecated: use the HTML inserts of a page.

What changes on the site

  • An unknown address shows a real 404 page.
  • Uploads refuse script files — PHP, CGI, Perl, Python, shell — and .htaccess and .htpasswd.
  • Anonymous comments can be edited and deleted by administrators only.
  • The action log is written on saves in the admin.
  • Date formats written for strftime(), with %a, %A, %b or %B, give English day and month names where 2.12 used the server's locale; the core's own formats keep the translated names.

Your PHP code

  • The code has to run on PHP 8.4: each() and create_function() no longer exist, and strftime() is deprecated.
  • The core turns PHP warnings into exceptions, so a warning — an undefined array key, for example — stops the page; deprecations are only logged.
  • Classes that extend core classes must match 2.13's method signatures: return types such as rewind(): void and current(): mixed were added.
  • Mail::setText() takes only the text; a second argument is ignored.