php-doc-en/reference/yaf/appconfig.xml
Richard Quadling 53d154b0f7 svn:eol-style => native
Added all svn:keywords


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@320512 c90b9560-bf6c-de11-be94-00142212c4b1
2011-12-06 17:07:04 +00:00

315 lines
9.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<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>
You should give an array of config or an ini config file(see
<classname>Yaf_Config_Ini</classname>) path to
<methodname>Yaf_Application::__construct</methodname>.
</para>
<para>
Yaf configurations could be merged with user configurations. The difference
is, Yaf configurations are prefixed with "yaf." or "application.", if there
are both "yaf." and "application.", "application." will be accepcted
preferentially.
<example>
<title>An array of yaf configuration example</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($config);
]]>
</programlisting>
</example>
<example>
<title>an ini file of yaf configuration example</title>
<programlisting role="ini">
<![CDATA[
[yaf]
yaf.directory = APPLICATION_PATH "/appliation"
yaf.dispatcher.catchException = 0
[product : yaf]
; user configuartions list here
]]>
</programlisting>
</example>
</para>
<para>
<table>
<title>Yaf Application Config</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.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.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>
</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>
The directory of the application, that is the folder which contains the
"controllers", "views", "models", "plugins" folders.
</para>
<para>
<note>
<para>
This config entry is the only one which doesn't has a default value, which means you should
always define it.
</para>
</note>
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.ext">
<term>
<parameter>application.ext</parameter>
<type>string</type>
</term>
<listitem>
<para>
The file ext of the PHP script, used in class 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>
The file ext of the view template script.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.modules">
<term>
<parameter>application.modules</parameter>
<type>string</type>
</term>
<listitem>
<para>
A commaseparated list of the registered modules, used in the route
process, especially while there are more than three segments in the PATH_INFO,
</para>
<para>
Yaf need a way to find out whether the first segment is a module name or not.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.library">
<term>
<parameter>application.library</parameter>
<type>string</type>
</term>
<listitem>
<para>
The local library directory, see <classname>Yaf_Loader</classname> and
<link linkend="ini.yaf.library">yaf.library</link>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.bootstrap">
<term>
<parameter>application.bootstrap</parameter>
<type>string</type>
</term>
<listitem>
<para>
A absolute path of the Bootstrap class script.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.baseUri">
<term>
<parameter>application.baseUri</parameter>
<type>string</type>
</term>
<listitem>
<para>
Used to remove a fixed prefix of request uri in route process.
Take a example, comes a request with request uri
"/prefix/controller/action". if you set application.baseUri to
"/prefix", then only "/controller/action" will take as the PATH_INFO in
route process.
</para>
<para>
In generally, you have no need to set this value.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.dispatcher.throwexception">
<term>
<parameter>application.dispatcher.throwException</parameter>
<type>bool</type>
</term>
<listitem>
<para>
If this is On, Yaf will throw exception while some error occurring. see
also <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>
If this is On, Yaf will forward to Error controller, Error Action while
there is a uncaught exception. see also
<methodname>Yaf_Dispatcher::catchException</methodname>.
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="configuration.yaf.dispatcher.defaultmodule">
<term>
<parameter>application.dispatcher.defaultModule</parameter>
<type>string</type>
</term>
<listitem>
<para>
The default module name, see also
<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>
The default controller name, see also
<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>
The default action name, see also
<methodname>Yaf_Dispatcher::setDefaultAction</methodname>.
</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
-->