Compare commits
No commits in common. "5564871ca8112f66974b4e20e727c208d3c740b1" and "99b7a77444ee9c00b89900e1b10e032c79553558" have entirely different histories.
5564871ca8
...
99b7a77444
4 changed files with 24 additions and 30 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
/vendor/
|
||||
/composer.lock
|
13
README.md
13
README.md
|
@ -1,14 +1,5 @@
|
|||
# hippopotato
|
||||
|
||||
Simple (local) filestorage based on PHP and flat files.
|
||||
Simple files storage based on flat files.
|
||||
|
||||
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
|
||||
Currently based on PHP and NGiNX.
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
{
|
||||
"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": {}
|
||||
}
|
22
public/index.php
Normal file
22
public/index.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?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