CKFinder 3 – PHP Connector Documentation
EditedFile Class Reference
Inheritance diagram for EditedFile:
ExistingFile File EditedImage

Public Member Functions

 __construct ($fileName, CKFinder $app, $newFileName=null)
 
 isValid ()
 
 getNewFilename ()
 
 getNewExtension ()
 
 saveAsNew ($saveAsNew)
 
 save ($contents, $filePath=null)
 
 setNewContents ($newContents)
 
 getNewContents ()
 
 getWorkingFolder ()
 
- Public Member Functions inherited from ExistingFile
 __construct ($fileName, $folder, ResourceType $resourceType, CKFinder $app)
 
 getPath ()
 
 getFilePath ()
 
 hasValidPath ()
 
 getResourceType ()
 
 hasAllowedExtension ()
 
 isHidden ()
 
 hasHiddenPath ()
 
 exists ()
 
 getContentsStream ()
 
 getContents ()
 
 save ($contents, $filePath=null)
 
 addError (int $number)
 
 getErrors ()
 
 deleteThumbnails ()
 
 deleteResizedImages ()
 
 getTimestamp ()
 
 getMimeType ()
 
 getSize ()
 
- Public Member Functions inherited from File
 __construct ($fileName, CKFinder $app)
 
 hasValidFilename ()
 
 getFilename ()
 
 getExtension ()
 
 getExtensions ($newFileName=null)
 
 autorename (Backend $backend=null, $path='')
 
 isImage ()
 
 getCache ()
 

Protected Member Functions

 areValidDoubleExtensions ($fileName=null)
 

Protected Attributes

 $workingFolder
 
 $newFileName
 
 $saveAsNew = false
 
 $newContents
 
- Protected Attributes inherited from ExistingFile
 $resourceType
 
 $folder
 
 $errors = []
 
 $metadata
 
 $backend
 
- Protected Attributes inherited from File
 $fileName
 
 $config
 
 $app
 

Additional Inherited Members

- Static Public Member Functions inherited from File
static isValidName ($fileName, $disallowUnsafeCharacters=true)
 
static secureName ($fileName, $disallowUnsafeCharacters=true, $forceAscii=false)
 
static convertToAscii ($str)
 
- Public Attributes inherited from File
const NO_EXTENSION = 'NO_EXT'
 

Detailed Description

The EditedFile class.

Represents an existing file being edited, i.e. content of the file is going to be replaced with new content.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $fileName,
CKFinder  $app,
  $newFileName = null 
)
Parameters
string$fileName
null$newFileName

Member Function Documentation

◆ areValidDoubleExtensions()

areValidDoubleExtensions (   $fileName = null)
protected

Checks double extensions in a given file name.

Parameters
null | string$fileNamefile name or null if the current file name is checked
Returns
bool true if extensions are allowed for the current resource type

◆ getNewContents()

getNewContents ( )

Returns new contents set for the edited file.

Returns
string

◆ getNewExtension()

getNewExtension ( )

Returns the new file extension.

◆ getNewFilename()

getNewFilename ( )

Returns the new file name of the edited file.

Returns
null|string the new file name of the edited file

◆ getWorkingFolder()

getWorkingFolder ( )

Returns the folder of the edited file.

Returns
WorkingFolder

◆ isValid()

isValid ( )

Validates the file.

Returns
bool true if the file passed validation
Exceptions
AlreadyExistsException
FileNotFoundException
InvalidExtensionException
InvalidNameException
InvalidRequestException
InvalidUploadException

Reimplemented in EditedImage.

◆ save()

save (   $contents,
  $filePath = null 
)

Sets new file contents.

Parameters
string$contentsnew file contents
null | string$filePathoptional path if new contents should be saved in a new file

Reimplemented from ExistingFile.

◆ saveAsNew()

saveAsNew (   $saveAsNew)

Sets the flag if the edited file is saved as new and does not exist in the file system yet.

Parameters
bool$saveAsNew

◆ setNewContents()

setNewContents (   $newContents)

Sets new contents for the edited file.

Parameters
string$newContents

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