Skip to content

Commit

Permalink
Merge pull request #79 from getkirby/develop
Browse files Browse the repository at this point in the history
1.5.0
  • Loading branch information
bastianallgeier authored May 21, 2024
2 parents 8cb3477 + 2d43d41 commit 1d1c76d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ kirby make:command hello --global

The command file will then be place in `~/.kirby/commands/hello.php` and is automatically available everywhere.

## Command environment

To load a custom environment config for a particular host, you can set an env variable

```
env KIRBY_HOST=production.com kirby mycommand
```

## Command plugins

Your Kirby plugins can define their own set of commands: https://getkirby.com/docs/reference/plugins/extensions/commands
Expand Down
5 changes: 5 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ function bootstrap(): string|null
// avoid any output in the CLI
$_ENV['KIRBY_RENDER'] = false;

if (empty($_ENV['KIRBY_HOST']) === false) {
$_SERVER['SERVER_NAME'] = $_ENV['KIRBY_HOST'];
$_SERVER['HTTP_HOST'] = $_ENV['KIRBY_HOST'];
}

ob_start();
require $index;
ob_end_clean();
Expand Down
2 changes: 1 addition & 1 deletion commands/uuid/populate.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

Uuids::populate();

$cli->success('UUID cache has been popluated');
$cli->success('UUID cache has been populated');
}
];

0 comments on commit 1d1c76d

Please sign in to comment.