Documentation

Generators extends BaseConfig
in package

Class BaseConfig

Not intended to be used on its own, this class will attempt to automatically populate the child class' properties with values from the environment.

These can be set within the .env file.

Table of Contents

$registrars  : array<string|int, mixed>
An optional array of classes that will act as Registrars for rapidly setting config class properties.
$views  : array<string, string>
-------------------------------------------------------------------------- Generator Commands' Views --------------------------------------------------------------------------
$didDiscovery  : bool
Has module discovery happened yet?
$moduleConfig  : Modules
The modules configuration.
__construct()  : mixed
Will attempt to get environment variables with names that match the properties of the child class.
getEnvValue()  : mixed
Retrieve an environment-specific configuration setting
initEnvValue()  : mixed
Initialization an environment-specific configuration setting
registerProperties()  : mixed
Provides external libraries a simple way to register one or more options into a config file.

Properties

$registrars

An optional array of classes that will act as Registrars for rapidly setting config class properties.

public static array<string|int, mixed> $registrars = []

$views

-------------------------------------------------------------------------- Generator Commands' Views --------------------------------------------------------------------------

public array<string, string> $views = ['make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php', 'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php', 'make:entity' => 'CodeIgniter\Commands\Generators\Views\entity.tpl.php', 'make:filter' => 'CodeIgniter\Commands\Generators\Views\filter.tpl.php', 'make:migration' => 'CodeIgniter\Commands\Generators\Views\migration.tpl.php', 'make:model' => 'CodeIgniter\Commands\Generators\Views\model.tpl.php', 'make:seeder' => 'CodeIgniter\Commands\Generators\Views\seeder.tpl.php', 'make:validation' => 'CodeIgniter\Commands\Generators\Views\validation.tpl.php', 'session:migration' => 'CodeIgniter\Commands\Generators\Views\migration.tpl.php']

This array defines the mapping of generator commands to the view files they are using. If you need to customize them for your own, copy these view files in your own folder and indicate the location here.

You will notice that the views have special placeholders enclosed in curly braces {...}. These placeholders are used internally by the generator commands in processing replacements, thus you are warned not to delete them or modify the names. If you will do so, you may end up disrupting the scaffolding process and throw errors.

YOU HAVE BEEN WARNED!

$didDiscovery

Has module discovery happened yet?

protected static bool $didDiscovery = false

Methods

__construct()

Will attempt to get environment variables with names that match the properties of the child class.

public __construct() : mixed

The "shortPrefix" is the lowercase-only config class name.

Return values
mixed

getEnvValue()

Retrieve an environment-specific configuration setting

protected getEnvValue(string $property, string $prefix, string $shortPrefix) : mixed
Parameters
$property : string
$prefix : string
$shortPrefix : string
Return values
mixed

initEnvValue()

Initialization an environment-specific configuration setting

protected initEnvValue(mixed &$property, string $name, string $prefix, string $shortPrefix) : mixed
Parameters
$property : mixed
$name : string
$prefix : string
$shortPrefix : string
Return values
mixed

registerProperties()

Provides external libraries a simple way to register one or more options into a config file.

protected registerProperties() : mixed
Tags
throws
ReflectionException
Return values
mixed

Search results