\Phug\Renderer\PartialRegistryTrait

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
getRegistryPathChunks()
getFirstRegistryIndex()
findCachePathInRegistry()
findCachePathInRegistryFile()
No protected properties found
N/A
tryExtensionsOnFileKey()
tryExtensions()
findInRegistry()
No private properties found
N/A

Methods

getRegistryPathChunks()

getRegistryPathChunks(string  $source, integer|null  $directoryIndex = null) : \Phug\Renderer\Partial\iterable

Yield list of path chunks for registry for a given path.

Parameters

string $source
integer|null $directoryIndex

Returns

\Phug\Renderer\Partial\iterable

getFirstRegistryIndex()

getFirstRegistryIndex(array|null  $registry) : string|false

Return the first value indexed with "i:" prefix as raw cash path.

Parameters

array|null $registry

registry result

Returns

string|false

findCachePathInRegistry()

findCachePathInRegistry(string  $path, array  $registry, array<mixed,string>  $extensions = array()) : string|false

Find the path of a cached file for a given path in a given registry.

Parameters

string $path

path to find in the registry

array $registry

registry data array

array<mixed,string> $extensions

extensions to try to add to the file path if not found

Returns

string|false

findCachePathInRegistryFile()

findCachePathInRegistryFile(string  $path, string  $registryFile, array<mixed,string>  $extensions = array()) : string|false

Find the path of a cached file for a given path in a given registry file (that may not exist).

Parameters

string $path

path to find in the registry

string $registryFile

registry file path

array<mixed,string> $extensions

extensions to try to add to the file path if not found

Returns

string|false

tryExtensionsOnFileKey()

tryExtensionsOnFileKey(array  $registry, string  $key, array<mixed,string>  $extensions) : boolean|mixed

Try to append extension to find a key in a given array if it's file registry key.

Parameters

array $registry
string $key
array<mixed,string> $extensions

Returns

boolean|mixed

tryExtensions()

tryExtensions(array  $registry, string  $key, array<mixed,string>  $extensions) : boolean|mixed

Try to append extension to find a key in a given array assuming it's file registry key.

Parameters

array $registry
string $key
array<mixed,string> $extensions

Returns

boolean|mixed

findInRegistry()

findInRegistry(string  $path, array  $registry, array<mixed,string>  $extensions) : string|array|false

Find raw entry of a cached file for a given path in a given registry.

Parameters

string $path

path to find in the registry

array $registry

registry data array

array<mixed,string> $extensions

extensions to try to add to the file path if not found

Returns

string|array|false