TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Resource\FileInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\FileInterface:
TYPO3\CMS\Core\Resource\ResourceInterface TYPO3\CMS\Core\Resource\AbstractFile TYPO3\CMS\Core\Resource\FileReference TYPO3\CMS\Core\Resource\File TYPO3\CMS\Core\Resource\ProcessedFile

Public Member Functions

 hasProperty ($key)
 
 getProperty ($key)
 
 getSize ()
 
 getSha1 ()
 
 getNameWithoutExtension ()
 
 getExtension ()
 
 getMimeType ()
 
 getModificationTime ()
 
 getCreationTime ()
 
 getContents ()
 
 setContents ($contents)
 
 delete ()
 
 rename ($newName)
 
 getPublicUrl ($relativeToCurrentScript=FALSE)
 
 isIndexed ()
 
 getForLocalProcessing ($writable=TRUE)
 
 toArray ()
 
- Public Member Functions inherited from TYPO3\CMS\Core\Resource\ResourceInterface
 getIdentifier ()
 
 getName ()
 
 getStorage ()
 
 getHashedIdentifier ()
 
 getParentFolder ()
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! File Interface

Author
Ingmar Schlecht ingma.nosp@m.r@ty.nosp@m.po3.o.nosp@m.rg

Definition at line 21 of file FileInterface.php.

Member Function Documentation

◆ delete()

TYPO3\CMS\Core\Resource\FileInterface::delete ( )

Deletes this file from its storage. This also means that this object becomes useless.

Returns
boolean TRUE if deletion succeeded

Implemented in TYPO3\CMS\Core\Resource\AbstractFile, and TYPO3\CMS\Core\Resource\FileReference.

◆ getContents()

TYPO3\CMS\Core\Resource\FileInterface::getContents ( )

Get the contents of this file

Returns
string File contents

Implemented in TYPO3\CMS\Core\Resource\FileReference, TYPO3\CMS\Core\Resource\AbstractFile, and TYPO3\CMS\Core\Resource\File.

◆ getCreationTime()

TYPO3\CMS\Core\Resource\FileInterface::getCreationTime ( )

Returns the creation time of the file as Unix timestamp

Returns
integer

Implemented in TYPO3\CMS\Core\Resource\FileReference, and TYPO3\CMS\Core\Resource\AbstractFile.

◆ getExtension()

TYPO3\CMS\Core\Resource\FileInterface::getExtension ( )

◆ getForLocalProcessing()

TYPO3\CMS\Core\Resource\FileInterface::getForLocalProcessing (   $writable = TRUE)

Returns a path to a local version of this file to process it locally (e.g. with some system tool). If the file is normally located on a remote storages, this creates a local copy. If the file is already on the local system, this only makes a new copy if $writable is set to TRUE.

Parameters
bool$writableSet this to FALSE if you only want to do read operations on the file.
Returns
string

Implemented in TYPO3\CMS\Core\Resource\AbstractFile, and TYPO3\CMS\Core\Resource\FileReference.

◆ getMimeType()

TYPO3\CMS\Core\Resource\FileInterface::getMimeType ( )

Get the MIME type of this file

Returns
array file information

Implemented in TYPO3\CMS\Core\Resource\FileReference, and TYPO3\CMS\Core\Resource\AbstractFile.

Referenced by TYPO3\CMS\Core\Resource\ResourceStorage\dumpFileContents().

◆ getModificationTime()

TYPO3\CMS\Core\Resource\FileInterface::getModificationTime ( )

Returns the modification time of the file as Unix timestamp

Returns
integer

Implemented in TYPO3\CMS\Core\Resource\FileReference, and TYPO3\CMS\Core\Resource\AbstractFile.

◆ getNameWithoutExtension()

TYPO3\CMS\Core\Resource\FileInterface::getNameWithoutExtension ( )

Returns the basename (the name without extension) of this file.

Returns
string

Implemented in TYPO3\CMS\Core\Resource\FileReference, and TYPO3\CMS\Core\Resource\AbstractFile.

◆ getProperty()

TYPO3\CMS\Core\Resource\FileInterface::getProperty (   $key)

Get the value of the $key property.

Parameters
string$key
Returns
string

Implemented in TYPO3\CMS\Core\Resource\ProcessedFile, TYPO3\CMS\Core\Resource\AbstractFile, TYPO3\CMS\Core\Resource\FileReference, and TYPO3\CMS\Core\Resource\File.

◆ getPublicUrl()

TYPO3\CMS\Core\Resource\FileInterface::getPublicUrl (   $relativeToCurrentScript = FALSE)

Returns a publicly accessible URL for this file

WARNING: Access to the file may be restricted by further means, e.g. some web-based authentication. You have to take care of this yourself.

Parameters
bool$relativeToCurrentScriptDetermines whether the URL returned should be relative to the current script, in case it is relative at all (only for the LocalDriver)
Returns
string

Implemented in TYPO3\CMS\Core\Resource\ProcessedFile, TYPO3\CMS\Core\Resource\AbstractFile, TYPO3\CMS\Core\Resource\FileReference, and TYPO3\CMS\Core\Resource\File.

Referenced by TYPO3\CMS\Extbase\Service\ImageService\getImageUri().

◆ getSha1()

TYPO3\CMS\Core\Resource\FileInterface::getSha1 ( )

Returns the Sha1 of this file

Returns
string

Implemented in TYPO3\CMS\Core\Resource\FileReference, TYPO3\CMS\Core\Resource\AbstractFile, and TYPO3\CMS\Core\Resource\File.

◆ getSize()

TYPO3\CMS\Core\Resource\FileInterface::getSize ( )

◆ hasProperty()

TYPO3\CMS\Core\Resource\FileInterface::hasProperty (   $key)

Returns true if the given key exists for this file.

Parameters
string$key
Returns
boolean

Implemented in TYPO3\CMS\Core\Resource\AbstractFile, TYPO3\CMS\Core\Resource\FileReference, and TYPO3\CMS\Core\Resource\File.

◆ isIndexed()

TYPO3\CMS\Core\Resource\FileInterface::isIndexed ( )

Returns TRUE if this file is indexed

Returns
boolean

Implemented in TYPO3\CMS\Core\Resource\FileReference, TYPO3\CMS\Core\Resource\ProcessedFile, and TYPO3\CMS\Core\Resource\File.

◆ rename()

TYPO3\CMS\Core\Resource\FileInterface::rename (   $newName)

Renames this file.

Parameters
string$newNameThe new file name
Returns
File

Implemented in TYPO3\CMS\Core\Resource\AbstractFile, and TYPO3\CMS\Core\Resource\FileReference.

◆ setContents()

TYPO3\CMS\Core\Resource\FileInterface::setContents (   $contents)

Replace the current file contents with the given string.

: Consider to remove this function from the interface, as its : At the same time, it could be considered whether to make the whole

Parameters
string$contentsThe contents to write to the file.
Returns
File The file object (allows chaining).

Implemented in TYPO3\CMS\Core\Resource\FileReference, TYPO3\CMS\Core\Resource\AbstractFile, TYPO3\CMS\Core\Resource\File, and TYPO3\CMS\Core\Resource\ProcessedFile.

◆ toArray()

TYPO3\CMS\Core\Resource\FileInterface::toArray ( )

Returns an array representation of the file. (This is used by the generic listing module vidi when displaying file records.)

Returns
array Array of main data of the file. Don't rely on all data to be present here, it's just a selection of the most relevant information.

Implemented in TYPO3\CMS\Core\Resource\FileReference, TYPO3\CMS\Core\Resource\ProcessedFile, and TYPO3\CMS\Core\Resource\File.