Reworking of some of the example/test scripts

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@86487 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2012-02-14 23:26:05 +00:00
parent b18939b29d
commit c50003e6e1
2 changed files with 14 additions and 2 deletions

View File

@ -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;

View File

@ -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;