f2/common
Composer 安装命令:
composer require f2/common
包简介
Provides shared functionality and exception classes for F2 libraries.
README 文档
README
This library is used by other f2/*-libraries for basic things such as configuration discovery, common exception classes and performance optimizations.
F2::events(): F2\Common\Contracts\EventServiceInterface
Provides the central event dispatcher:
Listening for events
F2::events()->on('some_event_name', function(F2\Common\Contracts\EventInterface $event) {});
Un-listening
F2::events()->off('some_event_name', $handler);
Emitting events
F2::events()->emit(new F2\Common\Event('some_event_name', ['some' => 'data']));
F2::config(string $configName, $defaultValue = null): mixed
Retrieve a configuration value from these sources in order:
$GLOBALS['f2']['config'][$configName]F2::config()->env($configName)$GLOBALS['f2']['config']['defaults'][$configName]Config defaults provided by Manifest classes.
F2::env(string $name): string
Retrieve a configuration value from the environment. Will load a .env file from the project root. If a value is not found, it will load default.env from project root and check for the value there.
统计信息
- 总下载量: 95
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-06