tests
This commit is contained in:
parent
588debfaa0
commit
7a464f7d36
5 changed files with 85 additions and 68 deletions
20
Makefile
20
Makefile
|
@ -22,7 +22,7 @@ MODULES="php"
|
||||||
pageList = $(shell $(CURDIR)/$(NODEJQ) -r ".pages[]" $(CURDIR)/$(CONF))
|
pageList = $(shell $(CURDIR)/$(NODEJQ) -r ".pages[]" $(CURDIR)/$(CONF))
|
||||||
noExt = $(shell echo $(i) | cut -d '.' -f1)
|
noExt = $(shell echo $(i) | cut -d '.' -f1)
|
||||||
|
|
||||||
all: builddirs npm_dependencies composer ejs minify-all copy-img copy-php
|
all: builddirs npm_dependencies ejs minify-all copy-img copy-php
|
||||||
|
|
||||||
ejs:
|
ejs:
|
||||||
$(foreach i,$(pageList), \
|
$(foreach i,$(pageList), \
|
||||||
|
@ -43,12 +43,11 @@ copy-img:
|
||||||
|
|
||||||
copy-php:
|
copy-php:
|
||||||
cp -v $(CURDIR)/src/static/php/*.php $(CURDIR)/build/php/
|
cp -v $(CURDIR)/src/static/php/*.php $(CURDIR)/build/php/
|
||||||
cp -v $(CURDIR)/src/Classes/*.php $(CURDIR)/build/php/classes/
|
cp -v $(CURDIR)/src/Classes/*.php $(CURDIR)/build/php/includes/Classes/
|
||||||
|
|
||||||
install: installdirs
|
install: installdirs
|
||||||
cp -rv $(CURDIR)/build/* $(DESTDIR)/
|
cp -rv $(CURDIR)/build/* $(DESTDIR)/
|
||||||
cp -rv $(CURDIR)/vendor $(DESTDIR)/
|
cp $(CURDIR)/src/*.json $(DESTDIR)/
|
||||||
cp $(CURDIR)/src/config.json $(DESTDIR)/
|
|
||||||
mv $(DESTDIR)/html/min/* $(DESTDIR)/public/
|
mv $(DESTDIR)/html/min/* $(DESTDIR)/public/
|
||||||
mv $(DESTDIR)/js/* $(DESTDIR)/public/
|
mv $(DESTDIR)/js/* $(DESTDIR)/public/
|
||||||
mv $(DESTDIR)/css/* $(DESTDIR)/public/
|
mv $(DESTDIR)/css/* $(DESTDIR)/public/
|
||||||
|
@ -62,6 +61,10 @@ install: installdirs
|
||||||
mv $(DESTDIR)/img $(DESTDIR)/public/
|
mv $(DESTDIR)/img $(DESTDIR)/public/
|
||||||
mv $(DESTDIR)/grill.php $(DESTDIR)/public/
|
mv $(DESTDIR)/grill.php $(DESTDIR)/public/
|
||||||
mv $(DESTDIR)/upload.php $(DESTDIR)/public/
|
mv $(DESTDIR)/upload.php $(DESTDIR)/public/
|
||||||
|
cd $(DESTDIR)/ && $(CURL) -o composer-setup.php https://raw.githubusercontent.com/composer/getcomposer.org/main/web/installer
|
||||||
|
cd $(DESTDIR)/ && $(PHP) composer-setup.php --quiet
|
||||||
|
cd $(DESTDIR)/ && rm composer-setup.php
|
||||||
|
cd $(DESTDIR)/ && php composer.phar update && php composer.phar install && php composer.phar dump-autoload
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
DESTDIR=$(TMPDIR)/uguu-$(PKGVERSION)
|
DESTDIR=$(TMPDIR)/uguu-$(PKGVERSION)
|
||||||
|
@ -83,13 +86,6 @@ uninstall:
|
||||||
npm_dependencies:
|
npm_dependencies:
|
||||||
$(NPM) install
|
$(NPM) install
|
||||||
|
|
||||||
composer:
|
|
||||||
$(CURL) -o composer-setup.php https://raw.githubusercontent.com/composer/getcomposer.org/main/web/installer
|
|
||||||
$(PHP) composer-setup.php --quiet
|
|
||||||
rm composer-setup.php
|
|
||||||
php composer.phar update
|
|
||||||
php composer.phar install
|
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
tar --exclude='./uguuForDocker.tar.gz' --exclude='./vendor' --exclude='./node_modules' -czf uguuForDocker.tar.gz .
|
tar --exclude='./uguuForDocker.tar.gz' --exclude='./vendor' --exclude='./node_modules' -czf uguuForDocker.tar.gz .
|
||||||
mv uguuForDocker.tar.gz docker/
|
mv uguuForDocker.tar.gz docker/
|
||||||
|
@ -104,5 +100,5 @@ purge-container:
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
builddirs:
|
builddirs:
|
||||||
mkdir -p $(CURDIR)/build $(CURDIR)/build/img $(CURDIR)/build/html $(CURDIR)/build/html/min $(CURDIR)/build/html/unmin $(CURDIR)/build/js $(CURDIR)/build/css $(CURDIR)/build/php $(CURDIR)/build/php/classes $(CURDIR)/build/public
|
mkdir -p $(CURDIR)/build $(CURDIR)/build/img $(CURDIR)/build/html $(CURDIR)/build/html/min $(CURDIR)/build/html/unmin $(CURDIR)/build/js $(CURDIR)/build/css $(CURDIR)/build/php $(CURDIR)/build/php/includes $(CURDIR)/build/php/includes/Classes $(CURDIR)/build/public
|
||||||
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
"name": "pomf/uguu",
|
|
||||||
"description": "Uguu is a simple lightweight temporary file host with support for drop, paste, click and API uploading.",
|
|
||||||
"type": "library",
|
|
||||||
"license": "GPL-3.0",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Pomf\\Uguu\\": "src/",
|
|
||||||
"Pomf\\Uguu\\Classes\\": "src/Classes"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Go Johansson (neku)",
|
|
||||||
"email": "neku@pomf.se"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"minimum-stability": "stable",
|
|
||||||
"require": {
|
|
||||||
"ext-fileinfo": "*",
|
|
||||||
"ext-pdo": "*"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"phpunit/phpunit": "^9.5.27",
|
|
||||||
"squizlabs/php_codesniffer": "^3.7.1",
|
|
||||||
"phpmd/phpmd": "^2.13.0",
|
|
||||||
"friendsofphp/php-cs-fixer": "^v2.19.3",
|
|
||||||
"phpstan/phpstan": "^1.9.3",
|
|
||||||
"vimeo/psalm": "^5.2.0"
|
|
||||||
}
|
|
||||||
}
|
|
31
src/composer.json
Normal file
31
src/composer.json
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"name": "pomf/uguu",
|
||||||
|
"description": "Uguu is a simple lightweight temporary file host with support for drop, paste, click and API uploading.",
|
||||||
|
"type": "library",
|
||||||
|
"license": "GPL-3.0",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Pomf\\Uguu\\": "/",
|
||||||
|
"Pomf\\Uguu\\Classes\\": "includes/Classes"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Go Johansson (neku)",
|
||||||
|
"email": "neku@pomf.se"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"require": {
|
||||||
|
"ext-fileinfo": "*",
|
||||||
|
"ext-pdo": "*"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^9.5.27",
|
||||||
|
"squizlabs/php_codesniffer": "^3.7.1",
|
||||||
|
"phpmd/phpmd": "^2.13.0",
|
||||||
|
"friendsofphp/php-cs-fixer": "^v2.19.3",
|
||||||
|
"phpstan/phpstan": "^1.9.3",
|
||||||
|
"vimeo/psalm": "^5.2.0"
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,6 +39,7 @@
|
||||||
"FILES_URL": "https://files.domain.com",
|
"FILES_URL": "https://files.domain.com",
|
||||||
"NAME_LENGTH": 8,
|
"NAME_LENGTH": 8,
|
||||||
"ID_CHARSET": "abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ",
|
"ID_CHARSET": "abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ",
|
||||||
|
"PHP_ERRORS": true,
|
||||||
"BLOCKED_EXTENSIONS": [
|
"BLOCKED_EXTENSIONS": [
|
||||||
"exe",
|
"exe",
|
||||||
"scr",
|
"scr",
|
||||||
|
|
|
@ -1,26 +1,46 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
function checkConfig()
|
||||||
* Uguu
|
{
|
||||||
*
|
if (!file_exists(__DIR__ . '../config.json')) {
|
||||||
* @copyright Copyright (c) 2022 Go Johansson (nokonoko) <neku@pomf.se>
|
throw new Exception('Cant read settings file.', 500);
|
||||||
*
|
}
|
||||||
* This program is free software: you can redistribute it and/or modify
|
try {
|
||||||
* it under the terms of the GNU General Public License as published by
|
$settings = json_decode(
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
file_get_contents(__DIR__ . '../config.json'),
|
||||||
* (at your option) any later version.
|
true,
|
||||||
*
|
);
|
||||||
* This program is distributed in the hope that it will be useful,
|
if ($settings['PHP_ERRORS']) {
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
error_reporting(E_ALL);
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
ini_set('display_errors', 1);
|
||||||
* GNU General Public License for more details.
|
}
|
||||||
*
|
}
|
||||||
* You should have received a copy of the GNU General Public License
|
catch (Exception) {
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
throw new Exception('Cant populate settings.', 500);
|
||||||
*/
|
}
|
||||||
|
}
|
||||||
require_once __DIR__ . '/../vendor/autoload.php';
|
|
||||||
|
checkConfig();
|
||||||
use Pomf\Uguu\GrillLoader;
|
/**
|
||||||
|
* Uguu
|
||||||
new GrillLoader();
|
*
|
||||||
|
* @copyright Copyright (c) 2022 Go Johansson (nokonoko) <neku@pomf.se>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
|
use Pomf\Uguu\GrillLoader;
|
||||||
|
|
||||||
|
new GrillLoader();
|
||||||
|
|
Loading…
Add table
Reference in a new issue