/** Error reporting */
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Europe/London');
define('EOL', PHP_SAPI == 'cli' ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
/** Include PHPExcel */
require_once dirname(__FILE__) . '/../src/Bootstrap.php';
//	Change these values to select the Rendering library that you wish to use
//		and its directory location on your server
$rendererName = PHPExcel\Settings::CHART_RENDERER_JPGRAPH;
$rendererLibrary = 'jpgraph3.5.0b1/src/';
$rendererLibraryPath = '/php/libraries/Charts/' . $rendererLibrary;
if (!PHPExcel\Settings::setChartRenderer($rendererName, $rendererLibraryPath)) {
    die('NOTICE: Please set the $rendererName and $rendererLibraryPath values' . EOL . 'at the top of this script as appropriate for your directory structure');
}
$inputFileType = 'Excel2007';
$inputFileNames = 'templates/36write*.xlsx';
if (isset($argc) && $argc > 1) {
    $inputFileNames = array();
    for ($i = 1; $i < $argc; ++$i) {
        $inputFileNames[] = dirname(__FILE__) . '/templates/' . $argv[$i];
    }
} else {
    $inputFileNames = glob($inputFileNames);
}
foreach ($inputFileNames as $inputFileName) {
    $inputFileNameShort = basename($inputFileName);
    if (!file_exists($inputFileName)) {
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * @category   PHPExcel
 * @package    PHPExcel
 * @copyright  Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
 * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
 * @version    ##VERSION##, ##DATE##
 */
/** Error reporting */
error_reporting(E_ALL);
date_default_timezone_set('Europe/London');
/** \PHPExcel\IOFactory */
require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
// Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file
PHPExcel\Settings::setZipClass(PHPExcel\Settings::PCLZIP);
echo date('H:i:s'), " Load from OOCalc file", PHP_EOL;
$callStartTime = microtime(true);
$objReader = \PHPExcel\IOFactory::createReader('OOCalc');
$objPHPExcel = $objReader->load("OOCalcTest.ods");
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
echo 'Call time to read Workbook was ', sprintf('%.4f', $callTime), " seconds", PHP_EOL;
// Echo memory usage
echo date('H:i:s'), ' Current memory usage: ', memory_get_usage(true) / 1024 / 1024, " MB", PHP_EOL;
echo date('H:i:s'), " Write to Excel2007 format", PHP_EOL;
$objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
echo date('H:i:s'), " File written to ", str_replace('.php', '.xlsx', __FILE__), PHP_EOL;
// Echo memory peak usage
echo date('H:i:s'), " Peak memory usage: ", memory_get_peak_usage(true) / 1024 / 1024, " MB", PHP_EOL;