Quick links: Content - sections - sub sections
EN FR

project.xml

The file project.xml contains some informations on the application. Some of these are important because they are used by the installer.

It is an XML file with a <project> as root element, and which contains 4 elements:


<project xmlns="http://jelix.org/ns/project/1.0">
    <info id="testapp@jelix.org" name="testapp" createdate="2017-01-01">
     ...
    </info>
    <dependencies>
     ...
    </dependencies>
    <directories>
     ...
    </directories>
    <entrypoints>
     ...
    </entrypoints>
</project>

info

Int the element info, there are some informations indicative only about the application, like its name, a description, the copyright, the creator name etc. Note that this element can be used also in module.xml files to identify a module. Here is an example:


<info id="testapp@jelix.org" name="testapp" createdate="2017-01-01">
    <version>1.0</version>
    <label lang="en_US">Testapp</label>
    <description lang="en_US">Application to test Jelix</description>
    <licence URL="http://www.gnu.org/licenses/gpl.html">GPL</licence>
    <copyright>2017 Laurent Jouanneau and other contributors</copyright>
    <creator name="Laurent Jouanneau" email="laurent@jelix.org"/>
    <contributor name="Superman" email="superman@superville.com"/>
    <homepageURL>http://jelix.org</homepageURL>
</info>

Only the <version> element and attributes id and name on <info> are required. Others are optionals.

The id attribute should be a unique identifiant. That's why it is recommanded to use an email as an identifiant (or a UUID but it is less readable).

The attribute name should be a "technical" name (the name of the directory of the application or of the module for instance). The label element can contain a displayable name.

dependencies

The element <directories> should contain informations about dependencies of the application. For the moment, only the jelix version is required.


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

This element can be used in a module.xml file, and can contain additionnaly one or more <module> elements, which indicate modules that the installer should install in order to execute correctly the modules.


  <module name="testurls" minversion="2.2" maxversion="2.3" />
  <module name="jauthdb" />
  <module name="jacl2db" />

directories

This element indicate paths of some directories. all elements in this example are required:


    <directories>
        <config>var/config</config>
        <log>var/log</log>
        <var>var</var>
        <www>www</www>
        <temp>../temp/testapp</temp>
    </directories>

entrypoints

The entrypoints element list all entry points of the application (in www/ or scripts/), with their configuration file and their type.


    <entrypoints>
        <entry file="index.php" config="index/config.ini.php" />
        <entry file="soap.php" config="soap/config.ini.php" type="soap"/>
        <entry file="jsonrpc.php" config="jsonrpc/config.ini.php" type="jsonrpc"/>
        <entry file="cmdline.php" config="cmdline/config.ini.php" type="cmdline"/>
    </entrypoints>

module.xml

A module.xml file must be present in each directory of modules. It contains a root element module which should contain a <info> element and <dependencies> element. See above to know how to write these elements.


<module xmlns="http://jelix.org/ns/module/1.0">
    <info id="jelix_tests@testapp.jelix.org" name="jelix_tests">
        <version>1.0</version>
        <label>Jelix tests</label>
        <description>unit tests for jelix</description>
    </info>
    <dependencies>
        <jelix minversion="1.6.0" maxversion="1.6.*" />
        <module name="testurls" minversion="1.0.2" maxversion="1.1b1" />
        <module name="jauthdb" />
        <module name="jacl2db" />
        <module name="jacldb" />
    </dependencies>
</module>

configuration ini files

See lib/jelix/core/defaultconfig.ini.php for the whole list of parameters. This file is the "source" of the var/config/mainconfig.ini.php file of your application.

Below is a tour of all configuration sections.

global section

Usually its parameters are at the beginning of file. They define default or global values of the framework.


startModule = "jelix"
startAction = "default:index"
locale = "en_US"
charset = "UTF-8"
timeZone = "US/Pacific"

pluginsPath = lib:jelix-plugins/,app:plugins/
modulesPath = lib:jelix-modules/,app:modules/

theme = default
use_error_handler = on

Parameters in details :

  • startModule, startAction : default module and action (generally re-defined for each response type. see preceding section)
  • locale, charset : default language and encoding of responses
  • timeZone : set the time zone for every date and time functions
  • pluginsPath : path list to plugins. learn more in plugins documentation.
  • theme : default selected theme. Read theme system description.
  • use_error_handler : this option shoud stay on for Jelix to return useful and detailed errors or exceptions.

modules section

Contains the list of all used modules, and their access level

  • 0 means the module is not used and must not be installed
  • 1 means the module is used, but only by other modules (its daos, forms etc), but is not accessible directly from the web (so it has no controllers or existing controllers will never be called)
  • 2 means the module is installed and usuable normally.

coordplugins section

List all coordinator plugins Jelix has to activate. They will be loaded from the list of path defined by the pluginsPath option.

The example below demonstrates the activation of an authentication plugin. Its own set of options are defined in auth.coord.ini.php file. Learn more about authentication.


[coordplugins]
;plugin name = ini filename
auth = "auth.coord.ini.php"

responses section

this section allows to customize each response type and its alias. each line consists of a couple <response alias>=<response class>.

As for example, it is usual to overload html default response (jResponseHtml) by such a line : html=myhtmlresponse. Find more details in customizing common response

Below are the default alias and response types:


[responses]
html = jResponseHtml
redirect = jResponseRedirect
redirectUrl = jResponseRedirectUrl
binary = jResponseBinary
text = jResponseText
jsonrpc = jResponseJsonrpc
json = jResponseJson
xmlrpc = jResponseXmlrpc
xml = jResponseXml
zip = jResponseZip
rss2.0 = jResponseRss20
atom1.0 = jResponseAtom10
css= jResponseCss
tcpdf = jResponseTcpdf

error_handling section

Those parameters are used to configure notifications occuring during an application script execution. Details can be found in error manager documentation.

Notifications have different levels. Jelix defined levels corresponding to PHP error_reporting levels:

  • default = selected level if no other level corresponds
  • error = notify an error stopping a script execution
  • warning = notifu an error which doesn't stop a script
  • notice = notify a possible error
  • deprecated = notify a deprecated function (php 5.3)
  • strict = notify core PHP messages about compatibility and interoperability

Below are the whole list of parameters:


[error_handling]
messageLogFormat = "%date%\t%ip\t[%code%]\t%msg%\t%file%\t%line%\n"
logFile = error.log
email = root@localhost
emailHeaders = "Content-Type: text/plain; charset=UTF-8\nFrom: webmaster@yoursite.com\nX-Mailer: Jelix\nX-Priority: 1 (Highest)\n"
quietMessage="A technical error has occured. Sorry for this trouble."

showInFirebug = off

; keywords you can use : ECHO, ECHOQUIET, EXIT, LOGFILE, SYSLOG, MAIL, TRACE
default      = ECHO EXIT
error        = ECHO EXIT
warning      = ECHO
notice       = ECHO
deprecated   = ECHO
strict       = ECHO
; exceptions implicitly use EXIT
exception    = ECHO
  • messageLogFormat and logFile configure a log file output (LOGFILE or SYSLOG)
  • email et emailHeaders configure mail ouptut (MAIL)
  • quietMessage defines a neutral message for user (ECHOQUIET)
  • showInFirebug : if on, all notifications will be redirected to firebug extension of firefox browser using its console api.

The last set of options allows to associate ouptut formats to each level of notification. Each level can have more than one output format. For example, in production, you'll probably want to set :error = ECHOQUIET EXIT LOGFILE and so on.

compilation section

Defines the template behavior of Jelix template engine. And more precisely of its compilation step. Find in-depth details in templates.


[compilation]
checkCacheFiletime  = on
force  = off
  • checkCacheFiletime : if on template will be compiled if its file modification date is more recent than its already PHP compiled file.
  • force : if on, template is systematically compiled

section zone

There is an option to globally disable zone caching. It is useful during development environment but should be set to off in production.

To disable zone caching :


[zones]
disableCache = on  // default to off

urlengine section

Defines how the url engine works.


[urlengine]
engine        = significant

enableParser = on
multiview = off

scriptNameServerVariable =
pathInfoInQueryParameter =

basePath = ""
jelixWWWPath = "jelix/"

defaultEntrypoint= index

simple_urlengine_https =

Details:

  • engine : name of the used engine. Available engines are: simple, basic_significant and significant
  • enableParser : activate the parsing of the url. Deactivate it if the url is parsed by the web server (with the mod_rewrite of Apache for exemple), and is given to Jelix as a simple url without pathinfo, like for the simple url engine.
  • multiView : indicate if the ".php" part of the entrypoints name should be added or not into generated url. It is possible to activate it if the multiview option in Apache is activated or if there is a rewrite rule into the web server that adds the ".php".
  • scriptNameServerVariable : the name of the variable into $_SERVER containing the script name. Example: for the url http://mysite.com/foo/index.php, it is the variable which contains "/foo/index.php". The name can be SCRIPT_NAME, ORIG_SCRIPT_NAME, PHP_SELF or REDIRECT_SCRIPT_URL. It is automatically detected by jelix, but in some server configuration, it may not work and you should indicate the variable name.
  • pathInQueryParameter : if the webserver has some rewrite rules that move the pathinfo into a query parameter (like RewriteRule ^(.*)$ index.php/?jpathinfo=$1 [L,QSA]) then you must indicate the name of this query parameter into pathInfoInQueryParameter (here "jpathinfo").
  • basePath : this parameter is the web path to your index.php. It is automatically detected, but some time the detection fails, and you should indicate it. For example, if the url of the index.php is http://foo.com/aaa/bbb/www/index.php, then you should indicate /aaa/bbb/www/. If the url is simply http://foo.com/index.php, then the base path is /.
  • jelixWWWPath : contains the web path to the lib/jelix-www/ content. If you modify it, modify also path into the htmleditors, wikieditors, datepickers, jquery. See below.
  • jqueryPath : contains the web path to the directory having jQuery/jQueryUI files of jelix (typically, web path to lib/jelix-www/jquery/). You can modify it, if you want to provide your own jQuery/jQueryUI files. But in this case, the content should have same filenames. However, jqueryPath is deprecated since Jelix 1.6.20, as there is a new way to define your own jQuery files. See the jquery section below.
  • defaultEntrypoint : contains the default entrypoint name
  • simple_urlengine_https : contains the list of actions that need HTTPS

notfound

The default page to display when a page is not find. notfoundAct should contains the action selector which will display the 404 error. By default, it is jelix~error:notfound


notfoundAct =

logfiles section

This section defines how log calls through jLog api will be output. Log files are created and stored in var/log/ application folder.

A per-module log file can be defined by setting a couple <module name>=<log filename> and calling jLog methods with <module name> as last argument.


; default log
  default = messages.log

; log for "news" module
  news = news.log

Another example shows how you can use firebug extension as a log output (useful for quickly debugging). Still you can log to a classic file calling jLog methods with file as last argument (for dumping huge content for example).


[logfiles]
default="!firebug"
file = "messages.log"

Learn more about Jelix debugging through jLog documentation.

mailer section

Parameters required to send mails through application scripts. As for example, authentication or notifications can send emails.


[mailer]
webmasterEmail = root@localhost
webmasterName =

; How to send mail : "mail" (mail()), "sendmail" (call sendmail), or "smtp" (send directly to a smtp)
mailerType = mail
; Sets the hostname to use in Message-Id and Received headers
; and as default HELO string. If empty, the value returned
; by SERVER_NAME is used or 'localhost.localdomain'.
hostname =
sendmailPath = "/usr/sbin/sendmail"

; if mailer = smtp , fill the following parameters

; SMTP hosts.  All hosts must be separated by a semicolon : "smtp1.example.com:25;smtp2.example.com"
smtpHost = "localhost"
; default SMTP server port
smtpPort = 25
; SMTP HELO of the message (Default is hostname)
smtpHelo =
; SMTP authentication
smtpAuth = off
smtpUsername =
smtpPassword =
; SMTP server timeout in seconds
smtpTimeout = 10

acl section

Defines options of access control list (ACL) or rights management. See rights management. You can use jAcl ou jAcl2, but not both at the same time. Indicate a driver to enable it.


[acl]
; example of driver : "db"
driver =

[acl2]
; example of driver : "db"
driver =

sessions section

Determines how PHP sessions are stored (file or databse). Find more details in sessions documentation.


[sessions]
shared_session = off
; Use alternative storage engines for sessions
;
; usage :
;
; storage = "files"
; files_path = "app:var/sessions/"
;
; or
;
; storage = "dao"
; dao_selector = "jelix~jsession"
; dao_db_profile = ""

section forms

Contains parameters for widgets of jForms.

First parameters for the datepicker:


[forms]
; define input type for datetime widgets : "textboxes" or "menulists"
controls.datetime.input = "menulists"

; define the way month labels are displayed widgets: "numbers", "names" or "shortnames"
controls.datetime.months.labels = "names"

; define the default config for datepickers in jforms
datepicker = default
datetimepicker = default

Then parameters for the captcha. All type of captcha are defined here (simple and recaptcha), with for each, the name of the class which validate the captcha, and the widget name.


captcha.simple.validator=\jelix\forms\Captcha\SimpleCaptchaValidator
captcha.simple.widgettype=captcha

captcha.recaptcha.validator=\jelix\forms\Captcha\ReCaptchaValidator
captcha.recaptcha.widgettype=recaptcha

You define the default type of captcha you want to use into captcha:


; default captcha type
captcha = simple

jquery section

This section exists since Jelix 1.6.20. It is possible to indicate the web path of jQuery files and jQueryUI files, allowing to use your own version of jQuery.


[jquery]
jquery = $jqueryPath/jquery.js
jqueryui.js[] = $jqueryPath/ui/jquery-ui-core-widg-mous-posi.custom.min.js
jqueryui.css[] = $jqueryPath/themes/base/jquery.ui.all.css

jqueryui.js[] means an array of files.

You can use some "variables", like $jqueryPath, which will be replaced by the value of jqueryPath of the urlengine section. You can use also $jelix which will be replaced by the value of jelixWWWPath. You can also indicate a simple path relative to the base path, or an absolute path.

datepickers and datetimepickers section

For each type of datepickers, you indicate the path of the initialisation script for jforms (the parameter name is the type name, <type>=...). Since Jelix 1.6.20, you indicate also the list of JS and CSS files that the widget will declare into the html page. Parameters names are <type>.js[]=... and <type>.css[]=....


[datepickers]
default = jelix/js/jforms/datepickers/default/init.js
default.js[]=$jqueryPath/ui/jquery-ui-core-widg-mous-posi.custom.min.js
default.js[]=$jqueryPath/ui/jquery.ui.datepicker.min.js
default.js[]=$jelix/js/jforms/datepickers/default/ui.$lang.js
default.js[]=$jqueryPath/ui/i18n/jquery.ui.datepicker-$lang.js
default.css[]=$jqueryPath/themes/base/jquery.ui.all.css

htmleditors section

define for each type of htmleditor, its name, the list of js files, the web path to the script that initialize the html editor for jForms, and its CSS file.

Here for the "default" html editor.


[htmleditors]
default.engine.name = wymeditor
default.engine.file[] = $jelix/jquery/jquery.js
default.engine.file[] = $jelix/wymeditor/jquery.wymeditor.js
default.config = $jelix/wymeditor/config/default.js
default.skin.default  = $jelix/wymeditor/skins/default/screen.css

wikieditors section


[wikieditors]
default.engine.name = wr3
default.wiki.rules = wr3_to_xhtml
; path to the engine file
default.engine.file = jelix/markitup/jquery.markitup.js
; define the path to the "internationalized" file to translate the label of each button
default.config.path = jelix/markitup/sets/wr3/
; define the path to the image of buttons of the toolbar
default.image.path = jelix/markitup/sets/wr3/images/
default.skin = jelix/markitup/skins/simple/style.css