我想知道如何处理媒体/目录/产品/缓存的缓存我不知道目录结构是如何形成的。我的例子是
mediacatalogproductcache
1small_image120x1209df78dab3d52sd08dse5fw8d27w36e95
a
b
d
...
我不知道如何取缓存中的数字1\接下来如何获取哈希密钥9df78dab3d52sd08dse5fw8d27w36e95很多时候用numberx代替higthweith(directory)我需要知道所有的,因为我想做一个外部CDN,并解放来调整我机器中的图像大小。Thx
如果您想了解更多关于该散列键的信息,我相信它是在Mage_Catalog_Model_Product_Image类中创建的,在setBaseFile函数的底部,它基本上获取图像的属性,将它们内爆在一起并创建散列。
// add misk params as a hash
$miscParams = array(
($this->_keepAspectRatio ? '' : 'non') . 'proportional',
($this->_keepFrame ? '' : 'no') . 'frame',
($this->_keepTransparency ? '' : 'no') . 'transparency',
($this->_constrainOnly ? 'do' : 'not') . 'constrainonly',
$this->_rgbToString($this->_backgroundColor),
'angle' . $this->_angle,
'quality' . $this->_quality
);
// if has watermark add watermark params to hash
if ($this->getWatermarkFile()) {
$miscParams[] = $this->getWatermarkFile();
$miscParams[] = $this->getWatermarkImageOpacity();
$miscParams[] = $this->getWatermarkPosition();
$miscParams[] = $this->getWatermarkWidth();
$miscParams[] = $this->getWatermarkHeigth();
}
如果您需要自己生成散列,可以使用相同的步骤。显然,HASH’ing是一个单向过程,因此不可能获取值并找出图像属性。