定制 hamoda-dev/configure 二次开发

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

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

hamoda-dev/configure

Composer 安装命令:

composer require hamoda-dev/configure

包简介

Configuration PHP Library

README 文档

README

PHP Configuration library. Use to get all your app configuration from files for diffrent enviroment { development, prodection, ...} It's Easy to use just a few steps to done with it

installtion

install via composer :

composer require hamoda-dev/configure

Configurations

1 - copy this to your composer.json file

"scripts": {
        "configure-init": [
            "cp -r -d vendor/hamoda-dev/configure/sample/config config",
            "cp -r vendor/hamoda-dev/configure/sample/configure.json configure.json"
        ]
}

2 - run this command in your project to create config directory & configure.json

    composer run-script configure-init

now you have config directory and configure.json

Config Directory

containe to directory { development, production }

  • inside development put your development configuration files
  • inside production put your production configuration files

you can switch betwen the environments in the configure.json file

configure.json
{
  "config_path" : "config",
  "environment" : "development"
}

in "environment" : "here you switching environment" => develoment or production

Syntax

<?php

    return [
        'app_url' => 'http://localhost',
        'mysql' => [
            'driver' => 'mysql',
            'url' => '',
            'host' => '127.0.0.1',
            'port' => '3306',
            'database' => 'forge',
            'username' => 'root',
            'password' => '',
            'unix_socket' => '',
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
        ]

Uesge

you can access all your configuration via config($parm) . Accept one parametr = config that you need it

from previus syntax example config('app_url') the output shuld be : http://localhost if you need to deeper value just use . betwen the keys config('mysql.host') the output shuld be : 127.0.0.1

You Can Add Any Number of configuration files an access it very easy

Enjoy :)

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-08-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固