]> BookStack Code Mirror - system-cli/commitdiff
Altered mysql config passing, fixed some test issues
authorDan Brown <redacted>
Tue, 11 Mar 2025 16:53:32 +0000 (16:53 +0000)
committerDan Brown <redacted>
Tue, 11 Mar 2025 16:53:32 +0000 (16:53 +0000)
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.

composer.lock
src/Services/MySqlRunner.php
tests/Commands/DownloadVendorCommandTest.php

index df6d1d1e04ba6dfc46a91af23945a5adb78f799c..3cc8538594a82476d7a98552f4b3a6c49982854d 100644 (file)
@@ -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",
index a3e1033d69d6cda16f22c9913d40c0f611d2f43f..d83f446b98a41df9134a700427e8271e7da0363f 100644 (file)
@@ -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,
index 6bd3a0453b743b03e5a5e8eb493ab1a2483bc6d8..cc5e730e22b3fcd1f85080526616bca03e549cf1 100644 (file)
@@ -1,6 +1,6 @@
 <?php declare(strict_types=1);
 
-namespace Commands;
+namespace Tests\Commands;
 
 use Tests\TestCase;
 
@@ -11,7 +11,7 @@ class DownloadVendorCommandTest extends TestCase
         $this->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');