diff --git a/.gitignore b/.gitignore index 7602bc9..05e199d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ phpmon.xcodeproj/xcuserdata PHP Monitor.xcodeproj/project.xcworkspace PHP Monitor.xcodeproj/xcuserdata phpmon-updater/PHP Monitor Self-Updater.app/ -.DS_Store \ No newline at end of file +.DS_Store diff --git a/README.md b/README.md index 6822683..38173ab 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,8 @@ This problem is usually resolved by upgrading Valet and running `valet install` composer global update valet install + +If you are seeing a 502 (Bad Gateway) error after about 30 seconds or so, your request is likely timing out. You may need to solve a performance issue with your own code. diff --git a/phpmon/Common/Filesystem/RealFileSystem.swift b/phpmon/Common/Filesystem/RealFileSystem.swift index 67cfa91..8cc9457 100644 --- a/phpmon/Common/Filesystem/RealFileSystem.swift +++ b/phpmon/Common/Filesystem/RealFileSystem.swift @@ -41,15 +41,11 @@ class RealFileSystem: FileSystemProtocol { } func getShallowContentsOfDirectory(_ path: String) throws -> [String] { - return try FileManager.default.contentsOfDirectory( - atPath: path.replacingTildeWithHomeDirectory - ) + return try FileManager.default.contentsOfDirectory(atPath: path.replacingTildeWithHomeDirectory) } func getDestinationOfSymlink(_ path: String) throws -> String { - return try FileManager.default.destinationOfSymbolicLink( - atPath: path.replacingTildeWithHomeDirectory - ) + return try FileManager.default.destinationOfSymbolicLink(atPath: path.replacingTildeWithHomeDirectory) } // MARK: - Move & Delete Files @@ -62,9 +58,7 @@ class RealFileSystem: FileSystemProtocol { } func remove(_ path: String) throws { - try FileManager.default.removeItem( - atPath: path.replacingTildeWithHomeDirectory - ) + try FileManager.default.removeItem(atPath: path.replacingTildeWithHomeDirectory) } // MARK: — FS Attributes diff --git a/phpmon/Domain/Menu/MainMenu+Startup.swift b/phpmon/Domain/Menu/MainMenu+Startup.swift index a653dc3..fc8b39b 100644 --- a/phpmon/Domain/Menu/MainMenu+Startup.swift +++ b/phpmon/Domain/Menu/MainMenu+Startup.swift @@ -121,6 +121,9 @@ extension MainMenu { // Check if the linked version has changed between launches of phpmon Stats.evaluateLastLinkedPhpVersion() + // Check if an update was performed earlier + AppUpdater.checkIfUpdateWasPerformed() + // We are ready! Log.info("PHP Monitor is ready to serve!") diff --git a/phpmon/IAP/InternetAccessPolicy.plist b/phpmon/IAP/InternetAccessPolicy.plist index 5d5a97c..bdcfa16 100644 --- a/phpmon/IAP/InternetAccessPolicy.plist +++ b/phpmon/IAP/InternetAccessPolicy.plist @@ -10,6 +10,22 @@ https://github.com/nicoverbruggen/phpmon Connections + + IsIncoming + + Host + github.com, api.github.com + NetworkProtocol + TCP + Port + 443 + Relevance + Essential + Purpose + PHP Monitor directly invokes Homebrew which contacts GitHub. This happens when PHP Monitor asks for more information about the PHP formula to determine which version of PHP you've got running. + DenyConsequences + If you deny these connections, PHP Monitor might not be able to complete its preset set of instructions, causing version switching to fail. + IsIncoming @@ -46,15 +62,15 @@ IsIncoming Host - github.com, api.github.com + formulae.brew.sh NetworkProtocol TCP Port - 443 + 80, 443 Relevance Essential Purpose - PHP Monitor directly invokes Homebrew which contacts GitHub. This happens when PHP Monitor asks for more information about the PHP formula to determine which version of PHP you've got running. + PHP Monitor directly invokes Homebrew which contacts the Homebrew API. This happens when PHP Monitor asks for more information about the PHP formula to determine which version of PHP you've got running. DenyConsequences If you deny these connections, PHP Monitor might not be able to complete its preset set of instructions, causing version switching to fail. diff --git a/tests/unit/Parsers/CaskFileParserTest.swift b/tests/unit/Parsers/CaskFileParserTest.swift index 5e1c18b..df065d3 100644 --- a/tests/unit/Parsers/CaskFileParserTest.swift +++ b/tests/unit/Parsers/CaskFileParserTest.swift @@ -49,5 +49,4 @@ class CaskFileParserTest: XCTestCase { XCTAssertTrue(caskFile.properties.keys.contains("url")) XCTAssertTrue(caskFile.properties.keys.contains("appcast")) } - } diff --git a/tests/unit/Versions/AppVersionTest.swift b/tests/unit/Versions/AppVersionTest.swift index 6886bae..30a837c 100644 --- a/tests/unit/Versions/AppVersionTest.swift +++ b/tests/unit/Versions/AppVersionTest.swift @@ -72,5 +72,4 @@ class AppVersionTest: XCTestCase { // Build is older XCTAssertFalse(AppVersion.from("5.0_101")! > AppVersion.from("5.0_102")!) } - }