InitCommand
extends ProjectCommand
in package
FinalYes
`cooper:init [--root=DIR]`: writes `config/config.casc` and one directory per environment (`config/dev/`, `config/test/`, `config/prod/`), each holding one `.casc` so the document's `import "${COOPER_ENV}/*.casc"` matches. Refuses to overwrite anything: one existing file and nothing is written.
A plain Symfony Console command with no framework behind it, so a
Symfony bundle registers it with bin/console, a Laravel package
with artisan, and vendor/bin/cooper-config runs it standalone.
Table of Contents
Constants
- ENVIRONMENTS : mixed = ['dev', 'test', 'prod']
Methods
- __construct() : mixed
- configure() : void
- execute() : int
- environmentDocument() : string
- mainDocument() : string
Constants
ENVIRONMENTS
private
mixed
ENVIRONMENTS
= ['dev', 'test', 'prod']
Methods
__construct()
public
__construct([string|null $projectRoot = null ]) : mixed
Parameters
- $projectRoot : string|null = null
-
where to scaffold unless
--rootsays otherwise;nullfor the Composer root package's directory
configure()
protected
configure() : void
execute()
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
intenvironmentDocument()
private
static environmentDocument(string $env) : string
Parameters
- $env : string
Return values
stringmainDocument()
private
static mainDocument() : string