Skip to content

Commit

Permalink
Version 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Oct 30, 2012
1 parent 838ed12 commit b1b3507
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 49 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ For more information, go to https://www.luigifab.fr/magento/versioning (IPv6 is

This repository is a mirror. To install the module, please use the extension key available in the documentation. If you like, take some of your time to improve the translations, go to https://bit.ly/2HyCCEc.

Version 2.2.1 released on 29/10/2012.
Version 2.2.2 released on 30/10/2012.
21 changes: 14 additions & 7 deletions app/code/community/Luigifab/Versioning/Model/Observer.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* Created J/31/05/2012
* Updated D/28/10/2012
* Version 4
* Updated M/30/10/2012
* Version 5
*
* Copyright 2011-2012 | Fabrice Creuzot (luigifab) <code~luigifab~info>
* https://redmine.luigifab.info/projects/magento/wiki/versioning
Expand All @@ -23,22 +23,29 @@ class Luigifab_Versioning_Model_Observer {
// event admin_versioning_upgrade_before
public function beforeUpgradeEvent($observer) {

//array('repository' => $repository, 'logger' => $logger, 'status' => $status, 'revision' => $targetRevision)
//array('repository' => $repository, 'revision' => $targetRevision, 'controller' => $this)
$event = $observer->getEvent();

$event->getController()->writeTitle('X) Before event');
$event->getController()->writeCommand('before event');

Mage::log('Luigifab_Versioning_Model_Observer::beforeUpgradeEvent, revision: '.$event->getRevision());
}

// event admin_versioning_upgrade_after
public function afterUpgradeEvent($observer) {

//array('repository' => $repository, 'logger' => $logger, 'status' => $status, 'revision' => $targetRevision, 'exception' => $e)
//array('repository' => $repository, 'revision' => $targetRevision, 'controller' => $this, 'exception' => $e)
$event = $observer->getEvent();

if (!is_null($event->getException())) {
$event->getController()->writeTitle('X) After event');
$event->getController()->writeCommand('after event');
Mage::log('Luigifab_Versioning_Model_Observer::afterUpgradeEvent, revision: '.$event->getRevision().', exception: '.$event->getException()->getMessage());
}
else {
$event->getController()->writeTitle('X) After event');
$event->getController()->writeCommand('after event');
Mage::log('Luigifab_Versioning_Model_Observer::afterUpgradeEvent, revision: '.$event->getRevision());
}
}
Expand All @@ -63,9 +70,9 @@ private function checkAllDir() {


// #### Mise à jour de la configuration ######################################### public ### //
// = révision : 5
// » Met à jour les fichiers de traduction pour chaque langue
// » Met aussi à jour les adresses IP à exclure
// = révision : 6
// » Met à jour les fichiers de traduction par rapport à la configuration
// » Met aussi à jour les adresses IP à exclure (en ajoutant un tiret avant et après chaque adresse)
public function updateConfig() {

$this->checkAllDir();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* Created S/03/12/2011
* Updated V/26/10/2012
* Version 26
* Updated M/30/10/2012
* Version 27
*
* Copyright 2011-2012 | Fabrice Creuzot (luigifab) <code~luigifab~info>
* https://redmine.luigifab.info/projects/magento/wiki/versioning
Expand Down Expand Up @@ -152,8 +152,8 @@ public function runAction() {
}


// #### Gestion de la mise à jour ############################# debug ## i18n ## private ### //
// = révision : 71
// #### Gestion de la mise à jour ################# dispatch ## debug ## i18n ## private ### //
// = révision : 72
// » Log les informations du processus de mise à jour
// » Met à jour le code application, purge le cache et régénère les fichiers minifiés lorsque nécessaire
// » Informe l'utiliseur en cas de changement de version
Expand Down Expand Up @@ -189,13 +189,6 @@ private function processUpgrade($targetRevision) {

$version = array_pop($version);

// *** Événement before **************************** //
if (Mage::getStoreConfig('versioning/scm/events') === '1') {
Mage::dispatchEvent('admin_versioning_upgrade_before', array(
'repository' => $repository, 'logger' => $logger, 'status' => $status, 'revision' => $targetRevision
));
}

// *** ÉTAPE 1 ************************************* //
$this->writeTitle($this->__('1) Locking and configuration check'));

Expand Down Expand Up @@ -224,6 +217,12 @@ private function processUpgrade($targetRevision) {
file_put_contents($lock, $logger['current_rev'].' » '.$logger['target_rev'].' from '.$logger['remote_addr'].' by '.$logger['user']);
}

// *** Événement before **************************** //
if (Mage::getStoreConfig('versioning/scm/events') === '1') {
Mage::dispatchEvent('admin_versioning_upgrade_before',
array('repository' => $repository, 'revision' => $targetRevision, 'controller' => $this));
}

// *** ÉTAPE 2 ************************************* //
$this->writeTitle($this->__('2) Upgrading'));
$repository->upgradeToRevision($this, $log, $targetRevision);
Expand Down Expand Up @@ -270,6 +269,12 @@ private function processUpgrade($targetRevision) {

$this->writeCommand(implode("\n", $messages));

// *** Événement after ***************************** //
if (Mage::getStoreConfig('versioning/scm/events') === '1') {
Mage::dispatchEvent('admin_versioning_upgrade_after',
array('repository' => $repository, 'revision' => $targetRevision, 'controller' => $this));
}

// *** ÉTAPE 5 ************************************* //
$this->writeTitle($this->__('4) Unlocking'));
unlink($lock);
Expand Down Expand Up @@ -305,13 +310,6 @@ private function processUpgrade($targetRevision) {
unlink($log);

Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Upgrade to revision %s completed.', $targetRevision));

// *** Événement after ***************************** //
if (Mage::getStoreConfig('versioning/scm/events') === '1') {
Mage::dispatchEvent('admin_versioning_upgrade_after', array(
'repository' => $repository, 'logger' => $logger, 'status' => $status, 'revision' => $targetRevision
));
}
}
catch (Exception $e) {

Expand All @@ -330,9 +328,6 @@ private function processUpgrade($targetRevision) {

$this->writeTitle($this->__('4) Unlocking'));
unlink($lock);

if (is_file($flag))
unlink($flag);
}
else {
$this->writeError($this->__('Stop! Stop! Stop! An upgrade is already underway.'));
Expand All @@ -341,9 +336,8 @@ private function processUpgrade($targetRevision) {

// *** Événement after ***************************** //
if (Mage::getStoreConfig('versioning/scm/events') === '1') {
Mage::dispatchEvent('admin_versioning_upgrade_after', array(
'repository' => $repository, 'logger' => $logger, 'status' => $status, 'revision' => $targetRevision, 'exception' => $e
));
Mage::dispatchEvent('admin_versioning_upgrade_after',
array('repository' => $repository, 'revision' => $targetRevision, 'controller' => $this, 'exception' => $e));
}
}

Expand All @@ -353,14 +347,14 @@ private function processUpgrade($targetRevision) {


// #### Gestion des commandes ########################################### public/private ### //
// = révision : 15
// = révision : 16
// » Affiche une commande ou une information pour savoir ce qu'il se passe
// » Ajoute un peu de code HTML pour faire plus jolie
private function writeLog($data) {
file_put_contents(Mage::helper('versioning')->getHistoryFile(), '`'.implode('`,`', $data).'`'."\n", FILE_APPEND | LOCK_EX);
}

private function writeTitle($data) {
public function writeTitle($data) {
sleep(1);
echo "\n",$data,"\n";
}
Expand Down
6 changes: 3 additions & 3 deletions app/code/community/Luigifab/Versioning/etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<!--
* Created S/03/12/2011
* Updated L/29/09/2012
* Version 19
* Updated M/30/10/2012
* Version 20
*
* Copyright 2011-2012 | Fabrice Creuzot (luigifab) <code~luigifab~info>
* https://redmine.luigifab.info/projects/magento/wiki/versioning
Expand All @@ -21,7 +21,7 @@
<config>
<modules>
<Luigifab_Versioning>
<version>2.2.1</version>
<version>2.2.2</version>
</Luigifab_Versioning>
</modules>
<global>
Expand Down
17 changes: 10 additions & 7 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<?xml version="1.0"?>
<package>
<name>Luigifab_Versioning</name>
<version>2.2.1</version>
<version>2.2.2</version>
<stability>stable</stability>
<license uri="http://www.opensource.org/licenses/GPL-2.0">GPL</license>
<channel>luigifab</channel>
<extends/>
<summary>Synchronize your Magento installation with your version control system.</summary>
<description>Works with BZR and GIT repositories with SSH authentication.</description>
<notes>- Fix invalid GIT branch name (HEAD)</notes>
<summary>Synchronize your Magento installation with your version control system.&#xD;
</summary>
<description>Works with BZR and GIT repositories with SSH authentication.&#xD;
</description>
<notes>- Move after event before website unlocking&#xD;
- Improve events examples</notes>
<authors><author><name>Fabrice Creuzot</name><user>luigifab</user><email>code@luigifab.info</email></author></authors>
<date>2012-10-29</date>
<time>17:46:35</time>
<contents><target name="magecommunity"><dir name="Luigifab"><dir name="Versioning"><dir name="Block"><dir name="Adminhtml"><file name="Downtime.php" hash="04a1f319e98424f75351c84f39e2343f"/><dir name="History"><file name="Grid.php" hash="8d7a6b141e79d6241ab0e934d4a2b6f1"/></dir><file name="History.php" hash="3927ded9d612eeac2aede49fd0b97ae4"/><file name="Lastlog.php" hash="b09d1d4dc53e18f336f2f0608075ce99"/><dir name="Repository"><file name="Grid.php" hash="172b1c31fd65d3da740cb7996165e53c"/></dir><file name="Repository.php" hash="f90c0d7963cd760e70facc95b1b5b0ea"/><file name="Status.php" hash="0fcc1f66ae30122dbf653770ca1e6c06"/><dir name="Widget"><file name="Description.php" hash="f468911178ed78b17817f3f6d70f6fdc"/><file name="Details.php" hash="de18bd6aa1d837826da6e1ee22e2be64"/><file name="Duration.php" hash="a90939425faaf781240801f1d14a6c3d"/><file name="Graph.php" hash="30c46b6b1967f930725932a149d9c378"/><file name="Revision.php" hash="5b0966928579edbf27e6fd77d5e584ac"/><file name="Status.php" hash="433161cc9bcc9eb993976a4171dc8c2d"/></dir></dir><file name="Notice.php" hash="961c438b22fdc4d1ac622482050e22b8"/></dir><dir name="Helper"><file name="Data.php" hash="83a5fa4832ba47b9149e6a841e6482df"/></dir><dir name="Model"><file name="History.php" hash="254c5a2a693374c718f3ae5f298f5530"/><file name="Observer.php" hash="073a734924a58c8722fe19416ce5a355"/><dir name="Scm"><file name="Bzr.php" hash="9721623760775d57086398438c00cd5c"/><file name="Git.php" hash="bff521075c483aaeb4f866cc2f41405b"/></dir><dir name="Source"><file name="Number.php" hash="f960ca170e0c3802476665f99c398298"/><file name="Type.php" hash="ebd214030f1d930068aaaa5ab6367256"/></dir></dir><file name="changelog" hash="4249018fbcfd7e7fe451efa7e0db71db"/><dir name="controllers"><dir name="Versioning"><file name="DowntimeController.php" hash="8011f405fb3bdb09514aa6798256089c"/><file name="RepositoryController.php" hash="7cb7f478b69d5efbe9bce6dd6db9be21"/><file name="UpgradeController.php" hash="4ce969c0de659cd8f56b45a67008cb8f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="557c5a757770a0dc4bea64e78f88c525"/><file name="config.xml" hash="640767e633b0592cafa1c916f6d4b71a"/><file name="system.xml" hash="4850459759ca74d9127fa319451a80ba"/></dir><file name="license" hash="b819c62bf1b7f2d249241db9a4ab3c99"/><file name="readme" hash="58d98e49b110d89ede7eb40f1de8ea0b"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="luigifab"><file name="versioning.xml" hash="8e50872b285a80035a26a5aa553a7e30"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="luigifab"><dir name="versioning"><file name="branch.svg.php" hash="c81d3555b1cbe4162c7103dbc03c9a18"/><file name="info.svg.php" hash="5d459fd0ece09c9eff86a5960e6cdf0f"/></dir></dir></dir><dir name="css"><dir name="luigifab"><dir name="versioning"><file name="styles.css" hash="f396c9714eaaf2b529e44c0ea4a07e45"/></dir></dir></dir><dir name="js"><dir name="luigifab"><dir name="versioning"><file name="app.js" hash="8f4fcbea228d04c12bceb53b6bf891f5"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Luigifab_Versioning.xml" hash="6062c9edc424dd91b04699a2cb631b29"/></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Luigifab_Versioning.csv" hash="8bda8218e07b7af49ba6f21390777afd"/></dir></target><target name="mageweb"><dir name="errors"><dir name="versioning"><file name="404.php" hash="07ecdcfe34637db0f64685d8e9d382fd"/><file name="404.phtml" hash="11265963fe5f5586f9895241d0583514"/><file name="503.php" hash="49119b1a7e7168ade6290275bd0cb820"/><file name="503.phtml" hash="bcaa1fc7a08ee24423ca16b56ecc0b45"/><dir name="css"><file name="styles.css" hash="7cfd42986c6dde76c138555d44b8774d"/></dir><dir name="locale"><file name="en_US.csv" hash="6640c882acc7cfe8f9c97420b71a06a2"/><file name="fr_FR.csv" hash="1b6680773468a96f2d52111c7b46abde"/></dir><file name="page.phtml" hash="36a34810c641433e3d1b65c31ce80b6b"/><file name="processor.php" hash="a9c2d793d8b37f3253e5e1c9c25d85b2"/><file name="readme.txt" hash="5067d7cfff8edd933ee8ae92c9cc3c52"/><file name="report.php" hash="732ebe33f5295832752f21fc782d8a7b"/><file name="report.phtml" hash="99e2778d96340c742f79caa8549d0269"/><file name="upgrade.php" hash="4ae737fbd7a7356c363ddaeab2d3b605"/><file name="upgrade.phtml" hash="2313e7692a2d0c218dee87e9f67e0ab5"/></dir></dir></target></contents>
<date>2012-10-30</date>
<time>17:44:47</time>
<contents><target name="magecommunity"><dir name="Luigifab"><dir name="Versioning"><dir name="Block"><dir name="Adminhtml"><file name="Downtime.php" hash="04a1f319e98424f75351c84f39e2343f"/><dir name="History"><file name="Grid.php" hash="8d7a6b141e79d6241ab0e934d4a2b6f1"/></dir><file name="History.php" hash="3927ded9d612eeac2aede49fd0b97ae4"/><file name="Lastlog.php" hash="b09d1d4dc53e18f336f2f0608075ce99"/><dir name="Repository"><file name="Grid.php" hash="172b1c31fd65d3da740cb7996165e53c"/></dir><file name="Repository.php" hash="f90c0d7963cd760e70facc95b1b5b0ea"/><file name="Status.php" hash="0fcc1f66ae30122dbf653770ca1e6c06"/><dir name="Widget"><file name="Description.php" hash="f468911178ed78b17817f3f6d70f6fdc"/><file name="Details.php" hash="de18bd6aa1d837826da6e1ee22e2be64"/><file name="Duration.php" hash="a90939425faaf781240801f1d14a6c3d"/><file name="Graph.php" hash="30c46b6b1967f930725932a149d9c378"/><file name="Revision.php" hash="5b0966928579edbf27e6fd77d5e584ac"/><file name="Status.php" hash="433161cc9bcc9eb993976a4171dc8c2d"/></dir></dir><file name="Notice.php" hash="961c438b22fdc4d1ac622482050e22b8"/></dir><dir name="Helper"><file name="Data.php" hash="83a5fa4832ba47b9149e6a841e6482df"/></dir><dir name="Model"><file name="History.php" hash="254c5a2a693374c718f3ae5f298f5530"/><file name="Observer.php" hash="d501e24096dffda6729fb17dc6a57c96"/><dir name="Scm"><file name="Bzr.php" hash="9721623760775d57086398438c00cd5c"/><file name="Git.php" hash="bff521075c483aaeb4f866cc2f41405b"/></dir><dir name="Source"><file name="Number.php" hash="f960ca170e0c3802476665f99c398298"/><file name="Type.php" hash="ebd214030f1d930068aaaa5ab6367256"/></dir></dir><file name="changelog" hash="e9a7fd1415749c34858b7f7b8e1735ef"/><dir name="controllers"><dir name="Versioning"><file name="DowntimeController.php" hash="8011f405fb3bdb09514aa6798256089c"/><file name="RepositoryController.php" hash="7cb7f478b69d5efbe9bce6dd6db9be21"/><file name="UpgradeController.php" hash="405368ed336dd991f1f3b935370f8499"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="557c5a757770a0dc4bea64e78f88c525"/><file name="config.xml" hash="8c1341bd13029b474ab4c9a739649834"/><file name="system.xml" hash="4850459759ca74d9127fa319451a80ba"/></dir><file name="license" hash="b819c62bf1b7f2d249241db9a4ab3c99"/><file name="readme" hash="58d98e49b110d89ede7eb40f1de8ea0b"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="luigifab"><file name="versioning.xml" hash="8e50872b285a80035a26a5aa553a7e30"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="luigifab"><dir name="versioning"><file name="branch.svg.php" hash="c81d3555b1cbe4162c7103dbc03c9a18"/><file name="info.svg.php" hash="5d459fd0ece09c9eff86a5960e6cdf0f"/></dir></dir></dir><dir name="css"><dir name="luigifab"><dir name="versioning"><file name="styles.css" hash="f396c9714eaaf2b529e44c0ea4a07e45"/></dir></dir></dir><dir name="js"><dir name="luigifab"><dir name="versioning"><file name="app.js" hash="8eca0ed5e3f5b85d35feeecfd9bb6e4c"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Luigifab_Versioning.xml" hash="6062c9edc424dd91b04699a2cb631b29"/></dir></target><target name="magelocale"><dir name="fr_FR"><file name="Luigifab_Versioning.csv" hash="8bda8218e07b7af49ba6f21390777afd"/></dir></target><target name="mageweb"><dir name="errors"><dir name="versioning"><file name="404.php" hash="07ecdcfe34637db0f64685d8e9d382fd"/><file name="404.phtml" hash="11265963fe5f5586f9895241d0583514"/><file name="503.php" hash="49119b1a7e7168ade6290275bd0cb820"/><file name="503.phtml" hash="bcaa1fc7a08ee24423ca16b56ecc0b45"/><dir name="css"><file name="styles.css" hash="7cfd42986c6dde76c138555d44b8774d"/></dir><dir name="locale"><file name="en_US.csv" hash="6640c882acc7cfe8f9c97420b71a06a2"/><file name="fr_FR.csv" hash="1b6680773468a96f2d52111c7b46abde"/></dir><file name="page.phtml" hash="36a34810c641433e3d1b65c31ce80b6b"/><file name="processor.php" hash="a9c2d793d8b37f3253e5e1c9c25d85b2"/><file name="readme.txt" hash="5067d7cfff8edd933ee8ae92c9cc3c52"/><file name="report.php" hash="732ebe33f5295832752f21fc782d8a7b"/><file name="report.phtml" hash="99e2778d96340c742f79caa8549d0269"/><file name="upgrade.php" hash="4ae737fbd7a7356c363ddaeab2d3b605"/><file name="upgrade.phtml" hash="2313e7692a2d0c218dee87e9f67e0ab5"/></dir></dir></target></contents>
<compatible/>
<dependencies><required><php><min>5.2.0</min><max>5.9.9</max></php></required></dependencies>
</package>
10 changes: 5 additions & 5 deletions skin/adminhtml/default/default/js/luigifab/versioning/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Created J/22/12/2011, Updated V/26/10/2012, Version 19
* Created J/22/12/2011, Updated L/29/10/2012, Version 19
*
* Copyright 2011-2012 | Fabrice Creuzot (luigifab) <code~luigifab~info>
* https://redmine.luigifab.info/projects/magento/wiki/versioning
Expand Down Expand Up @@ -57,17 +57,17 @@ function luigifabVersioningUpgrade(url, compressorInstalled, compressorEnabled,
if (text.length < 1) {
apijs.dialog.dialogFormOptions(
apijs.i18n.translate('versioning_uptitle', RegExp.$1), apijs.i18n.translate('versioning_uptext'),
function (param) { return true; }, null, url, 'versioning'
function () { return true; }, null, url, 'versioning'
);
}
else {
appcode += date.getFullYear() + '' + date.getMonth() + '' + date.getDate() + '';
appcode += date.getHours() + '' + date.getMinutes() + '' + date.getSeconds();
appcode = appcode.concat(date.getFullYear(), '', date.getMonth(), '', date.getDate(), '');
appcode = appcode.concat(appcode, date.getHours(), '', date.getMinutes(), '', date.getSeconds());

apijs.dialog.dialogFormOptions(
apijs.i18n.translate('versioning_uptitle', RegExp.$1),
apijs.i18n.translate(text, appcode),
function (param) { return true; }, null, url, 'versioning big'
function () { return true; }, null, url, 'versioning big'
);

if (!compressorEnabled) {
Expand Down

0 comments on commit b1b3507

Please sign in to comment.