function Versions::getChannel
File
-
vendor/
composer/ composer/ src/ Composer/ SelfUpdate/ Versions.php, line 48
Class
- Versions
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\SelfUpdateCode
public function getChannel() : string {
if ($this->channel) {
return $this->channel;
}
$channelFile = $this->config
->get('home') . '/update-channel';
if (file_exists($channelFile)) {
$channel = trim(file_get_contents($channelFile));
if (in_array($channel, [
'stable',
'preview',
'snapshot',
'2.2',
], true)) {
return $this->channel = $channel;
}
}
return $this->channel = 'stable';
}