Documentation

CommandRunner extends Controller
in package

Command runner

Table of Contents

$commands  : Commands
Instance of class managing the collection of commands
$forceHTTPS  : int
Should enforce HTTPS access for all methods in this controller.
$helpers  : array<string|int, mixed>
Helpers that will be automatically loaded on class instantiation.
$logger  : LoggerInterface
Instance of logger to use.
$request  : RequestInterface
Instance of the main Request object.
$response  : ResponseInterface
Instance of the main response object.
$validator  : Validation
Once validation has been run, will hold the Validation instance.
__construct()  : mixed
Constructor
_remap()  : mixed
We map all un-routed CLI methods through this function so we have the chance to look for a Command first.
getCommands()  : array<string|int, mixed>
Allows access to the current commands that have been found.
index()  : mixed
Default command.
initController()  : mixed
Constructor.
cachePage()  : mixed
Provides a simple way to tie into the main CodeIgniter class and tell it how long to cache the current page for.
forceHTTPS()  : mixed
A convenience method to use when you need to ensure that a single method is reached only via HTTPS. If it isn't, then a redirect will happen back to this method and HSTS header will be sent to have modern browsers transform requests automatically.
loadHelpers()  : mixed
Handles "auto-loading" helper files.
validate()  : bool
A shortcut to performing validation on input data. If validation is not successful, a $errors property will be set on this class.

Properties

$forceHTTPS

Should enforce HTTPS access for all methods in this controller.

protected int $forceHTTPS = 0

Number of seconds to set HSTS header

$helpers

Helpers that will be automatically loaded on class instantiation.

protected array<string|int, mixed> $helpers = []

$validator

Once validation has been run, will hold the Validation instance.

protected Validation $validator

Methods

__construct()

Constructor

public __construct() : mixed
Return values
mixed

_remap()

We map all un-routed CLI methods through this function so we have the chance to look for a Command first.

public _remap(string $method, array<string|int, mixed> ...$params) : mixed
Parameters
$method : string
$params : array<string|int, mixed>
Tags
throws
ReflectionException
Return values
mixed

getCommands()

Allows access to the current commands that have been found.

public getCommands() : array<string|int, mixed>
Return values
array<string|int, mixed>

index()

Default command.

public index(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>
Tags
throws
ReflectionException
Return values
mixed

cachePage()

Provides a simple way to tie into the main CodeIgniter class and tell it how long to cache the current page for.

protected cachePage(int $time) : mixed
Parameters
$time : int
Return values
mixed

forceHTTPS()

A convenience method to use when you need to ensure that a single method is reached only via HTTPS. If it isn't, then a redirect will happen back to this method and HSTS header will be sent to have modern browsers transform requests automatically.

protected forceHTTPS([int $duration = 31536000 ]) : mixed
Parameters
$duration : int = 31536000

The number of seconds this link should be considered secure for. Only with HSTS header. Default value is 1 year.

Tags
throws
HTTPException
Return values
mixed

loadHelpers()

Handles "auto-loading" helper files.

protected loadHelpers() : mixed
Tags
deprecated

Use helper function instead of using this method.

codeCoverageIgnore
Return values
mixed

validate()

A shortcut to performing validation on input data. If validation is not successful, a $errors property will be set on this class.

protected validate(array<string|int, mixed>|string $rules[, array<string|int, mixed> $messages = [] ]) : bool
Parameters
$rules : array<string|int, mixed>|string
$messages : array<string|int, mixed> = []

An array of custom error messages

Return values
bool

Search results