Yaf ConfigureOptions
Yaf ConfigureOptionsNameDefaultChangeableChangelogyaf.library""INI_ALLyaf.environ"product"INI_SYSTEMyaf.forward_limit5INI_ALLyaf.use_namespace0INI_ALLyaf.action_prefer0INI_ALLyaf.lowcase_path0INI_ALLyaf.use_spl_autoload0INI_ALLyaf.name_suffix1INI_ALLyaf.name_separator""INI_ALL
Runtime Runtime
| Name | Default | Changeable | Changelog |
|---|---|---|---|
| yaf.library | "" | INI_ALL | |
| yaf.environ | "product" | INI_SYSTEM | |
| yaf.forward_limit | 5 | INI_ALL | |
| yaf.use_namespace | 0 | INI_ALL | |
| yaf.action_prefer | 0 | INI_ALL | |
| yaf.lowcase_path | 0 | INI_ALL | |
| yaf.use_spl_autoload | 0 | INI_ALL | |
| yaf.name_suffix | 1 | INI_ALL | |
| yaf.name_separator | "" | INI_ALL |
Title
The yaf.cache_config directive existed in Yaf 2.x, where it cached the parsed result of the INI configuration file within the PHP process. It was removed in Yaf 3.0.0 and is no longer recognized.
yaf.librarystringThe global library directory.
Yaf_Loadersearches this directory for classes that can not be found in the application's local library (see application.library).See also
Yaf_Loader::getLibraryPathandYaf_Loader::setLibraryPath.yaf.environstringThe environment name,
"product"by default. It is used byYaf_Applicationto pick the section of the INI configuration file (its first constructor argument) that becomes the application configuration.For example, if this value is
"product", Yaf will use the section named[product]in the INI configuration file as the final configuration of theYaf_Application. The environment name can also be overridden per application by passing the second constructor argument toYaf_Application::__construct.yaf.forward_limitintThe maximum number of times
Yaf_Controller_Abstract::forwardcan be chained in a single request,5by default.This is a protection against recursive
Yaf_Controller_Abstract::forwardloops; when the limit is exceeded, aYaf_Exception_DispatchFailedis thrown. Non-positive values are clamped to the default.yaf.use_namespaceintWhen enabled, all classes declared by Yaf are named in namespace style:
outputYaf_Route_Rewrite => \Yaf\Route\Rewrite Yaf_Request_Http => \Yaf\Request\HttpThere is an exception for classes whose last component is a reserved keyword of PHP and thus cannot be used as a class name; such classes keep the underscore in their last component:
outputYaf_Controller_Abstract => \Yaf\Controller_Abstract Yaf_Route_Static => \Yaf\Route_StaticNoteOnly one of the two naming styles is registered when the extension starts, so this directive must be set before the extension is loaded; it can not be toggled per request in any meaningful way.
yaf.action_preferintWhen there is only one part in the
PATH_INFO, decides whether it should be considered as a controller name or as an action name.If this configure is on, the single segment is considered as an action name, and the controller name falls back to the default controller; otherwise it is considered as a controller name.
yaf.lowcase_pathintWhether to lowercase all path components during class autoloading.
yaf.use_spl_autoloadintWhen this value is on, if
Yaf_Loadercan not find a class, it will return false, giving other autoload functions a chance to be called.When this value is off (the default), if
Yaf_Loadercan not find a class, it will return true, and the class autoloading fails immediately:Yaf_Loader::autoloadalways returns true in that mode.NoteYaf registers its loader during the instantiation of a
Yaf_Application, so any other autoloaders registered before the instantiation will be called beforeYaf_Loader::autoload.yaf.name_suffixintWhen this is on (the default),
Yaf_Loaderidentifies an MVC class by its suffix to decide whether it is a controller or an action class:IndexController,IndexAction.When this is off,
Yaf_Loaderlooks at the prefix of the class name instead:Controller_Index,Action_Index.yaf.name_separatorstringWhen this is not empty,
Yaf_Loaderidentifies MVC classes by this separator instead of the underscore that separates the name and the MVC suffix.For example, when this value is
"_"and yaf.name_suffix is on,Yaf_Loaderwill takeIndex_Controlleras a controller class, whileIndexControlleris considered a normal class. When it is empty (the default), the underscore is used.