mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-28 02:58:26 +00:00
Fix some errors with samples
This commit is contained in:
@@ -33,8 +33,8 @@ define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
/** Include PHPExcel_IOFactory */
|
||||
require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
|
||||
/** Include PHPExcel */
|
||||
require_once dirname(__FILE__) . '/../src/Bootstrap.php';
|
||||
|
||||
|
||||
if (!file_exists("05featuredemo.xlsx")) {
|
||||
@@ -42,12 +42,12 @@ if (!file_exists("05featuredemo.xlsx")) {
|
||||
}
|
||||
|
||||
// Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file
|
||||
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
|
||||
\PHPExcel\Settings::setZipClass(\PHPExcel\Settings::PCLZIP);
|
||||
|
||||
echo date('H:i:s') , " Load from Excel2007 file" , EOL;
|
||||
$callStartTime = microtime(true);
|
||||
|
||||
$objPHPExcel = PHPExcel_IOFactory::load("05featuredemo.xlsx");
|
||||
$objPHPExcel = \PHPExcel\IOFactory::load("05featuredemo.xlsx");
|
||||
|
||||
$callEndTime = microtime(true);
|
||||
$callTime = $callEndTime - $callStartTime;
|
||||
@@ -59,7 +59,7 @@ echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024
|
||||
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
|
||||
$callStartTime = microtime(true);
|
||||
|
||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
||||
$objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
||||
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
|
||||
|
||||
$callEndTime = microtime(true);
|
||||
|
||||
Reference in New Issue
Block a user