<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Runtime Configuration</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="yaf.installation.html">Installation</a></div> <div class="next" style="text-align: right; float: right;"><a href="yaf.resources.html">Resource Types</a></div> <div class="up"><a href="yaf.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="yaf.configuration" class="section"> <h2 class="title">Runtime Configuration</h2> <p class="simpara"> The behaviour of these functions is affected by settings in <var class="filename">php.ini</var>. </p> <p class="para"> <table class="doctable table"> <caption><strong>Yaf Configure Options</strong></caption> <thead> <tr> <th>Name</th> <th>Default</th> <th>Changeable</th> <th>Changelog</th> </tr> </thead> <tbody class="tbody"> <tr> <td><a href="yaf.configuration.html#ini.yaf.library" class="link">yaf.library</a></td> <td class="empty"> </td> <td>its PHP_INI_ALL value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.action-prefer" class="link">yaf.action_prefer</a></td> <td>0</td> <td>its PHP_INI_ALL value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.lowcase-path" class="link">yaf.lowcase_path</a></td> <td>0</td> <td>its PHP_INI_ALL value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.use-spl-autoload" class="link">yaf.use_spl_autoload</a></td> <td>0</td> <td>its PHP_INI_ALL value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.forward-limit" class="link">yaf.forward_limit</a></td> <td>5</td> <td>its PHP_INI_ALL value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.name-suffix" class="link">yaf.name_suffix</a></td> <td>1</td> <td>its PHP_INI_ALL value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.name-separator" class="link">yaf.name_separator</a></td> <td class="empty"> </td> <td>its PHP_INI_ALL value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.cache-config" class="link">yaf.cache_config</a></td> <td>0</td> <td>its PHP_INI_SYSTEM value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.environ" class="link">yaf.environ</a></td> <td>product</td> <td>its PHP_INI_SYSTEM value</td> <td></td> </tr> <tr> <td><a href="yaf.configuration.html#ini.yaf.use-namespace" class="link">yaf.use_namespace</a></td> <td>0</td> <td>its PHP_INI_ALL value</td> <td></td> </tr> </tbody> </table> </p> <p class="para">Here's a short explanation of the configuration directives.</p> <p class="para"> <dl> <dt id="ini.yaf.library"> <span class="term"> <em><code class="parameter">yaf.library</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> The global library path, Yaf_loader will search global library in this directory. </p> </dd> </dt> <dt id="ini.yaf.action-prefer"> <span class="term"> <em><code class="parameter">yaf.action_prefer</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> If there is only one part in PATH_INFO, should it consider as a controller or action. </p> <p class="para"> If this configure On, it will be considered as a Action name. </p> </dd> </dt> <dt id="ini.yaf.lowcase-path"> <span class="term"> <em><code class="parameter">yaf.lowcase_path</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Whether lowercase all the path during the class autoloading. </p> </dd> </dt> <dt id="ini.yaf.use-spl-autoload"> <span class="term"> <em><code class="parameter">yaf.use_spl_autoload</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> When this value is On, if <a href="class.yaf-loader.html" class="classname">Yaf_Loader</a> can not find a class, it will return <strong><code>FALSE</code></strong>, then give chance to other auto load function to be called. </p> <p class="para"> When this value is Off, if <a href="class.yaf-loader.html" class="classname">Yaf_Loader</a> can not find a class, it will return <strong><code>TRUE</code></strong>, and make the class autoloading failed immediately. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Yaf will register its loader during a instantiation of <a href="class.yaf-application.html" class="classname">Yaf_Application</a>, so any other auto loaders which is register before the instantiation will be called before <span class="methodname"><a href="yaf-loader.autoload.html" class="methodname">Yaf_Loader::autoload()</a></span>. </p> </p></blockquote> <p class="para"> When this value is Off(default), <span class="methodname"><a href="yaf-loader.autoload.html" class="methodname">Yaf_Loader::autoload()</a></span> will always return <strong><code>TRUE</code></strong>. </p> </dd> </dt> <dt id="ini.yaf.forward-limit"> <span class="term"> <em><code class="parameter">yaf.forward_limit</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> The max forward count, default is 5. that means you can have a max value of 5 in the forward stack. </p> <p class="para"> This is a protection for prevent recursive <span class="methodname"><a href="yaf-controller-abstract.forward.html" class="methodname">Yaf_Controller_Abstract::forward()</a></span>. </p> </dd> </dt> <dt id="ini.yaf.name-suffix"> <span class="term"> <em><code class="parameter">yaf.name_suffix</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> When this On, Yaf_Loader will identify a class by it's suffix to decide whether it is a MVC Class. </p> <p class="para"> When this Off, Yaf_Loader will look at the prefix of the class name. </p> </dd> </dt> <dt id="ini.yaf.name-separator"> <span class="term"> <em><code class="parameter">yaf.name_separator</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> When this is not empty, Yaf_Loader will identify the class suffix and string value of this. </p> <p class="para"> For example, when this value is "_", Yaf_Loader will take Index_Controller as a Controller Class, IndexController as a normal class. </p> </dd> </dt> <dt id="ini.yaf.cache-config"> <span class="term"> <em><code class="parameter">yaf.cache_config</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> If this is On, and in the meantime you are using ini config file as the parameter of <span class="methodname"><strong>Yaf_Application()</strong></span>, the compiling result of the ini config file will be cached in the PHP process. <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Yaf examine the mtime of the ini file, if it was changed since last compiling, Yaf will reload it. </p> </p></blockquote> <div class="warning"><strong class="warning">Warning</strong> <p class="para"> Yaf use the ini file path as the cache entry key, so do use the absolute path in ini file path, otherwise there might be some conflicts if two application use the same relative path of ini config. </p> </div> </p> </dd> </dt> <dt id="ini.yaf.environ"> <span class="term"> <em><code class="parameter">yaf.environ</code></em> <span class="type"><a href="language.types.string.html" class="type string">string</a></span> </span> <dd> <p class="para"> This value is "product" by default, used for Yaf to fetch the config section of a ini config file. </p> <p class="para"> That is, if this value is "product", Yaf will use the section named "product" in the ini config file(the first parameter of the <a href="class.yaf-application.html" class="classname">Yaf_Application</a>) as the final config of the <a href="class.yaf-application.html" class="classname">Yaf_Application</a>. </p> </dd> </dt> <dt id="ini.yaf.use-namespace"> <span class="term"> <em><code class="parameter">yaf.use_namespace</code></em> <span class="type"><a href="language.types.integer.html" class="type integer">integer</a></span> </span> <dd> <p class="para"> Only works as of PHP 5.3, if this value is On, All classes of Yaf will named in namespace style. </p> <p class="para"> For example: <div class="example-contents screen"> <div class="cdata"><pre> Yaf_Route_Rewrite => \Yaf\Route\Rewrite Yaf_Request_Http => \Yaf\Request\Http </pre></div> </div> There is a exception, that is some classes like <a href="class.yaf-controller-abstract.html" class="classname">Yaf_Controller_Abstract</a>. The last component is a keyword of PHP, could not be used as a class name, so for such classes: <div class="example-contents screen"> <div class="cdata"><pre> Yaf_Controller_Abstract => \Yaf\Controller_Abstract Yaf_Route_Static => \Yaf\Route_Static </pre></div> </div> </p> </dd> </dt> </dl> </p> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="yaf.installation.html">Installation</a></div> <div class="next" style="text-align: right; float: right;"><a href="yaf.resources.html">Resource Types</a></div> <div class="up"><a href="yaf.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>