Skip to content

Commit

Permalink
Move config to di instead of di-web
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerych1984 committed Jan 15, 2024
1 parent 49d57b2 commit 15d5140
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion config/di-web.php → config/di.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@

$assetManager = $assetManager
->withConverter($container->get(AssetConverterInterface::class))
->withPublisher($container->get(AssetPublisherInterface::class))
;

if ($params['yiisoft/assets']['assetManager']['publisher'] !== null) {
$assetManager = $assetManager->withPublisher(
$container->get($params['yiisoft/assets']['assetManager']['publisher'])
);
};

$assetManager->registerMany($params['yiisoft/assets']['assetManager']['register']);
return $assetManager;
},
Expand Down
2 changes: 2 additions & 0 deletions config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
declare(strict_types=1);

use Yiisoft\Assets\AssetLoaderInterface;
use Yiisoft\Assets\AssetPublisherInterface;
use Yiisoft\Assets\Debug\AssetCollector;
use Yiisoft\Assets\Debug\AssetLoaderInterfaceProxy;

Expand All @@ -28,6 +29,7 @@
'allowedBundleNames' => [],
'customizedBundles' => [],
'register' => [],
'publisher' => AssetPublisherInterface::class,
],
],

Expand Down
2 changes: 1 addition & 1 deletion tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private function getDiConfig(?array $params = null): array
if ($params === null) {
$params = $this->getParams();
}
return require dirname(__DIR__) . '/config/di-web.php';
return require dirname(__DIR__) . '/config/di.php';
}

private function getParams(): array
Expand Down

0 comments on commit 15d5140

Please sign in to comment.