mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-26 11:10:16 +01:00
Summary: Fixes T13342. This does a few different things, although all of them seem small enough that I didn't bother splitting it up: - Support export of "remarkup" custom fields as text. There's some argument here to export them in some kind of structure if the target is JSON, but it's hard for me to really imagine we'll live in a world some day where we really regret just exporting them as text. - Support export of "date" custom fields as dates. This is easy except that I added `null` support. - If you built PHP from source without "--enable-zip", as I did, you can hit the TODO in Excel exports about "ZipArchive". Since I had a reproduction case, test for "ZipArchive" and give the user a better error if it's missing. - Add a setup check for the "zip" extension to try to avoid getting there in the first place. This is normally part of PHP so I believe users generally won't hit it, I just hit it because I built from source. See also T13232. Test Plan: - Added a custom "date" field. On tasks A and B, set it to null and some non-null value. Exported both tasks to Excel/JSON/text, saw null and a date, respectively. - Added a custom "remarkup" field, exported some values, saw the values in Excel. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13342 Differential Revision: https://secure.phabricator.com/D20658
29 lines
904 B
PHP
29 lines
904 B
PHP
<?php
|
|
|
|
final class PhabricatorZipSetupCheck extends PhabricatorSetupCheck {
|
|
|
|
public function getDefaultGroup() {
|
|
return self::GROUP_OTHER;
|
|
}
|
|
|
|
protected function executeChecks() {
|
|
if (!extension_loaded('zip')) {
|
|
$message = pht(
|
|
'The PHP "zip" extension is not installed. This extension is '.
|
|
'required by certain data export operations, including exporting '.
|
|
'data to Excel.'.
|
|
"\n\n".
|
|
'To clear this setup issue, install the extension and restart your '.
|
|
'webserver.'.
|
|
"\n\n".
|
|
'You may safely ignore this issue if you do not plan to export '.
|
|
'data in Zip archives or Excel spreadsheets, or intend to install '.
|
|
'the extension later.');
|
|
|
|
$this->newIssue('extension.zip')
|
|
->setName(pht('Missing "zip" Extension'))
|
|
->setMessage($message)
|
|
->addPHPExtension('zip');
|
|
}
|
|
}
|
|
}
|