-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bd75e15
Showing
12 changed files
with
2,432 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
vendor/ | ||
data/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: php | ||
install: composer install | ||
script: vendor/bin/phpunit tests | ||
cache: | ||
directories: | ||
- vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Andreas Dangel | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# chunk-php | ||
|
||
Simple hosting of temporary files. The idea is basically [chunk.io](https://chunk.io/) but implemented | ||
in php so that can run on any website hoster. | ||
|
||
## Features | ||
|
||
* Simple upload via browser | ||
* Upload via command line | ||
* Supports ZIP and TAR archives | ||
* Basic user control | ||
* Limit file size | ||
* Delete old files after a configurable period | ||
* Example: | ||
* Upload interface: <https://chunk.adangel.org> | ||
* Single image file: <https://chunk.adangel.org/adangel/8ec0f806-0317-4cdb-8925-eae3538b0b04> | ||
* A zip archive containing a website: <https://chunk.adangel.org/adangel/06190ed0-dd89-4dc8-946a-7324b062afe9/index.html> | ||
|
||
## Development | ||
|
||
``` | ||
composer install | ||
vendor/bin/phpunit tests | ||
``` | ||
|
||
### Run for development | ||
|
||
php -S localhost:8000 index.php | ||
|
||
and then go to <http://localhost:8000> | ||
|
||
## Deploy into production | ||
|
||
Depending on whether the script should be available at the root | ||
or as a subfolder, you need to use `.htaccess` and configure | ||
rewrite rules. | ||
|
||
``` | ||
# Make sure, the directory has "AllowOverride FileInfo". | ||
RewriteEngine on | ||
# if installed in subfolder "/chunk-php/" | ||
RewriteRule ^$ /chunk-php/index.php [END] | ||
RewriteRule ^(.*)$ /chunk-php/index.php/$1 [END] | ||
# if installed in root directory | ||
RewriteRule ^$ /index.php [END] | ||
RewriteRule ^(.*)$ /index.php/$1 [END] | ||
``` | ||
|
||
And adjust the users/credentials in `src/Config.php`. | ||
|
||
## Changelog | ||
|
||
### 1.0.0 (2020-06-06) | ||
* Initial version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "adangel/chunkphp", | ||
"require": { | ||
"php": ">=7.0", | ||
"ext-zip": "*", | ||
"ext-phar": "*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^9.2" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"com\\github\\adangel\\chunkphp\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"com\\github\\adangel\\chunkphp\\": "tests/" | ||
} | ||
} | ||
} |
Oops, something went wrong.