}
unset($nodeData['requirements']);
+ $applicationDirectory = $nodeData['applicationDirectory'];
+ unset($nodeData['applicationDirectory']);
+
// update package
if ($this->queue->packageID) {
$packageEditor = new PackageEditor(new Package($this->queue->packageID));
if ($this->getPackage()->isApplication && $this->getPackage()->package != 'com.woltlab.wcf' && $this->getAction() == 'install') {
if (empty($this->getPackage()->packageDir)) {
- $document = $this->promptPackageDir();
+ $document = $this->promptPackageDir($applicationDirectory);
if ($document !== null && $document instanceof FormDocument) {
$installationStep->setDocument($document);
}
/**
* Prompts for a text input for package directory (applies for applications only)
*
+ * @param string $applicationDirectory
* @return FormDocument
*/
- protected function promptPackageDir() {
+ protected function promptPackageDir($applicationDirectory) {
// check for pre-defined directories originating from WCFSetup
$directory = WCF::getSession()->getVar('__wcfSetup_directories');
if ($directory !== null) {
if ($isParent === false) {
$defaultPath = dirname(WCF_DIR);
}
- $defaultPath = FileUtil::addTrailingSlash(FileUtil::unifyDirSeparator($defaultPath)) . Package::getAbbreviation($this->getPackage()->package) . '/';
+ if (!$applicationDirectory) {
+ $applicationDirectory = Package::getAbbreviation($this->getPackage()->package);
+ }
+ $defaultPath = FileUtil::addTrailingSlash(FileUtil::unifyDirSeparator($defaultPath)) . $applicationDirectory . '/';
$packageDir->setValue($defaultPath);
$container->appendChild($packageDir);
* Creates a logical node-based installation tree.
*
* @author Alexander Ebert
- * @copyright 2001-2018 WoltLab GmbH
+ * @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\Package
*/
* active package installation dispatcher
* @var PackageInstallationDispatcher
*/
- public $installation = null;
+ public $installation;
/**
* current installation node
$this->node = $this->getToken();
- // calculate the number of instances of this package
$sql = "INSERT INTO wcf".WCF_N."_package_installation_node
(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
VALUES (?, ?, ?, ?, ?, ?, ?)";
'authorURL' => $this->installation->getArchive()->getAuthorInfo('authorURL') !== null ? $this->installation->getArchive()->getAuthorInfo('authorURL') : '',
'installDate' => TIME_NOW,
'updateDate' => TIME_NOW,
- 'requirements' => $this->requirements
+ 'requirements' => $this->requirements,
+ 'applicationDirectory' => $this->installation->getArchive()->getPackageInfo('applicationDirectory') ?: '',
])
]);
}