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' |
The EditedFile class.
Represents an existing file being edited, i.e. content of the file is going to be replaced with new content.
__construct | ( | $fileName, | |
CKFinder | $app, | ||
$newFileName = null |
|||
) |
string | $fileName | |
null | $newFileName |
|
protected |
Checks double extensions in a given file name.
null | string | $fileName | file name or null if the current file name is checked |
true
if extensions are allowed for the current resource type getNewContents | ( | ) |
Returns new contents set for the edited file.
getNewExtension | ( | ) |
Returns the new file extension.
getNewFilename | ( | ) |
Returns the new file name of the edited file.
getWorkingFolder | ( | ) |
Returns the folder of the edited file.
isValid | ( | ) |
Validates the file.
true
if the file passed validationAlreadyExistsException | |
FileNotFoundException | |
InvalidExtensionException | |
InvalidNameException | |
InvalidRequestException | |
InvalidUploadException |
Reimplemented in EditedImage.
save | ( | $contents, | |
$filePath = null |
|||
) |
Sets new file contents.
string | $contents | new file contents |
null | string | $filePath | optional path if new contents should be saved in a new file |
Reimplemented from ExistingFile.
saveAsNew | ( | $saveAsNew | ) |
Sets the flag if the edited file is saved as new and does not exist in the file system yet.
bool | $saveAsNew |
setNewContents | ( | $newContents | ) |
Sets new contents for the edited file.
string | $newContents |