Skip to content

Commit f5791f7

Browse files
authored
Merge pull request #152 from phalcon/#151-php8.0-refactor
#151 - Shift to PHP8.0
2 parents 7dfa9d7 + 7c1b2db commit f5791f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1469
-2331
lines changed
File renamed without changes.

docker/8.0/Dockerfile .docker/8.0/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LABEL vendor="Phalcon" \
55
maintainer="Phalcon Team <[email protected]>" \
66
description="Phalcon Migrations working environment"
77

8-
ENV PHALCON_VERSION="5.0.1" \
8+
ENV PHALCON_VERSION="5.5.0" \
99
PHP_VERSION="8.0"
1010

1111
ADD ./extra.ini /usr/local/etc/php/conf.d/
File renamed without changes.
File renamed without changes.

docker/8.1/Dockerfile .docker/8.1/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LABEL vendor="Phalcon" \
55
maintainer="Phalcon Team <[email protected]>" \
66
description="Phalcon Migrations working environment"
77

8-
ENV PHALCON_VERSION="5.0.1" \
8+
ENV PHALCON_VERSION="5.5.0" \
99
PHP_VERSION="8.1"
1010

1111
ADD ./extra.ini /usr/local/etc/php/conf.d/
File renamed without changes.
File renamed without changes.

docker/7.4/Dockerfile .docker/8.2/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
FROM composer:latest as composer
2-
FROM php:7.4-fpm
2+
FROM php:8.2-fpm
33

44
LABEL vendor="Phalcon" \
55
maintainer="Phalcon Team <[email protected]>" \
66
description="Phalcon Migrations working environment"
77

8-
ENV PHALCON_VERSION="5.0.1" \
9-
PHP_VERSION="7.4"
8+
ENV PHALCON_VERSION="5.5.0" \
9+
PHP_VERSION="8.2"
1010

1111
ADD ./extra.ini /usr/local/etc/php/conf.d/
1212

File renamed without changes.

.docker/8.3/.bashrc

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
# Easier navigation: .., ..., ...., ....., ~ and -
4+
alias ..="cd .."
5+
alias ...="cd ../.."
6+
alias ....="cd ../../.."
7+
alias .....="cd ../../../.."
8+
alias ~="cd ~" # `cd` is probably faster to type though
9+
alias -- -="cd -"
10+
11+
# Shortcuts
12+
alias g="git"
13+
alias h="history"
14+
15+
# Detect which `ls` flavor is in use
16+
if ls --color > /dev/null 2>&1; then # GNU `ls`
17+
colorflag="--color"
18+
else # OS X `ls`
19+
colorflag="-G"
20+
fi
21+
22+
# List all files colorized in long format
23+
# shellcheck disable=SC2139
24+
alias l="ls -lF ${colorflag}"
25+
26+
# List all files colorized in long format, including dot files
27+
# shellcheck disable=SC2139
28+
alias la="ls -laF ${colorflag}"
29+
30+
# List only directories
31+
# shellcheck disable=SC2139
32+
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
33+
34+
# See: https://superuser.com/a/656746/280737
35+
alias ll='LC_ALL="C.UTF-8" ls -alF'
36+
37+
# Always use color output for `ls`
38+
# shellcheck disable=SC2139
39+
alias ls="command ls ${colorflag}"
40+
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
41+
42+
# Always enable colored `grep` output
43+
alias grep='grep --color=auto '
44+
45+
# Enable aliases to be sudo’ed
46+
alias sudo='sudo '
47+
48+
# Get week number
49+
alias week='date +%V'
50+
51+
# Stopwatch
52+
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
53+
54+
# Canonical hex dump; some systems have this symlinked
55+
command -v hd > /dev/null || alias hd="hexdump -C"
56+
57+
# vhosts
58+
alias hosts='sudo nano /etc/hosts'
59+
60+
# copy working directory
61+
alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard'
62+
63+
# copy file interactive
64+
alias cp='cp -i'
65+
66+
# move file interactive
67+
alias mv='mv -i'
68+
69+
# untar
70+
alias untar='tar xvf'
71+
72+
# Zephir related
73+
alias untar='tar xvf'
74+
75+
PATH=$PATH:./vendor/bin

.docker/8.3/Dockerfile

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM composer:latest as composer
2+
FROM php:8.3-fpm
3+
4+
LABEL vendor="Phalcon" \
5+
maintainer="Phalcon Team <[email protected]>" \
6+
description="Phalcon Migrations working environment"
7+
8+
ENV PHALCON_VERSION="5.5.0" \
9+
PHP_VERSION="8.3"
10+
11+
ADD ./extra.ini /usr/local/etc/php/conf.d/
12+
13+
# Update
14+
RUN apt update -y && \
15+
apt install -y \
16+
apt-utils \
17+
gettext \
18+
git \
19+
libpq-dev \
20+
libzip-dev \
21+
nano \
22+
sudo \
23+
wget \
24+
zip
25+
26+
# PECL Packages
27+
RUN pecl install phalcon-${PHALCON_VERSION} \
28+
xdebug
29+
30+
# Install PHP extensions
31+
RUN docker-php-ext-install \
32+
gettext \
33+
pdo_mysql \
34+
pdo_pgsql \
35+
zip
36+
37+
# Install PHP extensions
38+
RUN docker-php-ext-enable \
39+
opcache \
40+
phalcon \
41+
xdebug
42+
43+
# Cleanup
44+
RUN apt autoremove -y \
45+
&& apt autoclean -y \
46+
&& apt clean -y \
47+
&& rm -rf /tmp/* /var/tmp/* \
48+
&& find /var/cache/apt/archives /var/lib/apt/lists /var/cache \
49+
-not -name lock \
50+
-type f \
51+
-delete \
52+
&& find /var/log -type f | while read f; do echo -n '' > ${f}; done
53+
54+
# Composer
55+
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
56+
# Bash script with helper aliases
57+
COPY ./.bashrc /root/.bashrc
58+
COPY ./.bashrc /home/phalcon/.bashrc
59+
60+
CMD ["php-fpm"]

.docker/8.3/extra.ini

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error_reporting=E_ALL
2+
display_errors="On"
3+
display_startup_errors="On"
4+
log_errors="On"
5+
error_log=/tmp/php_errors.log
6+
memory_limit=512M
7+
apc.enable_cli="On"
8+
session.save_path="/tmp"

.github/workflows/release-phar.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
1010
name: Compile and upload Phar
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1514

1615
- name: Compile phalcon-migrations.phar
1716
run: |

.github/workflows/tests.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ jobs:
88
runs-on: ubuntu-latest
99
env:
1010
extensions: mbstring, intl, json, phalcon-${{ matrix.phalcon-versions }}, mysql, pgsql
11-
key: cache-v2.2~17.05.2020
11+
key: cache-v4.0~13.04.2024
12+
1213
services:
1314
mysql:
14-
image: mysql:5.7
15+
image: mysql:8.0
1516
env:
1617
MYSQL_DATABASE: phalcon-migrations
1718
MYSQL_ROOT_PASSWORD: root
@@ -21,15 +22,17 @@ jobs:
2122
postgres:
2223
image: postgres:10.8
2324
ports:
24-
- 5432/tcp
25+
- "5432:5432"
2526
options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 2
27+
2628
strategy:
2729
fail-fast: false
2830
matrix:
29-
php-versions: ['7.4', '8.0', '8.1']
30-
phalcon-versions: ['5.0.1', '5.0.2', '5.0.3', '5.0.4', '5.0.5']
31+
php-versions: ['8.0', '8.1', '8.2', '8.3']
32+
phalcon-versions: ['5.5.0', '5.6.0', '5.6.1', '5.6.2']
3133
steps:
32-
- uses: actions/checkout@v1
34+
- uses: actions/checkout@v4
35+
3336
- name: Setup cache environment
3437
id: cache-env
3538
uses: shivammathur/cache-extensions@v1
@@ -63,8 +66,7 @@ jobs:
6366
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
6467
restore-keys: ${{ runner.os }}-composer-
6568

66-
- name: Install Composer dependencies
67-
run: composer install --prefer-dist --no-suggest
69+
- run: composer install --prefer-dist --no-suggest
6870

6971
- name: Copy .env file
7072
run: cp tests/.env.example tests/.env

.github/workflows/validations.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ jobs:
55
name: PSR-12 Code style
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v1
8+
- uses: actions/checkout@v4
99

10-
- name: Validate composer.json and composer.lock
11-
run: composer validate
10+
- run: composer validate
1211

1312
- name: Get Composer Cache Directory
1413
id: composer-cache
@@ -31,16 +30,16 @@ jobs:
3130
name: Static Code with PHP ${{ matrix.php-versions }}
3231
runs-on: ubuntu-latest
3332
env:
34-
extensions: mbstring, intl, json, phalcon-5.0.1
35-
key: cache-v2.2~17.05.2020
33+
extensions: mbstring, intl, json, phalcon-5.5.0
34+
key: cache-v4.0~13.04.2024
3635
needs: validate-code-style
3736
strategy:
3837
fail-fast: false
3938
matrix:
40-
php-versions: ['7.4', '8.0', '8.1']
39+
php-versions: ['8.0', '8.1', '8.2', '8.3']
40+
4141
steps:
42-
- name: Checkout the code
43-
uses: actions/checkout@v1
42+
- uses: actions/checkout@v4
4443

4544
- name: Setup cache environment
4645
id: cache-env

composer.json

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "phalcon/migrations",
33
"description": "Run and Generate DB Migrations with Phalcon Framework",
4+
"version": "4.0.0",
45
"keywords": [
56
"framework",
67
"phalcon",
@@ -26,24 +27,23 @@
2627
"forum": "https://forum.phalcon.io"
2728
},
2829
"require": {
29-
"php": ">=7.4",
30-
"ext-phalcon": ">=5.0.1",
31-
"phalcon/cli-options-parser": "^1.2",
32-
"nette/php-generator": "^3.5"
30+
"php": ">=8.0",
31+
"ext-phalcon": ">=5.5",
32+
"phalcon/cli-options-parser": "^2.0",
33+
"nette/php-generator": "^4.0"
3334
},
3435
"require-dev": {
3536
"ext-pdo": "*",
36-
"phalcon/ide-stubs": "^5.0.1",
37+
"phalcon/ide-stubs": "^5.5",
3738
"squizlabs/php_codesniffer": "^3.5",
3839
"fakerphp/faker": "^1.15",
3940
"humbug/box": "^3.8",
40-
"codeception/codeception": "^4.1",
41-
"codeception/module-asserts": "^1.0.0",
42-
"codeception/module-cli": "^1.0",
43-
"codeception/module-phpbrowser": "^1.0.0",
44-
"codeception/module-db": "^1.0",
41+
"codeception/codeception": "^5.1",
42+
"codeception/module-asserts": "^3.0.0",
43+
"codeception/module-cli": "^2.0",
44+
"codeception/module-db": "^3.0",
4545
"vimeo/psalm": "^4.6",
46-
"vlucas/phpdotenv": "^4.1",
46+
"vlucas/phpdotenv": "^5.6",
4747
"phpstan/phpstan": "^1.8"
4848
},
4949
"autoload": {
@@ -75,7 +75,6 @@
7575
"codeception.yml",
7676
"phpcs.xml.dist",
7777
"phpstan.neon.dist",
78-
"phpunit.xml.dist",
7978
"psalm.xml.dist"
8079
]
8180
},

0 commit comments

Comments
 (0)