~agasti-rhok-02/sahana-agasti/mayon-rhok-02

« back to all changes in this revision

Viewing changes to plugins/sfPhpExcelPlugin/lib/PHPExcel/PHPExcel/Writer/CSV.php

  • Committer: Chad Heuschober
  • Date: 2010-12-04 04:01:41 UTC
  • mfrom: (1.2.1 mayon)
  • Revision ID: chad.heuschober@mail.cuny.edu-20101204040141-orjw950gt411jzmt
Merged changes from r2 of project trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/**
3
3
 * PHPExcel
4
4
 *
5
 
 * Copyright (c) 2006 - 2009 PHPExcel
 
5
 * Copyright (c) 2006 - 2010 PHPExcel
6
6
 *
7
7
 * This library is free software; you can redistribute it and/or
8
8
 * modify it under the terms of the GNU Lesser General Public
20
20
 *
21
21
 * @category   PHPExcel
22
22
 * @package    PHPExcel_Writer
23
 
 * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
 
23
 * @copyright  Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
24
24
 * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
25
 
 * @version    ##VERSION##, ##DATE##
 
25
 * @version    1.7.4, 2010-08-26
26
26
 */
27
27
 
28
28
 
29
 
/** PHPExcel_IWriter */
30
 
require_once 'PHPExcel/Writer/IWriter.php';
31
 
 
32
 
/** PHPExcel_Cell */
33
 
require_once 'PHPExcel/Cell.php';
34
 
 
35
 
/** PHPExcel_RichText */
36
 
require_once 'PHPExcel/RichText.php';
37
 
 
38
 
/** PHPExcel_Shared_String */
39
 
require_once 'PHPExcel/Shared/String.php';
40
 
 
41
 
 
42
29
/**
43
30
 * PHPExcel_Writer_CSV
44
31
 *
45
32
 * @category   PHPExcel
46
33
 * @package    PHPExcel_Writer
47
 
 * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
 
34
 * @copyright  Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)
48
35
 */
49
36
class PHPExcel_Writer_CSV implements PHPExcel_Writer_IWriter {
50
37
        /**
119
106
                // Fetch sheet
120
107
                $sheet = $this->_phpExcel->getSheet($this->_sheetIndex);
121
108
 
 
109
                $saveDebugLog = PHPExcel_Calculation::getInstance()->writeDebugLog;
 
110
                PHPExcel_Calculation::getInstance()->writeDebugLog = false;
122
111
                $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
123
112
                PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
124
113
 
145
134
                fclose($fileHandle);
146
135
 
147
136
                PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType);
 
137
                PHPExcel_Calculation::getInstance()->writeDebugLog = $saveDebugLog;
148
138
        }
149
139
 
150
140
        /**
160
150
         * Set delimiter
161
151
         *
162
152
         * @param       string  $pValue         Delimiter, defaults to ,
 
153
         * @return PHPExcel_Writer_CSV
163
154
         */
164
155
        public function setDelimiter($pValue = ',') {
165
156
                $this->_delimiter = $pValue;
 
157
                return $this;
166
158
        }
167
159
 
168
160
        /**
178
170
         * Set enclosure
179
171
         *
180
172
         * @param       string  $pValue         Enclosure, defaults to "
 
173
         * @return PHPExcel_Writer_CSV
181
174
         */
182
175
        public function setEnclosure($pValue = '"') {
183
176
                if ($pValue == '') {
184
177
                        $pValue = null;
185
178
                }
186
179
                $this->_enclosure = $pValue;
 
180
                return $this;
187
181
        }
188
182
 
189
183
        /**
199
193
         * Set line ending
200
194
         *
201
195
         * @param       string  $pValue         Line ending, defaults to OS line ending (PHP_EOL)
 
196
         * @return PHPExcel_Writer_CSV
202
197
         */
203
198
        public function setLineEnding($pValue = PHP_EOL) {
204
199
                $this->_lineEnding = $pValue;
 
200
                return $this;
205
201
        }
206
202
 
207
203
        /**
217
213
         * Set whether BOM should be used
218
214
         *
219
215
         * @param       boolean $pValue         Use UTF-8 byte-order mark? Defaults to false
 
216
         * @return PHPExcel_Writer_CSV
220
217
         */
221
218
        public function setUseBOM($pValue = false) {
222
219
                $this->_useBOM = $pValue;
 
220
                return $this;
223
221
        }
224
222
 
225
223
        /**
235
233
         * Set sheet index
236
234
         *
237
235
         * @param       int             $pValue         Sheet index
 
236
         * @return PHPExcel_Writer_CSV
238
237
         */
239
238
        public function setSheetIndex($pValue = 0) {
240
239
                $this->_sheetIndex = $pValue;
 
240
                return $this;
241
241
        }
242
242
 
243
243
        /**
293
293
     * Set Pre-Calculate Formulas
294
294
     *
295
295
     * @param boolean $pValue   Pre-Calculate Formulas?
 
296
     * @return PHPExcel_Writer_CSV
296
297
     */
297
298
    public function setPreCalculateFormulas($pValue = true) {
298
299
        $this->_preCalculateFormulas = $pValue;
 
300
        return $this;
299
301
    }
300
302
}