friendsofhyperf/config-anyway

Config extension for Hyperf.

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

This package is auto-updated.

Last update: 2024-11-16 05:37:02 UTC


README

Latest Test Latest Stable Version Total Downloads GitHub license

Installation

composer require friendsofhyperf/config-anyway

Publish

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

Configure

// 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'],
        ],
    ]
];