Skip to content

Commit

Permalink
Version 4.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Feb 2, 2023
1 parent 7f3c7d9 commit 7f6735d
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 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/versioning (IPv6 is

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

- Current version: 4.5.0 (01/01/2023)
- Current version: 4.5.1 (02/02/2023)
- Compatibility: OpenMage 19.x / 20.x / 21.x, PHP 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2
- 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/Versioning/Helper/Data.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created S/03/12/2011
* Updated V/09/12/2022
* Updated J/05/01/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
Expand Down Expand Up @@ -63,7 +63,7 @@ public function getHumanDuration($start, $end = null) {
}

public function getNumber($value, array $options = []) {
$options['locale'] = Mage::getSingleton('core/translate')->getLocale();
$options['locale'] = Mage::getSingleton('core/locale')->getLocaleCode();
return Zend_Locale_Format::toNumber($value, $options);
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/code/community/Luigifab/Versioning/Model/Observer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created J/31/05/2012
* Updated L/14/11/2022
* Updated J/05/01/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
Expand Down Expand Up @@ -49,8 +49,8 @@ public function updateConfig() {
foreach (Mage::app()->getWebsites() as $website) {
foreach ($website->getGroups() as $group) {
foreach ($group->getStores() as $store) {
$locale = Mage::getStoreConfig('general/locale/code', $store->getId());
$global[$locale] = Mage::getStoreConfig('versioning/downtime', $store->getId());
$locale = Mage::getStoreConfig('general/locale/code', $store);
$global[$locale] = Mage::getStoreConfig('versioning/downtime', $store);
}
}
}
Expand Down
25 changes: 13 additions & 12 deletions src/app/code/community/Luigifab/Versioning/Model/Scm/Git.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created S/03/12/2011
* Updated J/01/12/2022
* Updated J/05/01/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
Expand Down Expand Up @@ -46,26 +46,26 @@ public function getCommitsCollection(bool $local = false) {

$help = Mage::helper('versioning');
$desc = version_compare($this->getSoftwareVersion(), '1.7.2', '>=') ? '%B' : '%s%n%b';
$line = (int) Mage::getStoreConfig('versioning/scm/number'); // nombre de ligne
$line = (int) Mage::getStoreConfig('versioning/scm/number');

// lecture de l'historique des commits
if ($local) {
exec('
export LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8;
export LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8;
git log "`git branch | grep "*" | cut -c3-`" --all --pretty=format:"<log><revno>%h</revno><parents> %p </parents><committer>%an</committer><timestamp>%ai</timestamp><message><![CDATA['.$desc.']]></message></log>" -'.$line.' | iconv -f UTF8//IGNORE -t UTF-8 -c 2>&1;
', $data, $val);
}
else if (is_string($configsh) && is_executable($configsh)) {
exec('
export LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8;
export LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8;
export GIT_SSH="'.$configsh.'";
git fetch 2>&1;
git log "origin/`git branch | grep "*" | cut -c3-`" --all --pretty=format:"<log><revno>%h</revno><parents> %p </parents><committer>%an</committer><timestamp>%ai</timestamp><message><![CDATA['.$desc.']]></message></log>" -'.$line.' | iconv -f UTF8//IGNORE -t UTF-8 -c 2>&1;
', $data, $val);
}
else {
exec('
export LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8;
export LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8;
git fetch 2>&1;
git log "origin/`git branch | grep "*" | cut -c3-`" --all --pretty=format:"<log><revno>%h</revno><parents> %p </parents><committer>%an</committer><timestamp>%ai</timestamp><message><![CDATA['.$desc.']]></message></log>" -'.$line.' | iconv -f UTF8//IGNORE -t UTF-8 -c 2>&1;
', $data, $val);
Expand Down Expand Up @@ -215,9 +215,9 @@ public function getCurrentDiff($from = null, $to = null, $dir = null, $excl = nu

// https://stackoverflow.com/a/55891251/2980105 (diff-highlight)
if (is_executable('/usr/share/doc/git/contrib/diff-highlight/diff-highlight'))
exec('LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8 '.$command.' | /usr/share/doc/git/contrib/diff-highlight/diff-highlight', $lines);
exec('LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8 '.$command.' | /usr/share/doc/git/contrib/diff-highlight/diff-highlight', $lines);
else
exec('LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8 '.$command, $lines);
exec('LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8 '.$command, $lines);

foreach ($lines as $i => $line) {

Expand Down Expand Up @@ -256,6 +256,7 @@ public function getCurrentDiff($from = null, $to = null, $dir = null, $excl = nu
$lines[$i] = '<del>'.mb_substr($help->escapeEntities($line), 0, 1500).'<i>...</i></del>';
else
$lines[$i] = mb_substr($help->escapeEntities($line), 0, 1500).'<i>...</i>';
$lines[$i] = str_replace(['', ''], '', $lines[$i]);
}
else if ($line[0] == '+') {
$lines[$i] = '<ins>'.$help->escapeEntities($line).'</ins>';
Expand Down Expand Up @@ -297,9 +298,9 @@ public function getCurrentDiffStatus($from = null, $to = null, $dir = null, $exc
$excl = explode(',', $excl);

if (is_executable('/usr/share/doc/git/contrib/diff-highlight/diff-highlight'))
exec('LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8 '.$command.' | /usr/share/doc/git/contrib/diff-highlight/diff-highlight', $lines);
exec('LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8 '.$command.' | /usr/share/doc/git/contrib/diff-highlight/diff-highlight', $lines);
else
exec('LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8 '.$command, $lines);
exec('LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8 '.$command, $lines);

// Added (A), Copied (C), Deleted (D), Modified (M), Renamed (R), Type changed (T), Unmerged (U), Unknown (X), pairing Broken (B)
// C and R are always followed by a score (denoting the percentage of similarity between the source and target of the move or copy)
Expand Down Expand Up @@ -351,7 +352,7 @@ public function getCurrentStatus($dir = null, $excl = null) {
if (!empty($dir))
$command .= ' '.str_replace(' ', "' '", escapeshellarg($dir));

exec('LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8 '.$command, $lines);
exec('LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8 '.$command, $lines);

if (!empty($excl)) {
$excl = explode(',', $excl);
Expand All @@ -374,7 +375,7 @@ public function upgradeToRevision($object, $log, $revision) {
$revision = escapeshellarg($revision);

if (is_dir('../.git/')) {
exec('export LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8;
exec('export LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8;
echo "<span>git fetch</span>" >> '.$log.';
git fetch;
echo "<span>git clean -f -d</span>" >> '.$log.';
Expand All @@ -383,7 +384,7 @@ public function upgradeToRevision($object, $log, $revision) {
git reset --hard '.$revision.' >> '.$log.' 2>&1;', $data, $val);
}
else {
exec('export LANG='.Mage::getSingleton('core/translate')->getLocale().'.utf8;
exec('export LANG='.Mage::getSingleton('core/locale')->getLocaleCode().'.utf8;
echo "<span>git fetch</span>" >> '.$log.';
git fetch;
echo "<span>git clean -f -d</span>" >> '.$log.';
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Luigifab/Versioning/Model/Upgrade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created V/27/02/2015
* Updated J/08/12/2022
* Updated J/05/01/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
Expand Down Expand Up @@ -34,7 +34,7 @@ public function disableAllBuffer() {
ignore_user_abort(true);

try {
for ($i = 0; $i < ob_get_level(); $i++)
while (ob_get_level() > 0)
ob_end_clean();
}
catch (Throwable $t) { }
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Luigifab/Versioning/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 S/03/12/2011
* Updated L/10/10/2022
* Updated J/05/01/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
Expand All @@ -20,7 +20,7 @@
<config>
<modules>
<Luigifab_Versioning>
<version>4.5.0</version>
<version>4.5.1</version>
</Luigifab_Versioning>
</modules>
<global>
Expand Down
4 changes: 2 additions & 2 deletions src/app/code/community/Luigifab/Versioning/etc/system.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
* Created S/03/12/2011
* Updated D/11/12/2022
* Updated J/05/01/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
Expand Down Expand Up @@ -34,7 +34,7 @@
<show_in_store>1</show_in_store>
<buttons>
<versioning translate="title">
<title>Version control</title>
<title>Show</title>
<action>adminhtml/versioning_repository/index</action>
</versioning>
</buttons>
Expand Down
4 changes: 2 additions & 2 deletions src/errors/page.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Created W/30/05/2012
* Updated J/08/12/2022
* Updated S/14/01/2023
*
* Copyright 2011-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://github.com/luigifab/openmage-versioning
Expand Down Expand Up @@ -48,7 +48,7 @@
p { margin:1em 0; font-size:0.85em; line-height:140%; }
pre { margin-top:3em; padding:2em; white-space:pre-wrap; word-break:break-all; background-color:#D0D0D0; }
pre span.line { color:#555; }
@media screen and (max-width:33rem),(max-device-width:33rem) {
@media (max-width:33rem),(max-device-width:33rem) {
div.box { margin:0 1em 1em; width:auto; }
pre { display:none; }
}
Expand Down

0 comments on commit 7f6735d

Please sign in to comment.