NaifyView\Compiler\CompiledArtifactCacheStore クラス
CompiledArtifactCacheStore — compiled mainline の Compiled Artifact Cache Store
template を generated PHP class へ落とす compile pipeline の一部。 大きな compiler へ責務を押し込まず、source 生成・依存計画・fast path などを小さく分ける。
使用例
// Engine が warm-hit できない template を compiled artifact へ変換する時に使う。
// 通常は View / Engine 経由で呼ばれ、アプリ側から直接操作しない。
プロパティ
| 名前 | 型 | 説明 |
|---|---|---|
private
static
$normalizedCacheDirCache
|
array |
process-local normalized cache dir memo |
private
static
$preparedCacheDirCache
|
array |
process-local prepared cache dir memo |
private
$cacheDir
|
?string |
cache root |
メソッド
| メソッド | 説明 |
|---|---|
public
__construct(?string $cacheDir): void
|
インスタンスを初期化する |
public
setCacheDir(?string $cacheDir): void
|
`setCacheDir()` の値を設定する |
public
getCacheDir(): ?string
|
`getCacheDir()` の値を返す |
public
prepareCacheDirectories(): string
|
`prepareCacheDirectories()` を実行する |
public
readMetaFile(string $metaFilePath, ?string $failureReason): ?array
|
`readMetaFile()` を実行する |
public
readPhpSource(string $classFilePath, ?string $failureReason): ?string
|
`readPhpSource()` を実行する |
public
loadPhpClass(string $path, string $className): void
|
Load a generated class while excluding publication of that same path. |
private
classReadFailed(string $path, string $className, ?string $reason): NaifyViewException
|
|
public
writeMetaFile(string $metaFilePath, array $meta): void
|
`writeMetaFile()` を実行する |
public
writePhpSource(string $classFilePath, string $compiledSource): void
|
`writePhpSource()` を実行する |
public
static
clearProcessCaches(): void
|
`clearProcessCaches()` をクリアする |
private
requireCacheDir(): string
|
`requireCacheDir()` を実行する |
private
writeCacheFile(string $path, string $contents): void
|
`writeCacheFile()` を実行する |
private
publishCacheFile(string $path, string $contents, ?string $failureReason): bool
|
`publishCacheFile()` を実行する |
private
readTextFileWithSharedLock(string $path, ?string $failureReason): ?string
|
`readTextFileWithSharedLock()` を実行する |
private
includeCacheFileWithSharedLock(string $path, ?string $failureReason): mixed
|
`includeCacheFileWithSharedLock()` を実行する |
private
buildTemporaryCachePath(string $path): string
|
`buildTemporaryCachePath()` を実行する |
private
writeTemporaryPayload(string $tempPath, string $contents): bool
|
`writeTemporaryPayload()` を実行する |
private
replaceCacheFile(string $sourcePath, string $targetPath): bool
|
`replaceCacheFile()` を実行する |
private
cacheFileMatchesPayload(string $path, string $contents): bool
|
`cacheFileMatchesPayload()` を実行する |
private
isValidMetaPayload(array $meta): bool
|
`isValidMetaPayload()` かを返す |
private
openCacheLockHandle(string $path, bool $forWrite): mixed
|
`openCacheLockHandle()` を実行する |
private
closeCacheLockHandle(mixed $handle): void
|
`closeCacheLockHandle()` を実行する |
private
getCacheLockPath(string $path): string
|
`getCacheLockPath()` の値を返す |
private
cacheLockUnavailableMessage(string $path): string
|
|
private
fopenWithoutWarnings(string $path, string $mode):
|
Suppress only expected I/O warnings, even when the caller ignores @. |
private
flockWithoutWarnings(mixed $handle, int $operation): bool
|
|
private
renameWithoutWarnings(string $source, string $target): bool
|
`renameWithoutWarnings()` を実行する |
private
unlinkWithoutWarnings(string $path): bool
|
`unlinkWithoutWarnings()` を実行する |
private
invalidatePhpOpcodeCache(string $path): void
|
`invalidatePhpOpcodeCache()` を実行する |
private
static
ensureCacheDirectoryExists(string $directory): void
|
`ensureCacheDirectoryExists()` を実行する |
private
buildCacheDirMemoKey(?string $cacheDir): ?string
|
`buildCacheDirMemoKey()` を実行する |