Version Notes
- Regenerates CSS files when saving CSS configuration
- Regenerates JS files when saving JS configuration
- Use the correct copyrights for Magento JS files
Download this release
Release Info
Developer | Fabrice Creuzot |
Extension | Compressor |
Version | 1.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2.2
app/code/community/Luigifab/Compressor/Block/Head.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Created V/20/08/2010
|
4 |
-
* Updated
|
5 |
-
* Version
|
6 |
*
|
7 |
* Copyright 2010-2011 | Fabrice Creuzot (luigifab) <code~luigifab~info>
|
8 |
* http://www.luigifab.info/magento/compressor.php
|
@@ -210,7 +210,7 @@ class Luigifab_Compressor_Block_Head extends Mage_Page_Block_Html_Head {
|
|
210 |
// COMPRESSION DES FICHIERS (5)
|
211 |
|
212 |
// #### Gestion des fichiers ########################################## debug ## private ### //
|
213 |
-
// = révision :
|
214 |
// » Compresse les fichiers sources en fonction de la configuration
|
215 |
// » Uniquement dans le cas ou le module est actif
|
216 |
// » Prend en charge les fichiers CSS et JS
|
@@ -250,6 +250,8 @@ class Luigifab_Compressor_Block_Head extends Mage_Page_Block_Html_Head {
|
|
250 |
// changement de configuration
|
251 |
if ($observer === 'css')
|
252 |
$force = true;
|
|
|
|
|
253 |
|
254 |
// debug ou pas
|
255 |
if ($this->debugCss) {
|
@@ -302,6 +304,8 @@ class Luigifab_Compressor_Block_Head extends Mage_Page_Block_Html_Head {
|
|
302 |
// changement de configuration
|
303 |
if ($observer === 'js')
|
304 |
$force = true;
|
|
|
|
|
305 |
|
306 |
// debug ou pas
|
307 |
if ($this->debugJs) {
|
@@ -331,6 +335,8 @@ class Luigifab_Compressor_Block_Head extends Mage_Page_Block_Html_Head {
|
|
331 |
// changement de configuration
|
332 |
if ($observer === 'js')
|
333 |
$force = true;
|
|
|
|
|
334 |
|
335 |
// debug ou pas
|
336 |
if ($this->debugJs) {
|
@@ -549,7 +555,7 @@ class Luigifab_Compressor_Block_Head extends Mage_Page_Block_Html_Head {
|
|
549 |
|
550 |
|
551 |
// #### Compression des fichiers JS Magento ########################### debug ## private ### //
|
552 |
-
// = révision :
|
553 |
// » Récupère la liste des fichiers JS Magento afin de les compresser (s'ils existent)
|
554 |
// » Ne régénère pas les fichiers compressés si la configuration ne le demande pas
|
555 |
// » Ajoute les fichiers compressés dans l'entête de la page web
|
@@ -558,32 +564,32 @@ class Luigifab_Compressor_Block_Head extends Mage_Page_Block_Html_Head {
|
|
558 |
|
559 |
$magentoFiles = array(
|
560 |
array('config' => 'js/magento_prototype/prototype', 'name' => 'prototype/prototype.js', 'copy' => 'prototype'),
|
561 |
-
array('config' => 'js/magento_prototype/validation', 'name' => 'prototype/validation.js', 'copy' => ''),
|
562 |
-
array('config' => 'js/magento_prototype/deprecation', 'name' => 'prototype/deprecation.js', 'copy' => ''),
|
563 |
|
564 |
array('config' => 'js/magento_scriptaculous/builder', 'name' => 'scriptaculous/builder.js', 'copy' => 'aculous'),
|
565 |
-
array('config' => 'js/magento_scriptaculous/effects', 'name' => 'scriptaculous/effects.js', 'copy' => ''),
|
566 |
-
array('config' => 'js/magento_scriptaculous/dragdrop', 'name' => 'scriptaculous/dragdrop.js', 'copy' => ''),
|
567 |
-
array('config' => 'js/magento_scriptaculous/controls', 'name' => 'scriptaculous/controls.js', 'copy' => ''),
|
568 |
-
array('config' => 'js/magento_scriptaculous/slider', 'name' => 'scriptaculous/slider.js', 'copy' => ''),
|
569 |
|
570 |
array('config' => 'js/magento_varien/js', 'name' => 'varien/js.js', 'copy' => 'magento'),
|
571 |
-
array('config' => 'js/magento_varien/form', 'name' => 'varien/form.js', 'copy' => ''),
|
572 |
-
array('config' => 'js/magento_varien/weee', 'name' => 'varien/weee.js', 'copy' => ''),
|
573 |
-
array('config' => 'js/magento_varien/menu', 'name' => 'varien/menu.js', 'copy' => ''),
|
574 |
-
array('config' => 'js/magento_varien/product', 'name' => 'varien/product.js', 'copy' => ''),
|
575 |
|
576 |
-
array('config' => 'js/magento_mage/translate', 'name' => 'mage/translate.js', 'copy' => ''),
|
577 |
-
array('config' => 'js/magento_mage/cookies', 'name' => 'mage/cookies.js', 'copy' => ''),
|
578 |
-
array('config' => 'js/magento_mage/centinel', 'name' => 'mage/centinel.js', 'copy' => ''),
|
579 |
-
array('config' => 'js/magento_mage/translate', 'name' => 'translator.js', 'copy' => ''),
|
580 |
|
581 |
-
array('config' => 'js/
|
582 |
-
array('config' => 'js/
|
583 |
-
array('config' => 'js/magento_calendar/calendarwin2k1', 'name' => 'calendar/calendar-win2k-1.js', 'copy' => ''),
|
584 |
|
585 |
-
array('config' => 'js/
|
586 |
-
array('config' => 'js/
|
|
|
587 |
);
|
588 |
|
589 |
// *** Lecture de la configuration ********************** //
|
@@ -602,6 +608,7 @@ class Luigifab_Compressor_Block_Head extends Mage_Page_Block_Html_Head {
|
|
602 |
|
603 |
// *** Compression des fichiers sources ***************** //
|
604 |
$data = array();
|
|
|
605 |
$destination = $dir.'/zip/magento.min.js';
|
606 |
|
607 |
// compression des fichiers sources (un fichier compressé = un media = un ou plusieurs fichiers sources)
|
@@ -620,13 +627,15 @@ class Luigifab_Compressor_Block_Head extends Mage_Page_Block_Html_Head {
|
|
620 |
$buffer = str_replace('//]]>', '', $buffer);
|
621 |
$buffer = trim($buffer);
|
622 |
}
|
623 |
-
else if ($file['copy'] !== '') {
|
624 |
$buffer = $this->copyrights[$file['copy']]."\n".$this->readData($source, $url, false);
|
625 |
}
|
626 |
else {
|
627 |
$buffer = $this->readData($source, $url, false);
|
628 |
}
|
629 |
|
|
|
|
|
630 |
if ($this->debugJs)
|
631 |
$this->logger->logReadFile($source, 'magento', strlen($buffer));
|
632 |
|
1 |
<?php
|
2 |
/**
|
3 |
* Created V/20/08/2010
|
4 |
+
* Updated J/27/10/2011
|
5 |
+
* Version 35
|
6 |
*
|
7 |
* Copyright 2010-2011 | Fabrice Creuzot (luigifab) <code~luigifab~info>
|
8 |
* http://www.luigifab.info/magento/compressor.php
|
210 |
// COMPRESSION DES FICHIERS (5)
|
211 |
|
212 |
// #### Gestion des fichiers ########################################## debug ## private ### //
|
213 |
+
// = révision : 51
|
214 |
// » Compresse les fichiers sources en fonction de la configuration
|
215 |
// » Uniquement dans le cas ou le module est actif
|
216 |
// » Prend en charge les fichiers CSS et JS
|
250 |
// changement de configuration
|
251 |
if ($observer === 'css')
|
252 |
$force = true;
|
253 |
+
else if ($observer === 'js')
|
254 |
+
$force = false;
|
255 |
|
256 |
// debug ou pas
|
257 |
if ($this->debugCss) {
|
304 |
// changement de configuration
|
305 |
if ($observer === 'js')
|
306 |
$force = true;
|
307 |
+
else if ($observer === 'css')
|
308 |
+
$force = false;
|
309 |
|
310 |
// debug ou pas
|
311 |
if ($this->debugJs) {
|
335 |
// changement de configuration
|
336 |
if ($observer === 'js')
|
337 |
$force = true;
|
338 |
+
else if ($observer === 'css')
|
339 |
+
$force = false;
|
340 |
|
341 |
// debug ou pas
|
342 |
if ($this->debugJs) {
|
555 |
|
556 |
|
557 |
// #### Compression des fichiers JS Magento ########################### debug ## private ### //
|
558 |
+
// = révision : 36
|
559 |
// » Récupère la liste des fichiers JS Magento afin de les compresser (s'ils existent)
|
560 |
// » Ne régénère pas les fichiers compressés si la configuration ne le demande pas
|
561 |
// » Ajoute les fichiers compressés dans l'entête de la page web
|
564 |
|
565 |
$magentoFiles = array(
|
566 |
array('config' => 'js/magento_prototype/prototype', 'name' => 'prototype/prototype.js', 'copy' => 'prototype'),
|
567 |
+
array('config' => 'js/magento_prototype/validation', 'name' => 'prototype/validation.js', 'copy' => 'prototype'),
|
568 |
+
array('config' => 'js/magento_prototype/deprecation', 'name' => 'prototype/deprecation.js', 'copy' => 'prototype'),
|
569 |
|
570 |
array('config' => 'js/magento_scriptaculous/builder', 'name' => 'scriptaculous/builder.js', 'copy' => 'aculous'),
|
571 |
+
array('config' => 'js/magento_scriptaculous/effects', 'name' => 'scriptaculous/effects.js', 'copy' => 'aculous'),
|
572 |
+
array('config' => 'js/magento_scriptaculous/dragdrop', 'name' => 'scriptaculous/dragdrop.js', 'copy' => 'aculous'),
|
573 |
+
array('config' => 'js/magento_scriptaculous/controls', 'name' => 'scriptaculous/controls.js', 'copy' => 'aculous'),
|
574 |
+
array('config' => 'js/magento_scriptaculous/slider', 'name' => 'scriptaculous/slider.js', 'copy' => 'aculous'),
|
575 |
|
576 |
array('config' => 'js/magento_varien/js', 'name' => 'varien/js.js', 'copy' => 'magento'),
|
577 |
+
array('config' => 'js/magento_varien/form', 'name' => 'varien/form.js', 'copy' => 'magento'),
|
578 |
+
array('config' => 'js/magento_varien/weee', 'name' => 'varien/weee.js', 'copy' => 'magento'),
|
579 |
+
array('config' => 'js/magento_varien/menu', 'name' => 'varien/menu.js', 'copy' => 'magento'),
|
580 |
+
array('config' => 'js/magento_varien/product', 'name' => 'varien/product.js', 'copy' => 'magento'),
|
581 |
|
582 |
+
array('config' => 'js/magento_mage/translate', 'name' => 'mage/translate.js', 'copy' => 'magento'),
|
583 |
+
array('config' => 'js/magento_mage/cookies', 'name' => 'mage/cookies.js', 'copy' => 'magento'),
|
584 |
+
array('config' => 'js/magento_mage/centinel', 'name' => 'mage/centinel.js', 'copy' => 'magento'),
|
585 |
+
array('config' => 'js/magento_mage/translate', 'name' => 'translator.js', 'copy' => 'magento'),
|
586 |
|
587 |
+
array('config' => 'js/magento_other/bundle', 'name' => 'js/bundle.js', 'copy' => 'magento'),
|
588 |
+
array('config' => 'js/magento_other/ccard', 'name' => 'lib/ccard.js', 'copy' => 'magento'),
|
|
|
589 |
|
590 |
+
array('config' => 'js/magento_calendar/calendar', 'name' => 'calendar/calendar.js', 'copy' => 'calendar'),
|
591 |
+
array('config' => 'js/magento_calendar/calendarsetup', 'name' => 'calendar/calendar-setup.js', 'copy' => 'calendar'),
|
592 |
+
array('config' => 'js/magento_calendar/calendarwin2k1', 'name' => 'calendar/calendar-win2k-1.js', 'copy' => 'calendar')
|
593 |
);
|
594 |
|
595 |
// *** Lecture de la configuration ********************** //
|
608 |
|
609 |
// *** Compression des fichiers sources ***************** //
|
610 |
$data = array();
|
611 |
+
$previous = '';
|
612 |
$destination = $dir.'/zip/magento.min.js';
|
613 |
|
614 |
// compression des fichiers sources (un fichier compressé = un media = un ou plusieurs fichiers sources)
|
627 |
$buffer = str_replace('//]]>', '', $buffer);
|
628 |
$buffer = trim($buffer);
|
629 |
}
|
630 |
+
else if (($previous !== $file['copy']) && ($file['copy'] !== '')) {
|
631 |
$buffer = $this->copyrights[$file['copy']]."\n".$this->readData($source, $url, false);
|
632 |
}
|
633 |
else {
|
634 |
$buffer = $this->readData($source, $url, false);
|
635 |
}
|
636 |
|
637 |
+
$previous = $file['copy'];
|
638 |
+
|
639 |
if ($this->debugJs)
|
640 |
$this->logger->logReadFile($source, 'magento', strlen($buffer));
|
641 |
|
app/code/community/Luigifab/Compressor/changelog
CHANGED
@@ -1,6 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
26/10/2011 | 1.2.1
|
2 |
|
3 |
-
* Correcting
|
4 |
|
5 |
21/10/2011 | 1.2.0
|
6 |
|
1 |
+
27/11/2011 | 1.2.2
|
2 |
+
|
3 |
+
* Regenerates CSS files when saving CSS configuration
|
4 |
+
* Regenerates JS files when saving JS configuration
|
5 |
+
* Use the correct copyrights for Magento JS files
|
6 |
+
|
7 |
26/10/2011 | 1.2.1
|
8 |
|
9 |
+
* Correcting lists of CSS and JS files
|
10 |
|
11 |
21/10/2011 | 1.2.0
|
12 |
|
app/code/community/Luigifab/Compressor/etc/config.xml
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
<!--
|
3 |
/**
|
4 |
* Created L/27/06/2011
|
5 |
-
* Updated
|
6 |
-
* Version
|
7 |
*
|
8 |
* Copyright 2011 | Fabrice Creuzot (luigifab) <code~luigifab~info>
|
9 |
* http://www.luigifab.info/magento/compressor.php
|
@@ -23,7 +23,7 @@
|
|
23 |
<config>
|
24 |
<modules>
|
25 |
<Luigifab_Compressor>
|
26 |
-
<version>1.2.
|
27 |
</Luigifab_Compressor>
|
28 |
</modules>
|
29 |
|
2 |
<!--
|
3 |
/**
|
4 |
* Created L/27/06/2011
|
5 |
+
* Updated J/27/10/2011
|
6 |
+
* Version 18
|
7 |
*
|
8 |
* Copyright 2011 | Fabrice Creuzot (luigifab) <code~luigifab~info>
|
9 |
* http://www.luigifab.info/magento/compressor.php
|
23 |
<config>
|
24 |
<modules>
|
25 |
<Luigifab_Compressor>
|
26 |
+
<version>1.2.2</version>
|
27 |
</Luigifab_Compressor>
|
28 |
</modules>
|
29 |
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Compressor</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/GPL-2.0">GPL</license>
|
7 |
<channel>community</channel>
|
@@ -15,11 +15,13 @@ Compatible with the merging files function of Magento.
|
|
15 |
No modification of your layout files are required.
|
16 |
Secure or unsecure website.
|
17 |
</description>
|
18 |
-
<notes>-
|
|
|
|
|
19 |
<authors><author><name>Fabrice Creuzot</name><user>luigifab</user><email>code@luigifab.info</email></author></authors>
|
20 |
-
<date>2011-10-
|
21 |
-
<time>17:
|
22 |
-
<contents><target name="magecommunity"><dir name="Luigifab"><dir name="Compressor"><dir name="Block"><file name="Adminhtml.php" hash="187366d3122f8a8010abe4e3d64b95e6"/><file name="Head.php" hash="
|
23 |
<compatible/>
|
24 |
<dependencies><required><php><min>5.2.0</min><max>5.9.9</max></php></required></dependencies>
|
25 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Compressor</name>
|
4 |
+
<version>1.2.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/GPL-2.0">GPL</license>
|
7 |
<channel>community</channel>
|
15 |
No modification of your layout files are required.
|
16 |
Secure or unsecure website.
|
17 |
</description>
|
18 |
+
<notes>- Regenerates CSS files when saving CSS configuration
|
19 |
+
- Regenerates JS files when saving JS configuration
|
20 |
+
- Use the correct copyrights for Magento JS files</notes>
|
21 |
<authors><author><name>Fabrice Creuzot</name><user>luigifab</user><email>code@luigifab.info</email></author></authors>
|
22 |
+
<date>2011-10-27</date>
|
23 |
+
<time>17:38:34</time>
|
24 |
+
<contents><target name="magecommunity"><dir name="Luigifab"><dir name="Compressor"><dir name="Block"><file name="Adminhtml.php" hash="187366d3122f8a8010abe4e3d64b95e6"/><file name="Head.php" hash="756ef2864ea50c772c129a13253c2528"/><file name="Html.php" hash="c87ed56bf7bf6d6245cef4065beaeecc"/><dir name="Notice"><file name="Css.php" hash="7a97a7e281f0284661abe3b4d0d425e6"/><file name="Htaccess.php" hash="f2e2b712c46068cb8895d0ca5ffa7953"/><file name="Html.php" hash="2fa3a2e587a5f965858aeebe85fae11b"/><file name="Js.php" hash="894da0a498afd9dcbb38a676f83942af"/></dir><dir name="Rapport"><file name="Css.php" hash="494d1ca013a068694fbe7ce625e57560"/><file name="Htaccess.php" hash="6c29990e782046f5194d8ee03e185217"/><file name="Js.php" hash="3f2bde6a75ed403b347735baedd2e0ab"/></dir></dir><dir name="Helper"><file name="Data.php" hash="c8e8ab2e4d669ba797b9b67a934e45e1"/></dir><dir name="Model"><file name="IhmArray.php" hash="f56a7277ae954b714ccccd7e9d984364"/><file name="Log.php" hash="c13c178e54584d505310cecf022d41e9"/><file name="Observer.php" hash="2568ce55feb80cb191f796add5ccb0c6"/><file name="Package.php" hash="373a90d697dbe5f75f5d1093273e18f9"/><dir name="Source"><file name="Copyright.php" hash="b0e10b61cea19c97034f8ccc5124dbdb"/><file name="Doctype.php" hash="42852f90826a7c57d33481d18d7b5989"/><file name="Encoding.php" hash="cc2586e60e659d0a9217d7e1766b704a"/><dir name="Files"><file name="Css.php" hash="76ed5171c247fc808bf7b84d807c9a2a"/><file name="Js.php" hash="f1aa2c0dfa5d8074a0a35020e05e3e56"/></dir><dir name="Media"><file name="Css.php" hash="899f98ca577b24474b44983233ee98e2"/><file name="Js.php" hash="cb5f7c9d2217d347bf75300f4c046bf3"/></dir><file name="Memory.php" hash="e3744d34f13645c239203e38a091fffd"/><file name="Template.php" hash="0815e04bf90905195e11fc9c8478838d"/><file name="Yesnoauto.php" hash="eb10791746d7219dfbe510d743710821"/></dir></dir><file name="changelog" hash="198b3b56368b88a631c363209846cff8"/><dir name="etc"><file name="config.xml" hash="7f1131d4bbe7dfadbf085deebd9b810f"/><file name="system.xml" hash="80ecad6eab0e2f9845ee7105334ded21"/></dir><file name="license" hash="b819c62bf1b7f2d249241db9a4ab3c99"/><file name="readme" hash="51580d6765e250b3a4b2e5c96d2f3b40"/></dir></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Luigifab_Compressor.csv" hash="803a048a5b1761c77bbe97b0dcba7cfc"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="compressor.xml" hash="c410c9f9ac76ac10d78af833c1d9f2df"/></dir><dir name="template"><dir name="compressor"><dir name="notice"><file name="css.phtml" hash="107514fd7069098dced4fbec8115f45e"/><file name="htaccess.phtml" hash="2b46468eef2fb19d2e6831c57cca882b"/><file name="html.phtml" hash="d5918d817f2a8ea1ee6833e58a7d9caa"/><file name="js.phtml" hash="b8b5deb998a5cabe185fce6defe031db"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="compressor"><file name="head.phtml" hash="9e640492cb8b81aa71ab8b841a97c178"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="css"><file name="compressor.css" hash="343a9405116ec009759d30d649e2205a"/></dir><dir name="js"><file name="compressor.js" hash="d1ceef0f7ade027ab4efef0ddab488a0"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Luigifab_Compressor.xml" hash="7f04420fe4094092d5409ebdd0f283ae"/></dir></target></contents>
|
25 |
<compatible/>
|
26 |
<dependencies><required><php><min>5.2.0</min><max>5.9.9</max></php></required></dependencies>
|
27 |
</package>
|