File
class File extends Controller (View source)
Traits
Trait ApplicationAwareTrait A trait used with ApplicationAwareInterface
Properties
protected Application | $app | from ApplicationAwareTrait | |
protected string[] | $helpers | The handles of the helpers to be returned by the getHelperObjects method. |
from AbstractController |
protected array | $sets | The values to be sent to views. |
from AbstractController |
protected string|null | $action | The action to be performed. |
from AbstractController |
protected Request|null | $request | The current request instance. |
from AbstractController |
protected array|null | $parameters | The action parameters. |
from AbstractController |
protected | $view | from Controller | |
protected string | $viewPath | The path to the view file (update it with the setViewPath method). |
from Controller |
protected | $theme | from Controller | |
protected | $controllerActionPath | from Controller | |
protected | $themeViewTemplate | from Controller | |
private File|null|false | $fileToBeReplaced | The file to be replaced (if any). |
|
private FileFolder|false | $destinationFolder | The destination folder where the uploaded files should be placed. |
|
private Page|null|false | $importOriginalPage | The original page to be used when importing files (if any). |
Methods
Adds an item to the view's header. This item will then be automatically printed out before the
section of the page.Adds an item to the view's footer. This item will then be automatically printed out before the section of the page.
Should the action be executed? Override this method to answer something different than true.
Get the the helpers that will be be automatically sent to Views as variables.
Get the whole $_GET array or a specific querystring value.
Override this method to do something right before the view is rendered.
Get the whole $_POST array or a specific posted value.
Redirect the clients to a specific URL/page (specify path(s) as argument(s) of this function).
Build a response that redirects clients to a specific URL/page (specify path(s) as argument(s) of $args).
Perform an action of this controller (if shouldRunControllerTask returns true).
Get the whole $_REQUEST array or a specific requested value.
Returns the wrapper file that holds the content of the view. Usually view.php.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Get the file instance to be replaced by the uploaded file (if any).
Get the destination folder where the uploaded files should be placed.
Get the original page to be used when importing files (if any).
Check that a list of strings are valid "incoming" file names.
Check that a list of strings are valid "incoming" file names.
Download an URL to the temporary directory.
No description
No description
No description
No description
No description
No description
No description
No description
Details
setApplication(Application $app)
Setter method for the application
__construct()
Initialize the instance.
Request
getRequest()
Get the current request instance.
setRequest(Request $request)
Set the current request instance.
requireAsset()
Add an asset required in views.
This function accept the same parameters as the requireAsset method of the ResponseAssetGroup.
addHeaderItem(string $item)
Adds an item to the view's header. This item will then be automatically printed out before the
section of the page.
addFooterItem(string $item)
Adds an item to the view's footer. This item will then be automatically printed out before the section of the page.
set(string $key, mixed $val)
Set a value to be sent to the view.
array
getSets()
Get the values to be sent to views.
bool
shouldRunControllerTask()
Should the action be executed? Override this method to answer something different than true.
array
getHelperObjects()
Get the the helpers that will be be automatically sent to Views as variables.
Array keys are the variable names, array values are the helper instances.
mixed
get(string|null $key = null, mixed $defaultValue = null)
Get the whole $_GET array or a specific querystring value.
getTask()
deprecated
deprecated
No description
string|null
getAction()
Get the action to be performed.
array|null
getParameters()
Get the action parameters.
on_start()
Override this method to perform controller initializations.
on_before_render()
Override this method to do something right before the view is rendered.
For instance, you can call $this->set('variableName', $variableValue) to send the view additional sets.
isPost()
deprecated
deprecated
No description
mixed
post(string|null $key = null, mixed $defaultValue = null)
Get the whole $_POST array or a specific posted value.
redirect()
deprecated
deprecated
Redirect the clients to a specific URL/page (specify path(s) as argument(s) of this function).
RedirectResponse
buildRedirect(array|string|UrlInterface $destination, int $httpResponseCode = Response::HTTP_FOUND)
Build a response that redirects clients to a specific URL/page (specify path(s) as argument(s) of $args).
runTask(mixed $action, mixed $parameters)
deprecated
deprecated
No description
mixed
runAction(string $action, array $parameters = [])
Perform an action of this controller (if shouldRunControllerTask returns true).
mixed
request(string|null $key = null)
Get the whole $_REQUEST array or a specific requested value.
executeCommand(mixed $command)
Dispatches a command to the command bus.
dispatchBatch(Batch $batch)
No description
setViewObject(View $view)
No description
setTheme($mixed)
No description
getTheme()
No description
setThemeViewTemplate($template)
No description
string
getThemeViewTemplate()
Returns the wrapper file that holds the content of the view. Usually view.php.
getControllerActionPath()
No description
string
getViewPath()
Get the path to the view file.
flash($key, $value, $isHTML = false)
No description
getViewObject()
No description
action()
No description
protected Controller
setViewPath(string $viewPath)
Set the path to the view file.
star()
No description
rescan()
No description
rescanMultiple()
No description
approveVersion()
No description
deleteVersion()
No description
upload()
No description
getFavoriteFolders()
No description
addFavoriteFolder($folderId)
No description
removeFavoriteFolder($folderId)
No description
JsonResponse
importIncoming()
No description
JsonResponse
importRemote()
No description
duplicate()
No description
getJSON()
No description
download()
No description
protected
doRescan(File $f)
No description
protected
getRequestFiles($permissionKey = 'view_file_in_file_manager', $checkUUID = false)
No description
protected Version|null
handleUpload(string $property, int|null $index = null)
No description
protected File|null
getFileToBeReplaced()
Get the file instance to be replaced by the uploaded file (if any).
protected FileFolder
getDestinationFolder()
Get the destination folder where the uploaded files should be placed.
protected Page|null
getImportOriginalPage()
Get the original page to be used when importing files (if any).
protected
checkExistingIncomingFiles(array $incomingFiles, Incoming $incoming)
Check that a list of strings are valid "incoming" file names.
protected array<string,string>
checkRemoteURlsToImport(array $urls)
Check that a list of strings are valid "incoming" file names.
protected string
downloadRemoteURL(string $url, string $temporaryDirectory, string $ip = null)
Download an URL to the temporary directory.
protected
buildImportResponse(array $importedFileVersions, ErrorList $errors, bool $isReplacingFile)
No description
private UploadedFile|null
getFileToImport(UploadedFile $file, bool $deleteFile)
No description
private bool
isFullChunkFilePresent(string $fileUuid, string $tempPath, int $totalChunks)
No description
private UploadedFile
combineFileChunks(string $fileUuid, string $tempPath, int $totalChunks, UploadedFile $originalFile)
No description
fetchDirectories()
No description
uploadComplete()
No description
createDirectory()
No description
fetchIncomingFiles()
No description