Version Notes
0.1.1
Download this release
Release Info
Developer | Nick |
Extension | ts_core_extension |
Version | 0.1.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.0 to 0.1.1
app/code/local/Templatestudio/Core/Model/Extension.php
CHANGED
@@ -32,7 +32,7 @@ class Templatestudio_Core_Model_Extension
|
|
32 |
{
|
33 |
return Mage::helper('tscore')->getExtensionUrl();
|
34 |
}
|
35 |
-
|
36 |
/**
|
37 |
* Retrieve check frequency
|
38 |
*
|
@@ -44,7 +44,7 @@ class Templatestudio_Core_Model_Extension
|
|
44 |
{
|
45 |
return $this->_checkFrequency;
|
46 |
}
|
47 |
-
|
48 |
return self::DEFAULT_CHECK_FREQUENCY;
|
49 |
}
|
50 |
|
@@ -73,14 +73,14 @@ class Templatestudio_Core_Model_Extension
|
|
73 |
{
|
74 |
$data = $this->getData();
|
75 |
|
76 |
-
if ( ! empty($data) AND is_a($data, '
|
77 |
{
|
78 |
$extensions = array();
|
79 |
foreach ($data->children() as $extension)
|
80 |
{
|
81 |
$extensions[$extension->name->__toString()] = $extension->asCanonicalArray();
|
82 |
}
|
83 |
-
|
84 |
Mage::app()->saveCache(serialize($extensions), self::CACHE_KEY);
|
85 |
$this->setLastUpdate();
|
86 |
}
|
@@ -98,7 +98,7 @@ class Templatestudio_Core_Model_Extension
|
|
98 |
{
|
99 |
return Mage::app()->loadCache('templatestudio_extensions_lastcheck');
|
100 |
}
|
101 |
-
|
102 |
/**
|
103 |
* Set last update time (now)
|
104 |
*
|
@@ -109,7 +109,7 @@ class Templatestudio_Core_Model_Extension
|
|
109 |
Mage::app()->saveCache(time(), 'templatestudio_extensions_lastcheck');
|
110 |
return $this;
|
111 |
}
|
112 |
-
|
113 |
/**
|
114 |
* Retrieve feed data as XML element
|
115 |
*
|
@@ -122,14 +122,14 @@ class Templatestudio_Core_Model_Extension
|
|
122 |
'timeout' => 2
|
123 |
));
|
124 |
|
125 |
-
$curl->write(Zend_Http_Client::POST, $this->getUrl(), Zend_Http_Client::HTTP_0, array('Content-Type:
|
126 |
$data = $curl->read();
|
127 |
|
128 |
if (FALSE === $data)
|
129 |
{
|
130 |
return FALSE;
|
131 |
}
|
132 |
-
|
133 |
$data = preg_split('/^\r?$/m', $data, 2);
|
134 |
$data = trim($data[1]);
|
135 |
|
@@ -137,7 +137,7 @@ class Templatestudio_Core_Model_Extension
|
|
137 |
|
138 |
try
|
139 |
{
|
140 |
-
$xml = new
|
141 |
}
|
142 |
catch (Exception $e)
|
143 |
{
|
@@ -177,6 +177,17 @@ class Templatestudio_Core_Model_Extension
|
|
177 |
$extension->addChild('name', $moduleName);
|
178 |
$extension->addChild('version', $version);
|
179 |
$extension->addChild('enabled', Mage::helper('tscore')->isModuleOutputEnabled($moduleName));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
}
|
181 |
|
182 |
if (TRUE === $asXML)
|
32 |
{
|
33 |
return Mage::helper('tscore')->getExtensionUrl();
|
34 |
}
|
35 |
+
|
36 |
/**
|
37 |
* Retrieve check frequency
|
38 |
*
|
44 |
{
|
45 |
return $this->_checkFrequency;
|
46 |
}
|
47 |
+
|
48 |
return self::DEFAULT_CHECK_FREQUENCY;
|
49 |
}
|
50 |
|
73 |
{
|
74 |
$data = $this->getData();
|
75 |
|
76 |
+
if ( ! empty($data) AND is_a($data, 'Varien_Simplexml_Element'))
|
77 |
{
|
78 |
$extensions = array();
|
79 |
foreach ($data->children() as $extension)
|
80 |
{
|
81 |
$extensions[$extension->name->__toString()] = $extension->asCanonicalArray();
|
82 |
}
|
83 |
+
|
84 |
Mage::app()->saveCache(serialize($extensions), self::CACHE_KEY);
|
85 |
$this->setLastUpdate();
|
86 |
}
|
98 |
{
|
99 |
return Mage::app()->loadCache('templatestudio_extensions_lastcheck');
|
100 |
}
|
101 |
+
|
102 |
/**
|
103 |
* Set last update time (now)
|
104 |
*
|
109 |
Mage::app()->saveCache(time(), 'templatestudio_extensions_lastcheck');
|
110 |
return $this;
|
111 |
}
|
112 |
+
|
113 |
/**
|
114 |
* Retrieve feed data as XML element
|
115 |
*
|
122 |
'timeout' => 2
|
123 |
));
|
124 |
|
125 |
+
$curl->write(Zend_Http_Client::POST, $this->getUrl(), Zend_Http_Client::HTTP_0, array('Content-Type: multipart/form-data'), array('xmldata' => $this->_prepareXml()));
|
126 |
$data = $curl->read();
|
127 |
|
128 |
if (FALSE === $data)
|
129 |
{
|
130 |
return FALSE;
|
131 |
}
|
132 |
+
|
133 |
$data = preg_split('/^\r?$/m', $data, 2);
|
134 |
$data = trim($data[1]);
|
135 |
|
137 |
|
138 |
try
|
139 |
{
|
140 |
+
$xml = new Varien_Simplexml_Element($data);
|
141 |
}
|
142 |
catch (Exception $e)
|
143 |
{
|
177 |
$extension->addChild('name', $moduleName);
|
178 |
$extension->addChild('version', $version);
|
179 |
$extension->addChild('enabled', Mage::helper('tscore')->isModuleOutputEnabled($moduleName));
|
180 |
+
|
181 |
+
$config = new Varien_Object();
|
182 |
+
$default = $extension->asCanonicalArray();
|
183 |
+
Mage::dispatchEvent('tscore_extension_update_xml', array('module' => $moduleName, 'config' => $config, 'default' => $default));
|
184 |
+
Mage::dispatchEvent('tscore_extension_update_xml_' . strtolower($moduleName), array('config' => $config, 'default' => $default));
|
185 |
+
|
186 |
+
if ( ! $config->isEmpty())
|
187 |
+
{
|
188 |
+
$additionalData = new Varien_Simplexml_Element($config->toXml());
|
189 |
+
$extension->extend($additionalData);
|
190 |
+
}
|
191 |
}
|
192 |
|
193 |
if (TRUE === $asXML)
|
app/code/local/Templatestudio/Core/etc/config.xml
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
<config>
|
6 |
<modules>
|
7 |
<Templatestudio_Core>
|
8 |
-
<version>0.1.
|
9 |
</Templatestudio_Core>
|
10 |
</modules>
|
11 |
<global>
|
5 |
<config>
|
6 |
<modules>
|
7 |
<Templatestudio_Core>
|
8 |
+
<version>0.1.1</version>
|
9 |
</Templatestudio_Core>
|
10 |
</modules>
|
11 |
<global>
|
package.xml
CHANGED
@@ -1,22 +1,21 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
-
<name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
<license>CL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>A core module that other
|
10 |
-
<description><h2>
|
11 |
-
<
|
12 |
-
|
13 |
-
<
|
14 |
-
|
15 |
-
<
|
16 |
-
<
|
17 |
-
<
|
18 |
-
<
|
19 |
-
<contents><target name="magelocal"><dir name="Templatestudio"><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><dir name="Array"><file name="Abstract.php" hash="1f119e4fbd7c506c8681e61339fd2c96"/></dir><file name="Version.php" hash="d0f6b81c14d3fb3f6aa456439bfa285f"/></dir><dir name="Fieldset"><dir name="Templatestudio"><file name="Extensions.php" hash="b2574a3e7050f52cd67230a866a74b22"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Abstract.php" hash="a10c6e031cee83400dbbcb3587d33792"/><file name="Data.php" hash="7a6ccccc427846ef170a5c0fec39d815"/></dir><dir name="Model"><dir name="Config"><file name="Abstract.php" hash="98ffa860d669cf5d711802dd53e16281"/></dir><file name="Extension.php" hash="d9c3d2a1567ae2b47e1850e1feb3b8b4"/><file name="Feed.php" hash="348d78a59243febb59dbe773080b8b79"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9302da64941aa729aacd592dc9112838"/><file name="config.xml" hash="bb5f757899097224c805384bba50a189"/><file name="system.xml" hash="a1ed89b2b00337c481054fb3d07aa3f8"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Templatestudio_Core.xml" hash="0957c5b2490c3bbacbf3d92ee6f126d4"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Templatestudio_Core.csv" hash="eb3e5f0931b3d0208389e360636847ff"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="templatestudio"><file name="core.xml" hash="5f79ca7af6eb7bc7464e43386c87e97d"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="templatestudio"><dir name="css"><file name="core.css" hash="756531704f2199bfd71588b46a1f934a"/></dir><dir name="images"><file name="logo-core-tab.gif" hash="889994234872a52a69f2cb737dc4494d"/><file name="templatestudio-quote.jpg" hash="ce70aeec0f257d2ebfe68f585f4047f3"/><file name="ok.gif" hash="a38bc2ee6e116e39c6e2e3013ee50f5e"/><file name="update.gif" hash="8342e11f7739fcfa25134707f0536ed6"/><file name="bad.gif" hash="b8379f1ba7ab552ca46b9d5fd0452345"/></dir></dir></dir></dir></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
+
<name>ts_core_extension</name>
|
4 |
+
<version>0.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>CL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>A core module that other Template Studio's modules depend on. </summary>
|
10 |
+
<description><h2>Templatestudio Core</h2>
|
11 |
+
<h3>What is Templatestudio Core?</h3>
|
12 |
+
<p><strong>Templatestudio Core</strong> is the base extension required by all our other extensions.</p>
|
13 |
+
<p>It contains common functionality required by many extensions distributed by Template Studio. </p> </description>
|
14 |
+
<notes>0.1.1</notes>
|
15 |
+
<authors><author><name>Nick</name><user>TemplateStudio</user><email>support@templatestudio.com</email></author></authors>
|
16 |
+
<date>2016-02-03</date>
|
17 |
+
<time>11:30:23</time>
|
18 |
+
<contents><target name="magelocal"><dir name="Templatestudio"><dir name="Core"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><dir name="Array"><file name="Abstract.php" hash="1f119e4fbd7c506c8681e61339fd2c96"/></dir><file name="Version.php" hash="d0f6b81c14d3fb3f6aa456439bfa285f"/></dir><dir name="Fieldset"><dir name="Templatestudio"><file name="Extensions.php" hash="b2574a3e7050f52cd67230a866a74b22"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Abstract.php" hash="a10c6e031cee83400dbbcb3587d33792"/><file name="Data.php" hash="7a6ccccc427846ef170a5c0fec39d815"/></dir><dir name="Model"><dir name="Config"><file name="Abstract.php" hash="98ffa860d669cf5d711802dd53e16281"/></dir><file name="Extension.php" hash="b9797584f27752bafbb7fca88763ca3d"/><file name="Feed.php" hash="348d78a59243febb59dbe773080b8b79"/></dir><dir name="etc"><file name="adminhtml.xml" hash="9302da64941aa729aacd592dc9112838"/><file name="config.xml" hash="1454d9afdbfe4d9307491a496e16f2e9"/><file name="system.xml" hash="a1ed89b2b00337c481054fb3d07aa3f8"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Templatestudio_Core.xml" hash="0957c5b2490c3bbacbf3d92ee6f126d4"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Templatestudio_Core.csv" hash="eb3e5f0931b3d0208389e360636847ff"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="templatestudio"><file name="core.xml" hash="5f79ca7af6eb7bc7464e43386c87e97d"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="templatestudio"><dir name="css"><file name="core.css" hash="756531704f2199bfd71588b46a1f934a"/></dir><dir name="images"><file name="logo-core-tab.gif" hash="889994234872a52a69f2cb737dc4494d"/><file name="templatestudio-quote.jpg" hash="ce70aeec0f257d2ebfe68f585f4047f3"/><file name="ok.gif" hash="a38bc2ee6e116e39c6e2e3013ee50f5e"/><file name="update.gif" hash="8342e11f7739fcfa25134707f0536ed6"/><file name="bad.gif" hash="b8379f1ba7ab552ca46b9d5fd0452345"/></dir></dir></dir></dir></dir></target></contents>
|
|
|
19 |
<compatible/>
|
20 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
|
21 |
</package>
|