public function getNextNode($parentNode = '')
{
$sql = "SELECT node
- FROM wcf" . WCF_N . "_package_installation_node
+ FROM wcf1_package_installation_node
WHERE processNo = ?
AND parentNode = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->processNo,
$parentNode,
public function getPackageNameByQueue($queueID)
{
$sql = "SELECT packageName
- FROM wcf" . WCF_N . "_package_installation_queue
+ FROM wcf1_package_installation_queue
WHERE queueID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([$queueID]);
$row = $statement->fetchArray();
public function getInstallationTypeByQueue($queueID)
{
$sql = "SELECT action
- FROM wcf" . WCF_N . "_package_installation_queue
+ FROM wcf1_package_installation_queue
WHERE queueID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([$queueID]);
$row = $statement->fetchArray();
public function getNodeData($node)
{
$sql = "SELECT nodeType, nodeData, sequenceNo
- FROM wcf" . WCF_N . "_package_installation_node
+ FROM wcf1_package_installation_node
WHERE processNo = ?
AND node = ?
ORDER BY sequenceNo ASC";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->processNo,
$node,
*/
public function completeNode($node)
{
- $sql = "UPDATE wcf" . WCF_N . "_package_installation_node
+ $sql = "UPDATE wcf1_package_installation_node
SET done = 1
WHERE processNo = ?
AND node = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->processNo,
$node,
*/
public function purgeNodes()
{
- $sql = "DELETE FROM wcf" . WCF_N . "_package_installation_node
+ $sql = "DELETE FROM wcf1_package_installation_node
WHERE processNo = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->processNo,
]);
- $sql = "DELETE FROM wcf" . WCF_N . "_package_installation_form
+ $sql = "DELETE FROM wcf1_package_installation_form
WHERE queueID = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->queueID,
]);
];
$sql = "SELECT done
- FROM wcf" . WCF_N . "_package_installation_node
+ FROM wcf1_package_installation_node
WHERE processNo = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->processNo,
]);
$newNode = $this->getToken();
// update descendants
- $sql = "UPDATE wcf" . WCF_N . "_package_installation_node
+ $sql = "UPDATE wcf1_package_installation_node
SET parentNode = ?
WHERE parentNode = ?
AND processNo = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$newNode,
$node,
// create a copy of current node (prevents empty nodes)
$sql = "SELECT nodeType, nodeData, done
- FROM wcf" . WCF_N . "_package_installation_node
+ FROM wcf1_package_installation_node
WHERE node = ?
AND processNo = ?
AND sequenceNo = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$node,
$this->installation->queue->processNo,
]);
$row = $statement->fetchArray();
- $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_node
+ $sql = "INSERT INTO wcf1_package_installation_node
(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData, done)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->queueID,
$this->installation->queue->processNo,
]);
// move other child-nodes greater than $sequenceNo into new node
- $sql = "UPDATE wcf" . WCF_N . "_package_installation_node
+ $sql = "UPDATE wcf1_package_installation_node
SET parentNode = ?,
node = ?,
sequenceNo = (sequenceNo - ?)
WHERE node = ?
AND processNo = ?
AND sequenceNo > ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$node,
$newNode,
$newNode = $this->getToken();
// update descendants
- $sql = "UPDATE wcf" . WCF_N . "_package_installation_node
+ $sql = "UPDATE wcf1_package_installation_node
SET parentNode = ?
WHERE parentNode = ?
AND processNo = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$newNode,
$beforeNode,
*/
public function shiftNodes($oldParentNode, $newParentNode)
{
- $sql = "UPDATE wcf" . WCF_N . "_package_installation_node
+ $sql = "UPDATE wcf1_package_installation_node
SET parentNode = ?
WHERE parentNode = ?
AND processNo = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$newParentNode,
$oldParentNode,
$this->node = $this->getToken();
- $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_node
+ $sql = "INSERT INTO wcf1_package_installation_node
(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
VALUES (?, ?, ?, ?, ?, ?, ?)";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->queueID,
$this->installation->queue->processNo,
// get package id
$sql = "SELECT packageID
- FROM wcf" . WCF_N . "_package
+ FROM wcf1_package
WHERE package = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([$archive->getPackageInfo('name')]);
$row = $statement->fetchArray();
$packageID = ($row === false) ? null : $row['packageID'];
// insert nodes
if (!empty($pluginNodes)) {
- $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_node
+ $sql = "INSERT INTO wcf1_package_installation_node
(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
VALUES (?, ?, ?, ?, ?, ?, ?)";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
foreach ($pluginNodes as $nodeData) {
$statement->execute([
$this->node = $this->getToken();
$this->sequenceNo = 0;
- $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_node
+ $sql = "INSERT INTO wcf1_package_installation_node
(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
VALUES (?, ?, ?, ?, ?, ?, ?)";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->queueID,
$this->installation->queue->processNo,
public function getQueueByNode($processNo, $node)
{
$sql = "SELECT queueID
- FROM wcf" . WCF_N . "_package_installation_node
+ FROM wcf1_package_installation_node
WHERE processNo = ?
AND node = ?";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$processNo,
$node,
WHEN 'file' THEN 2
ELSE 0
END AS pluginOrder
- FROM wcf" . WCF_N . "_package_installation_plugin
+ FROM wcf1_package_installation_plugin
ORDER BY pluginOrder, priority";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute();
$pips = $statement->fetchAll(\PDO::FETCH_ASSOC);
// insert pips
- $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_node
+ $sql = "INSERT INTO wcf1_package_installation_node
(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
VALUES (?, ?, ?, ?, ?, ?, ?)";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$sequenceNo = 0;
foreach ($pips as $pip) {
$this->parentNode = $this->node;
$this->node = $this->getToken();
- $sql = "INSERT INTO wcf" . WCF_N . "_package_installation_node
+ $sql = "INSERT INTO wcf1_package_installation_node
(queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
VALUES (?, ?, ?, ?, ?, ?, ?)";
- $statement = WCF::getDB()->prepareStatement($sql);
+ $statement = WCF::getDB()->prepare($sql);
$statement->execute([
$this->installation->queue->queueID,
$this->installation->queue->processNo,