h4cc / stack-flysystem
A Stack HttpKernel for Flysystem filesystems as a single purpose application.
Requires
- php: >=5.4.0
- league/flysystem: ~0.5
- stack/callable-http-kernel: ~1.0
- symfony/http-kernel: ~2.0
Requires (Dev)
- monolog/monolog: ~1.8
- silpion/stack-logger: ~1.0
- stack/builder: ~1.0
- stack/run: ~1.0
This package is not auto-updated.
Last update: 2024-11-05 04:27:15 UTC
README
This implementation of a HttpKernelInterface is providing a REST Api and using a flysystem abstraction as storage backend.
A idea inspired by StackPHP. Next to middlewares providing extra functionality for the HttpKernelInterface, there might also be some single purpose applications like this one. These tiny apps can be used to construct larger systems with ease, like middlewares do.
Installation
Composer
The recommended way to install h4cc/stack-flysystem
is through Composer:
{ "require": { "h4cc/stack-flysystem": "@stable" } }
Protip: you should browse the
h4cc/stack-flysystem
page to choose a stable version to use, avoid the @stable
meta constraint.
Development and Standalone
Clone this repo and run composer:
git clone git@github.com:h4cc/stack-flysystem.git
cd stack-flysystem
curl -sS https://getcomposer.org/installer | php
php composer.phar install
Example usage
Start the application with PHP internal webserver.
cd web
php -S 0.0.0.0:8080 index.php
Using some curl Requests to try all the Handlers.
# Downloading a image from Google
curl -O https://www.google.de/images/srpr/logo11w.png
# List empty dir (except .gitkeep file).
curl -X GET http://localhost:8080/
# POST image.
curl -X POST --data-binary @logo11w.png http://localhost:8080/foo/logo.png
# List again.
curl -X GET http://localhost:8080/
curl -X GET http://localhost:8080/foo/
# Fetch image
curl -X GET http://localhost:8080/foo/logo.png
# Replace image
curl -X PUT --data-binary @logo11w.png http://localhost:8080/foo/logo.png
# Delete image
curl -X DELETE http://localhost:8080/foo/logo.png
# List directory
curl -X GET http://localhost:8080/foo/