PHP Класс MiniAsset\Output\AssetCacher

Similar to AssetWriter except this class takes a more simplistic approach to writing cache files. It also provides ways to read existing cache files.
Наследование: use trait FreshTrait
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$path string The output path
$theme string The theme currently being built.

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

Метод Описание
__construct ( $path, $theme = null )
buildFileName ( AssetTarget $target ) : string Get the final build file name for a target.
ensureDir ( ) : void Create the output directory if it doesn't already exist.
outputDir ( AssetTarget $target ) : string Get the output dir
read ( AssetTarget $target ) : string Get the cached result for a build target.
write ( AssetTarget $target, $contents )

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

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

public __construct ( $path, $theme = null )

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

Get the final build file name for a target.
public buildFileName ( AssetTarget $target ) : string
$target MiniAsset\AssetTarget The target to get a name for.
Результат string

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

Create the output directory if it doesn't already exist.
public ensureDir ( ) : void
Результат void

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

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

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

Get the cached result for a build target.
public read ( AssetTarget $target ) : string
$target MiniAsset\AssetTarget The target to get content for.
Результат string

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

public write ( AssetTarget $target, $contents )
$target MiniAsset\AssetTarget

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

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

The output path
protected string $path
Результат string

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

The theme currently being built.
protected string $theme
Результат string