<header class="mainHeading">
<img src="{@RELATIVE_WCF_DIR}icon/installation1.svg" alt="" />
<hgroup>
- <h1>Paket »{$queue->packageName}« wird installiert …</h1>
+ <h1>Paket »{$packageName}« wird installiert …</h1>
<h2>Aktueller Schritt: <span id="packageInstallationAction">{lang}wcf.package.installation.step.prepare{/lang}</span></h2>
<p><progress id="packageInstallationProgress" value="0" max="100" style="width: 200px;">0%</progress></p>
</hgroup>
<div id="packageInstallationInnerContentContainer" class="" style="display: none;">
<div id="packageInstallationInnerContent" class=""></div>
</div>
-</div>
\ No newline at end of file
+</div>
*/
protected function stepInstall() {
$step = $this->installation->install($this->node);
+ $queueID = $this->installation->nodeBuilder->getQueueByNode($this->installation->queue->processNo, $step->getNode());
if ($step->hasDocument()) {
$this->data = array(
'innerTemplate' => $step->getTemplate(),
'node' => $step->getNode(),
'progress' => $this->installation->nodeBuilder->calculateProgress($this->node),
- 'step' => 'install'
+ 'step' => 'install',
+ 'queueID' => $queueID
);
}
else {
if ($step->getNode() == '') {
// perform final actions
- $queueID = $this->installation->completeSetup();
-
- // begin with next queue
- if ($queueID) {
- $this->data = array(
- 'progress' => 100,
- 'queueID' => $queueID,
- 'step' => 'prepare'
- );
- return;
- }
+ $this->installation->completeSetup();
- // no more queues, show success
+ // show success
$this->data = array(
'progress' => 100,
'step' => 'success'
$this->data = array(
'step' => 'install',
'node' => $step->getNode(),
- 'progress' => $this->installation->nodeBuilder->calculateProgress($this->node)
+ 'progress' => $this->installation->nodeBuilder->calculateProgress($this->node),
+ 'queueID' => $queueID
);
}
}
// create node tree
$this->installation->nodeBuilder->buildNodes();
$nextNode = $this->installation->nodeBuilder->getNextNode();
+ $queueID = $this->installation->nodeBuilder->getQueueByNode($this->installation->queue->processNo, $nextNode);
WCF::getTPL()->assign(array(
- 'queue' => $this->queue
+ 'packageName' => $this->installation->queue->packageName
));
$this->data = array(
'step' => 'install',
'node' => $nextNode,
'currentAction' => WCF::getLanguage()->get('wcf.package.installation.step.installing'),
- 'progress' => 0
+ 'progress' => 0,
+ 'queueID' => $queueID
);
}
case 'pip':
$step = $this->executePIP($nodeData);
break;
+
+ default:
+ die("Unknown node type: '".$data['nodeType']."'");
+ break;
}
if ($step->splitNode()) {
return $row['queueID'];
}
- /**
- * Returns next queue within an installation process.
- *
- * @return integer
- */
- protected function getNextQueue() {
- $sql = "SELECT queueID
- FROM wcf".WCF_N."_package_installation_queue
- WHERE userID = ?
- AND processNo = ?
- AND done = 0
- ORDER BY queueID ASC";
- $statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array(
- WCF::getUser()->userID,
- $this->queue->processNo
- ));
- $row = $statement->fetchArray();
-
- if (!$row) {
- return 0;
- }
-
- return $row['queueID'];
- }
-
/**
* Executes post-setup actions.
*/
));
}
- // return next queue within the same process no
- $queueID = $this->getNextQueue();
-
- if (!$queueID) {
- // clear language files once whole installation is completed
- LanguageEditor::deleteLanguageFiles();
-
- // reset all caches
- CacheHandler::getInstance()->clear(WCF_DIR.'cache/', '*');
- }
+ // clear language files once whole installation is completed
+ LanguageEditor::deleteLanguageFiles();
- return $queueID;
+ // reset all caches
+ CacheHandler::getInstance()->clear(WCF_DIR.'cache/', '*');
}
/**
<?php
namespace wcf\system\package;
use wcf\data\package\installation\queue\PackageInstallationQueue;
+use wcf\data\package\installation\queue\PackageInstallationQueueEditor;
use wcf\system\WCF;
+use wcf\util\FileUtil;
use wcf\util\StringUtil;
/**
public function getNextNode($parentNode = '') {
$sql = "SELECT node
FROM wcf".WCF_N."_package_installation_node
- WHERE queueID = ?
- AND processNo = ?
+ WHERE processNo = ?
AND parentNode = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(
- $this->installation->queue->queueID,
$this->installation->queue->processNo,
$parentNode
));
public function getNodeData($node) {
$sql = "SELECT nodeType, nodeData, sequenceNo
FROM wcf".WCF_N."_package_installation_node
- WHERE queueID = ?
- AND processNo = ?
+ WHERE processNo = ?
AND node = ?
ORDER BY sequenceNo ASC";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(
- $this->installation->queue->queueID,
$this->installation->queue->processNo,
$node
));
public function completeNode($node) {
$sql = "UPDATE wcf".WCF_N."_package_installation_node
SET done = 1
- WHERE queueID = ?
- AND processNo = ?
+ WHERE processNo = ?
AND node = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(
- $this->installation->queue->queueID,
$this->installation->queue->processNo,
$node
));
$sql = "UPDATE wcf".WCF_N."_package_installation_node
SET parentNode = ?
WHERE parentNode = ?
- AND queueID = ?
AND processNo = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(
$newNode,
$node,
- $this->installation->queue->queueID,
$this->installation->queue->processNo
));
$sql = "SELECT nodeType, nodeData, done
FROM wcf".WCF_N."_package_installation_node
WHERE node = ?
- AND queueID = ?
AND processNo = ?
AND sequenceNo = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(
$node,
- $this->installation->queue->queueID,
$this->installation->queue->processNo,
$sequenceNo
));
node = ?,
sequenceNo = (sequenceNo - ?)
WHERE node = ?
- AND queueID = ?
AND processNo = ?
AND sequenceNo > ?";
$statement = WCF::getDB()->prepareStatement($sql);
$newNode,
$sequenceNo,
$node,
- $this->installation->queue->queueID,
$this->installation->queue->processNo,
$sequenceNo
));
protected function getToken() {
return StringUtil::substring(StringUtil::getRandomID(), 0, 8);
}
+
+ /**
+ * Returns queue id based upon current node.
+ *
+ * @param integer $processNo
+ * @param string $node
+ * @return integer
+ */
+ public function getQueueByNode($processNo, $node) {
+ $sql = "SELECT queueID
+ FROM wcf".WCF_N."_package_installation_node
+ WHERE processNo = ?
+ AND node = ?";
+ $statement = WCF::getDB()->prepareStatement($sql);
+ $statement->execute(array(
+ $processNo,
+ $node
+ ));
+ $row = $statement->fetchArray();
+
+ return $row['queueID'];
+ }
}