jc-it / yii2-env-sync
一个帮助您在不同设备之间同步开发环境设置的 Yii2 模块。
v1.1.0
2024-08-12 10:07 UTC
Requires
- php: >=8.2
- gitonomy/gitlib: ^1.4.0
- league/flysystem: ^3.0.0
- spatie/db-dumper: ^3.6.0
- symfony/process: ^7.1.3
- yiisoft/yii2: ^2.0.48
Requires (Dev)
- captainhook/plugin-composer: ^5.3
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.2
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-strict-rules: ^1.1
- phpunit/phpunit: ^9.5
- ramsey/conventional-commits: ^1.3
- symfony/console: ^5.4.2
- symplify/easy-coding-standard: ^10.0
This package is auto-updated.
Last update: 2024-09-12 09:59:36 UTC
README
此扩展提供了一个实现通过外部存储在设备之间同步环境的模块的包。
$ composer require jc-it/yii2-env-sync
或者添加
"jc-it/yii2-env-sync": "^<latest version>"
到您的 composer.json
文件的 require
部分。
配置
要配置此模块,将其添加到您的配置文件中(最好是只添加到开发配置)。
'bootstrap' => ['dev-sync'], 'components' => [ 'db' => [ 'class' => \yii\db\Connection::class, ... ], 'externalStorageComponent' => function () { // Return a filesystem return new Filesystem(...); }, 'storageComponent1' => function () { // Return a filesystem return new Filesystem(...); }, ], 'modules' => [ 'env-sync' => [ 'class' => EnvSync::class, 'branch' => null, 'canSync' => YII_ENV_DEV, 'syncFilesystem' => 'externalStorageComponent', 'dbList' => [ // Map of name to component or configuration 'db' => 'db', ], 'fileSystems' => [ '/storage1' => 'storageComponent1', '/storage2' => new Filesystem(new LocalFilesystemAdapter(...)), ], 'user' => 'dev-user', ] ]
待办事项
- 修复 PHPStan,重新添加到
captainhook.json
-
{ "action": "vendor/bin/phpstan", "options": [], "conditions": [] },
-
- 添加测试
鸣谢
许可证
MIT 许可证 (MIT)。更多信息请参阅 LICENSE。