Example #1
0
 /**
  * Read the CSV-files in a language package
  *
  * The files are sorted alphabetically, then each of them is read, and results are recorded into key => value array
  *
  * @param string $vendor
  * @param string $package
  * @return array
  */
 private function readPackCsv($vendor, $package)
 {
     $files = $this->dir->search("{$vendor}/{$package}/*.csv");
     sort($files);
     $result = [];
     foreach ($files as $path) {
         $file = $this->dir->openFile($path);
         while (($row = $file->readCsv()) !== false) {
             $result[$row[0]] = $row[1];
         }
     }
     return $result;
 }