From c50003e6e1832bf494399ad675bcaf0127f1c686 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Tue, 14 Feb 2012 23:26:05 +0000 Subject: [PATCH] Reworking of some of the example/test scripts git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@86487 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Tests/02types-xls.php | 8 +++++++- Tests/02types.php | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Tests/02types-xls.php b/Tests/02types-xls.php index 16e7ee9b..b5249988 100644 --- a/Tests/02types-xls.php +++ b/Tests/02types-xls.php @@ -87,7 +87,7 @@ $objPHPExcel->getActiveSheet()->setCellValue('A8', 'Boolean'); $objPHPExcel->getActiveSheet()->setCellValue('B8', 'False'); $objPHPExcel->getActiveSheet()->setCellValue('C8', false); -$dateTimeNow = gmmktime(); +$dateTimeNow = time(); $objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time'); $objPHPExcel->getActiveSheet()->setCellValue('B9', 'Date'); $objPHPExcel->getActiveSheet()->setCellValue('C9', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow )); @@ -122,6 +122,12 @@ $objWriter->save(str_replace('.php', '.xls', __FILE__)); echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', __FILE__) , PHP_EOL; +echo date('H:i:s') , " Reload workbook from saved file" , PHP_EOL; +$objPHPExcel = PHPExcel_IOFactory::load(str_replace('.php', '.xls', __FILE__)); + +var_dump($objPHPExcel->getActiveSheet()->toArray()); + + // Echo memory peak usage echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL; diff --git a/Tests/02types.php b/Tests/02types.php index 2c5467c4..a6a31364 100644 --- a/Tests/02types.php +++ b/Tests/02types.php @@ -87,7 +87,7 @@ $objPHPExcel->getActiveSheet()->setCellValue('A8', 'Boolean'); $objPHPExcel->getActiveSheet()->setCellValue('B8', 'False'); $objPHPExcel->getActiveSheet()->setCellValue('C8', false); -$dateTimeNow = gmmktime(); +$dateTimeNow = time(); $objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time'); $objPHPExcel->getActiveSheet()->setCellValue('B9', 'Date'); $objPHPExcel->getActiveSheet()->setCellValue('C9', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow )); @@ -122,6 +122,12 @@ $objWriter->save(str_replace('.php', '.xlsx', __FILE__)); echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL; +echo date('H:i:s') , " Reload workbook from saved file" , PHP_EOL; +$objPHPExcel = PHPExcel_IOFactory::load(str_replace('.php', '.xlsx', __FILE__)); + +var_dump($objPHPExcel->getActiveSheet()->toArray()); + + // Echo memory peak usage echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;