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_]*$/'
[ Top ]
$_overwriteValues = array()
[ Top ]
$_preferConstant = false
[ Top ]
$_sections = array()
[ Top ]
$_values = array()
[ 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
[ 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
[ Top ]