SiteSeedOptions
in package
FinalYes
SiteSeed 実行オプション(不変 DTO)
fromCliArgs 生成時に検証を完了させる。Web UI (setup/import.php) は ImportController が 直接コンストラクタで組み立てる(SetupSession 経由のユーザーIDなど、CLI とは値の出所が 異なるため専用ファクトリは持たない)。
動作モードは asChild フラグで切り替える:
- asChild=false (default): 既存 blog (targetBlogId) の中身を bin で置き換える
- asChild=true : targetBlogId を親として、bin の内容を子 blog として作成する
注: Acms\Services\Blog\Import::run は 常に対象 blog の全データ (contents + config) を
削除して yaml で置き換える 動作のため、過去の config_import / config_delete /
contents_drop のような部分制御フラグは持たない (該当機能は管理画面の Backup/Import
を使うこと)。
Table of Contents
Properties
- $asChild : bool
- $binName : string
- $blogCode : string|null
- $blogDomain : string|null
- $blogName : string|null
- $dryRun : bool
- $json : bool
- $quiet : bool
- $resetSchema : bool
- $skipCacheFlush : bool
- $targetBlogId : int|null
- $userId : int|null
Methods
- __construct() : mixed
- fromCliArgs() : self
- CLI の argv から生成する
- intOrNull() : int
- validate() : void
Properties
$asChild read-only
public
bool
$asChild
= false
$binName read-only
public
string
$binName
$blogCode read-only
public
string|null
$blogCode
= null
$blogDomain read-only
public
string|null
$blogDomain
= null
$blogName read-only
public
string|null
$blogName
= null
$dryRun read-only
public
bool
$dryRun
= false
$json read-only
public
bool
$json
= false
$quiet read-only
public
bool
$quiet
= false
$resetSchema read-only
public
bool
$resetSchema
= false
$skipCacheFlush read-only
public
bool
$skipCacheFlush
= false
$targetBlogId read-only
public
int|null
$targetBlogId
= null
$userId read-only
public
int|null
$userId
= null
Methods
__construct()
public
__construct(string $binName[, bool $asChild = false ][, int|null $targetBlogId = null ][, string|null $blogCode = null ][, string|null $blogName = null ][, string|null $blogDomain = null ][, int|null $userId = null ][, bool $resetSchema = false ][, bool $skipCacheFlush = false ][, bool $dryRun = false ][, bool $quiet = false ][, bool $json = false ]) : mixed
Parameters
- $binName : string
- $asChild : bool = false
- $targetBlogId : int|null = null
- $blogCode : string|null = null
- $blogName : string|null = null
- $blogDomain : string|null = null
- $userId : int|null = null
- $resetSchema : bool = false
- $skipCacheFlush : bool = false
- $dryRun : bool = false
- $quiet : bool = false
- $json : bool = false
fromCliArgs()
CLI の argv から生成する
public
static fromCliArgs(array<int, string> $argv) : self
Parameters
- $argv : array<int, string>
-
$argv 相当
Return values
selfintOrNull()
private
static intOrNull(string $value, string $label) : int
Parameters
- $value : string
- $label : string
Return values
intvalidate()
private
validate() : void