<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-application.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'yaf-application.construct.php',
    1 => 'Yaf_Application::__construct',
    2 => 'Constructeur de Yaf_Application',
  ),
  'up' => 
  array (
    0 => 'class.yaf-application.php',
    1 => 'Yaf_Application',
  ),
  'prev' => 
  array (
    0 => 'yaf-application.clearlasterror.php',
    1 => 'Yaf_Application::clearLastError',
  ),
  'next' => 
  array (
    0 => 'yaf-application.destruct.php',
    1 => 'Yaf_Application::__destruct',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/yaf/yaf_application/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-application.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Application::__construct</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Application::__construct</span> &mdash; <span class="dc-title">Constructeur de Yaf_Application</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-application.construct-description">
  <h3 class="title">Description</h3>
   <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Yaf_Application::__construct</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$config</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$envrion</code><span class="initializer"> = ?</span></span>)</div>

  <p class="para rdfs-comment">
   Instancie un objet <span class="classname"><a href="class.yaf-application.php" class="classname">Yaf_Application</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-application.construct-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <dl>
   
    <dt><code class="parameter">config</code></dt>
    <dd>
     <p class="para">
      Un chemin vers le fichier de configuration ini, ou un tableau de configuration.
     </p>
     <p class="para">
      Si un fichier de configuration est fourni, il doit contenir une section
      nommée telle que spécifiée par le paramètre
      <a href="yaf.configuration.php#ini.yaf.environ" class="link">yaf.environ</a>, qui est &quot;product&quot; par défaut.
      <blockquote class="note"><p><strong class="note">Note</strong>: 
       <p class="para">
        Lors de l&#039;utilisation d&#039;un fichier de configuration au format ini pour
        la configuration de l&#039;application, il est recommandé d&#039;utiliser
        la méthode <a href="yaf.configuration.php#ini.yaf.cache-config" class="link">yaf.cache_config</a>
        à la place pour améliorer les performances.
       </p>
      </p></blockquote>
     </p>
     <p class="para">
      Et l&#039;entrée de configuration (et sa valeur par défaut) listée
      ci-dessous :
      <div class="example" id="example-1">
       <p><strong>Exemple #1 Un exemple de fichier de configuration au format ini</strong></p>
       <div class="example-contents">
<div class="inicode"><pre class="inicode">[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&#039;avez pas besoin de les définir
application.library = APPLICATION_PATH . &quot;/library&quot;
application.dispatcher.throwException=1
application.dispatcher.catchException=1

application.baseUri=&quot;&quot;

;Le nom du script PHP
ap.ext=php

;Le nom du template de visualisation
ap.view.ext=phtml

ap.dispatcher.defaultModule=Index
ap.dispatcher.defaultController=Index
ap.dispatcher.defaultAction=index

;Les modules définis
ap.modules=Index</pre>
</div>
       </div>

      </div>
     </p>
    </dd>
   
   
    <dt><code class="parameter">envrion</code></dt>
    <dd>
     <p class="para">
      La section à charger comme configuration finale.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-application.construct-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-application.construct-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="example-2">
   <p><strong>Exemple #2 Exemple avec <span class="function"><strong>Yaf_Application::__construct()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />defined</span><span style="color: #007700">(</span><span style="color: #DD0000">'APPLICATION_PATH'</span><span style="color: #007700">)                  </span><span style="color: #FF8000">// APPLICATION_PATH sera utilisé dans le fichier de configuration ini<br />    </span><span style="color: #007700">|| </span><span style="color: #0000BB">define</span><span style="color: #007700">(</span><span style="color: #DD0000">'APPLICATION_PATH'</span><span style="color: #007700">, </span><span style="color: #0000BB">__DIR__</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$application </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(</span><span style="color: #0000BB">APPLICATION_PATH</span><span style="color: #007700">.</span><span style="color: #DD0000">'/conf/application.ini'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$application</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">bootstrap</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">run</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode"></pre>
</div>
   </div>
  </div>
  <div class="example" id="example-3">
   <p><strong>Exemple #3 Exemple avec <span class="function"><strong>Yaf_Application::__construct()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$config </span><span style="color: #007700">= array(<br />    </span><span style="color: #DD0000">"application" </span><span style="color: #007700">=&gt; array(<br />        </span><span style="color: #DD0000">"directory" </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"/application"</span><span style="color: #007700">,<br />    ),<br />);<br /><br /></span><span style="color: #FF8000">/** YAf_Application */<br /></span><span style="color: #0000BB">$application </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Application</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$application</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">bootstrap</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">run</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode"></pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-application.construct-seealso">
  <h3 class="title">Voir aussi</h3>
  <ul class="simplelist">
   <li><span class="classname"><a href="class.yaf-config-ini.php" class="classname">Yaf_Config_Ini</a></span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>