[ PHPXref.com ] [ Generated: Sun Jul 20 20:47:27 2008 ] [ TruBlog 0.2.0 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/weblog/lib/php/ -> patConfiguration.php (summary)

patConfiguration $Id: patConfiguration.php,v 1.1 2005/07/23 12:35:05 triceo Exp $

Author: Stephan Schmidt
Version: 2.0.0
File Size: 951 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

patConfiguration:: (25 methods):
  patConfiguration()
  __construct()
  setEncoding()
  setConfigDir()
  getConfigDir()
  setDriverDir()
  setCacheDir()
  setOption()
  getOption()
  loadConfig()
  loadCachedConfig()
  parseConfigFile()
  getFullPath()
  _getDriver()
  _loadDriver()
  loadFromCache()
  writeCache()
  writeConfigFile()
  _getFileType()
  convertValue()
  getConfigValue()
  setConfigValue()
  setConfigValues()
  clearConfigValue()
  getDriverDir()


Class: patConfiguration  - X-Ref

patConfiguration

Main class, aggregates readers and writers
to access config files.

patConfiguration( $options = array()   X-Ref
constructor

param: array    $options

__construct( $options = array()   X-Ref
constructor for PHP 5

param: array    $options

setEncoding( $encoding )   X-Ref
set the XML encoding

param: string    $encoding

setConfigDir( $configDir )   X-Ref
set the directory, where all config files are stored

param: string    $configDir    name of the directory

getConfigDir()   X-Ref
get the directory, where all config files are stored

return: string    $configDir    name of the directory

setDriverDir( $driverDir )   X-Ref
set the directory, where all drivers are stored

param: string    $driverDir    name of the directory
return: boolean

setCacheDir( $cacheDir )   X-Ref
set the directory, where all cache files are stored

param: string    $cacheDir    name of the directory
return: boolean

setOption($option, $value)   X-Ref
set any option

This method checks, whether there is a method that should be called
for the specific option

param: string        name of the option
param: mixed         value of the option
return: mixed

getOption( $name )   X-Ref
get an option

This is only used by the drivers.

param: string    name of the option
return: mixed

loadConfig( $file, $options = array( 'mode' => 'w' )   X-Ref
load a configuration

this loads any config file, alias for parseConfigFile

Possible options are:
- mode (a|w)
- filetype

param: string    $file    name of config file
param: string    $mode    options for loading the config

loadCachedConfig( $file, $options = array( 'mode' => 'w' )   X-Ref
load a configuration from a cache

if cache is not valid, it will be updated automatically

param: string    $file        name of config file
param: string    $mode        options for loading the config
return: mixed    $success    True on success, patError object otherwise.

parseConfigFile( $file, $options = array( 'mode' => 'w' )   X-Ref
parse a configuration file

please use loadConfig instead

param: string    $file    name of the configuration file
param: string    $mode    options for loading the config

getFullPath( $file, $relative = NULL, $check = true )   X-Ref
get the full path of a file

param: string    $file        filename
param: string    $relative    get path relative to this file

_getDriver( $filetype, $mode = 'Reader' )   X-Ref
get a driver

will load driver, if not already loaded

param: string    $filetype    type of file that should be read/written
param: string    $mode        mode of the driver (reader|writer)

_loadDriver( $filetype, $mode = 'Reader' )   X-Ref
load a driver

param: string    $filetype    type of file that should be read/written
param: string    $mode        mode of the driver (reader|writer)

loadFromCache( $file )   X-Ref
load cache

param: string    $file    filename
return: mixed    $result    config on success, false otherwise

writeCache( $file, $config, $externalFiles )   X-Ref
write cache

param: string    $file    filename
param: array    $config    configuration
param: array    $externalFiles    list of files used

writeConfigFile( $filename, $options = NULL, $oldOptions = NULL )   X-Ref
write a configfile

param: string    $filename    name of the configfile
param: string    $format        format of the config file
param: array    $options    options, see the writer driver for details

_getFileType( $filename )   X-Ref
get the filetype based on a filename

param: string    $filename
return: string    $filetype

convertValue( $value, $type = 'string', $options = array()   X-Ref
convert a variable to any type

param: mixed        value that should be converted
param: string        type of the value (string, bool, integer, double, object)
param: array        options for the type conversion
return: mixed

getConfigValue( $path = '' )   X-Ref
returns a configuration value

if no path is given, all config values will be returnded in an array

param: string    $path    path, where the value is stored
return: mixed    $value    value

setConfigValue( $path, $value, $type = 'leave' )   X-Ref
set a config value

param: string    $path    path, where the value will be stored
param: mixed    $value    value to store

setConfigValues( $values )   X-Ref
sets several config values

param: array    $values        assoc array containg paths and values

clearConfigValue( $path = '' )   X-Ref
clears a config value

if no path is given, the complete config will be cleared

param: string    $path    path, where the value is stored

getDriverDir()   X-Ref
get driver directory

return: string    $driverDir    driver directory



[ Powered by PHPXref - Served by Debian GNU/Linux ]