1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-09 04:42:59 +02:00

👌 Verify switch succeeded (#111)

- Verify switch was successful
- Suggest "Fix My Valet"
- Restart nginx when switching PHP versions
This commit is contained in:
2022-01-31 17:56:20 +01:00
parent 4cffe5a662
commit 6081ef6b02
5 changed files with 44 additions and 10 deletions

View File

@@ -155,4 +155,16 @@ class PhpEnv {
.matching(constraint: $0.trimmingCharacters(in: .whitespacesAndNewlines))
}
}
/**
Validates whether the currently running version matches the provided version.
*/
public func validate(_ version: String) -> Bool {
if self.currentInstall.version.short == version {
print("Switching to version \(version) seems to have succeeded. Validation passed.")
return true
}
return false
}
}