Example #1
0
 /**
  * @param string $database
  * @param array  $excludeTables
  * @param string $target
  */
 protected function dumpDatabase($database, array $excludeTables, $target)
 {
     // structure
     Process::exec('mysqldump --defaults-extra-file={password_file} -v -h {host} -u {user} --quick --single-transaction --no-data {db} > {temp_sql_file}', ['{password_file}' => $this->connection['password_file'], '{host}' => $this->connection['host'], '{user}' => $this->connection['user'], '{db}' => $database, '{temp_sql_file}' => $target], [], $this->logger);
     // data
     Process::exec('mysqldump --defaults-extra-file={password_file} -v -h {host} -u {user} --quick --single-transaction --no-create-info {exclude_tables} {db} >> {temp_sql_file}', ['{password_file}' => $this->connection['password_file'], '{host}' => $this->connection['host'], '{user}' => $this->connection['user'], '{exclude_tables}' => $this->buildExcludeTablesArgument($database, $excludeTables), '{db}' => $database, '{temp_sql_file}' => $target], [], $this->logger);
 }
Example #2
0
 /**
  * @param string $database
  * @param array  $excludeTables
  * @param string $target
  */
 protected function dumpDatabase($database, array $excludeTables, $target)
 {
     // structure + tables
     Process::exec('pg_dump -v -w -h {host} -U {user} -d {db} {exclude_tables} > {temp_sql_file}', ['{host}' => $this->connection['host'], '{user}' => $this->connection['user'], '{db}' => $database, '{exclude_tables}' => $this->buildExcludeTablesArgument($excludeTables), '{temp_sql_file}' => $target], ['PGPASSFILE' => $this->connection['password_file']], $this->logger);
 }
Example #3
0
 /**
  * @param string $inputFile
  * @param string $outputFile
  */
 protected function encryptFile($inputFile, $outputFile)
 {
     Process::exec('gpg2 -v --encrypt {sign} --recipient {recipient} --batch --yes {passphrase} --output {output_file} {input_file}', ['{sign}' => $this->config['sign'] ? '--sign' : '', '{recipient}' => $this->config['recipient'], '{passphrase}' => $this->config['sign'] && $this->config['key_file'] ? '--passphrase-file ' . $this->config['key_file'] : '', '{input_file}' => $inputFile, '{output_file}' => $outputFile], [], $this->logger);
 }