/** * Checks to see if the image has been verified lately by checking in the cache or fails * back to the parent method as appropriate. * * @return bool */ public function isCached() { $cds = Mage::Helper('imagecdn')->factory(); if ($cds->useCdn()) { return $cds->fileExists($this->_newFile); } else { return parent::isCached(); } }
/** * Checks to see if the image has been verified lately by checking in the cache or fails * back to the parent method as appropriate. * * @return bool */ public function isCached() { if (!Mage::getStoreConfig('mycdn/general/enabled')) { return parent::isCached(); } $cache = Mage::helper('mycdn')->checkPathInCache($this->_newFile); if ($cache) { return true; } if (Mage::helper('mycdn')->isFileExists($this->_newFile)) { Mage::getModel('mycdn/adapter')->uploadFileAsync($this->_newFile, $this->_newFile); return true; } return false; }
public function isCached() { if (!Mage::helper('magefm_cdn')->isEnabled()) { return parent::isCached(); } $entity = Mage::getModel('magefm_cdn/cache')->loadByStoreAndPath(Mage::app()->getStore()->getId(), $this->_newFile); if ($entity->getId()) { return true; } $result = Mage::helper('magefm_cdn/storage')->fileExists($this->_newFile); if ($result) { $entity->setStoreId(Mage::app()->getStore()->getId()); $entity->setPath($this->_newFile); $entity->save(); } return $result; }
/** * Overrides the parent method. It checks the base file change time, * and if cached file is older - we concider an image is not cached * * @return bool */ public function isCached() { if (Mage::getStoreConfig("catalog/nicerimagenames/disable_ext")) { // use parent method if nicerimagenames disabled return parent::isCached(); } if (!$this->_fileExists($this->_newFile)) { return false; } if (!file_exists($this->_baseFile)) { return true; } if (filemtime($this->_newFile) < filemtime($this->_baseFile)) { // checks the base file change time, and if cached file is older - we concider an image is not cached return false; } return true; }