CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • ConsoleIntegrationTestCase
  • IntegrationTestCase
  • LegacyCommandRunner
  • LegacyShellDispatcher
  • TestCase
  • TestEmailTransport
  • TestSuite

Traits

  • ConsoleIntegrationTestTrait
  • EmailAssertTrait
  • EmailTrait
  • IntegrationTestTrait
  • StringCompareTrait

Class LegacyShellDispatcher

Allows injecting mock IO into shells

Cake\Console\ShellDispatcher
Extended by Cake\TestSuite\LegacyShellDispatcher
Namespace: Cake\TestSuite
Location: TestSuite/LegacyShellDispatcher.php

Properties summary

  • $_io protected
    Cake\Console\ConsoleIo

Inherited Properties

  • _aliases, args

Method Summary

  • __construct() public
    Constructor
  • _createShell() protected
    Injects mock and stub io components into the shell

Method Detail

__construct() public ¶

__construct( array $args = [] , boolean $bootstrap = true , Cake\Console\ConsoleIo $io = null )

Constructor

Parameters
array $args optional []
Argument array
boolean $bootstrap optional true
Initialize environment
Cake\Console\ConsoleIo $io optional null
ConsoleIo
Overrides
Cake\Console\ShellDispatcher::__construct()

_createShell() protected ¶

_createShell( string $className , string $shortName )

Injects mock and stub io components into the shell

Parameters
string $className
Class name
string $shortName
Short name
Returns
Cake\Console\Shell
Overrides
Cake\Console\ShellDispatcher::_createShell()

Methods inherited from Cake\Console\ShellDispatcher

_bootstrap() protected ¶

_bootstrap( )

Initializes the environment and loads the CakePHP core.

Returns
boolean
Success.

_dispatch() protected ¶

_dispatch( array $extra = [] )

Dispatch a request.

Parameters
array $extra optional []

Extra parameters that you can manually pass to the Shell to be dispatched. Built-in extra parameter is : - requested : if used, will prevent the Shell welcome message to be displayed

Returns
boolean|integer|null
Throws
Cake\Console\Exception\MissingShellMethodException

_handleAlias() protected ¶

_handleAlias( string $shell )

If the input matches an alias, return the aliased shell name

Parameters
string $shell
Optionally the name of a plugin or alias
Returns
string
Shell name with plugin prefix

_initEnvironment() protected ¶

_initEnvironment( )

Defines current working environment.

Throws
Cake\Core\Exception\Exception

_shellExists() protected ¶

_shellExists( string $shell )

Check if a shell class exists for the given name.

Parameters
string $shell
The shell name to look for.
Returns
string|boolean
Either the classname or false.

addShortPluginAliases() public ¶

addShortPluginAliases( )

For all loaded plugins, add a short alias

This permits a plugin which implements a shell of the same name to be accessed Using the shell name alone

Returns
array
the resultant list of aliases

alias() public static ¶

alias( string $short , string|null $original = null )

Add an alias for a shell command.

Aliases allow you to call shells by alternate names. This is most useful when dealing with plugin shells that you want to have shorter names for.

If you re-use an alias the last alias set will be the one available.

Usage

Aliasing a shell named ClassName:

$this->alias('alias', 'ClassName');

Getting the original name for a given alias:

$this->alias('alias');
Parameters
string $short
The new short name for the shell.
string|null $original optional null
The original full name for the shell.
Returns
string|false
The aliased class name, or false if the alias does not exist

dispatch() public ¶

dispatch( array $extra = [] )

Dispatches a CLI request

Converts a shell command result into an exit code. Null/True are treated as success. All other return values are an error.

Parameters
array $extra optional []

Extra parameters that you can manually pass to the Shell to be dispatched. Built-in extra parameter is : - requested : if used, will prevent the Shell welcome message to be displayed

Returns
integer
The cli command exit code. 0 is success.

findShell() public ¶

findShell( string $shell )

Get shell to use, either plugin shell or application shell

All paths in the loaded shell paths are searched, handles alias dereferencing

Parameters
string $shell
Optionally the name of a plugin
Returns
Cake\Console\Shell
A shell instance.
Throws
Cake\Console\Exception\MissingShellException
when errors are encountered.

help() public ¶

help( )

Shows console help. Performs an internal dispatch to the CommandList Shell

resetAliases() public static ¶

resetAliases( )

Clear any aliases that have been set.

run() public static ¶

run( array $argv , array $extra = [] )

Run the dispatcher

Parameters
array $argv
The argv from PHP
array $extra optional []
Extra parameters
Returns
integer
The exit code of the shell process.

shiftArgs() public ¶

shiftArgs( )

Removes first argument and shifts other arguments up

Returns
mixed
Null if there are no arguments otherwise the shifted argument

version() public ¶

version( )

Prints the currently installed version of CakePHP. Performs an internal dispatch to the CommandList Shell

Properties detail

$_io ¶

protected Cake\Console\ConsoleIo
Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs