ConfigServerWriter
in package
FinalYes
ablogcms/config.server.php の `define()` を **特定キーだけ差分更新** するクラス
Web インストーラ: setup/install.php::writeConfig から呼ばれる。
全文生成は ConfigServerBuilder、define 行の組み立てルールは
DefineLineFormatter に分離。本クラスは I/O と差分更新ロジックのみ担う。
I/O は原則 LocalStorage ファサード経由 (将来の Storage 差し替えと chmod 自動適用のため)。
ただし 読み込みだけは生の file_get_contents を直接使う: LocalStorage::get は
config.server.php を secret_file_name (DB パス漏洩防止) としてブロックするため。
書き込みと存在チェックは secret_file_name ガードの対象外なので Facade 経由で OK。
呼び出しタイミングは CMS bootstrap 後 (Application::init() 済み) の前提:
setup/install.php は setup/application.php で init() 済み。
Table of Contents
Properties
- $configPath : string
Methods
- __construct() : mixed
- update() : array<int, string>
- 指定した define() の値を書き換える。キーは文字列、値は文字列化できるもの。
Properties
$configPath read-only
private
string
$configPath
Methods
__construct()
public
__construct(string $configPath) : mixed
Parameters
- $configPath : string
update()
指定した define() の値を書き換える。キーは文字列、値は文字列化できるもの。
public
update(array<string, string|int|float|bool|null> $values) : array<int, string>
Parameters
- $values : array<string, string|int|float|bool|null>
-
define する key => value
Return values
array<int, string> —実際に書き換えが行われたキー