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

Breadcrumb

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

function RemoteFilesystem::findStatusMessage

Parameters

string[] $headers array of returned headers like from getLastHeaders():

Return value

string|null

1 call to RemoteFilesystem::findStatusMessage()
RemoteFilesystem::get in vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php
Get file content or copy action.

File

vendor/composer/composer/src/Composer/Util/RemoteFilesystem.php, line 188

Class

RemoteFilesystem
@internal @author François Pluchino <francois.pluchino@opendisplay.com> @author Jordi Boggiano <j.boggiano@seld.be> @author Nils Adermann <naderman@naderman.de>

Namespace

Composer\Util

Code

public function findStatusMessage(array $headers) {
    $value = null;
    foreach ($headers as $header) {
        if (Preg::isMatch('{^HTTP/\\S+ \\d+}i', $header)) {
            // In case of redirects, http_response_headers contains the headers of all responses
            // so we can not return directly and need to keep iterating
            $value = $header;
        }
    }
    return $value;
}

API Navigation

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