PHP Class FluidTYPO3\Vhs\Service\AssetService

Inject this Service in your class to access VHS Asset features - include assets etc.
Inheritance: implements TYPO3\CMS\Core\SingletonInterface
Afficher le fichier Open project: fluidtypo3/vhs

Protected Properties

Свойство Type Description
$cacheCleared boolean
$cachedDependencies array
$configurationManager TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
$objectManager TYPO3\CMS\Extbase\Object\ObjectManagerInterface
$settingsCache array
$typoScriptAssetsBuilt boolean

Méthodes publiques

Méthode Description
buildAll ( array $parameters, object $caller, boolean $cached = true ) : void
buildAllUncached ( array $parameters, object $caller ) : void
clearCacheCommand ( array $parameters ) : void
getSettings ( ) : array Returns the settings used by this particular Asset during inclusion. Public access allows later inspection of the TypoScript values which were applied to the Asset.
injectConfigurationManager ( TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager ) : void
injectObjectManager ( TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager ) : void
usePageCache ( object $caller, boolean $shouldUsePageCache ) : boolean

Méthodes protégées

Méthode Description
assertAssetAllowedInFooter ( mixed $asset ) : boolean
buildAsset ( mixed $asset ) : string
buildAssetsChunk ( array $assets ) : string
copyReferencedFilesAndReplacePaths ( string $contents, string $regex, string $originalDirectory, string $wrap = '|' ) : string Finds and replaces all URLs by using a given regex
detectAndCopyFileReferences ( string $contents, string $originalDirectory ) : string Fixes the relative paths inside of url() references in CSS files
extractAssetContent ( mixed $asset ) : string
extractAssetSettings ( mixed $asset ) : array
generateTagForAssetType ( string $type, string $content, string $file = null, string $integrity = null ) : string
getFileIntegrity ( $file ) : string
insertAssetsAtMarker ( string $markerName, mixed $assets ) : void
manipulateAssetsByTypoScriptSettings ( array $assets ) : array
mergeArrays ( $array1, $array2 ) : array
placeAssetsInHeaderAndFooter ( FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[] $assets, boolean $cached ) : void
prefixPath ( string $fileRelativePathAndFilename ) : string Prefix a path according to "absRefPrefix" TS configuration.
renderAssetAsFluidTemplate ( mixed $asset ) : string
sortAssetsByDependency ( FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[] $assets ) : FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[]
writeCachedMergedFileAndReturnTag ( FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[] $assets, string $type ) : string
writeFile ( string $file, string $contents )

Method Details

assertAssetAllowedInFooter() protected méthode

protected assertAssetAllowedInFooter ( mixed $asset ) : boolean
$asset mixed An Asset ViewHelper instance or an array containing an Asset definition
Résultat boolean

buildAll() public méthode

public buildAll ( array $parameters, object $caller, boolean $cached = true ) : void
$parameters array
$caller object
$cached boolean If TRUE, treats this inclusion as happening in a cached context
Résultat void

buildAllUncached() public méthode

public buildAllUncached ( array $parameters, object $caller ) : void
$parameters array
$caller object
Résultat void

buildAsset() protected méthode

protected buildAsset ( mixed $asset ) : string
$asset mixed An Asset ViewHelper instance or an array containing an Asset definition
Résultat string

buildAssetsChunk() protected méthode

protected buildAssetsChunk ( array $assets ) : string
$assets array
Résultat string

clearCacheCommand() public méthode

public clearCacheCommand ( array $parameters ) : void
$parameters array
Résultat void

copyReferencedFilesAndReplacePaths() protected méthode

Finds and replaces all URLs by using a given regex
protected copyReferencedFilesAndReplacePaths ( string $contents, string $regex, string $originalDirectory, string $wrap = '|' ) : string
$contents string Data to process
$regex string Regex used to find URLs in content
$originalDirectory string Original location to CSS file, if file based.
$wrap string Wrap around replaced values
Résultat string Processed data

detectAndCopyFileReferences() protected méthode

Fixes the relative paths inside of url() references in CSS files
protected detectAndCopyFileReferences ( string $contents, string $originalDirectory ) : string
$contents string Data to process
$originalDirectory string Original location of file
Résultat string Processed data

extractAssetContent() protected méthode

protected extractAssetContent ( mixed $asset ) : string
$asset mixed
Résultat string

extractAssetSettings() protected méthode

protected extractAssetSettings ( mixed $asset ) : array
$asset mixed An Asset ViewHelper instance or an array containing an Asset definition
Résultat array

generateTagForAssetType() protected méthode

protected generateTagForAssetType ( string $type, string $content, string $file = null, string $integrity = null ) : string
$type string
$content string
$file string
$integrity string
Résultat string

getFileIntegrity() protected méthode

protected getFileIntegrity ( $file ) : string
$file
Résultat string

getSettings() public méthode

Returns the settings used by this particular Asset during inclusion. Public access allows later inspection of the TypoScript values which were applied to the Asset.
public getSettings ( ) : array
Résultat array

injectConfigurationManager() public méthode

public injectConfigurationManager ( TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager ) : void
$configurationManager TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Résultat void

injectObjectManager() public méthode

public injectObjectManager ( TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager ) : void
$objectManager TYPO3\CMS\Extbase\Object\ObjectManagerInterface
Résultat void

insertAssetsAtMarker() protected méthode

protected insertAssetsAtMarker ( string $markerName, mixed $assets ) : void
$markerName string
$assets mixed
Résultat void

manipulateAssetsByTypoScriptSettings() protected méthode

protected manipulateAssetsByTypoScriptSettings ( array $assets ) : array
$assets array
Résultat array

mergeArrays() protected méthode

protected mergeArrays ( $array1, $array2 ) : array
$array1
$array2
Résultat array

placeAssetsInHeaderAndFooter() protected méthode

protected placeAssetsInHeaderAndFooter ( FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[] $assets, boolean $cached ) : void
$assets FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[]
$cached boolean
Résultat void

prefixPath() protected méthode

Prefix a path according to "absRefPrefix" TS configuration.
protected prefixPath ( string $fileRelativePathAndFilename ) : string
$fileRelativePathAndFilename string
Résultat string

renderAssetAsFluidTemplate() protected méthode

protected renderAssetAsFluidTemplate ( mixed $asset ) : string
$asset mixed
Résultat string

sortAssetsByDependency() protected méthode

protected sortAssetsByDependency ( FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[] $assets ) : FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[]
$assets FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[]
Résultat FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[]

usePageCache() public méthode

public usePageCache ( object $caller, boolean $shouldUsePageCache ) : boolean
$caller object
$shouldUsePageCache boolean
Résultat boolean

writeCachedMergedFileAndReturnTag() protected méthode

protected writeCachedMergedFileAndReturnTag ( FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[] $assets, string $type ) : string
$assets FluidTYPO3\Vhs\ViewHelpers\Asset\AssetInterface[]
$type string
Résultat string

writeFile() protected méthode

protected writeFile ( string $file, string $contents )
$file string
$contents string

Property Details

$cacheCleared protected_oe static_oe property

protected static bool $cacheCleared
Résultat boolean

$cachedDependencies protected_oe static_oe property

protected static array $cachedDependencies
Résultat array

$configurationManager protected_oe property

protected ConfigurationManagerInterface,TYPO3\CMS\Extbase\Configuration $configurationManager
Résultat TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface

$objectManager protected_oe property

protected ObjectManagerInterface,TYPO3\CMS\Extbase\Object $objectManager
Résultat TYPO3\CMS\Extbase\Object\ObjectManagerInterface

$settingsCache protected_oe static_oe property

protected static array $settingsCache
Résultat array

$typoScriptAssetsBuilt protected_oe static_oe property

protected static bool $typoScriptAssetsBuilt
Résultat boolean