承接 azi/config 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

azi/config

Composer 安装命令:

composer require azi/config

包简介

Easy Configuration Management Library

README 文档

README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Easy Configuration Management Library

If you are writing a WordPress theme or a PHP application, most likely you will have some configuration values. The conventional approach involves creating a file with a bunch of variables and constants, then including every file in your script, which may not be the most intuitive way. Inspired by Laravel's elegant configuration handling, I developed Config to provide a similar experience for PHP projects, especially in the context of WordPress themes.

Installation

to install config in your project you just need to run this command

$ composer require azi/config

Up & Running

after installing config you will need to create a directory named config in root of your project where your composer.json lives in this directory you can store your configuration files. i.e database.php or site.php lets say you want to store your database configuration values here. you will have to follow the following steps.

  • create a file called database.php
  • return your configuration values form that file like
  return [
     'mysql' => [
       'host' => '127.0.0.1',
       'username' => 'root',
       'password' => 'secrete'
     ]
   ];
  • access the values from anywhere in your application like
   // will return 127.0.0.1
$host = Azi\Config::get('database.mysql.host');

// OR
$db = Azi\Config::get('database.mysql');
$host = $db->get('host');
$username = $db->get('username');
$password = $db->get('password');

with this package you will also get a little helper function to access values you can also write the above code like this

  // will return 127.0.0.1
  $host = config('database.mysql.host');

Contributers

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固