示例#1
0
文件: AModule.php 项目: kingsj/core
 /**
  * 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();
     }
 }
示例#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;
 }
示例#3
0
 /**
  * Execute common helper method
  *
  * @param string $type Helper type
  *
  * @return void
  */
 public function runCommonHelpers($type)
 {
     parent::runCommonHelpers($type);
 }
示例#4
0
 /**
  * Get module ID
  *
  * @return string
  */
 protected function getModuleID(\XLite\Upgrade\Entry\AEntry $entry)
 {
     return $entry->getModuleEntryID();
 }
示例#5
0
文件: Cell.php 项目: kewaunited/xcart
 /**
  * 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();
     }
 }
示例#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();
     }
 }