Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GIP RENATER
switch-wayf
Commits
b4865866
Commit
b4865866
authored
Jun 25, 2018
by
Guillaume Rousse
Browse files
add --min-sp-quota and --min-idp-quota options
parent
8a774ff4
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/update-metadata.php
View file @
b4865866
...
...
@@ -30,7 +30,11 @@ Argument Description
--metadata-idp-file <file> File containing Service Providers
--metadata-sp-file <file> File containing Identity Providers
--min-idp-count <count> Minimum expected number of IdPs in metadata
--min-idp-quota <quota> Minimum expected number of IdPs in metadata,
as a percentage of current number
--min-sp-count <count> Minimum expected number of SPs in metadata
--min-sp-quota <quoat> Minimum expected number of SPs in metadata,
as a percentage of current number
--language <locale> Language locale, e.g. 'en', 'jp', ...
--verbose | -v Verbose mode
--help | -h Print this man page
...
...
@@ -50,7 +54,9 @@ $longopts = array(
"metadata-idp-file:"
,
"metadata-sp-file:"
,
"min-idp-count:"
,
"min-idp-quota:"
,
"min-sp-count:"
,
"min-sp-quota:"
,
"language:"
,
"verbose"
,
"help"
,
...
...
@@ -90,6 +96,14 @@ if (isset($options['min-sp-count'])) {
}
else
{
$minSPCount
=
$options
[
'min-sp-count'
];
}
}
elseif
(
isset
(
$options
[
'min-sp-quota'
]))
{
if
(
!
is_numeric
(
$options
[
'min-sp-quota'
]))
{
exit
(
"Exiting: invalid value for --min-sp-quota parameter
\n
"
);
}
else
{
require_once
(
$metadataSPFile
);
$SPCount
=
count
(
$metadataSProviders
);
$minSPCount
=
floor
(
$SPCount
*
$options
[
'min-sp-quota'
]
/
100
);
}
}
else
{
$minSPCount
=
0
;
}
...
...
@@ -100,6 +114,14 @@ if (isset($options['min-idp-count'])) {
}
else
{
$minIDPCount
=
$options
[
'min-idp-count'
];
}
}
elseif
(
isset
(
$options
[
'min-idp-quota'
]))
{
if
(
!
is_numeric
(
$options
[
'min-idp-quota'
]))
{
exit
(
"Exiting: invalid value for --min-idp-quota parameter
\n
"
);
}
else
{
require_once
(
$metadataIDPFile
);
$IDPCount
=
count
(
$metadataIDProviders
);
$minIDPCount
=
floor
(
$IDPCount
*
$options
[
'min-idp-quota'
]
/
100
);
}
}
else
{
$minIDPCount
=
0
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment