PHPExcel
[ class tree: PHPExcel ] [ index: PHPExcel ] [ all elements ]

Source for file Worksheet.php

Documentation is available at Worksheet.php

  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * Copyright (c) 2006 - 2008 PHPExcel
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  * 
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  20.  *
  21.  * @category   PHPExcel
  22.  * @package    PHPExcel
  23.  * @copyright  Copyright (c) 2006 - 2008 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.6.3, 2008-08-25
  26.  */
  27.  
  28.  
  29. /** PHPExcel */
  30. require_once 'PHPExcel.php';
  31.  
  32. /** PHPExcel_Cell */
  33. require_once 'PHPExcel/Cell.php';
  34.  
  35. /** PHPExcel_Cell_DataType */
  36. require_once 'PHPExcel/Cell/DataType.php';
  37.  
  38. /** PHPExcel_Worksheet_RowDimension */
  39. require_once 'PHPExcel/Worksheet/RowDimension.php';
  40.  
  41. /** PHPExcel_Worksheet_ColumnDimension */
  42. require_once 'PHPExcel/Worksheet/ColumnDimension.php';
  43.  
  44. /** PHPExcel_Worksheet_PageSetup */
  45. require_once 'PHPExcel/Worksheet/PageSetup.php';
  46.  
  47. /** PHPExcel_Worksheet_PageMargins */
  48. require_once 'PHPExcel/Worksheet/PageMargins.php';
  49.  
  50. /** PHPExcel_Worksheet_HeaderFooter */
  51. require_once 'PHPExcel/Worksheet/HeaderFooter.php';
  52.  
  53. /** PHPExcel_Worksheet_BaseDrawing */
  54. require_once 'PHPExcel/Worksheet/BaseDrawing.php';
  55.  
  56. /** PHPExcel_Worksheet_Drawing */
  57. require_once 'PHPExcel/Worksheet/Drawing.php';
  58.  
  59. /** PHPExcel_Worksheet_HeaderFooterDrawing */
  60. require_once 'PHPExcel/Worksheet/HeaderFooterDrawing.php';
  61.  
  62. /** PHPExcel_Worksheet_Protection */
  63. require_once 'PHPExcel/Worksheet/Protection.php';
  64.  
  65. /** PHPExcel_Comment */
  66. require_once 'PHPExcel/Comment.php';
  67.  
  68. /** PHPExcel_Style */
  69. require_once 'PHPExcel/Style.php';
  70.  
  71. /** PHPExcel_Style_Fill */
  72. require_once 'PHPExcel/Style/Fill.php';
  73.  
  74. /** PHPExcel_Style_NumberFormat */
  75. require_once 'PHPExcel/Style/NumberFormat.php';
  76.  
  77. /** PHPExcel_IComparable */
  78. require_once 'PHPExcel/IComparable.php';
  79.  
  80. /** PHPExcel_Shared_Font */
  81. require_once 'PHPExcel/Shared/Font.php';
  82.  
  83. /** PHPExcel_Shared_PasswordHasher */
  84. require_once 'PHPExcel/Shared/PasswordHasher.php';
  85.  
  86. /** PHPExcel_ReferenceHelper */
  87. require_once 'PHPExcel/ReferenceHelper.php';
  88.  
  89.  
  90. /**
  91.  * PHPExcel_Worksheet
  92.  *
  93.  * @category   PHPExcel
  94.  * @package    PHPExcel
  95.  * @copyright  Copyright (c) 2006 - 2008 PHPExcel (http://www.codeplex.com/PHPExcel)
  96.  */
  97. class PHPExcel_Worksheet implements PHPExcel_IComparable
  98. {
  99.     /* Break types */
  100.     const BREAK_NONE    = 0;
  101.     const BREAK_ROW        = 1;
  102.     const BREAK_COLUMN    = 2;
  103.     
  104.     /**
  105.      * Parent spreadsheet
  106.      *
  107.      * @var PHPExcel 
  108.      */
  109.     private $_parent;
  110.     
  111.     /**
  112.      * Collection of cells
  113.      *
  114.      * @var PHPExcel_Cell[] 
  115.      */
  116.     private $_cellCollection = array();
  117.     
  118.     /**
  119.      * Collection of row dimensions
  120.      *
  121.      * @var PHPExcel_Worksheet_RowDimension[] 
  122.      */
  123.     private $_rowDimensions = array();
  124.     
  125.     /**
  126.      * Default row dimension
  127.      *
  128.      * @var PHPExcel_Worksheet_RowDimension 
  129.      */
  130.     private $_defaultRowDimension = null;
  131.     
  132.     /**
  133.      * Collection of column dimensions
  134.      *
  135.      * @var PHPExcel_Worksheet_ColumnDimension[] 
  136.      */
  137.     private $_columnDimensions = array();
  138.     
  139.     /**
  140.      * Default column dimension
  141.      *
  142.      * @var PHPExcel_Worksheet_ColumnDimension 
  143.      */
  144.     private $_defaultColumnDimension = null;
  145.     
  146.     /**
  147.      * Collection of drawings
  148.      *
  149.      * @var PHPExcel_Worksheet_BaseDrawing[] 
  150.      */
  151.     private $_drawingCollection = null;
  152.     
  153.     /**
  154.      * Worksheet title
  155.      *
  156.      * @var string 
  157.      */
  158.     private $_title;
  159.     
  160.     /**
  161.      * Page setup
  162.      *
  163.      * @var PHPExcel_Worksheet_PageSetup 
  164.      */
  165.     private $_pageSetup;
  166.     
  167.     /**
  168.      * Page margins
  169.      *
  170.      * @var PHPExcel_Worksheet_PageMargins 
  171.      */
  172.     private $_pageMargins;
  173.     
  174.     /**
  175.      * Page header/footer
  176.      *
  177.      * @var PHPExcel_Worksheet_HeaderFooter 
  178.      */
  179.     private $_headerFooter;
  180.     
  181.     /**
  182.      * Protection
  183.      *
  184.      * @var PHPExcel_Worksheet_Protection 
  185.      */
  186.     private $_protection;
  187.     
  188.     /**
  189.      * Collection of styles
  190.      *
  191.      * @var PHPExcel_Style[] 
  192.      */
  193.     private $_styles = array();
  194.     
  195.     /**
  196.      * Is the current cell collection sorted already?
  197.      *
  198.      * @var boolean 
  199.      */
  200.     private $_cellCollectionIsSorted = false;
  201.     
  202.     /**
  203.      * Collection of breaks
  204.      *
  205.      * @var array 
  206.      */
  207.     private $_breaks = array();
  208.     
  209.     /**
  210.      * Collection of merged cell ranges
  211.      *
  212.      * @var array 
  213.      */
  214.     private $_mergeCells = array();
  215.     
  216.     /**
  217.      * Collection of protected cell ranges
  218.      *
  219.      * @var array 
  220.      */
  221.     private $_protectedCells = array();
  222.     
  223.     /**
  224.      * Autofilter Range
  225.      * 
  226.      * @var string 
  227.      */
  228.     private $_autoFilter = '';
  229.     
  230.     /**
  231.      * Freeze pane
  232.      * 
  233.      * @var string 
  234.      */
  235.     private $_freezePane = '';
  236.     
  237.     /**
  238.      * Show gridlines?
  239.      *
  240.      * @var boolean 
  241.      */
  242.     private $_showGridlines = false;
  243.     
  244.     /**
  245.     * Print gridlines?
  246.     *
  247.     * @var boolean 
  248.     */
  249.     private $_printGridlines = false;
  250.     
  251.     /**
  252.      * Show summary below? (Row/Column outline)
  253.      *
  254.      * @var boolean 
  255.      */
  256.     private $_showSummaryBelow = true;
  257.     
  258.     /**
  259.      * Show summary right? (Row/Column outline)
  260.      *
  261.      * @var boolean 
  262.      */
  263.     private $_showSummaryRight = true;
  264.     
  265.     /**
  266.      * Collection of comments
  267.      *
  268.      * @var PHPExcel_Comment[] 
  269.      */
  270.     private $_comments = array();
  271.  
  272.     /**
  273.      * Selected cell
  274.      *
  275.      * @var string 
  276.      */
  277.     private $_selectedCell = 'A1';
  278.     
  279.     /**
  280.      * Create a new worksheet
  281.      *
  282.      * @param PHPExcel         $pParent 
  283.      * @param string         $pTitle 
  284.      */
  285.     public function __construct(PHPExcel $pParent = null, $pTitle = 'Worksheet')
  286.     {
  287.         // Set parent and title
  288.         $this->_parent = $pParent;
  289.         $this->setTitle($pTitle);
  290.         
  291.         // Set page setup
  292.         $this->_pageSetup             = new PHPExcel_Worksheet_PageSetup();
  293.         
  294.         // Set page margins
  295.         $this->_pageMargins         = new PHPExcel_Worksheet_PageMargins();
  296.         
  297.         // Set page header/footer
  298.         $this->_headerFooter         = new PHPExcel_Worksheet_HeaderFooter();
  299.         
  300.         // Create a default style and a default gray125 style
  301.         $this->_styles['default']     = new PHPExcel_Style();
  302.         $this->_styles['gray125']     = new PHPExcel_Style();
  303.         $this->_styles['gray125']->getFill()->setFillType(PHPExcel_Style_Fill::FILL_PATTERN_GRAY125);
  304.         
  305.         // Drawing collection
  306.         $this->_drawingCollection     = new ArrayObject();
  307.         
  308.         // Protection
  309.         $this->_protection            = new PHPExcel_Worksheet_Protection();
  310.         
  311.         // Gridlines
  312.         $this->_showGridlines        = false;
  313.         $this->_printGridlines        = false;
  314.         
  315.         // Outline summary
  316.         $this->_showSummaryBelow    = true;
  317.         $this->_showSummaryRight    = true;
  318.         
  319.         // Default row dimension
  320.         $this->_defaultRowDimension = new PHPExcel_Worksheet_RowDimension(null);
  321.         
  322.         // Default column dimension
  323.         $this->_defaultColumnDimension = new PHPExcel_Worksheet_ColumnDimension(null);
  324.     }
  325.     
  326.     /**
  327.      * Get collection of cells
  328.      *
  329.      * @return PHPExcel_Cell[] 
  330.      */
  331.     public function getCellCollection()
  332.     {
  333.         // Garbage collect...
  334.         $this->garbageCollect();
  335.         
  336.         // Re-order cell collection?
  337.         if (!$this->_cellCollectionIsSorted) {
  338.             uasort($this->_cellCollection, array('PHPExcel_Cell', 'compareCells'));
  339.         }
  340.  
  341.         return $this->_cellCollection;
  342.     }
  343.     
  344.     /**
  345.      * Get collection of row dimensions
  346.      *
  347.      * @return PHPExcel_Worksheet_RowDimension[] 
  348.      */
  349.     public function getRowDimensions()
  350.     {
  351.         return $this->_rowDimensions;
  352.     }
  353.     
  354.     /**
  355.      * Get default row dimension
  356.      *
  357.      * @return PHPExcel_Worksheet_RowDimension 
  358.      */
  359.     public function getDefaultRowDimension()
  360.     {
  361.         return $this->_defaultRowDimension;
  362.     }
  363.     
  364.     /**
  365.      * Get collection of column dimensions
  366.      *
  367.      * @return PHPExcel_Worksheet_ColumnDimension[] 
  368.      */
  369.     public function getColumnDimensions()
  370.     {
  371.         return $this->_columnDimensions;
  372.     }
  373.     
  374.     /**
  375.      * Get default column dimension
  376.      *
  377.      * @return PHPExcel_Worksheet_ColumnDimension 
  378.      */
  379.     public function getDefaultColumnDimension()
  380.     {
  381.         return $this->_defaultColumnDimension;
  382.     }
  383.     
  384.     /**
  385.      * Get collection of drawings
  386.      *
  387.      * @return PHPExcel_Worksheet_BaseDrawing[] 
  388.      */
  389.     public function getDrawingCollection()
  390.     {
  391.         return $this->_drawingCollection;
  392.     }
  393.     
  394.     /**
  395.      * Refresh column dimensions
  396.      */
  397.     public function refreshColumnDimensions()
  398.     {
  399.         $currentColumnDimensions = $this->getColumnDimensions();
  400.         $newColumnDimensions = array();
  401.  
  402.         foreach ($currentColumnDimensions as $objColumnDimension) {
  403.             $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension;
  404.         }
  405.  
  406.         $this->_columnDimensions = $newColumnDimensions;
  407.     }
  408.     
  409.     /**
  410.      * Refresh row dimensions
  411.      */
  412.     public function refreshRowDimensions()
  413.     {
  414.         $currentRowDimensions = $this->getRowDimensions();
  415.         $newRowDimensions = array();
  416.  
  417.         foreach ($currentRowDimensions as $objRowDimension) {
  418.             $newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension;
  419.         }
  420.  
  421.         $this->_rowDimensions = $newRowDimensions;
  422.     }
  423.     
  424.     /**
  425.      * Calculate worksheet dimension
  426.      *
  427.      * @return string  String containing the dimension of this worksheet
  428.      */
  429.     public function calculateWorksheetDimension()
  430.     {        
  431.         // Return
  432.         return 'A1' . ':' .  $this->getHighestColumn() . $this->getHighestRow();
  433.     }
  434.     
  435.     /**
  436.      * Calculate widths for auto-size columns
  437.      * 
  438.      * @param  boolean  $calculateMergeCells  Calculate merge cell width
  439.      */
  440.     public function calculateColumnWidths($calculateMergeCells = false)
  441.     {
  442.         $autoSizes = array();
  443.         foreach ($this->getColumnDimensions() as $colDimension) {
  444.             if ($colDimension->getAutoSize()) {
  445.                 $autoSizes[$colDimension->getColumnIndex()] = -1;
  446.             }
  447.         }
  448.         
  449.         foreach ($this->getCellCollection() as $cell) {
  450.             if (isset($autoSizes[$cell->getColumn()])) {
  451.                 $cellValue = $cell->getCalculatedValue();
  452.  
  453.                 foreach ($this->getMergeCells() as $cells) {
  454.                     if ($cell->isInRange($cells) && !$calculateMergeCells) {
  455.                         $cellValue = ''; // do not calculate merge cells
  456.                     }
  457.                 }
  458.  
  459.                 $autoSizes[$cell->getColumn()] = max(
  460.                     (float)$autoSizes[$cell->getColumn()],
  461.                     (float)PHPExcel_Shared_Font::calculateColumnWidth(
  462.                         $this->getStyle($cell->getCoordinate())->getFont()->getSize(),
  463.                         false,
  464.                         $cellValue
  465.                     )
  466.                 );
  467.             }
  468.         }
  469.         foreach ($autoSizes as $columnIndex => $width) {
  470.             $this->getColumnDimension($columnIndex)->setWidth($width);
  471.         }
  472.         
  473.     }
  474.     
  475.     /**
  476.      * Get parent
  477.      *
  478.      * @return PHPExcel 
  479.      */
  480.     public function getParent() {
  481.         return $this->_parent;
  482.     }
  483.     
  484.     /**
  485.      * Re-bind parent
  486.      *
  487.      * @param PHPExcel $parent 
  488.      */
  489.     public function rebindParent(PHPExcel $parent) {
  490.         $namedRanges = $this->_parent->getNamedRanges();
  491.         foreach ($namedRanges as $namedRange) {
  492.             $parent->addNamedRange($namedRange);
  493.         }
  494.     
  495.         $this->_parent->removeSheetByIndex(
  496.             $this->_parent->getindex($this)
  497.         );
  498.         $this->_parent = $parent;
  499.     }
  500.     
  501.     /**
  502.      * Get title
  503.      *
  504.      * @return string 
  505.      */
  506.     public function getTitle()
  507.     {
  508.         return $this->_title;
  509.     }
  510.     
  511.     /**
  512.      * Set title
  513.      *
  514.      * @param string $pValue String containing the dimension of this worksheet
  515.      */
  516.     public function setTitle($pValue = 'Worksheet')
  517.     {
  518.         // Is this a 'rename' or not?
  519.         if ($this->getTitle() == $pValue) {
  520.             return;
  521.         }
  522.         
  523.         // Loop trough all sheets in parent PHPExcel and verify unique names
  524.         $titleCount    = 0;
  525.         $aNames     = $this->getParent()->getSheetNames();
  526.  
  527.         foreach ($aNames as $strName) {
  528.             if ($strName == $pValue || substr($strName, 0, strrpos($strName, ' ')) == $pValue) {
  529.                 $titleCount++;
  530.             }
  531.         }
  532.  
  533.         // Eventually, add a number to the sheet name
  534.         if ($titleCount > 0) {
  535.             $this->setTitle($pValue . ' ' . $titleCount);
  536.             return;
  537.         }
  538.                 
  539.         // Set title
  540.         $this->_title = $pValue;
  541.     }
  542.     
  543.     /**
  544.      * Get page setup
  545.      *
  546.      * @return PHPExcel_Worksheet_PageSetup 
  547.      */
  548.     public function getPageSetup()
  549.     {
  550.         return $this->_pageSetup;
  551.     }
  552.     
  553.     /**
  554.      * Set page setup
  555.      *
  556.      * @param PHPExcel_Worksheet_PageSetup    $pValue 
  557.      */
  558.     public function setPageSetup(PHPExcel_Worksheet_PageSetup $pValue)
  559.     {
  560.            $this->_pageSetup = $pValue;
  561.     }
  562.     
  563.     /**
  564.      * Get page margins
  565.      *
  566.      * @return PHPExcel_Worksheet_PageMargins 
  567.      */
  568.     public function getPageMargins()
  569.     {
  570.         return $this->_pageMargins;
  571.     }
  572.     
  573.     /**
  574.      * Set page margins
  575.      *
  576.      * @param PHPExcel_Worksheet_PageMargins    $pValue 
  577.      */
  578.     public function setPageMargins(PHPExcel_Worksheet_PageMargins $pValue)
  579.     {
  580.            $this->_pageMargins = $pValue;
  581.     }
  582.     
  583.     /**
  584.      * Get page header/footer
  585.      *
  586.      * @return PHPExcel_Worksheet_HeaderFooter 
  587.      */
  588.     public function getHeaderFooter()
  589.     {
  590.         return $this->_headerFooter;
  591.     }
  592.     
  593.     /**
  594.      * Set page header/footer
  595.      *
  596.      * @param PHPExcel_Worksheet_HeaderFooter    $pValue 
  597.      */
  598.     public function setHeaderFooter(PHPExcel_Worksheet_HeaderFooter $pValue)
  599.     {
  600.         $this->_headerFooter = $pValue;
  601.     }
  602.     
  603.     /**
  604.      * Get Protection
  605.      *
  606.      * @return PHPExcel_Worksheet_Protection 
  607.      */
  608.     public function getProtection()
  609.     {
  610.         return $this->_protection;
  611.     }
  612.     
  613.     /**
  614.      * Set Protection
  615.      *
  616.      * @param PHPExcel_Worksheet_Protection    $pValue 
  617.      */
  618.     public function setProtection(PHPExcel_Worksheet_Protection $pValue)
  619.     {
  620.            $this->_protection = $pValue;
  621.     }
  622.     
  623.     /**
  624.      * Get highest worksheet column
  625.      *
  626.      * @return string Highest column name
  627.      */
  628.     public function getHighestColumn()
  629.     {
  630.         // Highest column
  631.         $highestColumn = 'A';
  632.                
  633.         // Loop trough cells
  634.         foreach ($this->_cellCollection as $cell) {
  635.             if (PHPExcel_Cell::columnIndexFromString($highestColumn) < PHPExcel_Cell::columnIndexFromString($cell->getColumn())) {
  636.                 $highestColumn = $cell->getColumn();
  637.             }
  638.         }
  639.         
  640.         // Loop trough column dimensions
  641.         foreach ($this->_columnDimensions as $dimension) {
  642.             if ($highestColumn < $dimension->getColumnIndex()) {
  643.                 $highestColumn = $dimension->getColumnIndex();
  644.             }
  645.         }
  646.  
  647.         // Return
  648.         return $highestColumn;
  649.     }
  650.     
  651.     /**
  652.      * Get highest worksheet row
  653.      *
  654.      * @return int Highest row number
  655.      */
  656.     public function getHighestRow()
  657.     {       
  658.         // Highest row
  659.         $highestRow = 1;
  660.         
  661.         // Loop trough cells
  662.         foreach ($this->_cellCollection as $cell) {
  663.             if ($cell->getRow() > $highestRow) {
  664.                 $highestRow = $cell->getRow();
  665.             }
  666.         }
  667.         
  668.         // Loop trough row dimensions
  669.         foreach ($this->_rowDimensions as $dimension) {
  670.             if ($highestRow < $dimension->getRowIndex()) {
  671.                 $highestRow = $dimension->getRowIndex();
  672.             }
  673.         }
  674.         
  675.         // Return
  676.         return $highestRow;
  677.     }
  678.     
  679.     /**
  680.      * Set a cell value
  681.      *
  682.      * @param string     $pCoordinate    Coordinate of the cell
  683.      * @param mixed     $pValue            Value of the cell
  684.      */
  685.     public function setCellValue($pCoordinate = 'A1', $pValue = null)
  686.     {
  687.         // Set value
  688.         $this->getCell($pCoordinate)->setValue($pValue, true);
  689.     }
  690.     
  691.     /**
  692.      * Set a cell value by using numeric cell coordinates
  693.      *
  694.      * @param string     $pColumn        Numeric column coordinate of the cell
  695.      * @param string     $pRow            Numeric row coordinate of the cell
  696.      * @param mixed     $pValue            Value of the cell
  697.      */
  698.     public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 0, $pValue = null)
  699.     {
  700.         $this->setCellValue(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pValue);
  701.     }
  702.     
  703.     /**
  704.      * Set a cell value
  705.      *
  706.      * @param string     $pCoordinate    Coordinate of the cell
  707.      * @param mixed     $pValue            Value of the cell
  708.      * @param string    $pDataType        Explicit data type
  709.      */
  710.     public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
  711.     {
  712.         // Set value
  713.         $this->getCell($pCoordinate)->setValueExplicit($pValue, $pDataType);
  714.     }
  715.     
  716.     /**
  717.      * Set a cell value by using numeric cell coordinates
  718.      *
  719.      * @param string     $pColumn        Numeric column coordinate of the cell
  720.      * @param string     $pRow            Numeric row coordinate of the cell
  721.      * @param mixed     $pValue            Value of the cell
  722.      * @param string    $pDataType        Explicit data type
  723.      */
  724.     public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 0, $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
  725.     {
  726.         $this->setCellValueExplicit(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pValue, $pDataType);
  727.     }
  728.     
  729.     /**
  730.      * Get cell at a specific coordinate
  731.      *
  732.      * @param     string             $pCoordinate    Coordinate of the cell
  733.      * @throws     Exception
  734.      * @return     PHPExcel_Cell     Cell that was found
  735.      */
  736.     public function getCell($pCoordinate = 'A1')
  737.     {
  738.         // Worksheet reference?
  739.         if (strpos($pCoordinate, '!') !== false) {
  740.             $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
  741.             return $this->getParent()->getSheetByName($worksheetReference[0])->getCell($worksheetReference[1]);
  742.         }
  743.             
  744.         // Named range?
  745.         $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
  746.         if (!is_null($namedRange)) {
  747.             $pCoordinate = $namedRange->getRange();
  748.             if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
  749.                 if (!$namedRange->getLocalOnly()) {
  750.                     return $namedRange->getWorksheet()->getCell($pCoordinate);
  751.                 } else {
  752.                     throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
  753.                 }
  754.             }
  755.         }
  756.         
  757.         // Uppercase coordinate
  758.         $pCoordinate = strtoupper($pCoordinate);
  759.         
  760.         if (eregi(':', $pCoordinate)) {
  761.             throw new Exception('Cell coordinate can not be a range of cells.');
  762.         } else if (eregi('\$', $pCoordinate)) {
  763.             throw new Exception('Cell coordinate must not be absolute.');
  764.         } else {
  765.             // Coordinates
  766.             $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
  767.  
  768.             // Cell exists?
  769.             if (!isset($this->_cellCollection[ strtoupper($pCoordinate) ])) {
  770.                 $this->_cellCollection[ strtoupper($pCoordinate) ] = new PHPExcel_Cell($aCoordinates[0], $aCoordinates[1], null, null, $this);
  771.                 $this->_cellCollectionIsSorted = false;
  772.             }
  773.  
  774.             return $this->_cellCollection[ strtoupper($pCoordinate) ];
  775.         }
  776.     }
  777.     
  778.     /**
  779.      * Get cell at a specific coordinate by using numeric cell coordinates
  780.      *
  781.      * @param     string $pColumn        Numeric column coordinate of the cell
  782.      * @param     string $pRow        Numeric row coordinate of the cell
  783.      * @return     PHPExcel_Cell         Cell that was found
  784.      */
  785.     public function getCellByColumnAndRow($pColumn = 0, $pRow = 0)
  786.     {
  787.         return $this->getCell(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
  788.     }
  789.     
  790.     /**
  791.      * Cell at a specific coordinate exists?
  792.      *
  793.      * @param     string             $pCoordinate    Coordinate of the cell
  794.      * @throws     Exception
  795.      * @return     boolean 
  796.      */
  797.     public function cellExists($pCoordinate = 'A1')
  798.     {
  799.         // Worksheet reference?
  800.         if (strpos($pCoordinate, '!') !== false) {
  801.             $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
  802.             return $this->getParent()->getSheetByName($worksheetReference[0])->cellExists($worksheetReference[1]);
  803.         }
  804.             
  805.         // Named range?
  806.         $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
  807.         if (!is_null($namedRange)) {
  808.             $pCoordinate = $namedRange->getRange();
  809.             if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
  810.                 if (!$namedRange->getLocalOnly()) {
  811.                     return $namedRange->getWorksheet()->cellExists($pCoordinate);
  812.                 } else {
  813.                     throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
  814.                 }
  815.             }
  816.         }
  817.         
  818.         // Uppercase coordinate
  819.         $pCoordinate = strtoupper($pCoordinate);
  820.         
  821.         if (eregi(':', $pCoordinate)) {
  822.             throw new Exception('Cell coordinate can not be a range of cells.');
  823.         } else if (eregi('\$', $pCoordinate)) {
  824.             throw new Exception('Cell coordinate must not be absolute.');
  825.         } else {
  826.             // Coordinates
  827.             $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
  828.  
  829.             // Cell exists?
  830.             return isset($this->_cellCollection[ strtoupper($pCoordinate) ]);
  831.         }
  832.     }
  833.     
  834.     /**
  835.      * Cell at a specific coordinate by using numeric cell coordinates exists?
  836.      *
  837.      * @param     string $pColumn        Numeric column coordinate of the cell
  838.      * @param     string $pRow        Numeric row coordinate of the cell
  839.      * @return     boolean 
  840.      */
  841.     public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 0)
  842.     {
  843.         return $this->cellExists(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
  844.     }
  845.     
  846.     /**
  847.      * Get row dimension at a specific row
  848.      *
  849.      * @param int $pRow    Numeric index of the row
  850.      * @return PHPExcel_Worksheet_RowDimension 
  851.      */
  852.     public function getRowDimension($pRow = 0)
  853.     {
  854.         // Found
  855.         $found = null;
  856.         
  857.         // Get row dimension
  858.         if (!isset($this->_rowDimensions[$pRow])) {
  859.             $this->_rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow);
  860.         }
  861.         return $this->_rowDimensions[$pRow];
  862.     }
  863.        
  864.     /**
  865.      * Get column dimension at a specific column
  866.      *
  867.      * @param string $pColumn    String index of the column
  868.      * @return PHPExcel_Worksheet_ColumnDimension 
  869.      */
  870.     public function getColumnDimension($pColumn = 'A')
  871.     {
  872.         // Uppercase coordinate
  873.         $pColumn = strtoupper($pColumn);
  874.         
  875.         // Fetch dimensions
  876.         if (!isset($this->_columnDimensions[$pColumn])) {
  877.             $this->_columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn);
  878.         }
  879.         return $this->_columnDimensions[$pColumn];
  880.     }
  881.     
  882.     /**
  883.      * Get column dimension at a specific column by using numeric cell coordinates
  884.      *
  885.      * @param     string $pColumn        Numeric column coordinate of the cell
  886.      * @param     string $pRow        Numeric row coordinate of the cell
  887.      * @return     PHPExcel_Worksheet_ColumnDimension 
  888.      */
  889.     public function getColumnDimensionByColumn($pColumn = 0)
  890.     {
  891.         return $this->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($pColumn));
  892.     }
  893.     
  894.     /**
  895.      * Get styles
  896.      *
  897.      * @return PHPExcel_Style[] 
  898.      */
  899.     public function getStyles()
  900.     {
  901.         return $this->_styles;
  902.     }
  903.  
  904.     /**
  905.      * Get default style
  906.      *
  907.      * @return     PHPExcel_Style 
  908.      * @throws     Exception
  909.      */
  910.     public function getDefaultStyle()
  911.     {
  912.         return $this->_styles['default'];
  913.     }
  914.     
  915.     /**
  916.      * Get style for cell
  917.      *
  918.      * @param     string     $pCellCoordinate    Cell coordinate to get style for
  919.      * @return     PHPExcel_Style 
  920.      * @throws     Exception
  921.      */
  922.     public function getStyle($pCellCoordinate = 'A1')
  923.     {
  924.         // Worksheet reference?
  925.         if (strpos($pCellCoordinate, '!') !== false) {
  926.             $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCellCoordinate, true);
  927.             return $this->getParent()->getSheetByName($worksheetReference[0])->getStyle($worksheetReference[1]);
  928.         }
  929.         
  930.         // Named range?
  931.         $namedRange = PHPExcel_NamedRange::resolveRange($pCellCoordinate, $this);
  932.         if (!is_null($namedRange)) {
  933.             $pCoordinate = $namedRange->getRange();
  934.             if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
  935.                 if (!$namedRange->getLocalOnly()) {
  936.                     return $namedRange->getWorksheet()->getStyle($pCellCoordinate);
  937.                 } else {
  938.                     throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
  939.                 }
  940.             }
  941.         }
  942.         
  943.         // Uppercase coordinate
  944.         $pCellCoordinate = strtoupper($pCellCoordinate);
  945.         
  946.         if (eregi(':', $pCellCoordinate)) {
  947.             throw new Exception('Cell coordinate string can not be a range of cells.');
  948.         } else if (eregi('\$', $pCellCoordinate)) {
  949.             throw new Exception('Cell coordinate string must not be absolute.');
  950.         } else if ($pCellCoordinate == '') {
  951.             throw new Exception('Cell coordinate can not be zero-length string.');
  952.         } else {
  953.             // Create a cell for this coordinate.
  954.             // Reason: When we have an empty cell that has style information,
  955.             // it should exist for our IWriter
  956.             $this->getCell($pCellCoordinate);
  957.             
  958.             // Check if we already have style information for this cell.
  959.             // If not, create a new style.
  960.             if (isset($this->_styles[$pCellCoordinate])) {
  961.                 return $this->_styles[$pCellCoordinate];
  962.             } else {
  963.                 $newStyle = clone $this->getDefaultStyle();
  964.                 $this->_styles[$pCellCoordinate] = $newStyle;
  965.                 return $newStyle;
  966.             }
  967.         }
  968.     }
  969.     
  970.     /**
  971.      * Get style for cell by using numeric cell coordinates
  972.      *
  973.      * @param     int $pColumn    Numeric column coordinate of the cell
  974.      * @param     int $pRow        Numeric row coordinate of the cell
  975.      * @return     PHPExcel_Style 
  976.      */
  977.     public function getStyleByColumnAndRow($pColumn = 0, $pRow = 0)
  978.     {
  979.         return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
  980.     }
  981.     
  982.     /**
  983.      * Set shared cell style to a range of cells
  984.      *
  985.      * Please note that this will overwrite existing cell styles for cells in range!
  986.      *
  987.      * @param     PHPExcel_Style    $pSharedCellStyle    Cell style to share
  988.      * @param     string            $pRange                Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
  989.      * @throws    Exception
  990.      */
  991.      public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '')
  992.     {
  993.         // Uppercase coordinate
  994.         $pRange = strtoupper($pRange);
  995.         
  996.            // Is it a cell range or a single cell?
  997.            $rangeA     = '';
  998.            $rangeB     = '';
  999.            if (strpos($pRange, ':') === false) {
  1000.                $rangeA = $pRange;
  1001.                $rangeB = $pRange;
  1002.            } else {
  1003.                list($rangeA, $rangeB) = explode(':', $pRange);
  1004.            }
  1005.             
  1006.            // Calculate range outer borders
  1007.            $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
  1008.            $rangeEnd     = PHPExcel_Cell::coordinateFromString($rangeB);
  1009.             
  1010.            // Translate column into index
  1011.            $rangeStart[0]    = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
  1012.            $rangeEnd[0]    = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
  1013.             
  1014.            // Make sure we can loop upwards on rows and columns
  1015.            if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
  1016.                $tmp = $rangeStart;
  1017.                $rangeStart = $rangeEnd;
  1018.                $rangeEnd = $tmp;
  1019.            }
  1020.                        
  1021.            // Loop trough cells and apply styles
  1022.            for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; $col++) {
  1023.                for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; $row++) {
  1024.                    $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col) . $row);
  1025.                    $this->_styles[ PHPExcel_Cell::stringFromColumnIndex($col) . $row ] = $pSharedCellStyle;
  1026.                }
  1027.            }
  1028.     }
  1029.  
  1030.     /**
  1031.      * Duplicate cell style to a range of cells
  1032.      *
  1033.      * Please note that this will overwrite existing cell styles for cells in range!
  1034.      *
  1035.      * @param     PHPExcel_Style    $pCellStyle    Cell style to duplicate
  1036.      * @param     string            $pRange        Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
  1037.      * @throws    Exception
  1038.      */
  1039.     public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '')
  1040.     {
  1041.         // Uppercase coordinate
  1042.         $pRange = strtoupper($pRange);
  1043.         
  1044.            // Is it a cell range or a single cell?
  1045.            $rangeA     = '';
  1046.            $rangeB     = '';
  1047.            if (strpos($pRange, ':') === false) {
  1048.                $rangeA = $pRange;
  1049.                $rangeB = $pRange;
  1050.            } else {
  1051.                list($rangeA, $rangeB) = explode(':', $pRange);
  1052.            }
  1053.             
  1054.            // Calculate range outer borders
  1055.            $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
  1056.            $rangeEnd     = PHPExcel_Cell::coordinateFromString($rangeB);
  1057.             
  1058.            // Translate column into index
  1059.            $rangeStart[0]    = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
  1060.            $rangeEnd[0]    = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
  1061.             
  1062.            // Make sure we can loop upwards on rows and columns
  1063.            if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
  1064.                $tmp = $rangeStart;
  1065.                $rangeStart = $rangeEnd;
  1066.                $rangeEnd = $tmp;
  1067.            }
  1068.                        
  1069.            // Loop trough cells and apply styles
  1070.            for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; $col++) {
  1071.                for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; $row++) {
  1072.                    $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col) . $row);
  1073.                    $this->_styles[ PHPExcel_Cell::stringFromColumnIndex($col) . $row ] = clone $pCellStyle;
  1074.                }
  1075.            }
  1076.     }
  1077.     
  1078.     /**
  1079.      * Duplicate cell style array to a range of cells
  1080.      *
  1081.      * Please note that this will overwrite existing cell styles for cells in range,
  1082.      * if they are in the styles array. For example, if you decide to set a range of
  1083.      * cells to font bold, only include font bold in the styles array.
  1084.      *
  1085.      * @param    array            $pStyles    Array containing style information
  1086.      * @param     string            $pRange        Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
  1087.      * @throws    Exception
  1088.      */
  1089.     public function duplicateStyleArray($pStyles = null, $pRange = '')
  1090.     {
  1091.         if (is_array($pStyles)) {
  1092.             // Uppercase coordinate
  1093.             $pRange = strtoupper($pRange);
  1094.             
  1095.                // Is it a cell range or a single cell?
  1096.                $rangeA     = '';
  1097.                $rangeB     = '';
  1098.                if (strpos($pRange, ':') === false) {
  1099.                    $rangeA = $pRange;
  1100.                    $rangeB = $pRange;
  1101.                } else {
  1102.                    list($rangeA, $rangeB) = explode(':', $pRange);
  1103.                }
  1104.                 
  1105.                // Calculate range outer borders
  1106.                $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
  1107.                $rangeEnd     = PHPExcel_Cell::coordinateFromString($rangeB);
  1108.                 
  1109.                // Translate column into index
  1110.                $rangeStart[0]    = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
  1111.                $rangeEnd[0]    = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
  1112.                 
  1113.                // Make sure we can loop upwards on rows and columns
  1114.                if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
  1115.                    $tmp = $rangeStart;
  1116.                    $rangeStart = $rangeEnd;
  1117.                    $rangeEnd = $tmp;
  1118.                }
  1119.                            
  1120.                // Loop trough cells and apply styles array
  1121.                for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; $col++) {
  1122.                    for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; $row++) {
  1123.                        $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($col) . $row)->applyFromArray($pStyles);
  1124.                    }
  1125.                }
  1126.         } else {
  1127.             throw new Exception("Invalid style array passed.");
  1128.         }
  1129.     }
  1130.     
  1131.     /**
  1132.      * Set break on a cell
  1133.      *
  1134.      * @param     string            $pCell        Cell coordinate (e.g. A1)
  1135.      * @param     int                $pBreak        Break type (type of PHPExcel_Worksheet::BREAK_*)
  1136.      * @throws    Exception
  1137.      */
  1138.     public function setBreak($pCell = 'A1', $pBreak = PHPExcel_Worksheet::BREAK_NONE)
  1139.     {
  1140.         // Uppercase coordinate
  1141.         $pCell = strtoupper($pCell);
  1142.         
  1143.         if ($pCell != '') {
  1144.             $this->_breaks[strtoupper($pCell)] = $pBreak;
  1145.         } else {
  1146.             throw new Exception('No cell coordinate specified.');
  1147.         }
  1148.     }
  1149.     
  1150.     /**
  1151.      * Set break on a cell by using numeric cell coordinates
  1152.      *
  1153.      * @param     int     $pColumn    Numeric column coordinate of the cell
  1154.      * @param     int     $pRow        Numeric row coordinate of the cell
  1155.      * @param     int        $pBreak        Break type (type of PHPExcel_Worksheet::BREAK_*)
  1156.      * @throws    Exception
  1157.      */
  1158.     public function setBreakByColumnAndRow($pColumn = 0, $pRow = 0, $pBreak = PHPExcel_Worksheet::BREAK_NONE)
  1159.     {
  1160.         $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak);
  1161.     }
  1162.     
  1163.     /**
  1164.      * Get breaks
  1165.      *
  1166.      * @return array[] 
  1167.      */
  1168.     public function getBreaks()
  1169.     {
  1170.         return $this->_breaks;
  1171.     }
  1172.     
  1173.     /**
  1174.      * Set merge on a cell range
  1175.      *
  1176.      * @param     string            $pRange        Cell range (e.g. A1:E1)
  1177.      * @throws    Exception
  1178.      */
  1179.     public function mergeCells($pRange = 'A1:A1')
  1180.     {
  1181.         // Uppercase coordinate
  1182.         $pRange = strtoupper($pRange);
  1183.         
  1184.         if (eregi(':', $pRange)) {
  1185.             $this->_mergeCells[$pRange] = $pRange;
  1186.         } else {
  1187.             throw new Exception('Merge must be set on a range of cells.');
  1188.         }
  1189.     }
  1190.     
  1191.     /**
  1192.      * Set merge on a cell range by using numeric cell coordinates
  1193.      *
  1194.      * @param     int $pColumn1    Numeric column coordinate of the first cell
  1195.      * @param     int $pRow1        Numeric row coordinate of the first cell
  1196.      * @param     int $pColumn2    Numeric column coordinate of the last cell
  1197.      * @param     int $pRow2        Numeric row coordinate of the last cell
  1198.      * @throws    Exception
  1199.      */
  1200.     public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 0, $pColumn2 = 0, $pRow2 = 0)
  1201.     {
  1202.         $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
  1203.         $this->mergeCells($cellRange);
  1204.     }
  1205.        
  1206.     /**
  1207.      * Remove merge on a cell range
  1208.      *
  1209.      * @param     string            $pRange        Cell range (e.g. A1:E1)
  1210.      * @throws    Exception
  1211.      */
  1212.     public function unmergeCells($pRange = 'A1:A1')
  1213.     {
  1214.         // Uppercase coordinate
  1215.         $pRange = strtoupper($pRange);
  1216.         
  1217.         if (eregi(':', $pRange)) {
  1218.             if (isset($this->_mergeCells[$pRange])) {
  1219.                 unset($this->_mergeCells[$pRange]);
  1220.             } else {
  1221.                 throw new Exception('Cell range ' . $pRange . ' not known as merged.');
  1222.             }
  1223.         } else {
  1224.             throw new Exception('Merge can only be removed from a range of cells.');
  1225.         }
  1226.     }
  1227.     
  1228.     /**
  1229.      * Remove merge on a cell range by using numeric cell coordinates
  1230.      *
  1231.      * @param     int $pColumn1    Numeric column coordinate of the first cell
  1232.      * @param     int $pRow1        Numeric row coordinate of the first cell
  1233.      * @param     int $pColumn2    Numeric column coordinate of the last cell
  1234.      * @param     int $pRow2        Numeric row coordinate of the last cell
  1235.      * @throws    Exception
  1236.      */
  1237.     public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 0, $pColumn2 = 0, $pRow2 = 0)
  1238.     {
  1239.         $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
  1240.         $this->unmergeCells($cellRange);
  1241.     }
  1242.     
  1243.     /**
  1244.      * Get merge cells
  1245.      *
  1246.      * @return array[] 
  1247.      */
  1248.     public function getMergeCells()
  1249.     {
  1250.         return $this->_mergeCells;
  1251.     }
  1252.     
  1253.     /**
  1254.      * Set protection on a cell range
  1255.      *
  1256.      * @param     string            $pRange                Cell (e.g. A1) or cell range (e.g. A1:E1)
  1257.      * @param     string            $pPassword            Password to unlock the protection
  1258.      * @param     boolean         $pAlreadyHashed     If the password has already been hashed, set this to true
  1259.      * @throws    Exception
  1260.      */
  1261.     public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false)
  1262.     {
  1263.         // Uppercase coordinate
  1264.         $pRange = strtoupper($pRange);
  1265.         
  1266.         if (!$pAlreadyHashed) {
  1267.             $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword);
  1268.         }
  1269.         $this->_protectedCells[$pRange] = $pPassword;
  1270.     }
  1271.     
  1272.     /**
  1273.      * Set protection on a cell range by using numeric cell coordinates
  1274.      *
  1275.      * @param     int     $pColumn1            Numeric column coordinate of the first cell
  1276.      * @param     int     $pRow1                Numeric row coordinate of the first cell
  1277.      * @param     int     $pColumn2            Numeric column coordinate of the last cell
  1278.      * @param     int     $pRow2                Numeric row coordinate of the last cell
  1279.      * @param     string    $pPassword            Password to unlock the protection
  1280.      * @param     boolean $pAlreadyHashed     If the password has already been hashed, set this to true
  1281.      * @throws    Exception
  1282.      */
  1283.     public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 0, $pColumn2 = 0, $pRow2 = 0, $pPassword = '', $pAlreadyHashed = false)
  1284.     {
  1285.         $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
  1286.         $this->protectCells($cellRange, $pPassword, $pAlreadyHashed);
  1287.     }
  1288.     
  1289.     /**
  1290.      * Remove protection on a cell range
  1291.      *
  1292.      * @param     string            $pRange        Cell (e.g. A1) or cell range (e.g. A1:E1)
  1293.      * @throws    Exception
  1294.      */
  1295.     public function unprotectCells($pRange = 'A1')
  1296.     {
  1297.         // Uppercase coordinate
  1298.         $pRange = strtoupper($pRange);
  1299.         
  1300.         if (isset($this->_protectedCells[$pRange])) {
  1301.             unset($this->_protectedCells[$pRange]);
  1302.         } else {
  1303.             throw new Exception('Cell range ' . $pRange . ' not known as protected.');
  1304.         }
  1305.     }
  1306.     
  1307.     /**
  1308.      * Remove protection on a cell range by using numeric cell coordinates
  1309.      *
  1310.      * @param     int     $pColumn1            Numeric column coordinate of the first cell
  1311.      * @param     int     $pRow1                Numeric row coordinate of the first cell
  1312.      * @param     int     $pColumn2            Numeric column coordinate of the last cell
  1313.      * @param     int     $pRow2                Numeric row coordinate of the last cell
  1314.      * @param     string    $pPassword            Password to unlock the protection
  1315.      * @param     boolean $pAlreadyHashed     If the password has already been hashed, set this to true
  1316.      * @throws    Exception
  1317.      */
  1318.     public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 0, $pColumn2 = 0, $pRow2 = 0, $pPassword = '', $pAlreadyHashed = false)
  1319.     {
  1320.         $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
  1321.         $this->unprotectCells($cellRange, $pPassword, $pAlreadyHashed);
  1322.     }
  1323.     
  1324.     /**
  1325.      * Get protected cells
  1326.      *
  1327.      * @return array[] 
  1328.      */
  1329.     public function getProtectedCells()
  1330.     {
  1331.         return $this->_protectedCells;
  1332.     }
  1333.     
  1334.     /**
  1335.      * Get Autofilter Range
  1336.      *
  1337.      * @return string 
  1338.      */
  1339.     public function getAutoFilter()
  1340.     {
  1341.         return $this->_autoFilter;
  1342.     }
  1343.     
  1344.     /**
  1345.      * Set Autofilter Range
  1346.      *
  1347.      * @param     string        $pRange        Cell range (i.e. A1:E10)
  1348.      * @throws     Exception
  1349.      */
  1350.     public function setAutoFilter($pRange = '')
  1351.     {
  1352.         // Uppercase coordinate
  1353.         $pRange = strtoupper($pRange);
  1354.         
  1355.         if (eregi(':', $pRange)) {
  1356.             $this->_autoFilter = $pRange;
  1357.         } else {
  1358.             throw new Exception('Autofilter must be set on a range of cells.');
  1359.         }
  1360.     }
  1361.     
  1362.     /**
  1363.      * Set Autofilter Range by using numeric cell coordinates
  1364.      *
  1365.      * @param     int     $pColumn1    Numeric column coordinate of the first cell
  1366.      * @param     int     $pRow1        Numeric row coordinate of the first cell
  1367.      * @param     int     $pColumn2    Numeric column coordinate of the second cell
  1368.      * @param     int     $pRow2        Numeric row coordinate of the second cell
  1369.      * @throws     Exception
  1370.      */
  1371.     public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 0, $pColumn2 = 0, $pRow2 = 0)
  1372.     {
  1373.         $this->setAutoFilter(
  1374.             PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1
  1375.             . ':' . 
  1376.             PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2
  1377.         );
  1378.     }
  1379.     
  1380.     /**
  1381.      * Get Freeze Pane
  1382.      *
  1383.      * @return string 
  1384.      */
  1385.     public function getFreezePane()
  1386.     {
  1387.         return $this->_freezePane;
  1388.     }
  1389.     
  1390.     /**
  1391.      * Freeze Pane
  1392.      *
  1393.      * @param     string        $pCell        Cell (i.e. A1)
  1394.      * @throws     Exception
  1395.      */
  1396.     public function freezePane($pCell = '')
  1397.     {
  1398.         // Uppercase coordinate
  1399.         $pCell = strtoupper($pCell);
  1400.         
  1401.         if (!eregi(':', $pCell)) {
  1402.             $this->_freezePane = $pCell;
  1403.         } else {
  1404.             throw new Exception('Freeze pane can not be set on a range of cells.');
  1405.         }
  1406.     }
  1407.     
  1408.     /**
  1409.      * Freeze Pane by using numeric cell coordinates
  1410.      *
  1411.      * @param     int     $pColumn    Numeric column coordinate of the cell
  1412.      * @param     int     $pRow        Numeric row coordinate of the cell
  1413.      * @throws     Exception
  1414.      */
  1415.     public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 0)
  1416.     {
  1417.         $this->freezePane(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
  1418.     }
  1419.     
  1420.     /**
  1421.      * Unfreeze Pane
  1422.      *
  1423.      * @return string 
  1424.      */
  1425.     public function unfreezePane()
  1426.     {
  1427.         $this->freezePane('');
  1428.     }
  1429.     
  1430.     /**
  1431.      * Insert a new row, updating all possible related data
  1432.      *
  1433.      * @param     int    $pBefore    Insert before this one
  1434.      * @param     int    $pNumRows    Number of rows to insert
  1435.      * @throws     Exception
  1436.      */
  1437.     public function insertNewRowBefore($pBefore = 1, $pNumRows = 1) {
  1438.         if ($pBefore >= 1) {
  1439.             $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
  1440.             $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this);
  1441.         } else {
  1442.             throw new Exception("Rows can only be inserted before at least row 1.");
  1443.         }
  1444.         
  1445.         // Garbage collect...
  1446.         $this->garbageCollect();
  1447.     }
  1448.     
  1449.     /**
  1450.      * Insert a new column, updating all possible related data
  1451.      *
  1452.      * @param     int    $pBefore    Insert before this one
  1453.      * @param     int    $pNumCols    Number of columns to insert
  1454.      * @throws     Exception
  1455.      */
  1456.     public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1) {
  1457.         if (!is_numeric($pBefore)) {
  1458.             $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
  1459.             $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this);
  1460.         } else {
  1461.             throw new Exception("Column references should not be numeric.");
  1462.         }
  1463.         
  1464.         // Garbage collect...
  1465.         $this->garbageCollect();
  1466.     }
  1467.     
  1468.     /**
  1469.      * Insert a new column, updating all possible related data
  1470.      *
  1471.      * @param     int    $pBefore    Insert before this one (numeric column coordinate of the cell)
  1472.      * @param     int    $pNumCols    Number of columns to insert
  1473.      * @throws     Exception
  1474.      */
  1475.     public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1) {
  1476.         if ($pBefore >= 0) {
  1477.             $this->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols);
  1478.         } else {
  1479.             throw new Exception("Columns can only be inserted before at least column A (0).");
  1480.         }
  1481.         
  1482.         // Garbage collect...
  1483.         $this->garbageCollect();
  1484.     }    
  1485.  
  1486.     /**
  1487.      * Delete a row, updating all possible related data
  1488.      *
  1489.      * @param     int    $pRow        Remove starting with this one
  1490.      * @param     int    $pNumRows    Number of rows to remove
  1491.      * @throws     Exception
  1492.      */
  1493.     public function removeRow($pRow = 1, $pNumRows = 1) {
  1494.         if ($pRow >= 1) {
  1495.             $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
  1496.             $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this);
  1497.         } else {
  1498.             throw new Exception("Rows to be deleted should at least start from row 1.");
  1499.         }
  1500.         
  1501.         // Garbage collect...
  1502.         $this->garbageCollect();
  1503.     }
  1504.     
  1505.     /**
  1506.      * Remove a column, updating all possible related data
  1507.      *
  1508.      * @param     int    $pColumn    Remove starting with this one
  1509.      * @param     int    $pNumCols    Number of columns to remove
  1510.      * @throws     Exception
  1511.      */
  1512.     public function removeColumn($pColumn = 'A', $pNumCols = 1) {
  1513.         if (!is_numeric($pColumn)) {
  1514.             $pColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($pColumn) - 1 + $pNumCols);
  1515.             $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
  1516.             $objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this);
  1517.         } else {
  1518.             throw new Exception("Column references should not be numeric.");
  1519.         }
  1520.         
  1521.         // Garbage collect...
  1522.         $this->garbageCollect();
  1523.     }
  1524.     
  1525.     /**
  1526.      * Remove a column, updating all possible related data
  1527.      *
  1528.      * @param     int    $pColumn    Remove starting with this one (numeric column coordinate of the cell)
  1529.      * @param     int    $pNumCols    Number of columns to remove
  1530.      * @throws     Exception
  1531.      */
  1532.     public function removeColumnByIndex($pColumn = 0, $pNumCols = 1) {
  1533.         if ($pColumn >= 0) {
  1534.             $this->removeColumn(PHPExcel_Cell::stringFromColumnIndex($pColumn), $pNumCols);
  1535.         } else {
  1536.             throw new Exception("Columns can only be inserted before at least column A (0).");
  1537.         }
  1538.         
  1539.         // Garbage collect...
  1540.         $this->garbageCollect();
  1541.     }
  1542.     
  1543.     /**
  1544.      * Show gridlines?
  1545.      *
  1546.      * @return boolean 
  1547.      */
  1548.     public function getShowGridlines() {
  1549.         return $this->_showGridlines;
  1550.     }
  1551.     
  1552.     /**
  1553.      * Set show gridlines
  1554.      *
  1555.      * @param boolean $pValue    Show gridlines (true/false)
  1556.      */
  1557.     public function setShowGridlines($pValue = false) {
  1558.         $this->_showGridlines = $pValue;
  1559.     }
  1560.     
  1561.     /**
  1562.     * Print gridlines?
  1563.     *
  1564.     * @return boolean 
  1565.     */
  1566.     public function getPrintGridlines() {
  1567.         return $this->_printGridlines;
  1568.     }
  1569.  
  1570.     /**
  1571.     * Set print gridlines
  1572.     *
  1573.     * @param boolean $pValue Print gridlines (true/false)
  1574.     */
  1575.     public function setPrintGridlines($pValue = false) {
  1576.         $this->_printGridlines = $pValue;
  1577.     }
  1578.     
  1579.     /**
  1580.      * Show summary below? (Row/Column outlining)
  1581.      *
  1582.      * @return boolean 
  1583.      */
  1584.     public function getShowSummaryBelow() {
  1585.         return $this->_showSummaryBelow;
  1586.     }
  1587.     
  1588.     /**
  1589.      * Set show summary below
  1590.      *
  1591.      * @param boolean $pValue    Show summary below (true/false)
  1592.      */
  1593.     public function setShowSummaryBelow($pValue = true) {
  1594.         $this->_showSummaryBelow = $pValue;
  1595.     }
  1596.     
  1597.     /**
  1598.      * Show summary right? (Row/Column outlining)
  1599.      *
  1600.      * @return boolean 
  1601.      */
  1602.     public function getShowSummaryRight() {
  1603.         return $this->_showSummaryRight;
  1604.     }
  1605.     
  1606.     /**
  1607.      * Set show summary right
  1608.      *
  1609.      * @param boolean $pValue    Show summary right (true/false)
  1610.      */
  1611.     public function setShowSummaryRight($pValue = true) {
  1612.         $this->_showSummaryRight = $pValue;
  1613.     }
  1614.     
  1615.     /**
  1616.      * Get comments
  1617.      *
  1618.      * @return PHPExcel_Comment[] 
  1619.      */
  1620.     public function getComments()
  1621.     {
  1622.         return $this->_comments;
  1623.     }
  1624.     
  1625.     /**
  1626.      * Get comment for cell
  1627.      *
  1628.      * @param     string     $pCellCoordinate    Cell coordinate to get comment for
  1629.      * @return     PHPExcel_Comment 
  1630.      * @throws     Exception
  1631.      */
  1632.     public function getComment($pCellCoordinate = 'A1')
  1633.     {
  1634.         // Uppercase coordinate
  1635.         $pCellCoordinate = strtoupper($pCellCoordinate);
  1636.         
  1637.         if (eregi(':', $pCellCoordinate)) {
  1638.             throw new Exception('Cell coordinate string can not be a range of cells.');
  1639.         } else if (eregi('\$', $pCellCoordinate)) {
  1640.             throw new Exception('Cell coordinate string must not be absolute.');
  1641.         } else if ($pCellCoordinate == '') {
  1642.             throw new Exception('Cell coordinate can not be zero-length string.');
  1643.         } else {           
  1644.             // Check if we already have a comment for this cell.
  1645.             // If not, create a new comment.
  1646.             if (isset($this->_comments[$pCellCoordinate])) {
  1647.                 return $this->_comments[$pCellCoordinate];
  1648.             } else {
  1649.                 $newComment = new PHPExcel_Comment();
  1650.                 $this->_comments[$pCellCoordinate] = $newComment;
  1651.                 return $newComment;
  1652.             }
  1653.         }
  1654.     }
  1655.     
  1656.     /**
  1657.      * Get comment for cell by using numeric cell coordinates
  1658.      *
  1659.      * @param     int $pColumn    Numeric column coordinate of the cell
  1660.      * @param     int $pRow        Numeric row coordinate of the cell
  1661.      * @return     PHPExcel_Comment 
  1662.      */
  1663.     public function getCommentByColumnAndRow($pColumn = 0, $pRow = 0)
  1664.     {
  1665.         return $this->getComment(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
  1666.     }
  1667.  
  1668.     /**
  1669.      * Get selected cell
  1670.      *
  1671.      * @return string 
  1672.      */
  1673.     public function getSelectedCell()
  1674.     {
  1675.         return $this->_selectedCell;
  1676.     }
  1677.     
  1678.     /**
  1679.      * Selected cell
  1680.      *
  1681.      * @param     string        $pCell        Cell (i.e. A1)
  1682.      * @throws     Exception
  1683.      */
  1684.     public function setSelectedCell($pCell = '')
  1685.     {
  1686.         // Uppercase coordinate
  1687.         $pCell = strtoupper($pCell);
  1688.         
  1689.         if (!eregi(':', $pCell)) {
  1690.             $this->_selectedCell = $pCell;
  1691.         } else {
  1692.             throw new Exception('Selected cell can not be set on a range of cells.');
  1693.         }
  1694.     }
  1695.     
  1696.     /**
  1697.      * Selected cell by using numeric cell coordinates
  1698.      *
  1699.      * @param     int     $pColumn    Numeric column coordinate of the cell
  1700.      * @param     int     $pRow        Numeric row coordinate of the cell
  1701.      * @throws     Exception
  1702.      */
  1703.     public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 0)
  1704.     {
  1705.         $this->setSelectedCell(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
  1706.     }
  1707.     
  1708.     /**
  1709.      * Fill worksheet from values in array
  1710.      *
  1711.      * @param array $source    Source array
  1712.      * @param mixed $nullValue Value treated as "null"
  1713.      * @throws Exception
  1714.      */
  1715.     public function fromArray($source = null, $nullValue = null) {
  1716.         if (is_array($source)) {
  1717.             // Loop trough $source
  1718.             $currentRow = 0;
  1719.             $rowData = null;
  1720.             foreach ($source as $rowData) {
  1721.                 $currentRow++;
  1722.                 
  1723.                 for ($i = 0; $i < count($rowData); $i++) {
  1724.                     if ($rowData[$i] != $nullValue) {
  1725.                         // Set cell value
  1726.                         $this->setCellValue(
  1727.                             PHPExcel_Cell::stringFromColumnIndex($i) . $currentRow, $rowData[$i]
  1728.                         );
  1729.                     }
  1730.                 }
  1731.             }
  1732.         } else {
  1733.             throw new Exception("Parameter \$source should be an array.");
  1734.         }
  1735.     }
  1736.     
  1737.     /**
  1738.      * Create array from worksheet
  1739.      *
  1740.      * @param mixed $nullValue Value treated as "null"
  1741.      * @param boolean $calculateFormulas Should formulas be calculated?
  1742.      * @return array 
  1743.      */
  1744.     public function toArray($nullValue = null, $calculateFormulas = true) {
  1745.         // Returnvalue
  1746.         $returnValue = array();
  1747.         
  1748.         // Garbage collect...
  1749.         $this->garbageCollect();
  1750.         
  1751.         // Get worksheet dimension
  1752.         $dimension = explode(':', $this->calculateWorksheetDimension());
  1753.         $dimension[0] = PHPExcel_Cell::coordinateFromString($dimension[0]);
  1754.         $dimension[0][0] = PHPExcel_Cell::columnIndexFromString($dimension[0][0]) - 1;
  1755.         $dimension[1] = PHPExcel_Cell::coordinateFromString($dimension[1]);
  1756.         $dimension[1][0] = PHPExcel_Cell::columnIndexFromString($dimension[1][0]) - 1;
  1757.         
  1758.         // Loop trough cells
  1759.         for ($row = $dimension[0][1]; $row <= $dimension[1][1]; $row++) {
  1760.             for ($column = $dimension[0][0]; $column <= $dimension[1][0]; $column++) {
  1761.                 // Cell exists?
  1762.                 if ($this->cellExistsByColumnAndRow($column, $row)) {
  1763.                     $cell = $this->getCellByColumnAndRow($column, $row);
  1764.                     
  1765.                     if ($cell->getValue() instanceof PHPExcel_RichText) {
  1766.                         $returnValue[$row][$column] = $cell->getValue()->getPlainText();
  1767.                     } else {
  1768.                         if ($calculateFormulas) {
  1769.                             $returnValue[$row][$column] = $cell->getCalculatedValue();
  1770.                         } else {
  1771.                             $returnValue[$row][$column] = $cell->getValue();
  1772.                         }
  1773.                     }
  1774.                     
  1775.                     $style = $this->getDefaultStyle();
  1776.                     if (isset($this->_styles[$cell->getCoordinate()])) {
  1777.                         $style = $this->getStyleByColumnAndRow($column, $row);
  1778.                     }
  1779.  
  1780.                     $returnValue[$row][$column] = PHPExcel_Style_NumberFormat::toFormattedString($returnValue[$row][$column], $style->getNumberFormat()->getFormatCode());
  1781.                 } else {
  1782.                     $returnValue[$row][$column] = $nullValue;
  1783.                 }
  1784.             }    
  1785.         }
  1786.         
  1787.         // Return
  1788.         return $returnValue;
  1789.     }
  1790.     
  1791.     /**
  1792.      * Run PHPExcel garabage collector.
  1793.      */
  1794.     public function garbageCollect() {
  1795.         // Build a reference table from images
  1796.         $imageCoordinates = array();    
  1797.           $iterator = $this->getDrawingCollection()->getIterator();
  1798.            while ($iterator->valid()) {
  1799.                $imageCoordinates[$iterator->current()->getCoordinates()] = true;
  1800.  
  1801.                $iterator->next();
  1802.            }
  1803.         
  1804.         // Find cells that can be cleaned
  1805.         foreach ($this->_cellCollection as $coordinate => $cell) {
  1806.             // Can be cleaned?
  1807.             $canBeCleaned = false;
  1808.             
  1809.             // Empty value?
  1810.             if (is_null($cell->getValue()) || (!is_object($cell->getValue()) && $cell->getValue() === '' && !$cell->hasHyperlink())) {
  1811.                 // Style set? Default style?
  1812.                 if (!isset($this->_styles[$coordinate]) || $this->_styles[$coordinate]->getHashCode() == $this->_styles['default']->getHashCode()) {
  1813.                     // It can be cleaned!
  1814.                     $canBeCleaned = true;
  1815.                 }
  1816.             }
  1817.             
  1818.             // Referenced in image?
  1819.             if (isset($imageCoordinates[$coordinate]) && $imageCoordinates[$coordinate] === true) {
  1820.                 $canBeCleaned = false;    
  1821.             }
  1822.             
  1823.             // Clean?
  1824.             if ($canBeCleaned) {
  1825.                 unset($this->_cellCollection[$coordinate]);
  1826.                 
  1827.                 // Does it resemble the default style?
  1828.                 if (isset($this->_styles[$coordinate]) && $this->_styles[$coordinate]->getHashCode() == $this->_styles['default']->getHashCode()) {
  1829.                     unset($this->_styles[$coordinate]);
  1830.                 }
  1831.             }
  1832.         }
  1833.     }
  1834.     
  1835.     /**
  1836.      * Get hash code
  1837.      *
  1838.      * @return string    Hash code
  1839.      */    
  1840.     public function getHashCode() {
  1841.         return md5(
  1842.               $this->_title
  1843.             . $this->_autoFilter
  1844.             . ($this->_protection->isProtectionEnabled() ? 't' : 'f')
  1845.             . $this->calculateWorksheetDimension()
  1846.             . __CLASS__
  1847.         );
  1848.     }
  1849.         
  1850.     /**
  1851.      * Extract worksheet title from range.
  1852.      * 
  1853.      * Example: extractSheetTitle('test!A1') ==> 'test'
  1854.      * Example: extractSheetTitle('test!A1', true) ==> array('test', 'A1');
  1855.      *
  1856.      * @param string $pRange    Range to extract title from
  1857.      * @param bool $returnRange    Return range? (see example)
  1858.      * @return mixed 
  1859.      */
  1860.     public static function extractSheetTitle($pRange, $returnRange = false) {
  1861.         // Sheet title included?
  1862.         if (strpos($pRange, '!') === false) {
  1863.             return '';
  1864.         }
  1865.         
  1866.         // Extract sheet title
  1867.         $reference = explode('!', $pRange);
  1868.         $reference[0] = str_replace("'", "", $reference[0]);
  1869.         
  1870.         if ($returnRange) {
  1871.             return $reference;
  1872.         } else {
  1873.             return $reference[1];
  1874.         }
  1875.     }
  1876.     
  1877.     /**
  1878.      * Copy worksheet (!= clone!)
  1879.      * 
  1880.      * @return PHPExcel_Worksheet 
  1881.      */
  1882.     public function copy() {
  1883.         $copied = clone $this;
  1884.             
  1885.         foreach ($copied->_cellCollection as $coordinate => $cell) {
  1886.             $newCell = clone $cell;
  1887.             $newCell->rebindParent($copied);
  1888.             $copied->_cellCollection[$coordinate] = $newCell;
  1889.         }
  1890.         
  1891.         return $copied;
  1892.     }
  1893.     
  1894.     /**
  1895.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  1896.      */
  1897.     public function __clone() {
  1898.         $vars = get_object_vars($this);
  1899.         foreach ($vars as $key => $value) {
  1900.             if (is_object($value)) {
  1901.                 $this->$key = clone $value;
  1902.             } else {
  1903.                 $this->$key = $value;
  1904.             }
  1905.         }
  1906.     }
  1907. }

Documentation generated on Mon, 25 Aug 2008 13:52:59 +0200 by phpDocumentor 1.4.1