phpDocumentor

StyleEditThemeRepository extends ThemeBasicFileRepository

Class ThemeRepository

Table of Contents

ALLOWED_FILETYPE  = 'application/zip'
Allowed file type for uploading
$configuration  : StyleEditConfiguration
$configurationRepository  : ThemeConfigurationRepository
$contentWriteService  : ContentWriteService
$fileIO  : FileIO
$styleEditConfiguration  : StyleEditConfiguration|null
__construct()  : mixed
StyleEditThemeRepository constructor.
configurationRepository()  : ThemeConfigurationRepository
copyTo()  : ThemeConfiguration
delete()  : void
exists()  : bool
save()  : void
Validates and extracts uploaded themes
configuration()  : StyleEditConfiguration
fileIO()  : FileIO
getExistentSettingsFilename()  : string
installContentsFromThemeJson()  : void
loadConfigFromDisk()  : array<string|int, mixed>|mixed
loadJsonFilesFromDisk()  : array<string|int, mixed>|mixed
loadOriginalConfigFromDisk()  : array<string|int, mixed>|mixed
saveConfigToDisk()  : void
saveJsonFilesToDisk()  : bool|int
themeIsAlreadyInstalled()  : bool
validateExtractedContent()  : string
storeZipFromStringToTmpDirectory()  : string
Validates Zip string and stores a valid .zip file to the temporary directory

Constants

Properties

Methods

exists()

public exists( $themeId) : bool
Parameters
$themeId :
Tags
throws
Exception
Return values
bool

save()

Validates and extracts uploaded themes

public save(string $data) : void
Parameters
$data : string

must contain zip file

Tags
throws
TranslatedException
throws
Exception
Return values
void

getExistentSettingsFilename()

protected getExistentSettingsFilename(string $filename) : string
Parameters
$filename : string
Return values
string

loadJsonFilesFromDisk()

protected loadJsonFilesFromDisk( $filePath) : array<string|int, mixed>|mixed
Parameters
$filePath :
Tags
throws
Exception
throws
RuntimeException
Return values
array<string|int, mixed>|mixed

loadOriginalConfigFromDisk()

protected loadOriginalConfigFromDisk( $themeId) : array<string|int, mixed>|mixed
Parameters
$themeId :
Tags
throws
TranslatedException
Return values
array<string|int, mixed>|mixed

saveConfigToDisk()

protected saveConfigToDisk( $config,  $themePath) : void
Parameters
$config :
$themePath :
Tags
throws
Exception
Return values
void

saveJsonFilesToDisk()

protected saveJsonFilesToDisk( $object,  $filePath) : bool|int
Parameters
$object :
$filePath :
Tags
throws
Exception
Return values
bool|int

themeIsAlreadyInstalled()

protected themeIsAlreadyInstalled(string $path, stdClass $uploadedConfiguration) : bool
Parameters
$path : string

Path to a temporary directory that ends with the directory name of a about to be installed theme

$uploadedConfiguration : stdClass

ThemeConfiguration of temporary theme

Tags
throws
Exception
Return values
bool

should the theme be installed?

validateExtractedContent()

protected validateExtractedContent(array<string|int, string> $extractedDirectories, string $zipTmp) : string
Parameters
$extractedDirectories : array<string|int, string>
$zipTmp : string
Tags
throws
TranslatedException
throws
Exception
Return values
string

storeZipFromStringToTmpDirectory()

Validates Zip string and stores a valid .zip file to the temporary directory

private storeZipFromStringToTmpDirectory(string $zip) : string
Parameters
$zip : string

must contain zip file

Tags
throws
TranslatedException
throws
Exception
Return values
string

path to zip file in tmp directory

Search results