From ab242d964fb5f6d7f1530275b509969837a85e49 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 4 Nov 2019 20:40:14 -0800 Subject: [PATCH] composer.{json,lock} - Make the "tplaner/when" exception for old PHP reproducible Overview -------- The library `tplaner/when` has an inaccurate dependency on php71 and requires special work to deploy on php70. Before ------ The `composer.lock` file was manually edited to make it runnable on php70. However, if you `rm composer.lock && composer install`, then it fails. After ----- The `composer.json` and `composer.lock` are more repeatable. If you run `rm composer.lock && composer install`, then it works. Comments -------- This adds a fairly ugly section. However, the good news is that it should be more transparent - which should make it easier to understand/remove later. As a general rule, we don't want to have `civicrm-core.git` depend on packages/versions that aren't published. This is a somewhat unusual edge-case - this package/version is published via `packagist.org`. If you run without this on php71+, then you still get a valid/equivalent package. All that we've done is to enable running on `php70` (when `civicrm-core` is a root project). --- composer.json | 21 ++++++++++++++++++++- composer.lock | 25 +++++++------------------ 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 84ed89bd5d..acfb29bcb2 100644 --- a/composer.json +++ b/composer.json @@ -65,7 +65,7 @@ "katzien/php-mime-type": "2.1.0", "civicrm/composer-downloads-plugin": "^2.0", "league/csv": "^9.2", - "tplaner/when": "dev-master#c1ec099f421bff354cc5c929f83b94031423fc80", + "tplaner/when": "~3.0.0", "xkerman/restricted-unserialize": "~1.1" }, "require-dev": { @@ -89,6 +89,25 @@ "bash tools/scripts/composer/phpword-jquery.sh" ] }, + "repositories": { + "tplaner-when-1ec099f421bff354cc5c929f83b94031423fc80": { + "type": "package", + "package": { + "version": "3.0.0+php53", + "dist": {"url": "https://github.com/tplaner/When/archive/c1ec099f421bff354cc5c929f83b94031423fc80.zip", "type": "zip"}, + "name": "tplaner/when", + "type": "library", + "description": "Date/Calendar recursion library.", + "keywords": ["recurrence", "date", "time", "DateTime"], + "homepage": "https://github.com/tplaner/When", + "license": "MIT", + "authors": [{"name": "Tom Planer", "email": "tplaner@gmail.com"}], + "require": {"php": ">=5.3.0"}, + "require-dev": {"phpunit/phpunit": "~4.0"}, + "autoload": {"psr-4": {"When\\": "src/"}} + } + } + }, "extra": { "downloads": { "*": { diff --git a/composer.lock b/composer.lock index c188be07a7..3e8a14c551 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": "ec0b6779b9262fd5c0b41d3eb4d5f109", + "content-hash": "fc2b275e88919949aad21babc71c1706", "packages": [ { "name": "civicrm/civicrm-cxn-rpc", @@ -2230,23 +2230,16 @@ }, { "name": "tplaner/when", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/tplaner/When.git", - "reference": "c1ec099f421bff354cc5c929f83b94031423fc80" - }, + "version": "3.0.0+php53", "dist": { "type": "zip", - "url": "https://api.github.com/repos/tplaner/When/zipball/c1ec099f421bff354cc5c929f83b94031423fc80", - "reference": "c1ec099f421bff354cc5c929f83b94031423fc80", - "shasum": "" + "url": "https://github.com/tplaner/When/archive/c1ec099f421bff354cc5c929f83b94031423fc80.zip" }, "require": { "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^4.0" + "phpunit/phpunit": "~4.0" }, "type": "library", "autoload": { @@ -2254,7 +2247,6 @@ "When\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2267,13 +2259,11 @@ "description": "Date/Calendar recursion library.", "homepage": "https://github.com/tplaner/When", "keywords": [ + "DateTime", "date", - "datetime", "recurrence", - "repeat", "time" - ], - "time": "2019-01-11T21:59:13+00:00" + ] }, { "name": "xkerman/restricted-unserialize", @@ -2616,7 +2606,7 @@ { "name": "Tobias Nyholm", "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/nyholm" + "homepage": "https://github.com/Nyholm" }, { "name": "Nicolas Grekas", @@ -2806,7 +2796,6 @@ "stability-flags": { "zetacomponents/mail": 20, "pear/validate_finance_creditcard": 20, - "tplaner/when": 20, "cache/integration-tests": 20 }, "prefer-stable": false, -- 2.25.1