Quick links: Content - sections - sub sections
EN FR
The page corresponding to the latest stable release can be seen in the Jelix 1.8 Manual

Not released yet. Still in development.

Improvements provided by the version 1.9

Warning: the documentation is not updated yet with all these changes.

Jelix 1.9 is now compatible from PHP 8.2 to PHP 8.5.

Main new features

  • Precompilation of templates, DAOs, forms, locales, and configuration during installation, instead of on the fly
  • V2 syntax in templates: mainly, {{ ... }} or {% ... %} tags replace { .. } tags
  • Locales can be stored in separate Composer packages, and support for charsets other than UTF-8 is deprecated
  • Declaration of event listeners using PHP attributes
  • jDb is now based on JelixDatabase: support for schemas, generated columns, etc.
  • jDao is now based on JelixDao: native support for JSON fields, custom classes for factories
  • The jacl, jacldb, jpref, and jpref_admin modules are no longer provided with Jelix, but remain available in Composer packages

New features

Precompilation

Some files are not compiled anymore on the fly, but only during installation. It avoids launching compilers during an http request, to improve performance.

Files that are compiled during installation:

  • configuration
  • properties files for locales
  • event listeners list
  • url mapping
  • forms
  • template files having the ctpl extension (syntax v2 of Castor)
  • Daos

During the development, you can set a file watcher (into your IDE for example) that will call php dev.php compile $FULLPATH_OF_FILE, to compile a single file without calling the installer before each test into your browser.

Core

Autoload in module.xml: allow psr fallback directories like in composer.json. You can set a directory without a namespace. This directory will be a root for namespaces that are not matched by other rules.

Templates

Castor syntax v2 is now supported in template files having the ctpl extension. These templates are compiled during the installation.

As, by default, they are considered as trusted and HTML templates, compilation of a template may fail if the format is not HTML.

Into templates, it is highly recommended to use the pragma instructions {! output-type = ... !} to specify a content type other than HTML, and to use {! trusted = false!}, if it is not a trusted template. So compilation during installation will be done correctly.

Locales

  • classes jLocale and jBundle are deprecated, and replaced by Jelix\Locale\Locale and Jelix\Locale\Bundle.
  • These new classes support only UTF-8 charsets. Jelix\Locale\Locale call jLocale if the default charset is not UTF-8.
  • Properties files are now compiled during installation to improve performance at runtime, and are used by the new classes. Deprecated classes continue to compile properties files at runtime.
  • New methods Locale::getBundle() and Bundle::getAllKeys()
  • Locales can be in a directory outside an application, like into a Composer package. The directory should be declared with the new API jApp::declareLocalesDir().

Events

Classes jEvent and jEventListener are deprecated and replaced by \Jelix\Event\Event and \Jelix\Event\EventListener.

Declaration of event listener can now be done into the listener class with PHP attributes In this case, the listener class can be any classes, not only classes inheriting from \Jelix\Event\EventListener. However, the listener class should be still declared into the event.xml files.


<events xmlns="http://jelix.org/ns/events/1.0">
   <listener name="\JelixTests\Tests\Listener\TestAttrEventsListener"/>
</events>

use Jelix\Event\Attribute\ListenEvent;
use Jelix\Event\Attribute\ListenEventClass;

class TestAttrEventsListener
{
    #[ListenEvent('TestEvent')]
    function onTestEvent ($event) { }

    #[ListenEventClass]
    function testEventObject(EventForTest $event) { }
}

Forms

  • Support of <placeholder> into <input>, <textarea>, <htmleditor>, <wikieditor>,
  • Forms are compiled during the installation of the application to improve performance at runtime

Database

jDb is now relying on JelixDatabase.

The jDb class is still existing, but most of internal classes of jDb are gone and replaced by classes of JelixDatabase, although many of old classes are still existing (but can be empty) to not break typed parameters into your classes.

It brings some new features:

  • Support of schema names into table names, for some API
  • Support of generated column from Postgresql (contributor: Riccardo Beltrami)
  • Support of Identity column for Postgresql
  • Fix lastInsertId for SQLServer
  • Support of the mssql API removed. Only the connector using the sqlsrv API is available.
  • Minimum version of supported databases:
    • Mysql: 8.*
    • PostgreSQL: 13

Plugins for jDb (aka "drivers") implementing connectors etc, are not supported anymore. They have been replaced by classes provided directly by the JelixDatabase package.

Dao

jDao is now relying on JelixDao. The jDao class is still the main class to use to load and use Dao. Most of internal classes of jDao are gone and replaced by classes of JelixDao, although many of old classes are still existing (but can be empty) to not break typed parameters into your classes.

It brings some new features:

  • native support of JSON fields: dao properties having the datatype json are automatically encoded during insert/update, or decoded during a select.
  • Possibility to indicate a class from which the generated factory class will inherit. The classname should be indicated into the extends attribute of <factory>. The class can be anywhere and should be autoloadable. The class must inherit from jDaoFactoryBase and it must be abstract.

Other changes:

  • Plugins for jDao compiler (type 'daobuilder'), are not supported anymore.
  • Daos files are compiled during the installation of the application to improve performance at runtime
  • Classes generated from daos files have new names and are autoloaded
  • jSelectorDao, jSelectorDaoDb and jSelectorDaoRecord are deprecated and exists under new names.

Other new features

  • New methods jFile::mergeIniFile() and jFile::mergeIniContent()

Removes

  • Remove support of bytecode cache other than opcache.
  • Remove jacl and jacldb modules. There are still available into the jelix/jacl-module package. But you should consider it as an archive. You should migrate to jacl2 and jacl2db.
  • Remove jpref and jpref_admin modules. There are still available into the jelix/jpref-module package. But you should consider it as an archive. You should develop an alternative to these modules.
  • Plugins for jDb and jDao don't exist anymore.
  • All error messages are now only in english. No more jelix~db.*, jelix~daoxml.* and jelix~dao.* locales.
  • No more support of phpunit tests into modules. tests/runtests.php into application does not work anymore.

Broken API

  • Catching an exception about invalid/unknown profil (jProfile) must be done by catching \Jelix\Profiles\Exception instead of jException from now.
  • jFormsCompiler, jFormsCompiler_jf_1_0, jFormsCompiler_jf_1_1 have been renamed to Jelix\Forms\Compiler\FormCompiler, Jelix\Forms\Compiler\/XmlCompiler10, Jelix\Forms\Compiler\/XmlCompiler11, and so, are not existing anymore.

Deprecated features

  • The charset configuration property is deprecated. You should keep the default value to UTF-8. If not, convert your locales and other data to UTF-8 as the support of other charset will be gone in the next major version.
  • \Jelix\Core\Profiles must be used instead of jProfiles. Same API, but it is now relying on the JelixProfiles library. jProfiles is deprecated as well as methods storeInPool, getFromPool, getOrStoreInPool. Use storeConnectorInPool, getConnectorFromPool, getConnectorFromCallback instead.
  • If there are some plugins for jProfiles, they must inherit from \Jelix\Profiles\ReaderPlugin instead of jProfilesCompilerPlugin, or they must implement at least of the new interface \Jelix\Profiles\ProfilePluginInterface. jProfilesCompilerPlugin is deprecated.
  • jClassBinding
  • jelix_read_ini
  • jDao: method type xml. A PHP class should be used instead, that is declared into the extends attribute of <factory>.
  • css http request object is deprecated.
  • constant JELIX_SCRIPTS_PATH is now deprecated, as it becomes useless.
  • Functions declared into the namespace Jelix\Utilities are deprecated. Use them from the namespace Jelix\Core\Utilities.
  • Interface \jelix\Core\ConfigCompilerPluginInterface is deprecated. use \Jelix\Core\Config\CompilerPluginInterface instead.
  • selector classes: jSelectorAppCfg, jSelectorCfg, jSelectorDebugAction, jSelectorLib, jSelectorTmp, jSelectorVar
  • replace jSelectorModule by Jelix\Core\Selector\ModuleSelector
  • replace jISelector by Jelix\Core\Selector\SelectorInterface
  • replace jExceptionSelector by Jelix\Core\Selector\Exception
  • jelix_scan_module_sel
  • classes jLocale and jBundle are deprecated, and replaced by Jelix\Locale\Locale and Jelix\Locale\Bundle.
  • The method jConfigCompiler::findServerName() has been moved to jServer
  • jSelectorForm

About jDb:

  • jDbConnection and jDbPDOConnection are deprecated and replaced by objects implementing Jelix\Database\ConnectionInterface and Jelix\Database\ConnectionConstInterface
    • constants FETCH_*, ATTR_* and CURSOR_* are moved to ConnectionConstInterface
  • jDbResultSet and jDbPDOResultSet are deprecated and replaced by objects implementing Jelix\Database\ResultSetInterface
  • jDbParameters is deprecated and replaced by \Jelix\Database\AccessParameters
    • public methods are the same, however getParameters() is deprecated, getNormalizedParameters() should be used instead
  • jDbTools is deprecated and replaced by objects implementing Jelix\Database\Schema\SqlToolsInterface
    • methods getFieldList() and getTableList() are deprecated
    • constants IBD_* are moved to SqlToolsInterface
  • jDbSchema is deprecated and replaced by objects implementing Jelix\Database\Schema\SchemaInterface
  • jDbIndex, jDbConstraint, jDbUniqueKey, jDbPrimaryKey, jDbReference, jDbColumn, jDbTable are replaced by some classes of the Jelix\Database\Schema\ namespace.
  • jDbUtils and jDbUtils::getTools() is deprecated and is replaced by \Jelix\Database\Connection::getTools()
  • jDbWidget is deprecated and replaced by Jelix\Database\Helpers
  • jDaoDbMapper::createTableFromDao() returns an object \Jelix\Database\Schema\TableInterface instead of jTable

About jDao:

  • jDaoFactoryBase is replaced by objects implementing Jelix\Dao\DaoFactoryInterface
  • jDaoRecordBase is replaced by objects implementing Jelix\Dao\DaoRecordInterface
    • methods getDbProfile and setDbProfile don't exist on Jelix\Dao\DaoRecordInterface.
    • method getSelector() is deprecated, getDaoName() should be used instead.
  • jDaoConditions and jDaoCondition are deprecated and replaced by \Jelix\Dao\DaoConditions and \Jelix\Dao\DaoCondition.
  • jDaoXmlException is deprecated and not used anymore. The parser generates Jelix\Dao\Parser\ParserException instead.
  • jDaoGenerator and jDaoParser are removed
  • jDaoMethod is replaced by Jelix\Dao\Parser\DaoMethod
  • jDaoProperty is replaced by Jelix\Dao\Parser\DaoProperty
  • jDaoDbMapper is replaced by Jelix\Dao\DbMapper
  • jDaoSelector* classes are replaced by Jelix\Dao\DaoSelector* classes

Internal changes

  • constant JELIX_SCRIPTS_PATH: its value is now <vendor path>/lib/JelixFramework/DevHelper/.

Contributors to Jelix 1.9

  • Laurent Jouanneau
  • Raphael Martin
  • Riccardo Beltrami