diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..942cf20 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,16 @@ +name: Tests + +on: + push: + branches: + - master + - 'modernize-*' + pull_request: + +jobs: + call-tests: + name: Extension tests + # Der Branch 3.3.x des Frameworks zielt auf phpBB 3.3.x (master zielt auf phpBB 4) + uses: phpbb-extensions/test-framework/.github/workflows/tests.yml@3.3.x + with: + EXTNAME: gn36/versionchecknotifier diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 69f53d4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ -language: php -sudo: required - -matrix: - include: - - php: 5.3.3 - env: DB=mysqli - - php: 5.3 - env: DB=mysqli # MyISAM - - php: 5.4 - env: DB=mysqli - - php: 5.4 - env: DB=mysql - - php: 5.4 - env: DB=mariadb - - php: 5.4 - env: DB=postgres - - php: 5.4 - env: DB=sqlite3 - - php: 5.5 - env: DB=mysqli - - php: 5.6 - env: DB=mysqli -# Uncomment to also check in phpBB 3.2.x -# - php: 5.6 -# env: -# - DB=mysqli -# - PHPBB_BRANCH="3.2.x" - - php: 7.0 - env: DB=mysqli - - php: hhvm - env: DB=mysqli - allow_failures: - - php: hhvm - - php: 7.0 - fast_finish: true - -env: - global: - - EXTNAME="gn36/versionchecknotifier" # CHANGE name of the extension HERE - - SNIFF="1" # Should we run code sniffer on your code? - - IMAGE_ICC="1" # Should we run icc profile sniffer on your images? - - EPV="1" # Should we run EPV (Extension Pre Validator) on your code? - - PHPBB_BRANCH="3.1.x" - -branches: - only: - - master - - develop - - /^dev\/.*$/ - -install: -# Hopefully we don't need any travis dependencies for the test in 5.3.3 - - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.3.3' ]; then composer install --dev --no-interaction --prefer-source; fi" - - chmod +x travis/prepare-phpbb.sh - - travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH - - sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.4' ] && [ '$DB' = 'mysqli' ]; then composer require phpbb/translation-validator:1.3.* --dev --no-interaction; fi" - - travis/prepare-langtest.sh $EXTNAME $PHPBB_BRANCH - - cd ../../phpBB3 - - travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH - - travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION - - sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.5' ] && [ '$DB' = 'mysqli' ]; then cd phpBB; composer require phpbb/epv:dev-master --dev --no-interaction; cd ../; fi" - -before_script: - - travis/setup-database.sh $DB $TRAVIS_PHP_VERSION - -script: - - sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi" - - sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; fi" -# - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/phpunit.xml.dist --bootstrap ./tests/bootstrap.php - - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php - - sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.5' ] && [ '$DB' = 'mysqli' ]; then phpBB/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ] && [ '$DB' = 'mysqli' ]; then ../langtest/travis/test-lang.sh; fi" diff --git a/README.md b/README.md index cc052ea..794ee9b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# phpBB 3.1 Extension - Version Check Notifier +# phpBB 3.3 Extension - Version Check Notifier This extension will check for new versions of all extensions (including this one) and phpBB periodically and notifies the administrators about any available updates found. This uses the regular phpBB version check mechanism, so no configuration is needed. Current features: @@ -6,7 +6,7 @@ Current features: * Check the version of all extensions and notify administrators of any updates * Check the version of phpBB and notify administrators of any updates -This extension is currently not compatible to phpBB 3.2. +Requires phpBB 3.3.x and PHP 7.2 or newer (including PHP 8). For phpBB 3.1 use version 1.0.x. ## Installation @@ -22,9 +22,7 @@ If you find a bug, please report it on https://github.com/gn36/phpbb-ext-version ## Automated Testing -We will use automated unit tests including functional tests to prevent regressions. This will be updated with our travis build once it is working: - -master: [![Build Status](https://travis-ci.org/gn36/phpbb-ext-versionchecknotifier.png?branch=master)](http://travis-ci.org/gn36/phpbb-ext-versionchecknotifier) +Tests run via GitHub Actions using the [phpbb-extensions test framework](https://github.com/phpbb-extensions/test-framework) (see `.github/workflows/tests.yml`). ## License diff --git a/build.xml b/build.xml deleted file mode 100644 index 999cc1c..0000000 --- a/build.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/composer.json b/composer.json index bcb4fff..46cc593 100644 --- a/composer.json +++ b/composer.json @@ -3,9 +3,9 @@ "type" : "phpbb-extension", "description" : "This extension checks for extension and phpBB updates periodically and notifies admins about updates.", "homepage" : "https://github.com/gn36/phpbb-ext-versionchecknotifier/", - "version" : "1.0.1", - "time" : "2015-01-03", - "license" : "GPL-2.0", + "version" : "2.0.0-dev", + "time" : "2026-10-18", + "license" : "GPL-2.0-only", "authors" : [{ "name" : "Martin Beckmann", "email" : "gn#36@phpbb.de", @@ -14,16 +14,12 @@ } ], "require" : { - "php" : ">=5.3.3" - }, - "require-dev" : { - "phpbb/epv" : "dev-master", - "phpbb/translation-validator" : ">=1.3" + "php" : "^7.2 || ^8.0" }, "extra" : { "display-name" : "gn36 - Version Check Notifier", "soft-require" : { - "phpbb/phpbb" : ">=3.1.2,<3.2@dev" + "phpbb/phpbb" : "^3.3.0" }, "version-check" : { "host" : "phpbb.gn36.de", diff --git a/composer.lock b/composer.lock deleted file mode 100644 index dbf91a4..0000000 --- a/composer.lock +++ /dev/null @@ -1,1627 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "ebffc7dc18e12acca7a9e961b3d5d6f3", - "packages": [], - "packages-dev": [ - { - "name": "battye/php-array-parser", - "version": "v1.0.9", - "source": { - "type": "git", - "url": "https://github.com/battye/php-array-parser.git", - "reference": "9927b2985b7b45d1e4ff516650850e8c14fa9f69" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/battye/php-array-parser/zipball/9927b2985b7b45d1e4ff516650850e8c14fa9f69", - "reference": "9927b2985b7b45d1e4ff516650850e8c14fa9f69", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "battye\\array_parser\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Parse text representation of a PHP array into an actual PHP array.", - "keywords": [ - "array", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/battye/php-array-parser/issues", - "source": "https://github.com/battye/php-array-parser/tree/v1.0.9" - }, - "time": "2021-02-07T04:54:20+00:00" - }, - { - "name": "composer/ca-bundle", - "version": "1.2.9", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/78a0e288fdcebf92aa2318a8d3656168da6ac1a5", - "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.9" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-01-12T12:10:35+00:00" - }, - { - "name": "composer/composer", - "version": "1.10.22", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "28c9dfbe2351635961f670773e8d7b17bc5eda25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/28c9dfbe2351635961f670773e8d7b17bc5eda25", - "reference": "28c9dfbe2351635961f670773e8d7b17bc5eda25", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.2", - "composer/xdebug-handler": "^1.1", - "justinrainbow/json-schema": "^5.2.10", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" - }, - "conflict": { - "symfony/console": "2.8.38" - }, - "require-dev": { - "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^4.2" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/1.10.22" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-04-27T11:10:45+00:00" - }, - { - "name": "composer/semver", - "version": "1.7.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/1.7.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-12-03T15:47:16+00:00" - }, - { - "name": "composer/spdx-licenses", - "version": "1.5.5", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "de30328a7af8680efdc03e396aad24befd513200" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", - "reference": "de30328a7af8680efdc03e396aad24befd513200", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-12-03T16:04:16+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.6", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-03-25T17:01:18+00:00" - }, - { - "name": "gitonomy/gitlib", - "version": "v0.1.8", - "source": { - "type": "git", - "url": "https://github.com/gitonomy/gitlib.git", - "reference": "f575b8f7da917ade7890c6aa705fa22545690389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/f575b8f7da917ade7890c6aa705fa22545690389", - "reference": "f575b8f7da917ade7890c6aa705fa22545690389", - "shasum": "" - }, - "require": { - "symfony/process": "^2.3|^3.0" - }, - "require-dev": { - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Add some log" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Gitonomy\\Git\\": "src/Gitonomy/Git/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alexandre Salomé", - "email": "alexandre.salome@gmail.com", - "homepage": "http://alexandre-salome.fr" - }, - { - "name": "Julien DIDIER", - "email": "genzo.wm@gmail.com", - "homepage": "http://www.jdidier.net" - } - ], - "description": "Library for accessing git", - "homepage": "http://gitonomy.com", - "support": { - "issues": "https://github.com/gitonomy/gitlib/issues", - "source": "https://github.com/gitonomy/gitlib/tree/master" - }, - "time": "2015-12-01T22:25:57+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "5.2.10", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/5.2.10" - }, - "time": "2020-05-27T16:41:55+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v3.1.5", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v3.1.5" - }, - "time": "2018-02-28T20:30:58+00:00" - }, - { - "name": "phpbb/epv", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/phpbb/epv.git", - "reference": "0d7023382431c265374a6ae1e6a6413c18538882" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbb/epv/zipball/0d7023382431c265374a6ae1e6a6413c18538882", - "reference": "0d7023382431c265374a6ae1e6a6413c18538882", - "shasum": "" - }, - "require": { - "composer/composer": "^1.5", - "gitonomy/gitlib": "0.1.*@dev", - "nikic/php-parser": "~3.0", - "php": ">=7.0", - "sensiolabs/ansi-to-html": "~1.1", - "symfony/console": "^3.0|^4.0|^5.0", - "symfony/finder": "^3.0|^4.0|^5.0", - "symfony/process": "^3.0|^4.0|^5.0", - "symfony/yaml": "^3.0|^4.0|^5.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.4", - "phpunit/phpunit-mock-objects": "~3.2" - }, - "default-branch": true, - "bin": [ - "src/EPV.php" - ], - "type": "library", - "autoload": { - "psr-4": { - "Phpbb\\Epv\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-only" - ], - "authors": [ - { - "name": "Paul Sohier", - "email": "paul@phpbb.com" - } - ], - "description": "A extension validator for phpBB extensions. Extensions are required to pass the validator when submitted to the extension database.", - "support": { - "issues": "https://github.com/phpbb/epv/issues", - "source": "https://github.com/phpbb/epv/tree/master" - }, - "time": "2020-11-14T16:00:44+00:00" - }, - { - "name": "phpbb/translation-validator", - "version": "1.5.3", - "source": { - "type": "git", - "url": "https://github.com/phpbb/phpbb-translation-validator.git", - "reference": "28caf76f9e9f7374e2ad2053dd0ddb25b12662a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbb/phpbb-translation-validator/zipball/28caf76f9e9f7374e2ad2053dd0ddb25b12662a0", - "reference": "28caf76f9e9f7374e2ad2053dd0ddb25b12662a0", - "shasum": "" - }, - "require": { - "battye/php-array-parser": "~1.0", - "php": ">=5.5.9", - "symfony/console": "~3.0", - "symfony/finder": "~3.0", - "symfony/yaml": "~3.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.7" - }, - "bin": [ - "translation.php" - ], - "type": "library", - "autoload": { - "classmap": [ - "src/", - "tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-only" - ], - "authors": [ - { - "name": "Joas Schilling", - "email": "nickvergessen@phpbb.com", - "homepage": "http://www.phpbb.com/", - "role": "Developer" - }, - { - "name": "Battye", - "email": "battye@phpbb.com", - "homepage": "https://www.phpbb.com", - "role": "Developer" - } - ], - "description": "A language package validator for phpBB language packs. Language packs are required to pass the validator when submitted to the language pack database.", - "homepage": "https://github.com/phpbb/phpbb-translation-validator", - "support": { - "issues": "https://github.com/phpbb/phpbb-translation-validator/issues", - "source": "https://github.com/phpbb/phpbb-translation-validator/tree/release-1.5.3" - }, - "time": "2020-11-10T19:57:39+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" - }, - "time": "2020-03-23T09:12:05+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.8.3", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", - "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "support": { - "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" - }, - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", - "type": "tidelift" - } - ], - "time": "2020-11-11T09:19:24+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", - "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phar" - ], - "support": { - "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/master" - }, - "time": "2020-07-07T18:42:57+00:00" - }, - { - "name": "sensiolabs/ansi-to-html", - "version": "v1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sensiolabs/ansi-to-html.git", - "reference": "94a3145aae4733ff933c8910263ef56d1ae317a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sensiolabs/ansi-to-html/zipball/94a3145aae4733ff933c8910263ef56d1ae317a9", - "reference": "94a3145aae4733ff933c8910263ef56d1ae317a9", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "conflict": { - "twig/twig": "< 2.4.0" - }, - "require-dev": { - "twig/twig": "^2.4 || ^3.0" - }, - "suggest": { - "twig/twig": "Provides nice templating features" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "SensioLabs\\AnsiConverter\\": "SensioLabs/AnsiConverter" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "A library to convert a text with ANSI codes to HTML", - "support": { - "issues": "https://github.com/sensiolabs/ansi-to-html/issues", - "source": "https://github.com/sensiolabs/ansi-to-html/tree/v1.2.1" - }, - "time": "2020-10-06T05:48:55+00:00" - }, - { - "name": "symfony/console", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a10b1da6fc93080c180bba7219b5ff5b7518fe81", - "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/console/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "symfony/debug", - "version": "v4.4.20", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "157bbec4fd773bae53c5483c50951a5530a2cc16" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/157bbec4fd773bae53c5483c50951a5530a2cc16", - "reference": "157bbec4fd773bae53c5483c50951a5530a2cc16", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/log": "~1.0", - "symfony/polyfill-php80": "^1.15" - }, - "conflict": { - "symfony/http-kernel": "<3.4" - }, - "require-dev": { - "symfony/http-kernel": "^3.4|^4.0|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides tools to ease debugging PHP code", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.20" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-28T16:54:48+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v5.2.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "8c86a82f51658188119e62cff0a050a12d09836f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8c86a82f51658188119e62cff0a050a12d09836f", - "reference": "8c86a82f51658188119e62cff0a050a12d09836f", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.2.6" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-03-28T14:30:26+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", - "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/finder/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-11-16T17:02:08+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", - "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", - "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-22T09:19:47+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "symfony/process", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b8648cf1d5af12a44a51d07ef9bf980921f15fca", - "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "phpbb/epv": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.3.3" - }, - "platform-dev": [], - "plugin-api-version": "2.0.0" -} diff --git a/config/routing.yml b/config/routing.yml index 48b9f44..00c5cf8 100644 --- a/config/routing.yml +++ b/config/routing.yml @@ -1,4 +1,4 @@ # There is only one route gn36_versionchecknotifier_controller_redirector: - pattern: /versionchecknotifier/redirect/{notify_id} + path: /versionchecknotifier/redirect/{notify_id} defaults: { _controller: "gn36.versionchecknotifier.controller.redirector:handle", notify_id: 0 } diff --git a/config/services.yml b/config/services.yml index 2121f4c..4efbfef 100644 --- a/config/services.yml +++ b/config/services.yml @@ -13,7 +13,7 @@ services: arguments: - '@user' - '@notification_manager' - + # Events -------------------------------------- gn36.versionchecknotifier.events.global_events: class: gn36\versionchecknotifier\event\global_events @@ -40,35 +40,20 @@ services: # Notifications -------------------------------------- gn36.versionchecknotifier.notification.type.ext_update: class: gn36\versionchecknotifier\notification\ext_update - scope: prototype - arguments: - - '@user_loader' - - '@dbal.conn' - - '@cache.driver' - - '@user' - - '@auth' - - '@config' - - '%core.root_path%' - - '%core.php_ext%' - - '%tables.notification_types%' - - '%tables.notifications%' - - '%tables.user_notifications%' + shared: false + parent: notification.type.base + calls: + - [set_config, ['@config']] + - [set_user_loader, ['@user_loader']] tags: - { name: notification.type } + gn36.versionchecknotifier.notification.type.phpbb_update: class: gn36\versionchecknotifier\notification\phpbb_update - scope: prototype - arguments: - - '@user_loader' - - '@dbal.conn' - - '@cache.driver' - - '@user' - - '@auth' - - '@config' - - '%core.root_path%' - - '%core.php_ext%' - - '%tables.notification_types%' - - '%tables.notifications%' - - '%tables.user_notifications%' + shared: false + parent: notification.type.base + calls: + - [set_config, ['@config']] + - [set_user_loader, ['@user_loader']] tags: - - { name: notification.type } \ No newline at end of file + - { name: notification.type } diff --git a/controller/redirector.php b/controller/redirector.php index ee1cd84..43a81ef 100644 --- a/controller/redirector.php +++ b/controller/redirector.php @@ -35,7 +35,7 @@ public function handle($notify_id = 0) login_box(); } - $notifications = $this->manager->load_notifications(array('notification_id' => intval($notify_id))); + $notifications = $this->manager->load_notifications('notification.method.board', array('notification_id' => intval($notify_id))); if (!isset($notifications['notifications'][$notify_id])) { diff --git a/develop/check.sh b/develop/check.sh new file mode 100755 index 0000000..b345656 --- /dev/null +++ b/develop/check.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Führt lokal dieselben Prüfungen wie das CI (phpbb-extensions/test-framework@3.3.x) aus: +# Code Sniffer, Executable-Check, ICC-Profile, EPV und die Unit-Tests (SQLite). +# Nutzung: develop/check.sh +set -e +EXTNAME=gn36/versionchecknotifier +EXT="$(cd "$(dirname "$0")/.." && pwd)" +CORE="${PHPBB_DIR:-/opt/phpbb-core}" +DEST="$CORE/phpBB/ext/$EXTNAME" +rm -rf "$DEST" && mkdir -p "$DEST" +cp -a "$EXT/." "$DEST/" && rm -rf "$DEST/.git" +cd "$CORE" + +echo "== Code Sniffer" +phpBB/vendor/bin/phpcs -s --extensions=php --standard=build/code_sniffer/ruleset-php-extensions.xml \ + --ignore=*/"$EXTNAME"/tests/*,*/"$EXTNAME"/vendor/* phpBB/ext/"$EXTNAME" + +echo "== Executable files" +.github/ext-check-executable-files.sh ./ "$EXTNAME" + +echo "== ICC profiles" +for f in $(find "phpBB/ext/$EXTNAME" -type f -iregex '.*\.\(gif\|jpg\|jpeg\|png\)$' -not -wholename '*vendor/*'); do + phpBB/develop/strip_icc_profiles.sh "$f" +done + +echo "== EPV (nur Fatal führt zum Fehlschlag)" +phpBB/vendor/bin/EPV.php run --dir="phpBB/ext/$EXTNAME/" + +echo "== Unit tests" +"$EXT/develop/run-tests.sh" diff --git a/develop/cloud-setup.sh b/develop/cloud-setup.sh new file mode 100755 index 0000000..74fa164 --- /dev/null +++ b/develop/cloud-setup.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Setup-Script für eine Claude-Cloud-Umgebung zum Testen von phpBB-3.3-Erweiterungen. +# Installiert (möglichst versionsunabhängig): MariaDB, PHP-Erweiterungen, phpBB 3.3.x inkl. PHPUnit 9. +# Spiegelt die Schritte von phpbb-extensions/test-framework@3.3.x (Sniffer, EPV, Tests). +# Wird bei Umgebungen mit Setup-Script einmal ausgeführt und im Ergebnis zwischengespeichert. +set -euo pipefail + +PHPBB_BRANCH="${PHPBB_BRANCH:-3.3.x}" +PHPBB_DIR="${PHPBB_DIR:-/opt/phpbb-core}" + +export DEBIAN_FRONTEND=noninteractive +apt-get update -qq +# php-cli ist im Basis-Image meist vorhanden; die Pakete ohne Versionsnummer nehmen die Standard-PHP-Version der Distribution. +apt-get install -y -qq git unzip rsync mariadb-server imagemagick parallel \ + php-cli php-mbstring php-xml php-zip php-gd php-curl php-intl php-mysql php-sqlite3 php-pgsql + +# Datenbank für die phpBB-Tests (MariaDB); SQLite geht auch ohne Server. +service mariadb start || service mysql start || true +for i in $(seq 1 20); do mysqladmin ping --silent && break; sleep 1; done +mysql -e "CREATE DATABASE IF NOT EXISTS phpbb_tests CHARACTER SET utf8mb4; + CREATE USER IF NOT EXISTS 'phpbb'@'localhost' IDENTIFIED BY 'phpbb'; + GRANT ALL ON phpbb_tests.* TO 'phpbb'@'localhost';" + +# phpBB-Quellcode (aktueller Stand des 3.3-Branches) +if [ ! -d "$PHPBB_DIR/.git" ]; then + git clone --depth 1 -b "$PHPBB_BRANCH" https://github.com/phpbb/phpbb "$PHPBB_DIR" +fi +cd "$PHPBB_DIR/phpBB" +composer install --no-interaction --no-progress +# Wie phpBBs eigenes CI unter PHP 8: PHPUnit 9 statt 7 +composer remove phpunit/dbunit --dev --update-with-dependencies --no-interaction +composer require symfony/yaml:^4.4 misantron/dbunit:5.2.1 phpunit/phpunit:^9.3 doctrine/instantiator:^1.4 \ + --dev --update-with-all-dependencies --ignore-platform-reqs --no-interaction +# Extension Pre Validator (wie im CI des test-framework, Branch 3.3.x) +composer require phpbb/epv:dev-master --dev --no-interaction --ignore-platform-reqs --with-all-dependencies diff --git a/develop/run-ci-tests.sh b/develop/run-ci-tests.sh new file mode 100755 index 0000000..af9e003 --- /dev/null +++ b/develop/run-ci-tests.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Führt die Tests exakt so aus wie das CI (phpBB-Konfiguration phpunit-mysql-github.xml, inkl. funktionaler Tests). +# Voraussetzung: laufender MariaDB-Server (root ohne Passwort) und ein Webserver auf http://localhost/ mit phpBB/ als Root: +# service mariadb start; (cd $PHPBB_DIR && nohup php -S 127.0.0.1:80 -t phpBB >/tmp/php-server.log 2>&1 &) +set -e +EXTNAME=gn36/versionchecknotifier +EXT="$(cd "$(dirname "$0")/.." && pwd)" +CORE="${PHPBB_DIR:-/opt/phpbb-core}" +DEST="$CORE/phpBB/ext/$EXTNAME" +rm -rf "$DEST" && mkdir -p "$DEST/.github" +cp -a "$EXT/." "$DEST/" && rm -rf "$DEST/.git" +cd "$CORE" +sed 's#value="0.0.0.0"#value="127.0.0.1"#' .github/phpunit-mysql-github.xml > "$DEST/.github/phpunit-mysql-github.xml" +php -d error_reporting=24575 phpBB/vendor/bin/phpunit \ + --configuration "phpBB/ext/$EXTNAME/.github/phpunit-mysql-github.xml" --bootstrap ./tests/bootstrap.php "$@" diff --git a/develop/run-tests.sh b/develop/run-tests.sh new file mode 100755 index 0000000..b2927c5 --- /dev/null +++ b/develop/run-tests.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Führt die Extension-Tests gegen den phpBB-Checkout aus (SQLite, ohne DB-Server). +# Nutzung: develop/run-tests.sh [phpunit-Argumente] +set -e +EXT="$(cd "$(dirname "$0")/.." && pwd)" +CORE="${PHPBB_DIR:-/opt/phpbb-core}" +DEST="$CORE/phpBB/ext/gn36/versionchecknotifier" +rm -rf "$DEST" && mkdir -p "$DEST" +cp -a "$EXT/." "$DEST/" && rm -rf "$DEST/.git" +cd "$CORE" +export PHPBB_TEST_DBMS=sqlite3 PHPBB_TEST_DBHOST=/tmp/phpbb_test.sqlite +php -d error_reporting=24575 phpBB/vendor/bin/phpunit \ + --configuration phpBB/ext/gn36/versionchecknotifier/phpunit.xml.dist \ + "${@:---testsuite=Extension Test Suite}" diff --git a/event/global_events.php b/event/global_events.php index 0f4a06f..ad5a6eb 100644 --- a/event/global_events.php +++ b/event/global_events.php @@ -45,11 +45,11 @@ public function notification_add($event) $notifications_data = array( array( - 'item_type' => 'gn36.versionchecknotify.notification.type.ext_update', + 'item_type' => 'gn36.versionchecknotifier.notification.type.ext_update', 'method' => 'notification.method.email', ), array( - 'item_type' => 'gn36.versionchecknotify.notification.type.phpbb_update', + 'item_type' => 'gn36.versionchecknotifier.notification.type.phpbb_update', 'method' => 'notification.method.email', ), ); diff --git a/ext.php b/ext.php index 971ab4b..05092b8 100644 --- a/ext.php +++ b/ext.php @@ -38,7 +38,7 @@ protected function extra_dependencies() */ protected function split_version_info($string) { - $pattern = '#(>=|>|gt(?:;=?)?|ge|==?|eq|!=|<>|ne|<=|<|le|lt(?:;=?)?(?:gt;)?)([0-9._*-PLAHBETRCDV]+?)(?:$|,)#is'; + $pattern = '#(>=|>|gt(?:;=?)?|ge|==?|eq|!=|<>|ne|<=|<|le|lt(?:;=?)?(?:gt;)?)([0-9._*\-PLAHBETRCDV]+?)(?:$|,)#is'; $matches = null; preg_match_all($pattern, $string, $matches); @@ -76,9 +76,9 @@ function is_enableable() $require = array(); } - if (isset($meta['extra']['soft_require'])) + if (isset($meta['extra']['soft-require'])) { - $require = array_merge($require, $meta['extra']['soft_require']); + $require = array_merge($require, $meta['extra']['soft-require']); } $require = array_merge($require, $this->extra_dependencies()); diff --git a/notification/base.php b/notification/base.php index 2c313a6..908e00c 100644 --- a/notification/base.php +++ b/notification/base.php @@ -19,11 +19,27 @@ class base extends \phpbb\notification\type\base // The permission to check to find users / send message protected $permission = 'a_this_is_a_nonexistent_permission'; + /** @var \phpbb\config\config */ + protected $config; + + /** @var \phpbb\user_loader */ + protected $user_loader; + public static $notification_option = array( 'lang' => 'VERSIONCHECKNOTIFY_NOTIFY_OPTION', 'group' => 'NOTIFICATION_GROUP_MISCELLANEOUS', ); + public function set_config(\phpbb\config\config $config) + { + $this->config = $config; + } + + public function set_user_loader(\phpbb\user_loader $user_loader) + { + $this->user_loader = $user_loader; + } + public function get_type() { return 'gn36.versionchecknotifier.notification.type.base'; @@ -35,36 +51,36 @@ public function is_available() } /** - * calculate decimal from hex - * @param string $val hex value + * Calculate a hex string modulo a number without needing bcmath or 64 bit integers + * @param string $hex hex value + * @param int $modulus + * @return int */ - protected static function bchex2dec($val) + protected static function hexmod($hex, $modulus) { - if (strlen($val) == 1) + $result = 0; + foreach (str_split($hex) as $digit) { - return hexdec($val); + $result = ($result * 16 + hexdec($digit)) % $modulus; } - $head = substr($val, 0, -1); - $tail = substr($val, -1); - return bcadd(bcmul(16, self::bchex2dec($head)), hexdec($tail)); + return $result; } public static function get_item_id($notification_data) { //TODO: This is rather expensive calculation wise just to get the version in. Maybe rework cron to provide better data? // String -> unique numeric id is never really pleasant - $notification_data = base::extract_version_info($notification_data); + $notification_data = static::extract_version_info($notification_data); $version = $notification_data['version']; $id = substr(md5($notification_data['name'] . $version), 0, 16); - return intval(bcmod(self::bchex2dec($id), 10000000-1)); - + return self::hexmod($id, 10000000 - 1); } public static function get_item_parent_id($notification_data) { // Parent of an extension version is the extension itself: $id = substr(md5($notification_data['name']), 0, 16); - return intval(bcmod(self::bchex2dec($id), 10000000-1)); + return self::hexmod($id, 10000000 - 1); } public function find_users_for_notification($notification_data, $options = array()) @@ -103,9 +119,9 @@ public function get_avatar() if ($this->get_data('security')) { - return "{$this->user->lang("; + return "{$this->language->lang("; } - return "{$this->user->lang("; + return "{$this->language->lang("; } public function get_title() @@ -114,7 +130,7 @@ public function get_title() $version = $this->get_data('version'); $security = $this->get_data('security'); - return $this->user->lang($security ? $this->language_key_sec : $this->language_key, $ext_name, $version); + return $this->language->lang($security ? $this->language_key_sec : $this->language_key, $ext_name, $version); } public function get_reason() @@ -126,10 +142,10 @@ public function get_reason() if ($dl) { - return $this->user->lang('REASON_UPDATE_DL', $ext_name, $version, $old_version, $dl); + return $this->language->lang('REASON_UPDATE_DL', $ext_name, $version, $old_version, $dl); } - return $this->user->lang('REASON_UPDATE', $ext_name, $version, $old_version); + return $this->language->lang('REASON_UPDATE', $ext_name, $version, $old_version); } function users_to_query() @@ -173,19 +189,19 @@ public function get_email_template() public function get_email_template_variables() { - $this->user->add_lang_ext('gn36/versionchecknotifier', 'mailing'); + $this->language->add_lang('mailing', 'gn36/versionchecknotifier'); // TODO: EMAIL_SIG return array( 'EXTENSION' => $this->get_data('name'), 'NAME' => $this->get_data('name'), - 'VERSION' => $this->get_data('version') ? $this->get_data('version') : $this->user->lang('NOT_AVAILABLE'), - 'OLD_VERSION' => $this->get_data('old_version') ? $this->get_data('old_version') : $this->user->lang('NOT_AVAILABLE'), + 'VERSION' => $this->get_data('version') ? $this->get_data('version') : $this->language->lang('NOT_AVAILABLE'), + 'OLD_VERSION' => $this->get_data('old_version') ? $this->get_data('old_version') : $this->language->lang('NOT_AVAILABLE'), 'SITENAME' => $this->config['sitename'], - 'SECURITY' => $this->get_data('security') ? $this->user->lang('IS_SECURITY_UPDATE') : '', + 'SECURITY' => $this->get_data('security') ? $this->language->lang('IS_SECURITY_UPDATE') : '', 'U_INDEX' => generate_board_url() . "/index.{$this->php_ext}", - 'DOWNLOAD' => $this->get_data('download_url') ? str_replace('&', '&', $this->get_data('download_url')) : $this->user->lang('NOT_AVAILABLE'), - 'ANNOUNCEMENT' => $this->get_data('announcement_url') ? str_replace('&', '&', $this->get_data('announcement_url')) : $this->user->lang('NOT_AVAILABLE'), - 'ADD_INFO' => $this->get_data('text') ? $this->user->lang('ADDITIONAL_INFO', $this->get_data('text')) : '', + 'DOWNLOAD' => $this->get_data('download_url') ? str_replace('&', '&', $this->get_data('download_url')) : $this->language->lang('NOT_AVAILABLE'), + 'ANNOUNCEMENT' => $this->get_data('announcement_url') ? str_replace('&', '&', $this->get_data('announcement_url')) : $this->language->lang('NOT_AVAILABLE'), + 'ADD_INFO' => $this->get_data('text') ? $this->language->lang('ADDITIONAL_INFO', $this->get_data('text')) : '', //TODO: How to actually personalize this? ); } @@ -310,57 +326,4 @@ public function create_insert_array($notification_data, $pre_create_data = array return parent::create_insert_array($notification_data, $pre_create_data); } - - /** - * Update a notification - * - * @param array $notification_data Data specific for this type that will be updated - */ - public function update_notifications($notification_data) - { - $notification_data = $this->extract_version_info($notification_data); - - $old_notifications = array(); - $sql = 'SELECT n.user_id - FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt - WHERE n.notification_type_id = ' . (int) $this->notification_type_id . ' - AND n.item_id = ' . static::get_item_id($notification_data) . ' - AND nt.notification_type_id = n.notification_type_id - AND nt.notification_type_enabled = 1'; - $result = $this->db->sql_query($sql); - while ($row = $this->db->sql_fetchrow($result)) - { - $old_notifications[] = $row['user_id']; - } - $this->db->sql_freeresult($result); - - // Find the new users to notify - $notifications = $this->find_users_for_notification($notification_data); - - // Find the notifications we must delete - $remove_notifications = array_diff($old_notifications, array_keys($notifications)); - - // Find the notifications we must add - $add_notifications = array(); - foreach (array_diff(array_keys($notifications), $old_notifications) as $user_id) - { - $add_notifications[$user_id] = $notifications[$user_id]; - } - - // Add the necessary notifications - $this->notification_manager->add_notifications_for_users($this->get_type(), $notification_data, $add_notifications); - - // Remove the necessary notifications - if (!empty($remove_notifications)) - { - $sql = 'DELETE FROM ' . $this->notifications_table . ' - WHERE notification_type_id = ' . (int) $this->notification_type_id . ' - AND item_id = ' . static::get_item_id($notification_data) . ' - AND ' . $this->db->sql_in_set('user_id', $remove_notifications); - $this->db->sql_query($sql); - } - - // return true to continue with the update code in the notifications service (this will update the rest of the notifications) - return true; - } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ff6f4fc..3e8e6a5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,16 +1,14 @@ - @@ -19,21 +17,18 @@ ./tests/functional - ./tests/functional/ + ./tests/functional/ - - - ./tests/ - - + + ./ - - ./language/ - ./migrations/ - ./tests/ - - - + + + ./language/ + ./migrations/ + ./tests/ + + diff --git a/tests/controller/function_mocks.php b/tests/controller/function_mocks.php index c8db990..d6975dc 100644 --- a/tests/controller/function_mocks.php +++ b/tests/controller/function_mocks.php @@ -36,9 +36,9 @@ function redirect($url, $return = false, $insecure = false, \phpbb_test_case $te // Check datatypes if ($test_obj_save !== null) { - $test_obj_save->assertInternalType('string', $url); - $test_obj_save->assertInternalType('bool', $return); - $test_obj_save->assertInternalType('bool', $insecure); + $test_obj_save->assertIsString($url); + $test_obj_save->assertIsBool($return); + $test_obj_save->assertIsBool($insecure); } else { diff --git a/tests/controller/redirector_test.php b/tests/controller/redirector_test.php index 5bd240e..3eee4c5 100644 --- a/tests/controller/redirector_test.php +++ b/tests/controller/redirector_test.php @@ -62,7 +62,7 @@ public function test_redirect() private function get_instance($get_url_count = 0, $registered = true) { - $user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime')); + $user = $this->getMockBuilder('\phpbb\user')->disableOriginalConstructor()->getMock(); $user->ip = ''; $user->data = array( 'user_id' => 2, @@ -91,10 +91,13 @@ private function get_instance($get_url_count = 0, $registered = true) $manager->expects($this->any()) ->method('load_notifications') - ->will($this->returnValueMap(array( - array(array('notification_id' => 12345), array('notifications' => array(12345 => $notification))), - array($this->anything(), array('notifications' => array())) - ))); + ->will($this->returnCallback(function ($method, array $options = array()) use ($notification) { + if (isset($options['notification_id']) && $options['notification_id'] === 12345) + { + return array('notifications' => array(12345 => $notification)); + } + return array('notifications' => array()); + })); return new \gn36\versionchecknotifier\controller\redirector($user, $manager); } } diff --git a/tests/cron/main_test.php b/tests/cron/main_test.php index 39e9d13..57159ef 100644 --- a/tests/cron/main_test.php +++ b/tests/cron/main_test.php @@ -21,7 +21,7 @@ public function getDataSet() return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/dataset.xml'); } - public function setUp() + public function setUp(): void { parent::setUp(); @@ -34,7 +34,7 @@ public function setUp() public function runProvider() { return array( - 'none' => array(array(), array(), $this->never(), array($this->equalTo(array()))), + 'none' => array(array(), array(), $this->never(), array(array($this->equalTo(array())))), 'phpbb' => array( array(), array('phpbb' => array('new' => '2', 'current' => '1')), @@ -167,7 +167,7 @@ private function get_task($last_run = 0, $ext_versions = array(), $phpbb_version } else { - $call->withConsecutive($expected_notification_data); + $call->withConsecutive(array($expected_notification_data, $this->anything())); } return new \gn36\versionchecknotifier\cron\versionchecknotifier($this->cache, $this->config, $db, $this->log, $manager, $helper); diff --git a/tests/functional/install_test.php b/tests/functional/install_test.php index decd5b9..52fdeb9 100644 --- a/tests/functional/install_test.php +++ b/tests/functional/install_test.php @@ -8,7 +8,7 @@ * */ -namespace gn36\hookup\tests\functional; +namespace gn36\versionchecknotifier\tests\functional; /** * @group functional @@ -24,7 +24,7 @@ public function test_validate_posting() { // Check whether we can still call posting.php in edit mode (even though login prevents any useful use) $crawler = self::request('GET', 'posting.php?mode=edit&f=2&p=1'); - $this->assertContains('Username', $crawler->filter('dt')->text()); + $this->assertStringContainsString('Username', $crawler->filter('dt')->text()); } public function test_validate_ucp_settings() @@ -36,8 +36,8 @@ public function test_validate_ucp_settings() $this->login(); $crawler = self::request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options'); - $this->assertContains('A new version of an extension is available', implode(' ', $crawler->filter('td')->each($each_closure))); - $this->assertContains('A new phpBB version is available', implode(' ', $crawler->filter('td')->each($each_closure))); + $this->assertStringContainsString('A new version of an extension is available', implode(' ', $crawler->filter('td')->each($each_closure))); + $this->assertStringContainsString('A new phpBB version is available', implode(' ', $crawler->filter('td')->each($each_closure))); } @@ -45,6 +45,6 @@ public function test_validate_viewtopic() { // Check whether we can still call viewtopic.php without errors $crawler = self::request('GET', 'viewtopic.php?f=2&p=1'); - $this->assertContains('Welcome', $crawler->filter('h2')->text()); + $this->assertStringContainsString('Welcome', $crawler->filter('h2')->text()); } } diff --git a/tests/functional/redirector_test.php b/tests/functional/redirector_test.php index dcffe3b..9ee185d 100644 --- a/tests/functional/redirector_test.php +++ b/tests/functional/redirector_test.php @@ -31,10 +31,10 @@ public function test_call_redirect_errors() $this->add_lang_ext('gn36/versionchecknotifier', 'global'); $crawler = self::request('GET', 'app.php/versionchecknotifier/redirect/0?sid=' . $this->sid); - $this->assertContains($this->lang('INVALID_NOTIFICATION_ID_REDIRECT'), implode(' ', $crawler->filter('p')->each($each_closure))); + $this->assertStringContainsString($this->lang('INVALID_NOTIFICATION_ID_REDIRECT'), implode(' ', $crawler->filter('p')->each($each_closure))); $crawler = self::request('GET', 'app.php/versionchecknotifier/redirect/1?sid=' . $this->sid); - $this->assertContains($this->lang('INVALID_NOTIFICATION_ID_REDIRECT'), implode(' ', $crawler->filter('p')->each($each_closure))); + $this->assertStringContainsString($this->lang('INVALID_NOTIFICATION_ID_REDIRECT'), implode(' ', $crawler->filter('p')->each($each_closure))); } public function test_call_redirect_working() @@ -100,8 +100,8 @@ public function test_call_redirect_working() // Now check redirect $crawler = self::request('GET', 'app.php/versionchecknotifier/redirect/' . $last_id . '?sid=' . $this->sid); - $this->assertNotContains($this->lang('INVALID_NOTIFICATION_ID_REDIRECT'), implode(' ', $crawler->filter('p')->each($each_closure))); - $this->assertContains('example post', implode(' ', $crawler->filter('.content')->each($each_closure))); + $this->assertStringNotContainsString($this->lang('INVALID_NOTIFICATION_ID_REDIRECT'), implode(' ', $crawler->filter('p')->each($each_closure))); + $this->assertStringContainsString('example post', implode(' ', $crawler->filter('.content')->each($each_closure))); } public function test_redirect_login() @@ -114,7 +114,7 @@ public function test_redirect_login() $this->add_lang_ext('gn36/versionchecknotifier', 'global'); $crawler = self::request('GET', 'app.php/versionchecknotifier/redirect/1?sid=' . $this->sid); - $this->assertNotContains($this->lang('INVALID_NOTIFICATION_ID_REDIRECT'), implode(' ', $crawler->filter('p')->each($each_closure))); - $this->assertContains($this->lang('LOGIN'), implode(' ', $crawler->filter('.content')->each($each_closure))); + $this->assertStringNotContainsString($this->lang('INVALID_NOTIFICATION_ID_REDIRECT'), implode(' ', $crawler->filter('p')->each($each_closure))); + $this->assertStringContainsString($this->lang('LOGIN'), implode(' ', $crawler->filter('.content')->each($each_closure))); } } diff --git a/tests/notification/base.php b/tests/notification/base.php index 394c88b..dadaa85 100644 --- a/tests/notification/base.php +++ b/tests/notification/base.php @@ -13,7 +13,7 @@ abstract class base extends \phpbb_database_test_case { - protected $notifications, $db, $container, $user, $config, $auth, $cache; + protected $notifications, $language, $db, $container, $user, $config, $auth, $cache; protected function get_notification_types() { @@ -28,7 +28,7 @@ static protected function setup_extensions() return array('gn36/versionchecknotifier'); } - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -38,21 +38,26 @@ protected function setUp() $db = $this->db = $this->new_dbal(); $config = $this->config = new \phpbb\config\config(array( - //TODO + 'allow_board_notifications' => true, )); - $user = $this->user = new \phpbb\user('\phpbb\datetime'); + $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); + $this->language = new \phpbb\language\language($lang_loader); + $user = $this->user = new \phpbb\user($this->language, '\phpbb\datetime'); + $user->data['user_id'] = 0; + $user->data['user_type'] = USER_NORMAL; $this->user_loader = new \phpbb\user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users'); $auth = $this->auth = new \phpbb_mock_notifications_auth(); + $this->phpbb_dispatcher = new \phpbb_mock_event_dispatcher(); + $cache_driver = new \phpbb\cache\driver\dummy(); $cache = $this->cache = new \phpbb\cache\service( - new \phpbb\cache\driver\null(), + $cache_driver, $this->config, $this->db, + $this->phpbb_dispatcher, $phpbb_root_path, $phpEx ); - $this->phpbb_dispatcher = new \phpbb_mock_event_dispatcher(); - $phpbb_container = $this->container = new \phpbb_mock_container_builder(); $this->notifications = new \phpbb_notification_manager_helper( @@ -60,15 +65,12 @@ protected function setUp() array(), $this->container, $this->user_loader, - $this->config, $this->phpbb_dispatcher, $this->db, $this->cache, + $this->language, $this->user, - $phpbb_root_path, - $phpEx, 'phpbb_notification_types', - 'phpbb_notifications', 'phpbb_user_notifications' ); @@ -80,7 +82,7 @@ protected function setUp() foreach ($this->get_notification_types() as $type) { $type_parts = explode('.', $type); - $class = $this->build_type('\gn36\versionchecknotifier\notification\\' . array_pop($type_parts)); + $class = $this->build_type('\\gn36\\versionchecknotifier\\notification\\' . array_pop($type_parts)); $types[$type] = $class; $this->container->set($type, $class); @@ -97,6 +99,11 @@ protected function build_type($type) { global $phpbb_root_path, $phpEx; - return new $type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $phpbb_root_path, $phpEx, 'phpbb_notification_types', 'phpbb_notifications', 'phpbb_user_notifications'); + /** @var \gn36\versionchecknotifier\notification\base $instance */ + $instance = new $type($this->db, $this->language, $this->user, $this->auth, $phpbb_root_path, $phpEx, 'phpbb_user_notifications'); + $instance->set_config($this->config); + $instance->set_user_loader($this->user_loader); + + return $instance; } } diff --git a/travis/local_tools/full_test.sh b/travis/local_tools/full_test.sh deleted file mode 100644 index 6993759..0000000 --- a/travis/local_tools/full_test.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# Environment: -#EXTNAME="phpbbde/pastebin" # CHANGE name of the extension HERE -EXTNAME="gn36/hookup" # CHANGE name of the extension HERE -#EXTBRANCH="dev/translation-validator" # Branch to test -EXTBRANCH="dev/tests" # Branch to test -SNIFF="1" # Should we run code sniffer on your code? -IMAGE_ICC="1" # Should we run icc profile sniffer on your images? -EPV="1" # Should we run EPV (Extension Pre Validator) on your code? -LANG_TEST="0" -PHPBB_BRANCH="3.1.x" - -DB=mysqli -TRAVIS_PHP_VERSION=5.5.9 - -# Go into testdir and copy the extension: -EXTDIR=${EXTNAME%/*} -if [ ! -e testdir ]; then - mkdir testdir -fi -cd testdir -if [ -e $EXTDIR ]; then - rm -rf $EXTDIR -fi -mkdir $EXTDIR -cp -r ../../extensions/$EXTNAME $EXTDIR -#git clone --depth=1 ../../extensions/$EXTNAME $EXTNAME --branch=$EXTBRANCH -cd $EXTNAME - -# Install -#php composer.phar install --dev --no-interaction --prefer-source -php composer.phar install --no-interaction -if [ ! -e ../../phpBB3 ]; then - chmod +x travis/prepare-phpbb.sh - travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH - if [ "$LANG_TEST" != '0' ]; then - travis/prepare-langtest.sh $EXTNAME $PHPBB_BRANCH - fi - cd ../../phpBB3 -else - if [ "$LANG_TEST" != '0' ]; then - travis/prepare-langtest.sh $EXTNAME $PHPBB_BRANCH - fi - if [ ! -e ../../tmp ]; then - # This is from prepare-phpbb.sh - mkdir ../../tmp - cp -R . ../../tmp - fi - cd ../../phpBB3 - git pull origin -fi - -travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH -travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION -travis/install-phpbb-test-dependencies.sh -cd phpBB -#php ../composer.phar install --dev --no-interaction --prefer-source -php ../composer.phar install --no-interaction -cd .. - -# Preparation: -travis/setup-database.sh $DB $TRAVIS_PHP_VERSION - -# Functional tests: -if [ -e ../../../test_config.php ]; then - cp ../../../test_config.php ../tests/ -fi - -# script: -sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi" -sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; fi" -#php phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php -php phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/phpunit.xml.dist --bootstrap ./tests/bootstrap.php -sh -c "if [ '$EPV' != '0' ] && [ '$DB' = 'mysqli' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi" -sh -c "if [ '$LANG_TEST' != '0' ]; then ../langtest/travis/test-lang.sh; fi" diff --git a/travis/local_tools/phpunittest.sh b/travis/local_tools/phpunittest.sh deleted file mode 100644 index 1314465..0000000 --- a/travis/local_tools/phpunittest.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -# This script assumes a working test setup in testdir (e.g. setup by one of the other scripts) -# It also assumes the extensions to be tested to be located in ../extensions/vendor/name (relative to this script) -# Please make sure this is correct, otherwise testing won't work -# For db and functional tests, the test_config.php is required to be in the same folder. -# -# (c) 2016 - Martin Beckmann -# License: GPL v2 -# - -# Environment: -export EXTNAME="gn36/hookup" # Name of extension - -# Copy the current version of the ext for testing: -EXTDIR=${EXTNAME%/*} -if [ ! -e testdir ]; then - mkdir testdir -fi -cd testdir/phpBB3/phpBB/ext/ -if [ -e $EXTDIR ]; then - rm -rf $EXTDIR 2>/dev/null -fi -mkdir $EXTDIR -#cp -r ../../../../../extensions/$EXTNAME $EXTDIR -cp -r ../../../../../phpbb/phpBB/ext/$EXTNAME $EXTDIR - -#cp -r ../../../../../extensions/$EXTNAME/event $EXTNAME -cp -r ../../../../../phpbb/phpBB/ext/$EXTNAME/event $EXTNAME - -cd ../../ -pwd - -# Functional and database tests require test_config, make sure it's there: -if [ -e ../../test_config.php ]; then - cp ../../test_config.php tests/ -fi - -# Use installed phpunit version (may be fairly old) -#phpunit -c phpBB/ext/$EXTNAME/phpunit.xml.dist |sed "s/\[^[[0-9;]*[a-zA-Z]//gi" -#phpunit -c phpBB/ext/$EXTNAME/travis/phpunit-mysqli-travis.xml - -# Use phpBB dependency phpunit: -phpBB/vendor/bin/phpunit -c phpBB/ext/$EXTNAME/phpunit.xml.dist diff --git a/travis/local_tools/smart_full_test.sh b/travis/local_tools/smart_full_test.sh deleted file mode 100644 index 509fdd5..0000000 --- a/travis/local_tools/smart_full_test.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash -# -# Performs a full travis-like test on the extension. -# Please adjust settings to ensure that this works. -# -# This crude script assumes the following setup: -# / -# extensions/ -# gn36/hookup/ -# test/ -# testdir/ (will be created automatically) -# smart_full_test.sh -# phpunittest.sh -# full_test.sh -# test_config.php (optional) -# -# Testing done by this script is very similar to travis testing. -# The script was created based upon a travis configuration. -# This leads to some weird constructions of folders sometimes. -# -# (c) 2016 - Martin Beckmann -# License: GPL v2 -# - -# Environment: -EXTNAME="gn36/hookup" # CHANGE name of the extension HERE -EXTBRANCH="dev/tests" # Branch to test (not used) -SNIFF="1" # Should we run code sniffer on your code? -IMAGE_ICC="1" # Should we run icc profile sniffer on your images? -EPV="1" # Should we run EPV (Extension Pre Validator) on your code? -LANG_TEST="0" # Should we validate the language files? -PHPBB_BRANCH="3.1.x" # Which phpBB branch to check out - -DB=mysqli -TRAVIS_PHP_VERSION=5.5.9 - -# Go into testdir and copy the extension: -EXTDIR=${EXTNAME%/*} -if [ ! -e testdir ]; then - mkdir testdir -else - # Existing test dir, delete a few things to make sure everything works out correctly - rm -rf testdir/$EXTNAME - rm -rf testdir/phpBB3/phpBB/ext/$EXTNAME - rm -rf testdir/phpBB3/phpBB/ext/$EXTDIR - rm -rf testdir/phpBB3/phpBB/cache/* - cp testdir/phpBB3/phpBB/ext/index.htm testdir/phpBB3/phpBB/cache/ - rm -rf testdir/tmp - - # Not sure if this is really necessary - dbs=$(mysql -e "SET SESSION group_concat_max_len=1000000; SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name) , ';' ) AS statement FROM information_schema.tables WHERE table_schema = 'phpbb_tests' AND table_name LIKE 'phpbb_%';") - cleaned=$(echo "$dbs" | sed 's/statement//g') - mysql -e "USE phpbb_tests; $cleaned" -fi -cd testdir -if [ -e $EXTDIR ]; then - rm -rf $EXTDIR -fi -mkdir $EXTDIR - -# Copy instead of cloning (on some systems, cloning may be faster?) -cp -r ../../extensions/$EXTNAME $EXTDIR -#git clone --depth=1 ../../extensions/$EXTNAME $EXTNAME --branch=$EXTBRANCH -cd $EXTNAME - -# Install -#php composer.phar install --dev --no-interaction --prefer-source -php composer.phar install --no-interaction -if [ ! -e ../../phpBB3 ]; then - chmod +x travis/prepare-phpbb.sh - travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH - if [ "$LANG_TEST" != '0' ]; then - travis/prepare-langtest.sh $EXTNAME $PHPBB_BRANCH - fi - cd ../../phpBB3 -else - if [ "$LANG_TEST" != '0' ]; then - travis/prepare-langtest.sh $EXTNAME $PHPBB_BRANCH - fi - if [ ! -e ../../tmp ]; then - # This is from prepare-phpbb.sh - mkdir ../../tmp - cp -R . ../../tmp - fi - cd ../../phpBB3 - git pull origin -fi - -travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH -travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION -travis/install-phpbb-test-dependencies.sh -cd phpBB -#php ../composer.phar install --dev --no-interaction --prefer-source -php ../composer.phar install --no-interaction -cd .. - -# Preparation: -travis/setup-database.sh $DB $TRAVIS_PHP_VERSION - -# Database setup: -if [ -e ../../../test_config.php ]; then - cp ../../../test_config.php ../tests/ -fi - -# script: -sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi" -sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; fi" -# This would be default, but the default sql user config is kind of stupid in some setups. -# So use the project unittest file and a config file instead: -#php phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php -php phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/phpunit.xml.dist --bootstrap ./tests/bootstrap.php -sh -c "if [ '$EPV' != '0' ] && [ '$DB' = 'mysqli' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi" -sh -c "if [ '$LANG_TEST' != '0' ]; then ../langtest/travis/test-lang.sh; fi" diff --git a/travis/prepare-langtest.sh b/travis/prepare-langtest.sh deleted file mode 100755 index 147e8d4..0000000 --- a/travis/prepare-langtest.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -# This file is part of the hookup extension for phpBB -# -# @copyright (c) gn#36 -# @license GNU General Public License, version 2 (GPL-2.0) -# -# -set -e -set -x - -EXTNAME=$1 -BRANCH=$2 - -# This assumes that we are still in the ext-dir -EXTPATH=. -LANGTESTPATH=../../langtest - -if [ -d $LANGTESTPATH ]; then - rm -r $LANGTESTPATH -fi -mkdir $LANGTESTPATH -cp -r $EXTPATH/language/ $LANGTESTPATH/language - -# Fake a plural rule (this is extension specific, since we need to allow an array of 0-3 for the hookup constants here -lang='$lang' -for i in $(ls $EXTPATH/language/) -do - echo " 3, -));" > $LANGTESTPATH/language/$i/common.php -done - -# copy the license file to all languages to avoid that fatal error -for i in $(ls $EXTPATH/language/) -do - cp $EXTPATH/license.txt $LANGTESTPATH/language/$i/LICENSE -done - -# link to vendor dir and travis dir -currentdir=`pwd` -cd $EXTPATH -absextpath=`pwd` -cd $currentdir -ln -s $absextpath/vendor/ $LANGTESTPATH/vendor -ln -s $absextpath/travis/ $LANGTESTPATH/travis - diff --git a/travis/prepare-phpbb.sh b/travis/prepare-phpbb.sh deleted file mode 100755 index 46b739b..0000000 --- a/travis/prepare-phpbb.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# This file is part of the phpBB Forum Software package. -# -# @copyright (c) phpBB Limited -# @license GNU General Public License, version 2 (GPL-2.0) -# -# For full copyright and license information, please see -# the docs/CREDITS.txt file. -# -set -e -set -x - -EXTNAME=$1 -BRANCH=$2 -EXTPATH_TEMP=$3 - -# Copy extension to a temp folder -mkdir ../../tmp -cp -R . ../../tmp -cd ../../ - -# Clone phpBB -git clone --depth=1 "git://github.com/phpbb/phpbb.git" "phpBB3" --branch=$BRANCH \ No newline at end of file diff --git a/travis/test-lang.sh b/travis/test-lang.sh deleted file mode 100755 index d396289..0000000 --- a/travis/test-lang.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# -# This file is part of the hookup extension for phpBB -# -# @copyright (c) gn#36 -# @license GNU General Public License, version 2 (GPL-2.0) -# -# -#set -e -#set -x - -echo "Running language tests" -retval=true -# we should be in phpBB3, so we need to go up one level into the langtest dir: -cd ../langtest ; - -for i in $(ls language/) -do - php vendor/bin/PhpbbTranslationValidator.php validate --language-dir=language $i - if [ ! $? -eq 0 ]; then - retval=false - fi - echo ""; -done; - -cd ../phpBB3 -if [ "$retval" = true ]; then - exit 0 -fi -exit 1 -