Version Notes
- fix for memory leak caused by loading a lot of images
Download this release
Release Info
Developer | ORBA |
Extension | Orba_Ceneopl |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
app/code/community/Orba/Ceneopl/Model/Product.php
CHANGED
@@ -2,6 +2,11 @@
|
|
2 |
|
3 |
class Orba_Ceneopl_Model_Product extends Mage_Catalog_Model_Product {
|
4 |
|
|
|
|
|
|
|
|
|
|
|
5 |
protected function getConfig() {
|
6 |
return Mage::getModel('ceneopl/config');
|
7 |
}
|
@@ -236,21 +241,27 @@ class Orba_Ceneopl_Model_Product extends Mage_Catalog_Model_Product {
|
|
236 |
$imageResizedDir = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA)
|
237 |
. DS . "catalog" . DS . "product" . DS . "ceneopl";
|
238 |
$imagesBaseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product';
|
239 |
-
|
|
|
|
|
240 |
if (file_exists($imageDir . $imageFile)) {
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
if (
|
246 |
-
$
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
|
|
|
|
|
|
252 |
}
|
253 |
-
|
|
|
254 |
}
|
255 |
}
|
256 |
return $imagesBaseUrl . $imageFile;
|
2 |
|
3 |
class Orba_Ceneopl_Model_Product extends Mage_Catalog_Model_Product {
|
4 |
|
5 |
+
/**
|
6 |
+
* @var Ceneopl_Varien_Image
|
7 |
+
*/
|
8 |
+
protected $_imageObj;
|
9 |
+
|
10 |
protected function getConfig() {
|
11 |
return Mage::getModel('ceneopl/config');
|
12 |
}
|
241 |
$imageResizedDir = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA)
|
242 |
. DS . "catalog" . DS . "product" . DS . "ceneopl";
|
243 |
$imagesBaseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product';
|
244 |
+
if (is_null($this->_imageObj)) {
|
245 |
+
$this->_imageObj = new Ceneopl_Varien_Image();
|
246 |
+
}
|
247 |
if (file_exists($imageDir . $imageFile)) {
|
248 |
+
try {
|
249 |
+
$this->_imageObj->reload($imageDir . $imageFile);
|
250 |
+
$width = $this->_imageObj->getOriginalWidth();
|
251 |
+
$height = $this->_imageObj->getOriginalHeight();
|
252 |
+
if ($width > 2000 || $height > 2000) {
|
253 |
+
if (!file_exists($imageResizedDir . $imageFile)) {
|
254 |
+
$this->_imageObj->constrainOnly(true);
|
255 |
+
$this->_imageObj->keepAspectRatio(true);
|
256 |
+
$this->_imageObj->keepFrame(false);
|
257 |
+
$this->_imageObj->resize(2000, 2000);
|
258 |
+
$this->_imageObj->save($imageResizedDir . $imageFile);
|
259 |
+
Mage::log('Image resized for Ceneo feed: ' . $imageFile, null, 'ceneopl.log');
|
260 |
+
}
|
261 |
+
$imagesBaseUrl .= '/ceneopl';
|
262 |
}
|
263 |
+
} catch (Exception $e) {
|
264 |
+
Mage::log('Problem with image file (' . $e->getMessage() . '): ' . $imageFile, null, 'ceneopl.log');
|
265 |
}
|
266 |
}
|
267 |
return $imagesBaseUrl . $imageFile;
|
app/code/community/Orba/Ceneopl/data/ceneopl_setup/data-upgrade-1.1.0-1.1.1.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @copyright Copyright (c) 2016 Orba Sp. z o.o. (http://orba.pl)
|
4 |
+
*/
|
5 |
+
|
6 |
+
/**
|
7 |
+
* @var $this Orba_Ceneopl_Model_Mysql4_Setup
|
8 |
+
*/
|
9 |
+
|
10 |
+
$this->sendPing('1.1.1', true);
|
app/code/community/Orba/Ceneopl/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Orba_Ceneopl>
|
5 |
-
<version>1.1.
|
6 |
</Orba_Ceneopl>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Orba_Ceneopl>
|
5 |
+
<version>1.1.1</version>
|
6 |
</Orba_Ceneopl>
|
7 |
</modules>
|
8 |
<frontend>
|
lib/Ceneopl/Varien/Image.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @copyright Copyright (c) 2016 Orba Sp. z o.o. (http://orba.co)
|
4 |
+
*/
|
5 |
+
|
6 |
+
class Ceneopl_Varien_Image extends Varien_Image
|
7 |
+
{
|
8 |
+
/**
|
9 |
+
* Loads new image using current adapter.
|
10 |
+
* This prevents memory leaks when loading a lot of images in one run using standard Varien_Image.
|
11 |
+
* @param string $fileName
|
12 |
+
* @throws Exception
|
13 |
+
*/
|
14 |
+
public function reload($fileName = null)
|
15 |
+
{
|
16 |
+
if (isset($this->_imageHandler)) {
|
17 |
+
@imagedestroy($this->_imageHandler);
|
18 |
+
}
|
19 |
+
$this->_fileName = $fileName;
|
20 |
+
if (isset($fileName) ) {
|
21 |
+
$this->open();
|
22 |
+
}
|
23 |
+
}
|
24 |
+
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Orba_Ceneopl</name>
|
4 |
-
<version>1.1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
|
7 |
<channel>community</channel>
|
@@ -12,11 +12,11 @@ Documentation will be available soon. Please, check the screenshots instead.
|
|
12 |

|
13 |
Moduł ten pozwala zmapować atrybuty Twoich produktów z głównymi atrybutami z Ceneo.pl oraz przypisać Twoje produkty do konkretnych kategorii z Ceneo.pl, używając masowych akcji lub po prostu edytując produkty jeden po drugim. Następnie, daje Ci adresy URL do dynamicznie generowanych plików XML (jeden dla każdego store view), które możesz dodać do swoich kont w Ceneo.pl.
|
14 |
Dokumentacja będzie dostępna wkrótce. Tymczasem, pomocne moga okazać się zrzuty ekranów.</description>
|
15 |
-
<notes>-
|
16 |
<authors><author><name>ORBA</name><user>orba</user><email>magento@orba.pl</email></author></authors>
|
17 |
-
<date>2016-
|
18 |
-
<time>
|
19 |
-
<contents><target name="magecommunity"><dir name="Orba"><dir name="Ceneopl"><dir name="Block"><dir name="Admin"><dir name="Mapping"><dir name="Edit"><file name="Form.php" hash="399a6e2bf6c7e46245978a67ba8ee09c"/></dir><file name="Edit.php" hash="ff6f83712b0c132fb41fec6100da8e2a"/><file name="Grid.php" hash="f58762ca1761214e03eae42ac2f71aac"/></dir><file name="Mapping.php" hash="fb7353651db0c1cd76e763c46ecf84af"/><dir name="Offer"><file name="Grid.php" hash="8ca40a0b04b1eadb160b009a392e6d63"/><dir name="Urls"><file name="Grid.php" hash="5796223b6161b5216ec694455580877d"/></dir><file name="Urls.php" hash="563e39422019b4951e86bf28ce88be08"/></dir><file name="Offer.php" hash="4c4e743ee322f512efd4df3d1228cb76"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d15ea4514933d0288a2413db00823693"/></dir><dir name="Model"><file name="Attribute.php" hash="4c934d5f7ce4a97a6d77e1b4d7e87d22"/><dir name="Catalog"><file name="Category.php" hash="ca7606bb0cad983086682f10ec965f6c"/></dir><file name="Category.php" hash="b156511d62f255a5fe5cc618175edc77"/><file name="Config.php" hash="e0e12c2a6aeead4f66e84d9215b9dada"/><dir name="Mapping"><dir name="Catalog"><file name="Category.php" hash="0d7a8291e526194e96026787b131081e"/></dir></dir><file name="Mapping.php" hash="57c222b9e595c0582119ea9cba5cfa68"/><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="338bfafadc72bc96391f8c0ca5711f9f"/></dir><file name="Category.php" hash="9c33827a672b65938a75884e114bbf75"/><dir name="Mapping"><dir name="Catalog"><dir name="Category"><file name="Collection.php" hash="2e72f29cdbd11a5541bfac14d8a8a50a"/></dir><file name="Category.php" hash="c9853b8361ccb13dad12c0acb8661793"/></dir><file name="Collection.php" hash="781fbff81600c48eb328545f3eb4e471"/></dir><file name="Mapping.php" hash="3d8b32920e6d55819007bd88c5753ec6"/><file name="Setup.php" hash="cec11f8fbc2228a0aca226a05d594bed"/></dir><file name="Product.php" hash="
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Orba_Ceneopl</name>
|
4 |
+
<version>1.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/academic.php">Academic Free License (AFL)</license>
|
7 |
<channel>community</channel>
|
12 |

|
13 |
Moduł ten pozwala zmapować atrybuty Twoich produktów z głównymi atrybutami z Ceneo.pl oraz przypisać Twoje produkty do konkretnych kategorii z Ceneo.pl, używając masowych akcji lub po prostu edytując produkty jeden po drugim. Następnie, daje Ci adresy URL do dynamicznie generowanych plików XML (jeden dla każdego store view), które możesz dodać do swoich kont w Ceneo.pl.
|
14 |
Dokumentacja będzie dostępna wkrótce. Tymczasem, pomocne moga okazać się zrzuty ekranów.</description>
|
15 |
+
<notes>- fix for memory leak caused by loading a lot of images</notes>
|
16 |
<authors><author><name>ORBA</name><user>orba</user><email>magento@orba.pl</email></author></authors>
|
17 |
+
<date>2016-06-09</date>
|
18 |
+
<time>09:45:05</time>
|
19 |
+
<contents><target name="magecommunity"><dir name="Orba"><dir name="Ceneopl"><dir name="Block"><dir name="Admin"><dir name="Mapping"><dir name="Edit"><file name="Form.php" hash="399a6e2bf6c7e46245978a67ba8ee09c"/></dir><file name="Edit.php" hash="ff6f83712b0c132fb41fec6100da8e2a"/><file name="Grid.php" hash="f58762ca1761214e03eae42ac2f71aac"/></dir><file name="Mapping.php" hash="fb7353651db0c1cd76e763c46ecf84af"/><dir name="Offer"><file name="Grid.php" hash="8ca40a0b04b1eadb160b009a392e6d63"/><dir name="Urls"><file name="Grid.php" hash="5796223b6161b5216ec694455580877d"/></dir><file name="Urls.php" hash="563e39422019b4951e86bf28ce88be08"/></dir><file name="Offer.php" hash="4c4e743ee322f512efd4df3d1228cb76"/></dir></dir><dir name="Helper"><file name="Data.php" hash="d15ea4514933d0288a2413db00823693"/></dir><dir name="Model"><file name="Attribute.php" hash="4c934d5f7ce4a97a6d77e1b4d7e87d22"/><dir name="Catalog"><file name="Category.php" hash="ca7606bb0cad983086682f10ec965f6c"/></dir><file name="Category.php" hash="b156511d62f255a5fe5cc618175edc77"/><file name="Config.php" hash="e0e12c2a6aeead4f66e84d9215b9dada"/><dir name="Mapping"><dir name="Catalog"><file name="Category.php" hash="0d7a8291e526194e96026787b131081e"/></dir></dir><file name="Mapping.php" hash="57c222b9e595c0582119ea9cba5cfa68"/><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="338bfafadc72bc96391f8c0ca5711f9f"/></dir><file name="Category.php" hash="9c33827a672b65938a75884e114bbf75"/><dir name="Mapping"><dir name="Catalog"><dir name="Category"><file name="Collection.php" hash="2e72f29cdbd11a5541bfac14d8a8a50a"/></dir><file name="Category.php" hash="c9853b8361ccb13dad12c0acb8661793"/></dir><file name="Collection.php" hash="781fbff81600c48eb328545f3eb4e471"/></dir><file name="Mapping.php" hash="3d8b32920e6d55819007bd88c5753ec6"/><file name="Setup.php" hash="cec11f8fbc2228a0aca226a05d594bed"/></dir><file name="Product.php" hash="801b6b84595a7d6d5f0f372141f33461"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Ceneopl"><file name="MappingController.php" hash="3718ac7c179e47a58b18bb851de3235e"/><file name="OfferController.php" hash="f01f9fbfc6b9c770b7c1bfe65442daf1"/></dir></dir><file name="IndexController.php" hash="83d1694dfe519bd4419d1f34c6d0d426"/><file name="ProductsController.php" hash="f63384c0742e224568a2f2d634a1ba4e"/></dir><dir name="data"><dir name="ceneopl_setup"><file name="data-install-1.0.0.php" hash="b52f8d3ab15434e0777918b1ed435f0a"/><file name="data-upgrade-0.3.3-1.0.0.php" hash="d3ffb66e720099e186ad93fa58038598"/><file name="data-upgrade-1.0.2-1.1.0.php" hash="005f5261ae21459a3aa45cb5cd96635c"/><file name="data-upgrade-1.1.0-1.1.1.php" hash="48df0f59073f83c9e757a9c36e353090"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="b2949a45fa61be364401c8e1d0c1d459"/><file name="config.xml" hash="04804f96acbdfeb1fd6ab3b67461cb81"/><file name="system.xml" hash="e552ff41e29ab10e7ccecbd3d5d2e0b2"/></dir><dir name="sql"><dir name="ceneopl_setup"><file name="install-1.0.0.php" hash="39be5a7ca21d63543b59e19f844394d8"/><file name="mysql4-install-0.1.0.php" hash="ba5fee5905cdf2d51c9103e00d43da47"/><file name="mysql4-install-0.1.5.php" hash="a18774bf8456e9d5be704c31ecd52f6e"/><file name="mysql4-install-0.2.0.php" hash="1bce702593952d964f92d8e396caaea5"/><file name="mysql4-install-0.3.0.php" hash="229f9469861a23a0e4b5ac301188b178"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="f23bea9b310e25b84936e96dae4c40a5"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="32fa5ed7f5daafa1f64251065927fe76"/><file name="mysql4-upgrade-0.1.10-0.1.10.1.php" hash="1da3c1582ab0eeb169d2c1f325ebf5f7"/><file name="mysql4-upgrade-0.1.10.1-0.1.11.php" hash="80278787dba35beab849b078a36b4746"/><file name="mysql4-upgrade-0.1.11-0.2.0.php" hash="8054bf1d60c9071f2733b7f1449c9065"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="83f9e53f3ee498ced87a2f19cfe6d65d"/><file name="mysql4-upgrade-0.1.3-0.1.4.php" hash="987845dd887db121a783016ad89da724"/><file name="mysql4-upgrade-0.1.4-0.1.5.php" hash="1cf7ed3a4b6bf450f50d84bfd0e35dbb"/><file name="mysql4-upgrade-0.1.5-0.1.6.php" hash="23f8d6167791fccdd714577760b6a493"/><file name="mysql4-upgrade-0.1.6.1-0.1.7.php" hash="e51b21e07830628cafc4d0c06a866a05"/><file name="mysql4-upgrade-0.1.7-0.1.8.php" hash="1e1537398a0199184cb0a5e682ab818a"/><file name="mysql4-upgrade-0.1.8-0.1.9.php" hash="6f82e151d2e270ef22a01bf393e3ee91"/><file name="mysql4-upgrade-0.1.9-0.1.10.php" hash="3a2481167f7cf3fafd29e54e4bc0d495"/><file name="mysql4-upgrade-0.2.0-0.2.1.php" hash="1723ab67238857caf72e5257d8505241"/><file name="mysql4-upgrade-0.2.1-0.2.2.php" hash="f645d0a829664f8c97eaab0f7bf5caa2"/><file name="mysql4-upgrade-0.2.2-0.3.0.php" hash="d98385765cc3b9ea0cca5740dccece3a"/><file name="mysql4-upgrade-0.3.0-0.3.1.php" hash="3854ee260ce4158ddc2b2c6d1cf15dce"/><file name="mysql4-upgrade-0.3.1-0.3.2.php" hash="952f96888e9e5d7cc4692b980343b837"/><file name="mysql4-upgrade-0.3.2-0.3.3.php" hash="169ac610ff4c2cad1649ceafd9972d05"/><file name="upgrade-0.3.3-1.0.0.php" hash="a03cd9699597124071e95e90a7e4b60c"/><file name="upgrade-1.0.0-1.0.1.php" hash="a41515d243fd81201437acfedd3ca32a"/><file name="upgrade-1.0.1-1.0.1.1.php" hash="129f922dc9116faf6dc5125f722f49bb"/><file name="upgrade-1.0.1.1-1.0.2.php" hash="511a79277d2cc7b3883363aa9868c507"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="ceneopl"><dir name="mapping"><file name="edit.phtml" hash="6e1f1131d7f952e313cfb68e5bb65a05"/></dir><file name="mapping.phtml" hash="b45974b91bf07d80cbd1363f107b2271"/><dir name="offer"><file name="urls.phtml" hash="491e15c3bee269816aa2a7d88c6203f6"/></dir><file name="offer.phtml" hash="7da1798135793f99c569117b9076a3c4"/></dir></dir><dir name="layout"><file name="ceneopl.xml" hash="79a3f523e30960adfb0be84d6371f9a7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Orba_Ceneopl.xml" hash="c45256768710e7eb2b16eb898483bca5"/></dir></target><target name="magelocale"><dir name="pl_PL"><file name="Orba_Ceneopl.csv" hash="c3e5fcd9319cdf1401bffe7b6a978492"/></dir></target><target name="magelib"><dir name="Ceneopl"><dir name="Varien"><file name="Image.php" hash="edc7dc14325db88adc1ca7088ea369d4"/></dir><file name="simple_xml_extended.php" hash="1e72b54e04b09548dc3c7dd28500a05d"/></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|