From 5ebcfca91eef505fbc183603755c413277513b1b Mon Sep 17 00:00:00 2001 From: Olivier PEREZ Date: Fri, 10 Apr 2015 00:44:54 +0200 Subject: [PATCH] Delete deprecated scripts --- scripts/migration_date.php | 56 ---------- scripts/phpVar2getText.php | 153 ---------------------------- scripts/recherche_adresse.pl | 46 --------- scripts/recherche_adresse_admin.php | 29 ------ 4 files changed, 284 deletions(-) delete mode 100644 scripts/migration_date.php delete mode 100644 scripts/phpVar2getText.php delete mode 100644 scripts/recherche_adresse.pl delete mode 100644 scripts/recherche_adresse_admin.php diff --git a/scripts/migration_date.php b/scripts/migration_date.php deleted file mode 100644 index b6b5c77..0000000 --- a/scripts/migration_date.php +++ /dev/null @@ -1,56 +0,0 @@ -id_sondage." "; - $sujets=pg_exec($connect, "select sujet from sujet_studs where id_sondage='$dsondage->id_sondage'"); - $dsujets=pg_fetch_object($sujets,0); - - $nouvelledateaffiche=""; - $anciensujethoraires=explode(",",$dsujets->sujet); - - for ($j=0;$j '.$nouvelledate.'@'.$ancientsujet[1].'
'; - $nouvelledateaffiche.=$nouvelledate.'@'.$ancientsujet[1].','; - } - } else { - if (preg_match(";(\d{1,2})/(\d{1,2})/(\d{4});",$anciensujethoraires[$j],$registredate)) { - $nouvelledate=mktime(0,0,0,$registredate[2],$registredate[1],$registredate[3]); - // echo $anciensujethoraires[$j].' ---- > '.$nouvelledate.'
'; - $nouvelledateaffiche.=$nouvelledate.','; - } - } - } - - $nouvelledateaffiche=substr($nouvelledateaffiche,0,-1); - print $dsujets->sujet.' donne '.$nouvelledateaffiche.'\n\n'; - // pg_exec($connect,"update sujet_studs set sujet='$nouvelledateaffiche' where id_sondage='$dsondage->id_sondage'"); -} diff --git a/scripts/phpVar2getText.php b/scripts/phpVar2getText.php deleted file mode 100644 index 597735c..0000000 --- a/scripts/phpVar2getText.php +++ /dev/null @@ -1,153 +0,0 @@ -.inc - build un assoc array - preg_replace les appels wrappés dans gettext() dans le php principal - generate un .po - - ( - echo -e "\x27\2\x27,/p' lang/en.inc; - echo '); ?>' - ) > /tmp/lang.mod - (manually tweak 2 double quotes) -*/ - -// drop a $l which contain the array -if(isset($_SERVER['PHP_SELF'])) { - die(); // die if not run with php-cli -} - -require_once('/tmp/lang.mod'); -$mypath = '/var/www/studs'; - -/* Language, country need to be adapted */ -$header = 'msgid "" -msgstr "" -"Project-Id-Version: Studs 0.6.4\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-05-01 18:32+0100\n" -"PO-Revision-Date: 2010-05-01 18:32+0100\n" -"Last-Translator: Raphaël Droz \n" -"Language-Team: Guilhem Borghesi, Raphaël Droz\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Language: FR\n" -"X-Poedit-Country: FRANCE\n" -"X-Poedit-SourceCharset: utf-8\n" -"X-Poedit-KeywordsList: _\n" -"X-Poedit-Basepath: /var/www/studs\n" -"X-Poedit-SearchPath-0: .\n" - -'; - -/* helpers */ -function stripN($a) -{ - return preg_replace("/\n/","\\n", $a); -} - -function addDQ($a) -{ - return addcslashes($a,'"'); -} - -/* low priority for weak regexps (small variable length) at the end, please */ -function cmp($a, $b) -{ - return (mb_strlen($a) < mb_strlen($b)); -} - -uksort($l, 'cmp'); - -/* - 0: surely direct, like in: echo 'text ' . $var; - 1: wrap in, like in: echo "$var"; - 2: direct, like in: echo $var . "text"; -*/ -$match0 = $repl0 = $match1 = $repl1 = $match2 = $repl2 = $match3 = $repl3 = array(); -foreach($l as $k => $v) { - $match0[] = ';([\'"][ \.]|echo|print) *\$' . $k . ' *([\. ][\'"]|\;);' ; - $repl0[] = '\1 _("' . stripN(stripcslashes($v)) . '") \2' ; - - $match1[] = ';(["\'])(.*?)\$' . $k . ';' ; - $repl1[] = '\1\2" . _("' . stripN(addcslashes(stripcslashes($v),'"')) . '") . \1' ; - - $match2[] = ';\$' . $k . ';' ; - $repl2[] = '_("' . stripN(stripcslashes($v)) . '")' ; - - $match3[] = ';\. *\$GLOBALS\["' . $k . '"\] *\.;' ; - $repl3[] = '. _("' . stripN(stripcslashes($v)) . '") .' ; -} - -foreach (new DirectoryIterator('.') as $fileInfo) { - if($fileInfo->isDot()) { - continue; - } - - $name = $fileInfo->getFilename(); - // process php files - if(!preg_match('/\.php$/' , $name) || preg_match('/phpVar2getText/', $name)) { - continue; - } - - $orig = file_get_contents($name); - $a = preg_replace($match0, $repl0, $orig, -1, $b); - $a = preg_replace($match1, $repl1, $a, -1, $c); - $a = preg_replace($match2, $repl2, $a, -1, $d); - $a = preg_replace($match3, $repl3, $a, -1, $e); - $tot = $b + $c + $e; - echo $name . ' --- ' . $tot . " (match1: $c)" . "\n"; - if($tot > 0) { - file_put_contents($name . '.save', $orig); - file_put_contents($name, $a); - } -} - - -foreach(array('fr_FR','es_ES','de_DE', 'en_GB') as $i) { - $ii = explode('_', $i); - $f = $ii[0]; $g = $ii[1]; - - // de.inc corrupted the whole process ! - unset($tt_adminstuds_mail_corps_changemail); - // now define each of the strings with a new langague - require_once($mypath . '/lang/' . $f . '.inc'); - $a = ''; - - /* duplicates are fatal to poedit */ - foreach(array_unique($l) as $k => $v) { - /* poedit is strict with its syntax */ - $po_ready_v = stripN(addDQ($v)); - if($f == 'en') { - $a .= 'msgid "' . $po_ready_v . '"' . "\n" . 'msgstr "' . $po_ready_v . '"' . "\n\n"; - } else { - $a .= 'msgid "' . $po_ready_v . '"' . "\n" . - /* ${$k} the key (var name) in the orig (EN) array - to look for as a raw $var while the .inc is included in the context */ - 'msgstr "' . stripN(addDQ(${$k})) . '"' . "\n\n"; - } - } - file_put_contents('locale/' . $f . '_' . $g . '/LC_MESSAGES/Studs.po', $header . $a); -} diff --git a/scripts/recherche_adresse.pl b/scripts/recherche_adresse.pl deleted file mode 100644 index 0c5886d..0000000 --- a/scripts/recherche_adresse.pl +++ /dev/null @@ -1,46 +0,0 @@ -#/========================================================================== -#/ -#/Université de Strasbourg - Direction Informatique -#/Auteur : Guilhem BORGHESI -#/Création : Février 2008 -#/ -#/borghesi@unistra.fr -#/ -#/Ce logiciel est régi par la licence CeCILL-B soumise au droit français et -#/respectant les principes de diffusion des logiciels libres. Vous pouvez -#/utiliser, modifier et/ou redistribuer ce programme sous les conditions -#/de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA -#/sur le site "http://www.cecill.info". -#/ -#/Le fait que vous puissiez accéder à cet en-tête signifie que vous avez -#/pris connaissance de la licence CeCILL-B, et que vous en avez accepté les -#/termes. Vous pouvez trouver une copie de la licence dans le fichier LICENCE. -#/ -#/========================================================================== -#/ -#/Université de Strasbourg - Direction Informatique -#/Author : Guilhem BORGHESI -#/Creation : Feb 2008 -#/ -#/borghesi@unistra.fr -#/ -#/This software is governed by the CeCILL-B license under French law and -#/abiding by the rules of distribution of free software. You can use, -#/modify and/ or redistribute the software under the terms of the CeCILL-B -#/license as circulated by CEA, CNRS and INRIA at the following URL -#/"http://www.cecill.info". -#/ -#/The fact that you are presently reading this means that you have had -#/knowledge of the CeCILL-B license and that you accept its terms. You can -#/find a copy of this license in the file LICENSE. -#/ -#/========================================================================== - -#!/usr/bin/perl - -open (FILE,"../admin/logs_studs.txt"); - -while () { - /.*\t(.*u-strasbg.fr)\t.*/; - print $1."\n"; -} diff --git a/scripts/recherche_adresse_admin.php b/scripts/recherche_adresse_admin.php deleted file mode 100644 index 17be229..0000000 --- a/scripts/recherche_adresse_admin.php +++ /dev/null @@ -1,29 +0,0 @@ -mail_admin, "; - // print "$dsondage->mail_admin\n"; -}