Exemple #1
0
 /**
  * This directory is shared between hosts (NFS) and is store specific
  *
  * @param string|null $relativePath relative path in data directory
  *
  * @return string
  */
 public static function getSharedStoreSpecificPath($relativePath = null)
 {
     $path = self::getBaseDataPath(true, true);
     $path = self::addRelativePath($path, $relativePath);
     if (Cloud::isCloudStorageEnabled()) {
         return $path;
     }
     return self::createDirectoryIfNotExisting($path);
 }
Exemple #2
0
 /**
  * @param string $filename
  *
  * @throws \ErrorException
  *
  * @return string
  */
 public static function getAbsoluteProductImageUrl($filename)
 {
     $urlDomain = self::getStaticMediaUrl();
     if ($filename === '') {
         $applicationName = APPLICATION;
         switch ($applicationName) {
             case 'ZED':
                 return self::getSchema() . Config::get(LibraryConstants::HOST_ZED_GUI) . self::PLACEHOLDER_PRODUCT_ZED;
             case 'YVES':
                 return self::getSchema() . Config::get(LibraryConstants::HOST_YVES) . self::PLACEHOLDER_PRODUCT_YVES;
             default:
                 throw new ErrorException('Invalid Application name');
         }
     }
     $urlKey = $filename;
     /* ONLY FOR CLOUD HOSTING SETUP USED */
     if (Cloud::isCloudStorageCdnEnabled()) {
         return self::getAbsoluteProductImageUrlForCloudUsage($urlKey);
     }
     return self::getSchema() . implode('/', [$urlDomain, Store::getInstance()->getStoreName(), Config::get(LibraryConstants::PRODUCT_IMAGE_IMAGE_URL_PREFIX), $urlKey]);
 }