Compare commits

..

2 commits

Author SHA1 Message Date
5564871ca8 Implement as Composer library 2024-01-08 00:41:15 +01:00
b3c93309ce Restarting development 2024-01-08 00:31:15 +01:00
4 changed files with 30 additions and 24 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/vendor/
/composer.lock

View file

@ -1,5 +1,14 @@
# hippopotato
Simple files storage based on flat files.
Simple (local) filestorage based on PHP and flat files.
Currently based on PHP and NGiNX.
First iteration is only to server files.
To be able to extend the functionality, these files will first be served from `/f/`.
The code should be written to be used as a PHP module, as well as, a separate site.
The [Slim](https://www.slimframework.com/) provides for the latter.
The visibility of files is toggled by a file in each directory -- `.hippoacl`,
working somewhat like a `.gitignore` file. [^1]
[^1]: https://git.deboone.nl/websites/nl.deboone/issues/16

17
composer.json Normal file
View file

@ -0,0 +1,17 @@
{
"name": "kastdeur/hippopotato",
"description": "Simple flat file storage in PHP",
"license": "MIT",
"autoload": {
"psr-4": {
"Kastdeur\\Hippopotato\\": "src/"
}
},
"authors": [
{
"name": "ET de Boone",
"email": "dev@etdeboone.nl"
}
],
"require": {}
}

View file

@ -1,22 +0,0 @@
<?php
$limit_rate = Null;
$url = $_SERVER['REQUEST_URI'];
$file_directory_alias = '/files/';
$file_directory = '../'. $file_directory_alias;
if ( file_exists($file_directory . $url) )
{
if ( !is_null($limit_rate) )
{
header("X-Accel-Limit-Rate: {$limite_rate}");
}
header("X-Accel-Redirect: {$file_directory_alis}{$url}");
exit(0);
}
http_response_code(404);
exit(4);