Support database PIP syncs for non-Core packages
authorMatthias Schmidt <gravatronics@live.com>
Mon, 15 Mar 2021 08:46:18 +0000 (09:46 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 15 Mar 2021 08:46:18 +0000 (09:46 +0100)
wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php

index b3d0fced91bafece86dafff340b38e3ba121554c..da8f2c4dabf54857126d1f31c61acb1a9cb63b6b 100644 (file)
@@ -248,8 +248,17 @@ class DevtoolsPip extends DatabaseObjectDecorator
                 }
             } else {
                 if (\strpos($defaultFilename, '*') !== false) {
-                    foreach (\glob($path . $defaultFilename) as $file) {
-                        $targets[] = \basename($file);
+                    if ($this->pluginName === 'database') {
+                        foreach (\glob("{$path}/files/{$defaultFilename}") as $file) {
+                            $targets[] = \basename($file);
+                        }
+                        foreach (\glob("{$path}/files_wcf/{$defaultFilename}") as $file) {
+                            $targets[] = \basename($file);
+                        }
+                    } else {
+                        foreach (\glob($path . $defaultFilename) as $file) {
+                            $targets[] = \basename($file);
+                        }
                     }
 
                     // `glob()` returns files in an arbitrary order
@@ -420,6 +429,18 @@ class DevtoolsPip extends DatabaseObjectDecorator
 
                     break;
 
+                case 'database':
+                    $instructions['value'] = DatabasePackageInstallationPlugin::SCRIPT_DIR . $target;
+
+                    $path = "{$project->path}files/{$instructions['value']}";
+                    if (!\is_file($path)) {
+                        $path = "{$project->path}files_wcf/{$instructions['value']}";
+                    }
+
+                    $tar->registerFile($instructions['value'], $path);
+
+                    break;
+
                 default:
                     if (\strpos($defaultFilename, '*') !== false) {
                         $tar->registerFile(