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

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.
  • If you put your own libraries into the lib/ directory, don't forget to move them 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.4 or lower

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

Upgrading from jelix 1.5.x

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.

Files rename/removal

You must rename your var/config/defaultconfig.ini.php to var/config/mainconfig.ini.php.

Other stuffs

About jForms

If you built some widget or builder plugins for jForms, you should verify your implementation to match API changes:

* New boolean in parameters of \jelix\forms\Builder\BuilderBase::outputControlLabel() * New boolean in parameters of \jelix\forms\HtmlWidget\WidgetInterface::outputLabel()

Many improvements have been made on the display of data of jforms (with ctrl_value or formdatafull plugins). You should verify that your pages showing form contents are still good.

About jDao

Remove the use of the groupby attribute on <method> elements. It is deprecated and its implementation is unstable. Replace your method by an other SQL query.

Upgrading your modules

  • update sources of vendor's modules that you have installed, with version compatible with Jelix 1.6.
  • For your own modules:
    • In module.xml files, indicate that the module is compatible with Jelix 1.6 (change the attributes maxversion). Example:

        <jelix minversion="1.6" maxversion="1.6.*"/>

See the detailed changelog to know what are the new classes and methods you can use.

If your module contains tests for Simpletest, migrate them to use PHPUnit. Simpletest will not be available in next version of Jelix.

Jelix update

After all these modifications, you should run your install/installer.php script.

Upgrading from jelix 1.6.1

Until 1.6.1, The PHPunit wrapper of Jelix (lib/jelix-tests/) required to install PHPUnit by Pear. With 1.6.2, PHPunit should be installed with Composer.

If you want to keep PHPUnit installed by Pear

You have to modify your tests/runtests.php script, by adding this line: require_once 'PHPUnit/Autoload.php';


require(__DIR__.'/../application.init.php');

require_once 'PHPUnit/Autoload.php';

require(LIB_PATH.'jelix-tests/phpunit.inc.php');

If you want to use PHPUnit installed by composer

Install [Composer](http://getcomposer.org). Then create a composer.json file into your app (at the same level of your project.xml).


{
    "name": "mycompany/myapp",
    "type": "application",
    "description": "",
    "keywords": [],
    "require": {
        "php": ">=5.3.3"
    },
    "require-dev" : {
        "phpunit/phpunit": "4.3.*"
    },
    "autoload": {
        "files": [ "../lib/jelix/init.php"  ]
    },
    "minimum-stability": "stable"
}

Then run composer in the directory:


composer install

Your tests/runtests.php should include ../vendor/autoload.php:


require(__DIR__.'/../application.init.php');

require(__DIR__.'/../vendor/autoload.php';

require(LIB_PATH.'jelix-tests/phpunit.inc.php');