#401 : Support for namespaces
This commit is contained in:
parent
04cceaae2b
commit
727ab1ef34
|
@ -30,7 +30,7 @@ $inputFileName = './sampleData/example_1.xls';
|
||||||
echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
|
echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory to identify the format<br />';
|
||||||
try {
|
try {
|
||||||
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
|
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
|
||||||
} catch(PHPExcel_Reader_Exception $e) {
|
} catch(\PHPExcel\Reader\Exception $e) {
|
||||||
die('Error loading file "'.pathinfo($inputFileName,PATHINFO_BASENAME).'": '.$e->getMessage());
|
die('Error loading file "'.pathinfo($inputFileName,PATHINFO_BASENAME).'": '.$e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace PHPExcel\Reader;
|
namespace PHPExcel\Reader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Reader_Exception
|
* \PHPExcel\Reader\Exception
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006 - 2015 PHPExcel
|
* Copyright (c) 2006 - 2015 PHPExcel
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace PHPExcel\Shared;
|
namespace PHPExcel\Shared;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Shared_CodePage
|
* \PHPExcel\Shared\CodePage
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006 - 2015 PHPExcel
|
* Copyright (c) 2006 - 2015 PHPExcel
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace PHPExcel\Shared;
|
namespace PHPExcel\Shared;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Shared_File
|
* \PHPExcel\Shared\File
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006 - 2015 PHPExcel
|
* Copyright (c) 2006 - 2015 PHPExcel
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace PHPExcel\Shared;
|
namespace PHPExcel\Shared;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Shared_PasswordHasher
|
* \PHPExcel\Shared\PasswordHasher
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006 - 2015 PHPExcel
|
* Copyright (c) 2006 - 2015 PHPExcel
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace PHPExcel\Style;
|
namespace PHPExcel\Style;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPExcel_Style_NumberFormat
|
* \PHPExcel\Style\NumberFormat
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006 - 2015 PHPExcel
|
* Copyright (c) 2006 - 2015 PHPExcel
|
||||||
*
|
*
|
||||||
|
|
|
@ -87,12 +87,12 @@ class RowIterator implements \Iterator
|
||||||
*
|
*
|
||||||
* @param integer $startRow The row number at which to start iterating
|
* @param integer $startRow The row number at which to start iterating
|
||||||
* @return RowIterator
|
* @return RowIterator
|
||||||
* @throws PHPExcel_Exception
|
* @throws \PHPExcel\Exception
|
||||||
*/
|
*/
|
||||||
public function resetStart($startRow = 1)
|
public function resetStart($startRow = 1)
|
||||||
{
|
{
|
||||||
if ($startRow > $this->subject->getHighestRow()) {
|
if ($startRow > $this->subject->getHighestRow()) {
|
||||||
throw new PHPExcel_Exception("Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})");
|
throw new \PHPExcel\Exception("Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})");
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->startRow = $startRow;
|
$this->startRow = $startRow;
|
||||||
|
|
|
@ -179,7 +179,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
// If $pFilename is php://output or php://stdout, make it a temporary file...
|
// If $pFilename is php://output or php://stdout, make it a temporary file...
|
||||||
$originalFilename = $pFilename;
|
$originalFilename = $pFilename;
|
||||||
if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
|
if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
|
||||||
$pFilename = @tempnam(PHPExcel_Shared_File::sysGetTempDir(), 'phpxltmp');
|
$pFilename = @tempnam(\PHPExcel\Shared\File::sysGetTempDir(), 'phpxltmp');
|
||||||
if ($pFilename == '') {
|
if ($pFilename == '') {
|
||||||
$pFilename = $originalFilename;
|
$pFilename = $originalFilename;
|
||||||
}
|
}
|
||||||
|
|
|
@ -702,7 +702,7 @@ class HTML extends BaseWriter implements IWriter
|
||||||
if ($chart instanceof PHPExcel_Chart) {
|
if ($chart instanceof PHPExcel_Chart) {
|
||||||
$chartCoordinates = $chart->getTopLeftPosition();
|
$chartCoordinates = $chart->getTopLeftPosition();
|
||||||
if ($chartCoordinates['cell'] == $coordinates) {
|
if ($chartCoordinates['cell'] == $coordinates) {
|
||||||
$chartFileName = PHPExcel_Shared_File::sysGetTempDir().'/'.uniqid().'.png';
|
$chartFileName = \PHPExcel\Shared\File::sysGetTempDir().'/'.uniqid().'.png';
|
||||||
if (!$chart->render($chartFileName)) {
|
if (!$chart->render($chartFileName)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ class OpenDocument extends BaseWriter implements IWriter
|
||||||
// If $pFilename is php://output or php://stdout, make it a temporary file...
|
// If $pFilename is php://output or php://stdout, make it a temporary file...
|
||||||
$originalFilename = $pFilename;
|
$originalFilename = $pFilename;
|
||||||
if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
|
if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
|
||||||
$pFilename = @tempnam(PHPExcel_Shared_File::sysGetTempDir(), 'phpxltmp');
|
$pFilename = @tempnam(\PHPExcel\Shared\File::sysGetTempDir(), 'phpxltmp');
|
||||||
if ($pFilename == '') {
|
if ($pFilename == '') {
|
||||||
$pFilename = $originalFilename;
|
$pFilename = $originalFilename;
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,7 +214,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
|
||||||
{
|
{
|
||||||
parent::__construct($phpExcel);
|
parent::__construct($phpExcel);
|
||||||
$this->setUseInlineCss(true);
|
$this->setUseInlineCss(true);
|
||||||
$this->tempDir = PHPExcel_Shared_File::sysGetTempDir();
|
$this->tempDir = \PHPExcel\Shared\File::sysGetTempDir();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,11 +6,11 @@ class XEEValidatorTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @dataProvider providerInvalidXML
|
* @dataProvider providerInvalidXML
|
||||||
* @expectedException PHPExcel_Reader_Exception
|
* @expectedException \PHPExcel\Reader\Exception
|
||||||
*/
|
*/
|
||||||
public function testInvalidXML($filename)
|
public function testInvalidXML($filename)
|
||||||
{
|
{
|
||||||
$reader = $this->getMockForAbstractClass('PHPExcel_Reader_Abstract');
|
$reader = $this->getMockForAbstractClass('\PHPExcel\Reader\BaseReader');
|
||||||
$expectedResult = 'FAILURE: Should throw an Exception rather than return a value';
|
$expectedResult = 'FAILURE: Should throw an Exception rather than return a value';
|
||||||
$result = $reader->securityScanFile($filename);
|
$result = $reader->securityScanFile($filename);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
|
@ -30,7 +30,7 @@ class XEEValidatorTest extends \PHPUnit_Framework_TestCase
|
||||||
*/
|
*/
|
||||||
public function testValidXML($filename, $expectedResult)
|
public function testValidXML($filename, $expectedResult)
|
||||||
{
|
{
|
||||||
$reader = $this->getMockForAbstractClass('PHPExcel_Reader_Abstract');
|
$reader = $this->getMockForAbstractClass('\PHPExcel\Reader\BaseReader');
|
||||||
$result = $reader->securityScanFile($filename);
|
$result = $reader->securityScanFile($filename);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Shared_CodePage','numberToName'), $args);
|
$result = call_user_func_array(array('\PHPExcel\Shared\CodePage','numberToName'), $args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$invalidCodePage = 12345;
|
$invalidCodePage = 12345;
|
||||||
try {
|
try {
|
||||||
$result = call_user_func(array('PHPExcel_Shared_CodePage','numberToName'), $invalidCodePage);
|
$result = call_user_func(array('\PHPExcel\Shared\CodePage','numberToName'), $invalidCodePage);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->assertEquals($e->getMessage(), 'Unknown codepage: 12345');
|
$this->assertEquals($e->getMessage(), 'Unknown codepage: 12345');
|
||||||
return;
|
return;
|
||||||
|
@ -38,7 +38,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$unsupportedCodePage = 720;
|
$unsupportedCodePage = 720;
|
||||||
try {
|
try {
|
||||||
$result = call_user_func(array('PHPExcel_Shared_CodePage','numberToName'), $unsupportedCodePage);
|
$result = call_user_func(array('\PHPExcel\Shared\CodePage','numberToName'), $unsupportedCodePage);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->assertEquals($e->getMessage(), 'Code page 720 not supported.');
|
$this->assertEquals($e->getMessage(), 'Code page 720 not supported.');
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -10,7 +10,7 @@ class FileTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$expectedResult = false;
|
$expectedResult = false;
|
||||||
|
|
||||||
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));
|
$result = call_user_func(array('\PHPExcel\Shared\File','getUseUploadTempDirectory'));
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,9 @@ class FileTest extends \PHPUnit_Framework_TestCase
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
|
foreach ($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
|
||||||
call_user_func(array('PHPExcel_Shared_File','setUseUploadTempDirectory'), $useUploadTempDirectoryValue);
|
call_user_func(array('\PHPExcel\Shared\File','setUseUploadTempDirectory'), $useUploadTempDirectoryValue);
|
||||||
|
|
||||||
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));
|
$result = call_user_func(array('\PHPExcel\Shared\File','getUseUploadTempDirectory'));
|
||||||
$this->assertEquals($useUploadTempDirectoryValue, $result);
|
$this->assertEquals($useUploadTempDirectoryValue, $result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ class PasswordHasherTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Shared_PasswordHasher','hashPassword'), $args);
|
$result = call_user_func_array(array('\PHPExcel\Shared\PasswordHasher','hashPassword'), $args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class NumberFormatDateTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Style_NumberFormat','toFormattedString'), $args);
|
$result = call_user_func_array(array('\PHPExcel\Style\NumberFormat','toFormattedString'), $args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class NumberFormatTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$expectedResult = array_pop($args);
|
$expectedResult = array_pop($args);
|
||||||
$result = call_user_func_array(array('PHPExcel_Style_NumberFormat','toFormattedString'), $args);
|
$result = call_user_func_array(array('\PHPExcel\Style\NumberFormat','toFormattedString'), $args);
|
||||||
$this->assertEquals($expectedResult, $result);
|
$this->assertEquals($expectedResult, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ class AutofilterColumnTest extends \PHPUnit_Framework_TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException PHPExcel_Exception
|
* @expectedException \PHPExcel\Exception
|
||||||
*/
|
*/
|
||||||
public function testSetInvalidFilterTypeThrowsException()
|
public function testSetInvalidFilterTypeThrowsException()
|
||||||
{
|
{
|
||||||
|
@ -98,7 +98,7 @@ class AutofilterColumnTest extends \PHPUnit_Framework_TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException PHPExcel_Exception
|
* @expectedException \PHPExcel\Exception
|
||||||
*/
|
*/
|
||||||
public function testSetInvalidJoinThrowsException()
|
public function testSetInvalidJoinThrowsException()
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,7 +66,7 @@ class RowCellIteratorTest extends \PHPUnit_Framework_TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException PHPExcel_Exception
|
* @expectedException \PHPExcel\Exception
|
||||||
*/
|
*/
|
||||||
public function testSeekOutOfRange()
|
public function testSeekOutOfRange()
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ class RowCellIteratorTest extends \PHPUnit_Framework_TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException PHPExcel_Exception
|
* @expectedException \PHPExcel\Exception
|
||||||
*/
|
*/
|
||||||
public function testPrevOutOfRange()
|
public function testPrevOutOfRange()
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,7 @@ class RowIteratorTest extends \PHPUnit_Framework_TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException PHPExcel_Exception
|
* @expectedException \PHPExcel\Exception
|
||||||
*/
|
*/
|
||||||
public function testSeekOutOfRange()
|
public function testSeekOutOfRange()
|
||||||
{
|
{
|
||||||
|
@ -73,7 +73,7 @@ class RowIteratorTest extends \PHPUnit_Framework_TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException PHPExcel_Exception
|
* @expectedException \PHPExcel\Exception
|
||||||
*/
|
*/
|
||||||
public function testPrevOutOfRange()
|
public function testPrevOutOfRange()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue