/**
  * Installs the requirements of the current package.
  * 
  * Inserts needed package installations or updates into the package installation queue.
  * Returns true, if no package installations are needed. Otherwise false.
  * 
  * @return	boolean
  */
 protected function installPackageRequirements()
 {
     // build queue inserts
     $queueInserts = '';
     foreach ($this->packageArchive->getOpenRequirements() as $requirement) {
         // the required package was not found
         // so the installation will be canceled
         if (!isset($requirement['file'])) {
             if (isset($requirement['minversion']) && !empty($requirement['packageID'])) {
                 throw new SystemException("required package '" . $requirement['name'] . "' in needed version '" . $requirement['minversion'] . "' not found.", 13006);
             } else {
                 throw new SystemException("required package '" . $requirement['name'] . "' not found.", 13006);
             }
         }
         // check the given filename
         if (!FileUtil::isURL($requirement['file'])) {
             // filename is no url
             // required package is delivered with this package
             $requirement['file'] = $this->packageArchive->extractTar($requirement['file'], 'requiredPackage_');
             // unzip tar
             $requirement['file'] = PackageArchive::unzipPackageArchive($requirement['file']);
         }
         if (!empty($queueInserts)) {
             $queueInserts .= ',';
         }
         $action = $requirement['action'];
         $cancelable = $action == 'install' && $this->getAction() == 'install' ? 1 : 0;
         $queueInserts .= "(" . $this->queueID . ", " . $this->processNo . ", " . WCF::getUser()->userID . ", '" . escapeString($requirement['name']) . "', " . $requirement['packageID'] . ", '" . escapeString($requirement['file']) . "', '" . $action . "', 'requirement', " . $cancelable . ")";
     }
     // insert needed installations or updates
     if (!empty($queueInserts)) {
         $sql = "INSERT INTO\twcf" . WCF_N . "_package_installation_queue\n\t\t\t\t\t\t(parentQueueID, processNo, userID, package, packageID, archive, action, packageType, cancelable)\n\t\t\t\tVALUES\t\t" . $queueInserts;
         WCF::getDB()->sendQuery($sql);
         return false;
     }
     return true;
 }