Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 39 and 400]

(no description)

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

Defines 1 class


Class: ReaderAbstract  - X-Ref

Class ReaderAbstract

__construct(OptionsManagerInterface $optionsManager,GlobalFunctionsHelper $globalFunctionsHelper,InternalEntityFactoryInterface $entityFactory)   X-Ref

param: OptionsManagerInterface $optionsManager
param: GlobalFunctionsHelper $globalFunctionsHelper
param: InternalEntityFactoryInterface $entityFactory

setShouldFormatDates($shouldFormatDates)   X-Ref
Sets whether date/time values should be returned as PHP objects or be formatted as strings.

return: ReaderAbstract
param: bool $shouldFormatDates

setShouldPreserveEmptyRows($shouldPreserveEmptyRows)   X-Ref
Sets whether empty rows should be returned or skipped.

return: ReaderAbstract
param: bool $shouldPreserveEmptyRows

open($filePath)   X-Ref
Prepares the reader to read the given file. It also makes sure
that the file exists and is readable.

return: void
param: string $filePath Path of the file to be read

getFileRealPath($filePath)   X-Ref
Returns the real path of the given path.
If the given path is a valid stream wrapper, returns the path unchanged.

return: string
param: string $filePath

getStreamWrapperScheme($filePath)   X-Ref
Returns the scheme of the custom stream wrapper, if the path indicates a stream wrapper is used.
For example, php://temp => php, s3://path/to/file => s3...

return: string|null The stream wrapper scheme or NULL if not a stream wrapper
param: string $filePath Path of the file to be read

isStreamWrapper($filePath)   X-Ref
Checks if the given path is an unsupported stream wrapper
(like local path, php://temp, mystream://foo/bar...).

return: bool Whether the given path is an unsupported stream wrapper
param: string $filePath Path of the file to be read

isSupportedStreamWrapper($filePath)   X-Ref
Checks if the given path is an supported stream wrapper
(like php://temp, mystream://foo/bar...).
If the given path is a local path, returns true.

return: bool Whether the given path is an supported stream wrapper
param: string $filePath Path of the file to be read

isPhpStream($filePath)   X-Ref
Checks if a path is a PHP stream (like php://output, php://memory, ...)

return: bool Whether the given path maps to a PHP stream
param: string $filePath Path of the file to be read

getSheetIterator()   X-Ref
Returns an iterator to iterate over sheets.

return: \Iterator To iterate over sheets

close()   X-Ref
Closes the reader, preventing any additional reading

return: void