twistor / flysystem-http
An HTTP adapter for Flysystem that uses basic PHP functions.
Installs: 241 767
Dependents: 3
Suggesters: 1
Security: 0
Stars: 22
Watchers: 1
Forks: 10
Open Issues: 4
Requires
- league/flysystem: ^1.0.20
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is auto-updated.
Last update: 2024-10-26 09:17:27 UTC
README
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);