|
| __construct () |
| Create a new PHPExcel_Reader_CSV. More...
|
|
| setInputEncoding ($pValue='UTF-8') |
| Set input encoding. More...
|
|
| getInputEncoding () |
| Get input encoding. More...
|
|
| listWorksheetInfo ($pFilename) |
| Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) More...
|
|
| load ($pFilename) |
| Loads PHPExcel from file. More...
|
|
| loadIntoExisting ($pFilename, PHPExcel $objPHPExcel) |
| Loads PHPExcel from file into PHPExcel instance. More...
|
|
| getDelimiter () |
| Get delimiter. More...
|
|
| setDelimiter ($pValue=',') |
| Set delimiter. More...
|
|
| getEnclosure () |
| Get enclosure. More...
|
|
| setEnclosure ($pValue='"') |
| Set enclosure. More...
|
|
| getSheetIndex () |
| Get sheet index. More...
|
|
| setSheetIndex ($pValue=0) |
| Set sheet index. More...
|
|
| setContiguous ($contiguous=FALSE) |
| Set Contiguous. More...
|
|
| getContiguous () |
| Get Contiguous. More...
|
|
| getReadDataOnly () |
| Read data only? If this is true, then the Reader will only read data values for cells, it will not read any formatting information. More...
|
|
| setReadDataOnly ($pValue=FALSE) |
| Set read data only Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information. More...
|
|
| getIncludeCharts () |
| Read charts in workbook? If this is true, then the Reader will include any charts that exist in the workbook. More...
|
|
| setIncludeCharts ($pValue=FALSE) |
| Set read charts in workbook Set to true, to advise the Reader to include any charts that exist in the workbook. More...
|
|
| getLoadSheetsOnly () |
| Get which sheets to load Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null indicating that all worksheets in the workbook should be loaded. More...
|
|
| setLoadSheetsOnly ($value=NULL) |
| Set which sheets to load. More...
|
|
| setLoadAllSheets () |
| Set all sheets to load Tells the Reader to load all worksheets from the workbook. More...
|
|
| getReadFilter () |
| Read filter. More...
|
|
| setReadFilter (PHPExcel_Reader_IReadFilter $pValue) |
| Set read filter. More...
|
|
| canRead ($pFilename) |
| Can the current PHPExcel_Reader_IReader read the file? More...
|
|
| securityScan ($xml) |
| Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks. More...
|
|
| securityScanFile ($filestream) |
| Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks. More...
|
|
Definition at line 45 of file CSV.php.
PHPExcel_Reader_CSV::listWorksheetInfo |
( |
|
$pFilename | ) |
|
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
- Parameters
-
- Exceptions
-
Definition at line 173 of file CSV.php.
References PHPExcel_Reader_Abstract\$_fileHandle, _isValidFormat(), PHPExcel_Reader_Abstract\_openFile(), _skipBOM(), array, and PHPExcel_Cell\stringFromColumnIndex().
178 fclose ($this->_fileHandle);
186 $escapeEnclosures =
array(
"\\" . $this->_enclosure, $this->_enclosure . $this->_enclosure );
188 $worksheetInfo =
array();
189 $worksheetInfo[0][
'worksheetName'] =
'Worksheet';
190 $worksheetInfo[0][
'lastColumnLetter'] =
'A';
191 $worksheetInfo[0][
'lastColumnIndex'] = 0;
192 $worksheetInfo[0][
'totalRows'] = 0;
193 $worksheetInfo[0][
'totalColumns'] = 0;
196 while (($rowData = fgetcsv($fileHandle, 0, $this->_delimiter, $this->_enclosure)) !== FALSE) {
197 $worksheetInfo[0][
'totalRows']++;
198 $worksheetInfo[0][
'lastColumnIndex'] = max($worksheetInfo[0][
'lastColumnIndex'], count($rowData) - 1);
202 $worksheetInfo[0][
'totalColumns'] = $worksheetInfo[0][
'lastColumnIndex'] + 1;
207 return $worksheetInfo;
_skipBOM()
Move filepointer past any BOM marker.
Create styles array
The data for the language used.
_isValidFormat()
Validate that the current file is a CSV file.
static stringFromColumnIndex($pColumnIndex=0)
String from columnindex.
_openFile($pFilename)
Open file for reading.
PHPExcel_Reader_CSV::loadIntoExisting |
( |
|
$pFilename, |
|
|
PHPExcel |
$objPHPExcel |
|
) |
| |
Loads PHPExcel from file into PHPExcel instance.
- Parameters
-
- Returns
- PHPExcel
- Exceptions
-
Definition at line 234 of file CSV.php.
References $_contiguousRow, PHPExcel_Reader_Abstract\$_fileHandle, $_sheetIndex, $objPHPExcel, _isValidFormat(), PHPExcel_Reader_Abstract\_openFile(), _skipBOM(), array, PHPExcel_Shared_String\ConvertEncoding(), PHPExcel\createSheet(), PHPExcel\getSheetCount(), and PHPExcel\setActiveSheetIndex().
Referenced by load().
236 $lineEnding = ini_get(
'auto_detect_line_endings');
237 ini_set(
'auto_detect_line_endings',
true);
242 fclose ($this->_fileHandle);
256 $escapeEnclosures =
array(
"\\" . $this->_enclosure,
257 $this->_enclosure . $this->_enclosure
262 if ($this->_contiguous) {
267 while (($rowData = fgetcsv($fileHandle, 0, $this->_delimiter, $this->_enclosure)) !== FALSE) {
269 foreach($rowData as $rowDatum) {
270 if ($rowDatum !=
'' && $this->_readFilter->readCell($columnLetter, $currentRow)) {
272 $rowDatum = str_replace($escapeEnclosures, $this->_enclosure, $rowDatum);
275 if ($this->_inputEncoding !==
'UTF-8') {
280 $sheet->getCell($columnLetter . $currentRow)->setValue($rowDatum);
290 if ($this->_contiguous) {
291 $this->_contiguousRow = $currentRow;
294 ini_set(
'auto_detect_line_endings', $lineEnding);
_skipBOM()
Move filepointer past any BOM marker.
getSheetCount()
Get sheet count.
static ConvertEncoding($value, $to, $from)
Convert string from one encoding to another.
createSheet($iSheetIndex=NULL)
Create sheet and add it to this workbook.
Create styles array
The data for the language used.
_isValidFormat()
Validate that the current file is a CSV file.
setActiveSheetIndex($pIndex=0)
Set active sheet index.
_openFile($pFilename)
Open file for reading.