dev-master
9999999-devdump db for Yii2
BSD-3-Clause
The Requires
by fadeevms
yii dump
dump db for Yii2
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
php composer.phar require --prefer-dist fadeevms/yii2-dump-db "*"
or add, (*3)
"fadeevms/yii2-dump-db": "*"
to the require section of your composer.json., (*4)
To use this extension, simply add the following code in your application configuration:, (*5)
'components' => [ ... 'dumper' => [ 'class' => 'fadeevms\dump\dumpDB', ], ... ],
Usage:, (*6)
$dumper = \Yii::$app->dumper; echo $dumper->getDump();
Saving the dump to a file:, (*7)
$dumper = \Yii::$app->dumper; $bk_file = 'FILE_NAME-'.date('YmdHis').'.sql'; $fh = fopen($bk_file, 'w') or die("can't open file"); fwrite($fh, $dumper->getDump(FALSE)); fclose($fh);
Dumping external DB:, (*8)
$dumper = new \fadeevms\dump\dumpDB('mysql:host=HOTS_NAME_OR_IP;dbname=DATABASE_NAME','USERNAME','PASSWORD'); $dumper->setRemoveViewDefinerSecurity(TRUE); echo $dumper->getDump();
dump db for Yii2
BSD-3-Clause
yii dump