Exemple #1
0
 /**
  * CsvFileReader constructor.
  *
  * @param string|File $filePath CSVファイルのFileインスタンスかファイルパス
  */
 public function __construct($filePath)
 {
     if (is_a($filePath, 'File')) {
         $filePath = $filePath->path;
     }
     $tmp = NetCommonsFile::getTemporaryFileConvertSjisWin2Utf8($filePath);
     $path = $tmp->path;
     parent::__construct($path);
     $this->setFlags(SplFileObject::READ_CSV);
 }
Exemple #2
0
 /**
  * add folder
  *
  * @param string $folderPath zipに追加するフォルダのパス
  *
  * @return void
  * @throws InternalErrorException
  */
 public function addFolder($folderPath)
 {
     $folder = new Folder($folderPath);
     if (!$folder->copy($this->_tmpFolder->path . DS . NetCommonsFile::basename($folder->path))) {
         throw new InternalErrorException('NetCommonsZip File IO Error');
     }
 }