/** * 从文件中加载数据 */ public static function initAllCurrencies() { $cache = new TSVCache('currencies', CUTE_ROOT . '/misc'); $data = $cache->readData() ?: []; foreach ($data as $row) { @(list($code, $title, $num, $dec, $rate) = $row); self::$instances[$code] = new self($code, $rate, $num, $dec); } }
public function execute() { $source = CUTE_ROOT . '/misc/mobile.csv'; $cache = new TSVCache(basename($source, '.csv'), dirname($source)); $data = $cache->initiate()->readData(2); $this->openFiles(CUTE_ROOT . '/misc/phoneloc.dat'); $this->writeData($data); $this->closeFiles(); $this->app->writeln('DONE'); }