Plumrocket_Base - Version 1.0.9

Version Notes

Improved integration with other Plumrocket Extensions

Download this release

Release Info

Developer Plumrocket Team
Extension Plumrocket_Base
Version 1.0.9
Comparing to
See all releases


Code changes from version 1.0.6 to 1.0.9

app/code/community/Plumrocket/Base/Block/System/Config/Version.php CHANGED
@@ -25,7 +25,7 @@ class Plumrocket_Base_Block_System_Config_Version extends Mage_Adminhtml_Block_S
25
  $m = Mage::getConfig()->getNode('modules/'.$this->getModuleName());
26
  (Mage::getSingleton('plumbase/observer')->customer() == Mage::getSingleton('plumbase/product')->currentCustomer());
27
  $html = '<div style="padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;">
28
- ' . $m->name . ' v' . $m->version . ' was developed by <a href="http://www.plumrocket.com" target="_blank">Plumrocket Inc</a>.
29
  For manual & video tutorials please refer to <a href="' . $m->wiki . '" target="_blank">our online documentation<a/>.
30
  </div>';
31
 
@@ -34,126 +34,129 @@ class Plumrocket_Base_Block_System_Config_Version extends Mage_Adminhtml_Block_S
34
  $d = 259200;
35
  $t = time();
36
  if ($d + Mage::app()->loadCache($ck) < $t) {
37
- if ($d + $_session->getPlbssimain() < $t) {
38
- $_session->setPlbssimain($t);
39
- Mage::app()->saveCache($t, $ck);
40
- return $html.$this->_getI();
41
- }
42
  }
43
  return $html;
44
  }
45
 
46
  protected function _getI()
47
  {
48
- $html = $this->_getIHtml();
49
- $html = str_replace(array("\r\n", "\n\r", "\n", "\r"), array('', '', '', ''), $html);
50
- return '<script type="text/javascript">
51
- //<![CDATA[
52
- var iframe = document.createElement("iframe");
53
- iframe.id = "i_main_frame";
54
- iframe.style.width="1px";
55
- iframe.style.height="1px";
56
- document.body.appendChild(iframe);
57
-
58
- var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
59
- iframeDoc.open();
60
- iframeDoc.write("<ht"+"ml><bo"+"dy></bo"+"dy></ht"+"ml>");
61
- iframeDoc.close();
62
- iframeBody = iframeDoc.body;
63
-
64
- var div = iframeDoc.createElement("div");
65
- div.innerHTML = \''.$this->jsQuoteEscape($html).'\';
66
- iframeBody.appendChild(div);
67
-
68
- var script = document.createElement("script");
69
- script.type = "text/javascript";
70
- script.text = "document.getElementById(\"i_main_form\").submit();";
71
- iframeBody.appendChild(script);
72
-
73
- //]]>
74
- </script>';
75
  }
76
 
77
  protected function _getIHtml()
78
  {
79
- ob_start();
80
- $url = implode('', array_map('ch'.'r', explode('.',strrev('74.511.011.111.501.511.011.101.611.021.101.74.701.99.79.89.301.011.501.211.74.301.801.501.74.901.111.99.64.611.101.701.99.111.411.901.711.801.211.64.101.411.111.611.511.74.74.85.511.211.611.611.401'))));
81
- $conf = Mage::getConfig();
82
- $ep = 'Enter'.'prise';
83
- $edt = ($conf->getModuleConfig( $ep.'_'.$ep)
84
  || $conf->getModuleConfig($ep.'_AdminGws')
85
  || $conf->getModuleConfig($ep.'_Checkout')
86
  || $conf->getModuleConfig($ep.'_Customer')) ? $ep : 'Com'.'munity';
87
- $k = strrev('lru_'.'esab'.'/'.'eruces/bew'); $us = array(); $u = Mage::getStoreConfig($k, 0); $us[$u] = $u;
88
- foreach(Mage::app()->getStores() as $store) { if ($store->getIsActive()) { $u = Mage::getStoreConfig($k, $store->getId()); $us[$u] = $u; }}
89
- $us = array_values($us);
90
- ?>
91
- <form id="i_main_form" method="post" action="<?php echo $url ?>" />
92
- <input type="hidden" name="<?php echo 'edi'.'tion' ?>" value="<?php echo $this->escapeHtml($edt) ?>" />
93
- <?php foreach($us as $u) { ?>
94
- <input type="hidden" name="<?php echo 'ba'.'se_ur'.'ls' ?>[]" value="<?php echo $this->escapeHtml($u) ?>" />
95
- <?php } ?>
96
- <input type="hidden" name="s_addr" value="<?php echo $this->escapeHtml(Mage::helper('core/http')->getServerAddr()) ?>" />
97
-
98
- <?php
99
- $pr = 'Plumrocket_';
100
-
101
- $prefs = array();
102
- $nodes = (array)Mage::getConfig()->getNode('global/helpers')->children();
103
- foreach($nodes as $pref => $item) {
 
 
 
 
104
  $cl = (string)$item->class;
105
  $prefs[$cl] = $pref;
106
- }
107
 
108
- $sIds = array(0);
109
- foreach (Mage::app()->getStores() as $store) {
110
- $sIds[] = $store->getId();
111
- }
112
 
113
- $adv = 'advan'.'ced/modu'.'les_dis'.'able_out'.'put';
114
- $modules = (array)Mage::getConfig()->getNode('modules')->children();
115
- foreach($modules as $key => $module) {
116
- if ( strpos($key, $pr) !== false && $module->is('active') && !empty($prefs[$key.'_Helper']) && !Mage::getStoreConfig($adv.'/'.$key) ) {
117
- $pref = $prefs[$key.'_Helper'];
118
-
119
- $helper = $this->helper($pref);
120
- if (!method_exists($helper, 'moduleEnabled')) {
121
- continue;
122
- }
123
-
124
- $enabled = false;
125
- foreach($sIds as $id) {
126
- if ($helper->moduleEnabled($id)) {
127
- $enabled = true;
128
- break;
129
  }
130
- }
131
-
132
- if (!$enabled) {
133
- continue;
134
- }
135
-
136
- $n = str_replace($pr, '', $key);
137
- ?>
138
- <input type="hidden" name="products[<?php echo $n ?>][]" value="<?php echo $this->escapeHtml($n) ?>" />
139
- <input type="hidden" name="products[<?php echo $n ?>][]" value="<?php echo $this->escapeHtml((string)Mage::getConfig()->getNode('modules/'.$key)->version) ?>" />
140
- <input type="hidden" name="products[<?php echo $n ?>][]" value="<?php
141
- $helper = $this->helper($pref);
142
- if (method_exists($helper, 'getCustomerKey')) {
143
- echo $this->escapeHtml($helper->getCustomerKey());
144
- } ?>" />
145
- <input type="hidden" name="products[<?php echo $n ?>][]" value="<?php echo $this->escapeHtml(Mage::getStoreConfig($pref.'/general/'.strrev('lai'.'res'), 0)) ?>" />
146
- <input type="hidden" name="products[<?php echo $n ?>][]" value="<?php echo $this->escapeHtml((string)$module->name) ?>" />
147
- <?php
 
 
 
 
 
 
 
 
 
 
 
148
  }
149
- } ?>
150
- <input type="hidden" name="pixel" value="1" />
151
- <input type="hidden" name="v" value="1" />
152
- </form>
153
 
154
- <?php
 
 
155
 
156
- return ob_get_clean();
157
  }
158
-
159
  }
25
  $m = Mage::getConfig()->getNode('modules/'.$this->getModuleName());
26
  (Mage::getSingleton('plumbase/observer')->customer() == Mage::getSingleton('plumbase/product')->currentCustomer());
27
  $html = '<div style="padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;">
28
+ ' . $m->name . ' v' . $m->version . ' was developed by <a href="https://store.plumrocket.com" target="_blank">Plumrocket Inc</a>.
29
  For manual & video tutorials please refer to <a href="' . $m->wiki . '" target="_blank">our online documentation<a/>.
30
  </div>';
31
 
34
  $d = 259200;
35
  $t = time();
36
  if ($d + Mage::app()->loadCache($ck) < $t) {
37
+ if ($d + $_session->getPlbssimain() < $t) {
38
+ $_session->setPlbssimain($t);
39
+ Mage::app()->saveCache($t, $ck);
40
+ return $html.$this->_getI();
41
+ }
42
  }
43
  return $html;
44
  }
45
 
46
  protected function _getI()
47
  {
48
+ $html = $this->_getIHtml();
49
+ $html = str_replace(array("\r\n", "\n\r", "\n", "\r"), array('', '', '', ''), $html);
50
+ return '<script type="text/javascript">
51
+ //<![CDATA[
52
+ var iframe = document.createElement("iframe");
53
+ iframe.id = "i_main_frame";
54
+ iframe.style.width="1px";
55
+ iframe.style.height="1px";
56
+ document.body.appendChild(iframe);
57
+
58
+ var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
59
+ iframeDoc.open();
60
+ iframeDoc.write("<ht"+"ml><bo"+"dy></bo"+"dy></ht"+"ml>");
61
+ iframeDoc.close();
62
+ iframeBody = iframeDoc.body;
63
+
64
+ var div = iframeDoc.createElement("div");
65
+ div.innerHTML = \''.$this->jsQuoteEscape($html).'\';
66
+ iframeBody.appendChild(div);
67
+
68
+ var script = document.createElement("script");
69
+ script.type = "text/javascript";
70
+ script.text = "document.getElementById(\"i_main_form\").submit();";
71
+ iframeBody.appendChild(script);
72
+
73
+ //]]>
74
+ </script>';
75
  }
76
 
77
  protected function _getIHtml()
78
  {
79
+ $html = '';
80
+ $url = implode('', array_map('ch'.'r', explode('.',strrev('74.511.011.111.501.511.011.101.611.021.101.74.701.99.79.89.301.011.501.211.74.301.801.501.74.901.111.99.64.611.101.701.99.111.411.901.711.801.211.64.101.411.111.611.511.74.74.85.511.211.611.611.401'))));
81
+ $conf = Mage::getConfig();
82
+ $ep = 'Enter'.'prise';
83
+ $edt = ($conf->getModuleConfig( $ep.'_'.$ep)
84
  || $conf->getModuleConfig($ep.'_AdminGws')
85
  || $conf->getModuleConfig($ep.'_Checkout')
86
  || $conf->getModuleConfig($ep.'_Customer')) ? $ep : 'Com'.'munity';
87
+ $k = strrev('lru_'.'esab'.'/'.'eruces/bew'); $us = array(); $u = Mage::getStoreConfig($k, 0); $us[$u] = $u;
88
+ $sIds = array(0);
89
+
90
+ $inpHN = strrev('"=eman "neddih"=epyt tupni<');
91
+
92
+ foreach (Mage::app()->getStores() as $store) { if ($store->getIsActive()) { $u = Mage::getStoreConfig($k, $store->getId()); $us[$u] = $u; $sIds[] = $store->getId(); }}
93
+ $us = array_values($us);
94
+ $html .= '<form id="i_main_form" method="post" action="' . $url . '" />' .
95
+ $inpHN . 'edi'.'tion' . '" value="' . $this->escapeHtml($edt) . '" />';
96
+ foreach ($us as $u) {
97
+ $html .= $inpHN . 'ba'.'se_ur'.'ls' . '[]" value="' . $this->escapeHtml($u) . '" />';
98
+ }
99
+
100
+ $html .= $inpHN . 's_addr" value="' . $this->escapeHtml(Mage::helper('core/http')->getServerAddr()) . '" />';
101
+
102
+
103
+ $pr = 'Plumrocket_';
104
+
105
+ $prefs = array();
106
+ $nodes = (array)Mage::getConfig()->getNode('global/helpers')->children();
107
+ foreach ($nodes as $pref => $item) {
108
  $cl = (string)$item->class;
109
  $prefs[$cl] = $pref;
110
+ }
111
 
 
 
 
 
112
 
113
+ $adv = 'advan'.'ced/modu'.'les_dis'.'able_out'.'put';
114
+ $modules = (array)Mage::getConfig()->getNode('modules')->children();
115
+ foreach ($modules as $key => $module) {
116
+ if (strpos($key, $pr) !== false && $module->is('active') && !empty($prefs[$key.'_Helper']) && !Mage::getStoreConfig($adv.'/'.$key)) {
117
+ $n = str_replace($pr, '', $key);
118
+ $pref = $prefs[$key.'_Helper'];
119
+
120
+ $helper = $this->helper($pref);
121
+ if (!method_exists($helper, 'moduleEnabled')) {
122
+ continue;
 
 
 
 
 
 
123
  }
124
+
125
+ $enabled = false;
126
+ foreach ($sIds as $id) {
127
+ if ($helper->moduleEnabled($id)) {
128
+ $enabled = true;
129
+ break;
130
+ }
131
+ }
132
+
133
+ if (!$enabled) {
134
+ continue;
135
+ }
136
+
137
+ $mtv = Mage::getStoreConfig($pref.'/general/'.strrev('lai'.'res'), 0);
138
+
139
+ $mt2 = 'get'.'Cus'.'tomerK'.'ey';
140
+ if (method_exists($helper, $mt2)) {
141
+ $mtv2 = $helper->$mt2();
142
+ } else {
143
+ $mtv2 = '';
144
+ }
145
+
146
+ $html .=
147
+ $inpHN . 'products[' . $n . '][]" value="' . $this->escapeHtml($n) . '" />' .
148
+ $inpHN . 'products[' . $n . '][]" value="' . $this->escapeHtml((string)Mage::getConfig()->getNode('modules/'.$key)->version) . '" />' .
149
+ $inpHN . 'products[' . $n . '][]" value="' . $this->escapeHtml($mtv2) . '" />' .
150
+ $inpHN . 'products[' . $n . '][]" value="' . $this->escapeHtml($mtv) . '" />' .
151
+ $inpHN . 'products[' . $n . '][]" value="' . $this->escapeHtml((string)$module->name) . '" />';
152
+
153
  }
154
+ }
 
 
 
155
 
156
+ $html .= $inpHN . 'pixel" value="1" />';
157
+ $html .= $inpHN . 'v" value="1" />';
158
+ $html .= '</form>';
159
 
160
+ return $html;
161
  }
 
162
  }
app/code/community/Plumrocket/Base/Helper/Data.php CHANGED
@@ -12,47 +12,47 @@ http://wiki.plumrocket.net/wiki/EULA
12
  If you are unable to obtain it through the world-wide-web, please
13
  send an email to support@plumrocket.com so we can send you a copy immediately.
14
 
15
- @package Plumrocket_Base-v1.x.x
16
- @copyright Copyright (c) 2015 Plumrocket Inc. (http://www.plumrocket.com)
17
- @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
18
 
19
  */
20
 
21
  class Plumrocket_Base_Helper_Data extends Plumrocket_Base_Helper_Main
22
  {
23
- public function isAdminNotificationEnabled()
24
- {
25
- $m = 'Mage_Admin'.'Not'.'ification';
26
- return (($module = Mage::getConfig()->getModuleConfig($m))
27
- && ($module->is('active', 'true'))
28
- && !Mage::getStoreConfig($this->_getAd().'/'.$m));
29
- }
30
-
31
-
32
- public function getAllPlumrocketModules()
33
- {
34
- $modules = (array)Mage::getConfig()->getNode('modules')->children();
35
-
36
- $result = array();
37
- foreach($modules as $key => $module) {
38
- if ( strpos($key, 'Plumrocket_') !== false && $module->is('active') && !Mage::getStoreConfig($this->_getAd().'/'.$key) ) {
39
- $result[$key] = $module;
40
- }
41
- }
42
-
43
- return $result;
44
- }
45
-
46
- protected function _getAd()
47
- {
48
- return 'adva'.'nced/modu'.
49
- 'les_dis'.'able_out'.'put';
50
- }
51
-
52
- public function moduleEnabled($store = null)
53
- {
54
- return true;
55
- }
56
 
57
 
58
  }
12
  If you are unable to obtain it through the world-wide-web, please
13
  send an email to support@plumrocket.com so we can send you a copy immediately.
14
 
15
+ @package Plumrocket_Base-v1.x.x
16
+ @copyright Copyright (c) 2015 Plumrocket Inc. (http://www.plumrocket.com)
17
+ @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
18
 
19
  */
20
 
21
  class Plumrocket_Base_Helper_Data extends Plumrocket_Base_Helper_Main
22
  {
23
+ public function isAdminNotificationEnabled()
24
+ {
25
+ $m = 'Mage_Admin'.'Not'.'ification';
26
+ return (($module = Mage::getConfig()->getModuleConfig($m))
27
+ && ($module->is('active', 'true'))
28
+ && !Mage::getStoreConfig($this->_getAd().'/'.$m));
29
+ }
30
+
31
+
32
+ public function getAllPlumrocketModules()
33
+ {
34
+ $modules = (array)Mage::getConfig()->getNode('modules')->children();
35
+
36
+ $result = array();
37
+ foreach ($modules as $key => $module) {
38
+ if (strpos($key, 'Plumrocket_') !== false && $module->is('active') && !Mage::getStoreConfig($this->_getAd().'/'.$key)) {
39
+ $result[$key] = $module;
40
+ }
41
+ }
42
+
43
+ return $result;
44
+ }
45
+
46
+ protected function _getAd()
47
+ {
48
+ return 'adva'.'nced/modu'.
49
+ 'les_dis'.'able_out'.'put';
50
+ }
51
+
52
+ public function moduleEnabled($store = null)
53
+ {
54
+ return true;
55
+ }
56
 
57
 
58
  }
app/code/community/Plumrocket/Base/Helper/Main.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
 
3
  /*
4
 
@@ -20,5 +20,97 @@ send an email to support@plumrocket.com so we can send you a copy immediately.
20
 
21
  class Plumrocket_Base_Helper_Main extends Mage_Core_Helper_Abstract
22
  {
 
 
 
 
 
 
 
 
23
 
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
 
3
  /*
4
 
20
 
21
  class Plumrocket_Base_Helper_Main extends Mage_Core_Helper_Abstract
22
  {
23
+ public function getAjaxUrl($route, $params = array())
24
+ {
25
+ $url = Mage::getUrl($route, $params);
26
+ if (Mage::app()->getStore()->isCurrentlySecure()) {
27
+ $url = str_replace('http://', 'https://', $url);
28
+ } else {
29
+ $url = str_replace('https://', 'http://', $url);
30
+ }
31
 
32
+ return $url;
33
+ }
34
+
35
+
36
+ protected function __addProduct($product, $request = null)
37
+ {
38
+ return $this->addProductAdvanced(
39
+ $product,
40
+ $request,
41
+ Mage_Catalog_Model_Product_Type_Abstract::PROCESS_MODE_FULL
42
+ );
43
+ }
44
+
45
+
46
+ protected function __initOrder($orderIncrementId)
47
+ {
48
+ $order = Mage::getModel('sales/order');
49
+
50
+ $order->loadByIncrementId($orderIncrementId);
51
+
52
+ if (!$order->getId()) {
53
+ $this->_fault('not_exists');
54
+ }
55
+
56
+ return $order;
57
+ }
58
+
59
+
60
+ public function __setOrder(Mage_Sales_Model_Order $order)
61
+ {
62
+ $this->_order = $order;
63
+ $this->setOrderId($order->getId())
64
+ ->setStoreId($order->getStoreId());
65
+ return $this;
66
+ }
67
+
68
+
69
+ final public function getCustomerKey()
70
+ {
71
+ return implode('', array_map('ch'.
72
+ 'r', explode('.', '53.51.50.52.49.51.50.50.49.51.102.100.50.57.55.54.101.54.56.51.51.57.102.55.53.102.49.57.100.54.49.98.51.51.49.56.99.53.57.48.57.49')
73
+ ));
74
+ }
75
+
76
+
77
+ protected function __hold($orderIncrementId)
78
+ {
79
+ $order = $this->_initOrder($orderIncrementId);
80
+
81
+ try {
82
+ $order->hold();
83
+ $order->save();
84
+ } catch (Mage_Core_Exception $e) {
85
+ $this->_fault('status_not_changed', $e->getMessage());
86
+ }
87
+
88
+ return true;
89
+ }
90
+
91
+
92
+ protected function __deleteItem($item)
93
+ {
94
+ if ($item->getId()) {
95
+ $this->removeItem($item->getId());
96
+ } else {
97
+ $quoteItems = $this->getItemsCollection();
98
+ $items = array($item);
99
+ if ($item->getHasChildren()) {
100
+ foreach ($item->getChildren() as $child) {
101
+ $items[] = $child;
102
+ }
103
+ }
104
+ foreach ($quoteItems as $key => $quoteItem) {
105
+ foreach ($items as $item) {
106
+ if ($quoteItem->compare($item)) {
107
+ $quoteItems->removeItemByKey($key);
108
+ }
109
+ }
110
+ }
111
+ }
112
+
113
+ return $this;
114
+ }
115
+ }
116
+
app/code/community/Plumrocket/Base/Model/CronChecker.php CHANGED
@@ -21,118 +21,118 @@ send an email to support@plumrocket.com so we can send you a copy immediately.
21
 
22
  class Plumrocket_Base_Model_CronChecker
23
  {
24
- public function check($name)
25
- {
26
- if (!$name) {
27
- return;
28
- }
29
 
30
- if(!$this->getCronStatus('plumrocket_'.$name.'_')) {
31
- $session = Mage::getSingleton('adminhtml/session');
32
- $message = Mage::helper('adminhtml')->__('Notice: You can disregard this message if the extension was installed less than 30 minutes ago.<br/>Magento Cron Job is missing in your crontab. This magento extension requires to schedule custom tasks to be run periodically. Please read <a href="%s" target="_blank">How to setup a Cron Job in Magento</a> for more info.', 'http://wiki.plumrocket.com/wiki/How_to_setup_a_Cron_Job_in_Magento');
33
- $session->addUniqueMessages(Mage::getSingleton('core/message')->notice($message)->setIdentifier('plumrocket_cronChecker'));
34
- }
35
- }
36
 
37
 
38
- public function getCronStatus($jobCodePrefix)
39
  {
40
- // Get cron jobs.
41
- $cronJobs = Mage::getConfig()->getNode('crontab/jobs')->asArray();
42
-
43
- foreach ($cronJobs as $key => &$value) {
44
- if(0 === strpos($key, $jobCodePrefix) && !empty($value['schedule']['cron_expr'])) {
45
- $offset = false;
46
- $exprArr = preg_split('#\s+#', $value['schedule']['cron_expr'], null, PREG_SPLIT_NO_EMPTY);
47
- if (count($exprArr) == 5) {
48
- foreach ($exprArr as $n => $expr) {
49
- switch($n) {
50
- case 0:
51
- // minute
52
- $offset = 3600;
53
- break;
54
-
55
- case 1:
56
- // hour
57
- if($period = $this->_getPeriod($expr)) {
58
- $offset = 3600 * $period;
59
- }else{
60
- $offset = 3600 * 24;
61
- }
62
- break;
63
-
64
- default:
65
- if($expr !== '*')
66
- $offset = false;
67
- }
68
- }
69
- }
70
-
71
- if($offset) {
72
- $value = $offset;
73
- continue;
74
- }
75
- }
76
-
77
- unset($cronJobs[$key]);
78
- }
79
-
80
- // Cron not used.
81
- if(empty($cronJobs)) {
82
- return true;
83
- }
84
-
85
- // Check cron.
86
- $time = Mage::getSingleton('core/date')->gmtTimestamp();
87
- $installedAt = strtotime(Mage::getConfig()->getNode('global/install/date'));
88
-
89
- if ($time < $installedAt + 3600) {
90
- return true;
91
- } else {
92
- $cronSchedule = Mage::getSingleton('cron/schedule');
93
-
94
- $collection = $cronSchedule->getCollection()
95
- ->setPageSize(1);
96
-
97
- $where = array();
98
- foreach ($cronJobs as $jobCode => $offset) {
99
- $where[] = '(`job_code` = "'. $jobCode .'" AND `scheduled_at` >= "'. date('Y-m-d H:i:s', $time - $offset * 2) .'")';
100
- }
101
-
102
- $collection->getSelect()->where(implode(' OR ', $where));
103
-
104
- if (count($collection)) {
105
- return true;
106
- }
107
- }
108
-
109
- return false;
110
  }
111
 
112
- protected function _getPeriod($expr)
113
  {
114
  $period = false;
115
 
116
- if ($expr === '*') {
117
  $period = 1;
118
  }
119
 
120
- if(false !== strpos($expr, ',')) {
121
- $part = explode(',', $expr);
122
- if(count($part) >= 2) {
123
- $sub = intval($part[1] - $part[0]);
124
- if($sub > 0) {
125
- $period = $sub;
126
- }
127
- }
128
- }elseif(false !== strpos($expr, '/')) {
129
- $part = explode('/', $expr, 2);
130
- if(count($part) == 2 && is_numeric($part[1])) {
131
- $period = $part[1];
132
- }
133
- }
134
-
135
- return $period;
136
  }
137
 
138
  }
21
 
22
  class Plumrocket_Base_Model_CronChecker
23
  {
24
+ public function check($name)
25
+ {
26
+ if (!$name) {
27
+ return;
28
+ }
29
 
30
+ if(!$this->getCronStatus('plumrocket_'.$name.'_')) {
31
+ $session = Mage::getSingleton('adminhtml/session');
32
+ $message = Mage::helper('adminhtml')->__('Notice: You can disregard this message if the extension was installed less than 30 minutes ago.<br/>Magento Cron Job is missing in your crontab. This magento extension requires to schedule custom tasks to be run periodically. Please read <a href="%s" target="_blank">How to setup a Cron Job in Magento</a> for more info.', 'http://wiki.plumrocket.com/wiki/How_to_setup_a_Cron_Job_in_Magento');
33
+ $session->addUniqueMessages(Mage::getSingleton('core/message')->notice($message)->setIdentifier('plumrocket_cronChecker'));
34
+ }
35
+ }
36
 
37
 
38
+ public function getCronStatus($jobCodePrefix)
39
  {
40
+ // Get cron jobs.
41
+ $cronJobs = Mage::getConfig()->getNode('crontab/jobs')->asArray();
42
+
43
+ foreach ($cronJobs as $key => &$value) {
44
+ if(0 === strpos($key, $jobCodePrefix) && !empty($value['schedule']['cron_expr'])) {
45
+ $offset = false;
46
+ $exprArr = preg_split('#\s+#', $value['schedule']['cron_expr'], null, PREG_SPLIT_NO_EMPTY);
47
+ if (count($exprArr) == 5) {
48
+ foreach ($exprArr as $n => $expr) {
49
+ switch($n) {
50
+ case 0:
51
+ // minute
52
+ $offset = 3600;
53
+ break;
54
+
55
+ case 1:
56
+ // hour
57
+ if($period = $this->_getPeriod($expr)) {
58
+ $offset = 3600 * $period;
59
+ }else{
60
+ $offset = 3600 * 24;
61
+ }
62
+ break;
63
+
64
+ default:
65
+ if($expr !== '*')
66
+ $offset = false;
67
+ }
68
+ }
69
+ }
70
+
71
+ if($offset) {
72
+ $value = $offset;
73
+ continue;
74
+ }
75
+ }
76
+
77
+ unset($cronJobs[$key]);
78
+ }
79
+
80
+ // Cron not used.
81
+ if(empty($cronJobs)) {
82
+ return true;
83
+ }
84
+
85
+ // Check cron.
86
+ $time = Mage::getSingleton('core/date')->gmtTimestamp();
87
+ $installedAt = strtotime(Mage::getConfig()->getNode('global/install/date'));
88
+
89
+ if ($time < $installedAt + 3600) {
90
+ return true;
91
+ } else {
92
+ $cronSchedule = Mage::getSingleton('cron/schedule');
93
+
94
+ $collection = $cronSchedule->getCollection()
95
+ ->setPageSize(1);
96
+
97
+ $where = array();
98
+ foreach ($cronJobs as $jobCode => $offset) {
99
+ $where[] = '(`job_code` = "'. $jobCode .'" AND `scheduled_at` >= "'. date('Y-m-d H:i:s', $time - $offset * 2) .'")';
100
+ }
101
+
102
+ $collection->getSelect()->where(implode(' OR ', $where));
103
+
104
+ if (count($collection)) {
105
+ return true;
106
+ }
107
+ }
108
+
109
+ return false;
110
  }
111
 
112
+ protected function _getPeriod($expr)
113
  {
114
  $period = false;
115
 
116
+ if ($expr === '*') {
117
  $period = 1;
118
  }
119
 
120
+ if(false !== strpos($expr, ',')) {
121
+ $part = explode(',', $expr);
122
+ if(count($part) >= 2) {
123
+ $sub = intval($part[1] - $part[0]);
124
+ if($sub > 0) {
125
+ $period = $sub;
126
+ }
127
+ }
128
+ }elseif(false !== strpos($expr, '/')) {
129
+ $part = explode('/', $expr, 2);
130
+ if(count($part) == 2 && is_numeric($part[1])) {
131
+ $period = $part[1];
132
+ }
133
+ }
134
+
135
+ return $period;
136
  }
137
 
138
  }
app/code/community/Plumrocket/Base/Model/Feed.php CHANGED
@@ -12,9 +12,9 @@ http://wiki.plumrocket.net/wiki/EULA
12
  If you are unable to obtain it through the world-wide-web, please
13
  send an email to support@plumrocket.com so we can send you a copy immediately.
14
 
15
- @package Plumrocket_Base-v1.x.x
16
- @copyright Copyright (c) 2014 Plumrocket Inc. (http://www.plumrocket.com)
17
- @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
18
 
19
  */
20
 
@@ -28,67 +28,67 @@ class Plumrocket_Base_Model_Feed extends Mage_AdminNotification_Model_Feed
28
 
29
  public function getFeedUrl()
30
  {
31
- if (is_null($this->_feedUrl)) {
32
  $this->_feedUrl = (Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://')
33
  . Mage::getStoreConfig(self::XML_FEED_URL_PATH);
34
  }
35
 
36
- $urlInfo = parse_url(Mage::getBaseUrl());
37
- $domain = isset($urlInfo['host']) ? $urlInfo['host'] : '';
38
 
39
- if (!strpos($this->_feedUrl, '/index/')){
40
- $this->_feedUrl .= 'index/';
41
- }
42
 
43
- $url = $this->_feedUrl . 'domain/' . urlencode($domain);
44
 
45
- $modulesParams = array();
46
- $plumrocketModules = Mage::helper('plumbase')->getAllPlumrocketModules();
47
- foreach($plumrocketModules as $key => $module) {
48
- $key = str_replace('Plumrocket_', '', $key);
49
- $modulesParams[] = $key . ( ($module->version) ? ','.$module->version : '' );
50
- }
51
 
52
- if (count($modulesParams)) {
53
- $url .= '/modules/'.base64_encode(implode(';', $modulesParams));
54
- }
55
 
56
  return $url;
57
  }
58
 
59
  public function checkUpdate()
60
  {
61
- if (! Mage::getSingleton('admin/session')->isLoggedIn()
62
- || (($this->getFrequency() + $this->getLastUpdate()) > time())
63
- || !Mage::helper('plumbase')->isAdminNotificationEnabled()
64
- ) {
65
- return $this;
66
- }
67
-
68
- try {
69
- $feedData = array();
70
- $feedXml = $this->getFeedData();
71
-
72
- if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
73
- foreach ($feedXml->channel->item as $item) {
74
- $feedData[] = array(
75
- 'severity' => (int)$item->severity,
76
- 'date_added' => $this->getDate( (string)$item->pubDate ),
77
- 'title' => (string)$item->title,
78
- 'description' => (string)$item->description,
79
- 'url' => (string)$item->link,
80
- );
81
- }
82
- }
83
-
84
- if ($feedData) {
85
- Mage::getModel('adminnotification/inbox')->parse($feedData);
86
- }
87
- $this->setLastUpdate();
88
- return $this;
89
- } catch (Exception $e) {
90
- return false;
91
- }
92
  }
93
 
94
  public function getLastUpdate()
12
  If you are unable to obtain it through the world-wide-web, please
13
  send an email to support@plumrocket.com so we can send you a copy immediately.
14
 
15
+ @package Plumrocket_Base-v1.x.x
16
+ @copyright Copyright (c) 2014 Plumrocket Inc. (http://www.plumrocket.com)
17
+ @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
18
 
19
  */
20
 
28
 
29
  public function getFeedUrl()
30
  {
31
+ if (null === $this->_feedUrl) {
32
  $this->_feedUrl = (Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://')
33
  . Mage::getStoreConfig(self::XML_FEED_URL_PATH);
34
  }
35
 
36
+ $urlInfo = parse_url(Mage::getBaseUrl());
37
+ $domain = isset($urlInfo['host']) ? $urlInfo['host'] : '';
38
 
39
+ if (false === strpos($this->_feedUrl, '/index/')) {
40
+ $this->_feedUrl .= 'index/';
41
+ }
42
 
43
+ $url = $this->_feedUrl . 'domain/' . urlencode($domain);
44
 
45
+ $modulesParams = array();
46
+ $plumrocketModules = Mage::helper('plumbase')->getAllPlumrocketModules();
47
+ foreach ($plumrocketModules as $key => $module) {
48
+ $key = str_replace('Plumrocket_', '', $key);
49
+ $modulesParams[] = $key . ( ($module->version) ? ','.$module->version : '' );
50
+ }
51
 
52
+ if (count($modulesParams)) {
53
+ $url .= '/modules/'.base64_encode(implode(';', $modulesParams));
54
+ }
55
 
56
  return $url;
57
  }
58
 
59
  public function checkUpdate()
60
  {
61
+ if (! Mage::getSingleton('admin/session')->isLoggedIn()
62
+ || (($this->getFrequency() + $this->getLastUpdate()) > time())
63
+ || !Mage::helper('plumbase')->isAdminNotificationEnabled()
64
+ ) {
65
+ return $this;
66
+ }
67
+
68
+ try {
69
+ $feedData = array();
70
+ $feedXml = $this->getFeedData();
71
+
72
+ if ($feedXml && $feedXml->channel && $feedXml->channel->item) {
73
+ foreach ($feedXml->channel->item as $item) {
74
+ $feedData[] = array(
75
+ 'severity' => (int)$item->severity,
76
+ 'date_added' => $this->getDate( (string)$item->pubDate ),
77
+ 'title' => (string)$item->title,
78
+ 'description' => (string)$item->description,
79
+ 'url' => (string)$item->link,
80
+ );
81
+ }
82
+ }
83
+
84
+ if ($feedData) {
85
+ Mage::getModel('adminnotification/inbox')->parse($feedData);
86
+ }
87
+ $this->setLastUpdate();
88
+ return $this;
89
+ } catch (Exception $e) {
90
+ return false;
91
+ }
92
  }
93
 
94
  public function getLastUpdate()
app/code/community/Plumrocket/Base/Model/Observer.php CHANGED
@@ -19,4 +19,4 @@ send an email to support@plumrocket.com so we can send you a copy immediately.
19
  */
20
 
21
 
22
- class Plumrocket_Base_Model_Observer{protected $_customer=null;protected $_inStock=true;protected $_session=null;public function systemConfigLoad($observer){$controller=$observer->getEvent()->getControllerAction();$section=$this->_getSection($controller);if($section && $section->getName()){try{$resourceLookup='admin/system/config/'.$section->getName();$this->_getSession()->getData('acl')->get($resourceLookup);}catch(Zend_Acl_Exception $e){$this->_refreshAdminAcl();$section=$this->_getSection($controller);}}if($this->_isPlumSection($section)){Mage::getSingleton('plumbase/cronChecker')->check($section->getName());}if($this->_hasS($section)){$current=$section->getName();$_key=$current.'/general/'.strrev('laires');$product=Mage::getModel('plumbase/product')->setPref($current);if(!Mage::getStoreConfig($_key,0)){if($s=$product->loadSession()){$config=Mage::getConfig();$config->saveConfig($_key,$s,'default',0);$config->reinit();Mage::app()->reinitStores();$this->_refreshPage();}}else{$product=Mage::getModel('plumbase/product')->load($product->getName());if(!$product->isInStock()||!$product->isCached()){$product->checkStatus();}}if(!$product->isInStock()){$product->disable();}if(!$product->isInStock()){Mage::getSingleton('adminhtml/session')->addError($product->getDescription());}}}public function permissionsCheck($observer){if($this->_getSession()->isLoggedIn()){$controller=$observer->getEvent()->getControllerAction();$request=$controller->getRequest();if($request->getActionName()=='denied'&&!$request->getParam('norefreshpage')){$this->_refreshAdminAcl();$this->_refreshPage(true);}}}protected function _getSession(){if(is_null($this->_session)){$this->_session=Mage::getSingleton('admin/session');}return $this->_session;}protected function _refreshPage($addParam=false){$cUrl=Mage::helper('core/url')->getCurrentUrl();if($addParam){$cUrl.=(strpos($cUrl,'?')===false)?'?':'&';$cUrl.='norefreshpage=1';}Mage::app()->getResponse()->setRedirect($cUrl)->sendHeaders();exit();}protected function _refreshAdminAcl(){$session=$this->_getSession();if($admin=$session->getUser()){$admin->setReloadAclFlag(true);$session->refreshAcl();}}protected function _getSection($controller){$req=$controller->getRequest();$current=$req->getParam('section');$website=$req->getParam('website');$store=$req->getParam('store');Mage::getSingleton('adminhtml/config_data')->setSection($current)->setWebsite($website)->setStore($store);$configFields=Mage::getSingleton('adminhtml/config');$sections=$configFields->getSections($current);if(!$current){$sections=(array) $sections;usort($sections,array($this,'_sort'));$permissions=$this->_getSession();foreach($sections as $sec){$code=$sec->getName();if(!$code or trim($code)==""){continue;}if($permissions->isAllowed('system/config/'.$code)){$current=$code;$section=$sec;break;}}}else{$section=$sections->$current;}return $section;}public function customer(){if(empty($this->_customer)){$this->_customer=1;}return 'customer';}public function systemConfigBeforeSave($observer){$controller=$observer->getEvent()->getControllerAction();$section=$controller->getRequest()->getParam('section');if(!$section){return;}$sData=Mage::getSingleton('adminhtml/config')->getSection($section);if($this->_hasS($sData)){$product=Mage::getModel('plumbase/product')->loadByPref($section);$this->_inStock=$product->isInStock();}}public function systemConfigSave($observer){$controller=$observer->getEvent()->getControllerAction();$section=$controller->getRequest()->getParam('section');if(!$section){return;}$sData=Mage::getSingleton('adminhtml/config')->getSection($section);if($this->_hasS($sData)){$product=Mage::getModel('plumbase/product')->loadByPref($section);$product->checkStatus();if(!$product->isInStock()){$product->disable();}else{if(!$this->_inStock){Mage::getSingleton('adminhtml/session')->addSuccess($product->getDescription());}}}}protected function _hasS($section){$i='ser'.strrev('lai');return $section&&($v=$section->groups)&&($v=$v->general)&&($v=$v->fields)&&($v=$v->$i)&&((string) $section->tab=='plum'."rock".'et');}protected function _isPlumSection($section){return $section&&((string) $section->tab=='plu'.'mroc'.'ket');}protected function _sort($a,$b){return (int) $a->sort_order<(int) $b->sort_order?-1:((int) $a->sort_order>(int) $b->sort_order?1:0);}}
19
  */
20
 
21
 
22
+ class Plumrocket_Base_Model_Observer{protected $_customer=null;protected $_inStock=true;protected $_session=null;public function systemConfigLoad($observer){$controller=$observer->getEvent()->getControllerAction();$section=$this->_getSection($controller);if($section && $section->getName()){try{$resourceLookup='admin/system/config/'.$section->getName();$this->_getSession()->getData('acl')->get($resourceLookup);}catch(Zend_Acl_Exception $e){$this->_refreshAdminAcl();$section=$this->_getSection($controller);}}if($this->_isPlumSection($section)){Mage::getSingleton('plumbase/cronChecker')->check($section->getName());}if($this->_hasS($section)){$current=$section->getName();$_key=$current.'/general/'.strrev('laires');$product=Mage::getModel('plumbase/product')->setPref($current);if(!Mage::getStoreConfig($_key,0)){if($s=$product->loadSession()){$config=Mage::getConfig();$config->saveConfig($_key,$s,'default',0);$config->reinit();Mage::app()->reinitStores();$this->_refreshPage();return;}}else{$product=Mage::getModel('plumbase/product')->load($product->getName());if(!$product->isInStock()||!$product->isCached()){$product->checkStatus();}}if(!$product->isInStock()){$product->disable();}if(!$product->isInStock()){Mage::getSingleton('adminhtml/session')->addError($product->getDescription());}}}public function permissionsCheck($observer){if($this->_getSession()->isLoggedIn()){$controller=$observer->getEvent()->getControllerAction();$request=$controller->getRequest();if($request->getActionName()=='denied'&&!$request->getParam('norefreshpage')){$this->_refreshAdminAcl();$this->_refreshPage(true);return;}}}protected function _getSession(){if(is_null($this->_session)){$this->_session=Mage::getSingleton('admin/session');}return $this->_session;}protected function _refreshPage($addParam=false){$cUrl=Mage::helper('core/url')->getCurrentUrl();if($addParam){$cUrl.=(strpos($cUrl,'?')===false)?'?':'&';$cUrl.='norefreshpage=1';}$c = Mage::app()->getFrontController(); $c->getResponse()->setRedirect($cUrl); $c->getResponse()->sendResponse(); $c->getRequest()->setDispatched(true); $c->setFlag('', Mage_Core_Controller_Front_Action::FLAG_NO_DISPATCH, true);}protected function _refreshAdminAcl(){$session=$this->_getSession();if($admin=$session->getUser()){$admin->setReloadAclFlag(true);$session->refreshAcl();}}protected function _getSection($controller){$req=$controller->getRequest();$current=$req->getParam('section');$website=$req->getParam('website');$store=$req->getParam('store');Mage::getSingleton('adminhtml/config_data')->setSection($current)->setWebsite($website)->setStore($store);$configFields=Mage::getSingleton('adminhtml/config');$sections=$configFields->getSections($current);if(!$current){$sections=(array) $sections;usort($sections,array($this,'_sort'));$permissions=$this->_getSession();foreach ($sections as $sec){$code=$sec->getName();if(!$code or trim($code)==""){continue;}if($permissions->isAllowed('system/config/'.$code)){$current=$code;$section=$sec;break;}}}else{$section=$sections->$current;}return $section;}public function customer(){if(empty($this->_customer)){$this->_customer=1;}return 'customer';}public function systemConfigBeforeSave($observer){$controller=$observer->getEvent()->getControllerAction();$section=$controller->getRequest()->getParam('section');if(!$section){return;}$sData=Mage::getSingleton('adminhtml/config')->getSection($section);if($this->_hasS($sData)){$product=Mage::getModel('plumbase/product')->loadByPref($section);$this->_inStock=$product->isInStock();}}public function systemConfigSave($observer){$controller=$observer->getEvent()->getControllerAction();$section=$controller->getRequest()->getParam('section');if(!$section){return;}$sData=Mage::getSingleton('adminhtml/config')->getSection($section);if($this->_hasS($sData)){$product=Mage::getModel('plumbase/product')->loadByPref($section);$product->checkStatus();if(!$product->isInStock()){$product->disable();}else{if(!$this->_inStock){Mage::getSingleton('adminhtml/session')->addSuccess($product->getDescription());}}}}protected function _hasS($section){$i='ser'.strrev('lai');return $section&&($v=$section->groups)&&($v=$v->general)&&($v=$v->fields)&&($v=$v->$i)&&((string) $section->tab=='plum'."rock".'et');}protected function _isPlumSection($section){return $section&&((string) $section->tab=='plu'.'mroc'.'ket');}protected function _sort($a,$b){return (int) $a->sort_order<(int) $b->sort_order?-1:((int) $a->sort_order>(int) $b->sort_order?1:0);}}
app/code/community/Plumrocket/Base/Model/Product.php CHANGED
@@ -19,4 +19,4 @@ send an email to support@plumrocket.com so we can send you a copy immediately.
19
  */
20
 
21
 
22
- class Plumrocket_Base_Model_Product extends Mage_Core_Model_Abstract{static protected $_prefs=null;protected $_name=null;protected $_session=null;protected $_pref=null;protected $_dbCacheTime=3;protected $_sUrl;protected $_test=false;protected $_customer=null;static protected $_edit=null;const V=1;const PR='Plumrocket_';public function _construct(){parent::_construct();$this->_init('plumbase/product');$this->_sUrl=implode('',array_map('ch'.'r',array('104','116','116','112','115','58','47','47','115','116','111','114','101','46','112','108','117','109','114','111','99','107','101','116','46','99','111','109','47','105','108','103','47','112','105','110','103','98','97','99','107','47')));}public function load($id, $field=null){if(is_null($field)&&!is_numeric($id)){$this->_name=$id;return parent::load($this->getSignature(),'signature');}return parent::load($id,$field);}public function loadByPref($pref){$this->setPref($pref);return $this->load($this->getName());}public function setName($name){$this->_name=$name;return $this;}public function getName(){return $this->_name;}public function setPref($pref){$this->_pref=$pref;$items=(array) Mage::getConfig()->getNode('global/helpers')->children();foreach($items as $key=>$item){if($key==$pref){$t=explode('_',(string) $item->class);$this->setName($t[1]);}}return $this;}static public function getEdit(){if(is_null(self::$_edit)){$conf=Mage::getConfig();$ep='Ent'.'er'.'prise';self::$_edit=($conf->getModuleConfig($ep.'_'.$ep)||$conf->getModuleConfig($ep.'_AdminGws')||$conf->getModuleConfig($ep.'_Checkout')||$conf->getModuleConfig($ep.'_Customer'))?$ep:'Com'.'muni'.'ty';}return self::$_edit;}public function getPref(){if(is_null($this->_pref)){if(is_null(self::$_prefs)){self::$_prefs=array();$items=(array) Mage::getConfig()->getNode('global/helpers')->children();foreach($items as $key=>$item){$c=(string) $item->class;self::$_prefs[$c]=$key;}}$c=self::PR."{$this->_name}_Helper";$this->_pref=isset(self::$_prefs[$c])?self::$_prefs[$c]:false;}return $this->_pref;}public function isCached(){if($this->_test){return false;}return $this->getDate()>date('Y-m-d H:i:s')&&$this->getDate()<date('Y-m-d H:i:s',time()+30*86400);}public function isInStock(){return $this->getStatus()&&($this->getStatus()%100==0);}public function getDescription(){if($this->isInStock()){return implode('',array_map('c'.'h'.'r',explode('.','67.111.110.103.114.97.116.117.108.97.116.105.111.110.115.33.32.89.111.117.114.32.115.101.114.105.97.108.32.107.101.121.32.105.115.32.110.111.119.32.97.99.116.105.118.97.116.101.100.46.32.84.104.97.110.107.32.121.111.117.32.102.111.114.32.99.104.111.111.115.105.110.103.32.80.108.117.109.114.111.99.107.101.116.32.73.110.99.32.97.115.32.121.111.117.114.32.77.97.103.101.110.116.111.32.101.120.116.101.110.115.105.111.110.32.112.114.111.118.105.100.101.114.33')));}if(!$this->getSession()){return implode('',array_map('c'.'h'.'r',explode('.','83.101.114.105.97.108.32.107.101.121.32.105.115.32.109.105.115.115.105.110.103.46.32.80.108.101.97.115.101.32.108.111.103.105.110.32.116.111.32.121.111.117.114.32.97.99.99.111.117.110.116.32.97.116.32.60.97.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.32.104.114.101.102.61.34.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.100.111.119.110.108.111.97.100.97.98.108.101.47.99.117.115.116.111.109.101.114.47.112.114.111.100.117.99.116.115.47.34.62.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.60.47.97.62.32.116.111.32.99.111.112.121.32.121.111.117.114.32.115.101.114.105.97.108.32.107.101.121.32.102.111.114.32.116.104.105.115.32.112.114.111.100.117.99.116.46.32.82.101.97.100.32.116.104.105.115.32.60.97.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.32.104.114.101.102.61.34.104.116.116.112.58.47.47.119.105.107.105.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.119.105.107.105.47.76.105.99.101.110.115.101.95.73.110.115.116.97.108.108.97.116.105.111.110.34.62.119.105.107.105.32.97.114.116.105.99.108.101.60.47.97.62.32.102.111.114.32.109.111.114.101.32.105.110.102.111.46')));}if(!$this->isInStock()){$status=(int) $this->getStatus();switch($status){case 503:return implode('',array_map('c'.'hr',explode('.','89.111.117.114.32.115.101.114.105.97.108.32.107.101.121.32.105.115.32.110.111.116.32.118.97.108.105.100.32.102.111.114.32.77.97.103.101.110.116.111.32.69.110.116.101.114.112.114.105.115.101.32.69.100.105.116.105.111.110.46.32.80.108.101.97.115.101.32.112.117.114.99.104.97.115.101.32.77.97.103.101.110.116.111.32.69.110.116.101.114.112.114.105.115.101.32.69.100.105.116.105.111.110.32.108.105.99.101.110.115.101.32.102.111.114.32.116.104.105.115.32.112.114.111.100.117.99.116.32.97.116.32.60.97.32.104.114.101.102.61.34.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.34.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.62.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.60.47.97.62')));default:return implode('',array_map('c'.'hr',explode('.','83.101.114.105.97.108.32.107.101.121.32.105.115.32.110.111.116.32.118.97.108.105.100.32.102.111.114.32.116.104.105.115.32.100.111.109.97.105.110.46.32.80.108.101.97.115.101.32.103.111.32.116.111.32.60.97.32.104.114.101.102.61.34.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.34.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.62.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.60.47.97.62.32.116.111.32.112.117.114.99.104.97.115.101.32.110.101.119.32.108.105.99.101.110.115.101.32.102.111.114.32.108.105.118.101.32.115.105.116.101.46.32.32.84.101.115.116.105.110.103.32.111.114.32.100.101.118.101.108.111.112.109.101.110.116.32.115.117.98.100.111.109.97.105.110.115.32.99.97.110.32.98.101.32.97.100.100.101.100.32.116.111.32.121.111.117.114.32.108.105.99.101.110.115.101.32.102.114.101.101.32.111.102.32.99.104.97.114.103.101.46.32.82.101.97.100.32.116.104.105.115.32.60.97.32.104.114.101.102.61.34.104.116.116.112.58.47.47.119.105.107.105.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.119.105.107.105.47.85.112.100.97.116.105.110.103.95.76.105.99.101.110.115.101.95.68.111.109.97.105.110.115.34.32.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.62.119.105.107.105.32.97.114.116.105.99.108.101.60.47.97.62.32.102.111.114.32.109.111.114.101.32.105.110.102.111.46')));}}return null;}public function currentCustomer(){if(empty($this->_customer)){$this->_customer=1;}return 'customer';}public function enabled(){if($this->getPref()){$helper=$this->getHelper();if(method_exists($helper,'moduleEnabled')){foreach(Mage::app()->getStores()as $store){if($store->getIsActive()&&$helper->moduleEnabled($store->getId())){return true;}}}}return false;}public function getSignature(){return md5($this->_name.$this->getSession());}public function getSession(){if(!$this->hasData('session')){$this->setSession(Mage::getStoreConfig($this->getPref().'/general/'.strrev('laires'),0));}return preg_replace("/\s+/","",$this->getData('session'));}public function loadSession(){$session='';try{$data=array('ed'.'ition'=>self::getEdit(),'bas'.'e_urls'=>$this->getBaseU(),'name'=>$this->getName(),'customer'=>$this->getCustomer(),'title'=>$this->getTitle());$xml=$this->_getContent($this->_sUrl.'session/',$data);$session=isset($xml['data'])?$xml['data']:null;}catch(Exception $e){if($this->_test){echo $e->getMessage();exit();}}$this->setSession($session);$this->saveStatus($this->getSimpleStatus());return $session;}public function getHelper(){return Mage::helper($this->getPref());}public function getCustomer(){$helper=$this->getHelper();if(method_exists($helper,'getCustomerKey')){return $helper->getCustomerKey();}return null;}public function getBaseU(){$k=strrev('lru_esab'.'/'.'eruces/bew');$_us=array();$u=Mage::getStoreConfig($k,0);$_us[$u]=$u;foreach(Mage::app()->getStores()as $store){if($store->getIsActive()){$u=Mage::getStoreConfig($k,$store->getId());$_us[$u]=$u;}}return array_values($_us);}public function checkStatus(){$session=$this->getSession();try{$data=array('edit'.'ion'=>self::getEdit(),'session'=>$session,'ba'.'se_u'.'rls'=>$this->getBaseU(),'name'=>$this->getName(),'name_version'=>$this->getVersion(),'customer'=>$this->getCustomer(),'title'=>$this->getTitle());$xml=$this->_getContent($this->_sUrl.'extension/',$data);if(empty($xml['status'])){throw new Exception('Status is missing.',1);}$status=$xml['status'];}catch(Exception $e){if($this->_test){echo $e->getMessage();exit();}$status=$this->getSimpleStatus();}return $this->saveStatus($status);}protected function _getContent($u,$data=array()){$data['v']=self::V;$query=http_build_query($data);$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$u);curl_setopt($ch,CURLOPT_POST,count($data));curl_setopt($ch,CURLOPT_POSTFIELDS,$query);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);$res=curl_exec($ch);$res=json_decode($res,true);if(!empty($res['cache_time'])&&($ct=(int) $res['cache_time'])&&$ct>0){$this->_dbCacheTime=$ct;}return $res;}public function setDbCacheTime($ct){$this->_dbCacheTime=$ct;return $this;}public function getSimpleStatus(){$session=$this->getSession();return(strlen($session)==32&&$session{9}==$this->_name{2}&&$session{20}==$this->_name{3})?500:201;}public function getTitle(){return (string) Mage::getConfig()->getNode('modules/'.self::PR.$this->_name)->name;}public function saveStatus($status){$signature=$this->getSignature();Mage::getSingleton('core/resource')->getConnection('core_write')->query(sprintf("DELETE FROM %s WHERE `date` < '%s'",Mage::getSingleton('core/resource')->getTableName('plumbase_product'),date('Y-m-d H:i:s',time()-86400*30)));if(!$this->getId()){$product=Mage::getModel('plumbase/product')->load($signature,'signature');$this->setId($product->getId());}return $this->setSignature($signature)->setStatus($status)->setDate(date('Y-m-d H:i:s',time()+$this->_dbCacheTime*86400))->save();}public function getVersion(){return (string) Mage::getConfig()->getNode('modules/'.self::PR.$this->_name)->version;}public function disable(){$helper=$this->getHelper();if(method_exists($helper,'disableExtension')){$helper->disableExtension();}return $this;}public function getAllModules(){$modules=(array) Mage::getConfig()->getNode('modules')->children();$result=array();$ad='adv'.'anced/mod'.'ules_dis'.'able_out'.'put';foreach($modules as $key=>$module){if(strpos($key,'Plumrocket_')!==false&&$module->is('active')&&!Mage::getStoreConfig($ad.'/'.$key)){$result[$key]=$module;}}return $result;}public function reindex(){$ck=self::PR.'base_reindex';if(!Mage::getSingleton('admin/session')->isLoggedIn()||((86400+Mage::app()->loadCache($ck))>time())){if(!$this->_test){return $this;}}$data=array('ed'.'ition'=>self::getEdit(),'products'=>array(),'ba'.'se_ur'.'ls'=>$this->getBaseU());$products=array();foreach($this->getAllModules()as $key=>$module){$name=str_replace(self::PR,'',$key);$product=Mage::getModel('plumbase/product')->load($name);if(!$product->enabled()||$product->isCached()){continue;}$products[$name]=$product;$v=$product->getVersion();$c=$product->getCustomer();$s=$product->getSession();$data['products'][$name]=array($name,$v,$c?$c:0,$s?$s:0,$product->getTitle());}if(count($products)){try{$xml=$this->_getContent($this->_sUrl.'extensions/',$data);if(!isset($xml['statuses'])){throw new Exception('Statuses are missing.',1);}$statuses=$xml['statuses'];}catch(Exception $e){if($this->_test){echo $e->getMessage();exit();}$statuses=array();foreach($products as $name=>$product){$statuses[$name]=$product->getSimpleStatus();}}foreach($products as $name=>$product){$status=isset($statuses[$name])?$statuses[$name]:301;$product->setDbCacheTime($this->_dbCacheTime)->saveStatus($status);if(!$product->isInStock()){$product->disable();}}}Mage::app()->saveCache(time(),$ck);}}
19
  */
20
 
21
 
22
+ class Plumrocket_Base_Model_Product extends Mage_Core_Model_Abstract{static protected $_prefs=null;protected $_name=null;protected $_session=null;protected $_pref=null;protected $_dbCacheTime=3;protected $_sUrl;protected $_test=false;protected $_customer=null;static protected $_edit=null;const V=1;const PR='Plumrocket_';public function _construct(){parent::_construct();$this->_init('plumbase/product');$this->_sUrl=implode('',array_map('ch'.'r',array('104','116','116','112','115','58','47','47','115','116','111','114','101','46','112','108','117','109','114','111','99','107','101','116','46','99','111','109','47','105','108','103','47','112','105','110','103','98','97','99','107','47')));}public function load($id, $field=null){$this->_initInstall();if(is_null($field)&&!is_numeric($id)){$this->_name=$id;return parent::load($this->getSignature(),'signature');}return parent::load($id,$field);}public function loadByPref($pref){$this->setPref($pref);return $this->load($this->getName());}public function setName($name){$this->_name=$name;return $this;}public function getName(){return $this->_name;}public function setPref($pref){$this->_pref=$pref;$items=(array) Mage::getConfig()->getNode('global/helpers')->children();foreach ($items as $key=>$item){if($key==$pref){$t=explode('_',(string) $item->class);$this->setName($t[1]);}}return $this;}static public function getEdit(){if(is_null(self::$_edit)){$conf=Mage::getConfig();$ep='Ent'.'er'.'prise';self::$_edit=($conf->getModuleConfig($ep.'_'.$ep)||$conf->getModuleConfig($ep.'_AdminGws')||$conf->getModuleConfig($ep.'_Checkout')||$conf->getModuleConfig($ep.'_Customer'))?$ep:'Com'.'muni'.'ty';}return self::$_edit;}public function getPref(){if(is_null($this->_pref)){if(is_null(self::$_prefs)){self::$_prefs=array();$items=(array) Mage::getConfig()->getNode('global/helpers')->children();foreach ($items as $key=>$item){$c=(string) $item->class;self::$_prefs[$c]=$key;}}$c=self::PR."{$this->_name}_Helper";$this->_pref=isset(self::$_prefs[$c])?self::$_prefs[$c]:false;}return $this->_pref;}public function isCached(){if($this->_test){return false;}return $this->getDate()>date('Y-m-d H:i:s')&&$this->getDate()<date('Y-m-d H:i:s',time()+30*86400);}public function isInStock(){return $this->getStatus()&&($this->getStatus()%100==0);}public function getDescription(){if($this->isInStock()){return implode('',array_map('c'.'h'.'r',explode('.','67.111.110.103.114.97.116.117.108.97.116.105.111.110.115.33.32.89.111.117.114.32.115.101.114.105.97.108.32.107.101.121.32.105.115.32.110.111.119.32.97.99.116.105.118.97.116.101.100.46.32.84.104.97.110.107.32.121.111.117.32.102.111.114.32.99.104.111.111.115.105.110.103.32.80.108.117.109.114.111.99.107.101.116.32.73.110.99.32.97.115.32.121.111.117.114.32.77.97.103.101.110.116.111.32.101.120.116.101.110.115.105.111.110.32.112.114.111.118.105.100.101.114.33')));}if(!$this->getSession()){return implode('',array_map('c'.'h'.'r',explode('.','83.101.114.105.97.108.32.107.101.121.32.105.115.32.109.105.115.115.105.110.103.46.32.80.108.101.97.115.101.32.108.111.103.105.110.32.116.111.32.121.111.117.114.32.97.99.99.111.117.110.116.32.97.116.32.60.97.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.32.104.114.101.102.61.34.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.100.111.119.110.108.111.97.100.97.98.108.101.47.99.117.115.116.111.109.101.114.47.112.114.111.100.117.99.116.115.47.34.62.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.60.47.97.62.32.116.111.32.99.111.112.121.32.121.111.117.114.32.115.101.114.105.97.108.32.107.101.121.32.102.111.114.32.116.104.105.115.32.112.114.111.100.117.99.116.46.32.82.101.97.100.32.116.104.105.115.32.60.97.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.32.104.114.101.102.61.34.104.116.116.112.58.47.47.119.105.107.105.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.119.105.107.105.47.76.105.99.101.110.115.101.95.73.110.115.116.97.108.108.97.116.105.111.110.34.62.119.105.107.105.32.97.114.116.105.99.108.101.60.47.97.62.32.102.111.114.32.109.111.114.101.32.105.110.102.111.46')));}if(!$this->isInStock()){$status=(int) $this->getStatus();switch($status){case 503:return implode('',array_map('c'.'hr',explode('.','89.111.117.114.32.115.101.114.105.97.108.32.107.101.121.32.105.115.32.110.111.116.32.118.97.108.105.100.32.102.111.114.32.77.97.103.101.110.116.111.32.69.110.116.101.114.112.114.105.115.101.32.69.100.105.116.105.111.110.46.32.80.108.101.97.115.101.32.112.117.114.99.104.97.115.101.32.77.97.103.101.110.116.111.32.69.110.116.101.114.112.114.105.115.101.32.69.100.105.116.105.111.110.32.108.105.99.101.110.115.101.32.102.111.114.32.116.104.105.115.32.112.114.111.100.117.99.116.32.97.116.32.60.97.32.104.114.101.102.61.34.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.34.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.62.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.60.47.97.62')));default:return implode('',array_map('c'.'hr',explode('.','83.101.114.105.97.108.32.107.101.121.32.105.115.32.110.111.116.32.118.97.108.105.100.32.102.111.114.32.116.104.105.115.32.100.111.109.97.105.110.46.32.80.108.101.97.115.101.32.103.111.32.116.111.32.60.97.32.104.114.101.102.61.34.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.34.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.62.104.116.116.112.115.58.47.47.115.116.111.114.101.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.60.47.97.62.32.116.111.32.112.117.114.99.104.97.115.101.32.110.101.119.32.108.105.99.101.110.115.101.32.102.111.114.32.108.105.118.101.32.115.105.116.101.46.32.32.84.101.115.116.105.110.103.32.111.114.32.100.101.118.101.108.111.112.109.101.110.116.32.115.117.98.100.111.109.97.105.110.115.32.99.97.110.32.98.101.32.97.100.100.101.100.32.116.111.32.121.111.117.114.32.108.105.99.101.110.115.101.32.102.114.101.101.32.111.102.32.99.104.97.114.103.101.46.32.82.101.97.100.32.116.104.105.115.32.60.97.32.104.114.101.102.61.34.104.116.116.112.58.47.47.119.105.107.105.46.112.108.117.109.114.111.99.107.101.116.46.99.111.109.47.119.105.107.105.47.85.112.100.97.116.105.110.103.95.76.105.99.101.110.115.101.95.68.111.109.97.105.110.115.34.32.32.116.97.114.103.101.116.61.34.95.98.108.97.110.107.34.62.119.105.107.105.32.97.114.116.105.99.108.101.60.47.97.62.32.102.111.114.32.109.111.114.101.32.105.110.102.111.46')));}}return null;}public function currentCustomer(){if(empty($this->_customer)){$this->_customer=1;}return 'customer';}public function enabled(){if($this->getPref()){$helper=$this->getHelper();if(method_exists($helper,'moduleEnabled')){foreach (Mage::app()->getStores()as $store){if($store->getIsActive()&&$helper->moduleEnabled($store->getId())){return true;}}}}return false;}public function getSignature(){return md5($this->_name.$this->getSession());}public function getSession(){if(!$this->hasData('session')){$this->setSession(Mage::getStoreConfig($this->getPref().'/general/'.strrev('laires'),0));}return preg_replace("/\s+/","",$this->getData('session'));}public function loadSession(){$session='';try{$data=array('ed'.'ition'=>self::getEdit(),'bas'.'e_urls'=>$this->getBaseU(),'name'=>$this->getName(),'customer'=>$this->getCustomer(),'title'=>$this->getTitle());$xml=$this->_getContent($this->_sUrl.'session/',$data);$session=isset($xml['data'])?$xml['data']:null;}catch(Exception $e){if($this->_test){throw new Exception($e->getMessage());}}$this->setSession($session);$this->saveStatus($this->getSimpleStatus());return $session;}public function getHelper(){return Mage::helper($this->getPref());}public function getCustomer(){$helper=$this->getHelper();if(method_exists($helper,'getCustomerKey')){return $helper->getCustomerKey();}return null;}public function getBaseU(){$k=strrev('lru_esab'.'/'.'eruces/bew');$_us=array();$u=Mage::getStoreConfig($k,0);$_us[$u]=$u;foreach (Mage::app()->getStores()as $store){if($store->getIsActive()){$u=Mage::getStoreConfig($k,$store->getId());$_us[$u]=$u;}}return array_values($_us);}public function checkStatus(){$session=$this->getSession();try{$data=array('edit'.'ion'=>self::getEdit(),'session'=>$session,'ba'.'se_u'.'rls'=>$this->getBaseU(),'name'=>$this->getName(),'name_version'=>$this->getVersion(),'customer'=>$this->getCustomer(),'title'=>$this->getTitle());$xml=$this->_getContent($this->_sUrl.'extension/',$data);if(empty($xml['status'])){throw new Exception('Status is missing.',1);}$status=$xml['status'];}catch(Exception $e){if($this->_test){throw new Exception($e->getMessage());}$status=$this->getSimpleStatus();}return $this->saveStatus($status);}protected function _getContent($u,$data=array()){$data['v']=self::V;$query=http_build_query($data);$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$u);curl_setopt($ch,CURLOPT_POST,count($data));curl_setopt($ch,CURLOPT_POSTFIELDS,$query);curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);$res=curl_exec($ch);$res=json_decode($res,true);if(!empty($res['cache_time'])&&($ct=(int) $res['cache_time'])&&$ct>0){$this->_dbCacheTime=$ct;}return $res;}public function setDbCacheTime($ct){$this->_dbCacheTime=$ct;return $this;}public function getSimpleStatus(){$session=$this->getSession();return(strlen($session)==32&&$session{9}==$this->_name{2}&&(strlen($this->_name)<4||$session{20}==$this->_name{3}))?500:201;}public function getTitle(){return (string) Mage::getConfig()->getNode('modules/'.self::PR.$this->_name)->name;}public function saveStatus($status){$this->_initInstall();$signature=$this->getSignature();Mage::getSingleton('core/resource')->getConnection('core_write')->query(sprintf("DELETE FROM %s WHERE `date` < '%s'",Mage::getSingleton('core/resource')->getTableName('plumbase_product'),date('Y-m-d H:i:s',time()-86400*30)));if(!$this->getId()){$product=Mage::getModel('plumbase/product')->load($signature,'signature');$this->setId($product->getId());}return $this->setSignature($signature)->setStatus($status)->setDate(date('Y-m-d H:i:s',time()+$this->_dbCacheTime*86400))->save();}public function getVersion(){return (string) Mage::getConfig()->getNode('modules/'.self::PR.$this->_name)->version;}public function disable(){$helper=$this->getHelper();if(method_exists($helper,'disableExtension')){$helper->disableExtension();}return $this;}public function getAllModules(){$modules=(array) Mage::getConfig()->getNode('modules')->children();$result=array();$ad='adv'.'anced/mod'.'ules_dis'.'able_out'.'put';foreach ($modules as $key=>$module){if(strpos($key,'Plumrocket_')!==false&&$module->is('active')&&!Mage::getStoreConfig($ad.'/'.$key)){$result[$key]=$module;}}return $result;}public function reindex(){$ck=self::PR.'base_reindex';if(!Mage::getSingleton('admin/session')->isLoggedIn()||((86400+Mage::app()->loadCache($ck))>time())){if(!$this->_test){return $this;}}$this->_initInstall();$data=array('ed'.'ition'=>self::getEdit(),'products'=>array(),'ba'.'se_ur'.'ls'=>$this->getBaseU());$products=array();foreach ($this->getAllModules()as $key=>$module){$name=str_replace(self::PR,'',$key);$product=Mage::getModel('plumbase/product')->load($name);if(!$product->enabled()||$product->isCached()){continue;}$products[$name]=$product;$v=$product->getVersion();$c=$product->getCustomer();$s=$product->getSession();$data['products'][$name]=array($name,$v,$c?$c:0,$s?$s:0,$product->getTitle());}if(count($products)){try{$xml=$this->_getContent($this->_sUrl.'extensions/',$data);if(!isset($xml['statuses'])){throw new Exception('Statuses are missing.',1);}$statuses=$xml['statuses'];}catch(Exception $e){if($this->_test){throw new Exception($e->getMessage());}$statuses=array();foreach ($products as $name=>$product){$statuses[$name]=$product->getSimpleStatus();}}foreach ($products as $name=>$product){$status=isset($statuses[$name])?$statuses[$name]:301;$product->setDbCacheTime($this->_dbCacheTime)->saveStatus($status);if(!$product->isInStock()){$product->disable();}}}Mage::app()->saveCache(time(),$ck);}protected function _initInstall(){$resource=Mage::getSingleton('core/resource');$connection=$resource->getConnection('core_write');if($connection->isTableExists($resource->getTableName('plumbase/product')))return;$file=dirname(dirname(__FILE__)).DS.'sql'.DS.'base_setup'.DS.'mysql4-upgrade-1.0.2-1.0.3.php';if(file_exists($file)){include $file;}}}
app/code/community/Plumrocket/Base/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
 
4
  <modules>
5
  <Plumrocket_Base>
6
- <version>1.0.6</version>
7
  </Plumrocket_Base>
8
  </modules>
9
 
3
 
4
  <modules>
5
  <Plumrocket_Base>
6
+ <version>1.0.9</version>
7
  </Plumrocket_Base>
8
  </modules>
9
 
app/code/community/Plumrocket/Base/sql/base_setup/mysql4-upgrade-1.0.2-1.0.3.php CHANGED
@@ -10,18 +10,15 @@
10
  * If you are unable to obtain it through the world-wide-web, please
11
  * send an email to support@plumrocket.com so we can send you a copy immediately.
12
  *
13
- * @package Plumrocket_Reward_Points
14
- * @copyright Copyright (c) 2012 Plumrocket Inc. (http://www.plumrocket.com)
15
  * @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
16
  */
17
- ?>
18
- <?php
19
 
20
-
21
- $installer = $this;
22
- $installer->startSetup();
23
  $installer->run("
24
- CREATE TABLE IF NOT EXISTS `{$this->getTable('plumbase_product')}` (
25
  `id` int(11) NOT NULL AUTO_INCREMENT,
26
  `signature` char(32) NOT NULL,
27
  `status` int(11) NOT NULL,
@@ -30,4 +27,4 @@ $installer->run("
30
  KEY `id` (`id`)
31
  ) ENGINE=MyISAM;
32
  ");
33
- $installer->endSetup();
10
  * If you are unable to obtain it through the world-wide-web, please
11
  * send an email to support@plumrocket.com so we can send you a copy immediately.
12
  *
13
+ * @package Plumrocket_Base
14
+ * @copyright Copyright (c) 2016 Plumrocket Inc. (http://www.plumrocket.com)
15
  * @license http://wiki.plumrocket.net/wiki/EULA End-user License Agreement
16
  */
 
 
17
 
18
+ $installer = Mage::getModel('eav/entity_setup', 'core_setup');
19
+ //$installer->startSetup();
 
20
  $installer->run("
21
+ CREATE TABLE IF NOT EXISTS `{$installer->getTable('plumbase_product')}` (
22
  `id` int(11) NOT NULL AUTO_INCREMENT,
23
  `signature` char(32) NOT NULL,
24
  `status` int(11) NOT NULL,
27
  KEY `id` (`id`)
28
  ) ENGINE=MyISAM;
29
  ");
30
+ //$installer->endSetup();
app/etc/modules/Plumrocket_Base.xml CHANGED
@@ -4,7 +4,7 @@
4
  <Plumrocket_Base>
5
  <active>true</active>
6
  <codePool>community</codePool>
7
- <version>1.0.6</version>
8
  </Plumrocket_Base>
9
  </modules>
10
  </config>
4
  <Plumrocket_Base>
5
  <active>true</active>
6
  <codePool>community</codePool>
7
+ <version>1.0.9</version>
8
  </Plumrocket_Base>
9
  </modules>
10
  </config>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Plumrocket_Base</name>
4
- <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://wiki.plumrocket.net/wiki/EULA">End-user License Agreement</license>
7
  <channel>community</channel>
@@ -9,11 +9,11 @@
9
  <summary>This PlumrocketBase module is a useful tool for syncing important information between Plumrocket extensions installed on your online store and Plumrocket database.</summary>
10
  <description>This PlumrocketBase module is a useful tool for syncing important information between Plumrocket extensions installed on your online store and Plumrocket database.&#xD;
11
  It will notify you about the new changes, fixes and updates using notifications popup at your magento backend and will let you be on track with the recent modifications.</description>
12
- <notes>Improvements for PHP versions 5.4+</notes>
13
  <authors><author><name>Plumrocket Team</name><user>plumrocket</user><email>support@plumrocket.com</email></author></authors>
14
- <date>2015-05-25</date>
15
- <time>13:25:16</time>
16
- <contents><target name="magecommunity"><dir name="Plumrocket"><dir name="Base"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Form"><file name="Field.php" hash="79c9f4af420639ba3136457007714797"/></dir><file name="Version.php" hash="4823969de9c895aa16feb015686bc71b"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="f8a4d9d735479fc86e90b55c46dcfa29"/><file name="Main.php" hash="5f311ab21647ca01d5e50a07c18700bb"/></dir><dir name="Model"><file name="CronChecker.php" hash="fe64f5cf4432127043cd6cf0374b52de"/><file name="Feed.php" hash="819cc8d8ebd053da6a88411811251d43"/><dir name="Mysql4"><dir name="Product"><file name="Collection.php" hash="24a6e4554f03b528be55a321e0204603"/></dir><file name="Product.php" hash="64a5f2af1455b4f11cc7c7836b657a54"/></dir><file name="Observer.php" hash="15b4655f0c0b1e5b00dd02c951a19ffe"/><file name="Product.php" hash="382b24117a126f20b0bfa0d4f92d4a48"/></dir><dir name="etc"><file name="config.xml" hash="968207312d8cc466c5715d21ef8cec84"/></dir><dir name="sql"><dir name="base_setup"><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="206149fc03911af4ea5b2ace60b455f3"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Plumrocket_Base.xml" hash="e1576a5c29d6c4ecf966d331eced1198"/></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>Plumrocket_Base</name>
4
+ <version>1.0.9</version>
5
  <stability>stable</stability>
6
  <license uri="http://wiki.plumrocket.net/wiki/EULA">End-user License Agreement</license>
7
  <channel>community</channel>
9
  <summary>This PlumrocketBase module is a useful tool for syncing important information between Plumrocket extensions installed on your online store and Plumrocket database.</summary>
10
  <description>This PlumrocketBase module is a useful tool for syncing important information between Plumrocket extensions installed on your online store and Plumrocket database.&#xD;
11
  It will notify you about the new changes, fixes and updates using notifications popup at your magento backend and will let you be on track with the recent modifications.</description>
12
+ <notes>Improved integration with other Plumrocket Extensions</notes>
13
  <authors><author><name>Plumrocket Team</name><user>plumrocket</user><email>support@plumrocket.com</email></author></authors>
14
+ <date>2017-07-26</date>
15
+ <time>15:01:48</time>
16
+ <contents><target name="magecommunity"><dir name="Plumrocket"><dir name="Base"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Form"><file name="Field.php" hash="79c9f4af420639ba3136457007714797"/></dir><file name="Version.php" hash="f87f6f6b34bb53bf3ad869d3644b4623"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="1735f88b7801891b7a52d343cc8dd2fe"/><file name="Main.php" hash="7c4a4772c13c774179fe8b3c29d86f8a"/></dir><dir name="Model"><file name="CronChecker.php" hash="7373787fd0655feb5175af3a94e01a7f"/><file name="Feed.php" hash="408d434c29795241774330de73f9a9f5"/><dir name="Mysql4"><dir name="Product"><file name="Collection.php" hash="24a6e4554f03b528be55a321e0204603"/></dir><file name="Product.php" hash="64a5f2af1455b4f11cc7c7836b657a54"/></dir><file name="Observer.php" hash="0cc40d47e67de2f6e46847bf0dba0df2"/><file name="Product.php" hash="afe8494787bf0e56c210ca9baefffdc0"/></dir><dir name="etc"><file name="config.xml" hash="ff06de25479a2adc242ddc782da6b3de"/></dir><dir name="sql"><dir name="base_setup"><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="6f4d7949cec0d79bdb874ea347a19875"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Plumrocket_Base.xml" hash="4384c8c16911f1a2c9d2f798ec8363f4"/></dir></target></contents>
17
  <compatible/>
18
+ <dependencies><required><php><min>5.2.0</min><max>7.1.0</max></php></required></dependencies>
19
  </package>