From 781b9f9715721d195666feda746de7035d8093c7 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 24 Feb 2021 11:51:42 +0000 Subject: [PATCH 01/18] Components updated the package files. --- .horde.yml | 8 ++++---- composer.json | 30 +++++++++++++++--------------- doc/Horde/Date/CHANGES | 6 +++--- doc/Horde/Date/changelog.yml | 4 ++-- package.xml | 24 ++++++++++++------------ 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.horde.yml b/.horde.yml index c377e95..7d40a00 100644 --- a/.horde.yml +++ b/.horde.yml @@ -20,11 +20,11 @@ authors: active: false role: lead version: - release: 2.4.2 - api: 2.4.0 + release: 3.0.0alpha1 + api: 3.0.0alpha1 state: - release: stable - api: stable + release: alpha + api: alpha license: identifier: LGPL-2.1 uri: http://www.horde.org/licenses/lgpl21 diff --git a/composer.json b/composer.json index 1563dab..46a4a65 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "horde/date", "description": "Date library", - "type": "library", + "type": "horde-library", "homepage": "https://www.horde.org/libraries/Horde_Date", "license": "LGPL-2.1", "authors": [ @@ -16,32 +16,32 @@ "role": "lead" } ], - "version": "2.4.2", - "time": "2017-11-11", + "version": "3.0.0alpha1", + "time": "2021-02-24", "repositories": [ { - "type": "pear", - "url": "https://pear.horde.org" + "type": "composer", + "url": "https://horde-satis.maintaina.com/" } ], "require": { + "horde/horde-installer-plugin": "*", "php": "^5.3 || ^7", - "pear-pear.horde.org/Horde_Exception": "^2", - "pear-pear.horde.org/Horde_Nls": "^2", - "pear-pear.horde.org/Horde_Translation": "^2.2" + "horde/exception": "^2", + "horde/nls": "^2", + "horde/translation": "^2.2" }, "suggest": { - "pear-pear.horde.org/Horde_Icalendar": "^2", - "pear-pear.horde.org/Horde_Test": "^2.1", + "horde/icalendar": "^2", + "horde/test": "^2.1", "ext-calendar": "*" }, - "replace": { - "pear-pear.horde.org/Horde_Date": "2.*", - "pear-horde/Horde_Date": "2.*" - }, "autoload": { "psr-0": { "Horde_Date": "lib/" + }, + "psr-4": { + "Horde\\Date\\": "src/" } } -} +} \ No newline at end of file diff --git a/doc/Horde/Date/CHANGES b/doc/Horde/Date/CHANGES index 50ac84b..ca847bd 100644 --- a/doc/Horde/Date/CHANGES +++ b/doc/Horde/Date/CHANGES @@ -1,6 +1,6 @@ ------- -v2.4.2 ------- +------------ +v3.0.0alpha1 +------------ [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index b6f982d..a67966b 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -1,6 +1,6 @@ --- -2.4.2: - api: 2.4.0 +3.0.0alpha1: + api: 3.0.0alpha1 state: release: stable api: stable diff --git a/package.xml b/package.xml index 168e5cd..51ed5b3 100644 --- a/package.xml +++ b/package.xml @@ -3,7 +3,7 @@ Horde_Date pear.horde.org Date library - Package for creating and manipulating dates. + A library for creating and manipulating dates. Jan Schneider jan @@ -14,16 +14,16 @@ Chuck Hagenbuch chuck chuck@horde.org - yes + no - 2017-11-11 + 2021-02-24 - 2.4.2 - 2.4.0 + 3.0.0alpha1 + 3.0.0alpha1 - stable - stable + alpha + alpha LGPL-2.1 @@ -1208,14 +1208,14 @@ - 2.4.2 - 2.4.0 + 3.0.0alpha1 + 3.0.0alpha1 - stable - stable + alpha + alpha - 2017-10-20 + 2021-02-24 LGPL-2.1 * [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). From 694fb03ad5358e5b15ef1321f6b8e3f853865f18 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 24 Feb 2021 11:57:56 +0000 Subject: [PATCH 02/18] Released Date-3.0.0alpha1 --- .horde.yml | 16 +++++++-------- composer.json | 12 +++++------ doc/Horde/Date/changelog.yml | 2 +- package.xml | 39 ++---------------------------------- 4 files changed, 17 insertions(+), 52 deletions(-) diff --git a/.horde.yml b/.horde.yml index 7d40a00..7eff212 100644 --- a/.horde.yml +++ b/.horde.yml @@ -30,14 +30,14 @@ license: uri: http://www.horde.org/licenses/lgpl21 dependencies: required: - php: ^5.3 || ^7 - pear: - pear.horde.org/Horde_Exception: ^2 - pear.horde.org/Horde_Nls: ^2 - pear.horde.org/Horde_Translation: ^2.2 + php: ^7 + composer: + horde/exception: ^3 + horde/nls: ^3 + horde/translation: ^3 optional: - pear: - pear.horde.org/Horde_Icalendar: ^2 - pear.horde.org/Horde_Test: ^2.1 + composer: + horde/icalendar: ^3 + horde/test: ^3 ext: calendar: '*' diff --git a/composer.json b/composer.json index 46a4a65..52a5626 100644 --- a/composer.json +++ b/composer.json @@ -26,14 +26,14 @@ ], "require": { "horde/horde-installer-plugin": "*", - "php": "^5.3 || ^7", - "horde/exception": "^2", - "horde/nls": "^2", - "horde/translation": "^2.2" + "php": "^7", + "horde/exception": "^3", + "horde/nls": "^3", + "horde/translation": "^3" }, "suggest": { - "horde/icalendar": "^2", - "horde/test": "^2.1", + "horde/icalendar": "^3", + "horde/test": "^3", "ext-calendar": "*" }, "autoload": { diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index a67966b..8ddbdd3 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -4,7 +4,7 @@ state: release: stable api: stable - date: 2017-10-20 + date: 2021-02-24 license: identifier: LGPL-2.1 uri: http://www.horde.org/licenses/lgpl21 diff --git a/package.xml b/package.xml index 51ed5b3..ad011da 100644 --- a/package.xml +++ b/package.xml @@ -349,50 +349,15 @@ - 5.3.0 + 7.0.0 8.0.0alpha1 8.0.0alpha1 1.7.0 - - Horde_Exception - pear.horde.org - 2.0.0 - 3.0.0alpha1 - 3.0.0alpha1 - - - Horde_Nls - pear.horde.org - 2.0.0 - 3.0.0alpha1 - 3.0.0alpha1 - - - Horde_Translation - pear.horde.org - 2.2.0 - 3.0.0alpha1 - 3.0.0alpha1 - - - Horde_Icalendar - pear.horde.org - 2.0.0 - 3.0.0alpha1 - 3.0.0alpha1 - - - Horde_Test - pear.horde.org - 2.1.0 - 3.0.0alpha1 - 3.0.0alpha1 - calendar @@ -1215,7 +1180,7 @@ alpha alpha - 2021-02-24 + 2017-10-20 LGPL-2.1 * [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). From 219945ab3deccad0515a32b6cd845a394fffdd8b Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 24 Feb 2021 11:57:56 +0000 Subject: [PATCH 03/18] Development mode for Date-3.0.0alpha3 --- .horde.yml | 2 +- composer.json | 2 +- doc/Horde/Date/CHANGES | 7 ++++ doc/Horde/Date/changelog.yml | 11 ++++++ package.xml | 68 +++++++++++++++++++++++++++++++++--- 5 files changed, 84 insertions(+), 6 deletions(-) diff --git a/.horde.yml b/.horde.yml index 7eff212..fcf5b44 100644 --- a/.horde.yml +++ b/.horde.yml @@ -20,7 +20,7 @@ authors: active: false role: lead version: - release: 3.0.0alpha1 + release: 3.0.0alpha2 api: 3.0.0alpha1 state: release: alpha diff --git a/composer.json b/composer.json index 52a5626..e18e180 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "role": "lead" } ], - "version": "3.0.0alpha1", + "version": "3.0.0alpha2", "time": "2021-02-24", "repositories": [ { diff --git a/doc/Horde/Date/CHANGES b/doc/Horde/Date/CHANGES index ca847bd..acbd0f1 100644 --- a/doc/Horde/Date/CHANGES +++ b/doc/Horde/Date/CHANGES @@ -1,3 +1,10 @@ +------------ +v3.0.0alpha2 +------------ + + + + ------------ v3.0.0alpha1 ------------ diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index 8ddbdd3..5218032 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -1,4 +1,15 @@ --- +3.0.0alpha2: + api: 3.0.0alpha1 + state: + release: alpha + api: alpha + date: 2021-02-24 + license: + identifier: LGPL-2.1 + uri: http://www.horde.org/licenses/lgpl21 + notes: |+ + 3.0.0alpha1: api: 3.0.0alpha1 state: diff --git a/package.xml b/package.xml index ad011da..2494d55 100644 --- a/package.xml +++ b/package.xml @@ -18,7 +18,7 @@ 2021-02-24 - 3.0.0alpha1 + 3.0.0alpha2 3.0.0alpha1 @@ -27,7 +27,7 @@ LGPL-2.1 -* [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). +* @@ -485,6 +485,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0alpha1 @@ -1176,14 +1221,29 @@ 3.0.0alpha1 3.0.0alpha1 + + stable + stable + + 2021-02-24 + LGPL-2.1 + +* [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). + + + + + 3.0.0alpha2 + 3.0.0alpha1 + alpha alpha - 2017-10-20 + 2021-02-24 LGPL-2.1 -* [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). +* From 87af349ad37e79526c8c04734cebc9ba42c0fa1d Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 24 Feb 2021 19:49:17 +0000 Subject: [PATCH 04/18] Released Date-3.0.0alpha2 --- composer.json | 3 --- doc/Horde/Date/CHANGES | 3 +-- doc/Horde/Date/changelog.yml | 1 - package.xml | 49 ++---------------------------------- 4 files changed, 3 insertions(+), 53 deletions(-) diff --git a/composer.json b/composer.json index e18e180..e0b6437 100644 --- a/composer.json +++ b/composer.json @@ -39,9 +39,6 @@ "autoload": { "psr-0": { "Horde_Date": "lib/" - }, - "psr-4": { - "Horde\\Date\\": "src/" } } } \ No newline at end of file diff --git a/doc/Horde/Date/CHANGES b/doc/Horde/Date/CHANGES index acbd0f1..dc48d38 100644 --- a/doc/Horde/Date/CHANGES +++ b/doc/Horde/Date/CHANGES @@ -2,8 +2,7 @@ v3.0.0alpha2 ------------ - - +|+ ------------ v3.0.0alpha1 diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index 5218032..37cb07d 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -9,7 +9,6 @@ identifier: LGPL-2.1 uri: http://www.horde.org/licenses/lgpl21 notes: |+ - 3.0.0alpha1: api: 3.0.0alpha1 state: diff --git a/package.xml b/package.xml index 2494d55..022155d 100644 --- a/package.xml +++ b/package.xml @@ -27,7 +27,7 @@ LGPL-2.1 -* +* |+ @@ -485,51 +485,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0.0alpha1 @@ -1243,7 +1198,7 @@ 2021-02-24 LGPL-2.1 -* +* |+ From 4b92c33aa5ab2e3b6caa68157eaf1578cf7f3050 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 24 Feb 2021 19:49:17 +0000 Subject: [PATCH 05/18] Development mode for Date-3.0.0alpha4 --- .horde.yml | 2 +- composer.json | 2 +- doc/Horde/Date/CHANGES | 7 ++++ doc/Horde/Date/changelog.yml | 11 ++++++ package.xml | 65 ++++++++++++++++++++++++++++++++++-- 5 files changed, 83 insertions(+), 4 deletions(-) diff --git a/.horde.yml b/.horde.yml index fcf5b44..af1342c 100644 --- a/.horde.yml +++ b/.horde.yml @@ -20,7 +20,7 @@ authors: active: false role: lead version: - release: 3.0.0alpha2 + release: 3.0.0alpha3 api: 3.0.0alpha1 state: release: alpha diff --git a/composer.json b/composer.json index e0b6437..e7e6395 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "role": "lead" } ], - "version": "3.0.0alpha2", + "version": "3.0.0alpha3", "time": "2021-02-24", "repositories": [ { diff --git a/doc/Horde/Date/CHANGES b/doc/Horde/Date/CHANGES index dc48d38..47d66f8 100644 --- a/doc/Horde/Date/CHANGES +++ b/doc/Horde/Date/CHANGES @@ -1,3 +1,10 @@ +------------ +v3.0.0alpha3 +------------ + + + + ------------ v3.0.0alpha2 ------------ diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index 37cb07d..b6a5297 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -1,4 +1,15 @@ --- +3.0.0alpha3: + api: 3.0.0alpha1 + state: + release: alpha + api: alpha + date: 2021-02-24 + license: + identifier: LGPL-2.1 + uri: http://www.horde.org/licenses/lgpl21 + notes: |+ + 3.0.0alpha2: api: 3.0.0alpha1 state: diff --git a/package.xml b/package.xml index 022155d..06a5e55 100644 --- a/package.xml +++ b/package.xml @@ -18,7 +18,7 @@ 2021-02-24 - 3.0.0alpha2 + 3.0.0alpha3 3.0.0alpha1 @@ -27,7 +27,7 @@ LGPL-2.1 -* |+ +* @@ -485,6 +485,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0alpha1 @@ -1201,5 +1247,20 @@ * |+ + + + 3.0.0alpha3 + 3.0.0alpha1 + + + alpha + alpha + + 2021-02-24 + LGPL-2.1 + +* + + From 6f7cb141579744686bc1f8719f34cbad95b703fe Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 3 Mar 2021 08:30:40 +0100 Subject: [PATCH 06/18] Fix [#15054] Thunderbird-generated events issue See https://bugs.horde.org/ticket/15054 [#15054] Thunderbird "all workday" events become "daily" events --- lib/Horde/Date/Recurrence.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Horde/Date/Recurrence.php b/lib/Horde/Date/Recurrence.php index d607d3a..7b7d09a 100644 --- a/lib/Horde/Date/Recurrence.php +++ b/lib/Horde/Date/Recurrence.php @@ -1234,8 +1234,15 @@ public function fromRRule20($rrule) switch (Horde_String::upper($rdata['FREQ'])) { case 'DAILY': $this->setRecurType(self::RECUR_DAILY); - break; - + /** + * [#15054] Thunderbird "all workday" events become "daily" events + * Thunderbird-generated "every weekday" events are represented as + * RRULE:FREQ=DAILY;UNTIL=yyyymmddT041500Z;BYDAY=MO,TU,WE,TH,FR + * Fall through to weekly in this case. + */ + if (!isset($rdata['BYDAY'])) { + break; + } case 'WEEKLY': $this->setRecurType(self::RECUR_WEEKLY); if (isset($rdata['BYDAY'])) { From b1cba65f1242de2fd2154a5380c2dd59ab3a54f4 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Sat, 13 Mar 2021 16:20:01 +0000 Subject: [PATCH 07/18] Released Date-3.0.0alpha3 --- composer.json | 6 ++--- doc/Horde/Date/CHANGES | 3 +-- doc/Horde/Date/changelog.yml | 3 +-- package.xml | 52 +++--------------------------------- 4 files changed, 7 insertions(+), 57 deletions(-) diff --git a/composer.json b/composer.json index e7e6395..d43d16e 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "horde/date", "description": "Date library", - "type": "horde-library", + "type": "library", "homepage": "https://www.horde.org/libraries/Horde_Date", "license": "LGPL-2.1", "authors": [ @@ -16,8 +16,7 @@ "role": "lead" } ], - "version": "3.0.0alpha3", - "time": "2021-02-24", + "time": "2021-03-13", "repositories": [ { "type": "composer", @@ -25,7 +24,6 @@ } ], "require": { - "horde/horde-installer-plugin": "*", "php": "^7", "horde/exception": "^3", "horde/nls": "^3", diff --git a/doc/Horde/Date/CHANGES b/doc/Horde/Date/CHANGES index 47d66f8..cc2e222 100644 --- a/doc/Horde/Date/CHANGES +++ b/doc/Horde/Date/CHANGES @@ -2,8 +2,7 @@ v3.0.0alpha3 ------------ - - +|+ ------------ v3.0.0alpha2 diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index b6a5297..a9d1b35 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -4,12 +4,11 @@ state: release: alpha api: alpha - date: 2021-02-24 + date: 2021-03-13 license: identifier: LGPL-2.1 uri: http://www.horde.org/licenses/lgpl21 notes: |+ - 3.0.0alpha2: api: 3.0.0alpha1 state: diff --git a/package.xml b/package.xml index 06a5e55..1f02e14 100644 --- a/package.xml +++ b/package.xml @@ -16,7 +16,7 @@ chuck@horde.org no - 2021-02-24 + 2021-03-13 3.0.0alpha3 3.0.0alpha1 @@ -27,7 +27,7 @@ LGPL-2.1 -* +* |+ @@ -485,52 +485,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0.0alpha1 @@ -1259,7 +1213,7 @@ 2021-02-24 LGPL-2.1 -* +* |+ From 834d031dd4102abb5d4f4e2de2be3d1e805be2c9 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Sat, 13 Mar 2021 16:20:01 +0000 Subject: [PATCH 08/18] Development mode for Date-3.0.0alpha5 --- .horde.yml | 2 +- composer.json | 11 +++--- doc/Horde/Date/CHANGES | 7 ++++ doc/Horde/Date/changelog.yml | 11 ++++++ package.xml | 68 ++++++++++++++++++++++++++++++++++-- 5 files changed, 90 insertions(+), 9 deletions(-) diff --git a/.horde.yml b/.horde.yml index af1342c..2811799 100644 --- a/.horde.yml +++ b/.horde.yml @@ -20,7 +20,7 @@ authors: active: false role: lead version: - release: 3.0.0alpha3 + release: 3.0.0alpha4 api: 3.0.0alpha1 state: release: alpha diff --git a/composer.json b/composer.json index d43d16e..1279abe 100644 --- a/composer.json +++ b/composer.json @@ -1,4 +1,5 @@ { + "minimum-stability": "dev", "name": "horde/date", "description": "Date library", "type": "library", @@ -25,13 +26,13 @@ ], "require": { "php": "^7", - "horde/exception": "^3", - "horde/nls": "^3", - "horde/translation": "^3" + "horde/exception": "^3 || dev-FRAMEWORK_6_0", + "horde/nls": "^3 || dev-FRAMEWORK_6_0", + "horde/translation": "^3 || dev-FRAMEWORK_6_0" }, "suggest": { - "horde/icalendar": "^3", - "horde/test": "^3", + "horde/icalendar": "^3 || dev-FRAMEWORK_6_0", + "horde/test": "^3 || dev-FRAMEWORK_6_0", "ext-calendar": "*" }, "autoload": { diff --git a/doc/Horde/Date/CHANGES b/doc/Horde/Date/CHANGES index cc2e222..74db31c 100644 --- a/doc/Horde/Date/CHANGES +++ b/doc/Horde/Date/CHANGES @@ -1,3 +1,10 @@ +------------ +v3.0.0alpha4 +------------ + + + + ------------ v3.0.0alpha3 ------------ diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index a9d1b35..32367b9 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -1,4 +1,15 @@ --- +3.0.0alpha4: + api: 3.0.0alpha1 + state: + release: alpha + api: alpha + date: 2021-03-13 + license: + identifier: LGPL-2.1 + uri: http://www.horde.org/licenses/lgpl21 + notes: |+ + 3.0.0alpha3: api: 3.0.0alpha1 state: diff --git a/package.xml b/package.xml index 1f02e14..bc2a992 100644 --- a/package.xml +++ b/package.xml @@ -18,7 +18,7 @@ 2021-03-13 - 3.0.0alpha3 + 3.0.0alpha4 3.0.0alpha1 @@ -27,7 +27,7 @@ LGPL-2.1 -* |+ +* @@ -485,6 +485,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0alpha1 @@ -1210,11 +1257,26 @@ alpha alpha - 2021-02-24 + 2021-03-13 LGPL-2.1 * |+ + + + 3.0.0alpha4 + 3.0.0alpha1 + + + alpha + alpha + + 2021-03-13 + LGPL-2.1 + +* + + From 9f4c303717613356a58b380618be2f36ddb0afe3 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Thu, 18 Mar 2021 07:08:17 +0000 Subject: [PATCH 09/18] Convert Unit Tests for PHPUnit 9 --- test/Horde/Date/AllTests.php | 6 +++++- test/Horde/Date/DateTest.php | 15 ++++++++++++--- test/Horde/Date/RecurrenceTest.php | 14 +++++++++++--- test/Horde/Date/Repeater/DayNameTest.php | 8 ++++++-- test/Horde/Date/Repeater/DayTest.php | 6 +++++- test/Horde/Date/Repeater/HourTest.php | 9 +++++++-- test/Horde/Date/Repeater/MonthNameTest.php | 8 ++++++-- test/Horde/Date/Repeater/MonthTest.php | 9 +++++++-- test/Horde/Date/Repeater/TimeTest.php | 8 ++++++-- test/Horde/Date/Repeater/WeekTest.php | 9 +++++++-- test/Horde/Date/Repeater/WeekendTest.php | 9 +++++++-- test/Horde/Date/Repeater/YearTest.php | 9 +++++++-- test/Horde/Date/SpanTest.php | 6 +++++- test/Horde/Date/UtilsTest.php | 5 ++++- test/Horde/Date/bootstrap.php | 4 +++- 15 files changed, 98 insertions(+), 27 deletions(-) diff --git a/test/Horde/Date/AllTests.php b/test/Horde/Date/AllTests.php index 49583c8..4dc2732 100644 --- a/test/Horde/Date/AllTests.php +++ b/test/Horde/Date/AllTests.php @@ -1,3 +1,7 @@ run(); +// Silence annoying phpunit message about missing class AllTests; +class AllTests {} \ No newline at end of file diff --git a/test/Horde/Date/DateTest.php b/test/Horde/Date/DateTest.php index 9ef4434..8932126 100644 --- a/test/Horde/Date/DateTest.php +++ b/test/Horde/Date/DateTest.php @@ -4,21 +4,30 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date; +use \PHPUnit\Framework\TestCase; +use \date_default_timezone_get; +use \date_default_timezone_set; +use \stdClass; +use \Horde_Date; +use \Horde_Date_Span; +use \DateTime; +use \DateTimeZone; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_DateTest extends PHPUnit_Framework_TestCase +class DateTest extends TestCase { - public function setUp() + public function setUp(): void { $this->_oldTimezone = date_default_timezone_get(); date_default_timezone_set('Europe/Berlin'); } - public function tearDown() + public function tearDown(): void { date_default_timezone_set($this->_oldTimezone); } diff --git a/test/Horde/Date/RecurrenceTest.php b/test/Horde/Date/RecurrenceTest.php index a5c0ab3..32289ff 100644 --- a/test/Horde/Date/RecurrenceTest.php +++ b/test/Horde/Date/RecurrenceTest.php @@ -4,22 +4,30 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date; +use \Horde_Test_Case as TestCase; +use \Horde_Date; +use \Horde_Date_Recurrence; +use \Horde_Icalendar; +use \Horde_Icalendar_Vevent; +use \date_default_timezone_get; +use \date_default_timezone_set; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_RecurrenceTest extends Horde_Test_Case +class RecurrenceTest extends TestCase { - protected function setUp() + protected function setUp(): void { $this->ical = new Horde_Icalendar(); $this->_oldTimezone = date_default_timezone_get(); date_default_timezone_set('Europe/Berlin'); } - public function tearDown() + public function tearDown(): void { date_default_timezone_set($this->_oldTimezone); } diff --git a/test/Horde/Date/Repeater/DayNameTest.php b/test/Horde/Date/Repeater/DayNameTest.php index 1755675..a65837d 100644 --- a/test/Horde/Date/Repeater/DayNameTest.php +++ b/test/Horde/Date/Repeater/DayNameTest.php @@ -4,15 +4,19 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Repeater_DayName; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_DayNameTest extends PHPUnit_Framework_TestCase +class DayNameTest extends TestCase { - public function setUp() + public function setUp(): void { $this->now = new Horde_Date('2006-08-16 14:00:00'); } diff --git a/test/Horde/Date/Repeater/DayTest.php b/test/Horde/Date/Repeater/DayTest.php index 3f7987d..891fb2f 100644 --- a/test/Horde/Date/Repeater/DayTest.php +++ b/test/Horde/Date/Repeater/DayTest.php @@ -4,13 +4,17 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Repeater_Day; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_DayTest extends PHPUnit_Framework_TestCase +class DayTest extends TestCase { public function testNextFuture() { diff --git a/test/Horde/Date/Repeater/HourTest.php b/test/Horde/Date/Repeater/HourTest.php index 44cb99f..52a6c19 100644 --- a/test/Horde/Date/Repeater/HourTest.php +++ b/test/Horde/Date/Repeater/HourTest.php @@ -4,15 +4,20 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Span; +use \Horde_Date_Repeater_Hour; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_HourTest extends PHPUnit_Framework_TestCase +class HourTest extends TestCase { - public function setUp() + public function setUp(): void { $this->now = new Horde_Date('2006-08-16 14:00:00'); } diff --git a/test/Horde/Date/Repeater/MonthNameTest.php b/test/Horde/Date/Repeater/MonthNameTest.php index 23045f2..38b8f72 100644 --- a/test/Horde/Date/Repeater/MonthNameTest.php +++ b/test/Horde/Date/Repeater/MonthNameTest.php @@ -4,15 +4,19 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Repeater_MonthName; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_MonthNameTest extends PHPUnit_Framework_TestCase +class MonthNameTest extends TestCase { - public function setUp() + public function setUp(): void { $this->now = new Horde_Date('2006-08-16 14:00:00'); } diff --git a/test/Horde/Date/Repeater/MonthTest.php b/test/Horde/Date/Repeater/MonthTest.php index 5d82da8..e8b9997 100644 --- a/test/Horde/Date/Repeater/MonthTest.php +++ b/test/Horde/Date/Repeater/MonthTest.php @@ -4,15 +4,20 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Span; +use \Horde_Date_Repeater_Month; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_MonthTest extends PHPUnit_Framework_TestCase +class MonthTest extends TestCase { - public function setUp() + public function setUp(): void { $this->now = new Horde_Date('2006-08-16 14:00:00'); } diff --git a/test/Horde/Date/Repeater/TimeTest.php b/test/Horde/Date/Repeater/TimeTest.php index b02b911..1b5d14f 100644 --- a/test/Horde/Date/Repeater/TimeTest.php +++ b/test/Horde/Date/Repeater/TimeTest.php @@ -4,15 +4,19 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Repeater_Time; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_TimeTest extends PHPUnit_Framework_TestCase +class TimeTest extends TestCase { - public function setUp() + public function setUp(): void { $this->now = new Horde_Date('2006-08-16 14:00:00'); } diff --git a/test/Horde/Date/Repeater/WeekTest.php b/test/Horde/Date/Repeater/WeekTest.php index d11aa11..b2b3397 100644 --- a/test/Horde/Date/Repeater/WeekTest.php +++ b/test/Horde/Date/Repeater/WeekTest.php @@ -4,15 +4,20 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Repeater_Week; +use \Horde_Date_Span; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_WeekTest extends PHPUnit_Framework_TestCase +class WeekTest extends TestCase { - public function setUp() + public function setUp(): void { $this->now = new Horde_Date('2006-08-16 14:00:00'); } diff --git a/test/Horde/Date/Repeater/WeekendTest.php b/test/Horde/Date/Repeater/WeekendTest.php index de10f38..977d832 100644 --- a/test/Horde/Date/Repeater/WeekendTest.php +++ b/test/Horde/Date/Repeater/WeekendTest.php @@ -4,15 +4,20 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Repeater_Weekend; +use \Horde_Date_Span; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_WeekendTest extends PHPUnit_Framework_TestCase +class WeekendTest extends TestCase { - public function setUp() + public function setUp(): void { $this->now = new Horde_Date('2006-08-16 14:00:00'); } diff --git a/test/Horde/Date/Repeater/YearTest.php b/test/Horde/Date/Repeater/YearTest.php index 75a8c64..41d2d64 100644 --- a/test/Horde/Date/Repeater/YearTest.php +++ b/test/Horde/Date/Repeater/YearTest.php @@ -4,15 +4,20 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date\Repeater; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Repeater_Year; +use \Horde_Date_Span; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_Repeater_YearTest extends PHPUnit_Framework_TestCase +class YearTest extends TestCase { - public function setUp() + public function setUp(): void { $this->now = new Horde_Date('2006-08-16 14:00:00'); } diff --git a/test/Horde/Date/SpanTest.php b/test/Horde/Date/SpanTest.php index bb10974..cf5949d 100644 --- a/test/Horde/Date/SpanTest.php +++ b/test/Horde/Date/SpanTest.php @@ -4,13 +4,17 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date; +use \PHPUnit\Framework\TestCase; +use \Horde_Date; +use \Horde_Date_Span; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_SpanTest extends PHPUnit_Framework_TestCase +class SpanTest extends TestCase { public function testWidth() { diff --git a/test/Horde/Date/UtilsTest.php b/test/Horde/Date/UtilsTest.php index b714124..68e8435 100644 --- a/test/Horde/Date/UtilsTest.php +++ b/test/Horde/Date/UtilsTest.php @@ -4,13 +4,16 @@ * @package Date * @subpackage UnitTests */ +namespace Horde\Date; +use \PHPUnit\Framework\TestCase; +use \Horde_Date_Utils; /** * @category Horde * @package Date * @subpackage UnitTests */ -class Horde_Date_UtilsTest extends PHPUnit_Framework_TestCase +class UtilsTest extends TestCase { public function testFirstDayOfWeek() { diff --git a/test/Horde/Date/bootstrap.php b/test/Horde/Date/bootstrap.php index 4e19e93..939a36f 100644 --- a/test/Horde/Date/bootstrap.php +++ b/test/Horde/Date/bootstrap.php @@ -1,3 +1,5 @@ Date: Thu, 17 Mar 2022 09:10:56 +0000 Subject: [PATCH 10/18] Add unit test for bug #15054 --- test/Horde/Date/RecurrenceTest.php | 43 +++++++++++++++++++++++++++ test/Horde/Date/fixtures/bug15054.ics | 27 +++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 test/Horde/Date/fixtures/bug15054.ics diff --git a/test/Horde/Date/RecurrenceTest.php b/test/Horde/Date/RecurrenceTest.php index 32289ff..d5cce4d 100644 --- a/test/Horde/Date/RecurrenceTest.php +++ b/test/Horde/Date/RecurrenceTest.php @@ -1102,4 +1102,47 @@ public function testBug12869RecurrenceEndFromIcalendar() date_default_timezone_set('Europe/Berlin'); } + public function testBug15054ThunderbirdWorkday() + { + date_default_timezone_set('Europe/Berlin'); + $iCal = new Horde_Icalendar(); + $iCal->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/bug15054.ics')); + $components = $iCal->getComponents(); + foreach ($components as $content) { + if ($content instanceof Horde_Icalendar_Vevent) { + $start = new Horde_Date($content->getAttribute('DTSTART')); + $end = new Horde_Date($content->getAttribute('DTEND')); + $rrule = $content->getAttribute('RRULE'); + $recurrence = new Horde_Date_Recurrence($start, $end); + $recurrence->fromRRule20($rrule); + break; + } + } + + // Recurrence must not include weekend + // Thursday, checking for thursday + $dtInput = new \Horde_Date('20210318T080000', 'Europe/Berlin'); + $dtExpected = new \Horde_Date('20210318T090000', 'Europe/Berlin'); + $this->assertEquals($dtExpected->timestamp(), $recurrence->nextRecurrence($dtInput)->timestamp()); + // Friday, checking for friday + $dtInput = new \Horde_Date('20210319T080000', 'Europe/Berlin'); + $dtExpected = new \Horde_Date('20210319T090000', 'Europe/Berlin'); + $this->assertEquals($dtExpected->timestamp(), $recurrence->nextRecurrence($dtInput)->timestamp()); + // Saturday, checking for monday + $dtInput = new \Horde_Date('20210320T080000', 'Europe/Berlin'); + $dtExpected = new \Horde_Date('20210322T090000', 'Europe/Berlin'); + $this->assertEquals($dtExpected->toJSON(), $recurrence->nextRecurrence($dtInput)->toJSON()); + // Sunday, checking for monday + $dtInput = new \Horde_Date('20210321T080000', 'Europe/Berlin'); + $dtExpected = new \Horde_Date('20210322T090000', 'Europe/Berlin'); + $this->assertEquals($dtExpected->timestamp(), $recurrence->nextRecurrence($dtInput)->timestamp()); + // monday, checking for monday + $dtInput = new \Horde_Date('20210322T080000', 'Europe/Berlin'); + $dtExpected = new \Horde_Date('20210322T090000', 'Europe/Berlin'); + $this->assertEquals($dtExpected->timestamp(), $recurrence->nextRecurrence($dtInput)->timestamp()); + // tuesday, checking for tuesday + $dtInput = new \Horde_Date('20210323T080000', 'Europe/Berlin'); + $dtExpected = new \Horde_Date('20210323T090000', 'Europe/Berlin'); + $this->assertEquals($dtExpected->timestamp(), $recurrence->nextRecurrence($dtInput)->timestamp()); + } } diff --git a/test/Horde/Date/fixtures/bug15054.ics b/test/Horde/Date/fixtures/bug15054.ics new file mode 100644 index 0000000..6ec0c71 --- /dev/null +++ b/test/Horde/Date/fixtures/bug15054.ics @@ -0,0 +1,27 @@ +BEGIN:VCALENDAR +VERSION:2.0 +X-WR-CALNAME:Bug Reproducer +PRODID:-//The Horde Project//Horde iCalendar Library//EN +BEGIN:VEVENT +DTSTART;TZID=Europe/Berlin:20210318T090000 +DTEND;TZID=Europe/Berlin:20210318T100000 +DTSTAMP:20210318T072609Z +UID:1bae8052-9389-4059-b693-52f6138d5107 +CREATED:20210318T072313Z +LAST-MODIFIED:20210318T072313Z +SUMMARY:Bug 15054 +DESCRIPTION:Thunderbird creates a new event as "Jeden Werktag" (recurring + all work days). \nThis is expressed as a DAILY clause with an BYDAY + attribute listing the five workdays.\nHorde before this patch would only + parse BYDAY from weeks. The server accepts the meeting but drops the + restriction. The Event will be saved as "all days" and on next sync\, + the TB user has an "all days" event rather than an "all work days" + event. +LOCATION:https://bugs.horde.org/ticket/15054 +CLASS:PUBLIC +STATUS:CONFIRMED +TRANSP:OPAQUE +RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20210331T215959Z;BYDAY=MO,TU,WE,TH,FR +END:VEVENT +END:VCALENDAR + From 23c2020bc4adf4db6d1c2f23543269c2735133cf Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Wed, 3 Mar 2021 08:30:40 +0100 Subject: [PATCH 11/18] Fix [#15054] Thunderbird-generated events issue See https://bugs.horde.org/ticket/15054 [#15054] Thunderbird "all workday" events become "daily" events Update metadata and workflows for PHP 8 support PHP 8.1: use 'now' rather than null for current date Fix [#15054] Thunderbird-generated events issue See https://bugs.horde.org/ticket/15054 [#15054] Thunderbird "all workday" events become "daily" events Add unit test for bug #15054 --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++ .github/workflows/phpdoc.yml | 69 ++++++++++++++++++++++++++++++ .github/workflows/update-satis.yml | 59 +++++++++++++++++++++++++ .horde.yml | 4 +- composer.json | 4 +- lib/Horde/Date.php | 2 +- 6 files changed, 187 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/phpdoc.yml create mode 100644 .github/workflows/update-satis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c2de241 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: + - master + - maintaina-composerfixed + - FRAMEWORK_6_0 + pull_request: + branches: + - master + - maintaina-composerfixed + - FRAMEWORK_6_0 + + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-20.04'] + php-versions: ['7.4', '8.0', 'latest'] + phpunit-versions: ['latest', '9.5'] + steps: + - name: Setup github ssh key + run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com > ~/.ssh/known_hosts + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: bcmath, ctype, curl, dom, gd, gettext, iconv, imagick, json, ldap, mbstring, mysql, opcache, openssl, pcntl, pdo, posix, redis, soap, sockets, sqlite, tokenizer, xmlwriter + ini-values: post_max_size=512M, max_execution_time=360 + coverage: xdebug + tools: php-cs-fixer, phpunit:${{ matrix.phpunit-versions }}, composer:v2 + - name: Setup Github Token as composer credential + run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + - name: Install horde/test dependency and other dependencies + run: | + ## For unclear reasons, github action fails randomly if we do not install before we require. + COMPOSER_ROOT_VERSION=dev-FRAMEWORK_6_0 composer config minimum-stability dev + COMPOSER_ROOT_VERSION=dev-FRAMEWORK_6_0 composer install + - name: run phpunit + run: phpunit --bootstrap test/bootstrap.php diff --git a/.github/workflows/phpdoc.yml b/.github/workflows/phpdoc.yml new file mode 100644 index 0000000..365812f --- /dev/null +++ b/.github/workflows/phpdoc.yml @@ -0,0 +1,69 @@ +# This is a basic workflow to help you get started with Actions + +name: PHPDOC + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: + - master + - maintaina-composerfixed + - FRAMEWORK_6_0 + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + run: + runs-on: ubuntu-20.04 + steps: + - name: Setup github ssh key + run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com > ~/.ssh/known_hosts + - name: Setup uut dir + run: | + export REPO=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//") + export UUT_DIR=$(pwd) + export WORK_DIR=~ + export BIN_DIR="${WORK_DIR}/bin" + mkdir -p $BIN_DIR + git config --global user.name "PHPDOC CI Job" + git config --global user.email "ci-job@maintaina.com" + - name: Checkout + uses: actions/checkout@v2 + - name: Checkout Doc Dir + uses: actions/checkout@v2 + with: + repository: maintaina/phpdoc + token: ${{secrets.PHPDOC_TOKEN}} + path: "phpdoc-git" + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: bcmath, ctype, curl, dom, gd, gettext, iconv, imagick, json, ldap, mbstring, mysql, opcache, openssl, pcntl, pdo, posix, redis, soap, sockets, sqlite, tokenizer, xmlwriter + ini-values: post_max_size=512M, max_execution_time=360 + coverage: xdebug + tools: composer:v2 + - name: Setup Github Token as composer credential + run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + - name: phpdocumentor run + run: | + export UUT_DIR=$(pwd) + export REPO=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//") + export WORK_DIR=/home/runner/ + export BIN_DIR="${WORK_DIR}/bin" + wget https://phpdoc.org/phpDocumentor.phar + mkdir "${WORK_DIR}/phpdoc-out" + mv phpDocumentor.phar $BIN_DIR/phpdocumentor + chmod +x "${BIN_DIR}/phpdocumentor" + echo "Creating UUT related dir in docu repo" + mkdir -p $UUT_DIR/phpdoc-git/${GITHUB_REF##*/}/${REPO}/ + ## Look into any of lib, src, app (if they exist) but not test, migration, bin, locale or script dirs + $BIN_DIR/phpdocumentor -d $UUT_DIR/lib/ -d $UUT_DIR/src/ -d $UUT_DIR/app/ -t "${UUT_DIR}/phpdoc-git/${GITHUB_REF##*/}/${REPO}/" + cd ${UUT_DIR}/phpdoc-git + git add "${GITHUB_REF##*/}/${REPO}" + php indexer.php ${GITHUB_REF##*/} $REPO + git add index.html index.json + git commit -m "Updated phpdoc for $GITHUB_REPOSITORY (${GITHUB_REF##*/} branch) from ci" + git push diff --git a/.github/workflows/update-satis.yml b/.github/workflows/update-satis.yml new file mode 100644 index 0000000..5049bd0 --- /dev/null +++ b/.github/workflows/update-satis.yml @@ -0,0 +1,59 @@ +# This is a basic workflow to help you get started with Actions + +name: Update Satis + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: + - FRAMEWORK_6_0 + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + run: + runs-on: ubuntu-20.04 + steps: + - name: Setup github ssh key + run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com > ~/.ssh/known_hosts + - name: Setup uut dir + run: | + export REPO=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//") + export UUT_DIR=$(pwd) + export WORK_DIR=~ + export BIN_DIR="${WORK_DIR}/bin" + mkdir -p $BIN_DIR + git config --global user.name "PHPDOC CI Job" + git config --global user.email "ci-job@maintaina.com" + - name: Checkout + uses: actions/checkout@v2 + - name: Checkout satis web dir + uses: actions/checkout@v2 + with: + repository: maintaina-com/maintaina-com.github.io + token: ${{secrets.PHPDOC_TOKEN}} + path: "maintaina-com.github.io" + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: bcmath, ctype, curl, dom, gd, gettext, iconv, imagick, json, ldap, mbstring, mysql, opcache, openssl, pcntl, pdo, posix, redis, soap, sockets, sqlite, tokenizer, xmlwriter + ini-values: post_max_size=512M, max_execution_time=3600 + coverage: xdebug + tools: composer:v2 + - name: Setup Github Token as composer credential + run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + - name: Run Satis + run: | + export UUT_DIR=$(pwd) + export REPO=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//") + export WORK_DIR=/home/runner/ + export BIN_DIR="${WORK_DIR}/bin" + composer create-project composer/satis:dev-main + php satis/bin/satis build -vvv maintaina-com.github.io/satis.json maintaina-com.github.io/ horde/${REPO,,} + cd maintaina-com.github.io + git add include/ index.html p2/ packages.json + git commit -m "Update for horde/${REPO,,}" + git push diff --git a/.horde.yml b/.horde.yml index 2811799..1b7c25e 100644 --- a/.horde.yml +++ b/.horde.yml @@ -26,11 +26,11 @@ state: release: alpha api: alpha license: - identifier: LGPL-2.1 + identifier: LGPL-2.1-only uri: http://www.horde.org/licenses/lgpl21 dependencies: required: - php: ^7 + php: ^7.4 || ^8 composer: horde/exception: ^3 horde/nls: ^3 diff --git a/composer.json b/composer.json index 1279abe..e9c463f 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "Date library", "type": "library", "homepage": "https://www.horde.org/libraries/Horde_Date", - "license": "LGPL-2.1", + "license": "LGPL-2.1-only", "authors": [ { "name": "Jan Schneider", @@ -25,7 +25,7 @@ } ], "require": { - "php": "^7", + "php": "^7.4 || ^8", "horde/exception": "^3 || dev-FRAMEWORK_6_0", "horde/nls": "^3 || dev-FRAMEWORK_6_0", "horde/translation": "^3 || dev-FRAMEWORK_6_0" diff --git a/lib/Horde/Date.php b/lib/Horde/Date.php index 2b267f3..63a26b4 100644 --- a/lib/Horde/Date.php +++ b/lib/Horde/Date.php @@ -555,7 +555,7 @@ public function __toString() public function toDateTime() { try { - $date = new DateTime(null, new DateTimeZone($this->_timezone)); + $date = new DateTime('now', new DateTimeZone($this->_timezone)); $date->setDate($this->_year, $this->_month, $this->_mday); $date->setTime($this->_hour, $this->_min, $this->_sec); } catch (Exception $e) { From 3d099c4f28726d92017fe01eb02ea028214f123c Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Sat, 8 Oct 2022 22:27:01 +0200 Subject: [PATCH 12/18] Released Date-3.0.0alpha4 --- composer.json | 16 ++++-- doc/Horde/Date/CHANGES | 11 ++++- doc/Horde/Date/changelog.yml | 21 ++++++-- package.xml | 94 +++++++++++++++--------------------- 4 files changed, 76 insertions(+), 66 deletions(-) diff --git a/composer.json b/composer.json index e9c463f..6724129 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,4 @@ { - "minimum-stability": "dev", "name": "horde/date", "description": "Date library", "type": "library", @@ -17,11 +16,11 @@ "role": "lead" } ], - "time": "2021-03-13", + "time": "2022-10-08", "repositories": [ { "type": "composer", - "url": "https://horde-satis.maintaina.com/" + "url": "https://horde-satis.maintaina.com" } ], "require": { @@ -30,6 +29,7 @@ "horde/nls": "^3 || dev-FRAMEWORK_6_0", "horde/translation": "^3 || dev-FRAMEWORK_6_0" }, + "require-dev": {}, "suggest": { "horde/icalendar": "^3 || dev-FRAMEWORK_6_0", "horde/test": "^3 || dev-FRAMEWORK_6_0", @@ -39,5 +39,15 @@ "psr-0": { "Horde_Date": "lib/" } + }, + "autoload-dev": { + "psr-4": { + "Horde\\Date\\Test\\": "test/" + } + }, + "config": { + "allow-plugins": { + "horde/horde-installer-plugin": true + } } } \ No newline at end of file diff --git a/doc/Horde/Date/CHANGES b/doc/Horde/Date/CHANGES index 74db31c..b0511c4 100644 --- a/doc/Horde/Date/CHANGES +++ b/doc/Horde/Date/CHANGES @@ -2,7 +2,8 @@ v3.0.0alpha4 ------------ - +[rla] Fix some PHP 8.1 issues. +|+ ------------ @@ -21,11 +22,17 @@ v3.0.0alpha2 v3.0.0alpha1 ------------ +[rla] Begin conversion for composer usage. + + +------ +v2.4.2 +------ + [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). - ------ v2.4.1 ------ diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index 32367b9..9f2b992 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -4,12 +4,13 @@ state: release: alpha api: alpha - date: 2021-03-13 + date: 2022-10-08 license: identifier: LGPL-2.1 uri: http://www.horde.org/licenses/lgpl21 - notes: |+ - + notes: | + [rla] Fix some PHP 8.1 issues. + |+ 3.0.0alpha3: api: 3.0.0alpha1 state: @@ -39,9 +40,19 @@ license: identifier: LGPL-2.1 uri: http://www.horde.org/licenses/lgpl21 - notes: |+ + notes: | + [rla] Begin conversion for composer usage. +2.4.2: + api: 2.4.0 + state: + release: stable + api: stable + date: 2017-10-20 + license: + identifier: LGPL-2.1 + uri: http://www.horde.org/licenses/lgpl21 + notes: | [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). - 2.4.1: api: 2.4.0 state: diff --git a/package.xml b/package.xml index bc2a992..83ac088 100644 --- a/package.xml +++ b/package.xml @@ -16,7 +16,7 @@ chuck@horde.org no - 2021-03-13 + 2022-10-08 3.0.0alpha4 3.0.0alpha1 @@ -25,12 +25,20 @@ alpha alpha - LGPL-2.1 + LGPL-2.1-only -* +* [rla] Fix some PHP 8.1 issues. +* |+ + + + + + + + @@ -322,6 +330,7 @@ + @@ -349,9 +358,9 @@ - 7.0.0 - 8.0.0alpha1 - 8.0.0alpha1 + 7.4.0 + 9.0.0alpha1 + 9.0.0alpha1 1.7.0 @@ -365,6 +374,9 @@ + + + @@ -470,6 +482,7 @@ + @@ -485,53 +498,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1.0.0alpha1 @@ -1218,6 +1184,21 @@ * [jan] Fix translating the string representation of a recurrence rule. + + + 2.4.2 + 2.4.0 + + + stable + stable + + 2017-10-20 + LGPL-2.1 + +* [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). + + 3.0.0alpha1 @@ -1230,7 +1211,7 @@ 2021-02-24 LGPL-2.1 -* [jan] Allow passing a time format to Horde_Date_Recurrence#toString() (Bug #14768). +* [rla] Begin conversion for composer usage. @@ -1273,9 +1254,10 @@ alpha 2021-03-13 - LGPL-2.1 + LGPL-2.1-only -* +* [rla] Fix some PHP 8.1 issues. +* |+ From eef4c182e6fc54f4b66158634dba13e3d1713eac Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Sat, 8 Oct 2022 22:27:02 +0200 Subject: [PATCH 13/18] Development mode for Date-3.0.0alpha5 --- .horde.yml | 2 +- composer.json | 1 + doc/Horde/Date/CHANGES | 7 ++++ doc/Horde/Date/changelog.yml | 11 ++++++ package.xml | 73 +++++++++++++++++++++++++++++++++--- 5 files changed, 88 insertions(+), 6 deletions(-) diff --git a/.horde.yml b/.horde.yml index 1b7c25e..e184f95 100644 --- a/.horde.yml +++ b/.horde.yml @@ -20,7 +20,7 @@ authors: active: false role: lead version: - release: 3.0.0alpha4 + release: 3.0.0alpha5 api: 3.0.0alpha1 state: release: alpha diff --git a/composer.json b/composer.json index 6724129..549c2aa 100644 --- a/composer.json +++ b/composer.json @@ -1,4 +1,5 @@ { + "minimum-stability": "dev", "name": "horde/date", "description": "Date library", "type": "library", diff --git a/doc/Horde/Date/CHANGES b/doc/Horde/Date/CHANGES index b0511c4..23e9037 100644 --- a/doc/Horde/Date/CHANGES +++ b/doc/Horde/Date/CHANGES @@ -1,3 +1,10 @@ +------------ +v3.0.0alpha5 +------------ + + + + ------------ v3.0.0alpha4 ------------ diff --git a/doc/Horde/Date/changelog.yml b/doc/Horde/Date/changelog.yml index 9f2b992..4f98f7f 100644 --- a/doc/Horde/Date/changelog.yml +++ b/doc/Horde/Date/changelog.yml @@ -1,4 +1,15 @@ --- +3.0.0alpha5: + api: 3.0.0alpha1 + state: + release: alpha + api: alpha + date: 2022-10-08 + license: + identifier: LGPL-2.1 + uri: http://www.horde.org/licenses/lgpl21 + notes: |+ + 3.0.0alpha4: api: 3.0.0alpha1 state: diff --git a/package.xml b/package.xml index 83ac088..758e9c0 100644 --- a/package.xml +++ b/package.xml @@ -18,7 +18,7 @@ 2022-10-08 - 3.0.0alpha4 + 3.0.0alpha5 3.0.0alpha1 @@ -27,8 +27,7 @@ LGPL-2.1-only -* [rla] Fix some PHP 8.1 issues. -* |+ +* @@ -498,6 +497,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.0.0alpha1 @@ -1253,12 +1301,27 @@ alpha alpha - 2021-03-13 - LGPL-2.1-only + 2022-10-08 + LGPL-2.1 * [rla] Fix some PHP 8.1 issues. * |+ + + + 3.0.0alpha5 + 3.0.0alpha1 + + + alpha + alpha + + 2022-10-08 + LGPL-2.1 + +* + + From e8cd6d6636141744693e9e2f454b61044fa70243 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Sun, 9 Oct 2022 20:34:29 +0200 Subject: [PATCH 14/18] Fix strftime2date. Add a convenience wrapper. --- lib/Horde/Date/Utils.php | 44 ++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/lib/Horde/Date/Utils.php b/lib/Horde/Date/Utils.php index fd76244..4321de7 100644 --- a/lib/Horde/Date/Utils.php +++ b/lib/Horde/Date/Utils.php @@ -135,7 +135,7 @@ public static function relativeDateTime($time, $date_format = '%x', */ public static function strftime2date($format) { - $replace = array( + $replace = [ '/%a/' => 'D', '/%A/' => 'l', '/%d/' => 'd', @@ -151,7 +151,7 @@ public static function strftime2date($format) '/%h/' => 'M', '/%m/' => 'm', '/%C/' => '', - '/%g/' => '', + '/%g/' => 'y', '/%G/' => 'o', '/%y/' => 'y', '/%Y/' => 'Y', @@ -165,20 +165,52 @@ public static function strftime2date($format) '/%R/' => 'H:i', '/%S/' => 's', '/%T/' => 'H:i:s', - '/%X/e' => 'Horde_Date_Utils::strftime2date(Horde_Nls::getLangInfo(T_FMT))', '/%z/' => 'O', '/%Z/' => '', '/%c/' => '', '/%D/' => 'm/d/y', '/%F/' => 'Y-m-d', '/%s/' => 'U', - '/%x/e' => 'Horde_Date_Utils::strftime2date(Horde_Nls::getLangInfo(D_FMT))', '/%n/' => "\n", '/%t/' => "\t", '/%%/' => '%' - ); + ]; + + $callbackPatterns = [ + '/%X/' => function() { return Horde_Nls::getLangInfo(T_FMT); }, + '/%x/' => function() { return Horde_Nls::getLangInfo(D_FMT); }, + ]; - return preg_replace(array_keys($replace), array_values($replace), $format); + $pass1 = preg_replace_callback_array($callbackPatterns, $format); + $pass2 = preg_replace(array_keys($replace), array_values($replace), $pass1); + return $pass2; } + /** + * Unify date formatters and then format the date. + * + * Facilitates upgrades from strftime to date_format style placeholders by accepting both. + * Some formats are not supported and will be dropped + * Will produce undesirable results for date_format style format strings that contain % characters + * + * @param string $pattern A date/time format pattern either in strftime or date_format style + * @param string|Horde_Date|DateTimeInterface $date + * @return void + */ + public static function legacyDateFormatter( + string $pattern = 'Y-m-d H:i:s', + Horde_Date|DateTimeInterface|int|string|null $date = 'now', + $timezone = null + ) + { + if (is_null($date) || $date === 'now') { + $date = new Horde_Date(time(), $timezone); + } elseif (is_object($date) && $date instanceof DateTimeInterface) { + $timezone = $timezone ?? $date->getTimezone()->getName(); + $date = new Horde_Date($date, $timezone); + } elseif (is_int($date) || is_string($date)) { + $date = new Horde_Date($date, $timezone ?? 'UTC'); + } + return $date->format(self::strftime2date($pattern)); + } } From 545a30e73a0ea6a9dbca567d87daa36e4bde7698 Mon Sep 17 00:00:00 2001 From: Ralf Lang Date: Mon, 10 Oct 2022 19:48:08 +0200 Subject: [PATCH 15/18] PSR-4 unit tests --- phpunit.xml.dist | 38 +++++++++++++------ test/AllTests.php | 6 +++ test/Horde/Date/AllTests.php | 7 ---- test/Horde/Date/bootstrap.php | 5 --- .../{Horde/Date => Unnamespaced}/DateTest.php | 2 +- .../Date => Unnamespaced}/RecurrenceTest.php | 8 ++-- .../Repeater/DayNameTest.php | 2 +- .../Repeater/DayTest.php | 2 +- .../Repeater/HourTest.php | 2 +- .../Repeater/MonthNameTest.php | 2 +- .../Repeater/MonthTest.php | 2 +- .../Repeater/TimeTest.php | 2 +- .../Repeater/WeekTest.php | 2 +- .../Repeater/WeekendTest.php | 2 +- .../Repeater/YearTest.php | 2 +- .../{Horde/Date => Unnamespaced}/SpanTest.php | 2 +- .../Date => Unnamespaced}/UtilsTest.php | 2 +- test/bootstrap.php | 14 +++++++ test/{Horde/Date => }/fixtures/bug12869.ics | 0 test/{Horde/Date => }/fixtures/bug15054.ics | 0 test/{Horde/Date => }/fixtures/bug2813.ics | 0 21 files changed, 62 insertions(+), 40 deletions(-) create mode 100644 test/AllTests.php delete mode 100644 test/Horde/Date/AllTests.php delete mode 100644 test/Horde/Date/bootstrap.php rename test/{Horde/Date => Unnamespaced}/DateTest.php (99%) rename test/{Horde/Date => Unnamespaced}/RecurrenceTest.php (99%) rename test/{Horde/Date => Unnamespaced}/Repeater/DayNameTest.php (97%) rename test/{Horde/Date => Unnamespaced}/Repeater/DayTest.php (95%) rename test/{Horde/Date => Unnamespaced}/Repeater/HourTest.php (98%) rename test/{Horde/Date => Unnamespaced}/Repeater/MonthNameTest.php (98%) rename test/{Horde/Date => Unnamespaced}/Repeater/MonthTest.php (97%) rename test/{Horde/Date => Unnamespaced}/Repeater/TimeTest.php (98%) rename test/{Horde/Date => Unnamespaced}/Repeater/WeekTest.php (98%) rename test/{Horde/Date => Unnamespaced}/Repeater/WeekendTest.php (98%) rename test/{Horde/Date => Unnamespaced}/Repeater/YearTest.php (98%) rename test/{Horde/Date => Unnamespaced}/SpanTest.php (97%) rename test/{Horde/Date => Unnamespaced}/UtilsTest.php (96%) create mode 100644 test/bootstrap.php rename test/{Horde/Date => }/fixtures/bug12869.ics (100%) rename test/{Horde/Date => }/fixtures/bug15054.ics (100%) rename test/{Horde/Date => }/fixtures/bug2813.ics (100%) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 376111c..0830fc2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,12 +1,26 @@ - - - - test - - - - - lib - - - \ No newline at end of file + + + + + test + + + + + + src + + + diff --git a/test/AllTests.php b/test/AllTests.php new file mode 100644 index 0000000..b6ddf83 --- /dev/null +++ b/test/AllTests.php @@ -0,0 +1,6 @@ +run(); diff --git a/test/Horde/Date/AllTests.php b/test/Horde/Date/AllTests.php deleted file mode 100644 index 4dc2732..0000000 --- a/test/Horde/Date/AllTests.php +++ /dev/null @@ -1,7 +0,0 @@ -run(); -// Silence annoying phpunit message about missing class AllTests; -class AllTests {} \ No newline at end of file diff --git a/test/Horde/Date/bootstrap.php b/test/Horde/Date/bootstrap.php deleted file mode 100644 index 939a36f..0000000 --- a/test/Horde/Date/bootstrap.php +++ /dev/null @@ -1,5 +0,0 @@ -parsevCalendar(file_get_contents(__DIR__ . '/fixtures/bug2813.ics')); + $iCal->parsevCalendar(file_get_contents(__DIR__ . '/../fixtures/bug2813.ics')); $components = $iCal->getComponents(); date_default_timezone_set('US/Eastern'); @@ -1076,7 +1076,7 @@ public function testBug12869RecurrenceEndFromIcalendar() { date_default_timezone_set('Europe/Amsterdam'); $iCal = new Horde_Icalendar(); - $iCal->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/bug12869.ics')); + $iCal->parsevCalendar(file_get_contents(__DIR__ . '/../fixtures/bug12869.ics')); $components = $iCal->getComponents(); foreach ($components as $content) { if ($content instanceof Horde_Icalendar_Vevent) { @@ -1106,7 +1106,7 @@ public function testBug15054ThunderbirdWorkday() { date_default_timezone_set('Europe/Berlin'); $iCal = new Horde_Icalendar(); - $iCal->parsevCalendar(file_get_contents(__DIR__ . '/fixtures/bug15054.ics')); + $iCal->parsevCalendar(file_get_contents(__DIR__ . '/../fixtures/bug15054.ics')); $components = $iCal->getComponents(); foreach ($components as $content) { if ($content instanceof Horde_Icalendar_Vevent) { diff --git a/test/Horde/Date/Repeater/DayNameTest.php b/test/Unnamespaced/Repeater/DayNameTest.php similarity index 97% rename from test/Horde/Date/Repeater/DayNameTest.php rename to test/Unnamespaced/Repeater/DayNameTest.php index a65837d..fe40e31 100644 --- a/test/Horde/Date/Repeater/DayNameTest.php +++ b/test/Unnamespaced/Repeater/DayNameTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Repeater_DayName; diff --git a/test/Horde/Date/Repeater/DayTest.php b/test/Unnamespaced/Repeater/DayTest.php similarity index 95% rename from test/Horde/Date/Repeater/DayTest.php rename to test/Unnamespaced/Repeater/DayTest.php index 891fb2f..e64bd66 100644 --- a/test/Horde/Date/Repeater/DayTest.php +++ b/test/Unnamespaced/Repeater/DayTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Repeater_Day; diff --git a/test/Horde/Date/Repeater/HourTest.php b/test/Unnamespaced/Repeater/HourTest.php similarity index 98% rename from test/Horde/Date/Repeater/HourTest.php rename to test/Unnamespaced/Repeater/HourTest.php index 52a6c19..8aa0f4c 100644 --- a/test/Horde/Date/Repeater/HourTest.php +++ b/test/Unnamespaced/Repeater/HourTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Span; diff --git a/test/Horde/Date/Repeater/MonthNameTest.php b/test/Unnamespaced/Repeater/MonthNameTest.php similarity index 98% rename from test/Horde/Date/Repeater/MonthNameTest.php rename to test/Unnamespaced/Repeater/MonthNameTest.php index 38b8f72..0c64a2b 100644 --- a/test/Horde/Date/Repeater/MonthNameTest.php +++ b/test/Unnamespaced/Repeater/MonthNameTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Repeater_MonthName; diff --git a/test/Horde/Date/Repeater/MonthTest.php b/test/Unnamespaced/Repeater/MonthTest.php similarity index 97% rename from test/Horde/Date/Repeater/MonthTest.php rename to test/Unnamespaced/Repeater/MonthTest.php index e8b9997..5c8d93a 100644 --- a/test/Horde/Date/Repeater/MonthTest.php +++ b/test/Unnamespaced/Repeater/MonthTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Span; diff --git a/test/Horde/Date/Repeater/TimeTest.php b/test/Unnamespaced/Repeater/TimeTest.php similarity index 98% rename from test/Horde/Date/Repeater/TimeTest.php rename to test/Unnamespaced/Repeater/TimeTest.php index 1b5d14f..56b7828 100644 --- a/test/Horde/Date/Repeater/TimeTest.php +++ b/test/Unnamespaced/Repeater/TimeTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Repeater_Time; diff --git a/test/Horde/Date/Repeater/WeekTest.php b/test/Unnamespaced/Repeater/WeekTest.php similarity index 98% rename from test/Horde/Date/Repeater/WeekTest.php rename to test/Unnamespaced/Repeater/WeekTest.php index b2b3397..b1e9cf1 100644 --- a/test/Horde/Date/Repeater/WeekTest.php +++ b/test/Unnamespaced/Repeater/WeekTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Repeater_Week; diff --git a/test/Horde/Date/Repeater/WeekendTest.php b/test/Unnamespaced/Repeater/WeekendTest.php similarity index 98% rename from test/Horde/Date/Repeater/WeekendTest.php rename to test/Unnamespaced/Repeater/WeekendTest.php index 977d832..6d31de5 100644 --- a/test/Horde/Date/Repeater/WeekendTest.php +++ b/test/Unnamespaced/Repeater/WeekendTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Repeater_Weekend; diff --git a/test/Horde/Date/Repeater/YearTest.php b/test/Unnamespaced/Repeater/YearTest.php similarity index 98% rename from test/Horde/Date/Repeater/YearTest.php rename to test/Unnamespaced/Repeater/YearTest.php index 41d2d64..34e33c7 100644 --- a/test/Horde/Date/Repeater/YearTest.php +++ b/test/Unnamespaced/Repeater/YearTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date\Repeater; +namespace Horde\Date\Test\Repeater; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Repeater_Year; diff --git a/test/Horde/Date/SpanTest.php b/test/Unnamespaced/SpanTest.php similarity index 97% rename from test/Horde/Date/SpanTest.php rename to test/Unnamespaced/SpanTest.php index cf5949d..296142c 100644 --- a/test/Horde/Date/SpanTest.php +++ b/test/Unnamespaced/SpanTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date; +namespace Horde\Date\Test; use \PHPUnit\Framework\TestCase; use \Horde_Date; use \Horde_Date_Span; diff --git a/test/Horde/Date/UtilsTest.php b/test/Unnamespaced/UtilsTest.php similarity index 96% rename from test/Horde/Date/UtilsTest.php rename to test/Unnamespaced/UtilsTest.php index 68e8435..189aa5d 100644 --- a/test/Horde/Date/UtilsTest.php +++ b/test/Unnamespaced/UtilsTest.php @@ -4,7 +4,7 @@ * @package Date * @subpackage UnitTests */ -namespace Horde\Date; +namespace Horde\Date\Test; use \PHPUnit\Framework\TestCase; use \Horde_Date_Utils; diff --git a/test/bootstrap.php b/test/bootstrap.php new file mode 100644 index 0000000..c92c4e9 --- /dev/null +++ b/test/bootstrap.php @@ -0,0 +1,14 @@ + Date: Mon, 10 Oct 2022 19:48:48 +0200 Subject: [PATCH 16/18] Stub of namespaced date library --- src/DateTime.php | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/DateTime.php diff --git a/src/DateTime.php b/src/DateTime.php new file mode 100644 index 0000000..0a04cf7 --- /dev/null +++ b/src/DateTime.php @@ -0,0 +1,11 @@ + Date: Mon, 10 Oct 2022 19:49:58 +0200 Subject: [PATCH 17/18] Update metadata and workflows - define dev dependencies. --- .github/workflows/ci.yml | 3 +- .github/workflows/release.yml | 63 ++++++++++++++++++++++++++++++ .github/workflows/update-satis.yml | 3 +- .gitignore | 7 ++++ .horde.yml | 5 +++ .php-cs-fixer.dist.php | 25 ++++++++++++ composer.json | 14 ++++--- 7 files changed, 113 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .php-cs-fixer.dist.php diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2de241..a2e0f86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: operating-system: ['ubuntu-20.04'] - php-versions: ['7.4', '8.0', 'latest'] + php-versions: ['7.4', '8.0', '8.1', 'latest'] phpunit-versions: ['latest', '9.5'] steps: - name: Setup github ssh key @@ -49,6 +49,7 @@ jobs: run: | ## For unclear reasons, github action fails randomly if we do not install before we require. COMPOSER_ROOT_VERSION=dev-FRAMEWORK_6_0 composer config minimum-stability dev + COMPOSER_ROOT_VERSION=dev-FRAMEWORK_6_0 composer config allow-plugins true COMPOSER_ROOT_VERSION=dev-FRAMEWORK_6_0 composer install - name: run phpunit run: phpunit --bootstrap test/bootstrap.php diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..784f8fe --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,63 @@ +--- +name: make release + +# manual workflow to make a new release for the default branch +on: + workflow_dispatch: + branches: + - FRAMEWORK_6_0 +env: + components: "/home/runner/.composer/web/components/bin/horde-components -c /home/runner/.composer/web/components/config/maintaina.conf.dist" + +jobs: + run: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-20.04'] + php-versions: ['7.4'] + steps: + - name: Setup git + run: | + mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com > ~/.ssh/known_hosts + git config --global user.name "Github CI Runner" + git config --global user.email "ci-job@maintaina.com" + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: gettext + ini-values: post_max_size=512M, max_execution_time=360 + tools: composer:v2 + - name: Setup composer + run: | + composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} + composer global config repositories.0 composer https://horde-satis.maintaina.com + composer global config minimum-stability dev + composer config --no-plugins --global allow-plugins true + composer global require horde/components "dev-FRAMEWORK_6_0" + - name: write changelog + run: | + entries_amount=0; max_entries=100 + PATTERN="^\[.*\] .*" + + for commit in $(git rev-list FRAMEWORK_6_0) + do + msg=$(git log --format=%B -n 1 $commit | head -n 1) + if [ $entries_amount -gt $max_entries ]; then break; fi + if [[ $msg == 'Released'* ]]; then break; fi + if [[ $msg == 'Development mode for'* ]]; then break; fi + if [[ $msg =~ $PATTERN ]]; then + $components changed "$msg" + let "entries_amount+=1" + fi + done + - name: make release and push + run: | + $components release for maintaina + git push + git push origin --tags diff --git a/.github/workflows/update-satis.yml b/.github/workflows/update-satis.yml index 5049bd0..e105aae 100644 --- a/.github/workflows/update-satis.yml +++ b/.github/workflows/update-satis.yml @@ -25,7 +25,7 @@ jobs: export WORK_DIR=~ export BIN_DIR="${WORK_DIR}/bin" mkdir -p $BIN_DIR - git config --global user.name "PHPDOC CI Job" + git config --global user.name "Satis Repository CI Job" git config --global user.email "ci-job@maintaina.com" - name: Checkout uses: actions/checkout@v2 @@ -52,6 +52,7 @@ jobs: export WORK_DIR=/home/runner/ export BIN_DIR="${WORK_DIR}/bin" composer create-project composer/satis:dev-main + composer global config --no-plugins allow-plugins true php satis/bin/satis build -vvv maintaina-com.github.io/satis.json maintaina-com.github.io/ horde/${REPO,,} cd maintaina-com.github.io git add include/ index.html p2/ packages.json diff --git a/.gitignore b/.gitignore index 4e78ae3..3a7a91f 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,10 @@ run-tests.log /test/*/*/*/*.log /test/*/*/*/*.out +# Ignore test harness / quality tools output +.php-cs-fixer.cache +.phpunit.cache/ + +# ignore composer artifacts +composer.lock +vendor/ diff --git a/.horde.yml b/.horde.yml index e184f95..c3c2ed5 100644 --- a/.horde.yml +++ b/.horde.yml @@ -36,6 +36,11 @@ dependencies: horde/nls: ^3 horde/translation: ^3 optional: + composer: + horde/icalendar: ^3 + ext: + calendar: '*' + dev: composer: horde/icalendar: ^3 horde/test: ^3 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..e3aa45a --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,25 @@ +exclude('lib') + // doc may contain ancient examples or illustrational shorthand + ->exclude('doc') + ->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php') + ->in(__DIR__) +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR12' => true, + '@PHP81Migration' => true, + 'ordered_imports' => true, + 'strict_param' => true, + 'declare_strict_types' => true, + 'method_argument_space' => true, + 'array_syntax' => ['syntax' => 'short'], + ]) + ->setFinder($finder)->setFormat('txt')->setRiskyAllowed(true); +; diff --git a/composer.json b/composer.json index 549c2aa..c496501 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,4 @@ { - "minimum-stability": "dev", "name": "horde/date", "description": "Date library", "type": "library", @@ -17,7 +16,7 @@ "role": "lead" } ], - "time": "2022-10-08", + "time": "2022-10-10", "repositories": [ { "type": "composer", @@ -30,7 +29,11 @@ "horde/nls": "^3 || dev-FRAMEWORK_6_0", "horde/translation": "^3 || dev-FRAMEWORK_6_0" }, - "require-dev": {}, + "require-dev": { + "horde/icalendar": "^3 || dev-FRAMEWORK_6_0", + "horde/test": "^3 || dev-FRAMEWORK_6_0", + "ext-calendar": "*" + }, "suggest": { "horde/icalendar": "^3 || dev-FRAMEWORK_6_0", "horde/test": "^3 || dev-FRAMEWORK_6_0", @@ -50,5 +53,6 @@ "allow-plugins": { "horde/horde-installer-plugin": true } - } -} \ No newline at end of file + }, + "minimum-stability": "dev" +} From 48a22b9b754d59fcee307fe7321659abeb3973a2 Mon Sep 17 00:00:00 2001 From: Steve Mokris Date: Fri, 30 Dec 2022 16:39:34 -0500 Subject: [PATCH 18/18] Map timezones of the form `GMT-0800` to corresponding Olson names. --- lib/Horde/Date.php | 7 +++++++ test/Unnamespaced/DateTest.php | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/lib/Horde/Date.php b/lib/Horde/Date.php index 63a26b4..f8bccbf 100644 --- a/lib/Horde/Date.php +++ b/lib/Horde/Date.php @@ -824,6 +824,13 @@ public static function getTimezoneAlias($timezone) $timezone = reset(self::$_timezoneAbbreviations[$lower]); $timezone = $timezone['timezone_id']; } + + // Map timezones of the form `GMT-0800` + // (which sometimes appear in events imported from airplane flights). + // to corresponding Olson names. + if (preg_match('/^GMT([+-])(\d\d)00$/', $timezone, $matches)) + $timezone = 'Etc/GMT' . $matches[1] . ltrim($matches[2], '0'); + return $timezone; } diff --git a/test/Unnamespaced/DateTest.php b/test/Unnamespaced/DateTest.php index 2e311ab..51c0c83 100644 --- a/test/Unnamespaced/DateTest.php +++ b/test/Unnamespaced/DateTest.php @@ -308,6 +308,22 @@ public function testGetTimezoneAlias() 'UTC', Horde_Date::getTimezoneAlias('UTC') ); + $this->assertEquals( + 'Etc/GMT-8', + Horde_Date::getTimezoneAlias('GMT-0800') + ); + $this->assertEquals( + 'Etc/GMT+1', + Horde_Date::getTimezoneAlias('GMT+0100') + ); + $this->assertEquals( + 'Etc/GMT+10', + Horde_Date::getTimezoneAlias('GMT+1000') + ); + $this->assertEquals( + 'GMT+1030', + Horde_Date::getTimezoneAlias('GMT+1030') + ); } public function testSetTimezone()