Download the PHP package lmz/hyperf-config without Composer

On this page you can find all versions of the php package lmz/hyperf-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hyperf-config

hyperf-config

composer require lmz/hyperf-config

主要的目前是为了加载 config/autoload 带文件夹的配置,官方提供的配置文件只读取.php配置文件,如果有同名的文件就会被覆盖。

使用方法:

config/autoload/dependencies.php添加,其他用法与官方一样

demo

config/autoload/demo/test.php 配置文件

官方结果:

本项目结果:

使用环境变量

根目录下有.env文件

PHASE 可以自定义如dev publish production rd

PHASE=devconfig/autoload 下面有一个 database.php ,可以新建 config/autoload/ 新建dev/database.php文件夹,系统会优先读取 config/autoload/dev/database.php 配置。

项目目的

1、为什么不使用.env解决问题

就拿数据库配置来说,目前我们有5个数据库集群,使用.env管理,就只能写成env('DB_HOST_1', '127.0.0.1') env('DB_HOST_2', '127.0.0.1')等,都写在.env里面会非常多配置

2、为什么不使用配置系统

新项目目前没有Apollo 阿里云 ACM 应用配置管理,开发环境调试比较麻烦

注意事项

  1. 应该在 .gitignore 里面加上 config/autoload/dev/* 目录,不允许提交到代码库上面
  2. 不允许子文件夹名与PHASE值同名,不会生效,如config/autoload/demo/dev/test.phpdev 文件夹不会被读取

All versions of hyperf-config with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
hyperf/contract Version ~2.2.0
hyperf/utils Version ~2.2.0
psr/container Version ^1.0|^2.0
symfony/finder Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lmz/hyperf-config contains the following files

Loading the files please wait ....