Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Versions.php

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\SelfUpdate

Code

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';
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal