Chapter: Migrating from a previous version
« New features | ^ Introduction |
− Table of content
When you migrate from an old version of jelix to a newer one, you always must do these tasks:
- replace the
lib/
directory by the one provided in the new version. - If you put your own libraries into the
lib/
directory, don't forget to move them from the oldlib/
directory to the new one. - remove all the files in the
temp/yourapp/
directory - update your code as specified hereafter.
Updating from Jelix 1.2 or lower ¶
Read the upgrade instructions of all previous manuals and then follow instructions below.
Updating from jelix 1.4.0 ¶
- If you want to use the new hashing system in jAuth, provided by Jelix 1.4.1 (and 1.3.4, 1.2.10), be sure to follow the migration instructions.
- The update script of jacl2db replace in the table jacl2_rights, all null resource id by "-", which is the new value to indicate "all resources". It has been changed to allow to set a primary key with this field on some RDBMS like Oracle.
Upgrading from jelix 1.3 ¶
Here are all steps to follow to migrate your application.
Backup ¶
First, do a backup of your databases, and of your application files (modules, configuration etc.).
Temp directories ¶
As usual, you must remove every files into the temp/yourapp/
directory.
Change your entry points ¶
Your entrypoints should be changed:
- the coordinator should be set into the jApp object.
- the configuration file should be indicated to the jApp object too instead of the coordinator.
- See a template in
lib/jelix-scripts/templates/www/index.php.tpl
.
Here is an example:
require ('../application.init.php');
require (JELIX_LIB_CORE_PATH.'request/jClassicRequest.class.php');
checkAppOpened();
// load configuration
jApp::loadConfig('index/config.ini.php');
// new coordinator, and set it into the Jelix environment
jApp::setCoord(new jCoordinator());
// new request object, and call the coordinator to execute the action corresponding to the URL
jApp::coord()->process(new jClassicRequest());
Files removal ¶
Other stuffs ¶
Upgrading modules ¶
- update sources of vendor's modules that you have installed, with version compatible with Jelix 1.4.
- For your own modules:
- the global variable $gJConfig is now deprecated. You should use
jApp::config()
instead, to retrieve the configuration. - the global variable $gJCoord is now deprecated. You should use
jApp::coord()
instead, to retrieve the coordinator. - The locale code 'en_EN' is now deprecated. You have two solutions:
- a quick and temporary solution: add "en=en_EN" into the new section "[langToLocale]" section in the main configuration
- a better solution: rename your directories locales/en_EN to locales/en_US, use en_US as default locale, and perhaps change "en_EN" in your data. This is the prefered solution since the en_EN code will not be supported anymore in future versions.
- In
module.xml
files, indicate that the module is compatible with Jelix 1.4 (change the attributesmaxversion
). Example:
- the global variable $gJConfig is now deprecated. You should use
<jelix minversion="1.3" maxversion="1.4.*"/>
- In your static HTML pages (via jResponseBasicHtml) and error page (error.en_US.php etc), the $basePath variable should be renamed to $BASEPATH (jelix 1.4.1)
- Methods
jCoordinator::isModuleEnabled()
andjCoordinator::getModulePath()
are now deprecated, they have been copied intojApp
, you should then use jApp.
See the detailed changelog to know what are the new classes and methods you can use.
Jelix update ¶
After all these modifications, you should run your install/installer.php
script. The jelix module will change some things:
- The configuration parameter
availableLanguageCode
of theautolocale
plugin, if you use it, is moved to the main configuration and renamed toavailableLocales
.