Class: Teeple_GlobalConfig

Source Location: /GlobalConfig.php

Class Overview [line 32]


GlobalConfig

Author(s):

Version:

Copyright:

Variables

Constants

Methods


Inherited Variables

Inherited Constants

Inherited Methods



Class Details

GlobalConfig

プログラム全体の設定情報を扱うためのクラス PHPの定数を透過的に扱うことが出来る

preferConstantによってPHP定数の優先順位が変わる trueにすると PHP定数 > setValueで設定された値 > importSectionsでまとめて読み込んだ値 falseにすると setValueで設定された値 > importSectionsでまとめて読み込んだ値 > PHP定数

[ Top ]


Class Variables

$_exportableConstPattern =  '/^[A-Z_][A-Z0-9_]*$/'

[line 52]

Tags:

  • var - 定数としてエクスポート可能な名前を表す正規表現

Type: String

Overrides:

[ Top ]

$_overwriteValues = array()

[line 42]

Tags:

  • var - setValueで設定された値が保存される

Type: String

Overrides:

[ Top ]

$_preferConstant =  false

[line 57]

Tags:

  • var - 定数を他の値に対して優先するか否か

Type: String

Overrides:

[ Top ]

$_sections = array()

[line 47]

Tags:

  • var - importSectionsで読み込んだ値を、セクション単位でまとめるための配列

Type: String

Overrides:

[ Top ]

$_values = array()

[line 37]

Tags:

  • var - importSectionsで読み込まれた設定値が保存される

Type: array

Overrides:

[ Top ]


Class Methods

static loadConstantsFromFile

static boolean loadConstantsFromFile( $filename)

[line 287]

ファイルから設定を読み込み、 定数としてのエクスポートまでを行うstaticメソッド

Tags:

  • access - public

Parameters:

  • $filename -

[ Top ]

__construct

Teeple_GlobalConfig __construct( [bool $preferConstant = false])

[line 66]

コンストラクタ

Tags:

  • access - public

Parameters:

  • bool $preferConstant - [optional] if true, constants have priority over any other values.

[ Top ]

exportConstants

String exportConstants( )

[line 257]

設定値を定数としてエクスポートする

Tags:

  • access - public

Parameters:

[ Top ]

getSection

array getSection( String $sec)

[line 209]

セクション単位で設定値を配列の形で得る

Tags:

  • access - public

Parameters:

  • String $sec -

[ Top ]

getValue

mixed getValue( String $key, [mixed $default = null])

[line 150]

設定値を得る

定数として宣言されているか、 定数を優先するか、 上書きされているか、 等の要素を考慮して設定値は決まる

Tags:

  • access - public

Parameters:

  • String $key -
  • mixed $default -

[ Top ]

hasValue

boolean hasValue( String $key, [boolean $checkConst = false])

[line 176]

値が設定されているかどうかを調べる

Tags:

  • access - public

Parameters:

  • String $key -
  • boolean $checkConst - [optional] 定数をチェックするか

[ Top ]

importSections

void importSections( array $arr)

[line 115]

配列を一括して取り込む 自動的にupdateValuesを呼び出し、保持されている値を更新する

Tags:

  • access - public

Parameters:

  • array $arr -

[ Top ]

isConstName

String isConstName( String $key)

[line 274]

定数としてエクスポート可能な名称か調べる

Tags:

  • access - public

Parameters:

  • String $key -

[ Top ]

loadFromFile

boolean loadFromFile( String $filename)

[line 237]

INIファイルから設定を読み込む

Tags:

  • access - public

Parameters:

  • String $filename -

[ Top ]

setPreferConstant

void setPreferConstant( boolean $bool)

[line 77]

定数を優先するか

Tags:

  • access - public

Parameters:

  • boolean $bool -

[ Top ]

setValue

void setValue( mixed $key, mixed $value, [boolean $autoUpdate = false])

[line 194]

値を設定する このメソッドで設定した値は $_overwriteValuesとして独自に管理される

Tags:

  • access - public

Parameters:

  • mixed $key -
  • mixed $value -
  • boolean $autoUpdate - [optional] if ture, call updateValues() after overwriting

[ Top ]

updateValues

void updateValues( )

[line 127]

保持されている値を更新する

Tags:

  • access - public

Parameters:

[ Top ]


Class Constants


Documentation generated on Mon, 26 Apr 2010 08:59:50 +0900 by phpDocumentor 1.4.3