Version Notes
First stable version
Download this release
Release Info
Developer | Patryk Grudniewski |
Extension | SABIOinstaller |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- app/code/community/SabioSystem/Installer/Block/Adminhtml/Extension/Grid.php +2 -2
- app/code/community/SabioSystem/Installer/Helper/Data.php +4 -0
- app/code/community/SabioSystem/Installer/Model/Resource/Extension.php +58 -16
- app/code/community/SabioSystem/Installer/controllers/Adminhtml/ExtensionController.php +9 -1
- app/code/community/SabioSystem/Installer/etc/config.xml +1 -1
- package.xml +4 -4
app/code/community/SabioSystem/Installer/Block/Adminhtml/Extension/Grid.php
CHANGED
@@ -46,7 +46,7 @@ class SabioSystem_Installer_Block_Adminhtml_Extension_Grid extends Mage_Adminhtm
|
|
46 |
$this->addColumn('action',
|
47 |
array(
|
48 |
'header' => $helper->__('Action'),
|
49 |
-
'width' => '
|
50 |
'type' => 'action',
|
51 |
'getter' => 'getId',
|
52 |
'actions' => array(
|
@@ -82,4 +82,4 @@ class SabioSystem_Installer_Block_Adminhtml_Extension_Grid extends Mage_Adminhtm
|
|
82 |
));
|
83 |
|
84 |
}
|
85 |
-
}
|
46 |
$this->addColumn('action',
|
47 |
array(
|
48 |
'header' => $helper->__('Action'),
|
49 |
+
'width' => '140px',
|
50 |
'type' => 'action',
|
51 |
'getter' => 'getId',
|
52 |
'actions' => array(
|
82 |
));
|
83 |
|
84 |
}
|
85 |
+
}
|
app/code/community/SabioSystem/Installer/Helper/Data.php
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
<?php
|
2 |
class SabioSystem_Installer_Helper_Data extends Mage_Core_Helper_Data{
|
|
|
|
|
|
|
|
|
3 |
}
|
4 |
?>
|
1 |
<?php
|
2 |
class SabioSystem_Installer_Helper_Data extends Mage_Core_Helper_Data{
|
3 |
+
public function clearCache(){
|
4 |
+
Mage::app()->cleanCache();
|
5 |
+
return $this;
|
6 |
+
}
|
7 |
}
|
8 |
?>
|
app/code/community/SabioSystem/Installer/Model/Resource/Extension.php
CHANGED
@@ -4,10 +4,41 @@ class SabioSystem_Installer_Model_Resource_Extension extends Mage_Core_Model_Res
|
|
4 |
|
5 |
protected $_extensionMap=array();
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
protected function _construct(){
|
8 |
$this->_init('sabio_installer/extension','id');
|
9 |
$this->_serializableFields['map'] = array(null,array());
|
10 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
protected function _addExtension($object){
|
12 |
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
13 |
$object->setName($xmlRpc->getName($object->getKey()));
|
@@ -47,7 +78,7 @@ class SabioSystem_Installer_Model_Resource_Extension extends Mage_Core_Model_Res
|
|
47 |
|
48 |
}
|
49 |
|
50 |
-
rmdir(Mage::
|
51 |
|
52 |
return $this;
|
53 |
}
|
@@ -69,6 +100,12 @@ class SabioSystem_Installer_Model_Resource_Extension extends Mage_Core_Model_Res
|
|
69 |
|
70 |
return $this;
|
71 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
protected function _beforeSave($object){
|
73 |
if(!$object->getId()){
|
74 |
$this->_addExtension($object);
|
@@ -100,8 +137,14 @@ class SabioSystem_Installer_Model_Resource_Extension extends Mage_Core_Model_Res
|
|
100 |
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
101 |
$object->setNewestVersion($xmlRpc->getVersion($object->getKey()));
|
102 |
|
103 |
-
$
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
$object->setCurrentVersion($object->getNewestVersion());
|
107 |
$object->setMap($this->_extensionMap);
|
@@ -114,8 +157,15 @@ class SabioSystem_Installer_Model_Resource_Extension extends Mage_Core_Model_Res
|
|
114 |
$this->checkForUpdates($object);
|
115 |
if(version_compare($object->getNewestVersion(),$object->getCurrentVersion(),'>')){
|
116 |
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
117 |
-
|
118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
$object->setCurrentVersion($object->getNewestVersion());
|
121 |
$object->setMap($this->_extensionMap);
|
@@ -138,21 +188,13 @@ class SabioSystem_Installer_Model_Resource_Extension extends Mage_Core_Model_Res
|
|
138 |
}
|
139 |
|
140 |
public function uninstall($object){
|
141 |
-
if(
|
142 |
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
143 |
$xmlRpc->uninstall($object->getKey(),Mage::getBaseUrl());
|
144 |
|
145 |
$this->_extensionMap = $object->getMap();
|
146 |
-
|
147 |
-
|
148 |
-
->addFieldToFilter('id',array('neq'=>$object->getId()))
|
149 |
-
->walk(array($this,'excludeUsedFromMap'));
|
150 |
-
|
151 |
-
foreach($this->_extensionMap as $path){
|
152 |
-
if(is_file($path)){
|
153 |
-
unlink($path);
|
154 |
-
}
|
155 |
-
}
|
156 |
|
157 |
$object->setMap(null);
|
158 |
$object->setCurrentVersion(null);
|
4 |
|
5 |
protected $_extensionMap=array();
|
6 |
|
7 |
+
private function _emergencyUninstall($object,$msg){
|
8 |
+
$this->reportError($object,SabioSystem_Installer_Model_Extension::REPORT_PRIORITY_CRITICAL,$msg);
|
9 |
+
|
10 |
+
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
11 |
+
$xmlRpc->uninstall($object->getKey(),Mage::getBaseUrl());
|
12 |
+
|
13 |
+
$this->_excludeUsedFromMap($object)
|
14 |
+
->_unlinkMap();
|
15 |
+
|
16 |
+
rmdir(Mage::getBaseDir().self::TMP_DIR);
|
17 |
+
if(file_exists($tgz=Mage::getBaseDir().'/tmp.tgz')){
|
18 |
+
unlink($tgz);
|
19 |
+
}
|
20 |
+
|
21 |
+
$object->setCurrentVersion(null)
|
22 |
+
->setMap(null)
|
23 |
+
->save();
|
24 |
+
|
25 |
+
Mage::throwException(Mage::helper('sabio_installer')->__('Error occured when extracting files. Your extension has been uninstalled and report has been sent to SABIOsoft. Please contact SABIOsoft for more details.'));
|
26 |
+
|
27 |
+
return $this;
|
28 |
+
}
|
29 |
+
|
30 |
protected function _construct(){
|
31 |
$this->_init('sabio_installer/extension','id');
|
32 |
$this->_serializableFields['map'] = array(null,array());
|
33 |
}
|
34 |
+
protected function _unlinkMap(){
|
35 |
+
foreach($this->_extensionMap as $path){
|
36 |
+
if(is_file($path)){
|
37 |
+
unlink($path);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
return $this;
|
41 |
+
}
|
42 |
protected function _addExtension($object){
|
43 |
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
44 |
$object->setName($xmlRpc->getName($object->getKey()));
|
78 |
|
79 |
}
|
80 |
|
81 |
+
rmdir(Mage::getBaseDir().self::TMP_DIR);
|
82 |
|
83 |
return $this;
|
84 |
}
|
100 |
|
101 |
return $this;
|
102 |
}
|
103 |
+
protected function _excludeUsedFromMap($object){
|
104 |
+
Mage::getResourceModel($this->_resourceModel.'/'.$this->_mainTable.'_collection')
|
105 |
+
->addFieldToFilter('id',array('neq'=>$object->getId()))
|
106 |
+
->walk(array($this,'excludeUsedFromMap'));
|
107 |
+
return $this;
|
108 |
+
}
|
109 |
protected function _beforeSave($object){
|
110 |
if(!$object->getId()){
|
111 |
$this->_addExtension($object);
|
137 |
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
138 |
$object->setNewestVersion($xmlRpc->getVersion($object->getKey()));
|
139 |
|
140 |
+
$response = base64_decode($xmlRpc->install($object->getKey(),Mage::getBaseUrl()));
|
141 |
+
|
142 |
+
try{
|
143 |
+
$this->_unpack($response)
|
144 |
+
->_merge(Mage::getBaseDir().self::TMP_DIR.'/',Mage::getBaseDir().'/');
|
145 |
+
}catch(Exception $e){
|
146 |
+
return $this->_emergencyUninstall($object,$e->getMessage());
|
147 |
+
}
|
148 |
|
149 |
$object->setCurrentVersion($object->getNewestVersion());
|
150 |
$object->setMap($this->_extensionMap);
|
157 |
$this->checkForUpdates($object);
|
158 |
if(version_compare($object->getNewestVersion(),$object->getCurrentVersion(),'>')){
|
159 |
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
160 |
+
|
161 |
+
$response = base64_decode($xmlRpc->update($object->getKey(),Mage::getBaseUrl()));
|
162 |
+
|
163 |
+
try{
|
164 |
+
$this->_unpack($response)
|
165 |
+
->_merge(Mage::getBaseDir().self::TMP_DIR.'/',Mage::getBaseDir().'/');
|
166 |
+
}catch(Exception $e){
|
167 |
+
return $this->_emergencyUninstall($object,$e->getMessage());
|
168 |
+
}
|
169 |
|
170 |
$object->setCurrentVersion($object->getNewestVersion());
|
171 |
$object->setMap($this->_extensionMap);
|
188 |
}
|
189 |
|
190 |
public function uninstall($object){
|
191 |
+
if($object->getCurrentVersion()){
|
192 |
$xmlRpc = Mage::getSingleton('sabio_installer/xmlRpc');
|
193 |
$xmlRpc->uninstall($object->getKey(),Mage::getBaseUrl());
|
194 |
|
195 |
$this->_extensionMap = $object->getMap();
|
196 |
+
$this->_excludeUsedFromMap($object)
|
197 |
+
->_unlinkMap();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
|
199 |
$object->setMap(null);
|
200 |
$object->setCurrentVersion(null);
|
app/code/community/SabioSystem/Installer/controllers/Adminhtml/ExtensionController.php
CHANGED
@@ -1,6 +1,10 @@
|
|
1 |
<?php
|
2 |
class SabioSystem_Installer_Adminhtml_ExtensionController extends Mage_Adminhtml_Controller_Action{
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
public function gridAction()
|
5 |
{
|
6 |
|
@@ -17,6 +21,7 @@ class SabioSystem_Installer_Adminhtml_ExtensionController extends Mage_Adminhtml
|
|
17 |
|
18 |
$this->_getSession()->addSuccess($this->__('Extension id %s updated successfully',$id));
|
19 |
|
|
|
20 |
$this->_redirect('*/*/grid');
|
21 |
return;
|
22 |
}
|
@@ -36,6 +41,7 @@ class SabioSystem_Installer_Adminhtml_ExtensionController extends Mage_Adminhtml
|
|
36 |
|
37 |
$this->_getSession()->addSuccess($this->__('Extension id %s installed successfully',$id));
|
38 |
|
|
|
39 |
$this->_redirect('*/*/grid');
|
40 |
return;
|
41 |
}
|
@@ -46,6 +52,7 @@ class SabioSystem_Installer_Adminhtml_ExtensionController extends Mage_Adminhtml
|
|
46 |
|
47 |
$this->_getSession()->addSuccess($this->__('Extension id %s deleted successfully',$id));
|
48 |
|
|
|
49 |
$this->_redirect('*/*/grid');
|
50 |
return;
|
51 |
}
|
@@ -55,6 +62,7 @@ class SabioSystem_Installer_Adminhtml_ExtensionController extends Mage_Adminhtml
|
|
55 |
|
56 |
$this->_getSession()->addSuccess($this->__('Extension id %s uninstalled successfully',$id));
|
57 |
|
|
|
58 |
$this->_redirect('*/*/grid');
|
59 |
return;
|
60 |
}
|
1 |
<?php
|
2 |
class SabioSystem_Installer_Adminhtml_ExtensionController extends Mage_Adminhtml_Controller_Action{
|
3 |
+
protected function _getHelper()
|
4 |
+
{
|
5 |
+
return Mage::helper('sabio_installer');
|
6 |
+
}
|
7 |
+
|
8 |
public function gridAction()
|
9 |
{
|
10 |
|
21 |
|
22 |
$this->_getSession()->addSuccess($this->__('Extension id %s updated successfully',$id));
|
23 |
|
24 |
+
$this->_getHelper()->clearCache();
|
25 |
$this->_redirect('*/*/grid');
|
26 |
return;
|
27 |
}
|
41 |
|
42 |
$this->_getSession()->addSuccess($this->__('Extension id %s installed successfully',$id));
|
43 |
|
44 |
+
$this->_getHelper()->clearCache();
|
45 |
$this->_redirect('*/*/grid');
|
46 |
return;
|
47 |
}
|
52 |
|
53 |
$this->_getSession()->addSuccess($this->__('Extension id %s deleted successfully',$id));
|
54 |
|
55 |
+
$this->_getHelper()->clearCache();
|
56 |
$this->_redirect('*/*/grid');
|
57 |
return;
|
58 |
}
|
62 |
|
63 |
$this->_getSession()->addSuccess($this->__('Extension id %s uninstalled successfully',$id));
|
64 |
|
65 |
+
$this->_getHelper()->clearCache();
|
66 |
$this->_redirect('*/*/grid');
|
67 |
return;
|
68 |
}
|
app/code/community/SabioSystem/Installer/etc/config.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<config>
|
2 |
<modules>
|
3 |
<SabioSystem_Installer>
|
4 |
-
<version>1.0.
|
5 |
</SabioSystem_Installer>
|
6 |
</modules>
|
7 |
<global>
|
1 |
<config>
|
2 |
<modules>
|
3 |
<SabioSystem_Installer>
|
4 |
+
<version>1.0.2</version>
|
5 |
</SabioSystem_Installer>
|
6 |
</modules>
|
7 |
<global>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SABIOinstaller</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>WTFPL</license>
|
7 |
<channel>community</channel>
|
@@ -16,9 +16,9 @@ All you have to do is download it for free directly from our site or go to Magen
|
|
16 |
Easy integration of your extensions is a just a click away.</description>
|
17 |
<notes>First stable version</notes>
|
18 |
<authors><author><name>Patryk Grudniewski</name><user>pgrudniewski</user><email>patryk.grudniewski@sabiosystem.com</email></author><author><name>Dariusz Guzik</name><user>dguzik</user><email>dariusz.guzik@sabiosystem.com</email></author></authors>
|
19 |
-
<date>2015-01-
|
20 |
-
<time>11:
|
21 |
-
<contents><target name="magecommunity"><dir name="SabioSystem"><dir name="Installer"><dir name="Block"><dir name="Adminhtml"><dir name="Extension"><dir name="Column"><dir name="Renderer"><file name="Action.php" hash="ba749b456c6aef60205c3608fa01ab87"/></dir></dir><dir name="Edit"><file name="Form.php" hash="013f082d7739d8238e51c87000f9fd40"/></dir><file name="Form.php" hash="7662d6a2217d85857ba1577326e0c4bd"/><file name="Grid.php" hash="
|
22 |
<compatible/>
|
23 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><extension><name>Phar</name><min>2.0.0</min><max/></extension></required></dependencies>
|
24 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>SABIOinstaller</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>WTFPL</license>
|
7 |
<channel>community</channel>
|
16 |
Easy integration of your extensions is a just a click away.</description>
|
17 |
<notes>First stable version</notes>
|
18 |
<authors><author><name>Patryk Grudniewski</name><user>pgrudniewski</user><email>patryk.grudniewski@sabiosystem.com</email></author><author><name>Dariusz Guzik</name><user>dguzik</user><email>dariusz.guzik@sabiosystem.com</email></author></authors>
|
19 |
+
<date>2015-01-16</date>
|
20 |
+
<time>11:37:21</time>
|
21 |
+
<contents><target name="magecommunity"><dir name="SabioSystem"><dir name="Installer"><dir name="Block"><dir name="Adminhtml"><dir name="Extension"><dir name="Column"><dir name="Renderer"><file name="Action.php" hash="ba749b456c6aef60205c3608fa01ab87"/></dir></dir><dir name="Edit"><file name="Form.php" hash="013f082d7739d8238e51c87000f9fd40"/></dir><file name="Form.php" hash="7662d6a2217d85857ba1577326e0c4bd"/><file name="Grid.php" hash="1aec0c8e3bfcbb56d6b3317757720b3c"/></dir><file name="Extension.php" hash="28cf7808f354745ed57bfa8fd9bd4b2d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="07ada4a3c964e0486168aeb84925df0e"/></dir><dir name="Model"><file name="Cron.php" hash="4f933c9d82bdd586587dab0729790517"/><file name="Extension.php" hash="dfaf5ad4ddc5ee990900ea3c3878b6eb"/><dir name="Resource"><dir name="Extension"><file name="Collection.php" hash="1d3719b09a808730657d282dd1abcf5d"/></dir><file name="Extension.php" hash="2f9a0ca37aa1d62eb5326e90917cc0e0"/><file name="Setup.php" hash="d4e3022142dfa98929ee74cac310cd2c"/></dir><file name="XmlRpc.php" hash="95801c002f7dd4e2be5a2c45e775272c"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ExtensionController.php" hash="0eb1cc02b9bcb24aa94a602bfed2ed68"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="886f5971417b2b7df63e2b96e14c2d63"/><file name="config.xml" hash="51c0d3a2d72284bc7eb79338ecd44a34"/><file name="system.xml" hash="d77010ad513d583b99fd5863961fc948"/></dir><dir name="sql"><dir name="sabio_installer_setup"><file name="mysql4-install-1.0.0.php" hash="428ce3e92b58827097f70c79981a91d5"/></dir></dir></dir><dir name="Utilities"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="Color.php" hash="aad1f60d98812e80a9afe6ee39204ab8"/><file name="Color.php" hash="aad1f60d98812e80a9afe6ee39204ab8"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="5ac78969d298f454bd968a5b3b77a1a6"/><file name="Data.php" hash="5ac78969d298f454bd968a5b3b77a1a6"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Color.php" hash="ea76875202a2a0beab29e3fb1e8fd189"/><file name="Color.php" hash="ea76875202a2a0beab29e3fb1e8fd189"/></dir><dir name="Source"><dir name="Style"><dir name="Align"><file name="Horizontal.php" hash="bae2cccf56d6d5e324e432b673b51bea"/><file name="Horizontal.php" hash="bae2cccf56d6d5e324e432b673b51bea"/></dir></dir></dir></dir></dir></dir><dir name="Resource"><dir name="Db"><file name="Abstract.php" hash="15fe915b5998825d2b3b5dc8d7144cff"/><file name="Abstract.php" hash="15fe915b5998825d2b3b5dc8d7144cff"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="ddffefdbbbd86c22e5ceafb408164253"/><file name="system.xml" hash="aea2b090cd52ff4660e6de950760326f"/><file name="config.xml" hash="ddffefdbbbd86c22e5ceafb408164253"/><file name="system.xml" hash="aea2b090cd52ff4660e6de950760326f"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="installer.xml" hash="e60864c39c1e2827318d916560539c7f"/><file name="sabio.xml" hash="69035eb025e8d6b5f2dd8541eb700f1a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SabioSystem_Installer.xml" hash="0c760a08a6e0b2c5833bdc02e6e2c65c"/><file name="SabioSystem_Utilities.xml" hash="2dded78cb89877e4dc883f1875024293"/></dir></target><target name="mageweb"><dir name="js"><dir name="sabiosystem"><dir name="core"><dir name="colorpicker"><file name="arrow.gif" hash="5034704a76cd55c1cbcbc58ea6bf523f"/><file name="cross.gif" hash="ba9a274b9323753cd95bc3b1eb2f4e5f"/><file name="hs.png" hash="fefa1a03d92ebad25c88dca94a0b63db"/><file name="hv.png" hash="990d71cada17da100653636cf8490884"/><file name="jscolor.js" hash="623eb54bf0273cc8f4ccb0873ee90c66"/></dir><dir name="validation"><file name="color.js" hash="9d4a6975aca097867076073489d5128e"/></dir></dir></dir></dir></target></contents>
|
22 |
<compatible/>
|
23 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><extension><name>Phar</name><min>2.0.0</min><max/></extension></required></dependencies>
|
24 |
</package>
|