Abstract Class MOXMAN_Commands_BaseCommand

InheritanceMOXMAN_Commands_BaseCommand
ImplementsMOXMAN_ICommand
SubclassesMOXMAN_Commands_AlterImageCommand, MOXMAN_Commands_CopyToCommand, MOXMAN_Commands_CreateDirectoryCommand, MOXMAN_Commands_CreateDocumentCommand, MOXMAN_Commands_DeleteCommand, MOXMAN_Commands_FileInfoCommand, MOXMAN_Commands_GetAppKeysCommand, MOXMAN_Commands_GetConfigCommand, MOXMAN_Commands_GetFileContentsCommand, MOXMAN_Commands_ImportFromUrlCommand, MOXMAN_Commands_InstallCommand, MOXMAN_Commands_ListFilesCommand, MOXMAN_Commands_ListRootsCommand, MOXMAN_Commands_LoginCommand, MOXMAN_Commands_LogoutCommand, MOXMAN_Commands_LoopbackCommand, MOXMAN_Commands_MoveToCommand, MOXMAN_Commands_PutFileContentsCommand, MOXMAN_Commands_UnZipCommand, MOXMAN_Commands_ZipCommand

Class to be extended by other core plugin classes. Provides basic functionality shared by all commands.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
execute() Gets executed when a RPC call is made. MOXMAN_ICommand

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
fileToJson() Converts a file instance to a JSON serializable object. MOXMAN_Commands_BaseCommand
fireBeforeFileAction() Fires a before file action event with the specified file object. MOXMAN_Commands_BaseCommand
fireBeforeTargetFileAction() Fires a before file action event with the specified from/to file objects. MOXMAN_Commands_BaseCommand
fireCustomInfo() Fires a file custom info for the specified file. MOXMAN_Commands_BaseCommand
fireFileAction() Fires a file action event with the specified file object. MOXMAN_Commands_BaseCommand
fireFilesAction() Fires a file action event with the specified file object and files array. MOXMAN_Commands_BaseCommand
fireTargetFileAction() Fires a file action event with the specified from/to file objects. MOXMAN_Commands_BaseCommand
getPublicConfig() Returns public config options to the client. MOXMAN_Commands_BaseCommand

Method Details

fileToJson() protected method

Converts a file instance to a JSON serializable object.

protected stdClass fileToJson ( $file, $meta false )
$file MOXMAN_Vfs_IFile

File to convert into JSON format.

$meta Boolean

State if the meta data should be returned or not.

return stdClass

JSON serializable object.

fireBeforeFileAction() protected method

Fires a before file action event with the specified file object.

protected MOXMAN_Vfs_FileActionEventArgs fireBeforeFileAction ( $action, $file, $size 0 )
$action string

Action name for the file event for example DELETE.

$file MOXMAN_Vfs_IFile

File instance to use.

$size \Number

Size of the file being added.

return MOXMAN_Vfs_FileActionEventArgs

Returns event argument instance.

fireBeforeTargetFileAction() protected method

Fires a before file action event with the specified from/to file objects.

protected MOXMAN_Vfs_FileActionEventArgs fireBeforeTargetFileAction ( $action, $fromFile, $toFile )
$action string

Action name for the file event for example COPY.

$fromFile MOXMAN_Vfs_IFile

From file to use.

$toFile MOXMAN_Vfs_IFile

To file to use.

return MOXMAN_Vfs_FileActionEventArgs

Returns event argument instance.

fireCustomInfo() protected method

Fires a file custom info for the specified file.

protected MOXMAN_Vfs_CustomInfoEventArgs fireCustomInfo ( $type, $file )
$type string

Type of info event.

$file MOXMAN_Vfs_IFile

File instance to use.

return MOXMAN_Vfs_CustomInfoEventArgs

Returns event argument instance.

fireFileAction() protected method

Fires a file action event with the specified file object.

protected MOXMAN_Vfs_FileActionEventArgs fireFileAction ( $action, $file )
$action string

Action name for the file event for example DELETE.

$file MOXMAN_Vfs_IFile

File instance to use.

return MOXMAN_Vfs_FileActionEventArgs

Returns event argument instance.

fireFilesAction() protected method

Fires a file action event with the specified file object and files array.

protected MOXMAN_Vfs_FileActionEventArgs fireFilesAction ( $action, $file, $files )
$action string

Action for files event for example LIST_FILES.

$file MOXMAN_Vfs_IFile

File instance to use.

$files array

Array with files to include in event.

return MOXMAN_Vfs_FileActionEventArgs

Returns event argument instance.

fireTargetFileAction() protected method

Fires a file action event with the specified from/to file objects.

protected MOXMAN_Vfs_FileActionEventArgs fireTargetFileAction ( $action, $fromFile, $toFile )
$action string

Action name for the file event for example COPY.

$fromFile MOXMAN_Vfs_IFile

From file to use.

$toFile MOXMAN_Vfs_IFile

To file to use.

return MOXMAN_Vfs_FileActionEventArgs

Returns event argument instance.

getPublicConfig() protected method

Returns public config options to the client.

protected stdClass getPublicConfig ( $file null )
$file MOXMAN_Vfs_IFile

File to get public config options for.

return stdClass

JSON serializable object of config options.