Ejemplo n.º 1
0
 public function getUrl()
 {
     if ($this->_imageShouldComeFromCloudinary($this->_newFile)) {
         $imageProvider = CloudinaryImageProvider::fromConfiguration($this->_getConfigHelper()->buildConfiguration());
         return (string) $imageProvider->transformImage(Image::fromPath($this->_newFile));
     }
     return parent::getUrl();
 }
Ejemplo n.º 2
0
 /**
  * Provides the URL to the image on the CDN or fails back to the parent method as appropriate.
  *
  * @return string
  */
 public function getUrl()
 {
     if (!Mage::getStoreConfig('mycdn/general/enabled')) {
         return parent::getUrl();
     }
     $cache = Mage::helper('mycdn')->checkPathInCache($this->_newFile);
     if (!$cache) {
         return parent::getUrl();
     }
     return Mage::getModel('mycdn/adapter')->getUrl($this->_newFile);
 }
Ejemplo n.º 3
0
 /**
  * Provides the URL to the image on the CDN or fails back to the parent method as appropriate.
  *
  * @return string
  */
 public function getUrl()
 {
     $cds = Mage::Helper('imagecdn')->factory();
     if ($cds->useCdn()) {
         $url = $cds->getUrl($this->_newFile);
         if ($url) {
             return $url;
         }
     }
     return parent::getUrl();
 }
Ejemplo n.º 4
0
 /**
  * @param Mage_Catalog_Model_Product_Image $model
  * @depends testSetBaseFilePlaceholder
  */
 public function testGetUrlPlaceholder($model)
 {
     $this->assertStringMatchesFormat('http://localhost/pub/media/skin/frontend/%s/Mage_Catalog/images/product/placeholder/image.jpg', $model->getUrl());
 }
Ejemplo n.º 5
0
 /**
  * @return string
  */
 public function getUrl()
 {
     if ($this->_newFile === true) {
         $url = Mage::getDesign()->getSkinUrl('Mage_XmlConnect::images/catalog/category/placeholder/' . $this->getDestinationSubdir() . '.jpg');
     } else {
         $url = parent::getUrl();
     }
     return $url;
 }