jc-it / yii2-env-sync
A Yii2 module that helps sync your dev environment settings between devices..
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-12-12 10:32:55 UTC
README
This extension provides a package that implements a module to sync environments between devices via an external storage.
$ composer require jc-it/yii2-env-sync
or add
"jc-it/yii2-env-sync": "^<latest version>"
to the require
section of your composer.json
file.
Configuration
To configure the module, add the module to your config file (preferably only in the Dev configuration).
'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', ] ]
TODO
- Fix PHPStan, re-add to
captainhook.json
-
{ "action": "vendor/bin/phpstan", "options": [], "conditions": [] },
-
- Add tests
Credits
License
The MIT License (MIT). Please see LICENSE for more information.