diff --git a/.drone.yml b/.drone.yml
index b68f9634607e..6972ef97027e 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -60,14 +60,21 @@ pipeline:
composer:
image: owncloudci/php:${PHP_VERSION}
pull: true
+ environment:
+ - COMPOSER_HOME=/drone/src/.cache/composer
commands:
- make install-composer-deps
+ - make vendor-bin-deps
when:
event: [push, pull_request]
yarn:
image: owncloudci/nodejs:latest
pull: true
+ environment:
+ - NPM_CONFIG_CACHE=/drone/src/.cache/npm
+ - YARN_CACHE_FOLDER=/drone/src/.cache/yarn
+ - bower_storage__packages=/drone/src/.cache/bower
commands:
- ./tests/drone/yarn-install.sh
when:
@@ -79,9 +86,7 @@ pipeline:
secrets: [ cache_s3_endpoint, cache_s3_access_key, cache_s3_secret_key ]
rebuild: true
mount:
- - lib/composer
- - core/vendor
- - build/node_modules
+ - .cache
when:
local: false
event: [ push ]
@@ -116,7 +121,7 @@ pipeline:
- make test-php-phan
when:
matrix:
- TEST_SUITE: phan
+ TEST_SUITE: phan-70
php-phan-71:
image: owncloudci/php:7.1
@@ -629,19 +634,15 @@ matrix:
PHP_VERSION: 7.1
COVERAGE: true
- - PHP_VERSION: 5.6
- DB_TYPE: postgres
- TEST_SUITE: phpunit
- INSTALL_SERVER: true
- INSTALL_TESTING_APP: true
-
# owncloud-coding-standard
- # Run with PHP 5.6 because that is not supported by phan.
- # This gives us a syntax check for PHP 5.6
- - PHP_VERSION: 5.6
+ - PHP_VERSION: 7.1
TEST_SUITE: owncloud-coding-standard
- # phan (runs multiple PHP v7.* to provide syntax checks of each PHP version)
+ # phan (runs on just PHP 7.0 because that has different dependencies for phan)
+ - TEST_SUITE: phan-70
+ PHP_VERSION: 7.0
+
+ # phan (runs multiple PHP v7.1+ to provide syntax checks of each PHP version)
- TEST_SUITE: phan
PHP_VERSION: 7.1
@@ -688,6 +689,31 @@ matrix:
INSTALL_SERVER: true
INSTALL_TESTING_APP: true
+ # PHP 7.0
+ - PHP_VERSION: 7.0
+ DB_TYPE: mysql
+ TEST_SUITE: phpunit
+ INSTALL_SERVER: true
+ INSTALL_TESTING_APP: true
+
+ - PHP_VERSION: 7.0
+ DB_TYPE: mysqlmb4
+ TEST_SUITE: phpunit
+ INSTALL_SERVER: true
+ INSTALL_TESTING_APP: true
+
+ - PHP_VERSION: 7.0
+ DB_TYPE: postgres
+ TEST_SUITE: phpunit
+ INSTALL_SERVER: true
+ INSTALL_TESTING_APP: true
+
+ - PHP_VERSION: 7.0
+ DB_TYPE: oracle
+ TEST_SUITE: phpunit
+ INSTALL_SERVER: true
+ INSTALL_TESTING_APP: true
+
# PHP 7.2
- PHP_VERSION: 7.2
DB_TYPE: sqlite
@@ -735,7 +761,7 @@ matrix:
INSTALL_TESTING_APP: true
# Primary Objectstorage
- - PHP_VERSION: 5.6
+ - PHP_VERSION: 7.0
TEST_SUITE: phpunit
DB_TYPE: sqlite
OBJECTSTORE: swift
@@ -1462,7 +1488,7 @@ matrix:
CALDAV_CARDDAV_JOB: true
# encryption tests
- - PHP_VERSION: 5.6
+ - PHP_VERSION: 7.0
TEST_SUITE: cli
BEHAT_SUITE: cliEncryption
DB_TYPE: mariadb
diff --git a/.gitignore b/.gitignore
index ef7a507e4d44..2d1088ccaf70 100644
--- a/.gitignore
+++ b/.gitignore
@@ -133,3 +133,6 @@ clover.xml
/tests/output
.php_cs.cache
.php_cs
+
+# CI
+.cache
diff --git a/Makefile b/Makefile
index 43599daf80db..ff2bfd6ea321 100644
--- a/Makefile
+++ b/Makefile
@@ -363,6 +363,9 @@ vendor: composer.lock
vendor/bamarni/composer-bin-plugin: composer.lock
composer install
+.PHONY: vendor-bin-deps
+vendor-bin-deps: vendor-bin/owncloud-codestyle/vendor vendor-bin/php_codesniffer/vendor vendor-bin/phan/vendor vendor-bin/phpstan/vendor vendor-bin/behat/vendor
+
vendor-bin/owncloud-codestyle/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/owncloud-codestyle/composer.lock
composer bin owncloud-codestyle install --no-progress
@@ -381,8 +384,17 @@ 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.
diff --git a/composer.json b/composer.json
index 3de8a248cd8d..beaeca6a7a7b 100644
--- a/composer.json
+++ b/composer.json
@@ -7,7 +7,7 @@
"optimize-autoloader": true,
"classmap-authoritative": false,
"platform": {
- "php": "5.6.33"
+ "php": "7.0.8"
}
},
"autoload" : {
@@ -26,7 +26,7 @@
"roave/security-advisories": "dev-master"
},
"require": {
- "php": ">=5.6",
+ "php": ">=7.0.8",
"doctrine/dbal": "^2.5",
"phpseclib/phpseclib": "^2.0",
"rackspace/php-opencloud": "v1.9.2",
diff --git a/composer.lock b/composer.lock
index 5bc7b7f5c763..fffe6d0d3103 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1,10 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "27778b04ad8239c0cac828d5652a8af3",
+ "content-hash": "afd1118f0042ec2baa0f68468c644cb0",
"packages": [
{
"name": "bantu/ini-get-wrapper",
@@ -587,33 +587,33 @@
},
{
"name": "doctrine/inflector",
- "version": "v1.1.0",
+ "version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
- "reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
+ "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
- "reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
+ "url": "https://api.github.com/repos/doctrine/inflector/zipball/e11d84c6e018beedd929cff5220969a3c6d1d462",
+ "reference": "e11d84c6e018beedd929cff5220969a3c6d1d462",
"shasum": ""
},
"require": {
- "php": ">=5.3.2"
+ "php": "^7.0"
},
"require-dev": {
- "phpunit/phpunit": "4.*"
+ "phpunit/phpunit": "^6.2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "1.2.x-dev"
}
},
"autoload": {
- "psr-0": {
- "Doctrine\\Common\\Inflector\\": "lib/"
+ "psr-4": {
+ "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -650,7 +650,7 @@
"singularize",
"string"
],
- "time": "2015-11-06T14:35:42+00:00"
+ "time": "2017-07-22T12:18:28+00:00"
},
{
"name": "doctrine/lexer",
@@ -1380,33 +1380,29 @@
},
{
"name": "paragonie/random_compat",
- "version": "v2.0.18",
+ "version": "v9.99.99",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
- "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db"
+ "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0a58ef6e3146256cc3dc7cc393927bcc7d1b72db",
- "reference": "0a58ef6e3146256cc3dc7cc393927bcc7d1b72db",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
+ "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95",
"shasum": ""
},
"require": {
- "php": ">=5.2.0"
+ "php": "^7"
},
"require-dev": {
- "phpunit/phpunit": "4.*|5.*"
+ "phpunit/phpunit": "4.*|5.*",
+ "vimeo/psalm": "^1"
},
"suggest": {
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
},
"type": "library",
- "autoload": {
- "files": [
- "lib/random.php"
- ]
- },
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
@@ -1425,7 +1421,7 @@
"pseudorandom",
"random"
],
- "time": "2019-01-03T20:59:08+00:00"
+ "time": "2018-07-02T15:55:56+00:00"
},
{
"name": "patchwork/jsqueeze",
@@ -3762,29 +3758,35 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "3.3.2",
+ "version": "4.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2"
+ "reference": "94fd0001232e47129dd3504189fa1c7225010d08"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2",
- "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
+ "reference": "94fd0001232e47129dd3504189fa1c7225010d08",
"shasum": ""
},
"require": {
- "php": "^5.6 || ^7.0",
+ "php": "^7.0",
"phpdocumentor/reflection-common": "^1.0.0",
"phpdocumentor/type-resolver": "^0.4.0",
"webmozart/assert": "^1.0"
},
"require-dev": {
- "mockery/mockery": "^0.9.4",
- "phpunit/phpunit": "^4.4"
+ "doctrine/instantiator": "~1.0.5",
+ "mockery/mockery": "^1.0",
+ "phpunit/phpunit": "^6.4"
},
"type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.x-dev"
+ }
+ },
"autoload": {
"psr-4": {
"phpDocumentor\\Reflection\\": [
@@ -3803,7 +3805,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
- "time": "2017-11-10T14:09:06+00:00"
+ "time": "2017-11-30T07:14:17+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@@ -4117,29 +4119,29 @@
},
{
"name": "phpunit/php-token-stream",
- "version": "1.4.12",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
- "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
+ "reference": "791198a2c6254db10131eecfe8c06670700904db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
- "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db",
+ "reference": "791198a2c6254db10131eecfe8c06670700904db",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
- "php": ">=5.3.3"
+ "php": "^7.0"
},
"require-dev": {
- "phpunit/phpunit": "~4.2"
+ "phpunit/phpunit": "^6.2.4"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.4-dev"
+ "dev-master": "2.0-dev"
}
},
"autoload": {
@@ -4162,7 +4164,7 @@
"keywords": [
"tokenizer"
],
- "time": "2017-12-04T08:55:13+00:00"
+ "time": "2017-11-27T05:48:46+00:00"
},
{
"name": "phpunit/phpunit",
@@ -4312,12 +4314,12 @@
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
- "reference": "4e04718428742618a4bf24dafca45b8645c9320d"
+ "reference": "3521da8036ce31b11490433aaae47f9601774191"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/4e04718428742618a4bf24dafca45b8645c9320d",
- "reference": "4e04718428742618a4bf24dafca45b8645c9320d",
+ "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3521da8036ce31b11490433aaae47f9601774191",
+ "reference": "3521da8036ce31b11490433aaae47f9601774191",
"shasum": ""
},
"conflict": {
@@ -4454,7 +4456,7 @@
"theonedemon/phpwhois": "<=4.2.5",
"titon/framework": ">=0,<9.9.99",
"truckersmp/phpwhois": "<=4.3.1",
- "twig/twig": "<1.20",
+ "twig/twig": "<1.38|>=2,<2.7",
"typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.23|>=9,<9.5.4",
"typo3/cms-core": ">=8,<8.7.23|>=9,<9.5.4",
"typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5",
@@ -4508,7 +4510,7 @@
}
],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
- "time": "2019-02-26T21:14:50+00:00"
+ "time": "2019-03-12T13:04:55+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@@ -5068,7 +5070,7 @@
},
{
"name": "Gert de Pagter",
- "email": "backendtea@gmail.com"
+ "email": "BackEndTea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
@@ -5200,11 +5202,11 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": ">=5.6",
+ "php": ">=7.0.8",
"ext-json": "*"
},
"platform-dev": [],
"platform-overrides": {
- "php": "5.6.33"
+ "php": "7.0.8"
}
}
diff --git a/console.php b/console.php
index 4271c033be1e..b1257f634fae 100644
--- a/console.php
+++ b/console.php
@@ -33,10 +33,10 @@
\define('OC_CONSOLE', 1);
-// Show warning if a PHP version below 5.6.0 is used, this has to happen here
-// because base.php will already use 5.6 syntax.
-if (\version_compare(PHP_VERSION, '5.6.0') === -1) {
- echo 'This version of ownCloud requires at least PHP 5.6.0'.PHP_EOL;
+// 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;
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 57f04b2ecbb5..c65dfe52c4d8 100644
--- a/index.php
+++ b/index.php
@@ -27,10 +27,10 @@
*
*/
-// Show warning if a PHP version below 5.6.0 is used, this has to happen here
-// because base.php will already use 5.6 syntax.
-if (\version_compare(PHP_VERSION, '5.6.0') === -1) {
- echo 'This version of ownCloud requires at least PHP 5.6.0
';
+// 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
';
echo 'You are currently running PHP ' . PHP_VERSION . '. Please update your PHP version.';
return;
}