LockFileManager
Manages the milpa.lock file. The lock file records the exact state of installed plugins: - Which plugins are installed - Their exact versions - Their source (local or github:owner/repo) - Installation timestamp - Content hash for integrity checks Location: {rootPath}/milpa.lock
LockFileManager::__construct()
public function __construct(string $rootPath):Parameters
| Name | Type | Description |
|---|---|---|
| $rootPath | string |
LockFileManager::generate()
public function generate(array $plugins, string $milpaVersion = '2.0.0'): voidGenerate or update the lock file from current installed plugins.
Parameters
| Name | Type | Description |
|---|---|---|
| $plugins | array<array{name: string, version: string, source?: ?string, installedAt?: ?string, composerDeps?: ?array<string>}> | |
| $milpaVersion | string |
LockFileManager::read()
public function read(): ?arrayRead the lock file. Returns null if it doesn't exist.
LockFileManager::verify()
public function verify(): boolVerify the lock file integrity by recomputing the content hash.
LockFileManager::exists()
public function exists(): boolCheck if the lock file exists.
LockFileManager::getPath()
public function getPath(): stringGet the lock file path.
LockFileManager::getPluginLock()
public function getPluginLock(string $pluginName): ?arrayGet installed plugin info from the lock file.
Parameters
| Name | Type | Description |
|---|---|---|
| $pluginName | string |