Quick links: Content - sections - sub sections
EN FR
Jelix 1.3.9

Chapter: Migrating from a previous version

« New features ^ Introduction
Switch to language: FR

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.
  • don't forget to move your own libraries from the old lib/ directory to the new one
  • remove all the files in the temp/yourapp/ directory
  • update your code as specified hereafter.

Updating from jelix 1.3.3

Upgrading from jelix 1.2

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. You have also to delete the temp/yourapp-cli/ directory and the temp/yourapp-scripts/ directory, they are not used anymore.

Change your application.init.php

This file should use now jApp::initPaths() instead of defining JELIX_APP_* constants. You can access now to every path using the jApp object. JELIX_APP_* constants are generated for you automatically, to keep compatibility with modules not fully compatible with Jelix 1.3. However, it is highly recommanded to replace these JELIX_APP_* constants in theses modules, because future version of Jelix won't support anymore these constants.

Your application.init.php should contain this kind of code:


$appPath = dirname (__FILE__).'/';
require ($appPath.'../lib/jelix/init.php');

jApp::initPaths(
    $appPath
    //$appPath.'www/',
    //$appPath.'var/',
    //$appPath.'var/log/',
    //$appPath.'var/config/',
    //$appPath.'scripts/'
);
jApp::setTempBasePath(realpath($appPath.'../temp/testapp/').'/');

Files removal

You can remove application-cli.init.php and jelix-scripts.init.php, they are useless now. If you have command line scripts into the scripts/ directory of your application, replace the include instruction for application-cli.init.php, by an include instruction for application.init.php.

Other stuffs

  • If you have activated minification of js and css files in your html responses, it won't work anymore because the configuration has changed. Some options have dispeared, the directory www/cache/minify is not used anymore, and a minify.php script should be installed into www/.
  • you can add a tests/runtests.php script into your app directory, copied from lib/jelix-scripts/templates/tests/. It allows you to develop and run tests using phpunit.

Upgrading modules

  • update sources of vendor's modules that you have installed, with version compatible with Jelix 1.3.
  • For your own modules:
    • As indicated above, replace the use of JELIX_APP_* constants by the use of jApp.
    • In module.xml files, indicate that the module is compatible with Jelix 1.3 (change the attributes maxversion). Example :
        <jelix minversion="1.2" maxversion="1.3.*"/>

Jelix update

After all these modifications, you should run your installer.php script. The jelix module will change some things:

  • in your configuration
  • will create a new profiles.ini.php, storing content of dbprofils.ini.php, cache.ini.php, jkvdbprofiles.ini.php. Theses files will be removed.
  • will create a new cmd.php in the root of your application, to launch commands of jelix-script

The module jacl2db will update your database, if you use this module.

Updating from Jelix 1.1 or lower

Read the upgrade instructions of all previous manuals and then follow instruction above.