mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Merge pull request #614 from huangzhhui/config-provider
Changed the structure of config provider
This commit is contained in:
commit
aebefbcff4
23
CHANGELOG.md
23
CHANGELOG.md
@ -40,6 +40,29 @@ return ApplicationContext::setContainer($container);
|
||||
|
||||
- [#486](https://github.com/hyperf-cloud/hyperf/pull/486) Changed `getParsedBody` of Request is available to return JSON formatted data normally.
|
||||
- [#523](https://github.com/hyperf-cloud/hyperf/pull/523) The command `db:model` will generate the singular class name of an plural table as default.
|
||||
- [#614](https://github.com/hyperf-cloud/hyperf/pull/614) Changed the structure of config provider, also moved `config/dependencies.php` to `config/autoload/dependencies.php`, also you could place `dependencies` into config/config.php.
|
||||
|
||||
Changed the structure of config provider:
|
||||
Before:
|
||||
```php
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
'collectors' => [],
|
||||
],
|
||||
```
|
||||
Now:
|
||||
```php
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
'collectors' => [],
|
||||
],
|
||||
],
|
||||
```
|
||||
|
||||
## Deleted
|
||||
|
||||
|
@ -25,11 +25,11 @@ class ConfigProvider
|
||||
Packer::class => JsonPacker::class,
|
||||
Consumer::class => ConsumerFactory::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
16
src/cache/src/ConfigProvider.php
vendored
16
src/cache/src/ConfigProvider.php
vendored
@ -22,15 +22,15 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
CacheInterface::class => Cache::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
'collectors' => [
|
||||
CacheListenerCollector::class,
|
||||
]
|
||||
],
|
||||
'collectors' => [
|
||||
CacheListenerCollector::class,
|
||||
]
|
||||
],
|
||||
'publish' => [
|
||||
[
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -20,9 +20,11 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
ClientInterface::class => Client::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -20,9 +20,11 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
ClientInterface::class => ClientFactory::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -20,11 +20,12 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
ClientInterface::class => Client::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -22,9 +22,11 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
ConfigInterface::class => ConfigFactory::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -49,7 +49,7 @@ class ProviderConfig
|
||||
protected static function loadProviders(array $providers): array
|
||||
{
|
||||
$providerConfigs = [];
|
||||
foreach ($providers ?? [] as $provider) {
|
||||
foreach ($providers as $provider) {
|
||||
if (is_string($provider) && class_exists($provider) && method_exists($provider, '__invoke')) {
|
||||
$providerConfigs[] = (new $provider())();
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ class ProviderConfigTest extends TestCase
|
||||
|
||||
$dependencies = $res['dependencies'];
|
||||
$commands = $res['commands'];
|
||||
$scanPaths = $res['scan']['paths'];
|
||||
$scanPaths = $res['annotations']['scan']['paths'];
|
||||
$publish = $res['publish'];
|
||||
$listeners = $res['listeners'];
|
||||
|
||||
|
@ -17,12 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [],
|
||||
'collectors' => [
|
||||
ConstantsCollector::class,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'collectors' => [
|
||||
ConstantsCollector::class,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -17,12 +17,6 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
[
|
||||
'id' => 'config',
|
||||
|
@ -29,9 +29,11 @@ class ConfigProvider
|
||||
CrontabRegisterListener::class,
|
||||
OnPipeMessageListener::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -50,9 +50,11 @@ class ConfigProvider
|
||||
RollbackCommand::class,
|
||||
StatusCommand::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke()
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -31,13 +31,15 @@ class ConfigProvider
|
||||
'listeners' => [
|
||||
BootApplicationListener::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
'collectors' => [
|
||||
AnnotationCollector::class,
|
||||
AspectCollector::class,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
'collectors' => [
|
||||
AnnotationCollector::class,
|
||||
AspectCollector::class,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -48,22 +48,33 @@ class DefinitionSourceFactory
|
||||
}
|
||||
|
||||
$serverDependencies = $configFromProviders['dependencies'] ?? [];
|
||||
if (file_exists($configDir . '/dependencies.php')) {
|
||||
$definitions = include $configDir . '/dependencies.php';
|
||||
if (file_exists($configDir . '/autoload/dependencies.php')) {
|
||||
$definitions = include $configDir . '/autoload/dependencies.php';
|
||||
$serverDependencies = array_replace($serverDependencies, $definitions['dependencies'] ?? []);
|
||||
}
|
||||
|
||||
$scanDirs = $configFromProviders['scan']['paths'] ?? [];
|
||||
$ignoreAnnotations = [];
|
||||
$collectors = $configFromProviders['scan']['collectors'] ?? [];
|
||||
$scanDirs = $configFromProviders['annotations']['scan']['paths'] ?? [];
|
||||
$ignoreAnnotations = $configFromProviders['annotations']['scan']['ignore_annotations'] ?? [];
|
||||
$collectors = $configFromProviders['annotations']['scan']['collectors'] ?? [];
|
||||
|
||||
// Load the config/autoload/annotations.php and merge the config
|
||||
if (file_exists($configDir . '/autoload/annotations.php')) {
|
||||
$annotations = include $configDir . '/autoload/annotations.php';
|
||||
$scanDirs = array_merge($scanDirs, $annotations['scan']['paths'] ?? []);
|
||||
$ignoreAnnotations = $annotations['scan']['ignore_annotations'] ?? [];
|
||||
$ignoreAnnotations = array_merge($ignoreAnnotations, $annotations['scan']['ignore_annotations'] ?? []);
|
||||
$collectors = array_merge($collectors, $annotations['scan']['collectors'] ?? []);
|
||||
}
|
||||
|
||||
// Load the config/config.php and merge the config
|
||||
if (file_exists($configDir . '/config.php')) {
|
||||
$configContent = include $configDir . '/config.php';
|
||||
if (isset($configContent['annotations'])) {
|
||||
$scanDirs = array_merge($scanDirs, $configContent['annotations']['scan']['paths'] ?? []);
|
||||
$ignoreAnnotations = array_merge($ignoreAnnotations, $configContent['annotations']['scan']['ignore_annotations'] ?? []);
|
||||
$collectors = array_merge($collectors, $configContent['annotations']['scan']['collectors'] ?? []);
|
||||
}
|
||||
}
|
||||
|
||||
$scanConfig = new ScanConfig($scanDirs, $ignoreAnnotations, $collectors);
|
||||
|
||||
return new DefinitionSource($serverDependencies, $scanConfig, $this->enableCache);
|
||||
|
@ -17,11 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -20,11 +20,11 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
KVInterface::class => KVFactory::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -24,9 +24,11 @@ class ConfigProvider
|
||||
ListenerProviderInterface::class => ListenerProviderFactory::class,
|
||||
EventDispatcherInterface::class => EventDispatcherFactory::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -32,9 +32,11 @@ class ConfigProviderTest extends TestCase
|
||||
ListenerProviderInterface::class => ListenerProviderFactory::class,
|
||||
EventDispatcherInterface::class => EventDispatcherFactory::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
str_replace('/tests', '/src', __DIR__),
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
str_replace('/tests', '/src', __DIR__),
|
||||
],
|
||||
],
|
||||
],
|
||||
], (new ConfigProvider())());
|
||||
|
@ -23,11 +23,11 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
FormatterInterface::class => DefaultFormatter::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -25,9 +25,11 @@ class ConfigProvider
|
||||
ApplicationInterface::class => ApplicationFactory::class,
|
||||
StdoutLoggerInterface::class => StdoutLogger::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -39,9 +39,11 @@ class ConfigProvider
|
||||
AuthorizationServiceInterface::class => FailAuthorizationService::class,
|
||||
NamingStrategyInterface::class => NamingStrategy::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -16,13 +16,6 @@ class ConfigProvider
|
||||
{
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
],
|
||||
],
|
||||
];
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -26,11 +26,11 @@ class ConfigProvider
|
||||
ServerRequestInterface::class => Request::class,
|
||||
ResponseInterface::class => Response::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -24,8 +24,6 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
DataFormatter::class => DataFormatterFactory::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'listeners' => [
|
||||
RegisterProtocolListener::class,
|
||||
value(function () {
|
||||
@ -35,9 +33,11 @@ class ConfigProvider
|
||||
return null;
|
||||
}),
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -16,15 +16,6 @@ class ConfigProvider
|
||||
{
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
],
|
||||
'publish' => [
|
||||
],
|
||||
];
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -26,13 +26,11 @@ class ConfigProviderTest extends TestCase
|
||||
$dir = str_replace('/tests', '/src', __DIR__);
|
||||
|
||||
$this->assertSame([
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
$dir,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
$dir,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -17,10 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -19,16 +19,14 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
'collectors' => [
|
||||
ListenerCollector::class,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
'collectors' => [
|
||||
ListenerCollector::class,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -25,15 +25,10 @@ class ConfigProvider
|
||||
PaginatorInterface::class => Paginator::class,
|
||||
LengthAwarePaginatorInterface::class => LengthAwarePaginator::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'listeners' => [
|
||||
PageResolverListener::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -20,11 +20,11 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
\Redis::class => Redis::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -19,16 +19,14 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'listeners' => [
|
||||
AddConsumerDefinitionListener::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -12,7 +12,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Hyperf\RpcServer;
|
||||
|
||||
use Hyperf\Dispatcher\AbstractDispatcher;
|
||||
use Hyperf\Dispatcher\HttpDispatcher;
|
||||
use Hyperf\Dispatcher\HttpRequestHandler;
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
@ -23,14 +23,14 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
SwooleServer::class => SwooleServerFactory::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'listeners' => [
|
||||
InitProcessTitleListener::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -23,11 +23,11 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
ConsulAgent::class => ConsulAgentFactory::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -19,15 +19,9 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
GenCommand::class,
|
||||
],
|
||||
'scan' => [
|
||||
],
|
||||
'publish' => [
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -16,15 +16,6 @@ class ConfigProvider
|
||||
{
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
],
|
||||
],
|
||||
];
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -17,18 +17,16 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'listeners' => [
|
||||
Listener\InitServerListener::class,
|
||||
Listener\OnFinishListener::class,
|
||||
Listener\OnTaskListener::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -25,11 +25,11 @@ class ConfigProvider
|
||||
SwitchManager::class => SwitchManagerFactory::class,
|
||||
Client::class => Client::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -24,9 +24,11 @@ class ConfigProvider
|
||||
TranslatorLoaderInterface::class => FileLoaderFactory::class,
|
||||
TranslatorInterface::class => TranslatorFactory::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -20,11 +20,11 @@ class ConfigProvider
|
||||
'dependencies' => [
|
||||
RenderInterface::class => Render::class,
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
'publish' => [
|
||||
|
@ -17,13 +17,11 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -17,15 +17,15 @@ class ConfigProvider
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'listeners' => [
|
||||
Listener\InitSenderListener::class,
|
||||
Listener\OnPipeMessageListener::class,
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
'annotations' => [
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user