diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -5023,6 +5023,7 @@ 'PhabricatorXHProfSampleQuery' => 'applications/xhprof/query/PhabricatorXHProfSampleQuery.php', 'PhabricatorXHProfSampleSearchEngine' => 'applications/xhprof/query/PhabricatorXHProfSampleSearchEngine.php', 'PhabricatorYoutubeRemarkupRule' => 'infrastructure/markup/rule/PhabricatorYoutubeRemarkupRule.php', + 'PhabricatorZipSetupCheck' => 'applications/config/check/PhabricatorZipSetupCheck.php', 'Phame404Response' => 'applications/phame/site/Phame404Response.php', 'PhameBlog' => 'applications/phame/storage/PhameBlog.php', 'PhameBlog404Controller' => 'applications/phame/controller/blog/PhameBlog404Controller.php', @@ -11449,6 +11450,7 @@ 'PhabricatorXHProfSampleQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorXHProfSampleSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorYoutubeRemarkupRule' => 'PhutilRemarkupRule', + 'PhabricatorZipSetupCheck' => 'PhabricatorSetupCheck', 'Phame404Response' => 'AphrontHTMLResponse', 'PhameBlog' => array( 'PhameDAO', diff --git a/src/applications/config/check/PhabricatorZipSetupCheck.php b/src/applications/config/check/PhabricatorZipSetupCheck.php new file mode 100644 --- /dev/null +++ b/src/applications/config/check/PhabricatorZipSetupCheck.php @@ -0,0 +1,29 @@ +newIssue('extension.zip') + ->setName(pht('Missing "zip" Extension')) + ->setMessage($message) + ->addPHPExtension('zip'); + } + } +} diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldDate.php @@ -242,4 +242,8 @@ return new ConduitEpochParameterType(); } + protected function newExportFieldType() { + return new PhabricatorEpochExportField(); + } + } diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldRemarkup.php @@ -107,4 +107,8 @@ return new ConduitStringParameterType(); } + protected function newExportFieldType() { + return new PhabricatorStringExportField(); + } + } diff --git a/src/infrastructure/export/field/PhabricatorEpochExportField.php b/src/infrastructure/export/field/PhabricatorEpochExportField.php --- a/src/infrastructure/export/field/PhabricatorEpochExportField.php +++ b/src/infrastructure/export/field/PhabricatorEpochExportField.php @@ -6,6 +6,10 @@ private $zone; public function getTextValue($value) { + if ($value === null) { + return ''; + } + if (!isset($this->zone)) { $this->zone = new DateTimeZone('UTC'); } @@ -21,12 +25,20 @@ } public function getNaturalValue($value) { + if ($value === null) { + return $value; + } + return (int)$value; } public function getPHPExcelValue($value) { $epoch = $this->getNaturalValue($value); + if ($epoch === null) { + return null; + } + $seconds_per_day = phutil_units('1 day in seconds'); $offset = ($seconds_per_day * 25569); diff --git a/src/infrastructure/export/format/PhabricatorExcelExportFormat.php b/src/infrastructure/export/format/PhabricatorExcelExportFormat.php --- a/src/infrastructure/export/format/PhabricatorExcelExportFormat.php +++ b/src/infrastructure/export/format/PhabricatorExcelExportFormat.php @@ -14,12 +14,23 @@ } public function isExportFormatEnabled() { - // TODO: PHPExcel has a dependency on the PHP zip extension. We should test - // for that here, since it fatals if we don't have the ZipArchive class. + if (!extension_loaded('zip')) { + return false; + } + return @include_once 'PHPExcel.php'; } public function getInstallInstructions() { + if (!extension_loaded('zip')) { + return pht(<<