4. ConfigHandlersConfigHandler Tags (config_handlers.xml)

Allows you to define your own configuration files.

When you specify a relative path in the pattern the core.app_dir setting is used as the base path.

Note

When including the configuration file via AgaviConfigCache::checkConfig you need to specify the path in the same way as in the pattern (relative or absolute).

Warning

When specifying the absolute path (which is the preferred way for consistence) use the keywords where appropriate.

Example 5.3. config_handlers.xml

<configurations parent="%core.system_config_dir%/config_handlers.xml">
 <configuration>

  <handlers>
   <handler pattern="%core.module_dir%/*/config/action_filters.xml" validate="%core.agavi_dir%/config/xsd/filters.xsd" class="AgaviFilterConfigHandler" />
   <handler pattern="%core.module_dir%/*/config/module.xml" validate="%core.agavi_dir%/config/xsd/module.xsd" class="AgaviModuleConfigHandler" />
   <handler pattern="%core.module_dir%/*/validate/*.xml" class="AgaviValidatorConfigHandler" />
  </handlers>

 </configuration>
</configurations>


4.1. <handlers>

Parent element for <handler>.

Content

  • 0-n <handler>

4.2. <handler>

Defines a configuration handler.

Attributes

class

The class (name) providing the handler implementation for files match the pattern.

pattern

A file path pattern. Use * as a placeholder. You can use keywords here.

[parser]

You can define an alternative parser class (name) here. Use this if you don't want to use the default parser (in sense of default parser for that extension, "autosensed" by agavi) for that configuration file.

[validate]

A file path to a validation file (.xsd for .xml configuration files). You can use keywords here. If not specified the configuration file will not be validated before being passed to the configuration handler.

Content

  • 0-1 <parameters>