From e126c69917e4092ca476d411f4269b1a36fbef91 Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Sat, 14 Jan 2006 12:33:33 +0000
Subject: [PATCH] script pour tester le renommage des fichiers SPIP pour avoir
 l'extensibilite de l'espace de redaction

---
 .gitattributes |  1 +
 spip_migre     | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)
 create mode 100755 spip_migre

diff --git a/.gitattributes b/.gitattributes
index b5bd72e04f..c7fe1fea62 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -365,3 +365,4 @@ plugins/smallcaps/version.php -text
 /puce_rtl.gif -text
 /rien.gif -text
 /spip_action.php -text
+/spip_migre -text
diff --git a/spip_migre b/spip_migre
new file mode 100755
index 0000000000..d6c2ae4a66
--- /dev/null
+++ b/spip_migre
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# Script pour rendre Spip extensible
+# laisse tomber les .php3 par la meme occasion
+# garde neanmoins les .php3 qui peuvent avoir été mémorisés comme signets.
+
+for i in $(grep -l inc_version.php3 *)
+do
+	sed 's/inc_version.php3/inc_version.php/' $i > x
+	mv x $i
+done
+
+cd ecrire
+
+# Pour respecter "la fonction F_dist est definie dans inc_F.php"
+# il faut ajouter inc_ a qq fichiers derogatoires et remplacer - par _
+
+mv inc_config-contenu.php3 inc_config_contenu.php
+mv inc_config-multilang.php3 inc_config_multilang.php
+
+mv inc_config-fonctions.php inc_config_fonctions.php
+mv inc_config-lang.php inc_config_lang.php
+mv lab_diff.php inc_diff.php
+mv lab_ortho.php inc_ortho.php
+mv lab_revisions.php inc_revisions.php
+mv pclzip.lib.php inc_pclzip.php
+
+# 2 appels de la fonction pivot qui n'ont pas de php3
+sed  's/\(generer_url_ecrire("[^.]*\).php/\1/' inc_articles.php > a
+mv a inc_articles.php 
+sed  's/\(generer_url_ecrire("[^.]*\).php/\1/' inc_presentation.php3 > b
+mv b inc_presentation.php3
+
+# traitement specifique plus tard
+mv inc_version.php3 inc_version
+
+# pour tous les autres, c'est deja bon sauf le .php3 ---> .php
+
+for i in inc_*.php3
+do
+mv $i ${i%3}
+done
+
+# Et maintenant, changer la definition de la fonction pivot
+
+grep -v "script = '/'" inc_utils.php |
+sed 's/$ext=.*"\?/$args = "?exec=$script" . ($args ? "\&$args/; s,$script$ext,,' > x
+mv x inc_utils.php
+
+# consequence 1:  inc devient index, avec une valeur par defaut en dur
+sed 's/inc_version.php3/inc_version.php/;s/$SCRIPT_NAME/"accueil"/' inc.php3 > index.php
+
+# consequence 2: nouveau test pour les scripts sans authentification
+
+sed 's/inc_version.php3/inc_version.php/;s%$SCRIPT_NAME%preg_replace("/^.*exec=([^\&]*).*$/","\\\\1",$REQUEST_URI) OR (substr(basename($SCRIPT_NAME),0,11) == "spip_cookie")%'  inc_version > inc_version.php
+
-- 
GitLab