LimeSurvey API - Master branch

FileFetcherUploadZip extends FileFetcher
in package

Extension file fetcher for upload ZIP file.

Must work for all extension types: plugins, theme, question theme, etc.

Tags
since
2018-09-25
author

LimeSurvey GmbH

Table of Contents

Properties

$filterName  : string
Filter to apply to unzipping.

Methods

abort()  : void
Abort unzip, clear files and session.
fetch()  : void
Fetch files, meaning grab uploaded ZIP file and unzip it in system tmp folder.
getConfig()  : ExtensionConfig
Get config from unzipped zip file, but in temp dir. fetch() must be called before this.
getConfigFromDir()  : ExtensionConfig|null
Look for config.xml in $tempdir Recursively searches the folders if config.xml is not in root folder.
move()  : bool
Move files from tempdir to final destdir.
recurseCopy()  : bool
Recursively copy source folder $src to destination $dest.
setSource()  : void
Set source for this file fetcher.
setUnzipFilter()  : void
checkFileSizeError()  : void
checkZipBomb()  : void
Check if uploaded zip file is a zip bomb.
clearTmpdir()  : void
Set user session tempdir to null.
extractZipFile()  : void
getTempdir()  : string
Get tmp tempdir for extension to unzip in.

Properties

Methods

fetch()

Fetch files, meaning grab uploaded ZIP file and unzip it in system tmp folder.

public fetch() : void

getConfigFromDir()

Look for config.xml in $tempdir Recursively searches the folders if config.xml is not in root folder.

public getConfigFromDir(string $tempdir) : ExtensionConfig|null
Parameters
$tempdir : string
Return values
ExtensionConfig|null

move()

Move files from tempdir to final destdir.

public move(string $destdir) : bool
Parameters
$destdir : string
Return values
bool

setSource()

Set source for this file fetcher.

public setSource(string $source) : void
Parameters
$source : string

setUnzipFilter()

public setUnzipFilter(string $filterName) : void
Parameters
$filterName : string

checkFileSizeError()

protected checkFileSizeError() : void
Tags
todo

Duplicate from themes.php.

throws
Exception

checkZipBomb()

Check if uploaded zip file is a zip bomb.

protected checkZipBomb() : void

extractZipFile()

protected extractZipFile(string $tempdir) : void
Parameters
$tempdir : string

getTempdir()

Get tmp tempdir for extension to unzip in.

protected getTempdir() : string
Return values
string

        
On this page

Search results