PHP Класс MiniAsset\Output\AssetWriter

Наследование: use trait FreshTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_invalidated array An array of invalidated output files.
$path
$theme
$timestamp

Открытые методы

Метод Описание
__construct ( array $timestamp, string $timestampPath, string $theme = null ) Constructor.
buildCacheName ( string $build ) : string Get the cache name a build.
buildFileName ( AssetTarget $target, $timestamp = true ) : string Get the final filename for a build. Resolves theme prefixes and timestamps.
clearTimestamps ( ) : void Clear timestamps for assets.
config ( ) : array Get the config options this object is using.
finalize ( AssetTarget $build ) : void Finalize a build after written to filesystem.
getTimestamp ( AssetTarget $build ) : mixed Get the last build timestamp for a given build.
invalidate ( AssetTarget $build ) : void Invalidate a build before re-generating the file.
outputDir ( AssetTarget $target ) : string Get the output dir
setTimestamp ( AssetTarget $build, integer $time ) : void Set the timestamp for a build file.
write ( AssetTarget $build, string $content ) Writes content into a file

Защищенные методы

Метод Описание
_readTimestamp ( ) : array Read timestamps from either the fast cache, or the serialized file.
_timestampFile ( string $file, integer $time ) : string Modify a file name and append in the timestamp
_writeTimestamp ( array $data ) : void Write timestamps to either the fast cache, or the serialized file.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $timestamp, string $timestampPath, string $theme = null )
$timestamp array The map of extensions and timestamps
$timestampPath string The path to the timestamp file for assets.
$theme string The the theme being assets are being built for.

_readTimestamp() защищенный Метод

Read timestamps from either the fast cache, or the serialized file.
protected _readTimestamp ( ) : array
Результат array An array of timestamps for build files.

_timestampFile() защищенный Метод

Modify a file name and append in the timestamp
protected _timestampFile ( string $file, integer $time ) : string
$file string The filename.
$time integer The timestamp.
Результат string The build filename to cache on disk.

_writeTimestamp() защищенный Метод

Write timestamps to either the fast cache, or the serialized file.
protected _writeTimestamp ( array $data ) : void
$data array An array of timestamps for build files.
Результат void

buildCacheName() публичный Метод

Get the cache name a build.
public buildCacheName ( string $build ) : string
$build string The build target name.
Результат string The build cache name.

buildFileName() публичный Метод

Get the final filename for a build. Resolves theme prefixes and timestamps.
public buildFileName ( AssetTarget $target, $timestamp = true ) : string
$target MiniAsset\AssetTarget The build target name.
Результат string The build filename to cache on disk.

clearTimestamps() публичный Метод

Clear timestamps for assets.
public clearTimestamps ( ) : void
Результат void

config() публичный Метод

Get the config options this object is using.
public config ( ) : array
Результат array

finalize() публичный Метод

Finalize a build after written to filesystem.
public finalize ( AssetTarget $build ) : void
$build MiniAsset\AssetTarget The build to finalize.
Результат void

getTimestamp() публичный Метод

Will either read the cached version, or the on disk version. If no timestamp is found for a file, a new time will be generated and saved. If timestamps are disabled, false will be returned.
public getTimestamp ( AssetTarget $build ) : mixed
$build MiniAsset\AssetTarget The build to get a timestamp for.
Результат mixed The last build time, or false.

invalidate() публичный Метод

Invalidate a build before re-generating the file.
public invalidate ( AssetTarget $build ) : void
$build MiniAsset\AssetTarget The build to invalidate.
Результат void

outputDir() публичный Метод

Used to locate outputs when determining freshness.
public outputDir ( AssetTarget $target ) : string
$target MiniAsset\AssetTarget
Результат string The path

setTimestamp() публичный Метод

Set the timestamp for a build file.
public setTimestamp ( AssetTarget $build, integer $time ) : void
$build MiniAsset\AssetTarget The name of the build to set a timestamp for.
$time integer The timestamp.
Результат void

write() публичный Метод

Writes content into a file
public write ( AssetTarget $build, string $content )
$build MiniAsset\AssetTarget The filename to write.
$content string The contents to write.

Описание свойств

$_invalidated защищенное свойство

An array of invalidated output files.
protected array $_invalidated
Результат array

$path защищенное свойство

protected $path

$theme защищенное свойство

protected $theme

$timestamp защищенное свойство

protected $timestamp