Beispiel #1
0
 /**
  * Perform upgrade
  *
  * @param boolean    $isTestMode       Flag OPTIONAL
  * @param array|null $filesToOverwrite List of custom files to overwrite OPTIONAL
  *
  * @return void
  */
 public function upgrade($isTestMode = true, $filesToOverwrite = null)
 {
     parent::upgrade($isTestMode, $filesToOverwrite);
     if (!$isTestMode) {
         list($author, $name) = explode('\\', $this->getActualName());
         if (!$this->isValid()) {
             \Includes\SafeMode::markModuleAsUnsafe($author, $name);
         }
         // Load fixtures
         if (!$this->isInstalled()) {
             $yaml = \Includes\Utils\ModulesManager::getModuleYAMLFile($author, $name);
             if (\Includes\Utils\FileManager::isFileReadable($yaml)) {
                 \XLite\Core\Database::getInstance()->loadFixturesFromYaml($yaml);
             }
         }
         $this->updateDBRecords();
     }
 }
Beispiel #2
0
 /**
  * Download package
  *
  * @return boolean
  */
 public function download()
 {
     $result = false;
     $majorVersion = $this->getMajorVersionNew();
     $minorVersion = $this->getMinorVersionNew();
     $path = \XLite\Core\Marketplace::getInstance()->getCorePack($majorVersion, $minorVersion);
     $params = array('major' => $majorVersion, 'minor' => $minorVersion);
     if (isset($path)) {
         $this->addFileInfoMessage('Core pack (v.{{major}}.{{minor}}) is received', $path, true, $params);
         $this->setRepositoryPath($path);
         $this->saveHashesForInstalledFiles();
         $result = parent::download();
     } else {
         $this->addFileErrorMessage('Core pack (v.{{major}}.{{minor}}) is not received', \XLite\Core\Marketplace::getInstance()->getError(), true, $params);
     }
     return $result;
 }
Beispiel #3
0
 /**
  * Execute common helper method
  *
  * @param string $type Helper type
  *
  * @return void
  */
 public function runCommonHelpers($type)
 {
     parent::runCommonHelpers($type);
 }
Beispiel #4
0
 /**
  * Get module ID
  *
  * @return string
  */
 protected function getModuleID(\XLite\Upgrade\Entry\AEntry $entry)
 {
     return $entry->getModuleEntryID();
 }
Beispiel #5
0
 /**
  * Call install event
  *
  * @param \XLite\Upgrade\Entry\AEntry $entry      Entry
  * @param boolean                     $isTestMode Flag OPTIONAL
  *
  * @return void
  */
 public function callInstallEvent($entry, $isTestMode = false)
 {
     if (!$isTestMode) {
         $entry->callInstallEvent();
     }
 }
Beispiel #6
0
 /**
  * Perform upgrade
  *
  * @param boolean    $isTestMode       Flag OPTIONAL
  * @param array|null $filesToOverwrite List of custom files to overwrite OPTIONAL
  *
  * @return void
  */
 public function upgrade($isTestMode = true, $filesToOverwrite = null)
 {
     parent::upgrade($isTestMode, $filesToOverwrite);
     if (!$isTestMode) {
         list($author, $name) = explode('\\', $this->getActualName());
         if (!$this->isValid()) {
             \Includes\SafeMode::markModuleAsUnsafe($author, $name);
         }
         $this->updateDBRecords();
     }
 }