Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.73 KB

README.md

File metadata and controls

51 lines (36 loc) · 1.73 KB

Flysystem HTTP Adapter

Author Build Status Coverage Status Quality Score Software License Packagist Version

This adapter uses basic PHP functions to access HTTP resources. It is read only.

Installation

composer require twistor/flysystem-http

Usage

use League\Flysystem\Filesystem;
use Twistor\Flysystem\Http\HttpAdapter;

$filesystem = new Filesystem(new HttpAdapter('http://example.com'));

$contents = $filesystem->read('file.txt');

By default, metadata will be retrieved via HEAD requests. This can be disabled.

use Twistor\Flysystem\Http\HttpAdapter;

$supportsHead = false;

$adapter = new HttpAdapter('http://example.com', $supportsHead);

PHP context options can be set using the third parameter.

use Twistor\Flysystem\Http\HttpAdapter;

$context = [
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
    ],
];

$adapter = new HttpAdapter('http://example.com', true, $context);