Upgrade glpi-project/tools

This commit is contained in:
Cédric Anne 2022-01-31 13:30:38 +01:00
parent ce0aeca28e
commit 02efa77d16
7 changed files with 245 additions and 1643 deletions

View File

@ -1,13 +0,0 @@
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
require_once 'vendor/autoload.php';
class RoboFile extends Glpi\Tools\RoboFile
{
//Own plugin's robo stuff
}

View File

@ -3,7 +3,7 @@
"php": "^7.2"
},
"require-dev": {
"glpi-project/tools": "^0.1"
"glpi-project/tools": "^0.4"
},
"config": {
"optimize-autoloader": true,

1692
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
#!/bin/bash
soft='GLPI - Example plugin'
version='0.84'
email=glpi-translation@gna.org
copyright='INDEPNET Development Team'
#xgettext *.php */*.php -copyright-holder='$copyright' --package-name=$soft --package-version=$version --msgid-bugs-address=$email -o locales/en_GB.po -L PHP --from-code=UTF-8 --force-po -i --keyword=_n:1,2 --keyword=__ --keyword=_e
# Only strings with domain specified are extracted (use Xt args of keyword param to set number of args needed)
xgettext *.php */*.php -o locales/glpi.pot -L PHP --add-comments=TRANS --from-code=UTF-8 --force-po \
--keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t --keyword=_e:1,2t --keyword=_x:1c,2,3t --keyword=_ex:1c,2,3t \
--keyword=_sx:1c,2,3t --keyword=_nx:1c,2,3,5t
### for using tx :
##tx set --execute --auto-local -r GLPI_example.glpi-084-current 'locales/<lang>.po' --source-lang en --source-file locales/glpi.pot
## tx push -s
## tx pull -a

View File

@ -1,102 +0,0 @@
#!/usr/bin/perl
#!/usr/bin/perl -w
# ----------------------------------------------------------------------
# GLPI - Gestionnaire Libre de Parc Informatique
# Copyright (C) 2003-2006 by the INDEPNET Development Team.
#
# http://indepnet.net/ http://glpi-project.org
# ----------------------------------------------------------------------
#
# LICENSE
#
# This file is part of GLPI.
#
# GLPI 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; either version 2 of the License, or
# (at your option) any later version.
#
# GLPI 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 GLPI; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# ------------------------------------------------------------------------
do_dir("..");
sub do_dir{
local ($dir)=@_;
print "Entering $dir\n";
opendir(DIRHANDLE,$dir)||die "ERROR: can not read current directory\n";
foreach (readdir(DIRHANDLE)){
if ($_ ne '..' && $_ ne '.'){
if (-d "$dir/$_"){
if ($_ !~ m/.svn/i && $_ !~ m/CVS/i && $_ !~ m/lib/i){
do_dir("$dir/$_");
}
} else {
if(!(-l "$dir/$_")){
if ((index($_,".php",0)!=-1)||(index($_,".txt",0)!=-1)||(index($_,".css",0)!=-1)){
do_file("$dir/$_");
}
}
}
}
}
closedir DIRHANDLE;
}
sub do_file{
local ($file)=@_;
print $file."\n";
### DELETE HEADERS
open(INIT_FILE,$file);
@lines=<INIT_FILE>;
close(INIT_FILE);
open(TMP_FILE,">/tmp/tmp_glpi.txt");
$status='';
foreach (@lines){
if ($_ =~ m/\*\//){
$status="END";
}
if ($status =~ m/END/||$status !~ m/BEGIN/){
print TMP_FILE $_;
}
if ($status !~ m/END/){
if ($_ =~ m/\/\*/){
$status="BEGIN";
##### ADD NEW HEADERS
open(HEADER_FILE,"HEADER");
@headers=<HEADER_FILE>;
foreach (@headers){
print TMP_FILE $_;
}
close(HEADER_FILE) ;
}
}
}
close(TMP_FILE);
system("cp -f /tmp/tmp_glpi.txt $file");
}

View File

@ -1,29 +0,0 @@
#!/usr/bin/perl
#!/usr/bin/perl -w
if (@ARGV!=0){
print "USAGE update_mo.pl\n\n";
exit();
}
opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n";
foreach (readdir(DIRHANDLE)){
if ($_ ne '..' && $_ ne '.'){
if(!(-l "$dir/$_")){
if (index($_,".po",0)==length($_)-3) {
$lang=$_;
$lang=~s/\.po//;
`msgfmt locales/$_ -o locales/$lang.mo`;
}
}
}
}
closedir DIRHANDLE;
#
#

View File

@ -1,30 +0,0 @@
#!/usr/bin/perl
#!/usr/bin/perl -w
if (@ARGV!=2){
print "USAGE update_po.pl transifex_login transifex_password\n\n";
exit();
}
$user = $ARGV[0];
$password = $ARGV[1];
opendir(DIRHANDLE,'locales')||die "ERROR: can not read current directory\n";
foreach (readdir(DIRHANDLE)){
if ($_ ne '..' && $_ ne '.'){
if(!(-l "$dir/$_")){
if (index($_,".po",0)==length($_)-3) {
$lang=$_;
$lang=~s/\.po//;
`wget --user=$user --password=$password --output-document=locales/$_ http://www.transifex.net/api/2/project/GLPI_example/resource/glpipot/translation/$lang/?file=$_`;
}
}
}
}
closedir DIRHANDLE;
#
#