docker-composer

EnvironmentContainerDetector
in package
implements ContainerDetector

FinalYes

Detects container execution from environment variables and runtime files.

Table of Contents

Interfaces

ContainerDetector
Detects whether the current Composer process is already containerized.

Properties

$fileExists  : callable(string): bool
Checks whether a filesystem path exists.
$fileGetContents  : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 78 callable(string): Array
Reads file contents.
$getEnv  : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 78 callable(string): Array
Reads environment variables.

Methods

__construct()  : mixed
Creates an environment-based container detector.
isInsideContainer()  : bool
Checks whether the current process runs inside a container.

Properties

$fileExists

Checks whether a filesystem path exists.

private callable(string): bool $fileExists

Returns true when the path exists.

$fileGetContents

Reads file contents.

private Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 78 callable(string): Array $fileGetContents

Returns file contents or false when unreadable.

$getEnv

Reads environment variables.

private Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 78 callable(string): Array $getEnv

Returns an environment value or false when absent.

Methods

__construct()

Creates an environment-based container detector.

public __construct([ Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 78 callable(string): Array|null $getEnv = null ][, callable(string): bool|null $fileExists = null ][, Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 78 callable(string): Array|null $fileGetContents = null ]) : mixed
Parameters
$getEnv : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 78 callable(string): Array|null = null

The environment reader, or null for getenv.

$fileExists : callable(string): bool|null = null

The path existence checker, or null for file_exists.

$fileGetContents : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 78 callable(string): Array|null = null

The file reader, or null for file_get_contents.

isInsideContainer()

Checks whether the current process runs inside a container.

public isInsideContainer() : bool
Return values
bool

Returns true when a container marker is detected.


        
On this page

Search results