Merge branch 'rhymix:master' into master

This commit is contained in:
Lastorder 2024-12-01 08:19:13 +09:00 committed by GitHub
commit 42a0848a31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 60 additions and 12 deletions

View file

@ -6,7 +6,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ]
name: PHP ${{ matrix.php }}
steps:
@ -14,18 +14,11 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: ${{ matrix.php }}
- name: Install PHP
run: chmod +x .github/workflows/setup-php.sh && .github/workflows/setup-php.sh ${{ matrix.php }}
- name: Start MySQL and create database
run: |
sudo systemctl start mysql.service
sudo mysql -uroot -proot -e "CREATE DATABASE rhymix CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"
sudo mysql -uroot -proot -e "CREATE USER rhymix@localhost IDENTIFIED WITH mysql_native_password BY 'rhymix'"
sudo mysql -uroot -proot -e "GRANT ALL ON rhymix.* to rhymix@localhost; FLUSH PRIVILEGES"
sudo mysql -uroot -proot -e "SELECT VERSION()"
- name: Create test database
run: chmod +x .github/workflows/setup-mysql.sh && .github/workflows/setup-mysql.sh
- name: PHP Lint
run: if find . -name "*.php" ! -path "./common/vendor/*" -print0 | xargs -0 -n 1 -P 8 php -l | grep -v "No syntax errors detected"; then exit 1; fi

14
.github/workflows/setup-mysql.sh vendored Normal file
View file

@ -0,0 +1,14 @@
#!/bin/bash
AUTH="-uroot -proot"
# Start MySQL
sudo systemctl start mysql.service
# Create default database
sudo mysql $AUTH -e "CREATE DATABASE rhymix CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci"
sudo mysql $AUTH -e "CREATE USER rhymix@localhost IDENTIFIED WITH mysql_native_password BY 'rhymix'"
sudo mysql $AUTH -e "GRANT ALL ON rhymix.* to rhymix@localhost; FLUSH PRIVILEGES"
# Check MySQL version
sudo mysql $AUTH -e "SELECT VERSION()"

37
.github/workflows/setup-php.sh vendored Normal file
View file

@ -0,0 +1,37 @@
#!/bin/bash
# Based on https://github.com/nanasess/setup-php
sudo add-apt-repository -y ppa:ondrej/php
# Install all required packages
sudo apt -y install \
php$1-apcu \
php$1-bcmath \
php$1-cli \
php$1-common \
php$1-curl \
php$1-gd \
php$1-intl \
php$1-mbstring \
php$1-mysql \
php$1-opcache \
php$1-readline \
php$1-sqlite3 \
php$1-xml \
php$1-zip
# Enable and tune opcache
sudo bash -c 'echo "opcache.enable = 1" >> /etc/php/$1/cli/conf.d/10-opcache.ini'
sudo bash -c 'echo "opcache.enable_cli = 1" >> /etc/php/$1/cli/conf.d/10-opcache.ini'
sudo bash -c 'echo "opcache.jit = tracing" >> /etc/php/$1/cli/conf.d/10-opcache.ini'
sudo bash -c 'echo "opcache.jit_buffer_size = 128M" >> /etc/php/$1/cli/conf.d/10-opcache.ini'
# Enable APCu
sudo bash -c 'echo "apc.enable_cli = 1" >> /etc/php/$1/cli/conf.d/20-apcu.ini'
# Disable xdebug
sudo phpdismod -v ALL -s ALL xdebug
# Set and check default PHP version
sudo update-alternatives --set php /usr/bin/php$1
php -v

View file

@ -133,6 +133,10 @@ class MemberController extends Member
// If a device key is present, unregister it.
Rhymix\Modules\Member\Controllers\Device::getInstance()->autoUnregisterDevice($logged_info->member_srl);
if (isset($_COOKIE['device_key']))
{
Rhymix\Framework\Cookie::remove('device_key');
}
// Set redirect URL.
$output = new BaseObject();