@@ -79,11 +79,11 @@ discard block |
||
| 79 | 79 | $this->files[$file->Location] = $directory.$file->strd_FileId; |
| 80 | 80 | $this->filesSize += $file->DataLen; |
| 81 | 81 | |
| 82 | - $this->filesData[$directory . $file->strd_FileId] = |
|
| 82 | + $this->filesData[$directory.$file->strd_FileId] = |
|
| 83 | 83 | [ |
| 84 | 84 | 'size' => $file->DataLen, |
| 85 | 85 | 'mtime' => |
| 86 | - strtotime((string)$file->isoRecDate), |
|
| 86 | + strtotime((string) $file->isoRecDate), |
|
| 87 | 87 | ]; |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | return false; |
| 132 | 132 | |
| 133 | 133 | return new ArchiveEntry($fileName, $this->filesData[$fileName]['size'], |
| 134 | - $this->filesData[$fileName]['size'], $this->filesData[$fileName]['mtime'],false); |
|
| 134 | + $this->filesData[$fileName]['size'], $this->filesData[$fileName]['mtime'], false); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | * @return false|int |
| 224 | 224 | * @throws UnsupportedOperationException |
| 225 | 225 | */ |
| 226 | - public static function createArchive(array $files, $archiveFileName){ |
|
| 226 | + public static function createArchive(array $files, $archiveFileName) { |
|
| 227 | 227 | throw new UnsupportedOperationException(); |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | \ No newline at end of file |
@@ -52,8 +52,9 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | /** @var \CVolumeDescriptor $usedDesc */ |
| 54 | 54 | $usedDesc = $this->iso->GetDescriptor(SUPPLEMENTARY_VOLUME_DESC); |
| 55 | - if (!$usedDesc) |
|
| 56 | - $usedDesc = $this->iso->GetDescriptor(PRIMARY_VOLUME_DESC); |
|
| 55 | + if (!$usedDesc) { |
|
| 56 | + $usedDesc = $this->iso->GetDescriptor(PRIMARY_VOLUME_DESC); |
|
| 57 | + } |
|
| 57 | 58 | $this->blockSize = $usedDesc->iBlockSize; |
| 58 | 59 | $directories = $usedDesc->LoadMPathTable($this->iso); |
| 59 | 60 | // iterate over all directories |
@@ -74,8 +75,9 @@ discard block |
||
| 74 | 75 | if ($files) { |
| 75 | 76 | /** @var \CFileDirDescriptors $file */ |
| 76 | 77 | foreach ($files as $file) { |
| 77 | - if (in_array($file->strd_FileId, ['.', '..']) || $file->IsDirectory()) |
|
| 78 | - continue; |
|
| 78 | + if (in_array($file->strd_FileId, ['.', '..']) || $file->IsDirectory()) { |
|
| 79 | + continue; |
|
| 80 | + } |
|
| 79 | 81 | $this->files[$file->Location] = $directory.$file->strd_FileId; |
| 80 | 82 | $this->filesSize += $file->DataLen; |
| 81 | 83 | |
@@ -127,8 +129,9 @@ discard block |
||
| 127 | 129 | */ |
| 128 | 130 | public function getFileData($fileName) |
| 129 | 131 | { |
| 130 | - if (!isset($this->filesData[$fileName])) |
|
| 131 | - return false; |
|
| 132 | + if (!isset($this->filesData[$fileName])) { |
|
| 133 | + return false; |
|
| 134 | + } |
|
| 132 | 135 | |
| 133 | 136 | return new ArchiveEntry($fileName, $this->filesData[$fileName]['size'], |
| 134 | 137 | $this->filesData[$fileName]['size'], $this->filesData[$fileName]['mtime'],false); |
@@ -142,11 +145,14 @@ discard block |
||
| 142 | 145 | public function getFileContent($fileName) |
| 143 | 146 | { |
| 144 | 147 | $Location = array_search($fileName, $this->files, true); |
| 145 | - if (!isset($this->filesData[$fileName])) return false; |
|
| 148 | + if (!isset($this->filesData[$fileName])) { |
|
| 149 | + return false; |
|
| 150 | + } |
|
| 146 | 151 | $data = $this->filesData[$fileName]; |
| 147 | 152 | $Location_Real = $Location * $this->blockSize; |
| 148 | - if ($this->iso->Seek($Location_Real, SEEK_SET) === false) |
|
| 149 | - return false; |
|
| 153 | + if ($this->iso->Seek($Location_Real, SEEK_SET) === false) { |
|
| 154 | + return false; |
|
| 155 | + } |
|
| 150 | 156 | |
| 151 | 157 | return $this->iso->Read($data['size']); |
| 152 | 158 | } |
@@ -159,11 +165,14 @@ discard block |
||
| 159 | 165 | public function getFileResource($fileName) |
| 160 | 166 | { |
| 161 | 167 | $Location = array_search($fileName, $this->files, true); |
| 162 | - if (!isset($this->filesData[$fileName])) return false; |
|
| 168 | + if (!isset($this->filesData[$fileName])) { |
|
| 169 | + return false; |
|
| 170 | + } |
|
| 163 | 171 | $data = $this->filesData[$fileName]; |
| 164 | 172 | $Location_Real = $Location * $this->blockSize; |
| 165 | - if ($this->iso->Seek($Location_Real, SEEK_SET) === false) |
|
| 166 | - return false; |
|
| 173 | + if ($this->iso->Seek($Location_Real, SEEK_SET) === false) { |
|
| 174 | + return false; |
|
| 175 | + } |
|
| 167 | 176 | |
| 168 | 177 | $resource = fopen('php://temp', 'r+'); |
| 169 | 178 | fwrite($resource, $this->iso->Read($data['size'])); |