diff --git a/.github/workflows/app-code-check-7.yml b/.github/workflows/app-code-check-7.yml index 047aadc82..c681683b1 100644 --- a/.github/workflows/app-code-check-7.yml +++ b/.github/workflows/app-code-check-7.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: php-versions: ['7.4'] - server-versions: ['master', 'stable19', 'stable20'] + server-versions: ['master', 'stable20', 'stable21'] name: AppCode check php${{ matrix.php-versions }}-${{ matrix.server-versions }} steps: diff --git a/.github/workflows/app-code-check-8.yml b/.github/workflows/app-code-check-8.yml index 86dc88855..59f8428eb 100644 --- a/.github/workflows/app-code-check-8.yml +++ b/.github/workflows/app-code-check-8.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: php-versions: ['8.0'] - server-versions: ['master'] + server-versions: ['master', 'stable21'] name: AppCode check php${{ matrix.php-versions }}-${{ matrix.server-versions }} steps: diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 69003945f..289f568c6 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -11,7 +11,7 @@ env: APP_NAME: polls jobs: - php: + sqlite: runs-on: ubuntu-latest strategy: @@ -20,7 +20,7 @@ jobs: matrix: php-versions: ['7.4', '8.0'] databases: ['sqlite'] - server-versions: ['master'] + server-versions: ['master', 'stable21'] name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} @@ -79,9 +79,9 @@ jobs: # do not stop on another job's failure fail-fast: false matrix: - php-versions: ['7.3', '7.4', '8.0'] + php-versions: ['7.4', '8.0'] databases: ['mysql'] - server-versions: ['master'] + server-versions: ['master', 'stable21'] name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} @@ -151,7 +151,7 @@ jobs: matrix: php-versions: ['7.4', '8.0'] databases: ['pgsql'] - server-versions: ['master'] + server-versions: ['master', 'stable21'] name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} diff --git a/Makefile b/Makefile index 4a6881135..c814cb4f0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ # This file is licensed under the Affero General Public License version 3 or # later. See the COPYING file. # @author Bernhard Posselt +# @author Vinzenz Rosenkranz +# @author René Gieling # @copyright Bernhard Posselt 2016 # Dependencies: @@ -20,90 +22,82 @@ appstore_build_dir=$(build_dir)/artifacts/appstore appstore_package_name=$(appstore_build_dir)/$(app_name) nc_cert_dir=$(HOME)/.nextcloud/certificates composer=$(shell which composer 2> /dev/null) +version=$(shell node -p -e "require('./package.json').version") -all: dev-setup appstore +# all steps for an appstore release +appstore: setup-build build-js-production package -# Dev environment setup -dev-setup: clean-dev npm-init composer +# install deps for release package +setup-build: install-composer-build-deps npm-init +# install deps for ci (tests and analysis) +setup-dev: composer install-composer-dev-deps npm-init + +# install composer deps for ci (tests and analysis) +install-composer-build-deps: composer + composer install --no-dev -o + +# install composer deps for release package +install-composer-dev-deps: composer + composer install -o + +# install node deps npm-init: npm ci -# a copy is fetched from the web -.PHONY: composer -composer: -ifeq (,$(composer)) - @echo "No composer command available, downloading a copy from the web" - mkdir -p $(build_tools_dir) - curl -sS https://getcomposer.org/installer | php - mv composer.phar $(build_tools_dir) - php $(build_tools_dir)/composer.phar install --prefer-dist - php $(build_tools_dir)/composer.phar update --prefer-dist -else - composer install --prefer-dist - composer update --prefer-dist -endif +# remove build dir +clean: + rm -rf $(build_dir) + +# remove deps +clean-dev: clean + rm -rf node_modules + rm -rf ./vendor -# Lint +# lint js, css and php lint: npm run lint + npm run stylelint composer run cs:check +# lint fix js, css and php lint-fix: npm run lint:fix + npm run stylelint:fix composer run cs:fix -# Removes the appstore build and compiled js files -.PHONY: clean -clean: - rm -rf $(build_dir) - rm -rf js/* - mkdir -p js -clean-dev: clean - rm -rf node_modules - rm -rf ./vendor - -# Build js -# Installs and updates the composer dependencies. If composer is not installed +# build vue app build-js-production: - npm run build + npm run build + +# install composer, if not installed +.PHONY: composer +composer: +ifeq (,$(composer)) + @echo "No composer command available, downloading a copy from the web" + mkdir -p $(build_tools_dir) + curl -sS https://getcomposer.org/installer | php + mv composer.phar $(build_tools_dir) + php $(build_tools_dir)/composer.phar install --prefer-dist + php $(build_tools_dir)/composer.phar update --prefer-dist +endif -# Builds the source package for the app store, ignores php and js tests -.PHONY: appstore -appstore: clean lint build-js-production +# Builds the source package for the appstore +# signs, if certificate is present +package: clean mkdir -p $(build_source_dir) mkdir -p $(appstore_build_dir) - rsync -a \ - --exclude="ISSUE_TEMPLATE.md" \ - --exclude="*.log" \ - --exclude=".*" \ - --exclude="_*" \ - --exclude="build" \ - --exclude="bower.json" \ - --exclude="composer.*" \ - --exclude="js/.*" \ - --exclude="js/*.log" \ - --exclude="js/bower.json" \ - --exclude="js/karma.*" \ - --exclude="js/node_modules" \ - --exclude="js/package.json" \ - --exclude="js/protractor.*" \ - --exclude="js/test" \ - --exclude="js/tests" \ - --exclude="karma.*" \ - --exclude="l10n/no-php" \ - --exclude="Makefile" \ - --exclude="node_modules" \ - --exclude="package*" \ - --exclude="phpunit*xml" \ - --exclude="protractor.*" \ - --exclude="psalm.*" \ - --exclude="screenshots" \ - --exclude="src" \ - --exclude="tests" \ - --exclude="vendor" \ - --exclude="webpack.*" \ - $(project_dir)/ $(build_source_dir)/$(app_name) + rsync -zarh \ + $(project_dir)/appinfo \ + $(project_dir)/js \ + $(project_dir)/l10n \ + $(project_dir)/lib \ + $(project_dir)/templates \ + $(project_dir)/vendor \ + $(project_dir)/COPYING \ + $(project_dir)/README.md \ + $(project_dir)/CHANGELOG.md \ + $(build_source_dir)/$(app_name) tar -czf $(appstore_package_name).tar.gz \ --directory="$(build_source_dir)" $(app_name) @if [ -f $(nc_cert_dir)/$(app_name).key ]; then \ @@ -111,7 +105,8 @@ appstore: clean lint build-js-production openssl dgst -sha512 -sign $(nc_cert_dir)/$(app_name).key $(appstore_build_dir)/$(app_name).tar.gz | openssl base64; \ fi + .PHONY: test -test: composer +test: composer install-composer-dev-deps $(CURDIR)/vendor/phpunit/phpunit/phpunit --coverage-clover clover.xml -c tests/phpunit.xml $(CURDIR)/vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml diff --git a/composer.json b/composer.json index 46a4f63ed..b23524c9a 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,6 @@ "league/factory-muffin": "^3.0", "league/factory-muffin-faker": "^2.0", "nextcloud/coding-standard": "^0.5.0", - "doctrine/orm": "^2.7", "vimeo/psalm": "^4.3" }, "scripts": { @@ -39,5 +38,8 @@ "psalm": "php vendor/vimeo/psalm/psalm", "psalm:fix": "php vendor/vimeo/psalm/psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType", "psalm:info": "php vendor/vimeo/psalm/psalm --show-info=true" + }, + "require": { + "league/commonmark": "^1.6" } } diff --git a/composer.lock b/composer.lock index 69b30dec0..bd84725a6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,110 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2038b65124c4cc1eacc53e0da77f802a", - "packages": [], + "content-hash": "cea8741587b93250f2342f8d3b650406", + "packages": [ + { + "name": "league/commonmark", + "version": "1.6.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/7d70d2f19c84bcc16275ea47edabee24747352eb", + "reference": "7d70d2f19c84bcc16275ea47edabee24747352eb", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "scrutinizer/ocular": "1.7.*" + }, + "require-dev": { + "cebe/markdown": "~1.0", + "commonmark/commonmark.js": "0.29.2", + "erusev/parsedown": "~1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "~1.4", + "mikehaertl/php-shellcommand": "^1.4", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", + "scrutinizer/ocular": "^1.5", + "symfony/finder": "^4.2" + }, + "bin": [ + "bin/commonmark" + ], + "type": "library", + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and Github-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, + "funding": [ + { + "url": "https://enjoy.gitstore.app/repositories/thephpleague/commonmark", + "type": "custom" + }, + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://www.patreon.com/colinodell", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], + "time": "2021-05-12T11:39:41+00:00" + } + ], "packages-dev": [ { "name": "amphp/amp", @@ -429,650 +531,76 @@ "type": "tidelift" } ], - "time": "2021-05-05T19:37:51+00:00" - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" - }, - "time": "2019-12-04T15:06:13+00:00" - }, - { - "name": "doctrine/annotations", - "version": "1.12.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/b17c5014ef81d212ac539f07a1001832df1b6d3b", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/cache": "1.*", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.12.1" - }, - "time": "2021-02-21T21:00:45+00:00" - }, - { - "name": "doctrine/cache", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/a9c1b59eba5a08ca2770a76eddb88922f504e8e0", - "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0", - "shasum": "" - }, - "require": { - "php": "~7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4", - "psr/cache": ">=3" - }, - "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", - "cache/integration-tests": "dev-master", - "doctrine/coding-standard": "^8.0", - "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "predis/predis": "~1.0", - "psr/cache": "^1.0 || ^2.0", - "symfony/cache": "^4.4 || ^5.2" - }, - "suggest": { - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", - "homepage": "https://www.doctrine-project.org/projects/cache.html", - "keywords": [ - "abstraction", - "apcu", - "cache", - "caching", - "couchdb", - "memcached", - "php", - "redis", - "xcache" - ], - "support": { - "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/1.11.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", - "type": "tidelift" - } - ], - "time": "2021-04-13T14:46:17+00:00" - }, - { - "name": "doctrine/collections", - "version": "1.6.7", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/55f8b799269a1a472457bd1a41b4f379d4cfba4a", - "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a", - "shasum": "" - }, - "require": { - "php": "^7.1.3 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan-shim": "^0.9.2", - "phpunit/phpunit": "^7.0", - "vimeo/psalm": "^3.8.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", - "homepage": "https://www.doctrine-project.org/projects/collections.html", - "keywords": [ - "array", - "collections", - "iterators", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/1.6.7" - }, - "time": "2020-07-27T17:53:49+00:00" - }, - { - "name": "doctrine/common", - "version": "3.1.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "a036d90c303f3163b5be8b8fde9b6755b2be4a3a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/a036d90c303f3163b5be8b8fde9b6755b2be4a3a", - "reference": "a036d90c303f3163b5be8b8fde9b6755b2be4a3a", - "shasum": "" - }, - "require": { - "doctrine/persistence": "^2.0", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0 || ^8.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", - "squizlabs/php_codesniffer": "^3.0", - "symfony/phpunit-bridge": "^4.0.5", - "vimeo/psalm": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, proxies and much more.", - "homepage": "https://www.doctrine-project.org/projects/common.html", - "keywords": [ - "common", - "doctrine", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.1.2" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon", - "type": "tidelift" - } - ], - "time": "2021-02-10T20:18:51+00:00" - }, - { - "name": "doctrine/dbal", - "version": "2.13.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/dbal.git", - "reference": "c800380457948e65bbd30ba92cc17cda108bf8c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/c800380457948e65bbd30ba92cc17cda108bf8c9", - "reference": "c800380457948e65bbd30ba92cc17cda108bf8c9", - "shasum": "" - }, - "require": { - "doctrine/cache": "^1.0", - "doctrine/deprecations": "^0.5.3", - "doctrine/event-manager": "^1.0", - "ext-pdo": "*", - "php": "^7.1 || ^8" - }, - "require-dev": { - "doctrine/coding-standard": "8.2.0", - "jetbrains/phpstorm-stubs": "2020.2", - "phpstan/phpstan": "0.12.81", - "phpunit/phpunit": "^7.5.20|^8.5|9.5.0", - "squizlabs/php_codesniffer": "3.6.0", - "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", - "vimeo/psalm": "4.6.4" - }, - "suggest": { - "symfony/console": "For helpful console commands such as SQL execution and import of files." - }, - "bin": [ - "bin/doctrine-dbal" - ], - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - } - ], - "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", - "homepage": "https://www.doctrine-project.org/projects/dbal.html", - "keywords": [ - "abstraction", - "database", - "db2", - "dbal", - "mariadb", - "mssql", - "mysql", - "oci8", - "oracle", - "pdo", - "pgsql", - "postgresql", - "queryobject", - "sasql", - "sql", - "sqlanywhere", - "sqlite", - "sqlserver", - "sqlsrv" - ], - "support": { - "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.13.1" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", - "type": "tidelift" - } - ], - "time": "2021-04-17T17:30:19+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "v0.5.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "9504165960a1f83cc1480e2be1dd0a0478561314" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314", - "reference": "9504165960a1f83cc1480e2be1dd0a0478561314", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0|^7.0|^8.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v0.5.3" - }, - "time": "2021-03-21T12:59:47+00:00" + "time": "2021-05-05T19:37:51+00:00" }, { - "name": "doctrine/event-manager", - "version": "1.1.1", + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", "source": { "type": "git", - "url": "https://github.com/doctrine/event-manager.git", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": "<2.9@dev" + "php": ">=5.3.2" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" + "XdgBaseDir\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", - "homepage": "https://www.doctrine-project.org/projects/event-manager.html", - "keywords": [ - "event", - "event dispatcher", - "event manager", - "event system", - "events" - ], + "description": "implementation of xdg base directory specification for php", "support": { - "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/1.1.x" + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", - "type": "tidelift" - } - ], - "time": "2020-05-29T18:28:51+00:00" + "time": "2019-12-04T15:06:13+00:00" }, { - "name": "doctrine/inflector", - "version": "2.0.3", + "name": "doctrine/annotations", + "version": "1.13.1", "source": { "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210" + "url": "https://github.com/doctrine/annotations.git", + "reference": "e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210", - "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f", + "reference": "e6e7b7d5b45a2f2abc5460cc6396480b2b1d321f", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "doctrine/lexer": "1.*", + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0", + "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "doctrine/cache": "^1.11 || ^2.0", + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", + "symfony/cache": "^4.4 || ^5.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { - "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", @@ -1101,39 +629,18 @@ "email": "schmittjoh@gmail.com" } ], - "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", - "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "description": "Docblock Annotations Parser", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", "keywords": [ - "inflection", - "inflector", - "lowercase", - "manipulation", - "php", - "plural", - "singular", - "strings", - "uppercase", - "words" + "annotations", + "docblock", + "parser" ], "support": { - "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/2.0.x" + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.13.1" }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", - "type": "tidelift" - } - ], - "time": "2020-05-29T15:13:26+00:00" + "time": "2021-05-16T18:07:53+00:00" }, { "name": "doctrine/instantiator", @@ -1284,177 +791,6 @@ ], "time": "2020-05-25T17:44:05+00:00" }, - { - "name": "doctrine/orm", - "version": "2.8.4", - "source": { - "type": "git", - "url": "https://github.com/doctrine/orm.git", - "reference": "a588555ecd837b8d7e89355d9a13902e54d529c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/a588555ecd837b8d7e89355d9a13902e54d529c7", - "reference": "a588555ecd837b8d7e89355d9a13902e54d529c7", - "shasum": "" - }, - "require": { - "composer/package-versions-deprecated": "^1.8", - "doctrine/annotations": "^1.11.1", - "doctrine/cache": "^1.9.1", - "doctrine/collections": "^1.5", - "doctrine/common": "^3.0.3", - "doctrine/dbal": "^2.10.0", - "doctrine/event-manager": "^1.1", - "doctrine/inflector": "^1.4|^2.0", - "doctrine/instantiator": "^1.3", - "doctrine/lexer": "^1.0", - "doctrine/persistence": "^2.0", - "ext-pdo": "*", - "php": "^7.2|^8.0", - "symfony/console": "^3.0|^4.0|^5.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "phpstan/phpstan": "^0.12.18", - "phpunit/phpunit": "^8.5|^9.4", - "symfony/yaml": "^3.4|^4.0|^5.0", - "vimeo/psalm": "4.1.1" - }, - "suggest": { - "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" - }, - "bin": [ - "bin/doctrine" - ], - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\ORM\\": "lib/Doctrine/ORM" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Object-Relational-Mapper for PHP", - "homepage": "https://www.doctrine-project.org/projects/orm.html", - "keywords": [ - "database", - "orm" - ], - "support": { - "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.8.4" - }, - "time": "2021-04-05T18:38:36+00:00" - }, - { - "name": "doctrine/persistence", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/persistence.git", - "reference": "9899c16934053880876b920a3b8b02ed2337ac1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/9899c16934053880876b920a3b8b02ed2337ac1d", - "reference": "9899c16934053880876b920a3b8b02ed2337ac1d", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.0", - "doctrine/cache": "^1.0", - "doctrine/collections": "^1.0", - "doctrine/event-manager": "^1.0", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": "<2.10@dev" - }, - "require-dev": { - "composer/package-versions-deprecated": "^1.11", - "doctrine/coding-standard": "^6.0 || ^8.0", - "doctrine/common": "^3.0", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5.20 || ^8.0 || ^9.0", - "vimeo/psalm": "^3.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common", - "Doctrine\\Persistence\\": "lib/Doctrine/Persistence" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.", - "homepage": "https://doctrine-project.org/projects/persistence.html", - "keywords": [ - "mapper", - "object", - "odm", - "orm", - "persistence" - ], - "support": { - "issues": "https://github.com/doctrine/persistence/issues", - "source": "https://github.com/doctrine/persistence/tree/2.1.0" - }, - "time": "2020-10-24T22:13:54+00:00" - }, { "name": "fakerphp/faker", "version": "v1.14.1", @@ -2944,6 +2280,55 @@ ], "time": "2021-03-23T07:16:29+00:00" }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, { "name": "psr/container", "version": "1.1.1", @@ -4058,16 +3443,16 @@ }, { "name": "symfony/console", - "version": "v5.2.7", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "90374b8ed059325b49a29b55b3f8bb4062c87629" + "reference": "864568fdc0208b3eba3638b6000b69d2386e6768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/90374b8ed059325b49a29b55b3f8bb4062c87629", - "reference": "90374b8ed059325b49a29b55b3f8bb4062c87629", + "url": "https://api.github.com/repos/symfony/console/zipball/864568fdc0208b3eba3638b6000b69d2386e6768", + "reference": "864568fdc0208b3eba3638b6000b69d2386e6768", "shasum": "" }, "require": { @@ -4135,7 +3520,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.2.7" + "source": "https://github.com/symfony/console/tree/v5.2.8" }, "funding": [ { @@ -4151,7 +3536,7 @@ "type": "tidelift" } ], - "time": "2021-04-19T14:07:32+00:00" + "time": "2021-05-11T15:45:21+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4448,16 +3833,16 @@ }, { "name": "symfony/finder", - "version": "v5.2.4", + "version": "v5.2.9", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0d639a0943822626290d169965804f79400e6a04" + "reference": "ccccb9d48ca42757dd12f2ca4bf857a4e217d90d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04", - "reference": "0d639a0943822626290d169965804f79400e6a04", + "url": "https://api.github.com/repos/symfony/finder/zipball/ccccb9d48ca42757dd12f2ca4bf857a4e217d90d", + "reference": "ccccb9d48ca42757dd12f2ca4bf857a4e217d90d", "shasum": "" }, "require": { @@ -4489,7 +3874,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.2.4" + "source": "https://github.com/symfony/finder/tree/v5.2.9" }, "funding": [ { @@ -4505,7 +3890,7 @@ "type": "tidelift" } ], - "time": "2021-02-15T18:55:04+00:00" + "time": "2021-05-16T13:07:46+00:00" }, { "name": "symfony/options-resolver", @@ -5411,16 +4796,16 @@ }, { "name": "symfony/string", - "version": "v5.2.6", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572" + "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", - "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", + "url": "https://api.github.com/repos/symfony/string/zipball/01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db", + "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db", "shasum": "" }, "require": { @@ -5474,7 +4859,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.2.6" + "source": "https://github.com/symfony/string/tree/v5.2.8" }, "funding": [ { @@ -5490,7 +4875,7 @@ "type": "tidelift" } ], - "time": "2021-03-17T17:12:15+00:00" + "time": "2021-05-10T14:56:10+00:00" }, { "name": "theseer/tokenizer", diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 9de480ef4..12a0241d6 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -3,6 +3,7 @@ * @copyright Copyright (c) 2017 Vinzenz Rosenkranz * * @author Vinzenz Rosenkranz + * @author René Gieling * * @license GNU AGPL version 3 or any later version * @@ -47,6 +48,8 @@ public function boot(IBootContext $context): void { } public function register(IRegistrationContext $context): void { + include_once __DIR__ . '/../../vendor/autoload.php'; + $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); } diff --git a/lib/Db/Poll.php b/lib/Db/Poll.php index 5e2c30210..c394cb62d 100644 --- a/lib/Db/Poll.php +++ b/lib/Db/Poll.php @@ -159,6 +159,7 @@ class Poll extends Entity implements JsonSerializable { /** @var int $useNo*/ protected $useNo; + public function __construct() { $this->addType('created', 'int'); diff --git a/lib/Service/MailService.php b/lib/Service/MailService.php index cb38de45a..040bf8b54 100644 --- a/lib/Service/MailService.php +++ b/lib/Service/MailService.php @@ -42,6 +42,7 @@ use OCA\Polls\Db\Log; use OCA\Polls\Model\UserGroupClass; use OCA\Polls\Model\User; +use League\CommonMark\CommonMarkConverter; class MailService { @@ -314,9 +315,18 @@ private function generateInvitation(UserGroupClass $recipient, Poll $poll, strin [$owner->getDisplayName(), $poll->getTitle()], $this->trans->t('{owner} invited you to take part in the poll "{title}"') )); - $emailTemplate->addBodyText($poll->getDescription()); + + $config = [ + 'html_input' => 'strip', + 'allow_unsafe_links' => false, + ]; + + $converter = new CommonMarkConverter($config); + + $emailTemplate->addBodyText($converter->convertToHtml($poll->getDescription()), 'Hey'); + $emailTemplate->addBodyButton( - htmlspecialchars($this->trans->t('Go to poll')), + $this->trans->t('Go to poll'), $url ); $emailTemplate->addBodyText($this->trans->t('This link gives you personal access to the poll named above. Press the button above or copy the following link and add it in your browser\'s location bar:')); diff --git a/psalm.xml b/psalm.xml index dbd9a9276..5c3f25c2e 100644 --- a/psalm.xml +++ b/psalm.xml @@ -25,6 +25,9 @@ + + +