Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Commit9184e8d

Browse files
committed
replace name generator method
1 parent77a1062 commit9184e8d

14 files changed

+1141
-1148
lines changed

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ composer.lock
1313
docker/uguuForDocker.tar.gz
1414
!/.php-cs-fixer.cache
1515
test.php
16+
.php-cs-fixer.cache

‎README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ See the real world site at [uguu.se](https://uguu.se).
2929

3030
##Requirements
3131

32-
Tested and working with Nginx + PHP-8.1 + SQLite/MySQL/PostgreSQL + Node.js 18 or higher.
32+
Tested and working with Nginx + PHP-8.3 + SQLite/MySQL/PostgreSQL + Node.js 18 or higher.
3333

3434
Node.js is used to compile Uguu, after that it runs on PHP.
3535

@@ -47,19 +47,13 @@ Hit me up at [@nekunekus](https://twitter.com/nekunekus) or email me at neku@pom
4747

4848
We'd really like if you can take some time to make sure your coding style is
4949
consistent with the project. Uguu follows[PHP
50-
PSR-12](https://www.php-fig.org/psr/psr-12/) and[Airbnb JavaScript
50+
PSR-2](https://www.php-fig.org/psr/psr-12/) and[Airbnb JavaScript
5151
(ES5)](https://github.com/airbnb/javascript/tree/es5-deprecated/es5) (`airbnb/legacy`)
5252
coding style guides. We use ESLint and PHPCS tools to enforce these standards.
5353

5454
You can also help by sending us feature requests or writing documentation and
5555
tests.
5656

57-
##Upcoming Features
58-
59-
* S3 Bucket Support
60-
* Azure File Storage Support
61-
* Temporal/RR Support
62-
6357
##Credits
6458

6559
Uguu is based on[Pomf](http://github.com/pomf/pomf) which was written by Emma Lejack & Go Johansson (nekunekus (nokonoko)) and with help from the open source community.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"uguu",
3-
"version":"1.8.4",
3+
"version":"1.8.5",
44
"description":"Uguu is a simple lightweight temporary file host with support for drop, paste, click and API uploading.",
55
"homepage":"https://uguu.se",
66
"repository": {

‎src/Classes/Connector.php

+80-77
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,90 @@
11
<?php
2-
/*
3-
* Uguu
4-
*
5-
* @copyright Copyright (c) 2022-2024 Go Johansson (nokonoko) <neku@pomf.se>
6-
*
7-
* Note that this was previously distributed under the MIT license 2015-2022.
8-
*
9-
* If you are a company that wants to use Uguu I urge you to contact me to
10-
* solve any potential license issues rather then using pre-2022 code.
11-
*
12-
* A special thanks goes out to the open source community around the world
13-
* for supporting and being the backbone of projects like Uguu.
14-
*
15-
* This project can be found at <https://github.com/nokonoko/Uguu>.
16-
*
17-
* This program is free software: you can redistribute it and/or modify
18-
* it under the terms of the GNU General Public License as published by
19-
* the Free Software Foundation, either version 3 of the License, or
20-
* (at your option) any later version.
21-
*
22-
* This program is distributed in the hope that it will be useful,
23-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25-
* GNU General Public License for more details.
26-
*
27-
* You should have received a copy of the GNU General Public License
28-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
29-
*/
30-
31-
namespacePomf\Uguu\Classes;
32-
33-
usePDO;
34-
35-
class Connectorextends Database
2+
/*
3+
* Uguu
4+
*
5+
* @copyright Copyright (c) 2022-2024 Go Johansson (nokonoko) <neku@pomf.se>
6+
*
7+
* Note that this was previously distributed under the MIT license 2015-2022.
8+
*
9+
* If you are a company that wants to use Uguu I urge you to contact me to
10+
* solve any potential license issues rather then using pre-2022 code.
11+
*
12+
* A special thanks goes out to the open source community around the world
13+
* for supporting and being the backbone of projects like Uguu.
14+
*
15+
* This project can be found at <https://github.com/nokonoko/Uguu>.
16+
*
17+
* This program is free software: you can redistribute it and/or modify
18+
* it under the terms of the GNU General Public License as published by
19+
* the Free Software Foundation, either version 3 of the License, or
20+
* (at your option) any later version.
21+
*
22+
* This program is distributed in the hope that it will be useful,
23+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+
* GNU General Public License for more details.
26+
*
27+
* You should have received a copy of the GNU General Public License
28+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
29+
*/
30+
31+
namespacePomf\Uguu\Classes;
32+
33+
usePDO;
34+
useRandom\Randomizer;
35+
36+
class Connectorextends Database
37+
{
38+
publicPDO$DB;
39+
publicstring$dbType;
40+
publicarray$CONFIG;
41+
publicResponse$response;
42+
publicRandomizer$randomizer;
43+
44+
publicfunctionerrorHandler(int$errno,string$errstr):void
3645
{
37-
publicPDO$DB;
38-
publicstring$dbType;
39-
publicarray$CONFIG;
40-
publicResponse$response;
46+
if ($this->CONFIG['DEBUG']) {
47+
$this->response->error(500,'Server error:' .$errstr);
48+
}else {
49+
$this->response->error(500,'Server error.');
50+
}
51+
}
4152

42-
publicfunctionerrorHandler(int$errno,string$errstr):void
43-
{
53+
publicfunctionfatalErrorHandler():void
54+
{
55+
if (!is_null($e =error_get_last())) {
4456
if ($this->CONFIG['DEBUG']) {
45-
$this->response->error(500,'Server error:' .$errstr);
57+
$this->response->error(500,'FATALServer error:' .print_r($e,true));
4658
}else {
4759
$this->response->error(500,'Server error.');
4860
}
4961
}
62+
}
5063

51-
publicfunctionfatalErrorHandler():void
52-
{
53-
if (!is_null($e =error_get_last())) {
54-
if ($this->CONFIG['DEBUG']) {
55-
$this->response->error(500,'FATAL Server error:' .print_r($e,true));
56-
}else {
57-
$this->response->error(500,'Server error.');
58-
}
59-
}
60-
}
61-
62-
/**
63-
* Reads the config.json file and populates the CONFIG property with the settings
64-
* Also assembles the PDO DB connection and registers error handlers.
65-
*
66-
*/
67-
publicfunction__construct()
68-
{
69-
$this->response =newResponse('json');
70-
if (!file_exists(__DIR__ .'/../config.json')) {
71-
$this->response->error(500,'Cant read settings file.');
72-
}
73-
$this->CONFIG =json_decode(
74-
file_get_contents(__DIR__ .'/../config.json'),
75-
true,
76-
);
77-
ini_set('display_errors',0);
78-
set_error_handler([$this,"errorHandler"]);
79-
register_shutdown_function([$this,"fatalErrorHandler"]);
80-
$this->dbType =$this->CONFIG['DB_MODE'];
81-
$this->DB =newPDO(
82-
$this->CONFIG['DB_MODE'] .':' .$this->CONFIG['DB_PATH'],
83-
$this->CONFIG['DB_USER'],
84-
$this->CONFIG['DB_PASS'],
85-
);
64+
/**
65+
* Reads the config.json file and populates the CONFIG property with the settings
66+
* Also assembles the PDO DB connection and registers error handlers.
67+
*
68+
*/
69+
publicfunction__construct()
70+
{
71+
$this->response =newResponse('json');
72+
if (!file_exists(__DIR__ .'/../config.json')) {
73+
$this->response->error(500,'Cant read settings file.');
8674
}
87-
}
75+
$this->CONFIG =json_decode(
76+
file_get_contents(__DIR__ .'/../config.json'),
77+
true,
78+
);
79+
ini_set('display_errors',0);
80+
set_error_handler([$this,"errorHandler"]);
81+
register_shutdown_function([$this,"fatalErrorHandler"]);
82+
$this->dbType =$this->CONFIG['DB_MODE'];
83+
$this->DB =newPDO(
84+
$this->CONFIG['DB_MODE'] .':' .$this->CONFIG['DB_PATH'],
85+
$this->CONFIG['DB_USER'],
86+
$this->CONFIG['DB_PASS'],
87+
);
88+
$this->randomizer =newRandomizer();
89+
}
90+
}

‎src/Classes/CuteGrills.php

+53-53
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
11
<?php
2-
/*
3-
* Uguu
4-
*
5-
* @copyright Copyright (c) 2022-2024 Go Johansson (nokonoko) <neku@pomf.se>
6-
*
7-
* Note that this was previously distributed under the MIT license 2015-2022.
8-
*
9-
* If you are a company that wants to use Uguu I urge you to contact me to
10-
* solve any potential license issues rather then using pre-2022 code.
11-
*
12-
* A special thanks goes out to the open source community around the world
13-
* for supporting and being the backbone of projects like Uguu.
14-
*
15-
* This project can be found at <https://github.com/nokonoko/Uguu>.
16-
*
17-
* This program is free software: you can redistribute it and/or modify
18-
* it under the terms of the GNU General Public License as published by
19-
* the Free Software Foundation, either version 3 of the License, or
20-
* (at your option) any later version.
21-
*
22-
* This program is distributed in the hope that it will be useful,
23-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25-
* GNU General Public License for more details.
26-
*
27-
* You should have received a copy of the GNU General Public License
28-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
29-
*/
30-
31-
namespacePomf\Uguu\Classes;
2+
/*
3+
* Uguu
4+
*
5+
* @copyright Copyright (c) 2022-2024 Go Johansson (nokonoko) <neku@pomf.se>
6+
*
7+
* Note that this was previously distributed under the MIT license 2015-2022.
8+
*
9+
* If you are a company that wants to use Uguu I urge you to contact me to
10+
* solve any potential license issues rather then using pre-2022 code.
11+
*
12+
* A special thanks goes out to the open source community around the world
13+
* for supporting and being the backbone of projects like Uguu.
14+
*
15+
* This project can be found at <https://github.com/nokonoko/Uguu>.
16+
*
17+
* This program is free software: you can redistribute it and/or modify
18+
* it under the terms of the GNU General Public License as published by
19+
* the Free Software Foundation, either version 3 of the License, or
20+
* (at your option) any later version.
21+
*
22+
* This program is distributed in the hope that it will be useful,
23+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+
* GNU General Public License for more details.
26+
*
27+
* You should have received a copy of the GNU General Public License
28+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
29+
*/
3230

33-
class CuteGrills
34-
{
35-
publicarray$GRILLS;
31+
namespacePomf\Uguu\Classes;
32+
33+
class CuteGrills
34+
{
35+
publicarray$GRILLS;
3636

37-
/**
38-
* Loads the list of grills, then redirects to a random grill
39-
*/
40-
publicfunctionshowGrills():void
41-
{
42-
$this->loadGrills();
43-
if (!headers_sent()) {
44-
header(
45-
'Location: /img/grills/' .
37+
/**
38+
* Loads the list of grills, then redirects to a random grill
39+
*/
40+
publicfunctionshowGrills():void
41+
{
42+
$this->loadGrills();
43+
if (!headers_sent()) {
44+
header(
45+
'Location: /img/grills/' .
4646
$this->GRILLS[array_rand($this->GRILLS)],
47-
true,
48-
303,
49-
);
50-
}
47+
true,
48+
303,
49+
);
5150
}
51+
}
5252

53-
/**
54-
* Loads the images from the `img/grills/` directory into the `GRILLS` array
55-
*/
56-
publicfunctionloadGrills():void
57-
{
58-
$this->GRILLS =array_slice(scandir('img/grills/'),2);
59-
}
53+
/**
54+
* Loads the images from the `img/grills/` directory into the `GRILLS` array
55+
*/
56+
publicfunctionloadGrills():void
57+
{
58+
$this->GRILLS =array_slice(scandir('img/grills/'),2);
6059
}
60+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp