@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Remove ancient "Holiday" storage

Summary:
Ref T11809. This came out of Facebook many years ago for computing the number of business days that revisions had been stale.

We removed the little staleness marker a few months ago and haven't seen complaints about it.

If we did holidays now it would make sense to integrate them more directly with Calendar as real events, but I have no plans to pursue this anytime soon. It's easy enough to add the federal holidays manually (~5 minutes of work per year?) if you want them, and they're commentable/editable and you can add local holidays if you're not in the US.

Test Plan:
- Ran `bin/storage upgrade -f`.
- Grepped for `CalendarHoliday`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11809

Differential Revision: https://secure.phabricator.com/D16788

+1 -109
+1
resources/sql/autopatches/20161101.calendar.01.noholiday.sql
··· 1 + DROP TABLE {$NAMESPACE}_calendar.calendar_holiday;
-62
scripts/calendar/import_us_holidays.php
··· 1 - #!/usr/bin/env php 2 - <?php 3 - 4 - $root = dirname(dirname(dirname(__FILE__))); 5 - require_once $root.'/scripts/__init_script__.php'; 6 - 7 - // http://www.opm.gov/operating_status_schedules/fedhol/ 8 - $holidays = array( 9 - '2014-01-01' => "New Year's Day", 10 - '2014-01-20' => 'Birthday of Martin Luther King, Jr.', 11 - '2014-02-17' => "Washington's Birthday", 12 - '2014-05-26' => 'Memorial Day', 13 - '2014-07-04' => 'Independence Day', 14 - '2014-09-01' => 'Labor Day', 15 - '2014-10-13' => 'Columbus Day', 16 - '2014-11-11' => 'Veterans Day', 17 - '2014-11-27' => 'Thanksgiving Day', 18 - '2014-12-25' => 'Christmas Day', 19 - '2015-01-01' => "New Year's Day", 20 - '2015-01-19' => 'Birthday of Martin Luther King, Jr.', 21 - '2015-02-16' => "Washington's Birthday", 22 - '2015-05-25' => 'Memorial Day', 23 - '2015-07-03' => 'Independence Day', 24 - '2015-09-07' => 'Labor Day', 25 - '2015-10-12' => 'Columbus Day', 26 - '2015-11-11' => 'Veterans Day', 27 - '2015-11-26' => 'Thanksgiving Day', 28 - '2015-12-25' => 'Christmas Day', 29 - '2016-01-01' => "New Year's Day", 30 - '2016-01-18' => 'Birthday of Martin Luther King, Jr.', 31 - '2016-02-15' => "Washington's Birthday", 32 - '2016-05-30' => 'Memorial Day', 33 - '2016-07-04' => 'Independence Day', 34 - '2016-09-05' => 'Labor Day', 35 - '2016-10-10' => 'Columbus Day', 36 - '2016-11-11' => 'Veterans Day', 37 - '2016-11-24' => 'Thanksgiving Day', 38 - '2016-12-26' => 'Christmas Day', 39 - '2017-01-02' => "New Year's Day", 40 - '2017-01-16' => 'Birthday of Martin Luther King, Jr.', 41 - '2017-02-10' => "Washington's Birthday", 42 - '2017-05-29' => 'Memorial Day', 43 - '2017-07-04' => 'Independence Day', 44 - '2017-09-04' => 'Labor Day', 45 - '2017-10-09' => 'Columbus Day', 46 - '2017-11-10' => 'Veterans Day', 47 - '2017-11-23' => 'Thanksgiving Day', 48 - '2017-12-25' => 'Christmas Day', 49 - ); 50 - 51 - $table = new PhabricatorCalendarHoliday(); 52 - $conn_w = $table->establishConnection('w'); 53 - $table_name = $table->getTableName(); 54 - 55 - foreach ($holidays as $day => $name) { 56 - queryfx( 57 - $conn_w, 58 - 'INSERT IGNORE INTO %T (day, name) VALUES (%s, %s)', 59 - $table_name, 60 - $day, 61 - $name); 62 - }
-4
src/__phutil_library_map__.php
··· 2103 2103 'PhabricatorCalendarExternalInvitee' => 'applications/calendar/storage/PhabricatorCalendarExternalInvitee.php', 2104 2104 'PhabricatorCalendarExternalInviteePHIDType' => 'applications/calendar/phid/PhabricatorCalendarExternalInviteePHIDType.php', 2105 2105 'PhabricatorCalendarExternalInviteeQuery' => 'applications/calendar/query/PhabricatorCalendarExternalInviteeQuery.php', 2106 - 'PhabricatorCalendarHoliday' => 'applications/calendar/storage/PhabricatorCalendarHoliday.php', 2107 - 'PhabricatorCalendarHolidayTestCase' => 'applications/calendar/storage/__tests__/PhabricatorCalendarHolidayTestCase.php', 2108 2106 'PhabricatorCalendarICSFileImportEngine' => 'applications/calendar/import/PhabricatorCalendarICSFileImportEngine.php', 2109 2107 'PhabricatorCalendarICSImportEngine' => 'applications/calendar/import/PhabricatorCalendarICSImportEngine.php', 2110 2108 'PhabricatorCalendarICSURIImportEngine' => 'applications/calendar/import/PhabricatorCalendarICSURIImportEngine.php', ··· 6960 6958 ), 6961 6959 'PhabricatorCalendarExternalInviteePHIDType' => 'PhabricatorPHIDType', 6962 6960 'PhabricatorCalendarExternalInviteeQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 6963 - 'PhabricatorCalendarHoliday' => 'PhabricatorCalendarDAO', 6964 - 'PhabricatorCalendarHolidayTestCase' => 'PhabricatorTestCase', 6965 6961 'PhabricatorCalendarICSFileImportEngine' => 'PhabricatorCalendarICSImportEngine', 6966 6962 'PhabricatorCalendarICSImportEngine' => 'PhabricatorCalendarImportEngine', 6967 6963 'PhabricatorCalendarICSURIImportEngine' => 'PhabricatorCalendarICSImportEngine',
-24
src/applications/calendar/storage/PhabricatorCalendarHoliday.php
··· 1 - <?php 2 - 3 - final class PhabricatorCalendarHoliday extends PhabricatorCalendarDAO { 4 - 5 - protected $day; 6 - protected $name; 7 - 8 - protected function getConfiguration() { 9 - return array( 10 - self::CONFIG_TIMESTAMPS => false, 11 - self::CONFIG_COLUMN_SCHEMA => array( 12 - 'day' => 'date', 13 - 'name' => 'text64', 14 - ), 15 - self::CONFIG_KEY_SCHEMA => array( 16 - 'day' => array( 17 - 'columns' => array('day'), 18 - 'unique' => true, 19 - ), 20 - ), 21 - ) + parent::getConfiguration(); 22 - } 23 - 24 - }
-19
src/applications/calendar/storage/__tests__/PhabricatorCalendarHolidayTestCase.php
··· 1 - <?php 2 - 3 - final class PhabricatorCalendarHolidayTestCase extends PhabricatorTestCase { 4 - 5 - protected function getPhabricatorTestCaseConfiguration() { 6 - return array( 7 - self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true, 8 - ); 9 - } 10 - 11 - protected function willRunTests() { 12 - parent::willRunTests(); 13 - id(new PhabricatorCalendarHoliday()) 14 - ->setDay('2012-01-02') 15 - ->setName(pht('International Testing Day')) 16 - ->save(); 17 - } 18 - 19 - }