symfony API

sfConfigCache Class

« Back to API menu

action

addon

autoload

cache

command

config

controller

creole

database

debug

exception

filter

form

generator

helper

i18n

log

plugin

propel

request

response

routing

storage

task

test

user

util

validator

view

widget

You are currently browsing the symfony documentation for the 1.1 version. Switch to:

sfConfigCache allows you to customize the format of a configuration file to make it easy-to-use, yet still provide a PHP formatted result for direct inclusion into your modules.

Method Summary

  • loadConfigHandlers()
    Loads all configuration application and module level handlers.
  • __construct($configuration)
    Constructor
  • string checkConfig($configPath, $optional = false)
    Checks to see if a configuration file has been modified and if so recompile the cache file associated with it.
  • string getCacheName($config)
    Converts a normal filename into a cache filename.
  • getHandler($name)
    Returns the config handler configured for the given name
  • mergeUserConfigHandlers()
    Merges configuration handlers from the config_handlers.yml
  • writeCacheFile($config, $cache, $data)
    Writes a cache file.
  • callHandler($handler, $configs, $cache)
    Loads a configuration handler.
  • registerConfigHandler($handler, (class) $class, $params = array())
    Registers a configuration handler.
  • import($config, $once = true, $optional = false)
    Imports a configuration file.
  • clear()
    Clears all configuration cache files.

Method Details

  • loadConfigHandlers ()

    Loads all configuration application and module level handlers.

    throws sfConfigurationException If a configuration related error occurs.

  • __construct ($configuration)

    $configuration A sfApplicationConfiguration instance

    Constructor

  • (string) checkConfig ($configPath, $optional = false)

    $configPath A filesystem path to a configuration file
    $optional If true, config path does not need to exist

    Checks to see if a configuration file has been modified and if so recompile the cache file associated with it.

    The recompilation only occurs in a non debug environment.
    If the configuration file path is relative, symfony will look in directories defined in the sfConfiguration::getConfigPaths() method.

    returns An absolute filesystem path to the cache filename associated with this specified configuration file

    throws sfConfigurationException If a requested configuration file does not exist

  • (string) getCacheName ($config)

    $config A normal filename

    Converts a normal filename into a cache filename.

    returns An absolute filesystem path to a cache filename

  • getHandler ($name)

    $name The config handler name

    Returns the config handler configured for the given name

    returns A sfConfigHandler instance

  • mergeUserConfigHandlers ()

    Merges configuration handlers from the config_handlers.yml

    and the ones defined with registerConfigHandler()

  • writeCacheFile ($config, $cache, $data)

    $config An absolute filesystem path to a configuration file
    $cache An absolute filesystem path to the cache file that will be written
    $data Data to be written to the cache file

    Writes a cache file.

    throws sfCacheException If the cache file cannot be written

  • callHandler ($handler, $configs, $cache)

    $handler The handler to use when parsing a configuration file
    $configs An array of absolute filesystem paths to configuration files
    $cache An absolute filesystem path to the cache file that will be written

    Loads a configuration handler.

    throws sfConfigurationException If a requested configuration file does not have an associated configuration handler

  • registerConfigHandler ($handler, (class) $class, $params = array())

    $handler The handler to use when parsing a configuration file
    $class A configuration handler class
    $params An array of options for the handler class initialization

    Registers a configuration handler.

  • import ($config, $once = true, $optional = false)

    $config A filesystem path to a configuration file
    $once Only allow this configuration file to be included once per request?
    $optional Only include if true

    Imports a configuration file.

  • clear ()

    Clears all configuration cache files.