Wisepricer_Syncer2 - Version 2.0.0.3

Version Notes

First stable release.

Download this release

Release Info

Developer Pavel Zhytomirsky
Extension Wisepricer_Syncer2
Version 2.0.0.3
Comparing to
See all releases


Code changes from version 2.0.0.0 to 2.0.0.3

app/code/community/Wisepricer/Syncer2/Helper/Data.php CHANGED
@@ -53,6 +53,11 @@ class Wisepricer_Syncer2_Helper_Data extends Mage_Core_Helper_Abstract
53
  return implode(DS, array(Mage::getBaseDir('var'), self::PATH_VAR_WS2, self::PATH_IMPORT, $baseFile));
54
  }
55
 
 
 
 
 
 
56
  public function getToken()
57
  {
58
  return Mage::getStoreConfig(self::CONFIG_TOKEN);
53
  return implode(DS, array(Mage::getBaseDir('var'), self::PATH_VAR_WS2, self::PATH_IMPORT, $baseFile));
54
  }
55
 
56
+ public function getLogPath()
57
+ {
58
+ return implode(DS, array(Mage::getBaseDir('log'), self::LOG_FILENAME));
59
+ }
60
+
61
  public function getToken()
62
  {
63
  return Mage::getStoreConfig(self::CONFIG_TOKEN);
app/code/community/Wisepricer/Syncer2/Model/Observer.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Wisepricer_Syncer2_Model_Observer
3
+ {
4
+ /**
5
+ * Allow access to API Controller
6
+ * @param Varien_Event_Observer $observer
7
+ */
8
+ public function skipWebsiteRestriction(Varien_Event_Observer $observer)
9
+ {
10
+ $event = $observer->getEvent();
11
+ if ($event && $event->getController() instanceof Wisepricer_Syncer2_ApiController) {
12
+ if ($result = $event->getResult()) {
13
+ $result->setShouldProceed(false);
14
+ }
15
+ }
16
+ }
17
+ }
app/code/community/Wisepricer/Syncer2/controllers/ApiController.php CHANGED
@@ -22,6 +22,8 @@ class Wisepricer_Syncer2_ApiController extends Mage_Core_Controller_Front_Action
22
 
23
  CONST RESPONSE_CODE_FORBIDDEN = 403;
24
 
 
 
25
  protected $_processInstance = null;
26
 
27
  protected $jsonParams = null;
@@ -280,9 +282,19 @@ class Wisepricer_Syncer2_ApiController extends Mage_Core_Controller_Front_Action
280
 
281
  try {
282
 
283
- $this->_prepareDownloadResponse(basename($file), array(
 
 
 
 
 
 
 
 
 
 
284
  'type' => 'filename',
285
- 'value' => $this->getHelper()->getExportPath() . DS . basename($file),
286
  ));
287
 
288
 
22
 
23
  CONST RESPONSE_CODE_FORBIDDEN = 403;
24
 
25
+ CONST DEBUG_GET_LOG_FILE = 'LOGFILE';
26
+
27
  protected $_processInstance = null;
28
 
29
  protected $jsonParams = null;
282
 
283
  try {
284
 
285
+ $filePath = $this->getHelper()->getExportPath() . DS . basename($file);
286
+
287
+ if ($file === self::DEBUG_GET_LOG_FILE) {
288
+ $filePath = $this->getHelper()->getLogPath();
289
+ }
290
+
291
+ if (!file_exists($filePath)) {
292
+ $this->getHelper()->exception("File for export not found: $file");
293
+ }
294
+
295
+ $this->_prepareDownloadResponse(basename($filePath), array(
296
  'type' => 'filename',
297
+ 'value' => $filePath,
298
  ));
299
 
300
 
app/code/community/Wisepricer/Syncer2/etc/config.xml CHANGED
@@ -2,24 +2,15 @@
2
  <config>
3
  <modules>
4
  <Wisepricer_Syncer2>
5
- <version>2.0.0.0</version>
6
  <modulename>Wisepricer Syncer2</modulename>
7
  </Wisepricer_Syncer2>
8
  </modules>
9
  <global>
10
  <models>
11
  <wisepricer_syncer2>
12
- <class>Wisepricer_Syncer2_Model</class>
13
- <resourceModel>wisepricer_syncer2_mysql4</resourceModel>
14
  </wisepricer_syncer2>
15
- <wisepricer_syncer2_mysql4>
16
- <class>Wisepricer_Syncer2_Model_Mysql4</class>
17
- <entities>
18
- <state>
19
- <table>wisepricer_syncer2_state</table>
20
- </state>
21
- </entities>
22
- </wisepricer_syncer2_mysql4>
23
  </models>
24
  <resources>
25
  <wisepricer_syncer2_setup>
@@ -32,26 +23,20 @@
32
  </connection>
33
  </wisepricer_syncer2_setup>
34
  </resources>
35
- <blocks>
36
- <wisepricer_syncer2>
37
- <class>Wisepricer_Syncer2_Block</class>
38
- </wisepricer_syncer2>
39
- </blocks>
40
  <helpers>
41
  <wisepricer_syncer2>
42
  <class>Wisepricer_Syncer2_Helper</class>
43
  </wisepricer_syncer2>
44
  </helpers>
45
  <events>
46
- <wisepricer_syncer2_import_download_complete>
47
  <observers>
48
  <wisepricer_syncer2_observer>
49
- <type>singleton</type>
50
- <class>Wisepricer_Syncer2_Model_Observer</class>
51
- <method>importDownloadComplete</method>
52
  </wisepricer_syncer2_observer>
53
  </observers>
54
- </wisepricer_syncer2_import_download_complete>
55
  </events>
56
  </global>
57
  <frontend>
@@ -63,7 +48,21 @@
63
  <frontName>wisesyncer2</frontName>
64
  </args>
65
  </wisepricer_syncer2>
66
- </routers>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  </frontend>
68
  <default>
69
  <wisepricer_syncer2>
2
  <config>
3
  <modules>
4
  <Wisepricer_Syncer2>
5
+ <version>2.0.0.3</version>
6
  <modulename>Wisepricer Syncer2</modulename>
7
  </Wisepricer_Syncer2>
8
  </modules>
9
  <global>
10
  <models>
11
  <wisepricer_syncer2>
12
+ <class>Wisepricer_Syncer2_Model</class>
 
13
  </wisepricer_syncer2>
 
 
 
 
 
 
 
 
14
  </models>
15
  <resources>
16
  <wisepricer_syncer2_setup>
23
  </connection>
24
  </wisepricer_syncer2_setup>
25
  </resources>
 
 
 
 
 
26
  <helpers>
27
  <wisepricer_syncer2>
28
  <class>Wisepricer_Syncer2_Helper</class>
29
  </wisepricer_syncer2>
30
  </helpers>
31
  <events>
32
+ <websiterestriction_frontend>
33
  <observers>
34
  <wisepricer_syncer2_observer>
35
+ <class>wisepricer_syncer2/observer</class>
36
+ <method>skipWebsiteRestriction</method>
 
37
  </wisepricer_syncer2_observer>
38
  </observers>
39
+ </websiterestriction_frontend>
40
  </events>
41
  </global>
42
  <frontend>
48
  <frontName>wisesyncer2</frontName>
49
  </args>
50
  </wisepricer_syncer2>
51
+ </routers>
52
+ <enterprise>
53
+ <websiterestriction>
54
+ <full_action_names>
55
+ <generic>
56
+ <wisepricer_syncer2_api_ping />
57
+ <wisepricer_syncer2_api_getWebsites />
58
+ <wisepricer_syncer2_api_getAttributes />
59
+ <wisepricer_syncer2_api_exportFile />
60
+ <wisepricer_syncer2_api_importFile />
61
+ <wisepricer_syncer2_api_export />
62
+ </generic>
63
+ </full_action_names>
64
+ </websiterestriction>
65
+ </enterprise>
66
  </frontend>
67
  <default>
68
  <wisepricer_syncer2>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Wisepricer_Syncer2</name>
4
- <version>2.0.0.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>WisePricer is a new tool that allows you to Track &amp; monitor successful online retailers and update your store prices in real-time. With WisePricer you'll never get left behind the competition.</description>
11
  <notes>First stable release.</notes>
12
  <authors><author><name>Pavel Zhytomirsky</name><user>r3volut1oner</user><email>r3volut1oner@gmail.com</email></author></authors>
13
- <date>2015-09-02</date>
14
- <time>10:13:46</time>
15
- <contents><target name="magecommunity"><dir name="Wisepricer"><dir name="JobQueue"><dir name="Block"><dir name="Adminhtml"><dir name="Job"><file name="View.php" hash="aae12860e5c8c4b58f6d22372905ee7a"/></dir><dir name="Queue"><file name="Grid.php" hash="901021bad6652b9d4df6477fe893154a"/></dir><file name="Queue.php" hash="6f91a2d61d08d50fdf8c45c8857469be"/></dir></dir><dir name="Helper"><file name="Data.php" hash="055ae3239bd12f249a04ff46c27715d4"/></dir><dir name="Model"><dir name="Job"><file name="Abstract.php" hash="424f8974635068988567d637ab336d37"/></dir><file name="Job.php" hash="70aa35a24b5a972385187906cd01cf82"/><dir name="Resource"><dir name="Job"><file name="Collection.php" hash="69378351d91089d7c3e5f21c44c85ef2"/></dir><file name="Job.php" hash="9aa3bd32786cdf3d8a999d8c2fe1790e"/><file name="Setup.php" hash="c44ec3d6eed166951904d5ca7b654e40"/></dir><file name="Worker.php" hash="6b1e043cdc802851eecca990feb84f8f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="QueueController.php" hash="13e4a6e275dd92d8f6bfa4aef2860124"/></dir></dir><dir name="etc"><file name="config.xml" hash="cf1ed321c554546028181d31abf374e4"/></dir><dir name="sql"><dir name="wisepricer_jobqueue_setup"><file name="mysql4-install-1.0.0.0.php" hash="a6a1b8cd8254993835ddb6d047079dbf"/></dir></dir></dir><dir name="Syncer2"><file name="Exception.php" hash="02c7cdc73eaf99357a064cde11a92118"/><dir name="Helper"><file name="Data.php" hash="9a703e543cdd3e6e8b0647e61e86cc61"/></dir><dir name="Model"><file name="Abstract.php" hash="6bf02b02568f9693e26db9fc71c1fd00"/><file name="Exporter.php" hash="8dee6359099c961c238ae01cf4dbc29a"/><file name="Importer.php" hash="8819178eef966f3646c2c10015ffc95f"/></dir><dir name="controllers"><file name="ApiController.php" hash="b344fea43fc81815551e2ec172c6d98f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b40b1354d89057ce7ab80132b396cbf7"/><file name="config.xml" hash="8abb6452b90d7c7b3d3feef03d0feb48"/><file name="system.xml" hash="6e432cee618a82b158d4b2809cfa1f5f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wisepricer_Syncer2.xml" hash="42013aa3e5049f0ad3bd6932a4ad15be"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="wisepricer_syncer2"><file name="wiser_logo.png" hash="324530e55dada5d853c811ab31457db6"/></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="DJJob"><file name="DJJob.php" hash="b692e8d7a53a8a7096ea60d2cfd237f0"/><dir name="examples"><file name="HelloWorldJob.php" hash="3b7a9e4b1f912fb48acf5399f5fe33b9"/></dir><file name="jobs.sql" hash="d73a8213feedadf9dc9eb719fe33b935"/><dir name="test"><file name="custom_table_name.php" hash="3fbebd54f7814c9797107014c9cf0228"/><file name="database.php" hash="82e80af8b072a6276cd46dc4d09f937b"/><file name="original_database_configure.php" hash="e3acccdc25c6f876467c35729505626f"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Wisepricer_Syncer2</name>
4
+ <version>2.0.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
10
  <description>WisePricer is a new tool that allows you to Track &amp; monitor successful online retailers and update your store prices in real-time. With WisePricer you'll never get left behind the competition.</description>
11
  <notes>First stable release.</notes>
12
  <authors><author><name>Pavel Zhytomirsky</name><user>r3volut1oner</user><email>r3volut1oner@gmail.com</email></author></authors>
13
+ <date>2015-10-18</date>
14
+ <time>11:30:17</time>
15
+ <contents><target name="magecommunity"><dir name="Wisepricer"><dir name="JobQueue"><dir name="Block"><dir name="Adminhtml"><dir name="Job"><file name="View.php" hash="aae12860e5c8c4b58f6d22372905ee7a"/></dir><dir name="Queue"><file name="Grid.php" hash="901021bad6652b9d4df6477fe893154a"/></dir><file name="Queue.php" hash="6f91a2d61d08d50fdf8c45c8857469be"/></dir></dir><dir name="Helper"><file name="Data.php" hash="055ae3239bd12f249a04ff46c27715d4"/></dir><dir name="Model"><dir name="Job"><file name="Abstract.php" hash="424f8974635068988567d637ab336d37"/></dir><file name="Job.php" hash="70aa35a24b5a972385187906cd01cf82"/><dir name="Resource"><dir name="Job"><file name="Collection.php" hash="69378351d91089d7c3e5f21c44c85ef2"/></dir><file name="Job.php" hash="9aa3bd32786cdf3d8a999d8c2fe1790e"/><file name="Setup.php" hash="c44ec3d6eed166951904d5ca7b654e40"/></dir><file name="Worker.php" hash="6b1e043cdc802851eecca990feb84f8f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="QueueController.php" hash="13e4a6e275dd92d8f6bfa4aef2860124"/></dir></dir><dir name="etc"><file name="config.xml" hash="cf1ed321c554546028181d31abf374e4"/></dir><dir name="sql"><dir name="wisepricer_jobqueue_setup"><file name="mysql4-install-1.0.0.0.php" hash="a6a1b8cd8254993835ddb6d047079dbf"/></dir></dir></dir><dir name="Syncer2"><file name="Exception.php" hash="02c7cdc73eaf99357a064cde11a92118"/><dir name="Helper"><file name="Data.php" hash="59e3c2fcf36bacc990c7b2b6e4a9a3a5"/></dir><dir name="Model"><file name="Abstract.php" hash="6bf02b02568f9693e26db9fc71c1fd00"/><file name="Exporter.php" hash="8dee6359099c961c238ae01cf4dbc29a"/><file name="Importer.php" hash="8819178eef966f3646c2c10015ffc95f"/><file name="Observer.php" hash="090b0fe184fc7d7629e591eb41bd7c34"/></dir><dir name="controllers"><file name="ApiController.php" hash="235ef38e1d0d687b8b39ff9cf20f74fb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b40b1354d89057ce7ab80132b396cbf7"/><file name="config.xml" hash="2a923b1f2cf847e5e81bdcda630f3552"/><file name="system.xml" hash="6e432cee618a82b158d4b2809cfa1f5f"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wisepricer_Syncer2.xml" hash="42013aa3e5049f0ad3bd6932a4ad15be"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="wisepricer_syncer2"><file name="wiser_logo.png" hash="324530e55dada5d853c811ab31457db6"/></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="DJJob"><file name="DJJob.php" hash="b692e8d7a53a8a7096ea60d2cfd237f0"/><dir name="examples"><file name="HelloWorldJob.php" hash="3b7a9e4b1f912fb48acf5399f5fe33b9"/></dir><file name="jobs.sql" hash="d73a8213feedadf9dc9eb719fe33b935"/><dir name="test"><file name="custom_table_name.php" hash="3fbebd54f7814c9797107014c9cf0228"/><file name="database.php" hash="82e80af8b072a6276cd46dc4d09f937b"/><file name="original_database_configure.php" hash="e3acccdc25c6f876467c35729505626f"/></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>