定制 bravo3/properties 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bravo3/properties

最新稳定版本:1.0.2

Composer 安装命令:

composer require bravo3/properties

包简介

YAML property loader

README 文档

README

This property loader is designed for unit testing and uses the singleton design pattern to achieve this. Consider a dependency injection container if you wanted a property loader for the main application.

Usage

Conf::init('/path');
$c = Conf::getInstance();
$property = $c['some.property'];

or simply -

Conf::init('/path');
$property = Conf::get('some.property');

Defaults can be used here too -

$property = Conf::get('some.property', 'default value');

Config File

The path in the init line should point to where the properties.yml file should be, if the properties.yml file isn't present, it will look for a properties.yml.dist file. You can change the properties filename with the init functions second parameter.

Properties

YAML arrays are delimited in the property key using periods.

properties.yml:

some:
    property: hello world

Code:

echo Conf::get('some.property');   // hello world

统计信息

  • 总下载量: 7.52k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-05-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固