update docs

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@317851 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Xinchen Hui 2011-10-07 05:14:37 +00:00
parent b43f47795d
commit 2b41092a37
8 changed files with 115 additions and 14 deletions

View file

@ -12,8 +12,24 @@
<section xml:id="yaf-config-ini.intro">
&reftitle.intro;
<para>
Yaf_Config_Ini enables developers to store configuration data in a
familiar INI format and read them in the application by using nested object
property syntax. The INI format is specialized to provide both the ability
to have a hierarchy of configuration data keys and inheritance between
configuration data sections. Configuration data hierarchies are supported
by separating the keys with the dot or period character ("."). A section
may extend or inherit from another section by following the section name
with a colon character (":") and the name of the section from which data are
to be inherited.
<note>
<para>
Yaf_Config_Ini utilizes the » parse_ini_file() PHP function. Please review
this documentation to be aware of its specific behaviors, which propagate
to Yaf_Config_Ini, such as how the special values of "TRUE", "FALSE",
"yes", "no", and "NULL" are handled.
</para>
</note>
</para>
</section>
<!-- }}} -->
@ -87,6 +103,62 @@
</section>
<!-- }}} -->
<section role="examples">
&reftitle.examples;
<example>
<title><function>Yaf_Config_Ini</function>example</title>
<para>
This example illustrates a basic use of Yaf_Config_Ini for loading
configuration data from an INI file. In this example there are
configuration data for both a production system and for a staging system.
Because the staging system configuration data are very similar to those
for production, the staging section inherits from the production section.
In this case, the decision is arbitrary and could have been written
conversely, with the production section inheriting from the staging
section, though this may not be the case for more complex situations.
Suppose, then, that the following configuration data are contained in
/path/to/config.ini:
</para>
<programlisting role="ini">
<![CDATA[
; Production site configuration data
[production]
webhost = www.example.com
database.adapter = pdo_mysql
database.params.host = db.example.com
database.params.username = dbuser
database.params.password = secret
database.params.dbname = dbname
; Staging site configuration data inherits from production and
; overrides values as necessary
[staging : production]
database.params.host = dev.example.com
database.params.username = devuser
database.params.password = devsecret
]]>
</programlisting>
<programlisting role="php">
<![CDATA[
<?php
$config = new Yaf_Config_Ini('/path/to/config.ini', 'staging');
var_dump($config->database->params->host);
var_dump($config->database->params->dbname);
var_dump($config->get("database.params.username"));
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
string(15) "dev.example.com"
string(6) "dbname"
string(7) "devuser
]]>
</screen>
</example>
</section>
</partintro>

View file

@ -4,14 +4,15 @@
<refentry xml:id="yaf-config-abstract.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Config_Abstract::get</refname>
<refpurpose>The get purpose</refpurpose>
<refpurpose>Getter</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>abstract</modifier> <modifier>public</modifier> <type>void</type><methodname>Yaf_Config_Abstract::get</methodname>
<void />
<modifier>abstract</modifier> <modifier>public</modifier> <type>mixed</type><methodname>Yaf_Config_Abstract::get</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>

View file

@ -4,13 +4,13 @@
<refentry xml:id="yaf-config-abstract.readonly" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Config_Abstract::readonly</refname>
<refpurpose>The readonly purpose</refpurpose>
<refpurpose>Find a config whether readonly</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>abstract</modifier> <modifier>public</modifier> <type>void</type><methodname>Yaf_Config_Abstract::readonly</methodname>
<modifier>abstract</modifier> <modifier>public</modifier> <type>bool</type><methodname>Yaf_Config_Abstract::readonly</methodname>
<void />
</methodsynopsis>
<para>

View file

@ -4,13 +4,13 @@
<refentry xml:id="yaf-config-abstract.set" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Config_Abstract::set</refname>
<refpurpose>The set purpose</refpurpose>
<refpurpose>Setter</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>abstract</modifier> <modifier>public</modifier> <type>void</type><methodname>Yaf_Config_Abstract::set</methodname>
<modifier>abstract</modifier> <modifier>public</modifier> <type>Yaf_Config_Abstract</type><methodname>Yaf_Config_Abstract::set</methodname>
<void />
</methodsynopsis>
<para>

View file

@ -4,13 +4,13 @@
<refentry xml:id="yaf-config-abstract.toarray" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Config_Abstract::toArray</refname>
<refpurpose>The toArray purpose</refpurpose>
<refpurpose>Cast to array</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>abstract</modifier> <modifier>public</modifier> <type>void</type><methodname>Yaf_Config_Abstract::toArray</methodname>
<modifier>abstract</modifier> <modifier>public</modifier> <type>array</type><methodname>Yaf_Config_Abstract::toArray</methodname>
<void />
</methodsynopsis>
<para>

View file

@ -12,7 +12,7 @@
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>Yaf_Config_Ini::__set</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
<methodparam><type>string</type><parameter>value</parameter></methodparam>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<para>

View file

@ -14,7 +14,8 @@
<methodparam><type>bool</type><parameter>flag</parameter></methodparam>
</methodsynopsis>
<para>
Yaf will can render after dispatched a request, you can prevent the
rendering by calling this method with <parameter>flag</parameter> TRUE
</para>
&warn.undocumented.func;
@ -28,7 +29,7 @@
<term><parameter>flag</parameter></term>
<listitem>
<para>
bool
</para>
</listitem>
</varlistentry>
@ -42,6 +43,33 @@
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>Yaf_Dispatcher::autoRender</function>example</title>
<programlisting role="php">
<![CDATA[
<?php
class IndexController extends Yaf_Controller_Abstract {
/* init method will be called as soon as a controller is initialized */
public function init() {
if ($this->getRequest()->isXmlHttpRequest()) {
//do not call render for ajax request
//we will outpu a json string
Yaf_Dispatcher::getInstance()->autoRender(FALSE);
}
}
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
]]>
</screen>
</example>
</refsect1>
</refentry>

View file

@ -14,7 +14,7 @@
<void />
</methodsynopsis>
<para>
</para>
&warn.undocumented.func;