Compare commits
2 commits
99b7a77444
...
5564871ca8
Author | SHA1 | Date | |
---|---|---|---|
5564871ca8 | |||
b3c93309ce |
4 changed files with 30 additions and 24 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/vendor/
|
||||
/composer.lock
|
13
README.md
13
README.md
|
@ -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
17
composer.json
Normal 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": {}
|
||||
}
|
|
@ -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);
|
Loading…
Reference in a new issue