|
12 | 12 |
|
13 | 13 | namespace TYPO3\Tailor\Service;
|
14 | 14 |
|
15 |
| -use FilesystemIterator; |
16 |
| -use RecursiveCallbackFilterIterator; |
17 |
| -use RecursiveDirectoryIterator; |
18 |
| -use RecursiveIteratorIterator; |
19 | 15 | use TYPO3\Tailor\Environment\Variables;
|
20 | 16 | use TYPO3\Tailor\Exception\FormDataProcessingException;
|
21 | 17 | use TYPO3\Tailor\Exception\RequiredConfigurationMissing;
|
@@ -64,14 +60,14 @@ public function createZipArchiveFromPath(string $path): string
|
64 | 60 | throw new FormDataProcessingException('Path is not valid.', 1605562741);
|
65 | 61 | }
|
66 | 62 |
|
67 |
| - $zipArchive = new ZipArchive(); |
68 |
| - $zipArchive->open($this->getVersionFilename(), ZipArchive::CREATE | ZipArchive::OVERWRITE); |
| 63 | + $zipArchive = new \ZipArchive(); |
| 64 | + $zipArchive->open($this->getVersionFilename(), \ZipArchive::CREATE | \ZipArchive::OVERWRITE); |
69 | 65 |
|
70 | 66 | $emConfValid = false;
|
71 | 67 |
|
72 |
| - $iterator = new RecursiveDirectoryIterator($fullPath, FilesystemIterator::SKIP_DOTS); |
73 |
| - $files = new RecursiveIteratorIterator( |
74 |
| - new RecursiveCallbackFilterIterator($iterator, function($current) use ($fullPath) { |
| 68 | + $iterator = new \RecursiveDirectoryIterator($fullPath, \FilesystemIterator::SKIP_DOTS); |
| 69 | + $files = new \RecursiveIteratorIterator( |
| 70 | + new \RecursiveCallbackFilterIterator($iterator, function ($current) use ($fullPath) { |
75 | 71 | // @todo Find a more performant way for filtering
|
76 | 72 |
|
77 | 73 | $filepath = $current->getRealPath();
|
@@ -101,7 +97,7 @@ public function createZipArchiveFromPath(string $path): string
|
101 | 97 |
|
102 | 98 | return true;
|
103 | 99 | }),
|
104 |
| - RecursiveIteratorIterator::LEAVES_ONLY |
| 100 | + \RecursiveIteratorIterator::LEAVES_ONLY |
105 | 101 | );
|
106 | 102 |
|
107 | 103 | foreach ($files as $file) {
|
@@ -157,7 +153,7 @@ public function createZipArchiveFromArtefact(string $filename): string
|
157 | 153 | if (!is_file($filename)) {
|
158 | 154 | throw new FormDataProcessingException('No such file.', 1605562482);
|
159 | 155 | }
|
160 |
| - $zipArchive = new ZipArchive(); |
| 156 | + $zipArchive = new \ZipArchive(); |
161 | 157 | $zipFile = $zipArchive->open($filename);
|
162 | 158 | if (!$zipFile || $zipArchive->numFiles <= 0) {
|
163 | 159 | throw new FormDataProcessingException('No files in given directory.', 1605562663);
|
|
0 commit comments