This is a php version of linux's mysqldump in terminal "$ mysqldump -u username -p...".
- PHP 5 >= 5.1.0
- PECL pdo >= 0.2.0
<?php
$dumpSettings = array(
'include-tables' => array('table1', 'table2'),
'exclude-tables' => array('users', 'records'),
'compress' => 'GZIP',
'no-data' => false,
'add-drop-table' => false,
'single-transaction' => true,
'lock-tables' => false,
'add-locks' => true,
'extended-insert' => true
);
$dump = new Mysqldump('clouddueling', 'root', 'root', 'localhost', 'mysql', $dumpSettings);
$dump->start('storage/work/dump.sql');
- include-tables
- Only include these tables.
- exclude-tables
- Exclude these tables.
- compress
- GZIP, BZIP2, NONE
- no-data
- http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_no-data
- add-drop-table
- http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_add-drop-table
- single-transaction
- http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_single-transaction
- lock-tables
- http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_lock-tables
- add-locks
- http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_add-locks
- extended-insert
- http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_extended-insert
The Laravel framework is open-sourced software licensed under the MIT license
Originally written by James Elliott in 2009 but has since been almost entirely rewritten and improved upon. http://code.google.com/p/db-mysqldump/
- Replace public extend() with array_merge_recursive()