function XdebugHandler::__construct
Constructor
The $envPrefix is used to create distinct environment variables. It is uppercased and prepended to the default base values. For example 'myapp' would result in MYAPP_ALLOW_XDEBUG and MYAPP_ORIGINAL_INIS.
Parameters
string $envPrefix Value used in environment variables:
Throws
\RuntimeException If the parameter is invalid
File
-
vendor/
composer/ xdebug-handler/ src/ XdebugHandler.php, line 84
Class
- XdebugHandler
- @author John Stevenson <john-stevenson@blueyonder.co.uk>
Namespace
Composer\XdebugHandlerCode
public function __construct(string $envPrefix) {
if ($envPrefix === '') {
throw new \RuntimeException('Invalid constructor parameter');
}
self::$name = strtoupper($envPrefix);
$this->envAllowXdebug = self::$name . self::SUFFIX_ALLOW;
$this->envOriginalInis = self::$name . self::SUFFIX_INIS;
self::setXdebugDetails();
self::$inRestart = false;
if ($this->cli = PHP_SAPI === 'cli') {
$this->debug = (string) getenv(self::DEBUG);
}
$this->statusWriter = new Status($this->envAllowXdebug, (bool) $this->debug);
}