From 6cdf104fe7c19a24355f28468bfe3ed3afcb89d6 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 7 Feb 2018 13:05:21 +0100 Subject: [PATCH 01/18] Set min PHP version to 7.1 --- composer.json | 4 +- composer.lock | 436 +++++++++++++++----------------------------------- 2 files changed, 135 insertions(+), 305 deletions(-) diff --git a/composer.json b/composer.json index a43641556fd1..e2bcd869f6ef 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "optimize-autoloader": true, "classmap-authoritative": false, "platform": { - "php": "7.0.8" + "php": "7.1" } }, "autoload" : { @@ -30,7 +30,7 @@ "roave/security-advisories": "dev-master" }, "require": { - "php": ">=7.0.8", + "php": ">=7.1", "doctrine/dbal": "^2.5", "phpseclib/phpseclib": "^2.0", "jeremeamia/superclosure": "^2.4", diff --git a/composer.lock b/composer.lock index 72d0bcba7d22..6e2527f1e257 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c40ce033557c7f9b6dfd5976bbf43b4a", + "content-hash": "03c94f2c4cfdfa32385ea580fb4b2a14", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -283,103 +283,40 @@ ], "time": "2019-02-05T21:18:31+00:00" }, - { - "name": "doctrine/annotations", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97", - "reference": "54cacc9b81758b14e3ce750f205a393d52339e97", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/cache": "1.*", - "phpunit/phpunit": "^5.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "time": "2017-02-24T16:22:25+00:00" - }, { "name": "doctrine/cache", - "version": "v1.6.2", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b" + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/eb152c5100571c7a45470ff2a35095ab3f3b900b", - "reference": "eb152c5100571c7a45470ff2a35095ab3f3b900b", + "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", "shasum": "" }, "require": { - "php": "~5.5|~7.0" + "php": "~7.1" }, "conflict": { "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "phpunit/phpunit": "~4.8|~5.0", - "predis/predis": "~1.0", - "satooshi/php-coveralls": "~0.6" + "alcaeus/mongo-php-adapter": "^1.1", + "doctrine/coding-standard": "^6.0", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.0", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.9.x-dev" } }, "autoload": { @@ -392,143 +329,10 @@ "MIT" ], "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "cache", - "caching" - ], - "time": "2017-07-22T12:49:21+00:00" - }, - { - "name": "doctrine/collections", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/coding-standard": "~0.1@dev", - "phpunit/phpunit": "^5.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ], - "time": "2017-01-03T10:49:41+00:00" - }, - { - "name": "doctrine/common", - "version": "v2.7.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "4acb8f89626baafede6ee5475bc5844096eba8a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/4acb8f89626baafede6ee5475bc5844096eba8a9", - "reference": "4acb8f89626baafede6ee5475bc5844096eba8a9", - "shasum": "" - }, - "require": { - "doctrine/annotations": "1.*", - "doctrine/cache": "1.*", - "doctrine/collections": "1.*", - "doctrine/inflector": "1.*", - "doctrine/lexer": "1.*", - "php": "~5.6|~7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -537,10 +341,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -550,38 +350,49 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Common Library for Doctrine projects", - "homepage": "http://www.doctrine-project.org", + "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": [ - "annotations", - "collections", - "eventmanager", - "persistence", - "spl" + "abstraction", + "apcu", + "cache", + "caching", + "couchdb", + "memcached", + "php", + "redis", + "riak", + "xcache" ], - "time": "2017-07-22T08:35:12+00:00" + "time": "2019-11-15T14:31:57+00:00" }, { "name": "doctrine/dbal", - "version": "v2.5.13", + "version": "v2.9.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "729340d8d1eec8f01bff708e12e449a3415af873" + "reference": "7345cd59edfa2036eb0fa4264b77ae2576842035" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/729340d8d1eec8f01bff708e12e449a3415af873", - "reference": "729340d8d1eec8f01bff708e12e449a3415af873", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/7345cd59edfa2036eb0fa4264b77ae2576842035", + "reference": "7345cd59edfa2036eb0fa4264b77ae2576842035", "shasum": "" }, "require": { - "doctrine/common": ">=2.4,<2.8-dev", - "php": ">=5.3.2" + "doctrine/cache": "^1.0", + "doctrine/event-manager": "^1.0", + "ext-pdo": "*", + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "4.*", - "symfony/console": "2.*||^3.0" + "doctrine/coding-standard": "^5.0", + "jetbrains/phpstorm-stubs": "^2018.1.2", + "phpstan/phpstan": "^0.10.1", + "phpunit/phpunit": "^7.4", + "symfony/console": "^2.0.5|^3.0|^4.0", + "symfony/phpunit-bridge": "^3.4.5|^4.0.5" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -592,12 +403,13 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5.x-dev" + "dev-master": "2.9.x-dev", + "dev-develop": "3.0.x-dev" } }, "autoload": { - "psr-0": { - "Doctrine\\DBAL\\": "lib/" + "psr-4": { + "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" } }, "notification-url": "https://packagist.org/downloads/", @@ -605,6 +417,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -613,54 +429,58 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" } ], - "description": "Database Abstraction Layer", - "homepage": "http://www.doctrine-project.org", + "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", "dbal", + "mysql", "persistence", + "pgsql", + "php", "queryobject" ], - "time": "2017-07-22T20:44:48+00:00" + "time": "2019-11-02T22:19:34+00:00" }, { - "name": "doctrine/inflector", - "version": "v1.2.0", + "name": "doctrine/event-manager", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462" + "url": "https://github.com/doctrine/event-manager.git", + "reference": "629572819973f13486371cb611386eb17851e85c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462", - "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/629572819973f13486371cb611386eb17851e85c", + "reference": "629572819973f13486371cb611386eb17851e85c", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" + }, + "conflict": { + "doctrine/common": "<2.9@dev" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "doctrine/coding-standard": "^6.0", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + "Doctrine\\Common\\": "lib/Doctrine/Common" } }, "notification-url": "https://packagist.org/downloads/", @@ -668,6 +488,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -676,10 +500,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -687,17 +507,22 @@ { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", + "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": [ - "inflection", - "pluralize", - "singularize", - "string" + "event", + "event dispatcher", + "event manager", + "event system", + "events" ], - "time": "2017-07-22T12:18:28+00:00" + "time": "2019-11-10T09:48:07+00:00" }, { "name": "doctrine/lexer", @@ -3516,32 +3341,34 @@ }, { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^6.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -3561,12 +3388,12 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "jakub-onderka/php-console-color", @@ -3704,25 +3531,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", + "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -3745,7 +3575,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2019-08-09T12:45:53+00:00" }, { "name": "phar-io/manifest", @@ -3851,35 +3681,33 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "~6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3901,7 +3729,7 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2018-08-07T13:53:10+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -3956,30 +3784,31 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "0.5.1", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "cf842904952e64e703800d094cdf34e715a8a3ae" + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae", - "reference": "cf842904952e64e703800d094cdf34e715a8a3ae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -3997,7 +3826,8 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-12-30T13:23:38+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" }, { "name": "phpspec/prophecy", @@ -5387,11 +5217,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.0.8", + "php": ">=7.1", "ext-json": "*" }, "platform-dev": [], "platform-overrides": { - "php": "7.0.8" + "php": "7.1" } } From f99f565d48bbead16c95bb9e0784be20a03d1987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 7 Feb 2018 15:41:42 +0100 Subject: [PATCH 02/18] PHP 7.1+ is required --- console.php | 8 ++++---- index.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/console.php b/console.php index b9befb8fc2b6..92365fa227a6 100644 --- a/console.php +++ b/console.php @@ -33,10 +33,10 @@ \define('OC_CONSOLE', 1); -// Show warning if a PHP version below 7.0.7 is used, this has to happen here -// because base.php will already use 7.0 syntax. -if (\version_compare(PHP_VERSION, '7.0.7') === -1) { - echo 'This version of ownCloud requires at least PHP 7.0.7'.PHP_EOL; +// Show warning if a PHP version below 7.1.0 is used, this has to happen here +// because base.php will already use 7.1 syntax. +if (\version_compare(PHP_VERSION, '7.1.0') === -1) { + echo 'This version of ownCloud requires at least PHP 7.1.0'.PHP_EOL; echo 'You are currently running PHP ' . PHP_VERSION . '. Please update your PHP version.'.PHP_EOL; exit(1); } diff --git a/index.php b/index.php index 32d7587a0836..0e36dddc8ed6 100644 --- a/index.php +++ b/index.php @@ -27,10 +27,10 @@ * */ -// Show warning if a PHP version below 7.0.7 is used, this has to happen here -// because base.php will already use 7.0 syntax. -if (\version_compare(PHP_VERSION, '7.0.7') === -1) { - echo 'This version of ownCloud requires at least PHP 7.0.7
'; +// Show warning if a PHP version below 7.1.0 is used, this has to happen here +// because base.php will already use 7.1 syntax. +if (\version_compare(PHP_VERSION, '7.1.0') === -1) { + echo 'This version of ownCloud requires at least PHP 7.1.0
'; echo 'You are currently running PHP ' . PHP_VERSION . '. Please update your PHP version.'; return; } From b277de8a9c7aeb3543300f32d3b98418d17ae23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 12 Feb 2018 15:15:04 +0100 Subject: [PATCH 03/18] [Workaround] .... until https://github.com/sebastianbergmann/phpunit-mock-objects/pull/402 is merged and released --- tests/lib/DB/AdapterTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/lib/DB/AdapterTest.php b/tests/lib/DB/AdapterTest.php index ec3ebf15e454..0fe1cb58a9ad 100644 --- a/tests/lib/DB/AdapterTest.php +++ b/tests/lib/DB/AdapterTest.php @@ -22,6 +22,7 @@ namespace Test\DB; use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Driver\AbstractDriverException; use Doctrine\DBAL\Driver\DriverException; use OC\DB\Adapter; use OCP\DB\QueryBuilder\IExpressionBuilder; @@ -131,7 +132,7 @@ public function testUpsertCatchDeadlockAndThrowsException() { $qb->expects($this->exactly(3))->method('set')->willReturn($qb); $qb->expects($this->exactly(3))->method('setValue')->willReturn($qb); // Make a deadlock driver exception - $ex = $this->createMock(DriverException::class); + $ex = $this->createMock(AbstractDriverException::class); $ex->expects($this->exactly(5))->method('getErrorCode')->willReturn(1213); // Wrap the exception in a doctrine exception $e = new \Doctrine\DBAL\Exception\DriverException('1213', $ex); @@ -170,7 +171,7 @@ public function testUpsertAndThrowOtherDriverExceptions() { $qb->expects($this->exactly(3))->method('set')->willReturn($qb); $qb->expects($this->exactly(3))->method('setValue')->willReturn($qb); // Make a deadlock driver exception - $ex = $this->createMock(DriverException::class); + $ex = $this->createMock(AbstractDriverException::class); $ex->expects($this->exactly(1))->method('getErrorCode')->willReturn(1214); // Wrap the exception in a doctrine exception /** @var DriverException|\PHPUnit\Framework\MockObject\MockObject $ex */ From 3572dadd853579434c2fc9f0e6b30f29befc63fc Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Wed, 18 Apr 2018 23:04:00 +0300 Subject: [PATCH 04/18] Dismiss OCPostgreSqlPlatform as issues it addresses were fixed in doctrine/dbal since 2.6.4 --- lib/private/DB/ConnectionFactory.php | 3 - lib/private/DB/OCPostgreSqlPlatform.php | 95 ----------------------- tests/lib/DB/OCPostgreSqlPlatformTest.php | 71 ----------------- 3 files changed, 169 deletions(-) delete mode 100644 lib/private/DB/OCPostgreSqlPlatform.php delete mode 100644 tests/lib/DB/OCPostgreSqlPlatformTest.php diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index 03a04edc1122..f034dce4b907 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -134,9 +134,6 @@ public function getConnection($type, $additionalConnectionParams) { $additionalConnectionParams['platform'] = new OCSqlitePlatform(); $eventManager->addEventSubscriber(new SQLiteSessionInit(true, $journalMode)); break; - case 'pgsql': - $additionalConnectionParams['platform'] = new OCPostgreSqlPlatform(); - break; } /** @var Connection $connection */ $connection = DriverManager::getConnection( diff --git a/lib/private/DB/OCPostgreSqlPlatform.php b/lib/private/DB/OCPostgreSqlPlatform.php deleted file mode 100644 index 921b8c145e8d..000000000000 --- a/lib/private/DB/OCPostgreSqlPlatform.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * @copyright Copyright (c) 2018, ownCloud GmbH - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -namespace OC\DB; - -use Doctrine\DBAL\Platforms\PostgreSqlPlatform; -use Doctrine\DBAL\Schema\ColumnDiff; -use Doctrine\DBAL\Schema\TableDiff; -use Doctrine\DBAL\Types\Type; - -class OCPostgreSqlPlatform extends PostgreSqlPlatform { - - /** - * {@inheritDoc} - */ - public function getAlterTableSQL(TableDiff $diff) { - $queries = parent::getAlterTableSQL($diff); - foreach ($queries as $index => $sql) { - // BIGSERIAL could not be used in statements altering column type - // That's why we replace it with BIGINT - // see https://github.com/owncloud/core/pull/28364#issuecomment-315006853 - if (\preg_match('|(ALTER TABLE\s+\S+\s+ALTER\s+\S+\s+TYPE\s+)(BIGSERIAL)|i', $sql, $matches)) { - $alterTable = $matches[1]; - $queries[$index] = $alterTable . 'BIGINT'; - } - // Changing integer to bigint kills next autoincrement value - // see https://github.com/owncloud/core/pull/28364#issuecomment-315006853 - if (\preg_match('|ALTER TABLE\s+(\S+)\s+ALTER\s+(\S+)\s+DROP DEFAULT|i', $sql, $matches)) { - $queryColumnName = $matches[2]; - $columnDiff = $this->findColumnDiffByName($diff, $queryColumnName); - if ($columnDiff) { - if ($this->shouldSkipDropDefault($columnDiff)) { - unset($queries[$index]); - continue; - } - } - } - } - - return $queries; - } - - /** - * We should NOT drop next sequence value if - * - type was changed from INTEGER to BIGINT - * - column keeps an autoincrement - * - default value is kept NULL - * - * @param ColumnDiff $columnDiff - * @return bool - */ - private function shouldSkipDropDefault(ColumnDiff $columnDiff) { - $column = $columnDiff->column; - $fromColumn = $columnDiff->fromColumn; - return $fromColumn->getType()->getName() === Type::INTEGER - && $column->getType()->getName() === Type::BIGINT - && $fromColumn->getDefault() === null - && $column->getDefault() === null - && $fromColumn->getAutoincrement() - && $column->getAutoincrement(); - } - - /** - * @param TableDiff $diff - * @param string $name - * @return ColumnDiff | false - */ - private function findColumnDiffByName(TableDiff $diff, $name) { - foreach ($diff->changedColumns as $columnDiff) { - $oldColumnName = $columnDiff->getOldColumnName()->getQuotedName($this); - if ($oldColumnName === $name) { - return $columnDiff; - } - } - return false; - } -} diff --git a/tests/lib/DB/OCPostgreSqlPlatformTest.php b/tests/lib/DB/OCPostgreSqlPlatformTest.php deleted file mode 100644 index 9b5da0d0a0e5..000000000000 --- a/tests/lib/DB/OCPostgreSqlPlatformTest.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * @copyright Copyright (c) 2018, ownCloud GmbH - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -namespace Test\DB; - -use Doctrine\DBAL\Schema\Comparator; -use Doctrine\DBAL\Schema\Schema; -use Doctrine\DBAL\Types\Type; -use OC\DB\OCPostgreSqlPlatform; - -/** - * Class OCPostgreSqlPlatformTest - * - * @group DB - * - * @package Test\DB - */ - -class OCPostgreSqlPlatformTest extends \Test\TestCase { - public function testAlterBigint() { - $platform = new OCPostgreSqlPlatform(); - $sourceSchema = new Schema(); - $targetSchema = new Schema(); - - $this->createTableAndColumn($sourceSchema, Type::INTEGER); - $this->createTableAndColumn($targetSchema, Type::BIGINT); - - $comparator = new Comparator(); - $diff = $comparator->compare($sourceSchema, $targetSchema); - $sqlStatements = $diff->toSql($platform); - $this->assertContains( - 'ALTER TABLE poor_yorick ALTER id TYPE BIGINT', - $sqlStatements, - true - ); - - $this->assertNotContains( - 'ALTER TABLE poor_yorick ALTER id DROP DEFAULT', - $sqlStatements, - true - ); - } - - protected function createTableAndColumn($schema, $type) { - $table = $schema->createTable("poor_yorick"); - $table->addColumn('id', $type, [ - 'autoincrement' => true, - 'unsigned' => true, - 'notnull' => true, - 'length' => 11, - ]); - } -} From 4d86f3f5330d2f06a527dba2211c8d6c3ce0ee20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 24 Jul 2018 10:34:53 +0200 Subject: [PATCH 05/18] Remove our own sqlite autoincrement hack --- lib/private/DB/ConnectionFactory.php | 1 - lib/private/DB/OCSqlitePlatform.php | 49 ---------------------------- 2 files changed, 50 deletions(-) delete mode 100644 lib/private/DB/OCSqlitePlatform.php diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index f034dce4b907..5d087c89cca5 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -131,7 +131,6 @@ public function getConnection($type, $additionalConnectionParams) { break; case 'sqlite3': $journalMode = $additionalConnectionParams['sqlite.journal_mode']; - $additionalConnectionParams['platform'] = new OCSqlitePlatform(); $eventManager->addEventSubscriber(new SQLiteSessionInit(true, $journalMode)); break; } diff --git a/lib/private/DB/OCSqlitePlatform.php b/lib/private/DB/OCSqlitePlatform.php deleted file mode 100644 index 0ff843abb9e5..000000000000 --- a/lib/private/DB/OCSqlitePlatform.php +++ /dev/null @@ -1,49 +0,0 @@ - - * @author Thomas Müller - * - * @copyright Copyright (c) 2018, ownCloud GmbH - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -namespace OC\DB; - -class OCSqlitePlatform extends \Doctrine\DBAL\Platforms\SqlitePlatform { - /** - * {@inheritDoc} - */ - public function getColumnDeclarationSQL($name, array $field) { - $def = parent::getColumnDeclarationSQL($name, $field); - if (!empty($field['autoincrement'])) { - $def .= ' PRIMARY KEY AUTOINCREMENT'; - } - return $def; - } - - /** - * {@inheritDoc} - */ - protected function _getCreateTableSQL($name, array $columns, array $options = []) { - // if auto increment is set the column is already defined as primary key - foreach ($columns as $column) { - if (!empty($column['autoincrement'])) { - $options['primary'] = null; - } - } - return parent::_getCreateTableSQL($name, $columns, $options); - } -} From 7e4ac19244b8788e92a4527f334c3fd569320b46 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 22 Oct 2018 21:09:48 +0200 Subject: [PATCH 06/18] Add mariadb 10.3 to Drone --- .drone.starlark | 2 +- .drone.yml | 134 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 1 deletion(-) diff --git a/.drone.starlark b/.drone.starlark index 423d73de5123..fdb659af3d78 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -985,7 +985,7 @@ def phptests(testType): default = { 'phpVersions': ['7.0', '7.1', '7.2', '7.3'], 'databases': [ - 'sqlite', 'mariadb:10.2', 'mysql:5.5', 'mysql:5.7', 'postgres:9.4', 'oracle' + 'sqlite', 'mariadb:10.2', 'mariadb:10.3', 'mysql:5.5', 'mysql:5.7', 'postgres:9.4', 'oracle' ], 'coverage': True, 'includeKeyInMatrixName': False, diff --git a/.drone.yml b/.drone.yml index 08d87ab9b7b3..da21b47e62d4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1565,6 +1565,139 @@ depends_on: - phan-php7.2 - phan-php7.3 +--- +kind: pipeline +type: docker +name: phpunit-php7.1-mariadb10.3 + +platform: + os: linux + arch: amd64 + +workspace: + base: /drone + path: src + +steps: +- name: cache-restore + pull: always + image: plugins/s3-cache:1 + settings: + access_key: + from_secret: cache_s3_access_key + endpoint: + from_secret: cache_s3_endpoint + restore: true + secret_key: + from_secret: cache_s3_secret_key + when: + instance: + - drone.owncloud.services + - drone.owncloud.com + +- name: composer-install + pull: always + image: owncloudci/php:7.1 + commands: + - make install-composer-deps + environment: + COMPOSER_HOME: /drone/src/.cache/composer + +- name: vendorbin-install + pull: always + image: owncloudci/php:7.1 + commands: + - make vendor-bin-deps + environment: + COMPOSER_HOME: /drone/src/.cache/composer + +- name: yarn-install + pull: always + image: owncloudci/php:7.1 + commands: + - make install-nodejs-deps + environment: + NPM_CONFIG_CACHE: /drone/src/.cache/npm + YARN_CACHE_FOLDER: /drone/src/.cache/yarn + bower_storage__packages: /drone/src/.cache/bower + +- name: install-server + pull: always + image: owncloudci/php:7.1 + commands: + - bash tests/drone/install-server.sh + - php occ a:l + - php occ config:system:set trusted_domains 1 --value=server + - php occ log:manage --level 2 + - php occ config:list + - php occ security:certificates:import /drone/server.crt + - php occ security:certificates + environment: + DB_TYPE: mariadb + +- name: fix-permissions + pull: always + image: owncloudci/php:7.1 + commands: + - chown -R www-data /drone/src + +- name: owncloud-log-server + pull: always + image: owncloud/ubuntu:18.04 + detach: true + commands: + - tail -f /drone/src/data/owncloud.log + +- name: phpunit-tests + pull: always + image: owncloudci/php:7.1 + commands: + - su-exec www-data bash tests/drone/test-phpunit.sh + environment: + COVERAGE: true + DB_TYPE: mariadb + +- name: coverage-upload + pull: always + image: plugins/codecov:2 + settings: + files: + - "*.xml" + flags: + - phpunit + paths: + - tests/output/coverage + environment: + CODECOV_TOKEN: + from_secret: codecov_token + when: + instance: + - drone.owncloud.services + - drone.owncloud.com + +services: +- name: mariadb + pull: always + image: mariadb:10.3 + environment: + MYSQL_DATABASE: owncloud + MYSQL_PASSWORD: owncloud + MYSQL_ROOT_PASSWORD: owncloud + MYSQL_USER: owncloud + +trigger: + ref: + - refs/pull/** + - refs/tags/** + - refs/heads/master + +depends_on: +- coding-standard-php7.3 +- phpstan-php7.1 +- phan-php7.1 +- phan-php7.2 +- phan-php7.3 + --- kind: pipeline type: docker @@ -14355,6 +14488,7 @@ depends_on: - carddav-old-php7.1 - phpunit-php7.1-sqlite - phpunit-php7.1-mariadb10.2 +- phpunit-php7.1-mariadb10.3 - phpunit-php7.1-mysql5.5 - phpunit-php7.1-mysql5.7 - phpunit-php7.1-postgres9.4 From 7872cb6975cac7ec82cc46d0b120bcebb9b622bb Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 7 Nov 2018 17:17:42 +0100 Subject: [PATCH 07/18] Detect MariaDB > 10.3.1 and assume mb4 support --- lib/private/DB/MySqlTools.php | 46 ++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/lib/private/DB/MySqlTools.php b/lib/private/DB/MySqlTools.php index 61409b8bd490..b4009c86e9bd 100644 --- a/lib/private/DB/MySqlTools.php +++ b/lib/private/DB/MySqlTools.php @@ -22,17 +22,13 @@ namespace OC\DB; use OCP\IDBConnection; +use Doctrine\DBAL\DBALException; /** * Various MySQL specific helper functions. */ class MySqlTools { - - /** - * @param Connection $connection - * @return bool - */ - public function supports4ByteCharset(IDBConnection $connection) { + private function detectBarracuda(IDBConnection $connection) { foreach (['innodb_file_format' => 'Barracuda', 'innodb_large_prefix' => 'ON', 'innodb_file_per_table' => 'ON'] as $var => $val) { $result = $connection->executeQuery("SHOW VARIABLES LIKE '$var'"); $rows = $result->fetch(); @@ -44,6 +40,44 @@ public function supports4ByteCharset(IDBConnection $connection) { return false; } } + return true; } + + /** + * Detect MariaDB server version, including hack for some mariadb distributions + * that starts with the prefix '5.5.5-' + * + * @param string $versionString Version string as returned by mariadb server, i.e. '5.5.5-Mariadb-10.0.8-xenial' + * @return string + * @throws DBALException + */ + private function getMariaDbMysqlVersionNumber($versionString) { + if (!\preg_match('/^(?:5\.5\.5-)?(mariadb-)?(?P\d+)\.(?P\d+)\.(?P\d+)/i', $versionString, $versionParts)) { + throw DBALException::invalidPlatformVersionSpecified( + $versionString, + '^(?:5\.5\.5-)?(mariadb-)?..' + ); + } + return $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch']; + } + + /** + * @param Connection $connection + * @return bool + */ + public function supports4ByteCharset(IDBConnection $connection) { + if ($this->detectBarracuda($connection)) { + return true; + } + + $version = $connection->getDatabaseVersionString(); + $mariadb = \stripos($version, 'mariadb') !== false; + if ($mariadb && \version_compare($this->getMariaDbMysqlVersionNumber($version), '10.3.1', '>=')) { + // mb4 supported by default on MariaDB since 10.3.1 and innodb_file_format vars were removed + return true; + } + + return false; + } } From 0a7aba72616d08b8bdc79827b5dfd6e2232bc81f Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 7 Nov 2018 17:18:17 +0100 Subject: [PATCH 08/18] Remove obsolete MariaDB 10.2 workaround Since the DBAL update, the schema wrapper is not needed any more. --- lib/private/DB/ConnectionFactory.php | 4 - .../MySqlSchemaColumnDefinitionListener.php | 246 ------------------ 2 files changed, 250 deletions(-) delete mode 100644 lib/private/DB/MySqlSchemaColumnDefinitionListener.php diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php index 5d087c89cca5..eab0135b65c7 100644 --- a/lib/private/DB/ConnectionFactory.php +++ b/lib/private/DB/ConnectionFactory.php @@ -117,10 +117,6 @@ public function getConnection($type, $additionalConnectionParams) { case 'mysql': $eventManager->addEventSubscriber( new SQLSessionInit("SET SESSION AUTOCOMMIT=1")); - $eventManager->addEventListener( - Events::onSchemaColumnDefinition, - new MySqlSchemaColumnDefinitionListener() - ); break; case 'oci': $eventManager->addEventSubscriber(new OracleSessionInit); diff --git a/lib/private/DB/MySqlSchemaColumnDefinitionListener.php b/lib/private/DB/MySqlSchemaColumnDefinitionListener.php deleted file mode 100644 index 091ed3cb6dba..000000000000 --- a/lib/private/DB/MySqlSchemaColumnDefinitionListener.php +++ /dev/null @@ -1,246 +0,0 @@ - - * - * @copyright Copyright (c) 2018, ownCloud GmbH - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see - * - */ - -namespace OC\DB; - -use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Event\SchemaColumnDefinitionEventArgs; -use Doctrine\DBAL\Platforms\MySqlPlatform; -use Doctrine\DBAL\Schema\Column; -use Doctrine\DBAL\Types\Type; - -/** - * Class MySqlSchemaColumnDefinitionListener - * - * @package OC\DB - * - * This class contains the smallest portion of native Doctrine code taken from - * Doctrine\DBAL\Platforms\MySqlSchemaManager that allows to bypass the call to - * native _getPortableTableColumnDefinition method - * - * TODO: remove once https://github.com/owncloud/core/issues/28695 is fixed and Doctrine upgraded - */ -class MySqlSchemaColumnDefinitionListener { - /** - * @var \Doctrine\DBAL\Platforms\AbstractPlatform - */ - protected $_platform; - - public function onSchemaColumnDefinition(SchemaColumnDefinitionEventArgs $eventArgs) { - // We need an instance of platform with ownCloud-specific mappings - // this part can't be moved to constructor - it leads to an infinite recursion - if ($this->_platform === null) { - $this->_platform = \OC::$server->getDatabaseConnection()->getDatabasePlatform(); - } - - $databaseConnection = \OC::$server->getDatabaseConnection(); - '@phan-var \OC\DB\Connection $databaseConnection'; - $version = $databaseConnection->getDatabaseVersionString(); - $mariadb = \stripos($version, 'mariadb') !== false; - if ($mariadb && \version_compare($this->getMariaDbMysqlVersionNumber($version), '10.2.7', '>=')) { - $tableColumn = $eventArgs->getTableColumn(); - try { - $column = $this->_getPortableTableColumnDefinition($tableColumn); - $eventArgs->preventDefault(); - $eventArgs->setColumn($column); - } catch (DBALException $e) { - // Pass - } - } - } - - /** - * Given a table comment this method tries to extract a typehint for Doctrine Type, or returns - * the type given as default. - * - * @param string $comment - * @param string $currentType - * - * @return string - */ - public function extractDoctrineTypeFromComment($comment, $currentType) { - if (\preg_match("(\(DC2Type:([a-zA-Z0-9_]+)\))", $comment, $match)) { - $currentType = $match[1]; - } - - return $currentType; - } - - /** - * @param string $comment - * @param string $type - * - * @return string - */ - public function removeDoctrineTypeFromComment($comment, $type) { - return \str_replace('(DC2Type:'.$type.')', '', $comment); - } - - protected function _getPortableTableColumnDefinition($tableColumn) { - $tableColumn = \array_change_key_case($tableColumn, CASE_LOWER); - - $dbType = \strtolower($tableColumn['type']); - $dbType = \strtok($dbType, '(), '); - if (isset($tableColumn['length'])) { - $length = $tableColumn['length']; - } else { - $length = \strtok('(), '); - } - - $fixed = null; - - if (! isset($tableColumn['name'])) { - $tableColumn['name'] = ''; - } - - $scale = null; - $precision = null; - - $type = $this->_platform->getDoctrineTypeMapping($dbType); - - // In cases where not connected to a database DESCRIBE $table does not return 'Comment' - if (isset($tableColumn['comment'])) { - $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type); - $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type); - } - - switch ($dbType) { - case 'char': - case 'binary': - $fixed = true; - break; - case 'float': - case 'double': - case 'real': - case 'numeric': - case 'decimal': - if (\preg_match('([A-Za-z]+\(([0-9]+)\,([0-9]+)\))', $tableColumn['type'], $match)) { - $precision = $match[1]; - $scale = $match[2]; - $length = null; - } - break; - case 'tinytext': - $length = MySqlPlatform::LENGTH_LIMIT_TINYTEXT; - break; - case 'text': - $length = MySqlPlatform::LENGTH_LIMIT_TEXT; - break; - case 'mediumtext': - $length = MySqlPlatform::LENGTH_LIMIT_MEDIUMTEXT; - break; - case 'tinyblob': - $length = MySqlPlatform::LENGTH_LIMIT_TINYBLOB; - break; - case 'blob': - $length = MySqlPlatform::LENGTH_LIMIT_BLOB; - break; - case 'mediumblob': - $length = MySqlPlatform::LENGTH_LIMIT_MEDIUMBLOB; - break; - case 'tinyint': - case 'smallint': - case 'mediumint': - case 'int': - case 'integer': - case 'bigint': - case 'year': - $length = null; - break; - } - - $length = ((int) $length == 0) ? null : (int) $length; - - $default = isset($tableColumn['default']) ? $tableColumn['default'] : null; - $columnDefault = $this->getMariaDb1027ColumnDefault($default); - - $options = [ - 'length' => $length, - 'unsigned' => (bool) (\strpos($tableColumn['type'], 'unsigned') !== false), - 'fixed' => (bool) $fixed, - // This line was changed to fix breaking change introduced in MariaDB 10.2.6 - 'default' => $columnDefault, - 'notnull' => (bool) ($tableColumn['null'] != 'YES'), - 'scale' => null, - 'precision' => null, - 'autoincrement' => (bool) (\strpos($tableColumn['extra'], 'auto_increment') !== false), - 'comment' => isset($tableColumn['comment']) && $tableColumn['comment'] !== '' - ? $tableColumn['comment'] - : null, - ]; - - if ($scale !== null && $precision !== null) { - $options['scale'] = $scale; - $options['precision'] = $precision; - } - - $column = new Column($tableColumn['field'], Type::getType($type), $options); - - if (isset($tableColumn['collation'])) { - $column->setPlatformOption('collation', $tableColumn['collation']); - } - - return $column; - } - - /** - * Return Doctrine/Mysql-compatible column default values for MariaDB 10.2.7+ servers. - * - * - Since MariaDb 10.2.7 column defaults stored in information_schema are now quoted - * to distinguish them from expressions (see MDEV-10134). - * - Note: Quoted 'NULL' is not enforced by Maria, it is technically possible to have - * null in some circumstances (see https://jira.mariadb.org/browse/MDEV-14053) - * - * @link https://mariadb.com/kb/en/library/information-schema-columns-table/ - * @link https://jira.mariadb.org/browse/MDEV-13132 - * - * @param null|string $columnDefault default value as stored in information_schema for MariaDB >= 10.2.7 - * @return string - */ - private function getMariaDb1027ColumnDefault($columnDefault) { - if ($columnDefault === 'NULL' || $columnDefault === null) { - return null; - } - if ($columnDefault[0] === "'") { - return \preg_replace('/^\'(.*)\'$/', '$1', $columnDefault); - } - - return $columnDefault; - } - - /** - * Detect MariaDB server version, including hack for some mariadb distributions - * that starts with the prefix '5.5.5-' - * - * @param string $versionString Version string as returned by mariadb server, i.e. '5.5.5-Mariadb-10.0.8-xenial' - * @return string - * @throws DBALException - */ - private function getMariaDbMysqlVersionNumber($versionString) { - if (!\preg_match('/^(?:5\.5\.5-)?(mariadb-)?(?P\d+)\.(?P\d+)\.(?P\d+)/i', $versionString, $versionParts)) { - throw DBALException::invalidPlatformVersionSpecified( - $versionString, - '^(?:5\.5\.5-)?(mariadb-)?..' - ); - } - return $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch']; - } -} From 59c97a2cb3514ae3e4ff2b5058f34b68bc6a81b7 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 8 Nov 2018 14:58:57 +0100 Subject: [PATCH 09/18] Add MySQL 8 which defaults to mb4 mode --- .drone.starlark | 9 ++- .drone.yml | 136 ++++++++++++++++++++++++++++++++++ lib/private/DB/MySqlTools.php | 6 ++ tests/drone/install-server.sh | 4 +- 4 files changed, 150 insertions(+), 5 deletions(-) diff --git a/.drone.starlark b/.drone.starlark index fdb659af3d78..986bd8a38c83 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -985,7 +985,7 @@ def phptests(testType): default = { 'phpVersions': ['7.0', '7.1', '7.2', '7.3'], 'databases': [ - 'sqlite', 'mariadb:10.2', 'mariadb:10.3', 'mysql:5.5', 'mysql:5.7', 'postgres:9.4', 'oracle' + 'sqlite', 'mariadb:10.2', 'mariadb:10.3', 'mysql:5.5', 'mysql:5.7', 'mysql:8.0', 'postgres:9.4', 'oracle' ], 'coverage': True, 'includeKeyInMatrixName': False, @@ -1418,7 +1418,7 @@ def notify(): def databaseService(db): dbName = getDbName(db) if (dbName == 'mariadb') or (dbName == 'mysql'): - return [{ + service = { 'name': dbName, 'image': db, 'pull': 'always', @@ -1428,7 +1428,10 @@ def databaseService(db): 'MYSQL_DATABASE': getDbDatabase(db), 'MYSQL_ROOT_PASSWORD': getDbRootPassword() } - }] + } + if (db == 'mysql:8.0'): + service['command'] = ['--default-authentication-plugin=mysql_native_password'] + return [service] if dbName == 'postgres': return [{ diff --git a/.drone.yml b/.drone.yml index da21b47e62d4..90760913f717 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1964,6 +1964,141 @@ depends_on: - phan-php7.2 - phan-php7.3 +--- +kind: pipeline +type: docker +name: phpunit-php7.1-mysql8.0 + +platform: + os: linux + arch: amd64 + +workspace: + base: /drone + path: src + +steps: +- name: cache-restore + pull: always + image: plugins/s3-cache:1 + settings: + access_key: + from_secret: cache_s3_access_key + endpoint: + from_secret: cache_s3_endpoint + restore: true + secret_key: + from_secret: cache_s3_secret_key + when: + instance: + - drone.owncloud.services + - drone.owncloud.com + +- name: composer-install + pull: always + image: owncloudci/php:7.1 + commands: + - make install-composer-deps + environment: + COMPOSER_HOME: /drone/src/.cache/composer + +- name: vendorbin-install + pull: always + image: owncloudci/php:7.1 + commands: + - make vendor-bin-deps + environment: + COMPOSER_HOME: /drone/src/.cache/composer + +- name: yarn-install + pull: always + image: owncloudci/php:7.1 + commands: + - make install-nodejs-deps + environment: + NPM_CONFIG_CACHE: /drone/src/.cache/npm + YARN_CACHE_FOLDER: /drone/src/.cache/yarn + bower_storage__packages: /drone/src/.cache/bower + +- name: install-server + pull: always + image: owncloudci/php:7.1 + commands: + - bash tests/drone/install-server.sh + - php occ a:l + - php occ config:system:set trusted_domains 1 --value=server + - php occ log:manage --level 2 + - php occ config:list + - php occ security:certificates:import /drone/server.crt + - php occ security:certificates + environment: + DB_TYPE: mysql + +- name: fix-permissions + pull: always + image: owncloudci/php:7.1 + commands: + - chown -R www-data /drone/src + +- name: owncloud-log-server + pull: always + image: owncloud/ubuntu:18.04 + detach: true + commands: + - tail -f /drone/src/data/owncloud.log + +- name: phpunit-tests + pull: always + image: owncloudci/php:7.1 + commands: + - su-exec www-data bash tests/drone/test-phpunit.sh + environment: + COVERAGE: true + DB_TYPE: mysql + +- name: coverage-upload + pull: always + image: plugins/codecov:2 + settings: + files: + - "*.xml" + flags: + - phpunit + paths: + - tests/output/coverage + environment: + CODECOV_TOKEN: + from_secret: codecov_token + when: + instance: + - drone.owncloud.services + - drone.owncloud.com + +services: +- name: mysql + pull: always + image: mysql:8.0 + command: + - --default-authentication-plugin=mysql_native_password + environment: + MYSQL_DATABASE: owncloud + MYSQL_PASSWORD: owncloud + MYSQL_ROOT_PASSWORD: owncloud + MYSQL_USER: owncloud + +trigger: + ref: + - refs/pull/** + - refs/tags/** + - refs/heads/master + +depends_on: +- coding-standard-php7.3 +- phpstan-php7.1 +- phan-php7.1 +- phan-php7.2 +- phan-php7.3 + --- kind: pipeline type: docker @@ -14491,6 +14626,7 @@ depends_on: - phpunit-php7.1-mariadb10.3 - phpunit-php7.1-mysql5.5 - phpunit-php7.1-mysql5.7 +- phpunit-php7.1-mysql8.0 - phpunit-php7.1-postgres9.4 - phpunit-php7.1-oracle - phpunit-php7.0-sqlite diff --git a/lib/private/DB/MySqlTools.php b/lib/private/DB/MySqlTools.php index b4009c86e9bd..62e084c7b0f3 100644 --- a/lib/private/DB/MySqlTools.php +++ b/lib/private/DB/MySqlTools.php @@ -23,6 +23,7 @@ use OCP\IDBConnection; use Doctrine\DBAL\DBALException; +use Doctrine\DBAL\Platforms\MySQL80Platform; /** * Various MySQL specific helper functions. @@ -71,6 +72,11 @@ public function supports4ByteCharset(IDBConnection $connection) { return true; } + if ($connection->getDatabasePlatform() instanceof MySQL80Platform) { + // mb4 supported by default since MySQL 8.0 and innodb_file_format vars were removed + return true; + } + $version = $connection->getDatabaseVersionString(); $mariadb = \stripos($version, 'mariadb') !== false; if ($mariadb && \version_compare($this->getMariaDbMysqlVersionNumber($version), '10.3.1', '>=')) { diff --git a/tests/drone/install-server.sh b/tests/drone/install-server.sh index 118e3ba83a33..c86c5c21c675 100755 --- a/tests/drone/install-server.sh +++ b/tests/drone/install-server.sh @@ -83,8 +83,8 @@ case "${DB_TYPE}" in wait-for-it mysql:3306 DB=mysql ;; - mysqlmb4) - wait-for-it mysqlmb4:3306 + mysql8) + wait-for-it mysql8:3306 DB=mysql ;; postgres) From f0638ccd7d5e5e95f0aae0bd0bc12eb79d890f25 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 15 Nov 2018 22:04:44 +0100 Subject: [PATCH 10/18] Unit tests for mysql mb4 detection Unit tests to verify implementation of mb4 detection without touching the database. --- lib/private/DB/MySqlTools.php | 10 ++- tests/lib/DB/MySqlToolsTest.php | 134 ++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 3 deletions(-) create mode 100644 tests/lib/DB/MySqlToolsTest.php diff --git a/lib/private/DB/MySqlTools.php b/lib/private/DB/MySqlTools.php index 62e084c7b0f3..34cd90bf9790 100644 --- a/lib/private/DB/MySqlTools.php +++ b/lib/private/DB/MySqlTools.php @@ -1,6 +1,7 @@ + * @author Vincent Petry * * @copyright Copyright (c) 2018, ownCloud GmbH * @license AGPL-3.0 @@ -24,6 +25,7 @@ use OCP\IDBConnection; use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Platforms\MySQL80Platform; +use OC\DB\Connection; /** * Various MySQL specific helper functions. @@ -64,10 +66,12 @@ private function getMariaDbMysqlVersionNumber($versionString) { } /** - * @param Connection $connection - * @return bool + * Returns whether the database from the given connection supports 4-byte characters. + * + * @param Connection $connection connection to check + * @return bool true if supported, false otherwise */ - public function supports4ByteCharset(IDBConnection $connection) { + public function supports4ByteCharset(Connection $connection) { if ($this->detectBarracuda($connection)) { return true; } diff --git a/tests/lib/DB/MySqlToolsTest.php b/tests/lib/DB/MySqlToolsTest.php new file mode 100644 index 000000000000..c626f3590f1e --- /dev/null +++ b/tests/lib/DB/MySqlToolsTest.php @@ -0,0 +1,134 @@ + + * + * @copyright Copyright (c) 2018, ownCloud GmbH + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace Test\DB; + +use OCP\IDBConnection; +use Doctrine\DBAL\Driver\Statement; +use OC\DB\MySqlTools; +use Doctrine\DBAL\Platforms\MySQL80Platform; +use OC\DB\Connection; + +/** + * Class MySqlToolsTest + */ +class MySqlToolsTest extends \Test\TestCase { + + /** + * @var IDBConnection + */ + private $db; + + /** + * @var MySqlTools + */ + + public function setUp() { + parent::setUp(); + + $this->db = $this->createMock(Connection::class); + $this->tools = new MySqlTools(); + } + + public function providesDbVars() { + return [ + [ + ['innodb_file_format' => 'Barracuda', 'innodb_large_prefix' => 'ON', 'innodb_file_per_table' => 'ON'], true, + ['innodb_file_format' => 'Barracuda', 'innodb_large_prefix' => 'ON', 'innodb_file_per_table' => 'OFF'], false, + ['innodb_file_format' => 'Antelope', 'innodb_large_prefix' => 'ON', 'innodb_file_per_table' => 'ON'], false, + ['innodb_file_format' => 'Barracuda', 'innodb_large_prefix' => 'OFF', 'innodb_file_per_table' => 'ON'], false, + ], + ]; + } + + private function mockDatabaseVars($vars) { + $map = []; + foreach ($vars as $key => $value) { + $statementMock = $this->createMock(Statement::class); + $statementMock->expects($this->once())->method('fetch')->willReturn(['Value' => $value]); + $map[] = ["SHOW VARIABLES LIKE '$key'", [], [], null, $statementMock]; + } + // mock vars + $this->db->expects($this->any()) + ->method('executeQuery') + ->will($this->returnValueMap($map)); + } + + private function mockDatabaseEmptyVars() { + $statementMock = $this->createMock(Statement::class); + $statementMock->expects($this->any())->method('fetch')->willReturn(false); + + $this->db->expects($this->any()) + ->method('executeQuery') + ->willReturn($statementMock); + } + + /** + * Test barracuda detection based on MySQL vars + * + * @dataProvider providesDbVars + * @param array $vars + * @param bool $expectedResult + */ + public function testMb4WithBarracuda($vars, $expectedResult) { + $this->mockDatabaseVars($vars); + + $this->assertEquals($expectedResult, $this->tools->supports4ByteCharset($this->db)); + } + + public function testDetectMb4WithMySQL8() { + $this->mockDatabaseEmptyVars(); + + $this->db->expects($this->once()) + ->method('getDatabasePlatform') + ->willReturn($this->createMock(MySQL80Platform::class)); + + $this->assertTrue($this->tools->supports4ByteCharset($this->db)); + } + + public function providesVersionString() { + return [ + ['10.3.2-oracle', false], + ['10.3.0-mariadb', false], + ['mariadb-10.3.0', false], + ['10.3.1-mariadb', true], + ['mariadb-10.3.1', true], + ]; + } + + /** + * Tests whether MariaDB 10.3 is properly detected. + * + * @dataProvider providesVersionString + * @param string $versionString + * @param bool $expectedResult + */ + public function testDetectMb4WithMariaDB103($versionString, $expectedResult) { + $this->mockDatabaseEmptyVars(); + + $this->db->expects($this->once()) + ->method('getDatabaseVersionString') + ->willReturn($versionString); + + $this->assertEquals($expectedResult, $this->tools->supports4ByteCharset($this->db)); + } +} From 89ff65c91dac403e2ece78d70d83fc1c5dfb3c6f Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Sat, 30 Mar 2019 09:24:47 +0545 Subject: [PATCH 11/18] Adjust drone for PHP7.1 like master --- .drone.starlark | 5 +- .drone.yml | 161 +++++++++++------------------------------------- 2 files changed, 38 insertions(+), 128 deletions(-) diff --git a/.drone.starlark b/.drone.starlark index 986bd8a38c83..8084e702838f 100644 --- a/.drone.starlark +++ b/.drone.starlark @@ -30,7 +30,6 @@ config = { }, 'reducedDatabases' : { 'phpVersions': [ - '7.0', '7.2', '7.3', ], @@ -983,9 +982,9 @@ def phptests(testType): errorFound = False default = { - 'phpVersions': ['7.0', '7.1', '7.2', '7.3'], + 'phpVersions': ['7.1', '7.2', '7.3'], 'databases': [ - 'sqlite', 'mariadb:10.2', 'mariadb:10.3', 'mysql:5.5', 'mysql:5.7', 'mysql:8.0', 'postgres:9.4', 'oracle' + 'sqlite', 'mariadb:10.2', 'mariadb:10.3', 'mysql:5.5', 'mysql:5.7', 'mysql:8.0', 'postgres:9.4', 'postgres:10.3', 'oracle' ], 'coverage': True, 'includeKeyInMatrixName': False, diff --git a/.drone.yml b/.drone.yml index 90760913f717..f0b92a122d0d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2234,7 +2234,7 @@ depends_on: --- kind: pipeline type: docker -name: phpunit-php7.1-oracle +name: phpunit-php7.1-postgres10.3 platform: os: linux @@ -2299,7 +2299,7 @@ steps: - php occ security:certificates:import /drone/server.crt - php occ security:certificates environment: - DB_TYPE: oracle + DB_TYPE: postgres - name: fix-permissions pull: always @@ -2321,7 +2321,7 @@ steps: - su-exec www-data bash tests/drone/test-phpunit.sh environment: COVERAGE: true - DB_TYPE: oracle + DB_TYPE: postgres - name: coverage-upload pull: always @@ -2342,14 +2342,13 @@ steps: - drone.owncloud.com services: -- name: oracle +- name: postgres pull: always - image: deepdiver/docker-oracle-xe-11g:latest + image: postgres:10.3 environment: - ORACLE_DB: XE - ORACLE_DISABLE_ASYNCH_IO: true - ORACLE_PASSWORD: oracle - ORACLE_USER: system + POSTGRES_DB: owncloud + POSTGRES_PASSWORD: owncloud + POSTGRES_USER: owncloud trigger: ref: @@ -2367,7 +2366,7 @@ depends_on: --- kind: pipeline type: docker -name: phpunit-php7.0-sqlite +name: phpunit-php7.1-oracle platform: os: linux @@ -2396,7 +2395,7 @@ steps: - name: composer-install pull: always - image: owncloudci/php:7.0 + image: owncloudci/php:7.1 commands: - make install-composer-deps environment: @@ -2404,7 +2403,7 @@ steps: - name: vendorbin-install pull: always - image: owncloudci/php:7.0 + image: owncloudci/php:7.1 commands: - make vendor-bin-deps environment: @@ -2412,7 +2411,7 @@ steps: - name: yarn-install pull: always - image: owncloudci/php:7.0 + image: owncloudci/php:7.1 commands: - make install-nodejs-deps environment: @@ -2422,7 +2421,7 @@ steps: - name: install-server pull: always - image: owncloudci/php:7.0 + image: owncloudci/php:7.1 commands: - bash tests/drone/install-server.sh - php occ a:l @@ -2432,11 +2431,11 @@ steps: - php occ security:certificates:import /drone/server.crt - php occ security:certificates environment: - DB_TYPE: sqlite + DB_TYPE: oracle - name: fix-permissions pull: always - image: owncloudci/php:7.0 + image: owncloudci/php:7.1 commands: - chown -R www-data /drone/src @@ -2449,127 +2448,40 @@ steps: - name: phpunit-tests pull: always - image: owncloudci/php:7.0 + image: owncloudci/php:7.1 commands: - su-exec www-data bash tests/drone/test-phpunit.sh environment: - COVERAGE: false - DB_TYPE: sqlite - -trigger: - ref: - - refs/pull/** - - refs/tags/** - - refs/heads/master - -depends_on: -- coding-standard-php7.3 -- phpstan-php7.1 -- phan-php7.1 -- phan-php7.2 -- phan-php7.3 - ---- -kind: pipeline -type: docker -name: phpunit-php7.0-mariadb10.2 - -platform: - os: linux - arch: amd64 - -workspace: - base: /drone - path: src + COVERAGE: true + DB_TYPE: oracle -steps: -- name: cache-restore +- name: coverage-upload pull: always - image: plugins/s3-cache:1 + image: plugins/codecov:2 settings: - access_key: - from_secret: cache_s3_access_key - endpoint: - from_secret: cache_s3_endpoint - restore: true - secret_key: - from_secret: cache_s3_secret_key + files: + - "*.xml" + flags: + - phpunit + paths: + - tests/output/coverage + environment: + CODECOV_TOKEN: + from_secret: codecov_token when: instance: - drone.owncloud.services - drone.owncloud.com -- name: composer-install - pull: always - image: owncloudci/php:7.0 - commands: - - make install-composer-deps - environment: - COMPOSER_HOME: /drone/src/.cache/composer - -- name: vendorbin-install - pull: always - image: owncloudci/php:7.0 - commands: - - make vendor-bin-deps - environment: - COMPOSER_HOME: /drone/src/.cache/composer - -- name: yarn-install - pull: always - image: owncloudci/php:7.0 - commands: - - make install-nodejs-deps - environment: - NPM_CONFIG_CACHE: /drone/src/.cache/npm - YARN_CACHE_FOLDER: /drone/src/.cache/yarn - bower_storage__packages: /drone/src/.cache/bower - -- name: install-server - pull: always - image: owncloudci/php:7.0 - commands: - - bash tests/drone/install-server.sh - - php occ a:l - - php occ config:system:set trusted_domains 1 --value=server - - php occ log:manage --level 2 - - php occ config:list - - php occ security:certificates:import /drone/server.crt - - php occ security:certificates - environment: - DB_TYPE: mariadb - -- name: fix-permissions - pull: always - image: owncloudci/php:7.0 - commands: - - chown -R www-data /drone/src - -- name: owncloud-log-server - pull: always - image: owncloud/ubuntu:18.04 - detach: true - commands: - - tail -f /drone/src/data/owncloud.log - -- name: phpunit-tests - pull: always - image: owncloudci/php:7.0 - commands: - - su-exec www-data bash tests/drone/test-phpunit.sh - environment: - COVERAGE: false - DB_TYPE: mariadb - services: -- name: mariadb +- name: oracle pull: always - image: mariadb:10.2 + image: deepdiver/docker-oracle-xe-11g:latest environment: - MYSQL_DATABASE: owncloud - MYSQL_PASSWORD: owncloud - MYSQL_ROOT_PASSWORD: owncloud - MYSQL_USER: owncloud + ORACLE_DB: XE + ORACLE_DISABLE_ASYNCH_IO: true + ORACLE_PASSWORD: oracle + ORACLE_USER: system trigger: ref: @@ -14628,9 +14540,8 @@ depends_on: - phpunit-php7.1-mysql5.7 - phpunit-php7.1-mysql8.0 - phpunit-php7.1-postgres9.4 +- phpunit-php7.1-postgres10.3 - phpunit-php7.1-oracle -- phpunit-php7.0-sqlite -- phpunit-php7.0-mariadb10.2 - phpunit-php7.2-sqlite - phpunit-php7.2-mariadb10.2 - phpunit-php7.3-sqlite From 4122887d9d2f8409157b3bf7456ac18f66a1cc91 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 11 Jul 2019 09:04:24 +0545 Subject: [PATCH 12/18] Use is_iterable for PHP7.1 --- tests/acceptance/features/bootstrap/Sharing.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/acceptance/features/bootstrap/Sharing.php b/tests/acceptance/features/bootstrap/Sharing.php index 2a7edd7be63b..40adfc6e625b 100644 --- a/tests/acceptance/features/bootstrap/Sharing.php +++ b/tests/acceptance/features/bootstrap/Sharing.php @@ -812,9 +812,7 @@ public function isUserOrGroupInSharedData($userOrGroup, $permissions = null) { } $data = $this->getResponseXml()->data[0]; - if (\is_array($data) - || (\is_object($data) && ($data instanceof \Traversable)) - ) { + if (\is_iterable($data)) { foreach ($data as $element) { if ($element->share_with->__toString() === $userOrGroup && ($permissions === null From 3a1c928c234b84c7d88b1774bf67f1178dc1eb92 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 11 Jul 2019 09:14:51 +0545 Subject: [PATCH 13/18] Update to PHP 7.1 in travis - in case we use it --- .travis.yml | 152 ++++++++++++++++++++++++++-------------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/.travis.yml b/.travis.yml index 12d3504cddc1..efadf06f191a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ sudo: false language: php php: - - 7.0 + - 7.1 cache: directories: @@ -54,525 +54,525 @@ script: matrix: include: - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUILogin" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIFavorites" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIManageUsersGroups" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIManageQuota" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIPersonalSettings" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIFiles" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIMoveFilesFolders" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIRenameFiles" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIRenameFolders" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUITrashbin" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUISharingInternalGroups" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUISharingInternalUsers" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUISharingExternal" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIRestrictSharing" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest" BEHAT_SUITE="webUIUpload" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUILogin" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIFavorites" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIManageUsersGroups" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIManageQuota" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIPersonalSettings" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIFiles" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIMoveFilesFolders" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIRenameFiles" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIRenameFolders" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUITrashbin" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUISharingInternalGroups" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUISharingInternalUsers" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUISharingExternal" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIRestrictSharing" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="firefox" BROWSER_VERSION="57.0" BEHAT_SUITE="webUIUpload" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUILogin" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIFavorites" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIManageUsersGroups" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIManageQuota" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIPersonalSettings" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIFiles" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIMoveFilesFolders" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIRenameFiles" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIRenameFolders" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUITrashbin" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUISharingInternalGroups" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUISharingInternalUsers" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUISharingExternal" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIRestrictSharing" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="chrome" BROWSER_VERSION="latest-1" BEHAT_SUITE="webUIUpload" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUILogin" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIFavorites" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIManageUsersGroups" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIManageQuota" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIPersonalSettings" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIFiles" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIMoveFilesFolders" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIRenameFiles" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIRenameFolders" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUITrashbin" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUISharingInternalGroups" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUISharingInternalUsers" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUISharingExternal" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIRestrictSharing" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="MicrosoftEdge" BROWSER_VERSION="latest" BEHAT_SUITE="webUIUpload" PLATFORM="Windows 10" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUILogin" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIFavorites" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIManageUsersGroups" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIManageQuota" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIPersonalSettings" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIFiles" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIMoveFilesFolders" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIRenameFiles" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIRenameFolders" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUITrashbin" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUISharingInternalGroups" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUISharingInternalUsers" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUISharingExternal" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIRestrictSharing" PLATFORM="Windows 7" TEST_DAV=0 addons: apt: *common_apt hosts: *common_hosts sauce_connect: true - - php: 7.0 + - php: 7.1 if: type = cron env: DB=pgsql TC=selenium BROWSER="internet explorer" BROWSER_VERSION="11.0" BEHAT_SUITE="webUIUpload" PLATFORM="Windows 7" TEST_DAV=0 addons: From 4b05fc90fdce4fc091d4f7ca9d308a84dd254814 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 11 Jul 2019 09:20:03 +0545 Subject: [PATCH 14/18] Put back empty line in db_structure.xml that was removed by PR 34783 --- db_structure.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/db_structure.xml b/db_structure.xml index f6f07ae002b3..e65060897583 100644 --- a/db_structure.xml +++ b/db_structure.xml @@ -724,6 +724,7 @@ false + last_checked From 326e35705dc4f74c107187a254ab446f0a8ccba6 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 11 Jul 2019 09:22:47 +0545 Subject: [PATCH 15/18] Remove special PHP7.0 checks from Makefile --- Makefile | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Makefile b/Makefile index 76ecc814d0c0..b20efafbfbed 100644 --- a/Makefile +++ b/Makefile @@ -392,17 +392,8 @@ vendor-bin/phan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phan/compo vendor-bin/phan/composer.lock: vendor-bin/phan/composer.json @echo phan composer.lock is not up to date. -# The first line of "php --version" output looks like: -# PHP 7.2.16-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:23:29) ( NTS ) -# We want the 2nd "word", then the first 2 numbers separated by the dot -PHP_MINOR_VERSION = $(shell php --version | head -n 1 | cut -d' ' -f2 | cut -d'.' -f1-2) - vendor-bin/phpstan/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/phpstan/composer.lock -ifeq "$(PHP_MINOR_VERSION)" "7.0" - @echo "phpstan is not supported on PHP 7.0 so it is not being installed" -else composer bin phpstan install --no-progress -endif vendor-bin/phpstan/composer.lock: vendor-bin/phpstan/composer.json @echo phpstan composer.lock is not up to date. From 05d71b78bb49d4210069c76b5e1c9a2f72e98424 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 11 Jul 2019 09:38:48 +0545 Subject: [PATCH 16/18] Make sure to have at least doctrine/dbal 2.8 --- composer.json | 2 +- composer.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index e2bcd869f6ef..c9b168c77608 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "require": { "php": ">=7.1", - "doctrine/dbal": "^2.5", + "doctrine/dbal": "^2.8", "phpseclib/phpseclib": "^2.0", "jeremeamia/superclosure": "^2.4", "bantu/ini-get-wrapper": "v1.0.1", diff --git a/composer.lock b/composer.lock index 6e2527f1e257..0ae376cb7ce6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "03c94f2c4cfdfa32385ea580fb4b2a14", + "content-hash": "536facd7a486ca996db958f5e9d02102", "packages": [ { "name": "bantu/ini-get-wrapper", From 13a1b6c40253d573edf8ef305f975e8adf428cb8 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 31 Jul 2019 16:17:27 +0545 Subject: [PATCH 17/18] Revert "Revert void return type declarations that are not valid in PHP 7.0" This reverts commit 2a7d8ea5f6c45b85ed67285678d91aab33eceb71. --- .../tests/unit/Dav/EntityCollectionTest.php | 14 +++++++------- tests/lib/AutoLoaderTest.php | 8 ++++---- tests/lib/Mail/MailerTest.php | 16 ++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/apps/comments/tests/unit/Dav/EntityCollectionTest.php b/apps/comments/tests/unit/Dav/EntityCollectionTest.php index d2010513e7a3..460283752a47 100644 --- a/apps/comments/tests/unit/Dav/EntityCollectionTest.php +++ b/apps/comments/tests/unit/Dav/EntityCollectionTest.php @@ -66,11 +66,11 @@ public function setUp() { ); } - public function testGetId() { + public function testGetId(): void { $this->assertSame($this->collection->getId(), '19'); } - public function testGetChild() { + public function testGetChild(): void { $this->commentsManager->expects($this->once()) ->method('get') ->with('55') @@ -83,7 +83,7 @@ public function testGetChild() { /** * @expectedException \Sabre\DAV\Exception\NotFound */ - public function testGetChildException() { + public function testGetChildException(): void { $this->commentsManager->expects($this->once()) ->method('get') ->with('55') @@ -92,7 +92,7 @@ public function testGetChildException() { $this->collection->getChild('55'); } - public function testGetChildren() { + public function testGetChildren(): void { $this->commentsManager->expects($this->once()) ->method('getForObject') ->with('files', '19') @@ -104,7 +104,7 @@ public function testGetChildren() { $this->assertInstanceOf(\OCA\Comments\Dav\CommentNode::class, $result[0]); } - public function testFindChildren() { + public function testFindChildren(): void { $dt = new \DateTime('2016-01-10 18:48:00'); $this->commentsManager->expects($this->once()) ->method('getForObject') @@ -117,11 +117,11 @@ public function testFindChildren() { $this->assertInstanceOf(\OCA\Comments\Dav\CommentNode::class, $result[0]); } - public function testChildExistsTrue() { + public function testChildExistsTrue(): void { $this->assertTrue($this->collection->childExists('44')); } - public function testChildExistsFalse() { + public function testChildExistsFalse(): void { $this->commentsManager->expects($this->once()) ->method('get') ->with('44') diff --git a/tests/lib/AutoLoaderTest.php b/tests/lib/AutoLoaderTest.php index 08a335a19b8e..ed431360e32f 100644 --- a/tests/lib/AutoLoaderTest.php +++ b/tests/lib/AutoLoaderTest.php @@ -21,22 +21,22 @@ protected function setUp() { $this->loader = new AutoLoader(); } - public function testLoadPublicNamespace() { + public function testLoadPublicNamespace(): void { $this->assertEquals([], $this->loader->findClass('OCP\Foo\Bar')); } - public function testLoadAppNamespace() { + public function testLoadAppNamespace(): void { $result = $this->loader->findClass('OCA\Files\Foobar'); $this->assertCount(2, $result); $this->assertStringEndsWith('apps/files/foobar.php', $result[0]); $this->assertStringEndsWith('apps/files/lib/foobar.php', $result[1]); } - public function testLoadCoreNamespaceCore() { + public function testLoadCoreNamespaceCore(): void { $this->assertEquals([], $this->loader->findClass('OC\Core\Foo\Bar')); } - public function testLoadCoreNamespaceSettings() { + public function testLoadCoreNamespaceSettings(): void { $this->assertEquals([], $this->loader->findClass('OC\Settings\Foo\Bar')); } } diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php index 978bd21b5b33..01706b8001b6 100644 --- a/tests/lib/Mail/MailerTest.php +++ b/tests/lib/Mail/MailerTest.php @@ -37,7 +37,7 @@ public function setUp() { $this->mailer = new Mailer($this->config, $this->logger, $this->defaults); } - public function testGetSendMailInstanceSendMail() { + public function testGetSendMailInstanceSendMail(): void { $this->config ->expects($this->once()) ->method('getSystemValue') @@ -49,7 +49,7 @@ public function testGetSendMailInstanceSendMail() { $this->assertEquals('/usr/sbin/sendmail -bs', $mailer->getCommand()); } - public function testGetSendMailInstanceSendMailQmail() { + public function testGetSendMailInstanceSendMailQmail(): void { $this->config ->expects($this->once()) ->method('getSystemValue') @@ -60,11 +60,11 @@ public function testGetSendMailInstanceSendMailQmail() { $this->assertEquals('/var/qmail/bin/sendmail -bs', $mailer->getCommand()); } - public function testGetInstanceDefault() { + public function testGetInstanceDefault(): void { $this->assertInstanceOf(\Swift_Mailer::class, self::invokePrivate($this->mailer, 'getInstance')); } - public function testGetInstanceSendmail() { + public function testGetInstanceSendmail(): void { $this->config ->method('getSystemValue') ->will($this->returnValue('sendmail')); @@ -72,14 +72,14 @@ public function testGetInstanceSendmail() { $this->assertInstanceOf(\Swift_Mailer::class, self::invokePrivate($this->mailer, 'getInstance')); } - public function testCreateMessage() { + public function testCreateMessage(): void { $this->assertInstanceOf(Message::class, $this->mailer->createMessage()); } /** * @expectedException \Exception */ - public function testSendInvalidMailException() { + public function testSendInvalidMailException(): void { /** @var Message | \PHPUnit\Framework\MockObject\MockObject $message */ $message = $this->getMockBuilder(Message::class) ->disableOriginalConstructor()->getMock(); @@ -108,11 +108,11 @@ public function mailAddressProvider(): array { /** * @dataProvider mailAddressProvider */ - public function testValidateMailAddress($email, $expected) { + public function testValidateMailAddress($email, $expected): void { $this->assertSame($expected, $this->mailer->validateMailAddress($email)); } - public function testLogEntry() { + public function testLogEntry(): void { $this->mailer = $this->getMockBuilder(Mailer::class) ->setConstructorArgs([$this->config, $this->logger, $this->defaults]) ->setMethods(['getInstance']) From 967ccacf80cac3fb19e0352deb0ea9deaa20c92e Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 7 Nov 2019 13:25:41 +0545 Subject: [PATCH 18/18] Handle inline column comments in DbHandlerTest.php --- apps/federation/tests/DbHandlerTest.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/apps/federation/tests/DbHandlerTest.php b/apps/federation/tests/DbHandlerTest.php index c0ad31fde4d4..8ad1bc06ebd4 100644 --- a/apps/federation/tests/DbHandlerTest.php +++ b/apps/federation/tests/DbHandlerTest.php @@ -161,8 +161,16 @@ public function testAddToken() { $this->dbHandler->addServer('server1'); $query = $this->connection->getQueryBuilder()->select('*')->from($this->dbTable); $result = $query->execute()->fetchAll(); + $resultToken = $result[0]['token']; + // MySQL and sqLite support inline column comments in doctrine/dbal + // When the result is null, and the database has been created with column comments, + // then dbal can return a string like: + // 'NULL --token used to exchange the shared secret' + if (\is_string($resultToken) && (\substr($resultToken, 0, 4) === 'NULL')) { + $resultToken = null; + } $this->assertCount(1, $result); - $this->assertNull($result[0]['token']); + $this->assertNull($resultToken); $this->dbHandler->addToken('http://server1', 'token'); $query = $this->connection->getQueryBuilder()->select('*')->from($this->dbTable); $result = $query->execute()->fetchAll(); @@ -182,8 +190,16 @@ public function testAddSharedSecret() { $this->dbHandler->addServer('server1'); $query = $this->connection->getQueryBuilder()->select('*')->from($this->dbTable); $result = $query->execute()->fetchAll(); + $resultToken = $result[0]['shared_secret']; + // MySQL and sqLite support inline column comments in doctrine/dbal + // When the result is null, and the database has been created with column comments, + // then dbal can return a string like: + // 'NULL --shared secret used to authenticate' + if (\is_string($resultToken) && (\substr($resultToken, 0, 4) === 'NULL')) { + $resultToken = null; + } $this->assertCount(1, $result); - $this->assertNull($result[0]['shared_secret']); + $this->assertNull($resultToken); $this->dbHandler->addSharedSecret('http://server1', 'secret'); $query = $this->connection->getQueryBuilder()->select('*')->from($this->dbTable); $result = $query->execute()->fetchAll();