2017 © Pedro Peláez
 

yii2-extension yii2-dump-db

dump db for Yii2

image

fadeevms/yii2-dump-db

dump db for Yii2

  • Wednesday, November 5, 2014
  • by fadeevms
  • Repository
  • 0 Watchers
  • 0 Stars
  • 272 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 15 % Grown

The README.md

Yii2 extension that allows to create backups of mysql database (structure and data)

Installation

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();

The Versions

05/11 2014

dev-master

9999999-dev

dump db for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

by Avatar fadeevms

yii dump