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

Breadcrumb

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

function InitCommand::getGitConfig

Return value

array<string, string>

1 call to InitCommand::getGitConfig()
InitCommand::interact in vendor/composer/composer/src/Composer/Command/InitCommand.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Command/InitCommand.php, line 533

Class

InitCommand
@author Justin Rainbow <justin.rainbow@gmail.com> @author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Command

Code

protected function getGitConfig() : array {
    if (null !== $this->gitConfig) {
        return $this->gitConfig;
    }
    $process = new ProcessExecutor($this->getIO());
    if (0 === $process->execute([
        'git',
        'config',
        '-l',
    ], $output)) {
        $this->gitConfig = [];
        Preg::matchAllStrictGroups('{^([^=]+)=(.*)$}m', $output, $matches);
        foreach ($matches[1] as $key => $match) {
            $this->gitConfig[$match] = $matches[2][$key];
        }
        return $this->gitConfig;
    }
    return $this->gitConfig = [];
}
RSS feed
Powered by Drupal