PHP 클래스 Webiny\Component\Config\Config

Ex1: $config = \Webiny\Components\Config\Config::getInstance()->ini('path/to/file.ini'); Ex2: $config = $this->config()->ini('path/to/file.ini');
상속: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\StdLib\SingletonTrait
파일 보기 프로젝트 열기: Webiny/Framework 1 사용 예제들

공개 메소드들

메소드 설명
ini ( string $resource, boolean $flushCache = false, boolean $useSections = true, string $nestDelimiter = '.' ) : ConfigObject Get Config object from INI file or string
json ( string $resource, boolean $flushCache = false ) : ConfigObject Get Config object from JSON file or string
parseResource ( array | ArrayObject | AbstractDriver $resource, boolean $flushCache = false ) : ConfigObject Parse resource and create a Config object A valid resource is a PHP array, ArrayObject or an instance of AbstractDriver
php ( array $resource, boolean $flushCache = false ) : ConfigObject Get Config object from PHP array
yaml ( string $resource, boolean $flushCache = false ) : ConfigObject Get ConfigObject from YAML file or string

메소드 상세

ini() 공개 메소드

Get Config object from INI file or string
public ini ( string $resource, boolean $flushCache = false, boolean $useSections = true, string $nestDelimiter = '.' ) : ConfigObject
$resource string Config resource in form of a file path or config string
$flushCache boolean Flush existing cache and load config file
$useSections boolean Default: true
$nestDelimiter string Delimiter for nested properties, ex: a.b.c or a-b-c
리턴 ConfigObject

json() 공개 메소드

Get Config object from JSON file or string
public json ( string $resource, boolean $flushCache = false ) : ConfigObject
$resource string Config resource in form of a file path or config string
$flushCache boolean Flush existing cache and load config file
리턴 ConfigObject

parseResource() 공개 메소드

Parse resource and create a Config object A valid resource is a PHP array, ArrayObject or an instance of AbstractDriver
public parseResource ( array | ArrayObject | AbstractDriver $resource, boolean $flushCache = false ) : ConfigObject
$resource array | Webiny\Component\StdLib\StdObject\ArrayObject\ArrayObject | Webiny\Component\Config\Drivers\AbstractDriver Config resource
$flushCache boolean Flush existing cache and load config file
리턴 ConfigObject

php() 공개 메소드

Get Config object from PHP array
public php ( array $resource, boolean $flushCache = false ) : ConfigObject
$resource array Config resource in form of a PHP array
$flushCache boolean Flush existing cache and create new config
리턴 ConfigObject

yaml() 공개 메소드

Get ConfigObject from YAML file or string
public yaml ( string $resource, boolean $flushCache = false ) : ConfigObject
$resource string Config resource in form of a file path or config string
$flushCache boolean Flush existing cache and load config file
리턴 ConfigObject