Chapter: New features
|^ Introduction||Migrating from a previous version »|
− Table of content
Improvements provided by the version 1.7 ¶
Jelix 1.7 brings many new features. However, migration is easy, as a migration script do many things.
Jelix 1.7 is now compatible only with PHP 5.6 or higher, until PHP 8.0.
Composer integration ¶
- Jelix is now installable with Composer
- Some modules and plugins are now in their own repository and available separately with Composer.
- Configuration parameters
pluginsPathare not supported anymore and replaced by a new API to call from
jApp::declareModuleDir(). It si also possible to declare modules and plugins path in your composer.json file.
app/ directory ¶
An application contains now a new
app/ directory in which some files
and directory have been moved from
responses/. It allows
to separate files that are common for all environment (in
those that are specific to a server (in
This is the case for:
- main configuration. It is now in
urls.xml, configuration files of plugins, of SOAP etc. Other files like
config.ini.phpof entry points can be in both
localesdirectories. They should be in
var/localescan be still used but only for ressources created by the application, or installed by modules added during the life of the application.
responses/has been moved to
- the list of entry points is not anymore into project.xml, but in a new file
New URL engine ¶
There is now only one URL engine, which is a mix of
basic_significant url engine of Jelix 1.6. It has many improvements to ease
configuration. There is not anymore a plugin system for url engines, so
basic_significant plugins are gone.
- "module" and "action" parameters are not supported anymore (but you can still retrieve them from your controllers, even if this feature is deprecated)
startActionin the configuration do no exist anymore, as well as
- An API allows Installer scripts to declare new URL (so it modify
the urls.xml file):
- In the urls.xml file:
- it si possible to indicate a pathinfo on
- it is required to indicate an action for the url "/". It replace the
- an empty pathinfo in
<url>is equivalent to "/".
- Errors during the parsing of urls.xml have been improved
- it is possible to declare an url for a controller, without declaring all of its methods.
- it si possible to indicate a pathinfo on
The migration tools generates the new urls.xml for you.
Improvements of the installer ¶
Until Jelix 1.6, the installation system called installation script of modules for each entry point. This is not the case anymore. Installation script are called only one time.
So modules declarations (
[modules] section) is not possible anymore in
entry point configuration, but only in
and a new API for installation scripts has been created.
The new installation system introduces a new step for the installation of a module: configuration. A module can provide a class that will modify configuration and install files when the developer import the module into the application. The installation will just have to finish to initialize in the application instance.
A module can also provide a class for the deinstallation. There is no anymore
uninstall() methods into installation class. The deinstallation class is
copied outside the module when the developer "deconfigure" the module, so it
allows to execute some tasks in an application instance to remove properly
things created by the installer, even if the source code of the module has been
removed (this is the case when it was installed with Composer and then removed).
For the update of a module, you can now provide an
upgrade.php script, similar
install.php, which will be called at each update of the module, after
update scripts dedicated to a specific version. It allows to do repetitive
tasks at each update, and avoid to rewrite them in all update scripts.
All this changes imply changes into API and new class to inherit from into
module scripts. However classes written for the previous installation system
jInstallerEntryPoint) are still
supported, even if they are deprecated and won't be supported in next versions
There are new commands, like
but some other have disappear, like
During an upgrade, jInstaller does a backup of
installer.ini.php, so if
something goes wrong, you can restore it.
An other new feature, is the possibility to indicate into module.xml files, some alternative modules or some incompatible modules, in the dependencies section.
New assets system: webassets ¶
Jelix 1.7 offers a new way to declare in the HTML, assets like JS and CSS. In the configuration you can set some lists of JS scripts and CSS urls. Each lists are a named group.
So in your controller, instead of setting directly JS and CSS content, you just indicate the name of webassets group you want to use.
It allows to modify easily what a module want to load into your web page, without modifying the module itself. It could be very useful with external modules, or even modules provided by Jelix. For example, you can indicate other version of bundled library, ou you can change CSS and JS depending of the environment (demo vs production).
Note that libraries jQuery, jQueryUI and Markitup have been updated to their last version (respectively 3.3.1, 1.12.1, 1.1.15). jQueryUI is now provided as a unique file containing all components. WymEditor has been replaced by CKEditor5.
Command line script in modules ¶
In Jelix 1.6 and lower, it was possible to create command line scripts by
creating a controller inheriting of
jControllerCmdLine and an entry point
using jCmdLineCoordinator etc.. This mechanism is still usable but is deprecated.
A new mechanism is available: the module can provide
commands implemented with Symfony Console, and are
callable with a new script
console.php provided by the application, and
which will discover (almost) automatically all of these commands.
Jelix Scripts ¶
Commands that help the developer, are callable with the script cmd.php of the application. They have been totally rewritten by using Symfony Console. Names and parameters of these commands have been changed. The cmd.php script has been renamed to dev.php.
Commands about jAcl2 have been migrated into the module jacl2db, and are now callable with the new console.php script.
The createapp.php script has been moved to a bin/ directory, renamed as
and is based on Symfony Console. This script asks now parameters to the user,
because of the configuration system.
jDb and jDao ¶
- jDb: improved the support of prepared queries
- bindValue and bindParam should follow signature of PDO'ones
- sqlite: support of prepared queries
- pgsql: support of named parameters for prepared queries
- mysqli: improved support of prepared queries
- jDb/mysqli: use modern api to start transaction
- jDao has now its own plugins to generate classes. So "daobuilder" classes of jDb plugins are not recognized anymore.
- jDb schema: all improvements coming from Jelix 1.6.16. Full support of SQL schema changes with Mysql, Postgresql Sqlite3, OCI and SQLServer.
- Classes of jDbTools have been migrated outside the database plugins.
- The content of profiles.ini.php is optimized and stored in a cache
- it is extensible with plugins: these plugins can process a specific type
of profile and store some additionnal informations in the cache.
- A plugin for jDb is provided, allowing jDb to improve the connection speed.
- jForms does not store instances data into the session, but into a cache, by using jCache (so you can configure the cache : in files, or in memcache, Redis...)
- For the
choicecontrol, an item can now be an empty value.
choicecontrol can be used inside a
the new method
- The datetime picker allows now to select time
- new control
<color>to select a color.
- new control
<upload2>enhancing the actual
<upload>with management of already uploaded files.
API change in the framework core ¶
- The property
jResponseHtmldoes contain now only the lang code (XX) instead of the full locale (XX_YY). The full locale is now in a new property
- jRequest parse now automatically JSON content from the body request. This feature was introduced in Jelix 1.6.12 but it was deactivated by default.
- new method
jCoordinator::execOriginalAction()to know when there is an internal redirection
- jCmdLineRequest: the module and the action name should be given to the constructor when the script is dedicated to a specific action.
- CRUD controller: the records list can be ordered
- jAcl2: the notion of 'subject' has been replaced by the notion of 'right', which is more relevant. API having the word 'subject' in their name have been replaced by API using the 'right' name, but they are still available.
- new method
jApp::urlBasePath()which allow to retrieve the base path, so it is a shortcut for
- new method
- jApp is now using internally a new class jAppInstance to ease context switching
- new method
jAppInstance::includePlugin()to load a plugin class without instancying it directly
- new method
- new object
jFrameworkallowing to access to some informations about the framework (version...)
- In new application created with createapp.php, the temp directory is now in the application directory
- Web assets of modules loaded by the www controller of Jelix are now put in the cache of the browser.
Other new features ¶
- by default, in all new application, the content of jelix-www is duplicated
into the directory www/jelix/ of the application, so it ease the start
of the developpement of the application. You can keep the old behavior:
having a web alias to jelix-www/ in the web server configuration. You can
also create a symbolic link. This is configurable by launching the configurator
of the module jelix, with the new command
- jAuth: persistant_crypt_key has been renamed to persistant_encryption_key and use a stronger random generation algorithm.
- jAuth, plugin ldap: connection information (host, login, password etc.) should now be into the profiles.ini.php file
- jauthdb_admin: Users list can be filtered and ordered
- jacl2db_admin: Users list can be filtered
- jLocale can now try a locale key in a similar locale of the current one
- Organize zones cache into subdirectories
jIniFileModifier: no empty line added at the end of the file at each save
jFileis based on the Composer package "jelix/file-utilities", which have more useful methods.
jFile::getMimeTypeFromFilename(): support of a mime type list defined into a
[mimeTypes]section in the configuration
- fix jDatetime about RCF822 format and timezone
- new exceptions for controllers,
jHttp403ForbiddenExceptionto return easily an HTTP response (Jelix 1.7.2+).
Modules and plugins removed ¶
Like the jtcpdf module in previous version of Jelix, some modules and plugins are not provided anymore with the Jelix package, but available separately via Composer.
Here are these modules and plugins
- jSoap module: jelix/soap-server-module
- jtcpdf module: jelix/tcpdf-module.
- Minify plugin for jResponseHtml: jelix/minify-module.
- redis plugin for jKVDb: jelix/php-redis-plugin.
- jsitemap module : jelix/sitemap-module
- diff plugin for jTpl
Some other components, modules and plugins are now in their own repository, although there are available with the Jelix package via Composer dependencies.
Deprecated features, modules and plugins ¶
- There are not anymore en_EN locales files. Configure your application to use en_US or en_GB locales
- The memcache22 plugin for jCache has been removed
jInstallerBase::declarePluginsPath()has been removed
- jIniFile, jIniFileModifier, jIniMultiFilesModifier have other names: Jelix\IniFile\Util, Jelix\IniFile\IniModifier, Jelix\IniFile\MultiIniModifier. But it is still possible to use old name until the next version.
- The method
jApp::configPath()is deprecated and replaced by
- The class
jJsonhas been removed. Use json PHP functions instead.
- The class
jCrypthas been removed. The API it used has been deprecated in PHP and is not maintained anymore. You should use other stronger libraries like defuse/php-encryption for example.
- the class
jVersionComparatorhas been replaced by another similar class
- Remove <directories> from project.xml. It is not supported anymore.
- the plugin zendframework has been removed
- jDao: the 'driver' attribute on the
binary_opelement is deprecated, and is replaced by a 'dbtype' attribute
- jDao: the support of the attribute
groupbyon the element
methodhas been removed
- jDao: the deprecated method
jDaoConditions::addItemGroup()has been removed
- the driver
mssqlfor jDb has been deprecated. Use the driver
- Simpletests and the junittests module has been removed. If you need them, you can still installed separately (with Composer for example).
- mysql and sqlite plugins. They used deprecated PHP API. Note that there are still a mysqli and a sqlite3 plugin in Jelix
- jHttp is now deprecated and available as a Composer package
- Clearbricks files have been removed
- files json.js, json2.js and xul/jsonrpc.js have been removed since browsers support now JSON natively.
LDSfor jAuth has been removed.
For contributors ¶
- The Vagrant configuration for contributors is now in testapp
- No need anymore to "build" Jelix from the git repository: it is more easy to contribute ;-)
- FakeServerConf, Minify, PHPMailer are now installed via Composer
- In testapp, a new application "adminapp" is available to test admin modules
Contributors to Jelix 1.7 ¶
- Brunto (crud controller)
- Julien Issler (improvements on jForms)
- Laurent Jouanneau (most of improvements)