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() { | ||||
return true; | // 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. | |||||
return @include_once 'PHPExcel.php'; | |||||
} | |||||
public function getInstallInstructions() { | |||||
return pht(<<<EOHELP | |||||
Data can not be exported to Excel because the PHPExcel library is not | |||||
installed. This software component is required for Phabricator to create | |||||
Excel files. | |||||
You can install PHPExcel from GitHub: | |||||
> https://github.com/PHPOffice/PHPExcel | |||||
Briefly: | |||||
- Clone that repository somewhere on the sever | |||||
(like `/path/to/example/PHPExcel`). | |||||
- Update your PHP `%s` setting (in `php.ini`) to include the PHPExcel | |||||
amckinley: This is in `php.ini`, right? Maybe make that explicit? | |||||
`Classes` directory (like `/path/to/example/PHPExcel/Classes`). | |||||
EOHELP | |||||
, | |||||
'include_path'); | |||||
} | } | ||||
public function getFileExtension() { | public function getFileExtension() { | ||||
return 'xlsx'; | return 'xlsx'; | ||||
} | } | ||||
public function getMIMEContentType() { | public function getMIMEContentType() { | ||||
return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; | return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; | ||||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |
This is in php.ini, right? Maybe make that explicit?