Skip to content

Commit 5118b56

Browse files
committed
🩹 don't unintentionally boot acorn
1 parent 03f0d7d commit 5118b56

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bin/acorn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env php
22
<?php
33

4+
define('USING_ACORN_CLI', true);
5+
46
(static function () {
57
if (!is_file($autoloadPath = dirname(__DIR__, 4) . '/vendor/autoload.php')) {
68
$autoloadPath = dirname(__DIR__) . '/vendor/autoload.php';

src/Roots/Acorn/Application/Concerns/Bootable.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ public function bootAcorn(array $bootConfiguration = []): static
3737
if ($this->runningInConsole()) {
3838
$this->enableHttpsInConsole();
3939

40-
class_exists('WP_CLI') ? $this->bootWpCli() : $this->bootConsole();
40+
if (class_exists('WP_CLI')) {
41+
$this->bootWpCli();
42+
} elseif (defined('USING_ACORN_CLI') && USING_ACORN_CLI) {
43+
$this->bootConsole();
44+
}
4145

4246
return $this;
4347
}

0 commit comments

Comments
 (0)