More namespacing changes, think I've got most of the now except in JAMA and bestfit; plus modified the first few examples to use the bootstrap and namespacing as well

This commit is contained in:
Mark Baker 2013-06-20 01:23:47 +01:00
parent ffed9ab702
commit 143d52ab4e
29 changed files with 417 additions and 420 deletions

View File

@ -138,7 +138,6 @@ class Autoloader
*/
public function loadClass($className)
{
echo 'Load Class ', $className, PHP_EOL;
if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) {
$fileName = '';
$namespace = '';

View File

@ -3424,6 +3424,7 @@ class Calculation {
$args[] = $pCell;
}
if (strpos($functionCall,'::') !== FALSE) {
$functionCall = __NAMESPACE__ . '\\' . $functionCall;
$result = call_user_func_array(explode('::',$functionCall),$args);
} else {
foreach($args as &$arg) {

View File

@ -159,7 +159,7 @@ class IOFactory
// Include class
foreach (self::$_searchLocations as $searchLocation) {
if ($searchLocation['type'] == $searchType) {
$className = str_replace('{0}', $readerType, $searchLocation['class']);
$className = __NAMESPACE__ . '\\' . str_replace('{0}', $readerType, $searchLocation['class']);
$instance = new $className();
if ($instance !== NULL) {

View File

@ -76,13 +76,13 @@ class Reader_Excel2007 extends Reader_Abstract implements Reader_IReader
}
// Check if zip class exists
if (!class_exists('ZipArchive',FALSE)) {
if (!class_exists('\ZipArchive',FALSE)) {
throw new Reader_Exception("ZipArchive library is not enabled");
}
$xl = false;
// Load file
$zip = new ZipArchive;
$zip = new \ZipArchive;
if ($zip->open($pFilename) === true) {
// check if it is an OOXML archive
$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels"));
@ -120,7 +120,7 @@ class Reader_Excel2007 extends Reader_Abstract implements Reader_IReader
$worksheetNames = array();
$zip = new ZipArchive;
$zip = new \ZipArchive;
$zip->open($pFilename);
// The files we're looking at here are small enough that simpleXML is more efficient than XMLReader
@ -164,7 +164,7 @@ class Reader_Excel2007 extends Reader_Abstract implements Reader_IReader
$worksheetInfo = array();
$zip = new ZipArchive;
$zip = new \ZipArchive;
$zip->open($pFilename);
$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships");
@ -303,7 +303,7 @@ class Reader_Excel2007 extends Reader_Abstract implements Reader_IReader
}
public function _getFromZipArchive(ZipArchive $archive, $fileName = '')
public function _getFromZipArchive(\ZipArchive $archive, $fileName = '')
{
// Root-relative paths
if (strpos($fileName, '//') !== false)
@ -343,7 +343,7 @@ class Reader_Excel2007 extends Reader_Abstract implements Reader_IReader
$excel->removeCellStyleXfByIndex(0); // remove the default style
$excel->removeCellXfByIndex(0); // remove the default style
}
$zip = new ZipArchive;
$zip = new \ZipArchive;
$zip->open($pFilename);
// Read the theme first, because we need the colour scheme when reading the styles

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Style_Border
* PHPExcel\Style_Border
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Style_Border extends Style_Supervisor implements IComparable
@ -63,7 +63,7 @@ class Style_Border extends Style_Supervisor implements IComparable
/**
* Border color
*
* @var PHPExcel_Style_Color
* @var PHPExcel\Style_Color
*/
protected $_color;
@ -75,7 +75,7 @@ class Style_Border extends Style_Supervisor implements IComparable
protected $_parentPropertyName;
/**
* Create a new PHPExcel_Style_Border
* Create a new PHPExcel\Style_Border
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -101,9 +101,9 @@ class Style_Border extends Style_Supervisor implements IComparable
/**
* Bind parent. Only used for supervisor
*
* @param PHPExcel_Style_Borders $parent
* @param PHPExcel\Style_Borders $parent
* @param string $parentPropertyName
* @return PHPExcel_Style_Border
* @return PHPExcel\Style_Border
*/
public function bindParent($parent, $parentPropertyName=NULL)
{
@ -116,8 +116,8 @@ class Style_Border extends Style_Supervisor implements IComparable
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Border
* @throws PHPExcel_Exception
* @return PHPExcel\Style_Border
* @throws PHPExcel\Exception
*/
public function getSharedComponent()
{
@ -182,7 +182,7 @@ class Style_Border extends Style_Supervisor implements IComparable
* <code>
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
* array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => PHPExcel\Style_Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
@ -191,8 +191,8 @@ class Style_Border extends Style_Supervisor implements IComparable
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Border
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Border
*/
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
@ -207,7 +207,7 @@ class Style_Border extends Style_Supervisor implements IComparable
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new Exception("Invalid style array passed.");
}
return $this;
}
@ -228,16 +228,16 @@ class Style_Border extends Style_Supervisor implements IComparable
* Set Border style
*
* @param string|boolean $pValue
* When passing a boolean, FALSE equates PHPExcel_Style_Border::BORDER_NONE
* and TRUE to PHPExcel_Style_Border::BORDER_MEDIUM
* @return PHPExcel_Style_Border
* When passing a boolean, FALSE equates PHPExcel\Style_Border::BORDER_NONE
* and TRUE to PHPExcel\Style_Border::BORDER_MEDIUM
* @return PHPExcel\Style_Border
*/
public function setBorderStyle($pValue = PHPExcel_Style_Border::BORDER_NONE) {
public function setBorderStyle($pValue = Style_Border::BORDER_NONE) {
if (empty($pValue)) {
$pValue = PHPExcel_Style_Border::BORDER_NONE;
$pValue = Style_Border::BORDER_NONE;
} elseif(is_bool($pValue) && $pValue) {
$pValue = PHPExcel_Style_Border::BORDER_MEDIUM;
$pValue = Style_Border::BORDER_MEDIUM;
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('style' => $pValue));
@ -251,7 +251,7 @@ class Style_Border extends Style_Supervisor implements IComparable
/**
* Get Border Color
*
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public function getColor() {
return $this->_color;
@ -260,11 +260,11 @@ class Style_Border extends Style_Supervisor implements IComparable
/**
* Set Border Color
*
* @param PHPExcel_Style_Color $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Border
* @param PHPExcel\Style_Color $pValue
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Border
*/
public function setColor(PHPExcel_Style_Color $pValue = null) {
public function setColor(Style_Color $pValue = null) {
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Style_Borders
* PHPExcel\Style_Borders
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Style_Borders extends Style_Supervisor implements IComparable
@ -46,35 +46,35 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Left
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_left;
/**
* Right
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_right;
/**
* Top
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_top;
/**
* Bottom
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_bottom;
/**
* Diagonal
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_diagonal;
@ -88,40 +88,40 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* All borders psedo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_allBorders;
/**
* Outline psedo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_outline;
/**
* Inside psedo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_inside;
/**
* Vertical pseudo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_vertical;
/**
* Horizontal pseudo-border. Only applies to supervisor.
*
* @var PHPExcel_Style_Border
* @var PHPExcel\Style_Border
*/
protected $_horizontal;
/**
* Create a new PHPExcel_Style_Borders
* Create a new PHPExcel\Style_Borders
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -170,7 +170,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Borders
* @return PHPExcel\Style_Borders
*/
public function getSharedComponent()
{
@ -195,13 +195,13 @@ class Style_Borders extends Style_Supervisor implements IComparable
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
* array(
* 'bottom' => array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => PHPExcel\Style_Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
* ),
* 'top' => array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => PHPExcel\Style_Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
@ -213,7 +213,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
* array(
* 'allborders' => array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
* 'style' => PHPExcel\Style_Border::BORDER_DASHDOT,
* 'color' => array(
* 'rgb' => '808080'
* )
@ -223,8 +223,8 @@ class Style_Borders extends Style_Supervisor implements IComparable
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Borders
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Borders
*/
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
@ -257,7 +257,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new Exception("Invalid style array passed.");
}
return $this;
}
@ -265,7 +265,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Get Left
*
* @return PHPExcel_Style_Border
* @return PHPExcel\Style_Border
*/
public function getLeft() {
return $this->_left;
@ -274,7 +274,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Get Right
*
* @return PHPExcel_Style_Border
* @return PHPExcel\Style_Border
*/
public function getRight() {
return $this->_right;
@ -283,7 +283,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Get Top
*
* @return PHPExcel_Style_Border
* @return PHPExcel\Style_Border
*/
public function getTop() {
return $this->_top;
@ -292,7 +292,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Get Bottom
*
* @return PHPExcel_Style_Border
* @return PHPExcel\Style_Border
*/
public function getBottom() {
return $this->_bottom;
@ -301,7 +301,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Get Diagonal
*
* @return PHPExcel_Style_Border
* @return PHPExcel\Style_Border
*/
public function getDiagonal() {
return $this->_diagonal;
@ -310,12 +310,12 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Get AllBorders (pseudo-border). Only applies to supervisor.
*
* @return PHPExcel_Style_Border
* @throws PHPExcel_Exception
* @return PHPExcel\Style_Border
* @throws PHPExcel\Exception
*/
public function getAllBorders() {
if (!$this->_isSupervisor) {
throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
throw new Exception('Can only get pseudo-border for supervisor.');
}
return $this->_allBorders;
}
@ -324,11 +324,11 @@ class Style_Borders extends Style_Supervisor implements IComparable
* Get Outline (pseudo-border). Only applies to supervisor.
*
* @return boolean
* @throws PHPExcel_Exception
* @throws PHPExcel\Exception
*/
public function getOutline() {
if (!$this->_isSupervisor) {
throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
throw new Exception('Can only get pseudo-border for supervisor.');
}
return $this->_outline;
}
@ -337,11 +337,11 @@ class Style_Borders extends Style_Supervisor implements IComparable
* Get Inside (pseudo-border). Only applies to supervisor.
*
* @return boolean
* @throws PHPExcel_Exception
* @throws PHPExcel\Exception
*/
public function getInside() {
if (!$this->_isSupervisor) {
throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
throw new Exception('Can only get pseudo-border for supervisor.');
}
return $this->_inside;
}
@ -349,12 +349,12 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Get Vertical (pseudo-border). Only applies to supervisor.
*
* @return PHPExcel_Style_Border
* @throws PHPExcel_Exception
* @return PHPExcel\Style_Border
* @throws PHPExcel\Exception
*/
public function getVertical() {
if (!$this->_isSupervisor) {
throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
throw new Exception('Can only get pseudo-border for supervisor.');
}
return $this->_vertical;
}
@ -362,12 +362,12 @@ class Style_Borders extends Style_Supervisor implements IComparable
/**
* Get Horizontal (pseudo-border). Only applies to supervisor.
*
* @return PHPExcel_Style_Border
* @throws PHPExcel_Exception
* @return PHPExcel\Style_Border
* @throws PHPExcel\Exception
*/
public function getHorizontal() {
if (!$this->_isSupervisor) {
throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
throw new Exception('Can only get pseudo-border for supervisor.');
}
return $this->_horizontal;
}
@ -388,7 +388,7 @@ class Style_Borders extends Style_Supervisor implements IComparable
* Set DiagonalDirection
*
* @param int $pValue
* @return PHPExcel_Style_Borders
* @return PHPExcel\Style_Borders
*/
public function setDiagonalDirection($pValue = Style_Borders::DIAGONAL_NONE) {
if ($pValue == '') {

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -32,7 +32,7 @@ namespace PHPExcel;
* PHPExcel\Style_Color
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Style_Color extends Style_Supervisor implements IComparable
@ -72,7 +72,7 @@ class Style_Color extends Style_Supervisor implements IComparable
/**
* Create a new PHPExcel_Style_Color
* Create a new PHPExcel\Style_Color
*
* @param string $pARGB ARGB value for the colour
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
@ -82,7 +82,7 @@ class Style_Color extends Style_Supervisor implements IComparable
* Leave this value at default unless you understand exactly what
* its ramifications are
*/
public function __construct($pARGB = PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor = FALSE, $isConditional = FALSE)
public function __construct($pARGB = Style_Color::COLOR_BLACK, $isSupervisor = FALSE, $isConditional = FALSE)
{
// Supervisor?
parent::__construct($isSupervisor);
@ -98,7 +98,7 @@ class Style_Color extends Style_Supervisor implements IComparable
*
* @param mixed $parent
* @param string $parentPropertyName
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public function bindParent($parent, $parentPropertyName=NULL)
{
@ -111,7 +111,7 @@ class Style_Color extends Style_Supervisor implements IComparable
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public function getSharedComponent()
{
@ -156,8 +156,8 @@ class Style_Color extends Style_Supervisor implements IComparable
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Color
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Color
*/
public function applyFromArray($pStyles = NULL) {
if (is_array($pStyles)) {
@ -172,7 +172,7 @@ class Style_Color extends Style_Supervisor implements IComparable
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new Exception("Invalid style array passed.");
}
return $this;
}
@ -193,11 +193,11 @@ class Style_Color extends Style_Supervisor implements IComparable
* Set ARGB
*
* @param string $pValue
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public function setARGB($pValue = PHPExcel_Style_Color::COLOR_BLACK) {
public function setARGB($pValue = Style_Color::COLOR_BLACK) {
if ($pValue == '') {
$pValue = PHPExcel_Style_Color::COLOR_BLACK;
$pValue = Style_Color::COLOR_BLACK;
}
if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('argb' => $pValue));
@ -224,7 +224,7 @@ class Style_Color extends Style_Supervisor implements IComparable
* Set RGB
*
* @param string $pValue RGB value
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public function setRGB($pValue = '000000') {
if ($pValue == '') {
@ -335,7 +335,7 @@ class Style_Color extends Style_Supervisor implements IComparable
* @param int $pIndex Index entry point into the colour array
* @param boolean $background Flag to indicate whether default background or foreground colour
* should be returned if the indexed colour doesn't exist
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public static function indexedColor($pIndex, $background=FALSE) {
// Clean parameter
@ -404,13 +404,13 @@ class Style_Color extends Style_Supervisor implements IComparable
}
if (array_key_exists($pIndex, self::$_indexedColors)) {
return new PHPExcel_Style_Color(self::$_indexedColors[$pIndex]);
return new Style_Color(self::$_indexedColors[$pIndex]);
}
if ($background) {
return new PHPExcel_Style_Color('FFFFFFFF');
return new Style_Color('FFFFFFFF');
}
return new PHPExcel_Style_Color('FF000000');
return new Style_Color('FF000000');
}
/**

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Style_Conditional
* PHPExcel\Style_Conditional
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Style_Conditional implements IComparable
@ -88,12 +88,12 @@ class Style_Conditional implements IComparable
/**
* Style
*
* @var PHPExcel_Style
* @var PHPExcel\Style
*/
private $_style;
/**
* Create a new PHPExcel_Style_Conditional
* Create a new PHPExcel\Style_Conditional
*/
public function __construct()
{
@ -117,8 +117,8 @@ class Style_Conditional implements IComparable
/**
* Set Condition type
*
* @param string $pValue PHPExcel_Style_Conditional condition type
* @return PHPExcel_Style_Conditional
* @param string $pValue PHPExcel\Style_Conditional condition type
* @return PHPExcel\Style_Conditional
*/
public function setConditionType($pValue = Style_Conditional::CONDITION_NONE) {
$this->_conditionType = $pValue;
@ -137,8 +137,8 @@ class Style_Conditional implements IComparable
/**
* Set Operator type
*
* @param string $pValue PHPExcel_Style_Conditional operator type
* @return PHPExcel_Style_Conditional
* @param string $pValue PHPExcel\Style_Conditional operator type
* @return PHPExcel\Style_Conditional
*/
public function setOperatorType($pValue = Style_Conditional::OPERATOR_NONE) {
$this->_operatorType = $pValue;
@ -158,7 +158,7 @@ class Style_Conditional implements IComparable
* Set text
*
* @param string $value
* @return PHPExcel_Style_Conditional
* @return PHPExcel\Style_Conditional
*/
public function setText($value = null) {
$this->_text = $value;
@ -184,7 +184,7 @@ class Style_Conditional implements IComparable
*
* @deprecated Deprecated, use setConditions instead
* @param string $pValue Condition
* @return PHPExcel_Style_Conditional
* @return PHPExcel\Style_Conditional
*/
public function setCondition($pValue = '') {
if (!is_array($pValue))
@ -206,7 +206,7 @@ class Style_Conditional implements IComparable
* Set Conditions
*
* @param string[] $pValue Condition
* @return PHPExcel_Style_Conditional
* @return PHPExcel\Style_Conditional
*/
public function setConditions($pValue) {
if (!is_array($pValue))
@ -220,7 +220,7 @@ class Style_Conditional implements IComparable
* Add Condition
*
* @param string $pValue Condition
* @return PHPExcel_Style_Conditional
* @return PHPExcel\Style_Conditional
*/
public function addCondition($pValue = '') {
$this->_condition[] = $pValue;
@ -230,7 +230,7 @@ class Style_Conditional implements IComparable
/**
* Get Style
*
* @return PHPExcel_Style
* @return PHPExcel\Style
*/
public function getStyle() {
return $this->_style;
@ -239,9 +239,9 @@ class Style_Conditional implements IComparable
/**
* Set Style
*
* @param PHPExcel_Style $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Conditional
* @param PHPExcel\Style $pValue
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Conditional
*/
public function setStyle(Style $pValue = null) {
$this->_style = $pValue;

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Style_Fill
* PHPExcel\Style_Fill
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Style_Fill extends Style_Supervisor implements IComparable
@ -77,19 +77,19 @@ class Style_Fill extends Style_Supervisor implements IComparable
/**
* Start color
*
* @var PHPExcel_Style_Color
* @var PHPExcel\Style_Color
*/
protected $_startColor;
/**
* End color
*
* @var PHPExcel_Style_Color
* @var PHPExcel\Style_Color
*/
protected $_endColor;
/**
* Create a new PHPExcel_Style_Fill
* Create a new PHPExcel\Style_Fill
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -121,7 +121,7 @@ class Style_Fill extends Style_Supervisor implements IComparable
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Fill
* @return PHPExcel\Style_Fill
*/
public function getSharedComponent()
{
@ -145,7 +145,7 @@ class Style_Fill extends Style_Supervisor implements IComparable
* <code>
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray(
* array(
* 'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR,
* 'type' => PHPExcel\Style_Fill::FILL_GRADIENT_LINEAR,
* 'rotation' => 0,
* 'startcolor' => array(
* 'rgb' => '000000'
@ -158,8 +158,8 @@ class Style_Fill extends Style_Supervisor implements IComparable
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Fill
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Fill
*/
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
@ -183,7 +183,7 @@ class Style_Fill extends Style_Supervisor implements IComparable
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new Exception("Invalid style array passed.");
}
return $this;
}
@ -203,8 +203,8 @@ class Style_Fill extends Style_Supervisor implements IComparable
/**
* Set Fill Type
*
* @param string $pValue PHPExcel_Style_Fill fill type
* @return PHPExcel_Style_Fill
* @param string $pValue PHPExcel\Style_Fill fill type
* @return PHPExcel\Style_Fill
*/
public function setFillType($pValue = Style_Fill::FILL_NONE) {
if ($this->_isSupervisor) {
@ -232,7 +232,7 @@ class Style_Fill extends Style_Supervisor implements IComparable
* Set Rotation
*
* @param double $pValue
* @return PHPExcel_Style_Fill
* @return PHPExcel\Style_Fill
*/
public function setRotation($pValue = 0) {
if ($this->_isSupervisor) {
@ -247,7 +247,7 @@ class Style_Fill extends Style_Supervisor implements IComparable
/**
* Get Start Color
*
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public function getStartColor() {
return $this->_startColor;
@ -256,11 +256,11 @@ class Style_Fill extends Style_Supervisor implements IComparable
/**
* Set Start Color
*
* @param PHPExcel_Style_Color $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Fill
* @param PHPExcel\Style_Color $pValue
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Fill
*/
public function setStartColor(PHPExcel_Style_Color $pValue = null) {
public function setStartColor(Style_Color $pValue = null) {
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
@ -276,7 +276,7 @@ class Style_Fill extends Style_Supervisor implements IComparable
/**
* Get End Color
*
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public function getEndColor() {
return $this->_endColor;
@ -285,11 +285,11 @@ class Style_Fill extends Style_Supervisor implements IComparable
/**
* Set End Color
*
* @param PHPExcel_Style_Color $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Fill
* @param PHPExcel\Style_Color $pValue
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Fill
*/
public function setEndColor(PHPExcel_Style_Color $pValue = null) {
public function setEndColor(Style_Color $pValue = null) {
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -32,7 +32,7 @@ namespace PHPExcel;
* PHPExcel\Style\Font
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Style_Font extends Style_Supervisor implements IComparable
@ -103,12 +103,12 @@ class Style_Font extends Style_Supervisor implements IComparable
/**
* Foreground color
*
* @var PHPExcel_Style_Color
* @var PHPExcel\Style_Color
*/
protected $_color;
/**
* Create a new PHPExcel_Style_Font
* Create a new PHPExcel\Style_Font
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -146,7 +146,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function getSharedComponent()
{
@ -173,7 +173,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* 'name' => 'Arial',
* 'bold' => TRUE,
* 'italic' => FALSE,
* 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE,
* 'underline' => PHPExcel\Style_Font::UNDERLINE_DOUBLE,
* 'strike' => FALSE,
* 'color' => array(
* 'rgb' => '808080'
@ -183,8 +183,8 @@ class Style_Font extends Style_Supervisor implements IComparable
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Font
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Font
*/
public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) {
@ -220,7 +220,7 @@ class Style_Font extends Style_Supervisor implements IComparable
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new Exception("Invalid style array passed.");
}
return $this;
}
@ -241,7 +241,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* Set Name
*
* @param string $pValue
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function setName($pValue = 'Calibri') {
if ($pValue == '') {
@ -272,7 +272,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* Set Size
*
* @param double $pValue
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function setSize($pValue = 10) {
if ($pValue == '') {
@ -303,7 +303,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* Set Bold
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function setBold($pValue = false) {
if ($pValue == '') {
@ -334,7 +334,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* Set Italic
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function setItalic($pValue = false) {
if ($pValue == '') {
@ -365,7 +365,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* Set SuperScript
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function setSuperScript($pValue = false) {
if ($pValue == '') {
@ -397,7 +397,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* Set SubScript
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function setSubScript($pValue = false) {
if ($pValue == '') {
@ -428,10 +428,10 @@ class Style_Font extends Style_Supervisor implements IComparable
/**
* Set Underline
*
* @param string|boolean $pValue PHPExcel_Style_Font underline type
* @param string|boolean $pValue PHPExcel\Style_Font underline type
* If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE,
* false equates to UNDERLINE_NONE
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function setUnderline($pValue = self::UNDERLINE_NONE) {
if (is_bool($pValue)) {
@ -464,7 +464,7 @@ class Style_Font extends Style_Supervisor implements IComparable
* Set Strikethrough
*
* @param boolean $pValue
* @return PHPExcel_Style_Font
* @return PHPExcel\Style_Font
*/
public function setStrikethrough($pValue = false) {
if ($pValue == '') {
@ -482,7 +482,7 @@ class Style_Font extends Style_Supervisor implements IComparable
/**
* Get Color
*
* @return PHPExcel_Style_Color
* @return PHPExcel\Style_Color
*/
public function getColor() {
return $this->_color;
@ -491,11 +491,11 @@ class Style_Font extends Style_Supervisor implements IComparable
/**
* Set Color
*
* @param PHPExcel_Style_Color $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Font
* @param PHPExcel\Style_Color $pValue
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Font
*/
public function setColor(PHPExcel_Style_Color $pValue = null) {
public function setColor(Style_Color $pValue = null) {
// make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Style_NumberFormat
* PHPExcel\Style_NumberFormat
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Style_NumberFormat extends Style_Supervisor implements IComparable
@ -106,7 +106,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
protected $_builtInFormatCode = 0;
/**
* Create a new PHPExcel_Style_NumberFormat
* Create a new PHPExcel\Style_NumberFormat
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -129,7 +129,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_NumberFormat
* @return PHPExcel\Style_NumberFormat
*/
public function getSharedComponent()
{
@ -153,14 +153,14 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
* <code>
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray(
* array(
* 'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
* 'code' => PHPExcel\Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
* )
* );
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_NumberFormat
* @throws PHPExcel\Exception
* @return PHPExcel\Style_NumberFormat
*/
public function applyFromArray($pStyles = null)
{
@ -173,7 +173,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
}
}
} else {
throw new PHPExcel_Exception("Invalid style array passed.");
throw new Exception("Invalid style array passed.");
}
return $this;
}
@ -199,7 +199,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
* Set Format Code
*
* @param string $pValue
* @return PHPExcel_Style_NumberFormat
* @return PHPExcel\Style_NumberFormat
*/
public function setFormatCode($pValue = Style_NumberFormat::FORMAT_GENERAL)
{
@ -233,7 +233,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
* Set Built-In Format Code
*
* @param int $pValue
* @return PHPExcel_Style_NumberFormat
* @return PHPExcel\Style_NumberFormat
*/
public function setBuiltInFormatCode($pValue = 0)
{
@ -258,7 +258,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
self::$_builtInFormats = array();
// General
self::$_builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
self::$_builtInFormats[0] = Style_NumberFormat::FORMAT_GENERAL;
self::$_builtInFormats[1] = '0';
self::$_builtInFormats[2] = '0.00';
self::$_builtInFormats[3] = '#,##0';
@ -452,7 +452,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
$format = strtr($format,self::$_dateFormatReplacements12);
}
$dateObj = PHPExcel_Shared_Date::ExcelToPHPObject($value);
$dateObj = Shared_Date::ExcelToPHPObject($value);
$value = $dateObj->format($format);
}
@ -483,7 +483,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
$decimalLength = strlen($decimalPart);
$decimalDivisor = pow(10,$decimalLength);
$GCD = PHPExcel_Calculation_MathTrig::GCD($decimalPart,$decimalDivisor);
$GCD = Calculation_MathTrig::GCD($decimalPart,$decimalDivisor);
$adjustedDecimalPart = $decimalPart/$GCD;
$adjustedDecimalDivisor = $decimalDivisor/$GCD;
@ -543,14 +543,14 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
* @param array $callBack Callback function for additional formatting of string
* @return string Formatted string
*/
public static function toFormattedString($value = '0', $format = PHPExcel_Style_NumberFormat::FORMAT_GENERAL, $callBack = null)
public static function toFormattedString($value = '0', $format = Style_NumberFormat::FORMAT_GENERAL, $callBack = null)
{
// For now we do not treat strings although section 4 of a format code affects strings
if (!is_numeric($value)) return $value;
// For 'General' format code, we just pass the value although this is not entirely the way Excel does it,
// it seems to round numbers to a total of 10 digits.
if (($format === PHPExcel_Style_NumberFormat::FORMAT_GENERAL) || ($format === PHPExcel_Style_NumberFormat::FORMAT_TEXT)) {
if (($format === Style_NumberFormat::FORMAT_GENERAL) || ($format === Style_NumberFormat::FORMAT_TEXT)) {
return $value;
}
@ -670,8 +670,8 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
$value = number_format(
$value
, strlen($right)
, PHPExcel_Shared_String::getDecimalSeparator()
, PHPExcel_Shared_String::getThousandsSeparator()
, Shared_String::getDecimalSeparator()
, Shared_String::getThousandsSeparator()
);
$value = preg_replace($number_regex, $value, $format);
} else {
@ -694,7 +694,7 @@ class Style_NumberFormat extends Style_Supervisor implements IComparable
$currencyCode = $m[1];
list($currencyCode) = explode('-',$currencyCode);
if ($currencyCode == '') {
$currencyCode = PHPExcel_Shared_String::getCurrencyCode();
$currencyCode = Shared_String::getCurrencyCode();
}
$value = preg_replace('/\[\$([^\]]*)\]/u',$currencyCode,$value);
}

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 1.4.5, 2007-08-23
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Style_Protection
* PHPExcel\Style_Protection
*
* @category PHPExcel
* @package PHPExcel_Style
* @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Style_Protection extends Style_Supervisor implements IComparable
@ -57,7 +57,7 @@ class Style_Protection extends Style_Supervisor implements IComparable
protected $_hidden;
/**
* Create a new PHPExcel_Style_Protection
* Create a new PHPExcel\Style_Protection
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -82,7 +82,7 @@ class Style_Protection extends Style_Supervisor implements IComparable
* Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor
*
* @return PHPExcel_Style_Protection
* @return PHPExcel\Style_Protection
*/
public function getSharedComponent()
{
@ -113,8 +113,8 @@ class Style_Protection extends Style_Supervisor implements IComparable
* </code>
*
* @param array $pStyles Array containing style information
* @throws PHPExcel_Exception
* @return PHPExcel_Style_Protection
* @throws PHPExcel\Exception
* @return PHPExcel\Style_Protection
*/
public function applyFromArray($pStyles = NULL) {
if (is_array($pStyles)) {
@ -150,7 +150,7 @@ class Style_Protection extends Style_Supervisor implements IComparable
* Set locked
*
* @param string $pValue
* @return PHPExcel_Style_Protection
* @return PHPExcel\Style_Protection
*/
public function setLocked($pValue = self::PROTECTION_INHERIT) {
if ($this->_isSupervisor) {
@ -178,7 +178,7 @@ class Style_Protection extends Style_Supervisor implements IComparable
* Set hidden
*
* @param string $pValue
* @return PHPExcel_Style_Protection
* @return PHPExcel\Style_Protection
*/
public function setHidden($pValue = self::PROTECTION_INHERIT) {
if ($this->_isSupervisor) {

View File

@ -47,12 +47,12 @@ abstract class Style_Supervisor
/**
* Parent. Only used for supervisor
*
* @var PHPExcel_Style
* @var PHPExcel\Style
*/
protected $_parent;
/**
* Create a new PHPExcel_Style_Alignment
* Create a new PHPExcel\Style_Alignment
*
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what
@ -68,7 +68,7 @@ abstract class Style_Supervisor
* Bind parent. Only used for supervisor
*
* @param PHPExcel $parent
* @return PHPExcel_Style_Supervisor
* @return PHPExcel\Style_Supervisor
*/
public function bindParent($parent, $parentPropertyName=NULL)
{
@ -89,7 +89,7 @@ abstract class Style_Supervisor
/**
* Get the currently active sheet. Only used for supervisor
*
* @return PHPExcel_Worksheet
* @return PHPExcel\Worksheet
*/
public function getActiveSheet()
{

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Worksheet_ColumnDimension
* PHPExcel\Worksheet_ColumnDimension
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Worksheet_ColumnDimension
@ -89,7 +89,7 @@ class Worksheet_ColumnDimension
private $_xfIndex;
/**
* Create a new PHPExcel_Worksheet_ColumnDimension
* Create a new PHPExcel\Worksheet_ColumnDimension
*
* @param string $pIndex Character column index
*/
@ -115,7 +115,7 @@ class Worksheet_ColumnDimension
* Set ColumnIndex
*
* @param string $pValue
* @return PHPExcel_Worksheet_ColumnDimension
* @return PHPExcel\Worksheet_ColumnDimension
*/
public function setColumnIndex($pValue) {
$this->_columnIndex = $pValue;
@ -135,7 +135,7 @@ class Worksheet_ColumnDimension
* Set Width
*
* @param double $pValue
* @return PHPExcel_Worksheet_ColumnDimension
* @return PHPExcel\Worksheet_ColumnDimension
*/
public function setWidth($pValue = -1) {
$this->_width = $pValue;
@ -155,7 +155,7 @@ class Worksheet_ColumnDimension
* Set Auto Size
*
* @param bool $pValue
* @return PHPExcel_Worksheet_ColumnDimension
* @return PHPExcel\Worksheet_ColumnDimension
*/
public function setAutoSize($pValue = false) {
$this->_autoSize = $pValue;
@ -175,7 +175,7 @@ class Worksheet_ColumnDimension
* Set Visible
*
* @param bool $pValue
* @return PHPExcel_Worksheet_ColumnDimension
* @return PHPExcel\Worksheet_ColumnDimension
*/
public function setVisible($pValue = true) {
$this->_visible = $pValue;
@ -197,12 +197,12 @@ class Worksheet_ColumnDimension
* Value must be between 0 and 7
*
* @param int $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_ColumnDimension
* @throws PHPExcel\Exception
* @return PHPExcel\Worksheet_ColumnDimension
*/
public function setOutlineLevel($pValue) {
if ($pValue < 0 || $pValue > 7) {
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
throw new Exception("Outline level must range between 0 and 7.");
}
$this->_outlineLevel = $pValue;
@ -222,7 +222,7 @@ class Worksheet_ColumnDimension
* Set Collapsed
*
* @param bool $pValue
* @return PHPExcel_Worksheet_ColumnDimension
* @return PHPExcel\Worksheet_ColumnDimension
*/
public function setCollapsed($pValue = true) {
$this->_collapsed = $pValue;
@ -243,7 +243,7 @@ class Worksheet_ColumnDimension
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Worksheet_ColumnDimension
* @return PHPExcel\Worksheet_ColumnDimension
*/
public function setXfIndex($pValue = 0)
{

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,7 +29,7 @@
namespace PHPExcel;
/**
* PHPExcel_Worksheet_HeaderFooter
* PHPExcel\Worksheet_HeaderFooter
*
* <code>
* Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970:
@ -92,7 +92,7 @@ namespace PHPExcel;
* </code>
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Worksheet_HeaderFooter
@ -178,12 +178,12 @@ class Worksheet_HeaderFooter
/**
* Header/footer images
*
* @var PHPExcel_Worksheet_HeaderFooterDrawing[]
* @var PHPExcel\Worksheet_HeaderFooterDrawing[]
*/
private $_headerFooterImages = array();
/**
* Create a new PHPExcel_Worksheet_HeaderFooter
* Create a new PHPExcel\Worksheet_HeaderFooter
*/
public function __construct()
{
@ -202,7 +202,7 @@ class Worksheet_HeaderFooter
* Set OddHeader
*
* @param string $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setOddHeader($pValue) {
$this->_oddHeader = $pValue;
@ -222,7 +222,7 @@ class Worksheet_HeaderFooter
* Set OddFooter
*
* @param string $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setOddFooter($pValue) {
$this->_oddFooter = $pValue;
@ -242,7 +242,7 @@ class Worksheet_HeaderFooter
* Set EvenHeader
*
* @param string $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setEvenHeader($pValue) {
$this->_evenHeader = $pValue;
@ -262,7 +262,7 @@ class Worksheet_HeaderFooter
* Set EvenFooter
*
* @param string $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setEvenFooter($pValue) {
$this->_evenFooter = $pValue;
@ -282,7 +282,7 @@ class Worksheet_HeaderFooter
* Set FirstHeader
*
* @param string $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setFirstHeader($pValue) {
$this->_firstHeader = $pValue;
@ -302,7 +302,7 @@ class Worksheet_HeaderFooter
* Set FirstFooter
*
* @param string $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setFirstFooter($pValue) {
$this->_firstFooter = $pValue;
@ -322,7 +322,7 @@ class Worksheet_HeaderFooter
* Set DifferentOddEven
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setDifferentOddEven($pValue = false) {
$this->_differentOddEven = $pValue;
@ -342,7 +342,7 @@ class Worksheet_HeaderFooter
* Set DifferentFirst
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setDifferentFirst($pValue = false) {
$this->_differentFirst = $pValue;
@ -362,7 +362,7 @@ class Worksheet_HeaderFooter
* Set ScaleWithDocument
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setScaleWithDocument($pValue = true) {
$this->_scaleWithDocument = $pValue;
@ -382,7 +382,7 @@ class Worksheet_HeaderFooter
* Set AlignWithMargins
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setAlignWithMargins($pValue = true) {
$this->_alignWithMargins = $pValue;
@ -392,12 +392,12 @@ class Worksheet_HeaderFooter
/**
* Add header/footer image
*
* @param PHPExcel_Worksheet_HeaderFooterDrawing $image
* @param PHPExcel\Worksheet_HeaderFooterDrawing $image
* @param string $location
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooter
* @throws PHPExcel\Exception
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT) {
public function addImage(Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT) {
$this->_headerFooterImages[$location] = $image;
return $this;
}
@ -406,8 +406,8 @@ class Worksheet_HeaderFooter
* Remove header/footer image
*
* @param string $location
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooter
* @throws PHPExcel\Exception
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function removeImage($location = self::IMAGE_HEADER_LEFT) {
if (isset($this->_headerFooterImages[$location])) {
@ -419,13 +419,13 @@ class Worksheet_HeaderFooter
/**
* Set header/footer images
*
* @param PHPExcel_Worksheet_HeaderFooterDrawing[] $images
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_HeaderFooter
* @param PHPExcel\Worksheet_HeaderFooterDrawing[] $images
* @throws PHPExcel\Exception
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setImages($images) {
if (!is_array($images)) {
throw new PHPExcel_Exception('Invalid parameter!');
throw new Exception('Invalid parameter!');
}
$this->_headerFooterImages = $images;
@ -435,7 +435,7 @@ class Worksheet_HeaderFooter
/**
* Get header/footer images
*
* @return PHPExcel_Worksheet_HeaderFooterDrawing[]
* @return PHPExcel\Worksheet_HeaderFooterDrawing[]
*/
public function getImages() {
// Sort array

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Worksheet_PageMargins
* PHPExcel\Worksheet_PageMargins
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Worksheet_PageMargins
@ -80,7 +80,7 @@ class Worksheet_PageMargins
private $_footer = 0.3;
/**
* Create a new PHPExcel_Worksheet_PageMargins
* Create a new PHPExcel\Worksheet_PageMargins
*/
public function __construct()
{
@ -99,7 +99,7 @@ class Worksheet_PageMargins
* Set Left
*
* @param double $pValue
* @return PHPExcel_Worksheet_PageMargins
* @return PHPExcel\Worksheet_PageMargins
*/
public function setLeft($pValue) {
$this->_left = $pValue;
@ -119,7 +119,7 @@ class Worksheet_PageMargins
* Set Right
*
* @param double $pValue
* @return PHPExcel_Worksheet_PageMargins
* @return PHPExcel\Worksheet_PageMargins
*/
public function setRight($pValue) {
$this->_right = $pValue;
@ -139,7 +139,7 @@ class Worksheet_PageMargins
* Set Top
*
* @param double $pValue
* @return PHPExcel_Worksheet_PageMargins
* @return PHPExcel\Worksheet_PageMargins
*/
public function setTop($pValue) {
$this->_top = $pValue;
@ -159,7 +159,7 @@ class Worksheet_PageMargins
* Set Bottom
*
* @param double $pValue
* @return PHPExcel_Worksheet_PageMargins
* @return PHPExcel\Worksheet_PageMargins
*/
public function setBottom($pValue) {
$this->_bottom = $pValue;
@ -179,7 +179,7 @@ class Worksheet_PageMargins
* Set Header
*
* @param double $pValue
* @return PHPExcel_Worksheet_PageMargins
* @return PHPExcel\Worksheet_PageMargins
*/
public function setHeader($pValue) {
$this->_header = $pValue;
@ -199,7 +199,7 @@ class Worksheet_PageMargins
* Set Footer
*
* @param double $pValue
* @return PHPExcel_Worksheet_PageMargins
* @return PHPExcel\Worksheet_PageMargins
*/
public function setFooter($pValue) {
$this->_footer = $pValue;

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,7 +29,7 @@
namespace PHPExcel;
/**
* PHPExcel_Worksheet_PageSetup
* PHPExcel\Worksheet_PageSetup
*
* <code>
* Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988:
@ -103,7 +103,7 @@ namespace PHPExcel;
* </code>
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Worksheet_PageSetup
@ -277,7 +277,7 @@ class Worksheet_PageSetup
private $_firstPageNumber = NULL;
/**
* Create a new PHPExcel_Worksheet_PageSetup
* Create a new PHPExcel\Worksheet_PageSetup
*/
public function __construct()
{
@ -296,9 +296,9 @@ class Worksheet_PageSetup
* Set Paper Size
*
* @param int $pValue
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER) {
public function setPaperSize($pValue = Worksheet_PageSetup::PAPERSIZE_LETTER) {
$this->_paperSize = $pValue;
return $this;
}
@ -316,9 +316,9 @@ class Worksheet_PageSetup
* Set Orientation
*
* @param string $pValue
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) {
public function setOrientation($pValue = Worksheet_PageSetup::ORIENTATION_DEFAULT) {
$this->_orientation = $pValue;
return $this;
}
@ -340,8 +340,8 @@ class Worksheet_PageSetup
*
* @param int? $pValue
* @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
* @return PHPExcel_Worksheet_PageSetup
* @throws PHPExcel_Exception
* @return PHPExcel\Worksheet_PageSetup
* @throws PHPExcel\Exception
*/
public function setScale($pValue = 100, $pUpdate = true) {
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
@ -352,7 +352,7 @@ class Worksheet_PageSetup
$this->_fitToPage = false;
}
} else {
throw new PHPExcel_Exception("Scale must not be negative");
throw new Exception("Scale must not be negative");
}
return $this;
}
@ -370,7 +370,7 @@ class Worksheet_PageSetup
* Set Fit To Page
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setFitToPage($pValue = TRUE) {
$this->_fitToPage = $pValue;
@ -391,7 +391,7 @@ class Worksheet_PageSetup
*
* @param int? $pValue
* @param boolean $pUpdate Update fitToPage so it applies rather than scaling
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setFitToHeight($pValue = 1, $pUpdate = TRUE) {
$this->_fitToHeight = $pValue;
@ -415,7 +415,7 @@ class Worksheet_PageSetup
*
* @param int? $pValue
* @param boolean $pUpdate Update fitToPage so it applies rather than scaling
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setFitToWidth($pValue = 1, $pUpdate = TRUE) {
$this->_fitToWidth = $pValue;
@ -453,7 +453,7 @@ class Worksheet_PageSetup
* Set Columns to repeat at left
*
* @param array $pValue Containing start column and end column, empty array if option unset
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setColumnsToRepeatAtLeft($pValue = null) {
if (is_array($pValue)) {
@ -467,7 +467,7 @@ class Worksheet_PageSetup
*
* @param string $pStart
* @param string $pEnd
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A') {
$this->_columnsToRepeatAtLeft = array($pStart, $pEnd);
@ -502,7 +502,7 @@ class Worksheet_PageSetup
* Set Rows to repeat at top
*
* @param array $pValue Containing start column and end column, empty array if option unset
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setRowsToRepeatAtTop($pValue = null) {
if (is_array($pValue)) {
@ -516,7 +516,7 @@ class Worksheet_PageSetup
*
* @param int $pStart
* @param int $pEnd
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1) {
$this->_rowsToRepeatAtTop = array($pStart, $pEnd);
@ -536,7 +536,7 @@ class Worksheet_PageSetup
* Set center page horizontally
*
* @param bool $value
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setHorizontalCentered($value = false) {
$this->_horizontalCentered = $value;
@ -556,7 +556,7 @@ class Worksheet_PageSetup
* Set center page vertically
*
* @param bool $value
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function setVerticalCentered($value = false) {
$this->_verticalCentered = $value;
@ -570,7 +570,7 @@ class Worksheet_PageSetup
* Default behaviour, or a index value of 0, will return all ranges as a comma-separated string
* Otherwise, the specific range identified by the value of $index will be returned
* Print areas are numbered from 1
* @throws PHPExcel_Exception
* @throws PHPExcel\Exception
* @return string
*/
public function getPrintArea($index = 0) {
@ -581,7 +581,7 @@ class Worksheet_PageSetup
if (isset($printAreas[$index-1])) {
return $printAreas[$index-1];
}
throw new PHPExcel_Exception("Requested Print Area does not exist");
throw new Exception("Requested Print Area does not exist");
}
/**
@ -608,7 +608,7 @@ class Worksheet_PageSetup
* Default behaviour, or an index value of 0, will clear all print ranges that are set
* Otherwise, the range identified by the value of $index will be removed from the series
* Print areas are numbered from 1
* @return PHPExcel_Worksheet_PageSetup
* @return PHPExcel\Worksheet_PageSetup
*/
public function clearPrintArea($index = 0) {
if ($index == 0) {
@ -641,16 +641,16 @@ class Worksheet_PageSetup
* @param string $method Determines the method used when setting multiple print areas
* Default behaviour, or the "O" method, overwrites existing print area
* The "I" method, inserts the new print area before any specified index, or at the end of the list
* @return PHPExcel_Worksheet_PageSetup
* @throws PHPExcel_Exception
* @return PHPExcel\Worksheet_PageSetup
* @throws PHPExcel\Exception
*/
public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE) {
if (strpos($value,'!') !== false) {
throw new PHPExcel_Exception('Cell coordinate must not specify a worksheet.');
throw new Exception('Cell coordinate must not specify a worksheet.');
} elseif (strpos($value,':') === false) {
throw new PHPExcel_Exception('Cell coordinate must be a range of cells.');
throw new Exception('Cell coordinate must be a range of cells.');
} elseif (strpos($value,'$') !== false) {
throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
throw new Exception('Cell coordinate must not be absolute.');
}
$value = strtoupper($value);
@ -663,7 +663,7 @@ class Worksheet_PageSetup
$index = count($printAreas) - abs($index) + 1;
}
if (($index <= 0) || ($index > count($printAreas))) {
throw new PHPExcel_Exception('Invalid index for setting print range.');
throw new Exception('Invalid index for setting print range.');
}
$printAreas[$index-1] = $value;
$this->_printArea = implode(',',$printAreas);
@ -677,13 +677,13 @@ class Worksheet_PageSetup
$index = abs($index) - 1;
}
if ($index > count($printAreas)) {
throw new PHPExcel_Exception('Invalid index for setting print range.');
throw new Exception('Invalid index for setting print range.');
}
$printAreas = array_merge(array_slice($printAreas,0,$index),array($value),array_slice($printAreas,$index));
$this->_printArea = implode(',',$printAreas);
}
} else {
throw new PHPExcel_Exception('Invalid method for setting print range.');
throw new Exception('Invalid method for setting print range.');
}
return $this;
@ -699,8 +699,8 @@ class Worksheet_PageSetup
* Specifying an index value of 0, will always append the new print range at the end of the
* list.
* Print areas are numbered from 1
* @return PHPExcel_Worksheet_PageSetup
* @throws PHPExcel_Exception
* @return PHPExcel\Worksheet_PageSetup
* @throws PHPExcel\Exception
*/
public function addPrintArea($value, $index = -1) {
return $this->setPrintArea($value, $index, self::SETPRINTRANGE_INSERT);
@ -726,12 +726,12 @@ class Worksheet_PageSetup
* @param string $method Determines the method used when setting multiple print areas
* Default behaviour, or the "O" method, overwrites existing print area
* The "I" method, inserts the new print area before any specified index, or at the end of the list
* @return PHPExcel_Worksheet_PageSetup
* @throws PHPExcel_Exception
* @return PHPExcel\Worksheet_PageSetup
* @throws PHPExcel\Exception
*/
public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
{
return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, $index, $method);
return $this->setPrintArea(Cell::stringFromColumnIndex($column1) . $row1 . ':' . Cell::stringFromColumnIndex($column2) . $row2, $index, $method);
}
/**
@ -747,12 +747,12 @@ class Worksheet_PageSetup
* Specifying an index value of 0, will always append the new print range at the end of the
* list.
* Print areas are numbered from 1
* @return PHPExcel_Worksheet_PageSetup
* @throws PHPExcel_Exception
* @return PHPExcel\Worksheet_PageSetup
* @throws PHPExcel\Exception
*/
public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
{
return $this->setPrintArea(PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2, $index, self::SETPRINTRANGE_INSERT);
return $this->setPrintArea(Cell::stringFromColumnIndex($column1) . $row1 . ':' . Cell::stringFromColumnIndex($column2) . $row2, $index, self::SETPRINTRANGE_INSERT);
}
/**
@ -768,7 +768,7 @@ class Worksheet_PageSetup
* Set first page number
*
* @param int $value
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function setFirstPageNumber($value = null) {
$this->_firstPageNumber = $value;
@ -778,7 +778,7 @@ class Worksheet_PageSetup
/**
* Reset first page number
*
* @return PHPExcel_Worksheet_HeaderFooter
* @return PHPExcel\Worksheet_HeaderFooter
*/
public function resetFirstPageNumber() {
return $this->setFirstPageNumber(null);

View File

@ -32,7 +32,7 @@ namespace PHPExcel;
* PHPExcel_Worksheet_Protection
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Worksheet_Protection
@ -157,7 +157,7 @@ class Worksheet_Protection
private $_password = '';
/**
* Create a new PHPExcel_Worksheet_Protection
* Create a new PHPExcel\Worksheet_Protection
*/
public function __construct()
{
@ -200,7 +200,7 @@ class Worksheet_Protection
* Set Sheet
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setSheet($pValue = false) {
$this->_sheet = $pValue;
@ -220,7 +220,7 @@ class Worksheet_Protection
* Set Objects
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setObjects($pValue = false) {
$this->_objects = $pValue;
@ -240,7 +240,7 @@ class Worksheet_Protection
* Set Scenarios
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setScenarios($pValue = false) {
$this->_scenarios = $pValue;
@ -260,7 +260,7 @@ class Worksheet_Protection
* Set FormatCells
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setFormatCells($pValue = false) {
$this->_formatCells = $pValue;
@ -280,7 +280,7 @@ class Worksheet_Protection
* Set FormatColumns
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setFormatColumns($pValue = false) {
$this->_formatColumns = $pValue;
@ -300,7 +300,7 @@ class Worksheet_Protection
* Set FormatRows
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setFormatRows($pValue = false) {
$this->_formatRows = $pValue;
@ -320,7 +320,7 @@ class Worksheet_Protection
* Set InsertColumns
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setInsertColumns($pValue = false) {
$this->_insertColumns = $pValue;
@ -340,7 +340,7 @@ class Worksheet_Protection
* Set InsertRows
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setInsertRows($pValue = false) {
$this->_insertRows = $pValue;
@ -360,7 +360,7 @@ class Worksheet_Protection
* Set InsertHyperlinks
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setInsertHyperlinks($pValue = false) {
$this->_insertHyperlinks = $pValue;
@ -380,7 +380,7 @@ class Worksheet_Protection
* Set DeleteColumns
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setDeleteColumns($pValue = false) {
$this->_deleteColumns = $pValue;
@ -400,7 +400,7 @@ class Worksheet_Protection
* Set DeleteRows
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setDeleteRows($pValue = false) {
$this->_deleteRows = $pValue;
@ -420,7 +420,7 @@ class Worksheet_Protection
* Set SelectLockedCells
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setSelectLockedCells($pValue = false) {
$this->_selectLockedCells = $pValue;
@ -440,7 +440,7 @@ class Worksheet_Protection
* Set Sort
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setSort($pValue = false) {
$this->_sort = $pValue;
@ -460,7 +460,7 @@ class Worksheet_Protection
* Set AutoFilter
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setAutoFilter($pValue = false) {
$this->_autoFilter = $pValue;
@ -480,7 +480,7 @@ class Worksheet_Protection
* Set PivotTables
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setPivotTables($pValue = false) {
$this->_pivotTables = $pValue;
@ -500,7 +500,7 @@ class Worksheet_Protection
* Set SelectUnlockedCells
*
* @param boolean $pValue
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setSelectUnlockedCells($pValue = false) {
$this->_selectUnlockedCells = $pValue;
@ -521,11 +521,11 @@ class Worksheet_Protection
*
* @param string $pValue
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
* @return PHPExcel_Worksheet_Protection
* @return PHPExcel\Worksheet_Protection
*/
function setPassword($pValue = '', $pAlreadyHashed = false) {
if (!$pAlreadyHashed) {
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
$pValue = Shared_PasswordHasher::hashPassword($pValue);
}
$this->_password = $pValue;
return $this;

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel;
/**
* PHPExcel_Worksheet_RowDimension
* PHPExcel\Worksheet_RowDimension
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/
class Worksheet_RowDimension
@ -89,7 +89,7 @@ class Worksheet_RowDimension
private $_xfIndex;
/**
* Create a new PHPExcel_Worksheet_RowDimension
* Create a new PHPExcel\Worksheet_RowDimension
*
* @param int $pIndex Numeric row index
*/
@ -115,7 +115,7 @@ class Worksheet_RowDimension
* Set Row Index
*
* @param int $pValue
* @return PHPExcel_Worksheet_RowDimension
* @return PHPExcel\Worksheet_RowDimension
*/
public function setRowIndex($pValue) {
$this->_rowIndex = $pValue;
@ -135,7 +135,7 @@ class Worksheet_RowDimension
* Set Row Height
*
* @param double $pValue
* @return PHPExcel_Worksheet_RowDimension
* @return PHPExcel\Worksheet_RowDimension
*/
public function setRowHeight($pValue = -1) {
$this->_rowHeight = $pValue;
@ -155,7 +155,7 @@ class Worksheet_RowDimension
* Set ZeroHeight
*
* @param bool $pValue
* @return PHPExcel_Worksheet_RowDimension
* @return PHPExcel\Worksheet_RowDimension
*/
public function setzeroHeight($pValue = false) {
$this->_zeroHeight = $pValue;
@ -175,7 +175,7 @@ class Worksheet_RowDimension
* Set Visible
*
* @param bool $pValue
* @return PHPExcel_Worksheet_RowDimension
* @return PHPExcel\Worksheet_RowDimension
*/
public function setVisible($pValue = true) {
$this->_visible = $pValue;
@ -197,12 +197,12 @@ class Worksheet_RowDimension
* Value must be between 0 and 7
*
* @param int $pValue
* @throws PHPExcel_Exception
* @return PHPExcel_Worksheet_RowDimension
* @throws PHPExcel\Exception
* @return PHPExcel\Worksheet_RowDimension
*/
public function setOutlineLevel($pValue) {
if ($pValue < 0 || $pValue > 7) {
throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
throw new Exception("Outline level must range between 0 and 7.");
}
$this->_outlineLevel = $pValue;
@ -222,7 +222,7 @@ class Worksheet_RowDimension
* Set Collapsed
*
* @param bool $pValue
* @return PHPExcel_Worksheet_RowDimension
* @return PHPExcel\Worksheet_RowDimension
*/
public function setCollapsed($pValue = true) {
$this->_collapsed = $pValue;
@ -243,7 +243,7 @@ class Worksheet_RowDimension
* Set index to cellXf
*
* @param int $pValue
* @return PHPExcel_Worksheet_RowDimension
* @return PHPExcel\Worksheet_RowDimension
*/
public function setXfIndex($pValue = 0)
{

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category PHPExcel
* @package PHPExcel_Worksheet
* @package PHPExcel\Worksheet
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
@ -29,7 +29,7 @@
namespace PHPExcel;
/**
* PHPExcel_Worksheet_SheetView
* PHPExcel\Worksheet_SheetView
*
* @category PHPExcel
* @package PHPExcel\Worksheet

View File

@ -33,13 +33,13 @@ date_default_timezone_set('Europe/London');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
/** Include PHPExcel */
require_once '../Classes/PHPExcel.php';
/** Include PHPExcel Bootstrap */
require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel\Workbook();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
@ -80,11 +80,11 @@ $objPHPExcel->getActiveSheet()->setTitle('Simple');
$objPHPExcel->setActiveSheetIndex(0);
// Save Excel 2007 file
// Save as an Excel 2007 file
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
@ -95,11 +95,11 @@ echo 'Call time to write Workbook was ' , sprintf('%.4f',$callTime) , " seconds"
echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024 / 1024) , " MB" , EOL;
// Save Excel 95 file
// Save as an Excel 95 file
echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;

View File

@ -33,13 +33,13 @@ date_default_timezone_set('Europe/London');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
/** Include PHPExcel */
require_once '../Classes/PHPExcel.php';
/** Include PHPExcel Bootstrap */
require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel\Workbook();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
@ -93,28 +93,28 @@ $objPHPExcel->getActiveSheet()->setCellValue('A8', 'Boolean')
$dateTimeNow = time();
$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time')
->setCellValue('B9', 'Date')
->setCellValue('C9', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C9')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2);
->setCellValue('C9', PHPExcel\Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C9')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_DATE_YYYYMMDD2);
$objPHPExcel->getActiveSheet()->setCellValue('A10', 'Date/Time')
->setCellValue('B10', 'Time')
->setCellValue('C10', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C10')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4);
->setCellValue('C10', PHPExcel\Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C10')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_DATE_TIME4);
$objPHPExcel->getActiveSheet()->setCellValue('A11', 'Date/Time')
->setCellValue('B11', 'Date and Time')
->setCellValue('C11', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C11')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME);
->setCellValue('C11', PHPExcel\Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C11')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_DATE_DATETIME);
$objPHPExcel->getActiveSheet()->setCellValue('A12', 'NULL')
->setCellValue('C12', NULL);
$objRichText = new PHPExcel_RichText();
$objRichText = new PHPExcel\RichText();
$objRichText->createText('你好 ');
$objPayable = $objRichText->createTextRun('你 好 吗?');
$objPayable->getFont()->setBold(true);
$objPayable->getFont()->setItalic(true);
$objPayable->getFont()->setColor( new PHPExcel_Style_Color( PHPExcel_Style_Color::COLOR_DARKGREEN ) );
$objPayable->getFont()->setColor( new PHPExcel\Style_Color( PHPExcel\Style_Color::COLOR_DARKGREEN ) );
$objRichText->createText(', unless specified otherwise on the invoice.');
@ -137,7 +137,7 @@ $objPHPExcel->setActiveSheetIndex(0);
echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__));
echo date('H:i:s') , " File written to " , str_replace('.php', '.xls', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;
$callEndTime = microtime(true);
@ -152,7 +152,7 @@ echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024
echo date('H:i:s') , " Reload workbook from saved file" , EOL;
$callStartTime = microtime(true);
$objPHPExcel = PHPExcel_IOFactory::load(str_replace('.php', '.xls', __FILE__));
$objPHPExcel = PHPExcel\IOFactory::load(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;

View File

@ -33,13 +33,13 @@ date_default_timezone_set('Europe/London');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
/** Include PHPExcel */
require_once '../Classes/PHPExcel.php';
/** Include PHPExcel Bootstrap */
require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel\Workbook();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
@ -93,29 +93,29 @@ $objPHPExcel->getActiveSheet()->setCellValue('A8', 'Boolean')
$dateTimeNow = time();
$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Date/Time')
->setCellValue('B9', 'Date')
->setCellValue('C9', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C9')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2);
->setCellValue('C9', PHPExcel\Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C9')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_DATE_YYYYMMDD2);
$objPHPExcel->getActiveSheet()->setCellValue('A10', 'Date/Time')
->setCellValue('B10', 'Time')
->setCellValue('C10', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C10')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4);
->setCellValue('C10', PHPExcel\Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C10')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_DATE_TIME4);
$objPHPExcel->getActiveSheet()->setCellValue('A11', 'Date/Time')
->setCellValue('B11', 'Date and Time')
->setCellValue('C11', PHPExcel_Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C11')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME);
->setCellValue('C11', PHPExcel\Shared_Date::PHPToExcel( $dateTimeNow ));
$objPHPExcel->getActiveSheet()->getStyle('C11')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_DATE_DATETIME);
$objPHPExcel->getActiveSheet()->setCellValue('A12', 'NULL')
->setCellValue('C12', NULL);
$objRichText = new PHPExcel_RichText();
$objRichText = new PHPExcel\RichText();
$objRichText->createText('你好 ');
$objPayable = $objRichText->createTextRun('你 好 吗?');
$objPayable->getFont()->setBold(true);
$objPayable->getFont()->setItalic(true);
$objPayable->getFont()->setColor( new PHPExcel_Style_Color( PHPExcel_Style_Color::COLOR_DARKGREEN ) );
$objPayable->getFont()->setColor( new PHPExcel\Style_Color( PHPExcel\Style_Color::COLOR_DARKGREEN ) );
$objRichText->createText(', unless specified otherwise on the invoice.');
@ -139,7 +139,7 @@ $objPHPExcel->setActiveSheetIndex(0);
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
@ -153,7 +153,7 @@ echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024
echo date('H:i:s') , " Reload workbook from saved file" , EOL;
$callStartTime = microtime(true);
$objPHPExcel = PHPExcel_IOFactory::load(str_replace('.php', '.xlsx', __FILE__));
$objPHPExcel = PHPExcel\IOFactory::load(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;

View File

@ -33,13 +33,13 @@ date_default_timezone_set('Europe/London');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
/** Include PHPExcel */
require_once '../Classes/PHPExcel.php';
/** Include PHPExcel Bootstrap */
require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel\Workbook();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
@ -106,7 +106,7 @@ $objPHPExcel->setActiveSheetIndex(0);
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
@ -121,7 +121,7 @@ echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024
echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;

View File

@ -34,13 +34,13 @@ define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
/** Include PHPExcel */
require_once '../Classes/PHPExcel.php';
/** Include PHPExcel Bootstrap */
require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel\Workbook();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
@ -67,16 +67,16 @@ $objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddFooter('&L&B' . $objPHP
// Add a drawing to the header
echo date('H:i:s') , " Add a drawing to the header" , EOL;
$objDrawing = new PHPExcel_Worksheet_HeaderFooterDrawing();
$objDrawing = new PHPExcel\Worksheet_HeaderFooterDrawing();
$objDrawing->setName('PHPExcel logo');
$objDrawing->setPath('./images/phpexcel_logo.gif');
$objDrawing->setHeight(36);
$objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT);
$objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($objDrawing, PHPExcel\Worksheet_HeaderFooter::IMAGE_HEADER_LEFT);
// Set page orientation and size
echo date('H:i:s') , " Set page orientation and size" , EOL;
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel\Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel\Worksheet_PageSetup::PAPERSIZE_A4);
// Rename worksheet
echo date('H:i:s') , " Rename worksheet" , EOL;
@ -91,7 +91,7 @@ $objPHPExcel->setActiveSheetIndex(0);
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
@ -106,7 +106,7 @@ echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024
echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;

View File

@ -28,13 +28,13 @@
/** Error reporting */
error_reporting(E_ALL);
/** Include PHPExcel */
require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
/** Include PHPExcel Bootstrap */
require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel\Workbook();
// Set document properties
echo date('H:i:s') , " Set document properties" , EOL;
@ -51,8 +51,8 @@ $objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
echo date('H:i:s') , " Add some data" , EOL;
$objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->setCellValue('B1', 'Invoice');
$objPHPExcel->getActiveSheet()->setCellValue('D1', PHPExcel_Shared_Date::PHPToExcel( gmmktime(0,0,0,date('m'),date('d'),date('Y')) ));
$objPHPExcel->getActiveSheet()->getStyle('D1')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15);
$objPHPExcel->getActiveSheet()->setCellValue('D1', PHPExcel\Shared_Date::PHPToExcel( gmmktime(0,0,0,date('m'),date('d'),date('Y')) ));
$objPHPExcel->getActiveSheet()->getStyle('D1')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_DATE_XLSX15);
$objPHPExcel->getActiveSheet()->setCellValue('E1', '#12566');
$objPHPExcel->getActiveSheet()->setCellValue('A3', 'Product Id');
@ -115,13 +115,13 @@ $objPHPExcel->getActiveSheet()->getComment('E13')->getFillColor()->setRGB('EEEEE
// Add rich-text string
echo date('H:i:s') , " Add rich-text string" , EOL;
$objRichText = new PHPExcel_RichText();
$objRichText = new PHPExcel\RichText();
$objRichText->createText('This invoice is ');
$objPayable = $objRichText->createTextRun('payable within thirty days after the end of the month');
$objPayable->getFont()->setBold(true);
$objPayable->getFont()->setItalic(true);
$objPayable->getFont()->setColor( new PHPExcel_Style_Color( PHPExcel_Style_Color::COLOR_DARKGREEN ) );
$objPayable->getFont()->setColor( new PHPExcel\Style_Color( PHPExcel\Style_Color::COLOR_DARKGREEN ) );
$objRichText->createText(', unless specified otherwise on the invoice.');
@ -140,7 +140,7 @@ $objPHPExcel->getActiveSheet()->protectCells('A3:E13', 'PHPExcel');
// Set cell number formats
echo date('H:i:s') , " Set cell number formats" , EOL;
$objPHPExcel->getActiveSheet()->getStyle('E4:E13')->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE);
$objPHPExcel->getActiveSheet()->getStyle('E4:E13')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE);
// Set column widths
echo date('H:i:s') , " Set column widths" , EOL;
@ -153,23 +153,23 @@ echo date('H:i:s') , " Set fonts" , EOL;
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setName('Candara');
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setSize(20);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setUnderline(PHPExcel\Style_Font::UNDERLINE_SINGLE);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->getColor()->setARGB(PHPExcel\Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('D1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('E1')->getFont()->getColor()->setARGB(PHPExcel_Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('D1')->getFont()->getColor()->setARGB(PHPExcel\Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('E1')->getFont()->getColor()->setARGB(PHPExcel\Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('D13')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('E13')->getFont()->setBold(true);
// Set alignments
echo date('H:i:s') , " Set alignments" , EOL;
$objPHPExcel->getActiveSheet()->getStyle('D11')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('D12')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('D13')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('D11')->getAlignment()->setHorizontal(PHPExcel\Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('D12')->getAlignment()->setHorizontal(PHPExcel\Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('D13')->getAlignment()->setHorizontal(PHPExcel\Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('A18')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY);
$objPHPExcel->getActiveSheet()->getStyle('A18')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('A18')->getAlignment()->setHorizontal(PHPExcel\Style_Alignment::HORIZONTAL_JUSTIFY);
$objPHPExcel->getActiveSheet()->getStyle('A18')->getAlignment()->setVertical(PHPExcel\Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('B5')->getAlignment()->setShrinkToFit(true);
@ -178,7 +178,7 @@ echo date('H:i:s') , " Set thin black border outline around column" , EOL;
$styleThinBlackBorderOutline = array(
'borders' => array(
'outline' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN,
'style' => PHPExcel\Style_Border::BORDER_THIN,
'color' => array('argb' => 'FF000000'),
),
),
@ -191,7 +191,7 @@ echo date('H:i:s') , " Set thick brown border outline around Total" , EOL;
$styleThickBrownBorderOutline = array(
'borders' => array(
'outline' => array(
'style' => PHPExcel_Style_Border::BORDER_THICK,
'style' => PHPExcel\Style_Border::BORDER_THICK,
'color' => array('argb' => 'FF993300'),
),
),
@ -200,7 +200,7 @@ $objPHPExcel->getActiveSheet()->getStyle('D13:E13')->applyFromArray($styleThickB
// Set fills
echo date('H:i:s') , " Set fills" , EOL;
$objPHPExcel->getActiveSheet()->getStyle('A1:E1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('A1:E1')->getFill()->setFillType(PHPExcel\Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('A1:E1')->getFill()->getStartColor()->setARGB('FF808080');
// Set style for header row using alternative method
@ -211,15 +211,15 @@ $objPHPExcel->getActiveSheet()->getStyle('A3:E3')->applyFromArray(
'bold' => true
),
'alignment' => array(
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT,
'horizontal' => PHPExcel\Style_Alignment::HORIZONTAL_RIGHT,
),
'borders' => array(
'top' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
'style' => PHPExcel\Style_Border::BORDER_THIN
)
),
'fill' => array(
'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR,
'type' => PHPExcel\Style_Fill::FILL_GRADIENT_LINEAR,
'rotation' => 90,
'startcolor' => array(
'argb' => 'FFA0A0A0'
@ -234,11 +234,11 @@ $objPHPExcel->getActiveSheet()->getStyle('A3:E3')->applyFromArray(
$objPHPExcel->getActiveSheet()->getStyle('A3')->applyFromArray(
array(
'alignment' => array(
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,
'horizontal' => PHPExcel\Style_Alignment::HORIZONTAL_LEFT,
),
'borders' => array(
'left' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
'style' => PHPExcel\Style_Border::BORDER_THIN
)
)
)
@ -247,7 +247,7 @@ $objPHPExcel->getActiveSheet()->getStyle('A3')->applyFromArray(
$objPHPExcel->getActiveSheet()->getStyle('B3')->applyFromArray(
array(
'alignment' => array(
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,
'horizontal' => PHPExcel\Style_Alignment::HORIZONTAL_LEFT,
)
)
);
@ -256,7 +256,7 @@ $objPHPExcel->getActiveSheet()->getStyle('E3')->applyFromArray(
array(
'borders' => array(
'right' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN
'style' => PHPExcel\Style_Border::BORDER_THIN
)
)
)
@ -264,23 +264,23 @@ $objPHPExcel->getActiveSheet()->getStyle('E3')->applyFromArray(
// Unprotect a cell
echo date('H:i:s') , " Unprotect a cell" , EOL;
$objPHPExcel->getActiveSheet()->getStyle('B1')->getProtection()->setLocked(PHPExcel_Style_Protection::PROTECTION_UNPROTECTED);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getProtection()->setLocked(PHPExcel\Style_Protection::PROTECTION_UNPROTECTED);
// Add a hyperlink to the sheet
echo date('H:i:s') , " Add a hyperlink to the sheet" , EOL;
$objPHPExcel->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
$objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net');
$objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setTooltip('Navigate to website');
$objPHPExcel->getActiveSheet()->getStyle('E26')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('E26')->getAlignment()->setHorizontal(PHPExcel\Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->setCellValue('E27', 'Terms and conditions');
$objPHPExcel->getActiveSheet()->getCell('E27')->getHyperlink()->setUrl("sheet://'Terms and conditions'!A1");
$objPHPExcel->getActiveSheet()->getCell('E27')->getHyperlink()->setTooltip('Review terms and conditions');
$objPHPExcel->getActiveSheet()->getStyle('E27')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('E27')->getAlignment()->setHorizontal(PHPExcel\Style_Alignment::HORIZONTAL_RIGHT);
// Add a drawing to the worksheet
echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing = new PHPExcel\Worksheet_Drawing();
$objDrawing->setName('Logo');
$objDrawing->setDescription('Logo');
$objDrawing->setPath('./images/officelogo.jpg');
@ -289,7 +289,7 @@ $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
// Add a drawing to the worksheet
echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing = new PHPExcel\Worksheet_Drawing();
$objDrawing->setName('Paid');
$objDrawing->setDescription('Paid');
$objDrawing->setPath('./images/paid.png');
@ -302,7 +302,7 @@ $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
// Add a drawing to the worksheet
echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing = new PHPExcel\Worksheet_Drawing();
$objDrawing->setName('PHPExcel logo');
$objDrawing->setDescription('PHPExcel logo');
$objDrawing->setPath('./images/phpexcel_logo.gif');
@ -325,8 +325,8 @@ $objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddFooter('&L&B' . $objPHP
// Set page orientation and size
echo date('H:i:s') , " Set page orientation and size" , EOL;
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel\Worksheet_PageSetup::ORIENTATION_PORTRAIT);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel\Worksheet_PageSetup::PAPERSIZE_A4);
// Rename first worksheet
echo date('H:i:s') , " Rename first worksheet" , EOL;
@ -366,13 +366,13 @@ echo date('H:i:s') , " Set fonts" , EOL;
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setName('Candara');
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setSize(20);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setUnderline(PHPExcel\Style_Font::UNDERLINE_SINGLE);
$objPHPExcel->getActiveSheet()->getStyle('A3:A6')->getFont()->setSize(8);
// Add a drawing to the worksheet
echo date('H:i:s') , " Add a drawing to the worksheet" , EOL;
$objDrawing = new PHPExcel_Worksheet_Drawing();
$objDrawing = new PHPExcel\Worksheet_Drawing();
$objDrawing->setName('Terms and conditions');
$objDrawing->setDescription('Terms and conditions');
$objDrawing->setPath('./images/termsconditions.jpg');
@ -381,8 +381,8 @@ $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
// Set page orientation and size
echo date('H:i:s') , " Set page orientation and size" , EOL;
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel\Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel\Worksheet_PageSetup::PAPERSIZE_A4);
// Rename second worksheet
echo date('H:i:s') , " Rename second worksheet" , EOL;

View File

@ -36,15 +36,12 @@ date_default_timezone_set('Europe/London');
include "05featuredemo.inc.php";
/** Include PHPExcel_IOFactory */
require_once '../Classes/PHPExcel/IOFactory.php';
// Save Excel 2007 file
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;
@ -59,7 +56,7 @@ echo date('H:i:s') , ' Current memory usage: ' , (memory_get_usage(true) / 1024
echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;

View File

@ -34,19 +34,19 @@ define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
/** Include PHPExcel */
require_once '../Classes/PHPExcel.php';
/** Include PHPExcel Bootstrap */
require_once '../Classes/Bootstrap.php';
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_in_memory_gzip;
if (!PHPExcel_Settings::setCacheStorageMethod($cacheMethod)) {
$cacheMethod = PHPExcel\CachedObjectStorageFactory::cache_in_memory_gzip;
if (!PHPExcel\Settings::setCacheStorageMethod($cacheMethod)) {
die($cacheMethod . " caching method is not available" . EOL);
}
echo date('H:i:s') , " Enable Cell Caching using " , $cacheMethod , " method" , EOL;
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel\Workbook();
// Set document properties
echo date('H:i:s') , " Set properties" , EOL;
@ -109,7 +109,7 @@ $objPHPExcel->setActiveSheetIndex(0);
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;

View File

@ -34,9 +34,8 @@ define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
/** Include PHPExcel */
require_once '../Classes/PHPExcel.php';
/** Include PHPExcel Bootstrap */
require_once '../Classes/Bootstrap.php';
/*
After doing some test, I've got these results benchmarked
@ -53,8 +52,9 @@ for writing to Excel2007:
*/
// Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL;
$objPHPExcel = new PHPExcel();
echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel\Workbook();
// Set document properties
echo date('H:i:s') , " Set properties" , EOL;
@ -117,7 +117,7 @@ $objPHPExcel->setActiveSheetIndex(0);
echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime;