Skip to content

Commit 33335f0

Browse files
Merge pull request #241 from clementbirkle/main
Add Lando compatibility for the extension
2 parents 79030b6 + f9966e7 commit 33335f0

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,23 @@
7777
"herd",
7878
"valet",
7979
"sail",
80+
"lando",
8081
"local"
8182
],
8283
"enumItemLabels": [
8384
"Auto Detect",
8485
"Herd",
8586
"Valet",
8687
"Sail",
88+
"Lando",
8789
"Local"
8890
],
8991
"markdownEnumDescriptions": [
9092
"Auto detect the local PHP environment.",
9193
"Auto detect PHP version Herd is using for the project.",
9294
"Auto detect PHP version Valet is using for the project.",
9395
"Sail",
96+
"Lando",
9497
"Use PHP installed on the local machine."
9598
],
9699
"default": "auto",

src/support/config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ export const configAffected = (
2222
...keys: ConfigKey[]
2323
): boolean => keys.some((key) => event.affectsConfiguration(configKey(key)));
2424

25-
export type PhpEnvironment = "auto" | "herd" | "valet" | "sail" | "local";
25+
export type PhpEnvironment =
26+
| "auto"
27+
| "herd"
28+
| "valet"
29+
| "sail"
30+
| "local"
31+
| "lando";

src/support/php.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let hasVendor = projectPathExists("vendor/autoload.php");
3030
const hasBootstrap = projectPathExists("bootstrap/app.php");
3131

3232
let phpEnvKey: PhpEnvironment | null = null;
33-
const phpEnvsThatUseRelativePaths: PhpEnvironment[] = ["sail"];
33+
const phpEnvsThatUseRelativePaths: PhpEnvironment[] = ["sail", "lando"];
3434

3535
export const initVendorWatchers = () => {
3636
// fs.readdirSync(internalVendorPath()).forEach((file) => {
@@ -109,16 +109,21 @@ const getPhpCommand = (): string => {
109109
command: `"{binaryPath}"`,
110110
});
111111

112-
options.set("local", {
113-
check: "php -r 'echo PHP_BINARY;'",
114-
command: `"{binaryPath}"`,
115-
});
116-
117112
options.set("sail", {
118113
check: "./vendor/bin/sail ps",
119114
command: "./vendor/bin/sail php",
120115
});
121116

117+
options.set("lando", {
118+
check: "lando php -r 'echo PHP_BINARY;'",
119+
command: "lando php",
120+
});
121+
122+
options.set("local", {
123+
check: "php -r 'echo PHP_BINARY;'",
124+
command: `"{binaryPath}"`,
125+
});
126+
122127
for (const [key, option] of options.entries()) {
123128
if (phpEnv !== "auto" && phpEnv !== key) {
124129
continue;

0 commit comments

Comments
 (0)