forked from jelix/jelix-manual-en
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration-details.gtw
371 lines (271 loc) · 12.2 KB
/
configuration-details.gtw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
~~LANG:FR@frman:details-configuration~~
===== project.xml =====
The file @@[email protected]@@ 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 @@E@<project>@@ as root element, and which contains 4 elements:
<code xml>
<project xmlns="http://jelix.org/ns/project/1.0">
<info id="[email protected]" name="testapp" createdate="2005-01-01">
...
</info>
<dependencies>
...
</dependencies>
<directories>
...
</directories>
<entrypoints>
...
</entrypoints>
</project>
</code>
==== info ====
Int the element @@E@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 @@[email protected]@@ files to identify a module. Here is an example:
<code xml>
<info id="[email protected]" name="testapp" createdate="2005-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>2005-2010 Laurent Jouanneau and other contributors</copyright>
<creator name="Laurent Jouanneau" email="[email protected]" active="true" />
<contributor name="Superman" email="[email protected]" active="true" since="" role=""/>
<homepageURL>http://jelix.org</homepageURL>
</info>
</code>
Only the @@E@<version>@@ element and attributes @@A@id@@ and @@A@name@@ on @@E@<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 @@A@name@@ should be a "technical" name (the name of the directory of the application or of the module for instance). The @@E@label@@ element can contain a displayable name.
==== dependencies ====
The element @@E@<directories>@@ should contain informations about dependencies of the application. For the moment, only the jelix version is required.
<code xml>
<dependencies>
<jelix minversion="1.3.0" maxversion="1.3.*" />
</dependencies>
</code>
This element can be used in a @@[email protected]@@ file, and can contain additionnaly one or more @@E@<module>@@ elements, which indicate modules that the installer should install in order to execute correctly the modules.
<code xml>
<module name="testurls" minversion="2.2" maxversion="2.3" />
<module name="jauthdb" />
<module name="jacl2db" />
</code>
==== directories ====
This element indicate paths of some directories. all elements in this example are required:
<code xml>
<directories>
<config>var/config</config>
<log>var/log</log>
<var>var</var>
<www>www</www>
<temp>../temp/testapp</temp>
</directories>
</code>
==== entrypoints ====
The @@E@entrypoints@@ element list all entry points of the application (in @@F@www/@@ or @@F@scripts/@@), with their configuration file and their type.
<code xml>
<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>
</code>
===== module.xml =====
A @@[email protected]@@ file must be present in each directory of modules. It contains a root element @@E@module@@ which should contain a @@E@<info>@@ element and @@E@<dependencies>@@ element. See above to know how to write these elements.
<code xml>
<module xmlns="http://jelix.org/ns/module/1.0">
<info id="[email protected]" name="jelix_tests">
<version>1.0</version>
<label>Jelix tests</label>
<description>unit tests for jelix</description>
</info>
<dependencies>
<jelix minversion="1.3" maxversion="1.3.*" />
<module name="testurls" minversion="1.0.2" maxversion="1.1b1" />
<module name="jauthdb" />
<module name="jacl2db" />
<module name="jacldb" />
</dependencies>
</module>
</code>
===== configuration ini files=====
See @@F@lib/jelix/core/defaultconfig.ini.php@@ for the whole list of parameters. This file is the "source" of the identically-named file you find in @@F@var/config@@ 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.
<code ini>
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
</code>
Parameters in details :
* **startModule, startAction** : default module and action (generally re-defined for each response type. see [[config#organization|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|plugins]] documentation.
* **theme** : default selected theme. Read [[themes|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 @@[email protected]@@ file. Learn more about [[authentification|authentication]].
<code ini>
[coordplugins]
;plugin name = ini filename
auth = "auth.coord.ini.php"
</code>
==== 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 [[common-processes#customizing-common-response|customizing common response]]
Below are the default alias and response types:
<code ini>
[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
</code>
==== error_handling section ====
Those parameters are used to configure notifications occuring during an application script execution. Details can be found in [[errormanager|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:
<code ini>
[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: [email protected]\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
</code>
* **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|templates]].
<code ini>
[compilation]
checkCacheFiletime = on
force = off
</code>
* **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 :
<code ini>
[zones]
disableCache = on // default to off
</code>
==== urlengine section ====
@TODO : to complete
==== logfiles section ====
This section defines how log calls through [[debugging|jLog]] api will be output.
Log files are created and stored in @@F@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.
<code ini>
; default log
default = messages.log
; log for "news" module
news = news.log
</code>
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).
<code ini>
[logfiles]
default="!firebug"
file = "messages.log"
</code>
Learn more about Jelix debugging through [[debugging|jLog]] documentation.
==== mailer section ====
Parameters required to send mails through application scripts. As for example, authentication or notifications can send emails.
<code ini>
[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
</code>
==== acl section ====
Defines options of access control list (ACL) or rights management. See [[/rights2|rights management]]. You can use jAcl ou jAcl2, but not both at the same time. Indicate a driver to enable it.
<code ini>
[acl]
; example of driver : "db"
driver =
[acl2]
; example of driver : "db"
driver =
</code>
==== sessions section ====
Determines how PHP sessions are stored (file or databse). Find more details in [[/classe-utilities/jsession|sessions]] documentation.
<code ini>
[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 = ""
</code>