@@ 66-76 (lines=11) @@ | ||
63 | * |
|
64 | * @return boolean |
|
65 | */ |
|
66 | public function restore($filepath) |
|
67 | { |
|
68 | $command = sprintf('%s%s -f %s %s', |
|
69 | $this->getRestoreCommand(), |
|
70 | self::ENGINE_RESTORE_PROCESS, |
|
71 | escapeshellarg($filepath), |
|
72 | escapeshellarg($this->getDatabase()) |
|
73 | ); |
|
74 | ||
75 | return $this->getBackupProcess()->run($command, __FUNCTION__); |
|
76 | } |
|
77 | ||
78 | } |
@@ 47-59 (lines=13) @@ | ||
44 | * |
|
45 | * @return boolean |
|
46 | */ |
|
47 | public function export($filepath) |
|
48 | { |
|
49 | $command = sprintf( |
|
50 | '%s%s -E -S %s –Q "BACKUP DATABASE %s TO DISK=\'%s\'"', |
|
51 | $this->getExportCommand(), |
|
52 | self::ENGINE_RESTORE_PROCESS, |
|
53 | escapeshellarg($this->getHostname()), |
|
54 | escapeshellarg($this->getDatabase()), |
|
55 | escapeshellarg($filepath) |
|
56 | ); |
|
57 | ||
58 | return $this->getBackupProcess()->run($command, __FUNCTION__); |
|
59 | } |
|
60 | ||
61 | /** |
|
62 | * Restore the database from a file path. |
|
@@ 68-79 (lines=12) @@ | ||
65 | * |
|
66 | * @return boolean |
|
67 | */ |
|
68 | public function restore($filepath) |
|
69 | { |
|
70 | $command = sprintf('%s%s -E -S %s –Q "RESTORE DATABASE %s FROM DISK=\'%s\'"', |
|
71 | $this->getRestoreCommand(), |
|
72 | self::ENGINE_RESTORE_PROCESS, |
|
73 | escapeshellarg($this->getHostname()), |
|
74 | escapeshellarg($this->getDatabase()), |
|
75 | escapeshellarg($filepath) |
|
76 | ); |
|
77 | ||
78 | return $this->getBackupProcess()->run($command, __FUNCTION__); |
|
79 | } |
|
80 | ||
81 | } |