database-dumper Allows to create backups of mysql database structure and data

  1. Requirements
  2. Usage
  3. Resources

Simple class to create DB backups

Requirements

Tested on 1.1.10.

Usage

  1. Download latest version from GitHub(Click "Download as zip")
  2. Extract yii-database-dumper to extensions directory
Yii::import('ext.yii-database-dumper.SDatabaseDumper');
$dumper = new SDatabaseDumper;

// Get path to new backup file
$file = Yii::getPathOfAlias('webroot.protected.backups').'/dump.sql';

// Gzip dump
if(function_exists('gzencode'))
    file_put_contents($file.'.gz', gzencode($dumper->getDump()));
else
    file_put_contents($file, $dumper->getDump());

Resources

8 0
15 followers
0 downloads
Yii Version: 1.1
License: MIT
Category: Database
Tags: backup, dump, MySQL
Developed by: kmdm
Created on: Apr 20, 2012
Last updated: 11 years ago

Related Extensions