-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use 8x faster mysqldump fork #702
Changes from 2 commits
6eb1800
313b4c2
d565df6
c9e5bdb
fd8ef26
70d590c
40a5471
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
|
||
namespace lucatume\WPBrowser\WordPress\Database; | ||
|
||
use Druidfi\Mysqldump\Mysqldump; | ||
use Exception; | ||
use Ifsnop\Mysqldump\Mysqldump; | ||
use lucatume\WPBrowser\Utils\Db as DbUtil; | ||
use lucatume\WPBrowser\Utils\Serializer; | ||
use lucatume\WPBrowser\WordPress\DbException; | ||
|
@@ -330,14 +330,8 @@ public function import(string $dumpFilePath): int | |
public function dump(string $dumpFile): void | ||
{ | ||
try { | ||
$dump = new class($this->dsn, $this->dbUser, $this->dbPassword) extends Mysqldump { | ||
public function start($filename = '') | ||
{ | ||
$this->dumpSettings['add-drop-table'] = true; | ||
$this->dumpSettings['add-drop-database'] = true; | ||
return parent::start($filename); | ||
} | ||
}; | ||
$dumpSettings = ['add-drop-table'=> true, 'add-drop-database' => true]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will the composer-35.json file use the same source code? if so, this line here might need a if-class-exist or similar construct so it works with both Mysqldump implementations? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, v3.5 is transpiled from v4 and will use the same code. |
||
$dump = new Mysqldump($this->dsn, $this->dbUser, $this->dbPassword, $dumpSettings); | ||
$dump->start($dumpFile); | ||
} catch (\Exception $e) { | ||
throw new DbException("Failed to dump database: " . $e->getMessage(), DbException::FAILED_DUMP); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this dependency is requiring PHP 7.4+
is it fine to raise the min php version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 3.5 must be compatible with PHP 7.1 to 7.4, for this reason, the dependency cannot be changed.
It's fine to update
master
with the new solution, but 3.5 will have to keep the existing one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for pushing it over the finishing line