Skip to content

Commit

Permalink
Merge pull request #92 from manitu-opensource/patch-1
Browse files Browse the repository at this point in the history
Make loading data on demand
  • Loading branch information
globalcitizen committed Nov 18, 2019
2 parents 516f43b + 61fee25 commit c2e29dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion php-iban.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ function iban_country_get_central_bank_name($iban_country) {

# Get the list of all IBAN countries
function iban_countries() {
_iban_load_registry();
global $_iban_registry;
return array_keys($_iban_registry);
}
Expand Down Expand Up @@ -471,7 +472,6 @@ function iban_mistranscription_suggestions($incorrect_iban) {
# Load the IBAN registry from disk.
global $_iban_registry;
$_iban_registry = array();
_iban_load_registry();
function _iban_load_registry() {
global $_iban_registry;
# if the registry is not yet loaded, or has been corrupted, reload
Expand Down Expand Up @@ -538,6 +538,7 @@ function _iban_get_info($iban,$code) {

# Get information from the IBAN registry by country / code combination
function _iban_country_get_info($country,$code) {
_iban_load_registry();
global $_iban_registry;
$country = strtoupper($country);
$code = strtolower($code);
Expand Down

0 comments on commit c2e29dc

Please sign in to comment.