Files
doc-fr/reference/yaf/appconfig.xml
Yannick Torres 0deee38318 sync with EN
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@341186 c90b9560-bf6c-de11-be94-00142212c4b1
2016-11-27 12:15:25 +00:00

410 lines
13 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: bc655954b94d30c9ce98ae6a526c5c1df9703cc6 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<chapter xml:id="yaf.appconfig" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title xmlns="http://docbook.org/ns/docbook">Application Configuration</title>
<para>
Vous devez fournir un tableau de configuration, ou un fichier
au format ini de configuration (voir le chemin
<classname>Yaf_Config_Ini</classname>) de la méthode
<methodname>Yaf_Application::__construct</methodname>.
</para>
<para>
Yaf va fusionner automatiquement les configurations de l'application et
celles de l'utilisateur. Les configurations d'application sont préfixées
par "yaf." ou par "application.". Si à la fois "yaf." et "application." existent,
"application." prendra l'avantage.
<example>
<title>Exemple avec un tableau PHP</title>
<programlisting role="php">
<![CDATA[
<?php
$configs = array(
"application" => array(
"directory" => dirname(__FILE__),
"dispatcher" => array(
"catchException" => 0,
),
"view" => array(
"ext" => "phtml",
),
),
);
$app = new Yaf_Application($configs);
?>
]]>
</programlisting>
</example>
<example>
<title>Exemple avec un fichier ini</title>
<programlisting role="ini">
<![CDATA[
[yaf]
yaf.directory = APPLICATION_PATH "/appliation"
yaf.dispatcher.catchException = 0
[product : yaf]
; la configuration utilisateur va ici
]]>
</programlisting>
</example>
</para>
<para>
<table>
<title>Configuration d'application Yaf</title>
<tgroup cols="3">
<thead>
<row>
<entry>&Name;</entry>
<entry>&Default;</entry>
<entry>&Changelog;</entry>
</row>
</thead>
<tbody>
<row>
<entry>application.directory</entry>
<entry></entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.ext</entry>
<entry>"php"</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.view.ext</entry>
<entry>"phtml"</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.modules</entry>
<entry>"index"</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.library</entry>
<entry>application.directory . "/library"</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.library.directory</entry>
<entry>application.directory . "/library"</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.library.namespace</entry>
<entry>""</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.bootstrap</entry>
<entry>application.directory . "/Bootstrap" . application.ext</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.baseUri</entry>
<entry>""</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.dispatcher.defaultRoute</entry>
<entry></entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.dispatcher.throwException</entry>
<entry>1</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.dispatcher.catchException</entry>
<entry>0</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.dispatcher.defaultModule</entry>
<entry>"index"</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.dispatcher.defaultController</entry>
<entry>"index"</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.dispatcher.defaultAction</entry>
<entry>"index"</entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
<row>
<entry>application.system</entry>
<entry></entry>
<entry><!-- leave empty, this will be filled by an automatic script --></entry>
</row>
</tbody>
</tgroup>
</table>
</para>
&ini.descriptions.title;
<para>
<variablelist>
<varlistentry xml:id="configuration.yaf.directory">
<term>
<parameter>application.directory</parameter>
<type>string</type>
</term>
<listitem>
<para>
Le dossier de l'application ; il contient les dossiers
"controllers", "views", "models" et "plugins".
</para>
<para>
<note>
<para>
Cette entrée de configuration est la seule qui n'a pas de valeur
par défaut. Vous devez toujours la définir manuellement.
</para>
</note>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.ext">
<term>
<parameter>application.ext</parameter>
<type>string</type>
</term>
<listitem>
<para>
L'extension de fichier du script PHP, utilisé dans la classe
autoloading(<classname>Yaf_Loader</classname>).
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.view.ext">
<term>
<parameter>application.view.ext</parameter>
<type>string</type>
</term>
<listitem>
<para>
L'extension du fichier de script du template de visualisation.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.modules">
<term>
<parameter>application.modules</parameter>
<type>string</type>
</term>
<listitem>
<para>
Une liste séparée par une virgule de modules enregistrés, utilisés
dans le processus de routage, et spécialement lorsqu'il y a plus de
trois segments dans le PATH_INFO
</para>
<para>
Yaf doit avoir un moyen de savoir si le premier segment est un
nom de module ou pas.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.library">
<term>
<parameter>application.library</parameter>
<type>string</type>
</term>
<listitem>
<para>
Le dossier local de la bibliothèque, voir
<classname>Yaf_Loader</classname> et
<link linkend="ini.yaf.library">yaf.library</link>.
</para>
<note>
<para>
Depuis Yaf 2.1.6, cette entrée de configuration peut être un tableau.
Le chemin de la bibliothèque tente d'utiliser la valeur de <link
linkend="configuration.yaf.library.directory">application.library.directory</link>
</para>
</note>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.library.directory">
<term>
<parameter>application.library.directory</parameter>
<type>string</type>
</term>
<listitem>
<para>
Alias de <link
linkend="configuration.yaf.library">application.library</link>.
Introduit en Yaf 2.1.6.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.library.namespace">
<term>
<parameter>application.library.namespace</parameter>
<type>string</type>
</term>
<listitem>
<para>
Préfixes séparés par une virgule d'espace de noms locaux de
la bibliothèque.
</para>
<para>
Introduit en Yaf 2.1.6
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.bootstrap">
<term>
<parameter>application.bootstrap</parameter>
<type>string</type>
</term>
<listitem>
<para>
Un chemin absolu du script de la classe Bootstrap.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.baseuri">
<term>
<parameter>application.baseUri</parameter>
<type>string</type>
</term>
<listitem>
<para>
Utilisé pour supprimer un préfixe fixé d'une URI de requête
dans le processus de routage. Par exemple, une requête
dont l'URI est "/prefix/controller/action". Si vous définissez
application.baseUri à "/prefix", alors seul "/controller/action"
sera pris comme PATH_INFO dans le processus de routage.
</para>
<para>
En général, il n'est pas nécessaire de définir cette valeur.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.dispatcher.throwexception">
<term>
<parameter>application.dispatcher.throwException</parameter>
<type>bool</type>
</term>
<listitem>
<para>
Si vaut On, Yaf lancera une exception lorsqu'une erreur surviendra.
Voir aussi la méthode <methodname>Yaf_Dispatcher::throwException</methodname>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.dispatcher.catchexception">
<term>
<parameter>application.dispatcher.catchException</parameter>
<type>bool</type>
</term>
<listitem>
<para>
Si vaut On, Yaf transmettra les erreurs aux controlleurs/actions,
lorsqu'il rencontrera une exception non attrapable.
Voir aussi la méthode <methodname>Yaf_Dispatcher::catchException</methodname>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.dispatcher.defaulRoute">
<term>
<parameter>application.dispatcher.defaultRoute</parameter>
<type>string</type>
</term>
<listitem>
<para>
La route par défaut, si elle n'est pas spécifié, la route statique
sera utilisée. Voir la méthode <methodname>Yaf_Router::addRoute</methodname>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.dispatcher.defaultmodule">
<term>
<parameter>application.dispatcher.defaultModule</parameter>
<type>string</type>
</term>
<listitem>
<para>
Le nom de module par défaut. Voir aussi la méthode
<methodname>Yaf_Dispatcher::setDefaultModule</methodname>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.dispatcher.defaultcontroller">
<term>
<parameter>application.dispatcher.defaultController</parameter>
<type>string</type>
</term>
<listitem>
<para>
Le nom par défaut du controlleur. Voir aussi la méthode
<methodname>Yaf_Dispatcher::setDefaultController</methodname>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.dispatcher.defaultaction">
<term>
<parameter>application.dispatcher.defaultAction</parameter>
<type>string</type>
</term>
<listitem>
<para>
Le nom par défaut de l'action. Voir aussi la méthode
<methodname>Yaf_Dispatcher::setDefaultAction</methodname>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.system">
<term>
<parameter>application.system</parameter>
<type>string</type>
</term>
<listitem>
<para>
Définit une configuration Yaf au moment de l'exécution dans
application.ini, comme ceci :
<link linkend="ini.yaf.lowcase-path">application.system.lowcase_path</link>
<note>
<para>
seules les options de configuration PHP_INI_ALL peuvent
être définies de cette façon.
</para>
</note>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->