-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.php
executable file
·49 lines (41 loc) · 1.13 KB
/
demo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
ini_set('memory_limit', '-1');
include ('dumper.php');
try {
$world_dumper = Shuttle_Dumper::create(array(
'host' => '',
'username' => 'root',
'password' => '',
'db_name' => 'world',
));
// dump the database to gzipped file
$world_dumper->dump('world.sql.gz');
// dump the database to plain text file
$world_dumper->dump('world.sql');
$wp_dumper = Shuttle_Dumper::create(array(
'host' => '',
'username' => 'root',
'password' => '',
'db_name' => 'wordpress',
));
// Dump only the tables with wp_ prefix
$wp_dumper->dump('wordpress.sql', 'wp_');
$countries_dumper = Shuttle_Dumper::create(array(
'host' => '',
'username' => 'root',
'password' => '',
'db_name' => 'world',
'include_tables' => array('country', 'city'), // only include those tables
));
$countries_dumper->dump('world.sql.gz');
$world_dumper = Shuttle_Dumper::create(array(
'host' => '',
'username' => 'root',
'password' => '',
'db_name' => 'world',
'exclude_tables' => array('city'),
));
$world_dumper->dump('world-no-cities.sql.gz');
} catch(Shuttle_Exception $e) {
echo "Couldn't dump database: " . $e->getMessage();
}