LinnLiveConnect - Version 1.1.50

Version Notes

get info updates

Download this release

Release Info

Developer Albert Andrejev
Extension LinnLiveConnect
Version 1.1.50
Comparing to
See all releases


Code changes from version 1.1.49 to 1.1.50

app/code/local/LinnSystems/LinnLiveConnect/Model/Api/V2.php CHANGED
@@ -1,6 +1,37 @@
1
  <?php
2
  class Settings {
3
- const VERSION = 49;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
 
6
  class LinnSystems_LinnLiveConnect_Model_Api_V2 {
@@ -76,16 +107,16 @@ class LinnSystems_LinnLiveConnect_Model_Api_V2 {
76
  $worker = Factory::createWorker($version);
77
  return $worker->updatePriceBulk($data, $store, $identifierType);
78
  }
79
-
80
  public function debugInfo()
81
  {
82
- $worker = Factory::createWorker(Settings::VERSION);
83
  return $worker->debugInfo();
84
  }
85
-
86
- public function getGeneralInfo()
87
  {
88
- $worker = Factory::createWorker(Settings::VERSION);
89
  return $worker->getGeneralInfo();
90
  }
91
 
@@ -99,7 +130,7 @@ class Factory {
99
  $version = intval($version);
100
 
101
  if ($version == 0) throw new Mage_Api_Exception('version_not_specified');
102
- if (Settings::VERSION < $version ) throw new Mage_Api_Exception('wrong_version');
103
  }
104
 
105
  public static function createWorker($version)
@@ -769,6 +800,9 @@ class LinnLiveMain extends Mage_Core_Model_Abstract {
769
 
770
 
771
  protected function reindexSingleProduct($product){
 
 
 
772
  $event = Mage::getSingleton('index/indexer')->logEvent( $product, $product->getResource()->getType(), Mage_Index_Model_Event::TYPE_SAVE, false);
773
  Mage::getSingleton('index/indexer')->getProcessByCode('catalog_url')->setMode(Mage_Index_Model_Process::MODE_REAL_TIME)->processEvent($event);
774
  }
@@ -865,7 +899,7 @@ class LinnLiveMain extends Mage_Core_Model_Abstract {
865
  $productData->categories = $productData->category_ids;
866
 
867
  //merge into 1?
868
- $productAPI = new Mage_Catalog_Model_Product_Api_V2();
869
  $productId = $productAPI->create('configurable', $set, $sku, $productData, $store);
870
 
871
  list($assignedProductsArray, $attributesSetArray) = $this->_prepareConfigurableData($productsSet, $attributesSet, false);
@@ -956,7 +990,7 @@ class LinnLiveMain extends Mage_Core_Model_Abstract {
956
  $verInfo = Mage::getVersionInfo();
957
 
958
  $result = array(
959
- 'llc_ver' => Settings::VERSION,
960
  'magento_ver' => trim("{$verInfo['major']}.{$verInfo['minor']}.{$verInfo['revision']}" . ($verInfo['patch'] != '' ? ".{$verInfo['patch']}" : ""). "-{$verInfo['stability']}{$verInfo['number']}", '.-'),
961
  'php_ver' => phpversion(),
962
  'api_config' => $config
@@ -1398,23 +1432,23 @@ class LinnLiveMain extends Mage_Core_Model_Abstract {
1398
 
1399
  $productData = $this->_fixAttributes($productData);
1400
 
1401
- $productAPI = new Mage_Catalog_Model_Product_Api_V2();
1402
-
1403
  return $productAPI->create($type, $set, $sku, $productData, $store);
1404
  }
1405
-
1406
  public function debugInfo()
1407
  {
1408
  $verInfo = Mage::getVersionInfo();
1409
 
1410
  $result = array(
1411
- 'llc_ver' => Settings::VERSION,
1412
  'magento_ver' => $verInfo
1413
  );
1414
 
1415
  return $result;
1416
  }
1417
-
1418
  public function getProductStoreURL($productId, $store = null, $identifierType = 'id') {
1419
 
1420
  $storeId = $this->getStoreCode($store);
1
  <?php
2
  class Settings {
3
+ public static function getVersion() {
4
+ return Mage::getConfig()->getModuleConfig("LinnSystems_LinnLiveConnect")->version;
5
+ }
6
+ public static function getShortVersion(){
7
+ $version = explode('.',self::getVersion());
8
+ return array_pop($version);
9
+ }
10
+ }
11
+
12
+ class Mage_Catalog_Model_Product_Api_V2_LL extends Mage_Catalog_Model_Product_Api_V2{
13
+ public function create($type, $set, $sku, $productData, $store){
14
+ $tries = 0;
15
+ $maxtries = 3;
16
+ Mage::setIsDeveloperMode(true);
17
+
18
+ do {
19
+ $retry = false;
20
+ try {
21
+ return parent::create($type, $set, $sku, $productData, $store);
22
+ } catch (Exception $e) {
23
+
24
+ if ($tries < $maxtries && $e->getMessage()=='SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction') {
25
+ $retry = true;
26
+ sleep(1);
27
+ }else{
28
+ throw $e;
29
+ }
30
+ $tries++;
31
+ }
32
+
33
+ } while ($retry);
34
+ }
35
  }
36
 
37
  class LinnSystems_LinnLiveConnect_Model_Api_V2 {
107
  $worker = Factory::createWorker($version);
108
  return $worker->updatePriceBulk($data, $store, $identifierType);
109
  }
110
+ /*
111
  public function debugInfo()
112
  {
113
+ $worker = Factory::createWorker(Settings::getShortVersion());
114
  return $worker->debugInfo();
115
  }
116
+ */
117
+ public function getGeneralInfo($version)
118
  {
119
+ $worker = Factory::createWorker($version);
120
  return $worker->getGeneralInfo();
121
  }
122
 
130
  $version = intval($version);
131
 
132
  if ($version == 0) throw new Mage_Api_Exception('version_not_specified');
133
+ if (Settings::getShortVersion() < $version ) throw new Mage_Api_Exception('wrong_version');
134
  }
135
 
136
  public static function createWorker($version)
800
 
801
 
802
  protected function reindexSingleProduct($product){
803
+ /* $indexer = Mage::getSingleton('index/indexer');
804
+ $indexer->lockIndexer();
805
+ $indexer->unlockIndexer(); */
806
  $event = Mage::getSingleton('index/indexer')->logEvent( $product, $product->getResource()->getType(), Mage_Index_Model_Event::TYPE_SAVE, false);
807
  Mage::getSingleton('index/indexer')->getProcessByCode('catalog_url')->setMode(Mage_Index_Model_Process::MODE_REAL_TIME)->processEvent($event);
808
  }
899
  $productData->categories = $productData->category_ids;
900
 
901
  //merge into 1?
902
+ $productAPI = new Mage_Catalog_Model_Product_Api_V2_LL();
903
  $productId = $productAPI->create('configurable', $set, $sku, $productData, $store);
904
 
905
  list($assignedProductsArray, $attributesSetArray) = $this->_prepareConfigurableData($productsSet, $attributesSet, false);
990
  $verInfo = Mage::getVersionInfo();
991
 
992
  $result = array(
993
+ 'llc_ver' => Settings::getVersion(),
994
  'magento_ver' => trim("{$verInfo['major']}.{$verInfo['minor']}.{$verInfo['revision']}" . ($verInfo['patch'] != '' ? ".{$verInfo['patch']}" : ""). "-{$verInfo['stability']}{$verInfo['number']}", '.-'),
995
  'php_ver' => phpversion(),
996
  'api_config' => $config
1432
 
1433
  $productData = $this->_fixAttributes($productData);
1434
 
1435
+ $productAPI = new Mage_Catalog_Model_Product_Api_V2_LL();
1436
+
1437
  return $productAPI->create($type, $set, $sku, $productData, $store);
1438
  }
1439
+ /*
1440
  public function debugInfo()
1441
  {
1442
  $verInfo = Mage::getVersionInfo();
1443
 
1444
  $result = array(
1445
+ 'llc_ver' => Settings::getShortVersion(),
1446
  'magento_ver' => $verInfo
1447
  );
1448
 
1449
  return $result;
1450
  }
1451
+ */
1452
  public function getProductStoreURL($productId, $store = null, $identifierType = 'id') {
1453
 
1454
  $storeId = $this->getStoreCode($store);
app/code/local/LinnSystems/LinnLiveConnect/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <LinnSystems_LinnLiveConnect>
5
- <version>1.1.49</version>
6
  </LinnSystems_LinnLiveConnect>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <LinnSystems_LinnLiveConnect>
5
+ <version>1.1.50</version>
6
  </LinnSystems_LinnLiveConnect>
7
  </modules>
8
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>LinnLiveConnect</name>
4
- <version>1.1.49</version>
5
  <stability>stable</stability>
6
  <license>GPL v2</license>
7
  <channel>community</channel>
@@ -11,9 +11,9 @@
11
  Contains some workarounds to avoid bugs in original Magento modules and additional functionality to operate Magento store remotely.</description>
12
  <notes>get info updates</notes>
13
  <authors><author><name>Albert Andrejev</name><user>albert_andrejev</user><email>albert@linnsystems.com</email></author><author><name>Pavel Nikolajev</name><user>Pavel_LL2</user><email>pavel.nokolajev@linnsystems.com</email></author><author><name>Aleksandr Kornev</name><user>alex_LL2</user><email>alex.kornevs@linnsystems.com</email></author></authors>
14
- <date>2014-07-28</date>
15
- <time>10:42:22</time>
16
- <contents><target name="magelocal"><dir name="LinnSystems"><dir name="LinnLiveConnect"><dir name="Helper"><file name="Data.php" hash="5fe5216de67d4e69a0f418b0cd7780ee"/></dir><dir name="Model"><dir name="Api"><file name="V2.php" hash="e032a191ae1430bf76320797376e3f80"/></dir></dir><dir name="etc"><file name="api.xml" hash="be095375b1cd4ebbe91185ae668f8f16"/><file name="config.xml" hash="099ea6a62646477f2c73ad476884b680"/><file name="wsdl.xml" hash="2b450fd6a6332d20583aaa4fc52012b6"/><file name="wsi.xml" hash="67b9b8ae64b953805556a5d243e148bc"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="LinnSystems_LinnLiveConnect.xml" hash="19c48712cd0516815d6784592ada0881"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>LinnLiveConnect</name>
4
+ <version>1.1.50</version>
5
  <stability>stable</stability>
6
  <license>GPL v2</license>
7
  <channel>community</channel>
11
  Contains some workarounds to avoid bugs in original Magento modules and additional functionality to operate Magento store remotely.</description>
12
  <notes>get info updates</notes>
13
  <authors><author><name>Albert Andrejev</name><user>albert_andrejev</user><email>albert@linnsystems.com</email></author><author><name>Pavel Nikolajev</name><user>Pavel_LL2</user><email>pavel.nokolajev@linnsystems.com</email></author><author><name>Aleksandr Kornev</name><user>alex_LL2</user><email>alex.kornevs@linnsystems.com</email></author></authors>
14
+ <date>2014-07-30</date>
15
+ <time>14:33:46</time>
16
+ <contents><target name="magelocal"><dir name="LinnSystems"><dir name="LinnLiveConnect"><dir name="Helper"><file name="Data.php" hash="5fe5216de67d4e69a0f418b0cd7780ee"/></dir><dir name="Model"><dir name="Api"><file name="V2.php" hash="1bb60f6979f2f853a034b72592b13bea"/></dir></dir><dir name="etc"><file name="api.xml" hash="be095375b1cd4ebbe91185ae668f8f16"/><file name="config.xml" hash="01c7e067e030e1d43b0863f84355d58c"/><file name="wsdl.xml" hash="2b450fd6a6332d20583aaa4fc52012b6"/><file name="wsi.xml" hash="67b9b8ae64b953805556a5d243e148bc"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="LinnSystems_LinnLiveConnect.xml" hash="19c48712cd0516815d6784592ada0881"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
19
  </package>