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
ctypeandfileinfoextensions, and MariaDB 10.11 or newer; MySQL is not supported. - The project's
composer.json:symfony/console ^7.4instead of 2.6, nogoogle/recaptcha. Bring it in line with the starter's and runcomposer install --no-dev.
Files from the 2.13 starter
setup/: setup runs from the console only —php index.php setup …inhtdocs/— while 2.12 ran it in a browser at/setup/.htdocs/bootstrap.php,htdocs/auth.phpandhtdocs/resizer/timthumb.php; the web-server examples injambalaya/.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 beforereturn array(, and'setup_dir' => ROOT_DIR . '/setup'.modules: addmail,ads,blogandshop— the base layout now includes a component of theadsmodule.site.action_logis on in the template; it needs the columnshare_action_log.al_action, whichmodules.structure.sqladds.mail.subscriptionsis new;recaptchaand the commentedauthblock are gone.
See Configuration for every key.
The database
- The base schema,
starter.structure.sqlandstarter.routines.sql, has not changed since 2.12. starter.structure.fixes.sqladds what the 2.13 code reads and the 2016 dump lacked;modules.structure.sqladds 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.sqladds 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.sqladds/google-sitemap/.starter.data.admin.sqlandstarter.data.demo.fixes.sqlare not for an existing database.- Passwords keep working: both versions use
password_hash.
Your XSLT and templates
main.xsltincludes the core through../../../../core/…— four levels, 2.12 had five — and theinclude.xsltof the four new modules; the same depth applies ininclude.xsltanderror_page.xslt.energine.xsltplacespageAds,topBanner,BrandingandErrorComponent; without the last, the new 404 page has no text.- A component given
noCaptchaoruse_captchanow 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.SocialLoginFormis 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
.htaccessand.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,%bor%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()andcreate_function()no longer exist, andstrftime()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(): voidandcurrent(): mixedwere added. Mail::setText()takes only the text; a second argument is ignored.