Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move config to di instead of di-web #135

Merged
merged 9 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
['8.0', '8.1']
['8.0', '8.1', '8.2', '8.3']
2 changes: 1 addition & 1 deletion .github/workflows/composer-require-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.0']
['8.0', '8.1', '8.2', '8.3']
2 changes: 1 addition & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.1']
['8.3']
secrets:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
1 change: 0 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ jobs:
['ubuntu-latest']
php: >-
['8.0']

3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Yii Assets Change Log

## 4.1.0 under development
## 5.0.0 under development

- Chg #132: Move `di-web` configuration to `di` and allow to set publisher via parameters (@Gerych1984)
- Bug #123: `AssetManager` load empty `AssetBundle` when register wrong namespace bundle (@terabytesoftw)
- Enh #119, #129: Add debug collector for `yiisoft/yii-debug` (@xepozz, @vjik)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"config-plugin": {
"params": "params.php",
"di-web": "di-web.php"
"di": "di.php"
}
},
"config": {
Expand Down
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
Loading