PHP 클래스 Bolt\Config

저자: Bob den Otter, [email protected]
파일 보기 프로젝트 열기: bolt/bolt 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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

보호된 프로퍼티들

프로퍼티 타입 설명
$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