horat1us / yii2-migration-bootstrap
Yii2 Migrations Bootstrap
Installs: 1 443
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=7.4
- yiisoft/yii2: ^2.0.40
Requires (Dev)
- horat1us/yii2-asset-free: ^1.0
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.7
This package is auto-updated.
Last update: 2024-10-30 01:48:22 UTC
README
This package provides \yii\base\BootstrapInterface
implementation to append packages migrations to console application.
Main purpose is to prevent mistakes while re-configuring console application.
Previous implementation was available in horat1us/yii2-base package as BootstrapMigrations trait.
Installation
Using packagist.org:
composer require horat1us/yii2-migration-bootstrap:^1.0
Structure
- BootstrapTrait - base implementation, can be used outside
\yii\base\BootstrapInterface
implementation. - Bootstrap -
yii\base\BootstrapInterface
implementation using BootstrapTrait
Example
Implement \yii\base\BootstrapInterface
in your yii2 package:
<?php namespace Package; use Horat1us\Yii; class Bootstrap extends Yii\Migration\Bootstrap { public $namespaces = __NAMESPACE__ . "\\Migrations"; public $aliases = ['Package' => '@vendor/developer/package/src']; }
Then add to application bootstraps:
<?php // config.php use Package; return [ 'bootstrap' => [ 'class' => Package\Bootstrap::class, ], // ... another application config ];