Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

(no description)

File Size: 606 lines (16 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: $this

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()   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

openFileOrMemory($pFilename)   X-Ref
No description

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

param: string $pFilename
return: Spreadsheet

getDelimiter()   X-Ref
Get delimiter.

return: string

setDelimiter($delimiter)   X-Ref
Set delimiter.

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

getEnclosure()   X-Ref
Get enclosure.

return: string

setEnclosure($enclosure)   X-Ref
Set enclosure.

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

getSheetIndex()   X-Ref
Get sheet index.

return: int

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

param: int $pValue Sheet index
return: $this

setContiguous($contiguous)   X-Ref
Set Contiguous.

param: bool $contiguous
return: $this

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

guessEncodingTestNoBom(string &$encoding, string &$contents, string $compare, string $setEncoding)   X-Ref
No description

guessEncodingNoBom(string $filename)   X-Ref
No description

guessEncodingTestBom(string &$encoding, string $first4, string $compare, string $setEncoding)   X-Ref
No description

guessEncodingBom(string $filename)   X-Ref
No description

guessEncoding(string $filename, string $dflt = 'CP1252')   X-Ref
No description