From: Dan Brown Date: Tue, 11 Mar 2025 16:53:32 +0000 (+0000) Subject: Altered mysql config passing, fixed some test issues X-Git-Url: http://source.bookstackapp.com/system-cli/commitdiff_plain/f9c8d259a9b7cac86b4b5e878e5ee95e545fb172 Altered mysql config passing, fixed some test issues Switched mysql config file use to be an extra file, so that existing system config files can be considered instead of being ignored. Does mean that user config files could take precedance, but hopefully that should not be a big concern. --- diff --git a/composer.lock b/composer.lock index df6d1d1..3cc8538 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4f9274d16374a47807601a331304aaae", + "content-hash": "dfedeb5644f1db57e37ec243b28033ee", "packages": [ { "name": "graham-campbell/result-type", diff --git a/src/Services/MySqlRunner.php b/src/Services/MySqlRunner.php index a3e1033..d83f446 100644 --- a/src/Services/MySqlRunner.php +++ b/src/Services/MySqlRunner.php @@ -52,7 +52,7 @@ class MySqlRunner ->withTimeout(300) ->withIdleTimeout(300) ->runCapturingStdErr([ - "--defaults-file={$optionsFile}", + "--defaults-extra-file={$optionsFile}", $this->database, '-e', "show tables;" ]); @@ -74,7 +74,7 @@ class MySqlRunner ->withTimeout(300) ->withIdleTimeout(300) ->runCapturingStdErr([ - "--defaults-file={$optionsFile}", + "--defaults-extra-file={$optionsFile}", $this->database, '-e', "source {$sqlFilePath}" ]); @@ -122,7 +122,7 @@ HEREDOC; ->withIdleTimeout(300) ->withAdditionalPathLocation('C:\xampp\mysql\bin') ->runWithoutOutputCallbacks([ - "--defaults-file={$optionsFile}", + "--defaults-extra-file={$optionsFile}", '--single-transaction', '--no-tablespaces', $this->database, diff --git a/tests/Commands/DownloadVendorCommandTest.php b/tests/Commands/DownloadVendorCommandTest.php index 6bd3a04..cc5e730 100644 --- a/tests/Commands/DownloadVendorCommandTest.php +++ b/tests/Commands/DownloadVendorCommandTest.php @@ -1,6 +1,6 @@ withOwnBookStackFolder(function (string $basePath) { exec("rm -rf $basePath/vendor"); file_put_contents("$basePath/version", 'v25.02'); - mkdir("$basePath/dev/checksums", '0777', true); + mkdir("$basePath/dev/checksums", 0777, true); file_put_contents("$basePath/dev/checksums/vendor", '22e02ee72d21ff719c1073abbec8302f8e2096ba6d072e133051064ed24b45b1'); $this->assertDirectoryDoesNotExist("$basePath/vendor"); @@ -33,7 +33,7 @@ class DownloadVendorCommandTest extends TestCase exec("rm -rf $basePath/vendor"); file_put_contents("$basePath/version", 'v25.02'); - mkdir("$basePath/dev/checksums", '0777', true); + mkdir("$basePath/dev/checksums", 0777, true); file_put_contents("$basePath/dev/checksums/vendor", '22e02ee72d21ff719c1073abbec8302f8e2096ba6d072e133051064ed24b45b1'); $this->assertDirectoryDoesNotExist("$basePath/vendor"); @@ -53,7 +53,7 @@ class DownloadVendorCommandTest extends TestCase { $this->withOwnBookStackFolder(function (string $basePath) { file_put_contents("$basePath/version", 'v25.02'); - mkdir("$basePath/dev/checksums", '0777', true); + mkdir("$basePath/dev/checksums", 0777, true); file_put_contents("$basePath/dev/checksums/vendor", '42e02ee72d21ff719c1073abbec8302f8e2096ba6d072e133051064ed24b45b1'); $result = $this->runCommand('download-vendor');