Documentation

DockerComposeConfigurator extends AbstractConfigurator
in package

Adds services and volumes to compose.yaml file.

Tags
author

Kévin Dunglas kevin@dunglas.dev

Table of Contents

$configureDockerRecipes  : mixed
$composer  : mixed
$io  : mixed
$options  : mixed
$path  : mixed
$filesystem  : mixed
__construct()  : mixed
configure()  : mixed
shouldConfigureDockerRecipe()  : bool
unconfigure()  : mixed
update()  : void
extractSection()  : string|null
isFileMarked()  : bool
isFileXmlMarked()  : bool
markData()  : string
markXmlData()  : string
updateData()  : bool
updateDataString()  : string|null
write()  : mixed
askDockerSupport()  : string
configureDockerCompose()  : void
findDockerComposeFile()  : string|null
Finds the Docker Compose file according to these rules: https://docs.docker.com/compose/reference/envvars/#compose_file.
getContentsAfterApplyingRecipe()  : array<string|int, mixed>
normalizeConfig()  : array<string|int, mixed>
Normalizes the config and return the name of the main Docker Compose file if applicable.
parse()  : string

Properties

Methods

__construct()

public __construct(Composer $composer, IOInterface $io, Options $options) : mixed
Parameters
$composer : Composer
$io : IOInterface
$options : Options
Return values
mixed

configure()

public configure(Recipe $recipe, mixed $config, Lock $lock[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$recipe : Recipe
$config : mixed
$lock : Lock
$options : array<string|int, mixed> = []
Return values
mixed

shouldConfigureDockerRecipe()

public static shouldConfigureDockerRecipe(Composer $composer, IOInterface $io, Recipe $recipe) : bool
Parameters
$composer : Composer
$io : IOInterface
$recipe : Recipe
Return values
bool

update()

public update(RecipeUpdate $recipeUpdate, array<string|int, mixed> $originalConfig, array<string|int, mixed> $newConfig) : void
Parameters
$recipeUpdate : RecipeUpdate
$originalConfig : array<string|int, mixed>
$newConfig : array<string|int, mixed>
Return values
void

extractSection()

protected extractSection(Recipe $recipe, string $contents) : string|null
Parameters
$recipe : Recipe
$contents : string
Return values
string|null

isFileXmlMarked()

protected isFileXmlMarked(Recipe $recipe, string $file) : bool
Parameters
$recipe : Recipe
$file : string
Return values
bool

updateData()

protected updateData(string $file, string $data) : bool
Parameters
$file : string
$data : string
Return values
bool

True if section was found and replaced

updateDataString()

protected updateDataString(string $contents, string $data) : string|null
Parameters
$contents : string
$data : string
Return values
string|null

returns the updated content if the section was found, null if not found

write()

protected write(mixed $messages[, mixed $verbosity = IOInterface::VERBOSE ]) : mixed
Parameters
$messages : mixed
$verbosity : mixed = IOInterface::VERBOSE
Return values
mixed

configureDockerCompose()

private configureDockerCompose(Recipe $recipe, array<string|int, mixed> $config, bool $update) : void
Parameters
$recipe : Recipe
$config : array<string|int, mixed>
$update : bool
Return values
void

findDockerComposeFile()

Finds the Docker Compose file according to these rules: https://docs.docker.com/compose/reference/envvars/#compose_file.

private findDockerComposeFile(string $rootDir, string $file) : string|null
Parameters
$rootDir : string
$file : string
Return values
string|null

getContentsAfterApplyingRecipe()

private getContentsAfterApplyingRecipe(string $rootDir, Recipe $recipe, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$rootDir : string
$recipe : Recipe
$config : array<string|int, mixed>
Return values
array<string|int, mixed>

normalizeConfig()

Normalizes the config and return the name of the main Docker Compose file if applicable.

private normalizeConfig(array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
$config : array<string|int, mixed>
Return values
array<string|int, mixed>

parse()

private parse(mixed $level, mixed $indent, mixed $services) : string
Parameters
$level : mixed
$indent : mixed
$services : mixed
Return values
string

Search results