mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-28 19:19:27 +00:00
Fix some errors with samples
This commit is contained in:
@@ -30,7 +30,7 @@ error_reporting(E_ALL);
|
||||
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
/** PHPExcel_IOFactory */
|
||||
/** \PHPExcel\IOFactory */
|
||||
require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
|
||||
|
||||
|
||||
@@ -38,17 +38,17 @@ echo date('H:i:s') , " Load from XML file" , PHP_EOL;
|
||||
$inputFileName = "XMLTest.xml";
|
||||
|
||||
/** Identify the type of $inputFileName **/
|
||||
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);
|
||||
$inputFileType = \PHPExcel\IOFactory::identify($inputFileName);
|
||||
echo 'Loading ' , $inputFileName , ' using ' , $inputFileType , " Reader" , PHP_EOL;
|
||||
|
||||
/** Create a new Reader of the type that has been identified **/
|
||||
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
|
||||
$objReader = \PHPExcel\IOFactory::createReader($inputFileType);
|
||||
/** Load $inputFileName to a PHPExcel Object **/
|
||||
$objPHPExcel = $objReader->load($inputFileName);
|
||||
|
||||
|
||||
echo date('H:i:s') , " Write to Excel2007 format" , PHP_EOL;
|
||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
||||
$objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
||||
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
|
||||
echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user