arcanum/parameter-tree 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

arcanum/parameter-tree

最新稳定版本:2.0.1

Composer 安装命令:

composer require arcanum/parameter-tree

包简介

Namespaced accessors for multi-dimensional trees of parameters (such as POST/GET, config, etc)

README 文档

README

ParameterTree is a multi-dimensional, namespaced parameter bag simplifying access to multidimensional arrays (such as configs, GET/POST/SESSION params, etc), with default return values and typecasting.

Basic Usage

$dbConfig = new ParameterTree(
    [   
        "master"=>[
            "host"=>"db.com",
            "user"=>"DB-DUDE",
            "pass"=>"super-secret123",
            "port"=>"3306"
        ]
    ]
);
echo $dbConfig->get("master.host","localhost"); //db.com
echo $dbConfig->get("slave.host","localhost"); //localhost
var_dump($dbConfig->hasKey("master.host")); //true
var_dump($dbConfig->hasKey("master.soup")); //false
$dbConfig->set("slave.pass","abc123");
var_dump($config->toArray()); // ["master"=>["host"=>"db.com","user"=>"DB-DUDE","pass"=>"super-secret123","port"=>"3306],"slave"=>["pass"=>"abc123"]]

License

ParameterTree is open-sourced software licensed under the MIT license

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-20