Documentation

Config extends BaseConfig
in package

Class Config

Table of Contents

$registrars  : array<string|int, mixed>
An optional array of classes that will act as Registrars for rapidly setting config class properties.
$didDiscovery  : bool
Has module discovery happened yet?
$factory  : Database|null
The main instance used to manage all of our open database connections.
$instances  : array<string|int, mixed>
Cache for instance of any connections that have been requested as a "shared" instance.
$moduleConfig  : Modules
The modules configuration.
__construct()  : mixed
Will attempt to get environment variables with names that match the properties of the child class.
connect()  : BaseConnection
Creates the default
forge()  : Forge
Loads and returns an instance of the Forge for the specified database group, and loads the group if it hasn't been loaded yet.
getConnections()  : array<string|int, mixed>
Returns an array of all db connections currently made.
seeder()  : Seeder
Returns a new instance of the Database Seeder.
utils()  : BaseUtils
Returns a new instance of the Database Utilities class.
ensureFactory()  : mixed
Ensures the database Connection Manager/Factory is loaded and ready to use.
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 = []

$didDiscovery

Has module discovery happened yet?

protected static bool $didDiscovery = false

$factory

The main instance used to manage all of our open database connections.

protected static Database|null $factory

$instances

Cache for instance of any connections that have been requested as a "shared" instance.

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

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

connect()

Creates the default

public static connect([string|array<string|int, mixed> $group = null ][, bool $getShared = true ]) : BaseConnection
Parameters
$group : string|array<string|int, mixed> = null

The name of the connection group to use, or an array of configuration settings.

$getShared : bool = true

Whether to return a shared instance of the connection.

Return values
BaseConnection

forge()

Loads and returns an instance of the Forge for the specified database group, and loads the group if it hasn't been loaded yet.

public static forge([ConnectionInterface|string|array<string|int, mixed>|null $group = null ]) : Forge
Parameters
$group : ConnectionInterface|string|array<string|int, mixed>|null = null
Return values
Forge

getConnections()

Returns an array of all db connections currently made.

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

seeder()

Returns a new instance of the Database Seeder.

public static seeder([string|null $group = null ]) : Seeder
Parameters
$group : string|null = null
Return values
Seeder

utils()

Returns a new instance of the Database Utilities class.

public static utils([string|array<string|int, mixed>|null $group = null ]) : BaseUtils
Parameters
$group : string|array<string|int, mixed>|null = null
Return values
BaseUtils

ensureFactory()

Ensures the database Connection Manager/Factory is loaded and ready to use.

protected static ensureFactory() : mixed
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