Documentation

csvFile extends file
in package

CSv file object

Tags
author

Stefan Seehafer sea75300@yahoo.de

copyright

(c) 2020, Stefan Seehafer

license

http://www.gnu.org/licenses/gpl.txt GPLv3

since
4.5-b8

Table of Contents

$allowedExts  : array<string|int, mixed>
Erlaubte Dateiendungen
$allowedTypes  : array<string|int, mixed>
Erlaubte Dateitypen
$cache  : cache
Cache-Objekt
$cacheModule  : string
Cache Modul
$cacheName  : string
Cache name
$config  : config
System-Config-Objekt
$content  : string
Dateiinhalt
$data  : array<string|int, mixed>
data-Array für nicht weiter definierte Eigenschaften
$dbcon  : database
DB-Verbindung
$events  : events
Event-Liste
$extension  : string
Dateierweiterung
$filename  : string
Dateiname
$filepath  : string
Dateispfad
$filesize  : int
Dateigröße
$fullpath  : string
Dateipfad inkl. Dateiname
$language  : language
System-Sprachen-Objekt
$notifications  : notifications
Notifications
$table  : string
Tabellen-Name
$delim  : string
Delimiter char
$enclosure  : string
Enclosure char
$handle  : resource
Resource from fopen
__construct()  : bool
Constructor
__destruct()  : void
Destructor
assignCsvFields()  : void
Assigns row by index to field
delete()  : bool
Löscht Datei in Dateisystem
escapeFileName()  : mixed
Bereinigt Dateiname von problematischen Zeichen
exists()  : bool
Prüft ob Datei existiert
getContent()  : bool|array<string|int, mixed>
Fetch file content
getData()  : array<string|int, mixed>
Gibt Inhalt von "data" zurück
getExtension()  : string
Erweiterung
getFileHash()  : string
File SHA256 hash
getFilename()  : string
Dateiname
getFileNameHash()  : string
Return hash based on filename
getFilepath()  : string
Dateipfad
getFilesize()  : int
Dateigröße
getFullpath()  : string
Dateipfad + Dateiname
getMimeType()  : string
Retieves file mime type
getModificationTime()  : int
Return file upload time in file system
hasResource()  : bool
Check if handle was set
init()  : void
Initialize file handle
isEoF()  : int
Tell file pos
isReadable()  : bool
ist Datei lesbar
isValidDataFolder()  : bool
Check if fullpath is valid path in /data folder structure
isValidType()  : bool
Check if file extension and file type is valid
isWritable()  : bool
ist Datei beschreibbar
loadContent()  : bool
Lädt Inhalt von gespeicherter Datei
moveUploadedFile()  : bool
Verschiebt via PHP Upload hochgeladene Datei von tmp-Pfad nach Zielpfad
prepareFieldName()  : bool
Prepares field nam,e
rename()  : bool
Datei umbenennen
retrieveFileExtension()  : string
Retrieve file extension via pathinfo
retrieveFileName()  : string
Retrieve file name via pathinfo
retrieveRealType()  : string
Retrieve real file path via finfo
seek()  : int
Seek file pos
setContent()  : mixed
Dateiinhalt setzen
setFilename()  : mixed
Dateiname setzen
tell()  : int
Tell file pos
writeContent()  : bool
Lädt Inhalt von gespeicherter Datei
basePath()  : string
Returns file data base path
realpathNoExists()  : string
"realpath" wrapper for non-existing files

Properties

$allowedExts

Erlaubte Dateiendungen

public static array<string|int, mixed> $allowedExts = ['csv']

$allowedTypes

Erlaubte Dateitypen

public static array<string|int, mixed> $allowedTypes = ['text/csv']

$cacheModule

Cache Modul

protected string $cacheModule = ''
Tags
since
3.4

$cacheName

Cache name

protected string $cacheName = false

$content

Dateiinhalt

protected string $content

$data

data-Array für nicht weiter definierte Eigenschaften

protected array<string|int, mixed> $data

$extension

Dateierweiterung

protected string $extension

$filename

Dateiname

protected string $filename

$filepath

Dateispfad

protected string $filepath

$filesize

Dateigröße

protected int $filesize

$fullpath

Dateipfad inkl. Dateiname

protected string $fullpath

$table

Tabellen-Name

protected string $table

$delim

Delimiter char

private string $delim

$enclosure

Enclosure char

private string $enclosure

$handle

Resource from fopen

private resource $handle

Methods

__construct()

Constructor

public __construct([string $filename = '' ], string|null $delim, string|null $enclosure) : bool
Parameters
$filename : string = ''
$delim : string|null
$enclosure : string|null
Return values
bool

__destruct()

Destructor

public __destruct() : void
Return values
void

assignCsvFields()

Assigns row by index to field

public assignCsvFields(array<string|int, mixed> $fields, array<string|int, mixed> &$line) : void
Parameters
$fields : array<string|int, mixed>
$line : array<string|int, mixed>
Return values
void

delete()

Löscht Datei in Dateisystem

public delete() : bool
Return values
bool

escapeFileName()

Bereinigt Dateiname von problematischen Zeichen

public escapeFileName(string &$filename) : mixed
Parameters
$filename : string
Return values
mixed

exists()

Prüft ob Datei existiert

public exists() : bool
Return values
bool

getContent()

Fetch file content

public getContent() : bool|array<string|int, mixed>
Return values
bool|array<string|int, mixed>

getData()

Gibt Inhalt von "data" zurück

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getExtension()

Erweiterung

public getExtension() : string
Return values
string

getFileHash()

File SHA256 hash

public getFileHash() : string
Tags
since
4.1
Return values
string

getFilename()

Dateiname

public getFilename() : string
Return values
string

getFileNameHash()

Return hash based on filename

public getFileNameHash() : string
Tags
since
5.0.0-a1
Return values
string

getFilepath()

Dateipfad

public getFilepath() : string
Return values
string

getFilesize()

Dateigröße

public getFilesize() : int
Return values
int

getFullpath()

Dateipfad + Dateiname

public getFullpath() : string
Return values
string

getMimeType()

Retieves file mime type

public getMimeType() : string
Return values
string

getModificationTime()

Return file upload time in file system

public getModificationTime() : int
Return values
int

hasResource()

Check if handle was set

public hasResource() : bool
Return values
bool

init()

Initialize file handle

public init() : void
Return values
void

isEoF()

Tell file pos

public isEoF() : int
Return values
int

isReadable()

ist Datei lesbar

public isReadable() : bool
Tags
since
3.5
Return values
bool

isValidDataFolder()

Check if fullpath is valid path in /data folder structure

public isValidDataFolder([string $path = '' ][, string $type = '/' ]) : bool
Parameters
$path : string = ''
$type : string = '/'
Tags
since
4.1
Return values
bool

isValidType()

Check if file extension and file type is valid

public static isValidType(string $ext, string $type[, array<string|int, mixed> $map = [] ]) : bool
Parameters
$ext : string
$type : string
$map : array<string|int, mixed> = []
Tags
since
4.5
see
validateFileType
Return values
bool

isWritable()

ist Datei beschreibbar

public isWritable() : bool
Tags
since
3.5
Return values
bool

loadContent()

Lädt Inhalt von gespeicherter Datei

public loadContent() : bool
Tags
since
3.5
Return values
bool

moveUploadedFile()

Verschiebt via PHP Upload hochgeladene Datei von tmp-Pfad nach Zielpfad

public moveUploadedFile(string $uploadedPath) : bool
Parameters
$uploadedPath : string
Tags
since
3.3
Return values
bool

prepareFieldName()

Prepares field nam,e

public static prepareFieldName(string &$field) : bool
Parameters
$field : string
Return values
bool

rename()

Datei umbenennen

public rename(string $newname[, int $userid = false ]) : bool
Parameters
$newname : string
$userid : int = false
Return values
bool

retrieveFileExtension()

Retrieve file extension via pathinfo

public static retrieveFileExtension(string $filename) : string
Parameters
$filename : string
Tags
since
4.5
Return values
string

retrieveFileName()

Retrieve file name via pathinfo

public static retrieveFileName(string $filename) : string
Parameters
$filename : string
Tags
since
5.0
Return values
string

retrieveRealType()

Retrieve real file path via finfo

public static retrieveRealType(string $path) : string
Parameters
$path : string
Tags
since
5.0.0-a3
Return values
string

seek()

Seek file pos

public seek(int $current) : int
Parameters
$current : int
Return values
int

setContent()

Dateiinhalt setzen

public setContent(string $content) : mixed
Parameters
$content : string
Return values
mixed

setFilename()

Dateiname setzen

public setFilename(string $filename) : mixed
Parameters
$filename : string
Return values
mixed

tell()

Tell file pos

public tell() : int
Return values
int

writeContent()

Lädt Inhalt von gespeicherter Datei

public writeContent() : bool
Tags
since
4.2
Return values
bool

basePath()

Returns file data base path

protected basePath(string $filename) : string
Parameters
$filename : string
Return values
string

realpathNoExists()

"realpath" wrapper for non-existing files

protected realpathNoExists(string $path) : string
Parameters
$path : string
Tags
since
4.5
see
ops::realpathNoExists
Return values
string

Search results