From: Vincent Vanwaelscappel Date: Fri, 5 Jul 2019 13:44:20 +0000 (+0200) Subject: #2868 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ce07dc18fa5225f3023920fb6c8ad683a89378fd;p=cubist_locale.git #2868 --- diff --git a/src/Country.php b/src/Country.php index bd24571..d2ca904 100644 --- a/src/Country.php +++ b/src/Country.php @@ -6,5 +6,7 @@ namespace Cubist\Locale; class Country extends LocalizedList { - protected static $_listPath = 'vendor/umpirsky/country-list/data/$locale/country.php'; + protected static function _getListPath(){ + return 'vendor/umpirsky/country-list/data/$locale/country.php'; + } } diff --git a/src/Locale.php b/src/Locale.php index a0fbee7..700400e 100644 --- a/src/Locale.php +++ b/src/Locale.php @@ -4,5 +4,9 @@ namespace Cubist\Locale; class Locale extends LocalizedList { - protected static $_listPath = 'vendor/umpirsky/locale-list/data/$locale/locales.php'; + + protected static function _getListPath() + { + return 'vendor/umpirsky/locale-list/data/$locale/locales.php'; + } } diff --git a/src/LocalizedList.php b/src/LocalizedList.php index 2dab6d0..8c6e464 100644 --- a/src/LocalizedList.php +++ b/src/LocalizedList.php @@ -8,10 +8,15 @@ class LocalizedList public static function getList($locale) { - if (!isset(self::$_rawList[$locale])) { - self::$_rawList[$locale] = static::_getList($locale); + if (!isset(static::$_rawList[$locale])) { + static::$_rawList[$locale] = static::_getList($locale); } - return self::$_rawList[$locale]; + return static::$_rawList[$locale]; + } + + protected static function _getListPath() + { + return ''; } /** @@ -20,7 +25,7 @@ class LocalizedList */ protected static function _getList($locale) { - $f = base_path(str_replace('$locale', $locale, self::$_listPath)); + $f = base_path(str_replace('$locale', $locale, static::_getListPath())); if (!file_exists($f) || !is_file($f)) { return []; }