PHP Class Jarves\Controller\Admin\FileController

Inheritance: extends Symfony\Bundle\FrameworkBundle\Controller\Controller
Datei anzeigen Open project: jarves/jarves

Protected Properties

Property Type Description
$acl Jarves\ACL
$jarves Jarves\Jarves
$objects Jarves\Objects
$pageStack Jarves\PageStack
$utils Jarves\Utils
$webFilesystem Jarves\Filesystem\WebFilesystem

Public Methods

Method Description
createFileAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : boolean
createFolderAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : boolean
deleteFileAction ( string $path ) : boolean
doUploadAction ( Request $request, FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : string
getContentAction ( string $path ) : array | null | string
getFileAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array | null
moveFileAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array | boolean
pasteAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array | boolean
prepareUploadAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array[renamed
searchAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array
setContainer ( Symfony\Component\DependencyInjection\ContainerInterface $container = null )
setContentAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : boolean
showImageAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : Response
showPreviewAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : Response
viewFileAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher )

Protected Methods

Method Description
appendImageInformation ( array &$file ) Adds image information (dimensions/imageType).
checkAccess ( string $path, integer $mode = ACL::MODE_UPDATE )
checkOrThrow ( ACLRequest $aclRequest )
getFile ( string | integer $path ) : array | null Returns file information as array.
getFiles ( string $path ) : array | null Returns a list of files for a folder.
newFeed ( string | File $path, string $verb, string $message = '' )
prepareFiles ( FileInfo[] $files, boolean $showHiddenFiles = false ) : array Adds 'writeAccess' and imageInformation to $files.

Method Details

appendImageInformation() protected method

Adds image information (dimensions/imageType).
protected appendImageInformation ( array &$file )
$file array

checkAccess() protected method

protected checkAccess ( string $path, integer $mode = ACL::MODE_UPDATE )
$path string
$mode integer

checkOrThrow() protected method

protected checkOrThrow ( ACLRequest $aclRequest )
$aclRequest Jarves\ACLRequest

createFileAction() public method

public createFileAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : boolean
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return boolean

createFolderAction() public method

public createFolderAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : boolean
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return boolean

deleteFileAction() public method

public deleteFileAction ( string $path ) : boolean
$path string
return boolean

doUploadAction() public method

public doUploadAction ( Request $request, FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : string
$request Symfony\Component\HttpFoundation\Request
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return string

getContentAction() public method

public getContentAction ( string $path ) : array | null | string
$path string
return array | null | string array for directory, string for file content, null if not found.

getFile() protected method

Returns file information as array.
protected getFile ( string | integer $path ) : array | null
$path string | integer
return array | null

getFileAction() public method

public getFileAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array | null
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return array | null null if not found or not access

getFiles() protected method

Returns a list of files for a folder.
protected getFiles ( string $path ) : array | null
$path string
return array | null

moveFileAction() public method

public moveFileAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array | boolean
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return array | boolean returns [targetExists => true] when the target exists and $overwrite=false, otherwise true/false.

newFeed() protected method

protected newFeed ( string | File $path, string $verb, string $message = '' )
$path string | Jarves\Model\File
$verb string
$message string

pasteAction() public method

public pasteAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array | boolean
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return array | boolean returns [targetExists => true] when a target exists and $overwrite=false, otherwise true/false.

prepareFiles() protected method

Adds 'writeAccess' and imageInformation to $files.
protected prepareFiles ( FileInfo[] $files, boolean $showHiddenFiles = false ) : array
$files Jarves\File\FileInfo[]
$showHiddenFiles boolean
return array

prepareUploadAction() public method

public prepareUploadAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array[renamed
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return array[renamed

searchAction() public method

public searchAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return array

setContainer() public method

public setContainer ( Symfony\Component\DependencyInjection\ContainerInterface $container = null )
$container Symfony\Component\DependencyInjection\ContainerInterface

setContentAction() public method

public setContentAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : boolean
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return boolean

showImageAction() public method

public showImageAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : Response
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return Symfony\Component\HttpFoundation\Response

showPreviewAction() public method

public showPreviewAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : Response
$paramFetcher FOS\RestBundle\Request\ParamFetcher
return Symfony\Component\HttpFoundation\Response

viewFileAction() public method

public viewFileAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher )
$paramFetcher FOS\RestBundle\Request\ParamFetcher

Property Details

$acl protected_oe property

protected ACL,Jarves $acl
return Jarves\ACL

$jarves protected_oe property

protected Jarves,Jarves $jarves
return Jarves\Jarves

$objects protected_oe property

protected Objects,Jarves $objects
return Jarves\Objects

$pageStack protected_oe property

protected PageStack,Jarves $pageStack
return Jarves\PageStack

$utils protected_oe property

protected Utils,Jarves $utils
return Jarves\Utils

$webFilesystem protected_oe property

protected WebFilesystem,Jarves\Filesystem $webFilesystem
return Jarves\Filesystem\WebFilesystem