From a16b81285368223899f96fb0cc6539e3a8d1bb1c Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 15 Mar 2021 09:46:18 +0100 Subject: [PATCH] Support database PIP syncs for non-Core packages --- .../system/devtools/pip/DevtoolsPip.class.php | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php b/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php index b3d0fced91..da8f2c4dab 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php @@ -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( -- 2.20.1