Skip to content
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

CakePHP2 compatible to PHP 8.2 #7

Open
wants to merge 17 commits into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/configs/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ class DATABASE_CONFIG
private $identities = [
'mysql' => [
'datasource' => 'Database/Mysql',
'host' => '127.0.0.1',
'host' => 'mysql',
'login' => 'root',
'password' => 'root'
'password' => 'root',
'flags' => [PDO::ATTR_STRINGIFY_FETCHES => true],
],
'sqlite' => [
'datasource' => 'Database/Sqlite',
Expand Down
66 changes: 30 additions & 36 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ jobs:
linux-tests:
runs-on: ubuntu-latest

container:
image: ${{ matrix.container }}

strategy:
fail-fast: false
matrix:
php-version:
- '8.0'
container:
- 'beinbm/cake:php80'
- 'beinbm/cake:php82'
db-type:
- mysql
- sqlite
Expand All @@ -30,13 +34,7 @@ jobs:
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: cakephp_test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379:6379
memcached:
image: memcached
ports:
Expand All @@ -49,47 +47,43 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: apcu, memcache, memcached, redis, mcrypt, pdo_mysql, pdo_sqlite
ini-values: |
assert.exception=1,
zend.assertions=1,
error_reporting=-1,
log_errors_max_len=0,
display_errors=On,
apc.enable_cli=1
tools: composer

- name: locale-gen
run: |
sudo locale-gen de_DE;
sudo locale-gen es_ES;
# - name: Install PHP with extensions
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-version }}
# extensions: apcu, memcache, memcached, mcrypt, pdo_mysql, pdo_sqlite
# ini-values: |
# assert.exception=1,
# zend.assertions=1,
# error_reporting=-1,
# log_errors_max_len=0,
# display_errors=On,
# apc.enable_cli=1
# tools: composer

# - name: locale-gen
# run: |
# sudo locale-gen de_DE;
# sudo locale-gen es_ES;

- name: Create Another Databases for MySQL
if: matrix.db-type == 'mysql'
run: |
env MYSQL_PWD=root mysql -h 127.0.0.1 -u root -e 'CREATE DATABASE cakephp_test2;';
env MYSQL_PWD=root mysql -h 127.0.0.1 -u root -e 'CREATE DATABASE cakephp_test3;';
env MYSQL_PWD=root mysql -h mysql -u root -e 'CREATE DATABASE cakephp_test2;';
env MYSQL_PWD=root mysql -h mysql -u root -e 'CREATE DATABASE cakephp_test3;';

- name: Make temporary directories writable
run: chmod -R 777 ./app/tmp

- name: Composer get cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer
id: composer-cache
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php${{ matrix.php-version }}-composer-
path: ./vendor
key: ${{ matrix.container }}-composer-${{ hashFiles('**/composer.json') }}

- name: Install Composer Packages
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --no-ansi --no-interaction --no-progress

- name: Copy database.php
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ Icon?
ehthumbs.db
Thumbs.db

composer.lock
.phpunit.result.cache
101 changes: 0 additions & 101 deletions app/Config/Schema/db_acl.php

This file was deleted.

52 changes: 0 additions & 52 deletions app/Config/Schema/db_acl.sql

This file was deleted.

65 changes: 0 additions & 65 deletions app/Config/acl.ini.php

This file was deleted.

Loading
Loading