forked from Amit86/minimanager
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8 upgrade #74
Merged
Merged
PHP 8 upgrade #74
Changes from 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
edd4f91
Fix deprecated required params after optional
flashadvocate affee74
Add docker-compose configuration
flashadvocate 8b5a2f2
Replace string with int
flashadvocate 2811d6a
Fix result must be instanceof mysqli_result
flashadvocate a21ef31
Remove odd character from account edit
flashadvocate 3c21d0c
Auth instead of realmd
flashadvocate d769905
Flag bad query in top100
flashadvocate b5735e5
Fix UNION statement, division by zero
flashadvocate a2baa4e
Fix HTTP redirect on logout
flashadvocate 797252c
Hide login/register buttons on login page
flashadvocate 2059bf7
Define minimum php level in composer
flashadvocate 6233d3e
Require ext-gmp, ext-mysqli
flashadvocate a24270a
Replace ternary with max
flashadvocate b380e82
Gitignore vendor, IDE artifacts
flashadvocate 5df1ff8
Drop Expires header
flashadvocate 5650bc9
Remove invalid Cache-Control directives
flashadvocate 9e967a0
Define viewport defaults
flashadvocate 2068e46
Content-type header charset should default to UTF-8
flashadvocate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,6 @@ | ||
FROM httpd:2.4.33-alpine | ||
RUN apk update; \ | ||
apk upgrade; | ||
COPY minimanager.apache.conf /usr/local/apache2/conf/minimanager.apache.conf | ||
RUN echo "Include /usr/local/apache2/conf/minimanager.apache.conf" \ | ||
>> /usr/local/apache2/conf/httpd.conf |
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 @@ | ||
ServerName localhost | ||
|
||
LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so | ||
LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so | ||
LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so | ||
|
||
<VirtualHost *:80> | ||
# Proxy .php requests to port 9000 of the php-fpm container | ||
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/var/www/html/$1 | ||
DocumentRoot /var/www/html/ | ||
<Directory /var/www/html/> | ||
DirectoryIndex index.php | ||
Options Indexes FollowSymLinks | ||
AllowOverride All | ||
Require all granted | ||
</Directory> | ||
|
||
# Send apache logs to stdout and stderr | ||
CustomLog /proc/self/fd/1 common | ||
ErrorLog /proc/self/fd/2 | ||
</VirtualHost> |
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,40 @@ | ||
version: "3.2" | ||
services: | ||
php: | ||
build: './php/' | ||
networks: | ||
- backend | ||
volumes: | ||
- ../:/var/www/html/ | ||
apache: | ||
build: './apache/' | ||
depends_on: | ||
- php | ||
- mysql | ||
networks: | ||
- frontend | ||
- backend | ||
ports: | ||
- "8080:80" | ||
volumes: | ||
- ../:/var/www/html/ | ||
mysql: | ||
image: mysql:5.6.40 | ||
command: --init-file /mysql/init.sql | ||
ports: | ||
- "3306:3306" | ||
volumes: | ||
- ./mysql/data:/var/lib/mysql | ||
- ./mysql/init.sql:/mysql/init.sql | ||
networks: | ||
- backend | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=rootpassword | ||
|
||
healthcheck: | ||
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] | ||
timeout: 20s | ||
retries: 10 | ||
networks: | ||
frontend: | ||
backend: |
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 @@ | ||
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,109 @@ | ||
CREATE DATABASE IF NOT EXISTS mmftc; | ||
USE mmftc; | ||
-- | ||
-- Table structure for table `mm_forum_posts` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `mm_forum_posts`; | ||
|
||
CREATE TABLE `mm_forum_posts` | ||
( | ||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
`authorid` bigint(20) unsigned NOT NULL DEFAULT '0', | ||
`authorname` varchar(16) NOT NULL DEFAULT '', | ||
`forum` bigint(20) unsigned NOT NULL DEFAULT '0', | ||
`topic` bigint(20) unsigned NOT NULL DEFAULT '0', | ||
`lastpost` bigint(20) unsigned NOT NULL DEFAULT '0', | ||
`name` varchar(50) NOT NULL DEFAULT '', | ||
`text` longtext, | ||
`time` varchar(255) NOT NULL, | ||
`annouced` tinyint(3) unsigned NOT NULL DEFAULT '0', | ||
`sticked` tinyint(3) unsigned NOT NULL DEFAULT '0', | ||
`closed` tinyint(3) unsigned NOT NULL DEFAULT '0', | ||
PRIMARY KEY (`id`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; | ||
|
||
-- | ||
-- Dumping data for table `mm_forum_posts` | ||
-- | ||
|
||
LOCK | ||
TABLES `mm_forum_posts` WRITE; | ||
/*!40000 ALTER TABLE `mm_forum_posts` DISABLE KEYS */; | ||
INSERT INTO `mm_forum_posts`(`id`, `authorid`, `authorname`, `forum`, `topic`, `lastpost`, `name`, `text`, `time`, | ||
`annouced`, `sticked`) | ||
values (1, 0, 'miniManagerTeam', 1, 1, 1, 'Hello Admin!', | ||
'[b]Hi[/b] !!:D<br /><br />If you are reading this, that means that you have [i]correctly[/i] installed this forum, XD<br /><br /><br /><br />So what\' s next?<br /><br />Edit [color=red]forum.conf.php[/color]<br /><br /><br /><br />And enjoy!<br /><br /><br /><br />Report bugs at [url=https://github.com/TrinityCore/minimanager/issues]MiniManager tracker[/url]<br /><br /><br /><br />Bye!<br /><br />miniManagerTeam','00/00/00 00:00:00',1,0); | ||
/*!40000 ALTER TABLE `mm_forum_posts` ENABLE KEYS */; | ||
UNLOCK TABLES; | ||
|
||
-- | ||
-- Table structure for table `mm_motd` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `mm_motd`; | ||
|
||
CREATE TABLE `mm_motd` ( | ||
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Identifier', | ||
`realmid` int(11) NOT NULL, | ||
`type` longtext NOT NULL, | ||
`content` longtext NOT NULL, | ||
PRIMARY KEY (`id`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='MOTD System'; | ||
|
||
-- | ||
-- Dumping data for table `mm_motd` | ||
-- | ||
|
||
LOCK TABLES `mm_motd` WRITE; | ||
/*!40000 ALTER TABLE `mm_motd` DISABLE KEYS */; | ||
INSERT INTO `mm_motd` VALUES (1, 1, '02/05/10 14:29:07 Posted by: MiniManager Team', 'Hello Admin\r\n\r\nhelp supporting Minimanager\r\n\r\nhttps://github.com/TrinityCore/minimanager/issues\r\n\r\nif you found a bug or improved it, | ||
please contribute\r\n\r\nor it will eventually stop development from lack of interrest from community '); | ||
/*!40000 ALTER TABLE `mm_motd` ENABLE KEYS */; | ||
UNLOCK TABLES; | ||
|
||
-- | ||
-- Table structure for table `mm_point_system_invites` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `mm_point_system_invites`; | ||
CREATE TABLE `mm_point_system_invites` ( | ||
`entry` int(11) NOT NULL auto_increment, | ||
`PlayersAccount` char(50) default NULL, | ||
`InvitedBy` char(50) default NULL, | ||
`InviterAccount` char(50) default NULL, | ||
`Treated` int(1) NOT NULL default '0', | ||
`Rewarded` int(1) NOT NULL default '0', | ||
UNIQUE KEY `entry` (`entry`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; | ||
|
||
-- | ||
-- Table structure for table `mm_account` | ||
-- | ||
|
||
DROP TABLE IF EXISTS `mm_account`; | ||
CREATE TABLE `mm_account` ( | ||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
`username` varchar(32) NOT NULL DEFAULT '', | ||
`salt` binary(32), | ||
`verifier` binary(32), | ||
`email` text, | ||
`joindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`last_ip` varchar(30) NOT NULL DEFAULT '127.0.0.1', | ||
`locked` tinyint(3) unsigned NOT NULL DEFAULT '0', | ||
`expansion` tinyint(3) unsigned NOT NULL DEFAULT '0', | ||
`authkey` varchar(40) DEFAULT '', | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `idx_username` (`username`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Accounts pending verification'; | ||
|
||
DROP TABLE IF EXISTS `mm_password_resets`; | ||
CREATE TABLE `mm_password_resets` ( | ||
`token` binary(32) not null, | ||
`accountId` int(11) unsigned not null, | ||
`oldsalt` binary(32), | ||
`salt` binary(32), | ||
`verifier` binary(32), | ||
`time` bigint unsigned, | ||
primary key (`token`) | ||
); |
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,7 @@ | ||
FROM php:8.0-fpm-alpine | ||
RUN apk update \ | ||
apk upgrade; | ||
RUN apk add --upgrade php8-gmp gmp-dev; | ||
|
||
RUN docker-php-ext-install mysqli gmp; | ||
|
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 @@ | ||
extension=php_gmp.so |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -192,6 +192,7 @@ function top100($realmid, &$sqlr, &$sqlc) | |
<td>'.char_get_level_color($char['level']).'</td>'; | ||
if ($type === 'level') | ||
{ | ||
// @TODO - fix N+ issue - query inside while loop | ||
$guild_name = $sqlc->result($sqlc->query('SELECT BINARY name AS name FROM guild WHERE guildid = '.$char['gname'].''), 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. N+1 query issue here, probably shouldn't be inside the loop. Need to eager load this information elsewhere. |
||
$days = floor(round($char['totaltime'] / 3600)/24); | ||
$hours = round($char['totaltime'] / 3600) - ($days * 24); | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to make it more clear which database is failing, since the default error language does not make it obvious, and there's several potential culprits