diff --git a/.env.example b/.env.example index fcae4d6..f9f12b9 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,4 @@ DB_HOST=127.0.0.1 DB_NAME=phalcon DB_USERNAME=root DB_PASSWORD=password -DB_PORT=3306 \ No newline at end of file +DB_PORT=3306 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c6b94dd..d6a84b7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: --health-retries 5 strategy: matrix: - php: [7.4, 8.0] + php: [8.0, 8.1] steps: - name: Checkout code @@ -31,7 +31,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: phalcon-5.0.0beta1, pdo, mysql + extensions: phalcon-5.0.0RC1, pdo, mysql coverage: none - name: Validate composer.json and composer.lock diff --git a/composer.json b/composer.json index 4a17e4d..e88d897 100644 --- a/composer.json +++ b/composer.json @@ -18,19 +18,19 @@ } ], "require": { - "php": ">=7.4.0", + "php": ">=8.0", "ext-json": "*", - "codeception/codeception": "^4.0", - "codeception/lib-innerbrowser": "^1.0", - "codeception/module-asserts": "^1.0", - "codeception/module-phpbrowser": "^1.0", - "codeception/module-db": "^1.0" + "codeception/codeception": "^5.0.0-RC1", + "codeception/module-asserts": "^3.0", + "codeception/module-phpbrowser": "^3.0", + "codeception/module-db": "^3.0" }, "require-dev": { "codeception/util-robohelpers": "dev-master", - "vlucas/phpdotenv": "^4.1", - "squizlabs/php_codesniffer": "^3.4", - "vimeo/psalm": "^3.6" + "phalcon/ide-stubs": "^5.0.0RC1", + "squizlabs/php_codesniffer": "^3.6", + "vimeo/psalm": "^4.23", + "vlucas/phpdotenv": "^5.4" }, "autoload": { "classmap": [ diff --git a/docker-compose.yml b/docker-compose.yml index ed549a2..bd855f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,28 @@ -version: '2.1' +# For local development only. +version: '3' services: + module-phalcon5-8.0: + container_name: module-phalcon5-8.0 + hostname: module-phalcon5-80 + build: docker/8.0 + working_dir: /srv + volumes: + - .:/srv + + module-phalcon5-8.1: + container_name: module-phalcon5-8.1 + hostname: module-phalcon5-81 + build: docker/8.1 + working_dir: /srv + volumes: + - .:/srv + mysql: - restart: always + container_name: module-phalcon5-mysql image: mysql:5.7 - ports: - - 3306:3306 environment: - - MYSQL_DATABASE=phalcon - MYSQL_ROOT_PASSWORD=password + - MYSQL_USER=phalcon + - MYSQL_DATABASE=phalcon + - MYSQL_PASSWORD=password diff --git a/docker/8.0/.bashrc b/docker/8.0/.bashrc new file mode 100644 index 0000000..ddcecd5 --- /dev/null +++ b/docker/8.0/.bashrc @@ -0,0 +1,75 @@ +#!/bin/bash + +# Easier navigation: .., ..., ...., ....., ~ and - +alias ..="cd .." +alias ...="cd ../.." +alias ....="cd ../../.." +alias .....="cd ../../../.." +alias ~="cd ~" # `cd` is probably faster to type though +alias -- -="cd -" + +# Shortcuts +alias g="git" +alias h="history" + +# Detect which `ls` flavor is in use +if ls --color > /dev/null 2>&1; then # GNU `ls` + colorflag="--color" +else # OS X `ls` + colorflag="-G" +fi + +# List all files colorized in long format +# shellcheck disable=SC2139 +alias l="ls -lF ${colorflag}" + +# List all files colorized in long format, including dot files +# shellcheck disable=SC2139 +alias la="ls -laF ${colorflag}" + +# List only directories +# shellcheck disable=SC2139 +alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" + +# See: https://superuser.com/a/656746/280737 +alias ll='LC_ALL="C.UTF-8" ls -alF' + +# Always use color output for `ls` +# shellcheck disable=SC2139 +alias ls="command ls ${colorflag}" +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:' + +# Always enable colored `grep` output +alias grep='grep --color=auto ' + +# Enable aliases to be sudo’ed +alias sudo='sudo ' + +# Get week number +alias week='date +%V' + +# Stopwatch +alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' + +# Canonical hex dump; some systems have this symlinked +command -v hd > /dev/null || alias hd="hexdump -C" + +# vhosts +alias hosts='sudo nano /etc/hosts' + +# copy working directory +alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard' + +# copy file interactive +alias cp='cp -i' + +# move file interactive +alias mv='mv -i' + +# untar +alias untar='tar xvf' + +# Zephir related +alias untar='tar xvf' + +PATH=$PATH:./vendor/bin \ No newline at end of file diff --git a/docker/8.0/Dockerfile b/docker/8.0/Dockerfile new file mode 100644 index 0000000..cf585ff --- /dev/null +++ b/docker/8.0/Dockerfile @@ -0,0 +1,35 @@ +FROM composer:latest as composer +FROM php:8.0-fpm + +ADD ./extra.ini /usr/local/etc/php/conf.d/ + +# User/Group globals +ENV PHP_VERSION="8.0" \ + PHALCON_VERSION="5.0.0RC1" + +# Update +RUN apt update -y && \ + apt install -y \ + apt-utils \ + git \ + nano \ + sudo \ + wget \ + zip + +# PECL Packages +RUN pecl install phalcon-${PHALCON_VERSION} + +RUN docker-php-ext-install \ + pdo_mysql + +# Install PHP extensions +RUN docker-php-ext-enable \ + phalcon + +# Composer +COPY --from=composer /usr/bin/composer /usr/local/bin/composer +# Bash script with helper aliases +COPY ./.bashrc /root/.bashrc + +CMD ["php-fpm"] diff --git a/docker/8.0/extra.ini b/docker/8.0/extra.ini new file mode 100644 index 0000000..24836db --- /dev/null +++ b/docker/8.0/extra.ini @@ -0,0 +1,3 @@ +memory_limit=512M +apc.enable_cli="On" +session.save_path="/tmp" diff --git a/docker/8.1/.bashrc b/docker/8.1/.bashrc new file mode 100644 index 0000000..ddcecd5 --- /dev/null +++ b/docker/8.1/.bashrc @@ -0,0 +1,75 @@ +#!/bin/bash + +# Easier navigation: .., ..., ...., ....., ~ and - +alias ..="cd .." +alias ...="cd ../.." +alias ....="cd ../../.." +alias .....="cd ../../../.." +alias ~="cd ~" # `cd` is probably faster to type though +alias -- -="cd -" + +# Shortcuts +alias g="git" +alias h="history" + +# Detect which `ls` flavor is in use +if ls --color > /dev/null 2>&1; then # GNU `ls` + colorflag="--color" +else # OS X `ls` + colorflag="-G" +fi + +# List all files colorized in long format +# shellcheck disable=SC2139 +alias l="ls -lF ${colorflag}" + +# List all files colorized in long format, including dot files +# shellcheck disable=SC2139 +alias la="ls -laF ${colorflag}" + +# List only directories +# shellcheck disable=SC2139 +alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" + +# See: https://superuser.com/a/656746/280737 +alias ll='LC_ALL="C.UTF-8" ls -alF' + +# Always use color output for `ls` +# shellcheck disable=SC2139 +alias ls="command ls ${colorflag}" +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:' + +# Always enable colored `grep` output +alias grep='grep --color=auto ' + +# Enable aliases to be sudo’ed +alias sudo='sudo ' + +# Get week number +alias week='date +%V' + +# Stopwatch +alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' + +# Canonical hex dump; some systems have this symlinked +command -v hd > /dev/null || alias hd="hexdump -C" + +# vhosts +alias hosts='sudo nano /etc/hosts' + +# copy working directory +alias cwd='pwd | tr -d "\r\n" | xclip -selection clipboard' + +# copy file interactive +alias cp='cp -i' + +# move file interactive +alias mv='mv -i' + +# untar +alias untar='tar xvf' + +# Zephir related +alias untar='tar xvf' + +PATH=$PATH:./vendor/bin \ No newline at end of file diff --git a/docker/8.1/Dockerfile b/docker/8.1/Dockerfile new file mode 100644 index 0000000..d5843a5 --- /dev/null +++ b/docker/8.1/Dockerfile @@ -0,0 +1,35 @@ +FROM composer:latest as composer +FROM php:8.1-fpm + +ADD ./extra.ini /usr/local/etc/php/conf.d/ + +# User/Group globals +ENV PHP_VERSION="8.1" \ + PHALCON_VERSION="5.0.0RC1" + +# Update +RUN apt update -y && \ + apt install -y \ + apt-utils \ + git \ + nano \ + sudo \ + wget \ + zip + +# PECL Packages +RUN pecl install phalcon-${PHALCON_VERSION} + +RUN docker-php-ext-install \ + pdo_mysql + +# Install PHP extensions +RUN docker-php-ext-enable \ + phalcon + +# Composer +COPY --from=composer /usr/bin/composer /usr/local/bin/composer +# Bash script with helper aliases +COPY ./.bashrc /root/.bashrc + +CMD ["php-fpm"] diff --git a/docker/8.1/extra.ini b/docker/8.1/extra.ini new file mode 100644 index 0000000..24836db --- /dev/null +++ b/docker/8.1/extra.ini @@ -0,0 +1,3 @@ +memory_limit=512M +apc.enable_cli="On" +session.save_path="/tmp" diff --git a/documentation.md b/documentation.md index a1ca9ae..cfaa834 100644 --- a/documentation.md +++ b/documentation.md @@ -1507,7 +1507,7 @@ Switch to iframe or frame on the page. Example: ``` html -