You are here

public function PHPExcel_Shared_ZipArchive::locateName in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/ZipArchive.php \PHPExcel_Shared_ZipArchive::locateName()

Find if given fileName exist in archive (Emulate ZipArchive locateName())

Parameters

string $fileName Filename for the file in zip archive:

Return value

boolean

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/ZipArchive.php, line 120

Class

PHPExcel_Shared_ZipArchive
PHPExcel_Shared_ZipArchive

Code

public function locateName($fileName) {
  $list = $this->_zip
    ->listContent();
  $listCount = count($list);
  $list_index = -1;
  for ($i = 0; $i < $listCount; ++$i) {
    if (strtolower($list[$i]["filename"]) == strtolower($fileName) || strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {
      $list_index = $i;
      break;
    }
  }
  return $list_index > -1;
}