[SPIP] ~maj 3.0.13 -> 3.0.14
[ptitvelo/web/www.git] / www / ecrire / plugins / installer.php
index e8d5706..12d74ac 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2012                                                *
+ *  Copyright (c) 2001-2014                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -63,6 +63,10 @@ function plugins_installer_dist($plug, $action, $dir_type='_DIR_PLUGINS')
        if ($action == 'uninstall') $test = !$test;
        // Si deja fait, on ne dit rien
        if ($test)  return true;
+       // Si install et que l'on a la meta d'installation, c'est un upgrade
+       if($action == 'install' && !is_null(lire_meta($infos['prefix'].'_base_version')))
+               $infos['upgrade'] = true;
+
        // executer l'installation ou l'inverse
        // et renvoyer la trace (mais il faudrait passer en AJAX plutot)
        ob_start();