mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2025-02-06 09:49:24 +03:00
Chart reading test workbooks
git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@86720 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
parent
29fcbd0c97
commit
d6fbd9562e
@ -8,7 +8,7 @@ date_default_timezone_set('Europe/London');
|
|||||||
/**
|
/**
|
||||||
* PHPExcel
|
* PHPExcel
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006 - 2008 PHPExcel
|
* Copyright (C) 2006 - 2012 PHPExcel
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -26,7 +26,7 @@ date_default_timezone_set('Europe/London');
|
|||||||
*
|
*
|
||||||
* @category PHPExcel
|
* @category PHPExcel
|
||||||
* @package PHPExcel
|
* @package PHPExcel
|
||||||
* @copyright Copyright (c) 2006 - 2008 PHPExcel (http://www.codeplex.com/PHPExcel)
|
* @copyright Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
@ -38,12 +38,28 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../Classes/');
|
|||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
$inputFileType = 'Excel2007';
|
$inputFileType = 'Excel2007';
|
||||||
$inputFileName = 'templates/32chartreadwrite.xlsx';
|
$inputFileNames = 'templates/32readwrite*[0-9].xlsx';
|
||||||
|
|
||||||
|
if ((isset($argc)) && ($argc > 1)) {
|
||||||
|
$inputFileNames = array();
|
||||||
|
for($i = 1; $i < $argc; ++$i) {
|
||||||
|
$inputFileNames[] = __DIR__ . '/templates/' . $argv[$i];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$inputFileNames = glob($inputFileNames);
|
||||||
|
}
|
||||||
|
foreach($inputFileNames as $inputFileName) {
|
||||||
|
$inputFileNameShort = basename($inputFileName);
|
||||||
|
|
||||||
echo date('H:i:s')." Load Test from $inputFileType file" , PHP_EOL;
|
if (!file_exists($inputFileName)) {
|
||||||
|
echo date('H:i:s') , " File " , $inputFileNameShort , ' does not exist' , PHP_EOL;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo date('H:i:s') , " Load Test from $inputFileType file " , $inputFileNameShort , PHP_EOL;
|
||||||
|
|
||||||
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
|
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
|
||||||
|
$objReader->setIncludeCharts(TRUE);
|
||||||
$objPHPExcel = $objReader->load($inputFileName);
|
$objPHPExcel = $objReader->load($inputFileName);
|
||||||
|
|
||||||
|
|
||||||
@ -90,13 +106,19 @@ foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo date('H:i:s')." Write Tests to Excel2007 file" , PHP_EOL;
|
$outputFileName = basename($inputFileName);
|
||||||
|
|
||||||
|
echo date('H:i:s') , " Write Tests to Excel2007 file " , PHP_EOL;
|
||||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
||||||
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
|
$objWriter->save($outputFileName);
|
||||||
echo date('H:i:s') , " File written to " , str_replace('.php', '.xlsx', __FILE__) , PHP_EOL;
|
echo date('H:i:s') , " File written to " , $outputFileName , PHP_EOL;
|
||||||
|
|
||||||
|
$objPHPExcel->disconnectWorksheets();
|
||||||
|
unset($objPHPExcel);
|
||||||
|
}
|
||||||
|
|
||||||
// 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;
|
||||||
|
|
||||||
// Echo done
|
// Echo done
|
||||||
echo date('H:i:s')." Done writing files." , PHP_EOL;
|
echo date('H:i:s') , " Done writing files" , PHP_EOL;
|
||||||
|
Binary file not shown.
BIN
Tests/templates/32complexChartreadwrite.xlsx
Normal file
BIN
Tests/templates/32complexChartreadwrite.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteAreaChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteAreaChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteAreaChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteAreaChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteAreaChart3.xlsx
Normal file
BIN
Tests/templates/32readwriteAreaChart3.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteAreaPercentageChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteAreaPercentageChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteAreaPercentageChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteAreaPercentageChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteAreaStackedChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteAreaStackedChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteAreaStackedChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteAreaStackedChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteBarChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteBarChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteBarChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteBarChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteBarChart3.xlsx
Normal file
BIN
Tests/templates/32readwriteBarChart3.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteBarPercentageChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteBarPercentageChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteBarPercentageChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteBarPercentageChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteBarStackedChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteBarStackedChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteBarStackedChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteBarStackedChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteChartLegends1.xlsx
Normal file
BIN
Tests/templates/32readwriteChartLegends1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteChartTypes1.xlsx
Normal file
BIN
Tests/templates/32readwriteChartTypes1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteChartWithImages1.xlsx
Normal file
BIN
Tests/templates/32readwriteChartWithImages1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteColumnChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteColumnChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteColumnChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteColumnChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteColumnChart3.xlsx
Normal file
BIN
Tests/templates/32readwriteColumnChart3.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteColumnPercentageChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteColumnPercentageChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteColumnPercentageChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteColumnPercentageChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteColumnStackedChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteColumnStackedChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteColumnStackedChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteColumnStackedChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteDonutChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteDonutChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteDonutChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteDonutChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteDonutChart3.xlsx
Normal file
BIN
Tests/templates/32readwriteDonutChart3.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteDonutChart4.xlsx
Normal file
BIN
Tests/templates/32readwriteDonutChart4.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteLineChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteLineChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteLineChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteLineChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteLineChart3.xlsx
Normal file
BIN
Tests/templates/32readwriteLineChart3.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteLinePercentageChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteLinePercentageChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteLinePercentageChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteLinePercentageChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteLineStackedChart1.xlsx
Normal file
BIN
Tests/templates/32readwriteLineStackedChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwriteLineStackedChart2.xlsx
Normal file
BIN
Tests/templates/32readwriteLineStackedChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwritePieChart1.xlsx
Normal file
BIN
Tests/templates/32readwritePieChart1.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwritePieChart2.xlsx
Normal file
BIN
Tests/templates/32readwritePieChart2.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwritePieChart3.xlsx
Normal file
BIN
Tests/templates/32readwritePieChart3.xlsx
Normal file
Binary file not shown.
BIN
Tests/templates/32readwritePieChart4.xlsx
Normal file
BIN
Tests/templates/32readwritePieChart4.xlsx
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user