|
|
@@ -0,0 +1,279 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!-- Reviewed: no -->
|
|
|
+<sect2 id="zend.application.core-functionality.bootstrap-bootstrapabstract">
|
|
|
+ <title>Zend_Application_Bootstrap_BootstrapAbstract</title>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname> est une classe abstraite qui
|
|
|
+ propose les fonctionnalités de base d'un bootstrap classique. Elle implémente
|
|
|
+ both <link linkend="zend.application.core-functionality.bootstrap-bootstrapper">
|
|
|
+ Zend_Application_Bootstrap_Bootstrapper</link> et <link
|
|
|
+ linkend="zend.application.core-functionality.bootstrap-resourcebootstrapper">
|
|
|
+ Zend_Application_Bootstrap_ResourceBootstrapper</link>.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <table id="zend.application.core-functionality.bootstrap-bootstrapabstract.api.table">
|
|
|
+ <title>Zend_Application_Bootstrap_BootstrapAbstract Methods</title>
|
|
|
+ <tgroup cols="4">
|
|
|
+ <thead>
|
|
|
+ <row>
|
|
|
+ <entry>Méthode</entry>
|
|
|
+ <entry>Valeur de retour</entry>
|
|
|
+ <entry>Paramètres</entry>
|
|
|
+ <entry>Description</entry>
|
|
|
+ </row>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <row>
|
|
|
+ <entry><methodname>__construct($application)</methodname></entry>
|
|
|
+ <entry><type>Void</type></entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$application</varname>: <emphasis>requis</emphasis>.
|
|
|
+ Accepte un objet <classname>Zend_Application</classname> ou
|
|
|
+ <classname>Zend_Application_Bootstrap_Bootstrapper</classname>
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry><para>
|
|
|
+ Constructeur. Accepte un seul argument de type
|
|
|
+ <classname>Zend_Application</classname>, ou un autre objet bootstrap.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>setOptions(array $options)</methodname></entry>
|
|
|
+ <entry><classname>Zend_Application_Bootstrap_Bootstrapper</classname></entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$options</varname>: <emphasis>requis</emphasis>.
|
|
|
+ Tableau d'options à configurer.
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry>
|
|
|
+ <para>
|
|
|
+ Toute option possédant un setter l'invoquera, sinon l'option sera stockée
|
|
|
+ pour une utilisation ultérieure. Par exemple, si votre classe fille définit
|
|
|
+ une méthode <methodname>setFoo()</methodname>, l'option 'foo' passera sa
|
|
|
+ valeur à cette méthode.
|
|
|
+ </para>
|
|
|
+ <para>
|
|
|
+ Deux options supplémentaires spéciales peuvent aussi être utilisée.
|
|
|
+ <property>pluginPaths</property> spécifie des préfixes de chemin vers
|
|
|
+ les plugins; on attend ici un tableau de paires prefixes, chemins.
|
|
|
+ <property>resources</property> permet de spécifier un plugin
|
|
|
+ à utiliser.
|
|
|
+ </para>
|
|
|
+ </entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>getOption()</methodname></entry>
|
|
|
+ <entry><type>Array</type></entry>
|
|
|
+ <entry>N/A</entry>
|
|
|
+ <entry><para>
|
|
|
+ Retourne toutes les options enregistrées via
|
|
|
+ <methodname>setOptions()</methodname>.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>hasOption($key)</methodname></entry>
|
|
|
+ <entry><type>Boolean</type></entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$key</varname>: <emphasis>requis</emphasis>.
|
|
|
+ Option dont on veut tester la présence.
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry><para>Détermine si une option est présente.</para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>getOption($key)</methodname></entry>
|
|
|
+ <entry><type>Mixed</type></entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$key</varname>: <emphasis>requis</emphasis>.
|
|
|
+ Option à récupérer.
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry><para>
|
|
|
+ Récupère la valeur de l'option associée à la clé passée comme paramètre.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry>
|
|
|
+ <methodname>setApplication(Zend_Application |
|
|
|
+ Zend_Application_Bootstrap_Bootstrapper $application)</methodname>
|
|
|
+ </entry>
|
|
|
+ <entry>
|
|
|
+ <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname>
|
|
|
+ </entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$application</varname>: <emphasis>requis</emphasis>.
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry><para>
|
|
|
+ Enregistre l'objet application parent, ou un objet de bootstrap.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>getApplication()</methodname></entry>
|
|
|
+ <entry>
|
|
|
+ <classname>Zend_Application</classname> |
|
|
|
+ <classname>Zend_Application_Bootstrap_Bootstrapper</classname>
|
|
|
+ </entry>
|
|
|
+ <entry>N/A</entry>
|
|
|
+ <entry><para>
|
|
|
+ Récupère l'objet application ou bootstrap passé par le constructeur.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>getEnvironment()</methodname></entry>
|
|
|
+ <entry><type>String</type></entry>
|
|
|
+ <entry>N/A</entry>
|
|
|
+ <entry><para>
|
|
|
+ Récupère l'environnement (chaine) enregistré dans l'objet parent, application
|
|
|
+ ou bootstrap.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>getClassResources()</methodname></entry>
|
|
|
+ <entry><type>Array</type></entry>
|
|
|
+ <entry>N/A</entry>
|
|
|
+ <entry><para>
|
|
|
+ Récupère la liste des noms des chargeurs de ressources définis dans la
|
|
|
+ classe. Spécifique à l'implémentation.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>getContainer()</methodname></entry>
|
|
|
+ <entry><type>Object</type></entry>
|
|
|
+ <entry>N/A</entry>
|
|
|
+ <entry><para>
|
|
|
+ Récupère le conteneur stockant les ressources. Si aucun conteneur n'est spécifié,
|
|
|
+ un objet<link linkend="zend.registry">Zend_Registry</link> sera crée pour cet usage,
|
|
|
+ puis retourné.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>setContainer($container)</methodname></entry>
|
|
|
+ <entry>
|
|
|
+ <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname>
|
|
|
+ </entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$container</varname>, <emphasis>requis</emphasis>.
|
|
|
+ Un objet dans lequel stocker les resources.
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry><para>
|
|
|
+ Définit un conteneur mémorisant les ressources. Lorsqu'une ressource est
|
|
|
+ demandée, elle est chargée puis stocker dans ce conteneur pour être retournée
|
|
|
+ lors des prochains appels.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>hasResource($name)</methodname></entry>
|
|
|
+ <entry><type>Boolean</type></entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$name</varname>, <emphasis>requis</emphasis>.
|
|
|
+ Nom de la ressource dont on veut vérifier la présence.
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry><para>
|
|
|
+ Lorsqu'une ressource est demandée (retournée par une méthode ou un plugin),
|
|
|
+ elle est stockée dans un objet conteneur (voyez
|
|
|
+ <methodname>getContainer()</methodname> et
|
|
|
+ <methodname>setContainer()</methodname>.) Cette méthode interroge le
|
|
|
+ conteneur pour savoir si une ressource y est présente.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>getResource($name)</methodname></entry>
|
|
|
+ <entry><type>Mixed</type></entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$name</varname>, <emphasis>requis</emphasis>.
|
|
|
+ Nom de la ressource à récupérer
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry><para>
|
|
|
+ Lorsqu'une ressource est demandée (retournée par une méthode ou un plugin),
|
|
|
+ elle est stockée dans un objet conteneur (voyez
|
|
|
+ <methodname>getContainer()</methodname> et
|
|
|
+ <methodname>setContainer()</methodname>.) Cette méthode récupère une
|
|
|
+ ressource depuis le conteneur.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>bootstrap($resource = null)</methodname></entry>
|
|
|
+ <entry><type>Mixed</type></entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$resource</varname>: <emphasis>optionnel</emphasis>.
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry>
|
|
|
+ <para>
|
|
|
+ Si <varname>$resource</varname> est vide, charge toutes les ressources
|
|
|
+ (bootstrap). Si une chaine est passée, charge uniquement la ressource
|
|
|
+ demandée. Enfin si un tableau est passé, charge les ressources nommées
|
|
|
+ dans ce tableau.
|
|
|
+ </para>
|
|
|
+
|
|
|
+ <para>
|
|
|
+ Cette méthode peut être utilisée pour déclencher le chargement d'une
|
|
|
+ ressource, définit sous forme de méthode ou de plugin (c'est égal).
|
|
|
+ Attention si vous spécifiez à la fois une méthode et un plugin pour une
|
|
|
+ même ressource, alors la méthode sera préférée comme bootstrap, le plugin sera
|
|
|
+ ignoré.
|
|
|
+ </para>
|
|
|
+ </entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>run()</methodname></entry>
|
|
|
+ <entry><type>Void</type></entry>
|
|
|
+ <entry>N/A</entry>
|
|
|
+ <entry><para>
|
|
|
+ Définis la logique applicative à lancer après le bootstrap (la configuration)
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+
|
|
|
+ <row>
|
|
|
+ <entry><methodname>__call($method, $args)</methodname></entry>
|
|
|
+ <entry><type>Mixed</type></entry>
|
|
|
+ <entry><itemizedlist>
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$method</varname>: <emphasis>requis</emphasis>.
|
|
|
+ Nom de la méthode appelée
|
|
|
+ </para></listitem>
|
|
|
+
|
|
|
+ <listitem><para>
|
|
|
+ <varname>$args</varname>: <emphasis>requis</emphasis>.
|
|
|
+ Tableau d'arguments d'invocation pour la méthode.
|
|
|
+ </para></listitem>
|
|
|
+ </itemizedlist></entry>
|
|
|
+ <entry><para>
|
|
|
+ Propose une interface agréable pour configurer (bootstrap)
|
|
|
+ des ressources individuelles en appelant
|
|
|
+ 'bootstrap<NomDeLaRessource>()' à la place de
|
|
|
+ <methodname>bootstrap()</methodname>.
|
|
|
+ </para></entry>
|
|
|
+ </row>
|
|
|
+ </tbody>
|
|
|
+ </tgroup>
|
|
|
+ </table>
|
|
|
+</sect2>
|