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:
parent
b18939b29d
commit
c50003e6e1
|
@ -87,7 +87,7 @@ $objPHPExcel->getActiveSheet()->setCellValue('A8', 'Boolean');
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('B8', 'False');
|
$objPHPExcel->getActiveSheet()->setCellValue('B8', 'False');
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('C8', false);
|
$objPHPExcel->getActiveSheet()->setCellValue('C8', false);
|
||||||
|
|
||||||
$dateTimeNow = gmmktime();
|
$dateTimeNow = time();
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time');
|
$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time');
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('B9', 'Date');
|
$objPHPExcel->getActiveSheet()->setCellValue('B9', 'Date');
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('C9', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ));
|
$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') , " 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 memory peak usage
|
||||||
echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
|
echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ $objPHPExcel->getActiveSheet()->setCellValue('A8', 'Boolean');
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('B8', 'False');
|
$objPHPExcel->getActiveSheet()->setCellValue('B8', 'False');
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('C8', false);
|
$objPHPExcel->getActiveSheet()->setCellValue('C8', false);
|
||||||
|
|
||||||
$dateTimeNow = gmmktime();
|
$dateTimeNow = time();
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time');
|
$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time');
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('B9', 'Date');
|
$objPHPExcel->getActiveSheet()->setCellValue('B9', 'Date');
|
||||||
$objPHPExcel->getActiveSheet()->setCellValue('C9', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ));
|
$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') , " 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 memory peak usage
|
||||||
echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
|
echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , PHP_EOL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue