protected static function getData() { if (self::$data === null) { $config = wa()->getConfig()->getConfigFile('currency'); $config_path = wa()->getConfig()->getPath('config') . '/currency.php'; $cache = new waSystemCache('config/currency' . wa()->getLocale()); if ($config && filemtime($config_path) > $cache->getFilemtime()) { self::$data = array(); } else { self::$data = $cache->get(); } if (!self::$data) { self::$data = array(); $files = waFiles::listdir(dirname(__FILE__) . "/data/"); foreach ($files as $file) { if (preg_match('/^([A-Z]{3})\\.php$/', $file, $matches)) { $currency = $matches[1]; $file = wa()->getConfig()->getPath('system') . "/currency/data/" . $currency . ".php"; if (file_exists($file)) { $info = (include $file); $info['title'] = _ws($info['title']); } else { $info = array('sign' => $currency, 'title' => $currency); } self::$data[$currency] = $info; } } foreach ($config as $cur => $info) { if (!isset(self::$data[$cur])) { self::$data[$cur] = $info; } else { foreach ($info as $k => $v) { self::$data[$cur][$k] = $v; } } } $cache->set(self::$data); } } return self::$data; }