mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-26 01:42:09 +01:00
174 lines
4.6 KiB
XML
174 lines
4.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: ecaa2146429a7f88de40dfce14718afc896b74c5 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="yaf-application.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>Yaf_Application::__construct</refname>
|
|
<refpurpose>Constructeur de Yaf_Application</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<constructorsynopsis>
|
|
<modifier>public</modifier> <methodname>Yaf_Application::__construct</methodname>
|
|
<methodparam><type>mixed</type><parameter>config</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>envrion</parameter></methodparam>
|
|
</constructorsynopsis>
|
|
<para>
|
|
Instancie un objet <classname>Yaf_Application</classname>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>config</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Un chemin vers le fichier de configuration ini, ou un tableau de configuration.
|
|
</para>
|
|
<para>
|
|
Si un fichier de configuration est fourni, il doit contenir une section
|
|
nommée telle que spécifiée par le paramètre
|
|
<link linkend="ini.yaf.environ">yaf.environ</link>, qui est "product" par défaut.
|
|
<note>
|
|
<para>
|
|
Si vous utilisez un fichier de configuration au format ini pour
|
|
la configuration de votre application, vous devriez utiliser
|
|
la méthode <link linkend="ini.yaf.cache-config">yaf.cache_config</link>
|
|
à la place pour améliorer les performances.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
<para>
|
|
Et l'entrée de configuration (et sa valeur par défaut) listée
|
|
ci-dessous :
|
|
<example>
|
|
<title>Un exemple de fichier de configuration au format ini</title>
|
|
<programlisting role="ini" xml:id="yaf.application.ini">
|
|
<![CDATA[
|
|
[product]
|
|
;Doit toujours être défini ; aucune valeur par défaut
|
|
application.directory=APPLICATION_PATH
|
|
|
|
;Les configurations suivantes ont une valeur par défaut, vous n'avez pas besoin de les définir
|
|
application.library = APPLICATION_PATH . "/library"
|
|
application.dispatcher.throwException=1
|
|
application.dispatcher.catchException=1
|
|
|
|
application.baseUri=""
|
|
|
|
;Le nom du script PHP
|
|
ap.ext=php
|
|
|
|
;Le nom du template de visualisation
|
|
ap.view.ext=phtml
|
|
|
|
ap.dispatcher.defaultModuel=Index
|
|
ap.dispatcher.defaultController=Index
|
|
ap.dispatcher.defaultAction=index
|
|
|
|
;Les modules définis
|
|
ap.modules=Index
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>envrion</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La section à charger comme configuration finale.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Exemple avec <function>Yaf_Application::__construct</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
defined('APPLICATION_PATH') // APPLICATION_PATH sera utilisé dans le fichier de configuration ini
|
|
|| define('APPLICATION_PATH', __DIR__));
|
|
|
|
$application = new Yaf_Application(APPLICATION_PATH.'/conf/application.ini');
|
|
$application->bootstrap()->run();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<example>
|
|
<title>Exemple avec <function>Yaf_Application::__construct</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$config = array(
|
|
"application" => array(
|
|
"directory" => realpath(dirname(__FILE__)) . "/application",
|
|
),
|
|
);
|
|
|
|
/** YAf_Application */
|
|
$application = new Yaf_Application($config);
|
|
$application->bootstrap()->run();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member><classname>Yaf_Config_Ini</classname></member>
|
|
</simplelist>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- 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
|
|
-->
|