承接 jomisacu/configloader 相关项目开发

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

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

jomisacu/configloader

Composer 安装命令:

composer require jomisacu/configloader

包简介

A simple config system

README 文档

README

Provide a simple interface to handle configuration values.

Concepts

Config root directory

It's a place to store all configuration files under environments represented by sub directories.

Enviroment

A environment represents a directory into directory root.

By default the selected environment is ConfigLoader::ENV_PRODUCTION ("production"), to override this, you can put into config root directory a file named ENVIRONMENT.txt that contains a environment name, or, configure $_SERVER['ENVIRONMENT'] var through http server. For example, you can set this var on apache adding the line below:

# httpd.conf or .htaccess 
SetEnv ENVIRONMENT 'development'

Config file

A config file is a pure php file that contains an array named $config with the specific scope values. Example:

<?php // [config root dir]/[selected environment]/default.php file

$config['system_timezone'] = 'Americas/Santo_Domingo';

installation

php composer.phar require "jomisacu/configloader"

Usage

Use this package require atleast the below steps

  1. include
<?php

include "vendor/autoload.php";
  1. Create a instance
<?php

// for specific environment values.
// represents a sub directory on config files root directory
// it's a string and can exists any number of environments
$environment = \Jomisacu\ConfigLoader::ENV_DEVELOPMENT; 

// directory where resides configuration environments dirs
// -+ config (config root)
//	|-- development
//	|-- production
//	|-- testing
//	|-- qa
//	|-- example
//	|-- ... 
$configFilesRootDir = __DIR__ . '/config';

// configuration files to be loaded automatically
$autoloadFiles = ['default'];

$config = \Jomisacu\ConfigLoaderFactory::create($configFilesRootDir, $environment, $autoloadFiles);
   
  1. Access to configuration values
<?php

// ...

// load files
$config->load('default');

// via method call
echo $config->get('system_timezone') . "<br />";

// via magic method
echo $config->system_timezone . "<br />";

// ...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2017-04-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固