This commit is contained in:
2023-04-17 10:19:00 +08:00
parent 00b6d28196
commit e3d990077d
5 changed files with 10 additions and 45 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ use Exception;
use Kiri;
use Kiri\Di\LocalService;
use ReflectionException;
use Kiri\Error\{StdoutLogger, StdoutLoggerInterface};
use Kiri\Error\StdoutLogger;
use Kiri\Exception\{InitException};
use Psr\Log\LoggerInterface;
use Kiri\Events\EventProvider;
@@ -54,12 +54,12 @@ abstract class BaseMain extends Component
/**
* @param array $mapping
* @param array $components
* @throws ReflectionException
*/
public function mapping(array $mapping, array $components)
{
$di = Kiri::getDi();
$di->set(StdoutLoggerInterface::class, StdoutLogger::class);
$di->set(LoggerInterface::class, Logger::class);
$di->set(LoggerInterface::class, StdoutLogger::class);
foreach ($mapping as $interface => $class) {
$di->set($interface, $class);
}