/**
  * @dataProvider providerReturnsForcedEdition
  */
 public function testReturnsForcedEdition($editionToForce, $expectedEdition)
 {
     $editionSelector = new EditionSelector($editionToForce);
     $this->assertSame($expectedEdition, $editionSelector->getEdition());
 }
Beispiel #2
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'];
 }
Beispiel #3
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;
 }
Beispiel #5
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;
 }
Beispiel #6
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';
 }