选择语言 :

Core_Config

配置程序核心类

API - Core_Config

author
呼吸二氧化碳 jonwang@myqee.com
category
MyQEE
package
System
subpackage
Core
copyright
Copyright © 2008-2013 myqee.com
license
http://www.myqee.com/license.html

$this->__construct( )


$this->set( $key , $value , $type = '', $auto_clear_cache = true)

保存一个配置,支持批量设置

参数列表

参数 类型 描述 默认值
$key string/array 关键字
$value fixed
$type string 类型,长度32以内 empty
$auto_clear_cache boolean 自动清除缓存 bool true
返回值
  • boolean

$this->get( $key , $type = '', $no_cache = false)

获取制定key的配置

参数列表

参数 类型 描述 默认值
$key string KEY
$type string 类型 empty
$no_cache boolean 是否允许使用缓存 设置true将直接从数据库中查询 bool false
返回值
  • fixed

$this->get_by_type( $type = '')

获取制定type的所有值

参数列表

参数 类型 描述 默认值
$type string $type empty
返回值
  • array

$this->delete( $key , $type = '')

删除制定key的配置,支持多个

参数列表

参数 类型 描述 默认值
$key string/array $key
$type string $type empty
返回值
  • boolean

$this->delete_type( $type = '')

删除制定type的所有数据

参数列表

参数 类型 描述 默认值
$type string $type empty

$this->reload( $from_db = true, $type = '')

重新加载配置

参数列表

参数 类型 描述 默认值
$from_db boolean 是否强制从数据库中读取,默认true bool true
$type string 类型 empty
返回值
  • Core_Config

$this->clear_cache( )

清除配置缓存

返回值
  • boolean

$this->set_use_cache( )

设置是否启用缓存模式


$this->get_config_cache_file( $project , $type = '')

获取配置文件路径

参数列表

参数 类型 描述 默认值
$project string $project
$type string $type empty
返回值
  • string

$this->data_format( $data )

格式化数据方式

参数列表

参数 类型 描述 默认值
$data fixed $data
返回值
  • string

$this->data_unformat( $data )

反解数据

参数列表

参数 类型 描述 默认值
$data string $data