Can force option according to country
This commit is contained in:
parent
868f2e5473
commit
5de0d81dff
@ -44,8 +44,8 @@ $includeconstants=array();
|
|||||||
|
|
||||||
if (empty($argv[1]))
|
if (empty($argv[1]))
|
||||||
{
|
{
|
||||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=MY_CONF_NAME:value]\n";
|
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=MAILING_NO_USING_PHPMAIL:1\n";
|
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -54,8 +54,13 @@ while ($i < $argc)
|
|||||||
if (! empty($argv[$i])) parse_str($argv[$i]);
|
if (! empty($argv[$i])) parse_str($argv[$i]);
|
||||||
if (preg_match('/includeconstant=/',$argv[$i]))
|
if (preg_match('/includeconstant=/',$argv[$i]))
|
||||||
{
|
{
|
||||||
$tmp=explode(':', $includeconstant);
|
$tmp=explode(':', $includeconstant, 3);
|
||||||
if (count($tmp) == 2) $includeconstants[$tmp[0]] = $tmp[1];
|
if (count($tmp) != 3)
|
||||||
|
{
|
||||||
|
print "Error: Bad parameter includeconstant ".$includeconstant."\n";
|
||||||
|
exit -1;
|
||||||
|
}
|
||||||
|
$includeconstants[$tmp[0]][$tmp[1]] = $tmp[2];
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -84,9 +89,12 @@ else
|
|||||||
print "Release : ".$release."\n";
|
print "Release : ".$release."\n";
|
||||||
print "Include custom : ".$includecustom."\n";
|
print "Include custom : ".$includecustom."\n";
|
||||||
print "Include constants: ";
|
print "Include constants: ";
|
||||||
foreach ($includeconstants as $constname => $constvalue)
|
foreach ($includeconstants as $countrycode => $tmp)
|
||||||
{
|
{
|
||||||
print $constname.'='.$constvalue." ";
|
foreach($tmp as $constname => $constvalue)
|
||||||
|
{
|
||||||
|
print $constname.'='.$constvalue." ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
@ -100,16 +108,19 @@ $checksumconcat=array();
|
|||||||
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
|
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
|
||||||
$fp = fopen($outputfile,'w');
|
$fp = fopen($outputfile,'w');
|
||||||
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
|
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
|
||||||
fputs($fp, '<checksum_list version="'.$release.'">'."\n");
|
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
|
||||||
|
|
||||||
fputs($fp, '<dolibarr_constants>'."\n");
|
foreach ($includeconstants as $countrycode => $tmp)
|
||||||
foreach($includeconstants as $constname => $constvalue)
|
|
||||||
{
|
{
|
||||||
$valueforchecksum=(empty($constvalue)?'0':$constvalue);
|
fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n");
|
||||||
$checksumconcat[]=$valueforchecksum;
|
foreach($tmp as $constname => $constvalue)
|
||||||
fputs($fp, ' <constant name="'.$constname.'" value="'.$valueforchecksum.'">'.$valueforchecksum.'</constant>'."\n");
|
{
|
||||||
|
$valueforchecksum=(empty($constvalue)?'0':$constvalue);
|
||||||
|
$checksumconcat[]=$valueforchecksum;
|
||||||
|
fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n");
|
||||||
|
}
|
||||||
|
fputs($fp, '</dolibarr_constants>'."\n");
|
||||||
}
|
}
|
||||||
fputs($fp, '</dolibarr_constants>'."\n");
|
|
||||||
|
|
||||||
fputs($fp, '<dolibarr_htdocs_dir includecustom="'.$includecustom.'">'."\n");
|
fputs($fp, '<dolibarr_htdocs_dir includecustom="'.$includecustom.'">'."\n");
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user