Class ThemeWriter
publish theme and create cache and compile template 5.55 s
publish theme and compile template 3.62 s
compile template 2.63, 2.78, 2.69,
normal 0.676s
Methods
ThemeWriter constructor.
__construct(\FilesystemAdapter $filesystem, \ExistingDirectory $shopSource)
_appendFileContent
_appendFileContent( $destinationFile, $sourceFile)
|
|
Throws |
- \FileNotFoundException
|
Arguments
_applyActiveThemeVariants
_applyActiveThemeVariants(\IdentifiedThemeInterface $theme, \ThemeDirectoryRootInterface $destination, \Gambio\StyleEdit\Core\Repositories\Entities\ConfigurationCollection $variants) : boolean|\CustomThemeCopyResponse
Throws |
- \FileNotFoundException
|
Arguments
$variants
\Gambio\StyleEdit\Core\Repositories\Entities\ConfigurationCollection
Response
boolean|\CustomThemeCopyResponse
_copyCustomHtmlDirectory
_copyCustomHtmlDirectory(\IdentifiedThemeInterface $theme, $directory, \ThemeDirectoryRootInterface $destination) : boolean|\CustomThemeCopyResponse|mixed
_copyCustomJsDirectory
_copyCustomJsDirectory(\ThemeId $themeId, $directory, \ThemeDirectoryRootInterface $destination)
|
|
Throws |
- \FileNotFoundException
|
Arguments
_copyCustomStylesDirectory
_copyCustomStylesDirectory(\ThemeId $themeId, $directory, \ThemeDirectoryRootInterface $destination)
|
|
Throws |
- \FileNotFoundException
|
Arguments
_copyMainThemeDirectory
_copyMainThemeDirectory(\ThemeId $themeId, \ThemeDirectoryInterface $directory, \ThemeDirectoryRootInterface $destination)
_copyMainThemeStyleEditDirectory
_copyMainThemeStyleEditDirectory(\ThemeId $themeId, \ThemeDirectoryInterface $directory, \ThemeDirectoryRootInterface $destination)
_copySettingsJson
_copySettingsJson(\VariableThemeDirectoriesInterface $theme, \ThemeDirectoryRootInterface $destination)
_copyStyleEditThemeDirectory
_copyStyleEditThemeDirectory(\ThemeId $themeId, $directory, \ThemeDirectoryRootInterface $destination)
|
|
Throws |
- \FileNotFoundException
|
Arguments
_copyThemeDirectory
_copyThemeDirectory(\ThemeId $themeId, $directory, \ThemeDirectoryRootInterface $destination)
|
|
Throws |
- \FileNotFoundException
|
Arguments
_copyThemeFontsDirectory
_copyThemeFontsDirectory(\ThemeId $themeId, $fontsDirectory, \ThemeDirectoryRootInterface $destination)
|
|
Throws |
- \FileNotFoundException
|
Arguments
_copyThemeImagesDirectory
_copyThemeImagesDirectory(\ThemeId $themeId, $imagesDirectory, \ThemeDirectoryRootInterface $destination)
|
|
Throws |
- \FileNotFoundException
|
Arguments
_copyThemeJson
_copyThemeJson(\VariableThemeDirectoriesInterface $theme, \ThemeDirectoryRootInterface $destination)
_endsWith
_endsWith( $haystack, $needle) : boolean
Arguments
Response
boolean
_extendHtmlFile
_extendHtmlFile( $sourceFile, $destinationFile, $suffix) : mixed
Throws |
- \FileNotFoundException
|
Arguments
Response
mixed
_getRelative
_getRelative(\ThemeDirectoryRootInterface $directory) : mixed
_loadActiveVariants
_loadActiveVariants(\ThemeDirectoryRootInterface $destination) : \Gambio\StyleEdit\Core\Repositories\Entities\ConfigurationCollection
Arguments
Response
\Gambio\StyleEdit\Core\Repositories\Entities\ConfigurationCollection
_overloadVariantDirectory
_overloadVariantDirectory(\VariantDirectories $variant, \ThemeDirectoryRootInterface $destination) : boolean|\CustomThemeCopyResponse|mixed
_saveMainTheme
_saveMainTheme(\MainThemeInterface $mainTheme, \ThemeDirectoryRootInterface $destination)
_saveTheme
_saveTheme(\ThemeInterface $theme, \ThemeDirectoryRootInterface $destination) : boolean|\CustomThemeCopyResponse|mixed
_saveThemeStructure
_saveThemeStructure(\MainThemeInterface $mainTheme, \ThemeDirectoryRootInterface $destination, \ThemeInterface $childThemes)
|
|
Throws |
- \FileNotFoundException
|
Arguments
_stringAfter
_stringAfter( $searchFor, $subject) : boolean|string
Arguments
Response
boolean|string
_stringReplaceFirst
_stringReplaceFirst( $search, $replace, $subject) : string
Arguments
Response
string
applyHtmlOverloads
applyHtmlOverloads(\CustomThemeCopyResponse $overloaders, \ThemeDirectoryRootInterface $destination) : boolean|\CustomThemeCopyResponse
Creates a duplicate of a file with .min if only the source file exists
or a file without .min if only the .min file exists
duplicateFilesThatHaveNoMatchingMinOrSourceFile(array<mixed,string> $files)
Arguments
$files
array<mixed,string>
Checks the $themeDirectoryRoot (/public/theme)
for files that have no matching source or .min file
findFilesThatHaveNoMatchingMinOrSourceFile(\ThemeDirectoryRootInterface $themeDirectoryRoot)
findScriptsAndSheetsInDirectory
findScriptsAndSheetsInDirectory(\StringType $directory) : array<mixed,string>
Arguments
Response
array<mixed,string>
getRelativeFromFile
getRelativeFromFile(\ExistingFile $file) : string
Arguments
Response
string
Modifies the path if a file would be placed inside the root of the
custom directory. The file will be moved inside the global directory of
system directory
moveJsFromCustomRootDirectoryToCustomGlobalDirectory(string $path, string $source) : string
This method is only called for child themes
Arguments
Response
string
mixed
replaceCustomInPath
replaceCustomInPath(string $path) : string
Arguments
Response
string
Saves the given them to the destination.
save(\ThemeInterface $theme, \ThemeDirectoryRootInterface $destination) : void
Constants
FILE_IS_SCRIPT_OR_SHEET_PATTERN
FILE_IS_SCRIPT_OR_SHEET_PATTERN
UNMINIFIED_FILE_NAME_PATTERN
UNMINIFIED_FILE_NAME_PATTERN
Properties
sourceThemeId
sourceThemeId :