PHP Class BcThemeConfigReader

Inheritance: implements ConfigReaderInterface
Show file Open project: baserproject/basercms Class Usage Examples

Public Properties

Property Type Description
$variables array 保存する変数

Protected Properties

Property Type Description
$_path string テーマディレクトリ

Public Methods

Method Description
__construct ( string $path = null ) コンストラクタ
createContents ( array $data ) : string 与えられた連想配列からPHPコードを生成
dump ( string $key, array $data ) : integer 与えられた連想配列を設定ファイルにPHPコードとして保存する 追記ではなく上書きする
read ( string $key ) : array 指定されたテーマ名の設定ファイルを読み込む

Protected Methods

Method Description
_getFilePath ( string $key ) : string 与えられたテーマのディレクトリ名に対応する設定ファイルのパスを取得

Method Details

__construct() public method

コンストラクタ
public __construct ( string $path = null )
$path string テーマディレクトリのパス. デフォルトは WWW_ROOT . 'theme' . DS

_getFilePath() protected method

与えられたテーマのディレクトリ名に対応する設定ファイルのパスを取得
protected _getFilePath ( string $key ) : string
$key string テーマ名(ディレクトリ名)
return string 設定ファイルのフルパス

createContents() public method

与えられた連想配列からPHPコードを生成
public createContents ( array $data ) : string
$data array 設定の連想配列
return string

dump() public method

与えられた連想配列を設定ファイルにPHPコードとして保存する 追記ではなく上書きする
public dump ( string $key, array $data ) : integer
$key string テーマ名(ディレクトリ名)
$data array 保存する設定の連想配列
return integer 保存されたバイト数

read() public method

指定されたテーマ名の設定ファイルを読み込む
public read ( string $key ) : array
$key string テーマ名(ディレクトリ名)
return array 設定の連想配列

Property Details

$_path protected property

テーマディレクトリ
protected string $_path
return string

$variables public static property

保存する変数
public static array $variables
return array