Skip to content

Commit

Permalink
Update spid-php.tpl
Browse files Browse the repository at this point in the history
get previously saved file if registry.spid.gov.it has problems
  • Loading branch information
LDAV authored Nov 6, 2023
1 parent b45f330 commit 25290c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup/sdk/spid-php.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@
public function addSPIDButtonListItems($method='GET'): string {
$method = strtolower($method);
$registry_idp_json = file_get_contents('https://registry.spid.gov.it/entities-idp?output=json');
$registry_idp_json = @file_get_contents('https://registry.spid.gov.it/entities-idp?output=json');
$registry_idp = json_decode($registry_idp_json, true);
if($registry_idp!=null && is_array($registry_idp) && count($registry_idp)) {
file_put_contents('spid-idps.json', $registry_idp_json);
file_put_contents(__DIR__ . 'spid-idps.json', $registry_idp_json);
} else {
$registry_idp = json_decode(file_get_contents('spid-idps.json'), true);
$registry_idp = json_decode(file_get_contents(__DIR__ . 'spid-idps.json'), true);
}

if($method=='post') {
Expand Down

0 comments on commit 25290c2

Please sign in to comment.