CKFinder 3 – PHP Connector Documentation
CopiedFile Class Reference
Inheritance diagram for CopiedFile:
ExistingFile File MovedFile

Public Member Functions

 __construct ($fileName, $folder, ResourceType $resourceType, CKFinder $app)
 
 getTargetFolder ()
 
 getFileName ()
 
 setCopyOptions (string $copyOptions)
 
 hasAllowedExtension ()
 
 hasAllowedSize ()
 
 autorename (Backend $backend=null, $path='')
 
 doCopy ()
 
 getTargetFilename ()
 
 getSourceFilename ()
 
 getTargetFilePath ()
 
 getSourceFilePath ()
 
 isValid ()
 
- 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 Attributes

 $targetFolder
 
string $copyOptions
 
string $sourceFileName
 
- 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 CopiedFile class.

Represents a copied file.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $fileName,
  $folder,
ResourceType  $resourceType,
CKFinder  $app 
)

Constructor.

Parameters
string$fileNamesource file name
string$foldercopied source file resource type relative path
ResourceType$resourceTypesource file resource type
CKFinder$appCKFinder

Reimplemented from ExistingFile.

Reimplemented in MovedFile.

Member Function Documentation

◆ autorename()

autorename ( Backend  $backend = null,
  $path = '' 
)

Renames the current file by adding a number to the file name.

Renaming is done by adding a number in parenthesis provided that the file name does not collide with any other file existing in the target backend/path. For example, if the target backend path contains a file named foo.txt and the current file name is foo.txt, this method will change the current file name to foo(1).txt.

Parameters
Backend$backendtarget backend
string$pathtarget backend-relative path
Returns
bool true if file was renamed
Parameters
mixed$path

Reimplemented from File.

◆ doCopy()

doCopy ( )

Copies the current file.

Returns
bool true if the file was copied successfully
Exceptions

Exception

◆ getSourceFilename()

getSourceFilename ( )

Returns the source file name of the copied file.

◆ getSourceFilePath()

getSourceFilePath ( )

Returns the source file name of the copied file.

◆ getTargetFilename()

getTargetFilename ( )

Returns the target file name of the copied file.

Returns
string

◆ getTargetFilePath()

getTargetFilePath ( )

Returns the target path of the copied file.

◆ getTargetFolder()

getTargetFolder ( )

Returns the target folder for a copied file.

◆ hasAllowedExtension()

hasAllowedExtension ( )

Checks if the file has an extension allowed in both source and target ResourceTypes.

Returns
bool true if the file has an extension allowed in source and target directories

Reimplemented from ExistingFile.

◆ hasAllowedSize()

hasAllowedSize ( )

Checks if the copied file size does not exceed the file size limit set for the target folder.

Exceptions
FilesystemException

◆ isValid()

isValid ( )

Validates the copied file.

Returns
bool true if the copied file is valid and ready to be copied
Exceptions
FilesystemException

Exception

◆ setCopyOptions()

setCopyOptions ( string  $copyOptions)

Sets copy options.

See also
CopiedFile::$copyOptions

Member Data Documentation

◆ $sourceFileName

string $sourceFileName
protected

File name of the source file.


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