Example #1
0
 /**
  * Returns class responsible for system requirements check
  *
  * @return oxSysRequirements
  */
 function getSystemReqCheck()
 {
     $editionSelector = new EditionSelector();
     if ($editionSelector->isEnterprise()) {
         $systemRequirements = new \OxidEsales\EshopEnterprise\Core\SystemRequirements();
     } elseif ($editionSelector->isProfessional()) {
         $systemRequirements = new OxidEsales\EshopProfessional\Core\SystemRequirements();
     } else {
         $systemRequirements = new OxidEsales\Eshop\Core\SystemRequirements();
     }
     return $systemRequirements;
 }
 /**
  * Adds tests sql data to database.
  *
  * @param string $sTestSuitePath
  */
 public function addTestData($sTestSuitePath)
 {
     parent::addTestData($sTestSuitePath);
     $editionSelector = new EditionSelector();
     if ($editionSelector->isEnterprise()) {
         $testSqlPathProvider = new TestSqlPathProvider(new EditionSelector(), $this->getTestConfig()->getShopPath());
         $sTestSuitePath = realpath($testSqlPathProvider->getDataPathBySuitePath($sTestSuitePath));
         $sFileName = $sTestSuitePath . '/demodata_' . SHOP_EDITION . '.sql';
         if (file_exists($sFileName)) {
             $this->importSql($sFileName);
         }
         if (isSUBSHOP && file_exists($sTestSuitePath . '/demodata_EE_mall.sql')) {
             $this->importSql($sTestSuitePath . '/demodata_EE_mall.sql');
         }
     }
 }
Example #3
0
 /**
  * Methods returns class according edition.
  *
  * @param string $sInstanceName
  *
  * @return string
  */
 protected function getClass($sInstanceName)
 {
     $editionSelector = new EditionSelector();
     $class = 'OxidEsales\\EshopCommunity\\Setup\\' . $sInstanceName;
     $classEnterprise = '\\OxidEsales\\EshopEnterprise\\' . EditionPathProvider::SETUP_DIRECTORY . '\\' . $sInstanceName;
     $classProfessional = '\\OxidEsales\\EshopProfessional\\' . EditionPathProvider::SETUP_DIRECTORY . '\\' . $sInstanceName;
     if (($editionSelector->isProfessional() || $editionSelector->isEnterprise()) && class_exists($classProfessional)) {
         $class = $classProfessional;
     }
     if ($editionSelector->isEnterprise() && class_exists($classEnterprise)) {
         $class = $classEnterprise;
     }
     return $class;
 }
 /**
  * When oxConfigFile is not registered in registry (happens during setup), it should be created on the fly.
  */
 public function testForcingEditionByConfigWhenNotRegistered()
 {
     $path = $this->createFile('config.inc.php', '<?php $this->edition = "EE";');
     $this->setConfigParam('sShopDir', dirname($path));
     $configFile = oxRegistry::get('oxConfigFile');
     oxRegistry::set('oxConfigFile', null);
     $editionSelector = new EditionSelector();
     $this->assertTrue($editionSelector->isEnterprise());
     $this->assertFalse($editionSelector->isCommunity());
     $this->assertFalse($editionSelector->isProfessional());
     oxRegistry::set('oxConfigFile', $configFile);
 }
Example #5
0
 /**
  * _loadBaseChannel loads basic channel data
  *
  * @access protected
  */
 protected function _loadBaseChannel()
 {
     $oShop = $this->getConfig()->getActiveShop();
     $this->_aChannel['title'] = $oShop->oxshops__oxname->value;
     $this->_aChannel['link'] = Registry::get("oxUtilsUrl")->prepareUrlForNoSession($this->getConfig()->getShopUrl());
     $this->_aChannel['description'] = '';
     $oLang = Registry::getLang();
     $aLangIds = $oLang->getLanguageIds();
     $this->_aChannel['language'] = $aLangIds[$oLang->getBaseLanguage()];
     $this->_aChannel['copyright'] = $oShop->oxshops__oxname->value;
     $this->_aChannel['selflink'] = '';
     if (oxNew('oxMailValidator')->isValidEmail($oShop->oxshops__oxinfoemail->value)) {
         $this->_aChannel['managingEditor'] = $oShop->oxshops__oxinfoemail->value;
         if ($oShop->oxshops__oxfname) {
             $this->_aChannel['managingEditor'] .= " ({$oShop->oxshops__oxfname} {$oShop->oxshops__oxlname})";
         }
     }
     $this->_aChannel['generator'] = $oShop->oxshops__oxname->value;
     $editionSelector = new EditionSelector();
     $this->_aChannel['image']['url'] = $this->getConfig()->getImageUrl() . 'logo_' . strtolower($editionSelector->getEdition()) . '.png';
     $this->_aChannel['image']['title'] = $this->_aChannel['title'];
     $this->_aChannel['image']['link'] = $this->_aChannel['link'];
 }
Example #6
0
 /**
  * Returns shop logo image file name from config option
  *
  * @return string
  */
 public function getShopLogo()
 {
     if (is_null($this->_sShopLogo)) {
         $sLogoImage = $this->getConfig()->getConfigParam('sShopLogo');
         if (empty($sLogoImage)) {
             $editionSelector = new EditionSelector();
             $sLogoImage = "logo_" . strtolower($editionSelector->getEdition()) . ".png";
         }
         $this->setShopLogo($sLogoImage);
     }
     return $this->_sShopLogo;
 }
 /**
  * Returns service URL
  *
  * @deprecated since v5.3 (2016-05-20); Dynpages will be removed.
  *
  * @param string $sLangAbbr language abbr.
  *
  * @return string
  */
 public function getServiceUrl($sLangAbbr = null)
 {
     if ($this->_sServiceUrl === null) {
         $sProtocol = $this->_getServiceProtocol();
         $editionSelector = new EditionSelector();
         $sUrl = $sProtocol . '://admin.oxid-esales.com/' . $editionSelector->getEdition() . '/';
         $sCountry = $this->_getCountryByCode($this->getConfig()->getConfigParam('sShopCountry'));
         if (!$sLangAbbr) {
             $oLang = oxRegistry::getLang();
             $sLangAbbr = $oLang->getLanguageAbbr($oLang->getTplLanguage());
         }
         if ($sLangAbbr != "de") {
             $sLangAbbr = "en";
         }
         $this->_sServiceUrl = $sUrl . $this->_getShopVersionNr() . "/{$sCountry}/{$sLangAbbr}/";
     }
     return $this->_sServiceUrl;
 }
Example #8
0
 /**
  * @param ClassNameProvider     $classNameProvider
  * @param ModuleChainsGenerator $moduleChainsGenerator
  * @param ShopIdCalculator      $shopIdCalculator
  */
 public function __construct($classNameProvider = null, $moduleChainsGenerator = null, $shopIdCalculator = null)
 {
     if (!$classNameProvider) {
         $classMapProvider = new ClassMapProvider(new EditionSelector());
         $classNameProvider = new ClassNameProvider($classMapProvider->getOverridableClassMap());
     }
     $this->classNameProvider = $classNameProvider;
     if (!$shopIdCalculator) {
         $moduleVariablesCache = new FileCache();
         $editionSelector = new EditionSelector();
         if ($editionSelector->getEdition() === $editionSelector::ENTERPRISE) {
             $shopIdCalculator = new \OxidEsales\EshopEnterprise\Core\ShopIdCalculator($moduleVariablesCache);
         } else {
             $shopIdCalculator = new ShopIdCalculator($moduleVariablesCache);
         }
     }
     $this->shopIdCalculator = $shopIdCalculator;
     if (!$moduleChainsGenerator) {
         $subShopSpecificCache = new SubShopSpecificFileCache($shopIdCalculator);
         $moduleVariablesLocator = new ModuleVariablesLocator($subShopSpecificCache, $shopIdCalculator);
         $moduleChainsGenerator = new ModuleChainsGenerator($moduleVariablesLocator);
     }
     $this->moduleChainsGenerator = $moduleChainsGenerator;
 }
Example #9
0
 /**
  * Method forms path to demodata.sql file according edition.
  *
  * @return string
  */
 private function getDemodataSqlFilePath()
 {
     $editionSelector = new EditionSelector();
     return $this->getVendorDir() . '/' . EditionRootPathProvider::EDITIONS_DIRECTORY . '/' . 'oxideshop-demodata-' . strtolower($editionSelector->getEdition()) . '/src/demodata.sql';
 }