← All changes
|
vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Abstract.php
+111
-110
3.1.0
→
3.0.10
View file →
| @@ -1,10 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | /** |
| 4 | - * PHPExcel_Writer_Abstract | |
| 3 | + * PHPExcel | |
| 5 | 4 | * |
| 6 | - * Copyright (c) 2006 - 2015 PHPExcel | |
| 5 | + * Copyright (c) 2006 - 2014 PHPExcel | |
| 7 | 6 | * |
| 8 | 7 | * This library is free software; you can redistribute it and/or |
| 9 | 8 | * modify it under the terms of the GNU Lesser General Public |
| 10 | 9 | * License as published by the Free Software Foundation; either |
| @@ -20,138 +19,140 @@ | ||
| 20 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | 20 | * |
| 22 | 21 | * @category PHPExcel |
| 23 | 22 | * @package PHPExcel_Writer |
| 24 | - * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 25 | - * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL | |
| 23 | + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 24 | + * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL | |
| 26 | 25 | * @version ##VERSION##, ##DATE## |
| 27 | 26 | */ |
| 27 | + | |
| 28 | + | |
| 29 | +/** | |
| 30 | + * PHPExcel_Writer_Abstract | |
| 31 | + * | |
| 32 | + * @category PHPExcel | |
| 33 | + * @package PHPExcel_Writer | |
| 34 | + * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel) | |
| 35 | + */ | |
| 28 | 36 | abstract class PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter |
| 29 | 37 | { |
| 30 | - /** | |
| 31 | - * Write charts that are defined in the workbook? | |
| 32 | - * Identifies whether the Writer should write definitions for any charts that exist in the PHPExcel object; | |
| 33 | - * | |
| 34 | - * @var boolean | |
| 35 | - */ | |
| 36 | - protected $includeCharts = false; | |
| 38 | + /** | |
| 39 | + * Write charts that are defined in the workbook? | |
| 40 | + * Identifies whether the Writer should write definitions for any charts that exist in the PHPExcel object; | |
| 41 | + * | |
| 42 | + * @var boolean | |
| 43 | + */ | |
| 44 | + protected $_includeCharts = FALSE; | |
| 37 | 45 | |
| 38 | - /** | |
| 39 | - * Pre-calculate formulas | |
| 40 | - * Forces PHPExcel to recalculate all formulae in a workbook when saving, so that the pre-calculated values are | |
| 41 | - * immediately available to MS Excel or other office spreadsheet viewer when opening the file | |
| 42 | - * | |
| 43 | - * @var boolean | |
| 44 | - */ | |
| 45 | - protected $preCalculateFormulas = true; | |
| 46 | + /** | |
| 47 | + * Pre-calculate formulas | |
| 48 | + * Forces PHPExcel to recalculate all formulae in a workbook when saving, so that the pre-calculated values are | |
| 49 | + * immediately available to MS Excel or other office spreadsheet viewer when opening the file | |
| 50 | + * | |
| 51 | + * @var boolean | |
| 52 | + */ | |
| 53 | + protected $_preCalculateFormulas = TRUE; | |
| 46 | 54 | |
| 47 | - /** | |
| 48 | - * Use disk caching where possible? | |
| 49 | - * | |
| 50 | - * @var boolean | |
| 51 | - */ | |
| 52 | - protected $_useDiskCaching = false; | |
| 55 | + /** | |
| 56 | + * Use disk caching where possible? | |
| 57 | + * | |
| 58 | + * @var boolean | |
| 59 | + */ | |
| 60 | + protected $_useDiskCaching = FALSE; | |
| 53 | 61 | |
| 54 | - /** | |
| 55 | - * Disk caching directory | |
| 56 | - * | |
| 57 | - * @var string | |
| 58 | - */ | |
| 59 | - protected $_diskCachingDirectory = './'; | |
| 62 | + /** | |
| 63 | + * Disk caching directory | |
| 64 | + * | |
| 65 | + * @var string | |
| 66 | + */ | |
| 67 | + protected $_diskCachingDirectory = './'; | |
| 60 | 68 | |
| 61 | - /** | |
| 62 | - * Write charts in workbook? | |
| 63 | - * If this is true, then the Writer will write definitions for any charts that exist in the PHPExcel object. | |
| 64 | - * If false (the default) it will ignore any charts defined in the PHPExcel object. | |
| 65 | - * | |
| 66 | - * @return boolean | |
| 67 | - */ | |
| 68 | - public function getIncludeCharts() | |
| 69 | - { | |
| 70 | - return $this->includeCharts; | |
| 71 | - } | |
| 69 | + /** | |
| 70 | + * Write charts in workbook? | |
| 71 | + * If this is true, then the Writer will write definitions for any charts that exist in the PHPExcel object. | |
| 72 | + * If false (the default) it will ignore any charts defined in the PHPExcel object. | |
| 73 | + * | |
| 74 | + * @return boolean | |
| 75 | + */ | |
| 76 | + public function getIncludeCharts() { | |
| 77 | + return $this->_includeCharts; | |
| 78 | + } | |
| 72 | 79 | |
| 73 | - /** | |
| 74 | - * Set write charts in workbook | |
| 75 | - * Set to true, to advise the Writer to include any charts that exist in the PHPExcel object. | |
| 76 | - * Set to false (the default) to ignore charts. | |
| 77 | - * | |
| 78 | - * @param boolean $pValue | |
| 79 | - * @return PHPExcel_Writer_IWriter | |
| 80 | - */ | |
| 81 | - public function setIncludeCharts($pValue = false) | |
| 82 | - { | |
| 83 | - $this->includeCharts = (boolean) $pValue; | |
| 84 | - return $this; | |
| 85 | - } | |
| 80 | + /** | |
| 81 | + * Set write charts in workbook | |
| 82 | + * Set to true, to advise the Writer to include any charts that exist in the PHPExcel object. | |
| 83 | + * Set to false (the default) to ignore charts. | |
| 84 | + * | |
| 85 | + * @param boolean $pValue | |
| 86 | + * @return PHPExcel_Writer_IWriter | |
| 87 | + */ | |
| 88 | + public function setIncludeCharts($pValue = FALSE) { | |
| 89 | + $this->_includeCharts = (boolean) $pValue; | |
| 90 | + return $this; | |
| 91 | + } | |
| 86 | 92 | |
| 87 | 93 | /** |
| 88 | 94 | * Get Pre-Calculate Formulas flag |
| 89 | - * If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, | |
| 90 | - * so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet | |
| 91 | - * viewer when opening the file | |
| 92 | - * If false, then formulae are not calculated on save. This is faster for saving in PHPExcel, but slower | |
| 93 | - * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself | |
| 95 | + * If this is true (the default), then the writer will recalculate all formulae in a workbook when saving, | |
| 96 | + * so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet | |
| 97 | + * viewer when opening the file | |
| 98 | + * If false, then formulae are not calculated on save. This is faster for saving in PHPExcel, but slower | |
| 99 | + * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself | |
| 94 | 100 | * |
| 95 | 101 | * @return boolean |
| 96 | 102 | */ |
| 97 | - public function getPreCalculateFormulas() | |
| 98 | - { | |
| 99 | - return $this->preCalculateFormulas; | |
| 103 | + public function getPreCalculateFormulas() { | |
| 104 | + return $this->_preCalculateFormulas; | |
| 100 | 105 | } |
| 101 | 106 | |
| 102 | 107 | /** |
| 103 | 108 | * Set Pre-Calculate Formulas |
| 104 | - * Set to true (the default) to advise the Writer to calculate all formulae on save | |
| 105 | - * Set to false to prevent precalculation of formulae on save. | |
| 109 | + * Set to true (the default) to advise the Writer to calculate all formulae on save | |
| 110 | + * Set to false to prevent precalculation of formulae on save. | |
| 106 | 111 | * |
| 107 | - * @param boolean $pValue Pre-Calculate Formulas? | |
| 108 | - * @return PHPExcel_Writer_IWriter | |
| 112 | + * @param boolean $pValue Pre-Calculate Formulas? | |
| 113 | + * @return PHPExcel_Writer_IWriter | |
| 109 | 114 | */ |
| 110 | - public function setPreCalculateFormulas($pValue = true) | |
| 111 | - { | |
| 112 | - $this->preCalculateFormulas = (boolean) $pValue; | |
| 113 | - return $this; | |
| 115 | + public function setPreCalculateFormulas($pValue = TRUE) { | |
| 116 | + $this->_preCalculateFormulas = (boolean) $pValue; | |
| 117 | + return $this; | |
| 114 | 118 | } |
| 115 | 119 | |
| 116 | - /** | |
| 117 | - * Get use disk caching where possible? | |
| 118 | - * | |
| 119 | - * @return boolean | |
| 120 | - */ | |
| 121 | - public function getUseDiskCaching() | |
| 122 | - { | |
| 123 | - return $this->_useDiskCaching; | |
| 124 | - } | |
| 120 | + /** | |
| 121 | + * Get use disk caching where possible? | |
| 122 | + * | |
| 123 | + * @return boolean | |
| 124 | + */ | |
| 125 | + public function getUseDiskCaching() { | |
| 126 | + return $this->_useDiskCaching; | |
| 127 | + } | |
| 125 | 128 | |
| 126 | - /** | |
| 127 | - * Set use disk caching where possible? | |
| 128 | - * | |
| 129 | - * @param boolean $pValue | |
| 130 | - * @param string $pDirectory Disk caching directory | |
| 131 | - * @throws PHPExcel_Writer_Exception when directory does not exist | |
| 132 | - * @return PHPExcel_Writer_Excel2007 | |
| 133 | - */ | |
| 134 | - public function setUseDiskCaching($pValue = false, $pDirectory = null) | |
| 135 | - { | |
| 136 | - $this->_useDiskCaching = $pValue; | |
| 129 | + /** | |
| 130 | + * Set use disk caching where possible? | |
| 131 | + * | |
| 132 | + * @param boolean $pValue | |
| 133 | + * @param string $pDirectory Disk caching directory | |
| 134 | + * @throws PHPExcel_Writer_Exception when directory does not exist | |
| 135 | + * @return PHPExcel_Writer_Excel2007 | |
| 136 | + */ | |
| 137 | + public function setUseDiskCaching($pValue = FALSE, $pDirectory = NULL) { | |
| 138 | + $this->_useDiskCaching = $pValue; | |
| 137 | 139 | |
| 138 | - if ($pDirectory !== null) { | |
| 139 | - if (is_dir($pDirectory)) { | |
| 140 | - $this->_diskCachingDirectory = $pDirectory; | |
| 141 | - } else { | |
| 142 | - throw new PHPExcel_Writer_Exception("Directory does not exist: $pDirectory"); | |
| 143 | - } | |
| 144 | - } | |
| 145 | - return $this; | |
| 146 | - } | |
| 140 | + if ($pDirectory !== NULL) { | |
| 141 | + if (is_dir($pDirectory)) { | |
| 142 | + $this->_diskCachingDirectory = $pDirectory; | |
| 143 | + } else { | |
| 144 | + throw new PHPExcel_Writer_Exception("Directory does not exist: $pDirectory"); | |
| 145 | + } | |
| 146 | + } | |
| 147 | + return $this; | |
| 148 | + } | |
| 147 | 149 | |
| 148 | - /** | |
| 149 | - * Get disk caching directory | |
| 150 | - * | |
| 151 | - * @return string | |
| 152 | - */ | |
| 153 | - public function getDiskCachingDirectory() | |
| 154 | - { | |
| 155 | - return $this->_diskCachingDirectory; | |
| 156 | - } | |
| 150 | + /** | |
| 151 | + * Get disk caching directory | |
| 152 | + * | |
| 153 | + * @return string | |
| 154 | + */ | |
| 155 | + public function getDiskCachingDirectory() { | |
| 156 | + return $this->_diskCachingDirectory; | |
| 157 | + } | |
| 157 | 158 | } |