Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

(no description)

File Size: 563 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Csv  - X-Ref

__construct()   X-Ref
Create a new CSV Reader instance.


setInputEncoding($pValue)   X-Ref
Set input encoding.

param: string $pValue Input encoding, eg: 'UTF-8'
return: Csv

getInputEncoding()   X-Ref
Get input encoding.

return: string

skipBOM()   X-Ref
Move filepointer past any BOM marker.


checkSeparator()   X-Ref
Identify any separator that is explicitly set in the file.


inferSeparator()   X-Ref
Infer the separator if it isn't explicitly set in the file or specified by the user.


getNextLine($line = '')   X-Ref
No description

listWorksheetInfo($pFilename)   X-Ref
Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).

param: string $pFilename
return: array

load($pFilename)   X-Ref
Loads Spreadsheet from file.

param: string $pFilename
return: Spreadsheet

loadIntoExisting($pFilename, Spreadsheet $spreadsheet)   X-Ref
Loads PhpSpreadsheet from file into PhpSpreadsheet instance.

param: string $pFilename
param: Spreadsheet $spreadsheet
return: Spreadsheet

getDelimiter()   X-Ref
Get delimiter.

return: string

setDelimiter($delimiter)   X-Ref
Set delimiter.

param: string $delimiter Delimiter, eg: ','
return: CSV

getEnclosure()   X-Ref
Get enclosure.

return: string

setEnclosure($enclosure)   X-Ref
Set enclosure.

param: string $enclosure Enclosure, defaults to "
return: CSV

getSheetIndex()   X-Ref
Get sheet index.

return: int

setSheetIndex($pValue)   X-Ref
Set sheet index.

param: int $pValue Sheet index
return: CSV

setContiguous($contiguous)   X-Ref
Set Contiguous.

param: bool $contiguous
return: Csv

getContiguous()   X-Ref
Get Contiguous.

return: bool

setEscapeCharacter($escapeCharacter)   X-Ref
Set escape backslashes.

param: string $escapeCharacter
return: $this

getEscapeCharacter()   X-Ref
Get escape backslashes.

return: string

canRead($pFilename)   X-Ref
Can the current IReader read the file?

param: string $pFilename
return: bool