JsonFileTuiStateManager
Session persistence backed by a single JSON file. Survives a restart of the program, not a crash mid-write: every save rewrites the whole document, and a failed write leaves the previous session intact rather than a partial one.
JsonFileTuiStateManager::__construct()
public function __construct(string $path):Parameters
| Name | Type | Description |
|---|---|---|
| $path | string |
JsonFileTuiStateManager::loadState()
public function loadState(): array|falseReads the persisted session, or false when there is none or it is unreadable.
JsonFileTuiStateManager::saveState()
public function saveState(array $state): boolPersists the session, returning whether the write succeeded.
Parameters
| Name | Type | Description |
|---|---|---|
| $state | array |
JsonFileTuiStateManager::clearSession()
public function clearSession(): voidDiscards the persisted session, leaving no file behind.