mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-29 19:49:26 +00:00
Convert docs with our migrator
This commit is contained in:
@@ -22,30 +22,30 @@ date_default_timezone_set('Europe/London');
|
||||
/** Include path **/
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||
|
||||
/** PHPExcel_IOFactory */
|
||||
/** \PhpOffice\PhpSpreadsheet\IOFactory */
|
||||
include 'PHPExcel/IOFactory.php';
|
||||
|
||||
$inputFileType = 'Xlsx';
|
||||
$inputFileName = './sampleData/example1.xlsx';
|
||||
|
||||
/* Create a new Reader of the type defined in $inputFileType **/
|
||||
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
|
||||
$objReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
||||
/* Load $inputFileName to a PHPExcel Object **/
|
||||
$objPHPExcel = $objReader->load($inputFileName);
|
||||
$spreadsheet = $objReader->load($inputFileName);
|
||||
|
||||
echo '<hr />';
|
||||
|
||||
/* Read an array list of any custom properties for this document **/
|
||||
$customPropertyList = $objPHPExcel->getProperties()->getCustomProperties();
|
||||
$customPropertyList = $spreadsheet->getProperties()->getCustomProperties();
|
||||
|
||||
echo '<b>Custom Properties: </b><br />';
|
||||
/* Loop through the list of custom properties **/
|
||||
foreach ($customPropertyList as $customPropertyName) {
|
||||
echo '<b>',$customPropertyName,': </b>';
|
||||
/* Retrieve the property value **/
|
||||
$propertyValue = $objPHPExcel->getProperties()->getCustomPropertyValue($customPropertyName);
|
||||
$propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customPropertyName);
|
||||
/* Retrieve the property type **/
|
||||
$propertyType = $objPHPExcel->getProperties()->getCustomPropertyType($customPropertyName);
|
||||
$propertyType = $spreadsheet->getProperties()->getCustomPropertyType($customPropertyName);
|
||||
|
||||
/* Manipulate properties as appropriate for display purposes **/
|
||||
switch ($propertyType) {
|
||||
|
||||
Reference in New Issue
Block a user