Skip to content

Commit

Permalink
Update proxy-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 a2018f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup/sdk/proxy-spid-php.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class PROXY_SPID_PHP extends SPID_PHP {

public function addSPIDButtonListItems($method='GET'): string{
$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);
}

$button_li = "";
Expand Down

0 comments on commit a2018f4

Please sign in to comment.