SnapshotStore
API reference › Debug › storage › SnapshotStore
Yii2 compatibility facade for the framework-neutral snapshot store.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a Yii2 facade for the framework-neutral store. | SnapshotStore |
forModule() static | Creates a store bound to the module’s data path and permission settings. | SnapshotStore |
loadManifest() | Returns manifest entries ordered from newest to oldest. | SnapshotStore |
loadManifestResult() | Returns manifest entries together with an optional core storage diagnostic. | SnapshotStore |
readSnapshot() | Returns a stored snapshot or null when unavailable. | SnapshotStore |
writeSnapshot() | Writes a snapshot and manifest update through one core storage transaction. | SnapshotStore |
writeSnapshotResult() | Writes a snapshot and returns the committed manifest from the same storage transaction, without a second read. | SnapshotStore |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(string $path, int $dirMode, int|null $fileMode)Creates a Yii2 facade for the framework-neutral store.
Parameters
| Parameter | Type | Description |
|---|---|---|
$path | string | Storage directory path. |
$dirMode | int | Directory permissions used when creating the storage path. |
$fileMode | int| | File permissions or null to preserve the system default. |
forModule()
Section titled “forModule() ”public static function forModule(yii\debug\Module $module): selfCreates a store bound to the module’s data path and permission settings.
Parameters
| Parameter | Type | Description |
|---|---|---|
$module | yii\ | Debug module whose dataPath, dirMode, and fileMode configure the store. |
Returns
self: Store bound to the module settings.
loadManifest()
Section titled “loadManifest() ”public function loadManifest(): array<string, PHPForge\Debug\Storage\RequestSummary>Returns manifest entries ordered from newest to oldest.
Returns
array<string, PHPForge\Debug\Storage\RequestSummary>: Newest entries first.
loadManifestResult()
Section titled “loadManifestResult() ”public function loadManifestResult(): PHPForge\Debug\Storage\ManifestReadResultReturns manifest entries together with an optional core storage diagnostic.
Returns
PHPForge\Debug\Storage\ManifestReadResult: Manifest entries plus the storage diagnostic, when one was raised.
readSnapshot()
Section titled “readSnapshot() ”public function readSnapshot(string $tag): PHPForge\Debug\Storage\DebugSnapshot|nullReturns a stored snapshot or null when unavailable.
Parameters
| Parameter | Type | Description |
|---|---|---|
$tag | string | Snapshot tag. |
Returns
PHPForge\Debug\Storage\DebugSnapshot|null: Hydrated snapshot or null when unavailable.
writeSnapshot()
Section titled “writeSnapshot() ”public function writeSnapshot(PHPForge\Debug\Storage\DebugSnapshot $snapshot, int $historySize): list<PHPForge\Debug\Storage\RequestSummary>Writes a snapshot and manifest update through one core storage transaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
$snapshot | PHPForge\ | Snapshot to persist. |
$historySize | int | Maximum number of retained entries. |
Returns
list<PHPForge\Debug\Storage\RequestSummary>: Entries evicted from the manifest.
writeSnapshotResult()
Section titled “writeSnapshotResult() ”public function writeSnapshotResult(PHPForge\Debug\Storage\DebugSnapshot $snapshot, int $historySize): yii\debug\storage\SnapshotWriteResultWrites a snapshot and returns the committed manifest from the same storage transaction, without a second read.
Parameters
| Parameter | Type | Description |
|---|---|---|
$snapshot | PHPForge\ | Snapshot to persist. |
$historySize | int | Maximum number of retained entries. |
Returns
SnapshotWriteResult: Committed entries and evictions.