db
File Class Reference

Inherits Serializable.

Inherited by Image.

Public Member Functions

 __construct ($path, $webURI=NULL)
 
 exists ()
 
 isDir ()
 
 isFile ()
 
 isLink ()
 
 lastModifiedDate ()
 
 createdDate ()
 
 getMineType ()
 
 getMimeType ()
 
 getFsPath ()
 
 getWebURI ()
 
 getDir ()
 
 getFileName ()
 
 getExtension ()
 
 getFileContent ()
 
 getFileSize ()
 
 getFileExtension ()
 
 delete ()
 
 write ($string)
 
 serialize ()
 
 unserialize ($serialized)
 

Static Public Member Functions

static createFile ($path)
 
static getSafeFileName ($name)
 

Static Public Attributes

static $fileInfo = NULL
 

Protected Attributes

 $mimeType
 
 $file
 
 $webURI
 

Detailed Description

reprezentuje soubor/adresar na disku, je schopno rict jestli se jedna o adresar, soubor potom mimeType, velikost, cas vytvoreni atd.

filesystemova cesta se pise s normalnimi lomitky nehlede na os zapisuje se bez koncoveho lomitka

$webURI obsahuje cestu pod kterou by mel byt soubor dostupny

pouziva: http://php.net/manual/en/class.splfileobject.php http://www.phpro.org/tutorials/Introduction-to-SPL.html#14 https://www.inanimatt.com/php-files.html

Constructor & Destructor Documentation

◆ __construct()

__construct (   $path,
  $webURI = NULL 
)
Parameters
string$pathstring, ktery reprezentuje cestu k souboru nebo Adresar do ktereho se ma zapsat novy soubor
string$webURIpod jakou cestou ma byt dostupne na webu

Member Function Documentation

◆ createdDate()

createdDate ( )

vrati datum posledni modifikace souboru

Returns
Date datum posledni modifikace pokud je dostupna

◆ createFile()

static createFile (   $path)
static

◆ delete()

delete ( )

smaze soubor z disku

◆ exists()

exists ( )
Returns
boolean tests if file exists

◆ getDir()

getDir ( )
Returns
string vraci v jakem adresari se nachazi

◆ getExtension()

getExtension ( )

◆ getFileContent()

getFileContent ( )

◆ getFileExtension()

getFileExtension ( )

Return file extension example 'zip' , 'jpg'

Returns
string

◆ getFileName()

getFileName ( )

cisty nazev souboru bez adresare kde se nachazi

Returns
string

◆ getFileSize()

getFileSize ( )

return file size in bytes

Returns
int

◆ getFsPath()

getFsPath ( )

vrati absolutni path, kde se soubor nachazi na disku

◆ getMimeType()

getMimeType ( )
Returns
string vraci mime-type

◆ getMineType()

getMineType ( )
Deprecated:
use getMimeType
Returns
string vraci mime-type

◆ getSafeFileName()

static getSafeFileName (   $name)
static

funkce vraci "bezpecny" nazev souboru s tim, ze jej prevede na mala pismenka

Parameters
string$name
Returns
string protected

◆ getWebURI()

getWebURI ( )

◆ isDir()

isDir ( )

zjisti jestli je

Returns
boolean true pokud je soubor

◆ isFile()

isFile ( )

zjisti jestli je soubor

Returns
boolean true if this object is file

◆ isLink()

isLink ( )

zjisti jestli je hard nebo soft link na unixech nebo junction na windows?

◆ lastModifiedDate()

lastModifiedDate ( )

vrati datum posledni modifikace souboru

Returns
Date datum posledni modifikace pokud je dostupna

◆ serialize()

serialize ( )

implements Serializable interface serialize

Returns
string serialized object

◆ unserialize()

unserialize (   $serialized)

implements Serializable interface serialize

Parameters
string$serialized

◆ write()

write (   $string)

Zapise do souboru

Parameters
type$string
Returns
integer pocet zapsanych znaku

Member Data Documentation

◆ $file

$file
protected

◆ $fileInfo

$fileInfo = NULL
static

◆ $mimeType

$mimeType
protected

◆ $webURI

$webURI
protected

The documentation for this class was generated from the following file: