Skip to content

h4cc/stack-flysystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

h4cc/StackFlysystem

This implementation of a HttpKernelInterface is providing a REST Api and using a flysystem abstraction as storage backend.

Build Status

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/

About

A HttpKernel providing a REST interface using FlySystem for storage. Combine with StackPHP middlewares.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages