friendsofhyperf/config-anyway

Hyperf 的配置扩展。

v1.0.0-beta.1 2022-08-16 01:01 UTC

This package is auto-updated.

Last update: 2024-09-16 05:12:16 UTC


README

Latest Test Latest Stable Version Total Downloads GitHub license

安装

composer require friendsofhyperf/config-anyway

发布

php bin/hyperf.php vendor:publish friendsofhyperf/config-anyway

配置

// config/autoload/config_center.php
return [
    'drivers' => [
        'driver' => FriendsOfHyperf\ConfigAnyway\AnywayDriver::class,
        'mapping' => [
            'key1' => function() { return []; },
            'key2' => App\Source\ArrayHandler::class, // need __invoke()
            'key3' => [App\Source\ArrayHandler::class, '__invoke'],
        ],
    ]
];