mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
Pass the current dev mode to the event dispatcher, which in turn passes it to the events fired. This can be fetched in scripts to check which mode we are currently in
This commit is contained in:
parent
172414a1f0
commit
4b8813269c
5 changed files with 35 additions and 15 deletions
|
@ -37,18 +37,25 @@ class Event
|
|||
*/
|
||||
private $io;
|
||||
|
||||
/**
|
||||
* @var boolean Dev mode flag
|
||||
*/
|
||||
private $devMode;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name The event name
|
||||
* @param Composer $composer The composer object
|
||||
* @param IOInterface $io The IOInterface object
|
||||
* @param boolean $devMode Whether or not we are in dev mode
|
||||
*/
|
||||
public function __construct($name, Composer $composer, IOInterface $io)
|
||||
public function __construct($name, Composer $composer, IOInterface $io, $devMode)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->composer = $composer;
|
||||
$this->io = $io;
|
||||
$this->devMode = $devMode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,4 +87,14 @@ class Event
|
|||
{
|
||||
return $this->io;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the dev mode flag
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isDevMode()
|
||||
{
|
||||
return $this->devMode;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue