function Zip::listContents

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Archiver/Zip.php \Drupal\Core\Archiver\Zip::listContents()
  2. 10 core/lib/Drupal/Core/Archiver/Zip.php \Drupal\Core\Archiver\Zip::listContents()
  3. 11.x core/lib/Drupal/Core/Archiver/Zip.php \Drupal\Core\Archiver\Zip::listContents()

Overrides ArchiverInterface::listContents

File

core/lib/Drupal/Core/Archiver/Zip.php, line 71

Class

Zip
Defines an archiver implementation for .zip files.

Namespace

Drupal\Core\Archiver

Code

public function listContents() {
    $files = [];
    for ($i = 0; $i < $this->zip->numFiles; $i++) {
        $files[] = $this->zip
            ->getNameIndex($i);
    }
    return $files;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.