Skip to content

Commit 9fd8e70

Browse files
🚀 Version 2.1
Merge branch 'develop' * develop: 📝 Add installation instructions 📝 Added docs for release procedure 📝 Updated README 🔧 Hardened runtime (required for notarization) 🍱 Updated icon for macOS 11 style, updated alert
2 parents 0c33e8f + cb62a20 commit 9fd8e70

17 files changed

+174
-106
lines changed

PHP Monitor.xcodeproj/project.pbxproj

+12-8
Original file line numberDiff line numberDiff line change
@@ -382,19 +382,21 @@
382382
buildSettings = {
383383
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
384384
CODE_SIGN_ENTITLEMENTS = phpmon/phpmon.entitlements;
385-
CODE_SIGN_IDENTITY = "-";
385+
CODE_SIGN_IDENTITY = "Apple Development";
386386
CODE_SIGN_STYLE = Automatic;
387387
COMBINE_HIDPI_IMAGES = YES;
388-
CURRENT_PROJECT_VERSION = 22;
389-
DEVELOPMENT_TEAM = "";
388+
CURRENT_PROJECT_VERSION = 23;
389+
DEVELOPMENT_TEAM = 8M54J5J787;
390+
ENABLE_HARDENED_RUNTIME = YES;
390391
INFOPLIST_FILE = phpmon/Info.plist;
391392
LD_RUNPATH_SEARCH_PATHS = (
392393
"$(inherited)",
393394
"@executable_path/../Frameworks",
394395
);
395-
MARKETING_VERSION = 2.0;
396+
MARKETING_VERSION = 2.1;
396397
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
397398
PRODUCT_NAME = "$(TARGET_NAME)";
399+
PROVISIONING_PROFILE_SPECIFIER = "";
398400
SWIFT_VERSION = 5.0;
399401
};
400402
name = Debug;
@@ -404,19 +406,21 @@
404406
buildSettings = {
405407
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
406408
CODE_SIGN_ENTITLEMENTS = phpmon/phpmon.entitlements;
407-
CODE_SIGN_IDENTITY = "-";
409+
CODE_SIGN_IDENTITY = "Apple Development";
408410
CODE_SIGN_STYLE = Automatic;
409411
COMBINE_HIDPI_IMAGES = YES;
410-
CURRENT_PROJECT_VERSION = 22;
411-
DEVELOPMENT_TEAM = "";
412+
CURRENT_PROJECT_VERSION = 23;
413+
DEVELOPMENT_TEAM = 8M54J5J787;
414+
ENABLE_HARDENED_RUNTIME = YES;
412415
INFOPLIST_FILE = phpmon/Info.plist;
413416
LD_RUNPATH_SEARCH_PATHS = (
414417
"$(inherited)",
415418
"@executable_path/../Frameworks",
416419
);
417-
MARKETING_VERSION = 2.0;
420+
MARKETING_VERSION = 2.1;
418421
PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon;
419422
PRODUCT_NAME = "$(TARGET_NAME)";
423+
PROVISIONING_PROFILE_SPECIFIER = "";
420424
SWIFT_VERSION = 5.0;
421425
};
422426
name = Release;

README.md

+16-64
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,30 @@ For me, it comes in handy when running multiple versions of PHP with Homebrew. I
1010

1111
It's also super convenient to and switch between versions.
1212

13-
## System requirements
13+
## 🖥 System requirements
1414

1515
* macOS 10.15 Catalina
1616
* PHP 7.4 installed with Homebrew 2.x
1717
* Laravel Valet 2.x
1818

1919
_Please note that future versions of PHP will not work automatically, minor changes are required to add support for newer versions of PHP._
2020

21-
## Why I built this
21+
## 🚀 How to install
22+
23+
You can install via Homebrew, or may download the latest [release](https://github.com/nicoverbruggen/phpmon/releases).
24+
25+
To install via Homebrew, run:
26+
27+
brew tap nicoverbruggen/homebrew-cask
28+
brew cask install phpmon
29+
30+
## 👨‍💻 Why I built this
2231

2332
I wanted to be able to see at a glance which version of PHP was linked, and handle dealing with Laravel Valet in a simple app without having to deal with the terminal every time.
2433

2534
Initially, I had an Alfred workflow for this. But this does the job as well, while also showing me at all times which version of PHP is linked (which is the main benefit over e.g. an Alfred workflow).
2635

27-
## How it works
36+
## 🚜 How it works
2837

2938
### Version detection
3039

@@ -54,12 +63,10 @@ If you want to know more about how this works, I recommend you check out the sou
5463

5564
This app isn't very complicated after all. In the end, this just (conveniently) executes some shell commands.
5665

57-
## Troubleshooting
66+
## 🤬 Troubleshooting
5867

5968
**If you are having issues, the first thing you should be doing is installing the latest version of PHP Monitor. This can resolve a variety of issues.**
6069

61-
### Reasons for alerts at startup
62-
6370
PHP Monitor performs some integrity checks to ensure a good experience when using the app. You'll get a message telling you that PHP Monitor won't work correctly in the following scenarios:
6471

6572
- The PHP binary is not located in `/usr/local/bin/php`
@@ -71,65 +78,10 @@ PHP Monitor performs some integrity checks to ensure a good experience when usin
7178

7279
Follow instructions as specified in the alert in order to resolve any issues.
7380

74-
### Additional troubleshooting
75-
76-
#### Q: I want PHP Monitor to start up when I boot my Mac!
77-
78-
You can do this by dragging *PHP Monitor.app* into the **Login Items** section in **System Preferences > Users & Groups** for your account.
79-
80-
Super convenient!
81-
82-
#### Q: PHP Monitor says that the latest version of PHP is not installed, but it is!
83-
84-
Try installing again using `brew install [email protected]`.
85-
86-
This should resolve the issue.
87-
88-
#### Q: PHP Monitor reports another version compared to phpinfo on my local website, what is going on?
89-
90-
_Beginning with version 2.0 you'll get alerts about this at startup._
91-
92-
If you're still seeing another version of PHP in your scripts running on your local webserver (nginx) — e.g. when running `phpinfo()` — I recommend you shut down all PHP services that are currently active. You can find out what services are active by running:
93-
94-
sudo brew services list | grep php
95-
96-
This will present to you a list of services, like so (depending on the installed versions of PHP):
97-
98-
```
99-
php started root /Library/LaunchDaemons/homebrew.mxcl.php.plist
100-
101-
102-
103-
104-
105-
```
106-
107-
You'll want to make sure that **only one service is running** and that it is running **as `root`**. You can terminate a service by running:
108-
109-
sudo brew services stop {service_name}
110-
111-
So in order to disable PHP 7.3, you'd need to run:
112-
113-
sudo brew services stop [email protected]
114-
115-
If you notice that PHP FPM is running as your own user account, you can turn off the service by running:
116-
117-
brew services stop [email protected]
118-
119-
The easiest way to make sure that PHP Monitor works again is to run the following commands:
120-
121-
sudo brew services stop php
122-
sudo brew services stop [email protected]
123-
sudo brew services stop [email protected]
124-
sudo brew services stop [email protected]
125-
sudo brew services stop [email protected]
126-
sudo brew services stop [email protected]
127-
sudo brew services stop nginx
128-
129-
Then, in PHP Monitor, select "Restart php-fpm service", which should start the service.
81+
## 📝 Additional information
13082

131-
Alternatively, you can run `sudo brew services start [email protected]` where `7.4` is your preferred version of PHP (for the latest version of PHP, you may omit `@7.4` like in the example above).
83+
Please consult the [additional information](docs/ADDITIONAL.md) file that contains more information.
13284

133-
---
85+
## ⭐️ Is this helpful?
13486

13587
If this software has been useful to you, star the repository so I know that the software is being used. I did not include any tracking or analytics software, so if you encounter issues, let me know via an issue.

assets.sketch

107 KB
Binary file not shown.

docs/ADDITIONAL.md

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
### Q&A
2+
3+
#### Q: This app is doing network requests?
4+
5+
It's Homebrew. I can't prevent `brew` from doing things via the network when I invoke it.
6+
7+
PHP Monitor itself doesn't do any network requests. Feel free to check the source code or intercept the traffic, if you don't believe me.
8+
9+
#### Q: How can I set this up on a fresh Mac?
10+
11+
If you want to set up your computer for the very first time, here's how I do it:
12+
13+
Install [Homebrew](https://brew.sh) first.
14+
15+
Install PHP, composer, add to path:
16+
17+
brew install php
18+
brew install composer
19+
nano .zshrc
20+
21+
Make sure the following line is not in the comments:
22+
23+
export PATH=$HOME/bin:/usr/local/bin:$PATH
24+
25+
and add the following to your .zshrc:
26+
27+
export PATH=$HOME/bin:~/.composer/vendor/bin:$PATH
28+
29+
Make sure PHP is linked correctly:
30+
31+
which php
32+
33+
should return: `/usr/local/bin/php`
34+
35+
composer global require laravel/valet
36+
valet install
37+
38+
This should install `dnsmasq` and set up Valet. Great, almost there!
39+
40+
valet trust
41+
42+
Finally, run PHP Monitor. Since the app is notarized and signed with a developer ID, it should work.
43+
44+
#### Q: I want PHP Monitor to start up when I boot my Mac!
45+
46+
You can do this by dragging *PHP Monitor.app* into the **Login Items** section in **System Preferences > Users & Groups** for your account.
47+
48+
Super convenient!
49+
50+
#### Q: PHP Monitor says that the latest version of PHP is not installed, but it is!
51+
52+
Try installing again using `brew install [email protected]`.
53+
54+
This should resolve the issue.
55+
56+
#### Q: PHP Monitor reports another version compared to phpinfo on my local website, what is going on?
57+
58+
_Beginning with version 2.0 you'll get alerts about this at startup._
59+
60+
If you're still seeing another version of PHP in your scripts running on your local webserver (nginx) — e.g. when running `phpinfo()` — I recommend you shut down all PHP services that are currently active. You can find out what services are active by running:
61+
62+
sudo brew services list | grep php
63+
64+
This will present to you a list of services, like so (depending on the installed versions of PHP):
65+
66+
```
67+
php started root /Library/LaunchDaemons/homebrew.mxcl.php.plist
68+
69+
70+
71+
72+
73+
```
74+
75+
You'll want to make sure that **only one service is running** and that it is running **as `root`**. You can terminate a service by running:
76+
77+
sudo brew services stop {service_name}
78+
79+
So in order to disable PHP 7.3, you'd need to run:
80+
81+
sudo brew services stop [email protected]
82+
83+
If you notice that PHP FPM is running as your own user account, you can turn off the service by running:
84+
85+
brew services stop [email protected]
86+
87+
The easiest way to make sure that PHP Monitor works again is to run the following commands:
88+
89+
sudo brew services stop php
90+
sudo brew services stop [email protected]
91+
sudo brew services stop [email protected]
92+
sudo brew services stop [email protected]
93+
sudo brew services stop [email protected]
94+
sudo brew services stop [email protected]
95+
sudo brew services stop nginx
96+
97+
Then, in PHP Monitor, select "Restart php-fpm service", which should start the service.
98+
99+
Alternatively, you can run `sudo brew services start [email protected]` where `7.4` is your preferred version of PHP (for the latest version of PHP, you may omit `@7.4` like in the example above).

docs/RELEASE.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Release Procedure
2+
3+
1. Merge into `master`
4+
2. Create tag
5+
3. Add changes to changelog
6+
4. Archive
7+
5. Notarize and prepare for own distribution
8+
6. After notarization, export .app
9+
7. Create zipped version
10+
8. Calculate SHA256: `openssl dgst -sha256 phpmon-2.x.zip`
11+
9. Upload to GitHub
12+
10. Update Cask
13+
11. Check new version can be installed via Cask
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
{
22
"images" : [
33
{
4-
"size" : "16x16",
5-
"idiom" : "mac",
64
"filename" : "icon_16x16.png",
7-
"scale" : "1x"
5+
"idiom" : "mac",
6+
"scale" : "1x",
7+
"size" : "16x16"
88
},
99
{
10-
"size" : "16x16",
11-
"idiom" : "mac",
1210
"filename" : "[email protected]",
13-
"scale" : "2x"
11+
"idiom" : "mac",
12+
"scale" : "2x",
13+
"size" : "16x16"
1414
},
1515
{
16-
"size" : "32x32",
17-
"idiom" : "mac",
1816
"filename" : "icon_32x32.png",
19-
"scale" : "1x"
17+
"idiom" : "mac",
18+
"scale" : "1x",
19+
"size" : "32x32"
2020
},
2121
{
22-
"size" : "32x32",
23-
"idiom" : "mac",
2422
"filename" : "[email protected]",
25-
"scale" : "2x"
23+
"idiom" : "mac",
24+
"scale" : "2x",
25+
"size" : "32x32"
2626
},
2727
{
28-
"size" : "128x128",
29-
"idiom" : "mac",
3028
"filename" : "icon_128x128.png",
31-
"scale" : "1x"
29+
"idiom" : "mac",
30+
"scale" : "1x",
31+
"size" : "128x128"
3232
},
3333
{
34-
"size" : "128x128",
35-
"idiom" : "mac",
3634
"filename" : "[email protected]",
37-
"scale" : "2x"
35+
"idiom" : "mac",
36+
"scale" : "2x",
37+
"size" : "128x128"
3838
},
3939
{
40-
"size" : "256x256",
41-
"idiom" : "mac",
4240
"filename" : "icon_256x256.png",
43-
"scale" : "1x"
41+
"idiom" : "mac",
42+
"scale" : "1x",
43+
"size" : "256x256"
4444
},
4545
{
46-
"size" : "256x256",
47-
"idiom" : "mac",
4846
"filename" : "[email protected]",
49-
"scale" : "2x"
47+
"idiom" : "mac",
48+
"scale" : "2x",
49+
"size" : "256x256"
5050
},
5151
{
52-
"size" : "512x512",
53-
"idiom" : "mac",
5452
"filename" : "icon_512x512.png",
55-
"scale" : "1x"
53+
"idiom" : "mac",
54+
"scale" : "1x",
55+
"size" : "512x512"
5656
},
5757
{
58-
"size" : "512x512",
59-
"idiom" : "mac",
6058
"filename" : "[email protected]",
61-
"scale" : "2x"
59+
"idiom" : "mac",
60+
"scale" : "2x",
61+
"size" : "512x512"
6262
}
6363
],
6464
"info" : {
65-
"version" : 1,
66-
"author" : "xcode"
65+
"author" : "xcode",
66+
"version" : 1
6767
}
68-
}
68+
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

phpmon/Classes/Commands/Startup.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Startup {
2727
self.presentAlertOnMainThreadIf(
2828
!Shell.user.pipe("which valet").contains("/usr/local/bin/valet"),
2929
messageText: "Laravel Valet is not correctly installed",
30-
informativeText: "You must install Valet via brew. Try running `which valet` in Terminal, it should return `/usr/local/bin/valet`. The app will not work correctly until you resolve this issue."
30+
informativeText: "You must install Valet with composer. Try running `which valet` in Terminal, it should return `/usr/local/bin/valet`. The app will not work correctly until you resolve this issue."
3131
)
3232

3333
self.presentAlertOnMainThreadIf(

0 commit comments

Comments
 (0)