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

Update to php8.1 symfony 6.4 #331

Open
wants to merge 25 commits into
base: main
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
26 changes: 10 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
DB_DATABASE: phplist
DB_USERNAME: root
DB_PASSWORD: phplist
BROADCAST_DRIVER: log
BROADCAST_DRIVER: log
services:
mysql:
image: mysql:5.7
Expand All @@ -22,16 +22,21 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0']
php-versions: ['8.1']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql
coverage: xdebug #optional
- name: Install Symfony CLI
run: |
curl -sS https://get.symfony.com/cli/installer | bash
mv $HOME/.symfony*/bin/symfony /usr/local/bin/symfony
symfony version
- name: Start mysql service
run: sudo /etc/init.d/mysql start
- name: Verify MySQL connection on host
Expand All @@ -45,40 +50,29 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
continue-on-error: ${{matrix.php-versions == '8.0' }} # Temporal until full support for php8 === [temp-php8]
- name: Validating composer.json
run: composer validate --no-check-all --no-check-lock --strict;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Linting all php files
run: find src/ tests/ public/ -name ''*.php'' -print0 | xargs -0 -n 1 -P 4 php -l; php -l bin/*;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Run units tests with phpunit
run: vendor/bin/phpunit tests/Unit/
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
run: vendor/bin/phpunit tests/Unit/
- name: Run integration tests with phpunit
run: |
run: |
export PHPLIST_DATABASE_NAME=${{ env.DB_DATABASE }}
export PHPLIST_DATABASE_USER=${{ env.DB_USERNAME }}
export PHPLIST_DATABASE_PASSWORD=${{ env.DB_PASSWORD }}
export PHPLIST_DATABASE_PORT=${{ job.services.mysql.ports['3306'] }}
export PHPLIST_DATABASE_HOST=127.0.0.1
vendor/bin/phpunit tests/Integration/
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running the system tests
run: vendor/bin/phpunit tests/System/;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running static analysis
run: vendor/bin/phpstan analyse -c phpstan.neon;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running PHPMD
run: vendor/bin/phpmd src/ text config/PHPMD/rules.xml;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
- name: Running PHP_CodeSniffer
run: vendor/bin/phpcs --standard=config/PhpCodeSniffer/ bin/ src/ tests/ public/;
continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8]
106 changes: 56 additions & 50 deletions .github/workflows/core-docs.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,89 @@
name: Publish Core Docs
name: Publish Core Docs
on: [push, pull_request]
jobs:
make-restapi-docs:
name: Checkout phpList core and generate docs using `phpDocumentor`
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1
extensions: mbstring, dom, fileinfo, mysql
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Cache composer dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
path: ${{ env.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install current dependencies from composer.lock
run: composer install
- name: Install phpDocumentor
- name: Install phpDocumentor
run: |
wget https://phpdoc.org/phpDocumentor.phar
chmod +x phpDocumentor.phar
mv phpDocumentor.phar /usr/local/bin/phpDocumentor
- name: Verify phpDocumentor version
run: phpDocumentor --version
- name: Generate documentation
run: composer run-php-documentor
- name: zip phpdocumentor dir
- name: Zip phpDocumentor directory
run: zip -r phpdocumentor.zip docs/phpdocumentor
- name: Upload generated doc files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: doc-files
path: phpdocumentor.zip
deploy-docs:
name: Deploy Core Docs.
name: Deploy Core Docs
runs-on: ubuntu-20.04
needs: make-restapi-docs
steps:
- name: Checkout phplist/core-docs
uses: actions/checkout@v2
with:
repository: phpList/core-docs
fetch-depth: 0
token: ${{ secrets.PUSH_CORE_DOCS }}
- name: Restore REST API Spec
uses: actions/download-artifact@v2
with:
name: doc-files
- name: unzip phpdocumentor
run: |
unzip phpdocumentor.zip
rm phpdocumentor.zip
- name: List Files
run: ls
- name: Sync old files with newly generated ones.
run: rsync -av docs/phpdocumentor/* .
- name: Removed temp dirs
run: rm -rf docs
- name: Check if updates/changes.
run: git status --porcelain > repo-changes.txt
- name: Check changes file
run: cat repo-changes.txt
- name: Verify updates.
id: allow-deploy
run: |
if [ -s repo-changes.txt ]; then echo "Updates made to documentation"; echo '::set-output name=DEPLOY::true'; else echo "No updates made to documentation deployment would be skipped."; echo '::set-output name=DEPLOY::false'; fi
- name: Commit changes and deply
if: ${{ steps.allow-deploy.outputs.DEPLOY == 'true' }}
run: |
rm repo-changes.txt
git config user.name "github-actions"
git config user.email "[email protected]"
git add .
git commit -s -m "phplist/core docs deployment `date`"
git push
- name: Checkout phplist/core-docs
uses: actions/checkout@v3
with:
repository: phpList/core-docs
fetch-depth: 0
token: ${{ secrets.PUSH_CORE_DOCS }}
- name: Restore REST API Spec
uses: actions/download-artifact@v4
with:
name: doc-files
- name: Unzip phpDocumentor
run: |
unzip phpdocumentor.zip
rm phpdocumentor.zip
- name: List Files
run: ls
- name: Sync old files with newly generated ones
run: rsync -av docs/phpdocumentor/* .
- name: Remove temporary directories
run: rm -rf docs
- name: Check if updates/changes
run: git status --porcelain > repo-changes.txt
- name: Check changes file
run: cat repo-changes.txt
- name: Verify updates
id: allow-deploy
run: |
if [ -s repo-changes.txt ]; then
echo "Updates made to documentation";
echo 'DEPLOY=true' >> $GITHUB_ENV;
else
echo "No updates made to documentation. Deployment would be skipped.";
echo 'DEPLOY=false' >> $GITHUB_ENV;
fi
- name: Commit changes and deploy
if: ${{ env.DEPLOY == 'true' }}
run: |
rm repo-changes.txt
git config user.name "github-actions"
git config user.email "[email protected]"
git add .
git commit -s -m "phplist/core docs deployment `date`"
git push origin main --force
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
/vendor/
/docs/phpdocumentor
.vagrant
.phpdoc/
.phpdoc/
.phpunit.result.cache
4 changes: 2 additions & 2 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use PhpList\Core\Core\Bootstrap;
use PhpList\Core\Core\Environment;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Symfony\Component\ErrorHandler\ErrorHandler;

set_time_limit(0);

Expand All @@ -19,7 +19,7 @@ $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-d
&& $environment !== Environment::PRODUCTION;

if ($debug) {
Debug::enable();
ErrorHandler::register();
}

Bootstrap::getInstance()->setEnvironment($environment)->configure();
Expand Down
67 changes: 38 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,45 @@
"source": "https://github.com/phpList/core"
},
"require": {
"php": "^7.2|^8.0",
"doctrine/orm": "^2.5.0",
"doctrine/common": "^2.6.0",
"doctrine/doctrine-bundle": "^1.8.0",
"symfony/symfony": "^3.4.37",
"symfony/monolog-bundle": "^3.1.0",
"symfony/dependency-injection": "^3.4.37",
"symfony/config": "^3.4.37",
"symfony/yaml": "^3.4.37",
"jms/serializer-bundle": "^3.8.0",
"sensio/framework-extra-bundle": "^5.1.0",
"sensio/distribution-bundle": "^5.0.6"
"php": "^8.1",
"symfony/dependency-injection": "^6.4",
"symfony/config": "^6.4",
"symfony/yaml": "^6.4",
"symfony/error-handler": "^6.4",
"symfony/serializer": "^6.4",
"symfony/monolog-bundle": "^3.10",
"symfony/serializer-pack": "^1.3",
"symfony/orm-pack": "^2.4",
"doctrine/orm": "^3.3",
"doctrine/cache": "^2.2",
"symfony/asset": "^6.4",
"symfony/security-csrf": "^6.4",
"symfony/form": "^6.4",
"symfony/validator": "^6.4",
"doctrine/doctrine-fixtures-bundle": "^3.7",
"doctrine/instantiator": "^2.0",
"masterminds/html5": "^2.9"
},
"require-dev": {
"phpunit/phpunit": "^6.5.6",
"phpunit/phpunit-mock-objects": "^5.0.6",
"phpunit/dbunit": "^3.0.0",
"phpunit/phpunit": "^9.5",
"guzzlehttp/guzzle": "^6.3.0",
"squizlabs/php_codesniffer": "^3.2.0",
"phpstan/phpstan": "^0.7.0|0.12.57",
"nette/caching": "^2.5.0|^3.0.0",
"nikic/php-parser": "^3.1.0",
"phpstan/phpstan": "^1.10",
"nette/caching": "^3.0.0",
"nikic/php-parser": "^4.19.1",
"phpmd/phpmd": "^2.6.0",
"composer/composer": "^1.6.0",
"doctrine/instantiator": "^1.0.5"
"symfony/test-pack": "^1.1",
"symfony/process": "^6.4",
"composer/composer": "^2.7",
"symfony/framework-bundle": "^6.4",
"symfony/http-kernel": "^6.4",
"symfony/http-foundation": "^6.4",
"symfony/routing": "^6.4",
"symfony/console": "^6.4"
},
"suggest": {
"phplist/web-frontend": "4.0.x-dev",
"phplist/rest-api": "4.0.x-dev"
"phplist/web-frontend": "5.0.x-dev",
"phplist/rest-api": "5.0.x-dev"
},
"autoload": {
"psr-4": {
Expand All @@ -83,7 +93,8 @@
"PhpList\\Core\\Composer\\ScriptHandler::createBundleConfiguration",
"PhpList\\Core\\Composer\\ScriptHandler::createRoutesConfiguration",
"PhpList\\Core\\Composer\\ScriptHandler::createParametersConfiguration",
"PhpList\\Core\\Composer\\ScriptHandler::clearAllCaches"
"php bin/console cache:clear",
"php bin/console cache:warmup"
],
"post-install-cmd": [
"@update-configuration"
Expand All @@ -97,7 +108,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "4.0.x-dev"
"dev-ISSUE-337": "5.0.x-dev"
},
"symfony-app-dir": "",
"symfony-bin-dir": "bin",
Expand All @@ -107,16 +118,14 @@
"phplist/core": {
"bundles": [
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle",
"Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle",
"Symfony\\Bundle\\MonologBundle\\MonologBundle",
"JMS\\SerializerBundle\\JMSSerializerBundle",
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle",
"PhpList\\Core\\EmptyStartPageBundle\\PhpListEmptyStartPageBundle"
"PhpList\\Core\\EmptyStartPageBundle\\EmptyStartPageBundle"
],
"routes": {
"homepage": {
"resource": "@PhpListEmptyStartPageBundle/Controller/",
"type": "annotation"
"resource": "@EmptyStartPageBundle/Controller/",
"type": "attribute"
}
}
}
Expand Down
Loading
Loading