\thinkConfig

Summary

Methods
Properties
Constants
setDefaultPrefix()
parse()
load()
has()
pull()
get()
set()
remove()
reset()
__set()
__get()
__isset()
offsetSet()
offsetExists()
offsetUnset()
offsetGet()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$config
$prefix
N/A

Properties

$config

$config : array

配置参数

Type

array

$prefix

$prefix : string

配置前缀

Type

string

Methods

setDefaultPrefix()

setDefaultPrefix(string  $prefix) : void

设置配置参数默认前缀

Parameters

string $prefix

前缀

parse()

parse(string  $config, string  $type = '', string  $name = '') : mixed

解析配置文件或内容

Parameters

string $config

配置文件路径或内容

string $type

配置解析类型

string $name

配置名(如设置即表示二级配置)

Returns

mixed

load()

load(string  $file, string  $name = '') : mixed

加载配置文件(多种格式)

Parameters

string $file

配置文件名

string $name

一级配置名

Returns

mixed

has()

has(string  $name) : boolean

检测配置是否存在

Parameters

string $name

配置参数名(支持多级配置 .号分割)

Returns

boolean

pull()

pull(string  $name) : array

获取一级配置

Parameters

string $name

一级配置名

Returns

array

get()

get(string  $name = null, mixed  $default = null) : mixed

获取配置参数 为空则获取所有配置

Parameters

string $name

配置参数名(支持多级配置 .号分割)

mixed $default

默认值

Returns

mixed

set()

set(string|array  $name, mixed  $value = null) : mixed

设置配置参数 name为数组则为批量设置

Parameters

string|array $name

配置参数名(支持三级配置 .号分割)

mixed $value

配置值

Returns

mixed

remove()

remove(string  $name) : void

移除配置

Parameters

string $name

配置参数名(支持三级配置 .号分割)

reset()

reset(string  $prefix = '') : void

重置配置参数

Parameters

string $prefix

配置前缀名

__set()

__set(string  $name, mixed  $value) 

设置配置

Parameters

string $name

参数名

mixed $value

__get()

__get(string  $name) : mixed

获取配置参数

Parameters

string $name

参数名

Returns

mixed

__isset()

__isset(string  $name) : boolean

检测是否存在参数

Parameters

string $name

参数名

Returns

boolean

offsetSet()

offsetSet(  $name,   $value) 

Parameters

$name
$value

offsetExists()

offsetExists(  $name) 

Parameters

$name

offsetUnset()

offsetUnset(  $name) 

Parameters

$name

offsetGet()

offsetGet(  $name) 

Parameters

$name