public function getHTTPHeaders($path)
    {
        $propertyMap = [
            '{DAV:}getcontenttype' => 'Content-Type',
            '{DAV:}getcontentlength' => 'Content-Length',
            '{DAV:}getlastmodified' => 'Last-Modified',
            '{DAV:}getetag' => 'ETag',
        ];

        $properties = $this->getProperties($path, array_keys($propertyMap));

        $headers = [];
        foreach ($propertyMap as $property => $header) {
            if (!isset($properties[$property])) {
                continue;
            }

            if (is_scalar($properties[$property])) {
                $headers[$header] = $properties[$property];

            // GetLastModified gets special cased
            } elseif ($properties[$property] instanceof Xml\Property\GetLastModified) {
                $headers[$header] = HTTP\toDate($properties[$property]->getTime());
            }
        }

        return $headers;
    }
public function getHTTPHeaders($path)
    {
        $propertyMap = [
            '{DAV:}getcontenttype' => 'Content-Type',
            '{DAV:}getcontentlength' => 'Content-Length',
            '{DAV:}getlastmodified' => 'Last-Modified',
            '{DAV:}getetag' => 'ETag',
        ];

        $properties = $this->getProperties($path, array_keys($propertyMap));

        $headers = [];
        foreach ($propertyMap as $property => $header) {
            if (!isset($properties[$property])) {
                continue;
            }

            if (is_scalar($properties[$property])) {
                $headers[$header] = $properties[$property];

            // GetLastModified gets special cased
            } elseif ($properties[$property] instanceof Xml\Property\GetLastModified) {
                $headers[$header] = HTTP\toDate($properties[$property]->getTime());
            }
        }

        return $headers;
    }
public function getHTTPHeaders ( $ path ) { $ propertyMap = [ '{DAV:}getcontenttype' => 'Content-Type' , '{DAV:}getcontentlength' => 'Content-Length' , '{DAV:}getlastmodified' => 'Last-Modified' , '{DAV:}getetag' => 'ETag' , ] ; $ properties = $ this -> getProperties ( $ path , array_keys ( $ propertyMap ) ) ; $ headers = [ ] ; foreach ( $ propertyMap as $ property => $ header ) { if ( ! isset ( $ properties [ $ property ] ) ) { continue ; } if ( is_scalar ( $ properties [ $ property ] ) ) { $ headers [ $ header ] = $ properties [ $ property ] ; // GetLastModified gets special cased } elseif ( $ properties [ $ property ] instanceof Xml \ Property \ GetLastModified ) { $ headers [ $ header ] = HTTP \ toDate ( $ properties [ $ property ] -> getTime ( ) ) ; } } return $ headers ; }
Returns a list of HTTP headers for a particular resource.

The generated http headers are based on properties provided by the
resource. The method basically provides a simple mapping between
DAV property and HTTP header.

The headers are intended to be used for HEAD and GET requests.

@param string $path

@return array
Returns a list of HTTP headers for a particular resource .