Merge branch 'master' into blender-tweaks
This commit is contained in:
4
.arclint
4
.arclint
@@ -64,13 +64,13 @@
|
||||
"text": {
|
||||
"type": "text",
|
||||
"exclude": [
|
||||
"(^src/(.*/)?__tests__/[^/]+/.*\\.(txt|json))"
|
||||
"(^src/(.*/)?__tests__/[^/]+/.*\\.(txt|json|expect))"
|
||||
]
|
||||
},
|
||||
"text-without-length": {
|
||||
"type": "text",
|
||||
"include": [
|
||||
"(^src/(.*/)?__tests__/[^/]+/.*\\.(txt|json))"
|
||||
"(^src/(.*/)?__tests__/[^/]+/.*\\.(txt|json|expect))"
|
||||
],
|
||||
"severity": {
|
||||
"3": "disabled"
|
||||
|
769
externals/cldr/cldr_windows_timezones.xml
vendored
Normal file
769
externals/cldr/cldr_windows_timezones.xml
vendored
Normal file
@@ -0,0 +1,769 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE supplementalData SYSTEM "../../common/dtd/ldmlSupplemental.dtd">
|
||||
<!--
|
||||
Copyright © 1991-2013 Unicode, Inc.
|
||||
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
|
||||
For terms of use, see http://www.unicode.org/copyright.html
|
||||
-->
|
||||
|
||||
<supplementalData>
|
||||
<version number="$Revision$"/>
|
||||
<windowsZones>
|
||||
<mapTimezones otherVersion="7e00402" typeVersion="2016i">
|
||||
|
||||
<!-- (UTC-12:00) International Date Line West -->
|
||||
<mapZone other="Dateline Standard Time" territory="001" type="Etc/GMT+12"/>
|
||||
<mapZone other="Dateline Standard Time" territory="ZZ" type="Etc/GMT+12"/>
|
||||
|
||||
<!-- (UTC-11:00) Coordinated Universal Time-11 -->
|
||||
<mapZone other="UTC-11" territory="001" type="Etc/GMT+11"/>
|
||||
<mapZone other="UTC-11" territory="AS" type="Pacific/Pago_Pago"/>
|
||||
<mapZone other="UTC-11" territory="NU" type="Pacific/Niue"/>
|
||||
<mapZone other="UTC-11" territory="UM" type="Pacific/Midway"/>
|
||||
<mapZone other="UTC-11" territory="ZZ" type="Etc/GMT+11"/>
|
||||
|
||||
<!-- (UTC-10:00) Aleutian Islands -->
|
||||
<mapZone other="Aleutian Standard Time" territory="001" type="America/Adak"/>
|
||||
<mapZone other="Aleutian Standard Time" territory="US" type="America/Adak"/>
|
||||
|
||||
<!-- (UTC-10:00) Hawaii -->
|
||||
<mapZone other="Hawaiian Standard Time" territory="001" type="Pacific/Honolulu"/>
|
||||
<mapZone other="Hawaiian Standard Time" territory="CK" type="Pacific/Rarotonga"/>
|
||||
<mapZone other="Hawaiian Standard Time" territory="PF" type="Pacific/Tahiti"/>
|
||||
<mapZone other="Hawaiian Standard Time" territory="UM" type="Pacific/Johnston"/>
|
||||
<mapZone other="Hawaiian Standard Time" territory="US" type="Pacific/Honolulu"/>
|
||||
<mapZone other="Hawaiian Standard Time" territory="ZZ" type="Etc/GMT+10"/>
|
||||
|
||||
<!-- (UTC-09:30) Marquesas Islands -->
|
||||
<mapZone other="Marquesas Standard Time" territory="001" type="Pacific/Marquesas"/>
|
||||
<mapZone other="Marquesas Standard Time" territory="PF" type="Pacific/Marquesas"/>
|
||||
|
||||
<!-- (UTC-09:00) Alaska -->
|
||||
<mapZone other="Alaskan Standard Time" territory="001" type="America/Anchorage"/>
|
||||
<mapZone other="Alaskan Standard Time" territory="US" type="America/Anchorage America/Juneau America/Metlakatla America/Nome America/Sitka America/Yakutat"/>
|
||||
|
||||
<!-- (UTC-09:00) Coordinated Universal Time-09 -->
|
||||
<mapZone other="UTC-09" territory="001" type="Etc/GMT+9"/>
|
||||
<mapZone other="UTC-09" territory="PF" type="Pacific/Gambier"/>
|
||||
<mapZone other="UTC-09" territory="ZZ" type="Etc/GMT+9"/>
|
||||
|
||||
<!-- (UTC-08:00) Baja California -->
|
||||
<mapZone other="Pacific Standard Time (Mexico)" territory="001" type="America/Tijuana"/>
|
||||
<mapZone other="Pacific Standard Time (Mexico)" territory="MX" type="America/Tijuana America/Santa_Isabel"/>
|
||||
|
||||
<!-- (UTC-08:00) Coordinated Universal Time-08 -->
|
||||
<mapZone other="UTC-08" territory="001" type="Etc/GMT+8"/>
|
||||
<mapZone other="UTC-08" territory="PN" type="Pacific/Pitcairn"/>
|
||||
<mapZone other="UTC-08" territory="ZZ" type="Etc/GMT+8"/>
|
||||
|
||||
<!-- (UTC-08:00) Pacific Time (US & Canada) -->
|
||||
<mapZone other="Pacific Standard Time" territory="001" type="America/Los_Angeles"/>
|
||||
<mapZone other="Pacific Standard Time" territory="CA" type="America/Vancouver America/Dawson America/Whitehorse"/>
|
||||
<mapZone other="Pacific Standard Time" territory="US" type="America/Los_Angeles"/>
|
||||
<mapZone other="Pacific Standard Time" territory="ZZ" type="PST8PDT"/>
|
||||
|
||||
<!-- (UTC-07:00) Arizona -->
|
||||
<mapZone other="US Mountain Standard Time" territory="001" type="America/Phoenix"/>
|
||||
<mapZone other="US Mountain Standard Time" territory="CA" type="America/Dawson_Creek America/Creston America/Fort_Nelson"/>
|
||||
<mapZone other="US Mountain Standard Time" territory="MX" type="America/Hermosillo"/>
|
||||
<mapZone other="US Mountain Standard Time" territory="US" type="America/Phoenix"/>
|
||||
<mapZone other="US Mountain Standard Time" territory="ZZ" type="Etc/GMT+7"/>
|
||||
|
||||
<!-- (UTC-07:00) Chihuahua, La Paz, Mazatlan -->
|
||||
<mapZone other="Mountain Standard Time (Mexico)" territory="001" type="America/Chihuahua"/>
|
||||
<mapZone other="Mountain Standard Time (Mexico)" territory="MX" type="America/Chihuahua America/Mazatlan"/>
|
||||
|
||||
<!-- (UTC-07:00) Mountain Time (US & Canada) -->
|
||||
<mapZone other="Mountain Standard Time" territory="001" type="America/Denver"/>
|
||||
<mapZone other="Mountain Standard Time" territory="CA" type="America/Edmonton America/Cambridge_Bay America/Inuvik America/Yellowknife"/>
|
||||
<mapZone other="Mountain Standard Time" territory="MX" type="America/Ojinaga"/>
|
||||
<mapZone other="Mountain Standard Time" territory="US" type="America/Denver America/Boise"/>
|
||||
<mapZone other="Mountain Standard Time" territory="ZZ" type="MST7MDT"/>
|
||||
|
||||
<!-- (UTC-06:00) Central America -->
|
||||
<mapZone other="Central America Standard Time" territory="001" type="America/Guatemala"/>
|
||||
<mapZone other="Central America Standard Time" territory="BZ" type="America/Belize"/>
|
||||
<mapZone other="Central America Standard Time" territory="CR" type="America/Costa_Rica"/>
|
||||
<mapZone other="Central America Standard Time" territory="EC" type="Pacific/Galapagos"/>
|
||||
<mapZone other="Central America Standard Time" territory="GT" type="America/Guatemala"/>
|
||||
<mapZone other="Central America Standard Time" territory="HN" type="America/Tegucigalpa"/>
|
||||
<mapZone other="Central America Standard Time" territory="NI" type="America/Managua"/>
|
||||
<mapZone other="Central America Standard Time" territory="SV" type="America/El_Salvador"/>
|
||||
<mapZone other="Central America Standard Time" territory="ZZ" type="Etc/GMT+6"/>
|
||||
|
||||
<!-- (UTC-06:00) Central Time (US & Canada) -->
|
||||
<mapZone other="Central Standard Time" territory="001" type="America/Chicago"/>
|
||||
<mapZone other="Central Standard Time" territory="CA" type="America/Winnipeg America/Rainy_River America/Rankin_Inlet America/Resolute"/>
|
||||
<mapZone other="Central Standard Time" territory="MX" type="America/Matamoros"/>
|
||||
<mapZone other="Central Standard Time" territory="US" type="America/Chicago America/Indiana/Knox America/Indiana/Tell_City America/Menominee America/North_Dakota/Beulah America/North_Dakota/Center America/North_Dakota/New_Salem"/>
|
||||
<mapZone other="Central Standard Time" territory="ZZ" type="CST6CDT"/>
|
||||
|
||||
<!-- (UTC-06:00) Easter Island -->
|
||||
<mapZone other="Easter Island Standard Time" territory="001" type="Pacific/Easter"/>
|
||||
<mapZone other="Easter Island Standard Time" territory="CL" type="Pacific/Easter"/>
|
||||
|
||||
<!-- (UTC-06:00) Guadalajara, Mexico City, Monterrey -->
|
||||
<mapZone other="Central Standard Time (Mexico)" territory="001" type="America/Mexico_City"/>
|
||||
<mapZone other="Central Standard Time (Mexico)" territory="MX" type="America/Mexico_City America/Bahia_Banderas America/Merida America/Monterrey"/>
|
||||
|
||||
<!-- (UTC-06:00) Saskatchewan -->
|
||||
<mapZone other="Canada Central Standard Time" territory="001" type="America/Regina"/>
|
||||
<mapZone other="Canada Central Standard Time" territory="CA" type="America/Regina America/Swift_Current"/>
|
||||
|
||||
<!-- (UTC-05:00) Bogota, Lima, Quito, Rio Branco -->
|
||||
<mapZone other="SA Pacific Standard Time" territory="001" type="America/Bogota"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="BR" type="America/Rio_Branco America/Eirunepe"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="CA" type="America/Coral_Harbour"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="CO" type="America/Bogota"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="EC" type="America/Guayaquil"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="JM" type="America/Jamaica"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="KY" type="America/Cayman"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="PA" type="America/Panama"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="PE" type="America/Lima"/>
|
||||
<mapZone other="SA Pacific Standard Time" territory="ZZ" type="Etc/GMT+5"/>
|
||||
|
||||
<!-- (UTC-05:00) Chetumal -->
|
||||
<mapZone other="Eastern Standard Time (Mexico)" territory="001" type="America/Cancun"/>
|
||||
<mapZone other="Eastern Standard Time (Mexico)" territory="MX" type="America/Cancun"/>
|
||||
|
||||
<!-- (UTC-05:00) Eastern Time (US & Canada) -->
|
||||
<mapZone other="Eastern Standard Time" territory="001" type="America/New_York"/>
|
||||
<mapZone other="Eastern Standard Time" territory="BS" type="America/Nassau"/>
|
||||
<mapZone other="Eastern Standard Time" territory="CA" type="America/Toronto America/Iqaluit America/Montreal America/Nipigon America/Pangnirtung America/Thunder_Bay"/>
|
||||
<mapZone other="Eastern Standard Time" territory="US" type="America/New_York America/Detroit America/Indiana/Petersburg America/Indiana/Vincennes America/Indiana/Winamac America/Kentucky/Monticello America/Louisville"/>
|
||||
<mapZone other="Eastern Standard Time" territory="ZZ" type="EST5EDT"/>
|
||||
|
||||
<!-- (UTC-05:00) Haiti -->
|
||||
<mapZone other="Haiti Standard Time" territory="001" type="America/Port-au-Prince"/>
|
||||
<mapZone other="Haiti Standard Time" territory="HT" type="America/Port-au-Prince"/>
|
||||
|
||||
<!-- (UTC-05:00) Havana -->
|
||||
<mapZone other="Cuba Standard Time" territory="001" type="America/Havana"/>
|
||||
<mapZone other="Cuba Standard Time" territory="CU" type="America/Havana"/>
|
||||
|
||||
<!-- (UTC-05:00) Indiana (East) -->
|
||||
<mapZone other="US Eastern Standard Time" territory="001" type="America/Indianapolis"/>
|
||||
<mapZone other="US Eastern Standard Time" territory="US" type="America/Indianapolis America/Indiana/Marengo America/Indiana/Vevay"/>
|
||||
|
||||
<!-- (UTC-04:00) Asuncion -->
|
||||
<mapZone other="Paraguay Standard Time" territory="001" type="America/Asuncion"/>
|
||||
<mapZone other="Paraguay Standard Time" territory="PY" type="America/Asuncion"/>
|
||||
|
||||
<!-- (UTC-04:00) Atlantic Time (Canada) -->
|
||||
<mapZone other="Atlantic Standard Time" territory="001" type="America/Halifax"/>
|
||||
<mapZone other="Atlantic Standard Time" territory="BM" type="Atlantic/Bermuda"/>
|
||||
<mapZone other="Atlantic Standard Time" territory="CA" type="America/Halifax America/Glace_Bay America/Goose_Bay America/Moncton"/>
|
||||
<mapZone other="Atlantic Standard Time" territory="GL" type="America/Thule"/>
|
||||
|
||||
<!-- (UTC-04:00) Caracas -->
|
||||
<mapZone other="Venezuela Standard Time" territory="001" type="America/Caracas"/>
|
||||
<mapZone other="Venezuela Standard Time" territory="VE" type="America/Caracas"/>
|
||||
|
||||
<!-- (UTC-04:00) Cuiaba -->
|
||||
<mapZone other="Central Brazilian Standard Time" territory="001" type="America/Cuiaba"/>
|
||||
<mapZone other="Central Brazilian Standard Time" territory="BR" type="America/Cuiaba America/Campo_Grande"/>
|
||||
|
||||
<!-- (UTC-04:00) Georgetown, La Paz, Manaus, San Juan -->
|
||||
<mapZone other="SA Western Standard Time" territory="001" type="America/La_Paz"/>
|
||||
<mapZone other="SA Western Standard Time" territory="AG" type="America/Antigua"/>
|
||||
<mapZone other="SA Western Standard Time" territory="AI" type="America/Anguilla"/>
|
||||
<mapZone other="SA Western Standard Time" territory="AW" type="America/Aruba"/>
|
||||
<mapZone other="SA Western Standard Time" territory="BB" type="America/Barbados"/>
|
||||
<mapZone other="SA Western Standard Time" territory="BL" type="America/St_Barthelemy"/>
|
||||
<mapZone other="SA Western Standard Time" territory="BO" type="America/La_Paz"/>
|
||||
<mapZone other="SA Western Standard Time" territory="BQ" type="America/Kralendijk"/>
|
||||
<mapZone other="SA Western Standard Time" territory="BR" type="America/Manaus America/Boa_Vista America/Porto_Velho"/>
|
||||
<mapZone other="SA Western Standard Time" territory="CA" type="America/Blanc-Sablon"/>
|
||||
<mapZone other="SA Western Standard Time" territory="CW" type="America/Curacao"/>
|
||||
<mapZone other="SA Western Standard Time" territory="DM" type="America/Dominica"/>
|
||||
<mapZone other="SA Western Standard Time" territory="DO" type="America/Santo_Domingo"/>
|
||||
<mapZone other="SA Western Standard Time" territory="GD" type="America/Grenada"/>
|
||||
<mapZone other="SA Western Standard Time" territory="GP" type="America/Guadeloupe"/>
|
||||
<mapZone other="SA Western Standard Time" territory="GY" type="America/Guyana"/>
|
||||
<mapZone other="SA Western Standard Time" territory="KN" type="America/St_Kitts"/>
|
||||
<mapZone other="SA Western Standard Time" territory="LC" type="America/St_Lucia"/>
|
||||
<mapZone other="SA Western Standard Time" territory="MF" type="America/Marigot"/>
|
||||
<mapZone other="SA Western Standard Time" territory="MQ" type="America/Martinique"/>
|
||||
<mapZone other="SA Western Standard Time" territory="MS" type="America/Montserrat"/>
|
||||
<mapZone other="SA Western Standard Time" territory="PR" type="America/Puerto_Rico"/>
|
||||
<mapZone other="SA Western Standard Time" territory="SX" type="America/Lower_Princes"/>
|
||||
<mapZone other="SA Western Standard Time" territory="TT" type="America/Port_of_Spain"/>
|
||||
<mapZone other="SA Western Standard Time" territory="VC" type="America/St_Vincent"/>
|
||||
<mapZone other="SA Western Standard Time" territory="VG" type="America/Tortola"/>
|
||||
<mapZone other="SA Western Standard Time" territory="VI" type="America/St_Thomas"/>
|
||||
<mapZone other="SA Western Standard Time" territory="ZZ" type="Etc/GMT+4"/>
|
||||
|
||||
<!-- (UTC-04:00) Santiago -->
|
||||
<mapZone other="Pacific SA Standard Time" territory="001" type="America/Santiago"/>
|
||||
<mapZone other="Pacific SA Standard Time" territory="AQ" type="Antarctica/Palmer"/>
|
||||
<mapZone other="Pacific SA Standard Time" territory="CL" type="America/Santiago"/>
|
||||
|
||||
<!-- (UTC-04:00) Turks and Caicos -->
|
||||
<mapZone other="Turks And Caicos Standard Time" territory="001" type="America/Grand_Turk"/>
|
||||
<mapZone other="Turks And Caicos Standard Time" territory="TC" type="America/Grand_Turk"/>
|
||||
|
||||
<!-- (UTC-03:30) Newfoundland -->
|
||||
<mapZone other="Newfoundland Standard Time" territory="001" type="America/St_Johns"/>
|
||||
<mapZone other="Newfoundland Standard Time" territory="CA" type="America/St_Johns"/>
|
||||
|
||||
<!-- (UTC-03:00) Araguaina -->
|
||||
<mapZone other="Tocantins Standard Time" territory="001" type="America/Araguaina"/>
|
||||
<mapZone other="Tocantins Standard Time" territory="BR" type="America/Araguaina"/>
|
||||
|
||||
<!-- (UTC-03:00) Brasilia -->
|
||||
<mapZone other="E. South America Standard Time" territory="001" type="America/Sao_Paulo"/>
|
||||
<mapZone other="E. South America Standard Time" territory="BR" type="America/Sao_Paulo"/>
|
||||
|
||||
<!-- (UTC-03:00) Cayenne, Fortaleza -->
|
||||
<mapZone other="SA Eastern Standard Time" territory="001" type="America/Cayenne"/>
|
||||
<mapZone other="SA Eastern Standard Time" territory="AQ" type="Antarctica/Rothera"/>
|
||||
<mapZone other="SA Eastern Standard Time" territory="BR" type="America/Fortaleza America/Belem America/Maceio America/Recife America/Santarem"/>
|
||||
<mapZone other="SA Eastern Standard Time" territory="FK" type="Atlantic/Stanley"/>
|
||||
<mapZone other="SA Eastern Standard Time" territory="GF" type="America/Cayenne"/>
|
||||
<mapZone other="SA Eastern Standard Time" territory="SR" type="America/Paramaribo"/>
|
||||
<mapZone other="SA Eastern Standard Time" territory="ZZ" type="Etc/GMT+3"/>
|
||||
|
||||
<!-- (UTC-03:00) City of Buenos Aires -->
|
||||
<mapZone other="Argentina Standard Time" territory="001" type="America/Buenos_Aires"/>
|
||||
<mapZone other="Argentina Standard Time" territory="AR" type="America/Buenos_Aires America/Argentina/La_Rioja America/Argentina/Rio_Gallegos America/Argentina/Salta America/Argentina/San_Juan America/Argentina/San_Luis America/Argentina/Tucuman America/Argentina/Ushuaia America/Catamarca America/Cordoba America/Jujuy America/Mendoza"/>
|
||||
|
||||
<!-- (UTC-03:00) Greenland -->
|
||||
<mapZone other="Greenland Standard Time" territory="001" type="America/Godthab"/>
|
||||
<mapZone other="Greenland Standard Time" territory="GL" type="America/Godthab"/>
|
||||
|
||||
<!-- (UTC-03:00) Montevideo -->
|
||||
<mapZone other="Montevideo Standard Time" territory="001" type="America/Montevideo"/>
|
||||
<mapZone other="Montevideo Standard Time" territory="UY" type="America/Montevideo"/>
|
||||
|
||||
<!-- (UTC-03:00) Saint Pierre and Miquelon -->
|
||||
<mapZone other="Saint Pierre Standard Time" territory="001" type="America/Miquelon"/>
|
||||
<mapZone other="Saint Pierre Standard Time" territory="PM" type="America/Miquelon"/>
|
||||
|
||||
<!-- (UTC-03:00) Salvador -->
|
||||
<mapZone other="Bahia Standard Time" territory="001" type="America/Bahia"/>
|
||||
<mapZone other="Bahia Standard Time" territory="BR" type="America/Bahia"/>
|
||||
|
||||
<!-- (UTC-02:00) Coordinated Universal Time-02 -->
|
||||
<mapZone other="UTC-02" territory="001" type="Etc/GMT+2"/>
|
||||
<mapZone other="UTC-02" territory="BR" type="America/Noronha"/>
|
||||
<mapZone other="UTC-02" territory="GS" type="Atlantic/South_Georgia"/>
|
||||
<mapZone other="UTC-02" territory="ZZ" type="Etc/GMT+2"/>
|
||||
|
||||
<!-- (UTC-01:00) Azores -->
|
||||
<mapZone other="Azores Standard Time" territory="001" type="Atlantic/Azores"/>
|
||||
<mapZone other="Azores Standard Time" territory="GL" type="America/Scoresbysund"/>
|
||||
<mapZone other="Azores Standard Time" territory="PT" type="Atlantic/Azores"/>
|
||||
|
||||
<!-- (UTC-01:00) Cabo Verde Is. -->
|
||||
<mapZone other="Cape Verde Standard Time" territory="001" type="Atlantic/Cape_Verde"/>
|
||||
<mapZone other="Cape Verde Standard Time" territory="CV" type="Atlantic/Cape_Verde"/>
|
||||
<mapZone other="Cape Verde Standard Time" territory="ZZ" type="Etc/GMT+1"/>
|
||||
|
||||
<!-- (UTC) Coordinated Universal Time -->
|
||||
<mapZone other="UTC" territory="001" type="Etc/GMT"/>
|
||||
<mapZone other="UTC" territory="GL" type="America/Danmarkshavn"/>
|
||||
<mapZone other="UTC" territory="ZZ" type="Etc/GMT"/>
|
||||
|
||||
<!-- (UTC+00:00) Casablanca -->
|
||||
<mapZone other="Morocco Standard Time" territory="001" type="Africa/Casablanca"/>
|
||||
<mapZone other="Morocco Standard Time" territory="EH" type="Africa/El_Aaiun"/>
|
||||
<mapZone other="Morocco Standard Time" territory="MA" type="Africa/Casablanca"/>
|
||||
|
||||
<!-- (UTC+00:00) Dublin, Edinburgh, Lisbon, London -->
|
||||
<mapZone other="GMT Standard Time" territory="001" type="Europe/London"/>
|
||||
<mapZone other="GMT Standard Time" territory="ES" type="Atlantic/Canary"/>
|
||||
<mapZone other="GMT Standard Time" territory="FO" type="Atlantic/Faeroe"/>
|
||||
<mapZone other="GMT Standard Time" territory="GB" type="Europe/London"/>
|
||||
<mapZone other="GMT Standard Time" territory="GG" type="Europe/Guernsey"/>
|
||||
<mapZone other="GMT Standard Time" territory="IE" type="Europe/Dublin"/>
|
||||
<mapZone other="GMT Standard Time" territory="IM" type="Europe/Isle_of_Man"/>
|
||||
<mapZone other="GMT Standard Time" territory="JE" type="Europe/Jersey"/>
|
||||
<mapZone other="GMT Standard Time" territory="PT" type="Europe/Lisbon Atlantic/Madeira"/>
|
||||
|
||||
<!-- (UTC+00:00) Monrovia, Reykjavik -->
|
||||
<mapZone other="Greenwich Standard Time" territory="001" type="Atlantic/Reykjavik"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="BF" type="Africa/Ouagadougou"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="CI" type="Africa/Abidjan"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="GH" type="Africa/Accra"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="GM" type="Africa/Banjul"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="GN" type="Africa/Conakry"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="GW" type="Africa/Bissau"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="IS" type="Atlantic/Reykjavik"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="LR" type="Africa/Monrovia"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="ML" type="Africa/Bamako"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="MR" type="Africa/Nouakchott"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="SH" type="Atlantic/St_Helena"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="SL" type="Africa/Freetown"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="SN" type="Africa/Dakar"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="ST" type="Africa/Sao_Tome"/>
|
||||
<mapZone other="Greenwich Standard Time" territory="TG" type="Africa/Lome"/>
|
||||
|
||||
<!-- (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna -->
|
||||
<mapZone other="W. Europe Standard Time" territory="001" type="Europe/Berlin"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="AD" type="Europe/Andorra"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="AT" type="Europe/Vienna"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="CH" type="Europe/Zurich"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="DE" type="Europe/Berlin Europe/Busingen"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="GI" type="Europe/Gibraltar"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="IT" type="Europe/Rome"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="LI" type="Europe/Vaduz"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="LU" type="Europe/Luxembourg"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="MC" type="Europe/Monaco"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="MT" type="Europe/Malta"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="NL" type="Europe/Amsterdam"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="NO" type="Europe/Oslo"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="SE" type="Europe/Stockholm"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="SJ" type="Arctic/Longyearbyen"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="SM" type="Europe/San_Marino"/>
|
||||
<mapZone other="W. Europe Standard Time" territory="VA" type="Europe/Vatican"/>
|
||||
|
||||
<!-- (UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague -->
|
||||
<mapZone other="Central Europe Standard Time" territory="001" type="Europe/Budapest"/>
|
||||
<mapZone other="Central Europe Standard Time" territory="AL" type="Europe/Tirane"/>
|
||||
<mapZone other="Central Europe Standard Time" territory="CZ" type="Europe/Prague"/>
|
||||
<mapZone other="Central Europe Standard Time" territory="HU" type="Europe/Budapest"/>
|
||||
<mapZone other="Central Europe Standard Time" territory="ME" type="Europe/Podgorica"/>
|
||||
<mapZone other="Central Europe Standard Time" territory="RS" type="Europe/Belgrade"/>
|
||||
<mapZone other="Central Europe Standard Time" territory="SI" type="Europe/Ljubljana"/>
|
||||
<mapZone other="Central Europe Standard Time" territory="SK" type="Europe/Bratislava"/>
|
||||
|
||||
<!-- (UTC+01:00) Brussels, Copenhagen, Madrid, Paris -->
|
||||
<mapZone other="Romance Standard Time" territory="001" type="Europe/Paris"/>
|
||||
<mapZone other="Romance Standard Time" territory="BE" type="Europe/Brussels"/>
|
||||
<mapZone other="Romance Standard Time" territory="DK" type="Europe/Copenhagen"/>
|
||||
<mapZone other="Romance Standard Time" territory="ES" type="Europe/Madrid Africa/Ceuta"/>
|
||||
<mapZone other="Romance Standard Time" territory="FR" type="Europe/Paris"/>
|
||||
|
||||
<!-- (UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb -->
|
||||
<mapZone other="Central European Standard Time" territory="001" type="Europe/Warsaw"/>
|
||||
<mapZone other="Central European Standard Time" territory="BA" type="Europe/Sarajevo"/>
|
||||
<mapZone other="Central European Standard Time" territory="HR" type="Europe/Zagreb"/>
|
||||
<mapZone other="Central European Standard Time" territory="MK" type="Europe/Skopje"/>
|
||||
<mapZone other="Central European Standard Time" territory="PL" type="Europe/Warsaw"/>
|
||||
|
||||
<!-- (UTC+01:00) West Central Africa -->
|
||||
<mapZone other="W. Central Africa Standard Time" territory="001" type="Africa/Lagos"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="AO" type="Africa/Luanda"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="BJ" type="Africa/Porto-Novo"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="CD" type="Africa/Kinshasa"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="CF" type="Africa/Bangui"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="CG" type="Africa/Brazzaville"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="CM" type="Africa/Douala"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="DZ" type="Africa/Algiers"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="GA" type="Africa/Libreville"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="GQ" type="Africa/Malabo"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="NE" type="Africa/Niamey"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="NG" type="Africa/Lagos"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="TD" type="Africa/Ndjamena"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="TN" type="Africa/Tunis"/>
|
||||
<mapZone other="W. Central Africa Standard Time" territory="ZZ" type="Etc/GMT-1"/>
|
||||
|
||||
<!-- (UTC+01:00) Windhoek -->
|
||||
<mapZone other="Namibia Standard Time" territory="001" type="Africa/Windhoek"/>
|
||||
<mapZone other="Namibia Standard Time" territory="NA" type="Africa/Windhoek"/>
|
||||
|
||||
<!-- (UTC+02:00) Amman -->
|
||||
<mapZone other="Jordan Standard Time" territory="001" type="Asia/Amman"/>
|
||||
<mapZone other="Jordan Standard Time" territory="JO" type="Asia/Amman"/>
|
||||
|
||||
<!-- (UTC+02:00) Athens, Bucharest -->
|
||||
<mapZone other="GTB Standard Time" territory="001" type="Europe/Bucharest"/>
|
||||
<mapZone other="GTB Standard Time" territory="CY" type="Asia/Nicosia"/>
|
||||
<mapZone other="GTB Standard Time" territory="GR" type="Europe/Athens"/>
|
||||
<mapZone other="GTB Standard Time" territory="RO" type="Europe/Bucharest"/>
|
||||
|
||||
<!-- (UTC+02:00) Beirut -->
|
||||
<mapZone other="Middle East Standard Time" territory="001" type="Asia/Beirut"/>
|
||||
<mapZone other="Middle East Standard Time" territory="LB" type="Asia/Beirut"/>
|
||||
|
||||
<!-- (UTC+02:00) Cairo -->
|
||||
<mapZone other="Egypt Standard Time" territory="001" type="Africa/Cairo"/>
|
||||
<mapZone other="Egypt Standard Time" territory="EG" type="Africa/Cairo"/>
|
||||
|
||||
<!-- (UTC+02:00) Chisinau -->
|
||||
<mapZone other="E. Europe Standard Time" territory="001" type="Europe/Chisinau"/>
|
||||
<mapZone other="E. Europe Standard Time" territory="MD" type="Europe/Chisinau"/>
|
||||
|
||||
<!-- (UTC+02:00) Damascus -->
|
||||
<mapZone other="Syria Standard Time" territory="001" type="Asia/Damascus"/>
|
||||
<mapZone other="Syria Standard Time" territory="SY" type="Asia/Damascus"/>
|
||||
|
||||
<!-- (UTC+02:00) Gaza, Hebron -->
|
||||
<mapZone other="West Bank Standard Time" territory="001" type="Asia/Hebron"/>
|
||||
<mapZone other="West Bank Standard Time" territory="PS" type="Asia/Hebron Asia/Gaza"/>
|
||||
|
||||
<!-- (UTC+02:00) Harare, Pretoria -->
|
||||
<mapZone other="South Africa Standard Time" territory="001" type="Africa/Johannesburg"/>
|
||||
<mapZone other="South Africa Standard Time" territory="BI" type="Africa/Bujumbura"/>
|
||||
<mapZone other="South Africa Standard Time" territory="BW" type="Africa/Gaborone"/>
|
||||
<mapZone other="South Africa Standard Time" territory="CD" type="Africa/Lubumbashi"/>
|
||||
<mapZone other="South Africa Standard Time" territory="LS" type="Africa/Maseru"/>
|
||||
<mapZone other="South Africa Standard Time" territory="MW" type="Africa/Blantyre"/>
|
||||
<mapZone other="South Africa Standard Time" territory="MZ" type="Africa/Maputo"/>
|
||||
<mapZone other="South Africa Standard Time" territory="RW" type="Africa/Kigali"/>
|
||||
<mapZone other="South Africa Standard Time" territory="SZ" type="Africa/Mbabane"/>
|
||||
<mapZone other="South Africa Standard Time" territory="ZA" type="Africa/Johannesburg"/>
|
||||
<mapZone other="South Africa Standard Time" territory="ZM" type="Africa/Lusaka"/>
|
||||
<mapZone other="South Africa Standard Time" territory="ZW" type="Africa/Harare"/>
|
||||
<mapZone other="South Africa Standard Time" territory="ZZ" type="Etc/GMT-2"/>
|
||||
|
||||
<!-- (UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius -->
|
||||
<mapZone other="FLE Standard Time" territory="001" type="Europe/Kiev"/>
|
||||
<mapZone other="FLE Standard Time" territory="AX" type="Europe/Mariehamn"/>
|
||||
<mapZone other="FLE Standard Time" territory="BG" type="Europe/Sofia"/>
|
||||
<mapZone other="FLE Standard Time" territory="EE" type="Europe/Tallinn"/>
|
||||
<mapZone other="FLE Standard Time" territory="FI" type="Europe/Helsinki"/>
|
||||
<mapZone other="FLE Standard Time" territory="LT" type="Europe/Vilnius"/>
|
||||
<mapZone other="FLE Standard Time" territory="LV" type="Europe/Riga"/>
|
||||
<mapZone other="FLE Standard Time" territory="UA" type="Europe/Kiev Europe/Uzhgorod Europe/Zaporozhye"/>
|
||||
|
||||
<!-- (UTC+02:00) Istanbul -->
|
||||
<mapZone other="Turkey Standard Time" territory="001" type="Europe/Istanbul"/>
|
||||
<mapZone other="Turkey Standard Time" territory="TR" type="Europe/Istanbul"/>
|
||||
|
||||
<!-- (UTC+02:00) Jerusalem -->
|
||||
<mapZone other="Israel Standard Time" territory="001" type="Asia/Jerusalem"/>
|
||||
<mapZone other="Israel Standard Time" territory="IL" type="Asia/Jerusalem"/>
|
||||
|
||||
<!-- (UTC+02:00) Kaliningrad -->
|
||||
<mapZone other="Kaliningrad Standard Time" territory="001" type="Europe/Kaliningrad"/>
|
||||
<mapZone other="Kaliningrad Standard Time" territory="RU" type="Europe/Kaliningrad"/>
|
||||
|
||||
<!-- (UTC+02:00) Tripoli -->
|
||||
<mapZone other="Libya Standard Time" territory="001" type="Africa/Tripoli"/>
|
||||
<mapZone other="Libya Standard Time" territory="LY" type="Africa/Tripoli"/>
|
||||
|
||||
<!-- (UTC+03:00) Baghdad -->
|
||||
<mapZone other="Arabic Standard Time" territory="001" type="Asia/Baghdad"/>
|
||||
<mapZone other="Arabic Standard Time" territory="IQ" type="Asia/Baghdad"/>
|
||||
|
||||
<!-- (UTC+03:00) Kuwait, Riyadh -->
|
||||
<mapZone other="Arab Standard Time" territory="001" type="Asia/Riyadh"/>
|
||||
<mapZone other="Arab Standard Time" territory="BH" type="Asia/Bahrain"/>
|
||||
<mapZone other="Arab Standard Time" territory="KW" type="Asia/Kuwait"/>
|
||||
<mapZone other="Arab Standard Time" territory="QA" type="Asia/Qatar"/>
|
||||
<mapZone other="Arab Standard Time" territory="SA" type="Asia/Riyadh"/>
|
||||
<mapZone other="Arab Standard Time" territory="YE" type="Asia/Aden"/>
|
||||
|
||||
<!-- (UTC+03:00) Minsk -->
|
||||
<mapZone other="Belarus Standard Time" territory="001" type="Europe/Minsk"/>
|
||||
<mapZone other="Belarus Standard Time" territory="BY" type="Europe/Minsk"/>
|
||||
|
||||
<!-- (UTC+03:00) Moscow, St. Petersburg, Volgograd -->
|
||||
<mapZone other="Russian Standard Time" territory="001" type="Europe/Moscow"/>
|
||||
<mapZone other="Russian Standard Time" territory="RU" type="Europe/Moscow Europe/Kirov Europe/Volgograd"/>
|
||||
<mapZone other="Russian Standard Time" territory="UA" type="Europe/Simferopol"/>
|
||||
|
||||
<!-- (UTC+03:00) Nairobi -->
|
||||
<mapZone other="E. Africa Standard Time" territory="001" type="Africa/Nairobi"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="AQ" type="Antarctica/Syowa"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="DJ" type="Africa/Djibouti"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="ER" type="Africa/Asmera"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="ET" type="Africa/Addis_Ababa"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="KE" type="Africa/Nairobi"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="KM" type="Indian/Comoro"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="MG" type="Indian/Antananarivo"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="SD" type="Africa/Khartoum"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="SO" type="Africa/Mogadishu"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="SS" type="Africa/Juba"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="TZ" type="Africa/Dar_es_Salaam"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="UG" type="Africa/Kampala"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="YT" type="Indian/Mayotte"/>
|
||||
<mapZone other="E. Africa Standard Time" territory="ZZ" type="Etc/GMT-3"/>
|
||||
|
||||
<!-- (UTC+03:30) Tehran -->
|
||||
<mapZone other="Iran Standard Time" territory="001" type="Asia/Tehran"/>
|
||||
<mapZone other="Iran Standard Time" territory="IR" type="Asia/Tehran"/>
|
||||
|
||||
<!-- (UTC+04:00) Abu Dhabi, Muscat -->
|
||||
<mapZone other="Arabian Standard Time" territory="001" type="Asia/Dubai"/>
|
||||
<mapZone other="Arabian Standard Time" territory="AE" type="Asia/Dubai"/>
|
||||
<mapZone other="Arabian Standard Time" territory="OM" type="Asia/Muscat"/>
|
||||
<mapZone other="Arabian Standard Time" territory="ZZ" type="Etc/GMT-4"/>
|
||||
|
||||
<!-- (UTC+04:00) Astrakhan, Ulyanovsk -->
|
||||
<mapZone other="Astrakhan Standard Time" territory="001" type="Europe/Astrakhan"/>
|
||||
<mapZone other="Astrakhan Standard Time" territory="RU" type="Europe/Astrakhan Europe/Ulyanovsk"/>
|
||||
|
||||
<!-- (UTC+04:00) Baku -->
|
||||
<mapZone other="Azerbaijan Standard Time" territory="001" type="Asia/Baku"/>
|
||||
<mapZone other="Azerbaijan Standard Time" territory="AZ" type="Asia/Baku"/>
|
||||
|
||||
<!-- (UTC+04:00) Izhevsk, Samara -->
|
||||
<mapZone other="Russia Time Zone 3" territory="001" type="Europe/Samara"/>
|
||||
<mapZone other="Russia Time Zone 3" territory="RU" type="Europe/Samara"/>
|
||||
|
||||
<!-- (UTC+04:00) Port Louis -->
|
||||
<mapZone other="Mauritius Standard Time" territory="001" type="Indian/Mauritius"/>
|
||||
<mapZone other="Mauritius Standard Time" territory="MU" type="Indian/Mauritius"/>
|
||||
<mapZone other="Mauritius Standard Time" territory="RE" type="Indian/Reunion"/>
|
||||
<mapZone other="Mauritius Standard Time" territory="SC" type="Indian/Mahe"/>
|
||||
|
||||
<!-- (UTC+04:00) Tbilisi -->
|
||||
<mapZone other="Georgian Standard Time" territory="001" type="Asia/Tbilisi"/>
|
||||
<mapZone other="Georgian Standard Time" territory="GE" type="Asia/Tbilisi"/>
|
||||
|
||||
<!-- (UTC+04:00) Yerevan -->
|
||||
<mapZone other="Caucasus Standard Time" territory="001" type="Asia/Yerevan"/>
|
||||
<mapZone other="Caucasus Standard Time" territory="AM" type="Asia/Yerevan"/>
|
||||
|
||||
<!-- (UTC+04:30) Kabul -->
|
||||
<mapZone other="Afghanistan Standard Time" territory="001" type="Asia/Kabul"/>
|
||||
<mapZone other="Afghanistan Standard Time" territory="AF" type="Asia/Kabul"/>
|
||||
|
||||
<!-- (UTC+05:00) Ashgabat, Tashkent -->
|
||||
<mapZone other="West Asia Standard Time" territory="001" type="Asia/Tashkent"/>
|
||||
<mapZone other="West Asia Standard Time" territory="AQ" type="Antarctica/Mawson"/>
|
||||
<mapZone other="West Asia Standard Time" territory="KZ" type="Asia/Oral Asia/Aqtau Asia/Aqtobe"/>
|
||||
<mapZone other="West Asia Standard Time" territory="MV" type="Indian/Maldives"/>
|
||||
<mapZone other="West Asia Standard Time" territory="TF" type="Indian/Kerguelen"/>
|
||||
<mapZone other="West Asia Standard Time" territory="TJ" type="Asia/Dushanbe"/>
|
||||
<mapZone other="West Asia Standard Time" territory="TM" type="Asia/Ashgabat"/>
|
||||
<mapZone other="West Asia Standard Time" territory="UZ" type="Asia/Tashkent Asia/Samarkand"/>
|
||||
<mapZone other="West Asia Standard Time" territory="ZZ" type="Etc/GMT-5"/>
|
||||
|
||||
<!-- (UTC+05:00) Ekaterinburg -->
|
||||
<mapZone other="Ekaterinburg Standard Time" territory="001" type="Asia/Yekaterinburg"/>
|
||||
<mapZone other="Ekaterinburg Standard Time" territory="RU" type="Asia/Yekaterinburg"/>
|
||||
|
||||
<!-- (UTC+05:00) Islamabad, Karachi -->
|
||||
<mapZone other="Pakistan Standard Time" territory="001" type="Asia/Karachi"/>
|
||||
<mapZone other="Pakistan Standard Time" territory="PK" type="Asia/Karachi"/>
|
||||
|
||||
<!-- (UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi -->
|
||||
<mapZone other="India Standard Time" territory="001" type="Asia/Calcutta"/>
|
||||
<mapZone other="India Standard Time" territory="IN" type="Asia/Calcutta"/>
|
||||
|
||||
<!-- (UTC+05:30) Sri Jayawardenepura -->
|
||||
<mapZone other="Sri Lanka Standard Time" territory="001" type="Asia/Colombo"/>
|
||||
<mapZone other="Sri Lanka Standard Time" territory="LK" type="Asia/Colombo"/>
|
||||
|
||||
<!-- (UTC+05:45) Kathmandu -->
|
||||
<mapZone other="Nepal Standard Time" territory="001" type="Asia/Katmandu"/>
|
||||
<mapZone other="Nepal Standard Time" territory="NP" type="Asia/Katmandu"/>
|
||||
|
||||
<!-- (UTC+06:00) Astana -->
|
||||
<mapZone other="Central Asia Standard Time" territory="001" type="Asia/Almaty"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="AQ" type="Antarctica/Vostok"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="CN" type="Asia/Urumqi"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="IO" type="Indian/Chagos"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="KG" type="Asia/Bishkek"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="KZ" type="Asia/Almaty Asia/Qyzylorda"/>
|
||||
<mapZone other="Central Asia Standard Time" territory="ZZ" type="Etc/GMT-6"/>
|
||||
|
||||
<!-- (UTC+06:00) Dhaka -->
|
||||
<mapZone other="Bangladesh Standard Time" territory="001" type="Asia/Dhaka"/>
|
||||
<mapZone other="Bangladesh Standard Time" territory="BD" type="Asia/Dhaka"/>
|
||||
<mapZone other="Bangladesh Standard Time" territory="BT" type="Asia/Thimphu"/>
|
||||
|
||||
<!-- (UTC+06:00) Omsk -->
|
||||
<mapZone other="Omsk Standard Time" territory="001" type="Asia/Omsk"/>
|
||||
<mapZone other="Omsk Standard Time" territory="RU" type="Asia/Omsk"/>
|
||||
|
||||
<!-- (UTC+06:30) Yangon (Rangoon) -->
|
||||
<mapZone other="Myanmar Standard Time" territory="001" type="Asia/Rangoon"/>
|
||||
<mapZone other="Myanmar Standard Time" territory="CC" type="Indian/Cocos"/>
|
||||
<mapZone other="Myanmar Standard Time" territory="MM" type="Asia/Rangoon"/>
|
||||
|
||||
<!-- (UTC+07:00) Bangkok, Hanoi, Jakarta -->
|
||||
<mapZone other="SE Asia Standard Time" territory="001" type="Asia/Bangkok"/>
|
||||
<mapZone other="SE Asia Standard Time" territory="AQ" type="Antarctica/Davis"/>
|
||||
<mapZone other="SE Asia Standard Time" territory="CX" type="Indian/Christmas"/>
|
||||
<mapZone other="SE Asia Standard Time" territory="ID" type="Asia/Jakarta Asia/Pontianak"/>
|
||||
<mapZone other="SE Asia Standard Time" territory="KH" type="Asia/Phnom_Penh"/>
|
||||
<mapZone other="SE Asia Standard Time" territory="LA" type="Asia/Vientiane"/>
|
||||
<mapZone other="SE Asia Standard Time" territory="TH" type="Asia/Bangkok"/>
|
||||
<mapZone other="SE Asia Standard Time" territory="VN" type="Asia/Saigon"/>
|
||||
<mapZone other="SE Asia Standard Time" territory="ZZ" type="Etc/GMT-7"/>
|
||||
|
||||
<!-- (UTC+07:00) Barnaul, Gorno-Altaysk -->
|
||||
<mapZone other="Altai Standard Time" territory="001" type="Asia/Barnaul"/>
|
||||
<mapZone other="Altai Standard Time" territory="RU" type="Asia/Barnaul"/>
|
||||
|
||||
<!-- (UTC+07:00) Hovd -->
|
||||
<mapZone other="W. Mongolia Standard Time" territory="001" type="Asia/Hovd"/>
|
||||
<mapZone other="W. Mongolia Standard Time" territory="MN" type="Asia/Hovd"/>
|
||||
|
||||
<!-- (UTC+07:00) Krasnoyarsk -->
|
||||
<mapZone other="North Asia Standard Time" territory="001" type="Asia/Krasnoyarsk"/>
|
||||
<mapZone other="North Asia Standard Time" territory="RU" type="Asia/Krasnoyarsk Asia/Novokuznetsk"/>
|
||||
|
||||
<!-- (UTC+07:00) Novosibirsk -->
|
||||
<mapZone other="N. Central Asia Standard Time" territory="001" type="Asia/Novosibirsk"/>
|
||||
<mapZone other="N. Central Asia Standard Time" territory="RU" type="Asia/Novosibirsk"/>
|
||||
|
||||
<!-- (UTC+07:00) Tomsk -->
|
||||
<mapZone other="Tomsk Standard Time" territory="001" type="Asia/Tomsk"/>
|
||||
<mapZone other="Tomsk Standard Time" territory="RU" type="Asia/Tomsk"/>
|
||||
|
||||
<!-- (UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi -->
|
||||
<mapZone other="China Standard Time" territory="001" type="Asia/Shanghai"/>
|
||||
<mapZone other="China Standard Time" territory="CN" type="Asia/Shanghai"/>
|
||||
<mapZone other="China Standard Time" territory="HK" type="Asia/Hong_Kong"/>
|
||||
<mapZone other="China Standard Time" territory="MO" type="Asia/Macau"/>
|
||||
|
||||
<!-- (UTC+08:00) Irkutsk -->
|
||||
<mapZone other="North Asia East Standard Time" territory="001" type="Asia/Irkutsk"/>
|
||||
<mapZone other="North Asia East Standard Time" territory="RU" type="Asia/Irkutsk"/>
|
||||
|
||||
<!-- (UTC+08:00) Kuala Lumpur, Singapore -->
|
||||
<mapZone other="Singapore Standard Time" territory="001" type="Asia/Singapore"/>
|
||||
<mapZone other="Singapore Standard Time" territory="BN" type="Asia/Brunei"/>
|
||||
<mapZone other="Singapore Standard Time" territory="ID" type="Asia/Makassar"/>
|
||||
<mapZone other="Singapore Standard Time" territory="MY" type="Asia/Kuala_Lumpur Asia/Kuching"/>
|
||||
<mapZone other="Singapore Standard Time" territory="PH" type="Asia/Manila"/>
|
||||
<mapZone other="Singapore Standard Time" territory="SG" type="Asia/Singapore"/>
|
||||
<mapZone other="Singapore Standard Time" territory="ZZ" type="Etc/GMT-8"/>
|
||||
|
||||
<!-- (UTC+08:00) Perth -->
|
||||
<mapZone other="W. Australia Standard Time" territory="001" type="Australia/Perth"/>
|
||||
<mapZone other="W. Australia Standard Time" territory="AU" type="Australia/Perth"/>
|
||||
|
||||
<!-- (UTC+08:00) Taipei -->
|
||||
<mapZone other="Taipei Standard Time" territory="001" type="Asia/Taipei"/>
|
||||
<mapZone other="Taipei Standard Time" territory="TW" type="Asia/Taipei"/>
|
||||
|
||||
<!-- (UTC+08:00) Ulaanbaatar -->
|
||||
<mapZone other="Ulaanbaatar Standard Time" territory="001" type="Asia/Ulaanbaatar"/>
|
||||
<mapZone other="Ulaanbaatar Standard Time" territory="MN" type="Asia/Ulaanbaatar Asia/Choibalsan"/>
|
||||
|
||||
<!-- (UTC+08:30) Pyongyang -->
|
||||
<mapZone other="North Korea Standard Time" territory="001" type="Asia/Pyongyang"/>
|
||||
<mapZone other="North Korea Standard Time" territory="KP" type="Asia/Pyongyang"/>
|
||||
|
||||
<!-- (UTC+08:45) Eucla -->
|
||||
<mapZone other="Aus Central W. Standard Time" territory="001" type="Australia/Eucla"/>
|
||||
<mapZone other="Aus Central W. Standard Time" territory="AU" type="Australia/Eucla"/>
|
||||
|
||||
<!-- (UTC+09:00) Chita -->
|
||||
<mapZone other="Transbaikal Standard Time" territory="001" type="Asia/Chita"/>
|
||||
<mapZone other="Transbaikal Standard Time" territory="RU" type="Asia/Chita"/>
|
||||
|
||||
<!-- (UTC+09:00) Osaka, Sapporo, Tokyo -->
|
||||
<mapZone other="Tokyo Standard Time" territory="001" type="Asia/Tokyo"/>
|
||||
<mapZone other="Tokyo Standard Time" territory="ID" type="Asia/Jayapura"/>
|
||||
<mapZone other="Tokyo Standard Time" territory="JP" type="Asia/Tokyo"/>
|
||||
<mapZone other="Tokyo Standard Time" territory="PW" type="Pacific/Palau"/>
|
||||
<mapZone other="Tokyo Standard Time" territory="TL" type="Asia/Dili"/>
|
||||
<mapZone other="Tokyo Standard Time" territory="ZZ" type="Etc/GMT-9"/>
|
||||
|
||||
<!-- (UTC+09:00) Seoul -->
|
||||
<mapZone other="Korea Standard Time" territory="001" type="Asia/Seoul"/>
|
||||
<mapZone other="Korea Standard Time" territory="KR" type="Asia/Seoul"/>
|
||||
|
||||
<!-- (UTC+09:00) Yakutsk -->
|
||||
<mapZone other="Yakutsk Standard Time" territory="001" type="Asia/Yakutsk"/>
|
||||
<mapZone other="Yakutsk Standard Time" territory="RU" type="Asia/Yakutsk Asia/Khandyga"/>
|
||||
|
||||
<!-- (UTC+09:30) Adelaide -->
|
||||
<mapZone other="Cen. Australia Standard Time" territory="001" type="Australia/Adelaide"/>
|
||||
<mapZone other="Cen. Australia Standard Time" territory="AU" type="Australia/Adelaide Australia/Broken_Hill"/>
|
||||
|
||||
<!-- (UTC+09:30) Darwin -->
|
||||
<mapZone other="AUS Central Standard Time" territory="001" type="Australia/Darwin"/>
|
||||
<mapZone other="AUS Central Standard Time" territory="AU" type="Australia/Darwin"/>
|
||||
|
||||
<!-- (UTC+10:00) Brisbane -->
|
||||
<mapZone other="E. Australia Standard Time" territory="001" type="Australia/Brisbane"/>
|
||||
<mapZone other="E. Australia Standard Time" territory="AU" type="Australia/Brisbane Australia/Lindeman"/>
|
||||
|
||||
<!-- (UTC+10:00) Canberra, Melbourne, Sydney -->
|
||||
<mapZone other="AUS Eastern Standard Time" territory="001" type="Australia/Sydney"/>
|
||||
<mapZone other="AUS Eastern Standard Time" territory="AU" type="Australia/Sydney Australia/Melbourne"/>
|
||||
|
||||
<!-- (UTC+10:00) Guam, Port Moresby -->
|
||||
<mapZone other="West Pacific Standard Time" territory="001" type="Pacific/Port_Moresby"/>
|
||||
<mapZone other="West Pacific Standard Time" territory="AQ" type="Antarctica/DumontDUrville"/>
|
||||
<mapZone other="West Pacific Standard Time" territory="FM" type="Pacific/Truk"/>
|
||||
<mapZone other="West Pacific Standard Time" territory="GU" type="Pacific/Guam"/>
|
||||
<mapZone other="West Pacific Standard Time" territory="MP" type="Pacific/Saipan"/>
|
||||
<mapZone other="West Pacific Standard Time" territory="PG" type="Pacific/Port_Moresby"/>
|
||||
<mapZone other="West Pacific Standard Time" territory="ZZ" type="Etc/GMT-10"/>
|
||||
|
||||
<!-- (UTC+10:00) Hobart -->
|
||||
<mapZone other="Tasmania Standard Time" territory="001" type="Australia/Hobart"/>
|
||||
<mapZone other="Tasmania Standard Time" territory="AU" type="Australia/Hobart Australia/Currie"/>
|
||||
|
||||
<!-- (UTC+10:00) Vladivostok -->
|
||||
<mapZone other="Vladivostok Standard Time" territory="001" type="Asia/Vladivostok"/>
|
||||
<mapZone other="Vladivostok Standard Time" territory="RU" type="Asia/Vladivostok Asia/Ust-Nera"/>
|
||||
|
||||
<!-- (UTC+10:30) Lord Howe Island -->
|
||||
<mapZone other="Lord Howe Standard Time" territory="001" type="Australia/Lord_Howe"/>
|
||||
<mapZone other="Lord Howe Standard Time" territory="AU" type="Australia/Lord_Howe"/>
|
||||
|
||||
<!-- (UTC+11:00) Bougainville Island -->
|
||||
<mapZone other="Bougainville Standard Time" territory="001" type="Pacific/Bougainville"/>
|
||||
<mapZone other="Bougainville Standard Time" territory="PG" type="Pacific/Bougainville"/>
|
||||
|
||||
<!-- (UTC+11:00) Chokurdakh -->
|
||||
<mapZone other="Russia Time Zone 10" territory="001" type="Asia/Srednekolymsk"/>
|
||||
<mapZone other="Russia Time Zone 10" territory="RU" type="Asia/Srednekolymsk"/>
|
||||
|
||||
<!-- (UTC+11:00) Magadan -->
|
||||
<mapZone other="Magadan Standard Time" territory="001" type="Asia/Magadan"/>
|
||||
<mapZone other="Magadan Standard Time" territory="RU" type="Asia/Magadan"/>
|
||||
|
||||
<!-- (UTC+11:00) Norfolk Island -->
|
||||
<mapZone other="Norfolk Standard Time" territory="001" type="Pacific/Norfolk"/>
|
||||
<mapZone other="Norfolk Standard Time" territory="NF" type="Pacific/Norfolk"/>
|
||||
|
||||
<!-- (UTC+11:00) Sakhalin -->
|
||||
<mapZone other="Sakhalin Standard Time" territory="001" type="Asia/Sakhalin"/>
|
||||
<mapZone other="Sakhalin Standard Time" territory="RU" type="Asia/Sakhalin"/>
|
||||
|
||||
<!-- (UTC+11:00) Solomon Is., New Caledonia -->
|
||||
<mapZone other="Central Pacific Standard Time" territory="001" type="Pacific/Guadalcanal"/>
|
||||
<mapZone other="Central Pacific Standard Time" territory="AQ" type="Antarctica/Casey"/>
|
||||
<mapZone other="Central Pacific Standard Time" territory="AU" type="Antarctica/Macquarie"/>
|
||||
<mapZone other="Central Pacific Standard Time" territory="FM" type="Pacific/Ponape Pacific/Kosrae"/>
|
||||
<mapZone other="Central Pacific Standard Time" territory="NC" type="Pacific/Noumea"/>
|
||||
<mapZone other="Central Pacific Standard Time" territory="SB" type="Pacific/Guadalcanal"/>
|
||||
<mapZone other="Central Pacific Standard Time" territory="VU" type="Pacific/Efate"/>
|
||||
<mapZone other="Central Pacific Standard Time" territory="ZZ" type="Etc/GMT-11"/>
|
||||
|
||||
<!-- (UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky -->
|
||||
<mapZone other="Russia Time Zone 11" territory="001" type="Asia/Kamchatka"/>
|
||||
<mapZone other="Russia Time Zone 11" territory="RU" type="Asia/Kamchatka Asia/Anadyr"/>
|
||||
|
||||
<!-- (UTC+12:00) Auckland, Wellington -->
|
||||
<mapZone other="New Zealand Standard Time" territory="001" type="Pacific/Auckland"/>
|
||||
<mapZone other="New Zealand Standard Time" territory="AQ" type="Antarctica/McMurdo"/>
|
||||
<mapZone other="New Zealand Standard Time" territory="NZ" type="Pacific/Auckland"/>
|
||||
|
||||
<!-- (UTC+12:00) Coordinated Universal Time+12 -->
|
||||
<mapZone other="UTC+12" territory="001" type="Etc/GMT-12"/>
|
||||
<mapZone other="UTC+12" territory="KI" type="Pacific/Tarawa"/>
|
||||
<mapZone other="UTC+12" territory="MH" type="Pacific/Majuro Pacific/Kwajalein"/>
|
||||
<mapZone other="UTC+12" territory="NR" type="Pacific/Nauru"/>
|
||||
<mapZone other="UTC+12" territory="TV" type="Pacific/Funafuti"/>
|
||||
<mapZone other="UTC+12" territory="UM" type="Pacific/Wake"/>
|
||||
<mapZone other="UTC+12" territory="WF" type="Pacific/Wallis"/>
|
||||
<mapZone other="UTC+12" territory="ZZ" type="Etc/GMT-12"/>
|
||||
|
||||
<!-- (UTC+12:00) Fiji -->
|
||||
<mapZone other="Fiji Standard Time" territory="001" type="Pacific/Fiji"/>
|
||||
<mapZone other="Fiji Standard Time" territory="FJ" type="Pacific/Fiji"/>
|
||||
|
||||
<!-- (UTC+12:45) Chatham Islands -->
|
||||
<mapZone other="Chatham Islands Standard Time" territory="001" type="Pacific/Chatham"/>
|
||||
<mapZone other="Chatham Islands Standard Time" territory="NZ" type="Pacific/Chatham"/>
|
||||
|
||||
<!-- (UTC+13:00) Nuku'alofa -->
|
||||
<mapZone other="Tonga Standard Time" territory="001" type="Pacific/Tongatapu"/>
|
||||
<mapZone other="Tonga Standard Time" territory="KI" type="Pacific/Enderbury"/>
|
||||
<mapZone other="Tonga Standard Time" territory="TK" type="Pacific/Fakaofo"/>
|
||||
<mapZone other="Tonga Standard Time" territory="TO" type="Pacific/Tongatapu"/>
|
||||
<mapZone other="Tonga Standard Time" territory="ZZ" type="Etc/GMT-13"/>
|
||||
|
||||
<!-- (UTC+13:00) Samoa -->
|
||||
<mapZone other="Samoa Standard Time" territory="001" type="Pacific/Apia"/>
|
||||
<mapZone other="Samoa Standard Time" territory="WS" type="Pacific/Apia"/>
|
||||
|
||||
<!-- (UTC+14:00) Kiritimati Island -->
|
||||
<mapZone other="Line Islands Standard Time" territory="001" type="Pacific/Kiritimati"/>
|
||||
<mapZone other="Line Islands Standard Time" territory="KI" type="Pacific/Kiritimati"/>
|
||||
<mapZone other="Line Islands Standard Time" territory="ZZ" type="Etc/GMT-14"/>
|
||||
</mapTimezones>
|
||||
</windowsZones>
|
||||
</supplementalData>
|
20
externals/porter-stemmer/LICENSE
vendored
Normal file
20
externals/porter-stemmer/LICENSE
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2005-2016 Richard Heyes (http://www.phpguru.org/)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
42
externals/porter-stemmer/README.md
vendored
Normal file
42
externals/porter-stemmer/README.md
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# Porter Stemmer by Richard Heyes
|
||||
|
||||
# Installation (with composer)
|
||||
|
||||
```json
|
||||
{
|
||||
"require": {
|
||||
"camspiers/porter-stemmer": "1.0.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
$ composer install
|
||||
|
||||
# Usage
|
||||
|
||||
```php
|
||||
$stem = Porter::Stem($word);
|
||||
```
|
||||
|
||||
# License
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2005-2016 Richard Heyes (http://www.phpguru.org/)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
426
externals/porter-stemmer/src/Porter.php
vendored
Normal file
426
externals/porter-stemmer/src/Porter.php
vendored
Normal file
@@ -0,0 +1,426 @@
|
||||
<?php
|
||||
|
||||
# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
|
||||
|
||||
/**
|
||||
* Copyright (c) 2005-2016 Richard Heyes (http://www.phpguru.org/)
|
||||
*
|
||||
* Portions Copyright 2003-2007 Jon Abernathy <jon@chuggnutt.com>
|
||||
*
|
||||
* Originally available under the GPL 2 or greater. Relicensed with permission
|
||||
* of original authors under the MIT License in 2016.
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* @package PorterStemmer
|
||||
* @author Richard Heyes
|
||||
* @author Jon Abernathy <jon@chuggnutt.com>
|
||||
* @copyright 2005-2016 Richard Heyes (http://www.phpguru.org/)
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
*/
|
||||
|
||||
/**
|
||||
* PHP 5 Implementation of the Porter Stemmer algorithm. Certain elements
|
||||
* were borrowed from the (broken) implementation by Jon Abernathy.
|
||||
*
|
||||
* See http://tartarus.org/~martin/PorterStemmer/ for a description of the
|
||||
* algorithm.
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* $stem = PorterStemmer::Stem($word);
|
||||
*
|
||||
* How easy is that?
|
||||
*
|
||||
* @package PorterStemmer
|
||||
* @author Richard Heyes
|
||||
* @author Jon Abernathy <jon@chuggnutt.com>
|
||||
* @copyright 2005-2016 Richard Heyes (http://www.phpguru.org/)
|
||||
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||
*/
|
||||
class Porter
|
||||
{
|
||||
/**
|
||||
* Regex for matching a consonant
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $regex_consonant = '(?:[bcdfghjklmnpqrstvwxz]|(?<=[aeiou])y|^y)';
|
||||
|
||||
/**
|
||||
* Regex for matching a vowel
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $regex_vowel = '(?:[aeiou]|(?<![aeiou])y)';
|
||||
|
||||
/**
|
||||
* Stems a word. Simple huh?
|
||||
*
|
||||
* @param string $word Word to stem
|
||||
*
|
||||
* @return string Stemmed word
|
||||
*/
|
||||
public static function Stem($word)
|
||||
{
|
||||
if (strlen($word) <= 2) {
|
||||
return $word;
|
||||
}
|
||||
|
||||
$word = self::step1ab($word);
|
||||
$word = self::step1c($word);
|
||||
$word = self::step2($word);
|
||||
$word = self::step3($word);
|
||||
$word = self::step4($word);
|
||||
$word = self::step5($word);
|
||||
|
||||
return $word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 1
|
||||
*/
|
||||
private static function step1ab($word)
|
||||
{
|
||||
// Part a
|
||||
if (substr($word, -1) == 's') {
|
||||
|
||||
self::replace($word, 'sses', 'ss')
|
||||
OR self::replace($word, 'ies', 'i')
|
||||
OR self::replace($word, 'ss', 'ss')
|
||||
OR self::replace($word, 's', '');
|
||||
}
|
||||
|
||||
// Part b
|
||||
if (substr($word, -2, 1) != 'e' OR !self::replace($word, 'eed', 'ee', 0)) { // First rule
|
||||
$v = self::$regex_vowel;
|
||||
|
||||
// ing and ed
|
||||
if ( preg_match("#$v+#", substr($word, 0, -3)) && self::replace($word, 'ing', '')
|
||||
OR preg_match("#$v+#", substr($word, 0, -2)) && self::replace($word, 'ed', '')) { // Note use of && and OR, for precedence reasons
|
||||
|
||||
// If one of above two test successful
|
||||
if ( !self::replace($word, 'at', 'ate')
|
||||
AND !self::replace($word, 'bl', 'ble')
|
||||
AND !self::replace($word, 'iz', 'ize')) {
|
||||
|
||||
// Double consonant ending
|
||||
if ( self::doubleConsonant($word)
|
||||
AND substr($word, -2) != 'll'
|
||||
AND substr($word, -2) != 'ss'
|
||||
AND substr($word, -2) != 'zz') {
|
||||
|
||||
$word = substr($word, 0, -1);
|
||||
|
||||
} elseif (self::m($word) == 1 AND self::cvc($word)) {
|
||||
$word .= 'e';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 1c
|
||||
*
|
||||
* @param string $word Word to stem
|
||||
*/
|
||||
private static function step1c($word)
|
||||
{
|
||||
$v = self::$regex_vowel;
|
||||
|
||||
if (substr($word, -1) == 'y' && preg_match("#$v+#", substr($word, 0, -1))) {
|
||||
self::replace($word, 'y', 'i');
|
||||
}
|
||||
|
||||
return $word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 2
|
||||
*
|
||||
* @param string $word Word to stem
|
||||
*/
|
||||
private static function step2($word)
|
||||
{
|
||||
switch (substr($word, -2, 1)) {
|
||||
case 'a':
|
||||
self::replace($word, 'ational', 'ate', 0)
|
||||
OR self::replace($word, 'tional', 'tion', 0);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
self::replace($word, 'enci', 'ence', 0)
|
||||
OR self::replace($word, 'anci', 'ance', 0);
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
self::replace($word, 'izer', 'ize', 0);
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
self::replace($word, 'logi', 'log', 0);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
self::replace($word, 'entli', 'ent', 0)
|
||||
OR self::replace($word, 'ousli', 'ous', 0)
|
||||
OR self::replace($word, 'alli', 'al', 0)
|
||||
OR self::replace($word, 'bli', 'ble', 0)
|
||||
OR self::replace($word, 'eli', 'e', 0);
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
self::replace($word, 'ization', 'ize', 0)
|
||||
OR self::replace($word, 'ation', 'ate', 0)
|
||||
OR self::replace($word, 'ator', 'ate', 0);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
self::replace($word, 'iveness', 'ive', 0)
|
||||
OR self::replace($word, 'fulness', 'ful', 0)
|
||||
OR self::replace($word, 'ousness', 'ous', 0)
|
||||
OR self::replace($word, 'alism', 'al', 0);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
self::replace($word, 'biliti', 'ble', 0)
|
||||
OR self::replace($word, 'aliti', 'al', 0)
|
||||
OR self::replace($word, 'iviti', 'ive', 0);
|
||||
break;
|
||||
}
|
||||
|
||||
return $word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 3
|
||||
*
|
||||
* @param string $word String to stem
|
||||
*/
|
||||
private static function step3($word)
|
||||
{
|
||||
switch (substr($word, -2, 1)) {
|
||||
case 'a':
|
||||
self::replace($word, 'ical', 'ic', 0);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
self::replace($word, 'ness', '', 0);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
self::replace($word, 'icate', 'ic', 0)
|
||||
OR self::replace($word, 'iciti', 'ic', 0);
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
self::replace($word, 'ful', '', 0);
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
self::replace($word, 'ative', '', 0);
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
self::replace($word, 'alize', 'al', 0);
|
||||
break;
|
||||
}
|
||||
|
||||
return $word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 4
|
||||
*
|
||||
* @param string $word Word to stem
|
||||
*/
|
||||
private static function step4($word)
|
||||
{
|
||||
switch (substr($word, -2, 1)) {
|
||||
case 'a':
|
||||
self::replace($word, 'al', '', 1);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
self::replace($word, 'ance', '', 1)
|
||||
OR self::replace($word, 'ence', '', 1);
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
self::replace($word, 'er', '', 1);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
self::replace($word, 'ic', '', 1);
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
self::replace($word, 'able', '', 1)
|
||||
OR self::replace($word, 'ible', '', 1);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
self::replace($word, 'ant', '', 1)
|
||||
OR self::replace($word, 'ement', '', 1)
|
||||
OR self::replace($word, 'ment', '', 1)
|
||||
OR self::replace($word, 'ent', '', 1);
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
if (substr($word, -4) == 'tion' OR substr($word, -4) == 'sion') {
|
||||
self::replace($word, 'ion', '', 1);
|
||||
} else {
|
||||
self::replace($word, 'ou', '', 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 's':
|
||||
self::replace($word, 'ism', '', 1);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
self::replace($word, 'ate', '', 1)
|
||||
OR self::replace($word, 'iti', '', 1);
|
||||
break;
|
||||
|
||||
case 'u':
|
||||
self::replace($word, 'ous', '', 1);
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
self::replace($word, 'ive', '', 1);
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
self::replace($word, 'ize', '', 1);
|
||||
break;
|
||||
}
|
||||
|
||||
return $word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Step 5
|
||||
*
|
||||
* @param string $word Word to stem
|
||||
*/
|
||||
private static function step5($word)
|
||||
{
|
||||
// Part a
|
||||
if (substr($word, -1) == 'e') {
|
||||
if (self::m(substr($word, 0, -1)) > 1) {
|
||||
self::replace($word, 'e', '');
|
||||
|
||||
} elseif (self::m(substr($word, 0, -1)) == 1) {
|
||||
|
||||
if (!self::cvc(substr($word, 0, -1))) {
|
||||
self::replace($word, 'e', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Part b
|
||||
if (self::m($word) > 1 AND self::doubleConsonant($word) AND substr($word, -1) == 'l') {
|
||||
$word = substr($word, 0, -1);
|
||||
}
|
||||
|
||||
return $word;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the first string with the second, at the end of the string
|
||||
*
|
||||
* If third arg is given, then the preceding string must match that m
|
||||
* count at least.
|
||||
*
|
||||
* @param string $str String to check
|
||||
* @param string $check Ending to check for
|
||||
* @param string $repl Replacement string
|
||||
* @param int $m Optional minimum number of m() to meet
|
||||
*
|
||||
* @return bool Whether the $check string was at the end of the $str
|
||||
* string. True does not necessarily mean that it was
|
||||
* replaced.
|
||||
*/
|
||||
private static function replace(&$str, $check, $repl, $m = null)
|
||||
{
|
||||
$len = 0 - strlen($check);
|
||||
|
||||
if (substr($str, $len) == $check) {
|
||||
$substr = substr($str, 0, $len);
|
||||
if (is_null($m) OR self::m($substr) > $m) {
|
||||
$str = $substr . $repl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* What, you mean it's not obvious from the name?
|
||||
*
|
||||
* m() measures the number of consonant sequences in $str. if c is
|
||||
* a consonant sequence and v a vowel sequence, and <..> indicates arbitrary
|
||||
* presence,
|
||||
*
|
||||
* <c><v> gives 0
|
||||
* <c>vc<v> gives 1
|
||||
* <c>vcvc<v> gives 2
|
||||
* <c>vcvcvc<v> gives 3
|
||||
*
|
||||
* @param string $str The string to return the m count for
|
||||
*
|
||||
* @return int The m count
|
||||
*/
|
||||
private static function m($str)
|
||||
{
|
||||
$c = self::$regex_consonant;
|
||||
$v = self::$regex_vowel;
|
||||
|
||||
$str = preg_replace("#^$c+#", '', $str);
|
||||
$str = preg_replace("#$v+$#", '', $str);
|
||||
|
||||
preg_match_all("#($v+$c+)#", $str, $matches);
|
||||
|
||||
return count($matches[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true/false as to whether the given string contains two
|
||||
* of the same consonant next to each other at the end of the string.
|
||||
*
|
||||
* @param string $str String to check
|
||||
*
|
||||
* @return bool Result
|
||||
*/
|
||||
private static function doubleConsonant($str)
|
||||
{
|
||||
$c = self::$regex_consonant;
|
||||
|
||||
return preg_match("#$c{2}$#", $str, $matches) AND $matches[0][0] == $matches[0][1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for ending CVC sequence where second C is not W, X or Y
|
||||
*
|
||||
* @param string $str String to check
|
||||
*
|
||||
* @return bool Result
|
||||
*/
|
||||
private static function cvc($str)
|
||||
{
|
||||
$c = self::$regex_consonant;
|
||||
$v = self::$regex_vowel;
|
||||
|
||||
return preg_match("#($c$v$c)$#", $str, $matches)
|
||||
AND strlen($matches[1]) == 3
|
||||
AND $matches[1][2] != 'w'
|
||||
AND $matches[1][2] != 'x'
|
||||
AND $matches[1][2] != 'y';
|
||||
}
|
||||
}
|
@@ -9,7 +9,7 @@ return array(
|
||||
'names' => array(
|
||||
'conpherence.pkg.css' => '3c8a0668',
|
||||
'conpherence.pkg.js' => '020aebcf',
|
||||
'core.pkg.css' => '2d63dec5',
|
||||
'core.pkg.css' => '6dec90c4',
|
||||
'core.pkg.js' => '705aec2c',
|
||||
'differential.pkg.css' => '607c84be',
|
||||
'differential.pkg.js' => '1b97518d',
|
||||
@@ -31,7 +31,7 @@ return array(
|
||||
'rsrc/css/aphront/panel-view.css' => '46923d46',
|
||||
'rsrc/css/aphront/phabricator-nav-view.css' => 'f8a0c1bf',
|
||||
'rsrc/css/aphront/table-view.css' => '0bb61df1',
|
||||
'rsrc/css/aphront/tokenizer.css' => 'b52d0668',
|
||||
'rsrc/css/aphront/tokenizer.css' => '34e2a838',
|
||||
'rsrc/css/aphront/tooltip.css' => 'e3f2412f',
|
||||
'rsrc/css/aphront/typeahead-browse.css' => 'b7ed02d2',
|
||||
'rsrc/css/aphront/typeahead.css' => '8779483d',
|
||||
@@ -112,7 +112,7 @@ return array(
|
||||
'rsrc/css/application/tokens/tokens.css' => 'ce5a50bd',
|
||||
'rsrc/css/application/uiexample/example.css' => 'b4795059',
|
||||
'rsrc/css/core/core.css' => '1b29ed61',
|
||||
'rsrc/css/core/remarkup.css' => 'f06cc20e',
|
||||
'rsrc/css/core/remarkup.css' => 'c286eaef',
|
||||
'rsrc/css/core/syntax.css' => '220b85f9',
|
||||
'rsrc/css/core/z-index.css' => '99c0f5eb',
|
||||
'rsrc/css/diviner/diviner-shared.css' => '4bd263b0',
|
||||
@@ -146,6 +146,7 @@ return array(
|
||||
'rsrc/css/phui/phui-comment-form.css' => '68a2d99a',
|
||||
'rsrc/css/phui/phui-comment-panel.css' => 'ec4e31c0',
|
||||
'rsrc/css/phui/phui-crumbs-view.css' => '614f43cf',
|
||||
'rsrc/css/phui/phui-curtain-object-ref-view.css' => '12404744',
|
||||
'rsrc/css/phui/phui-curtain-view.css' => '68c5efb6',
|
||||
'rsrc/css/phui/phui-document-pro.css' => 'b9613a10',
|
||||
'rsrc/css/phui/phui-document-summary.css' => 'b068eed1',
|
||||
@@ -153,9 +154,9 @@ return array(
|
||||
'rsrc/css/phui/phui-feed-story.css' => 'a0c05029',
|
||||
'rsrc/css/phui/phui-fontkit.css' => '1ec937e5',
|
||||
'rsrc/css/phui/phui-form-view.css' => 'a8e0a1ab',
|
||||
'rsrc/css/phui/phui-form.css' => '159e2d9c',
|
||||
'rsrc/css/phui/phui-form.css' => '1f177cb7',
|
||||
'rsrc/css/phui/phui-head-thing.css' => 'd7f293df',
|
||||
'rsrc/css/phui/phui-header-view.css' => 'be09cc83',
|
||||
'rsrc/css/phui/phui-header-view.css' => '36c86a58',
|
||||
'rsrc/css/phui/phui-hovercard.css' => '6ca90fa0',
|
||||
'rsrc/css/phui/phui-icon-set-selector.css' => '7aa5f3ec',
|
||||
'rsrc/css/phui/phui-icon.css' => '4cbc684a',
|
||||
@@ -165,7 +166,7 @@ return array(
|
||||
'rsrc/css/phui/phui-left-right.css' => '68513c34',
|
||||
'rsrc/css/phui/phui-lightbox.css' => '4ebf22da',
|
||||
'rsrc/css/phui/phui-list.css' => 'b05144dd',
|
||||
'rsrc/css/phui/phui-object-box.css' => 'f434b6be',
|
||||
'rsrc/css/phui/phui-object-box.css' => 'b8d7eea0',
|
||||
'rsrc/css/phui/phui-pager.css' => 'd022c7ad',
|
||||
'rsrc/css/phui/phui-pinboard-view.css' => '1f08f5d8',
|
||||
'rsrc/css/phui/phui-policy-section-view.css' => '139fdc64',
|
||||
@@ -176,7 +177,7 @@ return array(
|
||||
'rsrc/css/phui/phui-status.css' => 'e5ff8be0',
|
||||
'rsrc/css/phui/phui-tag-view.css' => '8519160a',
|
||||
'rsrc/css/phui/phui-timeline-view.css' => '1e348e4b',
|
||||
'rsrc/css/phui/phui-two-column-view.css' => '01e6991e',
|
||||
'rsrc/css/phui/phui-two-column-view.css' => 'f96d319f',
|
||||
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'e86de308',
|
||||
'rsrc/css/phui/workboards/phui-workboard.css' => '74fc9d98',
|
||||
'rsrc/css/phui/workboards/phui-workcard.css' => '913441b6',
|
||||
@@ -538,7 +539,7 @@ return array(
|
||||
'aphront-multi-column-view-css' => 'fbc00ba3',
|
||||
'aphront-panel-view-css' => '46923d46',
|
||||
'aphront-table-view-css' => '0bb61df1',
|
||||
'aphront-tokenizer-control-css' => 'b52d0668',
|
||||
'aphront-tokenizer-control-css' => '34e2a838',
|
||||
'aphront-tooltip-css' => 'e3f2412f',
|
||||
'aphront-typeahead-control-css' => '8779483d',
|
||||
'application-search-view-css' => '0f7c06d8',
|
||||
@@ -796,7 +797,7 @@ return array(
|
||||
'phabricator-object-selector-css' => 'ee77366f',
|
||||
'phabricator-phtize' => '2f1db1ed',
|
||||
'phabricator-prefab' => '5793d835',
|
||||
'phabricator-remarkup-css' => 'f06cc20e',
|
||||
'phabricator-remarkup-css' => 'c286eaef',
|
||||
'phabricator-search-results-css' => '9ea70ace',
|
||||
'phabricator-shaped-request' => 'abf88db8',
|
||||
'phabricator-slowvote-css' => '1694baed',
|
||||
@@ -836,6 +837,7 @@ return array(
|
||||
'phui-comment-form-css' => '68a2d99a',
|
||||
'phui-comment-panel-css' => 'ec4e31c0',
|
||||
'phui-crumbs-view-css' => '614f43cf',
|
||||
'phui-curtain-object-ref-view-css' => '12404744',
|
||||
'phui-curtain-view-css' => '68c5efb6',
|
||||
'phui-document-summary-view-css' => 'b068eed1',
|
||||
'phui-document-view-css' => '52b748a5',
|
||||
@@ -843,10 +845,10 @@ return array(
|
||||
'phui-feed-story-css' => 'a0c05029',
|
||||
'phui-font-icon-base-css' => 'd7994e06',
|
||||
'phui-fontkit-css' => '1ec937e5',
|
||||
'phui-form-css' => '159e2d9c',
|
||||
'phui-form-css' => '1f177cb7',
|
||||
'phui-form-view-css' => 'a8e0a1ab',
|
||||
'phui-head-thing-view-css' => 'd7f293df',
|
||||
'phui-header-view-css' => 'be09cc83',
|
||||
'phui-header-view-css' => '36c86a58',
|
||||
'phui-hovercard' => '074f0783',
|
||||
'phui-hovercard-view-css' => '6ca90fa0',
|
||||
'phui-icon-set-selector-css' => '7aa5f3ec',
|
||||
@@ -858,7 +860,7 @@ return array(
|
||||
'phui-left-right-css' => '68513c34',
|
||||
'phui-lightbox-css' => '4ebf22da',
|
||||
'phui-list-view-css' => 'b05144dd',
|
||||
'phui-object-box-css' => 'f434b6be',
|
||||
'phui-object-box-css' => 'b8d7eea0',
|
||||
'phui-oi-big-ui-css' => 'fa74cc35',
|
||||
'phui-oi-color-css' => 'b517bfa0',
|
||||
'phui-oi-drag-ui-css' => 'da15d3dc',
|
||||
@@ -876,7 +878,7 @@ return array(
|
||||
'phui-tag-view-css' => '8519160a',
|
||||
'phui-theme-css' => '63311e09',
|
||||
'phui-timeline-view-css' => '1e348e4b',
|
||||
'phui-two-column-view-css' => '01e6991e',
|
||||
'phui-two-column-view-css' => 'f96d319f',
|
||||
'phui-workboard-color-css' => 'e86de308',
|
||||
'phui-workboard-view-css' => '74fc9d98',
|
||||
'phui-workcard-view-css' => '913441b6',
|
||||
@@ -1218,6 +1220,10 @@ return array(
|
||||
'javelin-stratcom',
|
||||
'javelin-workflow',
|
||||
),
|
||||
'34e2a838' => array(
|
||||
'aphront-typeahead-control-css',
|
||||
'phui-tag-view-css',
|
||||
),
|
||||
'37b8a04a' => array(
|
||||
'javelin-install',
|
||||
'javelin-util',
|
||||
@@ -1946,10 +1952,6 @@ return array(
|
||||
'b517bfa0' => array(
|
||||
'phui-oi-list-view-css',
|
||||
),
|
||||
'b52d0668' => array(
|
||||
'aphront-typeahead-control-css',
|
||||
'phui-tag-view-css',
|
||||
),
|
||||
'b58d1a2a' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-behavior-device',
|
||||
|
10
resources/sql/autopatches/20200220.xaccount.01.sql
Normal file
10
resources/sql/autopatches/20200220.xaccount.01.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE {$NAMESPACE}_user.user_externalaccountidentifier (
|
||||
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
phid VARBINARY(64) NOT NULL,
|
||||
externalAccountPHID VARBINARY(64) NOT NULL,
|
||||
providerConfigPHID VARBINARY(64) NOT NULL,
|
||||
identifierHash BINARY(12) NOT NULL,
|
||||
identifierRaw LONGTEXT NOT NULL,
|
||||
dateCreated INT UNSIGNED NOT NULL,
|
||||
dateModified INT UNSIGNED NOT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET={$CHARSET} COLLATE {$COLLATE_TEXT};
|
40
resources/sql/autopatches/20200222.xident.01.migrate.php
Normal file
40
resources/sql/autopatches/20200222.xident.01.migrate.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
$account_table = new PhabricatorExternalAccount();
|
||||
$identifier_table = new PhabricatorExternalAccountIdentifier();
|
||||
|
||||
$conn = $account_table->establishConnection('w');
|
||||
$table_name = $account_table->getTableName();
|
||||
|
||||
$iterator = new LiskRawMigrationIterator($conn, $table_name);
|
||||
foreach ($iterator as $account_row) {
|
||||
// We don't need to migrate "accountID" values for "password" accounts,
|
||||
// since these were dummy values in the first place and are no longer
|
||||
// read or written after D21014. (There would be no harm in writing these
|
||||
// rows, but it's easy to skip them.)
|
||||
|
||||
if ($account_row['accountType'] === 'password') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$account_id = $account_row['accountID'];
|
||||
if (!strlen($account_id)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
queryfx(
|
||||
$conn,
|
||||
'INSERT IGNORE INTO %R (
|
||||
phid, externalAccountPHID, providerConfigPHID,
|
||||
identifierHash, identifierRaw,
|
||||
dateCreated, dateModified)
|
||||
VALUES (%s, %s, %s, %s, %s, %d, %d)',
|
||||
$identifier_table,
|
||||
$identifier_table->generatePHID(),
|
||||
$account_row['phid'],
|
||||
$account_row['providerConfigPHID'],
|
||||
PhabricatorHash::digestForIndex($account_id),
|
||||
$account_id,
|
||||
$account_row['dateCreated'],
|
||||
$account_row['dateModified']);
|
||||
}
|
21
resources/sql/autopatches/20200222.xident.02.dropkey.php
Normal file
21
resources/sql/autopatches/20200222.xident.02.dropkey.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
// See T13493. This table previously had a UNIQUE KEY on "<accountType,
|
||||
// accountDomain, accountID>", which is obsolete. The application now violates
|
||||
// this key, so make sure it gets dropped.
|
||||
|
||||
// There's no "IF EXISTS" modifier for "ALTER TABLE" so run this as a PHP patch
|
||||
// instead of an SQL patch.
|
||||
|
||||
$table = new PhabricatorExternalAccount();
|
||||
$conn = $table->establishConnection('w');
|
||||
|
||||
try {
|
||||
queryfx(
|
||||
$conn,
|
||||
'ALTER TABLE %R DROP KEY %T',
|
||||
$table,
|
||||
'account_details');
|
||||
} catch (AphrontQueryException $ex) {
|
||||
// Ignore.
|
||||
}
|
46
resources/timezones/generate-timezone-map.php
Executable file
46
resources/timezones/generate-timezone-map.php
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
$root = dirname(dirname(dirname(__FILE__)));
|
||||
require_once $root.'/scripts/init/init-script.php';
|
||||
|
||||
$xml = $root.'/externals/cldr/cldr_windows_timezones.xml';
|
||||
$xml = Filesystem::readFile($xml);
|
||||
$xml = new SimpleXMLElement($xml);
|
||||
|
||||
$result_map = array();
|
||||
|
||||
$ignore = array(
|
||||
'UTC',
|
||||
'UTC-11',
|
||||
'UTC-02',
|
||||
'UTC-08',
|
||||
'UTC-09',
|
||||
'UTC+12',
|
||||
);
|
||||
$ignore = array_fuse($ignore);
|
||||
|
||||
$zones = $xml->windowsZones->mapTimezones->mapZone;
|
||||
foreach ($zones as $zone) {
|
||||
$windows_name = (string)$zone['other'];
|
||||
$target_name = (string)$zone['type'];
|
||||
|
||||
// Ignore the offset-based timezones from the CLDR map, since we handle
|
||||
// these later.
|
||||
if (isset($ignore[$windows_name])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// We've already seen this timezone so we don't need to add it to the map
|
||||
// again.
|
||||
if (isset($result_map[$windows_name])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$result_map[$windows_name] = $target_name;
|
||||
}
|
||||
|
||||
asort($result_map);
|
||||
|
||||
echo id(new PhutilJSON())
|
||||
->encodeFormatted($result_map);
|
126
resources/timezones/windows-timezones.json
Normal file
126
resources/timezones/windows-timezones.json
Normal file
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"Egypt Standard Time": "Africa/Cairo",
|
||||
"Morocco Standard Time": "Africa/Casablanca",
|
||||
"South Africa Standard Time": "Africa/Johannesburg",
|
||||
"W. Central Africa Standard Time": "Africa/Lagos",
|
||||
"E. Africa Standard Time": "Africa/Nairobi",
|
||||
"Libya Standard Time": "Africa/Tripoli",
|
||||
"Namibia Standard Time": "Africa/Windhoek",
|
||||
"Aleutian Standard Time": "America/Adak",
|
||||
"Alaskan Standard Time": "America/Anchorage",
|
||||
"Tocantins Standard Time": "America/Araguaina",
|
||||
"Paraguay Standard Time": "America/Asuncion",
|
||||
"Bahia Standard Time": "America/Bahia",
|
||||
"SA Pacific Standard Time": "America/Bogota",
|
||||
"Argentina Standard Time": "America/Buenos_Aires",
|
||||
"Eastern Standard Time (Mexico)": "America/Cancun",
|
||||
"Venezuela Standard Time": "America/Caracas",
|
||||
"SA Eastern Standard Time": "America/Cayenne",
|
||||
"Central Standard Time": "America/Chicago",
|
||||
"Mountain Standard Time (Mexico)": "America/Chihuahua",
|
||||
"Central Brazilian Standard Time": "America/Cuiaba",
|
||||
"Mountain Standard Time": "America/Denver",
|
||||
"Greenland Standard Time": "America/Godthab",
|
||||
"Turks And Caicos Standard Time": "America/Grand_Turk",
|
||||
"Central America Standard Time": "America/Guatemala",
|
||||
"Atlantic Standard Time": "America/Halifax",
|
||||
"Cuba Standard Time": "America/Havana",
|
||||
"US Eastern Standard Time": "America/Indianapolis",
|
||||
"SA Western Standard Time": "America/La_Paz",
|
||||
"Pacific Standard Time": "America/Los_Angeles",
|
||||
"Central Standard Time (Mexico)": "America/Mexico_City",
|
||||
"Saint Pierre Standard Time": "America/Miquelon",
|
||||
"Montevideo Standard Time": "America/Montevideo",
|
||||
"Eastern Standard Time": "America/New_York",
|
||||
"US Mountain Standard Time": "America/Phoenix",
|
||||
"Haiti Standard Time": "America/Port-au-Prince",
|
||||
"Canada Central Standard Time": "America/Regina",
|
||||
"Pacific SA Standard Time": "America/Santiago",
|
||||
"E. South America Standard Time": "America/Sao_Paulo",
|
||||
"Newfoundland Standard Time": "America/St_Johns",
|
||||
"Pacific Standard Time (Mexico)": "America/Tijuana",
|
||||
"Central Asia Standard Time": "Asia/Almaty",
|
||||
"Jordan Standard Time": "Asia/Amman",
|
||||
"Arabic Standard Time": "Asia/Baghdad",
|
||||
"Azerbaijan Standard Time": "Asia/Baku",
|
||||
"SE Asia Standard Time": "Asia/Bangkok",
|
||||
"Altai Standard Time": "Asia/Barnaul",
|
||||
"Middle East Standard Time": "Asia/Beirut",
|
||||
"India Standard Time": "Asia/Calcutta",
|
||||
"Transbaikal Standard Time": "Asia/Chita",
|
||||
"Sri Lanka Standard Time": "Asia/Colombo",
|
||||
"Syria Standard Time": "Asia/Damascus",
|
||||
"Bangladesh Standard Time": "Asia/Dhaka",
|
||||
"Arabian Standard Time": "Asia/Dubai",
|
||||
"West Bank Standard Time": "Asia/Hebron",
|
||||
"W. Mongolia Standard Time": "Asia/Hovd",
|
||||
"North Asia East Standard Time": "Asia/Irkutsk",
|
||||
"Israel Standard Time": "Asia/Jerusalem",
|
||||
"Afghanistan Standard Time": "Asia/Kabul",
|
||||
"Russia Time Zone 11": "Asia/Kamchatka",
|
||||
"Pakistan Standard Time": "Asia/Karachi",
|
||||
"Nepal Standard Time": "Asia/Katmandu",
|
||||
"North Asia Standard Time": "Asia/Krasnoyarsk",
|
||||
"Magadan Standard Time": "Asia/Magadan",
|
||||
"N. Central Asia Standard Time": "Asia/Novosibirsk",
|
||||
"Omsk Standard Time": "Asia/Omsk",
|
||||
"North Korea Standard Time": "Asia/Pyongyang",
|
||||
"Myanmar Standard Time": "Asia/Rangoon",
|
||||
"Arab Standard Time": "Asia/Riyadh",
|
||||
"Sakhalin Standard Time": "Asia/Sakhalin",
|
||||
"Korea Standard Time": "Asia/Seoul",
|
||||
"China Standard Time": "Asia/Shanghai",
|
||||
"Singapore Standard Time": "Asia/Singapore",
|
||||
"Russia Time Zone 10": "Asia/Srednekolymsk",
|
||||
"Taipei Standard Time": "Asia/Taipei",
|
||||
"West Asia Standard Time": "Asia/Tashkent",
|
||||
"Georgian Standard Time": "Asia/Tbilisi",
|
||||
"Iran Standard Time": "Asia/Tehran",
|
||||
"Tokyo Standard Time": "Asia/Tokyo",
|
||||
"Tomsk Standard Time": "Asia/Tomsk",
|
||||
"Ulaanbaatar Standard Time": "Asia/Ulaanbaatar",
|
||||
"Vladivostok Standard Time": "Asia/Vladivostok",
|
||||
"Yakutsk Standard Time": "Asia/Yakutsk",
|
||||
"Ekaterinburg Standard Time": "Asia/Yekaterinburg",
|
||||
"Caucasus Standard Time": "Asia/Yerevan",
|
||||
"Azores Standard Time": "Atlantic/Azores",
|
||||
"Cape Verde Standard Time": "Atlantic/Cape_Verde",
|
||||
"Greenwich Standard Time": "Atlantic/Reykjavik",
|
||||
"Cen. Australia Standard Time": "Australia/Adelaide",
|
||||
"E. Australia Standard Time": "Australia/Brisbane",
|
||||
"AUS Central Standard Time": "Australia/Darwin",
|
||||
"Aus Central W. Standard Time": "Australia/Eucla",
|
||||
"Tasmania Standard Time": "Australia/Hobart",
|
||||
"Lord Howe Standard Time": "Australia/Lord_Howe",
|
||||
"W. Australia Standard Time": "Australia/Perth",
|
||||
"AUS Eastern Standard Time": "Australia/Sydney",
|
||||
"Dateline Standard Time": "Etc/GMT+12",
|
||||
"Astrakhan Standard Time": "Europe/Astrakhan",
|
||||
"W. Europe Standard Time": "Europe/Berlin",
|
||||
"GTB Standard Time": "Europe/Bucharest",
|
||||
"Central Europe Standard Time": "Europe/Budapest",
|
||||
"E. Europe Standard Time": "Europe/Chisinau",
|
||||
"Turkey Standard Time": "Europe/Istanbul",
|
||||
"Kaliningrad Standard Time": "Europe/Kaliningrad",
|
||||
"FLE Standard Time": "Europe/Kiev",
|
||||
"GMT Standard Time": "Europe/London",
|
||||
"Belarus Standard Time": "Europe/Minsk",
|
||||
"Russian Standard Time": "Europe/Moscow",
|
||||
"Romance Standard Time": "Europe/Paris",
|
||||
"Russia Time Zone 3": "Europe/Samara",
|
||||
"Central European Standard Time": "Europe/Warsaw",
|
||||
"Mauritius Standard Time": "Indian/Mauritius",
|
||||
"Samoa Standard Time": "Pacific/Apia",
|
||||
"New Zealand Standard Time": "Pacific/Auckland",
|
||||
"Bougainville Standard Time": "Pacific/Bougainville",
|
||||
"Chatham Islands Standard Time": "Pacific/Chatham",
|
||||
"Easter Island Standard Time": "Pacific/Easter",
|
||||
"Fiji Standard Time": "Pacific/Fiji",
|
||||
"Central Pacific Standard Time": "Pacific/Guadalcanal",
|
||||
"Hawaiian Standard Time": "Pacific/Honolulu",
|
||||
"Line Islands Standard Time": "Pacific/Kiritimati",
|
||||
"Marquesas Standard Time": "Pacific/Marquesas",
|
||||
"Norfolk Standard Time": "Pacific/Norfolk",
|
||||
"West Pacific Standard Time": "Pacific/Port_Moresby",
|
||||
"Tonga Standard Time": "Pacific/Tongatapu"
|
||||
}
|
131
scripts/daemon/exec/exec_daemon.php
Executable file
131
scripts/daemon/exec/exec_daemon.php
Executable file
@@ -0,0 +1,131 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
if (function_exists('pcntl_async_signals')) {
|
||||
pcntl_async_signals(true);
|
||||
} else {
|
||||
declare(ticks = 1);
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/../../__init_script__.php';
|
||||
|
||||
if (!posix_isatty(STDOUT)) {
|
||||
$sid = posix_setsid();
|
||||
if ($sid <= 0) {
|
||||
throw new Exception(pht('Failed to create new process session!'));
|
||||
}
|
||||
}
|
||||
|
||||
$args = new PhutilArgumentParser($argv);
|
||||
$args->setTagline(pht('daemon executor'));
|
||||
$args->setSynopsis(<<<EOHELP
|
||||
**exec_daemon.php** [__options__] __daemon__ ...
|
||||
Run an instance of __daemon__.
|
||||
EOHELP
|
||||
);
|
||||
$args->parse(
|
||||
array(
|
||||
array(
|
||||
'name' => 'trace',
|
||||
'help' => pht('Enable debug tracing.'),
|
||||
),
|
||||
array(
|
||||
'name' => 'trace-memory',
|
||||
'help' => pht('Enable debug memory tracing.'),
|
||||
),
|
||||
array(
|
||||
'name' => 'verbose',
|
||||
'help' => pht('Enable verbose activity logging.'),
|
||||
),
|
||||
array(
|
||||
'name' => 'label',
|
||||
'short' => 'l',
|
||||
'param' => 'label',
|
||||
'help' => pht(
|
||||
'Optional process label. Makes "%s" nicer, no behavioral effects.',
|
||||
'ps'),
|
||||
),
|
||||
array(
|
||||
'name' => 'daemon',
|
||||
'wildcard' => true,
|
||||
),
|
||||
));
|
||||
|
||||
$trace_memory = $args->getArg('trace-memory');
|
||||
$trace_mode = $args->getArg('trace') || $trace_memory;
|
||||
$verbose = $args->getArg('verbose');
|
||||
|
||||
if (function_exists('posix_isatty') && posix_isatty(STDIN)) {
|
||||
fprintf(STDERR, pht('Reading daemon configuration from stdin...')."\n");
|
||||
}
|
||||
$config = @file_get_contents('php://stdin');
|
||||
$config = id(new PhutilJSONParser())->parse($config);
|
||||
|
||||
PhutilTypeSpec::checkMap(
|
||||
$config,
|
||||
array(
|
||||
'log' => 'optional string|null',
|
||||
'argv' => 'optional list<wild>',
|
||||
'load' => 'optional list<string>',
|
||||
'down' => 'optional int',
|
||||
));
|
||||
|
||||
$log = idx($config, 'log');
|
||||
|
||||
if ($log) {
|
||||
ini_set('error_log', $log);
|
||||
PhutilErrorHandler::setErrorListener(array('PhutilDaemon', 'errorListener'));
|
||||
}
|
||||
|
||||
$load = idx($config, 'load', array());
|
||||
foreach ($load as $library) {
|
||||
$library = Filesystem::resolvePath($library);
|
||||
phutil_load_library($library);
|
||||
}
|
||||
|
||||
PhutilErrorHandler::initialize();
|
||||
|
||||
$daemon = $args->getArg('daemon');
|
||||
if (!$daemon) {
|
||||
throw new PhutilArgumentUsageException(
|
||||
pht('Specify which class of daemon to start.'));
|
||||
} else if (count($daemon) > 1) {
|
||||
throw new PhutilArgumentUsageException(
|
||||
pht('Specify exactly one daemon to start.'));
|
||||
} else {
|
||||
$daemon = head($daemon);
|
||||
if (!class_exists($daemon)) {
|
||||
throw new PhutilArgumentUsageException(
|
||||
pht(
|
||||
'No class "%s" exists in any known library.',
|
||||
$daemon));
|
||||
} else if (!is_subclass_of($daemon, 'PhutilDaemon')) {
|
||||
throw new PhutilArgumentUsageException(
|
||||
pht(
|
||||
'Class "%s" is not a subclass of "%s".',
|
||||
$daemon,
|
||||
'PhutilDaemon'));
|
||||
}
|
||||
}
|
||||
|
||||
$argv = idx($config, 'argv', array());
|
||||
$daemon = newv($daemon, array($argv));
|
||||
|
||||
if ($trace_mode) {
|
||||
$daemon->setTraceMode();
|
||||
}
|
||||
|
||||
if ($trace_memory) {
|
||||
$daemon->setTraceMemory();
|
||||
}
|
||||
|
||||
if ($verbose) {
|
||||
$daemon->setVerbose(true);
|
||||
}
|
||||
|
||||
$down_duration = idx($config, 'down');
|
||||
if ($down_duration) {
|
||||
$daemon->setScaledownDuration($down_duration);
|
||||
}
|
||||
|
||||
$daemon->execute();
|
@@ -8,10 +8,14 @@ function init_phabricator_script(array $options) {
|
||||
ini_set(
|
||||
'include_path',
|
||||
$include_path.PATH_SEPARATOR.dirname(__FILE__).'/../../../');
|
||||
@include_once 'libphutil/scripts/__init_script__.php';
|
||||
if (!@constant('__LIBPHUTIL__')) {
|
||||
echo "ERROR: Unable to load libphutil. Update your PHP 'include_path' to ".
|
||||
"include the parent directory of libphutil/.\n";
|
||||
|
||||
$ok = @include_once 'arcanist/support/init/init-script.php';
|
||||
if (!$ok) {
|
||||
echo
|
||||
'FATAL ERROR: Unable to load the "Arcanist" library. '.
|
||||
'Put "arcanist/" next to "phabricator/" on disk.';
|
||||
echo "\n";
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@@ -224,6 +224,8 @@ phutil_register_library_map(array(
|
||||
'AphrontFormView' => 'view/form/AphrontFormView.php',
|
||||
'AphrontGlyphBarView' => 'view/widget/bars/AphrontGlyphBarView.php',
|
||||
'AphrontHTMLResponse' => 'aphront/response/AphrontHTMLResponse.php',
|
||||
'AphrontHTTPHeaderParser' => 'aphront/headerparser/AphrontHTTPHeaderParser.php',
|
||||
'AphrontHTTPHeaderParserTestCase' => 'aphront/headerparser/__tests__/AphrontHTTPHeaderParserTestCase.php',
|
||||
'AphrontHTTPParameterType' => 'aphront/httpparametertype/AphrontHTTPParameterType.php',
|
||||
'AphrontHTTPProxyResponse' => 'aphront/response/AphrontHTTPProxyResponse.php',
|
||||
'AphrontHTTPSink' => 'aphront/sink/AphrontHTTPSink.php',
|
||||
@@ -242,6 +244,9 @@ phutil_register_library_map(array(
|
||||
'AphrontMalformedRequestException' => 'aphront/exception/AphrontMalformedRequestException.php',
|
||||
'AphrontMoreView' => 'view/layout/AphrontMoreView.php',
|
||||
'AphrontMultiColumnView' => 'view/layout/AphrontMultiColumnView.php',
|
||||
'AphrontMultipartParser' => 'aphront/multipartparser/AphrontMultipartParser.php',
|
||||
'AphrontMultipartParserTestCase' => 'aphront/multipartparser/__tests__/AphrontMultipartParserTestCase.php',
|
||||
'AphrontMultipartPart' => 'aphront/multipartparser/AphrontMultipartPart.php',
|
||||
'AphrontMySQLDatabaseConnection' => 'infrastructure/storage/connection/mysql/AphrontMySQLDatabaseConnection.php',
|
||||
'AphrontMySQLDatabaseConnectionTestCase' => 'infrastructure/storage/__tests__/AphrontMySQLDatabaseConnectionTestCase.php',
|
||||
'AphrontMySQLiDatabaseConnection' => 'infrastructure/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php',
|
||||
@@ -265,12 +270,15 @@ phutil_register_library_map(array(
|
||||
'AphrontReloadResponse' => 'aphront/response/AphrontReloadResponse.php',
|
||||
'AphrontRequest' => 'aphront/AphrontRequest.php',
|
||||
'AphrontRequestExceptionHandler' => 'aphront/handler/AphrontRequestExceptionHandler.php',
|
||||
'AphrontRequestStream' => 'aphront/requeststream/AphrontRequestStream.php',
|
||||
'AphrontRequestTestCase' => 'aphront/__tests__/AphrontRequestTestCase.php',
|
||||
'AphrontResponse' => 'aphront/response/AphrontResponse.php',
|
||||
'AphrontResponseProducerInterface' => 'aphront/interface/AphrontResponseProducerInterface.php',
|
||||
'AphrontRoutingMap' => 'aphront/site/AphrontRoutingMap.php',
|
||||
'AphrontRoutingMapTestCase' => 'aphront/__tests__/AphrontRoutingMapTestCase.php',
|
||||
'AphrontRoutingResult' => 'aphront/site/AphrontRoutingResult.php',
|
||||
'AphrontSchemaQueryException' => 'infrastructure/storage/exception/AphrontSchemaQueryException.php',
|
||||
'AphrontScopedUnguardedWriteCapability' => 'aphront/writeguard/AphrontScopedUnguardedWriteCapability.php',
|
||||
'AphrontSelectHTTPParameterType' => 'aphront/httpparametertype/AphrontSelectHTTPParameterType.php',
|
||||
'AphrontSideNavFilterView' => 'view/layout/AphrontSideNavFilterView.php',
|
||||
'AphrontSite' => 'aphront/site/AphrontSite.php',
|
||||
@@ -286,6 +294,7 @@ phutil_register_library_map(array(
|
||||
'AphrontUserListHTTPParameterType' => 'aphront/httpparametertype/AphrontUserListHTTPParameterType.php',
|
||||
'AphrontView' => 'view/AphrontView.php',
|
||||
'AphrontWebpageResponse' => 'aphront/response/AphrontWebpageResponse.php',
|
||||
'AphrontWriteGuard' => 'aphront/writeguard/AphrontWriteGuard.php',
|
||||
'ArcanistConduitAPIMethod' => 'applications/arcanist/conduit/ArcanistConduitAPIMethod.php',
|
||||
'AuditConduitAPIMethod' => 'applications/audit/conduit/AuditConduitAPIMethod.php',
|
||||
'AuditQueryConduitAPIMethod' => 'applications/audit/conduit/AuditQueryConduitAPIMethod.php',
|
||||
@@ -603,6 +612,7 @@ phutil_register_library_map(array(
|
||||
'DifferentialRevisionActionTransaction' => 'applications/differential/xaction/DifferentialRevisionActionTransaction.php',
|
||||
'DifferentialRevisionAffectedFilesHeraldField' => 'applications/differential/herald/DifferentialRevisionAffectedFilesHeraldField.php',
|
||||
'DifferentialRevisionAuthorHeraldField' => 'applications/differential/herald/DifferentialRevisionAuthorHeraldField.php',
|
||||
'DifferentialRevisionAuthorPackagesHeraldField' => 'applications/differential/herald/DifferentialRevisionAuthorPackagesHeraldField.php',
|
||||
'DifferentialRevisionAuthorProjectsHeraldField' => 'applications/differential/herald/DifferentialRevisionAuthorProjectsHeraldField.php',
|
||||
'DifferentialRevisionBuildableTransaction' => 'applications/differential/xaction/DifferentialRevisionBuildableTransaction.php',
|
||||
'DifferentialRevisionCloseDetailsController' => 'applications/differential/controller/DifferentialRevisionCloseDetailsController.php',
|
||||
@@ -736,12 +746,14 @@ phutil_register_library_map(array(
|
||||
'DiffusionCommitAuditorsHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuditorsHeraldField.php',
|
||||
'DiffusionCommitAuditorsTransaction' => 'applications/diffusion/xaction/DiffusionCommitAuditorsTransaction.php',
|
||||
'DiffusionCommitAuthorHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuthorHeraldField.php',
|
||||
'DiffusionCommitAuthorPackagesHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuthorPackagesHeraldField.php',
|
||||
'DiffusionCommitAuthorProjectsHeraldField' => 'applications/diffusion/herald/DiffusionCommitAuthorProjectsHeraldField.php',
|
||||
'DiffusionCommitAutocloseHeraldField' => 'applications/diffusion/herald/DiffusionCommitAutocloseHeraldField.php',
|
||||
'DiffusionCommitBranchesController' => 'applications/diffusion/controller/DiffusionCommitBranchesController.php',
|
||||
'DiffusionCommitBranchesHeraldField' => 'applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php',
|
||||
'DiffusionCommitBuildableTransaction' => 'applications/diffusion/xaction/DiffusionCommitBuildableTransaction.php',
|
||||
'DiffusionCommitCommitterHeraldField' => 'applications/diffusion/herald/DiffusionCommitCommitterHeraldField.php',
|
||||
'DiffusionCommitCommitterPackagesHeraldField' => 'applications/diffusion/herald/DiffusionCommitCommitterPackagesHeraldField.php',
|
||||
'DiffusionCommitCommitterProjectsHeraldField' => 'applications/diffusion/herald/DiffusionCommitCommitterProjectsHeraldField.php',
|
||||
'DiffusionCommitConcernTransaction' => 'applications/diffusion/xaction/DiffusionCommitConcernTransaction.php',
|
||||
'DiffusionCommitController' => 'applications/diffusion/controller/DiffusionCommitController.php',
|
||||
@@ -907,10 +919,12 @@ phutil_register_library_map(array(
|
||||
'DiffusionPhpExternalSymbolsSource' => 'applications/diffusion/symbol/DiffusionPhpExternalSymbolsSource.php',
|
||||
'DiffusionPreCommitContentAffectedFilesHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAffectedFilesHeraldField.php',
|
||||
'DiffusionPreCommitContentAuthorHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAuthorHeraldField.php',
|
||||
'DiffusionPreCommitContentAuthorPackagesHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAuthorPackagesHeraldField.php',
|
||||
'DiffusionPreCommitContentAuthorProjectsHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAuthorProjectsHeraldField.php',
|
||||
'DiffusionPreCommitContentAuthorRawHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentAuthorRawHeraldField.php',
|
||||
'DiffusionPreCommitContentBranchesHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentBranchesHeraldField.php',
|
||||
'DiffusionPreCommitContentCommitterHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentCommitterHeraldField.php',
|
||||
'DiffusionPreCommitContentCommitterPackagesHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentCommitterPackagesHeraldField.php',
|
||||
'DiffusionPreCommitContentCommitterProjectsHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentCommitterProjectsHeraldField.php',
|
||||
'DiffusionPreCommitContentCommitterRawHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentCommitterRawHeraldField.php',
|
||||
'DiffusionPreCommitContentDiffContentAddedHeraldField' => 'applications/diffusion/herald/DiffusionPreCommitContentDiffContentAddedHeraldField.php',
|
||||
@@ -1527,6 +1541,7 @@ phutil_register_library_map(array(
|
||||
'HeraldApplicationActionGroup' => 'applications/herald/action/HeraldApplicationActionGroup.php',
|
||||
'HeraldApplyTranscript' => 'applications/herald/storage/transcript/HeraldApplyTranscript.php',
|
||||
'HeraldBasicFieldGroup' => 'applications/herald/field/HeraldBasicFieldGroup.php',
|
||||
'HeraldBoolFieldValue' => 'applications/herald/value/HeraldBoolFieldValue.php',
|
||||
'HeraldBuildableState' => 'applications/herald/state/HeraldBuildableState.php',
|
||||
'HeraldCallWebhookAction' => 'applications/herald/action/HeraldCallWebhookAction.php',
|
||||
'HeraldCommentAction' => 'applications/herald/action/HeraldCommentAction.php',
|
||||
@@ -1986,6 +2001,8 @@ phutil_register_library_map(array(
|
||||
'PHUICrumbView' => 'view/phui/PHUICrumbView.php',
|
||||
'PHUICrumbsView' => 'view/phui/PHUICrumbsView.php',
|
||||
'PHUICurtainExtension' => 'view/extension/PHUICurtainExtension.php',
|
||||
'PHUICurtainObjectRefListView' => 'view/phui/PHUICurtainObjectRefListView.php',
|
||||
'PHUICurtainObjectRefView' => 'view/phui/PHUICurtainObjectRefView.php',
|
||||
'PHUICurtainPanelView' => 'view/layout/PHUICurtainPanelView.php',
|
||||
'PHUICurtainView' => 'view/layout/PHUICurtainView.php',
|
||||
'PHUIDiffGraphView' => 'infrastructure/diff/view/PHUIDiffGraphView.php',
|
||||
@@ -2032,8 +2049,10 @@ phutil_register_library_map(array(
|
||||
'PHUIInfoView' => 'view/phui/PHUIInfoView.php',
|
||||
'PHUIInvisibleCharacterTestCase' => 'view/phui/__tests__/PHUIInvisibleCharacterTestCase.php',
|
||||
'PHUIInvisibleCharacterView' => 'view/phui/PHUIInvisibleCharacterView.php',
|
||||
'PHUILauncherView' => 'view/phui/PHUILauncherView.php',
|
||||
'PHUILeftRightExample' => 'applications/uiexample/examples/PHUILeftRightExample.php',
|
||||
'PHUILeftRightView' => 'view/phui/PHUILeftRightView.php',
|
||||
'PHUILinkView' => 'view/phui/PHUILinkView.php',
|
||||
'PHUIListExample' => 'applications/uiexample/examples/PHUIListExample.php',
|
||||
'PHUIListItemView' => 'view/phui/PHUIListItemView.php',
|
||||
'PHUIListView' => 'view/phui/PHUIListView.php',
|
||||
@@ -2793,46 +2812,42 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConduitTokenQuery' => 'applications/conduit/query/PhabricatorConduitTokenQuery.php',
|
||||
'PhabricatorConduitTokenTerminateController' => 'applications/conduit/controller/PhabricatorConduitTokenTerminateController.php',
|
||||
'PhabricatorConduitTokensSettingsPanel' => 'applications/conduit/settings/PhabricatorConduitTokensSettingsPanel.php',
|
||||
'PhabricatorConfigAllController' => 'applications/config/controller/PhabricatorConfigAllController.php',
|
||||
'PhabricatorConfigApplication' => 'applications/config/application/PhabricatorConfigApplication.php',
|
||||
'PhabricatorConfigApplicationController' => 'applications/config/controller/PhabricatorConfigApplicationController.php',
|
||||
'PhabricatorConfigCacheController' => 'applications/config/controller/PhabricatorConfigCacheController.php',
|
||||
'PhabricatorConfigClusterDatabasesController' => 'applications/config/controller/PhabricatorConfigClusterDatabasesController.php',
|
||||
'PhabricatorConfigClusterNotificationsController' => 'applications/config/controller/PhabricatorConfigClusterNotificationsController.php',
|
||||
'PhabricatorConfigClusterRepositoriesController' => 'applications/config/controller/PhabricatorConfigClusterRepositoriesController.php',
|
||||
'PhabricatorConfigClusterSearchController' => 'applications/config/controller/PhabricatorConfigClusterSearchController.php',
|
||||
'PhabricatorConfigCacheController' => 'applications/config/controller/services/PhabricatorConfigCacheController.php',
|
||||
'PhabricatorConfigClusterDatabasesController' => 'applications/config/controller/services/PhabricatorConfigClusterDatabasesController.php',
|
||||
'PhabricatorConfigClusterNotificationsController' => 'applications/config/controller/services/PhabricatorConfigClusterNotificationsController.php',
|
||||
'PhabricatorConfigClusterRepositoriesController' => 'applications/config/controller/services/PhabricatorConfigClusterRepositoriesController.php',
|
||||
'PhabricatorConfigClusterSearchController' => 'applications/config/controller/services/PhabricatorConfigClusterSearchController.php',
|
||||
'PhabricatorConfigCollectorsModule' => 'applications/config/module/PhabricatorConfigCollectorsModule.php',
|
||||
'PhabricatorConfigColumnSchema' => 'applications/config/schema/PhabricatorConfigColumnSchema.php',
|
||||
'PhabricatorConfigConfigPHIDType' => 'applications/config/phid/PhabricatorConfigConfigPHIDType.php',
|
||||
'PhabricatorConfigConsoleController' => 'applications/config/controller/PhabricatorConfigConsoleController.php',
|
||||
'PhabricatorConfigConstants' => 'applications/config/constants/PhabricatorConfigConstants.php',
|
||||
'PhabricatorConfigController' => 'applications/config/controller/PhabricatorConfigController.php',
|
||||
'PhabricatorConfigCoreSchemaSpec' => 'applications/config/schema/PhabricatorConfigCoreSchemaSpec.php',
|
||||
'PhabricatorConfigDatabaseController' => 'applications/config/controller/PhabricatorConfigDatabaseController.php',
|
||||
'PhabricatorConfigDatabaseIssueController' => 'applications/config/controller/PhabricatorConfigDatabaseIssueController.php',
|
||||
'PhabricatorConfigDatabaseController' => 'applications/config/controller/services/PhabricatorConfigDatabaseController.php',
|
||||
'PhabricatorConfigDatabaseIssueController' => 'applications/config/controller/services/PhabricatorConfigDatabaseIssueController.php',
|
||||
'PhabricatorConfigDatabaseSchema' => 'applications/config/schema/PhabricatorConfigDatabaseSchema.php',
|
||||
'PhabricatorConfigDatabaseSource' => 'infrastructure/env/PhabricatorConfigDatabaseSource.php',
|
||||
'PhabricatorConfigDatabaseStatusController' => 'applications/config/controller/PhabricatorConfigDatabaseStatusController.php',
|
||||
'PhabricatorConfigDatabaseStatusController' => 'applications/config/controller/services/PhabricatorConfigDatabaseStatusController.php',
|
||||
'PhabricatorConfigDefaultSource' => 'infrastructure/env/PhabricatorConfigDefaultSource.php',
|
||||
'PhabricatorConfigDictionarySource' => 'infrastructure/env/PhabricatorConfigDictionarySource.php',
|
||||
'PhabricatorConfigEdgeModule' => 'applications/config/module/PhabricatorConfigEdgeModule.php',
|
||||
'PhabricatorConfigEditController' => 'applications/config/controller/PhabricatorConfigEditController.php',
|
||||
'PhabricatorConfigEditController' => 'applications/config/controller/settings/PhabricatorConfigEditController.php',
|
||||
'PhabricatorConfigEditor' => 'applications/config/editor/PhabricatorConfigEditor.php',
|
||||
'PhabricatorConfigEntry' => 'applications/config/storage/PhabricatorConfigEntry.php',
|
||||
'PhabricatorConfigEntryDAO' => 'applications/config/storage/PhabricatorConfigEntryDAO.php',
|
||||
'PhabricatorConfigEntryQuery' => 'applications/config/query/PhabricatorConfigEntryQuery.php',
|
||||
'PhabricatorConfigFileSource' => 'infrastructure/env/PhabricatorConfigFileSource.php',
|
||||
'PhabricatorConfigGroupConstants' => 'applications/config/constants/PhabricatorConfigGroupConstants.php',
|
||||
'PhabricatorConfigGroupController' => 'applications/config/controller/PhabricatorConfigGroupController.php',
|
||||
'PhabricatorConfigHTTPParameterTypesModule' => 'applications/config/module/PhabricatorConfigHTTPParameterTypesModule.php',
|
||||
'PhabricatorConfigHistoryController' => 'applications/config/controller/PhabricatorConfigHistoryController.php',
|
||||
'PhabricatorConfigIgnoreController' => 'applications/config/controller/PhabricatorConfigIgnoreController.php',
|
||||
'PhabricatorConfigIssueListController' => 'applications/config/controller/PhabricatorConfigIssueListController.php',
|
||||
'PhabricatorConfigIssuePanelController' => 'applications/config/controller/PhabricatorConfigIssuePanelController.php',
|
||||
'PhabricatorConfigIssueViewController' => 'applications/config/controller/PhabricatorConfigIssueViewController.php',
|
||||
'PhabricatorConfigIgnoreController' => 'applications/config/controller/issue/PhabricatorConfigIgnoreController.php',
|
||||
'PhabricatorConfigIssueListController' => 'applications/config/controller/issue/PhabricatorConfigIssueListController.php',
|
||||
'PhabricatorConfigIssuePanelController' => 'applications/config/controller/issue/PhabricatorConfigIssuePanelController.php',
|
||||
'PhabricatorConfigIssueViewController' => 'applications/config/controller/issue/PhabricatorConfigIssueViewController.php',
|
||||
'PhabricatorConfigJSON' => 'applications/config/json/PhabricatorConfigJSON.php',
|
||||
'PhabricatorConfigJSONOptionType' => 'applications/config/custom/PhabricatorConfigJSONOptionType.php',
|
||||
'PhabricatorConfigKeySchema' => 'applications/config/schema/PhabricatorConfigKeySchema.php',
|
||||
'PhabricatorConfigListController' => 'applications/config/controller/PhabricatorConfigListController.php',
|
||||
'PhabricatorConfigLocalSource' => 'infrastructure/env/PhabricatorConfigLocalSource.php',
|
||||
'PhabricatorConfigManagementDeleteWorkflow' => 'applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php',
|
||||
'PhabricatorConfigManagementDoneWorkflow' => 'applications/config/management/PhabricatorConfigManagementDoneWorkflow.php',
|
||||
@@ -2843,12 +2858,12 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConfigManagementWorkflow' => 'applications/config/management/PhabricatorConfigManagementWorkflow.php',
|
||||
'PhabricatorConfigManualActivity' => 'applications/config/storage/PhabricatorConfigManualActivity.php',
|
||||
'PhabricatorConfigModule' => 'applications/config/module/PhabricatorConfigModule.php',
|
||||
'PhabricatorConfigModuleController' => 'applications/config/controller/PhabricatorConfigModuleController.php',
|
||||
'PhabricatorConfigModuleController' => 'applications/config/controller/module/PhabricatorConfigModuleController.php',
|
||||
'PhabricatorConfigOption' => 'applications/config/option/PhabricatorConfigOption.php',
|
||||
'PhabricatorConfigOptionType' => 'applications/config/custom/PhabricatorConfigOptionType.php',
|
||||
'PhabricatorConfigPHIDModule' => 'applications/config/module/PhabricatorConfigPHIDModule.php',
|
||||
'PhabricatorConfigProxySource' => 'infrastructure/env/PhabricatorConfigProxySource.php',
|
||||
'PhabricatorConfigPurgeCacheController' => 'applications/config/controller/PhabricatorConfigPurgeCacheController.php',
|
||||
'PhabricatorConfigPurgeCacheController' => 'applications/config/controller/services/PhabricatorConfigPurgeCacheController.php',
|
||||
'PhabricatorConfigRegexOptionType' => 'applications/config/custom/PhabricatorConfigRegexOptionType.php',
|
||||
'PhabricatorConfigRemarkupRule' => 'infrastructure/markup/rule/PhabricatorConfigRemarkupRule.php',
|
||||
'PhabricatorConfigRequestExceptionHandlerModule' => 'applications/config/module/PhabricatorConfigRequestExceptionHandlerModule.php',
|
||||
@@ -2856,6 +2871,10 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConfigSchemaQuery' => 'applications/config/schema/PhabricatorConfigSchemaQuery.php',
|
||||
'PhabricatorConfigSchemaSpec' => 'applications/config/schema/PhabricatorConfigSchemaSpec.php',
|
||||
'PhabricatorConfigServerSchema' => 'applications/config/schema/PhabricatorConfigServerSchema.php',
|
||||
'PhabricatorConfigServicesController' => 'applications/config/controller/services/PhabricatorConfigServicesController.php',
|
||||
'PhabricatorConfigSettingsController' => 'applications/config/controller/settings/PhabricatorConfigSettingsController.php',
|
||||
'PhabricatorConfigSettingsHistoryController' => 'applications/config/controller/settings/PhabricatorConfigSettingsHistoryController.php',
|
||||
'PhabricatorConfigSettingsListController' => 'applications/config/controller/settings/PhabricatorConfigSettingsListController.php',
|
||||
'PhabricatorConfigSetupCheckModule' => 'applications/config/module/PhabricatorConfigSetupCheckModule.php',
|
||||
'PhabricatorConfigSiteModule' => 'applications/config/module/PhabricatorConfigSiteModule.php',
|
||||
'PhabricatorConfigSiteSource' => 'infrastructure/env/PhabricatorConfigSiteSource.php',
|
||||
@@ -2867,7 +2886,6 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php',
|
||||
'PhabricatorConfigType' => 'applications/config/type/PhabricatorConfigType.php',
|
||||
'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php',
|
||||
'PhabricatorConfigVersionController' => 'applications/config/controller/PhabricatorConfigVersionController.php',
|
||||
'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php',
|
||||
'PhabricatorConpherenceColumnMinimizeSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnMinimizeSetting.php',
|
||||
'PhabricatorConpherenceColumnVisibleSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnVisibleSetting.php',
|
||||
@@ -3301,6 +3319,8 @@ phutil_register_library_map(array(
|
||||
'PhabricatorExtendingPhabricatorConfigOptions' => 'applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php',
|
||||
'PhabricatorExtensionsSetupCheck' => 'applications/config/check/PhabricatorExtensionsSetupCheck.php',
|
||||
'PhabricatorExternalAccount' => 'applications/people/storage/PhabricatorExternalAccount.php',
|
||||
'PhabricatorExternalAccountIdentifier' => 'applications/people/storage/PhabricatorExternalAccountIdentifier.php',
|
||||
'PhabricatorExternalAccountIdentifierQuery' => 'applications/auth/query/PhabricatorExternalAccountIdentifierQuery.php',
|
||||
'PhabricatorExternalAccountQuery' => 'applications/auth/query/PhabricatorExternalAccountQuery.php',
|
||||
'PhabricatorExternalAccountsSettingsPanel' => 'applications/settings/panel/PhabricatorExternalAccountsSettingsPanel.php',
|
||||
'PhabricatorExtraConfigSetupCheck' => 'applications/config/check/PhabricatorExtraConfigSetupCheck.php',
|
||||
@@ -4086,6 +4106,7 @@ phutil_register_library_map(array(
|
||||
'PhabricatorPeopleDisableController' => 'applications/people/controller/PhabricatorPeopleDisableController.php',
|
||||
'PhabricatorPeopleEmailLoginMailEngine' => 'applications/people/mail/PhabricatorPeopleEmailLoginMailEngine.php',
|
||||
'PhabricatorPeopleEmpowerController' => 'applications/people/controller/PhabricatorPeopleEmpowerController.php',
|
||||
'PhabricatorPeopleExternalIdentifierPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalIdentifierPHIDType.php',
|
||||
'PhabricatorPeopleExternalPHIDType' => 'applications/people/phid/PhabricatorPeopleExternalPHIDType.php',
|
||||
'PhabricatorPeopleIconSet' => 'applications/people/icon/PhabricatorPeopleIconSet.php',
|
||||
'PhabricatorPeopleInviteController' => 'applications/people/controller/PhabricatorPeopleInviteController.php',
|
||||
@@ -4383,6 +4404,9 @@ phutil_register_library_map(array(
|
||||
'PhabricatorProjectSubprojectsProfileMenuItem' => 'applications/project/menuitem/PhabricatorProjectSubprojectsProfileMenuItem.php',
|
||||
'PhabricatorProjectSubtypeDatasource' => 'applications/project/typeahead/PhabricatorProjectSubtypeDatasource.php',
|
||||
'PhabricatorProjectSubtypesConfigType' => 'applications/project/config/PhabricatorProjectSubtypesConfigType.php',
|
||||
'PhabricatorProjectTagsAddedField' => 'applications/project/herald/PhabricatorProjectTagsAddedField.php',
|
||||
'PhabricatorProjectTagsField' => 'applications/project/herald/PhabricatorProjectTagsField.php',
|
||||
'PhabricatorProjectTagsRemovedField' => 'applications/project/herald/PhabricatorProjectTagsRemovedField.php',
|
||||
'PhabricatorProjectTestDataGenerator' => 'applications/project/lipsum/PhabricatorProjectTestDataGenerator.php',
|
||||
'PhabricatorProjectTransaction' => 'applications/project/storage/PhabricatorProjectTransaction.php',
|
||||
'PhabricatorProjectTransactionEditor' => 'applications/project/editor/PhabricatorProjectTransactionEditor.php',
|
||||
@@ -5573,6 +5597,7 @@ phutil_register_library_map(array(
|
||||
'PhrictionTransactionComment' => 'applications/phriction/storage/PhrictionTransactionComment.php',
|
||||
'PhrictionTransactionEditor' => 'applications/phriction/editor/PhrictionTransactionEditor.php',
|
||||
'PhrictionTransactionQuery' => 'applications/phriction/query/PhrictionTransactionQuery.php',
|
||||
'PhutilAPCKeyValueCache' => 'infrastructure/cache/PhutilAPCKeyValueCache.php',
|
||||
'PhutilAmazonAuthAdapter' => 'applications/auth/adapter/PhutilAmazonAuthAdapter.php',
|
||||
'PhutilAsanaAuthAdapter' => 'applications/auth/adapter/PhutilAsanaAuthAdapter.php',
|
||||
'PhutilAuthAdapter' => 'applications/auth/adapter/PhutilAuthAdapter.php',
|
||||
@@ -5602,7 +5627,20 @@ phutil_register_library_map(array(
|
||||
'PhutilCalendarRootNode' => 'applications/calendar/parser/data/PhutilCalendarRootNode.php',
|
||||
'PhutilCalendarUserNode' => 'applications/calendar/parser/data/PhutilCalendarUserNode.php',
|
||||
'PhutilCodeSnippetContextFreeGrammar' => 'infrastructure/lipsum/code/PhutilCodeSnippetContextFreeGrammar.php',
|
||||
'PhutilConsoleSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilConsoleSyntaxHighlighter.php',
|
||||
'PhutilContextFreeGrammar' => 'infrastructure/lipsum/PhutilContextFreeGrammar.php',
|
||||
'PhutilDaemon' => 'infrastructure/daemon/PhutilDaemon.php',
|
||||
'PhutilDaemonHandle' => 'infrastructure/daemon/PhutilDaemonHandle.php',
|
||||
'PhutilDaemonOverseer' => 'infrastructure/daemon/PhutilDaemonOverseer.php',
|
||||
'PhutilDaemonOverseerModule' => 'infrastructure/daemon/PhutilDaemonOverseerModule.php',
|
||||
'PhutilDaemonPool' => 'infrastructure/daemon/PhutilDaemonPool.php',
|
||||
'PhutilDefaultSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilDefaultSyntaxHighlighter.php',
|
||||
'PhutilDefaultSyntaxHighlighterEngine' => 'infrastructure/markup/syntax/engine/PhutilDefaultSyntaxHighlighterEngine.php',
|
||||
'PhutilDefaultSyntaxHighlighterEnginePygmentsFuture' => 'infrastructure/markup/syntax/highlighter/pygments/PhutilDefaultSyntaxHighlighterEnginePygmentsFuture.php',
|
||||
'PhutilDefaultSyntaxHighlighterEngineTestCase' => 'infrastructure/markup/syntax/engine/__tests__/PhutilDefaultSyntaxHighlighterEngineTestCase.php',
|
||||
'PhutilDirectoryKeyValueCache' => 'infrastructure/cache/PhutilDirectoryKeyValueCache.php',
|
||||
'PhutilDisqusAuthAdapter' => 'applications/auth/adapter/PhutilDisqusAuthAdapter.php',
|
||||
'PhutilDivinerSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilDivinerSyntaxHighlighter.php',
|
||||
'PhutilEmptyAuthAdapter' => 'applications/auth/adapter/PhutilEmptyAuthAdapter.php',
|
||||
'PhutilFacebookAuthAdapter' => 'applications/auth/adapter/PhutilFacebookAuthAdapter.php',
|
||||
'PhutilGitHubAuthAdapter' => 'applications/auth/adapter/PhutilGitHubAuthAdapter.php',
|
||||
@@ -5612,19 +5650,38 @@ phutil_register_library_map(array(
|
||||
'PhutilICSParserTestCase' => 'applications/calendar/parser/ics/__tests__/PhutilICSParserTestCase.php',
|
||||
'PhutilICSWriter' => 'applications/calendar/parser/ics/PhutilICSWriter.php',
|
||||
'PhutilICSWriterTestCase' => 'applications/calendar/parser/ics/__tests__/PhutilICSWriterTestCase.php',
|
||||
'PhutilInRequestKeyValueCache' => 'infrastructure/cache/PhutilInRequestKeyValueCache.php',
|
||||
'PhutilInvisibleSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilInvisibleSyntaxHighlighter.php',
|
||||
'PhutilJIRAAuthAdapter' => 'applications/auth/adapter/PhutilJIRAAuthAdapter.php',
|
||||
'PhutilJSONFragmentLexerHighlighterTestCase' => 'infrastructure/markup/syntax/highlighter/__tests__/PhutilJSONFragmentLexerHighlighterTestCase.php',
|
||||
'PhutilJavaCodeSnippetContextFreeGrammar' => 'infrastructure/lipsum/code/PhutilJavaCodeSnippetContextFreeGrammar.php',
|
||||
'PhutilKeyValueCache' => 'infrastructure/cache/PhutilKeyValueCache.php',
|
||||
'PhutilKeyValueCacheNamespace' => 'infrastructure/cache/PhutilKeyValueCacheNamespace.php',
|
||||
'PhutilKeyValueCacheProfiler' => 'infrastructure/cache/PhutilKeyValueCacheProfiler.php',
|
||||
'PhutilKeyValueCacheProxy' => 'infrastructure/cache/PhutilKeyValueCacheProxy.php',
|
||||
'PhutilKeyValueCacheStack' => 'infrastructure/cache/PhutilKeyValueCacheStack.php',
|
||||
'PhutilKeyValueCacheTestCase' => 'infrastructure/cache/__tests__/PhutilKeyValueCacheTestCase.php',
|
||||
'PhutilLDAPAuthAdapter' => 'applications/auth/adapter/PhutilLDAPAuthAdapter.php',
|
||||
'PhutilLexerSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilLexerSyntaxHighlighter.php',
|
||||
'PhutilLipsumContextFreeGrammar' => 'infrastructure/lipsum/PhutilLipsumContextFreeGrammar.php',
|
||||
'PhutilMarkupEngine' => 'infrastructure/markup/PhutilMarkupEngine.php',
|
||||
'PhutilMarkupTestCase' => 'infrastructure/markup/__tests__/PhutilMarkupTestCase.php',
|
||||
'PhutilMemcacheKeyValueCache' => 'infrastructure/cache/PhutilMemcacheKeyValueCache.php',
|
||||
'PhutilOAuth1AuthAdapter' => 'applications/auth/adapter/PhutilOAuth1AuthAdapter.php',
|
||||
'PhutilOAuthAuthAdapter' => 'applications/auth/adapter/PhutilOAuthAuthAdapter.php',
|
||||
'PhutilOnDiskKeyValueCache' => 'infrastructure/cache/PhutilOnDiskKeyValueCache.php',
|
||||
'PhutilPHPCodeSnippetContextFreeGrammar' => 'infrastructure/lipsum/code/PhutilPHPCodeSnippetContextFreeGrammar.php',
|
||||
'PhutilPHPFragmentLexerHighlighterTestCase' => 'infrastructure/markup/syntax/highlighter/__tests__/PhutilPHPFragmentLexerHighlighterTestCase.php',
|
||||
'PhutilPhabricatorAuthAdapter' => 'applications/auth/adapter/PhutilPhabricatorAuthAdapter.php',
|
||||
'PhutilProseDiff' => 'infrastructure/diff/prose/PhutilProseDiff.php',
|
||||
'PhutilProseDiffTestCase' => 'infrastructure/diff/prose/__tests__/PhutilProseDiffTestCase.php',
|
||||
'PhutilProseDifferenceEngine' => 'infrastructure/diff/prose/PhutilProseDifferenceEngine.php',
|
||||
'PhutilPygmentizeParser' => 'infrastructure/parser/PhutilPygmentizeParser.php',
|
||||
'PhutilPygmentizeParserTestCase' => 'infrastructure/parser/__tests__/PhutilPygmentizeParserTestCase.php',
|
||||
'PhutilPygmentsSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilPygmentsSyntaxHighlighter.php',
|
||||
'PhutilQsprintfInterface' => 'infrastructure/storage/xsprintf/PhutilQsprintfInterface.php',
|
||||
'PhutilQueryString' => 'infrastructure/storage/xsprintf/PhutilQueryString.php',
|
||||
'PhutilRainbowSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilRainbowSyntaxHighlighter.php',
|
||||
'PhutilRealNameContextFreeGrammar' => 'infrastructure/lipsum/PhutilRealNameContextFreeGrammar.php',
|
||||
'PhutilRemarkupAnchorRule' => 'infrastructure/markup/markuprule/PhutilRemarkupAnchorRule.php',
|
||||
'PhutilRemarkupBlockInterpreter' => 'infrastructure/markup/blockrule/PhutilRemarkupBlockInterpreter.php',
|
||||
@@ -5660,10 +5717,28 @@ phutil_register_library_map(array(
|
||||
'PhutilRemarkupTableBlockRule' => 'infrastructure/markup/blockrule/PhutilRemarkupTableBlockRule.php',
|
||||
'PhutilRemarkupTestInterpreterRule' => 'infrastructure/markup/blockrule/PhutilRemarkupTestInterpreterRule.php',
|
||||
'PhutilRemarkupUnderlineRule' => 'infrastructure/markup/markuprule/PhutilRemarkupUnderlineRule.php',
|
||||
'PhutilSafeHTML' => 'infrastructure/markup/PhutilSafeHTML.php',
|
||||
'PhutilSafeHTMLProducerInterface' => 'infrastructure/markup/PhutilSafeHTMLProducerInterface.php',
|
||||
'PhutilSafeHTMLTestCase' => 'infrastructure/markup/__tests__/PhutilSafeHTMLTestCase.php',
|
||||
'PhutilSearchQueryCompiler' => 'applications/search/compiler/PhutilSearchQueryCompiler.php',
|
||||
'PhutilSearchQueryCompilerSyntaxException' => 'applications/search/compiler/PhutilSearchQueryCompilerSyntaxException.php',
|
||||
'PhutilSearchQueryCompilerTestCase' => 'applications/search/compiler/__tests__/PhutilSearchQueryCompilerTestCase.php',
|
||||
'PhutilSearchQueryToken' => 'applications/search/compiler/PhutilSearchQueryToken.php',
|
||||
'PhutilSearchStemmer' => 'applications/search/compiler/PhutilSearchStemmer.php',
|
||||
'PhutilSearchStemmerTestCase' => 'applications/search/compiler/__tests__/PhutilSearchStemmerTestCase.php',
|
||||
'PhutilSlackAuthAdapter' => 'applications/auth/adapter/PhutilSlackAuthAdapter.php',
|
||||
'PhutilSprite' => 'aphront/sprite/PhutilSprite.php',
|
||||
'PhutilSpriteSheet' => 'aphront/sprite/PhutilSpriteSheet.php',
|
||||
'PhutilSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilSyntaxHighlighter.php',
|
||||
'PhutilSyntaxHighlighterEngine' => 'infrastructure/markup/syntax/engine/PhutilSyntaxHighlighterEngine.php',
|
||||
'PhutilSyntaxHighlighterException' => 'infrastructure/markup/syntax/highlighter/PhutilSyntaxHighlighterException.php',
|
||||
'PhutilTranslatedHTMLTestCase' => 'infrastructure/markup/__tests__/PhutilTranslatedHTMLTestCase.php',
|
||||
'PhutilTwitchAuthAdapter' => 'applications/auth/adapter/PhutilTwitchAuthAdapter.php',
|
||||
'PhutilTwitterAuthAdapter' => 'applications/auth/adapter/PhutilTwitterAuthAdapter.php',
|
||||
'PhutilWordPressAuthAdapter' => 'applications/auth/adapter/PhutilWordPressAuthAdapter.php',
|
||||
'PhutilXHPASTSyntaxHighlighter' => 'infrastructure/markup/syntax/highlighter/PhutilXHPASTSyntaxHighlighter.php',
|
||||
'PhutilXHPASTSyntaxHighlighterFuture' => 'infrastructure/markup/syntax/highlighter/xhpast/PhutilXHPASTSyntaxHighlighterFuture.php',
|
||||
'PhutilXHPASTSyntaxHighlighterTestCase' => 'infrastructure/markup/syntax/highlighter/__tests__/PhutilXHPASTSyntaxHighlighterTestCase.php',
|
||||
'PolicyLockOptionType' => 'applications/policy/config/PolicyLockOptionType.php',
|
||||
'PonderAddAnswerView' => 'applications/ponder/view/PonderAddAnswerView.php',
|
||||
'PonderAnswer' => 'applications/ponder/storage/PonderAnswer.php',
|
||||
@@ -5855,6 +5930,7 @@ phutil_register_library_map(array(
|
||||
'function' => array(
|
||||
'celerity_generate_unique_node_id' => 'applications/celerity/api.php',
|
||||
'celerity_get_resource_uri' => 'applications/celerity/api.php',
|
||||
'hsprintf' => 'infrastructure/markup/render.php',
|
||||
'javelin_tag' => 'infrastructure/javelin/markup.php',
|
||||
'phabricator_date' => 'view/viewutils.php',
|
||||
'phabricator_datetime' => 'view/viewutils.php',
|
||||
@@ -5866,6 +5942,12 @@ phutil_register_library_map(array(
|
||||
'phid_get_subtype' => 'applications/phid/utils.php',
|
||||
'phid_get_type' => 'applications/phid/utils.php',
|
||||
'phid_group_by_type' => 'applications/phid/utils.php',
|
||||
'phutil_escape_html' => 'infrastructure/markup/render.php',
|
||||
'phutil_escape_html_newlines' => 'infrastructure/markup/render.php',
|
||||
'phutil_implode_html' => 'infrastructure/markup/render.php',
|
||||
'phutil_safe_html' => 'infrastructure/markup/render.php',
|
||||
'phutil_tag' => 'infrastructure/markup/render.php',
|
||||
'phutil_tag_div' => 'infrastructure/markup/render.php',
|
||||
'qsprintf' => 'infrastructure/storage/xsprintf/qsprintf.php',
|
||||
'qsprintf_check_scalar_type' => 'infrastructure/storage/xsprintf/qsprintf.php',
|
||||
'qsprintf_check_type' => 'infrastructure/storage/xsprintf/qsprintf.php',
|
||||
@@ -6154,6 +6236,8 @@ phutil_register_library_map(array(
|
||||
'AphrontFormView' => 'AphrontView',
|
||||
'AphrontGlyphBarView' => 'AphrontBarView',
|
||||
'AphrontHTMLResponse' => 'AphrontResponse',
|
||||
'AphrontHTTPHeaderParser' => 'Phobject',
|
||||
'AphrontHTTPHeaderParserTestCase' => 'PhutilTestCase',
|
||||
'AphrontHTTPParameterType' => 'Phobject',
|
||||
'AphrontHTTPProxyResponse' => 'AphrontResponse',
|
||||
'AphrontHTTPSink' => 'Phobject',
|
||||
@@ -6172,6 +6256,9 @@ phutil_register_library_map(array(
|
||||
'AphrontMalformedRequestException' => 'AphrontException',
|
||||
'AphrontMoreView' => 'AphrontView',
|
||||
'AphrontMultiColumnView' => 'AphrontView',
|
||||
'AphrontMultipartParser' => 'Phobject',
|
||||
'AphrontMultipartParserTestCase' => 'PhutilTestCase',
|
||||
'AphrontMultipartPart' => 'Phobject',
|
||||
'AphrontMySQLDatabaseConnection' => 'AphrontBaseMySQLDatabaseConnection',
|
||||
'AphrontMySQLDatabaseConnectionTestCase' => 'PhabricatorTestCase',
|
||||
'AphrontMySQLiDatabaseConnection' => 'AphrontBaseMySQLDatabaseConnection',
|
||||
@@ -6198,11 +6285,14 @@ phutil_register_library_map(array(
|
||||
'AphrontReloadResponse' => 'AphrontRedirectResponse',
|
||||
'AphrontRequest' => 'Phobject',
|
||||
'AphrontRequestExceptionHandler' => 'Phobject',
|
||||
'AphrontRequestStream' => 'Phobject',
|
||||
'AphrontRequestTestCase' => 'PhabricatorTestCase',
|
||||
'AphrontResponse' => 'Phobject',
|
||||
'AphrontRoutingMap' => 'Phobject',
|
||||
'AphrontRoutingMapTestCase' => 'PhabricatorTestCase',
|
||||
'AphrontRoutingResult' => 'Phobject',
|
||||
'AphrontSchemaQueryException' => 'AphrontQueryException',
|
||||
'AphrontScopedUnguardedWriteCapability' => 'Phobject',
|
||||
'AphrontSelectHTTPParameterType' => 'AphrontHTTPParameterType',
|
||||
'AphrontSideNavFilterView' => 'AphrontView',
|
||||
'AphrontSite' => 'Phobject',
|
||||
@@ -6221,6 +6311,7 @@ phutil_register_library_map(array(
|
||||
'PhutilSafeHTMLProducerInterface',
|
||||
),
|
||||
'AphrontWebpageResponse' => 'AphrontHTMLResponse',
|
||||
'AphrontWriteGuard' => 'Phobject',
|
||||
'ArcanistConduitAPIMethod' => 'ConduitAPIMethod',
|
||||
'AuditConduitAPIMethod' => 'ConduitAPIMethod',
|
||||
'AuditQueryConduitAPIMethod' => 'AuditConduitAPIMethod',
|
||||
@@ -6588,6 +6679,7 @@ phutil_register_library_map(array(
|
||||
'DifferentialRevisionActionTransaction' => 'DifferentialRevisionTransactionType',
|
||||
'DifferentialRevisionAffectedFilesHeraldField' => 'DifferentialRevisionHeraldField',
|
||||
'DifferentialRevisionAuthorHeraldField' => 'DifferentialRevisionHeraldField',
|
||||
'DifferentialRevisionAuthorPackagesHeraldField' => 'DifferentialRevisionHeraldField',
|
||||
'DifferentialRevisionAuthorProjectsHeraldField' => 'DifferentialRevisionHeraldField',
|
||||
'DifferentialRevisionBuildableTransaction' => 'DifferentialRevisionTransactionType',
|
||||
'DifferentialRevisionCloseDetailsController' => 'DifferentialController',
|
||||
@@ -6721,12 +6813,14 @@ phutil_register_library_map(array(
|
||||
'DiffusionCommitAuditorsHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitAuditorsTransaction' => 'DiffusionCommitTransactionType',
|
||||
'DiffusionCommitAuthorHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitAuthorPackagesHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitAuthorProjectsHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitAutocloseHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitBranchesController' => 'DiffusionController',
|
||||
'DiffusionCommitBranchesHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitBuildableTransaction' => 'DiffusionCommitTransactionType',
|
||||
'DiffusionCommitCommitterHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitCommitterPackagesHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitCommitterProjectsHeraldField' => 'DiffusionCommitHeraldField',
|
||||
'DiffusionCommitConcernTransaction' => 'DiffusionCommitAuditTransaction',
|
||||
'DiffusionCommitController' => 'DiffusionController',
|
||||
@@ -6895,10 +6989,12 @@ phutil_register_library_map(array(
|
||||
'DiffusionPhpExternalSymbolsSource' => 'DiffusionExternalSymbolsSource',
|
||||
'DiffusionPreCommitContentAffectedFilesHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentAuthorHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentAuthorPackagesHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentAuthorProjectsHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentAuthorRawHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentBranchesHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentCommitterHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentCommitterPackagesHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentCommitterProjectsHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentCommitterRawHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
'DiffusionPreCommitContentDiffContentAddedHeraldField' => 'DiffusionPreCommitContentHeraldField',
|
||||
@@ -7624,6 +7720,7 @@ phutil_register_library_map(array(
|
||||
'HeraldApplicationActionGroup' => 'HeraldActionGroup',
|
||||
'HeraldApplyTranscript' => 'Phobject',
|
||||
'HeraldBasicFieldGroup' => 'HeraldFieldGroup',
|
||||
'HeraldBoolFieldValue' => 'HeraldFieldValue',
|
||||
'HeraldBuildableState' => 'HeraldState',
|
||||
'HeraldCallWebhookAction' => 'HeraldAction',
|
||||
'HeraldCommentAction' => 'HeraldAction',
|
||||
@@ -7675,7 +7772,7 @@ phutil_register_library_map(array(
|
||||
'HeraldPreCommitContentAdapter' => 'HeraldPreCommitAdapter',
|
||||
'HeraldPreCommitRefAdapter' => 'HeraldPreCommitAdapter',
|
||||
'HeraldPreventActionGroup' => 'HeraldActionGroup',
|
||||
'HeraldProjectsField' => 'HeraldField',
|
||||
'HeraldProjectsField' => 'PhabricatorProjectTagsField',
|
||||
'HeraldRecursiveConditionsException' => 'Exception',
|
||||
'HeraldRelatedFieldGroup' => 'HeraldFieldGroup',
|
||||
'HeraldRemarkupFieldValue' => 'HeraldFieldValue',
|
||||
@@ -8171,6 +8268,8 @@ phutil_register_library_map(array(
|
||||
'PHUICrumbView' => 'AphrontView',
|
||||
'PHUICrumbsView' => 'AphrontView',
|
||||
'PHUICurtainExtension' => 'Phobject',
|
||||
'PHUICurtainObjectRefListView' => 'AphrontTagView',
|
||||
'PHUICurtainObjectRefView' => 'AphrontTagView',
|
||||
'PHUICurtainPanelView' => 'AphrontTagView',
|
||||
'PHUICurtainView' => 'AphrontTagView',
|
||||
'PHUIDiffGraphView' => 'Phobject',
|
||||
@@ -8217,8 +8316,10 @@ phutil_register_library_map(array(
|
||||
'PHUIInfoView' => 'AphrontTagView',
|
||||
'PHUIInvisibleCharacterTestCase' => 'PhabricatorTestCase',
|
||||
'PHUIInvisibleCharacterView' => 'AphrontView',
|
||||
'PHUILauncherView' => 'AphrontTagView',
|
||||
'PHUILeftRightExample' => 'PhabricatorUIExample',
|
||||
'PHUILeftRightView' => 'AphrontTagView',
|
||||
'PHUILinkView' => 'AphrontTagView',
|
||||
'PHUIListExample' => 'PhabricatorUIExample',
|
||||
'PHUIListItemView' => 'AphrontTagView',
|
||||
'PHUIListView' => 'AphrontTagView',
|
||||
@@ -8660,6 +8761,7 @@ phutil_register_library_map(array(
|
||||
'PhabricatorAuthDAO',
|
||||
'PhabricatorApplicationTransactionInterface',
|
||||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorDestructibleInterface',
|
||||
),
|
||||
'PhabricatorAuthProviderConfigController' => 'PhabricatorAuthProviderController',
|
||||
'PhabricatorAuthProviderConfigEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
@@ -9113,21 +9215,20 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConduitTokenQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorConduitTokenTerminateController' => 'PhabricatorConduitController',
|
||||
'PhabricatorConduitTokensSettingsPanel' => 'PhabricatorSettingsPanel',
|
||||
'PhabricatorConfigAllController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorConfigApplicationController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigCacheController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigClusterDatabasesController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigClusterNotificationsController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigClusterRepositoriesController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigClusterSearchController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigCacheController' => 'PhabricatorConfigServicesController',
|
||||
'PhabricatorConfigClusterDatabasesController' => 'PhabricatorConfigServicesController',
|
||||
'PhabricatorConfigClusterNotificationsController' => 'PhabricatorConfigServicesController',
|
||||
'PhabricatorConfigClusterRepositoriesController' => 'PhabricatorConfigServicesController',
|
||||
'PhabricatorConfigClusterSearchController' => 'PhabricatorConfigServicesController',
|
||||
'PhabricatorConfigCollectorsModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorConfigColumnSchema' => 'PhabricatorConfigStorageSchema',
|
||||
'PhabricatorConfigConfigPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorConfigConsoleController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigConstants' => 'Phobject',
|
||||
'PhabricatorConfigController' => 'PhabricatorController',
|
||||
'PhabricatorConfigCoreSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
'PhabricatorConfigDatabaseController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigDatabaseController' => 'PhabricatorConfigServicesController',
|
||||
'PhabricatorConfigDatabaseIssueController' => 'PhabricatorConfigDatabaseController',
|
||||
'PhabricatorConfigDatabaseSchema' => 'PhabricatorConfigStorageSchema',
|
||||
'PhabricatorConfigDatabaseSource' => 'PhabricatorConfigProxySource',
|
||||
@@ -9135,7 +9236,7 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConfigDefaultSource' => 'PhabricatorConfigProxySource',
|
||||
'PhabricatorConfigDictionarySource' => 'PhabricatorConfigSource',
|
||||
'PhabricatorConfigEdgeModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorConfigEditController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigEditController' => 'PhabricatorConfigSettingsController',
|
||||
'PhabricatorConfigEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhabricatorConfigEntry' => array(
|
||||
'PhabricatorConfigEntryDAO',
|
||||
@@ -9146,9 +9247,7 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConfigEntryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorConfigFileSource' => 'PhabricatorConfigProxySource',
|
||||
'PhabricatorConfigGroupConstants' => 'PhabricatorConfigConstants',
|
||||
'PhabricatorConfigGroupController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigHTTPParameterTypesModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorConfigHistoryController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigIgnoreController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigIssueListController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigIssuePanelController' => 'PhabricatorConfigController',
|
||||
@@ -9156,7 +9255,6 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConfigJSON' => 'Phobject',
|
||||
'PhabricatorConfigJSONOptionType' => 'PhabricatorConfigOptionType',
|
||||
'PhabricatorConfigKeySchema' => 'PhabricatorConfigStorageSchema',
|
||||
'PhabricatorConfigListController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigLocalSource' => 'PhabricatorConfigProxySource',
|
||||
'PhabricatorConfigManagementDeleteWorkflow' => 'PhabricatorConfigManagementWorkflow',
|
||||
'PhabricatorConfigManagementDoneWorkflow' => 'PhabricatorConfigManagementWorkflow',
|
||||
@@ -9180,6 +9278,10 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConfigSchemaQuery' => 'Phobject',
|
||||
'PhabricatorConfigSchemaSpec' => 'Phobject',
|
||||
'PhabricatorConfigServerSchema' => 'PhabricatorConfigStorageSchema',
|
||||
'PhabricatorConfigServicesController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigSettingsController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigSettingsHistoryController' => 'PhabricatorConfigSettingsController',
|
||||
'PhabricatorConfigSettingsListController' => 'PhabricatorConfigSettingsController',
|
||||
'PhabricatorConfigSetupCheckModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorConfigSiteModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorConfigSiteSource' => 'PhabricatorConfigProxySource',
|
||||
@@ -9191,7 +9293,6 @@ phutil_register_library_map(array(
|
||||
'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PhabricatorConfigType' => 'Phobject',
|
||||
'PhabricatorConfigValidationException' => 'Exception',
|
||||
'PhabricatorConfigVersionController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConpherenceApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorConpherenceColumnMinimizeSetting' => 'PhabricatorInternalSetting',
|
||||
'PhabricatorConpherenceColumnVisibleSetting' => 'PhabricatorInternalSetting',
|
||||
@@ -9668,7 +9769,14 @@ phutil_register_library_map(array(
|
||||
'PhabricatorExternalAccount' => array(
|
||||
'PhabricatorUserDAO',
|
||||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorDestructibleInterface',
|
||||
),
|
||||
'PhabricatorExternalAccountIdentifier' => array(
|
||||
'PhabricatorUserDAO',
|
||||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorDestructibleInterface',
|
||||
),
|
||||
'PhabricatorExternalAccountIdentifierQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorExternalAccountQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorExternalAccountsSettingsPanel' => 'PhabricatorSettingsPanel',
|
||||
'PhabricatorExtraConfigSetupCheck' => 'PhabricatorSetupCheck',
|
||||
@@ -10587,6 +10695,7 @@ phutil_register_library_map(array(
|
||||
'PhabricatorPeopleDisableController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleEmailLoginMailEngine' => 'PhabricatorPeopleMailEngine',
|
||||
'PhabricatorPeopleEmpowerController' => 'PhabricatorPeopleController',
|
||||
'PhabricatorPeopleExternalIdentifierPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorPeopleExternalPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorPeopleIconSet' => 'PhabricatorIconSet',
|
||||
'PhabricatorPeopleInviteController' => 'PhabricatorPeopleController',
|
||||
@@ -10940,6 +11049,9 @@ phutil_register_library_map(array(
|
||||
'PhabricatorProjectSubprojectsProfileMenuItem' => 'PhabricatorProfileMenuItem',
|
||||
'PhabricatorProjectSubtypeDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PhabricatorProjectSubtypesConfigType' => 'PhabricatorJSONConfigType',
|
||||
'PhabricatorProjectTagsAddedField' => 'PhabricatorProjectTagsField',
|
||||
'PhabricatorProjectTagsField' => 'HeraldField',
|
||||
'PhabricatorProjectTagsRemovedField' => 'PhabricatorProjectTagsField',
|
||||
'PhabricatorProjectTestDataGenerator' => 'PhabricatorTestDataGenerator',
|
||||
'PhabricatorProjectTransaction' => 'PhabricatorModularTransaction',
|
||||
'PhabricatorProjectTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
@@ -12401,6 +12513,7 @@ phutil_register_library_map(array(
|
||||
'PhrictionTransactionComment' => 'PhabricatorApplicationTransactionComment',
|
||||
'PhrictionTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhrictionTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||
'PhutilAPCKeyValueCache' => 'PhutilKeyValueCache',
|
||||
'PhutilAmazonAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilAsanaAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilAuthAdapter' => 'Phobject',
|
||||
@@ -12430,7 +12543,20 @@ phutil_register_library_map(array(
|
||||
'PhutilCalendarRootNode' => 'PhutilCalendarContainerNode',
|
||||
'PhutilCalendarUserNode' => 'PhutilCalendarNode',
|
||||
'PhutilCodeSnippetContextFreeGrammar' => 'PhutilContextFreeGrammar',
|
||||
'PhutilConsoleSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilContextFreeGrammar' => 'Phobject',
|
||||
'PhutilDaemon' => 'Phobject',
|
||||
'PhutilDaemonHandle' => 'Phobject',
|
||||
'PhutilDaemonOverseer' => 'Phobject',
|
||||
'PhutilDaemonOverseerModule' => 'Phobject',
|
||||
'PhutilDaemonPool' => 'Phobject',
|
||||
'PhutilDefaultSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilDefaultSyntaxHighlighterEngine' => 'PhutilSyntaxHighlighterEngine',
|
||||
'PhutilDefaultSyntaxHighlighterEnginePygmentsFuture' => 'FutureProxy',
|
||||
'PhutilDefaultSyntaxHighlighterEngineTestCase' => 'PhutilTestCase',
|
||||
'PhutilDirectoryKeyValueCache' => 'PhutilKeyValueCache',
|
||||
'PhutilDisqusAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilDivinerSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilEmptyAuthAdapter' => 'PhutilAuthAdapter',
|
||||
'PhutilFacebookAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilGitHubAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
@@ -12440,18 +12566,37 @@ phutil_register_library_map(array(
|
||||
'PhutilICSParserTestCase' => 'PhutilTestCase',
|
||||
'PhutilICSWriter' => 'Phobject',
|
||||
'PhutilICSWriterTestCase' => 'PhutilTestCase',
|
||||
'PhutilInRequestKeyValueCache' => 'PhutilKeyValueCache',
|
||||
'PhutilInvisibleSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilJIRAAuthAdapter' => 'PhutilOAuth1AuthAdapter',
|
||||
'PhutilJSONFragmentLexerHighlighterTestCase' => 'PhutilTestCase',
|
||||
'PhutilJavaCodeSnippetContextFreeGrammar' => 'PhutilCLikeCodeSnippetContextFreeGrammar',
|
||||
'PhutilKeyValueCache' => 'Phobject',
|
||||
'PhutilKeyValueCacheNamespace' => 'PhutilKeyValueCacheProxy',
|
||||
'PhutilKeyValueCacheProfiler' => 'PhutilKeyValueCacheProxy',
|
||||
'PhutilKeyValueCacheProxy' => 'PhutilKeyValueCache',
|
||||
'PhutilKeyValueCacheStack' => 'PhutilKeyValueCache',
|
||||
'PhutilKeyValueCacheTestCase' => 'PhutilTestCase',
|
||||
'PhutilLDAPAuthAdapter' => 'PhutilAuthAdapter',
|
||||
'PhutilLexerSyntaxHighlighter' => 'PhutilSyntaxHighlighter',
|
||||
'PhutilLipsumContextFreeGrammar' => 'PhutilContextFreeGrammar',
|
||||
'PhutilMarkupEngine' => 'Phobject',
|
||||
'PhutilMarkupTestCase' => 'PhutilTestCase',
|
||||
'PhutilMemcacheKeyValueCache' => 'PhutilKeyValueCache',
|
||||
'PhutilOAuth1AuthAdapter' => 'PhutilAuthAdapter',
|
||||
'PhutilOAuthAuthAdapter' => 'PhutilAuthAdapter',
|
||||
'PhutilOnDiskKeyValueCache' => 'PhutilKeyValueCache',
|
||||
'PhutilPHPCodeSnippetContextFreeGrammar' => 'PhutilCLikeCodeSnippetContextFreeGrammar',
|
||||
'PhutilPHPFragmentLexerHighlighterTestCase' => 'PhutilTestCase',
|
||||
'PhutilPhabricatorAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilProseDiff' => 'Phobject',
|
||||
'PhutilProseDiffTestCase' => 'PhabricatorTestCase',
|
||||
'PhutilProseDifferenceEngine' => 'Phobject',
|
||||
'PhutilPygmentizeParser' => 'Phobject',
|
||||
'PhutilPygmentizeParserTestCase' => 'PhutilTestCase',
|
||||
'PhutilPygmentsSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilQueryString' => 'Phobject',
|
||||
'PhutilRainbowSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilRealNameContextFreeGrammar' => 'PhutilContextFreeGrammar',
|
||||
'PhutilRemarkupAnchorRule' => 'PhutilRemarkupRule',
|
||||
'PhutilRemarkupBlockInterpreter' => 'Phobject',
|
||||
@@ -12487,10 +12632,27 @@ phutil_register_library_map(array(
|
||||
'PhutilRemarkupTableBlockRule' => 'PhutilRemarkupBlockRule',
|
||||
'PhutilRemarkupTestInterpreterRule' => 'PhutilRemarkupBlockInterpreter',
|
||||
'PhutilRemarkupUnderlineRule' => 'PhutilRemarkupRule',
|
||||
'PhutilSafeHTML' => 'Phobject',
|
||||
'PhutilSafeHTMLTestCase' => 'PhutilTestCase',
|
||||
'PhutilSearchQueryCompiler' => 'Phobject',
|
||||
'PhutilSearchQueryCompilerSyntaxException' => 'Exception',
|
||||
'PhutilSearchQueryCompilerTestCase' => 'PhutilTestCase',
|
||||
'PhutilSearchQueryToken' => 'Phobject',
|
||||
'PhutilSearchStemmer' => 'Phobject',
|
||||
'PhutilSearchStemmerTestCase' => 'PhutilTestCase',
|
||||
'PhutilSlackAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilSprite' => 'Phobject',
|
||||
'PhutilSpriteSheet' => 'Phobject',
|
||||
'PhutilSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilSyntaxHighlighterEngine' => 'Phobject',
|
||||
'PhutilSyntaxHighlighterException' => 'Exception',
|
||||
'PhutilTranslatedHTMLTestCase' => 'PhutilTestCase',
|
||||
'PhutilTwitchAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilTwitterAuthAdapter' => 'PhutilOAuth1AuthAdapter',
|
||||
'PhutilWordPressAuthAdapter' => 'PhutilOAuthAuthAdapter',
|
||||
'PhutilXHPASTSyntaxHighlighter' => 'Phobject',
|
||||
'PhutilXHPASTSyntaxHighlighterFuture' => 'FutureProxy',
|
||||
'PhutilXHPASTSyntaxHighlighterTestCase' => 'PhutilTestCase',
|
||||
'PolicyLockOptionType' => 'PhabricatorConfigJSONOptionType',
|
||||
'PonderAddAnswerView' => 'AphrontView',
|
||||
'PonderAnswer' => array(
|
||||
|
85
src/aphront/__tests__/AphrontRoutingMapTestCase.php
Normal file
85
src/aphront/__tests__/AphrontRoutingMapTestCase.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
final class AphrontRoutingMapTestCase
|
||||
extends PhabricatorTestCase {
|
||||
|
||||
public function testRoutingMaps() {
|
||||
$count = 0;
|
||||
|
||||
$sites = AphrontSite::getAllSites();
|
||||
foreach ($sites as $site) {
|
||||
$maps = $site->getRoutingMaps();
|
||||
foreach ($maps as $map) {
|
||||
foreach ($map->getRoutes() as $rule => $value) {
|
||||
$this->assertRoutable($site, $map, array(), $rule, $value);
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$count) {
|
||||
$this->assertSkipped(
|
||||
pht('No sites define any routing rules.'));
|
||||
}
|
||||
}
|
||||
|
||||
private function assertRoutable(
|
||||
AphrontSite $site,
|
||||
AphrontRoutingMap $map,
|
||||
array $path,
|
||||
$rule,
|
||||
$value) {
|
||||
|
||||
$path[] = $rule;
|
||||
|
||||
$site_description = $site->getDescription();
|
||||
$rule_path = implode(' > ', $path);
|
||||
|
||||
$pattern = implode('', $path);
|
||||
$pattern = '('.$pattern.')';
|
||||
$ok = @preg_match($pattern, '');
|
||||
|
||||
$this->assertTrue(
|
||||
($ok !== false),
|
||||
pht(
|
||||
'Routing rule ("%s", for site "%s") does not compile into a '.
|
||||
'valid regular expression.',
|
||||
$rule_path,
|
||||
$site_description));
|
||||
|
||||
if (is_array($value)) {
|
||||
$this->assertTrue(
|
||||
(count($value) > 0),
|
||||
pht(
|
||||
'Routing rule ("%s", for site "%s") does not have any targets.',
|
||||
$rule_path,
|
||||
$site_description));
|
||||
|
||||
foreach ($value as $sub_rule => $sub_value) {
|
||||
$this->assertRoutable($site, $map, $path, $sub_rule, $sub_value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_string($value)) {
|
||||
$this->assertTrue(
|
||||
class_exists($value),
|
||||
pht(
|
||||
'Routing rule ("%s", for site "%s") points at controller ("%s") '.
|
||||
'which does not exist.',
|
||||
$rule_path,
|
||||
$site_description,
|
||||
$value));
|
||||
return;
|
||||
}
|
||||
|
||||
$this->assertFailure(
|
||||
pht(
|
||||
'Routing rule ("%s", for site "%s") points at unknown value '.
|
||||
'(of type "%s"), expected a controller class name string.',
|
||||
$rule_path,
|
||||
$site_description,
|
||||
phutil_describe_type($value)));
|
||||
}
|
||||
|
||||
}
|
150
src/aphront/headerparser/AphrontHTTPHeaderParser.php
Normal file
150
src/aphront/headerparser/AphrontHTTPHeaderParser.php
Normal file
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
final class AphrontHTTPHeaderParser extends Phobject {
|
||||
|
||||
private $name;
|
||||
private $content;
|
||||
private $pairs;
|
||||
|
||||
public function parseRawHeader($raw_header) {
|
||||
$this->name = null;
|
||||
$this->content = null;
|
||||
|
||||
$parts = explode(':', $raw_header, 2);
|
||||
$this->name = trim($parts[0]);
|
||||
if (count($parts) > 1) {
|
||||
$this->content = trim($parts[1]);
|
||||
}
|
||||
|
||||
$this->pairs = null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHeaderName() {
|
||||
$this->requireParse();
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getHeaderContent() {
|
||||
$this->requireParse();
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function getHeaderContentAsPairs() {
|
||||
$content = $this->getHeaderContent();
|
||||
|
||||
|
||||
$state = 'prekey';
|
||||
$length = strlen($content);
|
||||
|
||||
$pair_name = null;
|
||||
$pair_value = null;
|
||||
|
||||
$pairs = array();
|
||||
$ii = 0;
|
||||
while ($ii < $length) {
|
||||
$c = $content[$ii];
|
||||
|
||||
switch ($state) {
|
||||
case 'prekey';
|
||||
// We're eating space in front of a key.
|
||||
if ($c == ' ') {
|
||||
$ii++;
|
||||
break;
|
||||
}
|
||||
$pair_name = '';
|
||||
$state = 'key';
|
||||
break;
|
||||
case 'key';
|
||||
// We're parsing a key name until we find "=" or ";".
|
||||
if ($c == ';') {
|
||||
$state = 'done';
|
||||
break;
|
||||
}
|
||||
|
||||
if ($c == '=') {
|
||||
$ii++;
|
||||
$state = 'value';
|
||||
break;
|
||||
}
|
||||
|
||||
$ii++;
|
||||
$pair_name .= $c;
|
||||
break;
|
||||
case 'value':
|
||||
// We found an "=", so now figure out if the value is quoted
|
||||
// or not.
|
||||
if ($c == '"') {
|
||||
$ii++;
|
||||
$state = 'quoted';
|
||||
break;
|
||||
}
|
||||
$state = 'unquoted';
|
||||
break;
|
||||
case 'quoted':
|
||||
// We're in a quoted string, parse until we find the closing quote.
|
||||
if ($c == '"') {
|
||||
$ii++;
|
||||
$state = 'done';
|
||||
break;
|
||||
}
|
||||
|
||||
$ii++;
|
||||
$pair_value .= $c;
|
||||
break;
|
||||
case 'unquoted':
|
||||
// We're in an unquoted string, parse until we find a space or a
|
||||
// semicolon.
|
||||
if ($c == ' ' || $c == ';') {
|
||||
$state = 'done';
|
||||
break;
|
||||
}
|
||||
$ii++;
|
||||
$pair_value .= $c;
|
||||
break;
|
||||
case 'done':
|
||||
// We parsed something, so eat any trailing whitespace and semicolons
|
||||
// and look for a new value.
|
||||
if ($c == ' ' || $c == ';') {
|
||||
$ii++;
|
||||
break;
|
||||
}
|
||||
|
||||
$pairs[] = array(
|
||||
$pair_name,
|
||||
$pair_value,
|
||||
);
|
||||
|
||||
$pair_name = null;
|
||||
$pair_value = null;
|
||||
|
||||
$state = 'prekey';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($state == 'quoted') {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Header has unterminated double quote for key "%s".',
|
||||
$pair_name));
|
||||
}
|
||||
|
||||
if ($pair_name !== null) {
|
||||
$pairs[] = array(
|
||||
$pair_name,
|
||||
$pair_value,
|
||||
);
|
||||
}
|
||||
|
||||
return $pairs;
|
||||
}
|
||||
|
||||
private function requireParse() {
|
||||
if ($this->name === null) {
|
||||
throw new PhutilInvalidStateException('parseRawHeader');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
final class AphrontHTTPHeaderParserTestCase extends PhutilTestCase {
|
||||
|
||||
public function testHeaderParser() {
|
||||
$cases = array(
|
||||
array(
|
||||
'Key: x; y; z',
|
||||
'Key',
|
||||
'x; y; z',
|
||||
array(
|
||||
array('x', null),
|
||||
array('y', null),
|
||||
array('z', null),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'Content-Disposition: form-data; name="label"',
|
||||
'Content-Disposition',
|
||||
'form-data; name="label"',
|
||||
array(
|
||||
array('form-data', null),
|
||||
array('name', 'label'),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'Content-Type: multipart/form-data; charset=utf-8',
|
||||
'Content-Type',
|
||||
'multipart/form-data; charset=utf-8',
|
||||
array(
|
||||
array('multipart/form-data', null),
|
||||
array('charset', 'utf-8'),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'Content-Type: application/octet-stream; charset="ut',
|
||||
'Content-Type',
|
||||
'application/octet-stream; charset="ut',
|
||||
false,
|
||||
),
|
||||
array(
|
||||
'Content-Type: multipart/form-data; boundary=ABCDEFG',
|
||||
'Content-Type',
|
||||
'multipart/form-data; boundary=ABCDEFG',
|
||||
array(
|
||||
array('multipart/form-data', null),
|
||||
array('boundary', 'ABCDEFG'),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'Content-Type: multipart/form-data; boundary="ABCDEFG"',
|
||||
'Content-Type',
|
||||
'multipart/form-data; boundary="ABCDEFG"',
|
||||
array(
|
||||
array('multipart/form-data', null),
|
||||
array('boundary', 'ABCDEFG'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($cases as $case) {
|
||||
$input = $case[0];
|
||||
$expect_name = $case[1];
|
||||
$expect_content = $case[2];
|
||||
|
||||
$parser = id(new AphrontHTTPHeaderParser())
|
||||
->parseRawHeader($input);
|
||||
|
||||
$actual_name = $parser->getHeaderName();
|
||||
$actual_content = $parser->getHeaderContent();
|
||||
|
||||
$this->assertEqual(
|
||||
$expect_name,
|
||||
$actual_name,
|
||||
pht('Header name for: %s', $input));
|
||||
|
||||
$this->assertEqual(
|
||||
$expect_content,
|
||||
$actual_content,
|
||||
pht('Header content for: %s', $input));
|
||||
|
||||
if (isset($case[3])) {
|
||||
$expect_pairs = $case[3];
|
||||
|
||||
$caught = null;
|
||||
try {
|
||||
$actual_pairs = $parser->getHeaderContentAsPairs();
|
||||
} catch (Exception $ex) {
|
||||
$caught = $ex;
|
||||
}
|
||||
|
||||
if ($expect_pairs === false) {
|
||||
$this->assertEqual(
|
||||
true,
|
||||
($caught instanceof Exception),
|
||||
pht('Expect exception for header pairs of: %s', $input));
|
||||
} else {
|
||||
$this->assertEqual(
|
||||
$expect_pairs,
|
||||
$actual_pairs,
|
||||
pht('Header pairs for: %s', $input));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
249
src/aphront/multipartparser/AphrontMultipartParser.php
Normal file
249
src/aphront/multipartparser/AphrontMultipartParser.php
Normal file
@@ -0,0 +1,249 @@
|
||||
<?php
|
||||
|
||||
final class AphrontMultipartParser extends Phobject {
|
||||
|
||||
private $contentType;
|
||||
private $boundary;
|
||||
|
||||
private $buffer;
|
||||
private $body;
|
||||
private $state;
|
||||
|
||||
private $part;
|
||||
private $parts;
|
||||
|
||||
public function setContentType($content_type) {
|
||||
$this->contentType = $content_type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getContentType() {
|
||||
return $this->contentType;
|
||||
}
|
||||
|
||||
public function beginParse() {
|
||||
$content_type = $this->getContentType();
|
||||
if ($content_type === null) {
|
||||
throw new PhutilInvalidStateException('setContentType');
|
||||
}
|
||||
|
||||
if (!preg_match('(^multipart/form-data)', $content_type)) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Expected "multipart/form-data" content type when executing a '.
|
||||
'multipart body read.'));
|
||||
}
|
||||
|
||||
$type_parts = preg_split('(\s*;\s*)', $content_type);
|
||||
$boundary = null;
|
||||
foreach ($type_parts as $type_part) {
|
||||
$matches = null;
|
||||
if (preg_match('(^boundary=(.*))', $type_part, $matches)) {
|
||||
$boundary = $matches[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($boundary === null) {
|
||||
throw new Exception(
|
||||
pht('Received "multipart/form-data" request with no "boundary".'));
|
||||
}
|
||||
|
||||
$this->parts = array();
|
||||
$this->part = null;
|
||||
|
||||
$this->buffer = '';
|
||||
$this->boundary = $boundary;
|
||||
|
||||
// We're looking for a (usually empty) body before the first boundary.
|
||||
$this->state = 'bodynewline';
|
||||
}
|
||||
|
||||
public function continueParse($bytes) {
|
||||
$this->buffer .= $bytes;
|
||||
|
||||
$continue = true;
|
||||
while ($continue) {
|
||||
switch ($this->state) {
|
||||
case 'endboundary':
|
||||
// We've just parsed a boundary. Next, we expect either "--" (which
|
||||
// indicates we've reached the end of the parts) or "\r\n" (which
|
||||
// indicates we should read the headers for the next part).
|
||||
|
||||
if (strlen($this->buffer) < 2) {
|
||||
// We don't have enough bytes yet, so wait for more.
|
||||
$continue = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!strncmp($this->buffer, '--', 2)) {
|
||||
// This is "--" after a boundary, so we're done. We'll read the
|
||||
// rest of the body (the "epilogue") and discard it.
|
||||
$this->buffer = substr($this->buffer, 2);
|
||||
$this->state = 'epilogue';
|
||||
|
||||
$this->part = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!strncmp($this->buffer, "\r\n", 2)) {
|
||||
// This is "\r\n" after a boundary, so we're going to going to
|
||||
// read the headers for a part.
|
||||
$this->buffer = substr($this->buffer, 2);
|
||||
$this->state = 'header';
|
||||
|
||||
// Create the object to hold the part we're about to read.
|
||||
$part = new AphrontMultipartPart();
|
||||
$this->parts[] = $part;
|
||||
$this->part = $part;
|
||||
break;
|
||||
}
|
||||
|
||||
throw new Exception(
|
||||
pht('Expected "\r\n" or "--" after multipart data boundary.'));
|
||||
case 'header':
|
||||
// We've just parsed a boundary, followed by "\r\n". We are going
|
||||
// to read the headers for this part. They are in the form of HTTP
|
||||
// headers and terminated by "\r\n". The section is terminated by
|
||||
// a line with no header on it.
|
||||
|
||||
if (strlen($this->buffer) < 2) {
|
||||
// We don't have enough data to find a "\r\n", so wait for more.
|
||||
$continue = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!strncmp("\r\n", $this->buffer, 2)) {
|
||||
// This line immediately began "\r\n", so we're done with parsing
|
||||
// headers. Start parsing the body.
|
||||
$this->buffer = substr($this->buffer, 2);
|
||||
$this->state = 'body';
|
||||
break;
|
||||
}
|
||||
|
||||
// This is an actual header, so look for the end of it.
|
||||
$header_len = strpos($this->buffer, "\r\n");
|
||||
if ($header_len === false) {
|
||||
// We don't have a full header yet, so wait for more data.
|
||||
$continue = false;
|
||||
break;
|
||||
}
|
||||
|
||||
$header_buf = substr($this->buffer, 0, $header_len);
|
||||
$this->part->appendRawHeader($header_buf);
|
||||
|
||||
$this->buffer = substr($this->buffer, $header_len + 2);
|
||||
break;
|
||||
case 'body':
|
||||
// We've parsed a boundary and headers, and are parsing the data for
|
||||
// this part. The data is terminated by "\r\n--", then the boundary.
|
||||
|
||||
// We'll look for "\r\n", then switch to the "bodynewline" state if
|
||||
// we find it.
|
||||
|
||||
$marker = "\r";
|
||||
$marker_pos = strpos($this->buffer, $marker);
|
||||
|
||||
if ($marker_pos === false) {
|
||||
// There's no "\r" anywhere in the buffer, so we can just read it
|
||||
// as provided. Then, since we read all the data, we're done until
|
||||
// we get more.
|
||||
|
||||
// Note that if we're in the preamble, we won't have a "part"
|
||||
// object and will just discard the data.
|
||||
if ($this->part) {
|
||||
$this->part->appendData($this->buffer);
|
||||
}
|
||||
$this->buffer = '';
|
||||
$continue = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($marker_pos > 0) {
|
||||
// If there are bytes before the "\r",
|
||||
if ($this->part) {
|
||||
$this->part->appendData(substr($this->buffer, 0, $marker_pos));
|
||||
}
|
||||
$this->buffer = substr($this->buffer, $marker_pos);
|
||||
}
|
||||
|
||||
$expect = "\r\n";
|
||||
$expect_len = strlen($expect);
|
||||
if (strlen($this->buffer) < $expect_len) {
|
||||
// We don't have enough bytes yet to know if this is "\r\n"
|
||||
// or not.
|
||||
$continue = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (strncmp($this->buffer, $expect, $expect_len)) {
|
||||
// The next two bytes aren't "\r\n", so eat them and go looking
|
||||
// for more newlines.
|
||||
if ($this->part) {
|
||||
$this->part->appendData(substr($this->buffer, 0, $expect_len));
|
||||
}
|
||||
$this->buffer = substr($this->buffer, $expect_len);
|
||||
break;
|
||||
}
|
||||
|
||||
// Eat the "\r\n".
|
||||
$this->buffer = substr($this->buffer, $expect_len);
|
||||
$this->state = 'bodynewline';
|
||||
break;
|
||||
case 'bodynewline':
|
||||
// We've parsed a newline in a body, or we just started parsing the
|
||||
// request. In either case, we're looking for "--", then the boundary.
|
||||
// If we find it, this section is done. If we don't, we consume the
|
||||
// bytes and move on.
|
||||
|
||||
$expect = '--'.$this->boundary;
|
||||
$expect_len = strlen($expect);
|
||||
|
||||
if (strlen($this->buffer) < $expect_len) {
|
||||
// We don't have enough bytes yet, so wait for more.
|
||||
$continue = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (strncmp($this->buffer, $expect, $expect_len)) {
|
||||
// This wasn't the boundary, so return to the "body" state and
|
||||
// consume it. (But first, we need to append the "\r\n" which we
|
||||
// ate earlier.)
|
||||
if ($this->part) {
|
||||
$this->part->appendData("\r\n");
|
||||
}
|
||||
$this->state = 'body';
|
||||
break;
|
||||
}
|
||||
|
||||
// This is the boundary, so toss it and move on.
|
||||
$this->buffer = substr($this->buffer, $expect_len);
|
||||
$this->state = 'endboundary';
|
||||
break;
|
||||
case 'epilogue':
|
||||
// We just discard any epilogue.
|
||||
$this->buffer = '';
|
||||
$continue = false;
|
||||
break;
|
||||
default:
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Unknown parser state "%s".\n',
|
||||
$this->state));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function endParse() {
|
||||
if ($this->state !== 'epilogue') {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Expected "multipart/form-data" parse to end '.
|
||||
'in state "epilogue".'));
|
||||
}
|
||||
|
||||
return $this->parts;
|
||||
}
|
||||
|
||||
|
||||
}
|
96
src/aphront/multipartparser/AphrontMultipartPart.php
Normal file
96
src/aphront/multipartparser/AphrontMultipartPart.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
final class AphrontMultipartPart extends Phobject {
|
||||
|
||||
private $headers = array();
|
||||
private $value = '';
|
||||
|
||||
private $name;
|
||||
private $filename;
|
||||
private $tempFile;
|
||||
private $byteSize = 0;
|
||||
|
||||
public function appendRawHeader($bytes) {
|
||||
$parser = id(new AphrontHTTPHeaderParser())
|
||||
->parseRawHeader($bytes);
|
||||
|
||||
$header_name = $parser->getHeaderName();
|
||||
|
||||
$this->headers[] = array(
|
||||
$header_name,
|
||||
$parser->getHeaderContent(),
|
||||
);
|
||||
|
||||
if (strtolower($header_name) === 'content-disposition') {
|
||||
$pairs = $parser->getHeaderContentAsPairs();
|
||||
foreach ($pairs as $pair) {
|
||||
list($key, $value) = $pair;
|
||||
switch ($key) {
|
||||
case 'filename':
|
||||
$this->filename = $value;
|
||||
break;
|
||||
case 'name':
|
||||
$this->name = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function appendData($bytes) {
|
||||
$this->byteSize += strlen($bytes);
|
||||
|
||||
if ($this->isVariable()) {
|
||||
$this->value .= $bytes;
|
||||
} else {
|
||||
if (!$this->tempFile) {
|
||||
$this->tempFile = new TempFile(getmypid().'.upload');
|
||||
}
|
||||
Filesystem::appendFile($this->tempFile, $bytes);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isVariable() {
|
||||
return ($this->filename === null);
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getVariableValue() {
|
||||
if (!$this->isVariable()) {
|
||||
throw new Exception(pht('This part is not a variable!'));
|
||||
}
|
||||
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function getPHPFileDictionary() {
|
||||
if (!$this->tempFile) {
|
||||
$this->appendData('');
|
||||
}
|
||||
|
||||
$mime_type = 'application/octet-stream';
|
||||
foreach ($this->headers as $header) {
|
||||
list($name, $value) = $header;
|
||||
if (strtolower($name) == 'content-type') {
|
||||
$mime_type = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'name' => $this->filename,
|
||||
'type' => $mime_type,
|
||||
'tmp_name' => (string)$this->tempFile,
|
||||
'error' => 0,
|
||||
'size' => $this->byteSize,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
final class AphrontMultipartParserTestCase extends PhutilTestCase {
|
||||
|
||||
public function testParser() {
|
||||
$map = array(
|
||||
array(
|
||||
'data' => 'simple.txt',
|
||||
'variables' => array(
|
||||
array('a', 'b'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$data_dir = dirname(__FILE__).'/data/';
|
||||
foreach ($map as $test_case) {
|
||||
$data = Filesystem::readFile($data_dir.$test_case['data']);
|
||||
$data = str_replace("\n", "\r\n", $data);
|
||||
|
||||
$parser = id(new AphrontMultipartParser())
|
||||
->setContentType('multipart/form-data; boundary=ABCDEFG');
|
||||
$parser->beginParse();
|
||||
$parser->continueParse($data);
|
||||
$parts = $parser->endParse();
|
||||
|
||||
$variables = array();
|
||||
foreach ($parts as $part) {
|
||||
if (!$part->isVariable()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$variables[] = array(
|
||||
$part->getName(),
|
||||
$part->getVariableValue(),
|
||||
);
|
||||
}
|
||||
|
||||
$expect_variables = idx($test_case, 'variables', array());
|
||||
$this->assertEqual($expect_variables, $variables);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
5
src/aphront/multipartparser/__tests__/data/simple.txt
Normal file
5
src/aphront/multipartparser/__tests__/data/simple.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
--ABCDEFG
|
||||
Content-Disposition: form-data; name="a"
|
||||
|
||||
b
|
||||
--ABCDEFG--
|
92
src/aphront/requeststream/AphrontRequestStream.php
Normal file
92
src/aphront/requeststream/AphrontRequestStream.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
final class AphrontRequestStream extends Phobject {
|
||||
|
||||
private $encoding;
|
||||
private $stream;
|
||||
private $closed;
|
||||
private $iterator;
|
||||
|
||||
public function setEncoding($encoding) {
|
||||
$this->encoding = $encoding;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEncoding() {
|
||||
return $this->encoding;
|
||||
}
|
||||
|
||||
public function getIterator() {
|
||||
if (!$this->iterator) {
|
||||
$this->iterator = new PhutilStreamIterator($this->getStream());
|
||||
}
|
||||
return $this->iterator;
|
||||
}
|
||||
|
||||
public function readData() {
|
||||
if (!$this->iterator) {
|
||||
$iterator = $this->getIterator();
|
||||
$iterator->rewind();
|
||||
} else {
|
||||
$iterator = $this->getIterator();
|
||||
}
|
||||
|
||||
if (!$iterator->valid()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = $iterator->current();
|
||||
$iterator->next();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function getStream() {
|
||||
if (!$this->stream) {
|
||||
$this->stream = $this->newStream();
|
||||
}
|
||||
|
||||
return $this->stream;
|
||||
}
|
||||
|
||||
private function newStream() {
|
||||
$stream = fopen('php://input', 'rb');
|
||||
if (!$stream) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Failed to open stream "%s" for reading.',
|
||||
'php://input'));
|
||||
}
|
||||
|
||||
$encoding = $this->getEncoding();
|
||||
if ($encoding === 'gzip') {
|
||||
// This parameter is magic. Values 0-15 express a time/memory tradeoff,
|
||||
// but the largest value (15) corresponds to only 32KB of memory and
|
||||
// data encoded with a smaller window size than the one we pass can not
|
||||
// be decompressed. Always pass the maximum window size.
|
||||
|
||||
// Additionally, you can add 16 (to enable gzip) or 32 (to enable both
|
||||
// gzip and zlib). Add 32 to support both.
|
||||
$zlib_window = 15 + 32;
|
||||
|
||||
$ok = stream_filter_append(
|
||||
$stream,
|
||||
'zlib.inflate',
|
||||
STREAM_FILTER_READ,
|
||||
array(
|
||||
'window' => $zlib_window,
|
||||
));
|
||||
if (!$ok) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Failed to append filter "%s" to input stream while processing '.
|
||||
'a request with "%s" encoding.',
|
||||
'zlib.inflate',
|
||||
$encoding));
|
||||
}
|
||||
}
|
||||
|
||||
return $stream;
|
||||
}
|
||||
|
||||
}
|
@@ -417,13 +417,19 @@ abstract class AphrontResponse extends Phobject {
|
||||
}
|
||||
|
||||
public function willBeginWrite() {
|
||||
if ($this->shouldCompressResponse()) {
|
||||
// Enable automatic compression here. Webservers sometimes do this for
|
||||
// us, but we now detect the absence of compression and warn users about
|
||||
// it so try to cover our bases more thoroughly.
|
||||
ini_set('zlib.output_compression', 1);
|
||||
} else {
|
||||
ini_set('zlib.output_compression', 0);
|
||||
// If we've already sent headers, these "ini_set()" calls will warn that
|
||||
// they have no effect. Today, this always happens because we're inside
|
||||
// a unit test, so just skip adjusting the setting.
|
||||
|
||||
if (!headers_sent()) {
|
||||
if ($this->shouldCompressResponse()) {
|
||||
// Enable automatic compression here. Webservers sometimes do this for
|
||||
// us, but we now detect the absence of compression and warn users about
|
||||
// it so try to cover our bases more thoroughly.
|
||||
ini_set('zlib.output_compression', 1);
|
||||
} else {
|
||||
ini_set('zlib.output_compression', 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
76
src/aphront/sprite/PhutilSprite.php
Normal file
76
src/aphront/sprite/PhutilSprite.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTE: This is very new and unstable.
|
||||
*/
|
||||
final class PhutilSprite extends Phobject {
|
||||
|
||||
private $sourceFiles = array();
|
||||
private $sourceX;
|
||||
private $sourceY;
|
||||
private $sourceW;
|
||||
private $sourceH;
|
||||
private $targetCSS;
|
||||
private $spriteSheet;
|
||||
private $name;
|
||||
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setTargetCSS($target_css) {
|
||||
$this->targetCSS = $target_css;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTargetCSS() {
|
||||
return $this->targetCSS;
|
||||
}
|
||||
|
||||
public function setSourcePosition($x, $y) {
|
||||
$this->sourceX = $x;
|
||||
$this->sourceY = $y;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSourceSize($w, $h) {
|
||||
$this->sourceW = $w;
|
||||
$this->sourceH = $h;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSourceH() {
|
||||
return $this->sourceH;
|
||||
}
|
||||
|
||||
public function getSourceW() {
|
||||
return $this->sourceW;
|
||||
}
|
||||
|
||||
public function getSourceY() {
|
||||
return $this->sourceY;
|
||||
}
|
||||
|
||||
public function getSourceX() {
|
||||
return $this->sourceX;
|
||||
}
|
||||
|
||||
public function setSourceFile($source_file, $scale = 1) {
|
||||
$this->sourceFiles[$scale] = $source_file;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSourceFile($scale) {
|
||||
if (empty($this->sourceFiles[$scale])) {
|
||||
throw new Exception(pht("No source file for scale '%s'!", $scale));
|
||||
}
|
||||
|
||||
return $this->sourceFiles[$scale];
|
||||
}
|
||||
|
||||
}
|
385
src/aphront/sprite/PhutilSpriteSheet.php
Normal file
385
src/aphront/sprite/PhutilSpriteSheet.php
Normal file
@@ -0,0 +1,385 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* NOTE: This is very new and unstable.
|
||||
*/
|
||||
final class PhutilSpriteSheet extends Phobject {
|
||||
|
||||
const MANIFEST_VERSION = 1;
|
||||
|
||||
const TYPE_STANDARD = 'standard';
|
||||
const TYPE_REPEAT_X = 'repeat-x';
|
||||
const TYPE_REPEAT_Y = 'repeat-y';
|
||||
|
||||
private $sprites = array();
|
||||
private $sources = array();
|
||||
private $hashes = array();
|
||||
private $cssHeader;
|
||||
private $generated;
|
||||
private $scales = array(1);
|
||||
private $type = self::TYPE_STANDARD;
|
||||
private $basePath;
|
||||
|
||||
private $css;
|
||||
private $images;
|
||||
|
||||
public function addSprite(PhutilSprite $sprite) {
|
||||
$this->generated = false;
|
||||
$this->sprites[] = $sprite;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCSSHeader($header) {
|
||||
$this->generated = false;
|
||||
$this->cssHeader = $header;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setScales(array $scales) {
|
||||
$this->scales = array_values($scales);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getScales() {
|
||||
return $this->scales;
|
||||
}
|
||||
|
||||
public function setSheetType($type) {
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setBasePath($base_path) {
|
||||
$this->basePath = $base_path;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function generate() {
|
||||
if ($this->generated) {
|
||||
return;
|
||||
}
|
||||
|
||||
$multi_row = true;
|
||||
$multi_col = true;
|
||||
$margin_w = 1;
|
||||
$margin_h = 1;
|
||||
|
||||
$type = $this->type;
|
||||
switch ($type) {
|
||||
case self::TYPE_STANDARD:
|
||||
break;
|
||||
case self::TYPE_REPEAT_X:
|
||||
$multi_col = false;
|
||||
$margin_w = 0;
|
||||
|
||||
$width = null;
|
||||
foreach ($this->sprites as $sprite) {
|
||||
if ($width === null) {
|
||||
$width = $sprite->getSourceW();
|
||||
} else if ($width !== $sprite->getSourceW()) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
"All sprites in a '%s' sheet must have the same width.",
|
||||
'repeat-x'));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case self::TYPE_REPEAT_Y:
|
||||
$multi_row = false;
|
||||
$margin_h = 0;
|
||||
|
||||
$height = null;
|
||||
foreach ($this->sprites as $sprite) {
|
||||
if ($height === null) {
|
||||
$height = $sprite->getSourceH();
|
||||
} else if ($height !== $sprite->getSourceH()) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
"All sprites in a '%s' sheet must have the same height.",
|
||||
'repeat-y'));
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new Exception(pht("Unknown sprite sheet type '%s'!", $type));
|
||||
}
|
||||
|
||||
|
||||
$css = array();
|
||||
if ($this->cssHeader) {
|
||||
$css[] = $this->cssHeader;
|
||||
}
|
||||
|
||||
$out_w = 0;
|
||||
$out_h = 0;
|
||||
|
||||
// Lay out the sprite sheet. We attempt to build a roughly square sheet
|
||||
// so it's easier to manage, since 2000x20 is more cumbersome for humans
|
||||
// to deal with than 200x200.
|
||||
//
|
||||
// To do this, we use a simple greedy algorithm, adding sprites one at a
|
||||
// time. For each sprite, if the sheet is at least as wide as it is tall
|
||||
// we create a new row. Otherwise, we try to add it to an existing row.
|
||||
//
|
||||
// This isn't optimal, but does a reasonable job in most cases and isn't
|
||||
// too messy.
|
||||
|
||||
// Group the sprites by their sizes. We lay them out in the sheet as
|
||||
// boxes, but then put them into the boxes in the order they were added
|
||||
// so similar sprites end up nearby on the final sheet.
|
||||
$boxes = array();
|
||||
foreach (array_reverse($this->sprites) as $sprite) {
|
||||
$s_w = $sprite->getSourceW() + $margin_w;
|
||||
$s_h = $sprite->getSourceH() + $margin_h;
|
||||
$boxes[$s_w][$s_h][] = $sprite;
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
foreach ($this->sprites as $sprite) {
|
||||
$s_w = $sprite->getSourceW() + $margin_w;
|
||||
$s_h = $sprite->getSourceH() + $margin_h;
|
||||
|
||||
// Choose a row for this sprite.
|
||||
$maybe = array();
|
||||
foreach ($rows as $key => $row) {
|
||||
if ($row['h'] < $s_h) {
|
||||
// We can only add it to a row if the row is at least as tall as the
|
||||
// sprite.
|
||||
continue;
|
||||
}
|
||||
// We prefer rows which have the same height as the sprite, and then
|
||||
// rows which aren't yet very wide.
|
||||
$wasted_v = ($row['h'] - $s_h);
|
||||
$wasted_h = ($row['w'] / $out_w);
|
||||
$maybe[$key] = $wasted_v + $wasted_h;
|
||||
}
|
||||
|
||||
$row_key = null;
|
||||
if ($maybe && $multi_col) {
|
||||
// If there were any candidate rows, pick the best one.
|
||||
asort($maybe);
|
||||
$row_key = head_key($maybe);
|
||||
}
|
||||
|
||||
if ($row_key !== null && $multi_row) {
|
||||
// If there's a candidate row, but adding the sprite to it would make
|
||||
// the sprite wider than it is tall, create a new row instead. This
|
||||
// generally keeps the sprite square-ish.
|
||||
if ($rows[$row_key]['w'] + $s_w > $out_h) {
|
||||
$row_key = null;
|
||||
}
|
||||
}
|
||||
|
||||
if ($row_key === null) {
|
||||
// Add a new row.
|
||||
$rows[] = array(
|
||||
'w' => 0,
|
||||
'h' => $s_h,
|
||||
'boxes' => array(),
|
||||
);
|
||||
$row_key = last_key($rows);
|
||||
$out_h += $s_h;
|
||||
}
|
||||
|
||||
// Add the sprite box to the row.
|
||||
$row = $rows[$row_key];
|
||||
$row['w'] += $s_w;
|
||||
$row['boxes'][] = array($s_w, $s_h);
|
||||
$rows[$row_key] = $row;
|
||||
|
||||
$out_w = max($row['w'], $out_w);
|
||||
}
|
||||
|
||||
$images = array();
|
||||
foreach ($this->scales as $scale) {
|
||||
$img = imagecreatetruecolor($out_w * $scale, $out_h * $scale);
|
||||
imagesavealpha($img, true);
|
||||
imagefill($img, 0, 0, imagecolorallocatealpha($img, 0, 0, 0, 127));
|
||||
|
||||
$images[$scale] = $img;
|
||||
}
|
||||
|
||||
|
||||
// Put the shorter rows first. At the same height, put the wider rows first.
|
||||
// This makes the resulting sheet more human-readable.
|
||||
foreach ($rows as $key => $row) {
|
||||
$rows[$key]['sort'] = $row['h'] + (1 - ($row['w'] / $out_w));
|
||||
}
|
||||
$rows = isort($rows, 'sort');
|
||||
|
||||
$pos_x = 0;
|
||||
$pos_y = 0;
|
||||
$rules = array();
|
||||
foreach ($rows as $row) {
|
||||
$max_h = 0;
|
||||
foreach ($row['boxes'] as $box) {
|
||||
$sprite = array_pop($boxes[$box[0]][$box[1]]);
|
||||
|
||||
foreach ($images as $scale => $img) {
|
||||
$src = $this->loadSource($sprite, $scale);
|
||||
imagecopy(
|
||||
$img,
|
||||
$src,
|
||||
$scale * $pos_x, $scale * $pos_y,
|
||||
$scale * $sprite->getSourceX(), $scale * $sprite->getSourceY(),
|
||||
$scale * $sprite->getSourceW(), $scale * $sprite->getSourceH());
|
||||
}
|
||||
|
||||
$rule = $sprite->getTargetCSS();
|
||||
$cssx = (-$pos_x).'px';
|
||||
$cssy = (-$pos_y).'px';
|
||||
|
||||
$rules[$sprite->getName()] = "{$rule} {\n".
|
||||
" background-position: {$cssx} {$cssy};\n}";
|
||||
|
||||
$pos_x += $sprite->getSourceW() + $margin_w;
|
||||
$max_h = max($max_h, $sprite->getSourceH());
|
||||
}
|
||||
$pos_x = 0;
|
||||
$pos_y += $max_h + $margin_h;
|
||||
}
|
||||
|
||||
// Generate CSS rules in input order.
|
||||
foreach ($this->sprites as $sprite) {
|
||||
$css[] = $rules[$sprite->getName()];
|
||||
}
|
||||
|
||||
$this->images = $images;
|
||||
$this->css = implode("\n\n", $css)."\n";
|
||||
$this->generated = true;
|
||||
}
|
||||
|
||||
public function generateImage($path, $scale = 1) {
|
||||
$this->generate();
|
||||
$this->log(pht("Writing sprite '%s'...", $path));
|
||||
imagepng($this->images[$scale], $path);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function generateCSS($path) {
|
||||
$this->generate();
|
||||
$this->log(pht("Writing CSS '%s'...", $path));
|
||||
|
||||
$out = $this->css;
|
||||
$out = str_replace('{X}', imagesx($this->images[1]), $out);
|
||||
$out = str_replace('{Y}', imagesy($this->images[1]), $out);
|
||||
|
||||
Filesystem::writeFile($path, $out);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function needsRegeneration(array $manifest) {
|
||||
return ($this->buildManifest() !== $manifest);
|
||||
}
|
||||
|
||||
private function buildManifest() {
|
||||
$output = array();
|
||||
foreach ($this->sprites as $sprite) {
|
||||
$output[$sprite->getName()] = array(
|
||||
'name' => $sprite->getName(),
|
||||
'rule' => $sprite->getTargetCSS(),
|
||||
'hash' => $this->loadSourceHash($sprite),
|
||||
);
|
||||
}
|
||||
|
||||
ksort($output);
|
||||
|
||||
$data = array(
|
||||
'version' => self::MANIFEST_VERSION,
|
||||
'sprites' => $output,
|
||||
'scales' => $this->scales,
|
||||
'header' => $this->cssHeader,
|
||||
'type' => $this->type,
|
||||
);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function generateManifest($path) {
|
||||
$data = $this->buildManifest();
|
||||
|
||||
$json = new PhutilJSON();
|
||||
$data = $json->encodeFormatted($data);
|
||||
Filesystem::writeFile($path, $data);
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function log($message) {
|
||||
echo $message."\n";
|
||||
}
|
||||
|
||||
private function loadSourceHash(PhutilSprite $sprite) {
|
||||
$inputs = array();
|
||||
|
||||
foreach ($this->scales as $scale) {
|
||||
$file = $sprite->getSourceFile($scale);
|
||||
|
||||
// If two users have a project in different places, like:
|
||||
//
|
||||
// /home/alincoln/project
|
||||
// /home/htaft/project
|
||||
//
|
||||
// ...we want to ignore the `/home/alincoln` part when hashing the sheet,
|
||||
// since the sprites don't change when the project directory moves. If
|
||||
// the base path is set, build the hashes using paths relative to the
|
||||
// base path.
|
||||
|
||||
$file_key = $file;
|
||||
if ($this->basePath) {
|
||||
$file_key = Filesystem::readablePath($file, $this->basePath);
|
||||
}
|
||||
|
||||
if (empty($this->hashes[$file_key])) {
|
||||
$this->hashes[$file_key] = md5(Filesystem::readFile($file));
|
||||
}
|
||||
|
||||
$inputs[] = $file_key;
|
||||
$inputs[] = $this->hashes[$file_key];
|
||||
}
|
||||
|
||||
$inputs[] = $sprite->getSourceX();
|
||||
$inputs[] = $sprite->getSourceY();
|
||||
$inputs[] = $sprite->getSourceW();
|
||||
$inputs[] = $sprite->getSourceH();
|
||||
|
||||
return md5(implode(':', $inputs));
|
||||
}
|
||||
|
||||
private function loadSource(PhutilSprite $sprite, $scale) {
|
||||
$file = $sprite->getSourceFile($scale);
|
||||
if (empty($this->sources[$file])) {
|
||||
$data = Filesystem::readFile($file);
|
||||
$image = imagecreatefromstring($data);
|
||||
$this->sources[$file] = array(
|
||||
'image' => $image,
|
||||
'x' => imagesx($image),
|
||||
'y' => imagesy($image),
|
||||
);
|
||||
}
|
||||
|
||||
$s_w = $sprite->getSourceW() * $scale;
|
||||
$i_w = $this->sources[$file]['x'];
|
||||
if ($s_w > $i_w) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
"Sprite source for '%s' is too small (expected width %d, found %d).",
|
||||
$file,
|
||||
$s_w,
|
||||
$i_w));
|
||||
}
|
||||
|
||||
$s_h = $sprite->getSourceH() * $scale;
|
||||
$i_h = $this->sources[$file]['y'];
|
||||
if ($s_h > $i_h) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
"Sprite source for '%s' is too small (expected height %d, found %d).",
|
||||
$file,
|
||||
$s_h,
|
||||
$i_h));
|
||||
}
|
||||
|
||||
return $this->sources[$file]['image'];
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
final class AphrontScopedUnguardedWriteCapability extends Phobject {
|
||||
|
||||
public function __destruct() {
|
||||
AphrontWriteGuard::endUnguardedWrites();
|
||||
}
|
||||
|
||||
}
|
267
src/aphront/writeguard/AphrontWriteGuard.php
Normal file
267
src/aphront/writeguard/AphrontWriteGuard.php
Normal file
@@ -0,0 +1,267 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Guard writes against CSRF. The Aphront structure takes care of most of this
|
||||
* for you, you just need to call:
|
||||
*
|
||||
* AphrontWriteGuard::willWrite();
|
||||
*
|
||||
* ...before executing a write against any new kind of storage engine. MySQL
|
||||
* databases and the default file storage engines are already covered, but if
|
||||
* you introduce new types of datastores make sure their writes are guarded. If
|
||||
* you don't guard writes and make a mistake doing CSRF checks in a controller,
|
||||
* a CSRF vulnerability can escape undetected.
|
||||
*
|
||||
* If you need to execute writes on a page which doesn't have CSRF tokens (for
|
||||
* example, because you need to do logging), you can temporarily disable the
|
||||
* write guard by calling:
|
||||
*
|
||||
* AphrontWriteGuard::beginUnguardedWrites();
|
||||
* do_logging_write();
|
||||
* AphrontWriteGuard::endUnguardedWrites();
|
||||
*
|
||||
* This is dangerous, because it disables the backup layer of CSRF protection
|
||||
* this class provides. You should need this only very, very rarely.
|
||||
*
|
||||
* @task protect Protecting Writes
|
||||
* @task disable Disabling Protection
|
||||
* @task manage Managing Write Guards
|
||||
* @task internal Internals
|
||||
*/
|
||||
final class AphrontWriteGuard extends Phobject {
|
||||
|
||||
private static $instance;
|
||||
private static $allowUnguardedWrites = false;
|
||||
|
||||
private $callback;
|
||||
private $allowDepth = 0;
|
||||
|
||||
|
||||
/* -( Managing Write Guards )---------------------------------------------- */
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new write guard for a request. Only one write guard may be
|
||||
* active at a time. You must explicitly call @{method:dispose} when you are
|
||||
* done with a write guard:
|
||||
*
|
||||
* $guard = new AphrontWriteGuard($callback);
|
||||
* // ...
|
||||
* $guard->dispose();
|
||||
*
|
||||
* Normally, you do not need to manage guards yourself -- the Aphront stack
|
||||
* handles it for you.
|
||||
*
|
||||
* This class accepts a callback, which will be invoked when a write is
|
||||
* attempted. The callback should validate the presence of a CSRF token in
|
||||
* the request, or abort the request (e.g., by throwing an exception) if a
|
||||
* valid token isn't present.
|
||||
*
|
||||
* @param callable CSRF callback.
|
||||
* @return this
|
||||
* @task manage
|
||||
*/
|
||||
public function __construct($callback) {
|
||||
if (self::$instance) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'An %s already exists. Dispose of the previous guard '.
|
||||
'before creating a new one.',
|
||||
__CLASS__));
|
||||
}
|
||||
if (self::$allowUnguardedWrites) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'An %s is being created in a context which permits '.
|
||||
'unguarded writes unconditionally. This is not allowed and '.
|
||||
'indicates a serious error.',
|
||||
__CLASS__));
|
||||
}
|
||||
$this->callback = $callback;
|
||||
self::$instance = $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Dispose of the active write guard. You must call this method when you are
|
||||
* done with a write guard. You do not normally need to call this yourself.
|
||||
*
|
||||
* @return void
|
||||
* @task manage
|
||||
*/
|
||||
public function dispose() {
|
||||
if (!self::$instance) {
|
||||
throw new Exception(pht(
|
||||
'Attempting to dispose of write guard, but no write guard is active!'));
|
||||
}
|
||||
|
||||
if ($this->allowDepth > 0) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Imbalanced %s: more %s calls than %s calls.',
|
||||
__CLASS__,
|
||||
'beginUnguardedWrites()',
|
||||
'endUnguardedWrites()'));
|
||||
}
|
||||
self::$instance = null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine if there is an active write guard.
|
||||
*
|
||||
* @return bool
|
||||
* @task manage
|
||||
*/
|
||||
public static function isGuardActive() {
|
||||
return (bool)self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return on instance of AphrontWriteGuard if it's active, or null
|
||||
*
|
||||
* @return AphrontWriteGuard|null
|
||||
*/
|
||||
public static function getInstance() {
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
|
||||
/* -( Protecting Writes )-------------------------------------------------- */
|
||||
|
||||
|
||||
/**
|
||||
* Declare intention to perform a write, validating that writes are allowed.
|
||||
* You should call this method before executing a write whenever you implement
|
||||
* a new storage engine where information can be permanently kept.
|
||||
*
|
||||
* Writes are permitted if:
|
||||
*
|
||||
* - The request has valid CSRF tokens.
|
||||
* - Unguarded writes have been temporarily enabled by a call to
|
||||
* @{method:beginUnguardedWrites}.
|
||||
* - All write guarding has been disabled with
|
||||
* @{method:allowDangerousUnguardedWrites}.
|
||||
*
|
||||
* If none of these conditions are true, this method will throw and prevent
|
||||
* the write.
|
||||
*
|
||||
* @return void
|
||||
* @task protect
|
||||
*/
|
||||
public static function willWrite() {
|
||||
if (!self::$instance) {
|
||||
if (!self::$allowUnguardedWrites) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Unguarded write! There must be an active %s to perform writes.',
|
||||
__CLASS__));
|
||||
} else {
|
||||
// Unguarded writes are being allowed unconditionally.
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$instance = self::$instance;
|
||||
if ($instance->allowDepth == 0) {
|
||||
call_user_func($instance->callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -( Disabling Write Protection )----------------------------------------- */
|
||||
|
||||
|
||||
/**
|
||||
* Enter a scope which permits unguarded writes. This works like
|
||||
* @{method:beginUnguardedWrites} but returns an object which will end
|
||||
* the unguarded write scope when its __destruct() method is called. This
|
||||
* is useful to more easily handle exceptions correctly in unguarded write
|
||||
* blocks:
|
||||
*
|
||||
* // Restores the guard even if do_logging() throws.
|
||||
* function unguarded_scope() {
|
||||
* $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
* do_logging();
|
||||
* }
|
||||
*
|
||||
* @return AphrontScopedUnguardedWriteCapability Object which ends unguarded
|
||||
* writes when it leaves scope.
|
||||
* @task disable
|
||||
*/
|
||||
public static function beginScopedUnguardedWrites() {
|
||||
self::beginUnguardedWrites();
|
||||
return new AphrontScopedUnguardedWriteCapability();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Begin a block which permits unguarded writes. You should use this very
|
||||
* sparingly, and only for things like logging where CSRF is not a concern.
|
||||
*
|
||||
* You must pair every call to @{method:beginUnguardedWrites} with a call to
|
||||
* @{method:endUnguardedWrites}:
|
||||
*
|
||||
* AphrontWriteGuard::beginUnguardedWrites();
|
||||
* do_logging();
|
||||
* AphrontWriteGuard::endUnguardedWrites();
|
||||
*
|
||||
* @return void
|
||||
* @task disable
|
||||
*/
|
||||
public static function beginUnguardedWrites() {
|
||||
if (!self::$instance) {
|
||||
return;
|
||||
}
|
||||
self::$instance->allowDepth++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Declare that you have finished performing unguarded writes. You must
|
||||
* call this exactly once for each call to @{method:beginUnguardedWrites}.
|
||||
*
|
||||
* @return void
|
||||
* @task disable
|
||||
*/
|
||||
public static function endUnguardedWrites() {
|
||||
if (!self::$instance) {
|
||||
return;
|
||||
}
|
||||
if (self::$instance->allowDepth <= 0) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Imbalanced %s: more %s calls than %s calls.',
|
||||
__CLASS__,
|
||||
'endUnguardedWrites()',
|
||||
'beginUnguardedWrites()'));
|
||||
}
|
||||
self::$instance->allowDepth--;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allow execution of unguarded writes. This is ONLY appropriate for use in
|
||||
* script contexts or other contexts where you are guaranteed to never be
|
||||
* vulnerable to CSRF concerns. Calling this method is EXTREMELY DANGEROUS
|
||||
* if you do not understand the consequences.
|
||||
*
|
||||
* If you need to perform unguarded writes on an otherwise guarded workflow
|
||||
* which is vulnerable to CSRF, use @{method:beginUnguardedWrites}.
|
||||
*
|
||||
* @return void
|
||||
* @task disable
|
||||
*/
|
||||
public static function allowDangerousUnguardedWrites($allow) {
|
||||
if (self::$instance) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'You can not unconditionally disable %s by calling %s while a write '.
|
||||
'guard is active. Use %s to temporarily allow unguarded writes.',
|
||||
__CLASS__,
|
||||
__FUNCTION__.'()',
|
||||
'beginUnguardedWrites()'));
|
||||
}
|
||||
self::$allowUnguardedWrites = true;
|
||||
}
|
||||
|
||||
}
|
@@ -10,13 +10,15 @@ final class AlmanacConsoleController extends AlmanacController {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$menu = id(new PHUIObjectItemListView())
|
||||
->setUser($viewer);
|
||||
->setViewer($viewer)
|
||||
->setBig(true);
|
||||
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Devices'))
|
||||
->setHref($this->getApplicationURI('device/'))
|
||||
->setImageIcon('fa-server')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Create an inventory of physical and virtual hosts and '.
|
||||
@@ -27,6 +29,7 @@ final class AlmanacConsoleController extends AlmanacController {
|
||||
->setHeader(pht('Services'))
|
||||
->setHref($this->getApplicationURI('service/'))
|
||||
->setImageIcon('fa-plug')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Create and update services, and map them to interfaces on '.
|
||||
@@ -37,6 +40,7 @@ final class AlmanacConsoleController extends AlmanacController {
|
||||
->setHeader(pht('Networks'))
|
||||
->setHref($this->getApplicationURI('network/'))
|
||||
->setImageIcon('fa-globe')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Manage public and private networks.')));
|
||||
@@ -46,6 +50,7 @@ final class AlmanacConsoleController extends AlmanacController {
|
||||
->setHeader(pht('Namespaces'))
|
||||
->setHref($this->getApplicationURI('namespace/'))
|
||||
->setImageIcon('fa-asterisk')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht('Control who can create new named services and devices.')));
|
||||
|
||||
@@ -57,6 +62,7 @@ final class AlmanacConsoleController extends AlmanacController {
|
||||
->setHeader(pht('Documentation'))
|
||||
->setHref($docs_uri)
|
||||
->setImageIcon('fa-book')
|
||||
->setClickable(true)
|
||||
->addAttribute(pht('Browse documentation for Almanac.')));
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
@@ -64,23 +70,20 @@ final class AlmanacConsoleController extends AlmanacController {
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Almanac Console'))
|
||||
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
|
||||
->setObjectList($menu);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Almanac Console'))
|
||||
->setHeaderIcon('fa-server');
|
||||
$launcher_view = id(new PHUILauncherView())
|
||||
->appendChild($box);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter(array(
|
||||
$box,
|
||||
));
|
||||
->setFooter($launcher_view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Almanac Console'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -405,6 +405,31 @@ final class PhabricatorAuditEditor
|
||||
$phid_map[] = $reverted_phids;
|
||||
}
|
||||
|
||||
// See T13463. Copy "related task" edges from the associated revision, if
|
||||
// one exists.
|
||||
|
||||
$revision = DiffusionCommitRevisionQuery::loadRevisionForCommit(
|
||||
$actor,
|
||||
$object);
|
||||
if ($revision) {
|
||||
$task_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
|
||||
$revision->getPHID(),
|
||||
DifferentialRevisionHasTaskEdgeType::EDGECONST);
|
||||
$task_phids = array_fuse($task_phids);
|
||||
|
||||
if ($task_phids) {
|
||||
$related_edge = DiffusionCommitHasTaskEdgeType::EDGECONST;
|
||||
$result[] = id(new PhabricatorAuditTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_EDGE)
|
||||
->setMetadataValue('edge:type', $related_edge)
|
||||
->setNewValue(array('+' => $task_phids));
|
||||
}
|
||||
|
||||
// Mark these objects as unmentionable, since the explicit relationship
|
||||
// is stronger and any mentions are redundant.
|
||||
$phid_map[] = $task_phids;
|
||||
}
|
||||
|
||||
$phid_map = array_mergev($phid_map);
|
||||
$this->addUnmentionablePHIDs($phid_map);
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* Abstract interface to an identity provider or authentication source, like
|
||||
* Twitter, Facebook or Google.
|
||||
* Twitter, Facebook, or Google.
|
||||
*
|
||||
* Generally, adapters are handed some set of credentials particular to the
|
||||
* provider they adapt, and they turn those credentials into standard
|
||||
@@ -17,13 +17,37 @@
|
||||
*/
|
||||
abstract class PhutilAuthAdapter extends Phobject {
|
||||
|
||||
final public function getAccountIdentifiers() {
|
||||
$result = $this->newAccountIdentifiers();
|
||||
assert_instances_of($result, 'PhabricatorExternalAccountIdentifier');
|
||||
return $result;
|
||||
}
|
||||
|
||||
protected function newAccountIdentifiers() {
|
||||
$identifiers = array();
|
||||
|
||||
$raw_identifier = $this->getAccountID();
|
||||
if ($raw_identifier !== null) {
|
||||
$identifiers[] = $this->newAccountIdentifier($raw_identifier);
|
||||
}
|
||||
|
||||
return $identifiers;
|
||||
}
|
||||
|
||||
final protected function newAccountIdentifier($raw_identifier) {
|
||||
return id(new PhabricatorExternalAccountIdentifier())
|
||||
->setIdentifierRaw($raw_identifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a unique identifier associated with the identity. For most providers,
|
||||
* this is an account ID.
|
||||
* Get a unique identifier associated with the account.
|
||||
*
|
||||
* The account ID needs to be unique within this adapter's configuration, such
|
||||
* that `<adapterKey, accountID>` is globally unique and always identifies the
|
||||
* same identity.
|
||||
* This identifier should be permanent, immutable, and uniquely identify
|
||||
* the account. If possible, it should be nonsensitive. For providers that
|
||||
* have a GUID or PHID value for accounts, these are the best values to use.
|
||||
*
|
||||
* You can implement @{method:newAccountIdentifiers} instead if a provider
|
||||
* is unable to emit identifiers with all of these properties.
|
||||
*
|
||||
* If the adapter was unable to authenticate an identity, it should return
|
||||
* `null`.
|
||||
@@ -31,7 +55,9 @@ abstract class PhutilAuthAdapter extends Phobject {
|
||||
* @return string|null Unique account identifier, or `null` if authentication
|
||||
* failed.
|
||||
*/
|
||||
abstract public function getAccountID();
|
||||
public function getAccountID() {
|
||||
throw new PhutilMethodNotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@@ -51,13 +51,17 @@ final class PhutilGitHubAuthAdapter extends PhutilOAuthAuthAdapter {
|
||||
|
||||
protected function loadOAuthAccountData() {
|
||||
$uri = new PhutilURI('https://api.github.com/user');
|
||||
$uri->replaceQueryParam('access_token', $this->getAccessToken());
|
||||
|
||||
$future = new HTTPSFuture($uri);
|
||||
|
||||
// NOTE: GitHub requires a User-Agent string.
|
||||
$future->addHeader('User-Agent', __CLASS__);
|
||||
|
||||
// See T13485. Circa early 2020, GitHub has deprecated use of the
|
||||
// "access_token" URI parameter.
|
||||
$token_header = sprintf('token %s', $this->getAccessToken());
|
||||
$future->addHeader('Authorization', $token_header);
|
||||
|
||||
list($body) = $future->resolvex();
|
||||
|
||||
try {
|
||||
|
@@ -13,8 +13,23 @@ final class PhutilGoogleAuthAdapter extends PhutilOAuthAuthAdapter {
|
||||
return 'google.com';
|
||||
}
|
||||
|
||||
public function getAccountID() {
|
||||
return $this->getAccountEmail();
|
||||
protected function newAccountIdentifiers() {
|
||||
$identifiers = array();
|
||||
|
||||
$account_id = $this->getOAuthAccountData('id');
|
||||
if ($account_id !== null) {
|
||||
$account_id = sprintf(
|
||||
'id(%s)',
|
||||
$account_id);
|
||||
$identifiers[] = $this->newAccountIdentifier($account_id);
|
||||
}
|
||||
|
||||
$email = $this->getAccountEmail();
|
||||
if ($email !== null) {
|
||||
$identifiers[] = $this->newAccountIdentifier($email);
|
||||
}
|
||||
|
||||
return $identifiers;
|
||||
}
|
||||
|
||||
public function getAccountEmail() {
|
||||
|
@@ -22,12 +22,33 @@ final class PhutilJIRAAuthAdapter extends PhutilOAuth1AuthAdapter {
|
||||
return $this->jiraBaseURI;
|
||||
}
|
||||
|
||||
public function getAccountID() {
|
||||
protected function newAccountIdentifiers() {
|
||||
// Make sure the handshake is finished; this method is used for its
|
||||
// side effect by Auth providers.
|
||||
$this->getHandshakeData();
|
||||
|
||||
return idx($this->getUserInfo(), 'key');
|
||||
$info = $this->getUserInfo();
|
||||
|
||||
// See T13493. Older versions of JIRA provide a "key" with a username or
|
||||
// email address. Newer versions of JIRA provide a GUID "accountId".
|
||||
// Intermediate versions of JIRA provide both.
|
||||
|
||||
$identifiers = array();
|
||||
|
||||
$account_key = idx($info, 'key');
|
||||
if ($account_key !== null) {
|
||||
$identifiers[] = $this->newAccountIdentifier($account_key);
|
||||
}
|
||||
|
||||
$account_id = idx($info, 'accountId');
|
||||
if ($account_id !== null) {
|
||||
$identifiers[] = $this->newAccountIdentifier(
|
||||
sprintf(
|
||||
'accountId(%s)',
|
||||
$account_id));
|
||||
}
|
||||
|
||||
return $identifiers;
|
||||
}
|
||||
|
||||
public function getAccountName() {
|
||||
|
@@ -156,7 +156,7 @@ abstract class PhutilOAuth1AuthAdapter extends PhutilAuthAdapter {
|
||||
$authorize_token_uri = new PhutilURI($this->getAuthorizeTokenURI());
|
||||
$authorize_token_uri->replaceQueryParam('oauth_token', $this->getToken());
|
||||
|
||||
return (string)$authorize_token_uri;
|
||||
return phutil_string_cast($authorize_token_uri);
|
||||
}
|
||||
|
||||
protected function finishOAuthHandshake() {
|
||||
|
@@ -197,22 +197,6 @@ abstract class PhabricatorAuthController extends PhabricatorController {
|
||||
return array($account, $provider, $response);
|
||||
}
|
||||
|
||||
$other_account = id(new PhabricatorExternalAccount())->loadAllWhere(
|
||||
'accountType = %s AND accountDomain = %s AND accountID = %s
|
||||
AND id != %d',
|
||||
$account->getAccountType(),
|
||||
$account->getAccountDomain(),
|
||||
$account->getAccountID(),
|
||||
$account->getID());
|
||||
|
||||
if ($other_account) {
|
||||
$response = $this->renderError(
|
||||
pht(
|
||||
'The account you are attempting to register with already belongs '.
|
||||
'to another user.'));
|
||||
return array($account, $provider, $response);
|
||||
}
|
||||
|
||||
$config = $account->getProviderConfig();
|
||||
if (!$config->getIsEnabled()) {
|
||||
$response = $this->renderError(
|
||||
|
@@ -116,14 +116,21 @@ final class PhabricatorAuthLoginController
|
||||
}
|
||||
} else {
|
||||
|
||||
// If the user already has a linked account of this type, prevent them
|
||||
// from linking a second account. This can happen if they swap logins
|
||||
// and then refresh the account link. See T6707. We will eventually
|
||||
// allow this after T2549.
|
||||
// If the user already has a linked account on this provider, prevent
|
||||
// them from linking a second account. This can happen if they swap
|
||||
// logins and then refresh the account link.
|
||||
|
||||
// There's no technical reason we can't allow you to link multiple
|
||||
// accounts from a single provider; disallowing this is currently a
|
||||
// product deciison. See T2549.
|
||||
|
||||
$existing_accounts = id(new PhabricatorExternalAccountQuery())
|
||||
->setViewer($viewer)
|
||||
->withUserPHIDs(array($viewer->getPHID()))
|
||||
->withAccountTypes(array($account->getAccountType()))
|
||||
->withProviderConfigPHIDs(
|
||||
array(
|
||||
$provider->getProviderConfigPHID(),
|
||||
))
|
||||
->execute();
|
||||
if ($existing_accounts) {
|
||||
return $this->renderError(
|
||||
|
@@ -465,7 +465,6 @@ final class PhabricatorAuthRegisterController
|
||||
|
||||
if (!$is_setup) {
|
||||
$account->setUserPHID($user->getPHID());
|
||||
$provider->willRegisterAccount($account);
|
||||
$account->save();
|
||||
}
|
||||
|
||||
|
@@ -67,7 +67,7 @@ final class PhabricatorAuthUnlinkController
|
||||
->setWorkflowKey($workflow_key)
|
||||
->requireHighSecurityToken($viewer, $request, $done_uri);
|
||||
|
||||
$account->delete();
|
||||
$account->unlinkAccount();
|
||||
|
||||
id(new PhabricatorAuthSessionEngine())->terminateLoginSessions(
|
||||
$viewer,
|
||||
|
@@ -1,3 +1,17 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorAuthHighSecurityToken extends Phobject {}
|
||||
final class PhabricatorAuthHighSecurityToken
|
||||
extends Phobject {
|
||||
|
||||
private $isUnchallengedToken = false;
|
||||
|
||||
public function setIsUnchallengedToken($is_unchallenged_token) {
|
||||
$this->isUnchallengedToken = $is_unchallenged_token;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIsUnchallengedToken() {
|
||||
return $this->isUnchallengedToken;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -493,7 +493,8 @@ final class PhabricatorAuthSessionEngine extends Phobject {
|
||||
// adds an auth factor, existing sessions won't get a free pass into hisec,
|
||||
// since they never actually got marked as hisec.
|
||||
if (!$factors) {
|
||||
return $this->issueHighSecurityToken($session, true);
|
||||
return $this->issueHighSecurityToken($session, true)
|
||||
->setIsUnchallengedToken(true);
|
||||
}
|
||||
|
||||
$this->request = $request;
|
||||
|
@@ -56,9 +56,12 @@ final class PhabricatorAuthManagementLDAPWorkflow
|
||||
$console->writeOut("\n");
|
||||
$console->writeOut("%s\n", pht('Connecting to LDAP...'));
|
||||
|
||||
$account_id = $adapter->getAccountID();
|
||||
if ($account_id) {
|
||||
$console->writeOut("%s\n", pht('Found LDAP Account: %s', $account_id));
|
||||
$account_ids = $adapter->getAccountIdentifiers();
|
||||
if ($account_ids) {
|
||||
$value_list = mpull($account_ids, 'getIdentifierRaw');
|
||||
$value_list = implode(', ', $value_list);
|
||||
|
||||
$console->writeOut("%s\n", pht('Found LDAP Account: %s', $value_list));
|
||||
} else {
|
||||
$console->writeOut("%s\n", pht('Unable to find LDAP account!'));
|
||||
}
|
||||
|
@@ -18,16 +18,6 @@ final class PhabricatorAuthManagementRefreshWorkflow
|
||||
'param' => 'user',
|
||||
'help' => pht('Refresh tokens for a given user.'),
|
||||
),
|
||||
array(
|
||||
'name' => 'type',
|
||||
'param' => 'provider',
|
||||
'help' => pht('Refresh tokens for a given provider type.'),
|
||||
),
|
||||
array(
|
||||
'name' => 'domain',
|
||||
'param' => 'domain',
|
||||
'help' => pht('Refresh tokens for a given domain.'),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -57,17 +47,6 @@ final class PhabricatorAuthManagementRefreshWorkflow
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$type = $args->getArg('type');
|
||||
if (strlen($type)) {
|
||||
$query->withAccountTypes(array($type));
|
||||
}
|
||||
|
||||
$domain = $args->getArg('domain');
|
||||
if (strlen($domain)) {
|
||||
$query->withAccountDomains(array($domain));
|
||||
}
|
||||
|
||||
$accounts = $query->execute();
|
||||
|
||||
if (!$accounts) {
|
||||
@@ -82,25 +61,24 @@ final class PhabricatorAuthManagementRefreshWorkflow
|
||||
}
|
||||
|
||||
$providers = PhabricatorAuthProvider::getAllEnabledProviders();
|
||||
$providers = mpull($providers, null, 'getProviderConfigPHID');
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
$console->writeOut(
|
||||
"%s\n",
|
||||
pht(
|
||||
'Refreshing account #%d (%s/%s).',
|
||||
$account->getID(),
|
||||
$account->getAccountType(),
|
||||
$account->getAccountDomain()));
|
||||
'Refreshing account #%d.',
|
||||
$account->getID()));
|
||||
|
||||
$key = $account->getProviderKey();
|
||||
if (empty($providers[$key])) {
|
||||
$config_phid = $account->getProviderConfigPHID();
|
||||
if (empty($providers[$config_phid])) {
|
||||
$console->writeOut(
|
||||
"> %s\n",
|
||||
pht('Skipping, provider is not enabled or does not exist.'));
|
||||
continue;
|
||||
}
|
||||
|
||||
$provider = $providers[$key];
|
||||
$provider = $providers[$config_phid];
|
||||
if (!($provider instanceof PhabricatorOAuth2AuthProvider)) {
|
||||
$console->writeOut(
|
||||
"> %s\n",
|
||||
|
@@ -20,6 +20,10 @@ abstract class PhabricatorAuthProvider extends Phobject {
|
||||
return $this->providerConfig;
|
||||
}
|
||||
|
||||
public function getProviderConfigPHID() {
|
||||
return $this->getProviderConfig()->getPHID();
|
||||
}
|
||||
|
||||
public function getConfigurationHelp() {
|
||||
return null;
|
||||
}
|
||||
@@ -186,44 +190,86 @@ abstract class PhabricatorAuthProvider extends Phobject {
|
||||
return;
|
||||
}
|
||||
|
||||
public function willRegisterAccount(PhabricatorExternalAccount $account) {
|
||||
return;
|
||||
final protected function newExternalAccountForIdentifiers(
|
||||
array $identifiers) {
|
||||
|
||||
assert_instances_of($identifiers, 'PhabricatorExternalAccountIdentifier');
|
||||
|
||||
if (!$identifiers) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Authentication provider (of class "%s") is attempting to '.
|
||||
'load or create an external account, but provided no account '.
|
||||
'identifiers.',
|
||||
get_class($this)));
|
||||
}
|
||||
|
||||
$config = $this->getProviderConfig();
|
||||
$viewer = PhabricatorUser::getOmnipotentUser();
|
||||
|
||||
$raw_identifiers = mpull($identifiers, 'getIdentifierRaw');
|
||||
|
||||
$accounts = id(new PhabricatorExternalAccountQuery())
|
||||
->setViewer($viewer)
|
||||
->withProviderConfigPHIDs(array($config->getPHID()))
|
||||
->withRawAccountIdentifiers($raw_identifiers)
|
||||
->needAccountIdentifiers(true)
|
||||
->execute();
|
||||
if (!$accounts) {
|
||||
$account = $this->newExternalAccount();
|
||||
} else if (count($accounts) === 1) {
|
||||
$account = head($accounts);
|
||||
} else {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Authentication provider (of class "%s") is attempting to load '.
|
||||
'or create an external account, but provided a list of '.
|
||||
'account identifiers which map to more than one account: %s.',
|
||||
get_class($this),
|
||||
implode(', ', $raw_identifiers)));
|
||||
}
|
||||
|
||||
// See T13493. Add all the identifiers to the account. In the case where
|
||||
// an account initially has a lower-quality identifier (like an email
|
||||
// address) and later adds a higher-quality identifier (like a GUID), this
|
||||
// allows us to automatically upgrade toward the higher-quality identifier
|
||||
// and survive API changes which remove the lower-quality identifier more
|
||||
// gracefully.
|
||||
|
||||
foreach ($identifiers as $identifier) {
|
||||
$account->appendIdentifier($identifier);
|
||||
}
|
||||
|
||||
return $this->didUpdateAccount($account);
|
||||
}
|
||||
|
||||
protected function loadOrCreateAccount($account_id) {
|
||||
if (!strlen($account_id)) {
|
||||
throw new Exception(pht('Empty account ID!'));
|
||||
}
|
||||
final protected function newExternalAccountForUser(PhabricatorUser $user) {
|
||||
$config = $this->getProviderConfig();
|
||||
|
||||
$adapter = $this->getAdapter();
|
||||
$adapter_class = get_class($adapter);
|
||||
// When a user logs in with a provider like username/password, they
|
||||
// always already have a Phabricator account (since there's no way they
|
||||
// could have a username otherwise).
|
||||
|
||||
if (!strlen($adapter->getAdapterType())) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
"AuthAdapter (of class '%s') has an invalid implementation: ".
|
||||
"no adapter type.",
|
||||
$adapter_class));
|
||||
}
|
||||
// These users should never go to registration, so we're building a
|
||||
// dummy "external account" which just links directly back to their
|
||||
// internal account.
|
||||
|
||||
if (!strlen($adapter->getAdapterDomain())) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
"AuthAdapter (of class '%s') has an invalid implementation: ".
|
||||
"no adapter domain.",
|
||||
$adapter_class));
|
||||
}
|
||||
|
||||
$account = id(new PhabricatorExternalAccount())->loadOneWhere(
|
||||
'accountType = %s AND accountDomain = %s AND accountID = %s',
|
||||
$adapter->getAdapterType(),
|
||||
$adapter->getAdapterDomain(),
|
||||
$account_id);
|
||||
$account = id(new PhabricatorExternalAccountQuery())
|
||||
->setViewer($user)
|
||||
->withProviderConfigPHIDs(array($config->getPHID()))
|
||||
->withUserPHIDs(array($user->getPHID()))
|
||||
->executeOne();
|
||||
if (!$account) {
|
||||
$account = $this->newExternalAccount()
|
||||
->setAccountID($account_id);
|
||||
->setUserPHID($user->getPHID());
|
||||
}
|
||||
|
||||
return $this->didUpdateAccount($account);
|
||||
}
|
||||
|
||||
private function didUpdateAccount(PhabricatorExternalAccount $account) {
|
||||
$adapter = $this->getAdapter();
|
||||
|
||||
$account->setUsername($adapter->getAccountName());
|
||||
$account->setRealName($adapter->getAccountRealName());
|
||||
$account->setEmail($adapter->getAccountEmail());
|
||||
@@ -240,6 +286,7 @@ abstract class PhabricatorAuthProvider extends Phobject {
|
||||
// file entry for it, but there's no convenient way to do this with
|
||||
// PhabricatorFile right now. The storage will get shared, so the impact
|
||||
// here is negligible.
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
$image_file = PhabricatorFile::newFromFileDownload(
|
||||
$image_uri,
|
||||
@@ -305,10 +352,23 @@ abstract class PhabricatorAuthProvider extends Phobject {
|
||||
$config = $this->getProviderConfig();
|
||||
$adapter = $this->getAdapter();
|
||||
|
||||
return id(new PhabricatorExternalAccount())
|
||||
$account = id(new PhabricatorExternalAccount())
|
||||
->setProviderConfigPHID($config->getPHID())
|
||||
->attachAccountIdentifiers(array());
|
||||
|
||||
// TODO: Remove this when these columns are removed. They no longer have
|
||||
// readers or writers (other than this callsite).
|
||||
|
||||
$account
|
||||
->setAccountType($adapter->getAdapterType())
|
||||
->setAccountDomain($adapter->getAdapterDomain())
|
||||
->setProviderConfigPHID($config->getPHID());
|
||||
->setAccountDomain($adapter->getAdapterDomain());
|
||||
|
||||
// TODO: Remove this when "accountID" is removed; the column is not
|
||||
// nullable.
|
||||
|
||||
$account->setAccountID('');
|
||||
|
||||
return $account;
|
||||
}
|
||||
|
||||
public function getLoginOrder() {
|
||||
|
@@ -335,7 +335,7 @@ final class PhabricatorJIRAAuthProvider
|
||||
public function getDoorkeeperURIRef(PhutilURI $uri) {
|
||||
$uri_string = phutil_string_cast($uri);
|
||||
|
||||
$pattern = '((https?://\S+?)/browse/([A-Z]+-[1-9]\d*))';
|
||||
$pattern = '((https?://\S+?)/browse/([A-Z][A-Z0-9]*-[1-9]\d*))';
|
||||
$matches = null;
|
||||
if (!preg_match($pattern, $uri_string, $matches)) {
|
||||
return null;
|
||||
|
@@ -164,7 +164,7 @@ final class PhabricatorLDAPAuthProvider extends PhabricatorAuthProvider {
|
||||
// See T3351.
|
||||
|
||||
DarkConsoleErrorLogPluginAPI::enableDiscardMode();
|
||||
$account_id = $adapter->getAccountID();
|
||||
$identifiers = $adapter->getAccountIdentifiers();
|
||||
DarkConsoleErrorLogPluginAPI::disableDiscardMode();
|
||||
} else {
|
||||
throw new Exception(pht('Username and password are required!'));
|
||||
@@ -180,7 +180,9 @@ final class PhabricatorLDAPAuthProvider extends PhabricatorAuthProvider {
|
||||
}
|
||||
}
|
||||
|
||||
return array($this->loadOrCreateAccount($account_id), $response);
|
||||
$account = $this->newExternalAccountForIdentifiers($identifiers);
|
||||
|
||||
return array($account, $response);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -100,13 +100,13 @@ abstract class PhabricatorOAuth1AuthProvider
|
||||
// an access token.
|
||||
|
||||
try {
|
||||
$account_id = $adapter->getAccountID();
|
||||
$identifiers = $adapter->getAccountIdentifiers();
|
||||
} catch (Exception $ex) {
|
||||
// TODO: Handle this in a more user-friendly way.
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
if (!strlen($account_id)) {
|
||||
if (!$identifiers) {
|
||||
$response = $controller->buildProviderErrorResponse(
|
||||
$this,
|
||||
pht(
|
||||
@@ -115,7 +115,9 @@ abstract class PhabricatorOAuth1AuthProvider
|
||||
return array($account, $response);
|
||||
}
|
||||
|
||||
return array($this->loadOrCreateAccount($account_id), $response);
|
||||
$account = $this->newExternalAccountForIdentifiers($identifiers);
|
||||
|
||||
return array($account, $response);
|
||||
}
|
||||
|
||||
public function processEditForm(
|
||||
|
@@ -80,13 +80,13 @@ abstract class PhabricatorOAuth2AuthProvider
|
||||
// an access token.
|
||||
|
||||
try {
|
||||
$account_id = $adapter->getAccountID();
|
||||
$identifiers = $adapter->getAccountIdentifiers();
|
||||
} catch (Exception $ex) {
|
||||
// TODO: Handle this in a more user-friendly way.
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
if (!strlen($account_id)) {
|
||||
if (!$identifiers) {
|
||||
$response = $controller->buildProviderErrorResponse(
|
||||
$this,
|
||||
pht(
|
||||
@@ -95,7 +95,9 @@ abstract class PhabricatorOAuth2AuthProvider
|
||||
return array($account, $response);
|
||||
}
|
||||
|
||||
return array($this->loadOrCreateAccount($account_id), $response);
|
||||
$account = $this->newExternalAccountForIdentifiers($identifiers);
|
||||
|
||||
return array($account, $response);
|
||||
}
|
||||
|
||||
public function processEditForm(
|
||||
@@ -197,7 +199,7 @@ abstract class PhabricatorOAuth2AuthProvider
|
||||
PhabricatorExternalAccount $account,
|
||||
$force_refresh = false) {
|
||||
|
||||
if ($account->getProviderKey() !== $this->getProviderKey()) {
|
||||
if ($account->getProviderConfigPHID() !== $this->getProviderConfigPHID()) {
|
||||
throw new Exception(pht('Account does not match provider!'));
|
||||
}
|
||||
|
||||
|
@@ -332,7 +332,7 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
|
||||
->setObject($user);
|
||||
|
||||
if ($engine->isValidPassword($envelope)) {
|
||||
$account = $this->loadOrCreateAccount($user->getPHID());
|
||||
$account = $this->newExternalAccountForUser($user);
|
||||
$log_user = $user;
|
||||
}
|
||||
}
|
||||
@@ -366,16 +366,6 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function willSaveAccount(PhabricatorExternalAccount $account) {
|
||||
parent::willSaveAccount($account);
|
||||
$account->setUserPHID($account->getAccountID());
|
||||
}
|
||||
|
||||
public function willRegisterAccount(PhabricatorExternalAccount $account) {
|
||||
parent::willRegisterAccount($account);
|
||||
$account->setAccountID($account->getUserPHID());
|
||||
}
|
||||
|
||||
public static function getPasswordProvider() {
|
||||
$providers = self::getAllEnabledProviders();
|
||||
|
||||
@@ -402,4 +392,5 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
|
||||
public function shouldAllowEmailTrustConfiguration() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorExternalAccountIdentifierQuery
|
||||
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||
|
||||
private $ids;
|
||||
private $phids;
|
||||
private $providerConfigPHIDs;
|
||||
private $externalAccountPHIDs;
|
||||
private $rawIdentifiers;
|
||||
|
||||
public function withIDs($ids) {
|
||||
$this->ids = $ids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withPHIDs(array $phids) {
|
||||
$this->phids = $phids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withProviderConfigPHIDs(array $phids) {
|
||||
$this->providerConfigPHIDs = $phids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withExternalAccountPHIDs(array $phids) {
|
||||
$this->externalAccountPHIDs = $phids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withRawIdentifiers(array $identifiers) {
|
||||
$this->rawIdentifiers = $identifiers;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function newResultObject() {
|
||||
return new PhabricatorExternalAccountIdentifier();
|
||||
}
|
||||
|
||||
protected function loadPage() {
|
||||
return $this->loadStandardPage($this->newResultObject());
|
||||
}
|
||||
|
||||
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
||||
$where = parent::buildWhereClauseParts($conn);
|
||||
|
||||
if ($this->ids !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'id IN (%Ld)',
|
||||
$this->ids);
|
||||
}
|
||||
|
||||
if ($this->phids !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'phid IN (%Ls)',
|
||||
$this->phids);
|
||||
}
|
||||
|
||||
if ($this->providerConfigPHIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'providerConfigPHID IN (%Ls)',
|
||||
$this->providerConfigPHIDs);
|
||||
}
|
||||
|
||||
if ($this->externalAccountPHIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'externalAccountPHID IN (%Ls)',
|
||||
$this->externalAccountPHIDs);
|
||||
}
|
||||
|
||||
if ($this->rawIdentifiers !== null) {
|
||||
$hashes = array();
|
||||
foreach ($this->rawIdentifiers as $raw_identifier) {
|
||||
$hashes[] = PhabricatorHash::digestForIndex($raw_identifier);
|
||||
}
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'identifierHash IN (%Ls)',
|
||||
$hashes);
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
return 'PhabricatorPeopleApplication';
|
||||
}
|
||||
|
||||
}
|
@@ -15,34 +15,18 @@ final class PhabricatorExternalAccountQuery
|
||||
|
||||
private $ids;
|
||||
private $phids;
|
||||
private $accountTypes;
|
||||
private $accountDomains;
|
||||
private $accountIDs;
|
||||
private $userPHIDs;
|
||||
private $needImages;
|
||||
private $accountSecrets;
|
||||
private $providerConfigPHIDs;
|
||||
private $needAccountIdentifiers;
|
||||
private $rawAccountIdentifiers;
|
||||
|
||||
public function withUserPHIDs(array $user_phids) {
|
||||
$this->userPHIDs = $user_phids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withAccountIDs(array $account_ids) {
|
||||
$this->accountIDs = $account_ids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withAccountDomains(array $account_domains) {
|
||||
$this->accountDomains = $account_domains;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withAccountTypes(array $account_types) {
|
||||
$this->accountTypes = $account_types;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withPHIDs(array $phids) {
|
||||
$this->phids = $phids;
|
||||
return $this;
|
||||
@@ -63,11 +47,21 @@ final class PhabricatorExternalAccountQuery
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function needAccountIdentifiers($need) {
|
||||
$this->needAccountIdentifiers = $need;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withProviderConfigPHIDs(array $phids) {
|
||||
$this->providerConfigPHIDs = $phids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withRawAccountIdentifiers(array $identifiers) {
|
||||
$this->rawAccountIdentifiers = $identifiers;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function newResultObject() {
|
||||
return new PhabricatorExternalAccount();
|
||||
}
|
||||
@@ -132,6 +126,23 @@ final class PhabricatorExternalAccountQuery
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->needAccountIdentifiers) {
|
||||
$account_phids = mpull($accounts, 'getPHID');
|
||||
|
||||
$identifiers = id(new PhabricatorExternalAccountIdentifierQuery())
|
||||
->setViewer($viewer)
|
||||
->setParentQuery($this)
|
||||
->withExternalAccountPHIDs($account_phids)
|
||||
->execute();
|
||||
|
||||
$identifiers = mgroup($identifiers, 'getExternalAccountPHID');
|
||||
foreach ($accounts as $account) {
|
||||
$account_phid = $account->getPHID();
|
||||
$account_identifiers = idx($identifiers, $account_phid, array());
|
||||
$account->attachAccountIdentifiers($account_identifiers);
|
||||
}
|
||||
}
|
||||
|
||||
return $accounts;
|
||||
}
|
||||
|
||||
@@ -141,62 +152,98 @@ final class PhabricatorExternalAccountQuery
|
||||
if ($this->ids !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'id IN (%Ld)',
|
||||
'account.id IN (%Ld)',
|
||||
$this->ids);
|
||||
}
|
||||
|
||||
if ($this->phids !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'phid IN (%Ls)',
|
||||
'account.phid IN (%Ls)',
|
||||
$this->phids);
|
||||
}
|
||||
|
||||
if ($this->accountTypes !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'accountType IN (%Ls)',
|
||||
$this->accountTypes);
|
||||
}
|
||||
|
||||
if ($this->accountDomains !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'accountDomain IN (%Ls)',
|
||||
$this->accountDomains);
|
||||
}
|
||||
|
||||
if ($this->accountIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'accountID IN (%Ls)',
|
||||
$this->accountIDs);
|
||||
}
|
||||
|
||||
if ($this->userPHIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'userPHID IN (%Ls)',
|
||||
'account.userPHID IN (%Ls)',
|
||||
$this->userPHIDs);
|
||||
}
|
||||
|
||||
if ($this->accountSecrets !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'accountSecret IN (%Ls)',
|
||||
'account.accountSecret IN (%Ls)',
|
||||
$this->accountSecrets);
|
||||
}
|
||||
|
||||
if ($this->providerConfigPHIDs !== null) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'providerConfigPHID IN (%Ls)',
|
||||
'account.providerConfigPHID IN (%Ls)',
|
||||
$this->providerConfigPHIDs);
|
||||
|
||||
// If we have a list of ProviderConfig PHIDs and are joining the
|
||||
// identifiers table, also include the list as an additional constraint
|
||||
// on the identifiers table.
|
||||
|
||||
// This does not change the query results (an Account and its
|
||||
// Identifiers always have the same ProviderConfig PHID) but it allows
|
||||
// us to use keys on the Identifier table more efficiently.
|
||||
|
||||
if ($this->shouldJoinIdentifiersTable()) {
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'identifier.providerConfigPHID IN (%Ls)',
|
||||
$this->providerConfigPHIDs);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->rawAccountIdentifiers !== null) {
|
||||
$hashes = array();
|
||||
|
||||
foreach ($this->rawAccountIdentifiers as $raw_identifier) {
|
||||
$hashes[] = PhabricatorHash::digestForIndex($raw_identifier);
|
||||
}
|
||||
|
||||
$where[] = qsprintf(
|
||||
$conn,
|
||||
'identifier.identifierHash IN (%Ls)',
|
||||
$hashes);
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
protected function buildJoinClauseParts(AphrontDatabaseConnection $conn) {
|
||||
$joins = parent::buildJoinClauseParts($conn);
|
||||
|
||||
if ($this->shouldJoinIdentifiersTable()) {
|
||||
$joins[] = qsprintf(
|
||||
$conn,
|
||||
'JOIN %R identifier ON account.phid = identifier.externalAccountPHID',
|
||||
new PhabricatorExternalAccountIdentifier());
|
||||
}
|
||||
|
||||
return $joins;
|
||||
}
|
||||
|
||||
protected function shouldJoinIdentifiersTable() {
|
||||
return ($this->rawAccountIdentifiers !== null);
|
||||
}
|
||||
|
||||
protected function shouldGroupQueryResultRows() {
|
||||
if ($this->shouldJoinIdentifiersTable()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return parent::shouldGroupQueryResultRows();
|
||||
}
|
||||
|
||||
protected function getPrimaryTableAlias() {
|
||||
return 'account';
|
||||
}
|
||||
|
||||
public function getQueryApplicationClass() {
|
||||
return 'PhabricatorPeopleApplication';
|
||||
}
|
||||
|
@@ -4,7 +4,8 @@ final class PhabricatorAuthProviderConfig
|
||||
extends PhabricatorAuthDAO
|
||||
implements
|
||||
PhabricatorApplicationTransactionInterface,
|
||||
PhabricatorPolicyInterface {
|
||||
PhabricatorPolicyInterface,
|
||||
PhabricatorDestructibleInterface {
|
||||
|
||||
protected $providerClass;
|
||||
protected $providerType;
|
||||
@@ -140,4 +141,33 @@ final class PhabricatorAuthProviderConfig
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorDestructibleInterface )----------------------------------- */
|
||||
|
||||
|
||||
public function destroyObjectPermanently(
|
||||
PhabricatorDestructionEngine $engine) {
|
||||
|
||||
$viewer = $engine->getViewer();
|
||||
$config_phid = $this->getPHID();
|
||||
|
||||
$accounts = id(new PhabricatorExternalAccountQuery())
|
||||
->setViewer($viewer)
|
||||
->withProviderConfigPHIDs(array($config_phid))
|
||||
->newIterator();
|
||||
foreach ($accounts as $account) {
|
||||
$engine->destroyObject($account);
|
||||
}
|
||||
|
||||
$identifiers = id(new PhabricatorExternalAccountIdentifierQuery())
|
||||
->setViewer($viewer)
|
||||
->withProviderConfigPHIDs(array($config_phid))
|
||||
->newIterator();
|
||||
foreach ($identifiers as $identifier) {
|
||||
$engine->destroyObject($identifier);
|
||||
}
|
||||
|
||||
$this->delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -37,8 +37,6 @@ final class PhabricatorAuthAccountView extends AphrontView {
|
||||
$use_name = $username;
|
||||
} else if (strlen($realname)) {
|
||||
$use_name = $realname;
|
||||
} else {
|
||||
$use_name = $account->getAccountID();
|
||||
}
|
||||
|
||||
$content[] = phutil_tag(
|
||||
@@ -61,8 +59,6 @@ final class PhabricatorAuthAccountView extends AphrontView {
|
||||
),
|
||||
array(
|
||||
$prov_name,
|
||||
" \xC2\xB7 ",
|
||||
$account->getAccountID(),
|
||||
));
|
||||
|
||||
$account_uri = $account->getAccountURI();
|
||||
|
@@ -849,8 +849,8 @@ final class PhutilICSParser extends Phobject {
|
||||
);
|
||||
|
||||
// Load the map of Windows timezones.
|
||||
$root_path = dirname(phutil_get_library_root('phutil'));
|
||||
$windows_path = $root_path.'/resources/timezones/windows_timezones.json';
|
||||
$root_path = dirname(phutil_get_library_root('phabricator'));
|
||||
$windows_path = $root_path.'/resources/timezones/windows-timezones.json';
|
||||
$windows_data = Filesystem::readFile($windows_path);
|
||||
$windows_zones = phutil_json_decode($windows_data);
|
||||
|
||||
|
@@ -37,13 +37,8 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/config/' => array(
|
||||
'' => 'PhabricatorConfigListController',
|
||||
'application/' => 'PhabricatorConfigApplicationController',
|
||||
'all/' => 'PhabricatorConfigAllController',
|
||||
'history/' => 'PhabricatorConfigHistoryController',
|
||||
'' => 'PhabricatorConfigConsoleController',
|
||||
'edit/(?P<key>[\w\.\-]+)/' => 'PhabricatorConfigEditController',
|
||||
'group/(?P<key>[^/]+)/' => 'PhabricatorConfigGroupController',
|
||||
'version/' => 'PhabricatorConfigVersionController',
|
||||
'database/'.
|
||||
'(?:(?P<ref>[^/]+)/'.
|
||||
'(?:(?P<database>[^/]+)/'.
|
||||
@@ -63,7 +58,7 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
|
||||
'purge/' => 'PhabricatorConfigPurgeCacheController',
|
||||
),
|
||||
'module/' => array(
|
||||
'(?P<module>[^/]+)/' => 'PhabricatorConfigModuleController',
|
||||
'(?:(?P<module>[^/]+)/)?' => 'PhabricatorConfigModuleController',
|
||||
),
|
||||
'cluster/' => array(
|
||||
'databases/' => 'PhabricatorConfigClusterDatabasesController',
|
||||
@@ -71,6 +66,12 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
|
||||
'repositories/' => 'PhabricatorConfigClusterRepositoriesController',
|
||||
'search/' => 'PhabricatorConfigClusterSearchController',
|
||||
),
|
||||
'settings/' => array(
|
||||
'' => 'PhabricatorConfigSettingsListController',
|
||||
'(?P<filter>advanced|all)/'
|
||||
=> 'PhabricatorConfigSettingsListController',
|
||||
'history/' => 'PhabricatorConfigSettingsHistoryController',
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -53,20 +53,23 @@ final class PhabricatorAuthSetupCheck extends PhabricatorSetupCheck {
|
||||
"\n\n".
|
||||
'Leaving your authentication provider configuration unlocked '.
|
||||
'increases the damage that a compromised administrator account can '.
|
||||
'do to your install, by, for example, changing the authentication '.
|
||||
'provider to a server they control and intercepting usernames and '.
|
||||
'do to your install. For example, an attacker who compromises an '.
|
||||
'administrator account can change authentication providers to point '.
|
||||
'at a server they control and attempt to intercept usernames and '.
|
||||
'passwords.'.
|
||||
"\n\n".
|
||||
'To prevent this attack, you should configure your authentication '.
|
||||
'providers, and then lock the configuration by doing `%s` '.
|
||||
'from the command line. This will prevent changing the '.
|
||||
'authentication provider config without first doing `%s`.',
|
||||
'bin/auth lock',
|
||||
'bin/auth unlock');
|
||||
'To prevent this attack, you should configure authentication, and '.
|
||||
'then lock the configuration by running "bin/auth lock" from the '.
|
||||
'command line. This will prevent changing the authentication config '.
|
||||
'without first running "bin/auth unlock".');
|
||||
$this
|
||||
->newIssue('auth.config-unlocked')
|
||||
->setShortName(pht('Auth Config Unlocked'))
|
||||
->setName(pht('Authenticaton Provider Configuration Unlocked'))
|
||||
->setName(pht('Authenticaton Configuration Unlocked'))
|
||||
->setSummary(
|
||||
pht(
|
||||
'Authentication configuration is currently unlocked. Once you '.
|
||||
'finish configuring authentication, you should lock it.'))
|
||||
->setMessage($message)
|
||||
->addRelatedPhabricatorConfig('auth.lock-config')
|
||||
->addCommand(
|
||||
|
@@ -48,10 +48,17 @@ final class PhabricatorDaemonsSetupCheck extends PhabricatorSetupCheck {
|
||||
|
||||
$expect_user = PhabricatorEnv::getEnvConfig('phd.user');
|
||||
if (strlen($expect_user)) {
|
||||
$all_daemons = id(new PhabricatorDaemonLogQuery())
|
||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||
->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE)
|
||||
->execute();
|
||||
|
||||
try {
|
||||
$all_daemons = id(new PhabricatorDaemonLogQuery())
|
||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||
->withStatus(PhabricatorDaemonLogQuery::STATUS_ALIVE)
|
||||
->execute();
|
||||
} catch (Exception $ex) {
|
||||
// If this query fails for some reason, just skip this check.
|
||||
$all_daemons = array();
|
||||
}
|
||||
|
||||
foreach ($all_daemons as $daemon) {
|
||||
$actual_user = $daemon->getRunningAsUser();
|
||||
if ($actual_user == $expect_user) {
|
||||
|
@@ -58,8 +58,7 @@ final class PhabricatorSecuritySetupCheck extends PhabricatorSetupCheck {
|
||||
->setName(pht('Alternate File Domain Not Configured'))
|
||||
->setSummary(
|
||||
pht(
|
||||
'Increase security (and improve performance) by configuring '.
|
||||
'a CDN or alternate file domain.'))
|
||||
'Improve security by configuring an alternate file domain.'))
|
||||
->setMessage(
|
||||
pht(
|
||||
'Phabricator is currently configured to serve user uploads '.
|
||||
|
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigAllController
|
||||
extends PhabricatorConfigController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$db_values = id(new PhabricatorConfigEntry())
|
||||
->loadAllWhere('namespace = %s', 'default');
|
||||
$db_values = mpull($db_values, null, 'getConfigKey');
|
||||
|
||||
$rows = array();
|
||||
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
|
||||
ksort($options);
|
||||
foreach ($options as $option) {
|
||||
$key = $option->getKey();
|
||||
|
||||
if ($option->getHidden()) {
|
||||
$value = phutil_tag('em', array(), pht('Hidden'));
|
||||
} else {
|
||||
$value = PhabricatorEnv::getEnvConfig($key);
|
||||
$value = PhabricatorConfigJSON::prettyPrintJSON($value);
|
||||
}
|
||||
|
||||
$db_value = idx($db_values, $key);
|
||||
$rows[] = array(
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $this->getApplicationURI('edit/'.$key.'/'),
|
||||
),
|
||||
$key),
|
||||
$value,
|
||||
$db_value && !$db_value->getIsDeleted() ? pht('Customized') : '',
|
||||
);
|
||||
}
|
||||
$table = id(new AphrontTableView($rows))
|
||||
->setColumnClasses(
|
||||
array(
|
||||
'',
|
||||
'wide',
|
||||
))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Key'),
|
||||
pht('Value'),
|
||||
pht('Customized'),
|
||||
));
|
||||
|
||||
$title = pht('Current Settings');
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('all/');
|
||||
|
||||
$view = $this->buildConfigBoxView(
|
||||
pht('All Settings'),
|
||||
$table);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($content);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigApplicationController
|
||||
extends PhabricatorConfigController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('application/');
|
||||
|
||||
$groups = PhabricatorApplicationConfigOptions::loadAll();
|
||||
$apps_list = $this->buildConfigOptionsList($groups, 'apps');
|
||||
$apps_list = $this->buildConfigBoxView(pht('Applications'), $apps_list);
|
||||
|
||||
$title = pht('Application Settings');
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($apps_list);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($content);
|
||||
}
|
||||
|
||||
private function buildConfigOptionsList(array $groups, $type) {
|
||||
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setBig(true);
|
||||
$groups = msort($groups, 'getName');
|
||||
foreach ($groups as $group) {
|
||||
if ($group->getGroup() == $type) {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon($group->getIcon())
|
||||
->setBackground('bg-violet');
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($group->getName())
|
||||
->setHref('/config/group/'.$group->getKey().'/')
|
||||
->addAttribute($group->getDescription())
|
||||
->setImageIcon($icon);
|
||||
$list->addItem($item);
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
@@ -1,99 +1,145 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigVersionController
|
||||
final class PhabricatorConfigConsoleController
|
||||
extends PhabricatorConfigController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$title = pht('Version Information');
|
||||
$versions = $this->renderModuleStatus($viewer);
|
||||
$menu = id(new PHUIObjectItemListView())
|
||||
->setViewer($viewer)
|
||||
->setBig(true);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('version/');
|
||||
$header = $this->buildHeaderView($title);
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Settings'))
|
||||
->setHref($this->getApplicationURI('settings/'))
|
||||
->setImageIcon('fa-wrench')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Review and modify configuration settings.')));
|
||||
|
||||
$view = $this->buildConfigBoxView(
|
||||
pht('Installed Versions'),
|
||||
$versions);
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Setup Issues'))
|
||||
->setHref($this->getApplicationURI('issue/'))
|
||||
->setImageIcon('fa-exclamation-triangle')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Show unresolved issues with setup and configuration.')));
|
||||
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Services'))
|
||||
->setHref($this->getApplicationURI('cluster/databases/'))
|
||||
->setImageIcon('fa-server')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'View status information for databases, caches, repositories, '.
|
||||
'and other services.')));
|
||||
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Extensions/Modules'))
|
||||
->setHref($this->getApplicationURI('module/'))
|
||||
->setImageIcon('fa-gear')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Show installed extensions and modules.')));
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->addTextCrumb(pht('Console'))
|
||||
->setBorder(true);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($view);
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Phabricator Configuation'))
|
||||
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
|
||||
->setObjectList($menu);
|
||||
|
||||
$versions = $this->newLibraryVersionTable($viewer);
|
||||
$binary_versions = $this->newBinaryVersionTable();
|
||||
|
||||
$launcher_view = id(new PHUILauncherView())
|
||||
->appendChild($box)
|
||||
->appendChild($versions)
|
||||
->appendChild($binary_versions);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setFooter($launcher_view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setTitle(pht('Phabricator Configuation'))
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($content);
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
public function renderModuleStatus($viewer) {
|
||||
public function newLibraryVersionTable() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$versions = $this->loadVersions($viewer);
|
||||
|
||||
$version_property_list = id(new PHUIPropertyListView());
|
||||
$rows = array();
|
||||
foreach ($versions as $name => $info) {
|
||||
$version = $info['version'];
|
||||
|
||||
if ($info['branchpoint']) {
|
||||
$display = pht(
|
||||
'%s (branched from %s on %s)',
|
||||
$version,
|
||||
$info['branchpoint'],
|
||||
$info['upstream']);
|
||||
$branchpoint = $info['branchpoint'];
|
||||
if (strlen($branchpoint)) {
|
||||
$branchpoint = substr($branchpoint, 0, 12);
|
||||
} else {
|
||||
$display = $version;
|
||||
$branchpoint = null;
|
||||
}
|
||||
|
||||
$version_property_list->addProperty($name, $display);
|
||||
}
|
||||
|
||||
$phabricator_root = dirname(phutil_get_library_root('phabricator'));
|
||||
$version_path = $phabricator_root.'/conf/local/VERSION';
|
||||
if (Filesystem::pathExists($version_path)) {
|
||||
$version_from_file = Filesystem::readFile($version_path);
|
||||
$version_property_list->addProperty(
|
||||
pht('Local Version'),
|
||||
$version_from_file);
|
||||
}
|
||||
|
||||
$version_property_list->addProperty('php', phpversion());
|
||||
|
||||
$binaries = PhutilBinaryAnalyzer::getAllBinaries();
|
||||
foreach ($binaries as $binary) {
|
||||
if (!$binary->isBinaryAvailable()) {
|
||||
$binary_info = pht('Not Available');
|
||||
$version = $info['hash'];
|
||||
if (strlen($version)) {
|
||||
$version = substr($version, 0, 12);
|
||||
} else {
|
||||
$version = $binary->getBinaryVersion();
|
||||
$path = $binary->getBinaryPath();
|
||||
if ($path === null && $version === null) {
|
||||
$binary_info = pht('-');
|
||||
} else if ($path === null) {
|
||||
$binary_info = $version;
|
||||
} else if ($version === null) {
|
||||
$binary_info = pht('- at %s', $path);
|
||||
} else {
|
||||
$binary_info = pht('%s at %s', $version, $path);
|
||||
}
|
||||
$version = pht('Unknown');
|
||||
}
|
||||
|
||||
$version_property_list->addProperty(
|
||||
$binary->getBinaryName(),
|
||||
$binary_info);
|
||||
|
||||
$epoch = $info['epoch'];
|
||||
if ($epoch) {
|
||||
$epoch = phabricator_date($epoch, $viewer);
|
||||
} else {
|
||||
$epoch = null;
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
$name,
|
||||
$version,
|
||||
$epoch,
|
||||
$branchpoint,
|
||||
);
|
||||
}
|
||||
|
||||
return $version_property_list;
|
||||
$table_view = id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Library'),
|
||||
pht('Version'),
|
||||
pht('Date'),
|
||||
pht('Branchpoint'),
|
||||
))
|
||||
->setColumnClasses(
|
||||
array(
|
||||
'pri',
|
||||
null,
|
||||
null,
|
||||
'wide',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Phabricator Version Information'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->appendChild($table_view);
|
||||
}
|
||||
|
||||
private function loadVersions(PhabricatorUser $viewer) {
|
||||
$specs = array(
|
||||
'phabricator',
|
||||
'arcanist',
|
||||
'phutil',
|
||||
);
|
||||
|
||||
$all_libraries = PhutilBootloader::getInstance()->getAllLibraries();
|
||||
@@ -207,13 +253,14 @@ final class PhabricatorConfigVersionController
|
||||
list($err, $stdout) = $future->resolve();
|
||||
if (!$err) {
|
||||
list($hash, $epoch) = explode(' ', $stdout);
|
||||
$version = pht('%s (%s)', $hash, phabricator_date($epoch, $viewer));
|
||||
} else {
|
||||
$version = pht('Unknown');
|
||||
$hash = null;
|
||||
$epoch = null;
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'version' => $version,
|
||||
'hash' => $hash,
|
||||
'epoch' => $epoch,
|
||||
'upstream' => null,
|
||||
'branchpoint' => null,
|
||||
);
|
||||
@@ -239,4 +286,51 @@ final class PhabricatorConfigVersionController
|
||||
return $results;
|
||||
}
|
||||
|
||||
private function newBinaryVersionTable() {
|
||||
$rows = array();
|
||||
|
||||
$rows[] = array(
|
||||
'php',
|
||||
phpversion(),
|
||||
php_sapi_name(),
|
||||
);
|
||||
|
||||
$binaries = PhutilBinaryAnalyzer::getAllBinaries();
|
||||
foreach ($binaries as $binary) {
|
||||
if (!$binary->isBinaryAvailable()) {
|
||||
$binary_version = pht('Not Available');
|
||||
$binary_path = null;
|
||||
} else {
|
||||
$binary_version = $binary->getBinaryVersion();
|
||||
$binary_path = $binary->getBinaryPath();
|
||||
}
|
||||
|
||||
$rows[] = array(
|
||||
$binary->getBinaryName(),
|
||||
$binary_version,
|
||||
$binary_path,
|
||||
);
|
||||
}
|
||||
|
||||
$table_view = id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Binary'),
|
||||
pht('Version'),
|
||||
pht('Path'),
|
||||
))
|
||||
->setColumnClasses(
|
||||
array(
|
||||
'pri',
|
||||
null,
|
||||
'wide',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Other Version Information'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->appendChild($table_view);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -6,57 +6,6 @@ abstract class PhabricatorConfigController extends PhabricatorController {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function buildSideNavView($filter = null, $for_app = false) {
|
||||
$guide_href = new PhutilURI('/guides/');
|
||||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
$nav->addFilter('/',
|
||||
pht('Core Settings'), null, 'fa-gear');
|
||||
$nav->addFilter('application/',
|
||||
pht('Application Settings'), null, 'fa-globe');
|
||||
$nav->addFilter('history/',
|
||||
pht('Settings History'), null, 'fa-history');
|
||||
$nav->addFilter('version/',
|
||||
pht('Version Information'), null, 'fa-download');
|
||||
$nav->addFilter('all/',
|
||||
pht('All Settings'), null, 'fa-list-ul');
|
||||
$nav->addLabel(pht('Setup'));
|
||||
$nav->addFilter('issue/',
|
||||
pht('Setup Issues'), null, 'fa-warning');
|
||||
$nav->addFilter(null,
|
||||
pht('Installation Guide'), $guide_href, 'fa-book');
|
||||
$nav->addLabel(pht('Database'));
|
||||
$nav->addFilter('database/',
|
||||
pht('Database Status'), null, 'fa-heartbeat');
|
||||
$nav->addFilter('dbissue/',
|
||||
pht('Database Issues'), null, 'fa-exclamation-circle');
|
||||
$nav->addLabel(pht('Cache'));
|
||||
$nav->addFilter('cache/',
|
||||
pht('Cache Status'), null, 'fa-home');
|
||||
$nav->addLabel(pht('Cluster'));
|
||||
$nav->addFilter('cluster/databases/',
|
||||
pht('Database Servers'), null, 'fa-database');
|
||||
$nav->addFilter('cluster/notifications/',
|
||||
pht('Notification Servers'), null, 'fa-bell-o');
|
||||
$nav->addFilter('cluster/repositories/',
|
||||
pht('Repository Servers'), null, 'fa-code');
|
||||
$nav->addFilter('cluster/search/',
|
||||
pht('Search Servers'), null, 'fa-search');
|
||||
$nav->addLabel(pht('Modules'));
|
||||
|
||||
$modules = PhabricatorConfigModule::getAllModules();
|
||||
foreach ($modules as $key => $module) {
|
||||
$nav->addFilter('module/'.$key.'/',
|
||||
$module->getModuleName(), null, 'fa-puzzle-piece');
|
||||
}
|
||||
|
||||
return $nav;
|
||||
}
|
||||
|
||||
public function buildApplicationMenu() {
|
||||
return $this->buildSideNavView(null, true)->getMenu();
|
||||
}
|
||||
|
||||
public function buildHeaderView($text, $action = null) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
|
@@ -1,112 +0,0 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigGroupController
|
||||
extends PhabricatorConfigController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$group_key = $request->getURIData('key');
|
||||
|
||||
$groups = PhabricatorApplicationConfigOptions::loadAll();
|
||||
$options = idx($groups, $group_key);
|
||||
if (!$options) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$group_uri = PhabricatorConfigGroupConstants::getGroupFullURI(
|
||||
$options->getGroup());
|
||||
$group_name = PhabricatorConfigGroupConstants::getGroupShortName(
|
||||
$options->getGroup());
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter($group_uri);
|
||||
|
||||
$title = pht('%s Configuration', $options->getName());
|
||||
$header = $this->buildHeaderView($title);
|
||||
$list = $this->buildOptionList($options->getOptions());
|
||||
$group_url = phutil_tag('a', array('href' => $group_uri), $group_name);
|
||||
|
||||
$box_header = pht("%s \xC2\xBB %s", $group_url, $options->getName());
|
||||
$view = $this->buildConfigBoxView($box_header, $list);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($group_name, $group_uri)
|
||||
->addTextCrumb($options->getName())
|
||||
->setBorder(true);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($content);
|
||||
}
|
||||
|
||||
private function buildOptionList(array $options) {
|
||||
assert_instances_of($options, 'PhabricatorConfigOption');
|
||||
|
||||
require_celerity_resource('config-options-css');
|
||||
|
||||
$db_values = array();
|
||||
if ($options) {
|
||||
$db_values = id(new PhabricatorConfigEntry())->loadAllWhere(
|
||||
'configKey IN (%Ls) AND namespace = %s',
|
||||
mpull($options, 'getKey'),
|
||||
'default');
|
||||
$db_values = mpull($db_values, null, 'getConfigKey');
|
||||
}
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setBig(true);
|
||||
foreach ($options as $option) {
|
||||
$summary = $option->getSummary();
|
||||
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($option->getKey())
|
||||
->setHref('/config/edit/'.$option->getKey().'/')
|
||||
->addAttribute($summary);
|
||||
|
||||
$color = null;
|
||||
$db_value = idx($db_values, $option->getKey());
|
||||
if ($db_value && !$db_value->getIsDeleted()) {
|
||||
$item->setEffect('visited');
|
||||
$color = 'violet';
|
||||
}
|
||||
|
||||
if ($option->getHidden()) {
|
||||
$item->setStatusIcon('fa-eye-slash grey', pht('Hidden'));
|
||||
$item->setDisabled(true);
|
||||
} else if ($option->getLocked()) {
|
||||
$item->setStatusIcon('fa-lock '.$color, pht('Locked'));
|
||||
} else if ($color) {
|
||||
$item->setStatusIcon('fa-pencil '.$color, pht('Editable'));
|
||||
} else {
|
||||
$item->setStatusIcon('fa-pencil-square-o '.$color, pht('Editable'));
|
||||
}
|
||||
|
||||
if (!$option->getHidden()) {
|
||||
$current_value = PhabricatorEnv::getEnvConfig($option->getKey());
|
||||
$current_value = PhabricatorConfigJSON::prettyPrintJSON(
|
||||
$current_value);
|
||||
$current_value = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'config-options-current-value '.$color,
|
||||
),
|
||||
array(
|
||||
$current_value,
|
||||
));
|
||||
|
||||
$item->setSideColumn($current_value);
|
||||
}
|
||||
|
||||
$list->addItem($item);
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigListController
|
||||
extends PhabricatorConfigController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('/');
|
||||
|
||||
$groups = PhabricatorApplicationConfigOptions::loadAll();
|
||||
$core_list = $this->buildConfigOptionsList($groups, 'core');
|
||||
$core_list = $this->buildConfigBoxView(pht('Core'), $core_list);
|
||||
|
||||
$title = pht('Core Settings');
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($core_list);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($content);
|
||||
}
|
||||
|
||||
private function buildConfigOptionsList(array $groups, $type) {
|
||||
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setBig(true);
|
||||
$groups = msort($groups, 'getName');
|
||||
foreach ($groups as $group) {
|
||||
if ($group->getGroup() == $type) {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon($group->getIcon())
|
||||
->setBackground('bg-blue');
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($group->getName())
|
||||
->setHref('/config/group/'.$group->getKey().'/')
|
||||
->addAttribute($group->getDescription())
|
||||
->setImageIcon($icon);
|
||||
$list->addItem($item);
|
||||
}
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
@@ -6,9 +6,6 @@ final class PhabricatorConfigIssueListController
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('issue/');
|
||||
|
||||
$engine = new PhabricatorSetupEngine();
|
||||
$response = $engine->execute();
|
||||
if ($response) {
|
||||
@@ -34,7 +31,6 @@ final class PhabricatorConfigIssueListController
|
||||
'fa-question-circle');
|
||||
|
||||
$title = pht('Setup Issues');
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
if (!$issues) {
|
||||
$issue_list = id(new PHUIInfoView())
|
||||
@@ -50,21 +46,24 @@ final class PhabricatorConfigIssueListController
|
||||
$other,
|
||||
);
|
||||
|
||||
$issue_list = $this->buildConfigBoxView(pht('Issues'), $issue_list);
|
||||
$issue_list = $this->buildConfigBoxView(
|
||||
pht('Unresolved Setup Issues'),
|
||||
$issue_list);
|
||||
}
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
$launcher_view = id(new PHUILauncherView())
|
||||
->appendChild($issue_list);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($issue_list);
|
||||
->setFooter($launcher_view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($content);
|
||||
}
|
||||
|
||||
@@ -76,27 +75,30 @@ final class PhabricatorConfigIssueListController
|
||||
$items = 0;
|
||||
|
||||
foreach ($issues as $issue) {
|
||||
if ($issue->getGroup() == $group) {
|
||||
$items++;
|
||||
$href = $this->getApplicationURI('/issue/'.$issue->getIssueKey().'/');
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($issue->getName())
|
||||
->setHref($href)
|
||||
->addAttribute($issue->getSummary());
|
||||
if (!$issue->getIsIgnored()) {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon($fonticon)
|
||||
->setBackground('bg-sky');
|
||||
$item->setImageIcon($icon);
|
||||
$list->addItem($item);
|
||||
} else {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon('fa-eye-slash')
|
||||
->setBackground('bg-grey');
|
||||
$item->setDisabled(true);
|
||||
$item->setImageIcon($icon);
|
||||
$ignored_items[] = $item;
|
||||
}
|
||||
if ($issue->getGroup() != $group) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$items++;
|
||||
$href = $this->getApplicationURI('/issue/'.$issue->getIssueKey().'/');
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($issue->getName())
|
||||
->setHref($href)
|
||||
->setClickable(true)
|
||||
->addAttribute($issue->getSummary());
|
||||
if (!$issue->getIsIgnored()) {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon($fonticon)
|
||||
->setBackground('bg-sky');
|
||||
$item->setImageIcon($icon);
|
||||
$list->addItem($item);
|
||||
} else {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon('fa-eye-slash')
|
||||
->setBackground('bg-grey');
|
||||
$item->setDisabled(true);
|
||||
$item->setImageIcon($icon);
|
||||
$ignored_items[] = $item;
|
||||
}
|
||||
}
|
||||
|
@@ -14,9 +14,6 @@ final class PhabricatorConfigIssueViewController
|
||||
}
|
||||
$issues = $engine->getIssues();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('issue/');
|
||||
|
||||
if (empty($issues[$issue_key])) {
|
||||
$content = id(new PHUIInfoView())
|
||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
|
||||
@@ -36,23 +33,21 @@ final class PhabricatorConfigIssueViewController
|
||||
$title = $issue->getShortName();
|
||||
}
|
||||
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->setBorder(true)
|
||||
->addTextCrumb(pht('Setup Issues'), $this->getApplicationURI('issue/'))
|
||||
->addTextCrumb($title, $request->getRequestURI())
|
||||
->setBorder(true);
|
||||
|
||||
$launcher_view = id(new PHUILauncherView())
|
||||
->appendChild($content);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($content);
|
||||
->setFooter($launcher_view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($content);
|
||||
}
|
||||
|
@@ -8,6 +8,11 @@ final class PhabricatorConfigModuleController
|
||||
$key = $request->getURIData('module');
|
||||
|
||||
$all_modules = PhabricatorConfigModule::getAllModules();
|
||||
|
||||
if (!strlen($key)) {
|
||||
$key = head_key($all_modules);
|
||||
}
|
||||
|
||||
if (empty($all_modules[$key])) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
@@ -16,13 +21,27 @@ final class PhabricatorConfigModuleController
|
||||
$content = $module->renderModuleStatus($request);
|
||||
$title = $module->getModuleName();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('module/'.$key.'/');
|
||||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
|
||||
$modules_uri = $this->getApplicationURI('module/');
|
||||
|
||||
$modules = PhabricatorConfigModule::getAllModules();
|
||||
|
||||
foreach ($modules as $module_key => $module) {
|
||||
$nav->newLink($module_key)
|
||||
->setName($module->getModuleName())
|
||||
->setHref(urisprintf('%s%s/', $modules_uri, $module_key))
|
||||
->setIcon('fa-puzzle-piece');
|
||||
}
|
||||
|
||||
$nav->selectFilter($key);
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$view = $this->buildConfigBoxView($title, $content);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Extensions/Modules'), $modules_uri)
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
@@ -1,13 +1,11 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigCacheController
|
||||
extends PhabricatorConfigController {
|
||||
extends PhabricatorConfigServicesController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('cache/');
|
||||
|
||||
$purge_button = id(new PHUIButtonView())
|
||||
->setText(pht('Purge Caches'))
|
||||
@@ -27,14 +25,15 @@ final class PhabricatorConfigCacheController
|
||||
$data_box,
|
||||
);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($title);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($page);
|
||||
|
||||
$nav = $this->newNavigation('cache');
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
@@ -92,10 +91,12 @@ final class PhabricatorConfigCacheController
|
||||
'n',
|
||||
'n',
|
||||
));
|
||||
|
||||
$table = $this->buildConfigBoxView(pht('Cache Storage'), $table);
|
||||
}
|
||||
|
||||
$properties = $this->buildConfigBoxView(pht('Data Cache'), $properties);
|
||||
$table = $this->buildConfigBoxView(pht('Cache Storage'), $table);
|
||||
|
||||
return array($properties, $table);
|
||||
}
|
||||
|
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigClusterDatabasesController
|
||||
extends PhabricatorConfigController {
|
||||
extends PhabricatorConfigServicesController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('cluster/databases/');
|
||||
$nav = $this->newNavigation('database-servers');
|
||||
|
||||
$title = pht('Cluster Database Status');
|
||||
$title = pht('Database Servers');
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Databases');
|
||||
$button = id(new PHUIButtonView())
|
||||
->setIcon('fa-book')
|
||||
@@ -20,9 +19,8 @@ final class PhabricatorConfigClusterDatabasesController
|
||||
$database_status = $this->buildClusterDatabaseStatus();
|
||||
$status = $this->buildConfigBoxView(pht('Status'), $database_status);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($title);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
@@ -1,13 +1,10 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigClusterNotificationsController
|
||||
extends PhabricatorConfigController {
|
||||
extends PhabricatorConfigServicesController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('cluster/notifications/');
|
||||
|
||||
$title = pht('Cluster Notifications');
|
||||
$title = pht('Notification Servers');
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Notifications');
|
||||
$button = id(new PHUIButtonView())
|
||||
->setIcon('fa-book')
|
||||
@@ -22,14 +19,15 @@ final class PhabricatorConfigClusterNotificationsController
|
||||
pht('Notifications Status'),
|
||||
$notification_status);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($title);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($status);
|
||||
|
||||
$nav = $this->newNavigation('notification-servers');
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
@@ -1,13 +1,10 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigClusterRepositoriesController
|
||||
extends PhabricatorConfigController {
|
||||
extends PhabricatorConfigServicesController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('cluster/repositories/');
|
||||
|
||||
$title = pht('Cluster Repository Status');
|
||||
$title = pht('Repository Services');
|
||||
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Repositories');
|
||||
$button = id(new PHUIButtonView())
|
||||
@@ -26,9 +23,8 @@ final class PhabricatorConfigClusterRepositoriesController
|
||||
$repo_errors = $this->buildConfigBoxView(
|
||||
pht('Repository Errors'), $repository_errors);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($title);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
@@ -38,6 +34,8 @@ final class PhabricatorConfigClusterRepositoriesController
|
||||
$repo_errors,
|
||||
));
|
||||
|
||||
$nav = $this->newNavigation('repository-servers');
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
@@ -1,13 +1,10 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigClusterSearchController
|
||||
extends PhabricatorConfigController {
|
||||
extends PhabricatorConfigServicesController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('cluster/search/');
|
||||
|
||||
$title = pht('Cluster Search');
|
||||
$title = pht('Search Servers');
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Search');
|
||||
|
||||
$button = id(new PHUIButtonView())
|
||||
@@ -20,14 +17,15 @@ final class PhabricatorConfigClusterSearchController
|
||||
|
||||
$search_status = $this->buildClusterSearchStatus();
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($title);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($search_status);
|
||||
|
||||
$nav = $this->newNavigation('search-servers');
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
abstract class PhabricatorConfigDatabaseController
|
||||
extends PhabricatorConfigController {
|
||||
extends PhabricatorConfigServicesController {
|
||||
|
||||
protected function renderIcon($status) {
|
||||
switch ($status) {
|
@@ -153,15 +153,14 @@ final class PhabricatorConfigDatabaseIssueController
|
||||
new PhutilNumber($counts[PhabricatorConfigStorageSchema::STATUS_WARN]));
|
||||
}
|
||||
|
||||
$title = pht('Database Issues');
|
||||
$title = pht('Schemata Issues');
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('dbissue/');
|
||||
$nav = $this->newNavigation('schemata-issues');
|
||||
|
||||
$view = $this->buildConfigBoxView(pht('Issues'), $table);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
@@ -71,8 +71,7 @@ final class PhabricatorConfigDatabaseStatusController
|
||||
}
|
||||
|
||||
private function buildResponse($title, $body) {
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('database/');
|
||||
$nav = $this->newNavigation('schemata');
|
||||
|
||||
if (!$title) {
|
||||
$title = pht('Database Status');
|
||||
@@ -118,8 +117,7 @@ final class PhabricatorConfigDatabaseStatusController
|
||||
);
|
||||
}
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setBorder(true);
|
||||
$crumbs = $this->newCrumbs();
|
||||
|
||||
$last_key = last_key($links);
|
||||
foreach ($links as $link_key => $link) {
|
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
abstract class PhabricatorConfigServicesController
|
||||
extends PhabricatorConfigController {
|
||||
|
||||
public function newNavigation($select_filter) {
|
||||
$services_uri = $this->getApplicationURI();
|
||||
|
||||
$nav = id(new AphrontSideNavFilterView())
|
||||
->setBaseURI(new PhutilURI($services_uri));
|
||||
|
||||
$nav->addLabel(pht('Databases'));
|
||||
|
||||
$nav->newLink('database-servers')
|
||||
->setName(pht('Database Servers'))
|
||||
->setIcon('fa-database')
|
||||
->setHref(urisprintf('%s%s/', $services_uri, 'cluster/databases'));
|
||||
|
||||
$nav->newLink('schemata')
|
||||
->setName(pht('Database Schemata'))
|
||||
->setIcon('fa-table')
|
||||
->setHref(urisprintf('%s%s/', $services_uri, 'database'));
|
||||
|
||||
$nav->newLink('schemata-issues')
|
||||
->setName(pht('Schemata Issues'))
|
||||
->setIcon('fa-exclamation-circle')
|
||||
->setHref(urisprintf('%s%s/', $services_uri, 'dbissue'));
|
||||
|
||||
|
||||
$nav->addLabel(pht('Cache'));
|
||||
|
||||
$nav->newLink('cache')
|
||||
->setName(pht('Cache Status'))
|
||||
->setIcon('fa-archive')
|
||||
->setHref(urisprintf('%s%s/', $services_uri, 'cache'));
|
||||
|
||||
$nav->addLabel(pht('Other Services'));
|
||||
|
||||
$nav->newLink('notification-servers')
|
||||
->setName(pht('Notification Servers'))
|
||||
->setIcon('fa-bell-o')
|
||||
->setHref(urisprintf('%s%s/', $services_uri, 'cluster/notifications'));
|
||||
|
||||
$nav->newLink('repository-servers')
|
||||
->setName(pht('Repository Servers'))
|
||||
->setIcon('fa-code')
|
||||
->setHref(urisprintf('%s%s/', $services_uri, 'cluster/repositories'));
|
||||
|
||||
$nav->newLink('search-servers')
|
||||
->setName(pht('Search Servers'))
|
||||
->setIcon('fa-search')
|
||||
->setHref(urisprintf('%s%s/', $services_uri, 'cluster/search'));
|
||||
|
||||
if ($select_filter) {
|
||||
$nav->selectFilter($select_filter);
|
||||
}
|
||||
|
||||
return $nav;
|
||||
}
|
||||
|
||||
public function newCrumbs() {
|
||||
$services_uri = $this->getApplicationURI('cluster/databases/');
|
||||
|
||||
return $this->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Services'))
|
||||
->setBorder(true);
|
||||
}
|
||||
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigEditController
|
||||
extends PhabricatorConfigController {
|
||||
extends PhabricatorConfigSettingsController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
@@ -30,11 +30,9 @@ final class PhabricatorConfigEditController
|
||||
->setDefault(null)
|
||||
->setDescription($desc);
|
||||
$group = null;
|
||||
$group_uri = $this->getApplicationURI();
|
||||
} else {
|
||||
$option = $options[$key];
|
||||
$group = $option->getGroup();
|
||||
$group_uri = $this->getApplicationURI('group/'.$group->getKey().'/');
|
||||
}
|
||||
|
||||
$issue = $request->getStr('issue');
|
||||
@@ -42,7 +40,7 @@ final class PhabricatorConfigEditController
|
||||
// If the user came here from an open setup issue, send them back.
|
||||
$done_uri = $this->getApplicationURI('issue/'.$issue.'/');
|
||||
} else {
|
||||
$done_uri = $group_uri;
|
||||
$done_uri = $this->getApplicationURI('settings/');
|
||||
}
|
||||
|
||||
// Check if the config key is already stored in the database.
|
||||
@@ -205,23 +203,10 @@ final class PhabricatorConfigEditController
|
||||
$title = $key;
|
||||
|
||||
$box_header = array();
|
||||
if ($group) {
|
||||
$box_header[] = phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $group_uri,
|
||||
),
|
||||
$group->getName());
|
||||
$box_header[] = " \xC2\xBB ";
|
||||
}
|
||||
$box_header[] = $key;
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
if ($group) {
|
||||
$crumbs->addTextCrumb($group->getName(), $group_uri);
|
||||
}
|
||||
$crumbs->addTextCrumb($key, '/config/edit/'.$key);
|
||||
$crumbs->setBorder(true);
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($key, '/config/edit/'.$key);
|
||||
|
||||
$form_box = $this->buildConfigBoxView($box_header, $form, $tag);
|
||||
|
||||
@@ -230,9 +215,6 @@ final class PhabricatorConfigEditController
|
||||
new PhabricatorConfigTransactionQuery());
|
||||
$timeline->setShouldTerminate(true);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter($group_uri);
|
||||
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
@@ -249,7 +231,6 @@ final class PhabricatorConfigEditController
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
abstract class PhabricatorConfigSettingsController
|
||||
extends PhabricatorConfigController {
|
||||
|
||||
public function newNavigation($select_filter) {
|
||||
$settings_uri = $this->getApplicationURI('settings/');
|
||||
|
||||
$nav = id(new AphrontSideNavFilterView())
|
||||
->setBaseURI(new PhutilURI($settings_uri));
|
||||
|
||||
$nav->addLabel(pht('Configuration'));
|
||||
|
||||
$nav->newLink('settings')
|
||||
->setName(pht('Core Settings'))
|
||||
->setIcon('fa-wrench')
|
||||
->setHref($settings_uri);
|
||||
|
||||
$nav->newLink('advanced')
|
||||
->setName(pht('Advanced Settings'))
|
||||
->setIcon('fa-cogs')
|
||||
->setHref(urisprintf('%s%s/', $settings_uri, 'advanced'));
|
||||
|
||||
$nav->newLink('all')
|
||||
->setName(pht('All Settings'))
|
||||
->setIcon('fa-list')
|
||||
->setHref(urisprintf('%s%s/', $settings_uri, 'all'));
|
||||
|
||||
$nav->addLabel(pht('History'));
|
||||
|
||||
$nav->newLink('history')
|
||||
->setName(pht('View History'))
|
||||
->setIcon('fa-history')
|
||||
->setHref(urisprintf('%s%s/', $settings_uri, 'history'));
|
||||
|
||||
if ($select_filter) {
|
||||
$nav->selectFilter($select_filter);
|
||||
}
|
||||
|
||||
return $nav;
|
||||
}
|
||||
|
||||
public function newCrumbs() {
|
||||
$settings_uri = $this->getApplicationURI('settings/');
|
||||
|
||||
return $this->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Settings'), $settings_uri)
|
||||
->setBorder(true);
|
||||
}
|
||||
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigHistoryController
|
||||
extends PhabricatorConfigController {
|
||||
final class PhabricatorConfigSettingsHistoryController
|
||||
extends PhabricatorConfigSettingsController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
@@ -27,12 +27,10 @@ final class PhabricatorConfigHistoryController
|
||||
$title = pht('Settings History');
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('history/');
|
||||
$nav = $this->newNavigation('history');
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($title);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
final class PhabricatorConfigSettingsListController
|
||||
extends PhabricatorConfigSettingsController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$filter = $request->getURIData('filter');
|
||||
if (!strlen($filter)) {
|
||||
$filter = 'settings';
|
||||
}
|
||||
|
||||
$is_core = ($filter === 'settings');
|
||||
$is_advanced = ($filter === 'advanced');
|
||||
$is_all = ($filter === 'all');
|
||||
|
||||
$show_core = ($is_core || $is_all);
|
||||
$show_advanced = ($is_advanced || $is_all);
|
||||
|
||||
if ($is_core) {
|
||||
$title = pht('Core Settings');
|
||||
} else if ($is_advanced) {
|
||||
$title = pht('Advanced Settings');
|
||||
} else {
|
||||
$title = pht('All Settings');
|
||||
}
|
||||
|
||||
$db_values = id(new PhabricatorConfigEntry())
|
||||
->loadAllWhere('namespace = %s', 'default');
|
||||
$db_values = mpull($db_values, null, 'getConfigKey');
|
||||
|
||||
$list = id(new PHUIObjectItemListView())
|
||||
->setBig(true)
|
||||
->setFlush(true);
|
||||
|
||||
$rows = array();
|
||||
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
|
||||
ksort($options);
|
||||
foreach ($options as $option) {
|
||||
$key = $option->getKey();
|
||||
|
||||
$is_advanced = (bool)$option->getLocked();
|
||||
if ($is_advanced && !$show_advanced) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$is_advanced && !$show_core) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$db_value = idx($db_values, $key);
|
||||
|
||||
$item = $this->newConfigOptionView($option, $db_value);
|
||||
$list->addItem($item);
|
||||
}
|
||||
|
||||
$header = $this->buildHeaderView($title);
|
||||
|
||||
$crumbs = $this->newCrumbs()
|
||||
->addTextCrumb($title);
|
||||
|
||||
$content = id(new PHUITwoColumnView())
|
||||
->setHeader($header)
|
||||
->setFooter($list);
|
||||
|
||||
$nav = $this->newNavigation($filter);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->appendChild($content);
|
||||
}
|
||||
|
||||
private function newConfigOptionView(
|
||||
PhabricatorConfigOption $option,
|
||||
PhabricatorConfigEntry $stored_value = null) {
|
||||
|
||||
$summary = $option->getSummary();
|
||||
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($option->getKey())
|
||||
->setClickable(true)
|
||||
->setHref('/config/edit/'.$option->getKey().'/')
|
||||
->addAttribute($summary);
|
||||
|
||||
$color = null;
|
||||
if ($stored_value && !$stored_value->getIsDeleted()) {
|
||||
$item->setEffect('visited');
|
||||
$color = 'violet';
|
||||
}
|
||||
|
||||
if ($option->getHidden()) {
|
||||
$item->setStatusIcon('fa-eye-slash', pht('Hidden'));
|
||||
} else if ($option->getLocked()) {
|
||||
$item->setStatusIcon('fa-lock '.$color, pht('Locked'));
|
||||
} else if ($color) {
|
||||
$item->setStatusIcon('fa-pencil '.$color, pht('Editable'));
|
||||
} else {
|
||||
$item->setStatusIcon('fa-circle-o grey', pht('Default'));
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
}
|
@@ -210,6 +210,9 @@ EOTEXT
|
||||
// This isn't a standard handler installed by an application, but
|
||||
// is a reasonable name for a user-installed handler.
|
||||
'editor' => true,
|
||||
|
||||
// This handler is for Visual Studio Code.
|
||||
'vscode' => true,
|
||||
))
|
||||
->setSummary(pht('Whitelists editor protocols for "Open in Editor".'))
|
||||
->setDescription(
|
||||
|
@@ -42,8 +42,6 @@ final class PhabricatorCountdownApplication extends PhabricatorApplication {
|
||||
'/countdown/' => array(
|
||||
'(?:query/(?P<queryKey>[^/]+)/)?'
|
||||
=> 'PhabricatorCountdownListController',
|
||||
'comment/(?P<id>[1-9]\d*)/'
|
||||
=> 'PhabricatorCountdownCommentController',
|
||||
$this->getEditRoutePattern('edit/')
|
||||
=> 'PhabricatorCountdownEditController',
|
||||
),
|
||||
|
@@ -59,9 +59,11 @@ final class PhabricatorDashboardConsoleController
|
||||
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
|
||||
->setObjectList($menu);
|
||||
|
||||
$launch_view = id(new PHUILauncherView())
|
||||
->appendChild($box);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setFixed(true)
|
||||
->setFooter($box);
|
||||
->setFooter($launch_view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
|
@@ -76,11 +76,7 @@ final class PhabricatorDifferentialApplication
|
||||
=> 'DifferentialRevisionInlinesController',
|
||||
),
|
||||
'comment/' => array(
|
||||
'preview/(?P<id>[1-9]\d*)/' => 'DifferentialCommentPreviewController',
|
||||
'save/(?P<id>[1-9]\d*)/' => 'DifferentialCommentSaveController',
|
||||
'inline/' => array(
|
||||
'preview/(?P<id>[1-9]\d*)/'
|
||||
=> 'DifferentialInlineCommentPreviewController',
|
||||
'edit/(?P<id>[1-9]\d*)/'
|
||||
=> 'DifferentialInlineCommentEditController',
|
||||
),
|
||||
|
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
final class DifferentialRevisionAuthorPackagesHeraldField
|
||||
extends DifferentialRevisionHeraldField {
|
||||
|
||||
const FIELDCONST = 'differential.revision.author.packages';
|
||||
|
||||
public function getHeraldFieldName() {
|
||||
return pht("Author's packages");
|
||||
}
|
||||
|
||||
public function getHeraldFieldValue($object) {
|
||||
$adapter = $this->getAdapter();
|
||||
$viewer = $adapter->getViewer();
|
||||
|
||||
$packages = id(new PhabricatorOwnersPackageQuery())
|
||||
->setViewer($viewer)
|
||||
->withAuthorityPHIDs(array($object->getAuthorPHID()))
|
||||
->execute();
|
||||
|
||||
return mpull($packages, 'getPHID');
|
||||
}
|
||||
|
||||
protected function getHeraldFieldStandardType() {
|
||||
return self::STANDARD_PHID_LIST;
|
||||
}
|
||||
|
||||
protected function getDatasource() {
|
||||
return new PhabricatorOwnersPackageDatasource();
|
||||
}
|
||||
|
||||
}
|
@@ -592,7 +592,7 @@ final class DifferentialChangesetParser extends Phobject {
|
||||
$result = $text;
|
||||
|
||||
if (isset($intra[$key])) {
|
||||
$result = ArcanistDiffUtils::applyIntralineDiff(
|
||||
$result = PhabricatorDifferenceEngine::applyIntralineDiff(
|
||||
$result,
|
||||
$intra[$key]);
|
||||
}
|
||||
|
@@ -354,6 +354,69 @@ final class DifferentialHunkParser extends Phobject {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function generateVisibleBlocksMask($lines_context) {
|
||||
|
||||
// See T13468. This is similar to "generateVisibleLinesMask()", but
|
||||
// attempts to work around a series of bugs which cancel each other
|
||||
// out but make a mess of the intermediate steps.
|
||||
|
||||
$old = $this->getOldLines();
|
||||
$new = $this->getNewLines();
|
||||
|
||||
$length = max(count($old), count($new));
|
||||
|
||||
$visible_lines = array();
|
||||
for ($ii = 0; $ii < $length; $ii++) {
|
||||
$old_visible = (isset($old[$ii]) && $old[$ii]['type']);
|
||||
$new_visible = (isset($new[$ii]) && $new[$ii]['type']);
|
||||
|
||||
$visible_lines[$ii] = ($old_visible || $new_visible);
|
||||
}
|
||||
|
||||
$mask = array();
|
||||
$reveal_cursor = -1;
|
||||
for ($ii = 0; $ii < $length; $ii++) {
|
||||
|
||||
// If this line isn't visible, it isn't going to reveal anything.
|
||||
if (!$visible_lines[$ii]) {
|
||||
|
||||
// If it hasn't been revealed by a nearby line, mark it as masked.
|
||||
if (empty($mask[$ii])) {
|
||||
$mask[$ii] = false;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// If this line is visible, reveal all the lines nearby.
|
||||
|
||||
// First, compute the minimum and maximum offsets we want to reveal.
|
||||
$min_reveal = max($ii - $lines_context, 0);
|
||||
$max_reveal = min($ii + $lines_context, $length - 1);
|
||||
|
||||
// Naively, we'd do more work than necessary when revealing context for
|
||||
// several adjacent visible lines: we would mark all the overlapping
|
||||
// lines as revealed several times.
|
||||
|
||||
// To avoid duplicating work, keep track of the largest line we've
|
||||
// revealed to. Since we reveal context by marking every consecutive
|
||||
// line, we don't need to touch any line above it.
|
||||
$min_reveal = max($min_reveal, $reveal_cursor);
|
||||
|
||||
// Reveal the remaining unrevealed lines.
|
||||
for ($jj = $min_reveal; $jj <= $max_reveal; $jj++) {
|
||||
$mask[$jj] = true;
|
||||
}
|
||||
|
||||
// Move the cursor to the next line which may still need to be revealed.
|
||||
$reveal_cursor = $max_reveal + 1;
|
||||
}
|
||||
|
||||
$this->setVisibleLinesMask($mask);
|
||||
|
||||
return $mask;
|
||||
}
|
||||
|
||||
public function generateVisibleLinesMask($lines_context) {
|
||||
$old = $this->getOldLines();
|
||||
$new = $this->getNewLines();
|
||||
@@ -361,6 +424,7 @@ final class DifferentialHunkParser extends Phobject {
|
||||
$visible = false;
|
||||
$last = 0;
|
||||
$mask = array();
|
||||
|
||||
for ($cursor = -$lines_context; $cursor < $max_length; $cursor++) {
|
||||
$offset = $cursor + $lines_context;
|
||||
if ((isset($old[$offset]) && $old[$offset]['type']) ||
|
||||
|
@@ -73,13 +73,8 @@ final class DifferentialRevision extends DifferentialDAO
|
||||
$view_policy = $app->getPolicy(
|
||||
DifferentialDefaultViewCapability::CAPABILITY);
|
||||
|
||||
if (PhabricatorEnv::getEnvConfig('phabricator.show-prototypes')) {
|
||||
$initial_state = DifferentialRevisionStatus::DRAFT;
|
||||
$should_broadcast = false;
|
||||
} else {
|
||||
$initial_state = DifferentialRevisionStatus::NEEDS_REVIEW;
|
||||
$should_broadcast = true;
|
||||
}
|
||||
$initial_state = DifferentialRevisionStatus::DRAFT;
|
||||
$should_broadcast = false;
|
||||
|
||||
return id(new DifferentialRevision())
|
||||
->setViewPolicy($view_policy)
|
||||
|
@@ -38,6 +38,14 @@ final class DifferentialRevisionInlineTransaction
|
||||
$changeset = $data[$comment->getChangesetID()];
|
||||
$diff = $changeset->getDiff();
|
||||
|
||||
$is_done = false;
|
||||
switch ($comment->getFixedState()) {
|
||||
case PhabricatorInlineCommentInterface::STATE_DONE:
|
||||
case PhabricatorInlineCommentInterface::STATE_UNDRAFT:
|
||||
$is_done = true;
|
||||
break;
|
||||
}
|
||||
|
||||
return array(
|
||||
'diff' => array(
|
||||
'id' => (int)$diff->getID(),
|
||||
@@ -47,6 +55,7 @@ final class DifferentialRevisionInlineTransaction
|
||||
'line' => (int)$comment->getLineNumber(),
|
||||
'length' => (int)($comment->getLineLength() + 1),
|
||||
'replyToCommentPHID' => $comment->getReplyToCommentPHID(),
|
||||
'isDone' => $is_done,
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -128,6 +128,8 @@ final class DiffusionBranchQueryConduitAPIMethod
|
||||
$refs = array_slice($refs, 0, $limit);
|
||||
}
|
||||
|
||||
$refs = array_values($refs);
|
||||
|
||||
return mpull($refs, 'toDictionary');
|
||||
}
|
||||
|
||||
|
@@ -78,14 +78,16 @@ final class DiffusionRepositoryEditController
|
||||
->addClass('diffusion-create-repo')
|
||||
->appendChild($layout);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setFixed(true)
|
||||
->setFooter(
|
||||
$launcher_view = id(new PHUILauncherView())
|
||||
->appendChild(
|
||||
array(
|
||||
$layout,
|
||||
$hints,
|
||||
));
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setFooter($launcher_view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
|
@@ -10,7 +10,7 @@ final class DiffusionCommitAuthorHeraldField
|
||||
}
|
||||
|
||||
public function getHeraldFieldValue($object) {
|
||||
return $object->getCommitData()->getCommitDetail('authorPHID');
|
||||
return $this->getAdapter()->getAuthorPHID();
|
||||
}
|
||||
|
||||
protected function getHeraldFieldStandardType() {
|
||||
|
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
final class DiffusionCommitAuthorPackagesHeraldField
|
||||
extends DiffusionCommitHeraldField {
|
||||
|
||||
const FIELDCONST = 'diffusion.commit.author.packages';
|
||||
|
||||
public function getHeraldFieldName() {
|
||||
return pht("Author's packages");
|
||||
}
|
||||
|
||||
public function getHeraldFieldValue($object) {
|
||||
$adapter = $this->getAdapter();
|
||||
$viewer = $adapter->getViewer();
|
||||
|
||||
$author_phid = $adapter->getAuthorPHID();
|
||||
if (!$author_phid) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$packages = id(new PhabricatorOwnersPackageQuery())
|
||||
->setViewer($viewer)
|
||||
->withAuthorityPHIDs(array($author_phid))
|
||||
->execute();
|
||||
|
||||
return mpull($packages, 'getPHID');
|
||||
}
|
||||
|
||||
protected function getHeraldFieldStandardType() {
|
||||
return self::STANDARD_PHID_LIST;
|
||||
}
|
||||
|
||||
protected function getDatasource() {
|
||||
return new PhabricatorOwnersPackageDatasource();
|
||||
}
|
||||
|
||||
}
|
@@ -11,17 +11,16 @@ final class DiffusionCommitAuthorProjectsHeraldField
|
||||
|
||||
public function getHeraldFieldValue($object) {
|
||||
$adapter = $this->getAdapter();
|
||||
$viewer = $adapter->getViewer();
|
||||
|
||||
$phid = $object->getCommitData()->getCommitDetail('authorPHID');
|
||||
if (!$phid) {
|
||||
$author_phid = $adapter->getAuthorPHID();
|
||||
if (!$author_phid) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$viewer = $adapter->getViewer();
|
||||
|
||||
$projects = id(new PhabricatorProjectQuery())
|
||||
->setViewer($viewer)
|
||||
->withMemberPHIDs(array($phid))
|
||||
->withMemberPHIDs(array($author_phid))
|
||||
->execute();
|
||||
|
||||
return mpull($projects, 'getPHID');
|
||||
|
@@ -10,7 +10,7 @@ final class DiffusionCommitCommitterHeraldField
|
||||
}
|
||||
|
||||
public function getHeraldFieldValue($object) {
|
||||
return $object->getCommitData()->getCommitDetail('committerPHID');
|
||||
return $this->getAdapter()->getCommitterPHID();
|
||||
}
|
||||
|
||||
protected function getHeraldFieldStandardType() {
|
||||
|
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
final class DiffusionCommitCommitterPackagesHeraldField
|
||||
extends DiffusionCommitHeraldField {
|
||||
|
||||
const FIELDCONST = 'diffusion.commit.committer.packages';
|
||||
|
||||
public function getHeraldFieldName() {
|
||||
return pht("Committer's packages");
|
||||
}
|
||||
|
||||
public function getHeraldFieldValue($object) {
|
||||
$adapter = $this->getAdapter();
|
||||
$viewer = $adapter->getViewer();
|
||||
|
||||
$committer_phid = $adapter->getAuthorPHID();
|
||||
if (!$committer_phid) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$packages = id(new PhabricatorOwnersPackageQuery())
|
||||
->setViewer($viewer)
|
||||
->withAuthorityPHIDs(array($committer_phid))
|
||||
->execute();
|
||||
|
||||
return mpull($packages, 'getPHID');
|
||||
}
|
||||
|
||||
protected function getHeraldFieldStandardType() {
|
||||
return self::STANDARD_PHID_LIST;
|
||||
}
|
||||
|
||||
protected function getDatasource() {
|
||||
return new PhabricatorOwnersPackageDatasource();
|
||||
}
|
||||
|
||||
}
|
@@ -11,17 +11,16 @@ final class DiffusionCommitCommitterProjectsHeraldField
|
||||
|
||||
public function getHeraldFieldValue($object) {
|
||||
$adapter = $this->getAdapter();
|
||||
$viewer = $adapter->getViewer();
|
||||
|
||||
$phid = $object->getCommitData()->getCommitDetail('committerPHID');
|
||||
if (!$phid) {
|
||||
$committer_phid = $adapter->getCommitterPHID();
|
||||
if (!$committer_phid) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$viewer = $adapter->getViewer();
|
||||
|
||||
$projects = id(new PhabricatorProjectQuery())
|
||||
->setViewer($viewer)
|
||||
->withMemberPHIDs(array($phid))
|
||||
->withMemberPHIDs(array($committer_phid))
|
||||
->execute();
|
||||
|
||||
return mpull($projects, 'getPHID');
|
||||
|
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
final class DiffusionPreCommitContentAuthorPackagesHeraldField
|
||||
extends DiffusionPreCommitContentHeraldField {
|
||||
|
||||
const FIELDCONST = 'diffusion.pre.commit.author.packages';
|
||||
|
||||
public function getHeraldFieldName() {
|
||||
return pht("Author's packages");
|
||||
}
|
||||
|
||||
public function getHeraldFieldValue($object) {
|
||||
$adapter = $this->getAdapter();
|
||||
$viewer = $adapter->getViewer();
|
||||
|
||||
$author_phid = $adapter->getAuthorPHID();
|
||||
if (!$author_phid) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$packages = id(new PhabricatorOwnersPackageQuery())
|
||||
->setViewer($viewer)
|
||||
->withAuthorityPHIDs(array($author_phid))
|
||||
->execute();
|
||||
|
||||
return mpull($packages, 'getPHID');
|
||||
}
|
||||
|
||||
protected function getHeraldFieldStandardType() {
|
||||
return self::STANDARD_PHID_LIST;
|
||||
}
|
||||
|
||||
protected function getDatasource() {
|
||||
return new PhabricatorOwnersPackageDatasource();
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user