예제 #1
0
파일: Currency.php 프로젝트: azhai/CuteLib
 /**
  * 从文件中加载数据
  */
 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);
     }
 }
예제 #2
0
 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');
 }