Class CommandScanner

Used by CommandCollection and CommandTask to scan the filesystem for command classes.

Namespace: Cake\Console

Method Summary

  • scanApp() public

    Scan the application for shells & commands.

  • scanCore() public

    Scan CakePHP internals for shells & commands.

  • scanDir() protected

    Scan a directory for .php files and return the class names that should be within them.

  • scanPlugin() public

    Scan the named plugin for shells and commands

Method Detail

scanApp() public

scanApp()

Scan the application for shells & commands.

Returns

array

A list of command metadata.

scanCore() public

scanCore()

Scan CakePHP internals for shells & commands.

Returns

array

A list of command metadata.

scanDir() protected

scanDir(string $path, string $namespace, string $prefix, array $hide)

Scan a directory for .php files and return the class names that should be within them.

Parameters

string $path

The directory to read.

string $namespace

The namespace the shells live in.

string $prefix

The prefix to apply to commands for their full name.

string[] $hide

A list of command names to hide as they are internal commands.

Returns

array

The list of shell info arrays based on scanning the filesystem and inflection.

scanPlugin() public

scanPlugin(string $plugin)

Scan the named plugin for shells and commands

Parameters

string $plugin

The named plugin.

Returns

array

A list of command metadata.

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Console.CommandScanner.html