Skip to content

Instantly share code, notes, and snippets.

@briward
Created January 14, 2016 16:57
Show Gist options
  • Save briward/6bd6389e16212605d7d7 to your computer and use it in GitHub Desktop.
Save briward/6bd6389e16212605d7d7 to your computer and use it in GitHub Desktop.
<?php
require __DIR__ . '/vendor/autoload.php';
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local;
$app = new Slim\App();
// Routes
$app->get('/', function($request, $response, $args) {
$adapter = new Local(__DIR__);
$filesystem = new Filesystem($adapter);
$myFileContents = $filesystem->read('myFile.txt');
return $myFileContents;
});
$app->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment