Skip to content

Commit

Permalink
Version 4.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Oct 10, 2022
1 parent eac07c4 commit a1b9108
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For more information, go to https://www.luigifab.fr/openmage/minifier (IPv6 is r

This repository is a releases mirror. To install the module, please use the composer key available in the documentation.

- Current version: 4.3.1 (07/07/2022)
- Current version: 4.3.2 (10/10/2022)
- Compatibility: OpenMage 19.x / 20.x / 21.x, PHP 7.2 / 7.3 / 7.4 / 8.0 / 8.1
- Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+
- Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es) / Chinese (zh), Czech (cs), Dutch (nl), Greek (el), Hungarian (hu), Japanese (ja), Polish (pl), Romanian (ro), Russian (ru), Slovak (sk), Turkish (tr), Ukrainian (uk)
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Luigifab/Minifier/Model/Observer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created S/20/06/2015
* Updated V/24/06/2022
* Updated D/18/09/2022
*
* Copyright 2011-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/minifier
Expand Down Expand Up @@ -42,7 +42,7 @@ public function clearCache(Varien_Event_Observer $observer) {
Mage::app()->cleanCache();
Mage::dispatchEvent('adminhtml_cache_flush_system');

Mage::getSingleton('adminhtml/session')->addSuccess(str_replace('Magento', 'OpenMage', Mage::helper('adminhtml')->__('The Magento cache storage has been flushed.')));
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('The OpenMage cache storage has been flushed.'));
}

// EVENT controller_action_predispatch_adminhtml_index_changeLocale (adminhtml)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created J/12/11/2020
* Updated V/24/06/2022
* Updated D/11/09/2022
*
* Copyright 2011-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2022 | Fabrice Creuzot <fabrice~cellublue~com>
Expand Down Expand Up @@ -65,7 +65,7 @@ public function getSkinUrl($file = null, array $params = []) {

// prevent reading files outside of the proper directory while still allowing symlinked files
Varien_Profiler::start(__METHOD__);
if (str_contains($file, '..')) {
if (!empty($file) && str_contains($file, '..')) {
Mage::log(sprintf('Invalid path requested: %s (params: %s)', $file, json_encode($params)), Zend_Log::ERR);
throw new RuntimeException('Invalid path requested.');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created S/23/07/2016
* Updated D/06/10/2019
* Updated V/02/09/2022
*
* Copyright 2011-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/minifier
Expand All @@ -19,10 +19,16 @@

class Luigifab_Minifier_Model_Rewrite_Translate extends Mage_Core_Model_Translate {

public function __construct() {
$this->_configShare = Mage::getStoreConfigFlag('minifier/general/translations_share');
$this->_configOverwrite = Mage::getStoreConfigFlag('minifier/general/translations_overwrite');
parent::__construct();
}

protected function _loadModuleTranslation($moduleName, $files, $forceReload = false) {

// partager les traductions lorsque le mode développeur est activé
$scope = (Mage::getStoreConfigFlag('minifier/general/translations_share') && Mage::getIsDeveloperMode()) ? false : $moduleName;
$scope = ($this->_configShare && Mage::getIsDeveloperMode()) ? false : $moduleName;

foreach ($files as $file) {
$file = $this->_getModuleFilePath($moduleName, $file);
Expand All @@ -35,7 +41,7 @@ protected function _loadModuleTranslation($moduleName, $files, $forceReload = fa
protected function _loadThemeTranslation($forceReload = false) {

// prioriser les traductions du thème
if (Mage::getStoreConfigFlag('minifier/general/translations_overwrite')) {
if ($this->_configOverwrite) {
$data = $this->_getFileData(Mage::getDesign()->getLocaleFileName('translate.csv'));
foreach ($data as $key => $value)
$this->_data['Zz_Zz'.self::SCOPE_SEPARATOR.$key] = $value;
Expand All @@ -48,7 +54,7 @@ protected function _loadThemeTranslation($forceReload = false) {
protected function _getTranslatedString($text, $code) {

// prioriser les traductions du thème
if (Mage::getStoreConfigFlag('minifier/general/translations_overwrite')) {
if ($this->_configOverwrite) {
$overload = 'Zz_Zz'.self::SCOPE_SEPARATOR.$text;
if (array_key_exists($overload, $this->_data))
return $this->_data[$overload];
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Luigifab/Minifier/etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Created L/27/06/2011
* Updated V/01/07/2022
* Updated V/02/09/2022
*
* Copyright 2011-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/minifier
Expand All @@ -20,7 +20,7 @@
<config>
<modules>
<Luigifab_Minifier>
<version>4.3.1</version>
<version>4.3.2</version>
</Luigifab_Minifier>
</modules>
<global>
Expand Down
6 changes: 3 additions & 3 deletions src/app/code/community/Luigifab/Minifier/lib/minify.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created S/14/07/2018
* Updated V/01/07/2022
* Updated S/30/07/2022
*
* Copyright 2011-2022 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/minifier
Expand Down Expand Up @@ -29,15 +29,15 @@
if (is_file('app/bootstrap.php'))
require_once('app/bootstrap.php');

require_once('app/Mage.php');

$action = empty($argv[1]) ? false : $argv[1]; // css ou js
$source = empty($argv[2]) ? false : $argv[2]; // fichier(s) source (fichier(s) existant séparés par des virgules)
$dest = empty($argv[3]) ? false : $argv[3]; // fichier cache (fichier inexistant)
$dev = empty($argv[4]) ? false : true;

if (!empty($action) && !empty($source) && !empty($dest)) {

require_once('app/Mage.php');

Mage::app('admin')->setUseSessionInUrl(false);
Mage::setIsDeveloperMode($dev);

Expand Down

0 comments on commit a1b9108

Please sign in to comment.