league/flysystem-ziparchive 3.29.0
“ZIP filesystem adapter for Flysystem.”
Calls PHP unlink()PHP reads remaining stream contents
SHA-2560b889fca8b75c82ac526935ff4b741099ca17c7a2d1b38f010e4b8f0944184d0
MaleculeH₂(Db₃F₂)Md₄(NePa₂Pt₂)
Evidence
⋯4 lines
5namespace League\Flysystem\ZipArchive;
6
7use ZipArchive;
8
9class FilesystemZipArchiveProvider implements ZipArchiveProvider
⋯10 lines
20 public function createZipArchive(): ZipArchive
21 {
22 if ($this->parentDirectoryCreated !== true) {
23 $this->parentDirectoryCreated = true;
24 $this->createParentDirectoryForZipArchive($this->filename);
⋯5 lines
30 private function createParentDirectoryForZipArchive(string $fullPath): void
31 {
32 $dirname = dirname($fullPath);
33
34 if (is_dir($dirname) || @mkdir($dirname, $this->localDirectoryPermissions, true)) {
35 return;
36 }
37
38 if ( ! is_dir($dirname)) {
39 throw UnableToCreateParentDirectory::atLocation($fullPath, error_get_last()['message'] ?? '');
40 }
41 }
42
43 private function openZipArchive(): ZipArchive
44 {
45 $archive = new ZipArchive();
46 $success = $archive->open($this->filename, ZipArchive::CREATE);
47
48 if ($success !== true) {
47:20… $flags
48 *
49 * @return bool
50 */
51 public function addFromString($localname, $contents, $flags = 0): bool
52 {
53 if ($this->failNextWrite) {
54 $this->failNextWrite = false;
55
56 …
89:42… ath, $contents, Config $config): void
90 {
91 $contents = stream_get_contents($contents);
92
93 if ($contents === false) {
94 throw UnableToWriteFile::atLocation($path, 'Could not get contents …
97:4… $this->write($path, $contents, $config);
98 }
99
100 public function read(string $path): string
101 {
102 $archive = $this->zipArchiveProvider->createZipArchive();
103 $contents = $archive->getF …
122:32… ile::fromLocation($path, $status);
123 }
124
125 $stream = fopen('php://temp', 'w+b');
126 stream_copy_to_stream($resource, $stream);
127 rewind($stream);
128 fclose($resource);
129
130 …
No evidence locations were recorded for this file. Raw result