Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/export/format/PhabricatorExcelExportFormat.php
| <?php | <?php | ||||
| final class PhabricatorExcelExportFormat | final class PhabricatorExcelExportFormat | ||||
| extends PhabricatorExportFormat { | extends PhabricatorExportFormat { | ||||
| const EXPORTKEY = 'excel'; | const EXPORTKEY = 'excel'; | ||||
| private $workbook; | private $workbook; | ||||
| private $sheet; | private $sheet; | ||||
| private $rowCursor; | private $rowCursor; | ||||
| public function getExportFormatName() { | public function getExportFormatName() { | ||||
| return pht('Excel (.xlsx)'); | return pht('Excel (.xlsx)'); | ||||
| } | } | ||||
| public function isExportFormatEnabled() { | public function isExportFormatEnabled() { | ||||
| // TODO: PHPExcel has a dependency on the PHP zip extension. We should test | if (!extension_loaded('zip')) { | ||||
| // for that here, since it fatals if we don't have the ZipArchive class. | return false; | ||||
| } | |||||
| return @include_once 'PHPExcel.php'; | return @include_once 'PHPExcel.php'; | ||||
| } | } | ||||
| public function getInstallInstructions() { | public function getInstallInstructions() { | ||||
| if (!extension_loaded('zip')) { | |||||
| return pht(<<<EOHELP | |||||
| Data can not be exported to Excel because the "zip" PHP extension is not | |||||
| installed. Consult the setup issue in the Config application for guidance on | |||||
| installing the extension. | |||||
| EOHELP | |||||
| ); | |||||
| } | |||||
| return pht(<<<EOHELP | return pht(<<<EOHELP | ||||
| Data can not be exported to Excel because the PHPExcel library is not | Data can not be exported to Excel because the PHPExcel library is not | ||||
| installed. This software component is required for Phabricator to create | installed. This software component is required for Phabricator to create | ||||
| Excel files. | Excel files. | ||||
| You can install PHPExcel from GitHub: | You can install PHPExcel from GitHub: | ||||
| > https://github.com/PHPOffice/PHPExcel | > https://github.com/PHPOffice/PHPExcel | ||||
| ▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines | |||||