Esempio n. 1
0
 /**
  * Unpack archive
  *
  * @return boolean
  */
 public function unpack()
 {
     if ($this->isDownloaded()) {
         // Extract archive files into a new directory
         list($dir, $result) = \Includes\Utils\PHARManager::unpack($this->getRepositoryPath(), LC_DIR_TMP);
         $this->setRepositoryPath($dir, true, !$result);
         if ($result) {
             $this->prepareUnpackDir($dir);
             $this->addFileInfoMessage('Entry "{{' . self::TOKEN_ENTRY . '}}" archive is unpacked', $dir, true);
         }
     }
     return $this->isUnpacked();
 }
Esempio n. 2
0
 /**
  * To determine what type of archives to download
  *
  * @return boolean
  */
 protected function canCompress()
 {
     return \Includes\Utils\PHARManager::canCompress();
 }
Esempio n. 3
0
 /**
  * Pack module into PHAR module file
  *
  * @return void
  */
 protected function doActionPack()
 {
     if (LC_DEVELOPER_MODE) {
         $module = $this->getModule();
         if ($module) {
             if ($module->getEnabled()) {
                 \Includes\Utils\PHARManager::packModule(new \XLite\Core\Pack\Module($module));
             } else {
                 \XLite\Core\TopMessage::addError('Only enabled modules can be packed');
             }
         } else {
             \XLite\Core\TopMessage::addError('Module with ID "' . $this->getModuleId() . '" is not found');
         }
     } else {
         \XLite\Core\TopMessage::addError('Module packing is available in the DEVELOPER mode only. Check etc/config.php file');
     }
 }