From 7f2af7518e19e667e6bfe6fb00e69299c5a7992c Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Thu, 3 Aug 2023 12:55:18 -0400 Subject: [PATCH 1/7] changed phalcon version for actions --- .github/workflows/main.yml | 4 ++-- .github/workflows/static-code-analysis.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d6a84b7..f1d5fe2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: --health-retries 5 strategy: matrix: - php: [8.0, 8.1] + php: [8.0, 8.1, 8.2] steps: - name: Checkout code @@ -31,7 +31,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: phalcon-5.0.0RC1, pdo, mysql + extensions: phalcon-5.0.0, pdo, mysql coverage: none - name: Validate composer.json and composer.lock diff --git a/.github/workflows/static-code-analysis.yml b/.github/workflows/static-code-analysis.yml index 908e5a0..0083d69 100644 --- a/.github/workflows/static-code-analysis.yml +++ b/.github/workflows/static-code-analysis.yml @@ -6,7 +6,7 @@ jobs: phpcs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v2 with: fetch-depth: 1 - name: Run PHP_CodeSniffer From d68858c3de245a77403ca92e1564a9b805852f14 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Thu, 3 Aug 2023 12:55:41 -0400 Subject: [PATCH 2/7] added 8.2 for local docker development and updated phalcon --- docker-compose.yml | 8 +++++ docker/8.0/Dockerfile | 2 +- docker/8.1/Dockerfile | 4 +-- docker/8.2/.bashrc | 75 +++++++++++++++++++++++++++++++++++++++++++ docker/8.2/Dockerfile | 35 ++++++++++++++++++++ docker/8.2/extra.ini | 3 ++ 6 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 docker/8.2/.bashrc create mode 100644 docker/8.2/Dockerfile create mode 100644 docker/8.2/extra.ini diff --git a/docker-compose.yml b/docker-compose.yml index bd855f8..c12a479 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,14 @@ services: volumes: - .:/srv + module-phalcon5-8.2: + container_name: module-phalcon5-8.2 + hostname: module-phalcon5-82 + build: docker/8.2 + working_dir: /srv + volumes: + - .:/srv + mysql: container_name: module-phalcon5-mysql image: mysql:5.7 diff --git a/docker/8.0/Dockerfile b/docker/8.0/Dockerfile index cf585ff..946c2e3 100644 --- a/docker/8.0/Dockerfile +++ b/docker/8.0/Dockerfile @@ -5,7 +5,7 @@ ADD ./extra.ini /usr/local/etc/php/conf.d/ # User/Group globals ENV PHP_VERSION="8.0" \ - PHALCON_VERSION="5.0.0RC1" + PHALCON_VERSION="5.2.3" # Update RUN apt update -y && \ diff --git a/docker/8.1/Dockerfile b/docker/8.1/Dockerfile index d5843a5..e4c5d1e 100644 --- a/docker/8.1/Dockerfile +++ b/docker/8.1/Dockerfile @@ -1,11 +1,11 @@ FROM composer:latest as composer -FROM php:8.1-fpm +FROM php:8.2-fpm ADD ./extra.ini /usr/local/etc/php/conf.d/ # User/Group globals ENV PHP_VERSION="8.1" \ - PHALCON_VERSION="5.0.0RC1" + PHALCON_VERSION="5.2.3" # Update RUN apt update -y && \ diff --git a/docker/8.2/.bashrc b/docker/8.2/.bashrc new file mode 100644 index 0000000..ddcecd5 --- /dev/null +++ b/docker/8.2/.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.2/Dockerfile b/docker/8.2/Dockerfile new file mode 100644 index 0000000..0520bc9 --- /dev/null +++ b/docker/8.2/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.2.3" + +# 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.2/extra.ini b/docker/8.2/extra.ini new file mode 100644 index 0000000..24836db --- /dev/null +++ b/docker/8.2/extra.ini @@ -0,0 +1,3 @@ +memory_limit=512M +apc.enable_cli="On" +session.save_path="/tmp" From 4ebf590e3f6eb2dba0ba5094526cd84e621a3ae5 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Thu, 3 Aug 2023 12:55:53 -0400 Subject: [PATCH 3/7] updated versions from RC --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e88d897..9fb8986 100644 --- a/composer.json +++ b/composer.json @@ -20,14 +20,14 @@ "require": { "php": ">=8.0", "ext-json": "*", - "codeception/codeception": "^5.0.0-RC1", + "codeception/codeception": "^5.0.0", "codeception/module-asserts": "^3.0", "codeception/module-phpbrowser": "^3.0", "codeception/module-db": "^3.0" }, "require-dev": { "codeception/util-robohelpers": "dev-master", - "phalcon/ide-stubs": "^5.0.0RC1", + "phalcon/ide-stubs": "^5.0.0", "squizlabs/php_codesniffer": "^3.6", "vimeo/psalm": "^4.23", "vlucas/phpdotenv": "^5.4" From fc2bc3934e5391ad2b562ff3744e7d2444f69d6a Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Thu, 3 Aug 2023 12:56:20 -0400 Subject: [PATCH 4/7] correcting issue #8 --- src/Codeception/Lib/Connector/Phalcon5.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Codeception/Lib/Connector/Phalcon5.php b/src/Codeception/Lib/Connector/Phalcon5.php index f38f2a7..da1ddf6 100644 --- a/src/Codeception/Lib/Connector/Phalcon5.php +++ b/src/Codeception/Lib/Connector/Phalcon5.php @@ -118,7 +118,8 @@ public function doRequest($request): Response if ($di->has('request')) { $di->remove('request'); } - $di['request'] = Stub::construct($phRequest, [], ['getRawBody' => $request->getContent()]); + $requestContent = $request->getContent() ?: ''; + $di['request'] = Stub::construct($phRequest, [], ['getRawBody' => $requestContent]); $response = $application->handle($pathString); if (!$response instanceof Http\ResponseInterface) { From b49c0b90b515633803e32806e28ecfdb82d3e351 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Thu, 3 Aug 2023 13:01:05 -0400 Subject: [PATCH 5/7] phpcs --- tests/_data/App/Models/Articles.php | 1 - tests/_support/Helper/Acceptance.php | 1 - tests/_support/Helper/Functional.php | 1 - tests/_support/Helper/Unit.php | 1 - 4 files changed, 4 deletions(-) diff --git a/tests/_data/App/Models/Articles.php b/tests/_data/App/Models/Articles.php index cc34fb3..88c35c4 100644 --- a/tests/_data/App/Models/Articles.php +++ b/tests/_data/App/Models/Articles.php @@ -6,5 +6,4 @@ class Articles extends Model { - } diff --git a/tests/_support/Helper/Acceptance.php b/tests/_support/Helper/Acceptance.php index b47b494..aaf8ebb 100644 --- a/tests/_support/Helper/Acceptance.php +++ b/tests/_support/Helper/Acceptance.php @@ -9,5 +9,4 @@ class Acceptance extends Module { - } diff --git a/tests/_support/Helper/Functional.php b/tests/_support/Helper/Functional.php index 64888fc..2bf7e3b 100644 --- a/tests/_support/Helper/Functional.php +++ b/tests/_support/Helper/Functional.php @@ -9,5 +9,4 @@ class Functional extends Module { - } diff --git a/tests/_support/Helper/Unit.php b/tests/_support/Helper/Unit.php index 415ae93..03e4543 100644 --- a/tests/_support/Helper/Unit.php +++ b/tests/_support/Helper/Unit.php @@ -9,5 +9,4 @@ class Unit extends Module { - } From 586d3c3d3ab3278d66c0337c9fbe11a4dba056a9 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Thu, 3 Aug 2023 13:03:03 -0400 Subject: [PATCH 6/7] updating checkout action to v3 --- .github/workflows/main.yml | 2 +- .github/workflows/static-code-analysis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f1d5fe2..60cc3a6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/static-code-analysis.yml b/.github/workflows/static-code-analysis.yml index 0083d69..c256b26 100644 --- a/.github/workflows/static-code-analysis.yml +++ b/.github/workflows/static-code-analysis.yml @@ -6,7 +6,7 @@ jobs: phpcs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 1 - name: Run PHP_CodeSniffer From 70d035ba059d61194ee30222782d5d236da1eb29 Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Thu, 3 Aug 2023 13:12:43 -0400 Subject: [PATCH 7/7] updating changelog --- CHANGELOG.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 436d1cf..77cee00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## [2.0.0](https://github.com/Codeception/module-phalcon5/releases/tag/1.0.0) (12-16-2021) + +- Fixed `getRawBody()` return type [#8](https://github.com/Codeception/module-phalcon5/issues/8) + +## [2.0.0](https://github.com/Codeception/module-phalcon5/releases/tag/1.0.0) (12-16-2021) + +- Use of Codeception v5+ +- Use of Phalcon 5.0.0RC1+ +- Corrected namespaces +- Cosmetic changes + +## [1.0.1](https://github.com/Codeception/module-phalcon5/releases/tag/1.0.0) (12-16-2021) + +- Corrections for Packagist descriptions and PHP minimum version + ## [1.0.0](https://github.com/Codeception/module-phalcon5/releases/tag/1.0.0) (12-11-2021) -- Support Phalcon 5.0.0beta1 \ No newline at end of file +- Support Phalcon 5.0.0beta1