diff options
author | plegall <plg@piwigo.org> | 2013-08-20 17:10:56 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2013-08-20 17:10:56 +0000 |
commit | 6f2fc71ffadb049855b2ff2c9fc0a1952b736484 (patch) | |
tree | dd40e49beddde1c22be2a939b8aa7f71e9d8317a /tools | |
parent | 6b73cb58b78a9b23d71f9843ee3fa176058a521e (diff) |
remove obsolete/useless scripts
git-svn-id: http://piwigo.org/svn/trunk@24201 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | tools/config.inc.php | 8 | ||||
-rw-r--r-- | tools/convert_language_to_2.1.pl | 184 | ||||
-rw-r--r-- | tools/convert_template_to_2.1.pl | 48 | ||||
-rwxr-xr-x | tools/key2value.php | 126 | ||||
-rw-r--r-- | tools/release_creation.readme | 50 | ||||
-rwxr-xr-x | tools/replace.php | 53 | ||||
-rw-r--r-- | tools/replace_language_keys.pl | 60 | ||||
-rw-r--r-- | tools/replace_language_values.pl | 61 |
8 files changed, 0 insertions, 590 deletions
diff --git a/tools/config.inc.php b/tools/config.inc.php deleted file mode 100644 index 6e74538fb..000000000 --- a/tools/config.inc.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -// this file is provided as an example. It does not modify the configuration -// as long as it remains in "tools" directory. Move it to "include" -// directory if you want to modify default configuration. - -$conf['prefix_thumbnail'] = 'thumb_'; -$conf['show_gt'] = true; -?>
\ No newline at end of file diff --git a/tools/convert_language_to_2.1.pl b/tools/convert_language_to_2.1.pl deleted file mode 100644 index b78547a33..000000000 --- a/tools/convert_language_to_2.1.pl +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/perl - -# Here is the way I finally used this script: -# -# for language in ar_SA cz_CZ da_DK de_DE es_AR es_ES hr_HR hu_HU it_IT ja_JP nl_NL pl_PL pt_BR pt_PT ru_RU sr_RS vi_VN zh_CN -# do -# export PWG_LANG=$language -# rm -rf language/$PWG_LANG -# cp -r ../branches/2.0/language/$PWG_LANG language/ -# perl tools/convert_language_to_2.1.pl language/$PWG_LANG -# done - -use strict; -use warnings; - -my $language_dir = $ARGV[0]; - -my @file_codes = qw/upgrade install admin common/; - -my %ignore_keys = ( - 'user_status_admin' => '', - 'user_status_generic' => '', - 'user_status_guest' => '', - 'user_status_normal' => '', - 'user_status_webmaster' => '', - 'Level 0' => '', - 'Level 1' => '', - 'Level 2' => '', - 'Level 4' => '', - 'Level 8' => '', - 'ACCESS_0' => '', - 'ACCESS_1' => '', - 'ACCESS_2' => '', - 'ACCESS_3' => '', - 'ACCESS_4' => '', - 'ACCESS_5' => '', - 'month' => '', - 'day' => '', - 'chronology_monthly_calendar' => '', - 'chronology_monthly_list' => '', - 'chronology_weekly_list' => '', -); - -my %remove_keys = ( - common => { - "You can\\'t upload pictures in this category" => '', - 'display pictures added on' => '', - 'Email address is missing' => '', - 'Delete: %s' => '', - 'All tags must match' => '', - 'Validate: %s' => '', - 'Upgrade from %s to %s' => '', - }, - admin => { - 'nbm_content_goto_2' => '', - 'nbm_content_hello_2' => '', - 'nbm_redirect_msg' => '', - - 'username' => '', - 'No tag defined. Use Administration>Pictures>Tags' => '', - 'Remote site url must start by http or https and must only contain characters among "/", "a-zA-Z0-9", "-" or "_"' => '', - 'path' => '', - 'Unable to retrieve server informations since allow_url_fopen is disabled.' => '', - 'The following tag were deleted' => '', - 'Remote site' => '', - 'Piwigo home' => '', - 'Move up' => '', - 'Instructions' => '', - 'Hits' => '', - 'General' => '', - 'Gallery description' => '', - 'Extensions' => '', - 'Demo' => '', - 'Categories ascending alphanumerically ordered' => '', - 'Categories descending alphanumerically ordered' => '', - 'Categories sorted in ascending order ⇓' => '', - 'Categories sorted in ascending order ⇓' => '', - 'Categories sorted in descending order ⇑' => '', - 'Categories sorted in descending order ⇑' => '', - 'Bugs' => '', - 'Automatic installation' => '', - 'Upgrade from version %s to %s' => '', - 'Upgrade from %s to %s' => '', - 'Upload Form' => '', - }, - upgrade => { - 'Are you sure?' => '', - 'In <i>%s</i>, before <b>?></b>, insert:' => '', - }, - install => { - 'Parameters are correct' => '', - 'Installation finished' => '', - 'The next step of the installation is now possible' => '', - 'next step' => '', - } -); - -my %to_copy = (); - -# load the replacements -my %replace_by = (); -foreach my $file_code (@file_codes) { - open(my $ifh_rep, '<language/templates/'.$file_code.'.lang.php'); - while (<$ifh_rep>) { - if (m/^\$lang\['(.*)'\] \s* = \s* (['"])(.*)\2;/x) { - if ($1 ne $3 and length($1) > 0) { - $replace_by{$1} = $3; - } - } - } -} -# use Data::Dumper; print Dumper(\%replace_by); exit(); - -my $append_to_common = ''; - -foreach my $file_code (@file_codes) { - my $filename = $language_dir.'/'.$file_code.'.lang.php'; - print $filename; - if (not -f $filename) { - print ' is missing', "\n"; - next; - } - print ' is under process', "\n"; - - if ($file_code eq 'admin') { - %to_copy = ( - 'Are you sure?' => '', - 'Email address is missing. Please specify an email address.' => '', - 'delete this comment' => '', - 'validate this comment' => '', - ); - } - else { - %to_copy = (); - } - - my $file_content = ''; - my $copy_content = ''; - - open(my $ifh, '<'.$language_dir.'/'.$file_code.'.lang.php'); - while (my $line = <$ifh>) { - if ($line =~ m/^\$lang\['(.*)'\] \s* =/x) { - if (defined $remove_keys{$file_code}{$1}) { - next; - } - elsif (defined $ignore_keys{$1}) { - $file_content.= $line; - } - elsif (defined $to_copy{$1}) { - $append_to_common.= $line; - } - elsif (defined $replace_by{$1}) { - my $search = quotemeta($1); - my $replace = $replace_by{$1}; - - $line =~ s{$search}{$replace}; - - if (defined $to_copy{$replace}) { - $append_to_common.= $line; - } - else { - $file_content.= $line; - } - } - else { - $file_content.= $line; - } - } - elsif ($line =~ m/^?>/) { - if ('common' eq $file_code) { - $file_content.= $append_to_common; - } - $file_content.= $line; - } - else { - $file_content.= $line; - } - } - close($ifh); - - open(my $ofh, '>'.$language_dir.'/'.$file_code.'.lang.php'); - print {$ofh} $file_content; - close($ofh); -} diff --git a/tools/convert_template_to_2.1.pl b/tools/convert_template_to_2.1.pl deleted file mode 100644 index a838e8f8b..000000000 --- a/tools/convert_template_to_2.1.pl +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/perl - -# perl tools/convert_template_to_2.1.pl /path/to/tpl/files/directory - -use strict; -use warnings; - -use File::Find; - -my $base_dir = $ARGV[0]; - -# load the replacements -my @file_codes = qw/upgrade install admin common/; -my %replace_by = (); -foreach my $file_code (@file_codes) { - open(my $ifh_rep, '<language/templates/'.$file_code.'.lang.php'); - while (<$ifh_rep>) { - if (m/^\$lang\['(.*)'\] \s* = \s* (['"])(.*)\2;/x) { - if ($1 ne $3 and length($1) > 0) { - $replace_by{$1} = $3; - } - } - } -} -# use Data::Dumper; print Dumper(\%replace_by); exit(); - -find(\&replace_keys, $base_dir); - -sub replace_keys { - if ($File::Find::name !~ m/tpl$/) { - return 0; - } - - my $file_content = ''; - open(my $fhi, '<', $File::Find::name); - while (<$fhi>) { - foreach my $from (keys %replace_by) { - my $to = $replace_by{$from}; - s/{'$from'\|\@translate/{'$to'|\@translate/g; - } - $file_content.= $_; - } - close($fhi); - - open(my $fho, '>', $File::Find::name); - print {$fho} $file_content; - close($fho); -} diff --git a/tools/key2value.php b/tools/key2value.php deleted file mode 100755 index cda02d9bc..000000000 --- a/tools/key2value.php +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/php -qn -<?php -if (isset($_SERVER['argc']) && $_SERVER['argc']<=1) -{ - help(); -} - -$language = trim($_SERVER['argv'][1]); -if (!is_dir("language/$language")) -{ - help(); -} - -$Files = array('common', 'admin', 'install', 'upgrade'); -$exclude_keys = array('user_status_admin', 'user_status_generic', - 'user_status_guest', 'user_status_normal', - 'user_status_webmaster', 'Level 0', - 'Level 1', 'Level 2', 'Level 4', 'Level 8', - 'chronology_monthly_calendar', 'chronology_monthly_list', - 'chronology_weekly_list'); - -foreach ($Files as $file) -{ - $lang_file = sprintf('language/%s/%s.lang.php', $language, $file); - $en_file = sprintf('language/en_UK/%s.lang.php', $file); - include $lang_file; - $source_lang = $lang; - unset($lang); - include $en_file; - - try - { - $fh = fopen($lang_file, 'w+'); - - fwrite($fh, copyright()); - - if ($file == 'common') - { - foreach ($lang_info as $key => $value) - { - fwrite($fh, sprintf("\$lang_info['%s'] = \"%s\";\n", - $key, - $value - ) - ); - } - } - fwrite($fh, "\n\n"); - - foreach ($lang as $key => $value) - { - if (is_array($value)) - { - foreach ($value as $k => $v) - { - fwrite($fh, sprintf("\$lang['%s'][%s] = \"%s\";\n", - str_replace("'", "\'", trim($key)), - trim($k), - str_replace('"', '\"', trim($source_lang[$key][$k])) - ) - ); - } - } - elseif (in_array($key, $exclude_keys)) - { - fwrite($fh, sprintf("\$lang['%s'] = \"%s\";\n", - str_replace("'", "\'", trim($key)), - str_replace('"', '\"', trim($source_lang[$key])) - ) - ); - } - else - { - fwrite($fh, sprintf("\$lang['%s'] = \"%s\";\n", - str_replace("'", "\'", trim($value)), - str_replace('"', '\"', trim($source_lang[$key])) - ) - ); - } - } - fwrite($fh, '?>'); - fclose($fh); - } - catch (Exception $e) - { - print $e->getMessage(); - } -} - -function help() -{ - echo "\n"; - echo 'usage : ', basename($_SERVER['argv'][0]), " <LANGUAGE CODE>\n"; - echo "\n"; - exit(1); -} - -function copyright() -{ - return -'<?php -// +-----------------------------------------------------------------------+ -// | Piwigo - a PHP based photo gallery | -// +-----------------------------------------------------------------------+ -// | Copyright(C) 2008-2013 Piwigo Team http://piwigo.org | -// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | -// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | -// +-----------------------------------------------------------------------+ -// | This program is free software; you can redistribute it and/or modify | -// | it under the terms of the GNU General Public License as published by | -// | the Free Software Foundation | -// | | -// | This program is distributed in the hope that it will be useful, but | -// | WITHOUT ANY WARRANTY; without even the implied warranty of | -// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | -// | General Public License for more details. | -// | | -// | You should have received a copy of the GNU General Public License | -// | along with this program; if not, write to the Free Software | -// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | -// | USA. | -// +-----------------------------------------------------------------------+ - -'; -} -?>
\ No newline at end of file diff --git a/tools/release_creation.readme b/tools/release_creation.readme deleted file mode 100644 index a8b4f6f52..000000000 --- a/tools/release_creation.readme +++ /dev/null @@ -1,50 +0,0 @@ -===================================== - Piwigo release creation guide -===================================== - -Technical creation -================== - -I take release 1.7.0 as an example. In URLs "plg" is my personnal Gna! -username, so use yours. - -- tag creation tags/release-1_7_0 : - -$ svn copy \ - -r 1999 \ - -m "Create release 1.7.0 from branch 1.7 r1999" \ - svn+ssh://plg@svn.gna.org/svn/phpwebgallery/branch/branch-1_7 \ - svn+ssh://plg@svn.gna.org/svn/phpwebgallery/tags/release-1_7_0 - -- checkout new Subversion release 1.7.0 - -$ svn co svn+ssh://plg@svn.gna.org/svn/phpwebgallery/tags/release-1_7_0 1.7.0 -$ cd 1.7.0 - -- in include/config_default.inc.php, change the following parameters: - - $conf['check_upgrade_feed'] = false; - - $conf['show_version'] = false; - - $conf['show_gt'] = false; - - $conf['die_on_sql_error'] = false; - -- in include/constants.php, change the PHPWG_VERSION to 1.7.0 - -- commit your changes to tags/release-1_7_0, with the following comment: - -> New version 1.7.0 hard coded. -> -> Stable release required modifications: don't show version and generation -> time in footer, don't check the upgrade feed, don't die on sql errors. - -$ svn commit - -- create the release (pwg_rel_create.sh is in tools directory) - -$ mkdir /tmp/1.7.0 -$ cd /tmp/1.7.0 -$ pwg_rel_create.sh release-1_7_0 1.7.0 -$ md5sum p* > MD5SUMS - -- upload the release to Gna! download area - -$ scp -r /tmp/1.7.0 plg@download.gna.org:/upload/phpwebgallery/release/1.7/ diff --git a/tools/replace.php b/tools/replace.php deleted file mode 100755 index 0596ca064..000000000 --- a/tools/replace.php +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/php -qn -<?php -if (isset($_SERVER['argc']) && $_SERVER['argc']<=1) -{ - echo "\n"; - echo 'usage : ', basename($_SERVER['argv'][0]), " <filename>\n"; - echo "\n"; - exit(1); -} - -$filename = trim($_SERVER['argv'][1]); -$lines = file($filename); -$content = file_get_contents($filename); - -$n = 0; -$nbLines = count($lines); - -$pattern = "`(.*{')(.*)('\|@translate}.*)`Um"; -$replace = "'{\''.keyReplace('\\1').'\'|@translate}'"; - -include "language/templates/common.lang.php"; -include "language/templates/admin.lang.php"; -include "language/templates/upgrade.lang.php"; -include "language/templates/install.lang.php"; - -while ($n < $nbLines) { - preg_match_all($pattern, $lines[$n], $matches); - echo str_replace($matches[2], keyReplace($matches[2]), $lines[$n]); - $n++; -} - -function keyReplace($key) { - global $lang; - - if (is_array($key)) { - $translation = array(); - foreach ($key as $i => $k) { - if (isset($lang[$k])) { - $translation = addslashes($lang[$k]); - } else { - $translation = "$k"; - } - } - } else { - if (isset($lang[$key])) { - $translation = addslashes($lang[$key]); - } else { - $translation = "$key"; - } - } - return $translation; -} -?>
\ No newline at end of file diff --git a/tools/replace_language_keys.pl b/tools/replace_language_keys.pl deleted file mode 100644 index 822b3e1cc..000000000 --- a/tools/replace_language_keys.pl +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -my $replacement_file = $ARGV[0]; -my $language_dir = $ARGV[1]; - -# load the replacements -my %replace_by = (); -open(my $ifh_rep, '<'.$replacement_file); -while (<$ifh_rep>) { - if (m/^\$lang\['(.*)'\] \s* = \s* (['"])(.*)\2;/x) { - if ($1 ne $3 and length($1) > 0) { - $replace_by{$1} = $3; - } - } -} -# use Data::Dumper; print Dumper(\%replace_by); exit(); - -my $append_to_common = ''; - -foreach my $file_code (qw/upgrade install admin common plugin/) { - my $filename = $language_dir.'/'.$file_code.'.lang.php'; - # print $filename; - if (not -f $filename) { - # print ' is missing', "\n"; - next; - } - print $filename.' is under process', "\n"; - - my $file_content = ''; - - open(my $ifh, '<'.$filename); - while (my $line = <$ifh>) { - if ($line =~ m/^\$lang\['(.*)'\] \s* =/x) { - if (defined $replace_by{$1}) { - my $search = quotemeta($1); - my $replace = $replace_by{$1}; - - $line =~ s{$search}{$replace}; - $file_content.= $line; - } - else { - $file_content.= $line; - } - } - elsif ($line =~ m/^?>/) { - $file_content.= $line; - } - else { - $file_content.= $line; - } - } - close($ifh); - - open(my $ofh, '>'.$filename); - print {$ofh} $file_content; - close($ofh); -} diff --git a/tools/replace_language_values.pl b/tools/replace_language_values.pl deleted file mode 100644 index f901e1140..000000000 --- a/tools/replace_language_values.pl +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -my $replacement_file = $ARGV[0]; -my $language_dir = $ARGV[1]; - -# load the new values for given keys -my %new_value_of = (); -open(my $ifh_rep, '<'.$replacement_file); -while (<$ifh_rep>) { - if (m/^\$lang\['(.*)'\] \s* = \s* (.*);/x) { - $new_value_of{$1} = $2; - } -} -# use Data::Dumper; print Dumper(\%new_value_of); exit(); - -my %replacement_performed_for = (); - -foreach my $file_code (qw/upgrade install admin common plugin/) { - my $filename = $language_dir.'/'.$file_code.'.lang.php'; - # print $filename; - if (not -f $filename) { - # print ' is missing', "\n"; - next; - } - print $filename.' is under process', "\n"; - - my $file_content = ''; - - open(my $ifh, '<'.$filename); - while (my $line = <$ifh>) { - if ($line =~ m/^\$lang\['(.*)'\] \s* =/x) { - if (defined $new_value_of{$1}) { - $file_content.= '$lang[\''.$1.'\'] = '.$new_value_of{$1}.';'."\n"; - $replacement_performed_for{$1}++; - } - else { - $file_content.= $line; - } - } - elsif ($line =~ m/^?>/) { - $file_content.= $line; - } - else { - $file_content.= $line; - } - } - close($ifh); - - open(my $ofh, '>'.$filename); - print {$ofh} $file_content; - close($ofh); -} - -foreach my $new_value (keys %new_value_of) { - if (not defined $replacement_performed_for{$new_value}) { - print 'no replacement performed on: ', $new_value, "\n"; - } -} |