mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-23 21:58:26 +00:00
Fix some errors with samples
This commit is contained in:
@@ -10,47 +10,18 @@ define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
|
||||
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
/**
|
||||
* PHPExcel
|
||||
*
|
||||
* Copyright (c) 2006 - 2015 PHPExcel
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* 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##
|
||||
*/
|
||||
|
||||
/** Include path **/
|
||||
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/../Classes/');
|
||||
|
||||
/** PHPExcel_IOFactory */
|
||||
include 'PHPExcel/IOFactory.php';
|
||||
/** 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;
|
||||
$rendererName = PHPExcel\Settings::CHART_RENDERER_JPGRAPH;
|
||||
$rendererLibrary = 'jpgraph3.5.0b1/src/';
|
||||
$rendererLibraryPath = '/php/libraries/Charts/' . $rendererLibrary;
|
||||
|
||||
|
||||
if (!PHPExcel_Settings::setChartRenderer(
|
||||
if (!PHPExcel\Settings::setChartRenderer(
|
||||
$rendererName,
|
||||
$rendererLibraryPath
|
||||
)) {
|
||||
@@ -83,7 +54,7 @@ foreach($inputFileNames as $inputFileName) {
|
||||
|
||||
echo date('H:i:s') , " Load Test from $inputFileType file " , $inputFileNameShort , EOL;
|
||||
|
||||
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
|
||||
$objReader = \PHPExcel\IOFactory::createReader($inputFileType);
|
||||
$objReader->setIncludeCharts(TRUE);
|
||||
$objPHPExcel = $objReader->load($inputFileName);
|
||||
|
||||
@@ -134,7 +105,7 @@ foreach($inputFileNames as $inputFileName) {
|
||||
$outputFileName = str_replace('.xlsx', '.html', basename($inputFileName));
|
||||
|
||||
echo date('H:i:s') , " Write Tests to HTML file " , EOL;
|
||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
|
||||
$objWriter = \PHPExcel\IOFactory::createWriter($objPHPExcel, 'HTML');
|
||||
$objWriter->setIncludeCharts(TRUE);
|
||||
$objWriter->save($outputFileName);
|
||||
echo date('H:i:s') , " File written to " , $outputFileName , EOL;
|
||||
|
||||
Reference in New Issue
Block a user