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) 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))) { if (null === $this->_namespace || $this->_namespace.$this->_namespaceSeparator === substr($className, 0, strlen($this->_namespace.$this->_namespaceSeparator))) {
$fileName = ''; $fileName = '';
$namespace = ''; $namespace = '';

View File

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

View File

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

View File

@ -76,13 +76,13 @@ class Reader_Excel2007 extends Reader_Abstract implements Reader_IReader
} }
// Check if zip class exists // Check if zip class exists
if (!class_exists('ZipArchive',FALSE)) { if (!class_exists('\ZipArchive',FALSE)) {
throw new Reader_Exception("ZipArchive library is not enabled"); throw new Reader_Exception("ZipArchive library is not enabled");
} }
$xl = false; $xl = false;
// Load file // Load file
$zip = new ZipArchive; $zip = new \ZipArchive;
if ($zip->open($pFilename) === true) { if ($zip->open($pFilename) === true) {
// check if it is an OOXML archive // check if it is an OOXML archive
$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); $rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels"));
@ -120,7 +120,7 @@ class Reader_Excel2007 extends Reader_Abstract implements Reader_IReader
$worksheetNames = array(); $worksheetNames = array();
$zip = new ZipArchive; $zip = new \ZipArchive;
$zip->open($pFilename); $zip->open($pFilename);
// The files we're looking at here are small enough that simpleXML is more efficient than XMLReader // 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(); $worksheetInfo = array();
$zip = new ZipArchive; $zip = new \ZipArchive;
$zip->open($pFilename); $zip->open($pFilename);
$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); //~ http://schemas.openxmlformats.org/package/2006/relationships"); $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 // Root-relative paths
if (strpos($fileName, '//') !== false) 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->removeCellStyleXfByIndex(0); // remove the default style
$excel->removeCellXfByIndex(0); // remove the default style $excel->removeCellXfByIndex(0); // remove the default style
} }
$zip = new ZipArchive; $zip = new \ZipArchive;
$zip->open($pFilename); $zip->open($pFilename);
// Read the theme first, because we need the colour scheme when reading the styles // 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 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Style * @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel; namespace PHPExcel;
/** /**
* PHPExcel_Style_Border * PHPExcel\Style_Border
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Style * @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class Style_Border extends Style_Supervisor implements IComparable class Style_Border extends Style_Supervisor implements IComparable
@ -63,7 +63,7 @@ class Style_Border extends Style_Supervisor implements IComparable
/** /**
* Border color * Border color
* *
* @var PHPExcel_Style_Color * @var PHPExcel\Style_Color
*/ */
protected $_color; protected $_color;
@ -75,7 +75,7 @@ class Style_Border extends Style_Supervisor implements IComparable
protected $_parentPropertyName; 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 * @param boolean $isSupervisor Flag indicating if this is a supervisor or not
* Leave this value at default unless you understand exactly what * 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 * Bind parent. Only used for supervisor
* *
* @param PHPExcel_Style_Borders $parent * @param PHPExcel\Style_Borders $parent
* @param string $parentPropertyName * @param string $parentPropertyName
* @return PHPExcel_Style_Border * @return PHPExcel\Style_Border
*/ */
public function bindParent($parent, $parentPropertyName=NULL) 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. * Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor * Only used for style supervisor
* *
* @return PHPExcel_Style_Border * @return PHPExcel\Style_Border
* @throws PHPExcel_Exception * @throws PHPExcel\Exception
*/ */
public function getSharedComponent() public function getSharedComponent()
{ {
@ -182,7 +182,7 @@ class Style_Border extends Style_Supervisor implements IComparable
* <code> * <code>
* $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray( * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
* array( * array(
* 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, * 'style' => PHPExcel\Style_Border::BORDER_DASHDOT,
* 'color' => array( * 'color' => array(
* 'rgb' => '808080' * 'rgb' => '808080'
* ) * )
@ -191,8 +191,8 @@ class Style_Border extends Style_Supervisor implements IComparable
* </code> * </code>
* *
* @param array $pStyles Array containing style information * @param array $pStyles Array containing style information
* @throws PHPExcel_Exception * @throws PHPExcel\Exception
* @return PHPExcel_Style_Border * @return PHPExcel\Style_Border
*/ */
public function applyFromArray($pStyles = null) { public function applyFromArray($pStyles = null) {
if (is_array($pStyles)) { if (is_array($pStyles)) {
@ -207,7 +207,7 @@ class Style_Border extends Style_Supervisor implements IComparable
} }
} }
} else { } else {
throw new PHPExcel_Exception("Invalid style array passed."); throw new Exception("Invalid style array passed.");
} }
return $this; return $this;
} }
@ -228,16 +228,16 @@ class Style_Border extends Style_Supervisor implements IComparable
* Set Border style * Set Border style
* *
* @param string|boolean $pValue * @param string|boolean $pValue
* When passing a boolean, FALSE equates PHPExcel_Style_Border::BORDER_NONE * When passing a boolean, FALSE equates PHPExcel\Style_Border::BORDER_NONE
* and TRUE to PHPExcel_Style_Border::BORDER_MEDIUM * and TRUE to PHPExcel\Style_Border::BORDER_MEDIUM
* @return PHPExcel_Style_Border * @return PHPExcel\Style_Border
*/ */
public function setBorderStyle($pValue = PHPExcel_Style_Border::BORDER_NONE) { public function setBorderStyle($pValue = Style_Border::BORDER_NONE) {
if (empty($pValue)) { if (empty($pValue)) {
$pValue = PHPExcel_Style_Border::BORDER_NONE; $pValue = Style_Border::BORDER_NONE;
} elseif(is_bool($pValue) && $pValue) { } elseif(is_bool($pValue) && $pValue) {
$pValue = PHPExcel_Style_Border::BORDER_MEDIUM; $pValue = Style_Border::BORDER_MEDIUM;
} }
if ($this->_isSupervisor) { if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('style' => $pValue)); $styleArray = $this->getStyleArray(array('style' => $pValue));
@ -251,7 +251,7 @@ class Style_Border extends Style_Supervisor implements IComparable
/** /**
* Get Border Color * Get Border Color
* *
* @return PHPExcel_Style_Color * @return PHPExcel\Style_Color
*/ */
public function getColor() { public function getColor() {
return $this->_color; return $this->_color;
@ -260,11 +260,11 @@ class Style_Border extends Style_Supervisor implements IComparable
/** /**
* Set Border Color * Set Border Color
* *
* @param PHPExcel_Style_Color $pValue * @param PHPExcel\Style_Color $pValue
* @throws PHPExcel_Exception * @throws PHPExcel\Exception
* @return PHPExcel_Style_Border * @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 // make sure parameter is a real color and not a supervisor
$color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue; $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;

View File

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

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Style * @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
@ -32,7 +32,7 @@ namespace PHPExcel;
* PHPExcel\Style_Color * PHPExcel\Style_Color
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Style * @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class Style_Color extends Style_Supervisor implements IComparable 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 string $pARGB ARGB value for the colour
* @param boolean $isSupervisor Flag indicating if this is a supervisor or not * @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 * Leave this value at default unless you understand exactly what
* its ramifications are * 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? // Supervisor?
parent::__construct($isSupervisor); parent::__construct($isSupervisor);
@ -98,7 +98,7 @@ class Style_Color extends Style_Supervisor implements IComparable
* *
* @param mixed $parent * @param mixed $parent
* @param string $parentPropertyName * @param string $parentPropertyName
* @return PHPExcel_Style_Color * @return PHPExcel\Style_Color
*/ */
public function bindParent($parent, $parentPropertyName=NULL) 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. * Get the shared style component for the currently active cell in currently active sheet.
* Only used for style supervisor * Only used for style supervisor
* *
* @return PHPExcel_Style_Color * @return PHPExcel\Style_Color
*/ */
public function getSharedComponent() public function getSharedComponent()
{ {
@ -156,8 +156,8 @@ class Style_Color extends Style_Supervisor implements IComparable
* </code> * </code>
* *
* @param array $pStyles Array containing style information * @param array $pStyles Array containing style information
* @throws PHPExcel_Exception * @throws PHPExcel\Exception
* @return PHPExcel_Style_Color * @return PHPExcel\Style_Color
*/ */
public function applyFromArray($pStyles = NULL) { public function applyFromArray($pStyles = NULL) {
if (is_array($pStyles)) { if (is_array($pStyles)) {
@ -172,7 +172,7 @@ class Style_Color extends Style_Supervisor implements IComparable
} }
} }
} else { } else {
throw new PHPExcel_Exception("Invalid style array passed."); throw new Exception("Invalid style array passed.");
} }
return $this; return $this;
} }
@ -193,11 +193,11 @@ class Style_Color extends Style_Supervisor implements IComparable
* Set ARGB * Set ARGB
* *
* @param string $pValue * @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 == '') { if ($pValue == '') {
$pValue = PHPExcel_Style_Color::COLOR_BLACK; $pValue = Style_Color::COLOR_BLACK;
} }
if ($this->_isSupervisor) { if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('argb' => $pValue)); $styleArray = $this->getStyleArray(array('argb' => $pValue));
@ -224,7 +224,7 @@ class Style_Color extends Style_Supervisor implements IComparable
* Set RGB * Set RGB
* *
* @param string $pValue RGB value * @param string $pValue RGB value
* @return PHPExcel_Style_Color * @return PHPExcel\Style_Color
*/ */
public function setRGB($pValue = '000000') { public function setRGB($pValue = '000000') {
if ($pValue == '') { 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 int $pIndex Index entry point into the colour array
* @param boolean $background Flag to indicate whether default background or foreground colour * @param boolean $background Flag to indicate whether default background or foreground colour
* should be returned if the indexed colour doesn't exist * 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) { public static function indexedColor($pIndex, $background=FALSE) {
// Clean parameter // Clean parameter
@ -404,13 +404,13 @@ class Style_Color extends Style_Supervisor implements IComparable
} }
if (array_key_exists($pIndex, self::$_indexedColors)) { if (array_key_exists($pIndex, self::$_indexedColors)) {
return new PHPExcel_Style_Color(self::$_indexedColors[$pIndex]); return new Style_Color(self::$_indexedColors[$pIndex]);
} }
if ($background) { 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 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Style * @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE## * @version ##VERSION##, ##DATE##
@ -29,10 +29,10 @@
namespace PHPExcel; namespace PHPExcel;
/** /**
* PHPExcel_Style_Conditional * PHPExcel\Style_Conditional
* *
* @category PHPExcel * @category PHPExcel
* @package PHPExcel_Style * @package PHPExcel\Style
* @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel) * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
*/ */
class Style_Conditional implements IComparable class Style_Conditional implements IComparable
@ -88,12 +88,12 @@ class Style_Conditional implements IComparable
/** /**
* Style * Style
* *
* @var PHPExcel_Style * @var PHPExcel\Style
*/ */
private $_style; private $_style;
/** /**
* Create a new PHPExcel_Style_Conditional * Create a new PHPExcel\Style_Conditional
*/ */
public function __construct() public function __construct()
{ {
@ -117,8 +117,8 @@ class Style_Conditional implements IComparable
/** /**
* Set Condition type * Set Condition type
* *
* @param string $pValue PHPExcel_Style_Conditional condition type * @param string $pValue PHPExcel\Style_Conditional condition type
* @return PHPExcel_Style_Conditional * @return PHPExcel\Style_Conditional
*/ */
public function setConditionType($pValue = Style_Conditional::CONDITION_NONE) { public function setConditionType($pValue = Style_Conditional::CONDITION_NONE) {
$this->_conditionType = $pValue; $this->_conditionType = $pValue;
@ -137,8 +137,8 @@ class Style_Conditional implements IComparable
/** /**
* Set Operator type * Set Operator type
* *
* @param string $pValue PHPExcel_Style_Conditional operator type * @param string $pValue PHPExcel\Style_Conditional operator type
* @return PHPExcel_Style_Conditional * @return PHPExcel\Style_Conditional
*/ */
public function setOperatorType($pValue = Style_Conditional::OPERATOR_NONE) { public function setOperatorType($pValue = Style_Conditional::OPERATOR_NONE) {
$this->_operatorType = $pValue; $this->_operatorType = $pValue;
@ -158,7 +158,7 @@ class Style_Conditional implements IComparable
* Set text * Set text
* *
* @param string $value * @param string $value
* @return PHPExcel_Style_Conditional * @return PHPExcel\Style_Conditional
*/ */
public function setText($value = null) { public function setText($value = null) {
$this->_text = $value; $this->_text = $value;
@ -184,7 +184,7 @@ class Style_Conditional implements IComparable
* *
* @deprecated Deprecated, use setConditions instead * @deprecated Deprecated, use setConditions instead
* @param string $pValue Condition * @param string $pValue Condition
* @return PHPExcel_Style_Conditional * @return PHPExcel\Style_Conditional
*/ */
public function setCondition($pValue = '') { public function setCondition($pValue = '') {
if (!is_array($pValue)) if (!is_array($pValue))
@ -206,7 +206,7 @@ class Style_Conditional implements IComparable
* Set Conditions * Set Conditions
* *
* @param string[] $pValue Condition * @param string[] $pValue Condition
* @return PHPExcel_Style_Conditional * @return PHPExcel\Style_Conditional
*/ */
public function setConditions($pValue) { public function setConditions($pValue) {
if (!is_array($pValue)) if (!is_array($pValue))
@ -220,7 +220,7 @@ class Style_Conditional implements IComparable
* Add Condition * Add Condition
* *
* @param string $pValue Condition * @param string $pValue Condition
* @return PHPExcel_Style_Conditional * @return PHPExcel\Style_Conditional
*/ */
public function addCondition($pValue = '') { public function addCondition($pValue = '') {
$this->_condition[] = $pValue; $this->_condition[] = $pValue;
@ -230,7 +230,7 @@ class Style_Conditional implements IComparable
/** /**
* Get Style * Get Style
* *
* @return PHPExcel_Style * @return PHPExcel\Style
*/ */
public function getStyle() { public function getStyle() {
return $this->_style; return $this->_style;
@ -239,9 +239,9 @@ class Style_Conditional implements IComparable
/** /**
* Set Style * Set Style
* *
* @param PHPExcel_Style $pValue * @param PHPExcel\Style $pValue
* @throws PHPExcel_Exception * @throws PHPExcel\Exception
* @return PHPExcel_Style_Conditional * @return PHPExcel\Style_Conditional
*/ */
public function setStyle(Style $pValue = null) { public function setStyle(Style $pValue = null) {
$this->_style = $pValue; $this->_style = $pValue;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,13 +33,13 @@ date_default_timezone_set('Europe/London');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />'); define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
/** Include PHPExcel */ /** Include PHPExcel Bootstrap */
require_once '../Classes/PHPExcel.php'; require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object // Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL; echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel(); $objPHPExcel = new PHPExcel\Workbook();
// Set document properties // Set document properties
echo date('H:i:s') , " Set document properties" , EOL; echo date('H:i:s') , " Set document properties" , EOL;
@ -80,11 +80,11 @@ $objPHPExcel->getActiveSheet()->setTitle('Simple');
$objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->setActiveSheetIndex(0);
// Save Excel 2007 file // Save as an Excel 2007 file
echo date('H:i:s') , " Write to Excel2007 format" , EOL; echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true); $callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__)); $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true); $callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime; $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; 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; echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true); $callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__)); $objWriter->save(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true); $callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime; $callTime = $callEndTime - $callStartTime;

View File

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

View File

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

View File

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

View File

@ -34,13 +34,13 @@ define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London'); date_default_timezone_set('Europe/London');
/** Include PHPExcel */ /** Include PHPExcel Bootstrap */
require_once '../Classes/PHPExcel.php'; require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object // Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL; echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel(); $objPHPExcel = new PHPExcel\Workbook();
// Set document properties // Set document properties
echo date('H:i:s') , " Set document properties" , EOL; 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 // Add a drawing to the header
echo date('H:i:s') , " Add a drawing to the header" , EOL; 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->setName('PHPExcel logo');
$objDrawing->setPath('./images/phpexcel_logo.gif'); $objDrawing->setPath('./images/phpexcel_logo.gif');
$objDrawing->setHeight(36); $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 // Set page orientation and size
echo date('H:i:s') , " Set page orientation and size" , EOL; echo date('H:i:s') , " Set page orientation and size" , EOL;
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE); $objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel\Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4); $objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel\Worksheet_PageSetup::PAPERSIZE_A4);
// Rename worksheet // Rename worksheet
echo date('H:i:s') , " Rename worksheet" , EOL; 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; echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true); $callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__)); $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true); $callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime; $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; echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true); $callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__)); $objWriter->save(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true); $callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime; $callTime = $callEndTime - $callStartTime;

View File

@ -28,13 +28,13 @@
/** Error reporting */ /** Error reporting */
error_reporting(E_ALL); error_reporting(E_ALL);
/** Include PHPExcel */ /** Include PHPExcel Bootstrap */
require_once dirname(__FILE__) . '/../Classes/PHPExcel.php'; require_once '../Classes/Bootstrap.php';
// Create new PHPExcel object // Create new PHPExcel object
echo date('H:i:s') , " Create new PHPExcel object" , EOL; echo date('H:i:s') , " Create new PHPExcel Workbook object" , EOL;
$objPHPExcel = new PHPExcel(); $objPHPExcel = new PHPExcel\Workbook();
// Set document properties // Set document properties
echo date('H:i:s') , " Set document properties" , EOL; 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; echo date('H:i:s') , " Add some data" , EOL;
$objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->setActiveSheetIndex(0);
$objPHPExcel->getActiveSheet()->setCellValue('B1', 'Invoice'); $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()->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()->getStyle('D1')->getNumberFormat()->setFormatCode(PHPExcel\Style_NumberFormat::FORMAT_DATE_XLSX15);
$objPHPExcel->getActiveSheet()->setCellValue('E1', '#12566'); $objPHPExcel->getActiveSheet()->setCellValue('E1', '#12566');
$objPHPExcel->getActiveSheet()->setCellValue('A3', 'Product Id'); $objPHPExcel->getActiveSheet()->setCellValue('A3', 'Product Id');
@ -115,13 +115,13 @@ $objPHPExcel->getActiveSheet()->getComment('E13')->getFillColor()->setRGB('EEEEE
// Add rich-text string // Add rich-text string
echo date('H:i:s') , " Add rich-text string" , EOL; echo date('H:i:s') , " Add rich-text string" , EOL;
$objRichText = new PHPExcel_RichText(); $objRichText = new PHPExcel\RichText();
$objRichText->createText('This invoice is '); $objRichText->createText('This invoice is ');
$objPayable = $objRichText->createTextRun('payable within thirty days after the end of the month'); $objPayable = $objRichText->createTextRun('payable within thirty days after the end of the month');
$objPayable->getFont()->setBold(true); $objPayable->getFont()->setBold(true);
$objPayable->getFont()->setItalic(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.'); $objRichText->createText(', unless specified otherwise on the invoice.');
@ -140,7 +140,7 @@ $objPHPExcel->getActiveSheet()->protectCells('A3:E13', 'PHPExcel');
// Set cell number formats // Set cell number formats
echo date('H:i:s') , " Set cell number formats" , EOL; 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 // Set column widths
echo date('H:i:s') , " Set column widths" , EOL; 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()->setName('Candara');
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setSize(20); $objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setSize(20);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('B1')->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE); $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()->getColor()->setARGB(PHPExcel\Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('D1')->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('E1')->getFont()->getColor()->setARGB(PHPExcel\Style_Color::COLOR_WHITE);
$objPHPExcel->getActiveSheet()->getStyle('D13')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('D13')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('E13')->getFont()->setBold(true); $objPHPExcel->getActiveSheet()->getStyle('E13')->getFont()->setBold(true);
// Set alignments // Set alignments
echo date('H:i:s') , " Set alignments" , EOL; echo date('H:i:s') , " Set alignments" , EOL;
$objPHPExcel->getActiveSheet()->getStyle('D11')->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('D12')->getAlignment()->setHorizontal(PHPExcel\Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->getStyle('D13')->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()->setHorizontal(PHPExcel\Style_Alignment::HORIZONTAL_JUSTIFY);
$objPHPExcel->getActiveSheet()->getStyle('A18')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER); $objPHPExcel->getActiveSheet()->getStyle('A18')->getAlignment()->setVertical(PHPExcel\Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('B5')->getAlignment()->setShrinkToFit(true); $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( $styleThinBlackBorderOutline = array(
'borders' => array( 'borders' => array(
'outline' => array( 'outline' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN, 'style' => PHPExcel\Style_Border::BORDER_THIN,
'color' => array('argb' => 'FF000000'), 'color' => array('argb' => 'FF000000'),
), ),
), ),
@ -191,7 +191,7 @@ echo date('H:i:s') , " Set thick brown border outline around Total" , EOL;
$styleThickBrownBorderOutline = array( $styleThickBrownBorderOutline = array(
'borders' => array( 'borders' => array(
'outline' => array( 'outline' => array(
'style' => PHPExcel_Style_Border::BORDER_THICK, 'style' => PHPExcel\Style_Border::BORDER_THICK,
'color' => array('argb' => 'FF993300'), 'color' => array('argb' => 'FF993300'),
), ),
), ),
@ -200,7 +200,7 @@ $objPHPExcel->getActiveSheet()->getStyle('D13:E13')->applyFromArray($styleThickB
// Set fills // Set fills
echo date('H:i:s') , " Set fills" , EOL; 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'); $objPHPExcel->getActiveSheet()->getStyle('A1:E1')->getFill()->getStartColor()->setARGB('FF808080');
// Set style for header row using alternative method // Set style for header row using alternative method
@ -211,15 +211,15 @@ $objPHPExcel->getActiveSheet()->getStyle('A3:E3')->applyFromArray(
'bold' => true 'bold' => true
), ),
'alignment' => array( 'alignment' => array(
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT, 'horizontal' => PHPExcel\Style_Alignment::HORIZONTAL_RIGHT,
), ),
'borders' => array( 'borders' => array(
'top' => array( 'top' => array(
'style' => PHPExcel_Style_Border::BORDER_THIN 'style' => PHPExcel\Style_Border::BORDER_THIN
) )
), ),
'fill' => array( 'fill' => array(
'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR, 'type' => PHPExcel\Style_Fill::FILL_GRADIENT_LINEAR,
'rotation' => 90, 'rotation' => 90,
'startcolor' => array( 'startcolor' => array(
'argb' => 'FFA0A0A0' 'argb' => 'FFA0A0A0'
@ -234,11 +234,11 @@ $objPHPExcel->getActiveSheet()->getStyle('A3:E3')->applyFromArray(
$objPHPExcel->getActiveSheet()->getStyle('A3')->applyFromArray( $objPHPExcel->getActiveSheet()->getStyle('A3')->applyFromArray(
array( array(
'alignment' => array( 'alignment' => array(
'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT, 'horizontal' => PHPExcel\Style_Alignment::HORIZONTAL_LEFT,
), ),
'borders' => array( 'borders' => array(
'left' => 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( $objPHPExcel->getActiveSheet()->getStyle('B3')->applyFromArray(
array( array(
'alignment' => 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( array(
'borders' => array( 'borders' => array(
'right' => 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 // Unprotect a cell
echo date('H:i:s') , " Unprotect a cell" , EOL; 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 // Add a hyperlink to the sheet
echo date('H:i:s') , " Add a hyperlink to the sheet" , EOL; echo date('H:i:s') , " Add a hyperlink to the sheet" , EOL;
$objPHPExcel->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net'); $objPHPExcel->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
$objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net'); $objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('http://www.phpexcel.net');
$objPHPExcel->getActiveSheet()->getCell('E26')->getHyperlink()->setTooltip('Navigate to website'); $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()->setCellValue('E27', 'Terms and conditions');
$objPHPExcel->getActiveSheet()->getCell('E27')->getHyperlink()->setUrl("sheet://'Terms and conditions'!A1"); $objPHPExcel->getActiveSheet()->getCell('E27')->getHyperlink()->setUrl("sheet://'Terms and conditions'!A1");
$objPHPExcel->getActiveSheet()->getCell('E27')->getHyperlink()->setTooltip('Review terms and conditions'); $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 // Add a drawing to the worksheet
echo date('H:i:s') , " Add a drawing to the worksheet" , EOL; 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->setName('Logo');
$objDrawing->setDescription('Logo'); $objDrawing->setDescription('Logo');
$objDrawing->setPath('./images/officelogo.jpg'); $objDrawing->setPath('./images/officelogo.jpg');
@ -289,7 +289,7 @@ $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
// Add a drawing to the worksheet // Add a drawing to the worksheet
echo date('H:i:s') , " Add a drawing to the worksheet" , EOL; 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->setName('Paid');
$objDrawing->setDescription('Paid'); $objDrawing->setDescription('Paid');
$objDrawing->setPath('./images/paid.png'); $objDrawing->setPath('./images/paid.png');
@ -302,7 +302,7 @@ $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
// Add a drawing to the worksheet // Add a drawing to the worksheet
echo date('H:i:s') , " Add a drawing to the worksheet" , EOL; 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->setName('PHPExcel logo');
$objDrawing->setDescription('PHPExcel logo'); $objDrawing->setDescription('PHPExcel logo');
$objDrawing->setPath('./images/phpexcel_logo.gif'); $objDrawing->setPath('./images/phpexcel_logo.gif');
@ -325,8 +325,8 @@ $objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddFooter('&L&B' . $objPHP
// Set page orientation and size // Set page orientation and size
echo date('H:i:s') , " Set page orientation and size" , EOL; echo date('H:i:s') , " Set page orientation and size" , EOL;
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT); $objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel\Worksheet_PageSetup::ORIENTATION_PORTRAIT);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4); $objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel\Worksheet_PageSetup::PAPERSIZE_A4);
// Rename first worksheet // Rename first worksheet
echo date('H:i:s') , " Rename first worksheet" , EOL; 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()->setName('Candara');
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setSize(20); $objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setSize(20);
$objPHPExcel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); $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); $objPHPExcel->getActiveSheet()->getStyle('A3:A6')->getFont()->setSize(8);
// Add a drawing to the worksheet // Add a drawing to the worksheet
echo date('H:i:s') , " Add a drawing to the worksheet" , EOL; 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->setName('Terms and conditions');
$objDrawing->setDescription('Terms and conditions'); $objDrawing->setDescription('Terms and conditions');
$objDrawing->setPath('./images/termsconditions.jpg'); $objDrawing->setPath('./images/termsconditions.jpg');
@ -381,8 +381,8 @@ $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
// Set page orientation and size // Set page orientation and size
echo date('H:i:s') , " Set page orientation and size" , EOL; echo date('H:i:s') , " Set page orientation and size" , EOL;
$objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE); $objPHPExcel->getActiveSheet()->getPageSetup()->setOrientation(PHPExcel\Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4); $objPHPExcel->getActiveSheet()->getPageSetup()->setPaperSize(PHPExcel\Worksheet_PageSetup::PAPERSIZE_A4);
// Rename second worksheet // Rename second worksheet
echo date('H:i:s') , " Rename second worksheet" , EOL; 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 "05featuredemo.inc.php";
/** Include PHPExcel_IOFactory */
require_once '../Classes/PHPExcel/IOFactory.php';
// Save Excel 2007 file // Save Excel 2007 file
echo date('H:i:s') , " Write to Excel2007 format" , EOL; echo date('H:i:s') , " Write to Excel2007 format" , EOL;
$callStartTime = microtime(true); $callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007'); $objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save(str_replace('.php', '.xlsx', __FILE__)); $objWriter->save(str_replace('.php', '.xlsx', __FILE__));
$callEndTime = microtime(true); $callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime; $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; echo date('H:i:s') , " Write to Excel5 format" , EOL;
$callStartTime = microtime(true); $callStartTime = microtime(true);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter = PHPExcel\IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save(str_replace('.php', '.xls', __FILE__)); $objWriter->save(str_replace('.php', '.xls', __FILE__));
$callEndTime = microtime(true); $callEndTime = microtime(true);
$callTime = $callEndTime - $callStartTime; $callTime = $callEndTime - $callStartTime;

View File

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

View File

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