From 34cd7da5f587cd7749b3b91df6f644f202585599 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:13:04 +0000 Subject: [PATCH 1/2] build(deps-dev): Bump nextcloud/coding-standard from 1.2.1 to 1.3.2 Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 1.2.1 to 1.3.2. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v1.2.1...v1.3.2) --- updated-dependencies: - dependency-name: nextcloud/coding-standard dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 263 ++++++++++++++++++++++++++++---------------------- 1 file changed, 146 insertions(+), 117 deletions(-) diff --git a/composer.lock b/composer.lock index 0e235ad4..068de5b0 100644 --- a/composer.lock +++ b/composer.lock @@ -56,16 +56,16 @@ }, { "name": "symfony/console", - "version": "v5.4.35", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "dbdf6adcb88d5f83790e1efb57ef4074309d3931" + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/dbdf6adcb88d5f83790e1efb57ef4074309d3931", - "reference": "dbdf6adcb88d5f83790e1efb57ef4074309d3931", + "url": "https://api.github.com/repos/symfony/console/zipball/c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", + "reference": "c4ba980ca61a9eb18ee6bcc73f28e475852bb1ed", "shasum": "" }, "require": { @@ -135,7 +135,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.35" + "source": "https://github.com/symfony/console/tree/v5.4.47" }, "funding": [ { @@ -151,20 +151,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:28:09+00:00" + "time": "2024-11-06T11:30:55+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", "shasum": "" }, "require": { @@ -172,12 +172,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -202,7 +202,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" }, "funding": [ { @@ -218,24 +218,24 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -245,12 +245,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -284,7 +281,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -300,36 +297,33 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -365,7 +359,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -381,36 +375,33 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -449,7 +440,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -465,24 +456,24 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -492,12 +483,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -532,7 +520,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -548,33 +536,30 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.28.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -611,7 +596,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -627,33 +612,30 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -694,7 +676,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -710,20 +692,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.2", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300", + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300", "shasum": "" }, "require": { @@ -739,12 +721,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -777,7 +759,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.4" }, "funding": [ { @@ -793,20 +775,20 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/string", - "version": "v5.4.35", + "version": "v5.4.47", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "c209c4d0559acce1c9a2067612cfb5d35756edc2" + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/c209c4d0559acce1c9a2067612cfb5d35756edc2", - "reference": "c209c4d0559acce1c9a2067612cfb5d35756edc2", + "url": "https://api.github.com/repos/symfony/string/zipball/136ca7d72f72b599f2631aca474a4f8e26719799", + "reference": "136ca7d72f72b599f2631aca474a4f8e26719799", "shasum": "" }, "require": { @@ -863,7 +845,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.35" + "source": "https://github.com/symfony/string/tree/v5.4.47" }, "funding": [ { @@ -879,7 +861,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-11-10T20:33:58+00:00" } ], "packages-dev": [ @@ -940,21 +922,68 @@ }, "time": "2022-10-31T08:38:03+00:00" }, + { + "name": "kubawerlos/php-cs-fixer-custom-fixers", + "version": "v3.22.0", + "source": { + "type": "git", + "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-tokenizer": "*", + "friendsofphp/php-cs-fixer": "^3.61.1", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6.4 || ^10.5.29" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpCsFixerCustomFixers\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kuba Werłos", + "email": "werlos@gmail.com" + } + ], + "description": "A set of custom fixers for PHP CS Fixer", + "support": { + "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", + "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" + }, + "time": "2024-08-16T20:44:35+00:00" + }, { "name": "nextcloud/coding-standard", - "version": "v1.2.1", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e" + "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e", - "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", + "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", "shasum": "" }, "require": { + "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", "php": "^7.3|^8.0", "php-cs-fixer/shim": "^3.17" }, @@ -977,22 +1006,22 @@ "description": "Nextcloud coding standards for the php cs fixer", "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.1" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2" }, - "time": "2024-02-01T14:54:37+00:00" + "time": "2024-10-14T16:49:05+00:00" }, { "name": "php-cs-fixer/shim", - "version": "v3.51.0", + "version": "v3.68.5", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "a792394f7f3934f75a4df9dca544796c6f503027" + "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/a792394f7f3934f75a4df9dca544796c6f503027", - "reference": "a792394f7f3934f75a4df9dca544796c6f503027", + "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", + "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", "shasum": "" }, "require": { @@ -1029,9 +1058,9 @@ "description": "A tool to automatically fix PHP code style", "support": { "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.51.0" + "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.68.5" }, - "time": "2024-02-28T19:51:07+00:00" + "time": "2025-01-30T17:01:41+00:00" } ], "aliases": [], @@ -1044,5 +1073,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } From 81ca11011f1fb74131f103f6399c4209a8d179ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 10 Feb 2025 15:24:11 +0100 Subject: [PATCH 2/2] fix: Remove coding-standard from main composer.json and update the one in bin folder instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- composer.json | 3 +- composer.lock | 150 +-------- index.php | 54 +-- lib/UpdateCommand.php | 12 +- lib/Updater.php | 54 +-- tests/checkSameCodeBase.php | 4 +- tests/features/bootstrap/FeatureContext.php | 10 +- updater.phar | Bin 1168454 -> 1171590 bytes vendor-bin/coding-standard/composer.lock | 77 ++++- vendor/composer/autoload_classmap.php | 1 - vendor/composer/autoload_psr4.php | 1 - vendor/composer/autoload_static.php | 6 - vendor/composer/installed.json | 313 ++++++------------ vendor/composer/installed.php | 88 ++--- .../.github/workflows/lint.yml | 22 -- vendor/nextcloud/coding-standard/.gitignore | 8 - .../coding-standard/.php-cs-fixer.dist.php | 15 - vendor/nextcloud/coding-standard/CHANGELOG.md | 41 --- vendor/nextcloud/coding-standard/LICENSE | 21 -- vendor/nextcloud/coding-standard/README.md | 56 ---- .../nextcloud/coding-standard/composer.json | 21 -- .../nextcloud/coding-standard/src/Config.php | 67 ---- vendor/php-cs-fixer/shim/LICENSE | 19 -- vendor/php-cs-fixer/shim/README.md | 11 - vendor/php-cs-fixer/shim/composer.json | 35 -- vendor/php-cs-fixer/shim/logo.md | 3 - vendor/php-cs-fixer/shim/logo.png | Bin 18627 -> 0 bytes vendor/php-cs-fixer/shim/php-cs-fixer | 18 - vendor/php-cs-fixer/shim/php-cs-fixer.phar | Bin 2839217 -> 0 bytes .../php-cs-fixer/shim/php-cs-fixer.phar.asc | Bin 566 -> 0 bytes vendor/symfony/console/Application.php | 6 +- .../console/Completion/CompletionInput.php | 2 +- vendor/symfony/console/Helper/ProgressBar.php | 5 +- .../symfony/console/Helper/QuestionHelper.php | 14 +- vendor/symfony/console/Helper/Table.php | 10 +- vendor/symfony/console/Input/InputOption.php | 2 +- .../symfony/console/Output/StreamOutput.php | 45 +-- .../symfony/console/Resources/completion.bash | 2 +- vendor/symfony/console/Terminal.php | 3 +- .../symfony/deprecation-contracts/.gitignore | 3 - vendor/symfony/deprecation-contracts/LICENSE | 2 +- vendor/symfony/polyfill-ctype/composer.json | 5 +- .../polyfill-intl-grapheme/composer.json | 5 +- .../polyfill-intl-normalizer/composer.json | 5 +- vendor/symfony/polyfill-mbstring/Mbstring.php | 136 ++++++-- .../symfony/polyfill-mbstring/bootstrap.php | 21 ++ .../symfony/polyfill-mbstring/bootstrap80.php | 22 +- .../symfony/polyfill-mbstring/composer.json | 5 +- vendor/symfony/polyfill-php73/composer.json | 5 +- vendor/symfony/polyfill-php80/composer.json | 5 +- vendor/symfony/service-contracts/.gitignore | 3 - vendor/symfony/service-contracts/LICENSE | 2 +- .../ServiceSubscriberTrait.php | 9 +- .../Test/ServiceLocatorTest.php | 80 +---- .../symfony/string/AbstractUnicodeString.php | 4 +- .../string/Inflector/EnglishInflector.php | 87 +++-- vendor/symfony/string/LazyString.php | 2 +- .../Resources/data/wcswidth_table_wide.php | 46 ++- .../Resources/data/wcswidth_table_zero.php | 52 ++- 59 files changed, 611 insertions(+), 1087 deletions(-) delete mode 100644 vendor/nextcloud/coding-standard/.github/workflows/lint.yml delete mode 100644 vendor/nextcloud/coding-standard/.gitignore delete mode 100644 vendor/nextcloud/coding-standard/.php-cs-fixer.dist.php delete mode 100644 vendor/nextcloud/coding-standard/CHANGELOG.md delete mode 100644 vendor/nextcloud/coding-standard/LICENSE delete mode 100644 vendor/nextcloud/coding-standard/README.md delete mode 100644 vendor/nextcloud/coding-standard/composer.json delete mode 100644 vendor/nextcloud/coding-standard/src/Config.php delete mode 100644 vendor/php-cs-fixer/shim/LICENSE delete mode 100644 vendor/php-cs-fixer/shim/README.md delete mode 100644 vendor/php-cs-fixer/shim/composer.json delete mode 100644 vendor/php-cs-fixer/shim/logo.md delete mode 100644 vendor/php-cs-fixer/shim/logo.png delete mode 100755 vendor/php-cs-fixer/shim/php-cs-fixer delete mode 100755 vendor/php-cs-fixer/shim/php-cs-fixer.phar delete mode 100644 vendor/php-cs-fixer/shim/php-cs-fixer.phar.asc delete mode 100644 vendor/symfony/deprecation-contracts/.gitignore delete mode 100644 vendor/symfony/service-contracts/.gitignore diff --git a/composer.json b/composer.json index 81745b0e..f9d74fef 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,7 @@ "psalm:fix": "- --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "nextcloud/coding-standard": "^1.1" + "bamarni/composer-bin-plugin": "^1.8" }, "extra": { "bamarni-bin": { diff --git a/composer.lock b/composer.lock index 068de5b0..3784faa0 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": "936ba63ded5d1b8248cdb4d5673af0ea", + "content-hash": "6e5904bc2aaa546fa8b77049f5242ec4", "packages": [ { "name": "psr/container", @@ -921,157 +921,17 @@ "source": "https://github.com/bamarni/composer-bin-plugin/tree/1.8.2" }, "time": "2022-10-31T08:38:03+00:00" - }, - { - "name": "kubawerlos/php-cs-fixer-custom-fixers", - "version": "v3.22.0", - "source": { - "type": "git", - "url": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers.git", - "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kubawerlos/php-cs-fixer-custom-fixers/zipball/8701394f0c7cd450ac4fa577d24589122c1d5d5e", - "reference": "8701394f0c7cd450ac4fa577d24589122c1d5d5e", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^3.61.1", - "php": "^7.4 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.6.4 || ^10.5.29" - }, - "type": "library", - "autoload": { - "psr-4": { - "PhpCsFixerCustomFixers\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kuba Werłos", - "email": "werlos@gmail.com" - } - ], - "description": "A set of custom fixers for PHP CS Fixer", - "support": { - "issues": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/issues", - "source": "https://github.com/kubawerlos/php-cs-fixer-custom-fixers/tree/v3.22.0" - }, - "time": "2024-08-16T20:44:35+00:00" - }, - { - "name": "nextcloud/coding-standard", - "version": "v1.3.2", - "source": { - "type": "git", - "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", - "reference": "9c719c4747fa26efc12f2e8b21c14a9a75c6ba6d", - "shasum": "" - }, - "require": { - "kubawerlos/php-cs-fixer-custom-fixers": "^3.22", - "php": "^7.3|^8.0", - "php-cs-fixer/shim": "^3.17" - }, - "type": "library", - "autoload": { - "psr-4": { - "Nextcloud\\CodingStandard\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christoph Wurst", - "email": "christoph@winzerhof-wurst.at" - } - ], - "description": "Nextcloud coding standards for the php cs fixer", - "support": { - "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.3.2" - }, - "time": "2024-10-14T16:49:05+00:00" - }, - { - "name": "php-cs-fixer/shim", - "version": "v3.68.5", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/shim.git", - "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", - "reference": "4a0a5cfd39b0677017a85f0fc252d3e8a6a6c02c", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0" - }, - "replace": { - "friendsofphp/php-cs-fixer": "self.version" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." - }, - "bin": [ - "php-cs-fixer", - "php-cs-fixer.phar" - ], - "type": "application", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" - } - ], - "description": "A tool to automatically fix PHP code style", - "support": { - "issues": "https://github.com/PHP-CS-Fixer/shim/issues", - "source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.68.5" - }, - "time": "2025-01-30T17:01:41+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/index.php b/index.php index ada1679c..00105cfc 100644 --- a/index.php +++ b/index.php @@ -277,8 +277,8 @@ private function getAppDirectories(): array { throw new \Exception('Invalid configuration in apps_paths configuration key'); } $appDir = basename($appsPath['path']); - if (strpos($appsPath['path'], $this->nextcloudDir.'/') === 0) { - $relativePath = substr($appsPath['path'], strlen($this->nextcloudDir.'/')); + if (strpos($appsPath['path'], $this->nextcloudDir . '/') === 0) { + $relativePath = substr($appsPath['path'], strlen($this->nextcloudDir . '/')); if ($relativePath !== 'apps') { $expected[] = $relativePath; } @@ -305,7 +305,7 @@ private function getRecursiveDirectoryIterator(string $folder, array $excludedPa $handle = opendir($folder); if ($handle === false) { - throw new \Exception('Could not open '.$folder); + throw new \Exception('Could not open ' . $folder); } /* Store first level children in an array to avoid trouble if changes happen while iterating */ @@ -323,7 +323,7 @@ private function getRecursiveDirectoryIterator(string $folder, array $excludedPa closedir($handle); foreach ($children as $name) { - $path = $folder.'/'.$name; + $path = $folder . '/' . $name; if (is_dir($path)) { yield from $this->getRecursiveDirectoryIterator($path, []); } @@ -382,7 +382,7 @@ public function checkWritePermissions(): void { * @throws \Exception when config.php can't be written */ public function setMaintenanceMode(bool $state): void { - $this->silentLog('[info] setMaintenanceMode("' . ($state ? 'true' : 'false') . '")'); + $this->silentLog('[info] setMaintenanceMode("' . ($state ? 'true' : 'false') . '")'); if ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) { $configFileName = rtrim($dir, '/') . '/config.php'; @@ -424,7 +424,7 @@ public function createBackup(): void { ]; // Create new folder for the backup - $backupFolderLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid').'/backups/nextcloud-'.$this->getConfigOptionMandatoryString('version') . '-' . time() . '/'; + $backupFolderLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/backups/nextcloud-' . $this->getConfigOptionMandatoryString('version') . '-' . time() . '/'; $this->silentLog('[info] backup folder location: ' . $backupFolderLocation); $state = mkdir($backupFolderLocation, 0750, true); @@ -440,7 +440,7 @@ public function createBackup(): void { if (!file_exists($backupFolderLocation . '/' . $relativeDirectory)) { $state = mkdir($backupFolderLocation . '/' . $relativeDirectory, 0750, true); if ($state === false) { - throw new \Exception('Could not create folder: '.$backupFolderLocation.'/'.$relativeDirectory); + throw new \Exception('Could not create folder: ' . $backupFolderLocation . '/' . $relativeDirectory); } } @@ -501,7 +501,7 @@ private function getUpdateServerResponse(): array { $this->silentLog('[info] releaseChannel: ' . $releaseChannel); $this->silentLog('[info] internal version: ' . $this->getConfigOptionMandatoryString('version')); - $updateURL = $updaterServer . '?version='. str_replace('.', 'x', $this->getConfigOptionMandatoryString('version')) .'xxx'.$releaseChannel.'xx'.urlencode($this->buildTime).'x'.PHP_MAJOR_VERSION.'x'.PHP_MINOR_VERSION.'x'.PHP_RELEASE_VERSION; + $updateURL = $updaterServer . '?version=' . str_replace('.', 'x', $this->getConfigOptionMandatoryString('version')) . 'xxx' . $releaseChannel . 'xx' . urlencode($this->buildTime) . 'x' . PHP_MAJOR_VERSION . 'x' . PHP_MINOR_VERSION . 'x' . PHP_RELEASE_VERSION; $this->silentLog('[info] updateURL: ' . $updateURL); // Download update response @@ -523,7 +523,7 @@ private function getUpdateServerResponse(): array { /** @var false|string $response */ $response = curl_exec($curl); if ($response === false) { - throw new \Exception('Could not do request to updater server: '.curl_error($curl)); + throw new \Exception('Could not do request to updater server: ' . curl_error($curl)); } curl_close($curl); @@ -551,7 +551,7 @@ public function downloadUpdate(): void { $response = $this->getUpdateServerResponse(); - $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/'; if (file_exists($storageLocation)) { $this->silentLog('[info] storage location exists'); $this->recursiveDelete($storageLocation); @@ -622,7 +622,7 @@ public function downloadUpdate(): void { * @throws \Exception */ private function getDownloadedFilePath(): string { - $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/'; $this->silentLog('[info] storage location: ' . $storageLocation); $filesInStorageLocation = scandir($storageLocation); @@ -732,7 +732,7 @@ public function extractDownload(): void { throw new \Exception('Required PHP extension missing: zip'); } - $libzip_version = defined("ZipArchive::LIBZIP_VERSION") ? \ZipArchive::LIBZIP_VERSION : "Unknown (but old)"; + $libzip_version = defined('ZipArchive::LIBZIP_VERSION') ? \ZipArchive::LIBZIP_VERSION : 'Unknown (but old)'; $this->silentLog('[info] Libzip version detected: ' . $libzip_version); $zip = new \ZipArchive; @@ -740,15 +740,15 @@ public function extractDownload(): void { if ($zipState === true) { $extraction = $zip->extractTo(dirname($downloadedFilePath)); if ($extraction === false) { - throw new \Exception('Error during unpacking zipfile: '.($zip->getStatusString())); + throw new \Exception('Error during unpacking zipfile: ' . ($zip->getStatusString())); } $zip->close(); $state = unlink($downloadedFilePath); if ($state === false) { - throw new \Exception("Can't unlink ". $downloadedFilePath); + throw new \Exception("Can't unlink " . $downloadedFilePath); } } else { - throw new \Exception("Can't handle ZIP file. Error code is: ".print_r($zipState, true)); + throw new \Exception("Can't handle ZIP file. Error code is: " . print_r($zipState, true)); } // Ensure that the downloaded version is not lower @@ -790,7 +790,7 @@ public function replaceEntryPoints(): void { } $state = file_put_contents($this->nextcloudDir . '/' . $file, $content); if ($state === false) { - throw new \Exception('Can\'t replace entry point: '.$file); + throw new \Exception('Can\'t replace entry point: ' . $file); } } @@ -846,7 +846,7 @@ public function deleteOldFiles(): void { throw new \Exception('core/shipped.json content is invalid'); } - $newShippedAppsFile = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/core/shipped.json'; + $newShippedAppsFile = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/core/shipped.json'; $newShippedAppsFileContent = file_get_contents($newShippedAppsFile); if ($newShippedAppsFileContent === false) { throw new \Exception('core/shipped.json is not available in the new release'); @@ -906,12 +906,12 @@ public function deleteOldFiles(): void { if ($fileInfo->isFile() || $fileInfo->isLink()) { $state = unlink($path); if ($state === false) { - throw new \Exception('Could not unlink: '.$path); + throw new \Exception('Could not unlink: ' . $path); } } elseif ($fileInfo->isDir()) { $state = rmdir($path); if ($state === false) { - throw new \Exception('Could not rmdir: '.$path); + throw new \Exception('Could not rmdir: ' . $path); } } } @@ -973,7 +973,7 @@ public function moveNewVersionInPlace(): void { 'public.php', 'ocs', ]; - $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/'; $this->silentLog('[info] storage location: ' . $storageLocation); // Rename apps and other stuff @@ -993,7 +993,7 @@ public function moveNewVersionInPlace(): void { public function finalize(): void { $this->silentLog('[info] finalize()'); - $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/'; $this->silentLog('[info] storage location: ' . $storageLocation); $this->moveWithExclusions($storageLocation, []); $state = rmdir($storageLocation); @@ -1001,7 +1001,7 @@ public function finalize(): void { throw new \Exception('Could not rmdir $storagelocation'); } - $state = unlink($this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/.step'); + $state = unlink($this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/.step'); if ($state === false) { throw new \Exception('Could not rmdir .step'); } @@ -1018,7 +1018,7 @@ public function finalize(): void { * @throws \Exception */ private function writeStep(string $state, int $step): void { - $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid'); if (!file_exists($updaterDir . '/.step')) { if (!file_exists($updaterDir)) { $result = mkdir($updaterDir); @@ -1060,8 +1060,8 @@ public function endStep(int $step): void { public function currentStep(): array { $this->silentLog('[info] currentStep()'); - $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid'); - if (!file_exists($updaterDir. '/.step')) { + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid'); + if (!file_exists($updaterDir . '/.step')) { return []; } @@ -1079,7 +1079,7 @@ public function currentStep(): array { } public function getUpdateStepFileLocation(): string { - $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOption('instanceid'); return $updaterDir . '/.step'; } @@ -1091,7 +1091,7 @@ public function getUpdateStepFileLocation(): string { public function rollbackChanges(int $step): void { $this->silentLog('[info] rollbackChanges("' . $step . '")'); - $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid'); if (file_exists($updaterDir . '/.step')) { $this->silentLog('[info] unlink .step'); $state = unlink($updaterDir . '/.step'); diff --git a/lib/UpdateCommand.php b/lib/UpdateCommand.php index 718f224b..f2586526 100644 --- a/lib/UpdateCommand.php +++ b/lib/UpdateCommand.php @@ -43,7 +43,7 @@ protected function configure(): void { $this ->setName('update') ->setDescription('Updates the code of an Nextcloud instance') - ->setHelp("This command fetches the latest code that is announced via the updater server and safely replaces the existing code with the new one.") + ->setHelp('This command fetches the latest code that is announced via the updater server and safely replaces the existing code with the new one.') ->addOption('no-backup', null, InputOption::VALUE_NONE, 'Skip backup of current Nextcloud version') ->addOption('no-upgrade', null, InputOption::VALUE_NONE, "Don't automatically run occ upgrade"); } @@ -80,7 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { } if (!function_exists('posix_getuid')) { - $output->writeln("The posix extensions are required - see http://php.net/manual/en/book.posix.php"); + $output->writeln('The posix extensions are required - see http://php.net/manual/en/book.posix.php'); return -1; } @@ -92,9 +92,9 @@ protected function execute(InputInterface $input, OutputInterface $output) { $user = posix_getpwuid(posix_getuid()); $configUser = posix_getpwuid(fileowner($configFileName)); if ($user['name'] !== $configUser['name']) { - $output->writeln("Console has to be executed with the user that owns the file config/config.php"); - $output->writeln("Current user: " . $user['name']); - $output->writeln("Owner of config.php: " . $configUser['name']); + $output->writeln('Console has to be executed with the user that owns the file config/config.php'); + $output->writeln('Current user: ' . $user['name']); + $output->writeln('Owner of config.php: ' . $configUser['name']); $output->writeln("Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)"); return -1; } @@ -252,7 +252,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { } } else { if (is_string($result['response'])) { - $output->writeln('' . $result['response'] . ''); + $output->writeln('' . $result['response'] . ''); } else { $output->writeln('Something has gone wrong. Please check the log file in the data dir.'); } diff --git a/lib/Updater.php b/lib/Updater.php index 5fb21b89..0a248275 100644 --- a/lib/Updater.php +++ b/lib/Updater.php @@ -259,8 +259,8 @@ private function getAppDirectories(): array { throw new \Exception('Invalid configuration in apps_paths configuration key'); } $appDir = basename($appsPath['path']); - if (strpos($appsPath['path'], $this->nextcloudDir.'/') === 0) { - $relativePath = substr($appsPath['path'], strlen($this->nextcloudDir.'/')); + if (strpos($appsPath['path'], $this->nextcloudDir . '/') === 0) { + $relativePath = substr($appsPath['path'], strlen($this->nextcloudDir . '/')); if ($relativePath !== 'apps') { $expected[] = $relativePath; } @@ -287,7 +287,7 @@ private function getRecursiveDirectoryIterator(string $folder, array $excludedPa $handle = opendir($folder); if ($handle === false) { - throw new \Exception('Could not open '.$folder); + throw new \Exception('Could not open ' . $folder); } /* Store first level children in an array to avoid trouble if changes happen while iterating */ @@ -305,7 +305,7 @@ private function getRecursiveDirectoryIterator(string $folder, array $excludedPa closedir($handle); foreach ($children as $name) { - $path = $folder.'/'.$name; + $path = $folder . '/' . $name; if (is_dir($path)) { yield from $this->getRecursiveDirectoryIterator($path, []); } @@ -364,7 +364,7 @@ public function checkWritePermissions(): void { * @throws \Exception when config.php can't be written */ public function setMaintenanceMode(bool $state): void { - $this->silentLog('[info] setMaintenanceMode("' . ($state ? 'true' : 'false') . '")'); + $this->silentLog('[info] setMaintenanceMode("' . ($state ? 'true' : 'false') . '")'); if ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) { $configFileName = rtrim($dir, '/') . '/config.php'; @@ -406,7 +406,7 @@ public function createBackup(): void { ]; // Create new folder for the backup - $backupFolderLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid').'/backups/nextcloud-'.$this->getConfigOptionMandatoryString('version') . '-' . time() . '/'; + $backupFolderLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/backups/nextcloud-' . $this->getConfigOptionMandatoryString('version') . '-' . time() . '/'; $this->silentLog('[info] backup folder location: ' . $backupFolderLocation); $state = mkdir($backupFolderLocation, 0750, true); @@ -422,7 +422,7 @@ public function createBackup(): void { if (!file_exists($backupFolderLocation . '/' . $relativeDirectory)) { $state = mkdir($backupFolderLocation . '/' . $relativeDirectory, 0750, true); if ($state === false) { - throw new \Exception('Could not create folder: '.$backupFolderLocation.'/'.$relativeDirectory); + throw new \Exception('Could not create folder: ' . $backupFolderLocation . '/' . $relativeDirectory); } } @@ -483,7 +483,7 @@ private function getUpdateServerResponse(): array { $this->silentLog('[info] releaseChannel: ' . $releaseChannel); $this->silentLog('[info] internal version: ' . $this->getConfigOptionMandatoryString('version')); - $updateURL = $updaterServer . '?version='. str_replace('.', 'x', $this->getConfigOptionMandatoryString('version')) .'xxx'.$releaseChannel.'xx'.urlencode($this->buildTime).'x'.PHP_MAJOR_VERSION.'x'.PHP_MINOR_VERSION.'x'.PHP_RELEASE_VERSION; + $updateURL = $updaterServer . '?version=' . str_replace('.', 'x', $this->getConfigOptionMandatoryString('version')) . 'xxx' . $releaseChannel . 'xx' . urlencode($this->buildTime) . 'x' . PHP_MAJOR_VERSION . 'x' . PHP_MINOR_VERSION . 'x' . PHP_RELEASE_VERSION; $this->silentLog('[info] updateURL: ' . $updateURL); // Download update response @@ -505,7 +505,7 @@ private function getUpdateServerResponse(): array { /** @var false|string $response */ $response = curl_exec($curl); if ($response === false) { - throw new \Exception('Could not do request to updater server: '.curl_error($curl)); + throw new \Exception('Could not do request to updater server: ' . curl_error($curl)); } curl_close($curl); @@ -533,7 +533,7 @@ public function downloadUpdate(): void { $response = $this->getUpdateServerResponse(); - $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/'; if (file_exists($storageLocation)) { $this->silentLog('[info] storage location exists'); $this->recursiveDelete($storageLocation); @@ -604,7 +604,7 @@ public function downloadUpdate(): void { * @throws \Exception */ private function getDownloadedFilePath(): string { - $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/'; $this->silentLog('[info] storage location: ' . $storageLocation); $filesInStorageLocation = scandir($storageLocation); @@ -714,7 +714,7 @@ public function extractDownload(): void { throw new \Exception('Required PHP extension missing: zip'); } - $libzip_version = defined("ZipArchive::LIBZIP_VERSION") ? \ZipArchive::LIBZIP_VERSION : "Unknown (but old)"; + $libzip_version = defined('ZipArchive::LIBZIP_VERSION') ? \ZipArchive::LIBZIP_VERSION : 'Unknown (but old)'; $this->silentLog('[info] Libzip version detected: ' . $libzip_version); $zip = new \ZipArchive; @@ -722,15 +722,15 @@ public function extractDownload(): void { if ($zipState === true) { $extraction = $zip->extractTo(dirname($downloadedFilePath)); if ($extraction === false) { - throw new \Exception('Error during unpacking zipfile: '.($zip->getStatusString())); + throw new \Exception('Error during unpacking zipfile: ' . ($zip->getStatusString())); } $zip->close(); $state = unlink($downloadedFilePath); if ($state === false) { - throw new \Exception("Can't unlink ". $downloadedFilePath); + throw new \Exception("Can't unlink " . $downloadedFilePath); } } else { - throw new \Exception("Can't handle ZIP file. Error code is: ".print_r($zipState, true)); + throw new \Exception("Can't handle ZIP file. Error code is: " . print_r($zipState, true)); } // Ensure that the downloaded version is not lower @@ -772,7 +772,7 @@ public function replaceEntryPoints(): void { } $state = file_put_contents($this->nextcloudDir . '/' . $file, $content); if ($state === false) { - throw new \Exception('Can\'t replace entry point: '.$file); + throw new \Exception('Can\'t replace entry point: ' . $file); } } @@ -828,7 +828,7 @@ public function deleteOldFiles(): void { throw new \Exception('core/shipped.json content is invalid'); } - $newShippedAppsFile = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/core/shipped.json'; + $newShippedAppsFile = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/core/shipped.json'; $newShippedAppsFileContent = file_get_contents($newShippedAppsFile); if ($newShippedAppsFileContent === false) { throw new \Exception('core/shipped.json is not available in the new release'); @@ -888,12 +888,12 @@ public function deleteOldFiles(): void { if ($fileInfo->isFile() || $fileInfo->isLink()) { $state = unlink($path); if ($state === false) { - throw new \Exception('Could not unlink: '.$path); + throw new \Exception('Could not unlink: ' . $path); } } elseif ($fileInfo->isDir()) { $state = rmdir($path); if ($state === false) { - throw new \Exception('Could not rmdir: '.$path); + throw new \Exception('Could not rmdir: ' . $path); } } } @@ -955,7 +955,7 @@ public function moveNewVersionInPlace(): void { 'public.php', 'ocs', ]; - $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/'; $this->silentLog('[info] storage location: ' . $storageLocation); // Rename apps and other stuff @@ -975,7 +975,7 @@ public function moveNewVersionInPlace(): void { public function finalize(): void { $this->silentLog('[info] finalize()'); - $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/'; + $storageLocation = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/downloads/nextcloud/'; $this->silentLog('[info] storage location: ' . $storageLocation); $this->moveWithExclusions($storageLocation, []); $state = rmdir($storageLocation); @@ -983,7 +983,7 @@ public function finalize(): void { throw new \Exception('Could not rmdir $storagelocation'); } - $state = unlink($this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid') . '/.step'); + $state = unlink($this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid') . '/.step'); if ($state === false) { throw new \Exception('Could not rmdir .step'); } @@ -1000,7 +1000,7 @@ public function finalize(): void { * @throws \Exception */ private function writeStep(string $state, int $step): void { - $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid'); if (!file_exists($updaterDir . '/.step')) { if (!file_exists($updaterDir)) { $result = mkdir($updaterDir); @@ -1042,8 +1042,8 @@ public function endStep(int $step): void { public function currentStep(): array { $this->silentLog('[info] currentStep()'); - $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid'); - if (!file_exists($updaterDir. '/.step')) { + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid'); + if (!file_exists($updaterDir . '/.step')) { return []; } @@ -1061,7 +1061,7 @@ public function currentStep(): array { } public function getUpdateStepFileLocation(): string { - $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOption('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOption('instanceid'); return $updaterDir . '/.step'; } @@ -1073,7 +1073,7 @@ public function getUpdateStepFileLocation(): string { public function rollbackChanges(int $step): void { $this->silentLog('[info] rollbackChanges("' . $step . '")'); - $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-'.$this->getConfigOptionMandatoryString('instanceid'); + $updaterDir = $this->getUpdateDirectoryLocation() . '/updater-' . $this->getConfigOptionMandatoryString('instanceid'); if (file_exists($updaterDir . '/.step')) { $this->silentLog('[info] unlink .step'); $state = unlink($updaterDir . '/.step'); diff --git a/tests/checkSameCodeBase.php b/tests/checkSameCodeBase.php index 2e534c25..5beb9ca6 100644 --- a/tests/checkSameCodeBase.php +++ b/tests/checkSameCodeBase.php @@ -76,8 +76,8 @@ function findDiffPos($original, $copy) { } if ($failedFiles !== []) { - echo "Code is not the same" . PHP_EOL; + echo 'Code is not the same' . PHP_EOL; exit(1); } -echo "Code is the same" . PHP_EOL; +echo 'Code is the same' . PHP_EOL; diff --git a/tests/features/bootstrap/FeatureContext.php b/tests/features/bootstrap/FeatureContext.php index 2f222add..090f637f 100644 --- a/tests/features/bootstrap/FeatureContext.php +++ b/tests/features/bootstrap/FeatureContext.php @@ -113,7 +113,7 @@ public function theCurrentInstalledVersionIs($installed, $version) { $zip->extractTo($this->serverDir); $zip->close(); } else { - throw new \Exception('Cant handle ZIP file. Error code is: '.$zipState); + throw new \Exception('Cant handle ZIP file. Error code is: ' . $zipState); } if ($installed === '') { @@ -271,7 +271,7 @@ public function thereIsAnUpdateToVersionAvailable($version) { https://download.nextcloud.com/server/releases/nextcloud-' . $version . '.zip https://docs.nextcloud.org/server/10/admin_manual/maintenance/manual_upgrade.html ' . $this->autoupdater . ' - '.$this->getSignatureForVersion($version).' + ' . $this->getSignatureForVersion($version) . ' '; file_put_contents($this->updateServerDir . 'index.php', $content); @@ -296,7 +296,7 @@ public function thereIsAnUpdateToPrereleaseVersionAvailable($version) { https://download.nextcloud.com/server/prereleases/nextcloud-' . $version . '.zip https://docs.nextcloud.org/server/10/admin_manual/maintenance/manual_upgrade.html 1 - '.$this->getSignatureForVersion($version).' + ' . $this->getSignatureForVersion($version) . ' '; file_put_contents($this->updateServerDir . 'index.php', $content); @@ -340,7 +340,7 @@ protected function runUpdateServer() { throw new Exception('Update server already started'); } - $cmd = "php -S localhost:8870 -t " . $this->updateServerDir . " 2>/dev/null 1>/dev/null"; + $cmd = 'php -S localhost:8870 -t ' . $this->updateServerDir . ' 2>/dev/null 1>/dev/null'; $this->updaterServerProcess = proc_open($cmd, [], $pipes, $this->updateServerDir); if (!is_resource($this->updaterServerProcess)) { @@ -399,7 +399,7 @@ public function theCurrentChannelIs($channel) { chdir($this->serverDir . 'nextcloud'); shell_exec('chmod +x occ'); - exec('./occ config:system:set --value '.$channel.' updater.release.channel'); + exec('./occ config:system:set --value ' . $channel . ' updater.release.channel'); } /** diff --git a/updater.phar b/updater.phar index 3c086b874900f056cd67a37ee2b1a8663c6a43ac..5f283b36f403f6c303846b4659538290b6f439d7 100755 GIT binary patch delta 8744 zcmds6dw3hwmG8{RdfC!w;zw-9vB!@@QsT!vq><#rv7HcHh-2qrO4B@?(P(6g$dWRW z5|cQXK!JwR5~G#_T|xp$H-tQz)U*R_fwZOFZAl<0lzsGTlWy6MwjXUASPFDo*gGRz ze&DopyML{}Pd@kFbMEgv??YEVe4^v-?{@4zSis1BpU2NiUN-C*InGb-|90K9{^%#M zt%T$L;!o&*8r^V=J)Bu)s2F|K&`mgwEYET@`o>QmJ(oGVU|!~m*_2s!X?{jAA8