Skip to content

Commit 27eceb0

Browse files
author
Sebastian Feldmann
committed
Merge branch 'master' into 5.1
2 parents ee7eb62 + 78dcf2c commit 27eceb0

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

build/phar-manifest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
"kunalvarma05/dropbox-php-sdk",
2929
"phpseclib/phpseclib",
3030
"softlayer/objectstorage",
31-
"vlucas/phpdotenv"
31+
"vlucas/phpdotenv",
32+
"google/apiclient",
33+
"php-opencloud/openstack"
3234
])) {
3335
continue;
3436
}

doc/config/source/mysqldump.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"compress": true,
1616
"extendedInsert": true,
1717
"hexBlob": true,
18+
"routines": true,
1819
"gtidPurged": "AUTO",
1920
"pathToMysqldump": "/path/to/custom/bin"
2021
}

doc/config/source/mysqldump.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
<!-- optional, default=false -->
4343
<option name="hexBlob" value="true" />
4444

45+
<!-- optional, default=false -->
46+
<option name="routines" value="true" />
47+
4548
<!-- optional, default=none, accepted=ON,OFF,AUTO -->
4649
<option name="gtidPurged" value="ON" />
4750

src/Backup/Source/Mysqldump.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,20 @@ class Mysqldump extends SimulatorExecutable implements Simulator
155155

156156
/**
157157
* Add general transaction id statement.
158-
* --set-gids-purged
158+
* --set-gids-purged=['ON', 'OFF', 'AUTO']
159159
*
160160
* @var string
161161
*/
162162
private $gtidPurged;
163163

164+
/**
165+
* Dump procedures and functions.
166+
* --routines
167+
*
168+
* @var bool
169+
*/
170+
private $routines;
171+
164172
/**
165173
* Setup.
166174
*
@@ -186,6 +194,7 @@ public function setup(array $conf = [])
186194
$this->extendedInsert = Util\Str::toBoolean(Util\Arr::getValue($conf, 'extendedInsert', ''), false);
187195
$this->noData = Util\Str::toBoolean(Util\Arr::getValue($conf, 'noData', ''), false);
188196
$this->filePerTable = Util\Str::toBoolean(Util\Arr::getValue($conf, 'filePerTable', ''), false);
197+
$this->routines = Util\Str::toBoolean(Util\Arr::getValue($conf, 'routines', ''), false);
189198

190199
// this doesn't fail, but it doesn't work, so throw an exception so the user understands
191200
if ($this->filePerTable && count($this->structureOnly)) {
@@ -259,6 +268,7 @@ protected function createExecutable(Target $target) : Executable
259268
->ignoreTables($this->ignoreTables)
260269
->produceFilePerTable($this->filePerTable)
261270
->dumpNoData($this->noData)
271+
->dumpRoutines($this->routines)
262272
->dumpStructureOnly($this->structureOnly)
263273
->dumpTo($this->getDumpTarget($target));
264274
// if compression is active and commands can be piped

src/Cli/Executable/Mysqldump.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ class Mysqldump extends Abstraction implements Executable
156156
*/
157157
private $hexBlob = false;
158158

159+
/**
160+
* Dump routines.
161+
* --routines
162+
*
163+
* @var boolean
164+
*/
165+
private $routines = false;
166+
159167
/**
160168
* Path to dump file
161169
*
@@ -375,6 +383,18 @@ public function produceFilePerTable(bool $bool) : Mysqldump
375383
return $this;
376384
}
377385

386+
/**
387+
* Dump procedures and functions.
388+
*
389+
* @param bool $bool
390+
* @return \phpbu\App\Cli\Executable\Mysqldump
391+
*/
392+
public function dumpRoutines(bool $bool) : Mysqldump
393+
{
394+
$this->routines = $bool;
395+
return $this;
396+
}
397+
378398
/**
379399
* Pipe compressor.
380400
*
@@ -421,6 +441,7 @@ protected function createCommandLine() : CommandLine
421441
$cmd->addOptionIfNotEmpty('-e', $this->extendedInsert, false);
422442
$cmd->addOptionIfNotEmpty('--hex-blob', $this->hexBlob, false);
423443
$cmd->addOptionIfNotEmpty('--set-gtid-purged', $this->gtidPurged);
444+
$cmd->addOptionIfNotEmpty('--routines', $this->routines, false);
424445

425446
$this->configureSourceData($cmd);
426447
$this->configureIgnoredTables($cmd);

0 commit comments

Comments
 (0)