Skip to content

Commit

Permalink
Merge pull request #8 from newfold-labs/add/fallback-provider
Browse files Browse the repository at this point in the history
Add a fallback provider
  • Loading branch information
arunshenoy99 authored Oct 22, 2024
2 parents ee3c6ef + ee72ec6 commit 5572585
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion includes/Data/Providers.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ public function __construct() {
'method' => 'wp_option',
),
),
// This fallback provider is used when we do not receive the storage map for any provider from Hiive after provisioning a license
'nfd' => array(
'storage' => array(
'license_id' => "nfd_module_pls_license_id_{$this->environment}_%s",
'activation_key' => "nfd_module_pls_activation_key_{$this->environment}_%s",
),
),
);
}

Expand All @@ -59,7 +66,7 @@ public function get_option_name( $provider, $type, $identifier ) {
return sprintf( $this->providers[ $provider ]['storage'][ $type ], $identifier );
}

return false; // Provider or type not found.
return sprintf( $this->providers['nfd']['storage'][ $type ], $identifier );
}

/**
Expand Down

0 comments on commit 5572585

Please sign in to comment.