php8.5
Home/ Manual/ reference / yaf/ Yaf ConfigureOptions

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

NameDefaultChangeableChangelog
yaf.library""INI_ALL
yaf.environ"product"INI_SYSTEM
yaf.forward_limit5INI_ALL
yaf.use_namespace0INI_ALL
yaf.action_prefer0INI_ALL
yaf.lowcase_path0INI_ALL
yaf.use_spl_autoload0INI_ALL
yaf.name_suffix1INI_ALL
yaf.name_separator""INI_ALL

Title

Note

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.librarystring

The global library directory. Yaf_Loader searches this directory for classes that can not be found in the application's local library (see application.library).

See also Yaf_Loader::getLibraryPath and Yaf_Loader::setLibraryPath.

yaf.environstring

The environment name, "product" by default. It is used by Yaf_Application to 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 the Yaf_Application. The environment name can also be overridden per application by passing the second constructor argument to Yaf_Application::__construct.

yaf.forward_limitint

The maximum number of times Yaf_Controller_Abstract::forward can be chained in a single request, 5 by default.

This is a protection against recursive Yaf_Controller_Abstract::forward loops; when the limit is exceeded, a Yaf_Exception_DispatchFailed is thrown. Non-positive values are clamped to the default.

yaf.use_namespaceint

When enabled, all classes declared by Yaf are named in namespace style:

output
Yaf_Route_Rewrite => \Yaf\Route\Rewrite
Yaf_Request_Http  => \Yaf\Request\Http

There 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:

output
Yaf_Controller_Abstract => \Yaf\Controller_Abstract
Yaf_Route_Static        => \Yaf\Route_Static
Note

Only 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_preferint

When 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_pathint

Whether to lowercase all path components during class autoloading.

yaf.use_spl_autoloadint

When this value is on, if Yaf_Loader can 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_Loader can not find a class, it will return true, and the class autoloading fails immediately: Yaf_Loader::autoload always returns true in that mode.

Note

Yaf registers its loader during the instantiation of a Yaf_Application, so any other autoloaders registered before the instantiation will be called before Yaf_Loader::autoload.

yaf.name_suffixint

When this is on (the default), Yaf_Loader identifies an MVC class by its suffix to decide whether it is a controller or an action class: IndexController, IndexAction.

When this is off, Yaf_Loader looks at the prefix of the class name instead: Controller_Index, Action_Index.

yaf.name_separatorstring

When this is not empty, Yaf_Loader identifies 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_Loader will take Index_Controller as a controller class, while IndexController is considered a normal class. When it is empty (the default), the underscore is used.

Source: reference/yaf/ini.xml · from the official PHP manual (php/doc-en)