Skip to content

Commit

Permalink
Improvements for the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Oct 5, 2022
1 parent 6302c62 commit f962c63
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Cms/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,10 @@ public function path(): string
*/
public function render(string $path = null, string $method = null)
{
if (($_ENV['KIRBY_RENDER'] ?? true) === false) {
return null;
}

return $this->io($this->call($path, $method));
}

Expand Down
12 changes: 12 additions & 0 deletions src/Cms/AppPlugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ trait AppPlugins
'blueprints' => [],
'cacheTypes' => [],
'collections' => [],
'commands' => [],
'components' => [],
'controllers' => [],
'collectionFilters' => [],
Expand Down Expand Up @@ -215,6 +216,17 @@ protected function extendCacheTypes(array $cacheTypes): array
return $this->extensions['cacheTypes'] = array_merge($this->extensions['cacheTypes'], $cacheTypes);
}

/**
* Registers additional CLI commands
*
* @param array $commands
* @return array
*/
protected function extendCommands(array $commands): array
{
return $this->extensions['commands'] = array_merge($this->extensions['commands'], $commands);
}

/**
* Registers additional collection filters
*
Expand Down
1 change: 1 addition & 0 deletions src/Cms/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ public function roots(): array
'blueprints' => fn (array $roots) => $roots['site'] . '/blueprints',
'cache' => fn (array $roots) => $roots['site'] . '/cache',
'collections' => fn (array $roots) => $roots['site'] . '/collections',
'commands' => fn (array $roots) => $roots['site'] . '/commands',
'config' => fn (array $roots) => $roots['site'] . '/config',
'controllers' => fn (array $roots) => $roots['site'] . '/controllers',
'languages' => fn (array $roots) => $roots['site'] . '/languages',
Expand Down

0 comments on commit f962c63

Please sign in to comment.