Version Notes
- 1.5.0: add automatic versioning for merged css/js files
- 1.4.0: Move themes files to the folder app/design/frontend/base/default, update yuicompressor to version 2.4.7, generate css/js file per store and not globally
- 1.3.1: fix Paypal donation button
- 1.3.0: improve canonical url generation, improve some configuration parameters, remove the option JS Packer because incompatible with Magento
- 1.2.0: improve compatibility with compilation feature of Magento, add a js/css flush button directly in the configuration page
- 1.1.0: rewrite some classes of the minify libraries to respect PHP 5 and prevent some errors, change the module name, make it compatible with compilation feature of Magento, add canonical url feature for SEO
- 1.0.10: fix type for css files stored in /js/ folder
- Version 1.0.9: make correct package for Magento prior to 1.5
- 1.0.8: make it compatible with 1.5 and some improvements.
- 1.0.2: add cron task to allow to update compressed/minified js/css files periodically
- 1.0.1: fix a missing config element class, this class seems to exists only since 1.4.1 or more
Release Info
Developer | Magento Core Team |
Extension | Diglin_UIOptimization |
Version | 1.5.0 |
Comparing to | |
See all releases |
Code changes from version 1.4.0 to 1.5.0
@@ -17,6 +17,48 @@
|
|
17 |
*/
|
18 |
class Diglin_UIOptimization_Model_Overwrite_Design_Package extends Mage_Core_Model_Design_Package
|
19 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
/**
|
21 |
* Merge specified css files and return URL to the merged file on success
|
22 |
*
|
@@ -26,7 +68,7 @@ class Diglin_UIOptimization_Model_Overwrite_Design_Package extends Mage_Core_Mod
|
|
26 |
public function getMergedCssUrl ($files)
|
27 |
{
|
28 |
$suffixFilename = (Mage::app()->getStore()->isCurrentlySecure()) ? '-ssl' : '';
|
29 |
-
$targetFilename = md5(implode(',', $files)) . $suffixFilename . '.css';
|
30 |
$targetDir = $this->_initMergerDir('css');
|
31 |
if (! $targetDir) {
|
32 |
return '';
|
17 |
*/
|
18 |
class Diglin_UIOptimization_Model_Overwrite_Design_Package extends Mage_Core_Model_Design_Package
|
19 |
{
|
20 |
+
/**
|
21 |
+
* Get the timestamp of the newest file
|
22 |
+
* (inspired by http://smith-web.net/2013/02/09/magento-css-auto-versioning)
|
23 |
+
*
|
24 |
+
* @param array $srcFiles
|
25 |
+
* @return int $timeStamp
|
26 |
+
*/
|
27 |
+
protected function getNewestFileTimestamp($srcFiles)
|
28 |
+
{
|
29 |
+
$timeStamp = null;
|
30 |
+
foreach ($srcFiles as $file) {
|
31 |
+
if(is_null($timeStamp)) {
|
32 |
+
//if is first file, set $timeStamp to filemtime of file
|
33 |
+
$timeStamp = filemtime($file);
|
34 |
+
} else {
|
35 |
+
//get max of current files filemtime and the max so far
|
36 |
+
$timeStamp = max($timeStamp, filemtime($file));
|
37 |
+
}
|
38 |
+
}
|
39 |
+
return $timeStamp;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Merge specified javascript files and return URL to the merged file on success
|
44 |
+
*
|
45 |
+
* @param $files
|
46 |
+
* @return string
|
47 |
+
*/
|
48 |
+
public function getMergedJsUrl($files)
|
49 |
+
{
|
50 |
+
$targetFilename = md5(implode(',', $files)) . ('_' . $this->getNewestFileTimestamp($files)) . '.js';
|
51 |
+
$targetDir = $this->_initMergerDir('js');
|
52 |
+
if (!$targetDir) {
|
53 |
+
return '';
|
54 |
+
}
|
55 |
+
if ($this->_mergeFiles($files, $targetDir . DS . $targetFilename, false, null, 'js')) {
|
56 |
+
return Mage::getBaseUrl('media', Mage::app()->getRequest()->isSecure()) . 'js/' . $targetFilename;
|
57 |
+
}
|
58 |
+
return '';
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
/**
|
63 |
* Merge specified css files and return URL to the merged file on success
|
64 |
*
|
68 |
public function getMergedCssUrl ($files)
|
69 |
{
|
70 |
$suffixFilename = (Mage::app()->getStore()->isCurrentlySecure()) ? '-ssl' : '';
|
71 |
+
$targetFilename = md5(implode(',', $files)) . ('_' . $this->getNewestFileTimestamp($files)) . $suffixFilename . '.css';
|
72 |
$targetDir = $this->_initMergerDir('css');
|
73 |
if (! $targetDir) {
|
74 |
return '';
|
Binary file
|
Binary file
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Diglin_UIOptimization</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -44,20 +44,21 @@ Inspired by the module from Yoast, this feature allows you to create canonical u
|
|
44 |
- An assistant will be available soon
|
45 |
- Follow the instruction in the configuration page
|
46 |
- In case of Access Denied in the backend: clear your cache, logout/login. In case, it still doesn't work, save again the user role in System > Permissions > Roles.</description>
|
47 |
-
<notes>-
|
48 |
-
-
|
49 |
-
-
|
50 |
-
-
|
51 |
-
-
|
52 |
-
-
|
|
|
53 |
- Version 1.0.9: make correct package for Magento prior to 1.5
|
54 |
-
-
|
55 |
-
-
|
56 |
-
-
|
57 |
<authors><author><name>diglin</name><user>auto-converted</user><email>sly@diglin.com</email></author></authors>
|
58 |
-
<date>2013-
|
59 |
-
<time>21:
|
60 |
-
<contents><target name="magecommunity"><dir name="Diglin"><dir name="UIOptimization"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Heading.php" hash="d15c30ac285cdff33a2ab32eb59cb564"/><file name="Hint.php" hash="aa26cc47900487fde4e747f413fa7aef"/></dir></dir></dir><dir name="Optimize"><file name="Head.php" hash="066b19559f082283f89334bf69c2d6c8"/></dir><file name="W3Ccssvalidator.php" hash="43f2e40257bc6d729f55ff86f892ffd9"/><file name="W3Chtmlvalidator.php" hash="3bb405092f65ce69f1de065074e938ef"/></dir><dir name="Helper"><file name="Data.php" hash="abf185647c5b74cc0cd03e8f1217d7bb"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Caseproperties.php" hash="71ecf181882b3ba86f34e9b13688b818"/><file name="Charset.php" hash="ed5b2d44ac015ad7a2e47e5256fcf326"/><file name="Csslevel.php" hash="a4c463268772612d76fa8cb01d48b394"/><file name="Csstypeminify.php" hash="ac3a3407105923255c212aabfdb7839e"/><file name="Doctype.php" hash="25f7b13fa0fb7eca9325c91fa84f1f66"/><file name="Jstypeminify.php" hash="e56cf7fc3ab95320d786972355b5176f"/><file name="Language.php" hash="2824c01f7014bc9c2a01bba519bf0d70"/><file name="Mergeselectors.php" hash="70e30f4f5e303b045838991184841409"/><file name="Optishorthand.php" hash="a66d0a74e0e659ddabc26d12fe30333a"/><file name="Profile.php" hash="4e4245d513a11ea2e48648d15f048952"/><file name="Template.php" hash="512a4faca68c7bb11b75ced04ec3fd23"/><file name="Usermedium.php" hash="53748dbbb513cf47e0a5ff6aa1f45947"/><file name="Warning.php" hash="375871ff5f28fb6c0679b7b935df638e"/></dir></dir><dir name="Overwrite"><dir name="Design"><file name="Package.php" hash="
|
61 |
<compatible/>
|
62 |
<dependencies/>
|
63 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Diglin_UIOptimization</name>
|
4 |
+
<version>1.5.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
44 |
- An assistant will be available soon
|
45 |
- Follow the instruction in the configuration page
|
46 |
- In case of Access Denied in the backend: clear your cache, logout/login. In case, it still doesn't work, save again the user role in System > Permissions > Roles.</description>
|
47 |
+
<notes>- 1.5.0: add automatic versioning for merged css/js files
|
48 |
+
- 1.4.0: Move themes files to the folder app/design/frontend/base/default, update yuicompressor to version 2.4.7, generate css/js file per store and not globally
|
49 |
+
- 1.3.1: fix Paypal donation button
|
50 |
+
- 1.3.0: improve canonical url generation, improve some configuration parameters, remove the option JS Packer because incompatible with Magento
|
51 |
+
- 1.2.0: improve compatibility with compilation feature of Magento, add a js/css flush button directly in the configuration page
|
52 |
+
- 1.1.0: rewrite some classes of the minify libraries to respect PHP 5 and prevent some errors, change the module name, make it compatible with compilation feature of Magento, add canonical url feature for SEO
|
53 |
+
- 1.0.10: fix type for css files stored in /js/ folder
|
54 |
- Version 1.0.9: make correct package for Magento prior to 1.5
|
55 |
+
- 1.0.8: make it compatible with 1.5 and some improvements.
|
56 |
+
- 1.0.2: add cron task to allow to update compressed/minified js/css files periodically
|
57 |
+
- 1.0.1: fix a missing config element class, this class seems to exists only since 1.4.1 or more</notes>
|
58 |
<authors><author><name>diglin</name><user>auto-converted</user><email>sly@diglin.com</email></author></authors>
|
59 |
+
<date>2013-05-24</date>
|
60 |
+
<time>21:31:39</time>
|
61 |
+
<contents><target name="magecommunity"><dir name="Diglin"><dir name="UIOptimization"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Heading.php" hash="d15c30ac285cdff33a2ab32eb59cb564"/><file name="Hint.php" hash="aa26cc47900487fde4e747f413fa7aef"/></dir></dir></dir><dir name="Optimize"><file name="Head.php" hash="066b19559f082283f89334bf69c2d6c8"/></dir><file name="W3Ccssvalidator.php" hash="43f2e40257bc6d729f55ff86f892ffd9"/><file name="W3Chtmlvalidator.php" hash="3bb405092f65ce69f1de065074e938ef"/></dir><dir name="Helper"><file name="Data.php" hash="abf185647c5b74cc0cd03e8f1217d7bb"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Caseproperties.php" hash="71ecf181882b3ba86f34e9b13688b818"/><file name="Charset.php" hash="ed5b2d44ac015ad7a2e47e5256fcf326"/><file name="Csslevel.php" hash="a4c463268772612d76fa8cb01d48b394"/><file name="Csstypeminify.php" hash="ac3a3407105923255c212aabfdb7839e"/><file name="Doctype.php" hash="25f7b13fa0fb7eca9325c91fa84f1f66"/><file name="Jstypeminify.php" hash="e56cf7fc3ab95320d786972355b5176f"/><file name="Language.php" hash="2824c01f7014bc9c2a01bba519bf0d70"/><file name="Mergeselectors.php" hash="70e30f4f5e303b045838991184841409"/><file name="Optishorthand.php" hash="a66d0a74e0e659ddabc26d12fe30333a"/><file name="Profile.php" hash="4e4245d513a11ea2e48648d15f048952"/><file name="Template.php" hash="512a4faca68c7bb11b75ced04ec3fd23"/><file name="Usermedium.php" hash="53748dbbb513cf47e0a5ff6aa1f45947"/><file name="Warning.php" hash="375871ff5f28fb6c0679b7b935df638e"/></dir></dir><dir name="Overwrite"><dir name="Design"><file name="Package.php" hash="263b8860d24e322ba74690a4b4af5035"/></dir></dir><file name="Observer.php" hash="3b5ccbf0aef2289fe9d0d054d760478f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="cde46a100bc94df35ce1fc8896e87514"/><file name="config.xml" hash="03bfe35e6446a1b319d7d0d02c307500"/><file name="system.xml" hash="9acbc1244d4eb9568f611a3d625b7cca"/></dir></dir></dir></target><target name="magelib"><dir name="Diglin"><dir name="Csstidy"><file name="Core.php" hash="820e39515baba186803453eaf735bb5d"/><file name="Optimise.php" hash="3694084e725ba252b623492d0d09a67d"/><file name="Print.php" hash="203c86314418bc2b70fcb8beccafea3b"/><file name="README" hash="3a3e2ddf61de1689e042291b821262b0"/><file name="data.inc.php" hash="516492aeb1c37bb2a869863d9f2a21a1"/></dir><dir name="HTTP"><dir name="Request2"><dir name="Adapter"><file name="Curl.php" hash="e7a010aee80ee8dcfe73b5efc0890726"/><file name="Mock.php" hash="d33b4f9fdebdfad58034f4fe028a111c"/><file name="Socket.php" hash="ced36e7a1a3ed7a3adad46518c1954c2"/></dir><dir name="Observer"><file name="Log.php" hash="9aefde329905d25619d16f525bee9c6d"/></dir><file name="Adapter.php" hash="9f90535b4b7bff4a7052f767579b0ff1"/><file name="Exception.php" hash="ce7b316eaedcd5928a57e74725539fa6"/><file name="MultipartBody.php" hash="7073427f223db55059eca79cac36bbc1"/><file name="Response.php" hash="bdbcb96eadd6549d916f95acf45a0268"/></dir><file name="ConditionalGet.php" hash="5fb451fba76286fa28323f53f1870daf"/><file name="Encoder.php" hash="37a2b8e6bcb2908162e2881be93040a6"/><file name="Request2.php" hash="73fec75564cceac997605763812f061f"/></dir><dir name="Io"><file name="File.php" hash="d1b4545aeac7030d6991cf9310194b37"/></dir><dir name="Minify"><dir name="CSS"><file name="Compressor.php" hash="7382e9fe1dc08eef2b06fa016ed2dde8"/><file name="UriRewriter.php" hash="0585d4c22e773319b1616caa04ee253d"/></dir><dir name="Cache"><file name="APC.php" hash="6cab72f5c2a8cbe72f0751e7fdb35299"/><file name="File.php" hash="a0b06218ace157a91e8581481207554e"/><file name="Memcache.php" hash="92b3b852552e54fee0746beaeecfd920"/></dir><dir name="Controller"><file name="Base.php" hash="93d54ee900c594dae559a20d020d6eaa"/><file name="Files.php" hash="510d15562a7b77eafb3d366dea9cfcc9"/><file name="Groups.php" hash="cbf4869e3d9f99d56b9581f8477e78a3"/><file name="MinApp.php" hash="15a18fbc0cc30664e08ea880f4538215"/><file name="Page.php" hash="650d9edc5cfddd92027e6b7b257568f9"/><file name="Version1.php" hash="9a8fbce1285b08047393442e556adf89"/></dir><file name="Build.php" hash="78fe924cecb08a507f6c8fde9090dca5"/><file name="CSS.php" hash="128ff0cb67f075f175a51d0f9aac7469"/><file name="CommentPreserver.php" hash="efab6711d7ec10b046a58826dc314d21"/><file name="HTML.php" hash="ef58c0cf87dbec2f0301330062781b27"/><file name="ImportProcessor.php" hash="29379d4088d36d706ebaca5c7649ed27"/><file name="Lines.php" hash="ca9d9d718035dfb400c77568c9692f7c"/><file name="Logger.php" hash="b92325836feb2e64992ff931dd9b7454"/><file name="Packer.php" hash="ddc1e068af1043089764c80eaded7d81"/><file name="Source.php" hash="d9cbdc2851722a509157ab469b681b22"/><file name="YUICompressor.php" hash="4b73c98c6b650f54a96a264f3e0f0c8d"/></dir><dir name="Net"><file name="URL2.php" hash="65e54166dcf0994507459d0ad5b97a2c"/></dir><dir name="Services"><dir name="W3C"><dir name="CSSValidator"><file name="Error.php" hash="41cfd8ca38ef335ce03e75802c57ab81"/><file name="Message.php" hash="9d83bc04fdf945dc51d9974d6f626cfc"/><file name="Response.php" hash="7ae2b76ba7fdf008d06818596628f05f"/><file name="Warning.php" hash="3b654f71af352d5be419ef968323968f"/></dir><dir name="HTMLValidator"><file name="Error.php" hash="39139614730155f1cb70f8e35997cf09"/><file name="Exception.php" hash="133012d58d41064e2712ca93fee77ca4"/><file name="Message.php" hash="dcbdb982c3308598b8c2cd69caf591ff"/><file name="Response.php" hash="b263217ee5da08f275a77357d08efcf9"/><file name="Warning.php" hash="1f5f024525ead59be6adf39f78e93615"/></dir><file name="CSSValidator.php" hash="ae14a24c658a28adf2f4cbf3e2af17f8"/><file name="HTMLValidator.php" hash="75ac95c991d238fe10a2d4e54c6d2a07"/></dir></dir><dir name="Solar"><file name="Dir.php" hash="e71fa00999543f6c14960fffc7fe4f59"/></dir><dir name="yuicompressor"><file name="yuicompressor-2.4.7.jar" hash="a64311cb39d119805b41d547c8dd039d"/><file name="yuicompressor.jar" hash="a64311cb39d119805b41d547c8dd039d"/></dir><file name="FirePHP.php" hash="0c1dce00e352b76ad76b36fc0a4d6fc7"/><file name="JSMin.php" hash="f6a43fd592beddde0736e19eb71d0cb0"/><file name="JSMinPlus.php" hash="99303433243e08149dd9c5082e22cf31"/><file name="JavaScriptPacker.php" hash="87ad3bd2bf41c3dbd4f9108a13ce3f45"/><file name="Minify.php" hash="e26f89ec7d5890875ed1de40875f46fa"/><file name="ParseMaster.php" hash="70988c48e5a68c8d3109d50542cfcde0"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="w3c-validator.css" hash="ec35256d2c26b55084099d447fc15f37"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="uioptimization.xml" hash="0db614f8736ab73850e64fec19163adb"/></dir><dir name="template"><dir name="uioptimization"><file name="canonicalurl.phtml" hash="50b14f2d39febd53232da5f1091c5b98"/><file name="w3ccssvalidator.phtml" hash="df20893c83302cac5485da4de78ba89c"/><file name="w3chtmlvalidator.phtml" hash="662d5d642f31b5fe2853cf8721b9e093"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Diglin_UIOptimization.xml" hash="df03af601856cd1869a114147b8eb6cc"/></dir></target></contents>
|
62 |
<compatible/>
|
63 |
<dependencies/>
|
64 |
</package>
|