PHP Класс Bolt\Config

Автор: Bob den Otter, [email protected]
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$fields Bolt\Storage\Field\Manager Will be made protected in Bolt 3.0.
$notify_update boolean @deprecated Deprecated since 3.2, to be removed in 4.0

Защищенные свойства (Protected)

Свойство Тип Описание
$app Silex\Application
$cachetimestamp integer
$data array
$defaultConfig array
$reservedFieldNames array
$yamlParser Symfony\Component\Yaml\Parser

Открытые методы

Метод Описание
__construct ( Silex\Application $app )
cacheConfig ( boolean $force = false )
checkConfig ( ) : boolean Sanity checks for doubles in in contenttypes.
doReplacements ( mixed $value = null ) : mixed Replaces placeholders in config values %foo% will be resolved to $app['foo'] from the container
get ( string $path, string | array | boolean $default = null ) : mixed Get a config value, using a path.
getConfig ( ) : array Load the configuration from the various YML files.
getCurrentTimestamp ( ) : string Get the current timestamp, corrected to the timezone.
getExceptions ( ) : array | null
getFields ( ) : Manager A getter to access the fields manager.
getTimestamp ( $when ) : string Get a timestamp, corrected to the timezone.
getTwigPath ( ) : string[] Build an array of Twig paths.
getWhichEnd ( ) : string Use {@see Zone} instead with a {@see Request}.
initialize ( )
set ( string $path, mixed $value ) : boolean Set a config value, using a path.
setCKPath ( )

Защищенные методы

Метод Описание
checkValidCache ( )
getDefaults ( ) Assume sensible defaults for a number of options.
loadCache ( ) : array | null Attempt to load cached configuration files.
parseConfigYaml ( string $filename, string $path = null ) : array Read and parse a YAML configuration file
parseConnectionParams ( array | string $params, array $defaults = [] ) : array Parses params to valid connection parameters: - Defaults are merged into the params - Bolt keys are converted to Doctrine keys - Invalid keys are filtered out
parseContentType ( string $key, array $contentType, array $generalConfig ) : array Parse a single Contenttype configuration array.
parseContentTypes ( array $generalConfig ) : array Read and parse the contenttypes.yml configuration file.
parseDatabase ( array $options ) : array Parse and fine-tune the database configuration.
parseFieldsAndGroups ( array $fields, array $generalConfig ) : array Parse a Contenttype's filed and determine the grouping
parseGeneral ( ) : array Read and parse the config.yml and config_local.yml configuration files.
parseSqliteOptions ( array $config ) : array Fine-tune Sqlite configuration parameters.
parseTaxonomy ( ) : array Read and parse the taxonomy.yml configuration file.
parseTemplatefields ( ) This method pulls the templatefields config from the theme config and appends it to the contenttypes configuration.
parseTheme ( string $themePath, array $generalConfig ) : array Read and parse the current theme's config.yml configuration file.
saveCache ( )

Приватные методы

Метод Описание
checkTaxonomy ( ) : boolean Sanity check for slashes in in taxonomy slugs.
determineZone ( )
invalidateCache ( ) Invalidate (remove) the cache file.
isCacheValid ( ) : boolean Check if the cached config file exists, and is newer than the authoritative source.
isThemeCacheValid ( ) : boolean Check if the cache is still valid with theme file as well.
loadTheme ( ) Checks if cache is valid for theme; if not invalidate and load it.
parseFieldRepeaters ( array $fields, string $key ) : array Basic validation of repeater fields.

Описание методов

__construct() публичный Метод

public __construct ( Silex\Application $app )
$app Silex\Application

cacheConfig() публичный Метод

public cacheConfig ( boolean $force = false )
$force boolean

checkConfig() публичный Метод

Sanity checks for doubles in in contenttypes.
public checkConfig ( ) : boolean
Результат boolean

checkValidCache() защищенный Метод

Устаревший: Deprecated since 3.2, to be removed in 4.0.
protected checkValidCache ( )

doReplacements() публичный Метод

Replaces placeholders in config values %foo% will be resolved to $app['foo'] from the container
public doReplacements ( mixed $value = null ) : mixed
$value mixed
Результат mixed

get() публичный Метод

For example: $var = $config->get('general/wysiwyg/ck/contentsCss');
public get ( string $path, string | array | boolean $default = null ) : mixed
$path string
$default string | array | boolean
Результат mixed

getConfig() публичный Метод

Load the configuration from the various YML files.
public getConfig ( ) : array
Результат array

getCurrentTimestamp() публичный Метод

Get the current timestamp, corrected to the timezone.
public getCurrentTimestamp ( ) : string
Результат string Current timestamp

getDefaults() защищенный Метод

Assume sensible defaults for a number of options.
protected getDefaults ( )

getExceptions() публичный Метод

public getExceptions ( ) : array | null
Результат array | null

getFields() публичный Метод

A getter to access the fields manager.
public getFields ( ) : Manager
Результат Bolt\Storage\Field\Manager

getTimestamp() публичный Метод

Get a timestamp, corrected to the timezone.
public getTimestamp ( $when ) : string
Результат string Timestamp

getTwigPath() публичный Метод

Build an array of Twig paths.
public getTwigPath ( ) : string[]
Результат string[]

getWhichEnd() публичный Метод

Going forward, decisions determined by current request should be done in an app or route middleware. Application should be setup agnostic to the current request. Route middlewares apply only to a certain route or group of routes. See {@see \Bolt\Controller\Async\AsyncBase::before} for an example. App middlewares apply to all routes. See classes in \Bolt\EventListener for examples of these. These middlewares could also be filtered by checking for Zone inside of listener.
Устаревший: Deprecated since 3.0, to be removed in 4.0.
public getWhichEnd ( ) : string
Результат string

initialize() публичный Метод

public initialize ( )

loadCache() защищенный Метод

Attempt to load cached configuration files.
protected loadCache ( ) : array | null
Результат array | null

parseConfigYaml() защищенный Метод

Read and parse a YAML configuration file
protected parseConfigYaml ( string $filename, string $path = null ) : array
$filename string The name of the YAML file to read
$path string The (optional) path to the YAML file
Результат array

parseConnectionParams() защищенный Метод

Parses params to valid connection parameters: - Defaults are merged into the params - Bolt keys are converted to Doctrine keys - Invalid keys are filtered out
protected parseConnectionParams ( array | string $params, array $defaults = [] ) : array
$params array | string
$defaults array
Результат array

parseContentType() защищенный Метод

Parse a single Contenttype configuration array.
protected parseContentType ( string $key, array $contentType, array $generalConfig ) : array
$key string
$contentType array
$generalConfig array
Результат array

parseContentTypes() защищенный Метод

Read and parse the contenttypes.yml configuration file.
protected parseContentTypes ( array $generalConfig ) : array
$generalConfig array
Результат array

parseDatabase() защищенный Метод

Parse and fine-tune the database configuration.
protected parseDatabase ( array $options ) : array
$options array
Результат array

parseFieldsAndGroups() защищенный Метод

Parse a Contenttype's filed and determine the grouping
protected parseFieldsAndGroups ( array $fields, array $generalConfig ) : array
$fields array
$generalConfig array
Результат array

parseGeneral() защищенный Метод

Read and parse the config.yml and config_local.yml configuration files.
protected parseGeneral ( ) : array
Результат array

parseSqliteOptions() защищенный Метод

Fine-tune Sqlite configuration parameters.
protected parseSqliteOptions ( array $config ) : array
$config array
Результат array

parseTaxonomy() защищенный Метод

Read and parse the taxonomy.yml configuration file.
protected parseTaxonomy ( ) : array
Результат array

parseTemplatefields() защищенный Метод

This method pulls the templatefields config from the theme config and appends it to the contenttypes configuration.
protected parseTemplatefields ( )

parseTheme() защищенный Метод

Read and parse the current theme's config.yml configuration file.
protected parseTheme ( string $themePath, array $generalConfig ) : array
$themePath string
$generalConfig array
Результат array

saveCache() защищенный Метод

Устаревший: Deprecated since 3.2, to be removed in 4.0. Now handled in a listener.
protected saveCache ( )

set() публичный Метод

For example: $app['config']->set('general/branding/name', 'Bolt');
public set ( string $path, mixed $value ) : boolean
$path string
$value mixed
Результат boolean

setCKPath() публичный Метод

Устаревший: Deprecated since 3.3, to be removed in 4.0.
public setCKPath ( )

Описание свойств

$app защищенное свойство

protected Application,Silex $app
Результат Silex\Application

$cachetimestamp защищенное свойство

protected int $cachetimestamp
Результат integer

$data защищенное свойство

protected array $data
Результат array

$defaultConfig защищенное свойство

protected array $defaultConfig
Результат array

$fields публичное свойство

Will be made protected in Bolt 3.0.
public Manager,Bolt\Storage\Field $fields
Результат Bolt\Storage\Field\Manager

$notify_update публичное свойство

@deprecated Deprecated since 3.2, to be removed in 4.0
public bool $notify_update
Результат boolean

$reservedFieldNames защищенное свойство

protected array $reservedFieldNames
Результат array

$yamlParser защищенное свойство

protected Parser,Symfony\Component\Yaml $yamlParser
Результат Symfony\Component\Yaml\Parser