FileFetcherUploadZip

Extends\LimeSurvey\ExtensionInstaller\FileFetcher

Extension file fetcher for upload ZIP file.

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

since 2018-09-25
author

LimeSurvey GmbH

package

Default

Methods

Abort procedure, remove temporary files.

abort(): void
inheritedabstract

checkFileSizeError

checkFileSizeError(): void
todo

Duplicate from themes.php.

Throws
\Exception

Check if uploaded zip file is a zip bomb.

checkZipBomb(): void

Set user session tempdir to null.

clearTmpdir(): void

extractZipFile

extractZipFile(string $tempdir): void

Arguments

$tempdir

string

Move files from source to tmp/ folder.

fetch(): void
inheritedabstract

getConfig

getConfig(): \ExtensionConfig
inheritedabstract
Throws
\Exception

if config cannot be parsed.

Response

\ExtensionConfig

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

getConfigFromDir(string $tempdir): \ExtensionConfig|null

Arguments

$tempdir

string

Response

\ExtensionConfig|null

Get tmp tempdir for extension to unzip in.

getTempdir(): string

Response

string

Move files from tmp/ folder to final destination.

move(string $destdir): boolean
inheritedabstract

Arguments

$destdir

string

Response

boolean

Recursively copy source folder $src to destination $dest.

recurseCopy(string $src,string $dest): boolean
see https://stackoverflow.com/questions/2050859/copy-entire-contents-of-a-directory-to-another-using-php
todo

Inject FileIO wrapper and add unit-test

Arguments

$src

string

$dest

string

Response

boolean

Set source for this file fetcher.

setSource(string $source): void
inheritedabstract

Can be ZIP file name, git repo URL, folder name, etc.

Arguments

$source

string

setUnzipFilter

setUnzipFilter(string $filterName): void

Arguments

$filterName

string

Properties

Filter to apply to unzipping.

filterName :string
var

Type(s)

string