From c26e8fd85fe986cb6236e4e420f928014a92af05 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 24 Nov 2018 09:28:56 +0100 Subject: [PATCH] Fix syncing Core file-based PIPs Core does not explicitly use the PIP to install files and acp templates thus there is no install instructions for those PIPs. Additionally, the (implicit) archive names of the file-based PIPs does not easily translate to the directory location. See #2616 --- .../package/DevtoolsInstaller.class.php | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/devtools/package/DevtoolsInstaller.class.php b/wcfsetup/install/files/lib/system/devtools/package/DevtoolsInstaller.class.php index 534740d42e..09274ca09f 100644 --- a/wcfsetup/install/files/lib/system/devtools/package/DevtoolsInstaller.class.php +++ b/wcfsetup/install/files/lib/system/devtools/package/DevtoolsInstaller.class.php @@ -38,7 +38,24 @@ class DevtoolsInstaller extends Installer { public function getTar($source) { $directory = null; - foreach ($this->project->getPackageArchive()->getInstallInstructions() as $instruction) { + $instructions = $this->project->getPackageArchive()->getInstallInstructions(); + + // WoltLab Suite Core does not install its acp templates and files via PIP + if ($this->project->isCore()) { + $instructions[] = [ + 'attributes' => ['type' => 'acpTemplate'], + 'pip' => 'acpTemplate', + 'value' => '' + ]; + + $instructions[] = [ + 'attributes' => ['type' => 'file'], + 'pip' => 'file', + 'value' => '' + ]; + } + + foreach ($instructions as $instruction) { $archive = null; switch ($instruction['pip']) { case 'acpTemplate': @@ -55,7 +72,25 @@ class DevtoolsInstaller extends Installer { } if ($archive !== null) { - $directory = FileUtil::addTrailingSlash($this->project->path . pathinfo($archive, PATHINFO_FILENAME)); + if ($this->project->isCore()) { + switch ($instruction['pip']) { + case 'acpTemplate': + $directory = $this->project->path . 'wcfsetup/install/files/acp/templates/'; + break; + + case 'file': + $directory = $this->project->path . 'wcfsetup/install/files/'; + break; + + case 'template': + $directory = $this->project->path . 'com.woltlab.wcf/templates/'; + break; + } + } + else { + $directory = FileUtil::addTrailingSlash($this->project->path . pathinfo($archive, PATHINFO_FILENAME)); + } + if ($source == $archive && is_dir($directory)) { $files = $this->project->getPackageArchive()->getTar()->getFiles(); -- 2.20.1